diff --git a/package-lock.json b/package-lock.json index 1f75c4651..162d0e009 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,11 +9,11 @@ "version": "2.0.0", "license": "MIT", "dependencies": { - "@paperbits/azure": "0.1.419", - "@paperbits/common": "0.1.419", - "@paperbits/core": "0.1.419", - "@paperbits/prosemirror": "0.1.419", - "@paperbits/styles": "0.1.419", + "@paperbits/azure": "0.1.424", + "@paperbits/common": "0.1.424", + "@paperbits/core": "0.1.424", + "@paperbits/prosemirror": "0.1.424", + "@paperbits/styles": "0.1.424", "@webcomponents/custom-elements": "1.4.2", "@webcomponents/shadydom": "^1.7.4", "adal-vanilla": "^1.0.18", @@ -35,10 +35,8 @@ "remark": "^13.0.0", "remark-html": "^13.0.1", "saxen": "^8.1.2", - "slick": "^1.12.2", "topojson-client": "^3.1.0", - "truncate-html": "^1.0.3", - "xhr2": "^0.2.0" + "truncate-html": "^1.0.3" }, "devDependencies": { "@azure/storage-blob": "12.4.1", @@ -301,11 +299,14 @@ } }, "node_modules/@babel/runtime": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.0.tgz", - "integrity": "sha512-JELkvo/DlpNdJ7dlyw/eY7E0suy5i5GQH+Vlxaq1nsNJ+H7f4Vtv3jMeCEgRhZZQFXTjldYfQgv2qmM6M1v5wA==", + "version": "7.14.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.6.tgz", + "integrity": "sha512-/PCB2uJ7oM44tz8YhC4Z/6PeOKXp4K588f+5M3clr1M4zbqztlo0XEfJ2LEzj/FgwfgGcIdl8n7YYjTCI0BYwg==", "dependencies": { "regenerator-runtime": "^0.13.4" + }, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@googlemaps/js-api-loader": { @@ -403,13 +404,13 @@ } }, "node_modules/@paperbits/azure": { - "version": "0.1.419", - "resolved": "https://registry.npmjs.org/@paperbits/azure/-/azure-0.1.419.tgz", - "integrity": "sha512-TR7g5HF1rE4krTEpOrCGQIhH+ONT0ybhBEhwaLgyB4cEUPu1TZrggf78HBREfjs9axFLX3FvcNZ2L0ZbQvlOtg==", + "version": "0.1.424", + "resolved": "https://registry.npmjs.org/@paperbits/azure/-/azure-0.1.424.tgz", + "integrity": "sha512-D9DNCoW1wwbEsDdw/wvAClpI7X4a9LMgh5eFlkJJtIZpWBw8O4Je/MEHbV1rvmqzf9d0hxiLvT+0UThUSDZCow==", "license": "MIT", "dependencies": { "@azure/storage-blob": "12.5.0", - "@paperbits/common": "0.1.419", + "@paperbits/common": "0.1.424", "applicationinsights-js": "1.0.21", "mime-types": "2.1.30" } @@ -452,9 +453,9 @@ "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==" }, "node_modules/@paperbits/common": { - "version": "0.1.419", - "resolved": "https://registry.npmjs.org/@paperbits/common/-/common-0.1.419.tgz", - "integrity": "sha512-vSjU1ZeK3dnT9+MQVktEcpjfqv5zMMT9VBc9L0MHcPf0SxLYZwKtB8wQJ2jMt3cgdHZDDzcdc2pFVf+pdWbupQ==", + "version": "0.1.424", + "resolved": "https://registry.npmjs.org/@paperbits/common/-/common-0.1.424.tgz", + "integrity": "sha512-k1FWbu93Etfbgo38L2caSNH/9DOR3TKefOyZAfNhi6wJu5tEkd5qfS8Juwf2yHkkYkguB39KDVn1T10KOHh7UQ==", "dependencies": { "deepmerge": "^4.2.2", "domino": "^2.1.4", @@ -471,13 +472,14 @@ } }, "node_modules/@paperbits/core": { - "version": "0.1.419", - "resolved": "https://registry.npmjs.org/@paperbits/core/-/core-0.1.419.tgz", - "integrity": "sha512-yMcew+LhM4k5QjXpA1EPuTOBFcAha4NxEy462g9m2RWYkxuQKntm2ZdkK6rPvjmZNIxdKQ/72WD4KacF3Tf2gQ==", + "version": "0.1.424", + "resolved": "https://registry.npmjs.org/@paperbits/core/-/core-0.1.424.tgz", + "integrity": "sha512-bxteTyWet5JeNylPbviaMJmg5mJIebq8y3ZDqbr8Bw8qXUqiX0BffE1W0HKrvJ6+PjX8btcAGZb9ebIKdr87EQ==", + "license": "MIT", "dependencies": { "@googlemaps/js-api-loader": "^1.11.3", - "@paperbits/common": "0.1.419", - "@paperbits/styles": "0.1.419", + "@paperbits/common": "0.1.424", + "@paperbits/styles": "0.1.424", "await-parallel-limit": "^2.1.0", "basiclightbox": "^5.0.4", "cropperjs": "^1.5.11", @@ -505,11 +507,11 @@ } }, "node_modules/@paperbits/prosemirror": { - "version": "0.1.419", - "resolved": "https://registry.npmjs.org/@paperbits/prosemirror/-/prosemirror-0.1.419.tgz", - "integrity": "sha512-6rbwtE5TfF35e8fYCbNELDAMHeZ0JjtEamLaEBx/1NfELfSh2f4ONM5qprp+Sl+gCHbra8nculm/YWR288tSyA==", + "version": "0.1.424", + "resolved": "https://registry.npmjs.org/@paperbits/prosemirror/-/prosemirror-0.1.424.tgz", + "integrity": "sha512-0to+w+ZKjSvhB00L6XSXdMot03DyuFXhRR2QG0U9ygz4uS1qK32RqoA8EvxzbfCSnwzLq41SXBuAUoGZh88kIQ==", "dependencies": { - "@paperbits/common": "0.1.419", + "@paperbits/common": "0.1.424", "prosemirror-commands": "^1.1.4", "prosemirror-history": "^1.1.3", "prosemirror-inputrules": "^1.1.2", @@ -522,11 +524,11 @@ } }, "node_modules/@paperbits/styles": { - "version": "0.1.419", - "resolved": "https://registry.npmjs.org/@paperbits/styles/-/styles-0.1.419.tgz", - "integrity": "sha512-dZPgJYO7uBIq6gWpuz4ng4uG0DZO1ISQmwN36bEZQHAWYMXGiTD27tAptpCuoHSIZgJUPdL37bXZpMJgLoJAhA==", + "version": "0.1.424", + "resolved": "https://registry.npmjs.org/@paperbits/styles/-/styles-0.1.424.tgz", + "integrity": "sha512-s0ajLlIAbvBAbGIV9p8gXca+g6OT5/2Jp4cfm6Dy/JnJk7T2IXaaxnACmcz8Sc0KIDWHVtsP1NUbeTb8dRHswA==", "dependencies": { - "@paperbits/common": "0.1.419", + "@paperbits/common": "0.1.424", "@simonwep/pickr": "^1.7.4", "jss": "^10.4.0", "jss-preset-default": "^10.4.0", @@ -3764,9 +3766,9 @@ "dev": true }, "node_modules/dns-packet": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.1.tgz", - "integrity": "sha512-0UxfQkMhYAUaZI+xrNZOz/as5KgDU0M/fQ9b6SpkyLbk3GEswDi6PADJVaYJradtRVsRIlF1zLyOodbcTCDzUg==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.4.tgz", + "integrity": "sha512-BQ6F4vycLXBvdrJZ6S3gZewt6rcrks9KBgM9vrhW+knGRqc8uEdT7fuCwloc7nny5xNoMJ17HGH0R/6fpo8ECA==", "dev": true, "dependencies": { "ip": "^1.1.0", @@ -3942,13 +3944,13 @@ } }, "node_modules/enhanced-resolve": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz", - "integrity": "sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz", + "integrity": "sha512-Nv9m36S/vxpsI+Hc4/ZGRs0n9mXqSWGGq49zxb/cJfPAQMbUtttJAlNPS4AQzaBdw/pKskw5bMbekT/Y7W/Wlg==", "dev": true, "dependencies": { "graceful-fs": "^4.1.2", - "memory-fs": "^0.4.0", + "memory-fs": "^0.5.0", "tapable": "^1.0.0" }, "engines": { @@ -3964,6 +3966,19 @@ "node": ">=0.4.0" } }, + "node_modules/enhanced-resolve/node_modules/memory-fs": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", + "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", + "dev": true, + "dependencies": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + }, + "engines": { + "node": ">=4.3.0 <5.0.0 || >=5.10" + } + }, "node_modules/entities": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", @@ -5298,9 +5313,9 @@ } }, "node_modules/glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "dependencies": { "is-glob": "^4.0.1" @@ -7559,18 +7574,24 @@ } }, "node_modules/mini-css-extract-plugin": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-1.0.0.tgz", - "integrity": "sha512-IsmrPv1nkdSUtFCDrAsuv5kg0k/27sLxfXqSz8vLjnbRKrNgoRdQrUNA4MppawvD+GHLkNP6L1P93Bw50ALkbg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-1.6.0.tgz", + "integrity": "sha512-nPFKI7NSy6uONUo9yn2hIfb9vyYvkFu95qki0e21DQ9uaqNKDP15DGpK0KnV6wDroWxPHtExrdEwx/yDQ8nVRw==", "dev": true, "dependencies": { "loader-utils": "^2.0.0", - "normalize-url": "1.9.1", "schema-utils": "^3.0.0", "webpack-sources": "^1.1.0" }, "engines": { "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^4.4.0 || ^5.0.0" } }, "node_modules/mini-css-extract-plugin/node_modules/big.js": { @@ -8339,9 +8360,9 @@ "dev": true }, "node_modules/node-sass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-5.0.0.tgz", - "integrity": "sha512-opNgmlu83ZCF792U281Ry7tak9IbVC+AKnXGovcQ8LG8wFaJv6cLnRlc6DIHlmNxWEexB5bZxi9SZ9JyUuOYjw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-6.0.0.tgz", + "integrity": "sha512-GDzDmNgWNc9GNzTcSLTi6DU6mzSPupVJoStIi7cF3GjwSE9q1cVakbvAAVSt59vzUjV9JJoSZFKoo9krbjKd2g==", "dev": true, "hasInstallScript": true, "optional": true, @@ -8368,7 +8389,7 @@ "node-sass": "bin/node-sass" }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/node-sass/node_modules/ansi-regex": { @@ -8482,21 +8503,6 @@ "node": ">=0.10.0" } }, - "node_modules/normalize-url": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-1.9.1.tgz", - "integrity": "sha1-LMDWazHqIwNkWENuNiDYWVTGbDw=", - "dev": true, - "dependencies": { - "object-assign": "^4.0.1", - "prepend-http": "^1.0.0", - "query-string": "^4.1.0", - "sort-keys": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/npm-run-path": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", @@ -9363,15 +9369,6 @@ "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", "dev": true }, - "node_modules/prepend-http": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", - "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/prismjs": { "version": "1.23.0", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.23.0.tgz", @@ -9746,12 +9743,24 @@ } }, "node_modules/puppeteer/node_modules/ws": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz", - "integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.0.tgz", + "integrity": "sha512-6ezXvzOZupqKj4jUqbQ9tXuJNo+BR2gU8fFRk3XCP3e0G6WT414u5ELe6Y0vtp7kmSJ3F7YWObSNr1ESsgi4vw==", "dev": true, "engines": { "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } } }, "node_modules/qs": { @@ -9763,19 +9772,6 @@ "node": ">=0.6" } }, - "node_modules/query-string": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz", - "integrity": "sha1-u7aTucqRXCMlFbIosaArYJBD2+s=", - "dev": true, - "dependencies": { - "object-assign": "^4.1.0", - "strict-uri-encode": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/querystring": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", @@ -10410,9 +10406,9 @@ } }, "node_modules/sass-loader": { - "version": "10.1.1", - "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-10.1.1.tgz", - "integrity": "sha512-W6gVDXAd5hR/WHsPicvZdjAWHBcEJ44UahgxcIE196fW2ong0ZHMPO1kZuI5q0VlvMQZh32gpv69PLWQm70qrw==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-10.2.0.tgz", + "integrity": "sha512-kUceLzC1gIHz0zNJPpqRsJyisWatGYNFRmv2CKZK2/ngMJgLqxTbXwe/hJ85luyvZkgqU3VlJ33UVF2T/0g6mw==", "dev": true, "dependencies": { "klona": "^2.0.4", @@ -10430,7 +10426,7 @@ }, "peerDependencies": { "fibers": ">= 3.1.0", - "node-sass": "^4.0.0 || ^5.0.0", + "node-sass": "^4.0.0 || ^5.0.0 || ^6.0.0", "sass": "^1.3.0", "webpack": "^4.36.0 || ^5.0.0" }, @@ -10807,14 +10803,6 @@ "node": ">=8" } }, - "node_modules/slick": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/slick/-/slick-1.12.2.tgz", - "integrity": "sha1-vQSN23TefRymkV+qSldXCzVQwtc=", - "engines": { - "node": "*" - } - }, "node_modules/snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", @@ -11001,27 +10989,6 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "node_modules/sort-keys": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz", - "integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=", - "dev": true, - "dependencies": { - "is-plain-obj": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sort-keys/node_modules/is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/source-list-map": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", @@ -11342,15 +11309,6 @@ "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", "dev": true }, - "node_modules/strict-uri-encode": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", - "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -11533,9 +11491,9 @@ } }, "node_modules/tapable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.0.tgz", - "integrity": "sha512-IlqtmLVaZA2qab8epUXbVWRn3aB1imbDMJtjB3nu4X0NqPkcY/JH9ZtCBWKHWPxs8Svi9tyo8w2dBoi07qZbBA==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", + "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", "dev": true, "engines": { "node": ">=6" @@ -12483,30 +12441,27 @@ "integrity": "sha512-tOhfEwEzFLJzf6d1ZPkYfGj+FWhIpBux9ppoP3rlclw3Z0BZv3N7b7030Z1kYth+6rDuAsXUFr+d0VE6Ed1ikw==" }, "node_modules/watchpack": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.4.tgz", - "integrity": "sha512-aWAgTW4MoSJzZPAicljkO1hsi1oKj/RRq/OJQh2PKI2UKL04c2Bs+MBOB+BBABHTXJpf9mCwHN7ANCvYsvY2sg==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz", + "integrity": "sha512-9P3MWk6SrKjHsGkLT2KHXdQ/9SNkyoJbabxnKOoJepsvJjJG8uYTR3yTPxPQvNDI3w4Nz1xnE0TLHK4RIVe/MQ==", "dev": true, "dependencies": { - "chokidar": "^3.4.1", "graceful-fs": "^4.1.2", "neo-async": "^2.5.0" }, "optionalDependencies": { - "watchpack-chokidar2": "^2.0.0" + "chokidar": "^3.4.1", + "watchpack-chokidar2": "^2.0.1" } }, "node_modules/watchpack-chokidar2": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/watchpack-chokidar2/-/watchpack-chokidar2-2.0.0.tgz", - "integrity": "sha512-9TyfOyN/zLUbA288wZ8IsMZ+6cbzvsNyEzSBp6e/zkifi6xxbl8SmQ/CxQq32k8NNqrdVEVUVSEf56L4rQ/ZxA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/watchpack-chokidar2/-/watchpack-chokidar2-2.0.1.tgz", + "integrity": "sha512-nCFfBIPKr5Sh61s4LPpy1Wtfi0HE8isJ3d2Yb5/Ppw2P2B/3eVSEBjKfN0fmHJSK14+31KwMKmcrzs2GM4P0Ww==", "dev": true, "optional": true, "dependencies": { "chokidar": "^2.1.8" - }, - "engines": { - "node": "<8.10.0" } }, "node_modules/watchpack-chokidar2/node_modules/anymatch": { @@ -12642,9 +12597,9 @@ } }, "node_modules/webpack": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.44.2.tgz", - "integrity": "sha512-6KJVGlCxYdISyurpQ0IPTklv+DULv05rs2hseIXer6D7KrUicRDLFb4IUM1S6LUAKypPM/nSiVSuv8jHu1m3/Q==", + "version": "4.46.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.46.0.tgz", + "integrity": "sha512-6jJuJjg8znb/xRItk7bkT0+Q7AHCYjjFnvKIWQPkNIOyRqoCGvkOs0ipeQzrqz4l5FtN5ZI/ukEHroeX/o1/5Q==", "dev": true, "dependencies": { "@webassemblyjs/ast": "1.9.0", @@ -12655,7 +12610,7 @@ "ajv": "^6.10.2", "ajv-keywords": "^3.4.1", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^4.3.0", + "enhanced-resolve": "^4.5.0", "eslint-scope": "^4.0.3", "json-parse-better-errors": "^1.0.2", "loader-runner": "^2.4.0", @@ -12676,6 +12631,18 @@ }, "engines": { "node": ">=6.11.5" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + }, + "webpack-command": { + "optional": true + } } }, "node_modules/webpack-cli": { @@ -12737,20 +12704,6 @@ "node": ">= 4" } }, - "node_modules/webpack-cli/node_modules/enhanced-resolve": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.3.0.tgz", - "integrity": "sha512-3e87LvavsdxyoCfGusJnrZ5G8SLPOFeHSNpZI/ATL9a5leXo2k0w6MKnbqhdBad9qTobSfB20Ld7UmgoNbAZkQ==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "memory-fs": "^0.5.0", - "tapable": "^1.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/webpack-cli/node_modules/json5": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", @@ -12777,19 +12730,6 @@ "node": ">=4.0.0" } }, - "node_modules/webpack-cli/node_modules/memory-fs": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", - "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", - "dev": true, - "dependencies": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" - }, - "engines": { - "node": ">=4.3.0 <5.0.0 || >=5.10" - } - }, "node_modules/webpack-cli/node_modules/supports-color": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", @@ -13237,33 +13177,6 @@ "node": ">= 4" } }, - "node_modules/webpack/node_modules/enhanced-resolve": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.3.0.tgz", - "integrity": "sha512-3e87LvavsdxyoCfGusJnrZ5G8SLPOFeHSNpZI/ATL9a5leXo2k0w6MKnbqhdBad9qTobSfB20Ld7UmgoNbAZkQ==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "memory-fs": "^0.5.0", - "tapable": "^1.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/webpack/node_modules/enhanced-resolve/node_modules/memory-fs": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", - "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", - "dev": true, - "dependencies": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" - }, - "engines": { - "node": ">=4.3.0 <5.0.0 || >=5.10" - } - }, "node_modules/webpack/node_modules/find-cache-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", @@ -13379,15 +13292,6 @@ "figgy-pudding": "^3.5.1" } }, - "node_modules/webpack/node_modules/tapable": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", - "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/webpack/node_modules/terser-webpack-plugin": { "version": "1.4.5", "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.5.tgz", @@ -13556,9 +13460,9 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "node_modules/ws": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", - "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.2.tgz", + "integrity": "sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==", "dev": true, "dependencies": { "async-limiter": "~1.0.0" @@ -14015,9 +13919,9 @@ } }, "@babel/runtime": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.0.tgz", - "integrity": "sha512-JELkvo/DlpNdJ7dlyw/eY7E0suy5i5GQH+Vlxaq1nsNJ+H7f4Vtv3jMeCEgRhZZQFXTjldYfQgv2qmM6M1v5wA==", + "version": "7.14.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.6.tgz", + "integrity": "sha512-/PCB2uJ7oM44tz8YhC4Z/6PeOKXp4K588f+5M3clr1M4zbqztlo0XEfJ2LEzj/FgwfgGcIdl8n7YYjTCI0BYwg==", "requires": { "regenerator-runtime": "^0.13.4" } @@ -14092,12 +13996,12 @@ "integrity": "sha512-hZNKjKOYsckoOEgBziGMnBcX0M7EtstnCmwz5jZUOUYwlZ+/xxX6z3jPu1XVO2Jivk0eLfuP9GP+vFD49CMetw==" }, "@paperbits/azure": { - "version": "0.1.419", - "resolved": "https://registry.npmjs.org/@paperbits/azure/-/azure-0.1.419.tgz", - "integrity": "sha512-TR7g5HF1rE4krTEpOrCGQIhH+ONT0ybhBEhwaLgyB4cEUPu1TZrggf78HBREfjs9axFLX3FvcNZ2L0ZbQvlOtg==", + "version": "0.1.424", + "resolved": "https://registry.npmjs.org/@paperbits/azure/-/azure-0.1.424.tgz", + "integrity": "sha512-D9DNCoW1wwbEsDdw/wvAClpI7X4a9LMgh5eFlkJJtIZpWBw8O4Je/MEHbV1rvmqzf9d0hxiLvT+0UThUSDZCow==", "requires": { "@azure/storage-blob": "12.5.0", - "@paperbits/common": "0.1.419", + "@paperbits/common": "0.1.424", "applicationinsights-js": "1.0.21", "mime-types": "2.1.30" }, @@ -14136,9 +14040,9 @@ } }, "@paperbits/common": { - "version": "0.1.419", - "resolved": "https://registry.npmjs.org/@paperbits/common/-/common-0.1.419.tgz", - "integrity": "sha512-vSjU1ZeK3dnT9+MQVktEcpjfqv5zMMT9VBc9L0MHcPf0SxLYZwKtB8wQJ2jMt3cgdHZDDzcdc2pFVf+pdWbupQ==", + "version": "0.1.424", + "resolved": "https://registry.npmjs.org/@paperbits/common/-/common-0.1.424.tgz", + "integrity": "sha512-k1FWbu93Etfbgo38L2caSNH/9DOR3TKefOyZAfNhi6wJu5tEkd5qfS8Juwf2yHkkYkguB39KDVn1T10KOHh7UQ==", "requires": { "deepmerge": "^4.2.2", "domino": "^2.1.4", @@ -14155,13 +14059,13 @@ } }, "@paperbits/core": { - "version": "0.1.419", - "resolved": "https://registry.npmjs.org/@paperbits/core/-/core-0.1.419.tgz", - "integrity": "sha512-yMcew+LhM4k5QjXpA1EPuTOBFcAha4NxEy462g9m2RWYkxuQKntm2ZdkK6rPvjmZNIxdKQ/72WD4KacF3Tf2gQ==", + "version": "0.1.424", + "resolved": "https://registry.npmjs.org/@paperbits/core/-/core-0.1.424.tgz", + "integrity": "sha512-bxteTyWet5JeNylPbviaMJmg5mJIebq8y3ZDqbr8Bw8qXUqiX0BffE1W0HKrvJ6+PjX8btcAGZb9ebIKdr87EQ==", "requires": { "@googlemaps/js-api-loader": "^1.11.3", - "@paperbits/common": "0.1.419", - "@paperbits/styles": "0.1.419", + "@paperbits/common": "0.1.424", + "@paperbits/styles": "0.1.424", "await-parallel-limit": "^2.1.0", "basiclightbox": "^5.0.4", "cropperjs": "^1.5.11", @@ -14185,11 +14089,11 @@ } }, "@paperbits/prosemirror": { - "version": "0.1.419", - "resolved": "https://registry.npmjs.org/@paperbits/prosemirror/-/prosemirror-0.1.419.tgz", - "integrity": "sha512-6rbwtE5TfF35e8fYCbNELDAMHeZ0JjtEamLaEBx/1NfELfSh2f4ONM5qprp+Sl+gCHbra8nculm/YWR288tSyA==", + "version": "0.1.424", + "resolved": "https://registry.npmjs.org/@paperbits/prosemirror/-/prosemirror-0.1.424.tgz", + "integrity": "sha512-0to+w+ZKjSvhB00L6XSXdMot03DyuFXhRR2QG0U9ygz4uS1qK32RqoA8EvxzbfCSnwzLq41SXBuAUoGZh88kIQ==", "requires": { - "@paperbits/common": "0.1.419", + "@paperbits/common": "0.1.424", "prosemirror-commands": "^1.1.4", "prosemirror-history": "^1.1.3", "prosemirror-inputrules": "^1.1.2", @@ -14202,11 +14106,11 @@ } }, "@paperbits/styles": { - "version": "0.1.419", - "resolved": "https://registry.npmjs.org/@paperbits/styles/-/styles-0.1.419.tgz", - "integrity": "sha512-dZPgJYO7uBIq6gWpuz4ng4uG0DZO1ISQmwN36bEZQHAWYMXGiTD27tAptpCuoHSIZgJUPdL37bXZpMJgLoJAhA==", + "version": "0.1.424", + "resolved": "https://registry.npmjs.org/@paperbits/styles/-/styles-0.1.424.tgz", + "integrity": "sha512-s0ajLlIAbvBAbGIV9p8gXca+g6OT5/2Jp4cfm6Dy/JnJk7T2IXaaxnACmcz8Sc0KIDWHVtsP1NUbeTb8dRHswA==", "requires": { - "@paperbits/common": "0.1.419", + "@paperbits/common": "0.1.424", "@simonwep/pickr": "^1.7.4", "jss": "^10.4.0", "jss-preset-default": "^10.4.0", @@ -17031,9 +16935,9 @@ "dev": true }, "dns-packet": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.1.tgz", - "integrity": "sha512-0UxfQkMhYAUaZI+xrNZOz/as5KgDU0M/fQ9b6SpkyLbk3GEswDi6PADJVaYJradtRVsRIlF1zLyOodbcTCDzUg==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.4.tgz", + "integrity": "sha512-BQ6F4vycLXBvdrJZ6S3gZewt6rcrks9KBgM9vrhW+knGRqc8uEdT7fuCwloc7nny5xNoMJ17HGH0R/6fpo8ECA==", "dev": true, "requires": { "ip": "^1.1.0", @@ -17201,13 +17105,13 @@ } }, "enhanced-resolve": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz", - "integrity": "sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz", + "integrity": "sha512-Nv9m36S/vxpsI+Hc4/ZGRs0n9mXqSWGGq49zxb/cJfPAQMbUtttJAlNPS4AQzaBdw/pKskw5bMbekT/Y7W/Wlg==", "dev": true, "requires": { "graceful-fs": "^4.1.2", - "memory-fs": "^0.4.0", + "memory-fs": "^0.5.0", "tapable": "^1.0.0" }, "dependencies": { @@ -17216,6 +17120,16 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", "dev": true + }, + "memory-fs": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", + "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", + "dev": true, + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } } } }, @@ -18310,9 +18224,9 @@ } }, "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "requires": { "is-glob": "^4.0.1" @@ -20196,13 +20110,12 @@ } }, "mini-css-extract-plugin": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-1.0.0.tgz", - "integrity": "sha512-IsmrPv1nkdSUtFCDrAsuv5kg0k/27sLxfXqSz8vLjnbRKrNgoRdQrUNA4MppawvD+GHLkNP6L1P93Bw50ALkbg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-1.6.0.tgz", + "integrity": "sha512-nPFKI7NSy6uONUo9yn2hIfb9vyYvkFu95qki0e21DQ9uaqNKDP15DGpK0KnV6wDroWxPHtExrdEwx/yDQ8nVRw==", "dev": true, "requires": { "loader-utils": "^2.0.0", - "normalize-url": "1.9.1", "schema-utils": "^3.0.0", "webpack-sources": "^1.1.0" }, @@ -20841,9 +20754,9 @@ "dev": true }, "node-sass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-5.0.0.tgz", - "integrity": "sha512-opNgmlu83ZCF792U281Ry7tak9IbVC+AKnXGovcQ8LG8wFaJv6cLnRlc6DIHlmNxWEexB5bZxi9SZ9JyUuOYjw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-6.0.0.tgz", + "integrity": "sha512-GDzDmNgWNc9GNzTcSLTi6DU6mzSPupVJoStIi7cF3GjwSE9q1cVakbvAAVSt59vzUjV9JJoSZFKoo9krbjKd2g==", "dev": true, "optional": true, "peer": true, @@ -20952,18 +20865,6 @@ "integrity": "sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=", "dev": true }, - "normalize-url": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-1.9.1.tgz", - "integrity": "sha1-LMDWazHqIwNkWENuNiDYWVTGbDw=", - "dev": true, - "requires": { - "object-assign": "^4.0.1", - "prepend-http": "^1.0.0", - "query-string": "^4.1.0", - "sort-keys": "^1.0.0" - } - }, "npm-run-path": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", @@ -21666,12 +21567,6 @@ "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", "dev": true }, - "prepend-http": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", - "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", - "dev": true - }, "prismjs": { "version": "1.23.0", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.23.0.tgz", @@ -22005,10 +21900,11 @@ } }, "ws": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz", - "integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==", - "dev": true + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.0.tgz", + "integrity": "sha512-6ezXvzOZupqKj4jUqbQ9tXuJNo+BR2gU8fFRk3XCP3e0G6WT414u5ELe6Y0vtp7kmSJ3F7YWObSNr1ESsgi4vw==", + "dev": true, + "requires": {} } } }, @@ -22018,16 +21914,6 @@ "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", "dev": true }, - "query-string": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz", - "integrity": "sha1-u7aTucqRXCMlFbIosaArYJBD2+s=", - "dev": true, - "requires": { - "object-assign": "^4.1.0", - "strict-uri-encode": "^1.0.0" - } - }, "querystring": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", @@ -22560,9 +22446,9 @@ } }, "sass-loader": { - "version": "10.1.1", - "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-10.1.1.tgz", - "integrity": "sha512-W6gVDXAd5hR/WHsPicvZdjAWHBcEJ44UahgxcIE196fW2ong0ZHMPO1kZuI5q0VlvMQZh32gpv69PLWQm70qrw==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-10.2.0.tgz", + "integrity": "sha512-kUceLzC1gIHz0zNJPpqRsJyisWatGYNFRmv2CKZK2/ngMJgLqxTbXwe/hJ85luyvZkgqU3VlJ33UVF2T/0g6mw==", "dev": true, "requires": { "klona": "^2.0.4", @@ -22888,11 +22774,6 @@ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, - "slick": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/slick/-/slick-1.12.2.tgz", - "integrity": "sha1-vQSN23TefRymkV+qSldXCzVQwtc=" - }, "snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", @@ -23054,23 +22935,6 @@ } } }, - "sort-keys": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz", - "integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=", - "dev": true, - "requires": { - "is-plain-obj": "^1.0.0" - }, - "dependencies": { - "is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", - "dev": true - } - } - }, "source-list-map": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", @@ -23351,12 +23215,6 @@ "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", "dev": true }, - "strict-uri-encode": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", - "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", - "dev": true - }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -23499,9 +23357,9 @@ "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==" }, "tapable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.0.tgz", - "integrity": "sha512-IlqtmLVaZA2qab8epUXbVWRn3aB1imbDMJtjB3nu4X0NqPkcY/JH9ZtCBWKHWPxs8Svi9tyo8w2dBoi07qZbBA==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", + "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", "dev": true }, "tar": { @@ -24308,21 +24166,21 @@ "integrity": "sha512-tOhfEwEzFLJzf6d1ZPkYfGj+FWhIpBux9ppoP3rlclw3Z0BZv3N7b7030Z1kYth+6rDuAsXUFr+d0VE6Ed1ikw==" }, "watchpack": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.4.tgz", - "integrity": "sha512-aWAgTW4MoSJzZPAicljkO1hsi1oKj/RRq/OJQh2PKI2UKL04c2Bs+MBOB+BBABHTXJpf9mCwHN7ANCvYsvY2sg==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz", + "integrity": "sha512-9P3MWk6SrKjHsGkLT2KHXdQ/9SNkyoJbabxnKOoJepsvJjJG8uYTR3yTPxPQvNDI3w4Nz1xnE0TLHK4RIVe/MQ==", "dev": true, "requires": { "chokidar": "^3.4.1", "graceful-fs": "^4.1.2", "neo-async": "^2.5.0", - "watchpack-chokidar2": "^2.0.0" + "watchpack-chokidar2": "^2.0.1" } }, "watchpack-chokidar2": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/watchpack-chokidar2/-/watchpack-chokidar2-2.0.0.tgz", - "integrity": "sha512-9TyfOyN/zLUbA288wZ8IsMZ+6cbzvsNyEzSBp6e/zkifi6xxbl8SmQ/CxQq32k8NNqrdVEVUVSEf56L4rQ/ZxA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/watchpack-chokidar2/-/watchpack-chokidar2-2.0.1.tgz", + "integrity": "sha512-nCFfBIPKr5Sh61s4LPpy1Wtfi0HE8isJ3d2Yb5/Ppw2P2B/3eVSEBjKfN0fmHJSK14+31KwMKmcrzs2GM4P0Ww==", "dev": true, "optional": true, "requires": { @@ -24447,9 +24305,9 @@ } }, "webpack": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.44.2.tgz", - "integrity": "sha512-6KJVGlCxYdISyurpQ0IPTklv+DULv05rs2hseIXer6D7KrUicRDLFb4IUM1S6LUAKypPM/nSiVSuv8jHu1m3/Q==", + "version": "4.46.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.46.0.tgz", + "integrity": "sha512-6jJuJjg8znb/xRItk7bkT0+Q7AHCYjjFnvKIWQPkNIOyRqoCGvkOs0ipeQzrqz4l5FtN5ZI/ukEHroeX/o1/5Q==", "dev": true, "requires": { "@webassemblyjs/ast": "1.9.0", @@ -24460,7 +24318,7 @@ "ajv": "^6.10.2", "ajv-keywords": "^3.4.1", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^4.3.0", + "enhanced-resolve": "^4.5.0", "eslint-scope": "^4.0.3", "json-parse-better-errors": "^1.0.2", "loader-runner": "^2.4.0", @@ -24518,29 +24376,6 @@ "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", "dev": true }, - "enhanced-resolve": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.3.0.tgz", - "integrity": "sha512-3e87LvavsdxyoCfGusJnrZ5G8SLPOFeHSNpZI/ATL9a5leXo2k0w6MKnbqhdBad9qTobSfB20Ld7UmgoNbAZkQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "memory-fs": "^0.5.0", - "tapable": "^1.0.0" - }, - "dependencies": { - "memory-fs": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", - "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", - "dev": true, - "requires": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" - } - } - } - }, "find-cache-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", @@ -24635,12 +24470,6 @@ "figgy-pudding": "^3.5.1" } }, - "tapable": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", - "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", - "dev": true - }, "terser-webpack-plugin": { "version": "1.4.5", "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.5.tgz", @@ -24710,17 +24539,6 @@ "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", "dev": true }, - "enhanced-resolve": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.3.0.tgz", - "integrity": "sha512-3e87LvavsdxyoCfGusJnrZ5G8SLPOFeHSNpZI/ATL9a5leXo2k0w6MKnbqhdBad9qTobSfB20Ld7UmgoNbAZkQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "memory-fs": "^0.5.0", - "tapable": "^1.0.0" - } - }, "json5": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", @@ -24741,16 +24559,6 @@ "json5": "^1.0.1" } }, - "memory-fs": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", - "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", - "dev": true, - "requires": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" - } - }, "supports-color": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", @@ -25184,9 +24992,9 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "ws": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", - "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.2.tgz", + "integrity": "sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==", "dev": true, "requires": { "async-limiter": "~1.0.0" diff --git a/package.json b/package.json index 4880df187..520a962f7 100644 --- a/package.json +++ b/package.json @@ -62,11 +62,11 @@ "webpack-merge": "^5.2.0" }, "dependencies": { - "@paperbits/azure": "0.1.419", - "@paperbits/common": "0.1.419", - "@paperbits/core": "0.1.419", - "@paperbits/prosemirror": "0.1.419", - "@paperbits/styles": "0.1.419", + "@paperbits/azure": "0.1.424", + "@paperbits/common": "0.1.424", + "@paperbits/core": "0.1.424", + "@paperbits/prosemirror": "0.1.424", + "@paperbits/styles": "0.1.424", "@webcomponents/custom-elements": "1.4.2", "@webcomponents/shadydom": "^1.7.4", "adal-vanilla": "^1.0.18", @@ -88,9 +88,7 @@ "remark": "^13.0.0", "remark-html": "^13.0.1", "saxen": "^8.1.2", - "slick": "^1.12.2", "topojson-client": "^3.1.0", - "truncate-html": "^1.0.3", - "xhr2": "^0.2.0" + "truncate-html": "^1.0.3" } } diff --git a/src/apim.design.module.ts b/src/apim.design.module.ts index dddf44a61..9dab00905 100644 --- a/src/apim.design.module.ts +++ b/src/apim.design.module.ts @@ -4,6 +4,7 @@ import { MapiObjectStorage, MapiBlobStorage } from "./persistence"; import { DefaultAuthenticator } from "./components/defaultAuthenticator"; import { IInjector, IInjectorModule } from "@paperbits/common/injection"; import { ConsoleLogger } from "@paperbits/common/logging"; +import { DefaultSessionManager } from "@paperbits/common/persistence/defaultSessionManager"; import { ListOfApisModule } from "./components/apis/list-of-apis/ko/listOfApis.module"; import { ListOfApisEditorModule } from "./components/apis/list-of-apis/ko/listOfApisEditor.module"; import { DetailsOfApiModule } from "./components/apis/details-of-api/ko/detailsOfApi.module"; @@ -61,6 +62,7 @@ import { OldContentRouteGuard } from "./routing/oldContentRouteGuard"; import { AccessTokenRefrsher } from "./authentication/accessTokenRefresher"; import { ApiProductsModule } from "./components/apis/api-products/ko/apiProducts.module"; import { ApiProductsEditorModule } from "./components/apis/api-products/ko/apiProductsEditor.module"; +import { RuntimeConfigurator } from "./services/runtimeConfigurator"; export class ApimDesignModule implements IInjectorModule { @@ -130,5 +132,7 @@ export class ApimDesignModule implements IInjectorModule { injector.bindSingleton("oauthService", OAuthService); injector.bindToCollection("autostart", HistoryRouteHandler); injector.bindToCollection("autostart", AccessTokenRefrsher); + injector.bindToCollection("autostart", RuntimeConfigurator); + injector.bindSingleton("sessionManager", DefaultSessionManager); } } \ No newline at end of file diff --git a/src/apim.publish.module.ts b/src/apim.publish.module.ts index 2d8325511..68753364a 100644 --- a/src/apim.publish.module.ts +++ b/src/apim.publish.module.ts @@ -1,3 +1,4 @@ +import { AadConfigPublisher } from "./publishing/aadConfigPublisher"; import { IInjector, IInjectorModule } from "@paperbits/common/injection"; import { ConsoleLogger } from "@paperbits/common/logging"; import { MapiClient } from "./services/mapiClient"; @@ -33,6 +34,8 @@ import { StaticRoleService } from "./services/roleService"; import { ProvisionService } from "./services/provisioningService"; import { OAuthService } from "./services/oauthService"; import { ApiProductsModule } from "./components/apis/api-products/ko/apiProducts.module"; +import { RuntimeConfigPublisher } from "./publishing/runtimeConfigPublisher"; +import { RuntimeConfigBuilder } from "./publishing/runtimeConfigBuilder"; export class ApimPublishModule implements IInjectorModule { public register(injector: IInjector): void { @@ -71,5 +74,10 @@ export class ApimPublishModule implements IInjectorModule { injector.bindSingleton("blobStorage", MapiBlobStorage); injector.bindSingleton("logger", ConsoleLogger); injector.bindSingleton("oauthService", OAuthService); + + injector.bindSingleton("runtimeConfigBuilder", RuntimeConfigBuilder); + injector.bindToCollection("publishers", AadConfigPublisher); + injector.bindToCollection("publishers", RuntimeConfigPublisher); + } } \ No newline at end of file diff --git a/src/apim.runtime.module.ts b/src/apim.runtime.module.ts index 87da2e467..c4d9b5e57 100644 --- a/src/apim.runtime.module.ts +++ b/src/apim.runtime.module.ts @@ -1,73 +1,74 @@ -import "./polyfills"; -import "./bindingHandlers/scrollintoview"; -import "./bindingHandlers/copyToClipboard"; -import "./bindingHandlers/syntaxHighlight"; -import "./bindingHandlers/markdown"; -import "./bindingHandlers/barChart"; -import "./bindingHandlers/mapChart"; -import "./bindingHandlers/minMaxAvgChart"; -import "./bindingHandlers/acceptChange"; -import "./bindingHandlers/tab"; +import "@paperbits/core/ko/bindingHandlers/bindingHandlers.activate"; import "@paperbits/core/ko/bindingHandlers/bindingHandlers.component"; +import "@paperbits/core/ko/bindingHandlers/bindingHandlers.dialog"; import "@paperbits/core/ko/bindingHandlers/bindingHandlers.focus"; -import "@paperbits/core/ko/bindingHandlers/bindingHandlers.activate"; import "@paperbits/core/ko/bindingHandlers/bindingHandlers.scrollable"; -import "@paperbits/core/ko/bindingHandlers/bindingHandlers.dialog"; -import { RouteHelper } from "./routing/routeHelper"; -import { IInjector, IInjectorModule } from "@paperbits/common/injection"; import { DefaultSettingsProvider } from "@paperbits/common/configuration"; +import { IInjector, IInjectorModule } from "@paperbits/common/injection"; import { ConsoleLogger } from "@paperbits/common/logging"; -import { ApiList, ApiListDropdown, ApiListTiles } from "./components/apis/list-of-apis/ko/runtime"; -import { ApiService } from "./services/apiService"; -import { TagService } from "./services/tagService"; -import { TenantService } from "./services/tenantService"; -import { AnalyticsService } from "./services/analyticsService"; +import { DefaultSessionManager } from "@paperbits/common/persistence/defaultSessionManager"; +import { ViewStack } from "@paperbits/common/ui/viewStack"; +import { BalloonBindingHandler, ResizableBindingHandler } from "@paperbits/core/ko/bindingHandlers"; +import "./bindingHandlers/acceptChange"; +import "./bindingHandlers/barChart"; +import "./bindingHandlers/copyToClipboard"; +import "./bindingHandlers/mapChart"; +import "./bindingHandlers/markdown"; +import "./bindingHandlers/minMaxAvgChart"; +import "./bindingHandlers/scrollintoview"; +import "./bindingHandlers/syntaxHighlight"; +import "./bindingHandlers/tab"; +import { ApiProducts } from "./components/apis/api-products/ko/runtime/api-products"; +import { ApiProductsTiles } from "./components/apis/api-products/ko/runtime/api-products-tiles"; import { ApiDetails } from "./components/apis/details-of-api/ko/runtime/api-details"; import { ApiHistory } from "./components/apis/history-of-api/ko/runtime/api-history"; -import { OperationDetails } from "./components/operations/operation-details/ko/runtime/operation-details"; -import { OperationConsole } from "./components/operations/operation-details/ko/runtime/operation-console"; -import { ProductService } from "./services/productService"; -import { FileInput } from "./components/file-input/file-input"; -import { MapiClient } from "./services/mapiClient"; -import { UsersService } from "./services/usersService"; -import { Signin } from "./components/users/signin/ko/runtime/signin"; -import { SignInAad } from "./components/users/signin-social/ko/runtime/signin-aad"; -import { SignInAadB2C } from "./components/users/signin-social/ko/runtime/signin-aad-b2c"; -import { Signup } from "./components/users/signup/ko/runtime/signup"; -import { SignupSocial } from "./components/users/signup-social/ko/runtime/signup-social"; -import { Profile } from "./components/users/profile/ko/runtime/profile"; -import { Subscriptions } from "./components/users/subscriptions/ko/runtime/subscriptions"; -import { ProductList } from "./components/products/product-list/ko/runtime/product-list"; -import { ProductDetails } from "./components/products/product-details/ko/runtime/product-details"; -import { ProductSubscribe } from "./components/products/product-subscribe/ko/runtime/product-subscribe"; +import { ApiList, ApiListDropdown, ApiListTiles } from "./components/apis/list-of-apis/ko/runtime"; import { DefaultAuthenticator } from "./components/defaultAuthenticator"; +import { FileInput } from "./components/file-input/file-input"; +import { CodeSampleViewModel } from "./components/operations/operation-details/ko/runtime/code-sample"; +import { OperationConsole } from "./components/operations/operation-details/ko/runtime/operation-console"; +import { OperationDetails } from "./components/operations/operation-details/ko/runtime/operation-details"; +import { TypeDefinitionViewModel } from "./components/operations/operation-details/ko/runtime/type-definition"; +import { OperationList } from "./components/operations/operation-list/ko/runtime/operation-list"; import { ProductApis } from "./components/products/product-apis/ko/runtime/product-apis"; import { ProductApisTiles } from "./components/products/product-apis/ko/runtime/product-apis-tiles"; -import { OperationList } from "./components/operations/operation-list/ko/runtime/operation-list"; +import { ProductDetails } from "./components/products/product-details/ko/runtime/product-details"; +import { ProductList } from "./components/products/product-list/ko/runtime/product-list"; +import { ProductListDropdown } from "./components/products/product-list/ko/runtime/product-list-dropdown"; +import { ProductListTiles } from "./components/products/product-list/ko/runtime/product-list-tiles"; +import { ProductSubscribe } from "./components/products/product-subscribe/ko/runtime/product-subscribe"; import { ProductSubscriptions } from "./components/products/product-subscriptions/ko/runtime/product-subscriptions"; -import { AadService } from "./services/aadService"; -import { BackendService } from "./services/backendService"; -import { HipCaptcha } from "./components/users/runtime/hip-captcha/hip-captcha"; -import { ResetPassword } from "./components/users/reset-password/ko/runtime/reset-password"; -import { ConfirmPassword } from "./components/users/confirm-password/ko/runtime/confirm-password"; -import { ChangePassword } from "./components/users/change-password/ko/runtime/change-password"; import { Reports } from "./components/reports/ko/runtime/reports"; -import { UnhandledErrorHandler } from "./errors/unhandledErrorHandler"; -import { ProductListDropdown } from "./components/products/product-list/ko/runtime/product-list-dropdown"; +import { TagInput } from "./components/tag-input/tag-input"; +import { ChangePassword } from "./components/users/change-password/ko/runtime/change-password"; +import { ConfirmPassword } from "./components/users/confirm-password/ko/runtime/confirm-password"; +import { Profile } from "./components/users/profile/ko/runtime/profile"; +import { ResetPassword } from "./components/users/reset-password/ko/runtime/reset-password"; +import { HipCaptcha } from "./components/users/runtime/hip-captcha/hip-captcha"; +import { SignInAad } from "./components/users/signin-social/ko/runtime/signin-aad"; +import { SignInAadB2C } from "./components/users/signin-social/ko/runtime/signin-aad-b2c"; +import { Signin } from "./components/users/signin/ko/runtime/signin"; +import { SignupSocial } from "./components/users/signup-social/ko/runtime/signup-social"; +import { Signup } from "./components/users/signup/ko/runtime/signup"; +import { Subscriptions } from "./components/users/subscriptions/ko/runtime/subscriptions"; import { ValidationSummary } from "./components/users/validation-summary/ko/runtime/validation-summary"; -import { TypeDefinitionViewModel } from "./components/operations/operation-details/ko/runtime/type-definition"; -import { CodeSampleViewModel } from "./components/operations/operation-details/ko/runtime/code-sample"; -import { StaticUserService } from "./services"; +import { UnhandledErrorHandler } from "./errors/unhandledErrorHandler"; +import "./polyfills"; +import { AadSignOutRouteGuard } from "./routing/aadSignoutRouteGuard"; +import { RouteHelper } from "./routing/routeHelper"; import { SignOutRouteGuard } from "./routing/signOutRouteGuard"; -import { ProvisionService } from "./services/provisioningService"; -import { BalloonBindingHandler, ResizableBindingHandler } from "@paperbits/core/ko/bindingHandlers"; -import { TagInput } from "./components/tag-input/tag-input"; -import { ViewStack } from "@paperbits/common/ui/viewStack"; +import { StaticUserService } from "./services"; +import { AadService } from "./services/aadService"; +import { AnalyticsService } from "./services/analyticsService"; +import { ApiService } from "./services/apiService"; +import { BackendService } from "./services/backendService"; +import { MapiClient } from "./services/mapiClient"; import { OAuthService } from "./services/oauthService"; -import { DefaultSessionManager } from "./authentication/defaultSessionManager"; -import { ApiProducts } from "./components/apis/api-products/ko/runtime/api-products"; -import { ApiProductsTiles } from "./components/apis/api-products/ko/runtime/api-products-tiles"; -import { ProductListTiles } from "./components/products/product-list/ko/runtime/product-list-tiles"; +import { ProductService } from "./services/productService"; +import { ProvisionService } from "./services/provisioningService"; +import { TagService } from "./services/tagService"; +import { TenantService } from "./services/tenantService"; +import { UsersService } from "./services/usersService"; export class ApimRuntimeModule implements IInjectorModule { public register(injector: IInjector): void { @@ -75,6 +76,7 @@ export class ApimRuntimeModule implements IInjectorModule { injector.bindToCollection("autostart", UnhandledErrorHandler); injector.bindToCollection("autostart", BalloonBindingHandler); injector.bindToCollection("autostart", ResizableBindingHandler); + injector.bindToCollection("routeGuards", AadSignOutRouteGuard); injector.bindToCollection("routeGuards", SignOutRouteGuard); injector.bind("apiList", ApiList); injector.bind("apiListDropdown", ApiListDropdown); diff --git a/src/authentication/defaultSessionManager.ts b/src/authentication/defaultSessionManager.ts deleted file mode 100644 index 1c32d03fd..000000000 --- a/src/authentication/defaultSessionManager.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { SessionManager } from "./sessionManager"; - -export class DefaultSessionManager implements SessionManager { - public async getItem(key: string): Promise { - const value = sessionStorage.getItem(key); - - if (!value) { - return null; - } - - return JSON.parse(value); - } - - public async setItem(key: string, value: T): Promise { - sessionStorage.setItem(key, JSON.stringify(value)); - } - - public async removeItem(key: string): Promise { - sessionStorage.removeItem(key); - } -} \ No newline at end of file diff --git a/src/authentication/sessionManager.ts b/src/authentication/sessionManager.ts deleted file mode 100644 index 0ba27baf7..000000000 --- a/src/authentication/sessionManager.ts +++ /dev/null @@ -1,20 +0,0 @@ -export interface SessionManager { - /** - * Returns stored value. - * @param key - */ - getItem(key: string): Promise; - - /** - * Stores value with specified key. - * @param key {string} Stored value key. - * @param value {T} Stored value. - */ - setItem(key: string, value: T): Promise; - - /** - * Removes value with specified key. - * @param key {string} Stored value key. - */ - removeItem(key: string): Promise; -} \ No newline at end of file diff --git a/src/components/operations/operation-details/ko/runtime/operation-console.ts b/src/components/operations/operation-details/ko/runtime/operation-console.ts index 360c02831..d7183a37f 100644 --- a/src/components/operations/operation-details/ko/runtime/operation-console.ts +++ b/src/components/operations/operation-details/ko/runtime/operation-console.ts @@ -1,35 +1,35 @@ import * as ko from "knockout"; import * as validation from "knockout.validation"; -import template from "./operation-console.html"; -import { HttpClient, HttpRequest, HttpResponse } from "@paperbits/common/http"; -import { Component, Param, OnMounted } from "@paperbits/common/ko/decorators"; import { ISettingsProvider } from "@paperbits/common/configuration"; -import { Operation } from "../../../../../models/operation"; -import { ApiService } from "../../../../../services/apiService"; -import { ConsoleOperation } from "../../../../../models/console/consoleOperation"; +import { HttpClient, HttpRequest, HttpResponse } from "@paperbits/common/http"; +import { Component, OnMounted, Param } from "@paperbits/common/ko/decorators"; +import { SessionManager } from "@paperbits/common/persistence/sessionManager"; +import { ServiceSkuName, TypeOfApi } from "../../../../../constants"; +import { SubscriptionState } from "../../../../../contracts/subscription"; +import { UnauthorizedError } from "../../../../../errors/unauthorizedError"; +import { Api } from "../../../../../models/api"; +import { AuthorizationServer } from "../../../../../models/authorizationServer"; import { ConsoleHeader } from "../../../../../models/console/consoleHeader"; -import { Utils } from "../../../../../utils"; +import { ConsoleOperation } from "../../../../../models/console/consoleOperation"; +import { ConsoleParameter } from "../../../../../models/console/consoleParameter"; import { KnownHttpHeaders } from "../../../../../models/knownHttpHeaders"; -import { Api } from "../../../../../models/api"; import { KnownStatusCodes } from "../../../../../models/knownStatusCodes"; +import { Operation } from "../../../../../models/operation"; import { Product } from "../../../../../models/product"; -import { ProductService } from "../../../../../services/productService"; -import { UsersService } from "../../../../../services/usersService"; -import { TenantService } from "../../../../../services/tenantService"; -import { ServiceSkuName, TypeOfApi } from "../../../../../constants"; import { Revision } from "../../../../../models/revision"; -import { templates } from "./templates/templates"; -import { ConsoleParameter } from "../../../../../models/console/consoleParameter"; -import { SubscriptionState } from "../../../../../contracts/subscription"; import { RouteHelper } from "../../../../../routing/routeHelper"; -import { TemplatingService } from "../../../../../services/templatingService"; +import { ApiService } from "../../../../../services/apiService"; import { OAuthService } from "../../../../../services/oauthService"; -import { AuthorizationServer } from "../../../../../models/authorizationServer"; -import { SessionManager } from "../../../../../authentication/sessionManager"; -import { OAuthSession, StoredCredentials } from "./oauthSession"; -import { UnauthorizedError } from "../../../../../errors/unauthorizedError"; +import { ProductService } from "../../../../../services/productService"; +import { TemplatingService } from "../../../../../services/templatingService"; +import { TenantService } from "../../../../../services/tenantService"; +import { UsersService } from "../../../../../services/usersService"; +import { Utils } from "../../../../../utils"; import { GrantTypes } from "./../../../../../constants"; +import { OAuthSession, StoredCredentials } from "./oauthSession"; +import template from "./operation-console.html"; import { ResponsePackage } from "./responsePackage"; +import { templates } from "./templates/templates"; import { LogItem, WebsocketClient } from "./websocketClient"; const oauthSessionKey = "oauthSession"; diff --git a/src/components/users/signin-social/ko/runtime/signin-aad-b2c.ts b/src/components/users/signin-social/ko/runtime/signin-aad-b2c.ts index cf58cd672..b62ab002a 100644 --- a/src/components/users/signin-social/ko/runtime/signin-aad-b2c.ts +++ b/src/components/users/signin-social/ko/runtime/signin-aad-b2c.ts @@ -1,9 +1,12 @@ import * as ko from "knockout"; import template from "./signin-aad-b2c.html"; -import { Component, RuntimeComponent, OnMounted, Param } from "@paperbits/common/ko/decorators"; +import { ISettingsProvider } from "@paperbits/common/configuration"; import { EventManager } from "@paperbits/common/events"; -import { AadService } from "../../../../../services"; +import { Component, OnMounted, Param, RuntimeComponent } from "@paperbits/common/ko/decorators"; +import { SettingNames } from "../../../../../constants"; +import { AadB2CClientConfig } from "../../../../../contracts/aadB2cClientConfig"; import { ValidationReport } from "../../../../../contracts/validationReport"; +import { AadService } from "../../../../../services"; const aadb2cResetPasswordErrorCode = "AADB2C90118"; @@ -18,38 +21,23 @@ const aadb2cResetPasswordErrorCode = "AADB2C90118"; export class SignInAadB2C { constructor( private readonly aadService: AadService, - private readonly eventManager: EventManager + private readonly eventManager: EventManager, + private readonly settingsProvider: ISettingsProvider ) { - this.clientId = ko.observable(); - this.authority = ko.observable(); - this.instance = ko.observable(); - this.signInPolicy = ko.observable(); - this.passwordResetPolicyName = ko.observable(); this.classNames = ko.observable(); this.label = ko.observable(); + this.replyUrl = ko.observable(); } - @Param() - public clientId: ko.Observable; - - @Param() - public authority: ko.Observable; - - @Param() - public instance: ko.Observable; - - @Param() - public signInPolicy: ko.Observable; - - @Param() - public passwordResetPolicyName: ko.Observable; - @Param() public classNames: ko.Observable; @Param() public label: ko.Observable; + @Param() + public replyUrl: ko.Observable; + @OnMounted() public async initialize(): Promise { await this.aadService.checkCallbacks(); @@ -61,13 +49,20 @@ export class SignInAadB2C { public async signIn(): Promise { this.cleanValidationErrors(); + const config = await this.settingsProvider.getSetting(SettingNames.aadB2CClientConfig); + try { - await this.aadService.runAadB2CUserFlow(this.clientId(), this.authority(), this.instance(), this.signInPolicy()); + await this.aadService.runAadB2CUserFlow( + config.clientId, + config.authority, + config.signinTenant, + config.signinPolicyName, + this.replyUrl()); } catch (error) { - if (this.passwordResetPolicyName() && error.message.includes(aadb2cResetPasswordErrorCode)) { // Reset password requested + if (config.passwordResetPolicyName && error.message.includes(aadb2cResetPasswordErrorCode)) { // Reset password requested try { - await this.aadService.runAadB2CUserFlow(this.clientId(), this.authority(), this.instance(), this.passwordResetPolicyName()); + await this.aadService.runAadB2CUserFlow(config.clientId, config.authority, config.signinTenant, config.passwordResetPolicyName); return; } catch (resetpasswordError) { @@ -75,7 +70,7 @@ export class SignInAadB2C { } } - let errorDetails; + let errorDetails: string[]; if (error.code === "ValidationError") { errorDetails = error.details?.map(detail => detail.message); diff --git a/src/components/users/signin-social/ko/runtime/signin-aad.ts b/src/components/users/signin-social/ko/runtime/signin-aad.ts index dbaf96ed3..9cbbcf607 100644 --- a/src/components/users/signin-social/ko/runtime/signin-aad.ts +++ b/src/components/users/signin-social/ko/runtime/signin-aad.ts @@ -1,9 +1,12 @@ -import * as ko from "knockout"; -import template from "./signin-aad.html"; +import { ISettingsProvider } from "@paperbits/common/configuration"; import { EventManager } from "@paperbits/common/events"; -import { Component, RuntimeComponent, Param } from "@paperbits/common/ko/decorators"; +import { Component, Param, RuntimeComponent } from "@paperbits/common/ko/decorators"; +import * as ko from "knockout"; import { ValidationReport } from "../../../../../contracts/validationReport"; import { AadService } from "../../../../../services"; +import { SettingNames } from "./../../../../../constants"; +import { AadClientConfig } from "./../../../../../contracts/aadClientConfig"; +import template from "./signin-aad.html"; @RuntimeComponent({ @@ -16,29 +19,23 @@ import { AadService } from "../../../../../services"; export class SignInAad { constructor( private readonly aadService: AadService, - private readonly eventManager: EventManager + private readonly eventManager: EventManager, + private readonly settingsProvider: ISettingsProvider ) { - this.clientId = ko.observable(); - this.authority = ko.observable(); - this.signinTenant = ko.observable(); this.classNames = ko.observable(); this.label = ko.observable(); + this.replyUrl = ko.observable(); } @Param() - public clientId: ko.Observable; - - @Param() - public authority: ko.Observable; + public classNames: ko.Observable; @Param() - public signinTenant: ko.Observable; + public label: ko.Observable; @Param() - public classNames: ko.Observable; + public replyUrl: ko.Observable; - @Param() - public label: ko.Observable; /** * Initiates signing-in with Azure Active Directory. @@ -47,7 +44,8 @@ export class SignInAad { this.cleanValidationErrors(); try { - await this.aadService.signInWithAadAdal(this.clientId(), this.authority(), this.signinTenant()); + const config = await this.settingsProvider.getSetting(SettingNames.aadClientConfig); + await this.aadService.signInWithAadAdal(config.clientId, config.authority, config.signinTenant, this.replyUrl()); } catch (error) { let errorDetails; diff --git a/src/components/users/signin-social/ko/signinSocialEditor.html b/src/components/users/signin-social/ko/signinSocialEditor.html index bd3cf1bb9..aedb71cdd 100644 --- a/src/components/users/signin-social/ko/signinSocialEditor.html +++ b/src/components/users/signin-social/ko/signinSocialEditor.html @@ -1,30 +1,74 @@ -
-
+
+
- +
+
+ + +
+
+ + +
+
- -
+
- +
+
+ + +
+
+ + +
+
- -
-
\ No newline at end of file + \ No newline at end of file diff --git a/src/components/users/signin-social/ko/signinSocialEditor.ts b/src/components/users/signin-social/ko/signinSocialEditor.ts index aae9bc6f7..bb56e1bc2 100644 --- a/src/components/users/signin-social/ko/signinSocialEditor.ts +++ b/src/components/users/signin-social/ko/signinSocialEditor.ts @@ -1,10 +1,9 @@ import * as ko from "knockout"; import template from "./signinSocialEditor.html"; import { StyleService } from "@paperbits/styles"; -import { HyperlinkModel } from "@paperbits/common/permalinks"; -import { SigninSocialModel } from "../signinSocialModel"; import { Component, OnMounted, Param, Event } from "@paperbits/common/ko/decorators"; import { LocalStyles } from "@paperbits/common/styles"; +import { SigninSocialModel } from "../signinSocialModel"; @Component({ @@ -12,14 +11,20 @@ import { LocalStyles } from "@paperbits/common/styles"; template: template }) export class SignInSocialEditor { - public readonly appearanceStyle: ko.Observable; public readonly aadLabel: ko.Observable; + public readonly aadReplyUrl: ko.Observable; public readonly aadB2CLabel: ko.Observable; + public readonly aadB2CReplyUrl: ko.Observable; + public readonly appearanceStyle: ko.Observable; + public readonly appearanceStyles: ko.ObservableArray; constructor(private readonly styleService: StyleService) { this.aadLabel = ko.observable(); + this.aadReplyUrl = ko.observable(); this.aadB2CLabel = ko.observable(); - this.appearanceStyle = ko.observable(); + this.aadB2CReplyUrl = ko.observable(); + this.appearanceStyle = ko.observable(); + this.appearanceStyles = ko.observableArray(); } @Param() @@ -30,18 +35,22 @@ export class SignInSocialEditor { @OnMounted() public async initialize(): Promise { - const buttonVariations = await this.styleService.getComponentVariations("button"); - this.aadLabel(this.model.aadLabel); + this.aadReplyUrl(this.model.aadReplyUrl); this.aadB2CLabel(this.model.aadB2CLabel); + this.aadB2CReplyUrl(this.model.aadB2CReplyUrl); if (this.model.styles) { - const selectedAppearence = buttonVariations.find(x => x.category === "appearance" && x.key === this.model.styles.appearance); - this.appearanceStyle(selectedAppearence); + const variations = await this.styleService.getComponentVariations("button"); + this.appearanceStyles(variations.filter(x => x.category === "appearance")); + this.appearanceStyle(this.model.styles?.appearance); } this.aadLabel.subscribe(this.applyChanges); + this.aadReplyUrl.subscribe(this.applyChanges); this.aadB2CLabel.subscribe(this.applyChanges); + this.aadB2CReplyUrl.subscribe(this.applyChanges); + this.appearanceStyle.subscribe(this.applyChanges); } public onVariationSelected(snippet: LocalStyles): void { @@ -57,8 +66,10 @@ export class SignInSocialEditor { private applyChanges(): void { this.model.aadLabel = this.aadLabel(); this.model.aadB2CLabel = this.aadB2CLabel(); + this.model.aadReplyUrl = this.aadReplyUrl() || null; + this.model.aadB2CReplyUrl = this.aadB2CReplyUrl() || null; this.model.styles = { - appearance: this.appearanceStyle().key + appearance: this.appearanceStyle() }; this.onChange(this.model); diff --git a/src/components/users/signin-social/ko/signinSocialViewModelBinder.ts b/src/components/users/signin-social/ko/signinSocialViewModelBinder.ts index 9db948057..b3ff82ca1 100644 --- a/src/components/users/signin-social/ko/signinSocialViewModelBinder.ts +++ b/src/components/users/signin-social/ko/signinSocialViewModelBinder.ts @@ -1,10 +1,10 @@ import { Bag } from "@paperbits/common"; -import { ViewModelBinder } from "@paperbits/common/widgets"; +import { EventManager } from "@paperbits/common/events"; import { StyleCompiler } from "@paperbits/common/styles"; -import { SigninSocialViewModel } from "./signinSocialViewModel"; -import { SigninSocialModel } from "../signinSocialModel"; +import { ViewModelBinder } from "@paperbits/common/widgets"; import { IdentityService } from "../../../../services/identityService"; -import { EventManager } from "@paperbits/common/events"; +import { SigninSocialModel } from "../signinSocialModel"; +import { SigninSocialViewModel } from "./signinSocialViewModel"; export class SigninSocialViewModelBinder implements ViewModelBinder { @@ -42,15 +42,14 @@ export class SigninSocialViewModelBinder implements ViewModelBinder x.type === "aad"); if (aadIdentityProvider) { const aadConfig = { - clientId: aadIdentityProvider.clientId, - authority: aadIdentityProvider.authority, - signinTenant: aadIdentityProvider.signinTenant, classNames: classNames, - label: model.aadLabel + label: model.aadLabel, + replyUrl: model.aadReplyUrl || undefined }; viewModel.aadConfig(JSON.stringify(aadConfig)); } @@ -58,20 +57,10 @@ export class SigninSocialViewModelBinder implements ViewModelBinder x.type === "aadB2C"); if (aadB2CIdentityProvider) { - let signinTenant = aadB2CIdentityProvider.signinTenant; - - if (!signinTenant && aadB2CIdentityProvider.allowedTenants.length > 0) { - signinTenant = aadB2CIdentityProvider.allowedTenants[0]; - } - const aadB2CConfig = { - clientId: aadB2CIdentityProvider.clientId, - authority: aadB2CIdentityProvider.authority, - instance: signinTenant, - signInPolicy: aadB2CIdentityProvider.signinPolicyName, - passwordResetPolicyName: aadB2CIdentityProvider.passwordResetPolicyName, classNames: classNames, - label: model.aadB2CLabel + label: model.aadB2CLabel, + replyUrl: model.aadB2CReplyUrl || undefined }; viewModel.aadB2CConfig(JSON.stringify(aadB2CConfig)); diff --git a/src/components/users/signin-social/signinSocialContract.ts b/src/components/users/signin-social/signinSocialContract.ts index f4340fdac..c124b96ab 100644 --- a/src/components/users/signin-social/signinSocialContract.ts +++ b/src/components/users/signin-social/signinSocialContract.ts @@ -16,8 +16,18 @@ export interface SigninSocialContract extends Contract { */ aadLabel: string; + /** + * AAD reply URL, e.g. `/signin`. + */ + aadReplyUrl: string; + /** * Label on AAD B2C button. */ aadB2CLabel: string; - } + + /** + * AAD B2C reply URL, e.g. `/signin`. + */ + aadB2CReplyUrl: string; +} diff --git a/src/components/users/signin-social/signinSocialModel.ts b/src/components/users/signin-social/signinSocialModel.ts index 27ca47f48..b7020b463 100644 --- a/src/components/users/signin-social/signinSocialModel.ts +++ b/src/components/users/signin-social/signinSocialModel.ts @@ -16,11 +16,21 @@ export class SigninSocialModel { */ public aadLabel?: string; + /** + * AAD reply URL, e.g. `/signin`. + */ + public aadReplyUrl?: string; + /** * Label on AAD B2C button. */ public aadB2CLabel?: string; + /** + * AAD B2C reply URL, e.g. `/signin`. + */ + public aadB2CReplyUrl?: string; + constructor() { this.styles = { appearance: "components/button/default" }; } diff --git a/src/components/users/signin-social/signinSocialModelBinder.ts b/src/components/users/signin-social/signinSocialModelBinder.ts index e4f58b032..db9c7d678 100644 --- a/src/components/users/signin-social/signinSocialModelBinder.ts +++ b/src/components/users/signin-social/signinSocialModelBinder.ts @@ -15,17 +15,19 @@ export class SigninSocialModelBinder implements IModelBinder public async contractToModel(contract: SigninSocialContract): Promise { const model = new SigninSocialModel(); - + model.roles = contract.roles || [BuiltInRoles.everyone.key]; model.styles = contract.styles || { appearance: "components/button/default" }; model.aadLabel = contract.aadLabel || "Azure Active Directory"; model.aadB2CLabel = contract.aadB2CLabel || "Azure Active Directory B2C"; + model.aadReplyUrl = contract.aadReplyUrl; + model.aadB2CReplyUrl = contract.aadB2CReplyUrl; return model; } public canHandleContract(contract: Contract): boolean { - return contract.type === nodeType || contract.type === oldNodeType; + return contract.type === nodeType || contract.type === oldNodeType; } public modelToContract(model: SigninSocialModel): Contract { @@ -37,10 +39,12 @@ export class SigninSocialModelBinder implements IModelBinder const contract: SigninSocialContract = { type: nodeType, - styles: model.styles, - roles: roles, aadLabel: model.aadLabel, - aadB2CLabel: model.aadB2CLabel + aadReplyUrl: model.aadReplyUrl, + aadB2CLabel: model.aadB2CLabel, + aadB2CReplyUrl: model.aadB2CReplyUrl, + styles: model.styles, + roles: roles }; return contract; diff --git a/src/contracts/aadB2CClientConfig.ts b/src/contracts/aadB2CClientConfig.ts new file mode 100644 index 000000000..8083ecf6c --- /dev/null +++ b/src/contracts/aadB2CClientConfig.ts @@ -0,0 +1,32 @@ +export interface AadB2CClientConfig { + /** + * Client ID of the Application in the external Identity Provider. + * It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft. + */ + clientId: string; + + /** + * OpenID Connect discovery endpoint hostname for AAD or AAD B2C, e.g. login.windows.net + */ + authority: string; + + /** + * The TenantId to use instead of Common when logging into Active Directory. + */ + signinTenant: string; + + /** + * Sign-in policy name. Only applies to AAD B2C identity provider. + */ + signinPolicyName: string; + + /** + * Sign-up policy name. Only applies to AAD B2C identity provider. + */ + signupPolicyName: string; + + /** + * Password reset policy name. Only applies to AAD B2C identity provider. + */ + passwordResetPolicyName: string; +} \ No newline at end of file diff --git a/src/contracts/aadClientConfig.ts b/src/contracts/aadClientConfig.ts new file mode 100644 index 000000000..01fcc2021 --- /dev/null +++ b/src/contracts/aadClientConfig.ts @@ -0,0 +1,17 @@ +export interface AadClientConfig { + /** + * Client ID of the Application in the external Identity Provider. + * It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft. + */ + clientId: string; + + /** + * OpenID Connect discovery endpoint hostname for AAD or AAD B2C, e.g. login.windows.net + */ + authority: string; + + /** + * The TenantId to use instead of Common when logging into Active Directory. + */ + signinTenant: string; +} \ No newline at end of file diff --git a/src/publishing/aadConfigPublisher.ts b/src/publishing/aadConfigPublisher.ts new file mode 100644 index 000000000..b3b92a613 --- /dev/null +++ b/src/publishing/aadConfigPublisher.ts @@ -0,0 +1,59 @@ +import { ISettingsProvider } from "@paperbits/common/configuration"; +import { IPublisher } from "@paperbits/common/publishing"; +import { SettingNames } from "../constants"; +import { IdentityService } from "../services"; +import { AadB2CClientConfig } from "./../contracts/aadB2CClientConfig"; +import { AadClientConfig } from "./../contracts/aadClientConfig"; +import { RuntimeConfigBuilder } from "./runtimeConfigBuilder"; + + +/** + * AAD configuration publisher propagates public AAD/B2C identity provider settings to runtime configuration. + */ +export class AadConfigPublisher implements IPublisher { + constructor( + private readonly runtimeConfigBuilder: RuntimeConfigBuilder, + private readonly identityService: IdentityService, + private readonly settingsProvider: ISettingsProvider + ) { } + + public async publish(): Promise { + const managementApiUrl = await this.settingsProvider.getSetting(SettingNames.managementApiUrl); + this.runtimeConfigBuilder.addSetting(SettingNames.managementApiUrl, managementApiUrl); + + const identityProviders = await this.identityService.getIdentityProviders(); + + const aadIdentityProvider = identityProviders.find(x => x.type === SettingNames.aadClientConfig); + + if (aadIdentityProvider) { + const aadConfig: AadClientConfig = { + clientId: aadIdentityProvider.clientId, + authority: aadIdentityProvider.authority, + signinTenant: aadIdentityProvider.signinTenant + }; + + this.runtimeConfigBuilder.addSetting(SettingNames.aadClientConfig, aadConfig); + } + + const aadB2CIdentityProvider = identityProviders.find(x => x.type === SettingNames.aadB2CClientConfig); + + if (aadB2CIdentityProvider) { + let signinTenant = aadB2CIdentityProvider.signinTenant; + + if (!signinTenant && aadB2CIdentityProvider.allowedTenants.length > 0) { + signinTenant = aadB2CIdentityProvider.allowedTenants[0]; + } + + const aadB2CConfig: AadB2CClientConfig = { + clientId: aadB2CIdentityProvider.clientId, + authority: aadB2CIdentityProvider.authority, + signinTenant: signinTenant, + signinPolicyName: aadB2CIdentityProvider.signinPolicyName, + signupPolicyName: aadB2CIdentityProvider.signupPolicyName, + passwordResetPolicyName: aadB2CIdentityProvider.passwordResetPolicyName, + }; + + this.runtimeConfigBuilder.addSetting(SettingNames.aadB2CClientConfig, aadB2CConfig); + } + } +} \ No newline at end of file diff --git a/src/publishing/runtimeConfigBuilder.ts b/src/publishing/runtimeConfigBuilder.ts new file mode 100644 index 000000000..b4dc8b692 --- /dev/null +++ b/src/publishing/runtimeConfigBuilder.ts @@ -0,0 +1,21 @@ +import { Bag } from "@paperbits/common"; + +/** + * Runtime config builder helps content publishers to compose runtime configuration. + */ +export class RuntimeConfigBuilder { + private readonly configuration: Bag = {}; + + /** + * Adds setting to runtime configuration. + * @param key {string} Setting key. + * @param value {Object} Serializable object. + */ + public addSetting(key: string, value: Object): void { + this.configuration[key] = value; + } + + public build(): Bag { + return this.configuration; + } +} \ No newline at end of file diff --git a/src/publishing/runtimeConfigPublisher.ts b/src/publishing/runtimeConfigPublisher.ts new file mode 100644 index 000000000..53da084f6 --- /dev/null +++ b/src/publishing/runtimeConfigPublisher.ts @@ -0,0 +1,21 @@ +import * as Utils from "@paperbits/common/utils"; +import { IBlobStorage } from "@paperbits/common/persistence"; +import { IPublisher } from "@paperbits/common/publishing"; +import { RuntimeConfigBuilder } from "./runtimeConfigBuilder"; + +/** + * Runtime configuration publisher outputs runtime settings to the target website. + */ +export class RuntimeConfigPublisher implements IPublisher { + constructor( + private readonly runtimeConfigBuilder: RuntimeConfigBuilder, + private readonly outputBlobStorage: IBlobStorage + ) { } + + public async publish(): Promise { + const configuration = this.runtimeConfigBuilder.build(); + const content = Utils.stringToUnit8Array(JSON.stringify(configuration)); + + await this.outputBlobStorage.uploadBlob("/config.json", content); + } +} \ No newline at end of file diff --git a/src/routing/aadSignoutRouteGuard.ts b/src/routing/aadSignoutRouteGuard.ts new file mode 100644 index 000000000..5ec1453dc --- /dev/null +++ b/src/routing/aadSignoutRouteGuard.ts @@ -0,0 +1,45 @@ +import * as Msal from "msal"; +import * as Constants from "../constants"; +import { RouteGuard, Route } from "@paperbits/common/routing"; +import { ISettingsProvider } from "@paperbits/common/configuration"; +import { IAuthenticator } from "../authentication"; +import { AadB2CClientConfig } from "../contracts/aadB2CClientConfig"; + + +/** + * AAD/B2C sign-out route guard ensures that AAD/B2C session gets terminated when website user signs out. + */ +export class AadSignOutRouteGuard implements RouteGuard { + constructor( + private readonly authenticator: IAuthenticator, + private readonly settingsProvider: ISettingsProvider + ) { } + + public async canActivate(route: Route): Promise { + if (route.hash !== Constants.hashSignOut) { + return true; + } + + const config = await this.settingsProvider.getSetting(Constants.SettingNames.aadB2CClientConfig); + + if (!config) { + return; + } + + const msalConfig = { + auth: { clientId: config.clientId } + }; + + const msalInstance = new Msal.UserAgentApplication(msalConfig); + const signedInUserAccount = msalInstance.getAccount(); + + if (!signedInUserAccount) { + return true; // if no AAD/B2C sessions open, allow router to continue the route change processing. + } + + this.authenticator.clearAccessToken(); + msalInstance.logout(); + + return false; // explicitly stopping route execution. + } +} \ No newline at end of file diff --git a/src/services/aadService.ts b/src/services/aadService.ts index 03f7b5ad5..14ae7c46d 100644 --- a/src/services/aadService.ts +++ b/src/services/aadService.ts @@ -2,21 +2,17 @@ import * as Msal from "msal"; import * as AuthenticationContext from "adal-vanilla"; import * as Constants from "../constants"; import { Utils } from "../utils"; -import { IAuthenticator, AccessToken } from "../authentication"; import { Router } from "@paperbits/common/routing"; -import { HttpClient } from "@paperbits/common/http"; import { ISettingsProvider } from "@paperbits/common/configuration"; import { RouteHelper } from "../routing/routeHelper"; import { UsersService } from "./usersService"; -import { MapiClient } from "./mapiClient"; +import { AadB2CClientConfig } from "../contracts/aadB2CClientConfig"; /** * Service for operations with Azure Active Directory identity provider. */ export class AadService { constructor( - private readonly authenticator: IAuthenticator, - private readonly httpClient: HttpClient, private readonly settingsProvider: ISettingsProvider, private readonly router: Router, private readonly routeHelper: RouteHelper, @@ -63,7 +59,7 @@ export class AadService { public async signInWithAadMsal(aadClientId: string, authority: string, signinTenant: string): Promise { const authorityUrl = `https://${authority}/${signinTenant}`; - const msalConfig = { + const msalConfig: Msal.Configuration = { auth: { clientId: aadClientId, authority: authorityUrl, @@ -88,9 +84,9 @@ export class AadService { * @param aadClientId {string} Azure Active Directory client ID. * @param signinTenant {string} Azure Active Directory tenant used to signin. */ - public signInWithAadAdal(aadClientId: string, instance: string, signinTenant: string): Promise { + public signInWithAadAdal(aadClientId: string, instance: string, signinTenant: string, replyUrl?: string): Promise { return new Promise((resolve, reject) => { - const callback = async (errorDescription: string, idToken: string, error: string, tokenType: string) => { + const callback = async (errorDescription: string, idToken: string, error: string) => { if (!idToken) { reject(new Error(`Authentication failed.`)); console.error(`Unable to obtain id_token with client ID: ${aadClientId}. Error: ${error}. Details: ${errorDescription}.`); @@ -105,7 +101,7 @@ export class AadService { } }; - const authContextConfig = { + const authContextConfig: any = { tenant: signinTenant, instance: `https://${instance}/`, clientId: aadClientId, @@ -113,6 +109,10 @@ export class AadService { callback: callback }; + if (replyUrl) { + authContextConfig.redirectUri = replyUrl; + } + const authContext = new AuthenticationContext(authContextConfig); authContext.login(); }); @@ -124,8 +124,9 @@ export class AadService { * @param tenant {string} Tenant, e.g. "contoso.b2clogin.com". * @param instance {string} Instance, e.g. "contoso.onmicrosoft.com". * @param userFlow {string} User flow, e.g. "B2C_1_signinsignup". + * @param replyUrl {string} Reply URL, e.g. "/signin". */ - public async runAadB2CUserFlow(clientId: string, tenant: string, instance: string, userFlow: string): Promise { + public async runAadB2CUserFlow(clientId: string, tenant: string, instance: string, userFlow: string, replyUrl?: string): Promise { if (!clientId) { throw new Error(`Client ID not specified.`); } @@ -136,14 +137,18 @@ export class AadService { const auth = `https://${tenant}/tfp/${instance}/${userFlow}`; - const msalConfig = { + const msalConfig: Msal.Configuration = { auth: { clientId: clientId, authority: auth, - validateAuthority: false + validateAuthority: false, } }; + if (replyUrl) { + msalConfig.auth.redirectUri = replyUrl; + } + const msalInstance = new Msal.UserAgentApplication(msalConfig); const loginRequest = { @@ -157,6 +162,19 @@ export class AadService { } } + public async signOutAadB2C(): Promise { + const config = await this.settingsProvider.getSetting(Constants.SettingNames.aadClientConfig); + + const msalConfig: Msal.Configuration = { + auth: { + clientId: config.clientId, + } + }; + + const msalInstance = new Msal.UserAgentApplication(msalConfig); + msalInstance.logout(); + } + /** * Ensures that all redirect-based callbacks are processed. */ diff --git a/src/services/runtimeConfigurator.ts b/src/services/runtimeConfigurator.ts new file mode 100644 index 000000000..09bf36873 --- /dev/null +++ b/src/services/runtimeConfigurator.ts @@ -0,0 +1,68 @@ +import { ISettingsProvider } from "@paperbits/common/configuration"; +import { SessionManager } from "@paperbits/common/persistence/sessionManager"; +import { IdentityService } from "."; +import { SettingNames } from "../constants"; +import { AadB2CClientConfig } from "../contracts/aadB2cClientConfig"; +import { AadClientConfig } from "../contracts/aadClientConfig"; + + +/** + * Runtime configurator propagates selected settings from designer to runtime components. + */ +export class RuntimeConfigurator { + constructor( + private readonly identityService: IdentityService, + private readonly settingsProvider: ISettingsProvider, + private readonly sessionManager: SessionManager + ) { + this.loadConfiguration(); + } + + public async loadConfiguration(): Promise { + const designTimeSettings = {}; + + /* Common providers */ + const managementApiUrl = await this.settingsProvider.getSetting(SettingNames.managementApiUrl); + const backendUrl = await this.settingsProvider.getSetting(SettingNames.backendUrl); + + designTimeSettings[SettingNames.managementApiUrl] = managementApiUrl; + designTimeSettings[SettingNames.backendUrl] = backendUrl; + + /* Identity providers */ + const identityProviders = await this.identityService.getIdentityProviders(); + const aadIdentityProvider = identityProviders.find(x => x.type === SettingNames.aadClientConfig); + + if (aadIdentityProvider) { + const aadConfig: AadClientConfig = { + clientId: aadIdentityProvider.clientId, + authority: aadIdentityProvider.authority, + signinTenant: aadIdentityProvider.signinTenant + }; + + designTimeSettings[SettingNames.aadClientConfig] = aadConfig; + } + + const aadB2CIdentityProvider = identityProviders.find(x => x.type === SettingNames.aadB2CClientConfig); + + if (aadB2CIdentityProvider) { + let signinTenant = aadB2CIdentityProvider.signinTenant; + + if (!signinTenant && aadB2CIdentityProvider.allowedTenants.length > 0) { + signinTenant = aadB2CIdentityProvider.allowedTenants[0]; + } + + const aadB2CConfig: AadB2CClientConfig = { + clientId: aadB2CIdentityProvider.clientId, + authority: aadB2CIdentityProvider.authority, + signinTenant: signinTenant, + signinPolicyName: aadB2CIdentityProvider.signinPolicyName, + signupPolicyName: aadB2CIdentityProvider.signupPolicyName, + passwordResetPolicyName: aadB2CIdentityProvider.passwordResetPolicyName, + }; + + designTimeSettings[SettingNames.aadB2CClientConfig] = aadB2CConfig; + } + + this.sessionManager.setItem("designTimeSettings", JSON.stringify(designTimeSettings)); + } +} \ No newline at end of file