From 871b21f0b85f5ca633bc3c4af1b2a6d596179cce Mon Sep 17 00:00:00 2001 From: inator Date: Sat, 21 Aug 2021 14:33:22 -0700 Subject: [PATCH 1/5] Only validate user docs to allows db multi-use. --- lib/validate-doc-update.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/validate-doc-update.js b/lib/validate-doc-update.js index 875a0e4..572c9c8 100644 --- a/lib/validate-doc-update.js +++ b/lib/validate-doc-update.js @@ -7,16 +7,8 @@ module.exports = function (newDoc, oldDoc, userCtx, secObj) { throw error } - if (newDoc._id.substr(0, 8) === '_design/') { - return - } - - if (newDoc._id.substr(0, 7) === '_local/') { - return - } - if ((oldDoc && oldDoc.type !== 'user') || newDoc.type !== 'user') { - throwError('doc.type must be user') + return } if (!newDoc.name) { From 47d39c55f299074e2fb7765635f8b67432abc12a Mon Sep 17 00:00:00 2001 From: inator Date: Sat, 21 Aug 2021 14:44:58 -0700 Subject: [PATCH 2/5] Add version and bump. --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 12523e8..42aff5a 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "pouchdb-users", + "version": "1.0.7", "description": "PouchDB plugin to simulate CouchDB’s _users database behavior", "main": "index.js", "scripts": { From 9f0ef776622d86d9a1332c6960cfd8ac998b1941 Mon Sep 17 00:00:00 2001 From: inator Date: Sat, 18 Dec 2021 21:42:31 -0700 Subject: [PATCH 3/5] Prep for publishing forked version. --- README.md | 1 + package.json | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index dd41dc4..c16b70a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # pouchdb-users > PouchDB plugin to simulate CouchDB’s \_users database behavior +> This forked version adds multi-db support [![Build Status](https://travis-ci.org/hoodiehq/pouchdb-users.svg?branch=master)](https://travis-ci.org/hoodiehq/pouchdb-users) [![Coverage Status](https://coveralls.io/repos/hoodiehq/pouchdb-users/badge.svg?branch=master)](https://coveralls.io/r/hoodiehq/pouchdb-users?branch=master) diff --git a/package.json b/package.json index 42aff5a..b02da9a 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "pouchdb-users", + "name": "@inator/pouchdb-users", "version": "1.0.7", "description": "PouchDB plugin to simulate CouchDB’s _users database behavior", "main": "index.js", @@ -15,7 +15,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/hoodiehq/pouchdb-users.git" + "url": "https://github.com/inator/pouchdb-users" }, "keywords": [ "couchdb", @@ -27,9 +27,9 @@ "author": "The Hoodie Community", "license": "Apache-2.0", "bugs": { - "url": "https://github.com/hoodiehq/pouchdb-users/issues" + "url": "https://github.com/inator/pouchdb-users/issues" }, - "homepage": "https://github.com/hoodiehq/pouchdb-users#readme", + "homepage": "https://github.com/inator/pouchdb-users#readme", "dependencies": { "lie": "^3.1.1", "pouchdb-bulkdocs-wrapper": "^1.0.2", From 6ab20a88132f4895f8b70f779908773f12d3bc96 Mon Sep 17 00:00:00 2001 From: inator Date: Sun, 19 Dec 2021 08:50:38 -0700 Subject: [PATCH 4/5] Readme update. --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c16b70a..d57b521 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # pouchdb-users -> PouchDB plugin to simulate CouchDB’s \_users database behavior -> This forked version adds multi-db support +> PouchDB plugin to simulate CouchDB’s \_users database behavior. + +This forked version allows _users behavior to be added to any db while still retaining the ability to add other doc types as well. Only 'user' doc types are validated for _user db behavior. [![Build Status](https://travis-ci.org/hoodiehq/pouchdb-users.svg?branch=master)](https://travis-ci.org/hoodiehq/pouchdb-users) [![Coverage Status](https://coveralls.io/repos/hoodiehq/pouchdb-users/badge.svg?branch=master)](https://coveralls.io/r/hoodiehq/pouchdb-users?branch=master) From 4e76ed04f05081be1a014e4e28c3b6c96280b46c Mon Sep 17 00:00:00 2001 From: inator Date: Sun, 19 Dec 2021 08:52:55 -0700 Subject: [PATCH 5/5] Version bump for rebublishing. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b02da9a..aaaa062 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@inator/pouchdb-users", - "version": "1.0.7", + "version": "1.0.8", "description": "PouchDB plugin to simulate CouchDB’s _users database behavior", "main": "index.js", "scripts": {