{"_id":"@atlascity/vuex-orm-plugin-lokijs","_rev":"2-80e6e0bd591cc5b64a2ff6b5ce366b5c","name":"@atlascity/vuex-orm-plugin-lokijs","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.2":{"name":"@atlascity/vuex-orm-plugin-lokijs","description":"vuex-orm LokiJS persistance plugin.","version":"0.0.2","author":{"name":"James Kirkby","email":"nshcore@protonmail.com"},"bugs":{"url":"https://github.com/atlascity/vuex-orm-plugin-loki/issues"},"dependencies":{"@vuex-orm/core":"^0.27.0","all-contributors-cli":"^4.5.0","crypto-js":"^3.1.9-1","lodash-es":"^4.17.11","lokijs":"^1.5.5","normalizr":"^3.3.0","vuex":"^3.0.1"},"devDependencies":{"@babel/core":"^7.1.0","@babel/plugin-proposal-class-properties":"^7.1.0","@babel/plugin-proposal-decorators":"^7.1.0","@babel/preset-typescript":"^7.1.0","@types/lodash":"^4.14.117","@types/lodash-es":"^4.17.1","@types/lokijs":"^1.5.2","@types/mocha":"^5.2.0","@types/node":"^10.10.3","@types/power-assert":"^1.5.0","@vue/babel-preset-app":"^3.0.1","@vue/test-utils":"^1.0.0-beta.25","babel-eslint":"^9.0.0","babel-loader":"^8.0.2","babel-plugin-istanbul":"^5.0.1","babel-preset-power-assert":"^3.0.0","buble":"^0.19.3","conventional-changelog-cli":"^1.2.0","conventional-github-releaser":"^1.1.3","cross-env":"^5.1.6","eslint":"^5.6.0","eslint-loader":"^2.1.0","eslint-plugin-typescript":"^0.12.0","eslint-plugin-vue-libs":"^2.0.1","fork-ts-checker-webpack-plugin":"^0.4.9","karma":"^3.0.0","karma-chrome-launcher":"^2.2.0","karma-coverage":"^1.1.2","karma-firefox-launcher":"^1.1.0","karma-mocha":"^1.3.0","karma-mocha-reporter":"^2.2.5","karma-safari-launcher":"^1.0.0","karma-sourcemap-loader":"^0.3.7","karma-webpack":"^3.0.5","lint-staged":"^8.1.4","mocha":"^5.2.0","mocha-loader":"^2.0.0","power-assert":"^1.6.0","rollup":"^0.66.0","rollup-plugin-buble":"^0.19.2","rollup-plugin-replace":"^2.0.0","ts-loader":"^5.2.0","typescript":"^3.0.3","typescript-eslint-parser":"^18.0.0","uglify-js":"^2.7.5","vue":"^2.5.17","vue-template-compiler":"^2.5.17","vuepress":"^0.14.0","webpack":"^4.19.1","webpack-cli":"^3.1.1","webpack-dev-server":"^3.1.8","yorkie":"^2.0.0"},"homepage":"https://github.com/atlascity/vuex-orm-plugin-loki","main":"dist/vuex-orm-plugin-loki.common.js","module":"dist/vuex-orm-plugin-loki.esm.js","unpkg":"dist/vuex-orm-plugin-loki.js","types":"types/index.d.ts","keywords":["plugin","vue","vuejs"],"license":"MIT","engines":{"node":">= 8.11","npm":">= 6.4.1"},"repository":{"type":"git","url":"git+ssh://git@github.com/atlascity/vuex-orm-plugin-loki.git"},"scripts":{"build":"npm run build:ts && node config/build.js","build:ts":"tsc -p src","build:ts:watch":"tsc -p src --watch","changelog":"conventional-changelog -i CHANGELOG.md -s -p eslint","release":"conventional-github-releaser -p eslint","clean":"rm -rf coverage && rm -rf lib/*.js* && rm -rf types/*.d.ts* && rm -rf dist/*.js* && rm -rf ./*.log","dev":"cross-env BABEL_ENV=test webpack-dev-server --inline --hot --open --content-base ./test/unit/ --config config/webpack.dev.conf.js","docs:dev":"vuepress dev docs","docs:build":"node config/version.js && vuepress build docs","lint":"eslint --fix --ext .ts src test","test":"npm run lint && npm run test:cover","test:cover":"cross-env BABEL_ENV=test karma start config/karma.cover.conf.js","test:unit":"cross-env BABEL_ENV=test karma start config/karma.unit.conf.js","contributor":"all-contributors add","contributor:gen":"all-contributors generate","security:audit":"npm audit"},"gitHooks":{"pre-commit":"lint-staged && npm run security:audit"},"lint-staged":{"*.js":["eslint --ext .js,.vue src","git add"],"*.vue":["eslint --ext .js,.vue src","git add"]},"directories":{"lib":"lib","test":"test"},"gitHead":"a892ca7b84f8c8ecd75f0aae51a635e4e8743370","_id":"@atlascity/vuex-orm-plugin-lokijs@0.0.2","_npmVersion":"6.4.1","_nodeVersion":"8.15.0","_npmUser":{"name":"nshcore","email":"nshcore@protonmail.com"},"dist":{"integrity":"sha512-cB1EFyVZ1RuiDc20lSgfejx7dEBcVFYByKnZopnxb7zS08x4qny8TPFnYctGNIctTdNajqr8/nG+O9QlxDRdxg==","shasum":"a1d8c736b8007e6aec2c961c4bca5d26d3d2d434","tarball":"https://registry.npmjs.org/@atlascity/vuex-orm-plugin-lokijs/-/vuex-orm-plugin-lokijs-0.0.2.tgz","fileCount":53,"unpackedSize":45279,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZoo7CRA9TVsSAnZWagAA5EYQAIRClDCw0DEatshKThXV\nImyrAZrWYWT1Jmlkbl81bhmPe9Ubo1RmVN3a8mrEWRDnyufKQnbbReCXaB6i\nrKCe9YjfSHvR2ZX/R+gaEEEs3OA/Lsd6Xj8/pUzOtVqXoZ7xJ1yZVGD0MVeT\nkxvdrCRzS9B5leSqrZAgCErUppRXhGQopboymm7butcl318Tfoe3q4D0OLgK\nGO5wZb77/pwogg01sEo/2crjLWITpLxHRi0SBOCZQsRcfU7qM+A+QB0QfZad\ncaMgnFb1m0HMA31gqqTkG/5BdrTv52sC0XYNDUTdT0h+dni6Q2jB2rmGAjdp\n2FybmpH2pmUvOzvSr0vTvx3A3XLMqfLOopqp9O97mD2F3hd4YIlquIkZ6sxH\nQD3wEbLUpTgF25MFDhsAqzzd4pN3DQNKn2GEa9IGuJTwuxO5SX8p539kxxUJ\nc49NuRczZ6wUujC9x3hMz75JauwKdHzdaf/FljYxuNUvgJyDxXdoZszkHzKR\nsFXoo0hB33XrkATLmUoTda0gB/psikc1obRvg2Ks1FNCV5guGNw+CGwK/ku0\nJy4zix2WIJgC+6cURkVO1ojqT/Aa0D0DFuQyrJYNn324vdbSUAkjIiql1McJ\nrYJOPmjAe3zqeDoIzw7yPLGmUjVoeWG3DZ3MTPOZBBWhCnK3yZF9UzdYCKP+\nnYrn\r\n=GjQp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJs6z0oG9jZOtmga+Iv1Ss05VlybT43q2uWwtrY1TiowIhAOw7eYz5b2a9zQcN6Ge7Dl4j1Qf/xlWTEKs19KVZMfSK"}]},"maintainers":[{"name":"nshcore","email":"nshcore@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vuex-orm-plugin-lokijs_0.0.2_1550223930877_0.6240046202111709"},"_hasShrinkwrap":false},"0.0.3":{"name":"@atlascity/vuex-orm-plugin-lokijs","description":"vuex-orm LokiJS persistance plugin.","version":"0.0.3","author":{"name":"James Kirkby","email":"james.kirby@atlascity.io"},"contributors":[{"name":"Konrad Moskal","email":"konrad.moskal@atlascity.io"}],"bugs":{"url":"https://github.com/atlascity/vuex-orm-plugin-lokijs/issues"},"dependencies":{"@vuex-orm/core":"^0.27.0","crypto-js":"^3.1.9-1","lokijs":"^1.5.5","normalizr":"^3.3.0","vuex":"^3.0.1"},"devDependencies":{"@babel/core":"^7.1.0","@babel/plugin-proposal-class-properties":"^7.1.0","@babel/plugin-proposal-decorators":"^7.1.0","@babel/preset-typescript":"^7.1.0","@types/crypto-js":"^3.1.43","@types/lokijs":"^1.5.2","@types/node":"^10.10.3","@vue/babel-preset-app":"^3.0.1","@vue/test-utils":"^1.0.0-beta.25","all-contributors-cli":"^6.1.2","babel-eslint":"^9.0.0","babel-loader":"^8.0.2","babel-plugin-istanbul":"^5.0.1","buble":"^0.19.3","conventional-changelog-cli":"^2.0.12","conventional-github-releaser":"^3.1.2","cross-env":"^5.1.6","eslint":"^5.6.0","eslint-loader":"^2.1.0","eslint-plugin-typescript":"^0.12.0","husky":"^1.3.1","lint-staged":"^8.1.5","snyk":"^1.133.0","ts-loader":"^5.2.0","typescript":"^3.0.3","typescript-eslint-parser":"^18.0.0","uglify-js":"^2.7.5","vue":"^2.6.6"},"homepage":"https://github.com/atlascity/vuex-orm-plugin-lokijs#readme","main":"dist/vuex-orm-plugin-loki.js","types":"types/index.d.ts","keywords":["plugin","vue","vuejs","loki","lokijs","vuex","vuex-orm"],"license":"GPL-2.0-only","engines":{"node":">= 8.11"},"repository":{"type":"git","url":"git+ssh://git@github.com/atlascity/vuex-orm-plugin-lokijs.git"},"scripts":{"build":"npm run build:ts && webpack","build:ts":"tsc -p src","test":"snyk test","contributor":"all-contributors add","contributor:gen":"all-contributors generate","release":"conventional-github-releaser -p eslint","changelog":"conventional-changelog -i CHANGELOG.md -s -p eslint","clean":"rm -rf lib && rm -rf dist && rm -rf types","lint":"eslint --fix --ext .ts src"},"lint-staged":{"*.ts":["git add","eslint --fix"]},"husky":{"hooks":{"pre-commit":"lint-staged"}},"gitHead":"e50d77b9a9416c87efb751827162d4fc470a23f2","_id":"@atlascity/vuex-orm-plugin-lokijs@0.0.3","_npmVersion":"6.4.1","_nodeVersion":"8.15.1","_npmUser":{"name":"nshcore","email":"nshcore@protonmail.com"},"dist":{"integrity":"sha512-axpW7PKGgLZMfePCNT4GqVaoTCKV7mZyLatiofHGJq7sBG3KZRVy67p9HouJplrVTMeJssAoVPPfyp1/jUirIQ==","shasum":"202382ad1f34940c867fea119ec07213db3e072a","tarball":"https://registry.npmjs.org/@atlascity/vuex-orm-plugin-lokijs/-/vuex-orm-plugin-lokijs-0.0.3.tgz","fileCount":39,"unpackedSize":203718,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcnMUZCRA9TVsSAnZWagAAfeMP+QCBotpVAyKfYUjea1At\nS+yHPotVyBS6P2NfnR+920VWAQZyu5GXqKvJ0c1GLv5JE6WcyXy0BBVfBAx6\neIXp/1YgeySGoZ2iV042gXJvDb13o2Ay6O1esk6z7ggv/K5nXaB/qDoj6eKy\n/wc7svySerMh/41jrQAYdA96tomXoow0PXNJ+r/8lAKZTexEsm+AS1ppQ2zm\n67P7Ba3qWLuEgSrMdQm/Y35dgo875HOU5+KKHpFspzX8qGE+5nEMYMEoAbKm\nn2ilOpEi9cmZgrYLyySwAJ+9rbnNItiE3o3EM8bKYLz2CgKKgciYdiw03OQv\n2mVzD3ZQWYazDeNi/Wn8bKTx4At/Vrtvl7uQ6EIE0VAoguQLnyp7QPsXt/HQ\nz84dGwLzr4j5P+KoPWY5TFgJuuirqfcH3FA1ogZxa0/vusBaKbU6B4zTkox2\nkRnx93iSLwI8YMcNn24S2b2+2Hk+kUaF2hZuW4Z1SrFCdmqEcoOTMHmZbNA4\nsLBWGBQOwkXpG6C8kI+u7T9gBrWXslgln8sgUEMEGaqhwrUJs823SUnSh3d6\n4ghJoukWgsqHaFfijYkFicV0hmVzXB1L4EbbYMu6cSastMTFOLJf7nFDjDBO\nKu7a65gLVEYWaCbUtBIlBcGcgaEpiLE2WziUwtGlo+/2BtWXawaFFOItkLuD\n6juB\r\n=o1r/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjrNyqrs5P+QrHZlhrBLaeJsbEH46J0AVr4MnUTlPxtQIgFFwaVxu3/diKdhr8SFs7oJONlVn8XjFRkQrKT0Lf8EE="}]},"maintainers":[{"name":"nshcore","email":"nshcore@protonmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vuex-orm-plugin-lokijs_0.0.3_1553777944972_0.605010189669235"},"_hasShrinkwrap":false}},"time":{"created":"2019-02-15T09:45:30.700Z","0.0.2":"2019-02-15T09:45:31.049Z","modified":"2022-04-04T16:08:40.910Z","0.0.3":"2019-03-28T12:59:05.131Z"},"maintainers":[{"name":"nshcore","email":"nshcore@protonmail.com"}],"description":"vuex-orm LokiJS persistance plugin.","homepage":"https://github.com/atlascity/vuex-orm-plugin-lokijs#readme","keywords":["plugin","vue","vuejs","loki","lokijs","vuex","vuex-orm"],"repository":{"type":"git","url":"git+ssh://git@github.com/atlascity/vuex-orm-plugin-lokijs.git"},"author":{"name":"James Kirkby","email":"james.kirby@atlascity.io"},"bugs":{"url":"https://github.com/atlascity/vuex-orm-plugin-lokijs/issues"},"license":"GPL-2.0-only","readme":"# vuex-orm-plugin-loki\n\n\n[![npm version](https://badge.fury.io/js/%40atlascity%2Fvuex-orm-plugin-lokijs.svg)](https://badge.fury.io/js/%40atlascity%2Fvuex-orm-plugin-lokijs)\n[![vue2](https://img.shields.io/badge/vue-2.x-brightgreen.svg)](https://vuejs.org/)\n\nvuex-orm LokiJS persistance (Local Storage) plugin, with optional AES encryption.\n\n## Installation\n\n`npm install @atlascity/vuex-orm-plugin-lokijs`\n\n## Why & How\n\t* We needed a persistent Local Storage based database.\n\t* VuexORM is a ORM tool for Vuex, this plugin adds the ability to use LokiJS as a persistant store. When you initialize your VuexORM database, the plugin will hydrate VuexORM with data stored in Local Storage (preserving original IDs).\n\n## Caveats\nOnly some of VuexORM model methods are currently implemented. There is no support for VuexORM relationships, you have to manage that yourself. Feel free to contribute!\n\n## Examples\n\n### $all\n\n\n### $insert\n```js\nimport MyModel from './models/MyModel';\nconst data = { name: 'Bob' };\nMyModel.$insert({ data }); // insert data using $insert() instead of regular insert()\n\n// retrieve data using regular VuexORM query()\nconst bob = MyModel.query().where('name', 'Bob').get();\n```\n### $update\n```js\nMyModel.$update({\n  where: record => record.name === 'Bob',\n  data: { name: 'Bobby' },\n});\n```\n\n### $delete\n```js\nconst bobby = MyModel.query().where('name', 'Bobby').get();\nMyModel.$delete(bobby.id);\n```\n\n### $update\n```js\nimport MyModel from './models/MyModel';\n\nMyModel.$update({\n  where: (record) => { return record.id === id; },\n  data: { example: 'data' },\n});\n```\n\n## Usage\n```js\nimport Vue from 'vue';\nimport Vuex from 'vuex';\nimport VuexORM from '@vuex-orm/core';\nimport VuexORMLoki from 'vuex-orm-lokijs';\nimport { Model } from '@vuex-orm/core';\n\n// define your VuexORM model\nclass MyModel extends Model {\n  static entity = 'MyModel';\n  static fields() {\n    return {\n      id: this.increment(),\n      data: this.attr(''),\n    };\n  }\n}\n\nVue.use(Vuex);\nconst database = new VuexORM.Database();\ndatabase.register(MyModel, {});\n\nconst options = {\n  env: 'browser',\n};\n\nfunction hydrationCompletedCallback() {\n  // data from LocalStorage has been fully loaded into VuexORM\n}\n\nVuexORM.use(VuexORMLoki, { database, options, hydrationCompletedCallback });\n\nconst store = new Vuex.Store({\n  plugins: [VuexORM.install(database)],\n});\n\n```\n\n## Encryption\nEncryption currently only works on `$insert()`.\n\n### Setup the model\n```js\nimport { Model } from '@vuex-orm/core';\n\nexport default MyModel extends Model {\n  static entity = 'MyModel';\n  static AES = ['secretProperty1', 'secretProperty2']; // tell the plugin what to encrypt\n\n  static fields() {\n    return {\n      id: this.increment(),\n      name: this.attr(),\n      secretProperty1: this.attr(),\n      secretProperty2: this.attr(),\n    };\n  }\n}\n```\n\n### Insert data with password\n```js\nimport MyModel from './models/MyModel';\nconst data = {\n  name: 'Bob',\n  secretProperty1: 'Very sensitive data',\n  secretProperty2: 'Even more',\n};\n\nconst password = \"your password\";\n\n/*\n * before being put into the database, the data\n * will be encrypted with AES using the password\n */\nMyModel.$insert({ data, password }); // pass the password\n```\n\n### Update data with password\n```js\nimport MyModel from './models/MyModel';\nconst data = {\n  name: 'Bob',\n  secretProperty1: 'Very sensitive data',\n  secretProperty2: 'Even more',\n};\n\nconst password = \"your password\";\n\n/*\n * before being put into the database, the data\n * will be encrypted with AES using the password\n */\nMyModel.$update({ data, password }); // pass the password\n```\n\n### Retrieve data and decrypt\n```js\nimport AES from 'crypto-js/aes';\nimport encUTF8 from 'crypto-js/enc-utf8';\nimport MyModel from './models/MyModel';\n\nfunction decrypt(data, password) {\n  const bytes = AES.decrypt(data, password);\n  return JSON.parse(bytes.toString(encUTF8));\n}\n\nconst bob = MyModel.query().where('name', 'Bob').get();\n\nMyModel.AES.forEach((key) => {\n  bob[key] = decrypt(bob[key], password);\n});\n```\n\n## :scroll: Changelog\nDetails changes for each release are documented in the [CHANGELOG.md](https://github.com/atlascity/vuex-orm-plugin-loki/blob/develop/CHANGELOG.md).\n\n## :exclamation: Issues\nPlease make sure to read the [Issue Reporting Checklist](https://github.com/atlascity/vuex-orm-plugin-loki/blob/develop/CONTRIBUTING.md#issue-reporting-guidelines) before opening an issue. Issues not conforming to the guidelines may be closed immediately.\n\n## :muscle: Contribution\nPlease make sure to read the [Contributing Guide](https://github.com/atlascity/vuex-orm-plugin-loki/blob/develop/CONTRIBUTING.md) before making a pull request.\n\n## Contributors\nHere are the wonderfull soles who contribute to this project\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore -->\n<table><tr><td align=\"center\"><a href=\"https://hub.docker.com/u/jkirkby91\"><img src=\"https://avatars2.githubusercontent.com/u/21375475?v=4\" width=\"100px;\" alt=\"nshCore\"/><br /><sub><b>nshCore</b></sub></a><br /><a href=\"https://github.com/nshCore/community/commits?author=nshCore\" title=\"Code\">💻</a> <a href=\"#example-nshCore\" title=\"Examples\">💡</a> <a href=\"#ideas-nshCore\" title=\"Ideas, Planning, & Feedback\">🤔</a> <a href=\"#infra-nshCore\" title=\"Infrastructure (Hosting, Build-Tools, etc)\">🚇</a> <a href=\"#plugin-nshCore\" title=\"Plugin/utility libraries\">🔌</a></td><td align=\"center\"><a href=\"https://github.com/dufia\"><img src=\"https://avatars1.githubusercontent.com/u/5569649?v=4\" width=\"100px;\" alt=\"Konrad Moskal\"/><br /><sub><b>Konrad Moskal</b></sub></a><br /><a href=\"https://github.com/nshCore/community/commits?author=dufia\" title=\"Code\">💻</a> <a href=\"#ideas-dufia\" title=\"Ideas, Planning, & Feedback\">🤔</a> <a href=\"#review-dufia\" title=\"Reviewed Pull Requests\">👀</a></td></tr></table>\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\n## :copyright: License\n\n[GPL-2.0-only](https://opensource.org/licenses/gpl-2.0.php)","readmeFilename":"README.md","contributors":[{"name":"Konrad Moskal","email":"konrad.moskal@atlascity.io"}]}