From 560e50ceb64c674e8ac07f7c5abcf2f93c38fbf2 Mon Sep 17 00:00:00 2001 From: Samarpan Date: Mon, 17 Jun 2019 01:42:54 +0530 Subject: [PATCH] Update deps --- README.md | 48 +- package-lock.json | 569 +++++++----------- package.json | 30 +- src/application.ts | 4 +- src/models/role.model.ts | 6 + src/models/tenant.model.ts | 6 + src/models/user-tenant-permission.model.ts | 9 +- src/models/user-tenant.model.ts | 17 +- src/models/user.model.ts | 9 +- src/modules/auth/error-keys.ts | 1 + .../default-soft-crud.repository.base.ts | 5 +- ...efault-user-modify-crud.repository.base.ts | 5 +- .../user-tenant-permission.repository.ts | 11 +- src/repositories/user-tenant.repository.ts | 11 +- src/repositories/user.repository.ts | 8 +- 15 files changed, 340 insertions(+), 399 deletions(-) diff --git a/README.md b/README.md index 85880e4..90ceb65 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ [![LoopBack]()](http://loopback.io/) [![Dependencies Status](https://img.shields.io/david/sourcefuse/loopback4-starter.svg?style=flat-square&label=Dependencies)](https://github.com/sourcefuse/loopback4-starter) +[![Loopback Core Version](https://img.shields.io/github/package-json/dependency-version/sourcefuse/loopback4-starter/@loopback/core.svg?style=flat-square)](https://github.com/strongloop/loopback-next) +[![License](https://img.shields.io/github/license/sourcefuse/loopback4-starter.svg?color=blue&label=License&style=flat-square)](https://github.com/sourcefuse/loopback4-starter/blob/master/LICENSE) This is a LoopBack 4 starter application to get you upto speed with initial setup of a very standard REST API application with LoopBack 4 as framework. It provides you with all the core requisite features for most of the applications over and above framework features, viz., @@ -22,29 +24,29 @@ In addition to that, it also provides you with some of the good to have items ## Table of Contents -- [How to use](#how-to-use) - - [Clone the repository](#clone-the-repository) - - [Install dependencies](#install-dependencies) - - [Update app name](#update-app-name) - - [Update git origin](#update-git-origin) - - [Setup database](#setup-database) - - [Setup redis](#setup-redis) - - [Configure environment](#configure-environment) - - [Run DB migrations](#run-db-migrations) - - [Start server](#start-server) - - [API Explorer](#api-explorer) -- [Architecture overview](#architecture-overview) - - [Database Model](#database-model) - - [Key Notes](#key-notes) - - [Multi-tenant system](#multi-tenant-system) - - [Authentication](#authentication) - - [Authorization](#authorization) - - [Soft Delete](#soft-delete) - - [Audit Logs](#audit-logs) -- [Feedback](#feedback) -- [Contributing](#contributing) -- [Code of conduct](#code-of-conduct) -- [License](#license) +- [How to use](#How-to-use) + - [Clone the repository](#Clone-the-repository) + - [Install dependencies](#Install-dependencies) + - [Update app name](#Update-app-name) + - [Update git origin](#Update-git-origin) + - [Setup database](#Setup-database) + - [Setup redis](#Setup-redis) + - [Configure environment](#Configure-environment) + - [Run DB migrations](#Run-DB-migrations) + - [Start server](#Start-server) + - [API Explorer](#API-Explorer) +- [Architecture overview](#Architecture-overview) + - [Database Model](#Database-Model) + - [Key Notes](#Key-Notes) + - [Multi-tenant system](#Multi-tenant-system) + - [Authentication](#Authentication) + - [Authorization](#Authorization) + - [Soft Delete](#Soft-Delete) + - [Audit Logs](#Audit-Logs) +- [Feedback](#Feedback) +- [Contributing](#Contributing) +- [Code of conduct](#Code-of-conduct) +- [License](#License) ### How to use diff --git a/package-lock.json b/package-lock.json index 47e2de8..dbe365c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -133,9 +133,9 @@ }, "dependencies": { "tsutils": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.10.0.tgz", - "integrity": "sha512-q20XSMq7jutbGB8luhKKsQldRKWvyBO2BGqni3p4yq8Ys9bEP/xQw3KepKmMRt9gJ4lvQSScrihJrcKdKoSU7Q==", + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.14.0.tgz", + "integrity": "sha512-SmzGbB0l+8I0QwsPgjooFRaRvHLBLNYM8SeQ0k6rtNDru5sCGeLJcZdwilNndN+GysuFjF5EIYgN8GfFG6UeUw==", "dev": true, "requires": { "tslib": "^1.8.1" @@ -197,14 +197,14 @@ } }, "@loopback/boot": { - "version": "1.2.10", - "resolved": "https://registry.npmjs.org/@loopback/boot/-/boot-1.2.10.tgz", - "integrity": "sha512-Hxkj8LhrgKPkSWEwOVJx7XRuV9998FO9EP6SLYykUG5oXZKAzPRUq+MYNXUAFiyGG4tLcQ69Jxd7HjuKzhX2BA==", - "requires": { - "@loopback/context": "^1.17.1", - "@loopback/core": "^1.7.3", - "@loopback/repository": "^1.5.8", - "@loopback/service-proxy": "^1.1.13", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@loopback/boot/-/boot-1.4.0.tgz", + "integrity": "sha512-5EVjvYglUCK9C3ybBAbId2wK2lzW08TcgJjahRjTPS+oL+gJOdRWsctJfOhUkS5jY2F0fZzTB/ZhftugSu347w==", + "requires": { + "@loopback/context": "^1.19.0", + "@loopback/core": "^1.8.1", + "@loopback/repository": "^1.6.1", + "@loopback/service-proxy": "^1.2.1", "@types/debug": "^4.1.4", "@types/glob": "^7.1.1", "debug": "^4.0.1", @@ -227,18 +227,22 @@ } }, "@loopback/build": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/@loopback/build/-/build-1.6.1.tgz", - "integrity": "sha512-TGasDeWSPIHlWKpenhH8yf3HnONLC1yLmlEWq76nfXSmeH5Hz6wbbWxqh2ufCx6SfMlpxIxNtwAkftlrM4FyMQ==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@loopback/build/-/build-1.7.1.tgz", + "integrity": "sha512-1KZ1vPQ1tAn6FyjPeJkPGChn0zkiWb9lOWr0Sl5PoysPbpYN0gnL6o5xF3n+rGDSPh70MXnZ/t8U7ObjEt5Btw==", "dev": true, "requires": { - "@loopback/eslint-config": "^1.0.0-3", - "@loopback/tslint-config": "^2.0.4", + "@loopback/eslint-config": "^1.1.1", + "@loopback/tslint-config": "^2.1.0", "@types/mocha": "^5.2.7", "@types/node": "^10.11.2", + "@typescript-eslint/eslint-plugin": "^1.9.0", + "@typescript-eslint/parser": "^1.9.0", "cross-spawn": "^6.0.5", "debug": "^4.0.1", "eslint": "^5.16.0", + "eslint-config-prettier": "^4.3.0", + "eslint-plugin-eslint-plugin": "^2.1.0", "eslint-plugin-mocha": "^5.3.0", "fs-extra": "^8.0.1", "glob": "^7.1.4", @@ -252,12 +256,6 @@ "typescript": "~3.5.1" }, "dependencies": { - "@types/node": { - "version": "10.14.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.8.tgz", - "integrity": "sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw==", - "dev": true - }, "glob": { "version": "7.1.4", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", @@ -275,43 +273,43 @@ } }, "@loopback/context": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/@loopback/context/-/context-1.17.1.tgz", - "integrity": "sha512-x042lj9EYBdbs5tDa/Rr+Lp5gXKTsUJt4YxHRgKAFrNw8XNOMBOJX+zS7P0wdA5jj2DyZZ8QnLFP/uaUQqsmhw==", + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/@loopback/context/-/context-1.19.0.tgz", + "integrity": "sha512-EPn9Ixcb8sbG/n5CFYlDHa0jNz7lJbvvYvxJCxA5sel28yKUS8jLsOsjhjqD2EH71C5hBdva5MGmjnz6zWqZjQ==", "requires": { - "@loopback/metadata": "^1.1.7", + "@loopback/metadata": "^1.2.1", "debug": "^4.0.1", "p-event": "^4.1.0", "uuid": "^3.2.1" } }, "@loopback/core": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@loopback/core/-/core-1.7.3.tgz", - "integrity": "sha512-VtFa9Eq2SQHZFCt/W7Rzcjo+/rxySn3KwjFM4fiApoDZkuFPRrvA0P5ZJuXTs/+hHk3SQFrIkjCTC6z6crEiVQ==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@loopback/core/-/core-1.8.1.tgz", + "integrity": "sha512-dCpKlV1oTVTOyu9gW7jUo/9KKzjevxugeSiroolYhLbuyUxJw8li73QP2Fm7Hb0ID527Zn/ekoA/mLytPGz8Cg==", "requires": { - "@loopback/context": "^1.17.1", + "@loopback/context": "^1.19.0", "debug": "^4.1.0" } }, "@loopback/eslint-config": { - "version": "1.0.0-3", - "resolved": "https://registry.npmjs.org/@loopback/eslint-config/-/eslint-config-1.0.0-3.tgz", - "integrity": "sha512-1/wV4yNSkzUFWcD9QHxkOekHOG5SIC9sN2DFDV+FV4fjY5GIyA53m9cCp5yVa14n9qNBvYLGkx3sE3/J5Kp0Pw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@loopback/eslint-config/-/eslint-config-1.1.1.tgz", + "integrity": "sha512-JdcjnYhxeAcgysZY+yH0+T4PhN70SnFh0vcoDs0Lw5vPDZF0YxfpTTUc+hHkq3s3nUERQmO66oosQ7blqlT/ag==", "dev": true }, "@loopback/http-server": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@loopback/http-server/-/http-server-1.2.6.tgz", - "integrity": "sha512-yjx+ry82AXzQbUPAmIXRx315z95nvUJmVmP3JdOyyQCbulGkM/DwpfQ1XsPjMDaxRaJyWaCWAobzS5C9y+gljw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@loopback/http-server/-/http-server-1.4.0.tgz", + "integrity": "sha512-BIIptiaZDIaC5lg+FoozEjl74EWm7qr9+AQ9xotbIt+L7CGHBb4TlKRw25jKxIHBzwK7ZJOk+h2lXGxoNncwnQ==", "requires": { "p-event": "^4.1.0" } }, "@loopback/metadata": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/@loopback/metadata/-/metadata-1.1.7.tgz", - "integrity": "sha512-swbQoSVhoSPsL+u0aHP11ycNws29zGEQdViZZuiEHyY3kHYCMCP5grUrdf8D1dlL3EY9QiUNdol82Pre04LAtA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@loopback/metadata/-/metadata-1.2.1.tgz", + "integrity": "sha512-oJZaI3IKYoV/akVAE/fF63us1bUJStwZOESfWG/2sm5+VlV8yX1fD2/gLo91P3OpXmoWajbn84nBzFqG6WtX1Q==", "requires": { "debug": "^4.0.1", "lodash": "^4.17.11", @@ -319,32 +317,32 @@ } }, "@loopback/openapi-v3": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/@loopback/openapi-v3/-/openapi-v3-1.5.1.tgz", - "integrity": "sha512-RLnUs9ARC5MotchBUQ9FGxyxTBL0xjoL8lS+oBk9jlejOXn/pG+aVrIkRSjtS+JygR94s2A5K3yKs/K2OLOjrg==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@loopback/openapi-v3/-/openapi-v3-1.6.1.tgz", + "integrity": "sha512-9Watby3fu3dF+lO86xbd9eA79PocJN1nB+NZmQ9/Q3uxaRablk4Jg7EgL4nSZi5JlXONwfuLyuafjmeOhtvDvw==", "requires": { - "@loopback/context": "^1.17.1", - "@loopback/openapi-v3-types": "^1.0.21", - "@loopback/repository-json-schema": "^1.5.1", + "@loopback/context": "^1.19.0", + "@loopback/openapi-v3-types": "^1.1.1", + "@loopback/repository-json-schema": "^1.6.1", "debug": "^4.0.1", "lodash": "^4.17.11" } }, "@loopback/openapi-v3-types": { - "version": "1.0.21", - "resolved": "https://registry.npmjs.org/@loopback/openapi-v3-types/-/openapi-v3-types-1.0.21.tgz", - "integrity": "sha512-gGj9EbAOuBp/h33yaA5sOWb6SkoziXhXOwXObR95eYY1FEQ77X8rcUhbVnWR6jE7fUc06WtPy7FlGsN4tNddIw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@loopback/openapi-v3-types/-/openapi-v3-types-1.1.1.tgz", + "integrity": "sha512-Y0TIm/HfjWbkV2aAH0d9VtnSBQRL6QTSN7NmKLZrYOB4NXm1dYvwuWa3D5zLRrzR3UChWGs7eh4LY6va0qvsVg==", "requires": { "openapi3-ts": "^1.3.0" } }, "@loopback/repository": { - "version": "1.5.8", - "resolved": "https://registry.npmjs.org/@loopback/repository/-/repository-1.5.8.tgz", - "integrity": "sha512-Tcjao/VsLFU1/9lF05Lv1+o31BNZcz56WeuCFhISw2q9xVN/y4Ftbz3SAl+YiO+xpThhsYXrFH8hJQw2kNkYjw==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@loopback/repository/-/repository-1.6.1.tgz", + "integrity": "sha512-Qk0hgv9Zl3FMQvA51NEudD5DzI4gmLYG8/a4GSN3difehusHRxc3APxbvgOwksXJ6GQS7GxMzx5Uws1IZ5dS2Q==", "requires": { - "@loopback/context": "^1.17.1", - "@loopback/core": "^1.7.3", + "@loopback/context": "^1.19.0", + "@loopback/core": "^1.8.1", "@types/debug": "^4.1.4", "debug": "^4.0.1", "lodash": "^4.17.11", @@ -352,26 +350,26 @@ } }, "@loopback/repository-json-schema": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/@loopback/repository-json-schema/-/repository-json-schema-1.5.1.tgz", - "integrity": "sha512-xR55nqYEJHeGODLVQDfWaMvn3uMNRFcvbXFlHgjEqmzCC5uFbL/hY710sGMw9EdhoUIC90IMMQF5NYS5sogSsw==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@loopback/repository-json-schema/-/repository-json-schema-1.6.1.tgz", + "integrity": "sha512-GTlwX3G+I94ptPZWJr3S2JRXOXgPRmlngPr3EOskWDxAglCZb3VauRxug+6BmbmBo+96Hn4P9ifCCtfItKXFeA==", "requires": { - "@loopback/context": "^1.17.1", - "@loopback/metadata": "^1.1.7", - "@loopback/repository": "^1.5.8", + "@loopback/context": "^1.19.0", + "@loopback/metadata": "^1.2.1", + "@loopback/repository": "^1.6.1", "@types/json-schema": "^7.0.1" } }, "@loopback/rest": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/@loopback/rest/-/rest-1.13.1.tgz", - "integrity": "sha512-MT54Szswy/piDv/IKgOcBuPWe5Yb5IJhooyrFiUBqaSXj2V0BTdb7XbHSASCOFl8GTcYXV3OAW21CNm5vkiw/w==", - "requires": { - "@loopback/context": "^1.17.1", - "@loopback/core": "^1.7.3", - "@loopback/http-server": "^1.2.6", - "@loopback/openapi-v3": "^1.5.1", - "@loopback/openapi-v3-types": "^1.0.21", + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@loopback/rest/-/rest-1.15.0.tgz", + "integrity": "sha512-L4joloXqOZjQ2YfOAawc6Xb/MAnfHY3G5nZWHYQjhwlOs6gOSDAQU4FGcDJ7fK6sHpPrplQK77V4YrbdZ8qniw==", + "requires": { + "@loopback/context": "^1.19.0", + "@loopback/core": "^1.8.1", + "@loopback/http-server": "^1.4.0", + "@loopback/openapi-v3": "^1.6.1", + "@loopback/openapi-v3-types": "^1.1.1", "@types/body-parser": "^1.17.0", "@types/cors": "^2.8.5", "@types/express": "^4.11.1", @@ -395,198 +393,34 @@ "strong-error-handler": "^3.2.0", "type-is": "^1.6.17", "validator": "^11.0.0" - }, - "dependencies": { - "content-disposition": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", - "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", - "requires": { - "safe-buffer": "5.1.2" - } - }, - "cookie": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", - "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" - }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" - }, - "express": { - "version": "4.17.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", - "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", - "requires": { - "accepts": "~1.3.7", - "array-flatten": "1.1.1", - "body-parser": "1.19.0", - "content-disposition": "0.5.3", - "content-type": "~1.0.4", - "cookie": "0.4.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "~1.1.2", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "~1.1.2", - "fresh": "0.5.2", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.5", - "qs": "6.7.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.1.2", - "send": "0.17.1", - "serve-static": "1.14.1", - "setprototypeof": "1.1.1", - "statuses": "~1.5.0", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" - } - } - }, - "finalhandler": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", - "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", - "requires": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "statuses": "~1.5.0", - "unpipe": "~1.0.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - } - } - }, - "mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" - }, - "send": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", - "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", - "requires": { - "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "~1.7.2", - "mime": "1.6.0", - "ms": "2.1.1", - "on-finished": "~2.3.0", - "range-parser": "~1.2.1", - "statuses": "~1.5.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - }, - "dependencies": { - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - } - } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" - } - } - }, - "serve-static": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", - "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", - "requires": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.17.1" - } - } } }, "@loopback/rest-explorer": { - "version": "1.1.25", - "resolved": "https://registry.npmjs.org/@loopback/rest-explorer/-/rest-explorer-1.1.25.tgz", - "integrity": "sha512-jIOd7ikUvQb4qm86VhJLGM9RrT362iMi0bkdH+VmphaDekVd3iCQDMKjxP+jgsea4mxtIgd621yGdyov4+W7nQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@loopback/rest-explorer/-/rest-explorer-1.2.1.tgz", + "integrity": "sha512-yeC1TmFJbGW2/PwS1I97yO2vD1hS5YDqXwpIzq9fbtnC7reMYgOOeqQ8oHDSZbKrjqx13kp8apNRgBEBzAW7+g==", "requires": { - "@loopback/context": "^1.17.1", - "@loopback/core": "^1.7.3", - "@loopback/rest": "^1.13.1", + "@loopback/context": "^1.19.0", + "@loopback/core": "^1.8.1", + "@loopback/rest": "^1.15.0", "ejs": "^2.6.1", "swagger-ui-dist": "^3.22.1" } }, "@loopback/service-proxy": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/@loopback/service-proxy/-/service-proxy-1.1.13.tgz", - "integrity": "sha512-x3GYoH9fESm3nI4q+fnBG8AUwvgpGMmALJiKzkEdy+uRi2NBCSfTsBaNrWzk4xLfIJsko4Zh2Y7OfswpAqvqmg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@loopback/service-proxy/-/service-proxy-1.2.1.tgz", + "integrity": "sha512-aERnaBwSrAXzxZk9e8rnRHyNrQuLRss7N3t3zXD63u3sycOwT/Hf4dR0hd7ChJCQTrrysh49zYxYNNxNDtU03Q==", "requires": { - "@loopback/context": "^1.17.1", - "@loopback/core": "^1.7.3", + "@loopback/context": "^1.19.0", + "@loopback/core": "^1.8.1", "loopback-datasource-juggler": "^4.7.1" } }, "@loopback/testlab": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@loopback/testlab/-/testlab-1.3.0.tgz", - "integrity": "sha512-sFe4agF4gz0bAe820Bb+eFVRonTvNZGnMItnHenuEeEeQTcp2qdtghpyAECBDQPITxtG+NrZXO8QIwujB26uBQ==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@loopback/testlab/-/testlab-1.5.0.tgz", + "integrity": "sha512-cb6xEE/KGafz46+xJj2fOdDoZYTuz8it+BdBm1GhKQTw5kQEKAh+2ughuFn7Plaa8YT2uPNCNTBBh4PdfzQfCQ==", "dev": true, "requires": { "@hapi/shot": "^4.0.7", @@ -615,9 +449,9 @@ } }, "@loopback/tslint-config": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@loopback/tslint-config/-/tslint-config-2.0.4.tgz", - "integrity": "sha512-HGTgSAeGGfDaYpaa7ef9xFkb/UpyEY/BaKHhocH7OtvP541BheFK6jVfDzy8tkMHj6Zo09K3cg7E38UeJAQdlQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@loopback/tslint-config/-/tslint-config-2.1.0.tgz", + "integrity": "sha512-nBad15OPtk0TJWR5OhB6TFYyYfpICRAc2cfT6R0t3KH3jrwavY8wGJ6UpZP79UuNPabdkTXIuJ9dBy6cwpyEwQ==", "dev": true, "requires": { "tslint-consistent-codestyle": "^1.14.1" @@ -723,6 +557,12 @@ "@types/node": "*" } }, + "@types/eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", + "dev": true + }, "@types/events": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", @@ -815,9 +655,9 @@ } }, "@types/lodash": { - "version": "4.14.133", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.133.tgz", - "integrity": "sha512-/3JqnvPnY58GLzG3Y7fpphOhATV1DDZ/Ak3DQufjlRK5E4u+s0CfClfNFtAGBabw+jDGtRFbOZe+Z02ZMWCBNQ==", + "version": "4.14.134", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.134.tgz", + "integrity": "sha512-2/O0khFUCFeDlbi7sZ7ZFRCcT812fAeOLm7Ev4KbwASkZ575TDrDcY7YyaoHdTOzKcNbfiwLYZqPmoC4wadrsw==", "dev": true }, "@types/marked": { @@ -855,14 +695,6 @@ "@types/node": "*" } }, - "@types/passport": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/passport/-/passport-1.0.0.tgz", - "integrity": "sha512-R2FXqM+AgsMIym0PuKj08Ybx+GR6d2rU3b1/8OcHolJ+4ga2pRPX105wboV6hq1AJvMo2frQzYKdqXS5+4cyMw==", - "requires": { - "@types/express": "*" - } - }, "@types/range-parser": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.3.tgz", @@ -897,9 +729,9 @@ } }, "@types/sinon": { - "version": "7.0.12", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-7.0.12.tgz", - "integrity": "sha512-fo0MWpVPSUrnZZhp9wyu+hhI3VJ9+Jhs+PWrokBTg3d2ryNPDOAWF1csIhQuYWBTn7KdZzXpRgpX2o6cwOlPWg==", + "version": "7.0.13", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-7.0.13.tgz", + "integrity": "sha512-d7c/C/+H/knZ3L8/cxhicHUiTDxdgap0b/aNJfsmLwFu/iOP17mdgbQsbHA3SJmrzsjD0l3UEE5SN4xxuz5ung==", "dev": true }, "@types/superagent": { @@ -929,6 +761,70 @@ "@types/node": "*" } }, + "@typescript-eslint/eslint-plugin": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.10.2.tgz", + "integrity": "sha512-7449RhjE1oLFIy5E/5rT4wG5+KsfPzakJuhvpzXJ3C46lq7xywY0/Rjo9ZBcwrfbk0nRZ5xmUHkk7DZ67tSBKw==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "1.10.2", + "eslint-utils": "^1.3.1", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^2.0.1", + "tsutils": "^3.7.0" + }, + "dependencies": { + "tsutils": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.14.0.tgz", + "integrity": "sha512-SmzGbB0l+8I0QwsPgjooFRaRvHLBLNYM8SeQ0k6rtNDru5sCGeLJcZdwilNndN+GysuFjF5EIYgN8GfFG6UeUw==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + } + } + }, + "@typescript-eslint/experimental-utils": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-1.10.2.tgz", + "integrity": "sha512-Hf5lYcrnTH5Oc67SRrQUA7KuHErMvCf5RlZsyxXPIT6AXa8fKTyfFO6vaEnUmlz48RpbxO4f0fY3QtWkuHZNjg==", + "dev": true, + "requires": { + "@typescript-eslint/typescript-estree": "1.10.2", + "eslint-scope": "^4.0.0" + } + }, + "@typescript-eslint/parser": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-1.10.2.tgz", + "integrity": "sha512-xWDWPfZfV0ENU17ermIUVEVSseBBJxKfqBcRCMZ8nAjJbfA5R7NWMZmFFHYnars5MjK4fPjhu4gwQv526oZIPQ==", + "dev": true, + "requires": { + "@types/eslint-visitor-keys": "^1.0.0", + "@typescript-eslint/experimental-utils": "1.10.2", + "@typescript-eslint/typescript-estree": "1.10.2", + "eslint-visitor-keys": "^1.0.0" + } + }, + "@typescript-eslint/typescript-estree": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-1.10.2.tgz", + "integrity": "sha512-Kutjz0i69qraOsWeI8ETqYJ07tRLvD9URmdrMoF10bG8y8ucLmPtSxROvVejWvlJUGl2et/plnMiKRDW+rhEhw==", + "dev": true, + "requires": { + "lodash.unescape": "4.0.1", + "semver": "5.5.0" + }, + "dependencies": { + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + } + } + }, "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -1383,7 +1279,6 @@ "version": "0.5.3", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", - "dev": true, "requires": { "safe-buffer": "5.1.2" } @@ -1405,8 +1300,7 @@ "cookie": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", - "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", - "dev": true + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" }, "cookie-signature": { "version": "1.0.6", @@ -1813,6 +1707,21 @@ "text-table": "^0.2.0" } }, + "eslint-config-prettier": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-4.3.0.tgz", + "integrity": "sha512-sZwhSTHVVz78+kYD3t5pCWSYEdVSBR0PXnwjDRsUs8ytIrK8PLXw+6FKp8r3Z7rx4ZszdetWlXYKOHoUrrwPlA==", + "dev": true, + "requires": { + "get-stdin": "^6.0.0" + } + }, + "eslint-plugin-eslint-plugin": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-eslint-plugin/-/eslint-plugin-eslint-plugin-2.1.0.tgz", + "integrity": "sha512-kT3A/ZJftt28gbl/Cv04qezb/NQ1dwYIbi8lyf806XMxkus7DvOVCLIfTXMrorp322Pnoez7+zabXH29tADIDg==", + "dev": true + }, "eslint-plugin-mocha": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-5.3.0.tgz", @@ -1913,7 +1822,6 @@ "version": "4.17.1", "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", - "dev": true, "requires": { "accepts": "~1.3.7", "array-flatten": "1.1.1", @@ -1951,7 +1859,6 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, "requires": { "ms": "2.0.0" } @@ -1959,20 +1866,17 @@ "depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, "path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", - "dev": true + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" } } }, @@ -2045,7 +1949,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", - "dev": true, "requires": { "debug": "2.6.9", "encodeurl": "~1.0.2", @@ -2060,7 +1963,6 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, "requires": { "ms": "2.0.0" } @@ -2068,8 +1970,7 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" } } }, @@ -2279,6 +2180,12 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + }, "get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", @@ -3100,6 +3007,12 @@ "resolved": "https://registry.npmjs.org/lodash.shuffle/-/lodash.shuffle-4.2.0.tgz", "integrity": "sha1-FFtQU8+HX29cKjP0i26ZSMbse0s=" }, + "lodash.unescape": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.unescape/-/lodash.unescape-4.0.1.tgz", + "integrity": "sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw=", + "dev": true + }, "lodash.values": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.values/-/lodash.values-4.3.0.tgz", @@ -3115,9 +3028,9 @@ } }, "lolex": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.0.1.tgz", - "integrity": "sha512-UHuOBZ5jjsKuzbB/gRNNW8Vg8f00Emgskdq2kvZxgBJCS0aqquAuXai/SkWORlKeZEiNQWZjFZOqIUcH9LqKCw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.1.0.tgz", + "integrity": "sha512-BYxIEXiVq5lGIXeVHnsFzqa1TxN5acnKnPCdlZSpzm8viNEOhiigupA4vTQ9HEFQ6nLTQ9wQOgBknJgzUYQ9Aw==", "dev": true }, "loopback-connector": { @@ -3194,9 +3107,9 @@ } }, "loopback-datasource-juggler": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/loopback-datasource-juggler/-/loopback-datasource-juggler-4.7.1.tgz", - "integrity": "sha512-pUB/j1OjYHWY1AbhR517/r8MuujMW3x5kgAq+bHVWHl3q1s1Glg6swETRO5ut0mGIkC+dDFcA0b2nFAie/vBjA==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/loopback-datasource-juggler/-/loopback-datasource-juggler-4.8.0.tgz", + "integrity": "sha512-cGwTX0F7r4np9csnoImEtUXurdOBG6BnO2Cjo+SNfR5P5OfMHAfStS1uJtdChyX5vXaNmQH75hWkjbbB5ThEeQ==", "requires": { "async": "^2.6.0", "debug": "^4.1.0", @@ -3213,15 +3126,10 @@ } }, "loopback4-authentication": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/loopback4-authentication/-/loopback4-authentication-1.0.6.tgz", - "integrity": "sha512-bqf743tI6u0XxbklmwKhS8TXHz1gGXmXkE7D+iHI6LGsyJciKN0DfUSlQc9bsboyJm7klDwgwbHtJ8tFxluVMQ==", - "requires": { - "@loopback/boot": "^1.2.10", - "@loopback/context": "^1.17.1", - "@loopback/core": "^1.7.3", - "@loopback/rest": "^1.13.1", - "@types/passport": "^1.0.0", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/loopback4-authentication/-/loopback4-authentication-1.1.1.tgz", + "integrity": "sha512-lBG8jKQ5jLVYt9lxB34ItqTdwoxYz2PvPPz6Y2t80ETllev89TNb0T+vliqFOBrBpEwfU9jRcYjwo9tsptqz3w==", + "requires": { "passport": "^0.4.0", "passport-http-bearer": "^1.0.1", "passport-local": "^1.0.0", @@ -3229,24 +3137,22 @@ } }, "loopback4-authorization": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/loopback4-authorization/-/loopback4-authorization-2.0.1.tgz", - "integrity": "sha512-S0k6kW8Up981JUuTiw6NbN/+9BXv/SsgPxw9lruiB2XuIXdUWmdbFENokIxdPF+NZSMPY/hjv5wJ1B7/OGF50w==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/loopback4-authorization/-/loopback4-authorization-2.1.0.tgz", + "integrity": "sha512-G2QHdUVfD95/Qb0Rty1nzwioCafHQTpPzuiaI652WYXYT6EPXmj48F6PIIY7u6ng1sp8iMn9ASDB47RvWOkdWw==", "requires": { - "@loopback/boot": "^1.2.10", - "@loopback/context": "^1.17.1", - "@loopback/core": "^1.7.3", "lodash": "^4.17.11" } }, "loopback4-soft-delete": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/loopback4-soft-delete/-/loopback4-soft-delete-1.0.4.tgz", - "integrity": "sha512-/VnLe3LYznBCnY4hS8YmEgkBMtKFmJyqZeTMWRwoOmYDQqlnH04dMbbH/b/0ZHPmi0lEb8lPRzeWFO0rWMTfsg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/loopback4-soft-delete/-/loopback4-soft-delete-1.1.2.tgz", + "integrity": "sha512-JZxdXVoH+Rg9cuDZYrnCwDgeLwqyWyW8gmvxRty5atPD2/J/RPYmUm6c+GfPeFTPswlcV5VByJ6IvEPsch2qkg==", "requires": { - "@loopback/boot": "^1.2.10", - "@loopback/context": "^1.17.1", - "@loopback/core": "^1.7.3" + "@loopback/boot": "^1.4.0", + "@loopback/context": "^1.19.0", + "@loopback/core": "^1.8.1", + "@loopback/repository": "^1.6.1" } }, "lru-cache": { @@ -3366,8 +3272,7 @@ "mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "dev": true + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" }, "mime-db": { "version": "1.40.0", @@ -3563,15 +3468,15 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" }, "nise": { - "version": "1.4.10", - "resolved": "https://registry.npmjs.org/nise/-/nise-1.4.10.tgz", - "integrity": "sha512-sa0RRbj53dovjc7wombHmVli9ZihXbXCQ2uH3TNm03DyvOSIQbxg+pbqDKrk2oxMK1rtLGVlKxcB9rrc6X5YjA==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/nise/-/nise-1.5.0.tgz", + "integrity": "sha512-Z3sfYEkLFzFmL8KY6xnSJLRxwQwYBjOXi/24lb62ZnZiGA0JUzGGTI6TBIgfCSMIDl9Jlu8SRmHNACLTemDHww==", "dev": true, "requires": { "@sinonjs/formatio": "^3.1.0", "@sinonjs/text-encoding": "^0.7.1", "just-extend": "^4.0.2", - "lolex": "^2.3.2", + "lolex": "^4.1.0", "path-to-regexp": "^1.7.0" }, "dependencies": { @@ -3581,12 +3486,6 @@ "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "dev": true }, - "lolex": { - "version": "2.7.5", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.7.5.tgz", - "integrity": "sha512-l9x0+1offnKKIzYVjyXU2SiwhXDLekRzKyhnbyldPHvC7BvLPVpdNUNR2KeMAiCN2D/kLNttZgQD5WjSxuBx3Q==", - "dev": true - }, "path-to-regexp": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", @@ -4314,9 +4213,9 @@ "dev": true }, "prettier": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.17.1.tgz", - "integrity": "sha512-TzGRNvuUSmPgwivDqkZ9tM/qTGW9hqDKWOE9YHiyQdixlKbv7kvEqsmDPrcHJTKwthU774TQwZXVtaQ/mMsvjg==", + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz", + "integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==", "dev": true }, "process-nextick-args": { @@ -4386,8 +4285,7 @@ "range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "dev": true + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" }, "raw-body": { "version": "2.4.0", @@ -4609,7 +4507,6 @@ "version": "0.17.1", "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", - "dev": true, "requires": { "debug": "2.6.9", "depd": "~1.1.2", @@ -4630,7 +4527,6 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, "requires": { "ms": "2.0.0" }, @@ -4638,16 +4534,14 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" } } }, "depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" } } }, @@ -4655,7 +4549,6 @@ "version": "1.14.1", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", - "dev": true, "requires": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", @@ -5094,14 +4987,14 @@ } }, "swagger-ui-dist": { - "version": "3.22.2", - "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-3.22.2.tgz", - "integrity": "sha512-37RuIYRKjFfoLPctzA2dWvBMJjWa1GLc0NgmubuRbr16b3pSuf9S0rY+82l6F86VV4xlgdPiLMcOZhqcIg/OOg==" + "version": "3.22.3", + "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-3.22.3.tgz", + "integrity": "sha512-tmjAsqT43pqg5UoiQ2805c+juX0ASSoI/Ash/0c19jjAOFtTfE93ZrzmFd9hjqVgre935CYeXT0uaku42Lu8xg==" }, "table": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.0.tgz", - "integrity": "sha512-nHFDrxmbrkU7JAFKqKbDJXfzrX2UBsWmrieXFTGxiI5e4ncg3VqsZeI4EzNmX0ncp4XNGVeoxIWJXfCIXwrsvw==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.1.tgz", + "integrity": "sha512-E6CK1/pZe2N75rGZQotFOdmzWQ1AILtgYbMAbAjvms0S1l5IDB47zG3nCnFGB/w+7nB3vKofbLXCH7HPBo864w==", "dev": true, "requires": { "ajv": "^6.9.1", @@ -5366,9 +5259,9 @@ "dev": true }, "typescript": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.1.tgz", - "integrity": "sha512-64HkdiRv1yYZsSe4xC1WVgamNigVYjlssIoaH2HcZF0+ijsk5YK2g0G34w9wJkze8+5ow4STd22AynfO6ZYYLw==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.2.tgz", + "integrity": "sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA==", "dev": true }, "typpy": { diff --git a/package.json b/package.json index 723c1af..18d26f6 100644 --- a/package.json +++ b/package.json @@ -50,14 +50,14 @@ "!*/__tests__" ], "dependencies": { - "@loopback/boot": "^1.2.10", - "@loopback/context": "^1.17.1", - "@loopback/core": "^1.7.3", - "@loopback/openapi-v3": "^1.5.1", - "@loopback/repository": "^1.5.8", - "@loopback/rest": "^1.13.1", - "@loopback/rest-explorer": "^1.1.25", - "@loopback/service-proxy": "^1.1.13", + "@loopback/boot": "^1.4.0", + "@loopback/context": "^1.19.0", + "@loopback/core": "^1.8.1", + "@loopback/openapi-v3": "^1.6.1", + "@loopback/repository": "^1.6.1", + "@loopback/rest": "^1.15.0", + "@loopback/rest-explorer": "^1.2.1", + "@loopback/service-proxy": "^1.2.1", "bcrypt": "^3.0.6", "db-migrate": "^0.11.5", "db-migrate-pg": "^0.5.1", @@ -68,18 +68,18 @@ "loopback-connector": "^4.7.0", "loopback-connector-kv-redis": "^3.0.1", "loopback-connector-postgresql": "^3.6.1", - "loopback4-authentication": "^1.0.6", - "loopback4-authorization": "^2.0.1", - "loopback4-soft-delete": "^1.0.4" + "loopback4-authentication": "^1.1.1", + "loopback4-authorization": "^2.1.0", + "loopback4-soft-delete": "^1.1.2" }, "devDependencies": { - "@loopback/build": "^1.6.1", - "@loopback/testlab": "^1.3.0", - "@loopback/tslint-config": "^2.0.4", + "@loopback/build": "^1.7.1", + "@loopback/testlab": "^1.5.0", + "@loopback/tslint-config": "^2.1.0", "@types/bcrypt": "^3.0.0", "@types/jsonwebtoken": "^8.3.2", "@types/node": "^10.11.2", "tslint": "^5.17.0", - "typescript": "^3.5.1" + "typescript": "^3.5.2" } } diff --git a/src/application.ts b/src/application.ts index c9c1f73..0401706 100644 --- a/src/application.ts +++ b/src/application.ts @@ -45,6 +45,8 @@ export class Loopback4StarterApplication extends BootMixin( }); this.component(RestExplorerComponent); + // Add authentication component + this.component(AuthenticationComponent); // Customize authentication verify handlers this.bind( AuthenticationBindings.Passport.OAUTH2_CLIENT_PASSWORD_VERIFIER, @@ -58,8 +60,6 @@ export class Loopback4StarterApplication extends BootMixin( this.bind( AuthenticationBindings.Passport.RESOURCE_OWNER_PASSWORD_VERIFIER, ).toProvider(ResourceOwnerVerifyProvider); - // Add authentication component - this.component(AuthenticationComponent); // Add authorization component this.bind(AuthorizationBindings.CONFIG).to({ diff --git a/src/models/role.model.ts b/src/models/role.model.ts index 87679fe..e16f715 100644 --- a/src/models/role.model.ts +++ b/src/models/role.model.ts @@ -35,3 +35,9 @@ export class Role extends BaseEntity { super(data); } } + +export interface RoleRelations { + // describe navigational properties here +} + +export type RoleWithRelations = Role; diff --git a/src/models/tenant.model.ts b/src/models/tenant.model.ts index f6f40ed..dc98357 100644 --- a/src/models/tenant.model.ts +++ b/src/models/tenant.model.ts @@ -76,3 +76,9 @@ export class Tenant extends UserModifiableEntity { super(data); } } + +export interface TenantRelations { + // describe navigational properties here +} + +export type TenantWithRelations = Tenant; diff --git a/src/models/user-tenant-permission.model.ts b/src/models/user-tenant-permission.model.ts index 367d300..c4a7afe 100644 --- a/src/models/user-tenant-permission.model.ts +++ b/src/models/user-tenant-permission.model.ts @@ -1,7 +1,7 @@ import {model, property, belongsTo} from '@loopback/repository'; import {UserModifiableEntity} from './user-modifiable-entity.model'; -import {UserTenant} from './user-tenant.model'; +import {UserTenant, UserTenantWithRelations} from './user-tenant.model'; import {UserPermission} from 'loopback4-authorization'; @model({ @@ -42,3 +42,10 @@ export class UserTenantPermission extends UserModifiableEntity super(data); } } + +export interface UserTenantPermissionRelations { + userTenant: UserTenantWithRelations; +} + +export type UserTenantPermissionWithRelations = UserTenantPermission & + UserTenantPermissionRelations; diff --git a/src/models/user-tenant.model.ts b/src/models/user-tenant.model.ts index a15424d..6a33170 100644 --- a/src/models/user-tenant.model.ts +++ b/src/models/user-tenant.model.ts @@ -1,9 +1,8 @@ -import {belongsTo, model, property} from '@loopback/repository'; - +import {model, property, belongsTo} from '@loopback/repository'; import {BaseEntity} from './base-entity.model'; -import {Role} from './role.model'; -import {Tenant} from './tenant.model'; -import {User} from './user.model'; +import {Tenant, TenantWithRelations} from './tenant.model'; +import {User, UserWithRelations} from './user.model'; +import {Role, RoleWithRelations} from './role.model'; @model({ name: 'user_tenants', @@ -56,3 +55,11 @@ export class UserTenant extends BaseEntity { super(data); } } + +export interface UserTenantRelations { + user: UserWithRelations; + tenant: TenantWithRelations; + role: RoleWithRelations; +} + +export type UserTenantWithRelations = UserTenant & UserTenantRelations; diff --git a/src/models/user.model.ts b/src/models/user.model.ts index 84d6421..4b0fc48 100644 --- a/src/models/user.model.ts +++ b/src/models/user.model.ts @@ -1,7 +1,6 @@ import {model, property} from '@loopback/repository'; -import {IAuthUser} from 'loopback4-authentication'; - import {UserModifiableEntity} from './user-modifiable-entity.model'; +import {IAuthUser} from 'loopback4-authentication'; @model({ name: 'users', @@ -72,3 +71,9 @@ export class User extends UserModifiableEntity implements IAuthUser { super(data); } } + +export interface UserRelations { + // describe navigational properties here +} + +export type UserWithRelations = User; diff --git a/src/modules/auth/error-keys.ts b/src/modules/auth/error-keys.ts index 8cc06f8..8266e8f 100644 --- a/src/modules/auth/error-keys.ts +++ b/src/modules/auth/error-keys.ts @@ -2,4 +2,5 @@ export const enum AuthenticateErrorKeys { UserDoesNotExist = 'UserDoesNotExist', UserInactive = 'User is inactive', TokenRevoked = 'Token is revoked', + TempPasswordLoginDisallowed = 'Login not allowed using temporary password. Please reset password.', } diff --git a/src/repositories/default-soft-crud.repository.base.ts b/src/repositories/default-soft-crud.repository.base.ts index 52e9a54..453607c 100644 --- a/src/repositories/default-soft-crud.repository.base.ts +++ b/src/repositories/default-soft-crud.repository.base.ts @@ -2,5 +2,6 @@ import {SoftCrudRepository, SoftDeleteEntity} from 'loopback4-soft-delete'; export abstract class DefaultSoftCrudRepository< T extends SoftDeleteEntity, - ID -> extends SoftCrudRepository {} + ID, + Relations extends object = {} +> extends SoftCrudRepository {} diff --git a/src/repositories/default-user-modify-crud.repository.base.ts b/src/repositories/default-user-modify-crud.repository.base.ts index 9beeb43..3313898 100644 --- a/src/repositories/default-user-modify-crud.repository.base.ts +++ b/src/repositories/default-user-modify-crud.repository.base.ts @@ -10,8 +10,9 @@ import {AuthErrorKeys} from 'loopback4-authentication'; export abstract class DefaultUserModifyCrudRepository< T extends UserModifiableEntity, - ID -> extends SoftCrudRepository { + ID, + Relations extends object = {} +> extends SoftCrudRepository { constructor( entityClass: typeof UserModifiableEntity & { prototype: T; diff --git a/src/repositories/user-tenant-permission.repository.ts b/src/repositories/user-tenant-permission.repository.ts index 08eeb12..a8fef55 100644 --- a/src/repositories/user-tenant-permission.repository.ts +++ b/src/repositories/user-tenant-permission.repository.ts @@ -3,14 +3,19 @@ import {BelongsToAccessor, repository} from '@loopback/repository'; import {AuthenticationBindings} from 'loopback4-authentication'; import {PgdbDataSource} from '../datasources'; -import {UserTenant, UserTenantPermission} from '../models'; +import { + UserTenant, + UserTenantPermission, + UserTenantPermissionRelations, +} from '../models'; import {AuthUser} from '../modules/auth'; import {DefaultUserModifyCrudRepository} from './default-user-modify-crud.repository.base'; import {UserTenantRepository} from './user-tenant.repository'; export class UserTenantPermissionRepository extends DefaultUserModifyCrudRepository< UserTenantPermission, - typeof UserTenantPermission.prototype.id + typeof UserTenantPermission.prototype.id, + UserTenantPermissionRelations > { public readonly userTenant: BelongsToAccessor< UserTenant, @@ -25,7 +30,7 @@ export class UserTenantPermissionRepository extends DefaultUserModifyCrudReposit ) { super(UserTenantPermission, dataSource, getCurrentUser); - this.userTenant = this._createBelongsToAccessorFor( + this.userTenant = this.createBelongsToAccessorFor( 'user_tenant_id', utRepositoryGetter, ); diff --git a/src/repositories/user-tenant.repository.ts b/src/repositories/user-tenant.repository.ts index a587069..3996b16 100644 --- a/src/repositories/user-tenant.repository.ts +++ b/src/repositories/user-tenant.repository.ts @@ -2,7 +2,7 @@ import {Getter, inject} from '@loopback/core'; import {BelongsToAccessor, repository} from '@loopback/repository'; import {PgdbDataSource} from '../datasources'; -import {Role, Tenant, User, UserTenant} from '../models'; +import {Role, Tenant, User, UserTenant, UserTenantRelations} from '../models'; import {DefaultSoftCrudRepository} from './default-soft-crud.repository.base'; import {RoleRepository} from './role.repository'; import {TenantRepository} from './tenant.repository'; @@ -10,7 +10,8 @@ import {UserRepository} from './user.repository'; export class UserTenantRepository extends DefaultSoftCrudRepository< UserTenant, - typeof UserTenant.prototype.id + typeof UserTenant.prototype.id, + UserTenantRelations > { public readonly tenant: BelongsToAccessor< Tenant, @@ -31,17 +32,17 @@ export class UserTenantRepository extends DefaultSoftCrudRepository< ) { super(UserTenant, dataSource); - this.tenant = this._createBelongsToAccessorFor( + this.tenant = this.createBelongsToAccessorFor( 'tenant_id', tenantRepositoryGetter, ); - this.user = this._createBelongsToAccessorFor( + this.user = this.createBelongsToAccessorFor( 'user_id', userRepositoryGetter, ); - this.role = this._createBelongsToAccessorFor( + this.role = this.createBelongsToAccessorFor( 'role_id', roleRepositoryGetter, ); diff --git a/src/repositories/user.repository.ts b/src/repositories/user.repository.ts index 41e7834..485e055 100644 --- a/src/repositories/user.repository.ts +++ b/src/repositories/user.repository.ts @@ -6,7 +6,7 @@ import * as bcrypt from 'bcrypt'; import {AuthenticationBindings, AuthErrorKeys} from 'loopback4-authentication'; import {PgdbDataSource} from '../datasources'; -import {User} from '../models'; +import {User, UserRelations} from '../models'; import {AuthUser} from '../modules/auth'; import {AuthenticateErrorKeys} from '../modules/auth/error-keys'; import {DefaultUserModifyCrudRepository} from './default-user-modify-crud.repository.base'; @@ -45,6 +45,12 @@ export class UserRepository extends DefaultUserModifyCrudRepository< throw new HttpErrors.Unauthorized(AuthenticateErrorKeys.UserDoesNotExist); } else if (!(await bcrypt.compare(password, user.password))) { throw new HttpErrors.Unauthorized(AuthErrorKeys.InvalidCredentials); + } else if ( + await bcrypt.compare(password, process.env.USER_TEMP_PASSWORD!) + ) { + throw new HttpErrors.Forbidden( + AuthenticateErrorKeys.TempPasswordLoginDisallowed, + ); } return user; }