author
int64 658
755k
| date
stringlengths 19
19
| timezone
int64 -46,800
43.2k
| hash
stringlengths 40
40
| message
stringlengths 5
490
| mods
list | language
stringclasses 20
values | license
stringclasses 3
values | repo
stringlengths 5
68
| original_message
stringlengths 12
491
|
---|---|---|---|---|---|---|---|---|---|
305,159 | 06.01.2020 09:19:05 | -3,600 | 62da0e7f94532454217af87499ae21e2bc0dc39a | feat(node): isolate node dependants into a separate folder | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/InfluxDB.ts",
"new_path": "packages/core/src/InfluxDB.ts",
"diff": "@@ -3,7 +3,7 @@ import {ClientOptions, WritePrecision} from './options'\nimport WriteApiImpl from './impl/WriteApiImpl'\nimport {IllegalArgumentError} from './errors'\nimport {Transport} from './transport'\n-import NodeHttpTransport from './impl/NodeHttpTransport'\n+import NodeHttpTransport from './impl/node/NodeHttpTransport'\nimport QueryApi from './QueryApi'\nimport QueryApiImpl from './impl/QueryApiImpl'\nimport SetupApi from './SetupApi'\n"
},
{
"change_type": "RENAME",
"old_path": "packages/core/src/impl/NodeHttpTransport.ts",
"new_path": "packages/core/src/impl/node/NodeHttpTransport.ts",
"diff": "-import {ConnectionOptions, DEFAULT_ConnectionOptions} from '../options'\n+import {ConnectionOptions, DEFAULT_ConnectionOptions} from '../../options'\nimport {parse} from 'url'\nimport * as http from 'http'\nimport * as https from 'https'\nimport {Buffer} from 'buffer'\n-import {RequestTimedOutError, ResponseAbortedError, HttpError} from '../errors'\n+import {\n+ RequestTimedOutError,\n+ ResponseAbortedError,\n+ HttpError,\n+} from '../../errors'\nimport {\nCommunicationObserver,\nTransport,\nSendOptions,\nHeaders,\nChunkCombiner,\n-} from '../transport'\n-import Cancellable from '../util/Cancellable'\n+} from '../../transport'\n+import Cancellable from '../../util/Cancellable'\nimport nodeChunkCombiner from './nodeChunkCombiner'\nimport zlib from 'zlib'\n"
},
{
"change_type": "RENAME",
"old_path": "packages/core/src/impl/nodeChunkCombiner.ts",
"new_path": "packages/core/src/impl/node/nodeChunkCombiner.ts",
"diff": "-import {ChunkCombiner} from '../transport'\n+import {ChunkCombiner} from '../../transport'\nimport {Buffer} from 'buffer'\nconst nodeChunkCombiner: ChunkCombiner = {\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(node): isolate node dependants into a separate folder |
305,159 | 06.01.2020 10:12:13 | -3,600 | 3d246db1fb96c4b03d7ff35a89a20d8a2c6e13d7 | chore: use extra ts config for builds and IDE | [
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"preinstall\": \"node ./scripts/require-yarn.js\",\n\"postinstall\": \"manypkg check\",\n\"clean\": \"yarn worspaces run clean\",\n- \"build\": \"cd ./packages/core && yarn run build\"\n+ \"build\": \"cd ./packages/core && yarn run build\",\n+ \"test\": \"cd ./packages/core && yarn test\"\n},\n\"homepage\": \"https://github.com/bonitoo-io/influxdb-client-js\",\n\"repository\": {\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/package.json",
"new_path": "packages/core/package.json",
"diff": "\"test:unit:ci\": \"yarn run test:unit --exit --reporter mocha-junit-reporter --reporter-options mochaFile=reports/mocha/test-results.xml\",\n\"test:watch\": \"mocha --require ts-node/register 'test/unit/**/*.test.ts' --watch-extensions ts --watch\",\n\"typecheck\": \"tsc --noEmit --pretty\",\n- \"typedoc\": \"typedoc --excludePrivate --excludeNotExported --mode file --out ./reports/apidoc --target es6 --tsconfig ./tsconfig.doc.json ./src\",\n+ \"typedoc\": \"typedoc --excludePrivate --excludeNotExported --mode file --out ./reports/apidoc --target es6 --tsconfig ./tsconfig.build.json ./src\",\n\"lint\": \"eslint 'src/**/*.ts' 'test/**/*.ts'\",\n\"lint:ci\": \"yarn run lint --format junit --output-file reports/eslint/eslint.xml\",\n\"lint:fix\": \"eslint --fix 'src/**/*.ts'\"\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/rollup.config.js",
"new_path": "packages/core/rollup.config.js",
"diff": "@@ -3,7 +3,6 @@ import {terser} from 'rollup-plugin-terser'\nimport gzip from 'rollup-plugin-gzip'\nimport typescript from 'rollup-plugin-typescript2'\nimport externalBuiltins from 'builtin-modules'\n-import tsc from 'typescript'\nimport pkg from './package.json'\n// import builtins from 'rollup-plugin-node-builtins'\n// import globals from 'rollup-plugin-node-globals'\n@@ -11,14 +10,7 @@ import pkg from './package.json'\nconst plugins = [\nsourceMaps(),\ntypescript({\n- typescript: tsc,\n- tsconfigDefaults: {\n- compilerOptions: {\n- declaration: true,\n- sourceMap: true,\n- },\n- include: ['src/**/*.ts'],\n- },\n+ tsconfig: './tsconfig.build.json',\n}),\nterser(),\ngzip(),\n"
},
{
"change_type": "RENAME",
"old_path": "packages/core/tsconfig.doc.json",
"new_path": "packages/core/tsconfig.build.json",
"diff": ""
},
{
"change_type": "MODIFY",
"old_path": "packages/core/tsconfig.json",
"new_path": "packages/core/tsconfig.json",
"diff": "{\n\"extends\": \"../../tsconfig.base.json\",\n- \"include\": [\"src/**/*.ts\"],\n+ \"compilerOptions\": {\n+ \"resolveJsonModule\": true\n+ },\n+ \"include\": [\"src/**/*.ts\", \"test/**/*.ts\"],\n\"exclude\": [\"dist\", \"rollup.config.js\"]\n}\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore: use extra ts config for builds and IDE |
305,159 | 06.01.2020 10:12:47 | -3,600 | 1180c054256e2321f8d3c782efe233d1003516e5 | feat(test): use node and pure chunk combiners | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/core/src/defaultTransport.ts",
"diff": "+import {ClientOptions} from '.'\n+import {Transport} from './transport'\n+import NodeHttpTransport from './impl/node/NodeHttpTransport'\n+\n+/**\n+ * Creates default transport using the connection options supplied.\n+ */\n+export function createTransport(options: ClientOptions): Transport {\n+ return options.transport || new NodeHttpTransport(options)\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/test/unit/impl/ChunksToLines.test.ts",
"new_path": "packages/core/test/unit/impl/ChunksToLines.test.ts",
"diff": "@@ -4,7 +4,7 @@ import chunksToLinesTables from '../../fixture/chunksToLinesTables.json'\nimport Cancellable from '../../../src/util/Cancellable'\nimport sinon from 'sinon'\nimport {CollectLinesObserver} from '../util/CollectLinesObserver'\n-import nodeChunkCombiner from '../../../src/impl/nodeChunkCombiner'\n+import nodeChunkCombiner from '../../../src/impl/node/nodeChunkCombiner'\nimport {Buffer} from 'buffer'\ninterface ChunkTest {\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/test/unit/impl/NodeHttpTransport.test.ts",
"new_path": "packages/core/test/unit/impl/NodeHttpTransport.test.ts",
"diff": "import {expect} from 'chai'\nimport nock from 'nock' // WARN: nock must be imported before NodeHttpTransport, since it modifies node's http\n-import NodeHttpTransport from '../../../src/impl/NodeHttpTransport'\n+import NodeHttpTransport from '../../../src/impl/node/NodeHttpTransport'\nimport {ConnectionOptions} from '../../../src/options'\nimport {SendOptions} from '../../../src/transport'\nimport Cancellable from '../../../src/util/Cancellable'\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/test/unit/impl/linesToTables.test.ts",
"new_path": "packages/core/test/unit/impl/linesToTables.test.ts",
"diff": "@@ -3,7 +3,7 @@ import fs from 'fs'\nimport {CollectTablesObserver} from '../util/CollectTablesObserver'\nimport {toLineObserver} from '../../../src/impl/linesToTables'\nimport ChunksToLines from '../../../src/impl/ChunksToLines'\n-import nodeChunkCombiner from '../../../src/impl/nodeChunkCombiner'\n+import chunkCombiner from '../../../src/impl/pureJsChunkCombiner'\ndescribe('linesToTables', () => {\nit('parses tables', async () => {\n@@ -13,7 +13,7 @@ describe('linesToTables', () => {\n)\nconst target = new CollectTablesObserver()\nconst lineObserver = toLineObserver(target)\n- const input = new ChunksToLines(lineObserver, nodeChunkCombiner)\n+ const input = new ChunksToLines(lineObserver, chunkCombiner)\ninput.next(data)\nexpect(target.completed).equals(0)\nexpect(target.tables).deep.equal(response.tables)\n@@ -26,7 +26,7 @@ describe('linesToTables', () => {\n;(target as any).useCancellable = (_x: any): void => {}\nconst lineObserver = toLineObserver(target)\n- const input = new ChunksToLines(lineObserver, nodeChunkCombiner)\n+ const input = new ChunksToLines(lineObserver, chunkCombiner)\ninput.useCancellable({\ncancel(): void {},\nisCancelled(): boolean {\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(test): use node and pure chunk combiners |
305,159 | 07.01.2020 08:29:53 | -3,600 | dc72b220c2c608817bfd9bcb37c3e91dd2c938a9 | feat(browser): introduce fetch transport | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/core/src/impl/browser/FetchTransport.ts",
"diff": "+/* eslint-disable @typescript-eslint/ban-ts-ignore */\n+/* eslint-disable @typescript-eslint/no-unused-vars */\n+import {Transport, SendOptions, CommunicationObserver} from '../../transport'\n+import pureJsChunkCombiner from '../pureJsChunkCombiner'\n+import {ConnectionOptions} from '../../options'\n+\n+/**\n+ * Transport layer that use browser fetch.\n+ */\n+export default class FetchTransport implements Transport {\n+ // @ts-ignore\n+ constructor(private _connectionOptions: ConnectionOptions) {}\n+ send(\n+ path: string,\n+ requestBody: string,\n+ options: SendOptions,\n+ callbacks?: Partial<CommunicationObserver<Uint8Array>> | undefined\n+ ): void {\n+ // TODO implement\n+ throw new Error('Method not implemented.')\n+ }\n+ request(path: string, body: any, options: SendOptions): Promise<any> {\n+ // TODO implement\n+ throw new Error('Method not implemented.')\n+ }\n+ chunkCombiner = pureJsChunkCombiner\n+}\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(browser): introduce fetch transport |
305,159 | 07.01.2020 10:53:20 | -3,600 | a816c1265ea741b5d8fc22824ae4a6eb9d2c78dc | chore: support clean target in monorepo root | [
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"scripts\": {\n\"preinstall\": \"node ./scripts/require-yarn.js\",\n\"postinstall\": \"manypkg check\",\n- \"clean\": \"yarn worspaces run clean\",\n+ \"clean\": \"yarn workspaces run clean\",\n\"build\": \"cd ./packages/core && yarn run build\",\n\"test\": \"cd ./packages/core && yarn test\"\n},\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore: support clean target in monorepo root |
305,159 | 07.01.2020 11:02:58 | -3,600 | dea485822ef2d6e226a68d6e0daa2eeb1117125f | feat(browser): implement request method of fetch transport | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/errors.ts",
"new_path": "packages/core/src/errors.ts",
"diff": "@@ -51,7 +51,7 @@ export class HttpError extends Error implements RetriableDecision {\nreadonly statusCode: number,\nreadonly statusMessage: string | undefined,\nreadonly body?: string,\n- retryAfter?: string | undefined\n+ retryAfter?: string | undefined | null\n) {\nsuper()\nObject.setPrototypeOf(this, HttpError.prototype)\n@@ -63,7 +63,7 @@ export class HttpError extends Error implements RetriableDecision {\nthis.setRetryAfter(retryAfter)\n}\n- private setRetryAfter(retryAfter?: string | undefined): void {\n+ private setRetryAfter(retryAfter?: string | undefined | null): void {\nif (typeof retryAfter === 'string') {\n// try to parse the supplied number as milliseconds\nif (/^[0-9]+$/.test(retryAfter)) {\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/core/src/impl/browser/.eslintrc.json",
"diff": "+{\n+ \"env\": {\n+ \"node\": false,\n+ \"browser\": true\n+ }\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/impl/browser/FetchTransport.ts",
"new_path": "packages/core/src/impl/browser/FetchTransport.ts",
"diff": "-/* eslint-disable @typescript-eslint/ban-ts-ignore */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport {Transport, SendOptions, CommunicationObserver} from '../../transport'\nimport pureJsChunkCombiner from '../pureJsChunkCombiner'\nimport {ConnectionOptions} from '../../options'\n+import {HttpError} from '../../errors'\n/**\n* Transport layer that use browser fetch.\n*/\nexport default class FetchTransport implements Transport {\n- // @ts-ignore\n- constructor(private _connectionOptions: ConnectionOptions) {}\n+ private defaultHeaders: {[key: string]: string}\n+ constructor(private connectionOptions: ConnectionOptions) {\n+ const url = new URL(this.connectionOptions.url)\n+ this.connectionOptions.url = `${url.protocol}://${url.hostname}${\n+ url.port ? ':' + url.port : ''\n+ }`\n+ this.defaultHeaders = {\n+ 'Content-Type': 'application/json; charset=utf-8',\n+ }\n+ if (this.connectionOptions.token) {\n+ this.defaultHeaders['Authorization'] =\n+ 'Token ' + this.connectionOptions.token\n+ }\n+ }\nsend(\npath: string,\nrequestBody: string,\n@@ -19,9 +31,40 @@ export default class FetchTransport implements Transport {\n// TODO implement\nthrow new Error('Method not implemented.')\n}\n- request(path: string, body: any, options: SendOptions): Promise<any> {\n- // TODO implement\n- throw new Error('Method not implemented.')\n+ async request(path: string, body: any, options: SendOptions): Promise<any> {\n+ const requestConfig = {\n+ method: options.method,\n+ body: typeof body === 'string' ? body : JSON.stringify(body),\n+ headers: {\n+ ...this.defaultHeaders,\n+ ...options.headers,\n+ },\n+ // allow to specify custom signal\n+ signal: (options as any).signal,\n+ }\n+\n+ const response = await fetch(\n+ `${this.connectionOptions.url}${path}`,\n+ requestConfig\n+ )\n+ const {status, headers} = response\n+ const responseContentType = headers.get('Content-Type') || ''\n+\n+ let data = undefined\n+ if (responseContentType.includes('json')) {\n+ data = await response.json()\n+ } else if (responseContentType.includes('text')) {\n+ data = await response.text()\n+ }\n+ if (status >= 300) {\n+ throw new HttpError(\n+ status,\n+ response.statusText,\n+ data,\n+ response.headers.get('Retry-After')\n+ )\n+ }\n+ return data\n}\nchunkCombiner = pureJsChunkCombiner\n}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/core/src/impl/browser/tsconfig.json",
"diff": "+{\n+ \"extends\": \"../../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"lib\": [\"DOM\", \"es2015\", \"es2017\"]\n+ },\n+ \"include\": [\"*.ts\"]\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/tsconfig.build.json",
"new_path": "packages/core/tsconfig.build.json",
"diff": "{\n\"extends\": \"./tsconfig.json\",\n\"compilerOptions\": {\n- \"resolveJsonModule\": false\n+ \"resolveJsonModule\": false,\n+ \"lib\": [\"es2015\", \"es2017\"]\n},\n\"include\": [\"src/**/*.ts\"]\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/tsconfig.json",
"new_path": "packages/core/tsconfig.json",
"diff": "{\n\"extends\": \"../../tsconfig.base.json\",\n\"compilerOptions\": {\n- \"resolveJsonModule\": true\n+ \"resolveJsonModule\": true,\n+ \"lib\": [\"es2015\", \"es2017\"]\n},\n\"include\": [\"src/**/*.ts\", \"test/**/*.ts\"],\n\"exclude\": [\"*.js\"]\n"
},
{
"change_type": "MODIFY",
"old_path": "yarn.lock",
"new_path": "yarn.lock",
"diff": "@@ -488,11 +488,6 @@ buffer-from@^1.0.0:\nversion \"1.1.1\"\nresolved \"https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef\"\n-builtin-modules@^3.1.0:\n- version \"3.1.0\"\n- resolved \"https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.1.0.tgz#aad97c15131eb76b65b50ef208e7584cd76a7484\"\n- integrity sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==\n-\nbuiltins@^1.0.3:\nversion \"1.0.3\"\nresolved \"https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88\"\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(browser): implement request method of fetch transport |
305,159 | 07.01.2020 12:17:59 | -3,600 | 3d7bae7dda65ffe9504c5396d8ad16dee34a9623 | feat(browser): make fetch transport independent on URL, so it can work in IE11 | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/impl/browser/FetchTransport.ts",
"new_path": "packages/core/src/impl/browser/FetchTransport.ts",
"diff": "@@ -4,16 +4,18 @@ import pureJsChunkCombiner from '../pureJsChunkCombiner'\nimport {ConnectionOptions} from '../../options'\nimport {HttpError} from '../../errors'\n+function normalizeUrl(s: string): string {\n+ const match = s.match(/^(https?:\\/\\/[^:/?#]*(?::[0-9]+)?).*$/i)\n+ if (!match) throw new Error(`Unsupported url: ${s}`)\n+ return match[1]\n+}\n/**\n* Transport layer that use browser fetch.\n*/\nexport default class FetchTransport implements Transport {\nprivate defaultHeaders: {[key: string]: string}\nconstructor(private connectionOptions: ConnectionOptions) {\n- const url = new URL(this.connectionOptions.url)\n- this.connectionOptions.url = `${url.protocol}://${url.hostname}${\n- url.port ? ':' + url.port : ''\n- }`\n+ this.connectionOptions.url = normalizeUrl(connectionOptions.url)\nthis.defaultHeaders = {\n'Content-Type': 'application/json; charset=utf-8',\n}\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(browser): make fetch transport independent on URL, so it can work in IE11 |
305,159 | 07.01.2020 14:37:07 | -3,600 | 718ce635f9de0a7c6110eddc58b3d695562ad4ba | feat(transport): reuse code between fetch and node transport | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/core/src/impl/completeCommunicationObserver.ts",
"diff": "+import {CommunicationObserver, Headers} from '../transport'\n+\n+export default function completeCommunicationObserver(\n+ callbacks: Partial<CommunicationObserver<any>> = {}\n+): Omit<Required<CommunicationObserver<any>>, 'useCancellable'> {\n+ let state = 0\n+ const retVal = {\n+ next: (data: any): void => {\n+ if (state === 0 && callbacks.next) {\n+ callbacks.next(data)\n+ }\n+ },\n+ error: (error: Error): void => {\n+ /* istanbul ignore else propagate error at most once */\n+ if (state === 0) {\n+ state = 1\n+ /* istanbul ignore else safety check */\n+ if (callbacks.error) callbacks.error(error)\n+ }\n+ },\n+ complete: (): void => {\n+ if (state === 0) {\n+ state = 2\n+ /* istanbul ignore else safety check */\n+ if (callbacks.complete) callbacks.complete()\n+ }\n+ },\n+ responseStarted: (headers: Headers): void => {\n+ if (callbacks.responseStarted) callbacks.responseStarted(headers)\n+ },\n+ }\n+ return retVal\n+}\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(transport): reuse code between fetch and node transport |
305,159 | 07.01.2020 14:38:13 | -3,600 | fcc9d94f9c7c8585e59bfa6f31df023024a10918 | feat: use AbortError in both node and browser | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/errors.ts",
"new_path": "packages/core/src/errors.ts",
"diff": "@@ -146,11 +146,12 @@ export class RequestTimedOutError extends Error implements RetriableDecision {\n}\n}\n-export class ResponseAbortedError extends Error implements RetriableDecision {\n+export class AbortError extends Error implements RetriableDecision {\n/* istanbul ignore next because of super() not being covered */\nconstructor() {\nsuper()\n- Object.setPrototypeOf(this, ResponseAbortedError.prototype)\n+ this.name = 'AbortError'\n+ Object.setPrototypeOf(this, AbortError.prototype)\nthis.message = 'Response aborted'\n}\ncanRetry(): boolean {\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/impl/node/NodeHttpTransport.ts",
"new_path": "packages/core/src/impl/node/NodeHttpTransport.ts",
"diff": "@@ -3,11 +3,7 @@ import {parse} from 'url'\nimport * as http from 'http'\nimport * as https from 'https'\nimport {Buffer} from 'buffer'\n-import {\n- RequestTimedOutError,\n- ResponseAbortedError,\n- HttpError,\n-} from '../../errors'\n+import {RequestTimedOutError, AbortError, HttpError} from '../../errors'\nimport {\nCommunicationObserver,\nTransport,\n@@ -18,6 +14,7 @@ import {\nimport Cancellable from '../../util/Cancellable'\nimport nodeChunkCombiner from './nodeChunkCombiner'\nimport zlib from 'zlib'\n+import completeCommunicationObserver from '../completeCommunicationObserver'\nconst zlibOptions = {\nflush: zlib.Z_SYNC_FLUSH,\n@@ -177,11 +174,7 @@ export class NodeHttpTransport implements Transport {\ncancellable: CancellableImpl,\ncallbacks?: Partial<CommunicationObserver<any>>\n): void {\n- const listeners = this.createRetriableCallbacks(\n- requestMessage,\n- cancellable,\n- callbacks\n- )\n+ const listeners = completeCommunicationObserver(callbacks)\nif (cancellable.isCancelled()) {\nlisteners.complete()\nreturn\n@@ -193,7 +186,7 @@ export class NodeHttpTransport implements Transport {\nreturn\n}\nres.on('aborted', () => {\n- listeners.error(new ResponseAbortedError())\n+ listeners.error(new AbortError())\n})\nlisteners.responseStarted(res.headers)\nconst statusCode =\n@@ -258,39 +251,5 @@ export class NodeHttpTransport implements Transport {\n}\nreq.end()\n}\n-\n- private createRetriableCallbacks(\n- requestMessage: {[key: string]: any},\n- cancellable: CancellableImpl,\n- callbacks: Partial<CommunicationObserver<any>> = {}\n- ): Omit<Required<CommunicationObserver<any>>, 'useCancellable'> {\n- let state = 0\n- const retVal = {\n- next: (data: any): void => {\n- if (state === 0 && callbacks.next) {\n- callbacks.next(data)\n- }\n- },\n- error: (error: Error): void => {\n- /* istanbul ignore else propagate error at most once */\n- if (state === 0) {\n- state = 1\n- /* istanbul ignore else safety check */\n- if (callbacks.error) callbacks.error(error)\n- }\n- },\n- complete: (): void => {\n- if (state === 0) {\n- state = 2\n- /* istanbul ignore else safety check */\n- if (callbacks.complete) callbacks.complete()\n- }\n- },\n- responseStarted: (headers: Headers): void => {\n- if (callbacks.responseStarted) callbacks.responseStarted(headers)\n- },\n- }\n- return retVal\n- }\n}\nexport default NodeHttpTransport\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/test/unit/errors.test.ts",
"new_path": "packages/core/test/unit/errors.test.ts",
"diff": "@@ -4,7 +4,7 @@ import {\ngetRetryDelay,\nHttpError,\nRequestTimedOutError,\n- ResponseAbortedError,\n+ AbortError,\nIllegalArgumentError,\nRetriableDecision,\n} from '../../src/errors'\n@@ -15,7 +15,7 @@ describe('errors', () => {\nnew HttpError(503, 'Service Unavailable'),\nnew HttpError(429, 'Too Many Requests'),\nnew RequestTimedOutError(),\n- new ResponseAbortedError(),\n+ new AbortError(),\nnew HttpError(429, 'Too Many Requests', '', '2019-11-02'),\n((): Error => {\nconst err = new Error('Connection reset')\n@@ -52,7 +52,7 @@ describe('errors', () => {\nretryAfter: 10,\n},\n{error: new RequestTimedOutError(), retryAfter: 0},\n- {error: new ResponseAbortedError(), retryAfter: 0},\n+ {error: new AbortError(), retryAfter: 0},\n]\ntestSet.forEach(entry => {\nit(`retries ${entry.error} in ${entry.retryAfter} ms`, () => {\n@@ -82,7 +82,7 @@ describe('errors', () => {\nretryAfter: 10,\n},\n{error: new RequestTimedOutError(), retryAfter: 0},\n- {error: new ResponseAbortedError(), retryAfter: 0},\n+ {error: new AbortError(), retryAfter: 0},\n{error: new Error(), retryAfter: 0},\n{error: '', retryAfter: 0},\n{error: null, retryAfter: 0},\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat: use AbortError in both node and browser |
305,159 | 07.01.2020 18:08:08 | -3,600 | af11a702bb2bde14a6d6093355bb6117fd8995a8 | feat(browser): implement send method | [
{
"change_type": "MODIFY",
"old_path": "examples/README.md",
"new_path": "examples/README.md",
"diff": "- Prerequisites\n- [yarn](https://yarnpkg.com/lang/en/docs/install/) installed\n- - Run `yarn install`\n+ - Run `yarn --cwd ..` in this directory\n- Change variables in [./env.ts](env.ts) to configure connection to your InfluxDB instance. The file can be used as-is against a [docker influxDB v2.0 installation](https://v2.docs.influxdata.com/v2.0/get-started/)\n- Examples are executable. If it does not work for you, run `yarn ts-node EXAMPLE.ts`.\n- [setupInfluxDB.ts](./setupInfluxDB.ts)\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/rollup.config.js",
"new_path": "packages/core/rollup.config.js",
"diff": "@@ -4,6 +4,7 @@ import typescript from 'rollup-plugin-typescript2'\nimport pkg from './package.json'\nimport replace from '@rollup/plugin-replace'\n+const tsBuildConfigPath = './tsconfig.build.json'\nconst externalNodeModules = ['buffer', 'http', 'https', 'url', 'zlib']\nconst input = 'src/index.ts'\n@@ -20,10 +21,11 @@ function createConfig({browser, format, out, name, target, noTerser}) {\n: {}\n),\ntypescript({\n- tsconfig: './tsconfig.build.json',\n+ tsconfig: tsBuildConfigPath,\ntsconfigOverride: {\ncompilerOptions: {\ntarget: target || 'es2015',\n+ lib: browser ? ['DOM', 'es2015'] : ['es2015'],\n},\n},\n}),\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/impl/browser/FetchTransport.ts",
"new_path": "packages/core/src/impl/browser/FetchTransport.ts",
"diff": "/* eslint-disable @typescript-eslint/no-unused-vars */\n-import {Transport, SendOptions, CommunicationObserver} from '../../transport'\n+import {\n+ Transport,\n+ SendOptions,\n+ CommunicationObserver,\n+ Headers,\n+} from '../../transport'\nimport pureJsChunkCombiner from '../pureJsChunkCombiner'\nimport {ConnectionOptions} from '../../options'\nimport {HttpError} from '../../errors'\n+import completeCommunicationObserver from '../completeCommunicationObserver'\nfunction normalizeUrl(s: string): string {\nconst match = s.match(/^(https?:\\/\\/[^:/?#]*(?::[0-9]+)?).*$/i)\n@@ -13,6 +19,7 @@ function normalizeUrl(s: string): string {\n* Transport layer that use browser fetch.\n*/\nexport default class FetchTransport implements Transport {\n+ chunkCombiner = pureJsChunkCombiner\nprivate defaultHeaders: {[key: string]: string}\nconstructor(private connectionOptions: ConnectionOptions) {\nthis.connectionOptions.url = normalizeUrl(connectionOptions.url)\n@@ -26,29 +33,60 @@ export default class FetchTransport implements Transport {\n}\nsend(\npath: string,\n- requestBody: string,\n+ body: string,\noptions: SendOptions,\ncallbacks?: Partial<CommunicationObserver<Uint8Array>> | undefined\n): void {\n- // TODO implement\n- throw new Error('Method not implemented.')\n- }\n- async request(path: string, body: any, options: SendOptions): Promise<any> {\n- const requestConfig = {\n- method: options.method,\n- body: typeof body === 'string' ? body : JSON.stringify(body),\n- headers: {\n- ...this.defaultHeaders,\n- ...options.headers,\n+ const observer = completeCommunicationObserver(callbacks)\n+ if (callbacks && callbacks.useCancellable && !(options as any).signal) {\n+ const controller = new AbortController()\n+ const signal = controller.signal\n+ callbacks.useCancellable({\n+ cancel() {\n+ controller.abort()\n},\n- // allow to specify custom signal\n- signal: (options as any).signal,\n+ isCancelled() {\n+ return signal.aborted\n+ },\n+ })\n}\n-\n- const response = await fetch(\n- `${this.connectionOptions.url}${path}`,\n- requestConfig\n- )\n+ this.fetch(path, body, options)\n+ .then(async response => {\n+ if (callbacks?.responseStarted) {\n+ const headers: Headers = {}\n+ response.headers.forEach((value: string, key: string) => {\n+ const previous = headers[key]\n+ if (previous === undefined) {\n+ headers[key] = value\n+ } else if (Array.isArray(previous)) {\n+ previous.push(value)\n+ } else {\n+ headers[key] = [previous, value]\n+ }\n+ })\n+ observer.responseStarted(headers)\n+ }\n+ if (response.body) {\n+ const reader = response.body.getReader()\n+ let chunk: ReadableStreamReadResult<Uint8Array>\n+ do {\n+ chunk = await reader.read()\n+ observer.next(chunk)\n+ } while (!chunk.done)\n+ } else if (response.arrayBuffer) {\n+ const buffer = await response.arrayBuffer()\n+ observer.next(new Uint8Array(buffer))\n+ } else {\n+ const text = await response.text()\n+ observer.next(new TextEncoder().encode(text))\n+ }\n+ response.body?.getReader\n+ })\n+ .catch(e => observer.error(e))\n+ .finally(() => observer.complete())\n+ }\n+ async request(path: string, body: any, options: SendOptions): Promise<any> {\n+ const response = await this.fetch(path, body, options)\nconst {status, headers} = response\nconst responseContentType = headers.get('Content-Type') || ''\n@@ -68,5 +106,23 @@ export default class FetchTransport implements Transport {\n}\nreturn data\n}\n- chunkCombiner = pureJsChunkCombiner\n+\n+ private fetch(\n+ path: string,\n+ body: any,\n+ options: SendOptions\n+ ): Promise<Response> {\n+ const {method, headers, ...other} = options\n+ return fetch(`${this.connectionOptions.url}${path}`, {\n+ method: method,\n+ body: typeof body === 'string' ? body : JSON.stringify(body),\n+ headers: {\n+ ...this.defaultHeaders,\n+ ...headers,\n+ },\n+ credentials: 'include' as 'include',\n+ // allow to specify custom options, such as signal, in SendOptions\n+ ...other,\n+ })\n+ }\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/impl/completeCommunicationObserver.ts",
"new_path": "packages/core/src/impl/completeCommunicationObserver.ts",
"diff": "@@ -6,7 +6,7 @@ export default function completeCommunicationObserver(\nlet state = 0\nconst retVal = {\nnext: (data: any): void => {\n- if (state === 0 && callbacks.next) {\n+ if (state === 0 && callbacks.next && data !== null) {\ncallbacks.next(data)\n}\n},\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/tsconfig.build.json",
"new_path": "packages/core/tsconfig.build.json",
"diff": "\"extends\": \"./tsconfig.json\",\n\"compilerOptions\": {\n\"resolveJsonModule\": false,\n- \"lib\": [\"es2015\", \"es2017\"]\n+ \"lib\": [\"es2015\", \"es2017\"],\n+ \"target\": \"es2015\"\n},\n\"include\": [\"src/**/*.ts\"]\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/tsconfig.json",
"new_path": "packages/core/tsconfig.json",
"diff": "\"extends\": \"../../tsconfig.base.json\",\n\"compilerOptions\": {\n\"resolveJsonModule\": true,\n- \"lib\": [\"es2015\", \"es2017\"]\n+ \"lib\": [\"DOM\", \"es2015\"]\n},\n\"include\": [\"src/**/*.ts\", \"test/**/*.ts\"],\n\"exclude\": [\"*.js\"]\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(browser): implement send method |
305,159 | 07.01.2020 19:14:09 | -3,600 | d29eaf058e79a21f2339ff4c3d3e4f051b459e01 | feat(examples): repair and improve examples | [
{
"change_type": "MODIFY",
"old_path": "examples/setupInfluxDB.ts",
"new_path": "examples/setupInfluxDB.ts",
"diff": "@@ -14,16 +14,16 @@ setupApi\n.isOnboarding()\n.then(async (allowed: boolean) => {\nif (allowed) {\n- const response = await setupApi.setup(\n- {org, bucket, username, password},\n- token\n- )\n- console.log(`The database is now onboarded.`)\n- console.log(JSON.stringify(response, null, 2))\n+ await setupApi.setup({\n+ org,\n+ bucket,\n+ username,\n+ password,\n+ token,\n+ })\n+ console.log(`InfluxDB '${url}' has been onboarded.`)\n} else {\n- console.log(\n- `The database exposed at ${url} already has a default user, organization and bucket.`\n- )\n+ console.log(`Influxdb ${url} has been already onboarded.`)\n}\nconsole.log('\\nFinished SUCCESS')\n})\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/write.ts",
"new_path": "examples/write.ts",
"diff": "@@ -11,23 +11,23 @@ const writeApi = new InfluxDB({url, token}).getWriteApi(org, bucket)\nwriteApi.useDefaultTags({hostname: require('os').hostname()})\nconsole.log('*** WRITE POINTS ***')\n-// writes a simple record to the database\n-writeApi.writePoint(\n- new Point('temperature')\n+// writes points\n+const point1 = new Point('temperature')\n.tag('example', 'write.ts')\n.floatField('value', 20 + Math.round(100 * Math.random()) / 10)\n-)\n-writeApi.writePoint(\n- new Point('temperature')\n+writeApi.writePoint(point1)\n+console.log(` ${point1}`)\n+const point2 = new Point('temperature')\n.tag('example', 'write.ts')\n- .floatField('value', 20 + Math.round(100 * Math.random()) / 10)\n-)\n+ .floatField('value', 10 + Math.round(100 * Math.random()) / 10)\n+writeApi.writePoint(point2)\n+console.log(` ${point2}`)\n// flush pending writes and close writeApi\nwriteApi\n.close()\n.then(() => {\n- console.log('FINISHED ... try ./query.ts')\n+ console.log('FINISHED ... now try ./query.ts')\n})\n.catch((e: Error) => {\nconsole.log('FAILED ... the data might not send to the server', e)\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(examples): repair and improve examples |
305,159 | 07.01.2020 20:25:53 | -3,600 | 87c156d4da35158fcb77eb20967f1d983bae84fb | feat(browser): allow any string in url, so that url can be relative | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/impl/browser/FetchTransport.ts",
"new_path": "packages/core/src/impl/browser/FetchTransport.ts",
"diff": "@@ -10,11 +10,6 @@ import {ConnectionOptions} from '../../options'\nimport {HttpError} from '../../errors'\nimport completeCommunicationObserver from '../completeCommunicationObserver'\n-function normalizeUrl(s: string): string {\n- const match = s.match(/^(https?:\\/\\/[^:/?#]*(?::[0-9]+)?).*$/i)\n- if (!match) throw new Error(`Unsupported url: ${s}`)\n- return match[1]\n-}\n/**\n* Transport layer that use browser fetch.\n*/\n@@ -22,7 +17,6 @@ export default class FetchTransport implements Transport {\nchunkCombiner = pureJsChunkCombiner\nprivate defaultHeaders: {[key: string]: string}\nconstructor(private connectionOptions: ConnectionOptions) {\n- this.connectionOptions.url = normalizeUrl(connectionOptions.url)\nthis.defaultHeaders = {\n'Content-Type': 'application/json; charset=utf-8',\n}\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(browser): allow any string in url, so that url can be relative |
305,159 | 08.01.2020 07:54:17 | -3,600 | e15abc406d8d642216eb4f8a39d6ea219e1a7437 | feat(browser): strip node code from currentTime during browser build | [
{
"change_type": "MODIFY",
"old_path": "packages/core/rollup.config.js",
"new_path": "packages/core/rollup.config.js",
"diff": "@@ -16,9 +16,13 @@ function createConfig({browser, format, out, name, target, noTerser}) {\nbrowser\n? {\n'./impl/node/NodeHttpTransport': './impl/browser/FetchTransport',\n+ 'process.env.ROLLUP_BROWSER': 'true',\n+ delimiters: ['', ''],\n+ }\n+ : {\n+ 'process.env.ROLLUP_BROWSER': 'false',\ndelimiters: ['', ''],\n}\n- : {}\n),\ntypescript({\ntsconfig: tsBuildConfigPath,\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/util/currentTime.ts",
"new_path": "packages/core/src/util/currentTime.ts",
"diff": "@@ -5,7 +5,12 @@ const zeroPadding = '000000000'\nlet useHrTime = false\nexport function useProcessHrtime(use: boolean): boolean {\n+ /* istanbul ignore else */\n+ if (!process.env.ROLLUP_BROWSER) {\nreturn (useHrTime = use && process && typeof process.hrtime === 'function')\n+ } else {\n+ return false\n+ }\n}\nuseProcessHrtime(true) // preffer node\n@@ -14,7 +19,7 @@ let startHrTime: [number, number] | undefined = undefined\nlet lastMillis = Date.now()\nlet stepsInMillis = 0\nfunction nanos(): string {\n- if (useHrTime) {\n+ if (!process.env.ROLLUP_BROWSER && useHrTime) {\nconst hrTime = process.hrtime() as [number, number]\nlet millis = Date.now()\nif (!startHrTime) {\n@@ -49,7 +54,7 @@ function nanos(): string {\n}\nfunction micros(): string {\n- if (useHrTime) {\n+ if (!process.env.ROLLUP_BROWSER && useHrTime) {\nconst hrTime = process.hrtime() as [number, number]\nconst micros = String(Math.trunc(hrTime[1] / 1000) % 1000)\nreturn (\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(browser): strip node code from currentTime during browser build |
305,159 | 08.01.2020 08:08:35 | -3,600 | becf3215caecc8990e03a55099b4b69e55d5d913 | feat(examples): modify examples so that they can be re-used also in the browser | [
{
"change_type": "MODIFY",
"old_path": "examples/README.md",
"new_path": "examples/README.md",
"diff": "- Prerequisites\n- [yarn](https://yarnpkg.com/lang/en/docs/install/) installed\n- Run `yarn --cwd ..` in this directory\n+ - Run `yarn --cwd .. build` in this directory, the referenced client library is then compiled\n- Change variables in [./env.ts](env.ts) to configure connection to your InfluxDB instance. The file can be used as-is against a [docker influxDB v2.0 installation](https://v2.docs.influxdata.com/v2.0/get-started/)\n- Examples are executable. If it does not work for you, run `yarn ts-node EXAMPLE.ts`.\n- [setupInfluxDB.ts](./setupInfluxDB.ts)\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/query.ts",
"new_path": "examples/query.ts",
"diff": "@@ -18,7 +18,7 @@ queryApi.queryRows(fluxQuery, {\nconst o = tableMeta.toObject(row)\n// console.log(JSON.stringify(o, null, 2))\nconsole.log(\n- `${o._time} ${o._measurement} at ${o.hostname}: ${o._field}=${o._value}`\n+ `${o._time} ${o._measurement} at '${o.location}': ${o._field}=${o._value}`\n)\n},\nerror(error: Error) {\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/write.ts",
"new_path": "examples/write.ts",
"diff": "import {InfluxDB, Point} from '@bonitoo-io/influxdb-client'\nimport {url, token, org, bucket} from './env'\n+import {hostname} from 'os'\nconst writeApi = new InfluxDB({url, token}).getWriteApi(org, bucket)\n// setup default tags for all writes through this API\n-writeApi.useDefaultTags({hostname: require('os').hostname()})\n+writeApi.useDefaultTags({location: hostname()})\nconsole.log('*** WRITE POINTS ***')\n// writes points\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(examples): modify examples so that they can be re-used also in the browser |
305,159 | 08.01.2020 12:19:47 | -3,600 | d106c0841fe49840fbd365dd8a17684428d80afb | feat(browser): better handle stream responses | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/impl/browser/FetchTransport.ts",
"new_path": "packages/core/src/impl/browser/FetchTransport.ts",
"diff": "@@ -9,6 +9,7 @@ import pureJsChunkCombiner from '../pureJsChunkCombiner'\nimport {ConnectionOptions} from '../../options'\nimport {HttpError} from '../../errors'\nimport completeCommunicationObserver from '../completeCommunicationObserver'\n+import Logger from '../Logger'\n/**\n* Transport layer that use browser fetch.\n@@ -18,7 +19,7 @@ export default class FetchTransport implements Transport {\nprivate defaultHeaders: {[key: string]: string}\nconstructor(private connectionOptions: ConnectionOptions) {\nthis.defaultHeaders = {\n- 'Content-Type': 'application/json; charset=utf-8',\n+ 'content-type': 'application/json; charset=utf-8',\n}\nif (this.connectionOptions.token) {\nthis.defaultHeaders['Authorization'] =\n@@ -60,12 +61,33 @@ export default class FetchTransport implements Transport {\n})\nobserver.responseStarted(headers)\n}\n+ if (response.status >= 300) {\n+ response\n+ .text()\n+ .then((text: string) => {\n+ throw new HttpError(\n+ response.status,\n+ response.statusText,\n+ text,\n+ response.headers.get('retry-after')\n+ )\n+ })\n+ .catch((e: Error) => {\n+ Logger.warn('Unable to receive error body', e)\n+ throw new HttpError(\n+ response.status,\n+ response.statusText,\n+ undefined,\n+ response.headers.get('retry-after')\n+ )\n+ })\n+ } else {\nif (response.body) {\nconst reader = response.body.getReader()\nlet chunk: ReadableStreamReadResult<Uint8Array>\ndo {\nchunk = await reader.read()\n- observer.next(chunk)\n+ observer.next(chunk.value)\n} while (!chunk.done)\n} else if (response.arrayBuffer) {\nconst buffer = await response.arrayBuffer()\n@@ -74,7 +96,7 @@ export default class FetchTransport implements Transport {\nconst text = await response.text()\nobserver.next(new TextEncoder().encode(text))\n}\n- response.body?.getReader\n+ }\n})\n.catch(e => observer.error(e))\n.finally(() => observer.complete())\n@@ -82,7 +104,7 @@ export default class FetchTransport implements Transport {\nasync request(path: string, body: any, options: SendOptions): Promise<any> {\nconst response = await this.fetch(path, body, options)\nconst {status, headers} = response\n- const responseContentType = headers.get('Content-Type') || ''\n+ const responseContentType = headers.get('content-type') || ''\nlet data = undefined\nif (responseContentType.includes('json')) {\n@@ -95,7 +117,7 @@ export default class FetchTransport implements Transport {\nstatus,\nresponse.statusText,\ndata,\n- response.headers.get('Retry-After')\n+ response.headers.get('retry-after')\n)\n}\nreturn data\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/impl/completeCommunicationObserver.ts",
"new_path": "packages/core/src/impl/completeCommunicationObserver.ts",
"diff": "@@ -6,7 +6,12 @@ export default function completeCommunicationObserver(\nlet state = 0\nconst retVal = {\nnext: (data: any): void => {\n- if (state === 0 && callbacks.next && data !== null) {\n+ if (\n+ state === 0 &&\n+ callbacks.next &&\n+ data !== null &&\n+ data !== undefined\n+ ) {\ncallbacks.next(data)\n}\n},\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(browser): better handle stream responses |
305,159 | 08.01.2020 12:20:26 | -3,600 | 42207989cc89572af5ce70769c13b19c7c69acd3 | feat(browser): allow to specify empty url for the browser to connect via same-origin proxy | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/InfluxDB.ts",
"new_path": "packages/core/src/InfluxDB.ts",
"diff": "@@ -57,7 +57,8 @@ export default class InfluxDB {\n} else {\nthrow new IllegalArgumentError('No url or configuration specified!')\n}\n- if (!this._options.url) throw new IllegalArgumentError('No url specified!')\n+ if (this._options.url === undefined)\n+ throw new IllegalArgumentError('No url specified!')\nthis.transport = this._options.transport || createTransport(this._options)\n}\n/* eslint-enable no-dupe-class-members */\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(browser): allow to specify empty url for the browser to connect via same-origin proxy |
305,159 | 08.01.2020 12:21:28 | -3,600 | 9dd47483c04ff51221fea23c93721d44ba1d56b4 | feat(setup): remove default content-type | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/impl/SetupApiImpl.ts",
"new_path": "packages/core/src/impl/SetupApiImpl.ts",
"diff": "@@ -18,7 +18,6 @@ export default class SetupApiImpl implements SetupApi {\n// token in not documented in open-api description\nreturn this.transport.request('/api/v2/setup', request, {\nmethod: 'POST',\n- headers: {'content-type': 'application/json', accept: 'application/json'},\n})\n}\n}\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(setup): remove default content-type |
305,159 | 08.01.2020 12:22:18 | -3,600 | e07e7f358b55b9372575fa6368b884e6ad48e47a | feat(examples): add browser examples iwth a local proxy server to influx | [
{
"change_type": "MODIFY",
"old_path": "examples/README.md",
"new_path": "examples/README.md",
"diff": "- [yarn](https://yarnpkg.com/lang/en/docs/install/) installed\n- Run `yarn --cwd ..` in this directory\n- Run `yarn --cwd .. build` in this directory, the referenced client library is then compiled\n+- Node.js examples\n- Change variables in [./env.ts](env.ts) to configure connection to your InfluxDB instance. The file can be used as-is against a [docker influxDB v2.0 installation](https://v2.docs.influxdata.com/v2.0/get-started/)\n- Examples are executable. If it does not work for you, run `yarn ts-node EXAMPLE.ts`.\n- [setupInfluxDB.ts](./setupInfluxDB.ts)\nWrites data points to InfluxDB.\n- [query.ts](./query.ts)\nQuery InfluxDB with [Flux](https://v2.docs.influxdata.com/v2.0/query-data/get-started/).\n+- Browser examples\n+ - Change `url` [./env.ts](env.ts) to match your influxDB instance\n+ - Change `token,org,bucket` variables [./index.html](index.html) to match your influxDB instance\n+ - Run `yarn browser`\n+ Starts a local HTTP server to provide browser examples and opens [./index.html](index.html) in your browser.\n+ The local HTTP server serves all static files from the parent repository and also proxies requests from '/api'\n+ path to a configured influxDB database.\n"
},
{
"change_type": "RENAME",
"old_path": "examples/env.ts",
"new_path": "examples/env.js",
"diff": ""
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "examples/index.html",
"diff": "+<html>\n+ <head>\n+ <title>Influx DB JavaScript Client Example</title>\n+ <script type=\"module\">\n+ import {InfluxDB, Point} from '../packages/core/dist/index.browser.mjs'\n+\n+ /** InfluxDB v2 URL */\n+ const url = '' // rely upon proxy to forward to the target influxDB\n+ const token = 'my-token'\n+ const org = 'my-org'\n+ const bucket = 'my-bucket'\n+\n+ const influxDB = new InfluxDB({url, token})\n+\n+ // log results also to HTML page\n+ const logField = document.getElementById('log');\n+ function log(message, ...rest){\n+ console.log(arguments[0],rest)\n+ const previousValue = logField.value\n+ logField.value += (previousValue?'\\n':'')+Array.prototype.slice.call(arguments).join('\\n')\n+ // scroll to bottom with latest results\n+ logField.scrollTo(0,logField.scrollHeight <= logField.offsetHeight ? 0 : logField.scrollHeight-logField.offsetHeight)\n+ }\n+\n+ function writeExample(value) {\n+ const writeApi = influxDB.getWriteApi(org, bucket)\n+ // setup default tags for all writes through this API\n+ writeApi.useDefaultTags({location: 'browser'})\n+\n+ log('\\n*** WRITE ***')\n+ const point1 = new Point('temperature')\n+ .tag('example', 'index.html')\n+ .floatField('value', value)\n+ writeApi.writePoint(point1)\n+ log(` ${point1}`)\n+\n+ // flush pending writes and close writeApi\n+ writeApi\n+ .close()\n+ .then(() => {\n+ log('WRITE FINISHED')\n+ temperatureInput.value = String(20 + Math.round(100 * Math.random()) / 10)\n+ })\n+ .catch(e => {\n+ log('WRITE FAILED', e)\n+ })\n+ }\n+ function queryExample(fluxQuery) {\n+ log('\\n*** QUERY ***')\n+ const queryApi = new InfluxDB({url, token}).getQueryApi(org)\n+ queryApi.queryRows(fluxQuery, {\n+ next(row, tableMeta) {\n+ const o = tableMeta.toObject(row)\n+ // log(JSON.stringify(o, null, 2))\n+ log(\n+ `${o._time} ${o._measurement} at '${o.location}': ${o._field}=${o._value}`\n+ )\n+ },\n+ error(error) {\n+ log('QUERY FAILED', error)\n+ },\n+ complete() {\n+ log('QUERY FINISHED')\n+ },\n+ })\n+ }\n+\n+ // initialize page controls\n+ const temperatureInput = document.getElementById('temperature');\n+ temperatureInput.value = String(20 + Math.round(100 * Math.random()) / 10)\n+ const writeButton = document.getElementById('writeButton')\n+ writeButton.addEventListener('click', () => {\n+ const number = Number(temperatureInput.value)\n+ if (isNaN(number)) log('ERROR: Not a number '+temperatureInput.value);\n+ else writeExample(number)\n+ })\n+ const queryInput = document.getElementById('query');\n+ const queryButton = document.getElementById('queryButton')\n+ queryButton.addEventListener('click', () => {\n+ queryExample(queryInput.value)\n+ })\n+\n+ </script>\n+ </head>\n+ <h1>Influx DB JavaScript Client Example</h1>\n+ <hr>\n+ <div>\n+ <input type=\"submit\" id=\"writeButton\" value='Write to InfluxDB'/>\n+ <span>Temperature: </span>\n+ <input type=\"number\" id=\"temperature\" value='20'></input>\n+ </div>\n+ <hr>\n+ <div style=\"display:flex; margin-bottom: 10px;\">\n+ <textarea id=\"query\" style=\"flex: 1\" rows=\"2\"\n+ >from(bucket:\"my-bucket\") |> range(start: 0) |> filter(fn: (r) => r._measurement == \"temperature\")</textarea>\n+ </div>\n+ <input type=\"submit\" id=\"queryButton\" value='Query InfluxDB'/>\n+ <hr>\n+ <fieldset>\n+ <legend>Log</legend>\n+ <textarea\n+ id=\"log\"\n+ style=\"width: 100%\"\n+ rows=\"25\"\n+ ></textarea>\n+ <button onclick=\"document.getElementById('log').value=''\">Clear Log</button>\n+ </fieldset>\n+</html>\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/package.json",
"new_path": "examples/package.json",
"diff": "\"version\": \"0.4.0\",\n\"license\": \"MIT\",\n\"scripts\": {\n- \"clean\": \"echo 'nothing to clean'\"\n+ \"clean\": \"echo 'nothing to clean'\",\n+ \"browser\": \"ts-node scripts/server.js\"\n},\n\"dependencies\": {\n- \"@bonitoo-io/influxdb-client\": \"*\"\n+ \"@bonitoo-io/influxdb-client\": \"*\",\n+ \"serve-static\": \"^1.14.1\"\n},\n\"devDependencies\": {\n+ \"@types/express\": \"^4.17.2\",\n+ \"@types/express-http-proxy\": \"^1.5.12\",\n+ \"express\": \"^4.17.1\",\n+ \"express-http-proxy\": \"^1.6.0\",\n+ \"open\": \"^7.0.0\",\n\"ts-node\": \"^8.5.4\",\n\"typescript\": \"^3.7.4\"\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/query.ts",
"new_path": "examples/query.ts",
"diff": "@@ -18,7 +18,7 @@ queryApi.queryRows(fluxQuery, {\nconst o = tableMeta.toObject(row)\n// console.log(JSON.stringify(o, null, 2))\nconsole.log(\n- `${o._time} ${o._measurement} at '${o.location}': ${o._field}=${o._value}`\n+ `${o._time} ${o._measurement} in '${o.location}': ${o._field}=${o._value}`\n)\n},\nerror(error: Error) {\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "examples/scripts/server.js",
"diff": "+import * as express from 'express'\n+import * as path from 'path'\n+import * as proxy from 'express-http-proxy'\n+import * as open from 'open'\n+import {url as influxDBUrl} from '../env'\n+\n+const port = 3001\n+\n+const app = express()\n+// serve all files of the git repository\n+app.use(express.static(path.join(__dirname, '..', '..'), {index: false}))\n+app.use(\n+ '/api',\n+ proxy(influxDBUrl + '/api', {\n+ proxyReqPathResolver: function(req) {\n+ return '/api' + req.url\n+ },\n+ })\n+)\n+app.listen(port, () => {\n+ console.log(`listening on http://localhost:${port}`)\n+ console.log(`opening http://localhost:${port}/examples/index.html`)\n+ open(`http://localhost:${port}/examples/index.html`)\n+})\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "examples/tsconfig.json",
"diff": "+{\n+ \"compilerOptions\": {\n+ \"allowJs\": true\n+ }\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/write.ts",
"new_path": "examples/write.ts",
"diff": "@@ -12,7 +12,6 @@ const writeApi = new InfluxDB({url, token}).getWriteApi(org, bucket)\nwriteApi.useDefaultTags({location: hostname()})\nconsole.log('*** WRITE POINTS ***')\n-// writes points\nconst point1 = new Point('temperature')\n.tag('example', 'write.ts')\n.floatField('value', 20 + Math.round(100 * Math.random()) / 10)\n"
},
{
"change_type": "MODIFY",
"old_path": "yarn.lock",
"new_path": "yarn.lock",
"diff": "version \"0.7.1\"\nresolved \"https://registry.yarnpkg.com/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz#8da5c6530915653f3a1f38fd5f101d8c3f8079c5\"\n+\"@types/body-parser@*\":\n+ version \"1.17.1\"\n+ resolved \"https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.17.1.tgz#18fcf61768fb5c30ccc508c21d6fd2e8b3bf7897\"\n+ integrity sha512-RoX2EZjMiFMjZh9lmYrwgoP9RTpAjSHiJxdp4oidAQVO02T7HER3xj9UKue5534ULWeqVEkujhWcyvUce+d68w==\n+ dependencies:\n+ \"@types/connect\" \"*\"\n+ \"@types/node\" \"*\"\n+\n\"@types/chai@^4.2.5\":\nversion \"4.2.5\"\nresolved \"https://registry.yarnpkg.com/@types/chai/-/chai-4.2.5.tgz#f8da153ebbe30babb0adc9a528b9ad32be3175a2\"\n+\"@types/connect@*\":\n+ version \"3.4.33\"\n+ resolved \"https://registry.yarnpkg.com/@types/connect/-/connect-3.4.33.tgz#31610c901eca573b8713c3330abc6e6b9f588546\"\n+ integrity sha512-2+FrkXY4zllzTNfJth7jOqEHC+enpLeGslEhpnTAkg21GkRrWV4SsAtqchtT4YS9/nODBU2/ZfsBY2X4J/dX7A==\n+ dependencies:\n+ \"@types/node\" \"*\"\n+\n\"@types/eslint-visitor-keys@^1.0.0\":\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d\"\nresolved \"https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7\"\nintegrity sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==\n+\"@types/express-http-proxy@^1.5.12\":\n+ version \"1.5.12\"\n+ resolved \"https://registry.yarnpkg.com/@types/express-http-proxy/-/express-http-proxy-1.5.12.tgz#077ab1ee9e0f20fa8a131f10dd96d7c72473b474\"\n+ integrity sha512-QnTNKXq3xqVU21iMtz1P1M+rhusjGqNqpcbmGzvnkrLNNCiFy6UNK/JDIYJjs3bu8AopFpnBn3wJC16K4nKSgQ==\n+ dependencies:\n+ \"@types/express\" \"*\"\n+\n+\"@types/express-serve-static-core@*\":\n+ version \"4.17.1\"\n+ resolved \"https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.1.tgz#82be64a77211b205641e0209096fd3afb62481d3\"\n+ integrity sha512-9e7jj549ZI+RxY21Cl0t8uBnWyb22HzILupyHZjYEVK//5TT/1bZodU+yUbLnPdoYViBBnNWbxp4zYjGV0zUGw==\n+ dependencies:\n+ \"@types/node\" \"*\"\n+ \"@types/range-parser\" \"*\"\n+\n+\"@types/express@*\", \"@types/express@^4.17.2\":\n+ version \"4.17.2\"\n+ resolved \"https://registry.yarnpkg.com/@types/express/-/express-4.17.2.tgz#a0fb7a23d8855bac31bc01d5a58cadd9b2173e6c\"\n+ integrity sha512-5mHFNyavtLoJmnusB8OKJ5bshSzw+qkMIBAobLrIM48HJvunFva9mOa6aBwh64lBFyNwBbs0xiEFuj4eU/NjCA==\n+ dependencies:\n+ \"@types/body-parser\" \"*\"\n+ \"@types/express-serve-static-core\" \"*\"\n+ \"@types/serve-static\" \"*\"\n+\n\"@types/fs-extra@^8.0.0\":\nversion \"8.0.1\"\nresolved \"https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-8.0.1.tgz#a2378d6e7e8afea1564e44aafa2e207dadf77686\"\nversion \"7.0.3\"\nresolved \"https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.3.tgz#bdfd69d61e464dcc81b25159c270d75a73c1a636\"\n+\"@types/mime@*\":\n+ version \"2.0.1\"\n+ resolved \"https://registry.yarnpkg.com/@types/mime/-/mime-2.0.1.tgz#dc488842312a7f075149312905b5e3c0b054c79d\"\n+ integrity sha512-FwI9gX75FgVBJ7ywgnq/P7tw+/o1GUbtP0KzbtusLigAOgIgNISRK0ZPl4qertvXSIE8YbsVJueQ90cDt9YYyw==\n+\n\"@types/minimatch@*\", \"@types/[email protected]\":\nversion \"3.0.3\"\nresolved \"https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d\"\nresolved \"https://registry.yarnpkg.com/@types/node/-/node-12.12.24.tgz#d4606afd8cf6c609036b854360367d1b2c78931f\"\nintegrity sha512-1Ciqv9pqwVtW6FsIUKSZNB82E5Cu1I2bBTj1xuIHXLe/1zYLl3956Nbhg2MzSYHVfl9/rmanjbQIb7LibfCnug==\n+\"@types/range-parser@*\":\n+ version \"1.2.3\"\n+ resolved \"https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.3.tgz#7ee330ba7caafb98090bece86a5ee44115904c2c\"\n+ integrity sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA==\n+\n\"@types/semver@^6.0.1\":\nversion \"6.2.0\"\nresolved \"https://registry.yarnpkg.com/@types/semver/-/semver-6.2.0.tgz#d688d574400d96c5b0114968705366f431831e1a\"\nintegrity sha512-1OzrNb4RuAzIT7wHSsgZRlMBlNsJl+do6UblR7JMW4oB7bbR+uBEYtUh7gEc/jM84GGilh68lSOokyM/zNUlBA==\n+\"@types/serve-static@*\":\n+ version \"1.13.3\"\n+ resolved \"https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.3.tgz#eb7e1c41c4468272557e897e9171ded5e2ded9d1\"\n+ integrity sha512-oprSwp094zOglVrXdlo/4bAHtKTAxX6VT8FOZlBKrmyLbNvE1zxZyJ6yikMVtHIvwP45+ZQGJn+FdXGKTozq0g==\n+ dependencies:\n+ \"@types/express-serve-static-core\" \"*\"\n+ \"@types/mime\" \"*\"\n+\n\"@types/sinon@^7.5.1\":\nversion \"7.5.1\"\nresolved \"https://registry.yarnpkg.com/@types/sinon/-/sinon-7.5.1.tgz#d27b81af0d1cfe1f9b24eebe7a24f74ae40f5b7c\"\nsemver \"^6.3.0\"\ntsutils \"^3.17.1\"\n+accepts@~1.3.7:\n+ version \"1.3.7\"\n+ resolved \"https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd\"\n+ integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==\n+ dependencies:\n+ mime-types \"~2.1.24\"\n+ negotiator \"0.6.2\"\n+\nacorn-jsx@^5.1.0:\nversion \"5.1.0\"\nresolved \"https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.1.0.tgz#294adb71b57398b0680015f0a38c563ee1db5384\"\n@@ -379,6 +444,11 @@ array-find-index@^1.0.1:\nresolved \"https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1\"\nintegrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=\[email protected]:\n+ version \"1.1.1\"\n+ resolved \"https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2\"\n+ integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=\n+\narray-from@^2.1.1:\nversion \"2.1.1\"\nresolved \"https://registry.yarnpkg.com/array-from/-/array-from-2.1.1.tgz#cfe9d8c26628b9dc5aecc62a9f5d8f1f352c1195\"\n@@ -450,6 +520,22 @@ base@^0.11.1:\nmixin-deep \"^1.2.0\"\npascalcase \"^0.1.1\"\[email protected]:\n+ version \"1.19.0\"\n+ resolved \"https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a\"\n+ integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==\n+ dependencies:\n+ bytes \"3.1.0\"\n+ content-type \"~1.0.4\"\n+ debug \"2.6.9\"\n+ depd \"~1.1.2\"\n+ http-errors \"1.7.2\"\n+ iconv-lite \"0.4.24\"\n+ on-finished \"~2.3.0\"\n+ qs \"6.7.0\"\n+ raw-body \"2.4.0\"\n+ type-is \"~1.6.17\"\n+\nbrace-expansion@^1.1.7:\nversion \"1.1.11\"\nresolved \"https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd\"\n@@ -493,6 +579,11 @@ builtins@^1.0.3:\nresolved \"https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88\"\nintegrity sha1-y5T662HIaWRR2zZTThQi+U8K7og=\[email protected]:\n+ version \"3.1.0\"\n+ resolved \"https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6\"\n+ integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==\n+\ncache-base@^1.0.1:\nversion \"1.0.1\"\nresolved \"https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2\"\n@@ -658,12 +749,34 @@ [email protected]:\nversion \"0.0.1\"\nresolved \"https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b\"\[email protected]:\n+ version \"0.5.3\"\n+ resolved \"https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd\"\n+ integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==\n+ dependencies:\n+ safe-buffer \"5.1.2\"\n+\n+content-type@~1.0.4:\n+ version \"1.0.4\"\n+ resolved \"https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b\"\n+ integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==\n+\nconvert-source-map@^1.6.0:\nversion \"1.7.0\"\nresolved \"https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442\"\ndependencies:\nsafe-buffer \"~5.1.1\"\[email protected]:\n+ version \"1.0.6\"\n+ resolved \"https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c\"\n+ integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw=\n+\[email protected]:\n+ version \"0.4.0\"\n+ resolved \"https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba\"\n+ integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==\n+\ncopy-descriptor@^0.1.0:\nversion \"0.1.1\"\nresolved \"https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d\"\n@@ -725,18 +838,18 @@ currently-unhandled@^0.4.1:\ndependencies:\narray-find-index \"^1.0.1\"\[email protected], debug@^3.1.0:\n- version \"3.2.6\"\n- resolved \"https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b\"\n- dependencies:\n- ms \"^2.1.1\"\n-\n-debug@^2.2.0, debug@^2.3.3:\[email protected], debug@^2.2.0, debug@^2.3.3:\nversion \"2.6.9\"\nresolved \"https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f\"\ndependencies:\nms \"2.0.0\"\[email protected], debug@^3.0.1, debug@^3.1.0:\n+ version \"3.2.6\"\n+ resolved \"https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b\"\n+ dependencies:\n+ ms \"^2.1.1\"\n+\ndebug@^4.0.1, debug@^4.1.0, debug@^4.1.1:\nversion \"4.1.1\"\nresolved \"https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791\"\n@@ -803,6 +916,16 @@ define-property@^2.0.2:\nis-descriptor \"^1.0.2\"\nisobject \"^3.0.1\"\n+depd@~1.1.2:\n+ version \"1.1.2\"\n+ resolved \"https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9\"\n+ integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=\n+\n+destroy@~1.0.4:\n+ version \"1.0.4\"\n+ resolved \"https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80\"\n+ integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=\n+\ndetect-indent@^6.0.0:\nversion \"6.0.0\"\nresolved \"https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.0.0.tgz#0abd0f549f69fc6659a254fe96786186b6f528fd\"\n@@ -841,6 +964,11 @@ doctrine@^3.0.0:\ndependencies:\nesutils \"^2.0.2\"\[email protected]:\n+ version \"1.1.1\"\n+ resolved \"https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d\"\n+ integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=\n+\nemoji-regex@^7.0.1:\nversion \"7.0.3\"\nresolved \"https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156\"\n@@ -849,6 +977,11 @@ emoji-regex@^8.0.0:\nversion \"8.0.0\"\nresolved \"https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37\"\n+encodeurl@~1.0.2:\n+ version \"1.0.2\"\n+ resolved \"https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59\"\n+ integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=\n+\nerror-ex@^1.3.1:\nversion \"1.3.2\"\nresolved \"https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf\"\n@@ -882,7 +1015,7 @@ es6-error@^4.0.1:\nversion \"4.1.1\"\nresolved \"https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d\"\n-es6-promise@^4.0.3:\n+es6-promise@^4.0.3, es6-promise@^4.1.1:\nversion \"4.2.8\"\nresolved \"https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a\"\n@@ -892,6 +1025,11 @@ es6-promisify@^5.0.0:\ndependencies:\nes6-promise \"^4.0.3\"\n+escape-html@~1.0.3:\n+ version \"1.0.3\"\n+ resolved \"https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988\"\n+ integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=\n+\[email protected], escape-string-regexp@^1.0.5:\nversion \"1.0.5\"\nresolved \"https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4\"\n@@ -1003,6 +1141,11 @@ esutils@^2.0.2:\nversion \"2.0.3\"\nresolved \"https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64\"\n+etag@~1.8.1:\n+ version \"1.8.1\"\n+ resolved \"https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887\"\n+ integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=\n+\nexpand-brackets@^2.1.4:\nversion \"2.1.4\"\nresolved \"https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622\"\n@@ -1016,6 +1159,51 @@ expand-brackets@^2.1.4:\nsnapdragon \"^0.8.1\"\nto-regex \"^3.0.1\"\n+express-http-proxy@^1.6.0:\n+ version \"1.6.0\"\n+ resolved \"https://registry.yarnpkg.com/express-http-proxy/-/express-http-proxy-1.6.0.tgz#8672b1093cc96b8a93e8e3da948dd111a668ef22\"\n+ integrity sha512-7Re6Lepg96NA2wiv7DC5csChAScn4K76/UgYnC71XiITCT1cgGTJUGK6GS0pIixudg3Fbx3Q6mmEW3mZv5tHFQ==\n+ dependencies:\n+ debug \"^3.0.1\"\n+ es6-promise \"^4.1.1\"\n+ raw-body \"^2.3.0\"\n+\n+express@^4.17.1:\n+ version \"4.17.1\"\n+ resolved \"https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134\"\n+ integrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==\n+ dependencies:\n+ accepts \"~1.3.7\"\n+ array-flatten \"1.1.1\"\n+ body-parser \"1.19.0\"\n+ content-disposition \"0.5.3\"\n+ content-type \"~1.0.4\"\n+ cookie \"0.4.0\"\n+ cookie-signature \"1.0.6\"\n+ debug \"2.6.9\"\n+ depd \"~1.1.2\"\n+ encodeurl \"~1.0.2\"\n+ escape-html \"~1.0.3\"\n+ etag \"~1.8.1\"\n+ finalhandler \"~1.1.2\"\n+ fresh \"0.5.2\"\n+ merge-descriptors \"1.0.1\"\n+ methods \"~1.1.2\"\n+ on-finished \"~2.3.0\"\n+ parseurl \"~1.3.3\"\n+ path-to-regexp \"0.1.7\"\n+ proxy-addr \"~2.0.5\"\n+ qs \"6.7.0\"\n+ range-parser \"~1.2.1\"\n+ safe-buffer \"5.1.2\"\n+ send \"0.17.1\"\n+ serve-static \"1.14.1\"\n+ setprototypeof \"1.1.1\"\n+ statuses \"~1.5.0\"\n+ type-is \"~1.6.18\"\n+ utils-merge \"1.0.1\"\n+ vary \"~1.1.2\"\n+\nextend-shallow@^2.0.1:\nversion \"2.0.1\"\nresolved \"https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f\"\n@@ -1138,6 +1326,19 @@ fill-range@^7.0.1:\ndependencies:\nto-regex-range \"^5.0.1\"\n+finalhandler@~1.1.2:\n+ version \"1.1.2\"\n+ resolved \"https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d\"\n+ integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==\n+ dependencies:\n+ debug \"2.6.9\"\n+ encodeurl \"~1.0.2\"\n+ escape-html \"~1.0.3\"\n+ on-finished \"~2.3.0\"\n+ parseurl \"~1.3.3\"\n+ statuses \"~1.5.0\"\n+ unpipe \"~1.0.0\"\n+\nfind-cache-dir@^2.1.0:\nversion \"2.1.0\"\nresolved \"https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7\"\n@@ -1222,6 +1423,11 @@ foreground-child@^1.5.6:\ncross-spawn \"^4\"\nsignal-exit \"^3.0.0\"\n+forwarded@~0.1.2:\n+ version \"0.1.2\"\n+ resolved \"https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84\"\n+ integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=\n+\nfragment-cache@^0.2.1:\nversion \"0.2.1\"\nresolved \"https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19\"\n@@ -1229,6 +1435,11 @@ fragment-cache@^0.2.1:\ndependencies:\nmap-cache \"^0.2.2\"\[email protected]:\n+ version \"0.5.2\"\n+ resolved \"https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7\"\n+ integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=\n+\[email protected], fs-extra@^8.1.0:\nversion \"8.1.0\"\nresolved \"https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0\"\n@@ -1444,6 +1655,28 @@ hosted-git-info@^2.1.4:\nversion \"2.8.5\"\nresolved \"https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.5.tgz#759cfcf2c4d156ade59b0b2dfabddc42a6b9c70c\"\[email protected]:\n+ version \"1.7.2\"\n+ resolved \"https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f\"\n+ integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==\n+ dependencies:\n+ depd \"~1.1.2\"\n+ inherits \"2.0.3\"\n+ setprototypeof \"1.1.1\"\n+ statuses \">= 1.5.0 < 2\"\n+ toidentifier \"1.0.0\"\n+\[email protected], http-errors@~1.7.2:\n+ version \"1.7.3\"\n+ resolved \"https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06\"\n+ integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==\n+ dependencies:\n+ depd \"~1.1.2\"\n+ inherits \"2.0.4\"\n+ setprototypeof \"1.1.1\"\n+ statuses \">= 1.5.0 < 2\"\n+ toidentifier \"1.0.0\"\n+\nhttps-proxy-agent@^2.2.1:\nversion \"2.2.4\"\nresolved \"https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz#4ee7a737abd92678a293d9b34a1af4d0d08c787b\"\n@@ -1451,7 +1684,7 @@ https-proxy-agent@^2.2.1:\nagent-base \"^4.3.0\"\ndebug \"^3.1.0\"\n-iconv-lite@^0.4.24:\[email protected], iconv-lite@^0.4.24:\nversion \"0.4.24\"\nresolved \"https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b\"\ndependencies:\n@@ -1495,10 +1728,15 @@ inflight@^1.0.4:\nonce \"^1.3.0\"\nwrappy \"1\"\n-inherits@2:\n+inherits@2, [email protected]:\nversion \"2.0.4\"\nresolved \"https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c\"\[email protected]:\n+ version \"2.0.3\"\n+ resolved \"https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de\"\n+ integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=\n+\ninquirer@^7.0.0:\nversion \"7.0.0\"\nresolved \"https://registry.yarnpkg.com/inquirer/-/inquirer-7.0.0.tgz#9e2b032dde77da1db5db804758b8fea3a970519a\"\n@@ -1521,6 +1759,11 @@ interpret@^1.0.0:\nversion \"1.2.0\"\nresolved \"https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296\"\[email protected]:\n+ version \"1.9.0\"\n+ resolved \"https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.0.tgz#37df74e430a0e47550fe54a2defe30d8acd95f65\"\n+ integrity sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==\n+\nis-accessor-descriptor@^0.1.6:\nversion \"0.1.6\"\nresolved \"https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6\"\n@@ -1673,6 +1916,11 @@ is-windows@^1.0.2:\nresolved \"https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d\"\nintegrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==\n+is-wsl@^2.1.0:\n+ version \"2.1.1\"\n+ resolved \"https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.1.1.tgz#4a1c152d429df3d441669498e2486d3596ebaf1d\"\n+ integrity sha512-umZHcSrwlDHo2TGMXv0DZ8dIUGunZ2Iv68YZnrmCiBPkZ4aaOhtv7pXJKeki9k3qJ3RJr0cDyitcl5wEH3AYog==\n+\[email protected]:\nversion \"0.0.1\"\nresolved \"https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf\"\n@@ -1967,6 +2215,11 @@ md5@^2.1.0:\ncrypt \"~0.0.1\"\nis-buffer \"~1.1.1\"\[email protected]:\n+ version \"0.3.0\"\n+ resolved \"https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748\"\n+ integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=\n+\nmeow@^5.0.0:\nversion \"5.0.0\"\nresolved \"https://registry.yarnpkg.com/meow/-/meow-5.0.0.tgz#dfc73d63a9afc714a5e371760eb5c88b91078aa4\"\n@@ -1982,6 +2235,11 @@ meow@^5.0.0:\ntrim-newlines \"^2.0.0\"\nyargs-parser \"^10.0.0\"\[email protected]:\n+ version \"1.0.1\"\n+ resolved \"https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61\"\n+ integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=\n+\nmerge-source-map@^1.1.0:\nversion \"1.1.0\"\nresolved \"https://registry.yarnpkg.com/merge-source-map/-/merge-source-map-1.1.0.tgz#2fdde7e6020939f70906a68f2d7ae685e4c8c646\"\n@@ -1997,6 +2255,11 @@ merge2@^1.2.3, merge2@^1.3.0:\nresolved \"https://registry.yarnpkg.com/merge2/-/merge2-1.3.0.tgz#5b366ee83b2f1582c48f87e47cf1a9352103ca81\"\nintegrity sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==\n+methods@~1.1.2:\n+ version \"1.1.2\"\n+ resolved \"https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee\"\n+ integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=\n+\nmicromatch@^3.1.10:\nversion \"3.1.10\"\nresolved \"https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23\"\n@@ -2024,6 +2287,23 @@ micromatch@^4.0.2:\nbraces \"^3.0.1\"\npicomatch \"^2.0.5\"\[email protected]:\n+ version \"1.43.0\"\n+ resolved \"https://registry.yarnpkg.com/mime-db/-/mime-db-1.43.0.tgz#0a12e0502650e473d735535050e7c8f4eb4fae58\"\n+ integrity sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==\n+\n+mime-types@~2.1.24:\n+ version \"2.1.26\"\n+ resolved \"https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.26.tgz#9c921fc09b7e149a65dfdc0da4d20997200b0a06\"\n+ integrity sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==\n+ dependencies:\n+ mime-db \"1.43.0\"\n+\[email protected]:\n+ version \"1.6.0\"\n+ resolved \"https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1\"\n+ integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==\n+\nmimic-fn@^2.1.0:\nversion \"2.1.0\"\nresolved \"https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b\"\n@@ -2139,6 +2419,11 @@ natural-compare@^1.4.0:\nversion \"1.4.0\"\nresolved \"https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7\"\[email protected]:\n+ version \"0.6.2\"\n+ resolved \"https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb\"\n+ integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==\n+\nneo-async@^2.6.0:\nversion \"2.6.1\"\nresolved \"https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c\"\n@@ -2269,6 +2554,13 @@ object.pick@^1.3.0:\ndependencies:\nisobject \"^3.0.1\"\n+on-finished@~2.3.0:\n+ version \"2.3.0\"\n+ resolved \"https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947\"\n+ integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=\n+ dependencies:\n+ ee-first \"1.1.1\"\n+\nonce@^1.3.0:\nversion \"1.4.0\"\nresolved \"https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1\"\n@@ -2281,6 +2573,13 @@ onetime@^5.1.0:\ndependencies:\nmimic-fn \"^2.1.0\"\n+open@^7.0.0:\n+ version \"7.0.0\"\n+ resolved \"https://registry.yarnpkg.com/open/-/open-7.0.0.tgz#7e52999b14eb73f90f0f0807fe93897c4ae73ec9\"\n+ integrity sha512-K6EKzYqnwQzk+/dzJAQSBORub3xlBTxMz+ntpZpH/LyCa1o6KjXhuN+2npAaI9jaSmU3R1Q8NWf4KUWcyytGsQ==\n+ dependencies:\n+ is-wsl \"^2.1.0\"\n+\noptimist@^0.6.1:\nversion \"0.6.1\"\nresolved \"https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686\"\n@@ -2377,6 +2676,11 @@ parse-json@^4.0.0:\nerror-ex \"^1.3.1\"\njson-parse-better-errors \"^1.0.1\"\n+parseurl@~1.3.3:\n+ version \"1.3.3\"\n+ resolved \"https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4\"\n+ integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==\n+\npascalcase@^0.1.1:\nversion \"0.1.1\"\nresolved \"https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14\"\n@@ -2412,6 +2716,11 @@ path-parse@^1.0.6:\nversion \"1.0.6\"\nresolved \"https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c\"\[email protected]:\n+ version \"0.1.7\"\n+ resolved \"https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c\"\n+ integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=\n+\npath-to-regexp@^1.7.0:\nversion \"1.8.0\"\nresolved \"https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.8.0.tgz#887b3ba9d84393e87a0a0b9f4cb756198b53548a\"\n@@ -2485,6 +2794,14 @@ propagate@^2.0.0:\nversion \"2.0.1\"\nresolved \"https://registry.yarnpkg.com/propagate/-/propagate-2.0.1.tgz#40cdedab18085c792334e64f0ac17256d38f9a45\"\n+proxy-addr@~2.0.5:\n+ version \"2.0.5\"\n+ resolved \"https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.5.tgz#34cbd64a2d81f4b1fd21e76f9f06c8a45299ee34\"\n+ integrity sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==\n+ dependencies:\n+ forwarded \"~0.1.2\"\n+ ipaddr.js \"1.9.0\"\n+\npseudomap@^1.0.2:\nversion \"1.0.2\"\nresolved \"https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3\"\n@@ -2493,11 +2810,41 @@ punycode@^2.1.0:\nversion \"2.1.1\"\nresolved \"https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec\"\[email protected]:\n+ version \"6.7.0\"\n+ resolved \"https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc\"\n+ integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==\n+\nquick-lru@^1.0.0:\nversion \"1.1.0\"\nresolved \"https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8\"\nintegrity sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=\n+range-parser@~1.2.1:\n+ version \"1.2.1\"\n+ resolved \"https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031\"\n+ integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==\n+\[email protected]:\n+ version \"2.4.0\"\n+ resolved \"https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332\"\n+ integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==\n+ dependencies:\n+ bytes \"3.1.0\"\n+ http-errors \"1.7.2\"\n+ iconv-lite \"0.4.24\"\n+ unpipe \"1.0.0\"\n+\n+raw-body@^2.3.0:\n+ version \"2.4.1\"\n+ resolved \"https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.1.tgz#30ac82f98bb5ae8c152e67149dac8d55153b168c\"\n+ integrity sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA==\n+ dependencies:\n+ bytes \"3.1.0\"\n+ http-errors \"1.7.3\"\n+ iconv-lite \"0.4.24\"\n+ unpipe \"1.0.0\"\n+\nread-pkg-up@^3.0.0:\nversion \"3.0.0\"\nresolved \"https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07\"\n@@ -2703,14 +3050,14 @@ rxjs@^6.4.0:\ndependencies:\ntslib \"^1.9.0\"\[email protected], safe-buffer@~5.1.1:\n+ version \"5.1.2\"\n+ resolved \"https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d\"\n+\nsafe-buffer@^5.0.1:\nversion \"5.2.0\"\nresolved \"https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519\"\n-safe-buffer@~5.1.1:\n- version \"5.1.2\"\n- resolved \"https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d\"\n-\nsafe-regex@^1.1.0:\nversion \"1.1.0\"\nresolved \"https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e\"\n@@ -2738,10 +3085,39 @@ semver@^6.0.0, semver@^6.1.2, semver@^6.3.0:\nversion \"6.3.0\"\nresolved \"https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d\"\[email protected]:\n+ version \"0.17.1\"\n+ resolved \"https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8\"\n+ integrity sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==\n+ dependencies:\n+ debug \"2.6.9\"\n+ depd \"~1.1.2\"\n+ destroy \"~1.0.4\"\n+ encodeurl \"~1.0.2\"\n+ escape-html \"~1.0.3\"\n+ etag \"~1.8.1\"\n+ fresh \"0.5.2\"\n+ http-errors \"~1.7.2\"\n+ mime \"1.6.0\"\n+ ms \"2.1.1\"\n+ on-finished \"~2.3.0\"\n+ range-parser \"~1.2.1\"\n+ statuses \"~1.5.0\"\n+\nserialize-javascript@^1.7.0:\nversion \"1.9.1\"\nresolved \"https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.9.1.tgz#cfc200aef77b600c47da9bb8149c943e798c2fdb\"\[email protected], serve-static@^1.14.1:\n+ version \"1.14.1\"\n+ resolved \"https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9\"\n+ integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==\n+ dependencies:\n+ encodeurl \"~1.0.2\"\n+ escape-html \"~1.0.3\"\n+ parseurl \"~1.3.3\"\n+ send \"0.17.1\"\n+\nset-blocking@^2.0.0:\nversion \"2.0.0\"\nresolved \"https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7\"\n@@ -2756,6 +3132,11 @@ set-value@^2.0.0, set-value@^2.0.1:\nis-plain-object \"^2.0.3\"\nsplit-string \"^3.0.1\"\[email protected]:\n+ version \"1.1.1\"\n+ resolved \"https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683\"\n+ integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==\n+\nshebang-command@^1.2.0:\nversion \"1.2.0\"\nresolved \"https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea\"\n@@ -2944,6 +3325,11 @@ static-extend@^0.1.1:\ndefine-property \"^0.2.5\"\nobject-copy \"^0.1.0\"\n+\"statuses@>= 1.5.0 < 2\", statuses@~1.5.0:\n+ version \"1.5.0\"\n+ resolved \"https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c\"\n+ integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=\n+\nstring-argv@^0.3.1:\nversion \"0.3.1\"\nresolved \"https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da\"\n@@ -3123,6 +3509,11 @@ to-regex@^3.0.1, to-regex@^3.0.2:\nregex-not \"^1.0.2\"\nsafe-regex \"^1.1.0\"\[email protected]:\n+ version \"1.0.0\"\n+ resolved \"https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553\"\n+ integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==\n+\ntrim-newlines@^2.0.0:\nversion \"2.0.0\"\nresolved \"https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-2.0.0.tgz#b403d0b91be50c331dfc4b82eeceb22c3de16d20\"\n@@ -3162,6 +3553,14 @@ type-fest@^0.8.1:\nversion \"0.8.1\"\nresolved \"https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d\"\n+type-is@~1.6.17, type-is@~1.6.18:\n+ version \"1.6.18\"\n+ resolved \"https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131\"\n+ integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==\n+ dependencies:\n+ media-typer \"0.3.0\"\n+ mime-types \"~2.1.24\"\n+\ntypedoc-default-themes@^0.6.1:\nversion \"0.6.1\"\nresolved \"https://registry.yarnpkg.com/typedoc-default-themes/-/typedoc-default-themes-0.6.1.tgz#e2e471188983df995f4f9df49f713044fced6802\"\n@@ -3226,6 +3625,11 @@ universalify@^0.1.0:\nversion \"0.1.2\"\nresolved \"https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66\"\[email protected], unpipe@~1.0.0:\n+ version \"1.0.0\"\n+ resolved \"https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec\"\n+ integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=\n+\nunset-value@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559\"\n@@ -3253,6 +3657,11 @@ use@^3.1.0:\nresolved \"https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f\"\nintegrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==\[email protected]:\n+ version \"1.0.1\"\n+ resolved \"https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713\"\n+ integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=\n+\nuuid@^3.3.2:\nversion \"3.3.3\"\nresolved \"https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866\"\n@@ -3275,6 +3684,11 @@ validate-npm-package-name@^3.0.0:\ndependencies:\nbuiltins \"^1.0.3\"\n+vary@~1.1.2:\n+ version \"1.1.2\"\n+ resolved \"https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc\"\n+ integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=\n+\nversion-bump-prompt@^5.0.6:\nversion \"5.0.6\"\nresolved \"https://registry.yarnpkg.com/version-bump-prompt/-/version-bump-prompt-5.0.6.tgz#71fb464316645253ba3f301fffd4804d8924ad75\"\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(examples): add browser examples iwth a local proxy server to influx |
305,159 | 08.01.2020 13:12:29 | -3,600 | 94cc7bcbf1267dab54583d4903a5d20056936eb1 | chore(doc): review code in order to improve documentation | [
{
"change_type": "MODIFY",
"old_path": "examples/README.md",
"new_path": "examples/README.md",
"diff": "- Run `yarn --cwd ..` in this directory\n- Run `yarn --cwd .. build` in this directory, the referenced client library is then compiled\n- Node.js examples\n- - Change variables in [./env.ts](env.ts) to configure connection to your InfluxDB instance. The file can be used as-is against a [docker influxDB v2.0 installation](https://v2.docs.influxdata.com/v2.0/get-started/)\n+ - Change variables in [./env.ts](env.ts) to configure connection to your InfluxDB instance. The file can be used as-is against a new [docker influxDB v2.0 installation](https://v2.docs.influxdata.com/v2.0/get-started/)\n- Examples are executable. If it does not work for you, run `yarn ts-node EXAMPLE.ts`.\n- [setupInfluxDB.ts](./setupInfluxDB.ts)\n- Performs onboarding of a new influxDB database (such as a new docker pod). It creates a new organization, bucket and user that is then used in examples.\n+ Performs onboarding of a new influxDB database. It creates a new organization, bucket and user that is then used in all examples.\n- [write.ts](./write.ts)\nWrites data points to InfluxDB.\n- [query.ts](./query.ts)\nQuery InfluxDB with [Flux](https://v2.docs.influxdata.com/v2.0/query-data/get-started/).\n- Browser examples\n- - Change `url` [./env.ts](env.ts) to match your influxDB instance\n- - Change `token,org,bucket` variables [./index.html](index.html) to match your influxDB instance\n+ - Change `url` in [./env.ts](env.ts) to match your influxDB instance\n+ - Change `token,org,bucket` variables in [./index.html](index.html) to match your influxDB instance\n- Run `yarn browser`\n- Starts a local HTTP server to provide browser examples and opens [./index.html](index.html) in your browser.\n- The local HTTP server serves all static files from the parent repository and also proxies requests from '/api'\n- path to a configured influxDB database.\n+ It starts a local HTTP server and opens [./index.html](index.html) in a default browser.\n+ The local HTTP server serves all static files from the parent repository and also proxies requests\n+ to a configured influxDB database, see [./scripts/server.js](server.js) for details.\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/InfluxDB.ts",
"new_path": "packages/core/src/InfluxDB.ts",
"diff": "@@ -10,26 +10,6 @@ import QueryApiImpl from './impl/QueryApiImpl'\nimport SetupApi from './SetupApi'\nimport SetupApiImpl from './impl/SetupApiImpl'\n-/**\n- * Fills URL out into into a configuration object\n- */\n-function fillOptions(\n- url: string | undefined,\n- options: {[key: string]: any}\n-): {[key: string]: any} {\n- if (url) {\n- options.url = url\n- }\n- return options\n-}\n-\n-/**\n- * Creates default transport using the connection options supplied.\n- */\n-function createTransport(options: ClientOptions): Transport {\n- return new TransportImpl(options)\n-}\n-\n/**\n* InfluxDB 2.0 client that uses HTTP API described in https://v2.docs.influxdata.com/v2.0/reference/api/ .\n*/\n@@ -51,21 +31,21 @@ export default class InfluxDB {\nconstructor(options?: any) {\nif (typeof options === 'string') {\n- this._options = fillOptions(options, {}) as ClientOptions\n+ this._options = {url: options}\n} else if (options !== null && typeof options === 'object') {\n- this._options = fillOptions(options.url, options) as ClientOptions\n+ this._options = options\n} else {\nthrow new IllegalArgumentError('No url or configuration specified!')\n}\nif (this._options.url === undefined)\nthrow new IllegalArgumentError('No url specified!')\n- this.transport = this._options.transport || createTransport(this._options)\n+ this.transport = this._options.transport || new TransportImpl(this._options)\n}\n/* eslint-enable no-dupe-class-members */\n/**\n* Creates [[WriteApi]] for the supplied organization and bucket. BEWARE that returned instances must be closed\n- * in order to flush the remaining data and close already scheduled executions.\n+ * in order to flush the remaining data and close already scheduled retry executions.\n*\n* @param org Specifies the destination organization for writes. Takes either the ID or Name interchangeably.\n* @param bucket The destination bucket for writes.\n@@ -88,7 +68,7 @@ export default class InfluxDB {\n/**\n* Creates [[QueryAPI]] for the supplied organization .\n*\n- * @param org Specifies the organization for queries.\n+ * @param org organization\n* @return query api instance\n*/\ngetQueryApi(org: string): QueryApi {\n@@ -96,10 +76,9 @@ export default class InfluxDB {\n}\n/**\n- * Retruns [[SetupApi]] for the supplied organization .\n+ * Returns [[SetupApi]].\n*\n- * @param org Specifies the organization for queries.\n- * @return query api instance\n+ * @return setup api instance\n*/\ngetSetupApi(): SetupApi {\nreturn new SetupApiImpl(this.transport)\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/Point.ts",
"new_path": "packages/core/src/Point.ts",
"diff": "@@ -21,9 +21,9 @@ export default class Point {\n}\n/**\n- * Setups point's measurement.\n+ * Sets point's measurement.\n*\n- * @param name the measurement name\n+ * @param name measurement name\n* @return new instance of {@link Point}\n*/\npublic measurement(name: string): Point {\n@@ -97,6 +97,13 @@ export default class Point {\nreturn this\n}\n+ /**\n+ * Adds a string field.\n+ *\n+ * @param name field name\n+ * @param value field value\n+ * @return this\n+ */\npublic stringField(name: string, value: string | any): Point {\nif (value !== null && value !== undefined) {\nif (typeof value !== 'string') value = String(value)\n@@ -105,6 +112,12 @@ export default class Point {\nreturn this\n}\n+ /**\n+ * Sets point time.\n+ *\n+ * @param value point time\n+ * @return this\n+ */\npublic timestamp(value: string | undefined): Point {\nthis.time = value\nreturn this\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/QueryApi.ts",
"new_path": "packages/core/src/QueryApi.ts",
"diff": "@@ -29,7 +29,8 @@ export interface QueryOptions {\n}\n/**\n- * Query InfluxDB 2.0.\n+ * Query InfluxDB 2.0. Provides methods that notify abouts result lines of the executed query.\n+ * @see <a href=\"https://v2.docs.influxdata.com/v2.0/api/#operation/PostQuery\">https://v2.docs.influxdata.com/v2.0/api/#operation/PostQuery</a>.\n*/\nexport default interface QueryApi {\n/**\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/SetupApi.ts",
"new_path": "packages/core/src/SetupApi.ts",
"diff": "*/\nexport default interface SetupApi {\n/**\n- * Is on-boarding still allowed.\n+ * Is on-boarding still allowed?\n* @return false if it was already performed\n*/\nisOnboarding(): Promise<boolean>\n/**\n* Setups a (new) influx DB instance.\n* @param request default user and password, organization, bucket\n- * @param token optional authentication token to be used with that user\n* @return information about the setup process (cast to OnboardingResponse from the generated api) to know more\n*/\nsetup(request: {\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/WriteApi.ts",
"new_path": "packages/core/src/WriteApi.ts",
"diff": "@@ -31,14 +31,14 @@ export default interface WriteApi {\n/**\n* Write point.\n*\n- * @param records lines in InfluxDB Line Protocol\n+ * @param point point to write\n*/\nwritePoint(point: Point): void\n/**\n* Write points.\n*\n- * @param records lines in InfluxDB Line Protocol\n+ * @param points points to write\n*/\nwritePoints(points: ArrayLike<Point>): void\n@@ -49,13 +49,13 @@ export default interface WriteApi {\nflush(): Promise<void>\n/**\n- * Closes this writer, cancels retries of writes operations that failed.\n+ * Flushes this writer and cancels retries of write operations that failed.\n* @return completition promise\n*/\nclose(): Promise<void>\n/**\n- * Unlike close, dispose simply quits without trying to send\n+ * Unlike close, dispose simply quits without trying to flush\n* the buffered data.\n*/\ndispose(): void\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/impl/browser/FetchTransport.ts",
"new_path": "packages/core/src/impl/browser/FetchTransport.ts",
"diff": "@@ -65,21 +65,25 @@ export default class FetchTransport implements Transport {\nresponse\n.text()\n.then((text: string) => {\n- throw new HttpError(\n+ observer.error(\n+ new HttpError(\nresponse.status,\nresponse.statusText,\ntext,\nresponse.headers.get('retry-after')\n)\n+ )\n})\n.catch((e: Error) => {\nLogger.warn('Unable to receive error body', e)\n- throw new HttpError(\n+ observer.error(\n+ new HttpError(\nresponse.status,\nresponse.statusText,\nundefined,\nresponse.headers.get('retry-after')\n)\n+ )\n})\n} else {\nif (response.body) {\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/options.ts",
"new_path": "packages/core/src/options.ts",
"diff": "import {Transport} from './transport'\n+/**\n+ * Option for the communication with InfluxDB server.\n+ */\nexport interface ConnectionOptions {\n/** base URL */\nurl: string\n@@ -11,10 +14,14 @@ export interface ConnectionOptions {\ntransportOptions?: {[key: string]: any}\n}\n+/** default connection options */\nexport const DEFAULT_ConnectionOptions: Partial<ConnectionOptions> = {\ntimeout: 10000,\n}\n+/**\n+ * Options that configure strategy for retrying failed requests.\n+ */\nexport interface RetryDelayStrategyOptions {\n/** include random milliseconds when retrying HTTP calls */\nretryJitter: number\n@@ -24,6 +31,9 @@ export interface RetryDelayStrategyOptions {\nmaxRetryDelay: number\n}\n+/**\n+ * Options that configure strategy for retrying failed InfluxDB write operations.\n+ */\nexport interface WriteRetryOptions extends RetryDelayStrategyOptions {\n/** max number of retries when write fails */\nmaxRetries: number\n@@ -32,7 +42,7 @@ export interface WriteRetryOptions extends RetryDelayStrategyOptions {\n}\n/**\n- * Options used by [[WriteApi]]\n+ * Options used by [[WriteApi]] .\n*/\nexport interface WriteOptions extends WriteRetryOptions {\n/** max number of records to send in a batch */\n@@ -41,12 +51,14 @@ export interface WriteOptions extends WriteRetryOptions {\nflushInterval: number\n}\n+/** default RetryDelayStrategyOptions */\nexport const DEFAULT_RetryDelayStrategyOptions = Object.freeze({\nretryJitter: 200,\nminRetryDelay: 1000,\nmaxRetryDelay: 15000,\n})\n+/** default writeOptions */\nexport const DEFAULT_WriteOptions: WriteOptions = Object.freeze({\nbatchSize: 1000,\nflushInterval: 60000,\n@@ -55,6 +67,9 @@ export const DEFAULT_WriteOptions: WriteOptions = Object.freeze({\n...DEFAULT_RetryDelayStrategyOptions,\n})\n+/**\n+ * Options used by [[InfluxDB]] .\n+ */\nexport interface ClientOptions extends ConnectionOptions {\n/** to override default writing options */\nwriteOptions?: Partial<WriteOptions>\n@@ -62,6 +77,10 @@ export interface ClientOptions extends ConnectionOptions {\ntransport?: Transport\n}\n+/**\n+ * Precission for write operations.\n+ * @see <a href=\"https://v2.docs.influxdata.com/v2.0/api/#operation/PostWrite\">https://v2.docs.influxdata.com/v2.0/api/#operation/PostWrite</a>\n+ */\nexport const enum WritePrecision {\n/** nanosecond */\nns = 'ns',\n@@ -73,6 +92,10 @@ export const enum WritePrecision {\ns = 's',\n}\n+/**\n+ * Settings that control the way of how a [[Point]] is serialized\n+ * to a protocol line.\n+ */\nexport interface PointSettings {\ndefaultTags?: {[key: string]: string}\nconvertTime?: (value: string | undefined) => string | undefined\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/query/FluxResultObserver.ts",
"new_path": "packages/core/src/query/FluxResultObserver.ts",
"diff": "@@ -2,7 +2,7 @@ import Cancellable from '../util/Cancellable'\nimport FluxTableMetaData from './FluxTableMetaData'\n/**\n- * Observes the results of the flux query.\n+ * Observes results of a flux query.\n*/\nexport default interface FluxResultObserver<T> {\n/**\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/query/FluxTableColumn.ts",
"new_path": "packages/core/src/query/FluxTableColumn.ts",
"diff": "/**\n- * Type of the columns, see https://v2.docs.influxdata.com/v2.0/reference/syntax/annotated-csv/#valid-data-types\n+ * Type of query result column, see https://v2.docs.influxdata.com/v2.0/reference/syntax/annotated-csv/#valid-data-types\n*/\nexport type ColumnType =\n| 'boolean'\n@@ -12,7 +12,7 @@ export type ColumnType =\n| 'duration'\n/**\n- * Represents column metadata of a flux <a href=\"http://bit.ly/flux-spec#table\">table</a>.\n+ * Column metadata of a flux <a href=\"http://bit.ly/flux-spec#table\">table</a>.\n*/\nexport default class FluxTableColumn {\n/**\n@@ -26,7 +26,7 @@ export default class FluxTableColumn {\ndataType: ColumnType\n/**\n- * Boolean flag indicating if the column is part of the table's group key.\n+ * Boolean flag indicating if the column is a part of the table's group key.\n*/\ngroup: boolean\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/query/FluxTableMetaData.ts",
"new_path": "packages/core/src/query/FluxTableMetaData.ts",
"diff": "@@ -24,7 +24,7 @@ export default class FluxTableMetaData {\nthrow new IllegalArgumentError(`Column ${label} not found!`)\n}\n/**\n- * Creates an object accordin to columns and supplied record.\n+ * Creates an object out of the supplied values with the help of columns .\n* @param values values for each column\n*/\ntoObject(values: string[]): {[key: string]: string} {\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/transport.ts",
"new_path": "packages/core/src/transport.ts",
"diff": "@@ -31,7 +31,7 @@ export interface CommunicationObserver<T> {\n}\n/**\n- * Options that can be send when sending a message.\n+ * Options for sending a request message.\n*/\nexport interface SendOptions {\nmethod: string\n@@ -39,7 +39,8 @@ export interface SendOptions {\n}\n/**\n- * Simpified platform-neutral data chunk manipulation.\n+ * Simpified platform-neutral data chunk manipulation, it might differ between\n+ * target platform (node vs browser).\n*/\nexport interface ChunkCombiner {\n/**\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/util/Cancellable.ts",
"new_path": "packages/core/src/util/Cancellable.ts",
"diff": "/**\n- * Performs cancellation of a running query.\n+ * Allows to cancel a running query.\n*/\nexport default interface Cancellable {\n/**\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/util/currentTime.ts",
"new_path": "packages/core/src/util/currentTime.ts",
"diff": "@@ -71,6 +71,11 @@ function seconds(): string {\nreturn String(Math.floor(Date.now() / 1000))\n}\n+/**\n+ * Exposes functions that creates strings that represent a timestamp that\n+ * can be used in the line protocol. Micro and nano timestamps are emulated\n+ * depending on the js platform in use.\n+ */\nexport const currentTime = Object.freeze({\n[String(WritePrecision.s)]: seconds,\n[String(WritePrecision.ms)]: millis,\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore(doc): review code in order to improve documentation |
305,159 | 09.01.2020 08:03:26 | -3,600 | 64780a7821cd30290a501ea159ad716de8d02c86 | feat(core): make transport readonly in InfluxDB for APIs to use | [
{
"change_type": "MODIFY",
"old_path": "packages/apis/package.json",
"new_path": "packages/apis/package.json",
"diff": "\"build\": \"yarn run clean && yarn run lint && rollup -c\",\n\"build:doc\": \"yarn run clean && typedoc --out ./doc ./src\",\n\"clean\": \"rimraf build doc\",\n+ \"clean:apis\": \"rimraf build/generated/*API.ts\",\n\"test\": \"yarn run lint && yarn run typecheck\",\n\"typecheck\": \"tsc --noEmit --pretty\",\n\"lint\": \"eslint 'src/**/*.ts'\",\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/InfluxDB.ts",
"new_path": "packages/core/src/InfluxDB.ts",
"diff": "@@ -15,7 +15,7 @@ import SetupApiImpl from './impl/SetupApiImpl'\n*/\nexport default class InfluxDB {\nprivate _options: ClientOptions\n- private transport: Transport\n+ readonly transport: Transport\n/* eslint-disable no-dupe-class-members */\n/**\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(core): make transport readonly in InfluxDB for APIs to use |
305,159 | 09.01.2020 14:14:12 | -3,600 | 987aa0f245e56fc37f6bcd7859cf871946976dea | feat(node): allow to define custom authorization header | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/impl/node/NodeHttpTransport.ts",
"new_path": "packages/core/src/impl/node/NodeHttpTransport.ts",
"diff": "@@ -151,19 +151,22 @@ export class NodeHttpTransport implements Transport {\nsendOptions: SendOptions\n): {[key: string]: any} {\nconst bodyBuffer = Buffer.from(body, 'utf-8')\n+ const headers: {[key: string]: any} = {\n+ 'content-type': 'application/json; charset=utf-8',\n+ }\n+ if (this.connectionOptions.token) {\n+ headers.authorization = 'Token ' + this.connectionOptions.token\n+ }\nconst options: {[key: string]: any} = {\n...this.defaultOptions,\npath,\nmethod: sendOptions.method,\nheaders: {\n- 'content-type': 'application/json; charset=utf-8',\n+ ...headers,\n...sendOptions.headers,\n},\nbody: bodyBuffer,\n}\n- if (this.connectionOptions.token) {\n- options.headers.authorization = 'Token ' + this.connectionOptions.token\n- }\noptions.headers['content-length'] = bodyBuffer.length\nreturn options\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(node): allow to define custom authorization header |
305,159 | 09.01.2020 20:04:38 | -3,600 | e354ab2b5f3924b4c6bca212282529cd35a22c6c | feat(apis): build api package | [
{
"change_type": "MODIFY",
"old_path": ".circleci/config.yml",
"new_path": ".circleci/config.yml",
"diff": "@@ -32,7 +32,9 @@ jobs:\ncd ./packages/core\nyarn test:unit:ci\nyarn lint:ci\n- # yarn typedoc\n+ yarn build\n+ cd ../apis\n+ yarn build\n# Upload results\n- store_test_results:\npath: reports\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/package.json",
"new_path": "examples/package.json",
"diff": "\"version\": \"0.4.0\",\n\"license\": \"MIT\",\n\"scripts\": {\n+ \"browser\": \"ts-node scripts/server.js\",\n\"clean\": \"echo 'nothing to clean'\",\n- \"browser\": \"ts-node scripts/server.js\"\n+ \"build\": \"echo 'nothing to build'\",\n+ \"test\": \"echo 'run examples to test'\"\n},\n\"dependencies\": {\n\"@bonitoo-io/influxdb-client\": \"*\",\n"
},
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"preinstall\": \"node ./scripts/require-yarn.js\",\n\"postinstall\": \"manypkg check\",\n\"clean\": \"yarn workspaces run clean\",\n- \"build\": \"cd ./packages/core && yarn run build\",\n- \"test\": \"cd ./packages/core && yarn test\"\n+ \"build\": \"yarn workspaces run build\",\n+ \"test\": \"yarn workspaces run test\"\n},\n\"homepage\": \"https://github.com/bonitoo-io/influxdb-client-js\",\n\"repository\": {\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/README.md",
"new_path": "packages/apis/README.md",
"diff": "@@ -4,19 +4,19 @@ Contains generated client APIs for InfluxDB v2.0\n## Re-generate APIs code\n-- update local swagger.yml to the latest version\n+- update local resources/swagger.yml to the latest version\n- `wget -O resources/swagger.yml https://raw.githubusercontent.com/influxdata/influxdb/master/http/swagger.yml`\n-- generate types.ts and operations.json\n+- re-generate src/generated/types.ts and resources/operations.json\n- `rm -rf src/generated/*.ts`\n- `oats -i 'types' --storeOperations resources/operations.json resources/swagger.yml > src/generated/types.ts`\n-- generate API from resources/operations.json\n+- generate src/generated APIs from resources/operations.json\n- `yarn generate`\n- validate\n- `yarn test`\n## Usage\n-See [Examples](../examples)\n+See [Examples](../../examples/README.md)\n## Build\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/generator/index.ts",
"new_path": "packages/apis/generator/index.ts",
"diff": "@@ -18,8 +18,15 @@ const apis = operations.reduce(\n},\n{} as {[api: string]: Array<Operation>}\n)\n+const indexContent = [\"export * from './types'\"]\nfor (const key of Object.keys(apis).sort()) {\nconst {apiName, code} = generateApi(key, apis[key])\nlogger.info(apiName + '.ts')\n+ indexContent.push(`export * from './${apiName}'`)\nfs.writeFileSync(path.join(targetDir, apiName + '.ts'), code)\n}\n+logger.info('index.ts')\n+fs.writeFileSync(\n+ path.join(targetDir, 'index.ts'),\n+ indexContent.join('\\n') + '\\n'\n+)\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/package.json",
"new_path": "packages/apis/package.json",
"diff": "\"description\": \"InfluxDB 2.0 generated APIs\",\n\"scripts\": {\n\"build\": \"yarn run clean && yarn run lint && rollup -c\",\n- \"build:doc\": \"yarn run clean && typedoc --out ./doc ./src\",\n- \"clean\": \"rimraf build doc\",\n+ \"build:doc\": \"yarn run clean && yarn typedoc\",\n+ \"clean\": \"rimraf build doc dist\",\n\"clean:apis\": \"rimraf src/generated/*API.ts\",\n\"generate\": \"yarn ts-node generator && yarn prettier --write src/generated/*.ts\",\n\"test\": \"yarn run lint && yarn run typecheck\",\n\"typecheck\": \"tsc --noEmit --pretty\",\n+ \"typedoc\": \"typedoc --excludePrivate --excludeNotExported --mode file --out ./doc --target es6 --tsconfig ./tsconfig.build.json ./src\",\n\"lint\": \"eslint 'src/**/*.ts'\",\n\"lint:fix\": \"eslint --fix 'src/**/*.ts'\"\n},\n\"main\": \"dist/index.js\",\n\"module\": \"dist/index.mjs\",\n+ \"browser\": {\n+ \"dist/index.js\": \"dist/index.browser.js\",\n+ \"dist/index.mjs\": \"dist/index.browser.mjs\"\n+ },\n\"homepage\": \"https://github.com/bonitoo-io/influxdb-client-js\",\n\"keywords\": [\n\"influxdb\",\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/apis/rollup.config.js",
"diff": "+import {terser} from 'rollup-plugin-terser'\n+import gzip from 'rollup-plugin-gzip'\n+import typescript from 'rollup-plugin-typescript2'\n+import pkg from './package.json'\n+import replace from '@rollup/plugin-replace'\n+\n+const tsBuildConfigPath = './tsconfig.build.json'\n+\n+const input = 'src/index.ts'\n+function createConfig({browser, format, out, name, target, noTerser}) {\n+ return {\n+ input,\n+ plugins: [\n+ replace(\n+ browser\n+ ? {\n+ 'process.env.ROLLUP_BROWSER': 'true',\n+ delimiters: ['', ''],\n+ }\n+ : {\n+ 'process.env.ROLLUP_BROWSER': 'false',\n+ delimiters: ['', ''],\n+ }\n+ ),\n+ typescript({\n+ tsconfig: tsBuildConfigPath,\n+ tsconfigOverride: {\n+ compilerOptions: {\n+ target: target || 'es2015',\n+ },\n+ },\n+ }),\n+ noTerser ? undefined : terser(),\n+ gzip(),\n+ ],\n+ output: {\n+ name: name || pkg.name,\n+ file: out,\n+ format: format,\n+ sourcemap: true,\n+ },\n+ //external: browser ? undefined : externalNodeModules,\n+ }\n+}\n+\n+export default [\n+ createConfig({browser: false, format: 'cjs', out: pkg.main}),\n+ createConfig({browser: false, format: 'esm', out: pkg.module}),\n+ createConfig({browser: true, format: 'umd', out: pkg.browser[pkg.main]}),\n+ createConfig({\n+ browser: true,\n+ format: 'esm',\n+ out: pkg.browser[pkg.module],\n+ }),\n+ createConfig({\n+ browser: true,\n+ format: 'iife',\n+ name: 'influxdbApis',\n+ out: 'dist/influxdbApis.min.js',\n+ target: 'es5',\n+ }),\n+ createConfig({\n+ browser: true,\n+ format: 'iife',\n+ name: 'influxdbApis',\n+ out: 'dist/influxdbApis.js',\n+ target: 'es5',\n+ noTerser: true,\n+ }),\n+]\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/apis/src/generated/index.ts",
"diff": "+export * from './types'\n+export * from './RootAPI'\n+export * from './AuthorizationsAPI'\n+export * from './BucketsAPI'\n+export * from './ChecksAPI'\n+export * from './DashboardsAPI'\n+export * from './DeleteAPI'\n+export * from './DocumentsAPI'\n+export * from './HealthAPI'\n+export * from './LabelsAPI'\n+export * from './MeAPI'\n+export * from './NotificationEndpointsAPI'\n+export * from './NotificationRulesAPI'\n+export * from './OrgsAPI'\n+export * from './PackagesAPI'\n+export * from './QueryAPI'\n+export * from './ReadyAPI'\n+export * from './ScrapersAPI'\n+export * from './SetupAPI'\n+export * from './SigninAPI'\n+export * from './SignoutAPI'\n+export * from './SourcesAPI'\n+export * from './TasksAPI'\n+export * from './TelegrafAPI'\n+export * from './TelegrafsAPI'\n+export * from './UsersAPI'\n+export * from './VariablesAPI'\n+export * from './WriteAPI'\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/apis/src/index.ts",
"diff": "+export * from './generated'\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/apis/tsconfig.build.json",
"diff": "+{\n+ \"extends\": \"./tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"resolveJsonModule\": false,\n+ \"lib\": [\"es2015\"],\n+ \"target\": \"es2015\"\n+ },\n+ \"include\": [\"src/**/*.ts\"]\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/tsconfig.json",
"new_path": "packages/apis/tsconfig.json",
"diff": "\"extends\": \"../../tsconfig.base.json\",\n\"compilerOptions\": {\n\"resolveJsonModule\": true,\n- \"lib\": [\"DOM\", \"es2015\"]\n+ \"lib\": [\"es2015\"]\n},\n- \"include\": [\"**/*.ts\"],\n+ \"include\": [\"src/**/*.ts\", \"generator/*.ts\"],\n\"exclude\": [\"**/*.js\"]\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/package.json",
"new_path": "packages/core/package.json",
"diff": "\"description\": \"InfluxDB 2.0 client\",\n\"scripts\": {\n\"build\": \"yarn run clean && rollup -c\",\n- \"build:doc\": \"yarn run clean && typedoc --out ./doc ./src\",\n+ \"build:doc\": \"yarn run clean && yarn typedoc\",\n\"clean\": \"rimraf dist build coverage .nyc_output doc *.lcov reports\",\n\"codecov\": \"nyc report --reporter=text-lcov > coverage/coverage.lcov && codecov\",\n\"coverage\": \"nyc mocha --require ts-node/register 'test/unit/**/*.test.ts' --exit\",\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(apis): build api package |
305,159 | 10.01.2020 09:25:06 | -3,600 | 8a023b4cd0f4e9860bb9fc6a2d2925cf370e541f | feath(browser): fix error handling in FetchTransport | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/impl/browser/FetchTransport.ts",
"new_path": "packages/core/src/impl/browser/FetchTransport.ts",
"diff": "@@ -62,7 +62,7 @@ export default class FetchTransport implements Transport {\nobserver.responseStarted(headers)\n}\nif (response.status >= 300) {\n- response\n+ return response\n.text()\n.then((text: string) => {\nobserver.error(\n@@ -111,11 +111,16 @@ export default class FetchTransport implements Transport {\nconst responseContentType = headers.get('content-type') || ''\nlet data = undefined\n+ try {\nif (responseContentType.includes('json')) {\ndata = await response.json()\n} else if (responseContentType.includes('text')) {\ndata = await response.text()\n}\n+ } catch (_e) {\n+ // ignore\n+ Logger.warn('Unable to read error body', _e)\n+ }\nif (status >= 300) {\nthrow new HttpError(\nstatus,\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feath(browser): fix error handling in FetchTransport |
305,159 | 10.01.2020 11:44:44 | -3,600 | 2e4c7310a965d93f4b7a7b185559ffe4db07c24e | feat(browser): don't send empty body when GET or HEAD, chrome complains | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/impl/browser/FetchTransport.ts",
"new_path": "packages/core/src/impl/browser/FetchTransport.ts",
"diff": "@@ -140,7 +140,12 @@ export default class FetchTransport implements Transport {\nconst {method, headers, ...other} = options\nreturn fetch(`${this.connectionOptions.url}${path}`, {\nmethod: method,\n- body: typeof body === 'string' ? body : JSON.stringify(body),\n+ body:\n+ method === 'GET' || method === 'HEAD'\n+ ? undefined\n+ : typeof body === 'string'\n+ ? body\n+ : JSON.stringify(body),\nheaders: {\n...this.defaultHeaders,\n...headers,\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(browser): don't send empty body when GET or HEAD, chrome complains |
305,159 | 10.01.2020 12:02:43 | -3,600 | 1e4e900ccdd51ae681dbc07231a26ed796f9b126 | feat(apis): repair server path for health and ready apis | [
{
"change_type": "MODIFY",
"old_path": "packages/apis/generator/index.ts",
"new_path": "packages/apis/generator/index.ts",
"diff": "@@ -12,6 +12,10 @@ const operations: Array<Operation> = _operations\n// reduce operations to apis\nconst apis = operations.reduce(\n(acc: {[api: string]: Array<Operation>}, val: Operation) => {\n+ if (val.path === '/ready' || val.path === '/health') {\n+ // due to a bug in the swagger parser, we don't have correct server path's\n+ val.server = ''\n+ }\nconst apiName = val.path.split('/')[1]\n;(acc[apiName] || (acc[apiName] = [])).push(val)\nreturn acc\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/src/generated/HealthAPI.ts",
"new_path": "packages/apis/src/generated/HealthAPI.ts",
"diff": "@@ -22,6 +22,6 @@ export class HealthAPI extends APIBase {\nrequest?: GetHealthRequest,\nrequestOptions?: RequestOptions\n): Promise<HealthCheck> {\n- return this.request('GET', `/api/v2/health`, request, requestOptions)\n+ return this.request('GET', `/health`, request, requestOptions)\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/src/generated/ReadyAPI.ts",
"new_path": "packages/apis/src/generated/ReadyAPI.ts",
"diff": "@@ -22,6 +22,6 @@ export class ReadyAPI extends APIBase {\nrequest?: GetReadyRequest,\nrequestOptions?: RequestOptions\n): Promise<Ready> {\n- return this.request('GET', `/api/v2/ready`, request, requestOptions)\n+ return this.request('GET', `/ready`, request, requestOptions)\n}\n}\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(apis): repair server path for health and ready apis |
305,159 | 10.01.2020 12:19:20 | -3,600 | 7c2b328018bbb6461a40f768427fe38a0c261e61 | feat(examples): add health check example (using apis) | [
{
"change_type": "MODIFY",
"old_path": "examples/README.md",
"new_path": "examples/README.md",
"diff": "- Node.js examples\n- Change variables in [./env.ts](env.ts) to configure connection to your InfluxDB instance. The file can be used as-is against a new [docker influxDB v2.0 installation](https://v2.docs.influxdata.com/v2.0/get-started/)\n- Examples are executable. If it does not work for you, run `yarn ts-node EXAMPLE.ts`.\n- - [setupInfluxDB.ts](./setupInfluxDB.ts)\n+ - [onboarding.ts](./onboarding.ts)\nPerforms onboarding of a new influxDB database. It creates a new organization, bucket and user that is then used in all examples.\n- [write.ts](./write.ts)\nWrites data points to InfluxDB.\n- Change `url` in [./env.ts](env.ts) to match your influxDB instance\n- Change `token,org,bucket` variables in [./index.html](index.html) to match your influxDB instance\n- Run `yarn browser`\n- It starts a local HTTP server and opens [./index.html](index.html) in a default browser.\n- The local HTTP server serves all static files from the parent repository and also proxies requests\n+ It starts a local HTTP server and opens [./index.html](index.html) that contains examples.\n+ The local HTTP server serves all files from this git repository and also proxies requests\nto a configured influxDB database, see [./scripts/server.js](server.js) for details.\n"
},
{
"change_type": "RENAME",
"old_path": "examples/env.js",
"new_path": "examples/env.ts",
"diff": "export const url = process.env['INFLUXDB_URL'] || 'http://localhost:9999'\n/** InfluxDB authorization token */\nexport const token = process.env['INFLUXDB_TOKEN'] || 'my-token'\n-\n-/** example organization within InfluxDB URL */\n+/** Organization within InfluxDB URL */\nexport const org = 'my-org'\n+/**InfluxDB bucket used in examples */\n+export const bucket = 'my-bucket'\n+// ONLY onboarding example\n/**InfluxDB user */\nexport const username = 'my-user'\n/**InfluxDB password */\nexport const password = 'my-password'\n-/**InfluxDB bucket used in examples */\n-export const bucket = 'my-bucket'\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "examples/health.ts",
"diff": "+#!../node_modules/.bin/ts-node\n+/*\n+This example shows how to use management/administration InfluxDB APIs\n+All InfluxDB APIs are available through '@bonitoo-io/influxdb-client-apis' package.\n+\n+See https://v2.docs.influxdata.com/v2.0/api/\n+*/\n+\n+import {InfluxDB} from '@bonitoo-io/influxdb-client'\n+import {HealthAPI, HealthCheck} from '@bonitoo-io/influxdb-client-apis'\n+import {url, token} from './env'\n+\n+console.log('*** HEALTH CHECK ***')\n+const influxDB = new InfluxDB({url, token})\n+const healthAPI = new HealthAPI(influxDB)\n+\n+healthAPI\n+ .getHealth()\n+ .then((result: HealthCheck) => {\n+ console.log(JSON.stringify(result, null, 2))\n+ console.log('\\nFinished SUCCESS')\n+ })\n+ .catch(error => {\n+ console.error(error)\n+ console.log('\\nFinished ERROR')\n+ })\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/index.html",
"new_path": "examples/index.html",
"diff": "<title>Influx DB JavaScript Client Example</title>\n<script type=\"module\">\nimport {InfluxDB, Point} from '../packages/core/dist/index.browser.mjs'\n+ import {HealthAPI} from '../packages/apis/dist/index.browser.mjs'\n/** InfluxDB v2 URL */\n- const url = '' // rely upon proxy to forward to the target influxDB\n+ const url = '/influx' // rely upon proxy to forward to the target influxDB\nconst token = 'my-token'\nconst org = 'my-org'\nconst bucket = 'my-bucket'\n+ const username = 'my-user' // onboarding example only\n+ const password = 'my-password' // onboarding example only\nconst influxDB = new InfluxDB({url, token})\n}\nfunction queryExample(fluxQuery) {\nlog('\\n*** QUERY ***')\n- const queryApi = new InfluxDB({url, token}).getQueryApi(org)\n+ const queryApi = influxDB.getQueryApi(org)\nqueryApi.queryRows(fluxQuery, {\nnext(row, tableMeta) {\nconst o = tableMeta.toObject(row)\n- // log(JSON.stringify(o, null, 2))\n+ if (o.example){\n+ // custom output for example query\nlog(\n- `${o._time} ${o._measurement} at '${o.location}': ${o._field}=${o._value}`\n+ `${o._time} ${o._measurement} in '${o.location}' (${o.example}): ${o._field}=${o._value}`\n)\n+ } else {\n+ // default output\n+ log(JSON.stringify(o, null, 2))\n+ }\n},\nerror(error) {\nlog('QUERY FAILED', error)\n},\n})\n}\n+ function onboardingExample() {\n+ log('\\n*** ONBOARDING ***')\n+ const setupApi = influxDB.getSetupApi()\n+ setupApi\n+ .isOnboarding()\n+ .then(async (allowed) => {\n+ if (allowed) {\n+ await setupApi.setup({\n+ org,\n+ bucket,\n+ username,\n+ password,\n+ token,\n+ })\n+ log(`InfluxDB '${url}' has been onboarded.`)\n+ } else {\n+ log(`Influxdb ${url} has been already onboarded.`)\n+ }\n+ })\n+ .catch(error => {\n+ log('Onboarding FAILED',error)\n+ })\n+ }\n+ function healthExample() {\n+ log('\\n*** HEALTH ***')\n+ const healthApi = new HealthAPI(influxDB)\n+ healthApi\n+ .getHealth()\n+ .then((result) => {\n+ log(JSON.stringify(result, null, 2))\n+ })\n+ .catch(error => {\n+ log('Health FAILED', error)\n+ })\n+ }\n// initialize page controls\nconst temperatureInput = document.getElementById('temperature');\nqueryButton.addEventListener('click', () => {\nqueryExample(queryInput.value)\n})\n+ document.getElementById('onboardButton').addEventListener('click', () => {\n+ onboardingExample()\n+ })\n+ document.getElementById('healthButton').addEventListener('click', () => {\n+ healthExample()\n+ })\n</script>\n</head>\n<h1>Influx DB JavaScript Client Example</h1>\n<hr>\n<div>\n- <input type=\"submit\" id=\"writeButton\" value='Write to InfluxDB'/>\n+ <button id=\"onboardButton\">InfluxDB Onboarding</button>\n+ <button id=\"healthButton\">InfluxDB Health</button>\n+ </div>\n+ <hr>\n+ <div>\n+ <button id=\"writeButton\">Write to InfluxDB</button>\n<span>Temperature: </span>\n<input type=\"number\" id=\"temperature\" value='20'></input>\n</div>\n<textarea id=\"query\" style=\"flex: 1\" rows=\"2\"\n>from(bucket:\"my-bucket\") |> range(start: 0) |> filter(fn: (r) => r._measurement == \"temperature\")</textarea>\n</div>\n- <input type=\"submit\" id=\"queryButton\" value='Query InfluxDB'/>\n+ <button id=\"queryButton\">Query InfluxDB</button>\n<hr>\n<fieldset>\n<legend>Log</legend>\n"
},
{
"change_type": "RENAME",
"old_path": "examples/setupInfluxDB.ts",
"new_path": "examples/onboarding.ts",
"diff": "@@ -8,6 +8,7 @@ for onboarding are defined in ./env.ts .\nimport {InfluxDB} from '@bonitoo-io/influxdb-client'\nimport {url, username, password, org, bucket, token} from './env'\n+console.log('*** ONBOARDING ***')\nconst setupApi = new InfluxDB({url}).getSetupApi()\nsetupApi\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/package.json",
"new_path": "examples/package.json",
"diff": "},\n\"dependencies\": {\n\"@bonitoo-io/influxdb-client\": \"*\",\n+ \"@bonitoo-io/influxdb-client-apis\": \"*\",\n\"serve-static\": \"^1.14.1\"\n},\n\"devDependencies\": {\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/query.ts",
"new_path": "examples/query.ts",
"diff": "@@ -18,7 +18,7 @@ queryApi.queryRows(fluxQuery, {\nconst o = tableMeta.toObject(row)\n// console.log(JSON.stringify(o, null, 2))\nconsole.log(\n- `${o._time} ${o._measurement} in '${o.location}': ${o._field}=${o._value}`\n+ `${o._time} ${o._measurement} in '${o.location}' (${o.example}): ${o._field}=${o._value}`\n)\n},\nerror(error: Error) {\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/scripts/server.js",
"new_path": "examples/scripts/server.js",
"diff": "@@ -5,20 +5,15 @@ import * as open from 'open'\nimport {url as influxDBUrl} from '../env'\nconst port = 3001\n+const influxPath = '/influx'\nconst app = express()\n// serve all files of the git repository\napp.use(express.static(path.join(__dirname, '..', '..'), {index: false}))\n-app.use(\n- '/api',\n- proxy(influxDBUrl + '/api', {\n- proxyReqPathResolver: function(req) {\n- return '/api' + req.url\n- },\n- })\n-)\n+app.use(influxPath, proxy(influxDBUrl))\napp.listen(port, () => {\nconsole.log(`listening on http://localhost:${port}`)\n+ console.log(`forwarding ${influxPath}/* to ${influxDBUrl}/*`)\nconsole.log(`opening http://localhost:${port}/examples/index.html`)\nopen(`http://localhost:${port}/examples/index.html`)\n})\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/tsconfig.json",
"new_path": "examples/tsconfig.json",
"diff": "{\n\"compilerOptions\": {\n\"allowJs\": true\n- }\n+ },\n+ \"exclude\": [\"**/*.js\"]\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/write.ts",
"new_path": "examples/write.ts",
"diff": "@@ -7,11 +7,11 @@ import {InfluxDB, Point} from '@bonitoo-io/influxdb-client'\nimport {url, token, org, bucket} from './env'\nimport {hostname} from 'os'\n+console.log('*** WRITE POINTS ***')\nconst writeApi = new InfluxDB({url, token}).getWriteApi(org, bucket)\n// setup default tags for all writes through this API\nwriteApi.useDefaultTags({location: hostname()})\n-console.log('*** WRITE POINTS ***')\nconst point1 = new Point('temperature')\n.tag('example', 'write.ts')\n.floatField('value', 20 + Math.round(100 * Math.random()) / 10)\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(examples): add health check example (using apis) |
305,159 | 10.01.2020 14:41:43 | -3,600 | 5d63ac9c2574b1c41dd3410422c81d3e6cb83d70 | feat(doc): remove ToDos | [
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "@@ -14,11 +14,7 @@ This library is a work in progress and should not be considered production ready\n## ToDos\n- this documentation\n-- all APIs (generated)\n-- implement transport for both node and browser, fetch API?\n- serialization of query results\n-- monorepo with yarn, separate examples\n-- browser client\n## Usage\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(doc): remove ToDos |
305,159 | 10.01.2020 16:37:32 | -3,600 | d1f0fe774c8a14d67bfe165c2253c156e3acbc87 | feat(query): allow custom serialization of query results | [
{
"change_type": "MODIFY",
"old_path": ".vscode/launch.json",
"new_path": ".vscode/launch.json",
"diff": "\"version\": \"0.2.0\",\n\"configurations\": [\n{\n- \"name\": \"Mocha Tests\",\n+ \"name\": \"Core Tests\",\n\"type\": \"node\",\n\"request\": \"launch\",\n- \"cwd\": \"${workspaceRoot}\",\n+ \"cwd\": \"${workspaceRoot}/packages/core\",\n\"program\": \"${workspaceRoot}/node_modules/mocha/bin/_mocha\",\n\"args\": [\n\"--require\",\n\"15000\",\n\"--check-leaks\",\n\"--colors\",\n- \"${workspaceRoot}/test/**/*.test.ts\"\n+ \"test/**/*.test.ts\"\n],\n\"internalConsoleOptions\": \"openOnSessionStart\"\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "@@ -14,7 +14,6 @@ This library is a work in progress and should not be considered production ready\n## ToDos\n- this documentation\n-- serialization of query results\n## Usage\n"
},
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"preinstall\": \"node ./scripts/require-yarn.js\",\n\"postinstall\": \"manypkg check\",\n\"clean\": \"yarn workspaces run clean\",\n- \"build\": \"yarn workspaces run build\",\n+ \"build\": \"cd packages/core && yarn build && cd ../apis && yarn build\",\n\"test\": \"yarn workspaces run test\"\n},\n\"homepage\": \"https://github.com/bonitoo-io/influxdb-client-js\",\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/query/FluxTableColumn.ts",
"new_path": "packages/core/src/query/FluxTableColumn.ts",
"diff": "@@ -11,6 +11,27 @@ export type ColumnType =\n| 'dateTime'\n| 'duration'\n+export interface FluxTableColumnLike {\n+ /**\n+ * Label (e.g., \"_start\", \"_stop\", \"_time\").\n+ */\n+ label: string\n+\n+ /**\n+ * The data type of column (e.g., \"string\", \"long\", \"dateTime:RFC3339\").\n+ */\n+ dataType?: ColumnType\n+\n+ /**\n+ * Boolean flag indicating if the column is a part of the table's group key.\n+ */\n+ group?: boolean\n+\n+ /**\n+ * Default value to be used for rows whose string value is the empty string.\n+ */\n+ defaultValue?: string\n+}\n/**\n* Column metadata of a flux <a href=\"http://bit.ly/flux-spec#table\">table</a>.\n*/\n@@ -39,12 +60,12 @@ export default class FluxTableColumn {\n* Creates a flux table column from an object supplied.\n* @param object\n*/\n- static from(object: any): FluxTableColumn {\n+ static from(object: FluxTableColumnLike): FluxTableColumn {\nconst retVal = new FluxTableColumn()\nretVal.label = object.label\nretVal.dataType = object.dataType as ColumnType\nretVal.group = Boolean(object.group)\n- retVal.defaultValue = object.defaultValue\n+ retVal.defaultValue = object.defaultValue || ''\nreturn retVal\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/query/FluxTableMetaData.ts",
"new_path": "packages/core/src/query/FluxTableMetaData.ts",
"diff": "import FluxTableColumn from './FluxTableColumn'\nimport {IllegalArgumentError} from '../errors'\n+const identity = (x: string): any => x\n+/**\n+ * A dictionary of serializers of particular types returned bya flux query\n+ * @see https://v2.docs.influxdata.com/v2.0/reference/syntax/annotated-csv/#valid-data-types\n+ */\n+export const typeSerializers: {[key: string]: (val: string) => any} = {\n+ boolean: (x: string): any => x === 'true',\n+ unsignedLong: identity,\n+ long: identity,\n+ double: (x: string): any => +x,\n+ string: identity,\n+ base64Binary: identity,\n+ dateTime: identity,\n+ duration: identity,\n+}\n/**\n* Represents metadata of a flux <a href=\"http://bit.ly/flux-spec#table\">table</a>.\n*/\n@@ -27,7 +42,7 @@ export default class FluxTableMetaData {\n* Creates an object out of the supplied values with the help of columns .\n* @param values values for each column\n*/\n- toObject(values: string[]): {[key: string]: string} {\n+ toObject(values: string[]): {[key: string]: any} {\nconst acc: any = {}\nfor (let i = 0; i < this.columns.length && i < values.length; i++) {\nlet val = values[i]\n@@ -35,7 +50,9 @@ export default class FluxTableMetaData {\nif (val === '' && column.defaultValue) {\nval = column.defaultValue\n}\n- acc[column.label] = val\n+ acc[column.label] = (\n+ typeSerializers[column.dataType as string] || identity\n+ )(val)\n}\nreturn acc\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/query/index.ts",
"new_path": "packages/core/src/query/index.ts",
"diff": "-export {default as FluxTableMetaData} from './FluxTableMetaData'\n+export {\n+ default as FluxTableMetaData,\n+ typeSerializers,\n+} from './FluxTableMetaData'\nexport {default as FluxResultObserver} from './FluxResultObserver'\nexport {default as FluxTableColumn, ColumnType} from './FluxTableColumn'\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/test/unit/query/FluxTableMetaData.test.ts",
"new_path": "packages/core/test/unit/query/FluxTableMetaData.test.ts",
"diff": "-import {FluxTableColumn, FluxTableMetaData} from '../../../src'\n+import {\n+ FluxTableColumn,\n+ FluxTableMetaData,\n+ ColumnType,\n+ typeSerializers,\n+} from '../../../src'\nimport {expect} from 'chai'\ndescribe('FluxTableMetaData', () => {\n@@ -7,7 +12,7 @@ describe('FluxTableMetaData', () => {\nFluxTableColumn.from({\nlabel: 'a',\ndefaultValue: 'def',\n- type: 'long',\n+ dataType: 'long',\ngroup: false,\n}),\nFluxTableColumn.from({\n@@ -26,7 +31,7 @@ describe('FluxTableMetaData', () => {\nFluxTableColumn.from({\nlabel: 'a',\ndefaultValue: 'def',\n- type: 'long',\n+ dataType: 'long',\ngroup: false,\n}),\nFluxTableColumn.from({\n@@ -39,4 +44,50 @@ describe('FluxTableMetaData', () => {\nexpect(subject.toObject(['x', 'y', 'z'])).to.deep.equal({a: 'x', b: 'y'})\nexpect(subject.toObject(['x'])).to.deep.equal({a: 'x'})\n})\n+ const serializationTable: Array<[ColumnType | undefined, string, any]> = [\n+ ['boolean', 'false', false],\n+ ['boolean', 'true', true],\n+ ['unsignedLong', '1', '1'],\n+ ['long', '1', '1'],\n+ ['double', '1', 1],\n+ ['string', '1', '1'],\n+ ['base64Binary', '1', '1'],\n+ ['dateTime', '1', '1'],\n+ ['duration', '1', '1'],\n+ [undefined, '1', '1'],\n+ ]\n+ for (const entry of serializationTable) {\n+ it(`serializes ${entry[0]}/${entry[1]}`, () => {\n+ const columns: FluxTableColumn[] = [\n+ FluxTableColumn.from({\n+ label: 'a',\n+ dataType: entry[0],\n+ }),\n+ ]\n+ const subject = new FluxTableMetaData(columns)\n+ expect(subject.toObject([entry[1]])).to.deep.equal({a: entry[2]})\n+ })\n+ }\n+ describe('custom serialization', () => {\n+ const type = 'long'\n+ let original: (x: string) => any\n+ beforeEach(() => {\n+ original = typeSerializers[type]\n+ typeSerializers[type] = (_x: string): any => []\n+ })\n+ afterEach(() => {\n+ typeSerializers[type] = original\n+ })\n+ it('cutomized srialization', () => {\n+ const columns: FluxTableColumn[] = [\n+ FluxTableColumn.from({\n+ label: 'a',\n+ dataType: 'long',\n+ group: false,\n+ }),\n+ ]\n+ const subject = new FluxTableMetaData(columns)\n+ expect(subject.toObject([''])).to.deep.equal({a: []})\n+ })\n+ })\n})\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(query): allow custom serialization of query results |
305,159 | 12.01.2020 13:05:46 | -3,600 | 83b1d1ff9bb1ab48a31ef2c373d2eb0f0afec805 | feat(apis): remove setup API from core, update examples to use SetupAPIs from the apis module | [
{
"change_type": "MODIFY",
"old_path": "examples/README.md",
"new_path": "examples/README.md",
"diff": "- Node.js examples\n- Change variables in [./env.ts](env.ts) to configure connection to your InfluxDB instance. The file can be used as-is against a new [docker influxDB v2.0 installation](https://v2.docs.influxdata.com/v2.0/get-started/)\n- Examples are executable. If it does not work for you, run `yarn ts-node EXAMPLE.ts`.\n- - [onboarding.ts](./onboarding.ts)\n- Performs onboarding of a new influxDB database. It creates a new organization, bucket and user that is then used in all examples.\n- [write.ts](./write.ts)\n- Writes data points to InfluxDB.\n+ Write data points to InfluxDB.\n- [query.ts](./query.ts)\nQuery InfluxDB with [Flux](https://v2.docs.influxdata.com/v2.0/query-data/get-started/).\n+ - [health.ts](./health.ts)\n+ Check health fo your influx DB.\n+ - [onboarding.ts](./onboarding.ts)\n+ Performs onboarding of a new influxDB database. It creates a new organization, bucket and user that is then used in all examples.\n- Browser examples\n- Change `url` in [./env.ts](env.ts) to match your influxDB instance\n- Change `token,org,bucket` variables in [./index.html](index.html) to match your influxDB instance\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/index.html",
"new_path": "examples/index.html",
"diff": "<title>InfluxDB JavaScript Client Examples</title>\n<script type=\"module\">\nimport {InfluxDB, Point} from '../packages/core/dist/index.browser.mjs'\n- import {HealthAPI} from '../packages/apis/dist/index.browser.mjs'\n+ import {HealthAPI, SetupAPI} from '../packages/apis/dist/index.browser.mjs'\n/** InfluxDB v2 URL */\nconst url = '/influx' // rely upon proxy to forward to the target influxDB\n}\nfunction onboardingExample() {\nlog('\\n*** ONBOARDING ***')\n- const setupApi = influxDB.getSetupApi()\n+ const setupApi = new SetupAPI(influxDB)\nsetupApi\n- .isOnboarding()\n- .then(async (allowed) => {\n+ .getSetup()\n+ .then(async ({allowed}) => {\nif (allowed) {\n- await setupApi.setup({\n+ await setupApi.postSetup({\n+ body: {\norg,\nbucket,\nusername,\npassword,\n- token,\n+ token\n+ }\n})\n- log(`InfluxDB '${url}' has been onboarded.`)\n+ log(`InfluxDB '${url}' is now onboarded.`)\n} else {\nlog(`InfluxDB '${url}' has been already onboarded.`)\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/onboarding.ts",
"new_path": "examples/onboarding.ts",
"diff": "@@ -6,23 +6,26 @@ for onboarding are defined in ./env.ts .\n*/\nimport {InfluxDB} from '@bonitoo-io/influxdb-client'\n+import {SetupAPI, OnboardingRequest} from '@bonitoo-io/influxdb-client-apis'\nimport {url, username, password, org, bucket, token} from './env'\nconsole.log('*** ONBOARDING ***')\n-const setupApi = new InfluxDB({url}).getSetupApi()\n+const setupApi = new SetupAPI(new InfluxDB({url}))\nsetupApi\n- .isOnboarding()\n- .then(async (allowed: boolean) => {\n+ .getSetup()\n+ .then(async ({allowed}) => {\nif (allowed) {\n- await setupApi.setup({\n+ await setupApi.postSetup({\n+ body: ({\norg,\nbucket,\nusername,\npassword,\n- token,\n+ token, // token is not documented in open API\n+ } as unknown) as OnboardingRequest,\n})\n- console.log(`InfluxDB '${url}' has been onboarded.`)\n+ console.log(`InfluxDB '${url}' is now onboarded.`)\n} else {\nconsole.log(`InfluxDB '${url}' has been already onboarded.`)\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/generator/generateApi.ts",
"new_path": "packages/apis/generator/generateApi.ts",
"diff": "@@ -58,7 +58,8 @@ function generateTypes(operation: Operation): string {\nif (operation.bodyParam.description) {\nretVal += ` /** ${operation.bodyParam.description} */\\n`\n}\n- retVal += ` body: ${getBodyType(operation)}\\n`\n+ const bodyType = getBodyType(operation)\n+ retVal += ` body: ${bodyType}\\n`\n}\nif (operation.queryParams && operation.queryParams.length) {\nfor (const param of operation.queryParams) {\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/InfluxDB.ts",
"new_path": "packages/core/src/InfluxDB.ts",
"diff": "@@ -7,8 +7,6 @@ import {Transport} from './transport'\nimport TransportImpl from './impl/node/NodeHttpTransport'\nimport QueryApi from './QueryApi'\nimport QueryApiImpl from './impl/QueryApiImpl'\n-import SetupApi from './SetupApi'\n-import SetupApiImpl from './impl/SetupApiImpl'\n/**\n* InfluxDB 2.0 client that uses HTTP API described in https://v2.docs.influxdata.com/v2.0/reference/api/ .\n@@ -74,13 +72,4 @@ export default class InfluxDB {\ngetQueryApi(org: string): QueryApi {\nreturn new QueryApiImpl(this.transport, org)\n}\n-\n- /**\n- * Returns [[SetupApi]].\n- *\n- * @return setup api instance\n- */\n- getSetupApi(): SetupApi {\n- return new SetupApiImpl(this.transport)\n- }\n}\n"
},
{
"change_type": "DELETE",
"old_path": "packages/core/src/SetupApi.ts",
"new_path": null,
"diff": "-/**\n- * See <a href=\"https://v2.docs.influxdata.com/v2.0/api/#tag/Setup\">https://v2.docs.influxdata.com/v2.0/api/#tag/Setup</a>.\n- */\n-export default interface SetupApi {\n- /**\n- * Is on-boarding still allowed?\n- * @return false if it was already performed\n- */\n- isOnboarding(): Promise<boolean>\n- /**\n- * Setups a (new) influx DB instance.\n- * @param request default user and password, organization, bucket\n- * @return information about the setup process (cast to OnboardingResponse from the generated api) to know more\n- */\n- setup(request: {\n- username: string\n- password: string\n- org: string\n- bucket: string\n- retentionPeriodHrs?: number\n- token?: string\n- }): Promise<any>\n-}\n"
},
{
"change_type": "DELETE",
"old_path": "packages/core/src/impl/SetupApiImpl.ts",
"new_path": null,
"diff": "-import SetupApi from '../SetupApi'\n-import {Transport} from '../transport'\n-\n-export default class SetupApiImpl implements SetupApi {\n- constructor(private transport: Transport) {}\n- async isOnboarding(): Promise<boolean> {\n- const x = await this.transport.request('/api/v2/setup', '', {method: 'GET'})\n- return x.allowed as boolean\n- }\n- setup(request: {\n- username: string\n- password: string\n- org: string\n- bucket: string\n- retentionPeriodHrs?: number\n- token?: string\n- }): Promise<any> {\n- // token in not documented in open-api description\n- return this.transport.request('/api/v2/setup', request, {\n- method: 'POST',\n- })\n- }\n-}\n"
},
{
"change_type": "DELETE",
"old_path": "packages/core/test/unit/SetupApi.test.ts",
"new_path": null,
"diff": "-import nock from 'nock'\n-import {expect} from 'chai'\n-import {InfluxDB} from '../../src'\n-\n-const org = `my-org`\n-const url = 'http://localhost:9999'\n-const username = 'my-user'\n-const password = 'my-password'\n-const bucket = 'my-bucket'\n-const token = 'my-token'\n-\n-describe('SetupApi', () => {\n- beforeEach(() => {\n- nock.disableNetConnect()\n- })\n- afterEach(() => {\n- nock.cleanAll()\n- nock.enableNetConnect()\n- })\n- it('isOnboarding', async () => {\n- nock(url)\n- .get('/api/v2/setup')\n- .reply(200, {allowed: false})\n- .persist()\n- const subject = new InfluxDB(url).getSetupApi()\n- const val = await subject.isOnboarding()\n- expect(val).equals(false)\n- })\n- it('setup', async () => {\n- nock(url)\n- .post('/api/v2/setup')\n- .reply(200, {data: true})\n- .persist()\n- const subject = new InfluxDB(url).getSetupApi()\n- const val = await subject.setup({org, username, password, bucket})\n- expect(val).exist\n- const val2 = await subject.setup({org, username, password, bucket, token})\n- expect(val2).exist\n- })\n-})\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(apis): remove setup API from core, update examples to use SetupAPIs from the apis module |
305,159 | 12.01.2020 13:31:30 | -3,600 | 289ef4d9823bb972eee0f8b39389eda94dd10ef8 | chore: update readne | [
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "@@ -30,7 +30,7 @@ Run all unit tests:\n$ yarn test:unit\n```\n-Check code:\n+Check code coverage of unit tests:\n```bash\n$ yarn coverage\n"
},
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"postinstall\": \"manypkg check\",\n\"clean\": \"yarn workspaces run clean\",\n\"build\": \"cd packages/core && yarn build && cd ../apis && yarn build\",\n- \"test\": \"yarn workspaces run test\"\n+ \"test\": \"yarn workspaces run test\",\n+ \"coverage\": \"cd packages/core && yarn coverage\"\n},\n\"homepage\": \"https://github.com/bonitoo-io/influxdb-client-js\",\n\"repository\": {\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore: update readne |
305,159 | 13.01.2020 10:03:02 | -3,600 | 4443bae10b99f960d19f0805f1052c1b34cb2059 | feat(example): convert a few examples to commonjs format | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "examples/.eslintrc.json",
"diff": "+{\n+ \"parser\": \"@typescript-eslint/parser\",\n+ \"parserOptions\": {\n+ \"sourceType\": \"module\",\n+ \"ecmaFeatures\": {}\n+ },\n+ \"plugins\": [\"@typescript-eslint\", \"prettier\"],\n+ \"env\": {\n+ \"node\": true\n+ },\n+ \"extends\": [\"eslint:recommended\", \"plugin:@typescript-eslint/recommended\"],\n+ \"rules\": {\n+ \"no-console\": \"off\",\n+ \"@typescript-eslint/no-var-requires\": \"off\"\n+ }\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/README.md",
"new_path": "examples/README.md",
"diff": "# InfluxDB Client Examples\n+This directory contains javascript and typescript examples for node.js and browser environments.\n+\n- Prerequisites\n- [yarn](https://yarnpkg.com/lang/en/docs/install/) installed\n- Run `yarn --cwd ..` in this directory\n- - Run `yarn --cwd .. build` in this directory, the referenced client library is then compiled\n+ - Run `yarn --cwd .. build` in this directory\n- Node.js examples\n- - Change variables in [./env.ts](env.ts) to configure connection to your InfluxDB instance. The file can be used as-is against a new [docker influxDB v2.0 installation](https://v2.docs.influxdata.com/v2.0/get-started/)\n+ - Change variables in [./env.js](env.js) to configure connection to your InfluxDB instance. The file can be used as-is against a new [docker influxDB v2.0 installation](https://v2.docs.influxdata.com/v2.0/get-started/)\n- Examples are executable. If it does not work for you, run `yarn ts-node EXAMPLE.ts`.\n- [write.ts](./write.ts)\nWrite data points to InfluxDB.\n- [query.ts](./query.ts)\nQuery InfluxDB with [Flux](https://v2.docs.influxdata.com/v2.0/query-data/get-started/).\n- - [health.ts](./health.ts)\n+ - [health.js](./health.js)\nCheck health fo your influx DB.\n- - [onboarding.ts](./onboarding.ts)\n+ - [onboarding.js](./onboarding.js)\nPerforms onboarding of a new influxDB database. It creates a new organization, bucket and user that is then used in all examples.\n- Browser examples\n- Change `url` in [./env.ts](env.ts) to match your influxDB instance\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "examples/env.js",
"diff": "+/** InfluxDB v2 URL */\n+const url = process.env['INFLUXDB_URL'] || 'http://localhost:9999'\n+/** InfluxDB authorization token */\n+const token = process.env['INFLUXDB_TOKEN'] || 'my-token'\n+/** Organization within InfluxDB URL */\n+const org = 'my-org'\n+/**InfluxDB bucket used in examples */\n+const bucket = 'my-bucket'\n+// ONLY onboarding example\n+/**InfluxDB user */\n+const username = 'my-user'\n+/**InfluxDB password */\n+const password = 'my-password'\n+\n+module.exports = {\n+ url,\n+ token,\n+ org,\n+ bucket,\n+ username,\n+ password,\n+}\n"
},
{
"change_type": "DELETE",
"old_path": "examples/env.ts",
"new_path": null,
"diff": "-/** InfluxDB v2 URL */\n-export const url = process.env['INFLUXDB_URL'] || 'http://localhost:9999'\n-/** InfluxDB authorization token */\n-export const token = process.env['INFLUXDB_TOKEN'] || 'my-token'\n-/** Organization within InfluxDB URL */\n-export const org = 'my-org'\n-/**InfluxDB bucket used in examples */\n-export const bucket = 'my-bucket'\n-// ONLY onboarding example\n-/**InfluxDB user */\n-export const username = 'my-user'\n-/**InfluxDB password */\n-export const password = 'my-password'\n"
},
{
"change_type": "RENAME",
"old_path": "examples/health.ts",
"new_path": "examples/health.js",
"diff": "-#!../node_modules/.bin/ts-node\n+#!/usr/bin/node\n/*\nThis example shows how to use management/administration InfluxDB APIs\nAll InfluxDB APIs are available through '@bonitoo-io/influxdb-client-apis' package.\n@@ -6,9 +6,9 @@ All InfluxDB APIs are available through '@bonitoo-io/influxdb-client-apis' packa\nSee https://v2.docs.influxdata.com/v2.0/api/\n*/\n-import {InfluxDB} from '@bonitoo-io/influxdb-client'\n-import {HealthAPI, HealthCheck} from '@bonitoo-io/influxdb-client-apis'\n-import {url, token} from './env'\n+const {InfluxDB} = require('@bonitoo-io/influxdb-client')\n+const {HealthAPI} = require('@bonitoo-io/influxdb-client-apis')\n+const {url, token} = require('./env')\nconsole.log('*** HEALTH CHECK ***')\nconst influxDB = new InfluxDB({url, token})\n@@ -16,7 +16,7 @@ const healthAPI = new HealthAPI(influxDB)\nhealthAPI\n.getHealth()\n- .then((result: HealthCheck) => {\n+ .then((result /* : HealthCheck */) => {\nconsole.log(JSON.stringify(result, null, 2))\nconsole.log('\\nFinished SUCCESS')\n})\n"
},
{
"change_type": "RENAME",
"old_path": "examples/onboarding.ts",
"new_path": "examples/onboarding.js",
"diff": "-#!../node_modules/.bin/ts-node\n+#!/usr/bin/env node\n/*\nThis example setups a new INFLUXDB database with user,organization\nand bucket that can be then used in examples. All values that used\nfor onboarding are defined in ./env.ts .\n*/\n-import {InfluxDB} from '@bonitoo-io/influxdb-client'\n-import {SetupAPI, OnboardingRequest} from '@bonitoo-io/influxdb-client-apis'\n-import {url, username, password, org, bucket, token} from './env'\n+const {InfluxDB} = require('@bonitoo-io/influxdb-client')\n+const {SetupAPI} = require('@bonitoo-io/influxdb-client-apis')\n+const {url, username, password, org, bucket, token} = require('./env')\nconsole.log('*** ONBOARDING ***')\nconst setupApi = new SetupAPI(new InfluxDB({url}))\n@@ -17,13 +17,13 @@ setupApi\n.then(async ({allowed}) => {\nif (allowed) {\nawait setupApi.postSetup({\n- body: ({\n+ body: {\norg,\nbucket,\nusername,\npassword,\n- token, // token is not documented in open API\n- } as unknown) as OnboardingRequest,\n+ token,\n+ },\n})\nconsole.log(`InfluxDB '${url}' is now onboarded.`)\n} else {\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/package.json",
"new_path": "examples/package.json",
"diff": "\"version\": \"0.4.0\",\n\"license\": \"MIT\",\n\"scripts\": {\n- \"browser\": \"ts-node scripts/server.js\",\n+ \"browser\": \"node scripts/server.js\",\n\"clean\": \"echo 'nothing to clean'\",\n\"build\": \"echo 'nothing to build'\",\n\"test\": \"echo 'run examples to test'\"\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/scripts/server.js",
"new_path": "examples/scripts/server.js",
"diff": "-import * as express from 'express'\n-import * as path from 'path'\n-import * as proxy from 'express-http-proxy'\n-import * as open from 'open'\n-import {url as influxDBUrl} from '../env'\n+const express = require('express')\n+const path = require('path')\n+const proxy = require('express-http-proxy')\n+const open = require('open')\n+const {url} = require('../env')\nconst port = 3001\n-const influxPath = '/influx'\n+const proxyPath = '/influx'\nconst app = express()\n// serve all files of the git repository\napp.use(express.static(path.join(__dirname, '..', '..'), {index: false}))\n-app.use(influxPath, proxy(influxDBUrl))\n+app.use(proxyPath, proxy(url))\napp.listen(port, () => {\nconsole.log(`listening on http://localhost:${port}`)\n- console.log(`forwarding ${influxPath}/* to ${influxDBUrl}/*`)\n+ console.log(`forwarding ${proxyPath}/* to ${url}/*`)\nconsole.log(`opening http://localhost:${port}/examples/index.html`)\nopen(`http://localhost:${port}/examples/index.html`)\n})\n"
},
{
"change_type": "RENAME",
"old_path": "examples/write.ts",
"new_path": "examples/write.js",
"diff": "-#!../node_modules/.bin/ts-node\n+#!/usr/bin/env node\n//////////////////////////////////////////\n// Shows how to use InfluxDB write API. //\n//////////////////////////////////////////\n-import {InfluxDB, Point} from '@bonitoo-io/influxdb-client'\n-import {url, token, org, bucket} from './env'\n-import {hostname} from 'os'\n+const {InfluxDB, Point, HttpError} = require('@bonitoo-io/influxdb-client')\n+const {url, token, org, bucket} = require('./env')\n+const {hostname} = require('os')\nconsole.log('*** WRITE POINTS ***')\nconst writeApi = new InfluxDB({url, token}).getWriteApi(org, bucket)\n@@ -29,6 +29,10 @@ writeApi\n.then(() => {\nconsole.log('FINISHED ... now try ./query.ts')\n})\n- .catch((e: Error) => {\n- console.log('FAILED ... the data might not send to the server', e)\n+ .catch(e => {\n+ console.error(e)\n+ if (e instanceof HttpError && e.statusCode === 401) {\n+ console.log('Run ./onboarding.js to setup a new InfluxDB database.')\n+ }\n+ console.log('\\nFinished ERROR')\n})\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(example): convert a few examples to commonjs format |
305,159 | 13.01.2020 10:48:45 | -3,600 | df3f41262ded8098b61f547758a5e802ad895e02 | chore(doc): update documentation | [
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "[](https://github.com/prettier/prettier)\n[](https://github.com/bonitoo-io/influxdb-client-js/blob/master/LICENSE)\n-This repository contains the reference javascript client for InfluxDB 2.0.\n+This repository contains the reference javascript client for InfluxDB 2.0. Both node and browser environments are supported.\n-## Disclaimer\n+**Note: This library is for use with InfluxDB 2.x. For connecting to InfluxDB 1.x instances, see [node-influx](https://github.com/node-influx/node-influx).**\n-This library is a work in progress and should not be considered production ready yet.\n+## Features\n-## ToDos\n+InfluxDB 2.0 client consist of two packages\n-- this documentation\n+- @bonitoo-io/influxdb-client\n+ - Querying data using the Flux language\n+ - Writing data\n+ - batched in chunks on background\n+ - automatic retries on write failures\n+- @bonitoo-io/influxdb-client-js-apis\n+ - provides all other InfluxDB 2.0 APIs for managing\n+ - sources, buckets\n+ - tasks\n+ - authorizations\n+ - health check\n+ - ...\n+ - built on top of @bonitoo-io/influxdb-client-js\n+\n+## Installation\n+\n+**Note: packages are not published to npm repository yet **\n+\n+To use Write and Query API in your project:\n+\n+```\n+$npm install --save @bonitoo-io/influxdb-client\n+```\n+\n+or\n+\n+```\n+$yarn add @bonitoo-io/influxdb-client\n+```\n+\n+To use all other APIs in your project:\n+\n+```\n+$npm install --save @bonitoo-io/influxdb-client-apis\n+```\n+\n+or\n+\n+```\n+$yarn add @bonitoo-io/influxdb-client-apis\n+```\n## Usage\n-See [Examples](./examples)\n+See [examples](./examples/README.md)\n+\n+- @bonitoo-io/influxdb-client\n+ - [write points or lines](./examples/write.js)\n+ - [query data](./examples/query.ts)\n+- @bonitoo-io/influxdb-client-apis\n+ - [setup / onboarding](./examples/onboarding.js)\n+ - [health](./examples/health.js)\n## Build Requirements\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore(doc): update documentation |
305,159 | 13.01.2020 13:07:14 | -3,600 | 398abd4c08f0d150715902e7ecec3070fd748198 | chore: specify files to ignore in published packages | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/apis/.npmignore",
"diff": "+node_modules\n+build\n+coverage\n+doc\n+.rpt2_cache\n+.DS_Store\n+.nyc_output\n+*.lcov\n+reports\n+yarn-error.log\n+/tsconfig.*\n+/rollup.config.js\n+/.prettierrc.json\n+/generator\n+/resources\n+/src\n+/test\n+\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/core/.npmignore",
"diff": "+node_modules\n+build\n+coverage\n+doc\n+.rpt2_cache\n+.DS_Store\n+.nyc_output\n+*.lcov\n+reports\n+yarn-error.log\n+/tsconfig.*\n+/rollup.config.js\n+/.prettierrc.json\n+/src\n+/test\n+\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore: specify files to ignore in published packages |
305,159 | 13.01.2020 13:08:23 | -3,600 | bcf8b77acfeaf9b34bd2ad20539ae16ff53b2322 | chore: repair top-level test target | [
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"postinstall\": \"manypkg check\",\n\"clean\": \"yarn workspaces run clean\",\n\"build\": \"cd packages/core && yarn build && cd ../apis && yarn build\",\n- \"test\": \"yarn workspaces run test\",\n+ \"test\": \"cd packages/core && yarn build && cd ../apis && yarn build\",\n\"coverage\": \"cd packages/core && yarn coverage\"\n},\n\"homepage\": \"https://github.com/bonitoo-io/influxdb-client-js\",\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore: repair top-level test target |
305,159 | 13.01.2020 13:08:57 | -3,600 | f9cd27efb4e449270ec634e02ce6e2d259a0e28b | chore: repair top-level test script | [
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"postinstall\": \"manypkg check\",\n\"clean\": \"yarn workspaces run clean\",\n\"build\": \"cd packages/core && yarn build && cd ../apis && yarn build\",\n- \"test\": \"cd packages/core && yarn build && cd ../apis && yarn build\",\n+ \"test\": \"cd packages/core && yarn test && cd ../apis && yarn test\",\n\"coverage\": \"cd packages/core && yarn coverage\"\n},\n\"homepage\": \"https://github.com/bonitoo-io/influxdb-client-js\",\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore: repair top-level test script |
305,159 | 13.01.2020 13:42:08 | -3,600 | 8e0d357a93e1aa5df0cc92d7b128d557a3e4173c | chore: use wilcard dependency for yarn | [
{
"change_type": "MODIFY",
"old_path": "packages/apis/package.json",
"new_path": "packages/apis/package.json",
"diff": "\"@bonitoo-io/influxdb-client\": \"*\"\n},\n\"devDependencies\": {\n- \"@bonitoo-io/influxdb-client\": \"^0.5.5\",\n+ \"@bonitoo-io/influxdb-client\": \"*\",\n\"@typescript-eslint/eslint-plugin\": \"^2.9.0\",\n\"@typescript-eslint/parser\": \"^2.9.0\",\n\"chalk\": \"^3.0.0\",\n"
},
{
"change_type": "UNKNOWN",
"old_path": "publish.sh",
"new_path": "publish.sh",
"diff": ""
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore: use wilcard dependency for yarn |
305,159 | 13.01.2020 13:53:18 | -3,600 | f32cc506cd8a6d3b92051b67b298cb39ab753be0 | chore: revert lerna update of dev dependency | [
{
"change_type": "MODIFY",
"old_path": "packages/apis/package.json",
"new_path": "packages/apis/package.json",
"diff": "\"@bonitoo-io/influxdb-client\": \"*\"\n},\n\"devDependencies\": {\n- \"@bonitoo-io/influxdb-client\": \"^0.5.6\",\n+ \"@bonitoo-io/influxdb-client\": \"*\",\n\"@typescript-eslint/eslint-plugin\": \"^2.9.0\",\n\"@typescript-eslint/parser\": \"^2.9.0\",\n\"chalk\": \"^3.0.0\",\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore: revert lerna update of dev dependency |
305,159 | 13.01.2020 13:59:58 | -3,600 | 7e1b826b356b3bf3232bbc7ebb6c69172c96f248 | chore: remove unused examples dependency | [
{
"change_type": "MODIFY",
"old_path": "examples/package.json",
"new_path": "examples/package.json",
"diff": "},\n\"dependencies\": {\n\"@bonitoo-io/influxdb-client\": \"*\",\n- \"@bonitoo-io/influxdb-client-apis\": \"*\",\n- \"serve-static\": \"^1.14.1\"\n+ \"@bonitoo-io/influxdb-client-apis\": \"*\"\n},\n\"devDependencies\": {\n\"@types/express\": \"^4.17.2\",\n"
},
{
"change_type": "MODIFY",
"old_path": "yarn.lock",
"new_path": "yarn.lock",
"diff": "@@ -3448,7 +3448,7 @@ serialize-javascript@^2.1.2:\nresolved \"https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-2.1.2.tgz#ecec53b0e0317bdc95ef76ab7074b7384785fa61\"\nintegrity sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==\[email protected], serve-static@^1.14.1:\[email protected]:\nversion \"1.14.1\"\nresolved \"https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9\"\nintegrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore: remove unused examples dependency |
305,159 | 13.01.2020 14:10:05 | -3,600 | bd90e6c7a6a5638119e59c85ff4b4cb08527cb14 | chore: split APIs readme so that npm repository shows only important parts | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/apis/DEVELOPMENT.md",
"diff": "+# influxdb-client-apis\n+\n+Contains generated client APIs for InfluxDB v2.0. See https://github.com/bonitoo-io/influxdb-client-js to know more.\n+\n+## Build\n+\n+```bash\n+$ yarn build\n+```\n+\n+## Re-generate APIs code\n+\n+- update local resources/swagger.yml to the latest version\n+ - `wget -O resources/swagger.yml https://raw.githubusercontent.com/influxdata/influxdb/master/http/swagger.yml`\n+- re-generate src/generated/types.ts and resources/operations.json\n+ - `rm -rf src/generated/*.ts`\n+ - `oats -i 'types' --storeOperations resources/operations.json resources/swagger.yml > src/generated/types.ts`\n+- generate src/generated APIs from resources/operations.json\n+ - `yarn generate`\n+- validate\n+ - `yarn test`\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/README.md",
"new_path": "packages/apis/README.md",
"diff": "# influxdb-client-apis\n-Contains generated client APIs for InfluxDB v2.0. See https://github.com/bonitoo-io/influxdb-client-js to know more.\n-\n-## Build\n-\n-```bash\n-$ yarn build\n-```\n-\n-## Development\n-\n-### Re-generate APIs code\n-\n-- update local resources/swagger.yml to the latest version\n- - `wget -O resources/swagger.yml https://raw.githubusercontent.com/influxdata/influxdb/master/http/swagger.yml`\n-- re-generate src/generated/types.ts and resources/operations.json\n- - `rm -rf src/generated/*.ts`\n- - `oats -i 'types' --storeOperations resources/operations.json resources/swagger.yml > src/generated/types.ts`\n-- generate src/generated APIs from resources/operations.json\n- - `yarn generate`\n-- validate\n- - `yarn test`\n+Contains client APIs for InfluxDB v2.0. See https://github.com/bonitoo-io/influxdb-client-js to know more.\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore: split APIs readme so that npm repository shows only important parts |
305,159 | 13.01.2020 16:31:54 | -3,600 | 6e8a1107fda8853c3905db4d487a3c5165fb8eb9 | fear(release): simplify lerna.json | [
{
"change_type": "MODIFY",
"old_path": "lerna.json",
"new_path": "lerna.json",
"diff": "{\n\"version\": \"independent\",\n\"npmClient\": \"yarn\",\n- \"packages\": [\"packages/*\"],\n- \"command\": {\n- \"publish\": {\n- \"message\": \"chore(release): publish %s\"\n- }\n- }\n+ \"packages\": [\"packages/*\"]\n}\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | fear(release): simplify lerna.json |
305,159 | 13.01.2020 20:44:58 | -3,600 | 3a7f8bd743c1f73f49d11b9501abaa3c7287f081 | fix(examples): update prerequisites | [
{
"change_type": "MODIFY",
"old_path": "examples/README.md",
"new_path": "examples/README.md",
"diff": "This directory contains javascript and typescript examples for node.js and browser environments.\n- Prerequisites\n+ - [node](https://nodejs.org/en/) installed\n- [yarn](https://yarnpkg.com/lang/en/docs/install/) installed\n- Run `yarn --cwd ..` in this directory\n- Run `yarn --cwd .. build` in this directory\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/index.html",
"new_path": "examples/index.html",
"diff": "<script type=\"module\">\nimport {InfluxDB, Point} from '../packages/core/dist/index.browser.mjs'\nimport {HealthAPI, SetupAPI} from '../packages/apis/dist/index.browser.mjs'\n+ // use the following imports to use the latest versions from npm repository\n+ // import {InfluxDB, Point} from 'https://unpkg.com/@bonitoo-io/influxdb-client/dist/index.browser.mjs'\n+ // import {HealthAPI, SetupAPI} from 'https://unpkg.com/@bonitoo-io/influxdb-client-apis/dist/index.browser.mjs'\n/** InfluxDB v2 URL */\nconst url = '/influx' // rely upon proxy to forward to the target influxDB\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | fix(examples): update prerequisites |
305,159 | 13.01.2020 20:46:27 | -3,600 | 89ecd498c9f3d94325ed98c644c8ef4327b89fac | chore(examples): update index with remote URLs | [
{
"change_type": "MODIFY",
"old_path": "examples/index.html",
"new_path": "examples/index.html",
"diff": "<script type=\"module\">\nimport {InfluxDB, Point} from '../packages/core/dist/index.browser.mjs'\nimport {HealthAPI, SetupAPI} from '../packages/apis/dist/index.browser.mjs'\n- // use the following imports to use the latest versions from npm repository\n+ // or use the following imports to get the latest versions from npm repository\n// import {InfluxDB, Point} from 'https://unpkg.com/@bonitoo-io/influxdb-client/dist/index.browser.mjs'\n// import {HealthAPI, SetupAPI} from 'https://unpkg.com/@bonitoo-io/influxdb-client-apis/dist/index.browser.mjs'\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore(examples): update index with remote URLs |
305,159 | 14.01.2020 11:47:26 | -3,600 | 7a892429524563d06725fc8e9543bf4f3fd3204a | feat(examples): do not require yarn or local build in examples, use just npm | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "examples/.gitignore",
"diff": "+node_modules\n+build\n+dist\n+coverage\n+doc\n+.rpt2_cache\n+.DS_Store\n+.nyc_output\n+*.lcov\n+reports\n+yarn-error.log\n+package-lock.json\n+yarn.lock\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/README.md",
"new_path": "examples/README.md",
"diff": "@@ -4,12 +4,10 @@ This directory contains javascript and typescript examples for node.js and brows\n- Prerequisites\n- [node](https://nodejs.org/en/) installed\n- - [yarn](https://yarnpkg.com/lang/en/docs/install/) installed\n- - Run `yarn --cwd ..` in this directory\n- - Run `yarn --cwd .. build` in this directory\n+ - Run `npm install` in this directory\n- Node.js examples\n- Change variables in [./env.js](env.js) to configure connection to your InfluxDB instance. The file can be used as-is against a new [docker influxDB v2.0 installation](https://v2.docs.influxdata.com/v2.0/get-started/)\n- - Examples are executable. If it does not work for you, run `yarn ts-node EXAMPLE.ts`.\n+ - Examples are executable. If it does not work for you, run `npm run ts-node EXAMPLE.ts`.\n- [write.ts](./write.ts)\nWrite data points to InfluxDB.\n- [query.ts](./query.ts)\n@@ -21,7 +19,7 @@ This directory contains javascript and typescript examples for node.js and brows\n- Browser examples\n- Change `url` in [./env.ts](env.ts) to match your influxDB instance\n- Change `token,org,bucket` variables in [./index.html](index.html) to match your influxDB instance\n- - Run `yarn browser`\n+ - Run `npm run browser`\nIt starts a local HTTP server and opens [./index.html](index.html) that contains examples.\nThe local HTTP server serves all files from this git repository and also proxies requests\nto a configured influxDB database, see [./scripts/server.js](server.js) for details.\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/index.html",
"new_path": "examples/index.html",
"diff": "<head>\n<title>InfluxDB JavaScript Client Examples</title>\n<script type=\"module\">\n- import {InfluxDB, Point} from '../packages/core/dist/index.browser.mjs'\n- import {HealthAPI, SetupAPI} from '../packages/apis/dist/index.browser.mjs'\n- // or use the following imports to get the latest versions from npm repository\n- // import {InfluxDB, Point} from 'https://unpkg.com/@bonitoo-io/influxdb-client/dist/index.browser.mjs'\n- // import {HealthAPI, SetupAPI} from 'https://unpkg.com/@bonitoo-io/influxdb-client-apis/dist/index.browser.mjs'\n+ // import latest release from npm repository\n+ import {InfluxDB, Point} from 'https://unpkg.com/@bonitoo-io/influxdb-client/dist/index.browser.mjs'\n+ import {HealthAPI, SetupAPI} from 'https://unpkg.com/@bonitoo-io/influxdb-client-apis/dist/index.browser.mjs'\n+ // or use the following imports to use local builds\n+ // import {InfluxDB, Point} from '../packages/core/dist/index.browser.mjs'\n+ // import {HealthAPI, SetupAPI} from '../packages/apis/dist/index.browser.mjs'\n/** InfluxDB v2 URL */\nconst url = '/influx' // rely upon proxy to forward to the target influxDB\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/package.json",
"new_path": "examples/package.json",
"diff": "\"browser\": \"node scripts/server.js\",\n\"clean\": \"echo 'nothing to clean'\",\n\"build\": \"echo 'nothing to build'\",\n- \"test\": \"echo 'run examples to test'\"\n+ \"test\": \"echo 'run examples to test'\",\n+ \"ts-node\": \"ts-node\"\n},\n\"dependencies\": {\n\"@bonitoo-io/influxdb-client\": \"*\",\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/query.ts",
"new_path": "examples/query.ts",
"diff": "-#!../node_modules/.bin/ts-node\n+#!./node_modules/.bin/ts-node\n//////////////////////////////////////////\n// Shows how to use InfluxDB query API. //\n//////////////////////////////////////////\n"
},
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"description\": \"InfluxDB 2.0 client monorepo\",\n\"workspaces\": {\n\"packages\": [\n- \"packages/*\",\n- \"examples\"\n+ \"packages/*\"\n]\n},\n\"scripts\": {\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(examples): do not require yarn or local build in examples, use just npm |
305,159 | 14.01.2020 11:52:30 | -3,600 | 97146190c4f93ad8fbd2666f538f335b32facfe5 | chore (examples): update readme | [
{
"change_type": "MODIFY",
"old_path": "examples/README.md",
"new_path": "examples/README.md",
"diff": "@@ -17,8 +17,8 @@ This directory contains javascript and typescript examples for node.js and brows\n- [onboarding.js](./onboarding.js)\nPerforms onboarding of a new influxDB database. It creates a new organization, bucket and user that is then used in all examples.\n- Browser examples\n- - Change `url` in [./env.ts](env.ts) to match your influxDB instance\n- - Change `token,org,bucket` variables in [./index.html](index.html) to match your influxDB instance\n+ - Change `url` in [./env.js](env.js) to match your influxDB instance\n+ - Change `token, org, bucket, username, password` variables in [./index.html](index.html) to match your influxDB instance\n- Run `npm run browser`\nIt starts a local HTTP server and opens [./index.html](index.html) that contains examples.\nThe local HTTP server serves all files from this git repository and also proxies requests\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/index.html",
"new_path": "examples/index.html",
"diff": "// import {InfluxDB, Point} from '../packages/core/dist/index.browser.mjs'\n// import {HealthAPI, SetupAPI} from '../packages/apis/dist/index.browser.mjs'\n- /** InfluxDB v2 URL */\n- const url = '/influx' // rely upon proxy to forward to the target influxDB\n+ // rely upon proxy to forward to the target influxDB\n+ const url = '/influx'\n+ // example constants\nconst token = 'my-token'\nconst org = 'my-org'\nconst bucket = 'my-bucket'\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore (examples): update readme |
305,159 | 17.01.2020 09:06:16 | -3,600 | 52d97a2ea479f5534ad07330a428ac5b56dbced4 | chore: add typedoc | [
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"clean\": \"yarn workspaces run clean\",\n\"build\": \"cd packages/core && yarn build && cd ../apis && yarn build\",\n\"test\": \"cd packages/core && yarn test && cd ../apis && yarn test\",\n- \"coverage\": \"cd packages/core && yarn coverage\"\n+ \"coverage\": \"cd packages/core && yarn coverage\",\n+ \"typedoc\": \"cd packages/core && yarn typedoc && cd ../apis && yarn typedoc\"\n},\n\"homepage\": \"https://github.com/bonitoo-io/influxdb-client-js\",\n\"repository\": {\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/package.json",
"new_path": "packages/apis/package.json",
"diff": "\"generate\": \"yarn ts-node generator && yarn prettier --write src/generated/*.ts\",\n\"test\": \"yarn run lint && yarn run typecheck\",\n\"typecheck\": \"tsc --noEmit --pretty\",\n- \"typedoc\": \"typedoc --excludePrivate --excludeNotExported --mode file --out ./doc --target es6 --tsconfig ./tsconfig.build.json ./src\",\n+ \"typedoc\": \"typedoc --excludePrivate --excludeNotExported --mode file --out ./doc/apidoc --module es2015 --tsconfig ./tsconfig.json ./src\",\n\"lint\": \"eslint 'src/**/*.ts'\",\n\"lint:fix\": \"eslint --fix 'src/**/*.ts'\"\n},\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/package.json",
"new_path": "packages/core/package.json",
"diff": "\"test:unit:ci\": \"yarn run test:unit --exit --reporter mocha-junit-reporter --reporter-options mochaFile=reports/mocha/test-results.xml\",\n\"test:watch\": \"mocha --require ts-node/register 'test/unit/**/*.test.ts' --watch-extensions ts --watch\",\n\"typecheck\": \"tsc --noEmit --pretty\",\n- \"typedoc\": \"typedoc --excludePrivate --excludeNotExported --mode file --out ./reports/apidoc --target es6 --tsconfig ./tsconfig.build.json ./src\",\n+ \"typedoc\": \"typedoc --excludePrivate --excludeNotExported --mode file --out ./reports/apidoc --module es2015 --tsconfig ./tsconfig.json ./src\",\n\"lint\": \"eslint 'src/**/*.ts' 'test/**/*.ts'\",\n\"lint:ci\": \"yarn run lint --format junit --output-file reports/eslint/eslint.xml\",\n\"lint:fix\": \"eslint --fix 'src/**/*.ts'\"\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore: add typedoc |
305,159 | 21.01.2020 07:39:44 | -3,600 | d95273c90847b16741754983f5f8a7d67102bf0d | chore: update package homepage so that it can be opened | [
{
"change_type": "MODIFY",
"old_path": "packages/apis/package.json",
"new_path": "packages/apis/package.json",
"diff": "\"dist/index.js\": \"dist/index.browser.js\",\n\"dist/index.mjs\": \"dist/index.browser.mjs\"\n},\n- \"homepage\": \"https://github.com/bonitoo-io/influxdb-client-js/packages/apis\",\n+ \"homepage\": \"https://github.com/bonitoo-io/influxdb-client-js\",\n\"repository\": {\n\"type\": \"git\",\n\"url\": \"git+https://github.com/bonitoo-io/influxdb-client-js\",\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/package.json",
"new_path": "packages/core/package.json",
"diff": "\"dist/index.js\": \"dist/index.browser.js\",\n\"dist/index.mjs\": \"dist/index.browser.mjs\"\n},\n- \"homepage\": \"https://github.com/bonitoo-io/influxdb-client-js/packages/core\",\n+ \"homepage\": \"https://github.com/bonitoo-io/influxdb-client-js\",\n\"repository\": {\n\"type\": \"git\",\n\"url\": \"git+https://github.com/bonitoo-io/influxdb-client-js\",\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore: update package homepage so that it can be opened |
305,159 | 22.01.2020 14:47:13 | -3,600 | c0e00296a655bd42af7ebebe0721d3ebf6237dc5 | feat(core): simplify InfluxDB constructor to provide to improve code completition | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/InfluxDB.ts",
"new_path": "packages/core/src/InfluxDB.ts",
"diff": "@@ -15,19 +15,11 @@ export default class InfluxDB {\nprivate _options: ClientOptions\nreadonly transport: Transport\n- /* eslint-disable no-dupe-class-members */\n/**\n- * Creates influxdb client from a string URL\n- * @param url influxDB url, such as http://localhost:9999?token=my-token\n- */\n- constructor(url: string)\n- /**\n- * Creates influxdb client options from an options object.\n+ * Creates influxdb client options from an options object or url.\n* @param options options\n*/\n- constructor(options: ClientOptions)\n-\n- constructor(options?: any) {\n+ constructor(options: ClientOptions | string) {\nif (typeof options === 'string') {\nthis._options = {url: options}\n} else if (options !== null && typeof options === 'object') {\n@@ -39,7 +31,6 @@ export default class InfluxDB {\nthrow new IllegalArgumentError('No url specified!')\nthis.transport = this._options.transport || new TransportImpl(this._options)\n}\n- /* eslint-enable no-dupe-class-members */\n/**\n* Creates [[WriteApi]] for the supplied organization and bucket. BEWARE that returned instances must be closed\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(core): simplify InfluxDB constructor to provide to improve code completition |
305,159 | 06.02.2020 14:02:13 | -3,600 | 76a44c27cd91a1c56487acf844b50d856c60ca69 | chome: update README links to work properly | [
{
"change_type": "MODIFY",
"old_path": "examples/README.md",
"new_path": "examples/README.md",
"diff": "@@ -17,9 +17,9 @@ This directory contains javascript and typescript examples for node.js and brows\n- [onboarding.js](./onboarding.js)\nPerforms onboarding of a new influxDB database. It creates a new organization, bucket and user that is then used in all examples.\n- Browser examples\n- - Change `url` in [./env.js](env.js) to match your influxDB instance\n+ - Change `url` in [env.js](./env.js) to match your influxDB instance\n- Change `token, org, bucket, username, password` variables in [./index.html](index.html) to match your influxDB instance\n- Run `npm run browser`\n- It starts a local HTTP server and opens [./index.html](index.html) that contains examples.\n+ It starts a local HTTP server and opens [index.html](./index.html) that contains examples.\nThe local HTTP server serves all files from this git repository and also proxies requests\n- to a configured influxDB database, see [./scripts/server.js](server.js) for details.\n+ to a configured influxDB database, see [scripts/server.js](./scripts/server.js) for details.\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chome: update README links to work properly |
305,159 | 06.02.2020 19:45:05 | -3,600 | a306bd5d22b3b4982e2a60dafbd4d938f0562efb | fix(distribution): provide valid browser field for webpack | [
{
"change_type": "MODIFY",
"old_path": "packages/apis/package.json",
"new_path": "packages/apis/package.json",
"diff": "},\n\"main\": \"dist/index.js\",\n\"module\": \"dist/index.mjs\",\n- \"browser\": {\n- \"dist/index.js\": \"dist/index.browser.js\",\n- \"dist/index.mjs\": \"dist/index.browser.mjs\"\n- },\n+ \"browser\": \"dist/index.browser.js\",\n\"homepage\": \"https://github.com/bonitoo-io/influxdb-client-js\",\n\"repository\": {\n\"type\": \"git\",\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/rollup.config.js",
"new_path": "packages/apis/rollup.config.js",
"diff": "@@ -46,11 +46,11 @@ function createConfig({browser, format, out, name, target, noTerser}) {\nexport default [\ncreateConfig({browser: false, format: 'cjs', out: pkg.main}),\ncreateConfig({browser: false, format: 'esm', out: pkg.module}),\n- createConfig({browser: true, format: 'umd', out: pkg.browser[pkg.main]}),\n+ createConfig({browser: true, format: 'umd', out: pkg.browser}),\ncreateConfig({\nbrowser: true,\nformat: 'esm',\n- out: pkg.browser[pkg.module],\n+ out: pkg.browser.replace('.js', '.mjs'),\n}),\ncreateConfig({\nbrowser: true,\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/package.json",
"new_path": "packages/core/package.json",
"diff": "},\n\"main\": \"dist/index.js\",\n\"module\": \"dist/index.mjs\",\n- \"browser\": {\n- \"dist/index.js\": \"dist/index.browser.js\",\n- \"dist/index.mjs\": \"dist/index.browser.mjs\"\n- },\n+ \"browser\": \"dist/index.browser.js\",\n\"homepage\": \"https://github.com/bonitoo-io/influxdb-client-js\",\n\"repository\": {\n\"type\": \"git\",\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/rollup.config.js",
"new_path": "packages/core/rollup.config.js",
"diff": "@@ -49,11 +49,11 @@ function createConfig({browser, format, out, name, target, noTerser}) {\nexport default [\ncreateConfig({browser: false, format: 'cjs', out: pkg.main}),\ncreateConfig({browser: false, format: 'esm', out: pkg.module}),\n- createConfig({browser: true, format: 'umd', out: pkg.browser[pkg.main]}),\n+ createConfig({browser: true, format: 'umd', out: pkg.browser}),\ncreateConfig({\nbrowser: true,\nformat: 'esm',\n- out: pkg.browser[pkg.module],\n+ out: pkg.browser.replace('.js', '.mjs'),\n}),\ncreateConfig({\nbrowser: true,\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | fix(distribution): provide valid browser field for webpack |
305,159 | 10.02.2020 12:24:29 | -3,600 | 5bd1a8d299334fe52d9472e3f7a045672c4bcf57 | feat(examples): add INFLUXDB_ORG env variable | [
{
"change_type": "MODIFY",
"old_path": "examples/env.js",
"new_path": "examples/env.js",
"diff": "@@ -3,7 +3,7 @@ const url = process.env['INFLUXDB_URL'] || 'http://localhost:9999'\n/** InfluxDB authorization token */\nconst token = process.env['INFLUXDB_TOKEN'] || 'my-token'\n/** Organization within InfluxDB URL */\n-const org = 'my-org'\n+const org = process.env['INFLUXDB_ORG'] || 'my-org'\n/**InfluxDB bucket used in examples */\nconst bucket = 'my-bucket'\n// ONLY onboarding example\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(examples): add INFLUXDB_ORG env variable |
305,159 | 11.02.2020 15:43:15 | -3,600 | 2a93a72fe7de03b0a1700327e9b203dcdc99a4ed | feat(query): maintain column index in table metadata | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/query/FluxTableColumn.ts",
"new_path": "packages/core/src/query/FluxTableColumn.ts",
"diff": "@@ -56,6 +56,12 @@ export default class FluxTableColumn {\n*/\ndefaultValue: string\n+ /**\n+ * Index of this column in the row array\n+ * @return index\n+ */\n+ index: number\n+\n/**\n* Creates a flux table column from an object supplied.\n* @param object\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/query/FluxTableMetaData.ts",
"new_path": "packages/core/src/query/FluxTableMetaData.ts",
"diff": "@@ -25,6 +25,7 @@ export default class FluxTableMetaData {\n*/\ncolumns: Array<FluxTableColumn>\nconstructor(columns: FluxTableColumn[]) {\n+ columns.forEach((col, i) => (col.index = i))\nthis.columns = columns\n}\n/**\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(query): maintain column index in table metadata |
305,159 | 11.02.2020 16:05:28 | -3,600 | 2e6d631325b987a1fe3e9d494616895bfe38ecc1 | fix(tests): update fixtures in tests | [
{
"change_type": "MODIFY",
"old_path": "packages/core/test/fixture/query/response2.parsed.json",
"new_path": "packages/core/test/fixture/query/response2.parsed.json",
"diff": "\"dataType\": \"string\",\n\"group\": false,\n\"defaultValue\": \"_result\",\n- \"label\": \"result\"\n+ \"label\": \"result\",\n+ \"index\": 0\n},\n{\n\"dataType\": \"long\",\n\"group\": false,\n\"defaultValue\": \"\",\n- \"label\": \"table\"\n+ \"label\": \"table\",\n+ \"index\": 1\n},\n{\n\"dataType\": \"dateTime:RFC3339\",\n\"group\": true,\n\"defaultValue\": \"\",\n- \"label\": \"_start\"\n+ \"label\": \"_start\",\n+ \"index\": 2\n},\n{\n\"dataType\": \"dateTime:RFC3339\",\n\"group\": true,\n\"defaultValue\": \"\",\n- \"label\": \"_stop\"\n+ \"label\": \"_stop\",\n+ \"index\": 3\n},\n{\n\"dataType\": \"dateTime:RFC3339\",\n\"group\": false,\n\"defaultValue\": \"\",\n- \"label\": \"_time\"\n+ \"label\": \"_time\",\n+ \"index\": 4\n},\n{\n\"dataType\": \"double\",\n\"group\": false,\n\"defaultValue\": \"\",\n- \"label\": \"_value\"\n+ \"label\": \"_value\",\n+ \"index\": 5\n},\n{\n\"dataType\": \"string\",\n\"group\": true,\n\"defaultValue\": \"\",\n- \"label\": \"_field\"\n+ \"label\": \"_field\",\n+ \"index\": 6\n},\n{\n\"dataType\": \"string\",\n\"group\": true,\n\"defaultValue\": \"\",\n- \"label\": \"_measurement\"\n+ \"label\": \"_measurement\",\n+ \"index\": 7\n},\n{\n\"dataType\": \"string\",\n\"group\": true,\n\"defaultValue\": \"\",\n- \"label\": \"location\"\n+ \"label\": \"location\",\n+ \"index\": 8\n}\n]\n}\n\"dataType\": \"string\",\n\"group\": false,\n\"defaultValue\": \"_result\",\n- \"label\": \"result\"\n+ \"label\": \"result\",\n+ \"index\": 0\n},\n{\n\"dataType\": \"long\",\n\"group\": false,\n\"defaultValue\": \"\",\n- \"label\": \"table\"\n+ \"label\": \"table\",\n+ \"index\": 1\n},\n{\n\"dataType\": \"dateTime:RFC3339\",\n\"group\": true,\n\"defaultValue\": \"\",\n- \"label\": \"_start\"\n+ \"label\": \"_start\",\n+ \"index\": 2\n},\n{\n\"dataType\": \"dateTime:RFC3339\",\n\"group\": true,\n\"defaultValue\": \"\",\n- \"label\": \"_stop\"\n+ \"label\": \"_stop\",\n+ \"index\": 3\n},\n{\n\"dataType\": \"dateTime:RFC3339\",\n\"group\": false,\n\"defaultValue\": \"\",\n- \"label\": \"_time\"\n+ \"label\": \"_time\",\n+ \"index\": 4\n},\n{\n\"dataType\": \"string\",\n\"group\": false,\n\"defaultValue\": \"\",\n- \"label\": \"_value\"\n+ \"label\": \"_value\",\n+ \"index\": 5\n},\n{\n\"dataType\": \"string\",\n\"group\": true,\n\"defaultValue\": \"\",\n- \"label\": \"_field\"\n+ \"label\": \"_field\",\n+ \"index\": 6\n},\n{\n\"dataType\": \"string\",\n\"group\": true,\n\"defaultValue\": \"\",\n- \"label\": \"_measurement\"\n+ \"label\": \"_measurement\",\n+ \"index\": 7\n},\n{\n\"dataType\": \"string\",\n\"group\": true,\n\"defaultValue\": \"\",\n- \"label\": \"location\"\n+ \"label\": \"location\",\n+ \"index\": 8\n}\n]\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/test/fixture/query/response3.parsed.json",
"new_path": "packages/core/test/fixture/query/response3.parsed.json",
"diff": "\"meta\": {\n\"columns\": [\n{\n+ \"index\": 0,\n\"label\": \"result\"\n},\n{\n+ \"index\": 1,\n\"label\": \"table\"\n},\n{\n+ \"index\": 2,\n\"label\": \"_start\"\n},\n{\n+ \"index\": 3,\n\"label\": \"_stop\"\n},\n{\n+ \"index\": 4,\n\"label\": \"_time\"\n},\n{\n+ \"index\": 5,\n\"label\": \"_value\"\n},\n{\n+ \"index\": 6,\n\"label\": \"_field\"\n},\n{\n+ \"index\": 7,\n\"label\": \"_measurement\"\n},\n{\n+ \"index\": 8,\n\"label\": \"location\"\n}\n]\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | fix(tests): update fixtures in tests |
305,159 | 13.02.2020 17:23:55 | -3,600 | 4847836e01803b0ede347721ce4faf9618ecfef1 | feat(tests): add test for browser's fetch transport | [
{
"change_type": "MODIFY",
"old_path": ".vscode/launch.json",
"new_path": ".vscode/launch.json",
"diff": "\"ts-node/register\",\n\"--timeout\",\n\"15000\",\n- \"--check-leaks\",\n\"--colors\",\n\"test/**/*.test.ts\"\n],\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/core/test/unit/impl/browser/FetchTransport.test.ts",
"diff": "+import FetchTransport from '../../../../src/impl/browser/FetchTransport'\n+import {expect} from 'chai'\n+import {removeFetchApi, emulateFetchApi} from './emulateBrowser'\n+import sinon from 'sinon'\n+\n+describe('FetchTransport', () => {\n+ afterEach(() => {\n+ removeFetchApi()\n+ })\n+\n+ describe('constructor', () => {\n+ it('creates the transport with url', () => {\n+ const options = {\n+ url: 'http://test:9999',\n+ }\n+ const transport: any = new FetchTransport(options)\n+ expect(transport.defaultHeaders).to.deep.equal({\n+ 'content-type': 'application/json; charset=utf-8',\n+ })\n+ expect(transport.connectionOptions).to.deep.equal(options)\n+ })\n+ it('creates the transport with url and token', () => {\n+ const options = {\n+ url: 'http://test:9999',\n+ token: 'a',\n+ }\n+ const transport: any = new FetchTransport(options)\n+ expect(transport.defaultHeaders).to.deep.equal({\n+ 'content-type': 'application/json; charset=utf-8',\n+ Authorization: 'Token a',\n+ })\n+ expect(transport.connectionOptions).to.deep.equal(options)\n+ })\n+ })\n+ describe('request', () => {\n+ const transport = new FetchTransport({url: 'http://test:9999'})\n+ it('receives json data', async () => {\n+ emulateFetchApi({\n+ headers: {'content-type': 'application/json'},\n+ body: '{}',\n+ })\n+ const response = await transport.request(\n+ '/whatever',\n+ {anything: 'here'},\n+ {\n+ method: 'POST',\n+ }\n+ )\n+ expect(response).is.deep.equal({})\n+ })\n+ it('receives text data', async () => {\n+ emulateFetchApi({\n+ headers: {'content-type': 'text/plain'},\n+ body: '{}',\n+ })\n+ const response = await transport.request('/whatever', '', {\n+ method: 'GET',\n+ })\n+ expect(response).is.deep.equal('{}')\n+ })\n+ it('receives no data', async () => {\n+ emulateFetchApi({\n+ headers: {},\n+ body: '{}',\n+ })\n+ const response = await transport.request('/whatever', '', {\n+ method: 'HEAD', // can be any other\n+ })\n+ expect(response).is.equal(undefined)\n+ })\n+ it('receives no data', async () => {\n+ emulateFetchApi({\n+ headers: {'content-type': 'text/plain'},\n+ body: 'error',\n+ })\n+ const response = await transport.request('/whatever', '', {\n+ method: 'POST',\n+ })\n+ expect(response).is.equal(undefined)\n+ })\n+ it('throws error', async () => {\n+ emulateFetchApi({\n+ headers: {'content-type': 'application/json'},\n+ body: '{}',\n+ status: 500,\n+ })\n+ try {\n+ await transport.request('/whatever', '', {\n+ method: 'GET',\n+ })\n+ expect.fail()\n+ } catch (_e) {\n+ // eslint-disable-next-line no-console\n+ // console.log(` OK, received ${_e}`)\n+ }\n+ })\n+ })\n+ describe('send', () => {\n+ const transport = new FetchTransport({url: 'http://test:9999'})\n+ function fakeCallbacks(): any {\n+ return {\n+ next: sinon.fake(),\n+ error: sinon.fake(),\n+ complete: sinon.fake(),\n+ useCancellable: sinon.fake(),\n+ responseStarted: sinon.fake(),\n+ }\n+ }\n+ ;[\n+ {\n+ body: 'a',\n+ status: 201,\n+ },\n+ {\n+ body: 'a',\n+ url: 'error',\n+ callbacks: fakeCallbacks(),\n+ },\n+ {\n+ body: [Buffer.from('a'), Buffer.from('b')],\n+ callbacks: fakeCallbacks(),\n+ },\n+ {\n+ body: Buffer.from('a'),\n+ callbacks: fakeCallbacks(),\n+ },\n+ {\n+ body: 'a',\n+ callbacks: fakeCallbacks(),\n+ },\n+ {\n+ body: 'a',\n+ callbacks: fakeCallbacks(),\n+ status: 500,\n+ },\n+ {\n+ body: 'error',\n+ callbacks: fakeCallbacks(),\n+ status: 501,\n+ },\n+ ].forEach(({body, callbacks, url = '/whatever', status = 200}, i) => {\n+ it(`receives data in chunks ${i}`, async () => {\n+ emulateFetchApi({\n+ headers: {'content-type': 'text/plain', duplicate: 'ok'},\n+ status,\n+ body,\n+ })\n+ if (callbacks) {\n+ await new Promise((resolve: any) =>\n+ transport.send(\n+ url,\n+ '',\n+ {method: 'POST'},\n+ {\n+ ...callbacks,\n+ complete() {\n+ callbacks.complete && callbacks.complete()\n+ resolve()\n+ },\n+ error(e: Error) {\n+ callbacks.error && callbacks.error(e)\n+ resolve()\n+ },\n+ }\n+ )\n+ )\n+ if (callbacks.useCancellable) {\n+ expect(callbacks.useCancellable.callCount).equals(1)\n+ const cancellable = callbacks.useCancellable.args[0][0]\n+ cancellable.cancel()\n+ expect(cancellable.isCancelled()).is.equal(true)\n+ }\n+ const isError = url === 'error' || status !== 200\n+ expect(callbacks.responseStarted.callCount).equals(\n+ url === 'error' ? 0 : 1\n+ )\n+ expect(callbacks.complete.callCount).equals(isError ? 0 : 1)\n+ expect(callbacks.error.callCount).equals(isError ? 1 : 0)\n+ expect(callbacks.next.callCount).equals(\n+ isError ? 0 : Array.isArray(body) ? body.length : 1\n+ )\n+ } else {\n+ transport.send('/whatever', '', {method: 'POST'}, callbacks)\n+ }\n+ })\n+ })\n+ })\n+})\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/core/test/unit/impl/browser/emulateBrowser.ts",
"diff": "+interface ResponseSpec {\n+ headers?: {[key: string]: string}\n+ status?: number\n+ body?: string | Uint8Array | Array<Uint8Array>\n+}\n+\n+function createResponse({\n+ headers = {},\n+ status = 200,\n+ body = '',\n+}: ResponseSpec): any {\n+ const retVal: any = {\n+ status,\n+ statusText: `X${status}X`,\n+ headers: {\n+ get(key: string): string | undefined {\n+ return headers[key] || headers[key.toLowerCase()]\n+ },\n+ forEach(fn: (value: string, key: string) => void): void {\n+ Object.keys(headers).forEach((key: string) => {\n+ fn(headers[key], key)\n+ if (key === 'duplicate') {\n+ fn(headers[key] + '2', key)\n+ fn(headers[key] + '3', key)\n+ }\n+ })\n+ },\n+ },\n+ json(): Promise<any> {\n+ if (typeof body === 'string') {\n+ if (body == 'error') return Promise.reject(new Error('error data'))\n+ return Promise.resolve(JSON.parse(body))\n+ } else {\n+ return Promise.reject(new Error('String body expected, but ' + body))\n+ }\n+ },\n+ }\n+ if (typeof body === 'string') {\n+ retVal.text = function(): Promise<string> {\n+ if (typeof body === 'string') {\n+ if (body == 'error') return Promise.reject(new Error('error data'))\n+ return Promise.resolve(body)\n+ } else {\n+ return Promise.reject(new Error('String body expected, but ' + body))\n+ }\n+ }\n+ }\n+ if (body instanceof Uint8Array) {\n+ retVal.arrayBuffer = function(): Promise<any> {\n+ return Promise.resolve(body.buffer)\n+ }\n+ }\n+ if (Array.isArray(body)) {\n+ retVal.body = {\n+ getReader(): any {\n+ let position = 0\n+ return {\n+ read(): Promise<any> {\n+ if (position < body.length) {\n+ return Promise.resolve({\n+ value: body[position++],\n+ done: false,\n+ })\n+ } else {\n+ return Promise.resolve({\n+ value: undefined,\n+ done: true,\n+ })\n+ }\n+ },\n+ }\n+ },\n+ }\n+ }\n+ return retVal\n+}\n+\n+let beforeEmulation:\n+ | {fetch: any; AbortController: any; TextEncoder: any}\n+ | undefined\n+\n+export function emulateFetchApi(spec: ResponseSpec): void {\n+ function fetch(url: string, _options: any): Promise<any> {\n+ return url.indexOf('error') !== -1\n+ ? Promise.reject(new Error(url))\n+ : Promise.resolve(createResponse(spec))\n+ }\n+ class AbortController {\n+ signal = {\n+ aborted: false,\n+ }\n+ abort(): void {\n+ this.signal.aborted = true\n+ }\n+ }\n+\n+ class TextEncoder {\n+ encode(s: string): Uint8Array {\n+ return Buffer.from(s)\n+ }\n+ }\n+ const globalVars = global as any\n+ if (!beforeEmulation) {\n+ beforeEmulation = {\n+ fetch: globalVars.fetch,\n+ AbortController: globalVars.AbortController,\n+ TextEncoder: globalVars.TextEncoder,\n+ }\n+ }\n+ globalVars.fetch = fetch\n+ globalVars.AbortController = AbortController\n+ globalVars.TextEncoder = TextEncoder\n+}\n+export function removeFetchApi(): void {\n+ if (beforeEmulation) {\n+ const {fetch, AbortController, TextEncoder} = beforeEmulation\n+ beforeEmulation = undefined\n+ const globalVars = global as any\n+ globalVars.fetch = fetch\n+ globalVars.AbortController = AbortController\n+ globalVars.TextEncoder = TextEncoder\n+ }\n+}\n"
},
{
"change_type": "RENAME",
"old_path": "packages/core/test/unit/impl/NodeHttpTransport.test.ts",
"new_path": "packages/core/test/unit/impl/node/NodeHttpTransport.test.ts",
"diff": "import {expect} from 'chai'\nimport nock from 'nock' // WARN: nock must be imported before NodeHttpTransport, since it modifies node's http\n-import NodeHttpTransport from '../../../src/impl/node/NodeHttpTransport'\n-import {ConnectionOptions} from '../../../src/options'\n-import {SendOptions} from '../../../src/transport'\n-import Cancellable from '../../../src/util/Cancellable'\n+import NodeHttpTransport from '../../../../src/impl/node/NodeHttpTransport'\n+import {ConnectionOptions} from '../../../../src/options'\n+import {SendOptions} from '../../../../src/transport'\n+import Cancellable from '../../../../src/util/Cancellable'\nimport * as http from 'http'\nimport * as https from 'https'\nimport sinon from 'sinon'\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(tests): add test for browser's fetch transport |
305,159 | 14.02.2020 07:47:04 | -3,600 | 9cf03cc0c479ffc9a462ae34ee19fc3991be6eba | feat(tests): improve fetch transport tests | [
{
"change_type": "MODIFY",
"old_path": "packages/core/test/unit/impl/browser/FetchTransport.test.ts",
"new_path": "packages/core/test/unit/impl/browser/FetchTransport.test.ts",
"diff": "@@ -179,6 +179,16 @@ describe('FetchTransport', () => {\nexpect(callbacks.next.callCount).equals(\nisError ? 0 : Array.isArray(body) ? body.length : 1\n)\n+ if (!isError) {\n+ const vals = callbacks.next.args.map((args: any) =>\n+ Buffer.from(args[0])\n+ )\n+ expect(\n+ Array.isArray(body)\n+ ? body\n+ : [Buffer.isBuffer(body) ? body : Buffer.from(body)]\n+ ).is.deep.equal(vals)\n+ }\n} else {\ntransport.send('/whatever', '', {method: 'POST'}, callbacks)\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/test/unit/impl/browser/emulateBrowser.ts",
"new_path": "packages/core/test/unit/impl/browser/emulateBrowser.ts",
"diff": "@@ -47,7 +47,9 @@ function createResponse({\n}\nif (body instanceof Uint8Array) {\nretVal.arrayBuffer = function(): Promise<any> {\n- return Promise.resolve(body.buffer)\n+ return Promise.resolve(\n+ body.buffer.slice(body.byteOffset, body.byteOffset + body.length)\n+ )\n}\n}\nif (Array.isArray(body)) {\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(tests): improve fetch transport tests |
305,159 | 14.02.2020 08:16:07 | -3,600 | 009d3f69339c7d7e75497319e4ac37b9ab5faac7 | feat(tests): improve test of query api to cover column index | [
{
"change_type": "MODIFY",
"old_path": "packages/core/test/unit/QueryApi.test.ts",
"new_path": "packages/core/test/unit/QueryApi.test.ts",
"diff": "import {expect} from 'chai'\nimport nock from 'nock' // WARN: nock must be imported before NodeHttpTransport, since it modifies node's http\n-import {InfluxDB, ClientOptions} from '../../src'\n+import {InfluxDB, ClientOptions, FluxTableMetaData} from '../../src'\nimport fs from 'fs'\nimport {CollectLinesObserver} from './util/CollectLinesObserver'\nimport {CollectTablesObserver} from './util/CollectTablesObserver'\n@@ -80,4 +80,36 @@ describe('QueryApi', () => {\nexpect(target.rows).to.deep.equal(response.rows)\n})\n})\n+ it('receives properly indexed table data', async () => {\n+ const subject = new InfluxDB(clientOptions).getQueryApi(ORG).with({})\n+ nock(clientOptions.url)\n+ .post(QUERY_PATH)\n+ .reply((_uri, _requestBody) => {\n+ return [\n+ 200,\n+ `,result,table,_start,_stop,_time,_value,_field,_measurement,location\n+,,0,1970-01-01T00:00:00Z,2019-12-12T09:05:37.96237406Z,1970-01-01T00:26:15.995033574Z,55,value,temperature,west\n+,,0,1970-01-01T00:00:00Z,2019-12-12T09:05:37.96237406Z,1970-01-01T00:26:16.063594313Z,55,value,temperature,west\n+,,0,1970-01-01T00:00:00Z,2019-12-12T09:05:37.96237406Z,1970-01-01T00:26:16.069518557Z,55,value,temperature,west`,\n+ {'retry-after': '1'},\n+ ]\n+ })\n+ .persist()\n+ const values: Array<string> = []\n+ await new Promise((resolve, reject) =>\n+ subject.queryRows('from(bucket:\"my-bucket\") |> range(start: 0)', {\n+ next(row: string[], meta: FluxTableMetaData): void {\n+ values.push(row[meta.column('_value').index])\n+ },\n+\n+ error(error: Error): void {\n+ reject(error)\n+ },\n+ complete(): void {\n+ resolve()\n+ },\n+ })\n+ )\n+ expect(values).to.deep.equal(['55', '55', '55'])\n+ })\n})\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(tests): improve test of query api to cover column index |
305,159 | 14.02.2020 12:33:22 | -3,600 | 5389c2e34bd8318fccadb4a665801e6577e3b703 | feat(api): update to the latest swagger file | [
{
"change_type": "MODIFY",
"old_path": "packages/apis/resources/operations.json",
"new_path": "packages/apis/resources/operations.json",
"diff": "},\n\"responses\": [\n{\n- \"code\": \"200\",\n+ \"code\": \"201\",\n\"description\": \"Replaced dashboard cells\",\n\"mediaTypes\": [\n{\n\"description\": \"Flux query or specification to execute\",\n\"required\": false,\n\"mediaType\": \"application/json\",\n- \"type\": \"Query\"\n+ \"type\": \"Query | InfluxQLQuery\"\n},\n\"responses\": [\n{\n}\n]\n},\n+ {\n+ \"code\": \"422\",\n+ \"description\": \"Request body failed validation\",\n+ \"mediaTypes\": [\n+ {\n+ \"mediaType\": \"application/json\",\n+ \"type\": \"Error\"\n+ }\n+ ]\n+ },\n{\n\"code\": \"default\",\n\"description\": \"Unexpected error\",\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/resources/swagger.yml",
"new_path": "packages/apis/resources/swagger.yml",
"diff": "@@ -2361,7 +2361,7 @@ paths:\nrequired: true\ndescription: The ID of the dashboard to update.\nresponses:\n- '200':\n+ '201':\ndescription: Replaced dashboard cells\ncontent:\napplication/json:\n@@ -3214,7 +3214,9 @@ paths:\ncontent:\napplication/json:\nschema:\n- $ref: \"#/components/schemas/Query\"\n+ oneOf:\n+ - $ref: \"#/components/schemas/Query\"\n+ - $ref: \"#/components/schemas/InfluxQLQuery\"\napplication/vnd.flux:\nschema:\ntype: string\n@@ -3322,6 +3324,12 @@ paths:\napplication/json:\nschema:\n$ref: \"#/components/schemas/Bucket\"\n+ 422:\n+ description: Request body failed validation\n+ content:\n+ application/json:\n+ schema:\n+ $ref: \"#/components/schemas/Error\"\ndefault:\ndescription: Unexpected error\ncontent:\n@@ -4319,6 +4327,9 @@ paths:\napplication/json:\nschema:\n$ref: \"#/components/schemas/PkgApply\"\n+ application/x-jsonnet:\n+ schema:\n+ $ref: \"#/components/schemas/PkgApply\"\ntext/yml:\nschema:\n$ref: \"#/components/schemas/PkgApply\"\n@@ -6265,7 +6276,7 @@ components:\ndescription: Flux query script to be analyzed\ntype: string\nQuery:\n- description: Query influx with specific return formatting.\n+ description: Query influx using the Flux language\ntype: object\nrequired:\n- query\n@@ -6276,23 +6287,29 @@ components:\ndescription: Query script to execute.\ntype: string\ntype:\n- description: The type of query.\n+ description: The type of query. Must be \"flux\".\ntype: string\n- default: flux\nenum:\n- flux\n- - influxql\n- db:\n- description: Required for `influxql` type queries.\n+ dialect:\n+ $ref: \"#/components/schemas/Dialect\"\n+ InfluxQLQuery:\n+ description: Query influx using the InfluxQL language\n+ type: object\n+ required:\n+ - query\n+ properties:\n+ query:\n+ description: InfluxQL query execute.\ntype: string\n- rp:\n- description: Required for `influxql` type queries.\n+ type:\n+ description: The type of query. Must be \"influxql\".\ntype: string\n- cluster:\n- description: Required for `influxql` type queries.\n+ enum:\n+ - influxql\n+ bucket:\n+ description: Bucket is to be used instead of the database and retention policy specified in the InfluxQL query.\ntype: string\n- dialect:\n- $ref: \"#/components/schemas/Dialect\"\nPackage:\ndescription: Represents a complete package source tree.\ntype: object\n@@ -7136,18 +7153,30 @@ components:\ntype: string\npackage:\n$ref: \"#/components/schemas/Pkg\"\n+ packages:\n+ type: array\n+ items:\n+ $ref: \"#/components/schemas/Pkg\"\nsecrets:\ntype: object\nadditionalProperties:\ntype: string\n- PkgCreate:\n+ remotes:\n+ type: array\n+ items:\ntype: object\nproperties:\n- pkgName:\n+ url:\ntype: string\n- pkgDescription:\n+ contentType:\ntype: string\n- pkgVersion:\n+ required: [\"url\"]\n+ PkgCreate:\n+ type: object\n+ properties:\n+ orgIDs:\n+ type: array\n+ items:\ntype: string\nresources:\ntype: object\n@@ -7170,6 +7199,8 @@ components:\ntype: string\nrequired: [id, kind]\nPkg:\n+ type: array\n+ items:\ntype: object\nproperties:\napiVersion:\n@@ -7177,23 +7208,26 @@ components:\nkind:\ntype: string\nenum:\n- - package\n+ - Bucket\n+ - CheckDeadman\n+ - CheckThreshold\n+ - Dashboard\n+ - Label\n+ - NotificationEndpointHTTP\n+ - NotificationEndpointPagerDuty\n+ - NotificationEndpointSlack\n+ - NotificationRule\n+ - NotificationEndpointHTTP\n+ - Task\n+ - Telegraf\n+ - Variable\nmeta:\ntype: object\nproperties:\n- description:\n- type: string\n- pkgName:\n- type: string\n- pkgVersion:\n+ name:\ntype: string\nspec:\ntype: object\n- properties:\n- resources:\n- type: array\n- items:\n- type: object\nPkgSummary:\ntype: object\nproperties:\n@@ -7270,6 +7304,10 @@ components:\ntype: string\nlabelID:\ntype: string\n+ missingEnvRefs:\n+ type: array\n+ items:\n+ type: string\nmissingSecrets:\ntype: array\nitems:\n@@ -8488,7 +8526,9 @@ components:\n- note\n- showNoteWhenEmpty\n- prefix\n+ - tickPrefix\n- suffix\n+ - tickSuffix\n- legend\n- decimalPlaces\nproperties:\n@@ -8514,8 +8554,12 @@ components:\ntype: boolean\nprefix:\ntype: string\n+ tickPrefix:\n+ type: string\nsuffix:\ntype: string\n+ tickSuffix:\n+ type: string\nlegend:\n$ref: '#/components/schemas/Legend'\ndecimalPlaces:\n@@ -8576,17 +8620,7 @@ components:\ntype: integer\nGaugeViewProperties:\ntype: object\n- required:\n- - type\n- - queries\n- - colors\n- - shape\n- - note\n- - showNoteWhenEmpty\n- - prefix\n- - suffix\n- - legend\n- - decimalPlaces\n+ required: [type, queries, colors, shape, note, showNoteWhenEmpty, prefix, tickPrefix, suffix, tickSuffix, legend, decimalPlaces]\nproperties:\ntype:\ntype: string\n@@ -8610,8 +8644,12 @@ components:\ntype: boolean\nprefix:\ntype: string\n+ tickPrefix:\n+ type: string\nsuffix:\ntype: string\n+ tickSuffix:\n+ type: string\nlegend:\n$ref: '#/components/schemas/Legend'\ndecimalPlaces:\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/src/generated/QueryAPI.ts",
"new_path": "packages/apis/src/generated/QueryAPI.ts",
"diff": "@@ -4,6 +4,7 @@ import {\nAnalyzeQueryResponse,\nFluxSuggestion,\nFluxSuggestions,\n+ InfluxQLQuery,\nLanguageRequest,\nQuery,\n} from './types'\n@@ -23,7 +24,7 @@ export interface PostQueryAnalyzeRequest {\n}\nexport interface PostQueryRequest {\n/** Flux query or specification to execute */\n- body: Query\n+ body: Query | InfluxQLQuery\n/** Specifies the name of the organization executing the query. Takes either the ID or Name interchangeably. If both `orgID` and `org` are specified, `org` takes precedence. */\norg?: string\n/** Specifies the ID of the organization executing the query. If both `orgID` and `org` are specified, `org` takes precedence. */\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/src/generated/types.ts",
"new_path": "packages/apis/src/generated/types.ts",
"diff": "@@ -769,7 +769,9 @@ export interface SingleStatViewProperties {\n/** If true, will display note when empty */\nshowNoteWhenEmpty: boolean\nprefix: string\n+ tickPrefix: string\nsuffix: string\n+ tickSuffix: string\nlegend: Legend\ndecimalPlaces: DecimalPlaces\n}\n@@ -801,7 +803,9 @@ export interface GaugeViewProperties {\n/** If true, will display note when empty */\nshowNoteWhenEmpty: boolean\nprefix: string\n+ tickPrefix: string\nsuffix: string\n+ tickSuffix: string\nlegend: Legend\ndecimalPlaces: DecimalPlaces\n}\n@@ -1468,20 +1472,14 @@ export interface Authorizations {\n}\n/**\n- * Query influx with specific return formatting.\n+ * Query influx using the Flux language\n*/\nexport interface Query {\nextern?: File\n/** Query script to execute. */\nquery: string\n- /** The type of query. */\n- type?: 'flux' | 'influxql'\n- /** Required for `influxql` type queries. */\n- db?: string\n- /** Required for `influxql` type queries. */\n- rp?: string\n- /** Required for `influxql` type queries. */\n- cluster?: string\n+ /** The type of query. Must be \"flux\". */\n+ type?: 'flux'\ndialect?: Dialect\n}\n@@ -1510,6 +1508,18 @@ export interface AnalyzeQueryResponse {\n}>\n}\n+/**\n+ * Query influx using the InfluxQL language\n+ */\n+export interface InfluxQLQuery {\n+ /** InfluxQL query execute. */\n+ query: string\n+ /** The type of query. Must be \"influxql\". */\n+ type?: 'influxql'\n+ /** Bucket is to be used instead of the database and retention policy specified in the InfluxQL query. */\n+ bucket?: string\n+}\n+\nexport interface PostBucketRequest {\norgID?: string\nname: string\n@@ -1537,9 +1547,7 @@ export interface SecretKeys {\nexport type Secrets = any\nexport interface PkgCreate {\n- pkgName?: string\n- pkgDescription?: string\n- pkgVersion?: string\n+ orgIDs?: string[]\nresources?: {\nid: string\nkind:\n@@ -1556,24 +1564,38 @@ export interface PkgCreate {\n}\n}\n-export interface Pkg {\n+export type Pkg = Array<{\napiVersion?: string\n- kind?: 'package'\n+ kind?:\n+ | 'Bucket'\n+ | 'CheckDeadman'\n+ | 'CheckThreshold'\n+ | 'Dashboard'\n+ | 'Label'\n+ | 'NotificationEndpointHTTP'\n+ | 'NotificationEndpointPagerDuty'\n+ | 'NotificationEndpointSlack'\n+ | 'NotificationRule'\n+ | 'NotificationEndpointHTTP'\n+ | 'Task'\n+ | 'Telegraf'\n+ | 'Variable'\nmeta?: {\n- description?: string\n- pkgName?: string\n- pkgVersion?: string\n- }\n- spec?: {\n- resources?: any[]\n- }\n+ name?: string\n}\n+ spec?: any\n+}>\nexport interface PkgApply {\ndryRun?: boolean\norgID?: string\npackage?: Pkg\n+ packages?: Pkg[]\nsecrets?: any\n+ remotes?: Array<{\n+ url: string\n+ contentType?: string\n+ }>\n}\nexport interface PkgSummary {\n@@ -1607,6 +1629,7 @@ export interface PkgSummary {\nlabelName?: string\nlabelID?: string\n}>\n+ missingEnvRefs?: string[]\nmissingSecrets?: string[]\nnotificationEndpoints?: Array<\nNotificationEndpointDiscrimator & {\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(api): update to the latest swagger file |
305,178 | 27.02.2020 14:04:50 | 28,800 | e78979694fb3b24f38321004b3bf930b834cb4fe | fix(package): updating name and version | [
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "{\n- \"private\": true,\n- \"name\": \"influxdb-client-monorepo\",\n- \"description\": \"InfluxDB 2.0 client monorepo\",\n+ \"name\": \"@influxdata/influx\",\n+ \"version\": \"0.6.0\",\n+ \"description\": \"InfluxDB 2.0 client\",\n\"workspaces\": {\n\"packages\": [\n\"packages/*\"\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | fix(package): updating name and version |
305,162 | 05.03.2020 12:48:35 | -3,600 | ed28258ee36cba163b2bc886fff01c67cec6cee1 | chore: single package versioning | [
{
"change_type": "MODIFY",
"old_path": "lerna.json",
"new_path": "lerna.json",
"diff": "{\n- \"version\": \"independent\",\n+ \"version\": \"0.6.0\",\n\"npmClient\": \"yarn\",\n- \"packages\": [\"packages/*\"]\n+ \"packages\": [\"packages/*\"],\n+ \"command\": {\n+ \"version\": {\n+ \"message\": \"chore(release): publish %s\"\n+ }\n+ }\n}\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore: single package versioning |
305,160 | 10.03.2020 11:13:53 | -3,600 | 447904cf3c2f7b3beecd9f405694f9650a49c4da | fixed link to write.js | [
{
"change_type": "MODIFY",
"old_path": "examples/README.md",
"new_path": "examples/README.md",
"diff": "@@ -8,7 +8,7 @@ This directory contains javascript and typescript examples for node.js and brows\n- Node.js examples\n- Change variables in [./env.js](env.js) to configure connection to your InfluxDB instance. The file can be used as-is against a new [docker influxDB v2.0 installation](https://v2.docs.influxdata.com/v2.0/get-started/)\n- Examples are executable. If it does not work for you, run `npm run ts-node EXAMPLE.ts`.\n- - [write.ts](./write.ts)\n+ - [write.js](./write.js)\nWrite data points to InfluxDB.\n- [query.ts](./query.ts)\nQuery InfluxDB with [Flux](https://v2.docs.influxdata.com/v2.0/query-data/get-started/).\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | fixed link to write.js |
305,160 | 11.03.2020 10:24:25 | -3,600 | d6f6b12d0989047e81e4404ddc0e1f9fd4f8143d | feat: add User-Agent request header | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "+## 1.1.0 [unreleased]\n+\n+### Features\n+1. [#152](https://github.com/influxdata/influxdb-client-js/issues/152): Set User-Agent to influxdb-client-js/VERSION for all requests\n+\n## 1.0.0 [2020-03-09]\n### Core\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "Makefile",
"diff": "+.DEFAULT_GOAL := help\n+\n+help:\n+ @echo \"Please use \\`make <target>' where <target> is one of\"\n+ @echo \"\"\n+ @echo \" publish to publish packages to specified version by VERSION property. make publish VERSION=1.1.0\"\n+ @echo \"\"\n+\n+publish:\n+ $(if $(VERSION),,$(error VERSION is not defined. Pass via \"make publish VERSION=1.1.0\"))\n+ git checkout master\n+ git pull\n+ yarn install --frozen-lockfile\n+ yarn run build\n+ yarn run test\n+ @echo \"Publishing $(VERSION)...\"\n+ sed -i '' -e \"s/CLIENT_LIB_VERSION = '.*'/CLIENT_LIB_VERSION = '$(VERSION)'/\" packages/core/src/impl/version.ts\n+ git commit -am \"prepare to release influxdb-client-js-$(VERSION)\"\n+ lerna publish $(VERSION)\n+ @echo \"Publish successful\"\n+ @echo \"\"\n+ @echo \"Next steps:\"\n+ @echo \" - add new version to CHANGELOG.md\"\n+ @echo \" - push changes to repository by : \\\"git commit -am 'prepare to next development iteration' && git push\\\"\"\n+ @echo \"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "@@ -85,6 +85,22 @@ Check code coverage of unit tests:\n$ yarn coverage\n```\n+## Development\n+\n+### Releasing a new version\n+\n+Ensure that:\n+\n+- You have administrator access to this repo on GitHub\n+- You have permissions to publish to the [influxdata](https://www.npmjs.com/org/influxdata) organization on npm\n+- You are on `master` and the working tree is clean\n+\n+Then run the publish script in the root of the repo:\n+\n+```\n+make publish VERSION=1.1.0\n+```\n+\n## Contributing\nIf you would like to contribute code you can do through GitHub by forking the repository and sending a pull request into the `master` branch.\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/impl/browser/FetchTransport.ts",
"new_path": "packages/core/src/impl/browser/FetchTransport.ts",
"diff": "@@ -10,6 +10,7 @@ import {ConnectionOptions} from '../../options'\nimport {HttpError} from '../../errors'\nimport completeCommunicationObserver from '../completeCommunicationObserver'\nimport Logger from '../Logger'\n+import {CLIENT_LIB_VERSION} from '../version'\n/**\n* Transport layer that use browser fetch.\n@@ -20,6 +21,7 @@ export default class FetchTransport implements Transport {\nconstructor(private connectionOptions: ConnectionOptions) {\nthis.defaultHeaders = {\n'content-type': 'application/json; charset=utf-8',\n+ 'User-Agent': `influxdb-client-js/${CLIENT_LIB_VERSION}`,\n}\nif (this.connectionOptions.token) {\nthis.defaultHeaders['Authorization'] =\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/impl/node/NodeHttpTransport.ts",
"new_path": "packages/core/src/impl/node/NodeHttpTransport.ts",
"diff": "@@ -15,6 +15,7 @@ import Cancellable from '../../util/Cancellable'\nimport nodeChunkCombiner from './nodeChunkCombiner'\nimport zlib from 'zlib'\nimport completeCommunicationObserver from '../completeCommunicationObserver'\n+import {CLIENT_LIB_VERSION} from '../version'\nconst zlibOptions = {\nflush: zlib.Z_SYNC_FLUSH,\n@@ -153,6 +154,7 @@ export class NodeHttpTransport implements Transport {\nconst bodyBuffer = Buffer.from(body, 'utf-8')\nconst headers: {[key: string]: any} = {\n'content-type': 'application/json; charset=utf-8',\n+ 'User-Agent': `influxdb-client-js/${CLIENT_LIB_VERSION}`,\n}\nif (this.connectionOptions.token) {\nheaders.authorization = 'Token ' + this.connectionOptions.token\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/core/src/impl/version.ts",
"diff": "+export const CLIENT_LIB_VERSION = '1.0.0'\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/test/unit/impl/browser/FetchTransport.test.ts",
"new_path": "packages/core/test/unit/impl/browser/FetchTransport.test.ts",
"diff": "@@ -2,6 +2,7 @@ import FetchTransport from '../../../../src/impl/browser/FetchTransport'\nimport {expect} from 'chai'\nimport {removeFetchApi, emulateFetchApi} from './emulateBrowser'\nimport sinon from 'sinon'\n+import {CLIENT_LIB_VERSION} from '../../../../src/impl/version'\ndescribe('FetchTransport', () => {\nafterEach(() => {\n@@ -16,6 +17,7 @@ describe('FetchTransport', () => {\nconst transport: any = new FetchTransport(options)\nexpect(transport.defaultHeaders).to.deep.equal({\n'content-type': 'application/json; charset=utf-8',\n+ 'User-Agent': `influxdb-client-js/${CLIENT_LIB_VERSION}`,\n})\nexpect(transport.connectionOptions).to.deep.equal(options)\n})\n@@ -27,6 +29,7 @@ describe('FetchTransport', () => {\nconst transport: any = new FetchTransport(options)\nexpect(transport.defaultHeaders).to.deep.equal({\n'content-type': 'application/json; charset=utf-8',\n+ 'User-Agent': `influxdb-client-js/${CLIENT_LIB_VERSION}`,\nAuthorization: 'Token a',\n})\nexpect(transport.connectionOptions).to.deep.equal(options)\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/test/unit/impl/node/NodeHttpTransport.test.ts",
"new_path": "packages/core/test/unit/impl/node/NodeHttpTransport.test.ts",
"diff": "@@ -9,6 +9,7 @@ import * as https from 'https'\nimport sinon from 'sinon'\nimport {Readable} from 'stream'\nimport zlib from 'zlib'\n+import {CLIENT_LIB_VERSION} from '../../../../src/impl/version'\nfunction sendTestData(\nconnectionOptions: ConnectionOptions,\n@@ -141,6 +142,10 @@ describe('NodeHttpTransport', () => {\nif (extras.token) {\ncontext.matchHeader('authorization', 'Token ' + extras.token)\n}\n+ context.matchHeader(\n+ 'User-Agent',\n+ `influxdb-client-js/${CLIENT_LIB_VERSION}`\n+ )\nlet cancellable: any\nnew NodeHttpTransport({\n...extras,\n"
},
{
"change_type": "DELETE",
"old_path": "publish.sh",
"new_path": null,
"diff": "-yarn install --frozen-lockfile && \\\n-yarn run build && \\\n-yarn run test && \\\n-lerna publish && \\\n-echo \"Publish successful\"\n\\ No newline at end of file\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat: add User-Agent request header (#156) |
305,162 | 13.03.2020 11:33:25 | -3,600 | 7e56671819b6cff086452e843f48f5f52a9b4e76 | prepare to release influxdb-client-js-1.1.0 | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "-## 1.1.0 [unreleased]\n+## 1.1.0 [2020-03-13]\n### Features\n1. [#152](https://github.com/influxdata/influxdb-client-js/issues/152): Set User-Agent to influxdb-client-js/VERSION for all requests\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/impl/version.ts",
"new_path": "packages/core/src/impl/version.ts",
"diff": "-export const CLIENT_LIB_VERSION = '1.0.0'\n+export const CLIENT_LIB_VERSION = '1.1.0'\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | prepare to release influxdb-client-js-1.1.0 |
305,162 | 13.03.2020 11:33:35 | -3,600 | 44a0fe4529638727c763283d3794da47bce17c37 | chore(release): publish v1.1.0 | [
{
"change_type": "MODIFY",
"old_path": "lerna.json",
"new_path": "lerna.json",
"diff": "{\n- \"version\": \"1.0.0\",\n+ \"version\": \"1.1.0\",\n\"npmClient\": \"yarn\",\n\"packages\": [\n\"packages/*\"\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/package.json",
"new_path": "packages/apis/package.json",
"diff": "{\n\"name\": \"@influxdata/influxdb-client-apis\",\n- \"version\": \"1.0.0\",\n+ \"version\": \"1.1.0\",\n\"description\": \"InfluxDB 2.0 generated APIs\",\n\"scripts\": {\n\"build\": \"yarn run clean && yarn run lint && rollup -c\",\n\"@influxdata/influxdb-client\": \"*\"\n},\n\"devDependencies\": {\n- \"@influxdata/influxdb-client\": \"^1.0.0\",\n+ \"@influxdata/influxdb-client\": \"^1.1.0\",\n\"@typescript-eslint/eslint-plugin\": \"^2.9.0\",\n\"@typescript-eslint/parser\": \"^2.9.0\",\n\"chalk\": \"^3.0.0\",\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/package.json",
"new_path": "packages/core/package.json",
"diff": "{\n\"name\": \"@influxdata/influxdb-client\",\n- \"version\": \"1.0.0\",\n+ \"version\": \"1.1.0\",\n\"description\": \"InfluxDB 2.0 client\",\n\"scripts\": {\n\"build\": \"yarn run clean && rollup -c\",\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore(release): publish v1.1.0 |
305,159 | 01.04.2020 22:39:54 | -7,200 | 3580bfd529b23f10e4e8a07bfb6989f5e9dd8a72 | chore: repair Makefile to include version
packages/core/src/impl/version.ts must be changed before running the build so that the new VERSION is built into distributions | [
{
"change_type": "MODIFY",
"old_path": "Makefile",
"new_path": "Makefile",
"diff": "@@ -11,10 +11,10 @@ publish:\ngit checkout master\ngit pull\nyarn install --frozen-lockfile\n+ sed -i '' -e \"s/CLIENT_LIB_VERSION = '.*'/CLIENT_LIB_VERSION = '$(VERSION)'/\" packages/core/src/impl/version.ts\nyarn run build\nyarn run test\n@echo \"Publishing $(VERSION)...\"\n- sed -i '' -e \"s/CLIENT_LIB_VERSION = '.*'/CLIENT_LIB_VERSION = '$(VERSION)'/\" packages/core/src/impl/version.ts\ngit commit -am \"prepare to release influxdb-client-js-$(VERSION)\"\nlerna publish $(VERSION)\n@echo \"Publish successful\"\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore: repair Makefile to include version
packages/core/src/impl/version.ts must be changed before running the build so that the new VERSION is built into distributions |
305,160 | 02.04.2020 07:40:19 | -7,200 | 0bb869fcfe60839cbea3b722553da90308ff842f | fix: Disabled using credentials for CORS | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "-## 1.2.0\n+## 1.2.0 [unreleased]\n+\n+### Bug\n+1. [#160](https://github.com/influxdata/influxdb-client-js/issues/160): Disabled using credentials for CORS\n### Security\n1. [#157](https://github.com/influxdata/influxdb-client-js/issues/157): [ESLint dependencies are vulnerable (ReDoS and Prototype Pollution)](https://github.com/advisories/GHSA-7fhm-mqm4-2wp7)\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/impl/browser/FetchTransport.ts",
"new_path": "packages/core/src/impl/browser/FetchTransport.ts",
"diff": "@@ -152,7 +152,7 @@ export default class FetchTransport implements Transport {\n...this.defaultHeaders,\n...headers,\n},\n- credentials: 'include' as 'include',\n+ credentials: 'omit' as 'omit',\n// allow to specify custom options, such as signal, in SendOptions\n...other,\n})\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | fix: Disabled using credentials for CORS (#161) |
305,159 | 14.04.2020 22:16:09 | -7,200 | 0dfd96a554514f933fa33843ad45c32ab32d1d47 | chore: repair doc | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/query/FluxTableColumn.ts",
"new_path": "packages/core/src/query/FluxTableColumn.ts",
"diff": "@@ -33,7 +33,7 @@ export interface FluxTableColumnLike {\ndefaultValue?: string\n}\n/**\n- * Column metadata of a flux [table](http://bit.ly/flux-spec#table).\n+ * Column metadata of a [flux table](http://bit.ly/flux-spec#table).\n*/\nexport default class FluxTableColumn {\n/**\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/query/FluxTableMetaData.ts",
"new_path": "packages/core/src/query/FluxTableMetaData.ts",
"diff": "@@ -17,7 +17,7 @@ export const typeSerializers: {[key: string]: (val: string) => any} = {\nduration: identity,\n}\n/**\n- * Represents metadata of a flux [table](http://bit.ly/flux-spec#table).\n+ * Represents metadata of a [flux table](http://bit.ly/flux-spec#table).\n*/\nexport default class FluxTableMetaData {\n/**\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore: repair doc |
305,159 | 14.04.2020 19:14:57 | -7,200 | 488917e38ce7bfdfe0b7fbed93110528a6d6487e | feat: allow to setup Point timestamp from a Date or number | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/Point.ts",
"new_path": "packages/core/src/Point.ts",
"diff": "@@ -8,7 +8,7 @@ export default class Point {\nprivate name: string\nprivate tags: {[key: string]: string} = {}\nprivate fields: {[key: string]: string} = {}\n- private time: string | undefined\n+ private time: string | number | Date | undefined\n/**\n* Create a new Point with specified a measurement name.\n@@ -118,7 +118,7 @@ export default class Point {\n* @param value point time\n* @return this\n*/\n- public timestamp(value: string | undefined): Point {\n+ public timestamp(value: string | number | Date | undefined): Point {\nthis.time = value\nreturn this\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/impl/WriteApiImpl.ts",
"new_path": "packages/core/src/impl/WriteApiImpl.ts",
"diff": "@@ -10,7 +10,7 @@ import Logger from './Logger'\nimport {HttpError, RetryDelayStrategy} from '../errors'\nimport Point from '../Point'\nimport {escape} from '../util/escape'\n-import {currentTime} from '../util/currentTime'\n+import {currentTime, dateToProtocolTimestamp} from '../util/currentTime'\nimport {createRetryDelayStrategy} from './retryStrategy'\nimport RetryBuffer from './RetryBuffer'\n@@ -66,6 +66,7 @@ export default class WriteApiImpl implements WriteApi, PointSettings {\n}\nprivate _timeoutHandle: any = undefined\nprivate currentTime: () => string\n+ private dateToProtocolTimestamp: (d: Date) => string\nretryBuffer: RetryBuffer\nretryStrategy: RetryDelayStrategy\n@@ -85,6 +86,7 @@ export default class WriteApiImpl implements WriteApi, PointSettings {\n...writeOptions,\n}\nthis.currentTime = currentTime[precision]\n+ this.dateToProtocolTimestamp = dateToProtocolTimestamp[precision]\nconst scheduleNextSend = (): void => {\nif (this.writeOptions.flushInterval > 0) {\n@@ -219,11 +221,18 @@ export default class WriteApiImpl implements WriteApi, PointSettings {\n})\nreturn this\n}\n- convertTime(value: string | undefined): string | undefined {\n- if (typeof value === 'string') {\n- return value ? value : undefined\n- } else {\n+ convertTime(value: string | number | Date | undefined): string | undefined {\n+ if (value === undefined) {\nreturn this.currentTime()\n+ } else if (value instanceof Date) {\n+ return this.dateToProtocolTimestamp(value)\n+ } else if (typeof value === 'string') {\n+ return value.length > 0 ? value : undefined\n+ } else if (typeof value === 'number') {\n+ return String(value)\n+ } else {\n+ Logger.error(`unsupported timestamp value: ${value}`)\n+ return String(value)\n}\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/options.ts",
"new_path": "packages/core/src/options.ts",
"diff": "@@ -98,5 +98,7 @@ export const enum WritePrecision {\n*/\nexport interface PointSettings {\ndefaultTags?: {[key: string]: string}\n- convertTime?: (value: string | undefined) => string | undefined\n+ convertTime?: (\n+ value: string | number | Date | undefined\n+ ) => string | undefined\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/util/currentTime.ts",
"new_path": "packages/core/src/util/currentTime.ts",
"diff": "@@ -86,3 +86,11 @@ export const currentTime = Object.freeze({\nmicros,\nnanos,\n})\n+\n+export const dateToProtocolTimestamp = {\n+ [String(WritePrecision.s)]: (d: Date): string =>\n+ `${Math.floor(d.getTime() / 1000)}`,\n+ [String(WritePrecision.ms)]: (d: Date): string => `${d.getTime()}`,\n+ [String(WritePrecision.us)]: (d: Date): string => `${d.getTime()}000`,\n+ [String(WritePrecision.ns)]: (d: Date): string => `${d.getTime()}000000`,\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/test/unit/WriteApi.test.ts",
"new_path": "packages/core/test/unit/WriteApi.test.ts",
"diff": "@@ -213,17 +213,19 @@ describe('WriteApi', () => {\nnew Point('test').floatField('value', 2),\nnew Point('test').floatField('value', 3),\nnew Point('test').floatField('value', 4).timestamp('1'),\n+ new Point('test').floatField('value', 5).timestamp(2),\n+ new Point('test').floatField('value', 6).timestamp(new Date(3)),\n+ new Point('test')\n+ .floatField('value', 7)\n+ .timestamp((false as any) as string), // wrong type from js\n])\nawait new Promise(resolve => setTimeout(resolve, 10)) // wait for background flush and HTTP to finish\n- expect(logs.error).to.length(0)\n- expect(logs.warn).to.length(2)\n- await new Promise(resolve => setTimeout(resolve, 10)) // wait for background flush\n- expect(logs.error).to.length(0)\n+ expect(logs.error).to.length(1) // true value is not a supported value\nexpect(logs.warn).to.length(2)\nexpect(messages).to.have.length(2)\nexpect(messages[0]).to.equal('test,t=\\\\ ,xtra=1 value=1')\nconst lines = messages[1].split('\\n')\n- expect(lines).has.length(3)\n+ expect(lines).has.length(6)\nexpect(lines[0]).to.satisfy((line: string) =>\nline.startsWith('test,xtra=1 value=2')\n)\n@@ -237,10 +239,9 @@ describe('WriteApi', () => {\nString(Date.now()).length + 6 // nanosecond precision\n)\nexpect(lines[2]).to.be.equal('test,xtra=1 value=4 1')\n- lines.forEach(_line => {})\n- await subject.flush().then(() => {\n- expect(logs.error).to.length(0)\n- })\n+ expect(lines[3]).to.be.equal('test,xtra=1 value=5 2')\n+ expect(lines[4]).to.be.equal('test,xtra=1 value=6 3000000')\n+ expect(lines[5]).to.be.equal('test,xtra=1 value=7 false')\n})\n})\n})\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/test/unit/util/currentTime.test.ts",
"new_path": "packages/core/test/unit/util/currentTime.test.ts",
"diff": "-import {currentTime, useProcessHrtime} from '../../../src'\n+import {\n+ currentTime,\n+ useProcessHrtime,\n+ dateToProtocolTimestamp,\n+} from '../../../src'\nimport {expect} from 'chai'\ndescribe('currentTime', () => {\n@@ -75,3 +79,13 @@ describe('currentTime', () => {\n)\n})\n})\n+\n+describe('dateToProtocolTimestamp', () => {\n+ const subject = new Date(1584294154693)\n+ expect(dateToProtocolTimestamp['s'](subject)).to.be.equal('1584294154')\n+ expect(dateToProtocolTimestamp['ms'](subject)).to.be.equal('1584294154693')\n+ expect(dateToProtocolTimestamp['us'](subject)).to.be.equal('1584294154693000')\n+ expect(dateToProtocolTimestamp['ns'](subject)).to.be.equal(\n+ '1584294154693000000'\n+ )\n+})\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat: allow to setup Point timestamp from a Date or number #171 |
305,159 | 14.04.2020 20:39:23 | -7,200 | 570db7dcd684c21b5fa932dd98c8d2e6da825244 | chore: improve inline doc | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/Point.ts",
"new_path": "packages/core/src/Point.ts",
"diff": "@@ -113,7 +113,12 @@ export default class Point {\n}\n/**\n- * Sets point time.\n+ * Sets point time. A string or number value is used\n+ * to carry an int64 value of a precision that depends\n+ * on WriteApi, nanoseconds by default. An undefined value\n+ * generates a local timestamp using the client's clock.\n+ * An empty string can be used to let the server assign\n+ * the timestamp.\n*\n* @param value point time\n* @return this\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore: improve inline doc |
305,159 | 15.04.2020 07:19:02 | -7,200 | deb38d1518ce965ad3a9c018a13c47347e7b1e38 | feat(core): allow js number in Point timestamp | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/impl/WriteApiImpl.ts",
"new_path": "packages/core/src/impl/WriteApiImpl.ts",
"diff": "@@ -224,14 +224,14 @@ export default class WriteApiImpl implements WriteApi, PointSettings {\nconvertTime(value: string | number | Date | undefined): string | undefined {\nif (value === undefined) {\nreturn this.currentTime()\n- } else if (value instanceof Date) {\n- return this.dateToProtocolTimestamp(value)\n} else if (typeof value === 'string') {\nreturn value.length > 0 ? value : undefined\n+ } else if (value instanceof Date) {\n+ return this.dateToProtocolTimestamp(value)\n} else if (typeof value === 'number') {\n- return String(value)\n+ return String(Math.floor(value))\n} else {\n- Logger.error(`unsupported timestamp value: ${value}`)\n+ // Logger.warn(`unsupported timestamp value: ${value}`)\nreturn String(value)\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/test/unit/WriteApi.test.ts",
"new_path": "packages/core/test/unit/WriteApi.test.ts",
"diff": "@@ -209,18 +209,18 @@ describe('WriteApi', () => {\nexpect(logs.error).to.length(0)\nexpect(logs.warn).to.length(1)\nsubject.writePoints([\n- new Point('test'), // will be ignored\n+ new Point('test'), // will be ignored + warning\nnew Point('test').floatField('value', 2),\nnew Point('test').floatField('value', 3),\nnew Point('test').floatField('value', 4).timestamp('1'),\n- new Point('test').floatField('value', 5).timestamp(2),\n+ new Point('test').floatField('value', 5).timestamp(2.1),\nnew Point('test').floatField('value', 6).timestamp(new Date(3)),\nnew Point('test')\n.floatField('value', 7)\n- .timestamp((false as any) as string), // wrong type from js\n+ .timestamp((false as any) as string), // server decides what to do with such values\n])\nawait new Promise(resolve => setTimeout(resolve, 10)) // wait for background flush and HTTP to finish\n- expect(logs.error).to.length(1) // true value is not a supported value\n+ expect(logs.error).to.length(0)\nexpect(logs.warn).to.length(2)\nexpect(messages).to.have.length(2)\nexpect(messages[0]).to.equal('test,t=\\\\ ,xtra=1 value=1')\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(core): allow js number in Point timestamp |
305,160 | 15.04.2020 07:59:48 | -7,200 | f8c85ca6b669148a595fc142d9f60039faf71541 | chore: deploy prerelease packages by CircleCI | [
{
"change_type": "MODIFY",
"old_path": ".circleci/config.yml",
"new_path": ".circleci/config.yml",
"diff": "@@ -61,8 +61,28 @@ jobs:\ncommand: yarn run coverage:send\n- store_artifacts:\npath: ./packages/core/coverage\n- # - store_artifacts:\n- # path: ./packages/core/.nyc_output\n+\n+ deploy-preview:\n+ parameters:\n+ docker:\n+ - image: circleci/node:12\n+ steps:\n+ - run:\n+ name: Early return if this build is from a forked repository\n+ command: |\n+ if [[ $CIRCLE_PROJECT_USERNAME != \"influxdata\" ]]; then\n+ echo \"Nothing to do for forked repositories, so marking this step successful\"\n+ circleci step halt\n+ fi\n+ - checkout\n+ - init-dependencies\n+ - run: npm install lerna\n+ - run:\n+ name: Setup npmjs\n+ command: bash .circleci/setup-npmjs.sh\n+ - run:\n+ name: Build & Deploy nightly version\n+ command: bash .circleci/deploy-nightly-version.sh\nworkflows:\nbuild:\n@@ -70,3 +90,10 @@ workflows:\n- unit-tests:\nversion: '12'\n- coverage\n+ - deploy-preview:\n+ requires:\n+ - unit-tests\n+ - coverage\n+ filters:\n+ branches:\n+ only: master\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": ".circleci/deploy-nightly-version.sh",
"diff": "+VERSION=$(cat packages/core/src/impl/version.ts | sed 's/[^0-9.]*//g' | awk -F. '{$2+=1; OFS=\".\"; print $1\".\"$2\".\"$3}')\n+sed -i -e \"s/CLIENT_LIB_VERSION = '.*'/CLIENT_LIB_VERSION = '${VERSION}.nightly'/\" packages/core/src/impl/version.ts\n+git config user.name \"CircleCI Builder\"\n+git config user.email \"[email protected]\"\n+git commit -am \"chore(release): prepare to release influxdb-client-js-${VERSION}.nightly\"\n+yarn run build\n+yarn lerna publish --canary preminor --no-git-tag-version --force-publish --preid nightly --yes\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": ".circleci/setup-npmjs.sh",
"diff": "+echo \"//registry.npmjs.org/:_authToken=$NPM_TOKEN\" >> ~/.npmrc\n+chmod 0600 ~/.npmrc\n"
},
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "1. [#157](https://github.com/influxdata/influxdb-client-js/issues/157): [ESLint dependencies are vulnerable (ReDoS and Prototype Pollution)](https://github.com/advisories/GHSA-7fhm-mqm4-2wp7)\n+### CI\n+1. [#167](https://github.com/influxdata/influxdb-client-js/pull/167): The CircleCI publish prerelease packages\n+\n## 1.1.0 [2020-03-13]\n### Features\n"
},
{
"change_type": "MODIFY",
"old_path": "Makefile",
"new_path": "Makefile",
"diff": "@@ -15,11 +15,11 @@ publish:\nyarn run build\nyarn run test\n@echo \"Publishing $(VERSION)...\"\n- git commit -am \"prepare to release influxdb-client-js-$(VERSION)\"\n+ git commit -am \"chore(release): prepare to release influxdb-client-js-$(VERSION)\"\nlerna publish $(VERSION)\n@echo \"Publish successful\"\n@echo \"\"\n@echo \"Next steps:\"\n@echo \" - add new version to CHANGELOG.md\"\n- @echo \" - push changes to repository by : \\\"git commit -am 'prepare to next development iteration' && git push\\\"\"\n+ @echo \" - push changes to repository by : \\\"git commit -am 'chore(release): prepare to next development iteration [skip CI]' && git push\\\"\"\n@echo \"\"\n"
},
{
"change_type": "MODIFY",
"old_path": "lerna.json",
"new_path": "lerna.json",
"diff": "],\n\"command\": {\n\"version\": {\n- \"message\": \"chore(release): publish %s\"\n+ \"message\": \"chore(release): publish %s [skip CI]\"\n}\n}\n}\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore: deploy prerelease packages by CircleCI (#167) |
305,160 | 16.04.2020 07:17:45 | -7,200 | f42435572c0db5a0c33276ef84c0a11d4bbff88a | docs: Clarify how to use a client with InfluxDB 1.8 | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "1. [#157](https://github.com/influxdata/influxdb-client-js/issues/157): [ESLint dependencies are vulnerable (ReDoS and Prototype Pollution)](https://github.com/advisories/GHSA-7fhm-mqm4-2wp7)\n+### Documentation\n+\n+1. [#175](https://github.com/influxdata/influxdb-client-js/pull/175): Clarify how to use a client with InfluxDB 1.8\n+\n### CI\n1. [#167](https://github.com/influxdata/influxdb-client-js/pull/167): The CircleCI publish prerelease packages\n"
},
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "@@ -68,6 +68,12 @@ See [examples](./examples/README.md)\n- [setup / onboarding](./examples/onboarding.js)\n- [health](./examples/health.js)\n+[InfluxDB 2.0 API compatibility endpoints](https://docs.influxdata.com/influxdb/v1.8/tools/api/#influxdb-2-0-api-compatibility-endpoints) are part of the InfluxDB 1.x line since InfluxDB 1.8.0.\n+This allows you to leverage InfluxDB 2.0 client libraries for both writing and querying data with Flux. For more details, see\n+\n+- [InfluxDB 1.8 example](examples/influxdb-1.8.ts)\n+- https://docs.influxdata.com/influxdb/v1.8/about_the_project/releasenotes-changelog/#forward-compatibility\n+\n## Build Requirements\n- node v12.13.1 or higher (older versions will work as well)\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/README.md",
"new_path": "examples/README.md",
"diff": "@@ -16,6 +16,8 @@ This directory contains javascript and typescript examples for node.js and brows\nCheck health fo your influx DB.\n- [onboarding.js](./onboarding.js)\nPerforms onboarding of a new influxDB database. It creates a new organization, bucket and user that is then used in all examples.\n+ - [influxdb-1.8.ts](./influxdb-1.8.ts)\n+ How to use forward compatibility APIs from InfluxDB 1.8.\n- Browser examples\n- Change `url` in [env.js](./env.js) to match your influxDB instance\n- Change `token, org, bucket, username, password` variables in [./index.html](index.html) to match your influxDB instance\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "examples/influxdb-1.8.ts",
"diff": "+#!./node_modules/.bin/ts-node\n+////////////////////////////////////////////////////////////////////\n+// Shows how to use forward compatibility APIs from InfluxDB 1.8. //\n+////////////////////////////////////////////////////////////////////\n+\n+import {ClientOptions, InfluxDB, Point} from '@influxdata/influxdb-client'\n+\n+const username = 'username'\n+const password = 'password'\n+\n+const database = 'telegraf'\n+const retentionPolicy = 'autogen'\n+\n+const bucket = `${database}/${retentionPolicy}`\n+\n+const clientOptions: ClientOptions = {\n+ url: 'http://localhost:8086',\n+ token: `${username}:${password}`,\n+}\n+\n+const influxDB = new InfluxDB(clientOptions)\n+\n+console.log('*** WRITE POINTS ***')\n+\n+const writeAPI = influxDB.getWriteApi('', bucket)\n+const point = new Point('mem')\n+ .tag('host', 'host1')\n+ .floatField('used_percent', 23.43234543)\n+writeAPI.writePoint(point)\n+writeAPI\n+ .close()\n+ .then(() => console.log('FINISHED'))\n+ .catch(error => {\n+ console.error(error)\n+ })\n+\n+console.log('*** QUERY ROWS ***')\n+\n+const queryAPI = influxDB.getQueryApi('')\n+const query = `from(bucket: \"${bucket}\") |> range(start: -1h)`\n+queryAPI.queryRows(query, {\n+ next(row, tableMeta) {\n+ const o = tableMeta.toObject(row)\n+ console.log(`${o._time} ${o._measurement} : ${o._field}=${o._value}`)\n+ },\n+ error(error) {\n+ console.error(error)\n+ },\n+ complete() {\n+ console.log('\\nFinished')\n+ },\n+})\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | docs: Clarify how to use a client with InfluxDB 1.8 (#175) |
305,159 | 21.04.2020 06:53:09 | -7,200 | 0823b4996a4ce5c001b3c6f0f0f9b96df9749b38 | fix(tests): add integration tests to coverage | [
{
"change_type": "MODIFY",
"old_path": "packages/core/package.json",
"new_path": "packages/core/package.json",
"diff": "\"build:doc\": \"yarn run clean && yarn typedoc\",\n\"clean\": \"rimraf dist build coverage .nyc_output doc *.lcov reports\",\n\"coverage:send\": \"nyc report --reporter=text-lcov > coverage/coverage.lcov && codecov --root=../..\",\n- \"coverage\": \"nyc mocha --require ts-node/register 'test/unit/**/*.test.ts' --exit\",\n+ \"coverage\": \"nyc mocha --require ts-node/register 'test/**/*.test.ts' --exit\",\n\"test\": \"yarn run lint && yarn run typecheck && yarn run test:unit\",\n\"test:unit\": \"mocha --require ts-node/register 'test/unit/**/*.test.ts' --exit\",\n\"test:integration\": \"mocha --require ts-node/register 'test/integration/**/*.test.ts' --exit\",\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | fix(tests): add integration tests to coverage |
305,159 | 21.04.2020 07:02:11 | -7,200 | af89cdec1495f047bcaef47fd46a83de1a0d5124 | chore(examples): finalize rxjs-query example | [
{
"change_type": "MODIFY",
"old_path": "examples/README.md",
"new_path": "examples/README.md",
"diff": "@@ -18,6 +18,8 @@ This directory contains javascript and typescript examples for node.js and brows\nPerforms onboarding of a new influxDB database. It creates a new organization, bucket and user that is then used in all examples.\n- [influxdb-1.8.ts](./influxdb-1.8.ts)\nHow to use forward compatibility APIs from InfluxDB 1.8.\n+ - [rxjs-query.ts](./rxjs-query.ts)\n+ Use [RxJS](https://rxjs.dev/) to query InfluxDB with [Flux](https://v2.docs.influxdata.com/v2.0/query-data/get-started/).\n- Browser examples\n- Change `url` in [env.js](./env.js) to match your influxDB instance\n- Change `token, org, bucket, username, password` variables in [./index.html](index.html) to match your influxDB instance\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/package.json",
"new_path": "examples/package.json",
"diff": "\"express\": \"^4.17.1\",\n\"express-http-proxy\": \"^1.6.0\",\n\"open\": \"^7.0.0\",\n+ \"rxjs\": \"^6.5.5\",\n\"ts-node\": \"^8.5.4\",\n\"typescript\": \"^3.7.4\"\n}\n"
},
{
"change_type": "RENAME",
"old_path": "examples/rxjs.ts",
"new_path": "examples/rxjs-query.ts",
"diff": ""
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore(examples): finalize rxjs-query example |
305,159 | 21.04.2020 07:14:56 | -7,200 | 2c78947f26037a8c35f6410110b56ce814868ffb | chore(tests): include integration tests in CI | [
{
"change_type": "MODIFY",
"old_path": ".circleci/config.yml",
"new_path": ".circleci/config.yml",
"diff": "@@ -30,7 +30,7 @@ jobs:\nname: Run tests\ncommand: |\ncd ./packages/core\n- yarn test:unit:ci\n+ yarn test:ci\nyarn lint:ci\nyarn build\ncd ../apis\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/package.json",
"new_path": "packages/core/package.json",
"diff": "\"clean\": \"rimraf dist build coverage .nyc_output doc *.lcov reports\",\n\"coverage:send\": \"nyc report --reporter=text-lcov > coverage/coverage.lcov && codecov --root=../..\",\n\"coverage\": \"nyc mocha --require ts-node/register 'test/**/*.test.ts' --exit\",\n- \"test\": \"yarn run lint && yarn run typecheck && yarn run test:unit\",\n+ \"test\": \"yarn run lint && yarn run typecheck && yarn run test:all\",\n+ \"test:all\": \"mocha --require ts-node/register 'test/**/*.test.ts' --exit\",\n\"test:unit\": \"mocha --require ts-node/register 'test/unit/**/*.test.ts' --exit\",\n\"test:integration\": \"mocha --require ts-node/register 'test/integration/**/*.test.ts' --exit\",\n- \"test:unit:ci\": \"yarn run test:unit --exit --reporter mocha-junit-reporter --reporter-options mochaFile=reports/mocha/test-results.xml\",\n+ \"test:ci\": \"yarn run test:all --exit --reporter mocha-junit-reporter --reporter-options mochaFile=reports/mocha/test-results.xml\",\n\"test:watch\": \"mocha --require ts-node/register 'test/unit/**/*.test.ts' --watch-extensions ts --watch\",\n\"typecheck\": \"tsc --noEmit --pretty\",\n\"typedoc\": \"typedoc --excludePrivate --excludeNotExported --mode file --out ./reports/apidoc --module es2015 --tsconfig ./tsconfig.json ./src\",\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore(tests): include integration tests in CI |
305,159 | 21.04.2020 08:46:13 | -7,200 | b0f4a03cf8bec8df96008a80c0e5ba12e6ab872b | feat(tests): complete tests of query API's observables | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/impl/ObservableQuery.ts",
"new_path": "packages/core/src/impl/ObservableQuery.ts",
"diff": "@@ -48,6 +48,7 @@ class QuerySubscription implements Subscription {\npublic unsubscribe(): void {\nthis.cancellable?.cancel()\n+ this.isClosed = true\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/test/integration/rxjs/QueryApi.test.ts",
"new_path": "packages/core/test/integration/rxjs/QueryApi.test.ts",
"diff": "@@ -44,6 +44,24 @@ describe('RxJS QueryApi integration', () => {\nexpect(lines).to.deep.equal(simpleResponseLines)\n})\n+ it('receives error', async () => {\n+ const subject = new InfluxDB(clientOptions).getQueryApi(ORG).with({})\n+ nock(clientOptions.url)\n+ .post(QUERY_PATH)\n+ .reply((_uri, _requestBody) => {\n+ return [500, 'Error', {}]\n+ })\n+ .persist()\n+\n+ try {\n+ await from(subject.rows('from(bucket:\"my-bucket\") |> range(start: 0)'))\n+ .pipe(toArray())\n+ .toPromise()\n+ expect.fail('Server return 500, but it did not fail!')\n+ } catch (_) {\n+ // expected failure\n+ }\n+ })\n;[\n['response2', undefined],\n['response2', true],\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/core/test/unit/impl/ObservableQuery.test.ts",
"diff": "+import {expect} from 'chai'\n+import ObservableQuery from '../../../src/impl/ObservableQuery'\n+import {CommunicationObserver} from '../../../src'\n+import completeCommunicationObserver from '../../../src/impl/completeCommunicationObserver'\n+import {Observer} from '../../../src/observable'\n+\n+class TestSubscriber implements Observer<string> {\n+ results: string[] = []\n+ next(s: string): void {\n+ this.results.push(s)\n+ }\n+ error(_: any): void {\n+ this.results.push('error')\n+ }\n+ complete(): void {\n+ this.results.push('complete')\n+ }\n+}\n+\n+describe('ObservableQuery', () => {\n+ it('sequence complete', async () => {\n+ let source: CommunicationObserver<string> = completeCommunicationObserver(\n+ {}\n+ ) // source is assigned by subject.subscribe\n+ const subject = new ObservableQuery<string>(\n+ consumer => (source = consumer),\n+ x => x\n+ )\n+ const subscriber = new TestSubscriber()\n+ const subscription = subject.subscribe(subscriber)\n+ expect(subscription.closed).deep.equals(false)\n+ source.next('next')\n+ source.next('next')\n+ source.complete()\n+ expect(subscription.closed).equals(true)\n+ expect(['next', 'next', 'complete']).deep.equals(subscriber.results)\n+ })\n+ it('sequence error', async () => {\n+ let source: CommunicationObserver<string> = completeCommunicationObserver(\n+ {}\n+ )\n+ const subject = new ObservableQuery<string>(\n+ consumer => (source = consumer),\n+ x => x\n+ )\n+ const subscriber = new TestSubscriber()\n+ const subscription = subject.subscribe(subscriber)\n+ expect(subscription.closed).equals(false)\n+ source.next('next')\n+ source.next('next')\n+ source.error(new Error())\n+ expect(subscription.closed).equals(true)\n+ expect(['next', 'next', 'error']).deep.equals(subscriber.results)\n+ })\n+ it('unsubscribed', async () => {\n+ let source: CommunicationObserver<string> = completeCommunicationObserver(\n+ {}\n+ )\n+ const subject = new ObservableQuery<string>(\n+ consumer => (source = consumer),\n+ x => x\n+ )\n+ const subscriber = new TestSubscriber()\n+ const subscription = subject.subscribe(subscriber)\n+ expect(subscription.closed).equals(false)\n+ source.next('next')\n+ subscription.unsubscribe()\n+ expect(subscription.closed).equals(true)\n+ expect(['next']).deep.equals(subscriber.results)\n+ })\n+ it('executor error', async () => {\n+ const subject = new ObservableQuery<string>(\n+ () => {\n+ throw new Error()\n+ },\n+ x => x\n+ )\n+ const subscriber = new TestSubscriber()\n+ const subscription = subject.subscribe(subscriber)\n+ expect(subscription.closed).equals(true)\n+ expect(['error']).deep.equals(subscriber.results)\n+ })\n+ it('subscriber methods are optional', async () => {\n+ let source: CommunicationObserver<string> = completeCommunicationObserver(\n+ {}\n+ ) // source is assigned by subject.subscribe\n+ const subject = new ObservableQuery<string>(\n+ consumer => (source = consumer),\n+ x => x\n+ )\n+ const s1 = subject.subscribe({})\n+ source.next('next')\n+ source.complete()\n+ expect(s1.closed).equals(true)\n+\n+ const s2 = subject.subscribe((null as any) as Observer<string>)\n+ source.next('next')\n+ source.error(new Error())\n+ expect(s2.closed).equals(true)\n+\n+ let called = false\n+ const s3 = subject.subscribe(_ => (called = true))\n+ source.next('next')\n+ source.complete()\n+ expect(called).equals(true)\n+ expect(s3.closed).equals(true)\n+ })\n+})\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(tests): complete tests of query API's observables |
305,159 | 21.04.2020 09:22:51 | -7,200 | 5e241a5ae1f0b2b77495c5f074b72eca41e1ac9a | chore(doc): add more doc | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/QueryApi.ts",
"new_path": "packages/core/src/QueryApi.ts",
"diff": "@@ -29,6 +29,7 @@ export interface QueryOptions {\ngzip?: boolean\n}\n+/** Wraps values and associated metadata of a query result row */\nexport interface Row {\nvalues: string[]\ntableMeta: FluxTableMetaData\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/test/integration/rxjs/QueryApi.test.ts",
"new_path": "packages/core/test/integration/rxjs/QueryApi.test.ts",
"diff": "@@ -57,7 +57,7 @@ describe('RxJS QueryApi integration', () => {\nawait from(subject.rows('from(bucket:\"my-bucket\") |> range(start: 0)'))\n.pipe(toArray())\n.toPromise()\n- expect.fail('Server return 500, but it did not fail!')\n+ expect.fail('Server returned 500!')\n} catch (_) {\n// expected failure\n}\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore(doc): add more doc |
305,159 | 21.04.2020 09:23:23 | -7,200 | 1da798c3ccd76e5f10c7b83ef87536afed511b71 | chore(dist): export query Row from main index | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/index.ts",
"new_path": "packages/core/src/index.ts",
"diff": "@@ -6,5 +6,5 @@ export * from './query'\nexport * from './transport'\nexport {default as Point} from './Point'\nexport {default as InfluxDB} from './InfluxDB'\n-export {default as QueryApi} from './QueryApi'\n+export {default as QueryApi, Row} from './QueryApi'\nexport {default as WriteApi} from './WriteApi'\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore(dist): export query Row from main index |
305,160 | 30.04.2020 08:57:23 | -7,200 | 9ca9c24e40c8e11b3d2d07a0d036cef436c43656 | chore(dependency): updated typedoc to avoid security alerts | [
{
"change_type": "MODIFY",
"old_path": "packages/core/package.json",
"new_path": "packages/core/package.json",
"diff": "\"rxjs\": \"^6.5.5\",\n\"sinon\": \"^7.5.0\",\n\"ts-node\": \"^8.5.4\",\n- \"typedoc\": \"^0.15.3\",\n+ \"typedoc\": \"^0.17.6\",\n\"typescript\": \"^3.7.4\",\n\"version-bump-prompt\": \"^5.0.6\"\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "yarn.lock",
"new_path": "yarn.lock",
"diff": "resolved \"https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.4.tgz#38fd73ddfd9b55abb1e1b2ed578cb55bd7b7d339\"\nintegrity sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==\n-\"@types/minimatch@*\", \"@types/[email protected]\":\n+\"@types/minimatch@*\":\nversion \"3.0.3\"\nresolved \"https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d\"\nintegrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==\n@@ -1429,13 +1429,6 @@ aws4@^1.8.0:\nresolved \"https://registry.yarnpkg.com/aws4/-/aws4-1.9.1.tgz#7e33d8f7d449b3f673cd72deb9abdc552dbe528e\"\nintegrity sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==\n-backbone@^1.4.0:\n- version \"1.4.0\"\n- resolved \"https://registry.yarnpkg.com/backbone/-/backbone-1.4.0.tgz#54db4de9df7c3811c3f032f34749a4cd27f3bd12\"\n- integrity sha512-RLmDrRXkVdouTg38jcgHhyQ/2zjg7a8E6sz2zxfz21Hh17xDJYUHBZimVIt5fUyS8vbfpeSmTL3gUjTEvUV3qQ==\n- dependencies:\n- underscore \">=1.8.3\"\n-\nbalanced-match@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767\"\n@@ -3089,7 +3082,7 @@ [email protected]:\nresolved \"https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e\"\nintegrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==\n-handlebars@^4.4.0, handlebars@^4.7.0:\n+handlebars@^4.4.0:\nversion \"4.7.3\"\nresolved \"https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.3.tgz#8ece2797826886cf8082d1726ff21d2a022550ee\"\nintegrity sha512-SRGwSYuNfx8DwHD/6InAPzD6RgeruWLT+B8e8a7gGs8FWgHzlExpTFMEq2IA6QpAfOClpKHy6+8IqTjeBCu6Kg==\n@@ -3100,6 +3093,18 @@ handlebars@^4.4.0, handlebars@^4.7.0:\noptionalDependencies:\nuglify-js \"^3.1.4\"\n+handlebars@^4.7.6:\n+ version \"4.7.6\"\n+ resolved \"https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.6.tgz#d4c05c1baf90e9945f77aa68a7a219aa4a7df74e\"\n+ integrity sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==\n+ dependencies:\n+ minimist \"^1.2.5\"\n+ neo-async \"^2.6.0\"\n+ source-map \"^0.6.1\"\n+ wordwrap \"^1.0.0\"\n+ optionalDependencies:\n+ uglify-js \"^3.1.4\"\n+\nhar-schema@^2.0.0:\nversion \"2.0.0\"\nresolved \"https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92\"\n@@ -3183,10 +3188,10 @@ [email protected]:\nresolved \"https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f\"\nintegrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==\n-highlight.js@^9.17.1:\n- version \"9.18.1\"\n- resolved \"https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.18.1.tgz#ed21aa001fe6252bb10a3d76d47573c6539fe13c\"\n- integrity sha512-OrVKYz70LHsnCgmbXctv/bfuvntIKDz177h0Co37DQ5jamGZLVmoCVMtjMtNZY3X9DrCcKfklHPNeA0uPZhSJg==\n+highlight.js@^10.0.0:\n+ version \"10.0.1\"\n+ resolved \"https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.0.1.tgz#32ba25ee532291b86d1480b809a7e38bcd7f6dfe\"\n+ integrity sha512-l1HB5S9nmBuvurFIOPbpeJv4psKh2MyKCTOYRK/E6dwRXkbG96PLH7amP/xpGNyZOK8OWqv45DxLS/ZAIb3n9w==\nhosted-git-info@^2.1.4, hosted-git-info@^2.7.1:\nversion \"2.8.8\"\n@@ -3729,11 +3734,6 @@ jest-worker@^24.9.0:\nmerge-stream \"^2.0.0\"\nsupports-color \"^6.1.0\"\n-jquery@^3.4.1:\n- version \"3.4.1\"\n- resolved \"https://registry.yarnpkg.com/jquery/-/jquery-3.4.1.tgz#714f1f8d9dde4bdfa55764ba37ef214630d80ef2\"\n- integrity sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==\n-\njs-tokens@^4.0.0:\nversion \"4.0.0\"\nresolved \"https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499\"\n@@ -4117,10 +4117,10 @@ map-visit@^1.0.0:\ndependencies:\nobject-visit \"^1.0.0\"\n-marked@^0.8.0:\n- version \"0.8.0\"\n- resolved \"https://registry.yarnpkg.com/marked/-/marked-0.8.0.tgz#ec5c0c9b93878dc52dd54be8d0e524097bd81a99\"\n- integrity sha512-MyUe+T/Pw4TZufHkzAfDj6HarCBWia2y27/bhuYkTaiUnfDYFnCP3KUN+9oM7Wi6JA2rymtVYbQu3spE0GCmxQ==\[email protected]:\n+ version \"1.0.0\"\n+ resolved \"https://registry.yarnpkg.com/marked/-/marked-1.0.0.tgz#d35784245a04871e5988a491e28867362e941693\"\n+ integrity sha512-Wo+L1pWTVibfrSr+TTtMuiMfNzmZWiOPeO7rZsQUY5bgsxpHesBEcIWJloWVTFnrMXnf/TL30eTFSGJddmQAng==\nmd5@^2.1.0:\nversion \"2.2.1\"\n@@ -4258,7 +4258,7 @@ minimist-options@^3.0.1:\narrify \"^1.0.1\"\nis-plain-obj \"^1.1.0\"\[email protected], minimist@>=1.2.2, minimist@^1.1.3, minimist@^1.2.0, minimist@~0.0.1:\[email protected], minimist@>=1.2.2, minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.5, minimist@~0.0.1:\nversion \"1.2.5\"\nresolved \"https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602\"\nintegrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==\n@@ -5662,10 +5662,10 @@ shebang-regex@^3.0.0:\nresolved \"https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172\"\nintegrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==\n-shelljs@^0.8.3:\n- version \"0.8.3\"\n- resolved \"https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.3.tgz#a7f3319520ebf09ee81275b2368adb286659b097\"\n- integrity sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A==\n+shelljs@^0.8.4:\n+ version \"0.8.4\"\n+ resolved \"https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2\"\n+ integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==\ndependencies:\nglob \"^7.0.0\"\ninterpret \"^1.0.0\"\n@@ -6363,37 +6363,28 @@ typedarray@^0.0.6:\nresolved \"https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777\"\nintegrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=\n-typedoc-default-themes@^0.6.3:\n- version \"0.6.3\"\n- resolved \"https://registry.yarnpkg.com/typedoc-default-themes/-/typedoc-default-themes-0.6.3.tgz#c214ce5bbcc6045558448a8fd422b90e3e9b6782\"\n- integrity sha512-rouf0TcIA4M2nOQFfC7Zp4NEwoYiEX4vX/ZtudJWU9IHA29MPC+PPgSXYLPESkUo7FuB//GxigO3mk9Qe1xp3Q==\n+typedoc-default-themes@^0.10.1:\n+ version \"0.10.1\"\n+ resolved \"https://registry.yarnpkg.com/typedoc-default-themes/-/typedoc-default-themes-0.10.1.tgz#eb27b7d689457c7ec843e47ec0d3e500581296a7\"\n+ integrity sha512-SuqAQI0CkwhqSJ2kaVTgl37cWs733uy9UGUqwtcds8pkFK8oRF4rZmCq+FXTGIb9hIUOu40rf5Kojg0Ha6akeg==\ndependencies:\n- backbone \"^1.4.0\"\n- jquery \"^3.4.1\"\nlunr \"^2.3.8\"\n- underscore \"^1.9.1\"\n-typedoc@^0.15.3:\n- version \"0.15.8\"\n- resolved \"https://registry.yarnpkg.com/typedoc/-/typedoc-0.15.8.tgz#d83195445a718d173e0d5c73b5581052cb47d4d9\"\n- integrity sha512-a0zypcvfIFsS7Gqpf2MkC1+jNND3K1Om38pbDdy/gYWX01NuJZhC5+O0HkIp0oRIZOo7PWrA5+fC24zkANY28Q==\n+typedoc@^0.17.6:\n+ version \"0.17.6\"\n+ resolved \"https://registry.yarnpkg.com/typedoc/-/typedoc-0.17.6.tgz#cab87a72c10e05429016d659a4c3071a5a3ffb61\"\n+ integrity sha512-pQiYnhG3yJk7939cv2n8uFoTsSgy5Hfiw0dgOQYa9nT9Ya1013dMctQdAXMj8JbNu7KhcauQyq9Zql9D/TziLw==\ndependencies:\n- \"@types/minimatch\" \"3.0.3\"\nfs-extra \"^8.1.0\"\n- handlebars \"^4.7.0\"\n- highlight.js \"^9.17.1\"\n+ handlebars \"^4.7.6\"\n+ highlight.js \"^10.0.0\"\nlodash \"^4.17.15\"\n- marked \"^0.8.0\"\n+ lunr \"^2.3.8\"\n+ marked \"1.0.0\"\nminimatch \"^3.0.0\"\nprogress \"^2.0.3\"\n- shelljs \"^0.8.3\"\n- typedoc-default-themes \"^0.6.3\"\n- typescript \"3.7.x\"\n-\[email protected]:\n- version \"3.7.5\"\n- resolved \"https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae\"\n- integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==\n+ shelljs \"^0.8.4\"\n+ typedoc-default-themes \"^0.10.1\"\ntypescript@^3.7.4:\nversion \"3.8.3\"\n@@ -6423,11 +6414,6 @@ umask@^1.1.0:\nresolved \"https://registry.yarnpkg.com/umask/-/umask-1.1.0.tgz#f29cebf01df517912bb58ff9c4e50fde8e33320d\"\nintegrity sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0=\n-underscore@>=1.8.3, underscore@^1.9.1:\n- version \"1.9.2\"\n- resolved \"https://registry.yarnpkg.com/underscore/-/underscore-1.9.2.tgz#0c8d6f536d6f378a5af264a72f7bec50feb7cf2f\"\n- integrity sha512-D39qtimx0c1fI3ya1Lnhk3E9nONswSKhnffBI0gME9C99fYOkNi04xs8K6pePLhvl1frbDemkaBQ5ikWllR2HQ==\n-\nunion-value@^1.0.0:\nversion \"1.0.1\"\nresolved \"https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847\"\n@@ -6625,6 +6611,11 @@ word-wrap@~1.2.3:\nresolved \"https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c\"\nintegrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==\n+wordwrap@^1.0.0:\n+ version \"1.0.0\"\n+ resolved \"https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb\"\n+ integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=\n+\nwordwrap@~0.0.2:\nversion \"0.0.3\"\nresolved \"https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107\"\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore(dependency): updated typedoc to avoid security alerts (#180) |
305,159 | 30.04.2020 21:12:16 | -7,200 | 80151978a64f70be5d9e118c0904d0261fa0eab8 | feat(apis): update generator to skip import of anynymous types | [
{
"change_type": "MODIFY",
"old_path": "packages/apis/generator/typesCollector.ts",
"new_path": "packages/apis/generator/typesCollector.ts",
"diff": "@@ -5,7 +5,9 @@ export default class TypesCollector {\ntypes: {[key: string]: boolean} = {}\nadd(type: string): void {\nif (type && type.charAt(0).toUpperCase() === type.charAt(0)) {\n- if (type.includes('|')) {\n+ if (type.startsWith('{')) {\n+ // ignore anonymous types\n+ } else if (type.includes('|')) {\ntype\n.split('|')\n.map(x => x.trim())\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(apis): update generator to skip import of anynymous types |
305,159 | 30.04.2020 22:10:23 | -7,200 | bfa40a8a74ba39cd81e995e801eae8ea939a9dc7 | feat(apis): import types referenced from anonymous type | [
{
"change_type": "MODIFY",
"old_path": "packages/apis/generator/typesCollector.ts",
"new_path": "packages/apis/generator/typesCollector.ts",
"diff": "@@ -6,12 +6,19 @@ export default class TypesCollector {\nadd(type: string): void {\nif (type && type.charAt(0).toUpperCase() === type.charAt(0)) {\nif (type.startsWith('{')) {\n- // ignore anonymous types\n+ // anonymous type, process references inside anonymous types\n+ // see typesCollector.test.ts\n+ const customTypeRegExp = / ([A-Z][A-Za-z0-9-_| ]*);\\n/g\n+ let match: RegExpExecArray | null\n+ while ((match = customTypeRegExp.exec(type)) !== null) {\n+ // console.log('match[1]', match[1], customTypeRegExp.lastIndex)\n+ this.add(match[1])\n+ }\n} else if (type.includes('|')) {\ntype\n.split('|')\n.map(x => x.trim())\n- .forEach(x => (this.types[x] = true))\n+ .forEach(x => this.add(x))\n} else {\nthis.types[type] = true\n}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/apis/test/unit/typesCollector.test.ts",
"diff": "+import {expect} from 'chai'\n+import TypesCollector from '../../generator/typesCollector'\n+\n+interface TypesCollectorTest {\n+ name: string\n+ toAdd: Array<string>\n+ result: string\n+}\n+\n+describe('TypesCollector', () => {\n+ const tests: TypesCollectorTest[] = [\n+ {\n+ name: 'collect built-in types',\n+ toAdd: ['string', 'any', 'boolean', 'void'],\n+ result: '',\n+ },\n+ {\n+ name: 'collect custom types',\n+ toAdd: ['C', 'B', 'A', 'B'],\n+ result: 'A, B, C',\n+ },\n+ {\n+ name: 'collect custom alternative types',\n+ toAdd: ['C | B | A', 'B'],\n+ result: 'A, B, C',\n+ },\n+ {\n+ name: 'collect anonymous type 1',\n+ toAdd: [\n+ '{\\n /** optional, when provided will replace the name */\\n name?: string;\\n /** optional, when provided will replace the description */\\n description?: string;\\n /** optional, when provided will replace all existing cells with the cells provided */\\n cells?: CellWithViewProperties;\\n}',\n+ ],\n+ result: 'CellWithViewProperties',\n+ },\n+ {\n+ name: 'collect anonymous type 2',\n+ toAdd: ['{\\n d?: D | C;\\n description?: A;\\n name?: string;\\n}'],\n+ result: 'A, C, D',\n+ },\n+ ]\n+ tests.forEach(test => {\n+ it(test.name, () => {\n+ const collector = new TypesCollector()\n+ test.toAdd.forEach(collector.add.bind(collector))\n+ const result = collector.toString()\n+ expect(result).equals(test.result)\n+ expect(collector.hasTypes()).equals(result !== '')\n+ })\n+ })\n+})\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(apis): import types referenced from anonymous type |
305,159 | 30.04.2020 22:13:30 | -7,200 | 6e7cc8104e1a243f9f3e93c60396ee418de4431b | feat(apis): regenerate APIs from 2020-04-30 swagger | [
{
"change_type": "MODIFY",
"old_path": "packages/apis/generator/typesCollector.ts",
"new_path": "packages/apis/generator/typesCollector.ts",
"diff": "@@ -6,7 +6,7 @@ export default class TypesCollector {\nadd(type: string): void {\nif (type && type.charAt(0).toUpperCase() === type.charAt(0)) {\nif (type.startsWith('{')) {\n- // anonymous type, process references inside anonymous types\n+ // anonymous type; process references to custom types in it\n// see typesCollector.test.ts\nconst customTypeRegExp = / ([A-Z][A-Za-z0-9-_| ]*);\\n/g\nlet match: RegExpExecArray | null\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/package.json",
"new_path": "packages/apis/package.json",
"diff": "\"clean\": \"rimraf build doc dist\",\n\"clean:apis\": \"rimraf src/generated/*API.ts\",\n\"generate\": \"yarn ts-node generator && yarn prettier --write src/generated/*.ts\",\n- \"test\": \"yarn run lint && yarn run typecheck\",\n+ \"test\": \"yarn run lint && yarn run typecheck && yarn run test:unit\",\n+ \"test:unit\": \"mocha --require ts-node/register 'test/unit/**/*.test.ts' --exit\",\n\"typecheck\": \"tsc --noEmit --pretty\",\n\"typedoc\": \"typedoc --excludePrivate --excludeNotExported --mode file --out ./doc/apidoc --module es2015 --tsconfig ./tsconfig.json ./src\",\n\"lint\": \"eslint 'src/**/*.ts'\",\n\"@influxdata/influxdb-client\": \"^1.2.0\",\n\"@typescript-eslint/eslint-plugin\": \"^2.9.0\",\n\"@typescript-eslint/parser\": \"^2.9.0\",\n+ \"chai\": \"^4.2.0\",\n\"chalk\": \"^3.0.0\",\n\"eslint\": \"^6.7.1\",\n\"eslint-config-prettier\": \"^6.7.0\",\n\"eslint-plugin-prettier\": \"^3.1.1\",\n+ \"mocha\": \"^6.2.2\",\n\"prettier\": \"^1.19.1\",\n\"rimraf\": \"^3.0.0\",\n\"rollup\": \"^1.27.5\",\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/resources/operations.json",
"new_path": "packages/apis/resources/operations.json",
"diff": "\"description\": \"Patching of a dashboard\",\n\"required\": true,\n\"mediaType\": \"application/json\",\n- \"type\": \"Dashboard\"\n+ \"type\": \"{\\n /** optional, when provided will replace the name */\\n name?: string;\\n /** optional, when provided will replace the description */\\n description?: string;\\n /** optional, when provided will replace all existing cells with the cells provided */\\n cells?: CellWithViewProperties;\\n}\"\n},\n\"responses\": [\n{\n\"name\": \"orgID\",\n\"description\": \"Filter organizations to a specific organization ID.\",\n\"type\": \"string\"\n+ },\n+ {\n+ \"name\": \"userID\",\n+ \"description\": \"Filter organizations to a specific user ID.\",\n+ \"type\": \"string\"\n}\n],\n\"bodyParam\": null,\n}\n]\n},\n+ {\n+ \"server\": \"/api/v2\",\n+ \"path\": \"/packages/stacks\",\n+ \"operation\": \"post\",\n+ \"operationId\": \"CreateStack\",\n+ \"basicAuth\": false,\n+ \"summary\": \"Create a new Influx package\",\n+ \"positionalParams\": [],\n+ \"headerParams\": [],\n+ \"queryParams\": [],\n+ \"bodyParam\": {\n+ \"description\": \"Influx package to create.\",\n+ \"required\": true,\n+ \"mediaType\": \"application/json\",\n+ \"type\": \"{\\n orgID?: string;\\n name?: string;\\n description?: string;\\n urls?: string[];\\n}\"\n+ },\n+ \"responses\": [\n+ {\n+ \"code\": \"201\",\n+ \"description\": \"Influx stack created\",\n+ \"mediaTypes\": [\n+ {\n+ \"mediaType\": \"application/json\",\n+ \"type\": \"{\\n id?: string;\\n orgID?: string;\\n name?: string;\\n description?: string;\\n urls?: string[];\\n readonly createdAt?: string;\\n readonly updatedAt?: string;\\n}\"\n+ }\n+ ]\n+ },\n+ {\n+ \"code\": \"default\",\n+ \"description\": \"Unexpected error\",\n+ \"mediaTypes\": [\n+ {\n+ \"mediaType\": \"application/json\",\n+ \"type\": \"Error\"\n+ }\n+ ]\n+ }\n+ ]\n+ },\n{\n\"server\": \"/api/v2\",\n\"path\": \"/tasks\",\n}\n]\n},\n+ {\n+ \"server\": \"/api/v2\",\n+ \"path\": \"/flags\",\n+ \"operation\": \"get\",\n+ \"operationId\": \"GetFlags\",\n+ \"basicAuth\": false,\n+ \"summary\": \"Return the feature flags for the currently authenticated user\",\n+ \"positionalParams\": [],\n+ \"headerParams\": [\n+ {\n+ \"name\": \"Zap-Trace-Span\",\n+ \"description\": \"OpenTracing span context\",\n+ \"required\": false,\n+ \"type\": \"string\"\n+ }\n+ ],\n+ \"queryParams\": [],\n+ \"bodyParam\": null,\n+ \"responses\": [\n+ {\n+ \"code\": \"200\",\n+ \"description\": \"Feature flags for the currently authenticated user\",\n+ \"mediaTypes\": [\n+ {\n+ \"mediaType\": \"application/json\",\n+ \"type\": \"Flags\"\n+ }\n+ ]\n+ },\n+ {\n+ \"code\": \"default\",\n+ \"description\": \"Unexpected error\",\n+ \"mediaTypes\": [\n+ {\n+ \"mediaType\": \"application/json\",\n+ \"type\": \"Error\"\n+ }\n+ ]\n+ }\n+ ]\n+ },\n{\n\"server\": \"/api/v2\",\n\"path\": \"/me\",\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/resources/swagger.yml",
"new_path": "packages/apis/resources/swagger.yml",
"diff": "@@ -2282,7 +2282,17 @@ paths:\ncontent:\napplication/json:\nschema:\n- $ref: \"#/components/schemas/Dashboard\"\n+ type: object\n+ properties:\n+ name:\n+ description: optional, when provided will replace the name\n+ type: string\n+ description:\n+ description: optional, when provided will replace the description\n+ type: string\n+ cells:\n+ description: optional, when provided will replace all existing cells with the cells provided\n+ $ref: \"#/components/schemas/CellWithViewProperties\"\nparameters:\n- $ref: '#/components/parameters/TraceSpan'\n- in: path\n@@ -3751,6 +3761,11 @@ paths:\nschema:\ntype: string\ndescription: Filter organizations to a specific organization ID.\n+ - in: query\n+ name: userID\n+ schema:\n+ type: string\n+ description: Filter organizations to a specific user ID.\nresponses:\n'200':\ndescription: A list of organizations\n@@ -4359,6 +4374,64 @@ paths:\napplication/json:\nschema:\n$ref: \"#/components/schemas/Error\"\n+ /packages/stacks:\n+ post:\n+ operationId: CreateStack\n+ tags:\n+ - InfluxPackages\n+ summary: Create a new Influx package\n+ requestBody:\n+ description: Influx package to create.\n+ required: true\n+ content:\n+ application/json:\n+ schema:\n+ type: object\n+ properties:\n+ orgID:\n+ type: string\n+ name:\n+ type: string\n+ description:\n+ type: string\n+ urls:\n+ type: array\n+ items:\n+ type: string\n+ responses:\n+ '201':\n+ description: Influx stack created\n+ content:\n+ application/json:\n+ schema:\n+ type: object\n+ properties:\n+ id:\n+ type: string\n+ orgID:\n+ type: string\n+ name:\n+ type: string\n+ description:\n+ type: string\n+ urls:\n+ type: array\n+ items:\n+ type: string\n+ createdAt:\n+ type: string\n+ format: date-time\n+ readOnly: true\n+ updatedAt:\n+ type: string\n+ format: date-time\n+ readOnly: true\n+ default:\n+ description: Unexpected error\n+ content:\n+ application/json:\n+ schema:\n+ $ref: \"#/components/schemas/Error\"\n/tasks:\nget:\noperationId: GetTasks\n@@ -4863,6 +4936,27 @@ paths:\napplication/json:\nschema:\n$ref: \"#/components/schemas/Error\"\n+ /flags:\n+ get:\n+ operationId: GetFlags\n+ tags:\n+ - Users\n+ summary: Return the feature flags for the currently authenticated user\n+ parameters:\n+ - $ref: '#/components/parameters/TraceSpan'\n+ responses:\n+ '200':\n+ description: Feature flags for the currently authenticated user\n+ content:\n+ application/json:\n+ schema:\n+ $ref: \"#/components/schemas/Flags\"\n+ default:\n+ description: Unexpected error\n+ content:\n+ application/json:\n+ schema:\n+ $ref: \"#/components/schemas/Error\"\n/me:\nget:\noperationId: GetMe\n@@ -6293,6 +6387,10 @@ components:\n- flux\ndialect:\n$ref: \"#/components/schemas/Dialect\"\n+ now:\n+ description: Specifies the time that should be reported as \"now\" in the query. Default is the server's now time.\n+ type: string\n+ format: date-time\nInfluxQLQuery:\ndescription: Query influx using the InfluxQL language\ntype: object\n@@ -7151,6 +7249,8 @@ components:\ntype: boolean\norgID:\ntype: string\n+ stackID:\n+ type: string\npackage:\n$ref: \"#/components/schemas/Pkg\"\npackages:\n@@ -7171,30 +7271,46 @@ components:\ncontentType:\ntype: string\nrequired: [\"url\"]\n+ PkgCreateKind:\n+ type: string\n+ enum:\n+ - bucket\n+ - check\n+ - dashboard\n+ - label\n+ - notification_endpoint\n+ - notification_rule\n+ - task\n+ - telegraf\n+ - variable\nPkgCreate:\ntype: object\nproperties:\norgIDs:\n+ type: array\n+ items:\n+ type: object\n+ properties:\n+ orgID:\n+ type: string\n+ resourceFilters:\n+ type: object\n+ properties:\n+ byLabel:\ntype: array\nitems:\ntype: string\n+ byResourceKind:\n+ type: array\n+ items:\n+ $ref: \"#/components/schemas/PkgCreateKind\"\nresources:\ntype: object\nproperties:\nid:\ntype: string\nkind:\n- type: string\n- enum:\n- - bucket\n- - check\n- - dashboard\n- - label\n- - notification_endpoint\n- - notification_rule\n- - task\n- - telegraf\n- - variable\n+ $ref: \"#/components/schemas/PkgCreateKind\"\nname:\ntype: string\nrequired: [id, kind]\n@@ -7217,7 +7333,6 @@ components:\n- NotificationEndpointPagerDuty\n- NotificationEndpointSlack\n- NotificationRule\n- - NotificationEndpointHTTP\n- Task\n- Telegraf\n- Variable\n@@ -7243,6 +7358,8 @@ components:\ntype: string\norgID:\ntype: string\n+ pkgName:\n+ type: string\nname:\ntype: string\ndescription:\n@@ -7260,6 +7377,8 @@ components:\n- $ref: \"#/components/schemas/CheckDiscriminator\"\n- type: object\nproperties:\n+ pkgName:\n+ type: string\nlabelAssociations:\ntype: array\nitems:\n@@ -7277,6 +7396,8 @@ components:\ntype: \"string\"\norgID:\ntype: \"string\"\n+ pkgName:\n+ type: string\nname:\ntype: \"string\"\ndescription:\n@@ -7294,12 +7415,18 @@ components:\nitems:\ntype: object\nproperties:\n+ status:\n+ type: string\n+ resourcePkgName:\n+ type: string\nresourceName:\ntype: string\nresourceID:\ntype: string\nresourceType:\ntype: string\n+ labelPkgName:\n+ type: string\nlabelName:\ntype: string\nlabelID:\n@@ -7319,6 +7446,8 @@ components:\n- $ref: \"#/components/schemas/NotificationEndpointDiscrimator\"\n- type: object\nproperties:\n+ pkgName:\n+ type: string\nlabelAssociations:\ntype: array\nitems:\n@@ -7328,11 +7457,13 @@ components:\nitems:\ntype: object\nproperties:\n+ pkgName:\n+ type: string\nname:\ntype: string\ndescription:\ntype: string\n- endpointName:\n+ endpointPkgName:\ntype: string\nendpointID:\ntype: string\n@@ -7375,6 +7506,8 @@ components:\nitems:\ntype: object\nproperties:\n+ pkgName:\n+ type: string\nid:\ntype: string\nname:\n@@ -7398,6 +7531,8 @@ components:\n- $ref: \"#/components/schemas/TelegrafRequest\"\n- type: object\nproperties:\n+ pkgName:\n+ type: string\nlabelAssociations:\ntype: array\nitems:\n@@ -7407,6 +7542,8 @@ components:\nitems:\ntype: object\nproperties:\n+ pkgName:\n+ type: string\nid:\ntype: string\norgID:\n@@ -7429,13 +7566,17 @@ components:\nitems:\ntype: object\nproperties:\n+ stateStatus:\n+ type: string\nid:\ntype: string\n- name:\n+ pkgName:\ntype: string\nnew:\ntype: object\nproperties:\n+ name:\n+ type: string\ndescription:\ntype: string\nretentionRules:\n@@ -7443,6 +7584,8 @@ components:\nold:\ntype: object\nproperties:\n+ name:\n+ type: string\ndescription:\ntype: string\nretentionRules:\n@@ -7452,9 +7595,11 @@ components:\nitems:\ntype: object\nproperties:\n+ stateStatus:\n+ type: string\nid:\ntype: string\n- name:\n+ pkgName:\ntype: string\nnew:\n$ref: \"#/components/schemas/CheckDiscriminator\"\n@@ -7463,6 +7608,26 @@ components:\ndashboards:\ntype: array\nitems:\n+ type: object\n+ properties:\n+ stateStatus:\n+ type: string\n+ id:\n+ type: string\n+ pkgName:\n+ type: string\n+ new:\n+ type: object\n+ properties:\n+ name:\n+ type: string\n+ description:\n+ type: string\n+ charts:\n+ type: array\n+ items:\n+ $ref: \"#/components/schemas/PkgChart\"\n+ old:\ntype: object\nproperties:\nname:\n@@ -7478,13 +7643,17 @@ components:\nitems:\ntype: object\nproperties:\n+ stateStatus:\n+ type: string\nid:\ntype: string\n- name:\n+ pkgName:\ntype: string\nnew:\ntype: object\nproperties:\n+ name:\n+ type: string\ncolor:\ntype: string\ndescription:\n@@ -7492,6 +7661,8 @@ components:\nold:\ntype: object\nproperties:\n+ name:\n+ type: string\ncolor:\ntype: string\ndescription:\n@@ -7501,16 +7672,20 @@ components:\nitems:\ntype: object\nproperties:\n- isNew:\n- type: boolean\n+ status:\n+ type: string\nresourceType:\ntype: string\nresourceID:\ntype: string\n+ resourcePkgName:\n+ type: string\nresourceName:\ntype: string\nlabelID:\ntype: string\n+ labelPkgName:\n+ type: string\nlabelName:\ntype: string\nnotificationEndpoints:\n@@ -7518,9 +7693,11 @@ components:\nitems:\ntype: object\nproperties:\n+ stateStatus:\n+ type: string\nid:\ntype: string\n- name:\n+ pkgName:\ntype: string\nnew:\n$ref: \"#/components/schemas/NotificationEndpointDiscrimator\"\n@@ -7529,6 +7706,56 @@ components:\nnotificationRules:\ntype: array\nitems:\n+ type: object\n+ properties:\n+ stateStatus:\n+ type: string\n+ id:\n+ type: string\n+ pkgName:\n+ type: string\n+ new:\n+ type: object\n+ properties:\n+ name:\n+ type: string\n+ description:\n+ type: string\n+ endpointName:\n+ type: string\n+ endpointID:\n+ type: string\n+ endpointType:\n+ type: string\n+ every:\n+ type: string\n+ offset:\n+ type: string\n+ messageTemplate:\n+ type: string\n+ status:\n+ type: string\n+ statusRules:\n+ type: array\n+ items:\n+ type: object\n+ properties:\n+ currentLevel:\n+ type: string\n+ previousLevel:\n+ type: string\n+ tagRules:\n+ type: array\n+ items:\n+ type: object\n+ properties:\n+ key:\n+ type: string\n+ value:\n+ type: string\n+ operator:\n+ type: string\n+ old:\ntype: object\nproperties:\nname:\n@@ -7572,6 +7799,32 @@ components:\ntasks:\ntype: array\nitems:\n+ type: object\n+ properties:\n+ stateStatus:\n+ type: string\n+ id:\n+ type: string\n+ pkgName:\n+ type: string\n+ new:\n+ type: object\n+ properties:\n+ name:\n+ type: string\n+ cron:\n+ type: string\n+ description:\n+ type: string\n+ every:\n+ type: string\n+ offset:\n+ type: string\n+ query:\n+ type: string\n+ status:\n+ type: string\n+ old:\ntype: object\nproperties:\nname:\n@@ -7591,19 +7844,34 @@ components:\ntelegrafConfigs:\ntype: array\nitems:\n+ type: object\n+ properties:\n+ stateStatus:\n+ type: string\n+ id:\n+ type: string\n+ pkgName:\n+ type: string\n+ new:\n+ $ref: \"#/components/schemas/TelegrafRequest\"\n+ old:\n$ref: \"#/components/schemas/TelegrafRequest\"\nvariables:\ntype: array\nitems:\ntype: object\nproperties:\n+ stateStatus:\n+ type: string\nid:\ntype: string\n- name:\n+ pkgName:\ntype: string\nnew:\ntype: object\nproperties:\n+ name:\n+ type: string\ndescription:\ntype: string\nargs:\n@@ -7611,6 +7879,8 @@ components:\nold:\ntype: object\nproperties:\n+ name:\n+ type: string\ndescription:\ntype: string\nargs:\n@@ -7639,6 +7909,8 @@ components:\ntype: string\norgID:\ntype: string\n+ pkgName:\n+ type: string\nname:\ntype: string\ndescription:\n@@ -7887,6 +8159,9 @@ components:\ntype: array\nitems:\n$ref: \"#/components/schemas/User\"\n+ Flags:\n+ type: object\n+ additionalProperties: true\nResourceMember:\nallOf:\n- $ref: \"#/components/schemas/User\"\n@@ -7972,6 +8247,9 @@ components:\nme:\ntype: string\nformat: uri\n+ flags:\n+ type: string\n+ format: uri\norgs:\ntype: string\nformat: uri\n@@ -8765,7 +9043,7 @@ components:\ndescription: Colors define color encoding of data into a visualization\ntype: array\nitems:\n- type: string\n+ $ref: \"#/components/schemas/DashboardColor\"\nAxes:\ndescription: The viewport for a View's visualizations\ntype: object\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/src/generated/DashboardsAPI.ts",
"new_path": "packages/apis/src/generated/DashboardsAPI.ts",
"diff": "@@ -3,6 +3,7 @@ import {\nAddResourceMemberRequestBody,\nCell,\nCellUpdate,\n+ CellWithViewProperties,\nCells,\nCreateCell,\nCreateDashboardRequest,\n@@ -46,7 +47,14 @@ export interface PatchDashboardsIDRequest {\n/** The ID of the dashboard to update. */\ndashboardID: string\n/** Patching of a dashboard */\n- body: Dashboard\n+ body: {\n+ /** optional, when provided will replace the name */\n+ name?: string\n+ /** optional, when provided will replace the description */\n+ description?: string\n+ /** optional, when provided will replace all existing cells with the cells provided */\n+ cells?: CellWithViewProperties\n+ }\n}\nexport interface DeleteDashboardsIDRequest {\n/** The ID of the dashboard to update. */\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/apis/src/generated/FlagsAPI.ts",
"diff": "+import {APIBase, RequestOptions} from '../APIBase'\n+import {Flags} from './types'\n+\n+export interface GetFlagsRequest {}\n+/**\n+ * See\n+ * * https://v2.docs.influxdata.com/v2.0/api/#operation/GetFlags\n+ */\n+export class FlagsAPI extends APIBase {\n+ /**\n+ * Creates FlagsAPI from an influxDB object.\n+ */\n+ constructor(influxDB: any) {\n+ super(influxDB)\n+ }\n+ /**\n+ * Return the feature flags for the currently authenticated user.\n+ * See https://v2.docs.influxdata.com/v2.0/api/#operation/GetFlags\n+ * @param request\n+ * @return promise of response\n+ */\n+ getFlags(\n+ request?: GetFlagsRequest,\n+ requestOptions?: RequestOptions\n+ ): Promise<Flags> {\n+ return this.request('GET', `/api/v2/flags`, request, requestOptions)\n+ }\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/src/generated/OrgsAPI.ts",
"new_path": "packages/apis/src/generated/OrgsAPI.ts",
"diff": "@@ -21,6 +21,8 @@ export interface GetOrgsRequest {\norg?: string\n/** Filter organizations to a specific organization ID. */\norgID?: string\n+ /** Filter organizations to a specific user ID. */\n+ userID?: string\n}\nexport interface PostOrgsRequest {\n/** Organization to create */\n@@ -150,7 +152,7 @@ export class OrgsAPI extends APIBase {\n): Promise<Organizations> {\nreturn this.request(\n'GET',\n- `/api/v2/orgs${this.queryString(request, ['org', 'orgID'])}`,\n+ `/api/v2/orgs${this.queryString(request, ['org', 'orgID', 'userID'])}`,\nrequest,\nrequestOptions\n)\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/src/generated/PackagesAPI.ts",
"new_path": "packages/apis/src/generated/PackagesAPI.ts",
"diff": "@@ -8,10 +8,20 @@ export interface CreatePkgRequest {\nexport interface ApplyPkgRequest {\nbody: PkgApply\n}\n+export interface CreateStackRequest {\n+ /** Influx package to create. */\n+ body: {\n+ orgID?: string\n+ name?: string\n+ description?: string\n+ urls?: string[]\n+ }\n+}\n/**\n* See\n* * https://v2.docs.influxdata.com/v2.0/api/#operation/CreatePkg\n* * https://v2.docs.influxdata.com/v2.0/api/#operation/ApplyPkg\n+ * * https://v2.docs.influxdata.com/v2.0/api/#operation/CreateStack\n*/\nexport class PackagesAPI extends APIBase {\n/**\n@@ -56,4 +66,30 @@ export class PackagesAPI extends APIBase {\n'application/json'\n)\n}\n+ /**\n+ * Create a new Influx package.\n+ * See https://v2.docs.influxdata.com/v2.0/api/#operation/CreateStack\n+ * @param request\n+ * @return promise of response\n+ */\n+ createStack(\n+ request: CreateStackRequest,\n+ requestOptions?: RequestOptions\n+ ): Promise<{\n+ id?: string\n+ orgID?: string\n+ name?: string\n+ description?: string\n+ urls?: string[]\n+ readonly createdAt?: string\n+ readonly updatedAt?: string\n+ }> {\n+ return this.request(\n+ 'POST',\n+ `/api/v2/packages/stacks`,\n+ request,\n+ requestOptions,\n+ 'application/json'\n+ )\n+ }\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/src/generated/index.ts",
"new_path": "packages/apis/src/generated/index.ts",
"diff": "@@ -6,6 +6,7 @@ export * from './ChecksAPI'\nexport * from './DashboardsAPI'\nexport * from './DeleteAPI'\nexport * from './DocumentsAPI'\n+export * from './FlagsAPI'\nexport * from './HealthAPI'\nexport * from './LabelsAPI'\nexport * from './MeAPI'\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/src/generated/types.ts",
"new_path": "packages/apis/src/generated/types.ts",
"diff": "@@ -29,6 +29,7 @@ export interface Routes {\n}\nvariables?: string\nme?: string\n+ flags?: string\norgs?: string\nquery?: {\nself?: string\n@@ -860,7 +861,7 @@ export interface CheckViewProperties {\ncheck?: Check\nqueries: DashboardQuery[]\n/** Colors define color encoding of data into a visualization */\n- colors: string[]\n+ colors: DashboardColor[]\n}\nexport type Check = CheckDiscriminator\n@@ -1481,6 +1482,8 @@ export interface Query {\n/** The type of query. Must be \"flux\". */\ntype?: 'flux'\ndialect?: Dialect\n+ /** Specifies the time that should be reported as \"now\" in the query. Default is the server's now time. */\n+ now?: string\n}\n/**\n@@ -1547,10 +1550,21 @@ export interface SecretKeys {\nexport type Secrets = any\nexport interface PkgCreate {\n- orgIDs?: string[]\n+ orgIDs?: Array<{\n+ orgID?: string\n+ resourceFilters?: {\n+ byLabel?: string[]\n+ byResourceKind?: PkgCreateKind[]\n+ }\n+ }>\nresources?: {\nid: string\n- kind:\n+ kind: PkgCreateKind\n+ name?: string\n+ }\n+}\n+\n+export type PkgCreateKind =\n| 'bucket'\n| 'check'\n| 'dashboard'\n@@ -1560,9 +1574,6 @@ export interface PkgCreate {\n| 'task'\n| 'telegraf'\n| 'variable'\n- name?: string\n- }\n-}\nexport type Pkg = Array<{\napiVersion?: string\n@@ -1576,7 +1587,6 @@ export type Pkg = Array<{\n| 'NotificationEndpointPagerDuty'\n| 'NotificationEndpointSlack'\n| 'NotificationRule'\n- | 'NotificationEndpointHTTP'\n| 'Task'\n| 'Telegraf'\n| 'Variable'\n@@ -1589,6 +1599,7 @@ export type Pkg = Array<{\nexport interface PkgApply {\ndryRun?: boolean\norgID?: string\n+ stackID?: string\npackage?: Pkg\npackages?: Pkg[]\nsecrets?: any\n@@ -1603,6 +1614,7 @@ export interface PkgSummary {\nbuckets?: Array<{\nid?: string\norgID?: string\n+ pkgName?: string\nname?: string\ndescription?: string\nretentionPeriod?: number\n@@ -1610,6 +1622,7 @@ export interface PkgSummary {\n}>\nchecks?: Array<\nCheckDiscriminator & {\n+ pkgName?: string\nlabelAssociations?: PkgSummaryLabel[]\n}\n>\n@@ -1617,15 +1630,19 @@ export interface PkgSummary {\ndashboards?: Array<{\nid?: string\norgID?: string\n+ pkgName?: string\nname?: string\ndescription?: string\nlabelAssociations?: PkgSummaryLabel[]\ncharts?: PkgChart[]\n}>\nlabelMappings?: Array<{\n+ status?: string\n+ resourcePkgName?: string\nresourceName?: string\nresourceID?: string\nresourceType?: string\n+ labelPkgName?: string\nlabelName?: string\nlabelID?: string\n}>\n@@ -1633,13 +1650,15 @@ export interface PkgSummary {\nmissingSecrets?: string[]\nnotificationEndpoints?: Array<\nNotificationEndpointDiscrimator & {\n+ pkgName?: string\nlabelAssociations?: PkgSummaryLabel[]\n}\n>\nnotificationRules?: Array<{\n+ pkgName?: string\nname?: string\ndescription?: string\n- endpointName?: string\n+ endpointPkgName?: string\nendpointID?: string\nendpointType?: string\nevery?: string\n@@ -1658,6 +1677,7 @@ export interface PkgSummary {\nlabelAssociations?: PkgSummaryLabel[]\n}>\ntasks?: Array<{\n+ pkgName?: string\nid?: string\nname?: string\ncron?: string\n@@ -1669,10 +1689,12 @@ export interface PkgSummary {\n}>\ntelegrafConfigs?: Array<\nTelegrafRequest & {\n+ pkgName?: string\nlabelAssociations?: PkgSummaryLabel[]\n}\n>\nvariables?: Array<{\n+ pkgName?: string\nid?: string\norgID?: string\nname?: string\n@@ -1683,55 +1705,79 @@ export interface PkgSummary {\n}\ndiff?: {\nbuckets?: Array<{\n+ stateStatus?: string\nid?: string\n- name?: string\n+ pkgName?: string\nnew?: {\n+ name?: string\ndescription?: string\nretentionRules?: RetentionRules\n}\nold?: {\n+ name?: string\ndescription?: string\nretentionRules?: RetentionRules\n}\n}>\nchecks?: Array<{\n+ stateStatus?: string\nid?: string\n- name?: string\n+ pkgName?: string\nnew?: CheckDiscriminator\nold?: CheckDiscriminator\n}>\ndashboards?: Array<{\n+ stateStatus?: string\n+ id?: string\n+ pkgName?: string\n+ new?: {\nname?: string\ndescription?: string\ncharts?: PkgChart[]\n+ }\n+ old?: {\n+ name?: string\n+ description?: string\n+ charts?: PkgChart[]\n+ }\n}>\nlabels?: Array<{\n+ stateStatus?: string\nid?: string\n- name?: string\n+ pkgName?: string\nnew?: {\n+ name?: string\ncolor?: string\ndescription?: string\n}\nold?: {\n+ name?: string\ncolor?: string\ndescription?: string\n}\n}>\nlabelMappings?: Array<{\n- isNew?: boolean\n+ status?: string\nresourceType?: string\nresourceID?: string\n+ resourcePkgName?: string\nresourceName?: string\nlabelID?: string\n+ labelPkgName?: string\nlabelName?: string\n}>\nnotificationEndpoints?: Array<{\n+ stateStatus?: string\nid?: string\n- name?: string\n+ pkgName?: string\nnew?: NotificationEndpointDiscrimator\nold?: NotificationEndpointDiscrimator\n}>\nnotificationRules?: Array<{\n+ stateStatus?: string\n+ id?: string\n+ pkgName?: string\n+ new?: {\nname?: string\ndescription?: string\nendpointName?: string\n@@ -1750,8 +1796,42 @@ export interface PkgSummary {\nvalue?: string\noperator?: string\n}>\n+ }\n+ old?: {\n+ name?: string\n+ description?: string\n+ endpointName?: string\n+ endpointID?: string\n+ endpointType?: string\n+ every?: string\n+ offset?: string\n+ messageTemplate?: string\n+ status?: string\n+ statusRules?: Array<{\n+ currentLevel?: string\n+ previousLevel?: string\n+ }>\n+ tagRules?: Array<{\n+ key?: string\n+ value?: string\n+ operator?: string\n+ }>\n+ }\n}>\ntasks?: Array<{\n+ stateStatus?: string\n+ id?: string\n+ pkgName?: string\n+ new?: {\n+ name?: string\n+ cron?: string\n+ description?: string\n+ every?: string\n+ offset?: string\n+ query?: string\n+ status?: string\n+ }\n+ old?: {\nname?: string\ncron?: string\ndescription?: string\n@@ -1759,16 +1839,26 @@ export interface PkgSummary {\noffset?: string\nquery?: string\nstatus?: string\n+ }\n+ }>\n+ telegrafConfigs?: Array<{\n+ stateStatus?: string\n+ id?: string\n+ pkgName?: string\n+ new?: TelegrafRequest\n+ old?: TelegrafRequest\n}>\n- telegrafConfigs?: TelegrafRequest[]\nvariables?: Array<{\n+ stateStatus?: string\nid?: string\n- name?: string\n+ pkgName?: string\nnew?: {\n+ name?: string\ndescription?: string\nargs?: VariableProperties\n}\nold?: {\n+ name?: string\ndescription?: string\nargs?: VariableProperties\n}\n@@ -1785,6 +1875,7 @@ export interface PkgSummary {\nexport interface PkgSummaryLabel {\nid?: string\norgID?: string\n+ pkgName?: string\nname?: string\ndescription?: string\nretentionPeriod?: string\n@@ -1974,6 +2065,8 @@ export interface LogEvent {\nreadonly message?: string\n}\n+export type Flags = any\n+\nexport interface PasswordResetBody {\npassword: string\n}\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(apis): regenerate APIs from 2020-04-30 swagger |
305,159 | 04.05.2020 08:51:16 | -7,200 | 490b36e9a7fd186227f2322aa994b0be355cf8a5 | feat(query): add now to query options | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/QueryApi.ts",
"new_path": "packages/core/src/QueryApi.ts",
"diff": "@@ -27,6 +27,11 @@ export interface QueryOptions {\n* Requests gzip encoded response.\n*/\ngzip?: boolean\n+ /**\n+ * Specifies the time that should be reported as \"now\" in the query. RFC3339 value must be returned,\n+ * for example `new Date().toISOString()`.\n+ */\n+ now?: () => string\n}\n/** Wraps values and associated metadata of a query result row */\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/impl/QueryApiImpl.ts",
"new_path": "packages/core/src/impl/QueryApiImpl.ts",
"diff": "@@ -60,11 +60,13 @@ export class QueryApiImpl implements QueryApi {\nreturn (consumer): void => {\nthis.transport.send(\n`/api/v2/query?org=${encodeURIComponent(org)}`,\n- JSON.stringify({\n+ JSON.stringify(\n+ this.decorateRequest({\nquery,\ndialect: DEFAULT_dialect,\ntype,\n- }),\n+ })\n+ ),\n{\nmethod: 'POST',\nheaders: {\n@@ -76,6 +78,14 @@ export class QueryApiImpl implements QueryApi {\n)\n}\n}\n+ private decorateRequest(request: any): any {\n+ if (typeof this.options.now === 'function') {\n+ request.now = this.options.now()\n+ }\n+ // https://v2.docs.influxdata.com/v2.0/api/#operation/PostQuery requires type\n+ request.type = this.options.type || 'flux'\n+ return request\n+ }\n}\nexport default QueryApiImpl\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/test/unit/QueryApi.test.ts",
"new_path": "packages/core/test/unit/QueryApi.test.ts",
"diff": "@@ -164,4 +164,49 @@ describe('QueryApi', () => {\n},\n])\n})\n+ it('sends custom now and type', async () => {\n+ let body: any\n+ nock(clientOptions.url)\n+ .post(QUERY_PATH)\n+ .reply((_uri, requestBody) => {\n+ body = requestBody\n+ return [200, '', {}]\n+ })\n+ .persist()\n+\n+ const query = 'from(bucket:\"my-bucket\") |> range(start: 0)'\n+ const tests: Record<string, string | undefined>[] = [\n+ {\n+ now: undefined,\n+ type: undefined,\n+ },\n+ {\n+ now: '2020-10-05T14:48:00.000Z',\n+ type: 'whatever',\n+ },\n+ ]\n+ for (const pair of tests) {\n+ let subject = new InfluxDB(clientOptions).getQueryApi(ORG)\n+ if (pair.now) {\n+ subject = subject.with({now: () => pair.now as string})\n+ }\n+ if (pair.type) {\n+ subject = subject.with({type: pair.type as any})\n+ }\n+ await new Promise((resolve, reject) =>\n+ subject.queryRows(query, {\n+ next(_row: string[], _meta: FluxTableMetaData): void {},\n+ error(error: Error): void {\n+ reject(error)\n+ },\n+ complete(): void {\n+ resolve()\n+ },\n+ })\n+ )\n+ expect(body?.type).to.deep.equal(pair.type || 'flux')\n+ expect(body?.query).to.deep.equal(query)\n+ expect(body?.now).to.deep.equal(pair.now)\n+ }\n+ })\n})\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(query): add now to query options |
305,159 | 04.05.2020 10:03:22 | -7,200 | 373a439d3c602367418aa5a0fab17c4afdea3049 | chore(query): improve typeSerializers fingerprint | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/query/FluxTableMetaData.ts",
"new_path": "packages/core/src/query/FluxTableMetaData.ts",
"diff": "-import FluxTableColumn from './FluxTableColumn'\n+import FluxTableColumn, {ColumnType} from './FluxTableColumn'\nimport {IllegalArgumentError} from '../errors'\nconst identity = (x: string): any => x\n@@ -6,7 +6,7 @@ const identity = (x: string): any => x\n* A dictionary of serializers of particular types returned by a flux query.\n* See https://v2.docs.influxdata.com/v2.0/reference/syntax/annotated-csv/#valid-data-types\n*/\n-export const typeSerializers: {[key: string]: (val: string) => any} = {\n+export const typeSerializers: Record<ColumnType, (val: string) => any> = {\nboolean: (x: string): any => x === 'true',\nunsignedLong: identity,\nlong: identity,\n@@ -51,9 +51,7 @@ export default class FluxTableMetaData {\nif (val === '' && column.defaultValue) {\nval = column.defaultValue\n}\n- acc[column.label] = (\n- typeSerializers[column.dataType as string] || identity\n- )(val)\n+ acc[column.label] = (typeSerializers[column.dataType] || identity)(val)\n}\nreturn acc\n}\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore(query): improve typeSerializers fingerprint |
305,160 | 07.05.2020 13:50:33 | -7,200 | afaae56aa2ae1013d0ac56f7e08abc32ae92eae6 | feat: remove trailing slash from connection URL | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "1. [#177](https://github.com/influxdata/influxdb-client-js/pull/177): Allow to receive query results as [Observable](https://github.com/tc39/proposal-observable)\n1. [#181](https://github.com/influxdata/influxdb-client-js/pull/181): Update APIs from swagger as of 2020-04-30\n1. [#182](https://github.com/influxdata/influxdb-client-js/pull/182): Allow setting the time that should be reported as \"now\" in the query\n+1. [#183](https://github.com/influxdata/influxdb-client-js/pull/183): Remove trailing slash from connection URL\n## 1.2.0 [2020-04-17]\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/InfluxDB.ts",
"new_path": "packages/core/src/InfluxDB.ts",
"diff": "@@ -27,8 +27,10 @@ export default class InfluxDB {\n} else {\nthrow new IllegalArgumentError('No url or configuration specified!')\n}\n- if (this._options.url === undefined)\n+ const url = this._options.url\n+ if (typeof url !== 'string')\nthrow new IllegalArgumentError('No url specified!')\n+ if (url.endsWith('/')) this._options.url = url.substring(0, url.length - 1)\nthis.transport = this._options.transport || new TransportImpl(this._options)\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/test/unit/Influxdb.test.ts",
"new_path": "packages/core/test/unit/Influxdb.test.ts",
"diff": "@@ -28,6 +28,20 @@ describe('InfluxDB', () => {\ntoken: 'b',\n})\n})\n+ it('is created from string url with trailing slash', () => {\n+ expect(\n+ (new InfluxDB('http://localhost:9999/') as any)._options\n+ ).to.deep.equal({\n+ url: 'http://localhost:9999',\n+ })\n+ })\n+ it('is created from configuration with url with trailing slash', () => {\n+ expect(\n+ (new InfluxDB({url: 'http://localhost:9999/'}) as any)._options\n+ ).to.deep.equal({\n+ url: 'http://localhost:9999',\n+ })\n+ })\nit('fails on null arg', () => {\nexpect(() => new InfluxDB((null as unknown) as ClientOptions)).to.throw(\n'No url or configuration specified!'\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat: remove trailing slash from connection URL (#183) |
305,159 | 08.05.2020 08:50:46 | -7,200 | e452b2b973f096e4af2add9a50a3929bc7baa46b | feat(core): allow to create write API with custom writeOptions | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/InfluxDB.ts",
"new_path": "packages/core/src/InfluxDB.ts",
"diff": "import WriteApi from './WriteApi'\n-import {ClientOptions, WritePrecision} from './options'\n+import {ClientOptions, WritePrecision, WriteOptions} from './options'\nimport WriteApiImpl from './impl/WriteApiImpl'\nimport {IllegalArgumentError} from './errors'\nimport {Transport} from './transport'\n@@ -41,18 +41,20 @@ export default class InfluxDB {\n* @param org Specifies the destination organization for writes. Takes either the ID or Name interchangeably.\n* @param bucket The destination bucket for writes.\n* @param precision Timestamp precision for line items.\n+ * @param options Custom write options.\n*/\ngetWriteApi(\norg: string,\nbucket: string,\n- precision: WritePrecision = WritePrecision.ns\n+ precision: WritePrecision = WritePrecision.ns,\n+ options?: Partial<WriteOptions>\n): WriteApi {\nreturn new WriteApiImpl(\nthis.transport,\norg,\nbucket,\nprecision,\n- this._options.writeOptions\n+ options || this._options.writeOptions\n)\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/options.ts",
"new_path": "packages/core/src/options.ts",
"diff": "@@ -71,9 +71,9 @@ export const DEFAULT_WriteOptions: WriteOptions = Object.freeze({\n* Options used by [[InfluxDB]] .\n*/\nexport interface ClientOptions extends ConnectionOptions {\n- /** to override default writing options */\n+ /** supplies and overrides default writing options */\nwriteOptions?: Partial<WriteOptions>\n- /** to specify custom transport */\n+ /** specifies custom transport */\ntransport?: Transport\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/test/unit/WriteApi.test.ts",
"new_path": "packages/core/test/unit/WriteApi.test.ts",
"diff": "@@ -85,10 +85,9 @@ describe('WriteApi', () => {\nlet subject: WriteApi\nlet logs: CollectedLogs\nfunction useSubject(writeOptions: Partial<WriteOptions>): void {\n- subject = createApi(ORG, BUCKET, PRECISION, {\n- retryJitter: 0,\n- ...writeOptions,\n- })\n+ subject = new InfluxDB({\n+ ...clientOptions,\n+ }).getWriteApi(ORG, BUCKET, PRECISION, writeOptions)\n}\nbeforeEach(() => {\n// logs = collectLogging.decorate()\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(core): allow to create write API with custom writeOptions |
305,159 | 14.05.2020 19:16:52 | -7,200 | 351b9ca9fb86e1892b38270c92584e29924c4dec | feat(query): introduce flux tagged template | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/core/src/query/flux.ts",
"diff": "+const SANITIZE_FLUX_PARAMETER = Symbol.for('SANITIZE_FLUX_PARAMETER')\n+\n+/**\n+ * A flux parameter like can print a sanitized value.\n+ */\n+export interface FluxParameterLike {\n+ [SANITIZE_FLUX_PARAMETER](): string\n+}\n+\n+class FluxParameter implements FluxParameterLike {\n+ constructor(private value: string) {}\n+ toString(): string {\n+ return this.value\n+ }\n+ [SANITIZE_FLUX_PARAMETER](): string {\n+ return this.value\n+ }\n+}\n+\n+/**\n+ * Escapes content of the supplied string so it can be wrapped into double qoutes\n+ * to become a [flux string literal](https://docs.influxdata.com/flux/v0.65/language/lexical-elements/#string-literals).\n+ * @param value string value\n+ * @return sanitized string\n+ */\n+function sanitizeString(value: any): string {\n+ // TODO sanitize string\n+ return value\n+}\n+\n+/**\n+ * Creates a flux integer literal.\n+ * @param value string value\n+ * @return flux parameter\n+ */\n+export function fluxInteger(value: any): FluxParameterLike {\n+ const val = String(value)\n+ for (const c of val) {\n+ if (c < '0' || c > '9') throw new Error(`not a flux integer: ${val}`)\n+ }\n+ return new FluxParameter(val)\n+}\n+\n+export function sanitizeFloat(value: any): string {\n+ const val = String(value)\n+ let dot = false\n+ for (const c of val) {\n+ if (c === '.') {\n+ if (dot) throw new Error(`not a flux float: ${val}`)\n+ dot = !dot\n+ }\n+ if (c !== '.' && (c < '0' || c > '9'))\n+ throw new Error(`not a flux float: ${val}`)\n+ }\n+ return val\n+}\n+/**\n+ * Creates a flux float literal.\n+ */\n+export function fluxFloat(value: any): FluxParameterLike {\n+ return new FluxParameter(sanitizeFloat(value))\n+}\n+\n+function sanitizeDateTime(value: any): string {\n+ return `time(v: \"${sanitizeString(value)}\")`\n+}\n+\n+/**\n+ * Creates flux date-time literal.\n+ */\n+export function fluxDateTime(value: any): FluxParameterLike {\n+ return new FluxParameter(sanitizeDateTime(value))\n+}\n+\n+/**\n+ * Creates flux date-time literal.\n+ */\n+export function fluxDuration(value: any): FluxParameterLike {\n+ return new FluxParameter(`duration(v: \"${sanitizeString(value)}\")`)\n+}\n+\n+function sanitizeRegExp(value: any): string {\n+ return `regexp.compile(v: \"${sanitizeString(value)}\")`\n+}\n+/**\n+ * Creates flux regexp literal\n+ */\n+export function fluxRegExp(value: any): FluxParameterLike {\n+ // let the server decide if it can be parsed\n+ return new FluxParameter(sanitizeRegExp(value))\n+}\n+\n+/**\n+ * Escapes content of the supplied parameter so that it can be safely embedded into flux query.\n+ * @param value parameter value\n+ * @return sanitized value\n+ */\n+export function sanitizeParameter(value: any): string {\n+ if (typeof value === 'string') {\n+ return `\"${sanitizeString(value)}\"`\n+ } else if (typeof value === 'number') {\n+ return sanitizeFloat(value)\n+ } else if (\n+ typeof value === 'object' &&\n+ typeof value[SANITIZE_FLUX_PARAMETER] === 'function'\n+ ) {\n+ return value[SANITIZE_FLUX_PARAMETER]()\n+ } else if (value instanceof Date) {\n+ return sanitizeDateTime(value)\n+ } else if (value instanceof RegExp) {\n+ return sanitizeRegExp(value)\n+ }\n+ return ''\n+}\n+\n+/**\n+ * Flux is a tagged template that sanitizes parameters in a flux query to avoid injection attacks.\n+ */\n+export function flux(strings: string[], ...values: any): string {\n+ const parts = new Array<string>(strings.length + values.length)\n+ let partIndex = 0\n+ for (let i = 0; i < strings.length; i++) {\n+ const text = strings[i]\n+ parts[partIndex++] = text\n+ if (i < values.length) {\n+ const val = values[i]\n+ const sanitized = sanitizeParameter(val)\n+ if (sanitized === '') {\n+ throw new Error(\n+ `Unsupported parameter literal '${val}' at index: ${i}, type: ${typeof val}`\n+ )\n+ }\n+ parts[partIndex++] = sanitized\n+ } else if (i < strings.length - 1) {\n+ throw new Error('Too few parameters supplied!')\n+ }\n+ }\n+ return parts.join('')\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/query/index.ts",
"new_path": "packages/core/src/query/index.ts",
"diff": "@@ -4,3 +4,4 @@ export {\n} from './FluxTableMetaData'\nexport {default as FluxResultObserver} from './FluxResultObserver'\nexport {default as FluxTableColumn, ColumnType} from './FluxTableColumn'\n+export * from './flux'\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(query): introduce flux tagged template |
305,159 | 15.05.2020 09:11:31 | -7,200 | 8d308dd2faab0a71ef7e4c860416db3a15a192b5 | feat(query): test flux tagged template | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/query/flux.ts",
"new_path": "packages/core/src/query/flux.ts",
"diff": "-const SANITIZE_FLUX_PARAMETER = Symbol.for('SANITIZE_FLUX_PARAMETER')\n+const FLUX_VALUE = Symbol.for('FLUX_VALUE')\n/**\n- * A flux parameter like can print a sanitized value.\n+ * A flux parameter can print its (sanitized) flux value.\n*/\nexport interface FluxParameterLike {\n- [SANITIZE_FLUX_PARAMETER](): string\n+ [FLUX_VALUE](): string\n}\nclass FluxParameter implements FluxParameterLike {\n- constructor(private value: string) {}\n+ constructor(private fluxValue: string) {}\ntoString(): string {\n- return this.value\n+ return this.fluxValue\n}\n- [SANITIZE_FLUX_PARAMETER](): string {\n- return this.value\n+ [FLUX_VALUE](): string {\n+ return this.fluxValue\n}\n}\n@@ -24,14 +24,69 @@ class FluxParameter implements FluxParameterLike {\n* @return sanitized string\n*/\nfunction sanitizeString(value: any): string {\n- // TODO sanitize string\n+ if (value === null || value === undefined) return ''\n+ value = value.toString()\n+ let retVal: any = undefined\n+ let i = 0\n+ function prepareRetVal(): void {\n+ if (retVal === undefined) {\n+ retVal = value.substring(0, i)\n+ }\n+ }\n+ for (; i < value.length; i++) {\n+ const c = value.charAt(i)\n+ switch (c) {\n+ case '\\r':\n+ prepareRetVal()\n+ retVal += '\\\\r'\n+ break\n+ case '\\n':\n+ prepareRetVal()\n+ retVal += '\\\\n'\n+ break\n+ case '\\t':\n+ prepareRetVal()\n+ retVal += '\\\\t'\n+ break\n+ case '\"':\n+ case '\\\\':\n+ prepareRetVal()\n+ retVal = retVal + '\\\\' + c\n+ break\n+ case '$':\n+ // escape ${\n+ if (i + 1 < value.length && value.charAt(i + 1) === '{') {\n+ prepareRetVal()\n+ i++\n+ retVal += '\\\\${'\n+ break\n+ }\n+ // append $\n+ if (retVal != undefined) {\n+ retVal += c\n+ }\n+ break\n+ default:\n+ if (retVal != undefined) {\n+ retVal += c\n+ }\n+ }\n+ }\n+ if (retVal !== undefined) {\n+ return retVal\n+ }\nreturn value\n}\n+/**\n+ * Creates a flux string literal.\n+ */\n+export function fluxString(value: any): FluxParameterLike {\n+ return new FluxParameter(`\"${sanitizeString(value)}\"`)\n+}\n+\n/**\n* Creates a flux integer literal.\n- * @param value string value\n- * @return flux parameter\n*/\nexport function fluxInteger(value: any): FluxParameterLike {\nconst val = String(value)\n@@ -82,41 +137,69 @@ export function fluxDuration(value: any): FluxParameterLike {\nfunction sanitizeRegExp(value: any): string {\nreturn `regexp.compile(v: \"${sanitizeString(value)}\")`\n}\n+\n/**\n- * Creates flux regexp literal\n+ * Creates flux regexp literal.\n*/\nexport function fluxRegExp(value: any): FluxParameterLike {\n// let the server decide if it can be parsed\nreturn new FluxParameter(sanitizeRegExp(value))\n}\n+/**\n+ * Creates flux boolean literal.\n+ */\n+export function fluxBool(value: any): FluxParameterLike {\n+ if (value === 'true' || value === 'false') {\n+ return new FluxParameter(value)\n+ }\n+ return new FluxParameter((!!value).toString())\n+}\n+\n+/**\n+ * Assumes that the supplied string is a flux literal value and creates\n+ * a parameter out of it.\n+ */\n+export function fluxLiteral(value: string): FluxParameterLike {\n+ // let the server decide if it can be parsed\n+ return new FluxParameter(value)\n+}\n+\n/**\n* Escapes content of the supplied parameter so that it can be safely embedded into flux query.\n* @param value parameter value\n- * @return sanitized value\n+ * @return sanitized flux value or an empty string if it cannot be converted\n*/\n-export function sanitizeParameter(value: any): string {\n- if (typeof value === 'string') {\n+export function toFluxValue(value: any): string {\n+ if (value === undefined) {\n+ return ''\n+ } else if (value === null) {\n+ return 'null'\n+ } else if (typeof value === 'boolean') {\n+ return value.toString()\n+ } else if (typeof value === 'string') {\nreturn `\"${sanitizeString(value)}\"`\n} else if (typeof value === 'number') {\nreturn sanitizeFloat(value)\n} else if (\ntypeof value === 'object' &&\n- typeof value[SANITIZE_FLUX_PARAMETER] === 'function'\n+ typeof value[FLUX_VALUE] === 'function'\n) {\n- return value[SANITIZE_FLUX_PARAMETER]()\n+ return value[FLUX_VALUE]()\n} else if (value instanceof Date) {\n- return sanitizeDateTime(value)\n+ return value.toISOString()\n} else if (value instanceof RegExp) {\nreturn sanitizeRegExp(value)\n}\n- return ''\n+ return toFluxValue(value.toString())\n}\n/**\n- * Flux is a tagged template that sanitizes parameters in a flux query to avoid injection attacks.\n+ * Flux is a tagged template that sanitizes supplied parameters\n+ * to avoid injection attacks in flux.\n*/\n-export function flux(strings: string[], ...values: any): string {\n+export function flux(strings: TemplateStringsArray, ...values: any): string {\n+ if (strings.length == 1) return strings[0] // the simplest case\nconst parts = new Array<string>(strings.length + values.length)\nlet partIndex = 0\nfor (let i = 0; i < strings.length; i++) {\n@@ -124,12 +207,22 @@ export function flux(strings: string[], ...values: any): string {\nparts[partIndex++] = text\nif (i < values.length) {\nconst val = values[i]\n- const sanitized = sanitizeParameter(val)\n+ let sanitized: string\n+ if (\n+ text.endsWith('\"') &&\n+ i + 1 < strings.length &&\n+ strings[i + 1].startsWith('\"')\n+ ) {\n+ // parameter is wrapped into flux double quotes\n+ sanitized = sanitizeString(val)\n+ } else {\n+ sanitized = toFluxValue(val)\nif (sanitized === '') {\nthrow new Error(\n`Unsupported parameter literal '${val}' at index: ${i}, type: ${typeof val}`\n)\n}\n+ }\nparts[partIndex++] = sanitized\n} else if (i < strings.length - 1) {\nthrow new Error('Too few parameters supplied!')\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "packages/core/test/unit/query/flux.test.ts",
"diff": "+import {\n+ fluxLiteral,\n+ fluxInteger,\n+ fluxFloat,\n+ fluxDuration,\n+ fluxDateTime,\n+ fluxRegExp,\n+ fluxString,\n+ toFluxValue,\n+ fluxBool,\n+ flux,\n+} from '../../../src'\n+import {expect} from 'chai'\n+\n+const FLUX_VALUE = Symbol.for('FLUX_VALUE')\n+\n+describe('Flux Values', () => {\n+ it('creates fluxLiteral', () => {\n+ const value = '12345'\n+ const subject = fluxLiteral(value)\n+ expect(subject.toString()).equals(value)\n+ expect((subject as any)[FLUX_VALUE]()).equals(value)\n+ })\n+ it('creates fluxInteger', () => {\n+ const subject = fluxInteger(123)\n+ expect(subject.toString()).equals('123')\n+ expect((subject as any)[FLUX_VALUE]()).equals('123')\n+ try {\n+ fluxInteger('123a')\n+ expect.fail()\n+ } catch (_e) {\n+ // OK, this must happen\n+ }\n+ })\n+ it('creates fluxBool', () => {\n+ expect(fluxBool('true').toString()).equals('true')\n+ expect((fluxBool('true') as any)[FLUX_VALUE]()).equals('true')\n+ expect(fluxBool('false').toString()).equals('false')\n+ expect((fluxBool('false') as any)[FLUX_VALUE]()).equals('false')\n+ expect(fluxBool(true).toString()).equals('true')\n+ expect((fluxBool(true) as any)[FLUX_VALUE]()).equals('true')\n+ expect(fluxBool(false).toString()).equals('false')\n+ expect((fluxBool(false) as any)[FLUX_VALUE]()).equals('false')\n+ expect(fluxBool(1).toString()).equals('true')\n+ expect((fluxBool(1) as any)[FLUX_VALUE]()).equals('true')\n+ expect(fluxBool(0).toString()).equals('false')\n+ expect((fluxBool(0) as any)[FLUX_VALUE]()).equals('false')\n+ })\n+ it('creates fluxFloat', () => {\n+ const subject = fluxFloat(123.456)\n+ expect(subject.toString()).equals('123.456')\n+ expect((subject as any)[FLUX_VALUE]()).equals('123.456')\n+ try {\n+ fluxFloat('123..')\n+ expect.fail()\n+ } catch (_e) {\n+ // OK, this must happen\n+ }\n+ try {\n+ fluxFloat('123.a')\n+ expect.fail()\n+ } catch (_e) {\n+ // OK, this must happen\n+ }\n+ })\n+ it('creates fluxDuration', () => {\n+ const subject = fluxDuration('1ms')\n+ const fluxValue = 'duration(v: \"1ms\")'\n+ expect(subject.toString()).equals(fluxValue)\n+ expect((subject as any)[FLUX_VALUE]()).equals(fluxValue)\n+ })\n+ it('creates fluxDateTime', () => {\n+ const subject = fluxDateTime('2020-06-06T21:56:00.000Z')\n+ const fluxValue = 'time(v: \"2020-06-06T21:56:00.000Z\")'\n+ expect(subject.toString()).equals(fluxValue)\n+ expect((subject as any)[FLUX_VALUE]()).equals(fluxValue)\n+ })\n+ it('creates fluxRegExp', () => {\n+ const subject = fluxRegExp('/abc/')\n+ const fluxValue = 'regexp.compile(v: \"/abc/\")'\n+ expect(subject.toString()).equals(fluxValue)\n+ expect((subject as any)[FLUX_VALUE]()).equals(fluxValue)\n+ })\n+ it('creates fluxString', () => {\n+ const subject = fluxString('abc')\n+ expect(subject.toString()).equals('\"abc\"')\n+ expect((subject as any)[FLUX_VALUE]()).equals('\"abc\"')\n+ expect(fluxString(null).toString()).equals('\"\"')\n+ expect((fluxString(null) as any)[FLUX_VALUE]()).equals('\"\"')\n+ expect(fluxString(undefined).toString()).equals('\"\"')\n+ expect((fluxString(undefined) as any)[FLUX_VALUE]()).equals('\"\"')\n+ })\n+ describe('toFluxValue', () => {\n+ const pairs: Array<{value: any; flux: string}> = [\n+ {value: null, flux: 'null'},\n+ {value: undefined, flux: ''},\n+ {value: false, flux: 'false'},\n+ {value: 1, flux: '1'},\n+ {value: 1.1, flux: '1.1'},\n+ {value: 'a', flux: '\"a\"'},\n+ {value: new Date(1589521447471), flux: '2020-05-15T05:44:07.471Z'},\n+ {value: /abc/, flux: 'regexp.compile(v: \"/abc/\")'},\n+ {\n+ value: {\n+ toString: function(): string {\n+ return 'whatever'\n+ },\n+ },\n+ flux: '\"whatever\"',\n+ },\n+ {value: fluxLiteral('1ms'), flux: '1ms'},\n+ {value: 'abc\\n\\r\\t\\\\\"def', flux: '\"abc\\\\n\\\\r\\\\t\\\\\\\\\\\\\"def\"'},\n+ {value: 'abc${val}def', flux: '\"abc\\\\${val}def\"'},\n+ {value: 'abc$', flux: '\"abc$\"'},\n+ {value: 'a\"$d', flux: '\"a\\\\\"$d\"'},\n+ ]\n+ pairs.forEach(pair => {\n+ it(`converts ${JSON.stringify(String(pair.value))} to '${\n+ pair.flux\n+ }'`, () => {\n+ expect(toFluxValue(pair.value)).equals(pair.flux)\n+ })\n+ })\n+ })\n+})\n+\n+describe('Flux Tagged Template', () => {\n+ expect(\n+ flux`from(bucket:\"my-bucket\") |> range(start: 0) |> filter(fn: (r) => r._measurement == \"temperature\")`,\n+ 'from(bucket:\"my-bucket\") |> range(start: 0) |> filter(fn: (r) => r._measurement == \"temperature\")'\n+ )\n+ expect(\n+ flux`from(bucket:\"my-bucket\") |> range(start: ${0}) |> filter(fn: (r) => r._measurement == ${'temperature'})`,\n+ 'from(bucket:\"my-bucket\") |> range(start: 0) |> filter(fn: (r) => r._measurement == \"temperature\")'\n+ )\n+ expect(\n+ flux`from(bucket:\"my-bucket\") |> range(start: ${0}) |> filter(fn: (r) => r._measurement == \"${'temperature'}\")`,\n+ 'from(bucket:\"my-bucket\") |> range(start: 0) |> filter(fn: (r) => r._measurement == \"temperature\")'\n+ )\n+\n+ try {\n+ flux`${undefined}`\n+ expect.fail()\n+ } catch (_e) {\n+ // ok expected, undefined is not supported\n+ }\n+\n+ try {\n+ flux((['1', '2'] as any) as TemplateStringsArray)\n+ expect.fail()\n+ } catch (_e) {\n+ // ok expected, too few arguments supplied to a tagged template\n+ }\n+})\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(query): test flux tagged template |
305,159 | 15.05.2020 09:11:45 | -7,200 | 001df8d0eed6456fb77193ac2e6237c6a2c9ad76 | feat(query): add query parameters example | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "examples/queryParameters.ts",
"diff": "+#!./node_modules/.bin/ts-node\n+//////////////////////////////////////////\n+// Shows how to use InfluxDB query API. //\n+//////////////////////////////////////////\n+\n+import {\n+ InfluxDB,\n+ FluxTableMetaData,\n+ flux,\n+ fluxDuration,\n+} from '@influxdata/influxdb-client'\n+import {url, token, org} from './env'\n+\n+const queryApi = new InfluxDB({url, token}).getQueryApi(org)\n+const start = fluxDuration('-1m')\n+const measurement = 'temperature'\n+const fluxQuery = flux`from(bucket:\"my-bucket\")\n+ |> range(start: ${start})\n+ |> filter(fn: (r) => r._measurement == ${measurement})`\n+console.log('query:', fluxQuery)\n+\n+console.log('*** QUERY ROWS ***')\n+// performs query and receive line table metadata and rows\n+// https://v2.docs.influxdata.com/v2.0/reference/syntax/annotated-csv/\n+queryApi.queryRows(fluxQuery, {\n+ next(row: string[], tableMeta: FluxTableMetaData) {\n+ const o = tableMeta.toObject(row)\n+ // console.log(JSON.stringify(o, null, 2))\n+ console.log(\n+ `${o._time} ${o._measurement} in '${o.location}' (${o.example}): ${o._field}=${o._value}`\n+ )\n+ },\n+ error(error: Error) {\n+ console.error(error)\n+ console.log('\\nFinished ERROR')\n+ },\n+ complete() {\n+ console.log('\\nFinished SUCCESS')\n+ },\n+})\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(query): add query parameters example |
305,159 | 15.05.2020 12:30:49 | -7,200 | 468d51a22d354547e57afebd76bb5d4c256e77ae | feat(examples): update readme to include queryParameters.ts example | [
{
"change_type": "MODIFY",
"old_path": "examples/README.md",
"new_path": "examples/README.md",
"diff": "@@ -12,6 +12,8 @@ This directory contains javascript and typescript examples for node.js and brows\nWrite data points to InfluxDB.\n- [query.ts](./query.ts)\nQuery InfluxDB with [Flux](https://v2.docs.influxdata.com/v2.0/query-data/get-started/).\n+ - [queryParameters.ts](./queryParameters.ts)\n+ Supply parameters to a [Flux](https://v2.docs.influxdata.com/v2.0/query-data/get-started/) query.\n- [health.js](./health.js)\nCheck health fo your influx DB.\n- [onboarding.js](./onboarding.js)\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(examples): update readme to include queryParameters.ts example |
305,159 | 18.05.2020 21:56:24 | -7,200 | 73fd9803686436da9514700784dfcc8266dbe318 | feat(query): return ParameterizedQuery from flux tagged template to ensure future extensibility | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/QueryApi.ts",
"new_path": "packages/core/src/QueryApi.ts",
"diff": "import {Observable} from './observable'\n-import {FluxResultObserver, FluxTableMetaData} from './query'\n+import {\n+ FluxResultObserver,\n+ FluxTableMetaData,\n+ ParameterizedQuery,\n+} from './query'\nimport {CommunicationObserver} from './transport'\nexport interface QueryOptions {\n@@ -57,14 +61,14 @@ export default interface QueryApi {\n*\n* @param query the query text in the format specifed in `QueryOptions.type`\n*/\n- lines(query: string): Observable<string>\n+ lines(query: string | ParameterizedQuery): Observable<string>\n/**\n* Creates a cold observable of the rows returned by the given query.\n*\n* @param query the query text in the format specifed in `QueryOptions.type`\n*/\n- rows(query: string): Observable<Row>\n+ rows(query: string | ParameterizedQuery): Observable<Row>\n/**\n* Executes the query and receives result lines (including empty and annotation lines)\n@@ -73,7 +77,10 @@ export default interface QueryApi {\n* @param record single line in the query result\n* @param consumer data/error consumer\n*/\n- queryLines(query: string, consumer: CommunicationObserver<string>): void\n+ queryLines(\n+ query: string | ParameterizedQuery,\n+ consumer: CommunicationObserver<string>\n+ ): void\n/**\n* Executes the query and receives table metadata and rows through the supplied consumer.\n@@ -81,5 +88,8 @@ export default interface QueryApi {\n* @param record single line in the query result\n* @param consumer data/error consumer\n*/\n- queryRows(query: string, consumer: FluxResultObserver<string[]>): void\n+ queryRows(\n+ query: string | ParameterizedQuery,\n+ consumer: FluxResultObserver<string[]>\n+ ): void\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/impl/QueryApiImpl.ts",
"new_path": "packages/core/src/impl/QueryApiImpl.ts",
"diff": "@@ -5,6 +5,7 @@ import {CommunicationObserver, Transport} from '../transport'\nimport ChunksToLines from './ChunksToLines'\nimport {toLineObserver} from './linesToTables'\nimport ObservableQuery, {QueryExecutor} from './ObservableQuery'\n+import {ParameterizedQuery} from '../query/flux'\nconst DEFAULT_dialect: any = {\nheader: true,\n@@ -26,11 +27,11 @@ export class QueryApiImpl implements QueryApi {\nreturn this\n}\n- lines(query: string): Observable<string> {\n+ lines(query: string | ParameterizedQuery): Observable<string> {\nreturn new ObservableQuery(this.createExecutor(query), identity)\n}\n- rows(query: string): Observable<Row> {\n+ rows(query: string | ParameterizedQuery): Observable<Row> {\nreturn new ObservableQuery(this.createExecutor(query), observer => {\nreturn toLineObserver({\nnext(values, tableMeta) {\n@@ -46,15 +47,21 @@ export class QueryApiImpl implements QueryApi {\n})\n}\n- queryLines(query: string, consumer: CommunicationObserver<string>): void {\n+ queryLines(\n+ query: string | ParameterizedQuery,\n+ consumer: CommunicationObserver<string>\n+ ): void {\nthis.createExecutor(query)(consumer)\n}\n- queryRows(query: string, consumer: FluxResultObserver<string[]>): void {\n+ queryRows(\n+ query: string | ParameterizedQuery,\n+ consumer: FluxResultObserver<string[]>\n+ ): void {\nthis.createExecutor(query)(toLineObserver(consumer))\n}\n- private createExecutor(query: string): QueryExecutor {\n+ private createExecutor(query: string | ParameterizedQuery): QueryExecutor {\nconst {org, type, gzip} = this.options\nreturn (consumer): void => {\n@@ -62,7 +69,7 @@ export class QueryApiImpl implements QueryApi {\n`/api/v2/query?org=${encodeURIComponent(org)}`,\nJSON.stringify(\nthis.decorateRequest({\n- query,\n+ query: query.toString(),\ndialect: DEFAULT_dialect,\ntype,\n})\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/query/flux.ts",
"new_path": "packages/core/src/query/flux.ts",
"diff": "@@ -7,6 +7,16 @@ export interface FluxParameterLike {\n[FLUX_VALUE](): string\n}\n+/**\n+ * Represents a parameterized query.\n+ */\n+export interface ParameterizedQuery {\n+ /**\n+ * Returns flux query with sanitized parameters.\n+ */\n+ toString(): string\n+}\n+\nclass FluxParameter implements FluxParameterLike {\nconstructor(private fluxValue: string) {}\ntoString(): string {\n@@ -198,7 +208,10 @@ export function toFluxValue(value: any): string {\n* Flux is a tagged template that sanitizes supplied parameters\n* to avoid injection attacks in flux.\n*/\n-export function flux(strings: TemplateStringsArray, ...values: any): string {\n+export function flux(\n+ strings: TemplateStringsArray,\n+ ...values: any\n+): ParameterizedQuery {\nif (strings.length == 1) return strings[0] // the simplest case\nconst parts = new Array<string>(strings.length + values.length)\nlet partIndex = 0\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/test/unit/query/flux.test.ts",
"new_path": "packages/core/test/unit/query/flux.test.ts",
"diff": "@@ -126,15 +126,15 @@ describe('Flux Values', () => {\ndescribe('Flux Tagged Template', () => {\nexpect(\n- flux`from(bucket:\"my-bucket\") |> range(start: 0) |> filter(fn: (r) => r._measurement == \"temperature\")`,\n+ flux`from(bucket:\"my-bucket\") |> range(start: 0) |> filter(fn: (r) => r._measurement == \"temperature\")`.toString(),\n'from(bucket:\"my-bucket\") |> range(start: 0) |> filter(fn: (r) => r._measurement == \"temperature\")'\n)\nexpect(\n- flux`from(bucket:\"my-bucket\") |> range(start: ${0}) |> filter(fn: (r) => r._measurement == ${'temperature'})`,\n+ flux`from(bucket:\"my-bucket\") |> range(start: ${0}) |> filter(fn: (r) => r._measurement == ${'temperature'})`.toString(),\n'from(bucket:\"my-bucket\") |> range(start: 0) |> filter(fn: (r) => r._measurement == \"temperature\")'\n)\nexpect(\n- flux`from(bucket:\"my-bucket\") |> range(start: ${0}) |> filter(fn: (r) => r._measurement == \"${'temperature'}\")`,\n+ flux`from(bucket:\"my-bucket\") |> range(start: ${0}) |> filter(fn: (r) => r._measurement == \"${'temperature'}\")`.toString(),\n'from(bucket:\"my-bucket\") |> range(start: 0) |> filter(fn: (r) => r._measurement == \"temperature\")'\n)\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(query): return ParameterizedQuery from flux tagged template to ensure future extensibility |
305,159 | 20.05.2020 07:18:24 | -7,200 | 2cdfefbf60f4ae4abb0eb1b5fc8f223dd811b908 | chore(query): rename queryWithParams example | [
{
"change_type": "MODIFY",
"old_path": "examples/README.md",
"new_path": "examples/README.md",
"diff": "@@ -12,7 +12,7 @@ This directory contains javascript and typescript examples for node.js and brows\nWrite data points to InfluxDB.\n- [query.ts](./query.ts)\nQuery InfluxDB with [Flux](https://v2.docs.influxdata.com/v2.0/query-data/get-started/).\n- - [queryParameters.ts](./queryParameters.ts)\n+ - [queryWithParams.ts](./queryWithParams.ts)\nSupply parameters to a [Flux](https://v2.docs.influxdata.com/v2.0/query-data/get-started/) query.\n- [health.js](./health.js)\nCheck health fo your influx DB.\n"
},
{
"change_type": "RENAME",
"old_path": "examples/queryParameters.ts",
"new_path": "examples/queryWithParams.ts",
"diff": ""
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore(query): rename queryWithParams example |
305,159 | 20.05.2020 10:05:03 | -7,200 | 280062563a17d28be408a2a508d172a6fc2f459a | fix(examples): improve heath.js example with timeout | [
{
"change_type": "MODIFY",
"old_path": "examples/README.md",
"new_path": "examples/README.md",
"diff": "@@ -15,7 +15,7 @@ This directory contains javascript and typescript examples for node.js and brows\n- [queryWithParams.ts](./queryWithParams.ts)\nSupply parameters to a [Flux](https://v2.docs.influxdata.com/v2.0/query-data/get-started/) query.\n- [health.js](./health.js)\n- Check health fo your influx DB.\n+ Check health of InfluxDB server.\n- [onboarding.js](./onboarding.js)\nPerforms onboarding of a new influxDB database. It creates a new organization, bucket and user that is then used in all examples.\n- [influxdb-1.8.ts](./influxdb-1.8.ts)\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/health.js",
"new_path": "examples/health.js",
"diff": "@@ -9,9 +9,10 @@ See https://v2.docs.influxdata.com/v2.0/api/\nconst {InfluxDB} = require('@influxdata/influxdb-client')\nconst {HealthAPI} = require('@influxdata/influxdb-client-apis')\nconst {url, token} = require('./env')\n+const timeout = 10 * 1000 // timeout for health check\nconsole.log('*** HEALTH CHECK ***')\n-const influxDB = new InfluxDB({url, token})\n+const influxDB = new InfluxDB({url, token, timeout})\nconst healthAPI = new HealthAPI(influxDB)\nhealthAPI\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | fix(examples): improve heath.js example with timeout #187 |
305,159 | 20.05.2020 10:27:15 | -7,200 | 77d4eb1c114a9f80634ae4a38821a85c8763149b | fix(examples): improve heath.js example with OK / NOT OK as influx ping does | [
{
"change_type": "MODIFY",
"old_path": "examples/health.js",
"new_path": "examples/health.js",
"diff": "@@ -19,7 +19,8 @@ healthAPI\n.getHealth()\n.then((result /* : HealthCheck */) => {\nconsole.log(JSON.stringify(result, null, 2))\n- console.log('\\nFinished SUCCESS')\n+ console.log('\\nHealth:', result.status === 'pass' ? 'OK' : 'NOT OK')\n+ console.log('\\nFinished success')\n})\n.catch(error => {\nconsole.error(error)\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | fix(examples): improve heath.js example with OK / NOT OK as influx ping does #187 |
305,159 | 20.05.2020 10:27:59 | -7,200 | 68eb707ef333a1d7188300ff43b208fb396f702c | chore(query): export FLUX_VALUE symbol | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/query/flux.ts",
"new_path": "packages/core/src/query/flux.ts",
"diff": "-const FLUX_VALUE = Symbol.for('FLUX_VALUE')\n+export const FLUX_VALUE = Symbol('FLUX_VALUE')\n/**\n* A flux parameter can print its (sanitized) flux value.\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/test/unit/query/flux.test.ts",
"new_path": "packages/core/test/unit/query/flux.test.ts",
"diff": "@@ -9,11 +9,10 @@ import {\ntoFluxValue,\nfluxBool,\nflux,\n+ FLUX_VALUE,\n} from '../../../src'\nimport {expect} from 'chai'\n-const FLUX_VALUE = Symbol.for('FLUX_VALUE')\n-\ndescribe('Flux Values', () => {\nit('creates fluxLiteral', () => {\nconst value = '12345'\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore(query): export FLUX_VALUE symbol |
305,159 | 20.05.2020 11:38:15 | -7,200 | 2a3091a780b5ad43893ae18de1e7d5afa0140947 | chore(query/flux): refactor fluxLiteral to fluxExpression | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/query/flux.ts",
"new_path": "packages/core/src/query/flux.ts",
"diff": "@@ -167,12 +167,13 @@ export function fluxBool(value: any): FluxParameterLike {\n}\n/**\n- * Assumes that the supplied string is a flux literal value and creates\n- * a parameter out of it.\n+ * Assumes that the supplied value is flux expression or literal that does not need sanitizing.\n+ *\n+ * @param value any value\n+ * @returns the supplied value as-is\n*/\n-export function fluxLiteral(value: string): FluxParameterLike {\n- // let the server decide if it can be parsed\n- return new FluxParameter(value)\n+export function fluxExpression(value: any): FluxParameterLike {\n+ return new FluxParameter(String(value))\n}\n/**\n@@ -212,7 +213,7 @@ export function flux(\nstrings: TemplateStringsArray,\n...values: any\n): ParameterizedQuery {\n- if (strings.length == 1) return strings[0] // the simplest case\n+ if (strings.length == 1 && (!values || values.length === 0)) return strings[0] // the simplest case\nconst parts = new Array<string>(strings.length + values.length)\nlet partIndex = 0\nfor (let i = 0; i < strings.length; i++) {\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/test/unit/query/flux.test.ts",
"new_path": "packages/core/test/unit/query/flux.test.ts",
"diff": "import {\n- fluxLiteral,\n+ fluxExpression,\nfluxInteger,\nfluxFloat,\nfluxDuration,\n@@ -14,9 +14,9 @@ import {\nimport {expect} from 'chai'\ndescribe('Flux Values', () => {\n- it('creates fluxLiteral', () => {\n+ it('creates fluxExpression', () => {\nconst value = '12345'\n- const subject = fluxLiteral(value)\n+ const subject = fluxExpression(value)\nexpect(subject.toString()).equals(value)\nexpect((subject as any)[FLUX_VALUE]()).equals(value)\n})\n@@ -107,7 +107,7 @@ describe('Flux Values', () => {\n},\nflux: '\"whatever\"',\n},\n- {value: fluxLiteral('1ms'), flux: '1ms'},\n+ {value: fluxExpression('1ms'), flux: '1ms'},\n{value: 'abc\\n\\r\\t\\\\\"def', flux: '\"abc\\\\n\\\\r\\\\t\\\\\\\\\\\\\"def\"'},\n{value: 'abc${val}def', flux: '\"abc\\\\${val}def\"'},\n{value: 'abc$', flux: '\"abc$\"'},\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | chore(query/flux): refactor fluxLiteral to fluxExpression |
305,159 | 20.05.2020 11:47:19 | -7,200 | 4c407783555dc484da551642ff0a403fc3e31733 | feat(query/flux): allow nesting of flux templates | [
{
"change_type": "MODIFY",
"old_path": "packages/core/src/query/flux.ts",
"new_path": "packages/core/src/query/flux.ts",
"diff": "@@ -17,7 +17,7 @@ export interface ParameterizedQuery {\ntoString(): string\n}\n-class FluxParameter implements FluxParameterLike {\n+class FluxParameter implements FluxParameterLike, ParameterizedQuery {\nconstructor(private fluxValue: string) {}\ntoString(): string {\nreturn this.fluxValue\n@@ -242,5 +242,6 @@ export function flux(\nthrow new Error('Too few parameters supplied!')\n}\n}\n- return parts.join('')\n+ // return flux expression so that flux can be embedded into another flux as-is\n+ return fluxExpression(parts.join(''))\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/test/unit/query/flux.test.ts",
"new_path": "packages/core/test/unit/query/flux.test.ts",
"diff": "@@ -150,4 +150,11 @@ describe('Flux Tagged Template', () => {\n} catch (_e) {\n// ok expected, too few arguments supplied to a tagged template\n}\n+\n+ // nested flux templates\n+ const flux1 = flux`from(bucket:\"my-bucket\")`\n+ expect(\n+ flux`${flux1} |> range(start: ${0})\")`.toString(),\n+ 'from(bucket:\"my-bucket\") |> range(start: 0)\")'\n+ )\n})\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(query/flux): allow nesting of flux templates |
305,159 | 25.05.2020 07:31:48 | -7,200 | 3340b21dc833cf57d77b713d21d15c6e75af8fbc | fix(example): add timestamp to write example | [
{
"change_type": "MODIFY",
"old_path": "examples/index.html",
"new_path": "examples/index.html",
"diff": ".tag('example', 'index.html')\n.floatField('value', value)\nwriteApi.writePoint(point1)\n- log(` ${point1}`)\n+ log(` ${point1.toLineProtocol()}`)\n// flush pending writes and close writeApi\nwriteApi\n"
},
{
"change_type": "MODIFY",
"old_path": "examples/write.js",
"new_path": "examples/write.js",
"diff": "@@ -8,20 +8,23 @@ const {url, token, org, bucket} = require('./env')\nconst {hostname} = require('os')\nconsole.log('*** WRITE POINTS ***')\n-const writeApi = new InfluxDB({url, token}).getWriteApi(org, bucket)\n+const writeApi = new InfluxDB({url, token}).getWriteApi(org, bucket, 'ns')\n// setup default tags for all writes through this API\nwriteApi.useDefaultTags({location: hostname()})\n+// write point with the current (client-side) timestamp\nconst point1 = new Point('temperature')\n.tag('example', 'write.ts')\n.floatField('value', 20 + Math.round(100 * Math.random()) / 10)\nwriteApi.writePoint(point1)\nconsole.log(` ${point1}`)\n+// write point with a custom timestamp\nconst point2 = new Point('temperature')\n.tag('example', 'write.ts')\n.floatField('value', 10 + Math.round(100 * Math.random()) / 10)\n+ .timestamp(new Date()) // can be also a number, but in writeApi's precision units (s, ms, us, ns)!\nwriteApi.writePoint(point2)\n-console.log(` ${point2}`)\n+console.log(` ${point2.toLineProtocol(writeApi)}`)\n// flush pending writes and close writeApi\nwriteApi\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/Point.ts",
"new_path": "packages/core/src/Point.ts",
"diff": "@@ -113,7 +113,7 @@ export default class Point {\n}\n/**\n- * Sets point time. A string or number value is used\n+ * Sets point time. A string or number value can be used\n* to carry an int64 value of a precision that depends\n* on WriteApi, nanoseconds by default. An undefined value\n* generates a local timestamp using the client's clock.\n@@ -123,7 +123,7 @@ export default class Point {\n* @param value point time\n* @return this\n*/\n- public timestamp(value: string | number | Date | undefined): Point {\n+ public timestamp(value: Date | number | string | undefined): Point {\nthis.time = value\nreturn this\n}\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | fix(example): add timestamp to write example |
305,159 | 29.05.2020 06:25:55 | -7,200 | 4b323360ef16e73a16b4e328ad1efee4f1651cc6 | fix(api/generator): inspect also array of anonymous objects | [
{
"change_type": "MODIFY",
"old_path": "packages/apis/generator/typesCollector.ts",
"new_path": "packages/apis/generator/typesCollector.ts",
"diff": "@@ -5,7 +5,7 @@ export default class TypesCollector {\ntypes: {[key: string]: boolean} = {}\nadd(type: string): void {\nif (type && type.charAt(0).toUpperCase() === type.charAt(0)) {\n- if (type.startsWith('{')) {\n+ if (type.startsWith('{') || type.startsWith('Array<{')) {\n// anonymous type; process references to custom types in it\n// see typesCollector.test.ts\nconst customTypeRegExp = / ([A-Z][A-Za-z0-9-_| ]*);\\n/g\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/test/unit/typesCollector.test.ts",
"new_path": "packages/apis/test/unit/typesCollector.test.ts",
"diff": "@@ -36,6 +36,13 @@ describe('TypesCollector', () => {\ntoAdd: ['{\\n d?: D | C;\\n description?: A;\\n name?: string;\\n}'],\nresult: 'A, C, D',\n},\n+ {\n+ name: 'collect anonymous type 2',\n+ toAdd: [\n+ 'Array<{\\n d?: D | C;\\n description?: A;\\n name?: string;\\n}>',\n+ ],\n+ result: 'A, C, D',\n+ },\n]\ntests.forEach(test => {\nit(test.name, () => {\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | fix(api/generator): inspect also array of anonymous objects |
305,159 | 29.05.2020 14:37:25 | -7,200 | 0346db6c2df2675e43e3462a2f9906e9826b6eca | feat(api/generator): import type of Array retval properly | [
{
"change_type": "MODIFY",
"old_path": "packages/apis/generator/typesCollector.ts",
"new_path": "packages/apis/generator/typesCollector.ts",
"diff": "@@ -14,6 +14,8 @@ export default class TypesCollector {\n// console.log('match[1]', match[1], customTypeRegExp.lastIndex)\nthis.add(match[1])\n}\n+ } else if (type.endsWith('[]')) {\n+ this.types[type.substring(0, type.length - 2)] = true\n} else if (type.includes('|')) {\ntype\n.split('|')\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/test/unit/typesCollector.test.ts",
"new_path": "packages/apis/test/unit/typesCollector.test.ts",
"diff": "@@ -43,6 +43,16 @@ describe('TypesCollector', () => {\n],\nresult: 'A, C, D',\n},\n+ {\n+ name: 'collect ListItem[]',\n+ toAdd: ['ListItem[]'],\n+ result: 'ListItem',\n+ },\n+ {\n+ name: 'collect string[]',\n+ toAdd: ['string[]'],\n+ result: '',\n+ },\n]\ntests.forEach(test => {\nit(test.name, () => {\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(api/generator): import type of Array retval properly |
305,159 | 02.06.2020 08:56:35 | -7,200 | 6e9cbaa8ea7190c9f483fad4356755cb161003d3 | feat(docs): explain writeApi buffering in the example and api docs | [
{
"change_type": "MODIFY",
"old_path": "examples/write.js",
"new_path": "examples/write.js",
"diff": "@@ -26,7 +26,9 @@ const point2 = new Point('temperature')\nwriteApi.writePoint(point2)\nconsole.log(` ${point2.toLineProtocol(writeApi)}`)\n-// flush pending writes and close writeApi\n+// WriteApi always buffer data into batches to optimize data transfer to InfluxDB server and retries\n+// writing upon server/network failure. writeApi.flush() can be called to flush the buffered data,\n+// close() also flushes the remaining buffered data and then cancels pending retries.\nwriteApi\n.close()\n.then(() => {\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/core/src/WriteApi.ts",
"new_path": "packages/core/src/WriteApi.ts",
"diff": "@@ -2,6 +2,9 @@ import Point from './Point'\n/**\n* The asynchronous buffering API to Write time-series data into InfluxDB 2.0.\n+ * This API always buffers points/lines to create batches under the hood\n+ * to optimize data transfer to InfluxDB server, use `flush` to send\n+ * the buffered data to InfluxDB immediately.\n* <p>\n* The data are formatted in [Line Protocol](https://bit.ly/2QL99fu).\n* <p>\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | feat(docs): explain writeApi buffering in the example and api docs |
305,159 | 05.06.2020 04:40:23 | -7,200 | 514658acbbb50b668c6dc88311532416c86a1e89 | fix(swagger): update generated cause after influxdb fixes
influxdata/influxdb#18250
influxdata/influxdb#18325 | [
{
"change_type": "MODIFY",
"old_path": "packages/apis/resources/operations.json",
"new_path": "packages/apis/resources/operations.json",
"diff": "\"server\": \"/api/v2\",\n\"path\": \"/dbrps\",\n\"operation\": \"get\",\n- \"operationId\": \"GetDPRPs\",\n+ \"operationId\": \"GetDBRPs\",\n\"basicAuth\": false,\n\"summary\": \"List all database retention policy mappings\",\n\"positionalParams\": [],\n},\n{\n\"server\": \"/api/v2\",\n- \"path\": \"/dprps/{dbrpID}\",\n+ \"path\": \"/dbrps/{dbrpID}\",\n\"operation\": \"get\",\n\"operationId\": \"GetDBRPsID\",\n\"basicAuth\": false,\n},\n{\n\"server\": \"/api/v2\",\n- \"path\": \"/dprps/{dbrpID}\",\n+ \"path\": \"/dbrps/{dbrpID}\",\n\"operation\": \"patch\",\n\"operationId\": \"PatchDBRPID\",\n\"basicAuth\": false,\n},\n{\n\"server\": \"/api/v2\",\n- \"path\": \"/dprps/{dbrpID}\",\n+ \"path\": \"/dbrps/{dbrpID}\",\n\"operation\": \"delete\",\n\"operationId\": \"DeleteDBRPID\",\n\"basicAuth\": false,\n\"server\": \"/api/v2\",\n\"path\": \"/orgs/{orgID}/invites/{inviteID}/resend\",\n\"operation\": \"post\",\n- \"operationId\": \"ResendOrgsIDInviteID\",\n+ \"operationId\": \"PostOrgsIDInviteID\",\n\"basicAuth\": false,\n\"summary\": \"Resends an invite\",\n\"positionalParams\": [\n{\n\"mediaType\": \"application/json\",\n\"type\": \"Pkg\"\n+ },\n+ {\n+ \"mediaType\": \"application/x-yaml\",\n+ \"type\": \"Pkg\"\n}\n]\n},\n}\n]\n},\n+ {\n+ \"server\": \"/api/v2\",\n+ \"path\": \"/packages/stacks/{stack_id}/export\",\n+ \"operation\": \"delete\",\n+ \"operationId\": \"ExportStack\",\n+ \"basicAuth\": false,\n+ \"summary\": \"Export a stack's resources in the form of a package\",\n+ \"positionalParams\": [\n+ {\n+ \"name\": \"stack_id\",\n+ \"description\": \"The stack id to be removed\",\n+ \"required\": true,\n+ \"type\": \"string\"\n+ }\n+ ],\n+ \"headerParams\": [],\n+ \"queryParams\": [\n+ {\n+ \"name\": \"orgID\",\n+ \"description\": \"The organization id of the user\",\n+ \"required\": true,\n+ \"type\": \"string\"\n+ }\n+ ],\n+ \"bodyParam\": null,\n+ \"responses\": [\n+ {\n+ \"code\": \"200\",\n+ \"description\": \"Stack and all its associated resources are deleted\",\n+ \"mediaTypes\": [\n+ {\n+ \"mediaType\": \"application/json\",\n+ \"type\": \"Pkg\"\n+ },\n+ {\n+ \"mediaType\": \"application/x-yaml\",\n+ \"type\": \"Pkg\"\n+ }\n+ ]\n+ },\n+ {\n+ \"code\": \"default\",\n+ \"description\": \"Unexpected error\",\n+ \"mediaTypes\": [\n+ {\n+ \"mediaType\": \"application/json\",\n+ \"type\": \"Error\"\n+ }\n+ ]\n+ }\n+ ]\n+ },\n{\n\"server\": \"/api/v2\",\n\"path\": \"/tasks\",\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/resources/swagger.yml",
"new_path": "packages/apis/resources/swagger.yml",
"diff": "@@ -375,7 +375,7 @@ paths:\n$ref: '#/components/schemas/Error'\n/dbrps:\nget:\n- operationId: GetDPRPs\n+ operationId: GetDBRPs\ntags:\n- DBRPs\nsummary: List all database retention policy mappings\n@@ -464,7 +464,7 @@ paths:\napplication/json:\nschema:\n$ref: '#/components/schemas/Error'\n- '/dprps/{dbrpID}':\n+ '/dbrps/{dbrpID}':\nget:\noperationId: GetDBRPsID\ntags:\n@@ -4560,7 +4560,7 @@ paths:\n$ref: '#/components/schemas/Error'\n'/orgs/{orgID}/invites/{inviteID}/resend':\npost:\n- operationId: ResendOrgsIDInviteID\n+ operationId: PostOrgsIDInviteID\ntags:\n- Invites\n- Organizations\n@@ -4728,6 +4728,9 @@ paths:\napplication/json:\nschema:\n$ref: '#/components/schemas/Pkg'\n+ application/x-yaml:\n+ schema:\n+ $ref: '#/components/schemas/Pkg'\ndefault:\ndescription: Unexpected error\ncontent:\n@@ -4942,6 +4945,41 @@ paths:\napplication/json:\nschema:\n$ref: '#/components/schemas/Error'\n+ /packages/stacks/{stack_id}/export:\n+ delete:\n+ operationId: ExportStack\n+ tags:\n+ - InfluxPackages\n+ summary: Export a stack's resources in the form of a package\n+ parameters:\n+ - in: path\n+ name: stack_id\n+ required: true\n+ schema:\n+ type: string\n+ description: The stack id to be removed\n+ - in: query\n+ name: orgID\n+ required: true\n+ schema:\n+ type: string\n+ description: The organization id of the user\n+ responses:\n+ '200':\n+ description: Stack and all its associated resources are deleted\n+ content:\n+ application/json:\n+ schema:\n+ $ref: '#/components/schemas/Pkg'\n+ application/x-yaml:\n+ schema:\n+ $ref: '#/components/schemas/Pkg'\n+ default:\n+ description: Unexpected error\n+ content:\n+ application/json:\n+ schema:\n+ $ref: '#/components/schemas/Error'\n/tasks:\nget:\noperationId: GetTasks\n@@ -10971,6 +11009,8 @@ components:\ntype: string\nproperties:\ntype: object\n+ additionalProperties:\n+ type: string\ndescription: Key/Value pairs associated with this label. Keys can be removed by sending an update with an empty value.\nexample: {'color': 'ffb3b3', 'description': 'this is a description'}\nLabelMapping:\n@@ -11681,6 +11721,7 @@ components:\nDBRP:\nrequired:\n- orgID\n+ - org\n- bucketID\n- database\n- retention_policy\n@@ -11692,6 +11733,9 @@ components:\norgID:\ntype: string\ndescription: the organization ID that owns this mapping.\n+ org:\n+ type: string\n+ description: the organization that owns this mapping.\nbucketID:\ntype: string\ndescription: the bucket ID used as target for the translation.\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/src/generated/DbrpsAPI.ts",
"new_path": "packages/apis/src/generated/DbrpsAPI.ts",
"diff": "import {APIBase, RequestOptions} from '../APIBase'\n-import {DBRP, DBRPs} from './types'\n+import {DBRP, DBRPUpdate, DBRPs} from './types'\n-export interface GetDPRPsRequest {\n+export interface GetDBRPsRequest {\n/** Specifies the organization ID to filter on */\norgID: string\n/** Specifies the mapping ID to filter on */\n@@ -19,10 +19,33 @@ export interface PostDBRPRequest {\n/** The database retention policy mapping to add */\nbody: DBRP\n}\n+export interface GetDBRPsIDRequest {\n+ /** The database retention policy mapping ID */\n+ dbrpID: string\n+ /** Specifies the organization ID of the mapping */\n+ orgID: string\n+}\n+export interface PatchDBRPIDRequest {\n+ /** The database retention policy mapping. */\n+ dbrpID: string\n+ /** Database retention policy update to apply */\n+ body: DBRPUpdate\n+ /** Specifies the organization ID of the mapping */\n+ orgID: string\n+}\n+export interface DeleteDBRPIDRequest {\n+ /** The database retention policy mapping */\n+ dbrpID: string\n+ /** Specifies the organization ID of the mapping */\n+ orgID: string\n+}\n/**\n* See\n- * * https://v2.docs.influxdata.com/v2.0/api/#operation/GetDPRPs\n+ * * https://v2.docs.influxdata.com/v2.0/api/#operation/GetDBRPs\n* * https://v2.docs.influxdata.com/v2.0/api/#operation/PostDBRP\n+ * * https://v2.docs.influxdata.com/v2.0/api/#operation/GetDBRPsID\n+ * * https://v2.docs.influxdata.com/v2.0/api/#operation/PatchDBRPID\n+ * * https://v2.docs.influxdata.com/v2.0/api/#operation/DeleteDBRPID\n*/\nexport class DbrpsAPI extends APIBase {\n/**\n@@ -33,12 +56,12 @@ export class DbrpsAPI extends APIBase {\n}\n/**\n* List all database retention policy mappings.\n- * See https://v2.docs.influxdata.com/v2.0/api/#operation/GetDPRPs\n+ * See https://v2.docs.influxdata.com/v2.0/api/#operation/GetDBRPs\n* @param request\n* @return promise of response\n*/\n- getDPRPs(\n- request: GetDPRPsRequest,\n+ getDBRPs(\n+ request: GetDBRPsRequest,\nrequestOptions?: RequestOptions\n): Promise<DBRPs> {\nreturn this.request(\n@@ -73,4 +96,56 @@ export class DbrpsAPI extends APIBase {\n'application/json'\n)\n}\n+ /**\n+ * Retrieve a database retention policy mapping.\n+ * See https://v2.docs.influxdata.com/v2.0/api/#operation/GetDBRPsID\n+ * @param request\n+ * @return promise of response\n+ */\n+ getDBRPsID(\n+ request: GetDBRPsIDRequest,\n+ requestOptions?: RequestOptions\n+ ): Promise<DBRP> {\n+ return this.request(\n+ 'GET',\n+ `/api/v2/dbrps/${request.dbrpID}${this.queryString(request, ['orgID'])}`,\n+ request,\n+ requestOptions\n+ )\n+ }\n+ /**\n+ * Update a database retention policy mapping.\n+ * See https://v2.docs.influxdata.com/v2.0/api/#operation/PatchDBRPID\n+ * @param request\n+ * @return promise of response\n+ */\n+ patchDBRPID(\n+ request: PatchDBRPIDRequest,\n+ requestOptions?: RequestOptions\n+ ): Promise<DBRP> {\n+ return this.request(\n+ 'PATCH',\n+ `/api/v2/dbrps/${request.dbrpID}${this.queryString(request, ['orgID'])}`,\n+ request,\n+ requestOptions,\n+ 'application/json'\n+ )\n+ }\n+ /**\n+ * Delete a database retention policy.\n+ * See https://v2.docs.influxdata.com/v2.0/api/#operation/DeleteDBRPID\n+ * @param request\n+ * @return promise of response\n+ */\n+ deleteDBRPID(\n+ request: DeleteDBRPIDRequest,\n+ requestOptions?: RequestOptions\n+ ): Promise<void> {\n+ return this.request(\n+ 'DELETE',\n+ `/api/v2/dbrps/${request.dbrpID}${this.queryString(request, ['orgID'])}`,\n+ request,\n+ requestOptions\n+ )\n+ }\n}\n"
},
{
"change_type": "DELETE",
"old_path": "packages/apis/src/generated/DprpsAPI.ts",
"new_path": null,
"diff": "-import {APIBase, RequestOptions} from '../APIBase'\n-import {DBRP, DBRPUpdate} from './types'\n-\n-export interface GetDBRPsIDRequest {\n- /** The database retention policy mapping ID */\n- dbrpID: string\n- /** Specifies the organization ID of the mapping */\n- orgID: string\n-}\n-export interface PatchDBRPIDRequest {\n- /** The database retention policy mapping. */\n- dbrpID: string\n- /** Database retention policy update to apply */\n- body: DBRPUpdate\n- /** Specifies the organization ID of the mapping */\n- orgID: string\n-}\n-export interface DeleteDBRPIDRequest {\n- /** The database retention policy mapping */\n- dbrpID: string\n- /** Specifies the organization ID of the mapping */\n- orgID: string\n-}\n-/**\n- * See\n- * * https://v2.docs.influxdata.com/v2.0/api/#operation/GetDBRPsID\n- * * https://v2.docs.influxdata.com/v2.0/api/#operation/PatchDBRPID\n- * * https://v2.docs.influxdata.com/v2.0/api/#operation/DeleteDBRPID\n- */\n-export class DprpsAPI extends APIBase {\n- /**\n- * Creates DprpsAPI from an influxDB object.\n- */\n- constructor(influxDB: any) {\n- super(influxDB)\n- }\n- /**\n- * Retrieve a database retention policy mapping.\n- * See https://v2.docs.influxdata.com/v2.0/api/#operation/GetDBRPsID\n- * @param request\n- * @return promise of response\n- */\n- getDBRPsID(\n- request: GetDBRPsIDRequest,\n- requestOptions?: RequestOptions\n- ): Promise<DBRP> {\n- return this.request(\n- 'GET',\n- `/api/v2/dprps/${request.dbrpID}${this.queryString(request, ['orgID'])}`,\n- request,\n- requestOptions\n- )\n- }\n- /**\n- * Update a database retention policy mapping.\n- * See https://v2.docs.influxdata.com/v2.0/api/#operation/PatchDBRPID\n- * @param request\n- * @return promise of response\n- */\n- patchDBRPID(\n- request: PatchDBRPIDRequest,\n- requestOptions?: RequestOptions\n- ): Promise<DBRP> {\n- return this.request(\n- 'PATCH',\n- `/api/v2/dprps/${request.dbrpID}${this.queryString(request, ['orgID'])}`,\n- request,\n- requestOptions,\n- 'application/json'\n- )\n- }\n- /**\n- * Delete a database retention policy.\n- * See https://v2.docs.influxdata.com/v2.0/api/#operation/DeleteDBRPID\n- * @param request\n- * @return promise of response\n- */\n- deleteDBRPID(\n- request: DeleteDBRPIDRequest,\n- requestOptions?: RequestOptions\n- ): Promise<void> {\n- return this.request(\n- 'DELETE',\n- `/api/v2/dprps/${request.dbrpID}${this.queryString(request, ['orgID'])}`,\n- request,\n- requestOptions\n- )\n- }\n-}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/src/generated/OrgsAPI.ts",
"new_path": "packages/apis/src/generated/OrgsAPI.ts",
"diff": "@@ -114,7 +114,7 @@ export interface DeleteOrgsIDInviteIDRequest {\n/** The organization ID. */\norgID: string\n}\n-export interface ResendOrgsIDInviteIDRequest {\n+export interface PostOrgsIDInviteIDRequest {\n/** The ID of the invite to resend. */\ninviteID: string\n/** The organization ID. */\n@@ -162,7 +162,7 @@ export interface GetOrgsIDLogsRequest {\n* * https://v2.docs.influxdata.com/v2.0/api/#operation/PostOrgsIDOwners\n* * https://v2.docs.influxdata.com/v2.0/api/#operation/PostOrgsIDInvites\n* * https://v2.docs.influxdata.com/v2.0/api/#operation/DeleteOrgsIDInviteID\n- * * https://v2.docs.influxdata.com/v2.0/api/#operation/ResendOrgsIDInviteID\n+ * * https://v2.docs.influxdata.com/v2.0/api/#operation/PostOrgsIDInviteID\n* * https://v2.docs.influxdata.com/v2.0/api/#operation/GetCloudUsers\n* * https://v2.docs.influxdata.com/v2.0/api/#operation/DeleteOrgsIDCloudUserID\n* * https://v2.docs.influxdata.com/v2.0/api/#operation/DeleteOrgsIDOwnersID\n@@ -491,12 +491,12 @@ export class OrgsAPI extends APIBase {\n}\n/**\n* Resends an invite.\n- * See https://v2.docs.influxdata.com/v2.0/api/#operation/ResendOrgsIDInviteID\n+ * See https://v2.docs.influxdata.com/v2.0/api/#operation/PostOrgsIDInviteID\n* @param request\n* @return promise of response\n*/\n- resendOrgsIDInviteID(\n- request: ResendOrgsIDInviteIDRequest,\n+ postOrgsIDInviteID(\n+ request: PostOrgsIDInviteIDRequest,\nrequestOptions?: RequestOptions\n): Promise<Invite> {\nreturn this.request(\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/src/generated/PackagesAPI.ts",
"new_path": "packages/apis/src/generated/PackagesAPI.ts",
"diff": "@@ -31,6 +31,12 @@ export interface DeleteStackRequest {\n/** The organization id of the user */\norgID: string\n}\n+export interface ExportStackRequest {\n+ /** The stack id to be removed */\n+ stack_id: string\n+ /** The organization id of the user */\n+ orgID: string\n+}\n/**\n* See\n* * https://v2.docs.influxdata.com/v2.0/api/#operation/CreatePkg\n@@ -38,6 +44,7 @@ export interface DeleteStackRequest {\n* * https://v2.docs.influxdata.com/v2.0/api/#operation/ListStacks\n* * https://v2.docs.influxdata.com/v2.0/api/#operation/CreateStack\n* * https://v2.docs.influxdata.com/v2.0/api/#operation/DeleteStack\n+ * * https://v2.docs.influxdata.com/v2.0/api/#operation/ExportStack\n*/\nexport class PackagesAPI extends APIBase {\n/**\n@@ -168,4 +175,23 @@ export class PackagesAPI extends APIBase {\nrequestOptions\n)\n}\n+ /**\n+ * Export a stack's resources in the form of a package.\n+ * See https://v2.docs.influxdata.com/v2.0/api/#operation/ExportStack\n+ * @param request\n+ * @return promise of response\n+ */\n+ exportStack(\n+ request: ExportStackRequest,\n+ requestOptions?: RequestOptions\n+ ): Promise<Pkg> {\n+ return this.request(\n+ 'DELETE',\n+ `/api/v2/packages/stacks/${\n+ request.stack_id\n+ }/export${this.queryString(request, ['orgID'])}`,\n+ request,\n+ requestOptions\n+ )\n+ }\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/src/generated/index.ts",
"new_path": "packages/apis/src/generated/index.ts",
"diff": "@@ -7,7 +7,6 @@ export * from './DashboardsAPI'\nexport * from './DbrpsAPI'\nexport * from './DeleteAPI'\nexport * from './DocumentsAPI'\n-export * from './DprpsAPI'\nexport * from './FlagsAPI'\nexport * from './HealthAPI'\nexport * from './LabelsAPI'\n"
},
{
"change_type": "MODIFY",
"old_path": "packages/apis/src/generated/types.ts",
"new_path": "packages/apis/src/generated/types.ts",
"diff": "@@ -305,6 +305,8 @@ export interface DBRP {\nreadonly id?: string\n/** the organization ID that owns this mapping. */\norgID: string\n+ /** the organization that owns this mapping. */\n+ org: string\n/** the bucket ID used as target for the translation. */\nbucketID: string\n/** InfluxDB v1 database */\n"
}
] | TypeScript | MIT License | influxdata/influxdb-client-js | fix(swagger): update generated cause after influxdb fixes
influxdata/influxdb#18250
influxdata/influxdb#18325 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.