chore: update flux-lsp to 0.5.8
parent
001e3b75c5
commit
2ec0d26699
|
@ -132,7 +132,7 @@
|
|||
"dependencies": {
|
||||
"@influxdata/clockface": "2.2.0",
|
||||
"@influxdata/flux": "^0.5.1",
|
||||
"@influxdata/flux-lsp-browser": "^0.5.6",
|
||||
"@influxdata/flux-lsp-browser": "^0.5.8",
|
||||
"@influxdata/giraffe": "0.18.0",
|
||||
"@influxdata/influx": "0.5.5",
|
||||
"@influxdata/influxdb-templates": "0.9.0",
|
||||
|
|
|
@ -90,6 +90,22 @@ const queryTagKeys = async (orgID, bucket) => {
|
|||
return raw
|
||||
}
|
||||
|
||||
const queryTagValues = async (orgID, bucket, tag) => {
|
||||
if (!orgID || orgID === '') {
|
||||
throw new Error('no org is provided')
|
||||
}
|
||||
|
||||
const query = `import "influxdata/influxdb/v1"
|
||||
v1.tagValues(bucket:"${bucket}", tag: "${tag}")`
|
||||
|
||||
const raw = await runQuery(orgID, query).promise
|
||||
if (raw.type !== 'SUCCESS') {
|
||||
throw new Error('failed to get tagKeys')
|
||||
}
|
||||
|
||||
return raw
|
||||
}
|
||||
|
||||
export class LSPServer {
|
||||
private server: WASMServer
|
||||
private messageID: number = 0
|
||||
|
@ -103,6 +119,7 @@ export class LSPServer {
|
|||
this.server.register_buckets_callback(this.getBuckets)
|
||||
this.server.register_measurements_callback(this.getMeasurements)
|
||||
this.server.register_tag_keys_callback(this.getTagKeys)
|
||||
this.server.register_tag_values_callback(this.getTagValues)
|
||||
this.store = reduxStore
|
||||
}
|
||||
|
||||
|
@ -116,6 +133,16 @@ export class LSPServer {
|
|||
}
|
||||
}
|
||||
|
||||
getTagValues = async (bucket, tag) => {
|
||||
try {
|
||||
const response = await queryTagValues(this.orgID, bucket, tag)
|
||||
return parseQueryResponse(response)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
getBuckets = () => {
|
||||
return Promise.resolve(this.buckets)
|
||||
}
|
||||
|
|
13
ui/yarn.lock
13
ui/yarn.lock
|
@ -1016,10 +1016,10 @@
|
|||
resolved "https://registry.yarnpkg.com/@influxdata/clockface/-/clockface-2.2.0.tgz#73f09f4832d6b6bad53af029844a11dd6562527e"
|
||||
integrity sha512-pIQPJXjvVgzcryhAjgZPSoC5BRLbQb1sIIY9l6KQCg4DWJkxqFC/sPI7qJItRXd8kiPXbfbHvXGAwqIY+TdWNQ==
|
||||
|
||||
"@influxdata/flux-lsp-browser@^0.5.6":
|
||||
version "0.5.6"
|
||||
resolved "https://registry.yarnpkg.com/@influxdata/flux-lsp-browser/-/flux-lsp-browser-0.5.6.tgz#ca0d57c713ca4bbca4828b9c26b86c3ec4781249"
|
||||
integrity sha512-9NP4zl2nLNy4C9lyGfqf09C41w1ENINXg1X5O+LZFgqbc2oRF3HyZFgDbUfPRgsWUAQrjahSNm29bt/KnOgy2w==
|
||||
"@influxdata/flux-lsp-browser@^0.5.8":
|
||||
version "0.5.8"
|
||||
resolved "https://registry.yarnpkg.com/@influxdata/flux-lsp-browser/-/flux-lsp-browser-0.5.8.tgz#95372a08d0d6179efcbed58bc0c4230a17ad9d5b"
|
||||
integrity sha512-uaza9uZ6IBt9CWNJs4Cfpa3uSt3AsErfy9xKpjUVkuUYOWmJb3qtqAj7mnWzSjvOjRBXbB3ghHkgOnivxTis+g==
|
||||
|
||||
"@influxdata/flux@^0.5.1":
|
||||
version "0.5.1"
|
||||
|
@ -1520,6 +1520,11 @@
|
|||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
"@types/webpack-env@^1.15.2":
|
||||
version "1.15.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.15.2.tgz#927997342bb9f4a5185a86e6579a0a18afc33b0a"
|
||||
integrity sha512-67ZgZpAlhIICIdfQrB5fnDvaKFcDxpKibxznfYRVAT4mQE41Dido/3Ty+E3xGBmTogc5+0Qb8tWhna+5B8z1iQ==
|
||||
|
||||
"@types/webpack@^4.4.31", "@types/webpack@^4.4.35":
|
||||
version "4.4.35"
|
||||
resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.4.35.tgz#b7088eb2d471d5645e5503d272783cafa753583b"
|
||||
|
|
Loading…
Reference in New Issue