{}
-function buildClickHandler(key: string, currentPath: string, sendCommand: (command: any) => void) {
+function buildClickHandler(
+ key: string,
+ currentPath: string,
+ sendCommand: (type: string, payload: any, clientId?: string) => void
+) {
return () => {
- sendCommand({
- type: "state.values.request",
- payload: { path: `${currentPath ? `${currentPath}.` : ""}${key}` },
- })
+ sendCommand("state.values.request", { path: `${currentPath ? `${currentPath}.` : ""}${key}` })
}
}
-function renderKeys(keys: string[], currentPath: string, sendCommand: (command: any) => void) {
+function renderKeys(
+ keys: string[],
+ currentPath: string,
+ sendCommand: (type: string, payload: any, clientId?: string) => void
+) {
if (!keys) return ¯\_(ツ)_/¯
if (keys.length === 0) return Sorry, no keys in there.
return (
{keys.map(key => {
- return {key}
+ return (
+
+ {key}
+
+ )
})}
)
diff --git a/src/types.ts b/src/types.ts
index 2f85cc5d..0c3aab3d 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -11,4 +11,19 @@ export enum CommandType {
StateKeysResponse = "state.keys.response",
StateValuesChange = "state.values.change",
StateValuesResponse = "state.values.response",
+ StateBackupResponse = "state.backup.response",
+ CustomCommandRegister = "customCommand.register",
+ CustomCommandUnregister = "customCommand.unregister",
+}
+
+export interface Command {
+ id: number
+ type: CommandType
+ connectionId: number
+ clientId?: string
+ date: Date
+ deltaTime: number
+ important: boolean
+ messageId: number
+ payload: any
}
diff --git a/src/utils/makeTable.tsx b/src/utils/makeTable.tsx
index 4938d7f6..e5865889 100644
--- a/src/utils/makeTable.tsx
+++ b/src/utils/makeTable.tsx
@@ -49,6 +49,7 @@ function textForValue(value: any) {
return value
}
+// eslint-disable-next-line react/display-name
export default (obj: any) => (
{Object.keys(obj).map(key => {
diff --git a/tsconfig.json b/tsconfig.json
index 9c74f734..bea138b3 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -6,6 +6,7 @@
"declarationDir": "dist/types",
"emitDeclarationOnly": true,
"emitDecoratorMetadata": true,
+ "esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"experimentalDecorators": true,
"module": "es2015",
diff --git a/wallaby.js b/wallaby.js
deleted file mode 100644
index d7a40a67..00000000
--- a/wallaby.js
+++ /dev/null
@@ -1,18 +0,0 @@
-module.exports = function(wallaby) {
- return {
- files: ["src/**/*.ts", "!src/**/*.test.ts"],
-
- tests: ["src/**/*.test.ts"],
-
- compilers: {
- "**/*.ts": wallaby.compilers.babel(),
- },
-
- env: {
- type: "node",
- runner: "node",
- },
-
- testFramework: "jest",
- }
-}
diff --git a/yarn.lock b/yarn.lock
index 64165a53..92d6b344 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1143,6 +1143,13 @@
dependencies:
regenerator-runtime "^0.13.2"
+"@babel/runtime@^7.5.4", "@babel/runtime@^7.8.3":
+ version "7.8.3"
+ resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.8.3.tgz#0811944f73a6c926bb2ad35e918dcc1bfab279f1"
+ integrity sha512-fVHx1rzEmwB130VTkLnxR+HmxcTjGzH12LYQcFFoBwakMd3aOMD4OsRN7tGG/UOYE2ektgFrS8uACAoRk1CY0w==
+ dependencies:
+ regenerator-runtime "^0.13.2"
+
"@babel/runtime@^7.7.2":
version "7.7.6"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.7.6.tgz#d18c511121aff1b4f2cd1d452f1bac9601dd830f"
@@ -1150,13 +1157,6 @@
dependencies:
regenerator-runtime "^0.13.2"
-"@babel/runtime@^7.8.3":
- version "7.8.3"
- resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.8.3.tgz#0811944f73a6c926bb2ad35e918dcc1bfab279f1"
- integrity sha512-fVHx1rzEmwB130VTkLnxR+HmxcTjGzH12LYQcFFoBwakMd3aOMD4OsRN7tGG/UOYE2ektgFrS8uACAoRk1CY0w==
- dependencies:
- regenerator-runtime "^0.13.2"
-
"@babel/template@^7.1.0", "@babel/template@^7.4.4", "@babel/template@^7.6.0":
version "7.6.0"
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.6.0.tgz#7f0159c7f5012230dad64cca42ec9bdb5c9536e6"
@@ -2417,6 +2417,14 @@
dependencies:
defer-to-connect "^1.0.1"
+"@testing-library/react-hooks@3.2.1":
+ version "3.2.1"
+ resolved "https://registry.yarnpkg.com/@testing-library/react-hooks/-/react-hooks-3.2.1.tgz#19b6caa048ef15faa69d439c469033873ea01294"
+ integrity sha512-1OB6Ksvlk6BCJA1xpj8/WWz0XVd1qRcgqdaFAq+xeC6l61Ucj0P6QpA5u+Db/x9gU4DCX8ziR5b66Mlfg0M2RA==
+ dependencies:
+ "@babel/runtime" "^7.5.4"
+ "@types/testing-library__react-hooks" "^3.0.0"
+
"@tootallnate/once@1":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.0.0.tgz#9c13c2574c92d4503b005feca8f2e16cc1611506"
@@ -2605,6 +2613,13 @@
dependencies:
"@types/react" "*"
+"@types/react-test-renderer@*":
+ version "16.9.2"
+ resolved "https://registry.yarnpkg.com/@types/react-test-renderer/-/react-test-renderer-16.9.2.tgz#e1c408831e8183e5ad748fdece02214a7c2ab6c5"
+ integrity sha512-4eJr1JFLIAlWhzDkBCkhrOIWOvOxcCAfQh+jiKg7l/nNZcCIL2MHl2dZhogIFKyHzedVWHaVP1Yydq/Ruu4agw==
+ dependencies:
+ "@types/react" "*"
+
"@types/react-textarea-autosize@^4.3.3":
version "4.3.4"
resolved "https://registry.yarnpkg.com/@types/react-textarea-autosize/-/react-textarea-autosize-4.3.4.tgz#9a93f751c91ad5e86387bce75e3b7e11ed195813"
@@ -2659,6 +2674,14 @@
"@types/react-native" "*"
csstype "^2.2.0"
+"@types/testing-library__react-hooks@^3.0.0":
+ version "3.2.0"
+ resolved "https://registry.yarnpkg.com/@types/testing-library__react-hooks/-/testing-library__react-hooks-3.2.0.tgz#52f3a109bef06080e3b1e3ae7ea1c014ce859897"
+ integrity sha512-dE8iMTuR5lzB+MqnxlzORlXzXyCL0EKfzH0w/lau20OpkHD37EaWjZDz0iNG8b71iEtxT4XKGmSKAGVEqk46mw==
+ dependencies:
+ "@types/react" "*"
+ "@types/react-test-renderer" "*"
+
"@types/webpack-env@^1.15.0":
version "1.15.0"
resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.15.0.tgz#bd9956d5044b1fb43e869a9ba9148862ff98d9fd"
@@ -3228,6 +3251,15 @@ array-includes@^3.0.3:
define-properties "^1.1.2"
es-abstract "^1.7.0"
+array-includes@^3.1.1:
+ version "3.1.1"
+ resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.1.tgz#cdd67e6852bdf9c1215460786732255ed2459348"
+ integrity sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ==
+ dependencies:
+ define-properties "^1.1.3"
+ es-abstract "^1.17.0"
+ is-string "^1.0.5"
+
array-union@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39"
@@ -5553,6 +5585,13 @@ doctrine@1.5.0:
esutils "^2.0.2"
isarray "^1.0.0"
+doctrine@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d"
+ integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==
+ dependencies:
+ esutils "^2.0.2"
+
doctrine@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961"
@@ -6060,6 +6099,26 @@ eslint-plugin-promise@4.2.1:
resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-4.2.1.tgz#845fd8b2260ad8f82564c1222fce44ad71d9418a"
integrity sha512-VoM09vT7bfA7D+upt+FjeBO5eHIJQBUWki1aPvB+vbNiHS3+oGIJGIeyBtKQTME6UPXXy3vV07OL1tHd3ANuDw==
+eslint-plugin-react-hooks@^2.3.0:
+ version "2.3.0"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-2.3.0.tgz#53e073961f1f5ccf8dd19558036c1fac8c29d99a"
+ integrity sha512-gLKCa52G4ee7uXzdLiorca7JIQZPPXRAQDXV83J4bUEeUuc5pIEyZYAZ45Xnxe5IuupxEqHS+hUhSLIimK1EMw==
+
+eslint-plugin-react@^7.18.0:
+ version "7.18.0"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.18.0.tgz#2317831284d005b30aff8afb7c4e906f13fa8e7e"
+ integrity sha512-p+PGoGeV4SaZRDsXqdj9OWcOrOpZn8gXoGPcIQTzo2IDMbAKhNDnME9myZWqO3Ic4R3YmwAZ1lDjWl2R2hMUVQ==
+ dependencies:
+ array-includes "^3.1.1"
+ doctrine "^2.1.0"
+ has "^1.0.3"
+ jsx-ast-utils "^2.2.3"
+ object.entries "^1.1.1"
+ object.fromentries "^2.0.2"
+ object.values "^1.1.1"
+ prop-types "^15.7.2"
+ resolve "^1.14.2"
+
eslint-plugin-standard@4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-4.0.1.tgz#ff0519f7ffaff114f76d1bd7c3996eef0f6e20b4"
@@ -8214,6 +8273,11 @@ is-stream@^2.0.0:
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3"
integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==
+is-string@^1.0.5:
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6"
+ integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==
+
is-symbol@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38"
@@ -8968,6 +9032,14 @@ jsprim@^1.2.2:
json-schema "0.2.3"
verror "1.10.0"
+jsx-ast-utils@^2.2.3:
+ version "2.2.3"
+ resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.2.3.tgz#8a9364e402448a3ce7f14d357738310d9248054f"
+ integrity sha512-EdIHFMm+1BPynpKOpdPqiOsvnIrInRGJD7bzPZdPkjitQEqpdpUuFpq4T0npZFKTiB3RhWFdGN+oqOJIdhDhQA==
+ dependencies:
+ array-includes "^3.0.3"
+ object.assign "^4.1.0"
+
keyv@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9"
@@ -10739,6 +10811,16 @@ object.entries@^1.1.0:
function-bind "^1.1.1"
has "^1.0.3"
+object.entries@^1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.1.tgz#ee1cf04153de02bb093fec33683900f57ce5399b"
+ integrity sha512-ilqR7BgdyZetJutmDPfXCDffGa0/Yzl2ivVNpbx/g4UeWrCdRnFDUBrKJGLhGieRHDATnyZXWBeCb29k9CJysQ==
+ dependencies:
+ define-properties "^1.1.3"
+ es-abstract "^1.17.0-next.1"
+ function-bind "^1.1.1"
+ has "^1.0.3"
+
"object.fromentries@^2.0.0 || ^1.0.0":
version "2.0.1"
resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.1.tgz#050f077855c7af8ae6649f45c80b16ee2d31e704"
@@ -10749,6 +10831,16 @@ object.entries@^1.1.0:
function-bind "^1.1.1"
has "^1.0.3"
+object.fromentries@^2.0.2:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.2.tgz#4a09c9b9bb3843dd0f89acdb517a794d4f355ac9"
+ integrity sha512-r3ZiBH7MQppDJVLx6fhD618GKNG40CZYH9wgwdhKxBDDbQgjeWGGd4AtkZad84d291YxvWe7bJGuE65Anh0dxQ==
+ dependencies:
+ define-properties "^1.1.3"
+ es-abstract "^1.17.0-next.1"
+ function-bind "^1.1.1"
+ has "^1.0.3"
+
object.getownpropertydescriptors@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16"
@@ -10774,6 +10866,16 @@ object.values@^1.1.0:
function-bind "^1.1.1"
has "^1.0.3"
+object.values@^1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.1.tgz#68a99ecde356b7e9295a3c5e0ce31dc8c953de5e"
+ integrity sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==
+ dependencies:
+ define-properties "^1.1.3"
+ es-abstract "^1.17.0-next.1"
+ function-bind "^1.1.1"
+ has "^1.0.3"
+
octokit-pagination-methods@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz#cf472edc9d551055f9ef73f6e42b4dbb4c80bea4"
@@ -12098,7 +12200,7 @@ react-inspector@^4.0.0:
prop-types "^15.6.1"
storybook-chromatic "^2.2.2"
-react-is@^16.12.0:
+react-is@^16.12.0, react-is@^16.8.6:
version "16.12.0"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.12.0.tgz#2cc0fe0fba742d97fd527c42a13bec4eeb06241c"
integrity sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q==
@@ -12196,6 +12298,16 @@ react-syntax-highlighter@^11.0.2:
prismjs "^1.8.4"
refractor "^2.4.1"
+react-test-renderer@16.12.0:
+ version "16.12.0"
+ resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.12.0.tgz#11417ffda579306d4e841a794d32140f3da1b43f"
+ integrity sha512-Vj/teSqt2oayaWxkbhQ6gKis+t5JrknXfPVo+aIJ8QwYAqMPH77uptOdrlphyxl8eQI/rtkOYg86i/UWkpFu0w==
+ dependencies:
+ object-assign "^4.1.1"
+ prop-types "^15.6.2"
+ react-is "^16.8.6"
+ scheduler "^0.18.0"
+
react-textarea-autosize@^7.1.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/react-textarea-autosize/-/react-textarea-autosize-7.1.0.tgz#3132cb77e65d94417558d37c0bfe415a5afd3445"
@@ -12768,6 +12880,13 @@ resolve@^1.12.0:
dependencies:
path-parse "^1.0.6"
+resolve@^1.14.2:
+ version "1.15.0"
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.15.0.tgz#1b7ca96073ebb52e741ffd799f6b39ea462c67f5"
+ integrity sha512-+hTmAldEGE80U2wJJDC1lebb5jWqvTYAfm3YZ1ckk1gBr0MnCqUKlwK1e+anaFljIl+F5tR5IoZcm4ZDA1zMQw==
+ dependencies:
+ path-parse "^1.0.6"
+
responselike@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7"