├── .babelrc ├── .editorconfig ├── .github ├── contributing.md ├── issue_template.md ├── pull_request_template.md └── stale.yml ├── .gitignore ├── .istanbul.yml ├── .npmignore ├── .travis.yml ├── .vscode ├── launch.json └── settings.json ├── CHANGELOG.md ├── LICENSE ├── README.md ├── dist ├── feathers-localstorage.js ├── feathers-localstorage.js.map └── feathers-localstorage.min.js ├── lib └── index.js ├── package-lock.json ├── package.json ├── test └── index.test.js ├── types ├── index.d.ts ├── index.test.ts ├── tsconfig.json └── tslint.json └── webpack.config.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@babel/preset-env" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.github/contributing.md: -------------------------------------------------------------------------------- 1 | # Contributing to Feathers 2 | 3 | Thank you for contributing to Feathers! :heart: :tada: 4 | 5 | This repo is the main core and where most issues are reported. Feathers embraces modularity and is broken up across many repos. To make this easier to manage we currently use [Zenhub](https://www.zenhub.com/) for issue triage and visibility. They have a free browser plugin you can install so that you can see what is in flight at any time, but of course you also always see current issues in Github. 6 | 7 | ## Report a bug 8 | 9 | Before creating an issue please make sure you have checked out the docs, specifically the [FAQ](https://docs.feathersjs.com/help/faq.html) section. You might want to also try searching Github. It's pretty likely someone has already asked a similar question. 10 | 11 | If you haven't found your answer please feel free to join our [slack channel](http://slack.feathersjs.com), create an issue on Github, or post on [Stackoverflow](http://stackoverflow.com) using the `feathers` or `feathersjs` tag. We try our best to monitor Stackoverflow but you're likely to get more immediate responses in Slack and Github. 12 | 13 | Issues can be reported in the [issue tracker](https://github.com/feathersjs/feathers/issues). Since feathers combines many modules it can be hard for us to assess the root cause without knowing which modules are being used and what your configuration looks like, so **it helps us immensely if you can link to a simple example that reproduces your issue**. 14 | 15 | ## Report a Security Concern 16 | 17 | We take security very seriously at Feathers. We welcome any peer review of our 100% open source code to ensure nobody's Feathers app is ever compromised or hacked. As a web application developer you are responsible for any security breaches. We do our very best to make sure Feathers is as secure as possible by default. 18 | 19 | In order to give the community time to respond and upgrade we strongly urge you report all security issues to us. Send one of the core team members a PM in [Slack](http://slack.feathersjs.com) or email us at hello@feathersjs.com with details and we will respond ASAP. 20 | 21 | For full details refer to our [Security docs](https://docs.feathersjs.com/SECURITY.html). 22 | 23 | ## Pull Requests 24 | 25 | We :heart: pull requests and we're continually working to make it as easy as possible for people to contribute, including a [Plugin Generator](https://github.com/feathersjs/generator-feathers-plugin) and a [common test suite](https://github.com/feathersjs/feathers-service-tests) for database adapters. 26 | 27 | We prefer small pull requests with minimal code changes. The smaller they are the easier they are to review and merge. A core team member will pick up your PR and review it as soon as they can. They may ask for changes or reject your pull request. This is not a reflection of you as an engineer or a person. Please accept feedback graciously as we will also try to be sensitive when providing it. 28 | 29 | Although we generally accept many PRs they can be rejected for many reasons. We will be as transparent as possible but it may simply be that you do not have the same context or information regarding the roadmap that the core team members have. We value the time you take to put together any contributions so we pledge to always be respectful of that time and will try to be as open as possible so that you don't waste it. :smile: 30 | 31 | **All PRs (except documentation) should be accompanied with tests and pass the linting rules.** 32 | 33 | ### Code style 34 | 35 | Before running the tests from the `test/` folder `npm test` will run ESlint. You can check your code changes individually by running `npm run lint`. 36 | 37 | ### ES6 compilation 38 | 39 | Feathers uses [Babel](https://babeljs.io/) to leverage the latest developments of the JavaScript language. All code and samples are currently written in ES2015. To transpile the code in this repository run 40 | 41 | > npm run compile 42 | 43 | __Note:__ `npm test` will run the compilation automatically before the tests. 44 | 45 | ### Tests 46 | 47 | [Mocha](http://mochajs.org/) tests are located in the `test/` folder and can be run using the `npm run mocha` or `npm test` (with ESLint and code coverage) command. 48 | 49 | ### Documentation 50 | 51 | Feathers documentation is contained in Markdown files in the [feathers-docs](https://github.com/feathersjs/feathers-docs) repository. To change the documentation submit a pull request to that repo, referencing any other PR if applicable, and the docs will be updated with the next release. 52 | 53 | ## External Modules 54 | 55 | If you're written something awesome for Feathers, the Feathers ecosystem, or using Feathers please add it to the [showcase](https://docs.feathersjs.com/why/showcase.html). You also might want to check out the [Plugin Generator](https://github.com/feathersjs/generator-feathers-plugin) that can be used to scaffold plugins to be Feathers compliant from the start. 56 | 57 | If you think it would be a good core module then please contact one of the Feathers core team members in [Slack](http://slack.feathersjs.com) and we can discuss whether it belongs in core and how to get it there. :beers: 58 | 59 | ## Contributor Code of Conduct 60 | 61 | As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. 62 | 63 | We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion. 64 | 65 | Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct. 66 | 67 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team. 68 | 69 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers. 70 | 71 | This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/) 72 | -------------------------------------------------------------------------------- /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | ### Steps to reproduce 2 | 3 | (First please check that this issue is not already solved as [described 4 | here](https://github.com/feathersjs/feathers/blob/master/.github/contributing.md#report-a-bug)) 5 | 6 | - [ ] Tell us what broke. The more detailed the better. 7 | - [ ] If you can, please create a simple example that reproduces the issue and link to a gist, jsbin, repo, etc. 8 | 9 | ### Expected behavior 10 | Tell us what should happen 11 | 12 | ### Actual behavior 13 | Tell us what happens instead 14 | 15 | ### System configuration 16 | 17 | Tell us about the applicable parts of your setup. 18 | 19 | **Module versions** (especially the part that's not working): 20 | 21 | **NodeJS version**: 22 | 23 | **Operating System**: 24 | 25 | **Browser Version**: 26 | 27 | **React Native Version**: 28 | 29 | **Module Loader**: -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ### Summary 2 | 3 | (If you have not already please refer to the contributing guideline as [described 4 | here](https://github.com/feathersjs/feathers/blob/master/.github/contributing.md#pull-requests)) 5 | 6 | - [ ] Tell us about the problem your pull request is solving. 7 | - [ ] Are there any open issues that are related to this? 8 | - [ ] Is this PR dependent on PRs in other repos? 9 | 10 | If so, please mention them to keep the conversations linked together. 11 | 12 | ### Other Information 13 | 14 | If there's anything else that's important and relevant to your pull 15 | request, mention that information here. This could include 16 | benchmarks, or other information. 17 | 18 | Your PR will be reviewed by a core team member and they will work with you to get your changes merged in a timely manner. If merged your PR will automatically be added to the changelog in the next release. 19 | 20 | If your changes involve documentation updates please mention that and link the appropriate PR in [feathers-docs](https://github.com/feathersjs/feathers-docs). 21 | 22 | Thanks for contributing to Feathers! :heart: -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 84 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 7 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - greenkeeper 8 | - bug 9 | - security 10 | - enhancement 11 | # Label to use when marking an issue as stale 12 | staleLabel: wontfix 13 | # Comment to post when marking an issue as stale. Set to `false` to disable 14 | markComment: > 15 | This issue has been automatically marked as stale because it has not had 16 | recent activity. It will be closed if no further activity occurs. 17 | Apologies if the issue could not be resolved. FeathersJS ecosystem 18 | modules are community maintained so there may be a chance that there isn't anybody 19 | available to address the issue at the moment. 20 | For other ways to get help [see here](https://docs.feathersjs.com/help/readme.html). 21 | # Comment to post when closing a stale issue. Set to `false` to disable 22 | closeComment: false 23 | # Only close stale issues 24 | only: issues 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | # Logs 4 | logs 5 | *.log 6 | 7 | # Runtime data 8 | pids 9 | *.pid 10 | *.seed 11 | 12 | # Directory for instrumented libs generated by jscoverage/JSCover 13 | lib-cov 14 | 15 | # Coverage directory used by tools like istanbul 16 | coverage 17 | 18 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 19 | .grunt 20 | 21 | # Compiled binary addons (http://nodejs.org/api/addons.html) 22 | build/Release 23 | 24 | # Dependency directory 25 | # Commenting this out is preferred by some people, see 26 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- 27 | node_modules 28 | 29 | # Users Environment Variables 30 | .lock-wscript 31 | 32 | dist 33 | -------------------------------------------------------------------------------- /.istanbul.yml: -------------------------------------------------------------------------------- 1 | verbose: false 2 | instrumentation: 3 | root: ./lib/ 4 | include-all-sources: true 5 | reporting: 6 | print: summary 7 | reports: 8 | - html 9 | - text 10 | - lcov 11 | watermarks: 12 | statements: [50, 80] 13 | lines: [50, 80] 14 | functions: [50, 80] 15 | branches: [50, 80] 16 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .editorconfig 2 | .jshintrc 3 | .travis.yml 4 | .istanbul.yml 5 | .babelrc 6 | .idea/ 7 | .vscode/ 8 | test/ 9 | coverage/ 10 | .github/ 11 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - node 4 | - '8' 5 | sudo: false 6 | install: npm install 7 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "args": [ 9 | "--timeout", 10 | "999999", 11 | "--colors", 12 | "${workspaceFolder}/test" 13 | ], 14 | "internalConsoleOptions": "openOnSessionStart", 15 | "name": "Server Mocha Tests", 16 | "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", 17 | "request": "launch", 18 | "skipFiles": [ 19 | "/**" 20 | ], 21 | "type": "node" 22 | }, 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "print.colourScheme": "Atelier Dune" 3 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## [v6.0.0-pre.1](https://github.com/feathersjs-ecosystem/feathers-localstorage/tree/v6.0.0-pre.1) (2022-06-21) 4 | [Full Changelog](https://github.com/feathersjs-ecosystem/feathers-localstorage/compare/v5.1.0...v6.0.0-pre.1) 5 | 6 | *** Breaking Change *** 7 | 8 | Updated the adapter to adhere to the new Dove principles. _This will not work with earlier versions of Feathers_ 9 | 10 | ## [v5.1.1](https://github.com/feathersjs-ecosystem/feathers-localstorage/tree/v5.1.1) (2020-03-27) 11 | 12 | [Full Changelog](https://github.com/feathersjs-ecosystem/feathers-localstorage/compare/v5.1.0...v5.1.1) 13 | 14 | **Closed issues:** 15 | 16 | - TypeScript definitions not referenced in package.json [\#105](https://github.com/feathersjs-ecosystem/feathers-localstorage/issues/105) 17 | - An in-range update of @feathersjs/adapter-commons is breaking the build 🚨 [\#102](https://github.com/feathersjs-ecosystem/feathers-localstorage/issues/102) 18 | - An in-range update of @feathersjs/adapter-commons is breaking the build 🚨 [\#97](https://github.com/feathersjs-ecosystem/feathers-localstorage/issues/97) 19 | 20 | **Merged pull requests:** 21 | 22 | - Reference type definitions in package.json \(\#105\) [\#106](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/106) ([C0Nd3Mnd](https://github.com/C0Nd3Mnd)) 23 | - Update dtslint to the latest version 🚀 [\#104](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/104) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) 24 | - Update all dependencies and Types version [\#103](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/103) ([daffl](https://github.com/daffl)) 25 | - Update dtslint to the latest version 🚀 [\#101](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/101) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) 26 | - update dtslint to version 1.0.2 [\#100](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/100) ([daffl](https://github.com/daffl)) 27 | - Greenkeeper/@feathersjs/adapter commons 4.3.8 [\#98](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/98) ([daffl](https://github.com/daffl)) 28 | 29 | ## [v5.1.0](https://github.com/feathersjs-ecosystem/feathers-localstorage/tree/v5.1.0) (2019-10-07) 30 | 31 | [Full Changelog](https://github.com/feathersjs-ecosystem/feathers-localstorage/compare/v5.0.0...v5.1.0) 32 | 33 | **Closed issues:** 34 | 35 | - An in-range update of browserify is breaking the build 🚨 [\#93](https://github.com/feathersjs-ecosystem/feathers-localstorage/issues/93) 36 | - An in-range update of dtslint is breaking the build 🚨 [\#92](https://github.com/feathersjs-ecosystem/feathers-localstorage/issues/92) 37 | - An in-range update of webpack is breaking the build 🚨 [\#89](https://github.com/feathersjs-ecosystem/feathers-localstorage/issues/89) 38 | 39 | **Merged pull requests:** 40 | 41 | - Update all dependencies [\#96](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/96) ([daffl](https://github.com/daffl)) 42 | - Update semistandard to the latest version 🚀 [\#95](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/95) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) 43 | - Fixed README example: [\#94](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/94) ([robertreppel](https://github.com/robertreppel)) 44 | - Update dtslint to the latest version 🚀 [\#91](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/91) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) 45 | - Greenkeeper/webpack 4.36.1 [\#90](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/90) ([daffl](https://github.com/daffl)) 46 | 47 | ## [v5.0.0](https://github.com/feathersjs-ecosystem/feathers-localstorage/tree/v5.0.0) (2019-07-05) 48 | 49 | [Full Changelog](https://github.com/feathersjs-ecosystem/feathers-localstorage/compare/v4.0.0...v5.0.0) 50 | 51 | **Merged pull requests:** 52 | 53 | - Add TypeScript definitions and upgrade tests to Feathers 4 [\#87](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/87) ([daffl](https://github.com/daffl)) 54 | - Update mocha to the latest version 🚀 [\#84](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/84) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) 55 | - Update adapter-tests [\#83](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/83) ([daffl](https://github.com/daffl)) 56 | - Update @feathersjs/adapter-commons to the latest version 🚀 [\#82](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/82) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) 57 | 58 | ## [v4.0.0](https://github.com/feathersjs-ecosystem/feathers-localstorage/tree/v4.0.0) (2018-12-17) 59 | 60 | [Full Changelog](https://github.com/feathersjs-ecosystem/feathers-localstorage/compare/v3.0.0...v4.0.0) 61 | 62 | **Closed issues:** 63 | 64 | - An in-range update of @feathersjs/socketio is breaking the build 🚨 [\#79](https://github.com/feathersjs-ecosystem/feathers-localstorage/issues/79) 65 | 66 | **Merged pull requests:** 67 | 68 | - Update feathers-memory to the latest version 🚀 [\#81](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/81) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) 69 | 70 | ## [v3.0.0](https://github.com/feathersjs-ecosystem/feathers-localstorage/tree/v3.0.0) (2018-09-21) 71 | 72 | [Full Changelog](https://github.com/feathersjs-ecosystem/feathers-localstorage/compare/v2.0.2...v3.0.0) 73 | 74 | **Fixed bugs:** 75 | 76 | - Values of Services are Being Mixed [\#68](https://github.com/feathersjs-ecosystem/feathers-localstorage/issues/68) 77 | 78 | **Closed issues:** 79 | 80 | - An in-range update of debug is breaking the build 🚨 [\#73](https://github.com/feathersjs-ecosystem/feathers-localstorage/issues/73) 81 | 82 | **Merged pull requests:** 83 | 84 | - Prevent reusing names [\#77](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/77) ([j2L4e](https://github.com/j2L4e)) 85 | - Fix throttling. [\#76](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/76) ([j2L4e](https://github.com/j2L4e)) 86 | - Update all dependencies [\#75](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/75) ([daffl](https://github.com/daffl)) 87 | - Update babel-loader to the latest version 🚀 [\#71](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/71) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) 88 | - Update shx to the latest version 🚀 [\#70](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/70) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) 89 | - Update webpack-cli to the latest version 🚀 [\#69](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/69) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) 90 | 91 | ## [v2.0.2](https://github.com/feathersjs-ecosystem/feathers-localstorage/tree/v2.0.2) (2018-04-13) 92 | 93 | [Full Changelog](https://github.com/feathersjs-ecosystem/feathers-localstorage/compare/v2.0.1...v2.0.2) 94 | 95 | **Closed issues:** 96 | 97 | - Use with create-react-app [\#66](https://github.com/feathersjs-ecosystem/feathers-localstorage/issues/66) 98 | 99 | **Merged pull requests:** 100 | 101 | - Transpile all Feathers modules for distributable [\#67](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/67) ([daffl](https://github.com/daffl)) 102 | 103 | ## [v2.0.1](https://github.com/feathersjs-ecosystem/feathers-localstorage/tree/v2.0.1) (2018-03-07) 104 | 105 | [Full Changelog](https://github.com/feathersjs-ecosystem/feathers-localstorage/compare/v2.0.0...v2.0.1) 106 | 107 | **Closed issues:** 108 | 109 | - webpack warning on lazy-cache [\#60](https://github.com/feathersjs-ecosystem/feathers-localstorage/issues/60) 110 | 111 | **Merged pull requests:** 112 | 113 | - Update webpack to the latest version 🚀 [\#65](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/65) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) 114 | - Update browserify to the latest version 🚀 [\#64](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/64) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) 115 | - Update mocha to the latest version 🚀 [\#63](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/63) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) 116 | - Update browserify to the latest version 🚀 [\#62](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/62) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) 117 | - Update semistandard to the latest version 🚀 [\#61](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/61) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) 118 | 119 | ## [v2.0.0](https://github.com/feathersjs-ecosystem/feathers-localstorage/tree/v2.0.0) (2017-12-03) 120 | 121 | [Full Changelog](https://github.com/feathersjs-ecosystem/feathers-localstorage/compare/v1.1.0...v2.0.0) 122 | 123 | **Merged pull requests:** 124 | 125 | - Add client build [\#59](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/59) ([daffl](https://github.com/daffl)) 126 | - Upgrade to Feathers Buzzard \(v3\) [\#58](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/58) ([daffl](https://github.com/daffl)) 127 | - Update to new plugin infrastructure [\#57](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/57) ([daffl](https://github.com/daffl)) 128 | - Update nsp to the latest version 🚀 [\#55](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/55) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) 129 | - Update dependencies to enable Greenkeeper 🌴 [\#54](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/54) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) 130 | - Update mocha to the latest version 🚀 [\#52](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/52) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) 131 | 132 | ## [v1.1.0](https://github.com/feathersjs-ecosystem/feathers-localstorage/tree/v1.1.0) (2017-09-23) 133 | 134 | [Full Changelog](https://github.com/feathersjs-ecosystem/feathers-localstorage/compare/v1.0.1...v1.1.0) 135 | 136 | **Merged pull requests:** 137 | 138 | - Use latest feathers-memory [\#51](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/51) ([daffl](https://github.com/daffl)) 139 | 140 | ## [v1.0.1](https://github.com/feathersjs-ecosystem/feathers-localstorage/tree/v1.0.1) (2017-09-06) 141 | 142 | [Full Changelog](https://github.com/feathersjs-ecosystem/feathers-localstorage/compare/v1.0.0...v1.0.1) 143 | 144 | **Closed issues:** 145 | 146 | - An in-range update of babel-core is breaking the build 🚨 [\#49](https://github.com/feathersjs-ecosystem/feathers-localstorage/issues/49) 147 | 148 | **Merged pull requests:** 149 | 150 | - Always use uId [\#50](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/50) ([daffl](https://github.com/daffl)) 151 | - Update debug to the latest version 🚀 [\#48](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/48) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) 152 | - Update feathers-socketio to the latest version 🚀 [\#47](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/47) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) 153 | - Update feathers-service-tests to the latest version 🚀 [\#46](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/46) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) 154 | - Update semistandard to the latest version 🚀 [\#45](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/45) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) 155 | - Update dependencies to enable Greenkeeper 🌴 [\#44](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/44) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) 156 | - Update browserify to version 14.1.0 🚀 [\#40](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/40) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) 157 | - body-parser@1.16.1 breaks build 🚨 [\#39](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/39) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) 158 | - feathers-service-tests@0.9.1 breaks build 🚨 [\#34](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/34) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) 159 | 160 | ## [v1.0.0](https://github.com/feathersjs-ecosystem/feathers-localstorage/tree/v1.0.0) (2016-11-11) 161 | 162 | [Full Changelog](https://github.com/feathersjs-ecosystem/feathers-localstorage/compare/v0.5.0...v1.0.0) 163 | 164 | **Closed issues:** 165 | 166 | - improve performance by not to save/load the whole data everytime [\#31](https://github.com/feathersjs-ecosystem/feathers-localstorage/issues/31) 167 | 168 | **Merged pull requests:** 169 | 170 | - Update feathers-service-tests to version 0.9.0 🚀 [\#32](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/32) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) 171 | - Update and remove Node \< 4 [\#30](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/30) ([daffl](https://github.com/daffl)) 172 | - babel-core@6.18.1 breaks build 🚨 [\#27](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/27) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) 173 | - babel-preset-es2015@6.18.0 breaks build 🚨 [\#26](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/26) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) 174 | - jshint —\> semistandard [\#23](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/23) ([corymsmith](https://github.com/corymsmith)) 175 | - Update feathers-service-tests to version 0.8.0 🚀 [\#20](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/20) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) 176 | 177 | ## [v0.5.0](https://github.com/feathersjs-ecosystem/feathers-localstorage/tree/v0.5.0) (2016-09-09) 178 | 179 | [Full Changelog](https://github.com/feathersjs-ecosystem/feathers-localstorage/compare/v0.4.1...v0.5.0) 180 | 181 | **Closed issues:** 182 | 183 | - usage with feathersjs authentication module on react-native [\#16](https://github.com/feathersjs-ecosystem/feathers-localstorage/issues/16) 184 | - React native exaple for AsyncStorage with create, get, update, remove [\#14](https://github.com/feathersjs-ecosystem/feathers-localstorage/issues/14) 185 | 186 | **Merged pull requests:** 187 | 188 | - Update feathers-memory to version 0.8.0 🚀 [\#18](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/18) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) 189 | - Update service tests, id and events option [\#17](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/17) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) 190 | - Update mocha to version 3.0.0 🚀 [\#15](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/15) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) 191 | 192 | ## [v0.4.1](https://github.com/feathersjs-ecosystem/feathers-localstorage/tree/v0.4.1) (2016-06-17) 193 | 194 | [Full Changelog](https://github.com/feathersjs-ecosystem/feathers-localstorage/compare/v0.4.0...v0.4.1) 195 | 196 | **Merged pull requests:** 197 | 198 | - Update feathers-service-tests to version 0.6.0 🚀 [\#13](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/13) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) 199 | - Update babel-plugin-add-module-exports to version 0.2.0 🚀 [\#12](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/12) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) 200 | 201 | ## [v0.4.0](https://github.com/feathersjs-ecosystem/feathers-localstorage/tree/v0.4.0) (2016-04-05) 202 | 203 | [Full Changelog](https://github.com/feathersjs-ecosystem/feathers-localstorage/compare/v0.3.2...v0.4.0) 204 | 205 | **Merged pull requests:** 206 | 207 | - Update to latest feathers-memory and remove dist [\#11](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/11) ([daffl](https://github.com/daffl)) 208 | 209 | ## [v0.3.2](https://github.com/feathersjs-ecosystem/feathers-localstorage/tree/v0.3.2) (2016-04-05) 210 | 211 | [Full Changelog](https://github.com/feathersjs-ecosystem/feathers-localstorage/compare/v0.3.1...v0.3.2) 212 | 213 | **Merged pull requests:** 214 | 215 | - Update feathers-memory to version 0.7.0 🚀 [\#10](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/10) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) 216 | 217 | ## [v0.3.1](https://github.com/feathersjs-ecosystem/feathers-localstorage/tree/v0.3.1) (2016-03-27) 218 | 219 | [Full Changelog](https://github.com/feathersjs-ecosystem/feathers-localstorage/compare/v0.3.0...v0.3.1) 220 | 221 | **Closed issues:** 222 | 223 | - Cannot use 'in' operator to search for 'settings' in null [\#8](https://github.com/feathersjs-ecosystem/feathers-localstorage/issues/8) 224 | 225 | **Merged pull requests:** 226 | 227 | - This is a fix for there not being a .get handler [\#9](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/9) ([jack-guy](https://github.com/jack-guy)) 228 | 229 | ## [v0.3.0](https://github.com/feathersjs-ecosystem/feathers-localstorage/tree/v0.3.0) (2016-03-14) 230 | 231 | [Full Changelog](https://github.com/feathersjs-ecosystem/feathers-localstorage/compare/v0.2.1...v0.3.0) 232 | 233 | **Closed issues:** 234 | 235 | - Add common tests back in [\#6](https://github.com/feathersjs-ecosystem/feathers-localstorage/issues/6) 236 | 237 | **Merged pull requests:** 238 | 239 | - Make behaviour the same as normal database services again [\#7](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/7) ([daffl](https://github.com/daffl)) 240 | 241 | ## [v0.2.1](https://github.com/feathersjs-ecosystem/feathers-localstorage/tree/v0.2.1) (2016-02-28) 242 | 243 | [Full Changelog](https://github.com/feathersjs-ecosystem/feathers-localstorage/compare/v0.2.0...v0.2.1) 244 | 245 | **Fixed bugs:** 246 | 247 | - Using without explicitly passing a storage engine is throwing an error with Webpack/Browserify [\#3](https://github.com/feathersjs-ecosystem/feathers-localstorage/issues/3) 248 | 249 | **Closed issues:** 250 | 251 | - Get with a non-existent id should not throw an error [\#5](https://github.com/feathersjs-ecosystem/feathers-localstorage/issues/5) 252 | 253 | **Merged pull requests:** 254 | 255 | - throw an error if storage is not passed in explicitly. Closes \#3. [\#4](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/4) ([ekryski](https://github.com/ekryski)) 256 | 257 | ## [v0.2.0](https://github.com/feathersjs-ecosystem/feathers-localstorage/tree/v0.2.0) (2016-02-27) 258 | 259 | [Full Changelog](https://github.com/feathersjs-ecosystem/feathers-localstorage/compare/v0.1.1...v0.2.0) 260 | 261 | **Merged pull requests:** 262 | 263 | - Bug fix [\#2](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/2) ([ekryski](https://github.com/ekryski)) 264 | 265 | ## [v0.1.1](https://github.com/feathersjs-ecosystem/feathers-localstorage/tree/v0.1.1) (2016-02-25) 266 | 267 | [Full Changelog](https://github.com/feathersjs-ecosystem/feathers-localstorage/compare/v0.1.0...v0.1.1) 268 | 269 | ## [v0.1.0](https://github.com/feathersjs-ecosystem/feathers-localstorage/tree/v0.1.0) (2016-02-25) 270 | 271 | [Full Changelog](https://github.com/feathersjs-ecosystem/feathers-localstorage/compare/ef187de4aa9f8f89e71c41b3a542053b36f03b86...v0.1.0) 272 | 273 | **Merged pull requests:** 274 | 275 | - Localstorage working [\#1](https://github.com/feathersjs-ecosystem/feathers-localstorage/pull/1) ([ekryski](https://github.com/ekryski)) 276 | 277 | 278 | 279 | \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* 280 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Feathers 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # feathers-localstorage 2 | 3 | [![Greenkeeper badge](https://badges.greenkeeper.io/feathersjs-ecosystem/feathers-localstorage.svg)](https://greenkeeper.io/) 4 | 5 | [![Build Status](https://travis-ci.org/feathersjs-ecosystem/feathers-localstorage.png?branch=master)](https://travis-ci.org/feathersjs-ecosystem/feathers-localstorage) 6 | [![Dependency Status](https://img.shields.io/david/feathersjs-ecosystem/feathers-localstorage.svg?style=flat-square)](https://david-dm.org/feathersjs-ecosystem/feathers-localstorage) 7 | [![Download Status](https://img.shields.io/npm/dm/feathers-localstorage.svg?style=flat-square)](https://www.npmjs.com/package/feathers-localstorage) 8 | 9 | [feathers-localstorage](https://github.com/feathersjs-ecosystem/feathers-localstorage/) is a database service adapter that extends [feathers-memory](./memory.md) and stores data in [localStorage](https://developer.mozilla.org/en/docs/Web/API/Window/localStorage) in the browser or [AsyncStorage](https://facebook.github.io/react-native/docs/asyncstorage.html) in React Native. 10 | 11 | ```bash 12 | $ npm install --save feathers-localstorage 13 | ``` 14 | 15 | > __Important:__ This branch only works for FeathersJS Dove (v5). Please choose a non-pre release for other versions of FeathersJS. 16 | 17 | > __Important:__ `feathers-localstorage` implements the [Feathers Common database adapter API](https://docs.feathersjs.com/api/databases/common.html) and [querying syntax](https://docs.feathersjs.com/api/databases/querying.html). 18 | 19 | 20 | ## API 21 | 22 | ### `service(options)` 23 | 24 | Returns a new service instance initialized with the given options. 25 | 26 | ```js 27 | const service = require('feathers-localstorage'); 28 | 29 | app.use('/messages', service({ 30 | storage: window.localStorage || AsyncStorage 31 | })); 32 | app.use('/messages', service({ storage, id, startId, name, store, paginate })); 33 | ``` 34 | 35 | __Options:__ 36 | 37 | - `storage` (**required**) - The local storage engine. You can pass in the browsers `window.localStorage`, React Native's `AsyncStorage` or a NodeJS localstorage module. 38 | - `throttle` (*optional*, default `200`) - The minimum time (ms) before in-memory data is written to `storage`. Data is only written if changed since last write. 39 | - `id` (*optional*, default: `'id'`) - The name of the id field property. 40 | - `startId` (*optional*, default: `0`) - An id number to start with that will be incremented for new record. 41 | - `name` (*optional*, default: `'feathers'`) - The key to store data under in local or async storage. 42 | - `store` (*optional*) - An object with id to item assignments to pre-initialize the data store. 43 | - `events` (*optional*) - A list of [custom service events](https://docs.feathersjs.com/api/events.html#custom-events) sent by this service. 44 | - `paginate` (*optional*) - A [pagination object](https://docs.feathersjs.com/api/databases/common.html#pagination) containing a `default` and `max` page size. 45 | - `whitelist` (*optional*) - A list of additional query parameters to allow. 46 | - `multi` (*optional*) - Allow `create` with arrays and `update` and `remove` with `id` `null` to change multiple items. Can be `true` for all methods or an array of allowed methods (e.g. `[ 'remove', 'create' ]`). 47 | - `reuseKeys` (*optional*, default: `false`) Allow duplicate keys i.e. last definition wins. Mostly useful for demonstration and testing purposes. 48 | 49 | ## Example 50 | 51 | See the [clients](https://docs.feathersjs.com/api/client.html) chapter for more information about using Feathers in the browser and React Native. 52 | 53 | ### Browser 54 | 55 | ```html 56 | 57 | 58 | 74 | ``` 75 | 76 | ### React Native 77 | 78 | ```bash 79 | $ npm install @feathersjs/feathers feathers-localstorage --save 80 | ``` 81 | 82 | ```js 83 | import React from 'react-native'; 84 | import feathers from '@feathersjs/feathers'; 85 | import localstorage from 'feathers-localstorage'; 86 | 87 | const { AsyncStorage } = React; 88 | 89 | const app = feathers() 90 | .use('/messages', localstorage({ storage: AsyncStorage })); 91 | 92 | const messages = app.service('messages'); 93 | 94 | messages.on('created', function(message) { 95 | console.log('Someone created a message', message); 96 | }); 97 | 98 | messages.create({ 99 | text: 'Message from React Native' 100 | }); 101 | ``` 102 | 103 | ## License 104 | 105 | Copyright (c) 2017 106 | 107 | Licensed under the [MIT license](LICENSE). 108 | -------------------------------------------------------------------------------- /dist/feathers-localstorage.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"feathers-localstorage.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C,CAAC;AACD,O;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACVA,eAA0BA,mBAAO,CAAC,0EAAD,CAAjC;AAAA,IAAQC,aAAR,YAAQA,aAAR;;AAEA,IAAMC,QAAQ,GAAG,EAAjB;;IAEMC;;;;;EACJ,wBAA2B;IAAA;;IAAA,IAAdC,OAAc,uEAAJ,EAAI;;IAAA;;IACzB,0BAAMA,OAAN;IACA,MAAKC,WAAL,GAAmBD,OAAO,CAACE,IAAR,IAAgB,UAAnC;IACA,MAAKC,QAAL,GAAgBH,OAAO,CAACI,OAAR,IAAoB,OAAOC,MAAP,KAAkB,WAAlB,IAAiCA,MAAM,CAACC,YAA5E;IACA,MAAKC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UACA","sources":["webpack://feathers.localstorage/webpack/universalModuleDefinition","webpack://feathers.localstorage/./lib/index.js","webpack://feathers.localstorage/../src/index.ts","webpack://feathers.localstorage/../src/query.ts","webpack://feathers.localstorage/../src/service.ts","webpack://feathers.localstorage/../src/sort.ts","webpack://feathers.localstorage/../src/debug.ts","webpack://feathers.localstorage/../node_modules/tslib/tslib.es6.js","webpack://feathers.localstorage/../src/utils.ts","webpack://feathers.localstorage/../src/core.ts","webpack://feathers.localstorage/../src/operations.ts","webpack://feathers.localstorage/webpack/bootstrap","webpack://feathers.localstorage/webpack/runtime/define property getters","webpack://feathers.localstorage/webpack/runtime/hasOwnProperty shorthand","webpack://feathers.localstorage/webpack/runtime/make namespace object","webpack://feathers.localstorage/webpack/before-startup","webpack://feathers.localstorage/webpack/startup","webpack://feathers.localstorage/webpack/after-startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"feathers\"] = factory();\n\telse\n\t\troot[\"feathers\"] = root[\"feathers\"] || {}, root[\"feathers\"][\"localstorage\"] = factory();\n})(self, function() {\nreturn ","const { MemoryService } = require('@feathersjs/memory');\n\nconst usedKeys = [];\n\nclass LocalStorage extends MemoryService {\n constructor (options = {}) {\n super(options);\n this._storageKey = options.name || 'feathers';\n this._storage = options.storage || (typeof window !== 'undefined' && window.localStorage);\n this._throttle = options.throttle || 200;\n this._reuseKeys = options.reuseKeys || false;\n this.store = null;\n\n if (!this._storage) {\n throw new Error('The `storage` option needs to be provided');\n }\n\n if (usedKeys.indexOf(this._storageKey) === -1) {\n usedKeys.push(this._storageKey);\n } else {\n if (!this._reuseKeys) {\n throw new Error(`The storage name '${this._storageKey}' is already in use by another instance.`);\n }\n }\n\n this.ready();\n }\n\n ready () {\n if (!this.store) {\n return Promise.resolve(this._storage.getItem(this._storageKey))\n .then(str => JSON.parse(str || '{}'))\n .then(store => {\n const keys = Object.keys(store);\n const last = store[keys[keys.length - 1]];\n\n // Current id is the id of the last item\n this._uId = (keys.length && typeof last[this.id] !== 'undefined') ? last[this.id] + 1 : this._uId;\n\n return (this.store = store);\n });\n }\n\n return Promise.resolve(this.store);\n }\n\n flush (data) {\n if (!this._timeout) {\n this._timeout = setTimeout(() => {\n this._storage.setItem(this._storageKey, JSON.stringify(this.store));\n delete this._timeout;\n }, this._throttle);\n }\n\n return data;\n }\n\n execute (method, ...args) {\n return this.ready()\n .then(() => super[method](...args));\n }\n\n $find (...args) {\n return this.execute('$find', ...args);\n }\n\n $get (...args) {\n return this.execute('$get', ...args);\n }\n\n $create (...args) {\n return this.execute('$create', ...args)\n .then(data => this.flush(data));\n }\n\n $patch (...args) {\n return this.execute('$patch', ...args)\n .then(data => this.flush(data));\n }\n\n $update (...args) {\n return this.execute('$update', ...args)\n .then(data => this.flush(data));\n }\n\n $remove (...args) {\n return this.execute('$remove', ...args)\n .then(data => this.flush(data));\n }\n}\n\nmodule.exports = function init (options) {\n return new LocalStorage(options);\n};\n\nmodule.exports.Service = MemoryService;\n",null,null,null,null,null,"/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n to[j] = from[i];\r\n return to;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n",null,null,null,"// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./lib/index.js\");\n",""],"names":["require","MemoryService","usedKeys","LocalStorage","options","_storageKey","name","_storage","storage","window","localStorage","_throttle","throttle","_reuseKeys","reuseKeys","store","Error","indexOf","push","ready","Promise","resolve","getItem","then","str","JSON","parse","keys","Object","last","length","_uId","id","data","_timeout","setTimeout","setItem","stringify","method","args","execute","flush","module","exports","init","Service","__exportStar","enumerable","get","select","params","queryFields","query","_a","$select","result","otherFields","resultFields","concat","convert","pick","Array","isArray","map","value","parseInt","isPlainObject","commons_1","isObject","constructor","validateQueryProperty","operators","key","startsWith","includes","errors_1","getFilters","settings","filterNames","filters","reduce","current","queryValue","filter","undefined","getQuery","getOwnPropertySymbols","$skip","$sort","sort","$limit","_limit","paginate","limit","default","max","base","lower","isNaN","upper","Number","MAX_VALUE","Math","min","$or","or","filterQuery","_query","alwaysMulti","find","update","AdapterBase","events","multi","always","getOptions","adapter","_params","sanitizeQuery","$find","$get","allowsMulti","all","sanitizeData","payload","$create","$update","$patch","$remove","compareNSB","a","b","compareArrays","i","l","comparison","compare","compareStrings","Date","getTime","aKeys","bKeys","sorter","path","compares","direction","split","comparasion","debuggers","noopDebug","defaultInitializer","setDebug","debug","forEach","createDebug","stripSlashes","replace","each","obj","callback","some","val","every","values","isMatch","item","isEmpty","isObjectOrArray","extend","first","rest","assign","omit","source","merge","target","isPromise","createSymbol","Symbol","FeathersError","err","code","className","_data","msg","properties","type","message","errors","BadRequest","NotAuthenticated","PaymentError","Forbidden","NotFound","MethodNotAllowed","NotAcceptable","Timeout","Conflict","Gone","LengthRequired","Unprocessable","TooManyRequests","GeneralError","NotImplemented","BadGateway","Unavailable","error","_select","MemoryAdapter","matcher","sift_1","adapter_commons_1","startId","total","slice","skip","oldEntry","oldId","patchEntry","entry","currentId","getEntries","entries","_find","_get","_create","_update","_patch","_remove","memory","extendStatics","d","setPrototypeOf","__proto__","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","create","typeChecker","typeString","getClassName","toString","comparable","toJSON","isFunction","isVanillaObject","equals","length_1","walkKeyPathValues","keyPath","next","depth","owner","currentKey","owneryQuery","BaseOperation","done","keep","children","_super","_this","GroupOperation","length_2","reset","root","length_3","childOperation","QueryOperation","parent","childrenNext","NestedOperation","_nextNestedValue","createTester","Function","RegExp","test","lastIndex","comparableA","EqualsOperation","_test","createEqualsOperation","NopeOperation","numericalOperationCreator","createNumericalOperation","numericalOperation","typeofParams","createNamedOperation","parentQuery","operationCreator","operations","throwUnsupportedOperation","containsOperation","charAt","createNestedOperation","nestedQuery","parentKey","createQueryOperations","selfOperations","nestedOperations","createQueryOperation","_b","ops","apply","op","propop","createOperationTester","operation","createQueryTester","$Ne","$ElemMatch","_queryOperation","child","$Not","$Size","assertGroupNotEmpty","$Or","_ops","success","$Nor","$In","_testers","toLowerCase","length_4","ownerQuery","_in","$Nin","$Exists","$And","NamedGroupOperation","$All","$eq","$ne","$nor","$elemMatch","$nin","$in","$lt","$lte","$gt","$gte","$mod","mod","equalsValue","$exists","$regex","pattern","$options","$not","typeAliases","number","v","string","bool","array","null","timestamp","$type","clazz","$and","$all","$size","$where","process","env","CSP_ENABLED","bind","createDefaultQueryOperation","defaultOperations","createDefaultQueryTester"],"sourceRoot":""} -------------------------------------------------------------------------------- /dist/feathers-localstorage.min.js: -------------------------------------------------------------------------------- 1 | !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.localstorage=e():(t.feathers=t.feathers||{},t.feathers.localstorage=e())}(window,(function(){return r={},t.m=e=[function(t,e,r){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(7)("@feathersjs/errors");function i(t,e,r,u,a){var c,s,f;(t=t||"Error")instanceof Error?(s=t.message||"Error",t.errors&&(c=t.errors)):"object"===n(t)?(s=t.message||"Error",a=t):s=t,a&&((f=JSON.parse(JSON.stringify(a))).errors?(c=f.errors,delete f.errors):a.errors&&(c=JSON.parse(JSON.stringify(a.errors)))),this.type="FeathersError",this.name=e,this.message=s,this.code=r,this.className=u,this.data=f,this.errors=c||{},o("".concat(this.name,"(").concat(this.code,"): ").concat(this.message)),o(this.errors),Error.captureStackTrace?Error.captureStackTrace(this,i):this.stack=(new Error).stack}function u(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t}function a(t,e){i.call(this,t,"BadRequest",400,"bad-request",e)}function c(t,e){i.call(this,t,"NotAuthenticated",401,"not-authenticated",e)}function s(t,e){i.call(this,t,"PaymentError",402,"payment-error",e)}function f(t,e){i.call(this,t,"Forbidden",403,"forbidden",e)}function l(t,e){i.call(this,t,"NotFound",404,"not-found",e)}function p(t,e){i.call(this,t,"MethodNotAllowed",405,"method-not-allowed",e)}function y(t,e){i.call(this,t,"NotAcceptable",406,"not-acceptable",e)}function h(t,e){i.call(this,t,"Timeout",408,"timeout",e)}function d(t,e){i.call(this,t,"Conflict",409,"conflict",e)}function m(t,e){i.call(this,t,"LengthRequired",411,"length-required",e)}function v(t,e){i.call(this,t,"Unprocessable",422,"unprocessable",e)}function b(t,e){i.call(this,t,"TooManyRequests",429,"too-many-requests",e)}function g(t,e){i.call(this,t,"GeneralError",500,"general-error",e)}function w(t,e){i.call(this,t,"NotImplemented",501,"not-implemented",e)}function O(t,e){i.call(this,t,"BadGateway",502,"bad-gateway",e)}function C(t,e){i.call(this,t,"Unavailable",503,"unavailable",e)}u(i,Error),Object.defineProperty(i.prototype,"toJSON",{value:function(){return{name:this.name,message:this.message,code:this.code,className:this.className,data:this.data,errors:this.errors}}}),u(a,i),u(c,i),u(s,i),u(f,i),u(l,i),u(p,i),u(y,i),u(h,i),u(d,i),u(m,i),u(v,i),u(b,i),u(g,i),u(w,i),u(O,i),u(C,i);var j={FeathersError:i,BadRequest:a,NotAuthenticated:c,PaymentError:s,Forbidden:f,NotFound:l,MethodNotAllowed:p,NotAcceptable:y,Timeout:h,Conflict:d,LengthRequired:m,Unprocessable:v,TooManyRequests:b,GeneralError:g,NotImplemented:w,BadGateway:O,Unavailable:C,400:a,401:c,402:s,403:f,404:l,405:p,406:y,408:h,409:d,411:m,422:v,429:b,500:g,501:w,502:O,503:C};t.exports=Object.assign({convert:function(t){if(!t)return t;var e=j[t.name],r=e?new e(t.message,t.data):new Error(t.message||t);return"object"===n(t)&&Object.assign(r,t),r}},j)},function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=n(r(10));!function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(3)),e.hooks=o},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:u}catch(t){n=u}}();var c,s=[],f=!1,l=-1;function p(){f&&c&&(f=!1,c.length?s=c.concat(s):l=-1,s.length&&y())}function y(){if(!f){var t=a(p);f=!0;for(var e=s.length;e;){for(c=s,s=[];++l 0) { 29 | this._storage.setItem(this._storageKey, JSON.stringify(this._store)); 30 | this.store = this._store; 31 | } 32 | 33 | const store = JSON.parse(this._storage.getItem(this._storageKey) || '{}'); 34 | this.store = store; 35 | const keys = Object.keys(store); 36 | 37 | this._uId = 1; 38 | 39 | const last = keys.length > 0 ? store[keys[keys.length - 1]] : { [this.id]: 1 }; 40 | 41 | // Current id is the id of the last item 42 | this._uId = typeof last[this.id] !== 'undefined' ? last[this.id] + 1 : this._uId; 43 | 44 | // We only want too initialize once 45 | this._isInitialized = true; 46 | } 47 | } 48 | 49 | flush (data) { 50 | if (!this._timeout) { 51 | this._timeout = setTimeout(() => { 52 | this._storage.setItem(this._storageKey, JSON.stringify(this.store)); 53 | delete this._timeout; 54 | }, this._throttle); 55 | } 56 | 57 | return data; 58 | } 59 | 60 | execute (method, ...args) { 61 | this.ready(); 62 | return super[method](...args); 63 | } 64 | 65 | _find (...args) { 66 | return this.execute('_find', ...args); 67 | } 68 | 69 | _get (...args) { 70 | return this.execute('_get', ...args); 71 | } 72 | 73 | _create (...args) { 74 | return this.execute('_create', ...args) 75 | .then(data => this.flush(data)); 76 | } 77 | 78 | _patch (...args) { 79 | return this.execute('_patch', ...args) 80 | .then(data => this.flush(data)); 81 | } 82 | 83 | _update (...args) { 84 | return this.execute('_update', ...args) 85 | .then(data => this.flush(data)); 86 | } 87 | 88 | _remove (...args) { 89 | return this.execute('_remove', ...args) 90 | .then(data => this.flush(data)); 91 | } 92 | } 93 | 94 | module.exports = function init (options) { 95 | return new LocalStorage(options); 96 | }; 97 | 98 | // module.exports.Service = MemoryService; 99 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "feathers-localstorage", 3 | "description": "A client side service based on @feathersjs/memory that persists to LocalStorage", 4 | "version": "6.0.0-pre.2", 5 | "homepage": "https://github.com/feathersjs-ecosystem/feathers-localstorage", 6 | "main": "lib/", 7 | "types": "types/", 8 | "keywords": [ 9 | "feathers", 10 | "feathers-plugin" 11 | ], 12 | "license": "MIT", 13 | "repository": { 14 | "type": "git", 15 | "url": "git://github.com/feathersjs-ecosystem/feathers-localstorage.git" 16 | }, 17 | "author": { 18 | "name": "Feathers contributors", 19 | "email": "hello@feathersjs.com", 20 | "url": "https://feathersjs.com" 21 | }, 22 | "contributors": [], 23 | "bugs": { 24 | "url": "https://github.com/feathersjs-ecosystem/feathers-localstorage/issues" 25 | }, 26 | "engines": { 27 | "node": ">= 6" 28 | }, 29 | "browserslist": [ 30 | "last 2 versions", 31 | "IE 10" 32 | ], 33 | "scripts": { 34 | "add-dist": "npm run clean && npm run build && git add dist/ --force && git commit -am \"Updating dist\"", 35 | "clean": "shx rm -rf dist/ && shx mkdir -p dist", 36 | "build": "npm run clean && npm run webpack && npm run webpack:production", 37 | "webpack": "webpack", 38 | "webpack:production": "NODE_ENV=production webpack", 39 | "publish": "git push origin --tags && npm run changelog && git push origin", 40 | "changelog": "github_changelog_generator -u feathersjs-ecosystem -p feathers-localstorage && git add CHANGELOG.md && git commit -am \"Updating changelog\"", 41 | "release:patch": "npm run add-dist && npm version patch && npm publish", 42 | "release:minor": "npm run add-dist && npm version minor && npm publish", 43 | "release:major": "npm run add-dist && npm version major && npm publish", 44 | "lint": "semistandard --fix", 45 | "mocha": "node_modules/mocha/bin/_mocha -- --recursive test/", 46 | "dtslint": "dtslint types", 47 | "test": "npm run lint && npm run dtslint && npm run coverage", 48 | "coverage": "istanbul cover node_modules/mocha/bin/_mocha -- --recursive test/" 49 | }, 50 | "semistandard": { 51 | "env": [ 52 | "mocha" 53 | ] 54 | }, 55 | "directories": { 56 | "lib": "lib" 57 | }, 58 | "dependencies": { 59 | "@feathersjs/memory": "^5.0.8" 60 | }, 61 | "devDependencies": { 62 | "@babel/core": "^7.22.9", 63 | "@babel/preset-env": "^7.22.9", 64 | "@feathersjs/adapter-tests": "^5.0.8", 65 | "@feathersjs/errors": "^5.0.8", 66 | "@feathersjs/feathers": "^5.0.8", 67 | "babel-loader": "^9.1.3", 68 | "browserify": "^17.0.0", 69 | "dtslint": "^4.2.1", 70 | "istanbul": "^1.1.0-alpha.1", 71 | "localstorage-memory": "^1.0.3", 72 | "mocha": "^10.2.0", 73 | "semistandard": "^17.0.0", 74 | "shx": "^0.3.4", 75 | "ts-node": "^10.9.1", 76 | "typescript": "^5.1.6", 77 | "webpack": "^5.73.0", 78 | "webpack-cli": "^4.10.0", 79 | "webpack-merge": "^5.8.0" 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /test/index.test.js: -------------------------------------------------------------------------------- 1 | const adapterTests = require('@feathersjs/adapter-tests'); 2 | const errors = require('@feathersjs/errors'); 3 | const feathers = require('@feathersjs/feathers'); 4 | const assert = require('assert'); 5 | const storage = require('localstorage-memory'); 6 | 7 | const service = require('../lib'); 8 | const testSuite = adapterTests([ 9 | '.options', 10 | '.events', 11 | '._get', 12 | '._find', 13 | '._create', 14 | '._update', 15 | '._patch', 16 | '._remove', 17 | '.get', 18 | '.get + $select', 19 | '.get + id + query', 20 | '.get + NotFound', 21 | '.find', 22 | '.remove', 23 | '.remove + $select', 24 | '.remove + id + query', 25 | '.remove + multi', 26 | '.update', 27 | '.update + $select', 28 | '.update + id + query', 29 | '.update + NotFound', 30 | '.patch', 31 | '.patch + $select', 32 | '.patch + id + query', 33 | '.patch multiple', 34 | '.patch + NotFound', 35 | '.create', 36 | '.create + $select', 37 | '.create multi', 38 | 'internal .find', 39 | 'internal .get', 40 | 'internal .create', 41 | 'internal .update', 42 | 'internal .patch', 43 | 'internal .remove', 44 | '.find + equal', 45 | '.find + equal multiple', 46 | '.find + $sort', 47 | '.find + $sort + string', 48 | '.find + $limit', 49 | '.find + $limit 0', 50 | '.find + $skip', 51 | '.find + $select', 52 | '.find + $or', 53 | '.find + $in', 54 | '.find + $nin', 55 | '.find + $lt', 56 | '.find + $lte', 57 | '.find + $gt', 58 | '.find + $gte', 59 | '.find + $ne', 60 | '.find + $gt + $lt + $sort', 61 | '.find + $or nested + $sort', 62 | '.find + paginate', 63 | '.find + paginate + $limit + $skip', 64 | '.find + paginate + $limit 0', 65 | '.find + paginate + params', 66 | '.get + id + query id', 67 | '.remove + id + query id', 68 | '.update + id + query id', 69 | '.patch + id + query id', 70 | '.create ignores query', 71 | '.find + $and', 72 | '.find + $and + $or', 73 | '.remove + multi no pagination', 74 | '.update + query + NotFound', 75 | '.patch multiple no pagination', 76 | '.patch multi query same', 77 | '.patch multi query changed', 78 | '.patch + query + NotFound', 79 | 'params.adapter + paginate', 80 | 'params.adapter + multi', 81 | '.find + paginate + query' 82 | ]); 83 | 84 | describe('Feathers Localstorage Service', () => { 85 | beforeEach(() => storage.clear()); 86 | 87 | const events = ['testing']; 88 | const app = feathers() 89 | .use('/people', service({ events, storage, name: 'test-storage-1' })) 90 | .use('/people-customid', service({ 91 | id: 'customid', events, storage, name: 'test-storage-2' 92 | })); 93 | 94 | it('is CommonJS compatible', () => { 95 | assert.strictEqual(typeof require('../lib'), 'function'); 96 | }); 97 | 98 | it('Sane defaults for option', () => { 99 | try { 100 | feathers() 101 | .use('/people', service({ storage: null })); 102 | } catch (err) { 103 | console.log(err.message); 104 | assert.strictEqual(err.name, 'Error'); 105 | assert.strictEqual(err.message, 'The `storage` option needs to be provided'); 106 | } 107 | }); 108 | 109 | it('loads and sets data in storage', () => { 110 | const name = 'test-storage-3'; 111 | 112 | storage.setItem(name, '{ "0": { "id": 0 , "text": "test 0" } }'); 113 | 114 | const app = feathers() 115 | .use('/messages', service({ name, storage, throttle: 30 })); 116 | const messageService = app.service('messages'); 117 | 118 | return messageService.create({ text: 'testing 1' }) 119 | .then(() => messageService.create({ text: 'testing 2' })) 120 | .then(() => { 121 | return new Promise((resolve) => { 122 | setTimeout(() => { 123 | const data = JSON.parse(storage.getItem(name)); 124 | assert.deepStrictEqual(data, { 125 | 0: { 126 | id: 0, 127 | text: 'test 0' 128 | }, 129 | 1: { 130 | id: 1, 131 | text: 'testing 1' 132 | }, 133 | 2: { 134 | id: 2, 135 | text: 'testing 2' 136 | } 137 | }); 138 | resolve(); 139 | }, messageService._throttle + 1); 140 | }); 141 | }).then(() => { 142 | return messageService.remove(0) 143 | .then(() => messageService.remove(1)); 144 | }).then(() => { 145 | return new Promise((resolve) => { 146 | setTimeout(() => { 147 | const data = JSON.parse(storage.getItem(name)); 148 | assert.deepStrictEqual(data, { 149 | 2: { 150 | id: 2, 151 | text: 'testing 2' 152 | } 153 | }); 154 | resolve(); 155 | }, messageService._throttle + 1); 156 | }); 157 | }); 158 | }); 159 | 160 | it('initializes and sets data in storage', () => { 161 | const name = 'test-storage-3a'; 162 | 163 | const store = { 0: { id: 0, text: 'test 0' } }; 164 | storage.setItem(name, '{ "9": { "id": 9 , "text": "test 9" } }'); // This should be cleared 165 | 166 | const app = feathers() 167 | .use('/messages', service({ name, storage, store, throttle: 30 })); 168 | const messageService = app.service('messages'); 169 | 170 | return messageService.create({ text: 'testing 1' }) 171 | .then(() => messageService.create({ text: 'testing 2' })) 172 | .then(() => { 173 | return new Promise((resolve) => { 174 | setTimeout(() => { 175 | const data = JSON.parse(storage.getItem(name)); 176 | assert.deepStrictEqual(data, { 177 | 0: { 178 | id: 0, 179 | text: 'test 0' 180 | }, 181 | 1: { 182 | id: 1, 183 | text: 'testing 1' 184 | }, 185 | 2: { 186 | id: 2, 187 | text: 'testing 2' 188 | } 189 | }); 190 | resolve(); 191 | }, messageService._throttle + 1); 192 | }); 193 | }).then(() => { 194 | return messageService.remove(0) 195 | .then(() => messageService.remove(1)); 196 | }).then(() => { 197 | return new Promise((resolve) => { 198 | setTimeout(() => { 199 | const data = JSON.parse(storage.getItem(name)); 200 | assert.deepStrictEqual(data, { 201 | 2: { 202 | id: 2, 203 | text: 'testing 2' 204 | } 205 | }); 206 | resolve(); 207 | }, messageService._throttle + 1); 208 | }); 209 | }); 210 | }); 211 | 212 | it('gets data in storage', done => { 213 | const name = 'test-storage-4'; 214 | 215 | storage.setItem(name, '{ "0": { "id": 0, "text": "test 0" } }'); 216 | 217 | const app = feathers() 218 | .use('/messages', service({ name, storage })); 219 | const messageService = app.service('messages'); 220 | 221 | messageService.get(0).then((data) => { 222 | assert.deepStrictEqual(data, { 223 | id: 0, 224 | text: 'test 0' 225 | }); 226 | }).then(() => { 227 | return messageService.find().then((data) => { 228 | assert.deepStrictEqual(data, [{ 229 | id: 0, 230 | text: 'test 0' 231 | }]); 232 | }); 233 | }).then(done, done); 234 | }); 235 | 236 | it('throws on name reuse', done => { 237 | const name = 'test-storage-5'; 238 | 239 | assert.throws(() => { 240 | service({ storage, name }); 241 | service({ storage, name }); 242 | }); 243 | 244 | done(); 245 | }); 246 | 247 | it('accepts on name reuse with reuseKeys option', done => { 248 | const name = 'test-storage-6'; 249 | 250 | let flag = true; 251 | try { 252 | service({ storage, name }); 253 | service({ storage, name, reuseKeys: true }); 254 | } catch (err) { 255 | flag = false; 256 | } 257 | assert.strictEqual(flag, true); 258 | 259 | done(); 260 | }); 261 | 262 | it('localstorage clear with empty storage option', done => { 263 | const name = 'test-storage-7'; 264 | 265 | storage.setItem(name, '{ "0": { "id": 0, "text": "test 0" } }'); 266 | 267 | const app = feathers() 268 | .use('/messages', service({ name, storage, store: {} })); 269 | 270 | const messageService = app.service('messages'); 271 | const res = messageService.find(); 272 | 273 | assert.strictEqual(res['0'], undefined); 274 | const resString = JSON.stringify(res); 275 | assert.strictEqual(resString, '{}'); 276 | 277 | done(); 278 | }); 279 | 280 | testSuite(app, errors, 'people'); 281 | testSuite(app, errors, 'people-customid', 'customid'); 282 | }); 283 | -------------------------------------------------------------------------------- /types/index.d.ts: -------------------------------------------------------------------------------- 1 | // TypeScript Version: 3.7 2 | // import { Params, Paginated, Id, NullableId } from '@feathersjs/feathers'; 3 | 4 | import { MemoryService, MemoryServiceOptions, MemoryServiceStore } from '@feathersjs/memory'; 5 | 6 | export interface LocalStorageServiceOptions extends MemoryServiceOptions { 7 | name: string; 8 | throttle: number; 9 | } 10 | 11 | export class Service extends MemoryService { 12 | constructor(options?: Partial); 13 | 14 | ready(): Promise>; 15 | flush(data?: any): any; 16 | } 17 | 18 | declare const localstorage: ((config?: Partial) => Service); 19 | export default localstorage; 20 | -------------------------------------------------------------------------------- /types/index.test.ts: -------------------------------------------------------------------------------- 1 | import { default as createService, Service } from 'feathers-localstorage'; 2 | 3 | const service1 = createService(); 4 | const service2 = new Service({ 5 | name: 'mykey', 6 | throttle: 400 7 | }); 8 | 9 | service1._find({}); 10 | 11 | service2.ready().then(() => service2.flush()); 12 | -------------------------------------------------------------------------------- /types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "lib": ["es6"], 5 | "noImplicitAny": true, 6 | "noImplicitThis": true, 7 | "strictNullChecks": true, 8 | "strictFunctionTypes": true, 9 | "noEmit": true, 10 | 11 | // If the library is an external module (uses `export`), this allows your test file to import "mylib" instead of "./index". 12 | // If the library is global (cannot be imported via `import` or `require`), leave this out. 13 | "baseUrl": ".", 14 | "paths": { "feathers-localstorage": ["."] } 15 | } 16 | } -------------------------------------------------------------------------------- /types/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "dtslint/dtslint.json", // Or "dtslint/dt.json" if on DefinitelyTyped 3 | "rules": { 4 | "indent": [true, "spaces"] 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const webpack = require('webpack'); 3 | const { merge } = require('webpack-merge'); 4 | // const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); 5 | 6 | const isProduction = process.env.NODE_ENV === 'production'; 7 | 8 | const config = { 9 | entry: './lib', 10 | output: { 11 | library: ['feathers', 'localstorage'], 12 | libraryTarget: 'umd', 13 | path: path.resolve(__dirname, 'dist') 14 | }, 15 | module: { 16 | rules: [{ 17 | test: /\.js/, 18 | exclude: /node_modules\/(?!(@feathersjs|debug|feathers|sift))/, 19 | loader: 'babel-loader', 20 | options: { 21 | presets: ['@babel/preset-env'] 22 | } 23 | }] 24 | }, 25 | plugins: [] 26 | }; 27 | 28 | const dev = { 29 | mode: 'development', 30 | devtool: 'source-map', 31 | output: { 32 | filename: 'feathers-localstorage.js' 33 | } 34 | }; 35 | 36 | const prod = { 37 | mode: 'production', 38 | output: { 39 | filename: 'feathers-localstorage.min.js' 40 | }, 41 | plugins: [/* new UglifyJSPlugin({ 42 | uglifyOptions: { 43 | ie8: false, 44 | comments: false, 45 | sourceMap: false 46 | } 47 | }), */ new webpack.DefinePlugin({ 48 | 'process.env.NODE_ENV': JSON.stringify('production') 49 | })] 50 | }; 51 | 52 | module.exports = merge(config, isProduction ? prod : dev); 53 | --------------------------------------------------------------------------------