{
  "name": "couchdb-web-node-plugin",
  "version": "1.0.761",
  "description": "A couchdb server, model instance conflict handler, rest api, authentication, session management, schema validator and model relation guarantee for webNode.",
  "keywords": [
    "api",
    "authentication",
    "authorisation",
    "backend",
    "database",
    "model",
    "rest",
    "roles",
    "session",
    "schema",
    "user",
    "validation",
    "web"
  ],
  "homepage": "https://torben.website/couchdb-web-node-plugin",
  "bugs": {
    "email": "info@torben.website",
    "url": "https://github.com/thaibault/couchdb-web-node-plugin/issues"
  },
  "license": "CC-BY-3.0",
  "author": {
    "name": "Torben Sickert",
    "email": "info@torben.website",
    "url": "https://torben.website"
  },
  "files": [
    "databaseHelper.d.ts",
    "databaseHelper.js",
    "helper.d.ts",
    "index.d.ts",
    "index.js",
    "helper.js",
    "type.d.ts",
    "type.js"
  ],
  "repository": {
    "type": "git",
    "url": "https://github.com/thaibault/couchdb-web-node-plugin.git"
  },
  "scripts": {
    "build": "weboptimizer build:types && yarn build:databaseHelper && weboptimizer build",
    "build:databaseHelper": "weboptimizer build '{__reference__: \"target:databaseHelper\"}'",
    "check:types": "weboptimizer check:types",
    "clear": "weboptimizer clear && rimraf log.txt",
    "document": "weboptimizer document",
    "lint": "weboptimizer lint",
    "prepare": "yarn build",
    "report:coverage": "nyc report --reporter=text-lcov | coveralls",
    "serve": "yarn build && yarn start",
    "start": "web-node '{plugin: {hotReloading: true}}'",
    "test": "weboptimizer test",
    "test:coverage": "weboptimizer test:coverage",
    "test:coverage:report": "weboptimizer test:coverage:report",
    "update:documentation": "documentation-website",
    "watch": "weboptimizer build --watch"
  },
  "dependencies": {
    "pouchdb-authentication": "^1.1.3",
    "pouchdb-find": "^9.0.0",
    "pouchdb-node": "^9.0.0",
    "pouchdb-validation": "^4.2.0",
    "rxjs": "^7.8.2"
  },
  "devDependencies": {
    "@babel/eslint-parser": "^7.27.0",
    "@babel/runtime": "^7.27.0",
    "@stylistic/eslint-plugin-ts": "^4.2.0",
    "@types/ejs": "^3.1.5",
    "@types/express": "^5.0.1",
    "@types/node": "^22.14.1",
    "@types/pouchdb-node": "^6.1.7",
    "@typescript-eslint/eslint-plugin": "^8.30.1",
    "@typescript-eslint/parser": "^8.30.1",
    "clientnode": "^3.0.1275",
    "documentation-website": "^1.0.345",
    "eslint": "^9.24.0",
    "eslint-config-google": "^0.14.0",
    "eslint-plugin-jsdoc": "^50.6.9",
    "express": "^5.1.0",
    "express-pouchdb": "^4.2.0",
    "jest": "^29.7.0",
    "jsdoc": "^4.0.4",
    "mkdirp": "^3.0.1",
    "node-fetch": "^3.3.2",
    "rimraf": "^6.0.1",
    "typescript-eslint": "^8.30.1",
    "web-node": "^1.0.545",
    "weboptimizer": "^2.0.1577"
  },
  "peerDependencies": {
    "@babel/runtime": "*",
    "clientnode": "*",
    "express": "*",
    "express-pouchdb": "*",
    "node-fetch": "*",
    "pouchdb-server": "*",
    "request": "*",
    "web-node": "*"
  },
  "peerDependenciesMeta": {
    "@babel/runtime": {
      "optional": true
    },
    "express": {
      "optional": true
    },
    "express-pouchdb": {
      "optional": true
    },
    "pouchdb-server": {
      "optional": true
    }
  },
  "engines": {
    "node": ">=20",
    "npm": ">=10",
    "yarn": ">=4"
  },
  "resolutions": {
    "colors": "1.4.0",
    "globals@npm:^9.18.0": "patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch",
    "globals@npm:^11.1.0": "patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch",
    "globals@npm:^14.0.0": "patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch"
  },
  "sideEffects": false,
  "documentationWebsite": {
    "name": "couchdb-web-node-plugin",
    "trackingCode": "UA-40192634-21"
  },
  "webNode": {
    "couchdb": {
      "attachAutoRestarter": true,
      "backend": {
        "configuration": {
          "couchdb/database_dir": {
            "__evaluate__": "path.resolve(self.couchdb.path)"
          },
          "couchdb/max_attachment_chunk_size": "4294967296",
          "couchdb/os_process_timeout": "25000",
          "couchdb/view_index_dir": {
            "__evaluate__": "path.resolve(self.couchdb.path)"
          },
          "couch_httpd_auth/timeout": {
            "__evaluate__": "60 ** 2 * 24 * 14"
          },
          "chttpd/require_valid_user": true,
          "httpd/allow_jsonp": true,
          "httpd/bind_address": {
            "__evaluate__": "self.couchdb.backend.configuration['httpd/host']"
          },
          "httpd/enable_cors": true,
          "httpd/host": "0.0.0.0",
          "httpd/port": 5984,
          "log/file": "/dev/stdout",
          "log/level": "info"
        },
        "prefixes": [
          "_node/_local/_config",
          "_config"
        ]
      },
      "runner": {
        "memoryInMegaByte": "default",
        "nodePath": "/usr/bin/node",
        "variants": [
          {
            "adminUserConfigurationPath": "_node/couchdb@127.0.0.1/_config/admins",
            "configurationFile": {
              "content": {
                "__evaluate__": "`[couchdb]\\ndatabase_dir = ${path.resolve(self.couchdb.path)}\\nview_index_dir = ${path.resolve(self.couchdb.path)}`"
              },
              "path": {
                "__evaluate__": "path.resolve(self.couchdb.path, 'local.ini')"
              }
            },
            "environment": {
              "ERL_FLAGS": {
                "__evaluate__": "`-couch_ini /usr/lib/couchdb/etc/default.ini /usr/lib/couchdb/etc/datadirs.ini /etc/couchdb/local.ini ${path.resolve(self.couchdb.path, 'local.ini')}`"
              }
            },
            "locations": "/usr/lib/couchdb/bin/",
            "names": "couchdb"
          },
          {
            "adminUserConfigurationPath": "_config/admins",
            "arguments": [
              "--config",
              {
                "__evaluate__": "`./${self.couchdb.path}/database.json`"
              },
              "--dir",
              {
                "__evaluate__": "self.couchdb.backend.configuration['couchdb/database_dir']"
              },
              "#: NOTE: This redundancy seems to be needed to forward ports in docker containers.",
              "--host",
              {
                "__evaluate__": "self.couchdb.backend.configuration['httpd/host']"
              },
              "--port",
              {
                "__evaluate__": "`${self.couchdb.backend.configuration['httpd/port']}`"
              }
            ],
            "locations": [
              "node_modules/.bin/",
              "../.bin/"
            ],
            "names": "pouchdb-server"
          },
          {
            "adminUserConfigurationPath": "_config/admins",
            "packages": [
              "express",
              "express-pouchdb"
            ],
            "names": "express-pouchdb"
          }
        ]
      },
      "changesStream": {
        "include_docs": false,
        "live": true,
        "return_docs": false,
        "since": "now",
        "timeout": false
      },
      "updateMaterializedViewsChangesStream": {
        "include_docs": true,
        "live": true,
        "return_docs": false,
        "since": "now",
        "style": "all_docs",
        "timeout": false
      },
      "changesStreamReinitializer": {
        "retries": 5,
        "retryWaitingFactorInSeconds": 3,
        "maxmumRetryWaitingTimeInSeconds": 120
      },
      "numberOfParallelChangesRunner": 1,
      "connector": {
        "fetch": {
          "timeout": {
            "__evaluate__": "5 * 60 * 1000"
          }
        },
        "fetchInterceptor": {
          "numberOfRetries": 5,
          "retryIntervalInSeconds": 0.2,
          "exponentialBackoff": true,
          "maximumRetryIntervallInSeconds": 30
        }
      },
      "createGenericFlatIndex": true,
      "databaseName": "main",
      "debug": false,
      "ensureAdminPresence": true,
      "ensureSecuritySettingsPresence": true,
      "ensureUserPresence": true,
      "ignoreNoChangeError": true,
      "local": false,
      "maximumNumberOfEntitiesInBulkOperation": 10,
      "maximumRepresentationLength": 1000,
      "maximumRepresentationTryLength": 1000000,
      "model": {
        "autoMigrationPath": "migration",
        "dateTimeFormat": "iso",
        "entities": {
          "_base": {
            "_allowedRoles": "users",
            "_attachments": {},
            "_deleted": {
              "type": "boolean"
            },
            "_id": {
              "mutable": false
            },
            "_maximumAggregatedSize": 100000000,
            "_minimumAggregatedSize": 0,
            "_rev": {
              "mutable": false
            },
            "-type": {
              "maximumLength": 999,
              "minimumLength": 1,
              "nullable": false,
              "mutable": false,
              "pattern": {
                "__evaluate__": "`(?:${self.couchdb.model.property.name.typePattern.public}|${self.couchdb.model.property.name.typePattern.private})`"
              }
            }
          },
          "_expressionMapping": {
            "_additional": {
              "constraintExecution": {
                "description": "`Given value \"${newValue}\" should be able to be compiled as template string: ${(() => { try { new Function(`return \\`${newValue}\\``) } catch (error) { return `${error}` } })()}`",
                "evaluation": "try { new Function(`return \\`${newValue}\\``) } catch (error) { return false }; return true"
              }
            },
            "_extends": "_stringMapping"
          },
          "_interval": {
            "_constraintExpressions": {
              "description": "`You have to ensure that start time is before or equal to end time for models with an ${modelName.replace(/^_+/, '')} specification${pathDescription}.`",
              "evaluation": "newDocument.start <= newDocument.end"
            },
            "end": {
              "declaration": "Ende des Intervals",
              "description": "Ende",
              "nullable": false,
              "type": "DateTime"
            },
            "start": {
              "declaration": "Start des Intervals",
              "description": "Start",
              "nullable": false,
              "type": "DateTime"
            }
          },
          "_location": {
            "latitude": {
              "declaration": "Latitude degree of the represented position.",
              "description": "Latitude",
              "maximum": 90,
              "minimum": -90,
              "nullable": false,
              "type": [
                "number",
                "UNRESOLVED"
              ]
            },
            "longitude": {
              "declaration": "Longitude degree of the represented position.",
              "description": "Longitude",
              "maximum": 180,
              "minimum": -180,
              "nullable": false,
              "type": [
                "number",
                "UNRESOLVED"
              ]
            }
          },
          "_materializedView": {
            "_allowedRoles": []
          },
          "_stringMapping": {
            "_additional": {
              "declaration": "Templatedata",
              "description": "String mapped values.",
              "emptyEqualsNull": false,
              "type": "string"
            }
          },
          "_timeTrackable": {
            "creationDateTime": {
              "minimum": 1,
              "mutable": false,
              "nullable": false,
              "onCreateExpression": "nowUTCTimestamp",
              "type": "DateTime"
            },
            "updateDateTime": {
              "constraintExpression": {
                "evaluate": {
                  "__evaluate__": "`modelConfiguration.updateStrategy === 'migrate' && oldDocument ? true : newValue > ${nowUTCTimestamp}`"
                }
              },
              "minimum": 0,
              "nullable": false,
              "onUpdateExpression": "modelConfiguration.updateStrategy === 'migrate' && oldDocument ? oldDocument[name] : nowUTCTimestamp",
              "type": "DateTime"
            }
          },
          "_userTrackable": {
            "lastUser": {
              "nullable": false,
              "onUpdateExpression": {
                "__evaluate__": "`userContext.name || '${self.couchdb.admin.name}'`"
              }
            }
          }
        },
        "property": {
          "defaultSpecification": {
            "emptyEqualsNull": true,
            "maximumAggregatedSize": 100000000,
            "minimumAggregatedSize": 0,
            "minimumLength": 0,
            "minimumNumber": 0,
            "maximumSize": 10000000,
            "minimumSize": 0,
            "mutable": true,
            "nullable": true,
            "trim": true,
            "type": "string",
            "writable": true
          },
          "name": {
            "reserved": [],
            "special": {
              "additional": "_additional",
              "allowedRole": "_allowedRoles",
              "attachment": "_attachments",
              "conflict": "_conflicts",
              "constraint": {
                "execution": "_constraintExecutions",
                "expression": "_constraintExpressions"
              },
              "create": {
                "execution": "_createExecution",
                "expression": "_createExecution"
              },
              "deleted": "_deleted",
              "deletedConflict": "_deleted_conflicts",
              "designDocumentNamePrefix": "_design/",
              "extend": "_extends",
              "id": "_id",
              "localSequence": "_local_seq",
              "maximumAggregatedSize": "_maximumAggregatedSize",
              "minimumAggregatedSize": "_minimumAggregatedSize",
              "oldType": "_oldType",
              "revision": "_rev",
              "revisions": "_revisions",
              "revisionsInformation": "_revs_info",
              "strategy": "_updateStrategy",
              "type": "-type",
              "update": {
                "execution": "_onUpdateExecution",
                "expression": "_onUpdateExpression"
              }
            },
            "typePattern": {
              "private": "^_[a-z][A-Za-z0-9]+$",
              "public": "^[A-Z][A-Za-z0-9]+$"
            },
            "validatedDocumentsCache": "_validatedDocuments"
          }
        },
        "triggerInitialCompaction": true,
        "updateConfiguration": true,
        "updateStrategy": "fillUp",
        "updateValidation": true
      },
      "path": "database",
      "security": {
        "_default": {
          "admins": {
            "names": [],
            "roles": [
              "admin"
            ]
          },
          "members": {
            "names": [],
            "roles": []
          }
        },
        "_users": {
          "admins": {
            "names": [
              "admin"
            ],
            "roles": [
              "admin"
            ]
          },
          "members": {
            "names": [
              "admin"
            ],
            "roles": [
              "admin"
            ]
          }
        }
      },
      "skipLatestRevisionDetermining": true,
      "url": {
        "__evaluate__": "`http://{1}${self.couchdb.backend.configuration['httpd/host']}:${self.couchdb.backend.configuration['httpd/port']}`"
      },
      "admin": {
        "name": "admin",
        "password": "admin"
      },
      "users": {},
      "materializedViews": {}
    }
  },
  "webOptimizer": {
    "assetPattern": {
      "javaScript": {
        "excludeFilePathRegularExpression": {
          "__evaluate__": "2 < self.givenCommandLineArguments.length && self.givenCommandLineArguments[2].startsWith('test') ? '^$' : '.+'"
        }
      }
    },
    "exportFormat": {
      "external": "commonjs2",
      "self": "commonjs2"
    },
    "injection": {
      "entry": {
        "__evaluate__": "2 < self.givenCommandLineArguments.length && self.givenCommandLineArguments[2].startsWith('test') ? {testBundle: 'test'} : {helper: './helper', index: './index', type: './type'}"
      }
    },
    "module": {
      "aliases": {
        "#": "Share same library version.",
        "node-fetch$": "pouchdb-node/node_modules/node-fetch/lib/index.js"
      },
      "optimizer": {
        "babelMinify": {
          "bundle": {
            "transform": {
              "#": "To provide a logging output we need to exclude this feature.",
              "removeConsole": false
            }
          },
          "#": "Avoids \"Couldn't find intersection\" build error.",
          "module": false
        }
      },
      "skipParseRegularExpressions": {
        "__evaluate__": "/(?:(?:bindings\\/bindings)|(?:colors\\/lib\\/(?:colors)|(?:extendStringPrototype))|(?:encoding\\/lib\\/iconv-loader)|(?:global)|(?:module))\\.js(?:\\?.+|$)/"
      }
    },
    "targetTechnology": {
      "boilerplate": "node",
      "payload": "node"
    },
    "target:databaseHelper": {
      "injection": {
        "entry": {
          "__evaluate__": "{databaseHelper: './databaseHelper'}"
        }
      },
      "inPlace": {
        "externalLibrary": {
          "normal": true
        }
      },
      "module": {
        "preprocessor": {
          "javaScript": {
            "options": {
              "plugins": {
                "__remove__": "@babel/plugin-transform-runtime"
              }
            }
          }
        }
      }
    },
    "test": {
      "injection": {
        "external": {
          "implicit": {
            "pattern": {
              "exclude": {
                "#": "NOTE: Theses files are ECMAscript file so have to be processed to work with test-runner.",
                "__append__": [
                  {
                    "__evaluate__": "/^(.+\\/)?data-uri-to-buffer(\\/.+)?$/"
                  },
                  {
                    "__evaluate__": "/^(.+\\/)?fetch-blob(\\/.+)?$/"
                  },
                  {
                    "__evaluate__": "/^(.+\\/)?node-fetch(\\/.+)?$/"
                  }
                ]
              }
            }
          }
        }
      }
    }
  },
  "packageManager": "yarn@4.6.0+sha512.5383cc12567a95f1d668fbe762dfe0075c595b4bfff433be478dbbe24e05251a8e8c3eb992a986667c1d53b6c3a9c85b8398c35a960587fbd9fa3a0915406728"
}