feat(cc-redirect): redirect URL hash and add redundant redirect method
This CL adds logic to redirect the URL hash to the Community Console,
so actions that are embedded in the URL like |#action=reply| will be
passed to the Community Console.
It also adds another method of redirecting to the Community Console
which will coexist with the old method.
Fixed: twpowertools:164
Change-Id: Ib3f770d7cbeec8f26cdd249e66f7f46ae94bb1c8
diff --git a/package-lock.json b/package-lock.json
index 47b639c..de77d80 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -15,6 +15,7 @@
"@material/mwc-dialog": "^0.27.0",
"@material/tooltip": "^12.0.0",
"@material/web": "^0.1.0-alpha.0",
+ "@stdlib/utils-escape-regexp-string": "^0.1.1",
"async-mutex": "^0.3.2",
"dompurify": "^2.4.1",
"google-protobuf": "^3.19.3",
@@ -2433,6 +2434,376 @@
"@sinonjs/commons": "^3.0.0"
}
},
+ "node_modules/@stdlib/assert-has-own-property": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/assert-has-own-property/-/assert-has-own-property-0.1.1.tgz",
+ "integrity": "sha512-Zsylp37i4rz3r0SEknZHDiqRf3StznHRm/tsh4vq6w63C+q8gyFDZVQcwFQ55OrK9OmvWmW+ypAFBUpEFAjX6Q==",
+ "os": [
+ "aix",
+ "darwin",
+ "freebsd",
+ "linux",
+ "macos",
+ "openbsd",
+ "sunos",
+ "win32",
+ "windows"
+ ],
+ "engines": {
+ "node": ">=0.10.0",
+ "npm": ">2.7.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/stdlib"
+ }
+ },
+ "node_modules/@stdlib/assert-has-symbol-support": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/assert-has-symbol-support/-/assert-has-symbol-support-0.1.1.tgz",
+ "integrity": "sha512-wQpag9EQENPG+EAel6YuUDvNgT8DlaR9s582xE3ScNTLvjNFCzS9M6tFKbgYojxUP7ZCj9VVnh0BAMg+Cxyrww==",
+ "os": [
+ "aix",
+ "darwin",
+ "freebsd",
+ "linux",
+ "macos",
+ "openbsd",
+ "sunos",
+ "win32",
+ "windows"
+ ],
+ "engines": {
+ "node": ">=0.10.0",
+ "npm": ">2.7.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/stdlib"
+ }
+ },
+ "node_modules/@stdlib/assert-has-tostringtag-support": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/assert-has-tostringtag-support/-/assert-has-tostringtag-support-0.1.1.tgz",
+ "integrity": "sha512-EQbfk5kH0rqaL8fFBPjcj3xloZ+vHMLnSM8TvKS0ViMH2adp/qneR+tr9fk3AavxMikrLe8iK/AdTGGDd5xv9A==",
+ "os": [
+ "aix",
+ "darwin",
+ "freebsd",
+ "linux",
+ "macos",
+ "openbsd",
+ "sunos",
+ "win32",
+ "windows"
+ ],
+ "dependencies": {
+ "@stdlib/assert-has-symbol-support": "^0.1.1"
+ },
+ "engines": {
+ "node": ">=0.10.0",
+ "npm": ">2.7.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/stdlib"
+ }
+ },
+ "node_modules/@stdlib/assert-is-string": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/assert-is-string/-/assert-is-string-0.1.1.tgz",
+ "integrity": "sha512-GrQjWcirF4xAAp48e4rWpr0SmmUbdsAsoGse9PdOXSLaGRhAjDziLAgx2GLEJMcBuxCR5n1g2dCicPo6bM1hDw==",
+ "os": [
+ "aix",
+ "darwin",
+ "freebsd",
+ "linux",
+ "macos",
+ "openbsd",
+ "sunos",
+ "win32",
+ "windows"
+ ],
+ "dependencies": {
+ "@stdlib/assert-has-tostringtag-support": "^0.1.1",
+ "@stdlib/utils-define-nonenumerable-read-only-property": "^0.1.1",
+ "@stdlib/utils-native-class": "^0.1.1"
+ },
+ "engines": {
+ "node": ">=0.10.0",
+ "npm": ">2.7.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/stdlib"
+ }
+ },
+ "node_modules/@stdlib/error-tools-fmtprodmsg": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/error-tools-fmtprodmsg/-/error-tools-fmtprodmsg-0.1.1.tgz",
+ "integrity": "sha512-gyQsjgr+TacoDXpPUIkL5LxEx+tT7uWycyv92no0Jo4J+mCzxOq47cBNuwTxboeIKtUSuscD5trWpL9oIdYYbQ==",
+ "os": [
+ "aix",
+ "darwin",
+ "freebsd",
+ "linux",
+ "macos",
+ "openbsd",
+ "sunos",
+ "win32",
+ "windows"
+ ],
+ "dependencies": {
+ "@stdlib/types": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0",
+ "npm": ">2.7.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/stdlib"
+ }
+ },
+ "node_modules/@stdlib/string-base-format-interpolate": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/string-base-format-interpolate/-/string-base-format-interpolate-0.1.1.tgz",
+ "integrity": "sha512-amSiQPOaKNoMgsgvdOCwLjlhrhcj1wUTnBrKmOcjUl3wSR+kRW1zEmGs92DaeGGf0B/SJMe1D3oq5DPriIPP8Q==",
+ "os": [
+ "aix",
+ "darwin",
+ "freebsd",
+ "linux",
+ "macos",
+ "openbsd",
+ "sunos",
+ "win32",
+ "windows"
+ ],
+ "engines": {
+ "node": ">=0.10.0",
+ "npm": ">2.7.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/stdlib"
+ }
+ },
+ "node_modules/@stdlib/string-base-format-tokenize": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/string-base-format-tokenize/-/string-base-format-tokenize-0.1.1.tgz",
+ "integrity": "sha512-Og33cMtG6btAdA9Dwu69rEZ3/piZEGGLsbt1O2kIi1mxsVk34CO5Wr2JE0VetBjtJ+ylyNm5FODBjsObUhiliQ==",
+ "os": [
+ "aix",
+ "darwin",
+ "freebsd",
+ "linux",
+ "macos",
+ "openbsd",
+ "sunos",
+ "win32",
+ "windows"
+ ],
+ "engines": {
+ "node": ">=0.10.0",
+ "npm": ">2.7.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/stdlib"
+ }
+ },
+ "node_modules/@stdlib/string-format": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/string-format/-/string-format-0.1.1.tgz",
+ "integrity": "sha512-s/AyPpI2hh2mHcvb/OXrVSv2IQbLlXCL55YSW1HyByVsKRMUgE8RsU2uSuwIIbEczbLIffMugG5ly5QxX7fbCw==",
+ "os": [
+ "aix",
+ "darwin",
+ "freebsd",
+ "linux",
+ "macos",
+ "openbsd",
+ "sunos",
+ "win32",
+ "windows"
+ ],
+ "dependencies": {
+ "@stdlib/string-base-format-interpolate": "^0.1.1",
+ "@stdlib/string-base-format-tokenize": "^0.1.1"
+ },
+ "engines": {
+ "node": ">=0.10.0",
+ "npm": ">2.7.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/stdlib"
+ }
+ },
+ "node_modules/@stdlib/symbol-ctor": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/symbol-ctor/-/symbol-ctor-0.1.1.tgz",
+ "integrity": "sha512-XhhpiWoXwoB6pBkICOlgQsqRbX11TOsA9w18ntv8NAYaimT/dljxuvq258Dq48yuLy/XyFzXYP17uZ92UGFWLg==",
+ "os": [
+ "aix",
+ "darwin",
+ "freebsd",
+ "linux",
+ "macos",
+ "openbsd",
+ "sunos",
+ "win32",
+ "windows"
+ ],
+ "engines": {
+ "node": ">=0.10.0",
+ "npm": ">2.7.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/stdlib"
+ }
+ },
+ "node_modules/@stdlib/types": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/@stdlib/types/-/types-0.1.0.tgz",
+ "integrity": "sha512-gnUBNBOoDvA5BRJ11e/mNGasMRQwZrTERt6qICAAwqjCJuMamK+SKELv+GNQP/wX6i7rdqhocJy/7Fq7cGbRLQ==",
+ "os": [
+ "aix",
+ "darwin",
+ "freebsd",
+ "linux",
+ "macos",
+ "openbsd",
+ "sunos",
+ "win32",
+ "windows"
+ ],
+ "engines": {
+ "node": ">=0.10.0",
+ "npm": ">2.7.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/stdlib"
+ }
+ },
+ "node_modules/@stdlib/utils-define-nonenumerable-read-only-property": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/utils-define-nonenumerable-read-only-property/-/utils-define-nonenumerable-read-only-property-0.1.1.tgz",
+ "integrity": "sha512-QCSKAflKO3vuljGaNgFNp3hIbe43CGiXiYET/RPCIo5cjIho8EN0rOQtcbT2s2udiGXXusl0t/v5YLiwueC6JQ==",
+ "os": [
+ "aix",
+ "darwin",
+ "freebsd",
+ "linux",
+ "macos",
+ "openbsd",
+ "sunos",
+ "win32",
+ "windows"
+ ],
+ "dependencies": {
+ "@stdlib/types": "^0.1.0",
+ "@stdlib/utils-define-property": "^0.1.1"
+ },
+ "engines": {
+ "node": ">=0.10.0",
+ "npm": ">2.7.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/stdlib"
+ }
+ },
+ "node_modules/@stdlib/utils-define-property": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/utils-define-property/-/utils-define-property-0.1.1.tgz",
+ "integrity": "sha512-vy6vaNV5aijnGZi1sWY8GPueOPmGc8No39ejXoSrHymMix83vNsk/pNsY2Usg1J80g71cZIlbCxiJjLJiXmOzw==",
+ "os": [
+ "aix",
+ "darwin",
+ "freebsd",
+ "linux",
+ "macos",
+ "openbsd",
+ "sunos",
+ "win32",
+ "windows"
+ ],
+ "dependencies": {
+ "@stdlib/error-tools-fmtprodmsg": "^0.1.0",
+ "@stdlib/string-format": "^0.1.1",
+ "@stdlib/types": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0",
+ "npm": ">2.7.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/stdlib"
+ }
+ },
+ "node_modules/@stdlib/utils-escape-regexp-string": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/utils-escape-regexp-string/-/utils-escape-regexp-string-0.1.1.tgz",
+ "integrity": "sha512-4eOr5YOA5LjJrNyuaofuXg/lc4qxhpl/ZlazLddtiXWcAqf0nzclFbe/nHvF4fgvgUtYiC9+rRASbZyIDhxxkw==",
+ "os": [
+ "aix",
+ "darwin",
+ "freebsd",
+ "linux",
+ "macos",
+ "openbsd",
+ "sunos",
+ "win32",
+ "windows"
+ ],
+ "dependencies": {
+ "@stdlib/assert-is-string": "^0.1.1",
+ "@stdlib/error-tools-fmtprodmsg": "^0.1.0",
+ "@stdlib/string-format": "^0.1.1"
+ },
+ "engines": {
+ "node": ">=0.10.0",
+ "npm": ">2.7.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/stdlib"
+ }
+ },
+ "node_modules/@stdlib/utils-native-class": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/utils-native-class/-/utils-native-class-0.1.1.tgz",
+ "integrity": "sha512-I8kGJN8T/Fjb+Yew0Asp6bg8Cbb7/XA973UAQ38LCb9uR3uKVsg+mKboMxKrnVkVGvZMp6kfmW8TlowMBzcsrg==",
+ "os": [
+ "aix",
+ "darwin",
+ "freebsd",
+ "linux",
+ "macos",
+ "openbsd",
+ "sunos",
+ "win32",
+ "windows"
+ ],
+ "dependencies": {
+ "@stdlib/assert-has-own-property": "^0.1.1",
+ "@stdlib/assert-has-tostringtag-support": "^0.1.1",
+ "@stdlib/symbol-ctor": "^0.1.1"
+ },
+ "engines": {
+ "node": ">=0.10.0",
+ "npm": ">2.7.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/stdlib"
+ }
+ },
"node_modules/@tootallnate/once": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz",
@@ -9849,6 +10220,110 @@
"@sinonjs/commons": "^3.0.0"
}
},
+ "@stdlib/assert-has-own-property": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/assert-has-own-property/-/assert-has-own-property-0.1.1.tgz",
+ "integrity": "sha512-Zsylp37i4rz3r0SEknZHDiqRf3StznHRm/tsh4vq6w63C+q8gyFDZVQcwFQ55OrK9OmvWmW+ypAFBUpEFAjX6Q=="
+ },
+ "@stdlib/assert-has-symbol-support": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/assert-has-symbol-support/-/assert-has-symbol-support-0.1.1.tgz",
+ "integrity": "sha512-wQpag9EQENPG+EAel6YuUDvNgT8DlaR9s582xE3ScNTLvjNFCzS9M6tFKbgYojxUP7ZCj9VVnh0BAMg+Cxyrww=="
+ },
+ "@stdlib/assert-has-tostringtag-support": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/assert-has-tostringtag-support/-/assert-has-tostringtag-support-0.1.1.tgz",
+ "integrity": "sha512-EQbfk5kH0rqaL8fFBPjcj3xloZ+vHMLnSM8TvKS0ViMH2adp/qneR+tr9fk3AavxMikrLe8iK/AdTGGDd5xv9A==",
+ "requires": {
+ "@stdlib/assert-has-symbol-support": "^0.1.1"
+ }
+ },
+ "@stdlib/assert-is-string": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/assert-is-string/-/assert-is-string-0.1.1.tgz",
+ "integrity": "sha512-GrQjWcirF4xAAp48e4rWpr0SmmUbdsAsoGse9PdOXSLaGRhAjDziLAgx2GLEJMcBuxCR5n1g2dCicPo6bM1hDw==",
+ "requires": {
+ "@stdlib/assert-has-tostringtag-support": "^0.1.1",
+ "@stdlib/utils-define-nonenumerable-read-only-property": "^0.1.1",
+ "@stdlib/utils-native-class": "^0.1.1"
+ }
+ },
+ "@stdlib/error-tools-fmtprodmsg": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/error-tools-fmtprodmsg/-/error-tools-fmtprodmsg-0.1.1.tgz",
+ "integrity": "sha512-gyQsjgr+TacoDXpPUIkL5LxEx+tT7uWycyv92no0Jo4J+mCzxOq47cBNuwTxboeIKtUSuscD5trWpL9oIdYYbQ==",
+ "requires": {
+ "@stdlib/types": "^0.1.0"
+ }
+ },
+ "@stdlib/string-base-format-interpolate": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/string-base-format-interpolate/-/string-base-format-interpolate-0.1.1.tgz",
+ "integrity": "sha512-amSiQPOaKNoMgsgvdOCwLjlhrhcj1wUTnBrKmOcjUl3wSR+kRW1zEmGs92DaeGGf0B/SJMe1D3oq5DPriIPP8Q=="
+ },
+ "@stdlib/string-base-format-tokenize": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/string-base-format-tokenize/-/string-base-format-tokenize-0.1.1.tgz",
+ "integrity": "sha512-Og33cMtG6btAdA9Dwu69rEZ3/piZEGGLsbt1O2kIi1mxsVk34CO5Wr2JE0VetBjtJ+ylyNm5FODBjsObUhiliQ=="
+ },
+ "@stdlib/string-format": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/string-format/-/string-format-0.1.1.tgz",
+ "integrity": "sha512-s/AyPpI2hh2mHcvb/OXrVSv2IQbLlXCL55YSW1HyByVsKRMUgE8RsU2uSuwIIbEczbLIffMugG5ly5QxX7fbCw==",
+ "requires": {
+ "@stdlib/string-base-format-interpolate": "^0.1.1",
+ "@stdlib/string-base-format-tokenize": "^0.1.1"
+ }
+ },
+ "@stdlib/symbol-ctor": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/symbol-ctor/-/symbol-ctor-0.1.1.tgz",
+ "integrity": "sha512-XhhpiWoXwoB6pBkICOlgQsqRbX11TOsA9w18ntv8NAYaimT/dljxuvq258Dq48yuLy/XyFzXYP17uZ92UGFWLg=="
+ },
+ "@stdlib/types": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/@stdlib/types/-/types-0.1.0.tgz",
+ "integrity": "sha512-gnUBNBOoDvA5BRJ11e/mNGasMRQwZrTERt6qICAAwqjCJuMamK+SKELv+GNQP/wX6i7rdqhocJy/7Fq7cGbRLQ=="
+ },
+ "@stdlib/utils-define-nonenumerable-read-only-property": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/utils-define-nonenumerable-read-only-property/-/utils-define-nonenumerable-read-only-property-0.1.1.tgz",
+ "integrity": "sha512-QCSKAflKO3vuljGaNgFNp3hIbe43CGiXiYET/RPCIo5cjIho8EN0rOQtcbT2s2udiGXXusl0t/v5YLiwueC6JQ==",
+ "requires": {
+ "@stdlib/types": "^0.1.0",
+ "@stdlib/utils-define-property": "^0.1.1"
+ }
+ },
+ "@stdlib/utils-define-property": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/utils-define-property/-/utils-define-property-0.1.1.tgz",
+ "integrity": "sha512-vy6vaNV5aijnGZi1sWY8GPueOPmGc8No39ejXoSrHymMix83vNsk/pNsY2Usg1J80g71cZIlbCxiJjLJiXmOzw==",
+ "requires": {
+ "@stdlib/error-tools-fmtprodmsg": "^0.1.0",
+ "@stdlib/string-format": "^0.1.1",
+ "@stdlib/types": "^0.1.0"
+ }
+ },
+ "@stdlib/utils-escape-regexp-string": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/utils-escape-regexp-string/-/utils-escape-regexp-string-0.1.1.tgz",
+ "integrity": "sha512-4eOr5YOA5LjJrNyuaofuXg/lc4qxhpl/ZlazLddtiXWcAqf0nzclFbe/nHvF4fgvgUtYiC9+rRASbZyIDhxxkw==",
+ "requires": {
+ "@stdlib/assert-is-string": "^0.1.1",
+ "@stdlib/error-tools-fmtprodmsg": "^0.1.0",
+ "@stdlib/string-format": "^0.1.1"
+ }
+ },
+ "@stdlib/utils-native-class": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/@stdlib/utils-native-class/-/utils-native-class-0.1.1.tgz",
+ "integrity": "sha512-I8kGJN8T/Fjb+Yew0Asp6bg8Cbb7/XA973UAQ38LCb9uR3uKVsg+mKboMxKrnVkVGvZMp6kfmW8TlowMBzcsrg==",
+ "requires": {
+ "@stdlib/assert-has-own-property": "^0.1.1",
+ "@stdlib/assert-has-tostringtag-support": "^0.1.1",
+ "@stdlib/symbol-ctor": "^0.1.1"
+ }
+ },
"@tootallnate/once": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz",