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,164
28.02.2019 16:38:08
28,800
f3e06be3174635ecdd276c45a8b2ac8f168930d3
Standardize label methods in dashboards
[ { "change_type": "MODIFY", "old_path": "src/wrappers/dashboards.ts", "new_path": "src/wrappers/dashboards.ts", "diff": "@@ -97,7 +97,7 @@ export default class {\nreturn data.cells || [];\n}\n- public async createLabel(dashboardID: string, labelID: string): Promise<ILabel> {\n+ public async addLabel(dashboardID: string, labelID: string): Promise<ILabel> {\nconst {data} = await this.service.dashboardsDashboardIDLabelsPost(dashboardID, {\nlabelID,\n});\n@@ -109,7 +109,13 @@ export default class {\nreturn addLabelDefaults(data.label);\n}\n- public async deleteLabel(dashboardID: string, labelID: string): Promise<Response> {\n+ public async addLabels(dashboardID: string, labelIDs: string[]): Promise<ILabel[]> {\n+ return Promise.all(labelIDs.map((labelID) => {\n+ return this.addLabel(dashboardID, labelID);\n+ }));\n+ }\n+\n+ public async removeLabel(dashboardID: string, labelID: string): Promise<Response> {\nconst {data} = await this.service.dashboardsDashboardIDLabelsLabelIDDelete(dashboardID, labelID);\nreturn data;\n@@ -153,9 +159,7 @@ export default class {\n}\nconst labels = originalDashboard.labels || [];\n- const pendingLabels = labels.map(async (label) => this.createLabel(newDashboard.id || \"\", label.id || \"\"));\n-\n- const newLabels = await Promise.all(pendingLabels);\n+ const newLabels = await this.addLabels(newDashboard.id, labels.map((label) => label.id || \"\"));\nreturn newLabels.filter((l) => !!l).map(addLabelDefaults);\n}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Standardize label methods in dashboards
305,164
01.03.2019 09:49:30
28,800
1dbe6543033ebced4c31397ca13eebd54bed7a5f
Add getAllByOrgID to dashboards
[ { "change_type": "MODIFY", "old_path": "src/api/api.ts", "new_path": "src/api/api.ts", "diff": "@@ -863,6 +863,32 @@ export interface CreateCell {\nusingView?: string;\n}\n+/**\n+ *\n+ * @export\n+ * @interface CreateDashboardRequest\n+ */\n+export interface CreateDashboardRequest {\n+ /**\n+ * id of the organization that owns the dashboard\n+ * @type {string}\n+ * @memberof CreateDashboardRequest\n+ */\n+ orgID: string;\n+ /**\n+ * user-facing name of the dashboard\n+ * @type {string}\n+ * @memberof CreateDashboardRequest\n+ */\n+ name: string;\n+ /**\n+ * user-facing description of the dashboard\n+ * @type {string}\n+ * @memberof CreateDashboardRequest\n+ */\n+ description?: string;\n+}\n+\n/**\n*\n* @export\n@@ -882,43 +908,25 @@ export interface CreateProtoResourcesRequest {\n* @export\n* @interface Dashboard\n*/\n-export interface Dashboard {\n+export interface Dashboard extends CreateDashboardRequest {\n/**\n*\n- * @type {DashboardLinks}\n+ * @type {any}\n* @memberof Dashboard\n*/\n- links?: DashboardLinks;\n+ links?: any;\n/**\n*\n* @type {string}\n* @memberof Dashboard\n*/\nid?: string;\n- /**\n- * id of the organization that owns the dashboard\n- * @type {string}\n- * @memberof Dashboard\n- */\n- orgID?: string;\n- /**\n- * user-facing name of the dashboard\n- * @type {string}\n- * @memberof Dashboard\n- */\n- name?: string;\n- /**\n- * user-facing description of the dashboard\n- * @type {string}\n- * @memberof Dashboard\n- */\n- description?: string;\n/**\n*\n- * @type {DashboardMeta}\n+ * @type {any}\n* @memberof Dashboard\n*/\n- meta?: DashboardMeta;\n+ meta?: any;\n/**\n*\n* @type {Array<Cell>}\n@@ -987,46 +995,6 @@ export namespace DashboardColor {\n}\n}\n-/**\n- *\n- * @export\n- * @interface DashboardLinks\n- */\n-export interface DashboardLinks {\n- /**\n- *\n- * @type {string}\n- * @memberof DashboardLinks\n- */\n- self?: string;\n- /**\n- *\n- * @type {string}\n- * @memberof DashboardLinks\n- */\n- cells?: string;\n-}\n-\n-/**\n- *\n- * @export\n- * @interface DashboardMeta\n- */\n-export interface DashboardMeta {\n- /**\n- *\n- * @type {string}\n- * @memberof DashboardMeta\n- */\n- createdAt?: string;\n- /**\n- *\n- * @type {string}\n- * @memberof DashboardMeta\n- */\n- updatedAt?: string;\n-}\n-\n/**\n*\n* @export\n@@ -9928,15 +9896,15 @@ export const DashboardsApiAxiosParamCreator = function (configuration?: Configur\n/**\n*\n* @summary Create a dashboard\n- * @param {Dashboard} dashboard dashboard to create\n+ * @param {CreateDashboardRequest} createDashboardRequest dashboard to create\n* @param {string} [zapTraceSpan] OpenTracing span context\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- dashboardsPost(dashboard: Dashboard, zapTraceSpan?: string, options: any = {}): RequestArgs {\n- // verify required parameter 'dashboard' is not null or undefined\n- if (dashboard === null || dashboard === undefined) {\n- throw new RequiredError('dashboard','Required parameter dashboard was null or undefined when calling dashboardsPost.');\n+ dashboardsPost(createDashboardRequest: CreateDashboardRequest, zapTraceSpan?: string, options: any = {}): RequestArgs {\n+ // verify required parameter 'createDashboardRequest' is not null or undefined\n+ if (createDashboardRequest === null || createDashboardRequest === undefined) {\n+ throw new RequiredError('createDashboardRequest','Required parameter createDashboardRequest was null or undefined when calling dashboardsPost.');\n}\nconst localVarPath = `/dashboards`;\nconst localVarUrlObj = url.parse(localVarPath, true);\n@@ -9958,8 +9926,8 @@ export const DashboardsApiAxiosParamCreator = function (configuration?: Configur\n// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943\ndelete localVarUrlObj.search;\nlocalVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);\n- const needsSerialization = (<any>\"Dashboard\" !== \"string\") || localVarRequestOptions.headers['Content-Type'] === 'application/json';\n- localVarRequestOptions.data = needsSerialization ? JSON.stringify(dashboard || {}) : (dashboard || \"\");\n+ const needsSerialization = (<any>\"CreateDashboardRequest\" !== \"string\") || localVarRequestOptions.headers['Content-Type'] === 'application/json';\n+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(createDashboardRequest || {}) : (createDashboardRequest || \"\");\nreturn {\nurl: url.format(localVarUrlObj),\n@@ -10299,13 +10267,13 @@ export const DashboardsApiFp = function(configuration?: Configuration) {\n/**\n*\n* @summary Create a dashboard\n- * @param {Dashboard} dashboard dashboard to create\n+ * @param {CreateDashboardRequest} createDashboardRequest dashboard to create\n* @param {string} [zapTraceSpan] OpenTracing span context\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- dashboardsPost(dashboard: Dashboard, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Dashboard> {\n- const localVarAxiosArgs = DashboardsApiAxiosParamCreator(configuration).dashboardsPost(dashboard, zapTraceSpan, options);\n+ dashboardsPost(createDashboardRequest: CreateDashboardRequest, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Dashboard> {\n+ const localVarAxiosArgs = DashboardsApiAxiosParamCreator(configuration).dashboardsPost(createDashboardRequest, zapTraceSpan, options);\nreturn (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\nconst axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\nreturn axios.request(axiosRequestArgs);\n@@ -10564,13 +10532,13 @@ export const DashboardsApiFactory = function (configuration?: Configuration, bas\n/**\n*\n* @summary Create a dashboard\n- * @param {Dashboard} dashboard dashboard to create\n+ * @param {CreateDashboardRequest} createDashboardRequest dashboard to create\n* @param {string} [zapTraceSpan] OpenTracing span context\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- dashboardsPost(dashboard: Dashboard, zapTraceSpan?: string, options?: any) {\n- return DashboardsApiFp(configuration).dashboardsPost(dashboard, zapTraceSpan, options)(axios, basePath);\n+ dashboardsPost(createDashboardRequest: CreateDashboardRequest, zapTraceSpan?: string, options?: any) {\n+ return DashboardsApiFp(configuration).dashboardsPost(createDashboardRequest, zapTraceSpan, options)(axios, basePath);\n},\n};\n};\n@@ -10866,14 +10834,14 @@ export class DashboardsApi extends BaseAPI {\n/**\n*\n* @summary Create a dashboard\n- * @param {Dashboard} dashboard dashboard to create\n+ * @param {CreateDashboardRequest} createDashboardRequest dashboard to create\n* @param {string} [zapTraceSpan] OpenTracing span context\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n* @memberof DashboardsApi\n*/\n- public dashboardsPost(dashboard: Dashboard, zapTraceSpan?: string, options?: any) {\n- return DashboardsApiFp(this.configuration).dashboardsPost(dashboard, zapTraceSpan, options)(this.axios, this.basePath);\n+ public dashboardsPost(createDashboardRequest: CreateDashboardRequest, zapTraceSpan?: string, options?: any) {\n+ return DashboardsApiFp(this.configuration).dashboardsPost(createDashboardRequest, zapTraceSpan, options)(this.axios, this.basePath);\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/dashboards.ts", "new_path": "src/wrappers/dashboards.ts", "diff": "-import { Cell, CellsApi, Dashboard, DashboardsApi, ProtosApi, View } from \"../api\";\n+import {\n+ Cell,\n+ CellsApi,\n+ CreateDashboardRequest,\n+ Dashboard,\n+ DashboardsApi,\n+ ProtosApi,\n+ View,\n+} from \"../api\";\nimport {IDashboard, ILabel} from \"../types\";\nimport {addLabelDefaults} from \"./labels\";\n@@ -48,7 +56,13 @@ export default class {\nreturn addDefaultsToAll(data.dashboards || []);\n}\n- public async create(props: Dashboard): Promise<IDashboard> {\n+ public async getAllByOrgID(orgID: string): Promise<Dashboard[]> {\n+ const {data} = await this.service.dashboardsGet(undefined, undefined, undefined, undefined, orgID);\n+\n+ return addDefaultsToAll(data.dashboards || []);\n+ }\n+\n+ public async create(props: CreateDashboardRequest): Promise<IDashboard> {\nconst {data} = await this.service.dashboardsPost(props);\nreturn addDefaults(data);\n@@ -138,7 +152,6 @@ export default class {\nconst createdDashboard = await this.create({\n...original,\n- cells: [],\nname: cloneName,\n});\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add getAllByOrgID to dashboards
305,164
01.03.2019 11:13:35
28,800
d272bd81b46d3baa937672660d6a5950adf2cb82
Remove unused variable and fix tsconfig to prevent future issues
[ { "change_type": "MODIFY", "old_path": "src/types/index.ts", "new_path": "src/types/index.ts", "diff": "-import {Bucket, Cell, Dashboard, Task} from \"../api\";\n+import {Bucket, Dashboard, Task} from \"../api\";\nimport { Label as APILabel } from \"../api\";\ninterface ILabelProperties {\n" }, { "change_type": "MODIFY", "old_path": "tsconfig.json", "new_path": "tsconfig.json", "diff": "// \"alwaysStrict\": true, /* Parse in strict mode and emit \"use strict\" for each source file. */\n/* Additional Checks */\n- // \"noUnusedLocals\": true, /* Report errors on unused locals. */\n+ \"noUnusedLocals\": true, /* Report errors on unused locals. */\n// \"noUnusedParameters\": true, /* Report errors on unused parameters. */\n// \"noImplicitReturns\": true, /* Report error when not all code paths in function return a value. */\n// \"noFallthroughCasesInSwitch\": true, /* Report errors for fallthrough cases in switch statement. */\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Remove unused variable and fix tsconfig to prevent future issues
305,161
03.03.2019 23:26:29
28,800
947f18be45b8c01226870bbb7dca6ff3c245ee33
Add create from template function to tasks
[ { "change_type": "MODIFY", "old_path": "src/wrappers/labels.ts", "new_path": "src/wrappers/labels.ts", "diff": "@@ -3,7 +3,7 @@ import {ILabel} from \"../types\";\nconst DEFAULT_LABEL_COLOR = \"#326BBA\";\n-interface ILabelProperties {\n+export interface ILabelProperties {\ncolor: string;\ndescription?: string;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/tasks.ts", "new_path": "src/wrappers/tasks.ts", "diff": "-import { LogEvent, Run, Task, TasksApi, User } from \"../api\";\n+import {LabelsApi, LogEvent, Run, Task, TasksApi, User} from \"../api\";\nimport {ILabel, ITask} from \"../types\";\nimport {addLabelDefaults} from \"./labels\";\n+import {ITaskTemplate, TemplateType} from \"./templates\"\nconst addDefaults = (task: Task): ITask => {\nreturn {\n@@ -15,9 +16,11 @@ const addDefaultsToAll = (tasks: Task[]): ITask[] => (\nexport default class {\nprivate service: TasksApi;\n+ private labelsService: LabelsApi;\nconstructor(basePath: string) {\nthis.service = new TasksApi({basePath});\n+ this.labelsService = new LabelsApi({basePath});\n}\npublic async create(org: string, script: string): Promise<ITask> {\n@@ -164,6 +167,53 @@ export default class {\nreturn this.get(createdTask.id);\n}\n+ public async createFromTemplate(template: ITaskTemplate, orgID: string): Promise<Task> {\n+\n+ if (template.data[0].type !== TemplateType.Task) {\n+ throw new Error(\"Can not create task from this template\");\n+ }\n+\n+ const flux = template.data[0].attributes.flux;\n+\n+ const createdTask = await this.create(\"org\", flux);\n+ // TODO use create task by orgID here\n+\n+ if (!createdTask || !createdTask.id) {\n+ throw new Error(\"Could not create task\");\n+ }\n+\n+ if (template.data[0].relationships && template.data[0].relationships.label) {\n+ const labelRelationships = template.data[0].relationships.label.data;\n+\n+ const includedResources = template.included || [];\n+\n+ const labelsToCreate = includedResources.filter(({id, type}) => {\n+ labelRelationships.find((lr) => {\n+ return lr.type === TemplateType.Label && lr.id === id;\n+ });\n+ });\n+\n+ const pendingLabels = labelsToCreate.map((l) => {\n+ const name = l.attributes.name;\n+ const properties = l.attributes.properties;\n+\n+ return this.labelsService.labelsPost({name, properties});\n+ });\n+\n+ const labelsResponse = await Promise.all(pendingLabels);\n+\n+ const createdLabels = labelsResponse.map((lr) => lr.data.label);\n+\n+ this.addLabels(createdTask.id, createdLabels.filter((cl) => !!cl)); // ????\n+\n+ const task = await this.get(createdTask.id);\n+\n+ return task;\n+ }\n+\n+ return createdTask;\n+ }\n+\nprivate async cloneLabels(\noriginalTask: Task,\nnewTask: Task,\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/wrappers/templates.ts", "diff": "+import {ILabelProperties} from \"./labels\";\n+\n+export enum TemplateType {\n+ Label = \"label\",\n+ Task = \"task\",\n+}\n+\n+interface IKeyValuePairs {[key: string]: any;}\n+\n+interface ITemplate {\n+ meta: ITemplateMeta;\n+ data: ITemplateData[];\n+ included?: ITemplateIncluded[];\n+}\n+\n+interface ITemplateMeta extends IKeyValuePairs {\n+ name: string;\n+}\n+\n+interface ITemplateData {\n+ type: TemplateType;\n+ attributes: IKeyValuePairs;\n+ relationships?: {[key in TemplateType]?: {data: IRelationshipDataItem[]}};\n+}\n+\n+interface IRelationshipDataItem {\n+ type: TemplateType;\n+ id: string;\n+}\n+\n+interface ITemplateIncluded {\n+ type: TemplateType;\n+ id: string;\n+ attributes: IKeyValuePairs;\n+}\n+\n+export interface ITaskTemplate extends ITemplate {\n+ data: ITaskTemplateData[];\n+ included?: ITaskTemplateIncluded[];\n+}\n+\n+interface ITaskTemplateData extends ITemplateData {\n+ type: TemplateType.Task;\n+ attributes: {name: string, flux: string};\n+ relationships?: {\n+ [TemplateType.Label]: {data: ILabelRelationshipDataItem[]};\n+ };\n+}\n+\n+interface ILabelRelationshipDataItem {\n+ type: TemplateType.Label;\n+ id: string;\n+}\n+\n+interface ITaskTemplateIncluded extends ITemplateIncluded {\n+ type: TemplateType.Label;\n+ attributes: {name: string; properties: ILabelProperties};\n+}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add create from template function to tasks
305,168
04.03.2019 15:11:00
28,800
815f1065cc8dbcffdf997ac97c1aa448c23ac8c1
Update users api to include a get call for all users
[ { "change_type": "MODIFY", "old_path": "src/wrappers/users.ts", "new_path": "src/wrappers/users.ts", "diff": "-import { User, UsersApi } from \"../api\";\n+import { User, Users, UsersApi } from \"../api\";\nexport default class {\nprivate service: UsersApi;\n@@ -12,4 +12,10 @@ export default class {\nreturn data;\n}\n+\n+ public async getAllUsers(): Promise<Users> {\n+ const { data } = await this.service.usersGet();\n+\n+ return data;\n+ }\n}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Update users api to include a get call for all users
305,161
05.03.2019 11:21:00
28,800
fec9c1b23aa54a76cb708fd72ff074981872e408
Break create task from template function in to smaller chunks
[ { "change_type": "MODIFY", "old_path": "src/wrappers/tasks.ts", "new_path": "src/wrappers/tasks.ts", "diff": "-import {LabelsApi, LogEvent, Run, Task, TasksApi, User} from \"../api\";\n+import {Label, LabelsApi, LogEvent, Run, Task, TasksApi, User} from \"../api\";\nimport {ILabel, ITask} from \"../types\";\nimport {addLabelDefaults} from \"./labels\";\n-import {ITaskTemplate, TemplateType} from \"./templates\"\n+import {ITaskTemplate, ITemplate, TemplateType} from \"./templates\";\nconst addDefaults = (task: Task): ITask => {\nreturn {\n@@ -29,6 +29,12 @@ export default class {\nreturn addDefaults(data);\n}\n+ public async createByOrgID(orgID: string, script: string): Promise<ITask> {\n+ const {data} = await this.service.tasksPost({orgID, flux: script});\n+\n+ return addDefaults(data);\n+ }\n+\npublic async get(id: string): Promise<ITask> {\nconst {data} = await this.service.tasksTaskIDGet(id);\n@@ -167,23 +173,31 @@ export default class {\nreturn this.get(createdTask.id);\n}\n- public async createFromTemplate(template: ITaskTemplate, orgID: string): Promise<Task> {\n+ public async createFromTemplate(template: ITaskTemplate, orgID: string): Promise<ITask> {\n- if (template.data[0].type !== TemplateType.Task) {\n+ if (template.data.type !== TemplateType.Task) {\nthrow new Error(\"Can not create task from this template\");\n}\n- const flux = template.data[0].attributes.flux;\n+ const flux = template.data.attributes.flux;\n- const createdTask = await this.create(\"org\", flux);\n- // TODO use create task by orgID here\n+ const createdTask = await this.createByOrgID(orgID, flux);\nif (!createdTask || !createdTask.id) {\nthrow new Error(\"Could not create task\");\n}\n- if (template.data[0].relationships && template.data[0].relationships.label) {\n- const labelRelationships = template.data[0].relationships.label.data;\n+ await this.createIncludedLabelsFromTemplate(template, createdTask);\n+\n+ const task = await this.get(createdTask.id);\n+\n+ return task;\n+ }\n+\n+ private async createIncludedLabelsFromTemplate(template: ITemplate, createdTask: ITask) {\n+ if (!template.data.relationships || !template.data.relationships.label) {return; }\n+\n+ const labelRelationships = template.data.relationships.label.data;\nconst includedResources = template.included || [];\n@@ -202,16 +216,16 @@ export default class {\nconst labelsResponse = await Promise.all(pendingLabels);\n- const createdLabels = labelsResponse.map((lr) => lr.data.label);\n-\n- this.addLabels(createdTask.id, createdLabels.filter((cl) => !!cl)); // ????\n+ const createdLabels = labelsResponse\n+ .map((lr) => lr.data.label)\n+ .filter((cl): cl is Label => !!cl)\n+ .map(addLabelDefaults);\n- const task = await this.get(createdTask.id);\n-\n- return task;\n+ if (!createdTask || !createdTask.id) {\n+ throw new Error(\"Can not add labels to undefined Task\");\n}\n- return createdTask;\n+ await this.addLabels(createdTask.id, createdLabels);\n}\nprivate async cloneLabels(\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/templates.ts", "new_path": "src/wrappers/templates.ts", "diff": "@@ -7,9 +7,9 @@ export enum TemplateType {\ninterface IKeyValuePairs {[key: string]: any; }\n-interface ITemplate {\n+export interface ITemplate {\nmeta: ITemplateMeta;\n- data: ITemplateData[];\n+ data: ITemplateData;\nincluded?: ITemplateIncluded[];\n}\n@@ -35,7 +35,7 @@ interface ITemplateIncluded {\n}\nexport interface ITaskTemplate extends ITemplate {\n- data: ITaskTemplateData[];\n+ data: ITaskTemplateData;\nincluded?: ITaskTemplateIncluded[];\n}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Break create task from template function in to smaller chunks
305,168
05.03.2019 12:53:10
28,800
243ef537341070715a99e8e1cc678e65d8c4e0ed
Update orgs api to include add members to org
[ { "change_type": "MODIFY", "old_path": "src/wrappers/organizations.ts", "new_path": "src/wrappers/organizations.ts", "diff": "@@ -76,4 +76,13 @@ export default class {\nreturn data;\n}\n+\n+ public async addMember(\n+ id: string,\n+ user: AddResourceMemberRequestBody,\n+ ): Promise<ResourceMember> {\n+ const { data } = await this.service.orgsOrgIDMembersPost(id, user);\n+\n+ return data;\n+ }\n}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Update orgs api to include add members to org
305,161
05.03.2019 14:57:28
28,800
a49c065ea9fdd192af15edc7f5fc9248b583d763
Unify LabelProperty types
[ { "change_type": "MODIFY", "old_path": "src/types/index.ts", "new_path": "src/types/index.ts", "diff": "import {Bucket, Dashboard, Task} from \"../api\";\nimport { Label as APILabel } from \"../api\";\n-interface ILabelProperties {\n+export interface ILabelProperties {\ncolor: string;\ndescription?: string;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/labels.ts", "new_path": "src/wrappers/labels.ts", "diff": "import { Label as APILabel, LabelsApi } from \"../api\";\nimport {ILabel} from \"../types\";\n+import {ILabelProperties} from \"../types\";\nconst DEFAULT_LABEL_COLOR = \"#326BBA\";\n-export interface ILabelProperties {\n- color: string;\n- description?: string;\n-}\n-\nexport const addLabelDefaults = (l: APILabel): ILabel => ({\n...l,\nproperties: {\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Unify LabelProperty types
305,161
05.03.2019 14:59:15
28,800
35811cb4e921e998cdf3e429f92e455ff82356d8
move template types from templates to types folder
[ { "change_type": "MODIFY", "old_path": "src/types/index.ts", "new_path": "src/types/index.ts", "diff": "@@ -32,3 +32,69 @@ type DashboardRequired = {[P in keyof DashboardPicked]-?: DashboardPicked[P]};\nexport interface IDashboard extends DashboardOriginal, DashboardRequired {\nlabels: ILabel[];\n}\n+\n+export enum TemplateType {\n+ Label = \"label\",\n+ Task = \"task\",\n+}\n+\n+interface IKeyValuePairs {[key: string]: any; }\n+\n+export interface ITemplate {\n+ id?: string;\n+ meta: ITemplateMeta;\n+ content: ITemplateContent;\n+ labels?: ILabel[];\n+}\n+\n+interface ITemplateMeta extends IKeyValuePairs {\n+ name: string;\n+ version: string;\n+}\n+\n+interface ITemplateContent {\n+ data: ITemplateData;\n+ included?: ITemplateIncluded[];\n+}\n+\n+interface ITemplateData {\n+ type: TemplateType;\n+ attributes: IKeyValuePairs;\n+ relationships?: {[key in TemplateType]?: {data: IRelationshipDataItem[]}};\n+}\n+\n+interface IRelationshipDataItem {\n+ type: TemplateType;\n+ id: string;\n+}\n+\n+interface ITemplateIncluded {\n+ type: TemplateType;\n+ id: string;\n+ attributes: IKeyValuePairs;\n+}\n+\n+export interface ITaskTemplate extends ITemplate {\n+ content: {\n+ data: ITaskTemplateData;\n+ included?: ITaskTemplateIncluded[];\n+ };\n+}\n+\n+interface ITaskTemplateData extends ITemplateData {\n+ type: TemplateType.Task;\n+ attributes: {name: string, flux: string};\n+ relationships?: {\n+ [TemplateType.Label]: {data: ILabelRelationshipDataItem[]};\n+ };\n+}\n+\n+interface ILabelRelationshipDataItem {\n+ type: TemplateType.Label;\n+ id: string;\n+}\n+\n+interface ITaskTemplateIncluded extends ITemplateIncluded {\n+ type: TemplateType.Label;\n+ attributes: {name: string; properties: ILabelProperties};\n+}\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/tasks.ts", "new_path": "src/wrappers/tasks.ts", "diff": "import {Label, LabelsApi, LogEvent, Run, Task, TasksApi, User} from \"../api\";\n-import {ILabel, ITask} from \"../types\";\n+import {ILabel, ITask, ITaskTemplate, ITemplate, TemplateType} from \"../types\";\nimport {addLabelDefaults} from \"./labels\";\n-import {ITaskTemplate, ITemplate, TemplateType} from \"./templates\";\nconst addDefaults = (task: Task): ITask => {\nreturn {\n" }, { "change_type": "DELETE", "old_path": "src/wrappers/templates.ts", "new_path": null, "diff": "-import {ILabelProperties} from \"./labels\";\n-\n-export enum TemplateType {\n- Label = \"label\",\n- Task = \"task\",\n-}\n-\n-interface IKeyValuePairs {[key: string]: any; }\n-\n-export interface ITemplate {\n- meta: ITemplateMeta;\n- data: ITemplateData;\n- included?: ITemplateIncluded[];\n-}\n-\n-interface ITemplateMeta extends IKeyValuePairs {\n- name: string;\n-}\n-\n-interface ITemplateData {\n- type: TemplateType;\n- attributes: IKeyValuePairs;\n- relationships?: {[key in TemplateType]?: {data: IRelationshipDataItem[]}};\n-}\n-\n-interface IRelationshipDataItem {\n- type: TemplateType;\n- id: string;\n-}\n-\n-interface ITemplateIncluded {\n- type: TemplateType;\n- id: string;\n- attributes: IKeyValuePairs;\n-}\n-\n-export interface ITaskTemplate extends ITemplate {\n- data: ITaskTemplateData;\n- included?: ITaskTemplateIncluded[];\n-}\n-\n-interface ITaskTemplateData extends ITemplateData {\n- type: TemplateType.Task;\n- attributes: {name: string, flux: string};\n- relationships?: {\n- [TemplateType.Label]: {data: ILabelRelationshipDataItem[]};\n- };\n-}\n-\n-interface ILabelRelationshipDataItem {\n- type: TemplateType.Label;\n- id: string;\n-}\n-\n-interface ITaskTemplateIncluded extends ITemplateIncluded {\n- type: TemplateType.Label;\n- attributes: {name: string; properties: ILabelProperties};\n-}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
move template types from templates to types folder
305,161
05.03.2019 15:18:58
28,800
5b98b6677612c43f436615eb59128d18c5631583
Correct task template instantiation functions
[ { "change_type": "MODIFY", "old_path": "src/wrappers/tasks.ts", "new_path": "src/wrappers/tasks.ts", "diff": "@@ -174,11 +174,13 @@ export default class {\npublic async createFromTemplate(template: ITaskTemplate, orgID: string): Promise<ITask> {\n- if (template.data.type !== TemplateType.Task) {\n+ const {content} = template;\n+\n+ if (content.data.type !== TemplateType.Task) {\nthrow new Error(\"Can not create task from this template\");\n}\n- const flux = template.data.attributes.flux;\n+ const flux = content.data.attributes.flux;\nconst createdTask = await this.createByOrgID(orgID, flux);\n@@ -194,11 +196,14 @@ export default class {\n}\nprivate async createIncludedLabelsFromTemplate(template: ITemplate, createdTask: ITask) {\n- if (!template.data.relationships || !template.data.relationships.label) {return; }\n- const labelRelationships = template.data.relationships.label.data;\n+ const {content} = template;\n+\n+ if (!content.data.relationships || !content.data.relationships.label) {return; }\n+\n+ const labelRelationships = content.data.relationships.label.data;\n- const includedResources = template.included || [];\n+ const includedResources = content.included || [];\nconst labelsToCreate = includedResources.filter(({id, type}) => {\nlabelRelationships.find((lr) => {\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Correct task template instantiation functions
305,161
05.03.2019 15:37:20
28,800
6287aba55cad7b3229553e4eb82e05aaa38f8fe8
Add version check to task template instantiator
[ { "change_type": "MODIFY", "old_path": "src/wrappers/tasks.ts", "new_path": "src/wrappers/tasks.ts", "diff": "@@ -176,7 +176,7 @@ export default class {\nconst {content} = template;\n- if (content.data.type !== TemplateType.Task) {\n+ if (content.data.type !== TemplateType.Task || template.meta.version !== \"1\") {\nthrow new Error(\"Can not create task from this template\");\n}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add version check to task template instantiator
305,166
04.03.2019 17:10:28
18,000
14cf300764c47590467d363289475f16d353e5f4
fix(wrappers/dash): return IDashaboard in dashboard wrappers
[ { "change_type": "MODIFY", "old_path": "src/wrappers/dashboards.ts", "new_path": "src/wrappers/dashboards.ts", "diff": "@@ -38,19 +38,19 @@ export default class {\nthis.service = new DashboardsApi({basePath});\n}\n- public async get(id: string): Promise<Dashboard> {\n+ public async get(id: string): Promise<IDashboard> {\nconst {data} = await this.service.dashboardsDashboardIDGet(id);\n- return data;\n+ return addDefaults(data);\n}\n- public async getAll(): Promise<Dashboard[]> {\n+ public async getAll(): Promise<IDashboard[]> {\nconst {data} = await this.service.dashboardsGet(undefined);\nreturn addDefaultsToAll(data.dashboards || []);\n}\n- public async getAllByOrg(org: string): Promise<Dashboard[]> {\n+ public async getAllByOrg(org: string): Promise<IDashboard[]> {\nconst {data} = await this.service.dashboardsGet(org);\nreturn addDefaultsToAll(data.dashboards || []);\n@@ -81,7 +81,7 @@ export default class {\nreturn data;\n}\n- public async createFromProto(protoID: string, orgID?: string): Promise<Dashboard[]> {\n+ public async createFromProto(protoID: string, orgID?: string): Promise<IDashboard[]> {\nlet request = {};\nif (orgID) {\n@@ -90,7 +90,7 @@ export default class {\nconst { data } = await this.protosService.protosProtoIDDashboardsPost(protoID, request);\n- return data.dashboards || [];\n+ return addDefaultsToAll(data.dashboards || []);\n}\npublic async deleteCell(dashboardID: string, cellID: string): Promise<Response> {\n@@ -147,7 +147,7 @@ export default class {\nreturn data;\n}\n- public async clone(dashboardID: string, cloneName: string): Promise<Dashboard | null> {\n+ public async clone(dashboardID: string, cloneName: string): Promise<IDashboard | null> {\nconst original = await this.get(dashboardID);\nconst createdDashboard = await this.create({\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
fix(wrappers/dash): return IDashaboard in dashboard wrappers
305,161
06.03.2019 14:43:15
28,800
bc2efd53d717cd6030b8d4cd5791a124094d84a9
Prevent duplicating cells when cloning dashboards
[ { "change_type": "MODIFY", "old_path": "src/wrappers/dashboards.ts", "new_path": "src/wrappers/dashboards.ts", "diff": "@@ -150,8 +150,12 @@ export default class {\npublic async clone(dashboardID: string, cloneName: string): Promise<IDashboard | null> {\nconst original = await this.get(dashboardID);\n+ const {name, description, orgID} = original;\n+\n+ const dashboardWithoutCells = {name, description, orgID};\n+\nconst createdDashboard = await this.create({\n- ...original,\n+ ...dashboardWithoutCells,\nname: cloneName,\n});\n@@ -163,7 +167,6 @@ export default class {\nawait this.cloneLabels(original, createdDashboard);\nreturn this.get(createdDashboard.id);\n-\n}\nprivate async cloneLabels(originalDashboard: Dashboard, newDashboard: Dashboard): Promise<ILabel[]> {\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Prevent duplicating cells when cloning dashboards
305,165
06.03.2019 18:28:55
28,800
180c72ad608e7e5109b5e4fb4c5e9357be9e1560
Update create from template function names
[ { "change_type": "MODIFY", "old_path": "src/wrappers/dashboards.ts", "new_path": "src/wrappers/dashboards.ts", "diff": "@@ -257,18 +257,24 @@ export default class {\nconst createdDashboard = await this.create({ orgID, name, description });\n- await this.createIncludedLabelsFromTemplate(template, createdDashboard);\n- await this.createIncludedCellsFromTemplate(template, createdDashboard);\n+ await Promise.all([\n+ await this.createLabelsFromTemplate(template, createdDashboard),\n+ await this.createCellsFromTemplate(template, createdDashboard),\n+ ]);\nconst dashboard = await this.get(createdDashboard.id);\nreturn addDefaults(dashboard);\n}\n- private async createIncludedLabelsFromTemplate(\n+ private async createLabelsFromTemplate(\ntemplate: IDashboardTemplate,\ndashboard: IDashboard,\n) {\n+ if (!dashboard || !dashboard.id) {\n+ throw new Error(\"Can not add labels to undefined Dashboard\");\n+ }\n+\nconst { content } = template;\nif (\n@@ -306,14 +312,10 @@ export default class {\n.map((l) => l.id)\n.filter((id): id is string => !!id);\n- if (!dashboard || !dashboard.id) {\n- throw new Error(\"Can not add labels to undefined Dashboard\");\n- }\n-\nawait this.addLabels(dashboard.id, createdLabels);\n}\n- private async createIncludedCellsFromTemplate(template: IDashboardTemplate,\n+ private async createCellsFromTemplate(template: IDashboardTemplate,\ncreatedDashboard: IDashboard) {\nconst { content } = template;\n@@ -346,10 +348,10 @@ export default class {\n});\nconst cellResponses = await Promise.all(pendingCells);\n- this.createIncludedViewsFromTemplate(template, cellResponses, cellsToCreate, createdDashboard);\n+ this.createViewsFromTemplate(template, cellResponses, cellsToCreate, createdDashboard);\n}\n- private async createIncludedViewsFromTemplate(\n+ private async createViewsFromTemplate(\ntemplate: IDashboardTemplate,\ncreatedCells: Cell[],\noriginalCellsIncluded: ICellIncluded[],\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Update create from template function names
305,168
07.03.2019 11:51:44
28,800
78f69594fc353900a268317caeab56c01a97c16f
Update orgs wrapper to be able to remove member from org
[ { "change_type": "MODIFY", "old_path": "src/wrappers/organizations.ts", "new_path": "src/wrappers/organizations.ts", "diff": "@@ -85,4 +85,12 @@ export default class {\nreturn data;\n}\n+\n+ public async removeMember(\n+ orgID: string,\n+ userID: string,\n+ ): Promise<Response> {\n+ const { data } = await this.service.orgsOrgIDMembersUserIDDelete(userID, orgID);\n+ return data;\n+ }\n}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Update orgs wrapper to be able to remove member from org
305,164
07.03.2019 11:56:17
28,800
0254b67aa9dc8176b233b167b65ceb11a74d8065
Add precommit task
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"description\": \"Influxdb v2 client\",\n\"main\": \"dist/index.js\",\n\"scripts\": {\n+ \"precommit\": \"npm run vet\",\n\"prepublishOnly\": \"npm run build\",\n\"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\n\"generate\": \"openapi-generator generate -g typescript-axios -o src/api -i https://raw.githubusercontent.com/influxdata/influxdb/master/http/swagger.yml\",\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add precommit task
305,164
07.03.2019 11:59:19
28,800
7fd193391e4db727c8730a60c7ca4aa32eeb6545
Add husky as dev dependency
[ { "change_type": "MODIFY", "old_path": "package-lock.json", "new_path": "package-lock.json", "diff": "{\n\"name\": \"@influxdata/influx\",\n- \"version\": \"0.2.13\",\n+ \"version\": \"0.2.22\",\n\"lockfileVersion\": 1,\n\"requires\": true,\n\"dependencies\": {\n\"integrity\": \"sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=\",\n\"dev\": true\n},\n+ \"caller-callsite\": {\n+ \"version\": \"2.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz\",\n+ \"integrity\": \"sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"callsites\": \"^2.0.0\"\n+ }\n+ },\n+ \"caller-path\": {\n+ \"version\": \"2.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz\",\n+ \"integrity\": \"sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"caller-callsite\": \"^2.0.0\"\n+ }\n+ },\n+ \"callsites\": {\n+ \"version\": \"2.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz\",\n+ \"integrity\": \"sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=\",\n+ \"dev\": true\n+ },\n\"chalk\": {\n\"version\": \"2.4.2\",\n\"resolved\": \"https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz\",\n}\n}\n},\n+ \"ci-info\": {\n+ \"version\": \"2.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz\",\n+ \"integrity\": \"sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==\",\n+ \"dev\": true\n+ },\n\"color-convert\": {\n\"version\": \"1.9.3\",\n\"resolved\": \"https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz\",\n\"integrity\": \"sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=\",\n\"dev\": true\n},\n+ \"cosmiconfig\": {\n+ \"version\": \"5.1.0\",\n+ \"resolved\": \"https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.1.0.tgz\",\n+ \"integrity\": \"sha512-kCNPvthka8gvLtzAxQXvWo4FxqRB+ftRZyPZNuab5ngvM9Y7yw7hbEysglptLgpkGX9nAOKTBVkHUAe8xtYR6Q==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"import-fresh\": \"^2.0.0\",\n+ \"is-directory\": \"^0.3.1\",\n+ \"js-yaml\": \"^3.9.0\",\n+ \"lodash.get\": \"^4.4.2\",\n+ \"parse-json\": \"^4.0.0\"\n+ }\n+ },\n+ \"cross-spawn\": {\n+ \"version\": \"6.0.5\",\n+ \"resolved\": \"https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz\",\n+ \"integrity\": \"sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"nice-try\": \"^1.0.4\",\n+ \"path-key\": \"^2.0.1\",\n+ \"semver\": \"^5.5.0\",\n+ \"shebang-command\": \"^1.2.0\",\n+ \"which\": \"^1.2.9\"\n+ }\n+ },\n\"debug\": {\n\"version\": \"3.1.0\",\n\"resolved\": \"https://registry.npmjs.org/debug/-/debug-3.1.0.tgz\",\n\"integrity\": \"sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==\",\n\"dev\": true\n},\n+ \"end-of-stream\": {\n+ \"version\": \"1.4.1\",\n+ \"resolved\": \"https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz\",\n+ \"integrity\": \"sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"once\": \"^1.4.0\"\n+ }\n+ },\n+ \"error-ex\": {\n+ \"version\": \"1.3.2\",\n+ \"resolved\": \"https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz\",\n+ \"integrity\": \"sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"is-arrayish\": \"^0.2.1\"\n+ }\n+ },\n\"escape-string-regexp\": {\n\"version\": \"1.0.5\",\n\"resolved\": \"https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz\",\n\"integrity\": \"sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=\",\n\"dev\": true\n},\n+ \"execa\": {\n+ \"version\": \"1.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/execa/-/execa-1.0.0.tgz\",\n+ \"integrity\": \"sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"cross-spawn\": \"^6.0.0\",\n+ \"get-stream\": \"^4.0.0\",\n+ \"is-stream\": \"^1.1.0\",\n+ \"npm-run-path\": \"^2.0.0\",\n+ \"p-finally\": \"^1.0.0\",\n+ \"signal-exit\": \"^3.0.0\",\n+ \"strip-eof\": \"^1.0.0\"\n+ }\n+ },\n+ \"find-up\": {\n+ \"version\": \"3.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz\",\n+ \"integrity\": \"sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"locate-path\": \"^3.0.0\"\n+ }\n+ },\n\"follow-redirects\": {\n\"version\": \"1.5.10\",\n\"resolved\": \"https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz\",\n\"integrity\": \"sha1-FQStJSMVjKpA20onh8sBQRmU6k8=\",\n\"dev\": true\n},\n+ \"get-stdin\": {\n+ \"version\": \"6.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz\",\n+ \"integrity\": \"sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==\",\n+ \"dev\": true\n+ },\n+ \"get-stream\": {\n+ \"version\": \"4.1.0\",\n+ \"resolved\": \"https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz\",\n+ \"integrity\": \"sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"pump\": \"^3.0.0\"\n+ }\n+ },\n\"glob\": {\n\"version\": \"7.1.3\",\n\"resolved\": \"https://registry.npmjs.org/glob/-/glob-7.1.3.tgz\",\n\"integrity\": \"sha1-tdRU3CGZriJWmfNGfloH87lVuv0=\",\n\"dev\": true\n},\n+ \"hosted-git-info\": {\n+ \"version\": \"2.7.1\",\n+ \"resolved\": \"https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz\",\n+ \"integrity\": \"sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==\",\n+ \"dev\": true\n+ },\n+ \"husky\": {\n+ \"version\": \"1.3.1\",\n+ \"resolved\": \"https://registry.npmjs.org/husky/-/husky-1.3.1.tgz\",\n+ \"integrity\": \"sha512-86U6sVVVf4b5NYSZ0yvv88dRgBSSXXmHaiq5pP4KDj5JVzdwKgBjEtUPOm8hcoytezFwbU+7gotXNhpHdystlg==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"cosmiconfig\": \"^5.0.7\",\n+ \"execa\": \"^1.0.0\",\n+ \"find-up\": \"^3.0.0\",\n+ \"get-stdin\": \"^6.0.0\",\n+ \"is-ci\": \"^2.0.0\",\n+ \"pkg-dir\": \"^3.0.0\",\n+ \"please-upgrade-node\": \"^3.1.1\",\n+ \"read-pkg\": \"^4.0.1\",\n+ \"run-node\": \"^1.0.0\",\n+ \"slash\": \"^2.0.0\"\n+ }\n+ },\n+ \"import-fresh\": {\n+ \"version\": \"2.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz\",\n+ \"integrity\": \"sha1-2BNVwVYS04bGH53dOSLUMEgipUY=\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"caller-path\": \"^2.0.0\",\n+ \"resolve-from\": \"^3.0.0\"\n+ }\n+ },\n\"inflight\": {\n\"version\": \"1.0.6\",\n\"resolved\": \"https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz\",\n\"integrity\": \"sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=\",\n\"dev\": true\n},\n+ \"is-arrayish\": {\n+ \"version\": \"0.2.1\",\n+ \"resolved\": \"https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz\",\n+ \"integrity\": \"sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=\",\n+ \"dev\": true\n+ },\n\"is-buffer\": {\n\"version\": \"1.1.6\",\n\"resolved\": \"https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz\",\n\"integrity\": \"sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==\"\n},\n+ \"is-ci\": {\n+ \"version\": \"2.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz\",\n+ \"integrity\": \"sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"ci-info\": \"^2.0.0\"\n+ }\n+ },\n+ \"is-directory\": {\n+ \"version\": \"0.3.1\",\n+ \"resolved\": \"https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz\",\n+ \"integrity\": \"sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=\",\n+ \"dev\": true\n+ },\n+ \"is-stream\": {\n+ \"version\": \"1.1.0\",\n+ \"resolved\": \"https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz\",\n+ \"integrity\": \"sha1-EtSj3U5o4Lec6428hBc66A2RykQ=\",\n+ \"dev\": true\n+ },\n+ \"isexe\": {\n+ \"version\": \"2.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz\",\n+ \"integrity\": \"sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=\",\n+ \"dev\": true\n+ },\n\"js-tokens\": {\n\"version\": \"3.0.2\",\n\"resolved\": \"https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz\",\n\"esprima\": \"^4.0.0\"\n}\n},\n+ \"json-parse-better-errors\": {\n+ \"version\": \"1.0.2\",\n+ \"resolved\": \"https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz\",\n+ \"integrity\": \"sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==\",\n+ \"dev\": true\n+ },\n+ \"locate-path\": {\n+ \"version\": \"3.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz\",\n+ \"integrity\": \"sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"p-locate\": \"^3.0.0\",\n+ \"path-exists\": \"^3.0.0\"\n+ }\n+ },\n+ \"lodash.get\": {\n+ \"version\": \"4.4.2\",\n+ \"resolved\": \"https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz\",\n+ \"integrity\": \"sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=\",\n+ \"dev\": true\n+ },\n\"minimatch\": {\n\"version\": \"3.0.4\",\n\"resolved\": \"https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz\",\n\"resolved\": \"https://registry.npmjs.org/ms/-/ms-2.0.0.tgz\",\n\"integrity\": \"sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=\"\n},\n+ \"nice-try\": {\n+ \"version\": \"1.0.5\",\n+ \"resolved\": \"https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz\",\n+ \"integrity\": \"sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==\",\n+ \"dev\": true\n+ },\n+ \"normalize-package-data\": {\n+ \"version\": \"2.5.0\",\n+ \"resolved\": \"https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz\",\n+ \"integrity\": \"sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"hosted-git-info\": \"^2.1.4\",\n+ \"resolve\": \"^1.10.0\",\n+ \"semver\": \"2 || 3 || 4 || 5\",\n+ \"validate-npm-package-license\": \"^3.0.1\"\n+ }\n+ },\n+ \"npm-run-path\": {\n+ \"version\": \"2.0.2\",\n+ \"resolved\": \"https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz\",\n+ \"integrity\": \"sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"path-key\": \"^2.0.0\"\n+ }\n+ },\n\"once\": {\n\"version\": \"1.4.0\",\n\"resolved\": \"https://registry.npmjs.org/once/-/once-1.4.0.tgz\",\n\"wrappy\": \"1\"\n}\n},\n+ \"p-finally\": {\n+ \"version\": \"1.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz\",\n+ \"integrity\": \"sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=\",\n+ \"dev\": true\n+ },\n+ \"p-limit\": {\n+ \"version\": \"2.2.0\",\n+ \"resolved\": \"https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz\",\n+ \"integrity\": \"sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"p-try\": \"^2.0.0\"\n+ }\n+ },\n+ \"p-locate\": {\n+ \"version\": \"3.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz\",\n+ \"integrity\": \"sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"p-limit\": \"^2.0.0\"\n+ }\n+ },\n+ \"p-try\": {\n+ \"version\": \"2.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz\",\n+ \"integrity\": \"sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==\",\n+ \"dev\": true\n+ },\n+ \"parse-json\": {\n+ \"version\": \"4.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz\",\n+ \"integrity\": \"sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"error-ex\": \"^1.3.1\",\n+ \"json-parse-better-errors\": \"^1.0.1\"\n+ }\n+ },\n+ \"path-exists\": {\n+ \"version\": \"3.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz\",\n+ \"integrity\": \"sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=\",\n+ \"dev\": true\n+ },\n\"path-is-absolute\": {\n\"version\": \"1.0.1\",\n\"resolved\": \"https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz\",\n\"integrity\": \"sha1-F0uSaHNVNP+8es5r9TpanhtcX18=\",\n\"dev\": true\n},\n+ \"path-key\": {\n+ \"version\": \"2.0.1\",\n+ \"resolved\": \"https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz\",\n+ \"integrity\": \"sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=\",\n+ \"dev\": true\n+ },\n\"path-parse\": {\n\"version\": \"1.0.6\",\n\"resolved\": \"https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz\",\n\"integrity\": \"sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==\",\n\"dev\": true\n},\n+ \"pify\": {\n+ \"version\": \"3.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/pify/-/pify-3.0.0.tgz\",\n+ \"integrity\": \"sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=\",\n+ \"dev\": true\n+ },\n+ \"pkg-dir\": {\n+ \"version\": \"3.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz\",\n+ \"integrity\": \"sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"find-up\": \"^3.0.0\"\n+ }\n+ },\n+ \"please-upgrade-node\": {\n+ \"version\": \"3.1.1\",\n+ \"resolved\": \"https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.1.1.tgz\",\n+ \"integrity\": \"sha512-KY1uHnQ2NlQHqIJQpnh/i54rKkuxCEBx+voJIS/Mvb+L2iYd2NMotwduhKTMjfC1uKoX3VXOxLjIYG66dfJTVQ==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"semver-compare\": \"^1.0.0\"\n+ }\n+ },\n+ \"pump\": {\n+ \"version\": \"3.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/pump/-/pump-3.0.0.tgz\",\n+ \"integrity\": \"sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"end-of-stream\": \"^1.1.0\",\n+ \"once\": \"^1.3.1\"\n+ }\n+ },\n+ \"read-pkg\": {\n+ \"version\": \"4.0.1\",\n+ \"resolved\": \"https://registry.npmjs.org/read-pkg/-/read-pkg-4.0.1.tgz\",\n+ \"integrity\": \"sha1-ljYlN48+HE1IyFhytabsfV0JMjc=\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"normalize-package-data\": \"^2.3.2\",\n+ \"parse-json\": \"^4.0.0\",\n+ \"pify\": \"^3.0.0\"\n+ }\n+ },\n\"resolve\": {\n\"version\": \"1.10.0\",\n\"resolved\": \"https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz\",\n\"path-parse\": \"^1.0.6\"\n}\n},\n+ \"resolve-from\": {\n+ \"version\": \"3.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz\",\n+ \"integrity\": \"sha1-six699nWiBvItuZTM17rywoYh0g=\",\n+ \"dev\": true\n+ },\n+ \"run-node\": {\n+ \"version\": \"1.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/run-node/-/run-node-1.0.0.tgz\",\n+ \"integrity\": \"sha512-kc120TBlQ3mih1LSzdAJXo4xn/GWS2ec0l3S+syHDXP9uRr0JAT8Qd3mdMuyjqCzeZktgP3try92cEgf9Nks8A==\",\n+ \"dev\": true\n+ },\n\"semver\": {\n\"version\": \"5.6.0\",\n\"resolved\": \"https://registry.npmjs.org/semver/-/semver-5.6.0.tgz\",\n\"integrity\": \"sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==\",\n\"dev\": true\n},\n+ \"semver-compare\": {\n+ \"version\": \"1.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz\",\n+ \"integrity\": \"sha1-De4hahyUGrN+nvsXiPavxf9VN/w=\",\n+ \"dev\": true\n+ },\n+ \"shebang-command\": {\n+ \"version\": \"1.2.0\",\n+ \"resolved\": \"https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz\",\n+ \"integrity\": \"sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"shebang-regex\": \"^1.0.0\"\n+ }\n+ },\n+ \"shebang-regex\": {\n+ \"version\": \"1.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz\",\n+ \"integrity\": \"sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=\",\n+ \"dev\": true\n+ },\n+ \"signal-exit\": {\n+ \"version\": \"3.0.2\",\n+ \"resolved\": \"https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz\",\n+ \"integrity\": \"sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=\",\n+ \"dev\": true\n+ },\n+ \"slash\": {\n+ \"version\": \"2.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/slash/-/slash-2.0.0.tgz\",\n+ \"integrity\": \"sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==\",\n+ \"dev\": true\n+ },\n+ \"spdx-correct\": {\n+ \"version\": \"3.1.0\",\n+ \"resolved\": \"https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz\",\n+ \"integrity\": \"sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"spdx-expression-parse\": \"^3.0.0\",\n+ \"spdx-license-ids\": \"^3.0.0\"\n+ }\n+ },\n+ \"spdx-exceptions\": {\n+ \"version\": \"2.2.0\",\n+ \"resolved\": \"https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz\",\n+ \"integrity\": \"sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==\",\n+ \"dev\": true\n+ },\n+ \"spdx-expression-parse\": {\n+ \"version\": \"3.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz\",\n+ \"integrity\": \"sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"spdx-exceptions\": \"^2.1.0\",\n+ \"spdx-license-ids\": \"^3.0.0\"\n+ }\n+ },\n+ \"spdx-license-ids\": {\n+ \"version\": \"3.0.3\",\n+ \"resolved\": \"https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz\",\n+ \"integrity\": \"sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g==\",\n+ \"dev\": true\n+ },\n\"sprintf-js\": {\n\"version\": \"1.0.3\",\n\"resolved\": \"https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz\",\n\"ansi-regex\": \"^2.0.0\"\n}\n},\n+ \"strip-eof\": {\n+ \"version\": \"1.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz\",\n+ \"integrity\": \"sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=\",\n+ \"dev\": true\n+ },\n\"supports-color\": {\n\"version\": \"2.0.0\",\n\"resolved\": \"https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz\",\n\"integrity\": \"sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg==\",\n\"dev\": true\n},\n+ \"validate-npm-package-license\": {\n+ \"version\": \"3.0.4\",\n+ \"resolved\": \"https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz\",\n+ \"integrity\": \"sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"spdx-correct\": \"^3.0.0\",\n+ \"spdx-expression-parse\": \"^3.0.0\"\n+ }\n+ },\n+ \"which\": {\n+ \"version\": \"1.3.1\",\n+ \"resolved\": \"https://registry.npmjs.org/which/-/which-1.3.1.tgz\",\n+ \"integrity\": \"sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"isexe\": \"^2.0.0\"\n+ }\n+ },\n\"wrappy\": {\n\"version\": \"1.0.2\",\n\"resolved\": \"https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz\",\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"license\": \"MIT\",\n\"devDependencies\": {\n\"@openapitools/openapi-generator-cli\": \"0.0.7-3.3.4\",\n- \"typescript\": \"^3.2.2\",\n- \"tslint\": \"^5.12.1\"\n+ \"husky\": \"^1.3.1\",\n+ \"tslint\": \"^5.12.1\",\n+ \"typescript\": \"^3.2.2\"\n},\n\"dependencies\": {\n\"axios\": \"^0.18.0\"\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add husky as dev dependency
305,165
07.03.2019 11:28:55
28,800
ade93eb86f9c170af597baa5b777fac51bcd97df
prevent duplicate labels from getting created when creating task from template
[ { "change_type": "MODIFY", "old_path": "src/wrappers/tasks.ts", "new_path": "src/wrappers/tasks.ts", "diff": "import { Label, LabelsApi, LogEvent, Run, Task, TasksApi, User } from \"../api\";\nimport {\nILabel,\n+ ILabelIncluded,\nITask,\nITaskTemplate,\n- ITemplate,\nTemplateType,\n} from \"../types\";\nimport { addLabelDefaults } from \"./labels\";\n@@ -206,15 +206,15 @@ export default class {\nthrow new Error(\"Could not create task\");\n}\n- await this.createIncludedLabelsFromTemplate(template, createdTask);\n+ await this.createLabelsFromTemplate(template, createdTask);\nconst task = await this.get(createdTask.id);\nreturn task;\n}\n- private async createIncludedLabelsFromTemplate(\n- template: ITemplate,\n+ private async createLabelsFromTemplate(\n+ template: ITaskTemplate,\ncreatedTask: ITask,\n) {\nconst { content } = template;\n@@ -223,16 +223,36 @@ export default class {\nreturn;\n}\n+ if (!createdTask || !createdTask.id) {\n+ throw new Error(\"Can not add labels to undefined Task\");\n+ }\n+\nconst labelRelationships = content.data.relationships.label.data;\nconst includedResources = content.included || [];\n- const labelsToCreate = includedResources.filter(({ id }) => {\n+ const labelsIncluded = includedResources.filter(({ id }) => {\nreturn labelRelationships.some((lr) => {\nreturn lr.type === TemplateType.Label && lr.id === id;\n});\n});\n+ const {data} = await this.labelsService.labelsGet();\n+ const existingLabels = data.labels || [];\n+\n+ const {labelsToCreate, labelsToAdd} = labelsIncluded.reduce((acc, l) => {\n+ const existingLabel = existingLabels.find((el) => el.name === l.attributes.name);\n+\n+ if (!existingLabel) {\n+ acc.labelsToCreate = [...acc.labelsToCreate, l];\n+ return acc;\n+ }\n+\n+ acc.labelsToAdd = [...acc.labelsToAdd, addLabelDefaults(existingLabel)];\n+ return acc;\n+\n+ }, {labelsToAdd: [] as ILabel[], labelsToCreate: [] as ILabelIncluded[]});\n+\nconst pendingLabels = labelsToCreate.map((l) => {\nconst name = l.attributes.name;\nconst properties = l.attributes.properties;\n@@ -247,11 +267,7 @@ export default class {\n.filter((cl): cl is Label => !!cl)\n.map(addLabelDefaults);\n- if (!createdTask || !createdTask.id) {\n- throw new Error(\"Can not add labels to undefined Task\");\n- }\n-\n- await this.addLabels(createdTask.id, createdLabels);\n+ await this.addLabels(createdTask.id, [...createdLabels, ...labelsToAdd]);\n}\nprivate async cloneLabels(\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
prevent duplicate labels from getting created when creating task from template
305,165
07.03.2019 12:39:02
28,800
7f64060bcc3132e6abccdf5c0fe1407ad3808a2e
prevent duplicate labels from getting created when creating dashboardls from template
[ { "change_type": "MODIFY", "old_path": "src/wrappers/dashboards.ts", "new_path": "src/wrappers/dashboards.ts", "diff": "@@ -294,7 +294,7 @@ export default class {\nconst includedResources = content.included || [];\n- const labelsToCreate = includedResources.reduce((acc, ir) => {\n+ const labelsIncluded = includedResources.reduce((acc, ir) => {\nif (ir.type === TemplateType.Label) {\nconst found = labelRelationships.some((lr) => lr.type === TemplateType.Label && lr.id === ir.id);\nif (found) {\n@@ -304,6 +304,15 @@ export default class {\nreturn acc;\n}, [] as ILabelIncluded[]);\n+ const {labelsToCreate, labelIDsToAdd} = await this.separateExistingLabels(labelsIncluded);\n+\n+ const createdLabels = await this.createLabels(labelsToCreate);\n+ const createdLabelIDs = createdLabels.map((l) => l.id).filter((id): id is string => !!id);\n+\n+ await this.addLabels(dashboard.id, [...createdLabelIDs, ...labelIDsToAdd]);\n+ }\n+\n+ private async createLabels(labelsToCreate: ILabelIncluded[]): Promise<Label[]> {\nconst pendingLabels = labelsToCreate.map((l) => {\nconst { attributes: { name, properties } } = l;\nreturn this.labelsService.labelsPost({ name, properties });\n@@ -311,13 +320,26 @@ export default class {\nconst labelsResponse = await Promise.all(pendingLabels);\n- const createdLabels = labelsResponse\n+ return labelsResponse\n.map((lr) => lr.data.label)\n- .filter((cl): cl is Label => !!cl)\n- .map((l) => l.id)\n- .filter((id): id is string => !!id);\n+ .filter((cl): cl is Label => !!cl);\n+ }\n+\n+ private async separateExistingLabels(labelsFromTemplate: ILabelIncluded[]) {\n+ const {data} = await this.labelsService.labelsGet();\n+ const existingLabels = data.labels || [];\n- await this.addLabels(dashboard.id, createdLabels);\n+ return labelsFromTemplate.reduce((acc, l) => {\n+ const existingLabel = existingLabels.find((el) => el.name === l.attributes.name);\n+\n+ if (!existingLabel || !existingLabel.id) {\n+ acc.labelsToCreate = [...acc.labelsToCreate, l];\n+ return acc;\n+ }\n+\n+ acc.labelIDsToAdd = [...acc.labelIDsToAdd, existingLabel.id];\n+ return acc;\n+ }, {labelIDsToAdd: [] as string[], labelsToCreate: [] as ILabelIncluded[]});\n}\nprivate async createCellsFromTemplate(template: IDashboardTemplate, createdDashboard: IDashboard) {\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
prevent duplicate labels from getting created when creating dashboardls from template
305,165
07.03.2019 14:41:06
28,800
d8549f98a0fe6c1960989f016d654ea16b627f1f
Update tasks label and create from template to be consistent with dashboard's
[ { "change_type": "MODIFY", "old_path": "src/wrappers/dashboards.ts", "new_path": "src/wrappers/dashboards.ts", "diff": "@@ -161,7 +161,7 @@ export default class {\n);\nif (!data.label) {\n- throw new Error(\"Failed to create label\");\n+ throw new Error(\"Failed to add label\");\n}\nreturn addLabelDefaults(data.label);\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/tasks.ts", "new_path": "src/wrappers/tasks.ts", "diff": "@@ -105,43 +105,35 @@ export default class {\nreturn data;\n}\n- public async addLabel(taskID: string, label: ILabel): Promise<ILabel> {\n- if (!label.id) {\n- throw new Error(\"label must have id\");\n- }\n-\n+ public async addLabel(taskID: string, labelID: string): Promise<ILabel> {\nconst { data } = await this.service.tasksTaskIDLabelsPost(taskID, {\n- labelID: label.id,\n+ labelID,\n});\nif (!data.label) {\n- throw new Error(\"API did not return a label\");\n+ throw new Error(\"Failed to add label\");\n}\nreturn addLabelDefaults(data.label);\n}\n- public async removeLabel(taskID: string, label: ILabel): Promise<Response> {\n- if (!label.id) {\n- throw new Error(\"label must have id\");\n- }\n-\n+ public async removeLabel(taskID: string, labelID: string): Promise<Response> {\nconst { data } = await this.service.tasksTaskIDLabelsLabelIDDelete(\ntaskID,\n- label.id,\n+ labelID,\n);\nreturn data;\n}\n- public addLabels(taskID: string, labels: ILabel[]): Promise<ILabel[]> {\n- const promises = labels.map((l) => this.addLabel(taskID, l));\n+ public addLabels(taskID: string, labelIDs: string[]): Promise<ILabel[]> {\n+ const promises = labelIDs.map((l) => this.addLabel(taskID, l));\nreturn Promise.all(promises);\n}\npublic removeLabels(taskID: string, labels: ILabel[]): Promise<Response[]> {\n- const promises = labels.map((l) => this.removeLabel(taskID, l));\n+ const promises = labels.map((l) => this.removeLabel(taskID, l.id || \"\"));\nreturn Promise.all(promises);\n}\n@@ -217,16 +209,16 @@ export default class {\ntemplate: ITaskTemplate,\ncreatedTask: ITask,\n) {\n+ if (!createdTask || !createdTask.id) {\n+ throw new Error(\"Can not add labels to undefined Task\");\n+ }\n+\nconst { content } = template;\nif (!content.data.relationships || !content.data.relationships.label) {\nreturn;\n}\n- if (!createdTask || !createdTask.id) {\n- throw new Error(\"Can not add labels to undefined Task\");\n- }\n-\nconst labelRelationships = content.data.relationships.label.data;\nconst includedResources = content.included || [];\n@@ -237,22 +229,33 @@ export default class {\n});\n});\n+ const {labelsToCreate, labelIDsToAdd} = await this.separateExistingLabels(labelsIncluded);\n+\n+ const createdLabels = await this.createLabels(labelsToCreate);\n+ const createdLabelIDs = createdLabels.map((l) => l.id).filter((id): id is string => !!id);\n+\n+ await this.addLabels(createdTask.id, [...createdLabelIDs, ...labelIDsToAdd]);\n+ }\n+\n+ private async separateExistingLabels(labelsFromTemplate: ILabelIncluded[]) {\nconst {data} = await this.labelsService.labelsGet();\nconst existingLabels = data.labels || [];\n- const {labelsToCreate, labelsToAdd} = labelsIncluded.reduce((acc, l) => {\n+ return labelsFromTemplate.reduce((acc, l) => {\nconst existingLabel = existingLabels.find((el) => el.name === l.attributes.name);\n- if (!existingLabel) {\n+ if (!existingLabel || !existingLabel.id) {\nacc.labelsToCreate = [...acc.labelsToCreate, l];\nreturn acc;\n}\n- acc.labelsToAdd = [...acc.labelsToAdd, addLabelDefaults(existingLabel)];\n+ acc.labelIDsToAdd = [...acc.labelIDsToAdd, existingLabel.id];\nreturn acc;\n- }, {labelsToAdd: [] as ILabel[], labelsToCreate: [] as ILabelIncluded[]});\n+ }, {labelIDsToAdd: [] as string[], labelsToCreate: [] as ILabelIncluded[]});\n+ }\n+ private async createLabels(labelsToCreate: ILabelIncluded[]): Promise<Label[]> {\nconst pendingLabels = labelsToCreate.map((l) => {\nconst name = l.attributes.name;\nconst properties = l.attributes.properties;\n@@ -262,12 +265,7 @@ export default class {\nconst labelsResponse = await Promise.all(pendingLabels);\n- const createdLabels = labelsResponse\n- .map((lr) => lr.data.label)\n- .filter((cl): cl is Label => !!cl)\n- .map(addLabelDefaults);\n-\n- await this.addLabels(createdTask.id, [...createdLabels, ...labelsToAdd]);\n+ return labelsResponse.map((lr) => lr.data.label).filter((cl): cl is Label => !!cl);\n}\nprivate async cloneLabels(\n@@ -280,7 +278,7 @@ export default class {\nconst labels = originalTask.labels || [];\nconst pendingLabels = labels.map(async (label) =>\n- this.addLabel(newTask.id || \"\", addLabelDefaults(label)),\n+ this.addLabel(newTask.id || \"\", label.id || \"\"),\n);\nconst newLabels = await Promise.all(pendingLabels);\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Update tasks label and create from template to be consistent with dashboard's
305,164
07.03.2019 15:31:33
28,800
474fdb3d50b0a9d2679912ca6a9dab86fbbabe39
Clean up creating labels from dashboard templates
[ { "change_type": "MODIFY", "old_path": "src/types/index.ts", "new_path": "src/types/index.ts", "diff": "@@ -151,7 +151,7 @@ interface IDashboardTemplateData extends ITemplateData {\n};\n}\n-type IDashboardTemplateIncluded =\n+export type IDashboardTemplateIncluded =\n| ICellIncluded\n| IViewIncluded\n| ILabelIncluded;\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/dashboards.ts", "new_path": "src/wrappers/dashboards.ts", "diff": "@@ -13,6 +13,7 @@ import {\nICellIncluded,\nIDashboard,\nIDashboardTemplate,\n+ IDashboardTemplateIncluded,\nILabel,\nILabelIncluded,\nTemplateType,\n@@ -280,38 +281,30 @@ export default class {\nthrow new Error(\"Can not add labels to undefined Dashboard\");\n}\n- const { content } = template;\n+ const { content: {data: {relationships}, included} } = template;\n- if (\n- !content.data.relationships ||\n- !content.data.relationships[TemplateType.Label]\n- ) {\n+ if (!relationships || !relationships[TemplateType.Label]) {\nreturn;\n}\n- const labelRelationships =\n- content.data.relationships[TemplateType.Label].data;\n+ const labelsIncluded = this.findIncludedLabels(included || []);\n- const includedResources = content.included || [];\n-\n- const labelsIncluded = includedResources.reduce((acc, ir) => {\n- if (ir.type === TemplateType.Label) {\n- const found = labelRelationships.some((lr) => lr.type === TemplateType.Label && lr.id === ir.id);\n- if (found) {\n- acc = [...acc, ir];\n- }\n- }\n- return acc;\n- }, [] as ILabelIncluded[]);\n+ const {data: {labels}} = await this.labelsService.labelsGet();\n+ const existingLabels = labels || [];\n- const {labelsToCreate, labelIDsToAdd} = await this.separateExistingLabels(labelsIncluded);\n+ const labelIDsToAdd = this.findLabelIDsToAdd(existingLabels, labelsIncluded);\n+ const labelsToCreate = this.findLabelsToCreate(existingLabels, labelsIncluded);\nconst createdLabels = await this.createLabels(labelsToCreate);\n- const createdLabelIDs = createdLabels.map((l) => l.id).filter((id): id is string => !!id);\n+ const createdLabelIDs = createdLabels.map((l) => l.id || \"\");\nawait this.addLabels(dashboard.id, [...createdLabelIDs, ...labelIDsToAdd]);\n}\n+ private findIncludedLabels(resources: IDashboardTemplateIncluded[]) {\n+ return resources.filter((r): r is ILabelIncluded => r.type === TemplateType.Label);\n+ }\n+\nprivate async createLabels(labelsToCreate: ILabelIncluded[]): Promise<Label[]> {\nconst pendingLabels = labelsToCreate.map((l) => {\nconst { attributes: { name, properties } } = l;\n@@ -325,21 +318,16 @@ export default class {\n.filter((cl): cl is Label => !!cl);\n}\n- private async separateExistingLabels(labelsFromTemplate: ILabelIncluded[]) {\n- const {data} = await this.labelsService.labelsGet();\n- const existingLabels = data.labels || [];\n-\n- return labelsFromTemplate.reduce((acc, l) => {\n- const existingLabel = existingLabels.find((el) => el.name === l.attributes.name);\n-\n- if (!existingLabel || !existingLabel.id) {\n- acc.labelsToCreate = [...acc.labelsToCreate, l];\n- return acc;\n+ private findLabelIDsToAdd(currentLabels: Label[], labels: ILabelIncluded[]): string[] {\n+ return labels.filter(\n+ (l) => !!currentLabels.find((el) => el.name === l.attributes.name),\n+ ).map((l) => l.id);\n}\n- acc.labelIDsToAdd = [...acc.labelIDsToAdd, existingLabel.id];\n- return acc;\n- }, {labelIDsToAdd: [] as string[], labelsToCreate: [] as ILabelIncluded[]});\n+ private findLabelsToCreate(currentLabels: Label[], labels: ILabelIncluded[]): ILabelIncluded[] {\n+ return labels.filter(\n+ (l) => !currentLabels.find((el) => el.name === l.attributes.name),\n+ );\n}\nprivate async createCellsFromTemplate(template: IDashboardTemplate, createdDashboard: IDashboard) {\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Clean up creating labels from dashboard templates Co-authored-by: Iris Scholten <[email protected]>
305,164
07.03.2019 15:49:50
28,800
31704c36251c0cd17061d0942b457dae54d70a7f
Clean up label creation from task templates
[ { "change_type": "MODIFY", "old_path": "src/wrappers/dashboards.ts", "new_path": "src/wrappers/dashboards.ts", "diff": "@@ -281,13 +281,13 @@ export default class {\nthrow new Error(\"Can not add labels to undefined Dashboard\");\n}\n- const { content: {data: {relationships}, included} } = template;\n+ const { content: {included} } = template;\n- if (!relationships || !relationships[TemplateType.Label]) {\n+ if (!included || !included.length) {\nreturn;\n}\n- const labelsIncluded = this.findIncludedLabels(included || []);\n+ const labelsIncluded = this.findIncludedLabels(included);\nconst {data: {labels}} = await this.labelsService.labelsGet();\nconst existingLabels = labels || [];\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/tasks.ts", "new_path": "src/wrappers/tasks.ts", "diff": "@@ -213,46 +213,36 @@ export default class {\nthrow new Error(\"Can not add labels to undefined Task\");\n}\n- const { content } = template;\n+ const { content: {included} } = template;\n- if (!content.data.relationships || !content.data.relationships.label) {\n+ if (!included || !included.length) {\nreturn;\n}\n- const labelRelationships = content.data.relationships.label.data;\n-\n- const includedResources = content.included || [];\n+ const labelsIncluded = included.filter((r): r is ILabelIncluded => r.type === TemplateType.Label);\n- const labelsIncluded = includedResources.filter(({ id }) => {\n- return labelRelationships.some((lr) => {\n- return lr.type === TemplateType.Label && lr.id === id;\n- });\n- });\n+ const {data} = await this.labelsService.labelsGet();\n+ const existingLabels = data.labels || [];\n- const {labelsToCreate, labelIDsToAdd} = await this.separateExistingLabels(labelsIncluded);\n+ const labelIDsToAdd = this.findLabelIDsToAdd(existingLabels, labelsIncluded);\n+ const labelsToCreate = this.findLabelsToCreate(existingLabels, labelsIncluded);\nconst createdLabels = await this.createLabels(labelsToCreate);\n- const createdLabelIDs = createdLabels.map((l) => l.id).filter((id): id is string => !!id);\n+ const createdLabelIDs = createdLabels.map((l) => l.id || \"\");\nawait this.addLabels(createdTask.id, [...createdLabelIDs, ...labelIDsToAdd]);\n}\n- private async separateExistingLabels(labelsFromTemplate: ILabelIncluded[]) {\n- const {data} = await this.labelsService.labelsGet();\n- const existingLabels = data.labels || [];\n-\n- return labelsFromTemplate.reduce((acc, l) => {\n- const existingLabel = existingLabels.find((el) => el.name === l.attributes.name);\n-\n- if (!existingLabel || !existingLabel.id) {\n- acc.labelsToCreate = [...acc.labelsToCreate, l];\n- return acc;\n+ private findLabelIDsToAdd(currentLabels: Label[], labels: ILabelIncluded[]): string[] {\n+ return labels.filter(\n+ (l) => !!currentLabels.find((el) => l.attributes.name === el.name),\n+ ).map((l) => l.id);\n}\n- acc.labelIDsToAdd = [...acc.labelIDsToAdd, existingLabel.id];\n- return acc;\n-\n- }, {labelIDsToAdd: [] as string[], labelsToCreate: [] as ILabelIncluded[]});\n+ private findLabelsToCreate(currentLabels: Label[], labels: ILabelIncluded[]): ILabelIncluded[] {\n+ return labels.filter(\n+ (l) => !currentLabels.find((el) => l.attributes.name === el.name),\n+ );\n}\nprivate async createLabels(labelsToCreate: ILabelIncluded[]): Promise<Label[]> {\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Clean up label creation from task templates Co-authored-by: Iris Scholten <[email protected]>
305,165
07.03.2019 16:20:02
28,800
7e0f70c92453adc1955150d6ecc0807165fcad43
Update tasks removeLabels to take labelIDs instead of labels array
[ { "change_type": "MODIFY", "old_path": "src/wrappers/tasks.ts", "new_path": "src/wrappers/tasks.ts", "diff": "@@ -132,8 +132,8 @@ export default class {\nreturn Promise.all(promises);\n}\n- public removeLabels(taskID: string, labels: ILabel[]): Promise<Response[]> {\n- const promises = labels.map((l) => this.removeLabel(taskID, l.id || \"\"));\n+ public removeLabels(taskID: string, labelIDs: string[]): Promise<Response[]> {\n+ const promises = labelIDs.map((l) => this.removeLabel(taskID, l));\nreturn Promise.all(promises);\n}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Update tasks removeLabels to take labelIDs instead of labels array
305,165
08.03.2019 10:01:16
28,800
c0ce1717543818308630ba42bd50128ec3c6105a
Fix error in create cell from template in dashboards
[ { "change_type": "MODIFY", "old_path": "src/wrappers/dashboards.ts", "new_path": "src/wrappers/dashboards.ts", "diff": "@@ -356,8 +356,8 @@ export default class {\n}, [] as ICellIncluded[]);\nconst pendingCells = cellsToCreate.map((c) => {\n- const { attributes: { name, x, y, w, h } } = c;\n- return this.createCell(createdDashboard.id, { name, x, y, w, h });\n+ const { attributes: { x, y, w, h } } = c;\n+ return this.createCell(createdDashboard.id, { x, y, w, h });\n});\nconst cellResponses = await Promise.all(pendingCells);\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Fix error in create cell from template in dashboards
305,165
08.03.2019 16:05:47
28,800
4be6710f08e5f6d1e47eafffc4f9e2c0ba4e413c
fix add existing label when creating from templates
[ { "change_type": "MODIFY", "old_path": "package-lock.json", "new_path": "package-lock.json", "diff": "{\n\"name\": \"@influxdata/influx\",\n- \"version\": \"0.2.31\",\n+ \"version\": \"0.2.32\",\n\"lockfileVersion\": 1,\n\"requires\": true,\n\"dependencies\": {\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/dashboards.ts", "new_path": "src/wrappers/dashboards.ts", "diff": "@@ -335,9 +335,9 @@ export default class {\ncurrentLabels: Label[],\nlabels: ILabelIncluded[]\n): string[] {\n- return labels\n- .filter(l => !!currentLabels.find(el => el.name === l.attributes.name))\n- .map(l => l.id)\n+ return currentLabels\n+ .filter(el => !!labels.find(l => el.name === l.attributes.name))\n+ .map(l => l.id || '')\n}\nprivate findLabelsToCreate(\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/tasks.ts", "new_path": "src/wrappers/tasks.ts", "diff": "@@ -244,9 +244,9 @@ export default class {\ncurrentLabels: Label[],\nlabels: ILabelIncluded[]\n): string[] {\n- return labels\n- .filter(l => !!currentLabels.find(el => l.attributes.name === el.name))\n- .map(l => l.id)\n+ return currentLabels\n+ .filter(el => !!labels.find(l => l.attributes.name === el.name))\n+ .map(l => l.id || '')\n}\nprivate findLabelsToCreate(\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
fix add existing label when creating from templates
305,161
11.03.2019 12:42:48
25,200
b0a23e0a28b4ea5f4831c1d40dff3c6a273372f8
Create wrapper for templates api
[ { "change_type": "MODIFY", "old_path": "src/api/api.ts", "new_path": "src/api/api.ts", "diff": "@@ -491,23 +491,35 @@ export interface Bucket {\n*/\nexport interface BucketLinks {\n/**\n- *\n+ * URI of resource.\n* @type {string}\n* @memberof BucketLinks\n*/\nself?: string;\n/**\n- *\n+ * URI of resource.\n* @type {string}\n* @memberof BucketLinks\n*/\norg?: string;\n/**\n- *\n+ * URI of resource.\n* @type {string}\n* @memberof BucketLinks\n*/\nwrite?: string;\n+ /**\n+ * URI of resource.\n+ * @type {string}\n+ * @memberof BucketLinks\n+ */\n+ members?: string;\n+ /**\n+ * URI of resource.\n+ * @type {string}\n+ * @memberof BucketLinks\n+ */\n+ owners?: string;\n}\n/**\n@@ -1155,6 +1167,156 @@ export namespace Dialect {\n}\n}\n+/**\n+ *\n+ * @export\n+ * @interface Document\n+ */\n+export interface Document {\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof Document\n+ */\n+ id?: string;\n+ /**\n+ *\n+ * @type {DocumentMeta}\n+ * @memberof Document\n+ */\n+ meta?: DocumentMeta;\n+ /**\n+ *\n+ * @type {any}\n+ * @memberof Document\n+ */\n+ content?: any;\n+ /**\n+ *\n+ * @type {Array<Label>}\n+ * @memberof Document\n+ */\n+ labels?: Array<Label>;\n+}\n+\n+/**\n+ *\n+ * @export\n+ * @interface DocumentCreate\n+ */\n+export interface DocumentCreate {\n+ /**\n+ *\n+ * @type {DocumentMeta}\n+ * @memberof DocumentCreate\n+ */\n+ meta?: DocumentMeta;\n+ /**\n+ *\n+ * @type {any}\n+ * @memberof DocumentCreate\n+ */\n+ content?: any;\n+ /**\n+ * must specify one of orgID and org\n+ * @type {string}\n+ * @memberof DocumentCreate\n+ */\n+ org?: string;\n+ /**\n+ * must specify one of orgID and org\n+ * @type {string}\n+ * @memberof DocumentCreate\n+ */\n+ orgID?: string;\n+ /**\n+ * this is an array of label strings that will be added as labels to the document\n+ * @type {Array<string>}\n+ * @memberof DocumentCreate\n+ */\n+ labels?: Array<string>;\n+}\n+\n+/**\n+ *\n+ * @export\n+ * @interface DocumentListEntry\n+ */\n+export interface DocumentListEntry {\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof DocumentListEntry\n+ */\n+ id?: string;\n+ /**\n+ *\n+ * @type {DocumentMeta}\n+ * @memberof DocumentListEntry\n+ */\n+ meta?: DocumentMeta;\n+ /**\n+ *\n+ * @type {Array<Label>}\n+ * @memberof DocumentListEntry\n+ */\n+ labels?: Array<Label>;\n+}\n+\n+/**\n+ *\n+ * @export\n+ * @interface DocumentMeta\n+ */\n+export interface DocumentMeta {\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof DocumentMeta\n+ */\n+ name?: string;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof DocumentMeta\n+ */\n+ version?: string;\n+}\n+\n+/**\n+ *\n+ * @export\n+ * @interface DocumentUpdate\n+ */\n+export interface DocumentUpdate {\n+ /**\n+ *\n+ * @type {DocumentMeta}\n+ * @memberof DocumentUpdate\n+ */\n+ meta?: DocumentMeta;\n+ /**\n+ *\n+ * @type {any}\n+ * @memberof DocumentUpdate\n+ */\n+ content?: any;\n+}\n+\n+/**\n+ *\n+ * @export\n+ * @interface Documents\n+ */\n+export interface Documents {\n+ /**\n+ *\n+ * @type {Array<DocumentListEntry>}\n+ * @memberof Documents\n+ */\n+ documents?: Array<DocumentListEntry>;\n+}\n+\n/**\n* a pair consisting of length of time and the unit of time measured. It is the atomic unit from which all duration literals are composed.\n* @export\n@@ -2108,8 +2270,12 @@ export namespace ModelError {\nNotFound = 'not found',\nConflict = 'conflict',\nInvalid = 'invalid',\n+ UnprocessableEntity = 'unprocessable entity',\nEmptyValue = 'empty value',\n- Unavailable = 'unavailable'\n+ Unavailable = 'unavailable',\n+ Forbidden = 'forbidden',\n+ Unauthorized = 'unauthorized',\n+ MethodNotAllowed = 'method not allowed'\n}\n}\n@@ -2359,12 +2525,6 @@ export interface Organization {\n* @memberof Organization\n*/\nstatus?: Organization.StatusEnum;\n- /**\n- *\n- * @type {Owners}\n- * @memberof Organization\n- */\n- owners?: Owners;\n}\n/**\n@@ -2389,43 +2549,49 @@ export namespace Organization {\n*/\nexport interface OrganizationLinks {\n/**\n- *\n+ * URI of resource.\n* @type {string}\n* @memberof OrganizationLinks\n*/\nself?: string;\n/**\n- *\n+ * URI of resource.\n* @type {string}\n* @memberof OrganizationLinks\n*/\nmembers?: string;\n/**\n- *\n+ * URI of resource.\n+ * @type {string}\n+ * @memberof OrganizationLinks\n+ */\n+ owners?: string;\n+ /**\n+ * URI of resource.\n* @type {string}\n* @memberof OrganizationLinks\n*/\nlabels?: string;\n/**\n- *\n+ * URI of resource.\n* @type {string}\n* @memberof OrganizationLinks\n*/\nsecrets?: string;\n/**\n- *\n+ * URI of resource.\n* @type {string}\n* @memberof OrganizationLinks\n*/\nbuckets?: string;\n/**\n- *\n+ * URI of resource.\n* @type {string}\n* @memberof OrganizationLinks\n*/\ntasks?: string;\n/**\n- *\n+ * URI of resource.\n* @type {string}\n* @memberof OrganizationLinks\n*/\n@@ -2452,26 +2618,6 @@ export interface Organizations {\norgs?: Array<Organization>;\n}\n-/**\n- *\n- * @export\n- * @interface Owners\n- */\n-export interface Owners {\n- /**\n- *\n- * @type {Users}\n- * @memberof Owners\n- */\n- users?: Users;\n- /**\n- *\n- * @type {Organizations}\n- * @memberof Owners\n- */\n- organizations?: Organizations;\n-}\n-\n/**\n* represents a complete package source tree\n* @export\n@@ -3675,10 +3821,10 @@ export interface ScraperTargetResponse extends ScraperTargetRequest {\nname?: string;\n/**\n*\n- * @type {Links}\n+ * @type {any}\n* @memberof ScraperTargetResponse\n*/\n- links?: Links;\n+ links?: any;\n}\n/**\n@@ -3962,15 +4108,15 @@ export interface Task {\n* @type {string}\n* @memberof Task\n*/\n- id?: string;\n+ id: string;\n/**\n* The ID of the organization that owns this Task.\n* @type {string}\n* @memberof Task\n*/\n- orgID?: string;\n+ orgID: string;\n/**\n- * The organization that owns this Task.\n+ * The name of the organization that owns this Task.\n* @type {string}\n* @memberof Task\n*/\n@@ -6021,6 +6167,27 @@ export interface TelegrafRequestPlugin {\n* @memberof TelegrafRequestPlugin\n*/\nname: string;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof TelegrafRequestPlugin\n+ */\n+ type: TelegrafRequestPlugin.TypeEnum;\n+}\n+\n+/**\n+ * @export\n+ * @namespace TelegrafRequestPlugin\n+ */\n+export namespace TelegrafRequestPlugin {\n+ /**\n+ * @export\n+ * @enum {string}\n+ */\n+ export enum TypeEnum {\n+ Input = 'input',\n+ Output = 'output'\n+ }\n}\n/**\n@@ -6167,7 +6334,7 @@ export interface UserLinks {\n* @type {string}\n* @memberof UserLinks\n*/\n- log?: string;\n+ logs?: string;\n}\n/**\n@@ -19573,6 +19740,356 @@ export class TelegrafsApi extends BaseAPI {\n}\n+/**\n+ * TemplatesApi - axios parameter creator\n+ * @export\n+ */\n+export const TemplatesApiAxiosParamCreator = function (configuration?: Configuration) {\n+ return {\n+ /**\n+ *\n+ * @param {string} org specifies the name of the organization of the template\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ */\n+ documentsTemplatesGet(org: string, zapTraceSpan?: string, options: any = {}): RequestArgs {\n+ // verify required parameter 'org' is not null or undefined\n+ if (org === null || org === undefined) {\n+ throw new RequiredError('org','Required parameter org was null or undefined when calling documentsTemplatesGet.');\n+ }\n+ const localVarPath = `/documents/templates`;\n+ const localVarUrlObj = url.parse(localVarPath, true);\n+ let baseOptions;\n+ if (configuration) {\n+ baseOptions = configuration.baseOptions;\n+ }\n+ const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions, options);\n+ const localVarHeaderParameter = {} as any;\n+ const localVarQueryParameter = {} as any;\n+\n+ if (org !== undefined) {\n+ localVarQueryParameter['org'] = org;\n+ }\n+\n+ if (zapTraceSpan !== undefined && zapTraceSpan !== null) {\n+ localVarHeaderParameter['Zap-Trace-Span'] = String(zapTraceSpan);\n+ }\n+\n+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);\n+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943\n+ delete localVarUrlObj.search;\n+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);\n+\n+ return {\n+ url: url.format(localVarUrlObj),\n+ options: localVarRequestOptions,\n+ };\n+ },\n+ /**\n+ *\n+ * @summary Create a template\n+ * @param {DocumentCreate} documentCreate template that will be created\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ */\n+ documentsTemplatesPost(documentCreate: DocumentCreate, zapTraceSpan?: string, options: any = {}): RequestArgs {\n+ // verify required parameter 'documentCreate' is not null or undefined\n+ if (documentCreate === null || documentCreate === undefined) {\n+ throw new RequiredError('documentCreate','Required parameter documentCreate was null or undefined when calling documentsTemplatesPost.');\n+ }\n+ const localVarPath = `/documents/templates`;\n+ const localVarUrlObj = url.parse(localVarPath, true);\n+ let baseOptions;\n+ if (configuration) {\n+ baseOptions = configuration.baseOptions;\n+ }\n+ const localVarRequestOptions = Object.assign({ method: 'POST' }, baseOptions, options);\n+ const localVarHeaderParameter = {} as any;\n+ const localVarQueryParameter = {} as any;\n+\n+ if (zapTraceSpan !== undefined && zapTraceSpan !== null) {\n+ localVarHeaderParameter['Zap-Trace-Span'] = String(zapTraceSpan);\n+ }\n+\n+ localVarHeaderParameter['Content-Type'] = 'application/json';\n+\n+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);\n+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943\n+ delete localVarUrlObj.search;\n+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);\n+ const needsSerialization = (<any>\"DocumentCreate\" !== \"string\") || localVarRequestOptions.headers['Content-Type'] === 'application/json';\n+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(documentCreate || {}) : (documentCreate || \"\");\n+\n+ return {\n+ url: url.format(localVarUrlObj),\n+ options: localVarRequestOptions,\n+ };\n+ },\n+ /**\n+ *\n+ * @param {string} templateID ID of template\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ */\n+ documentsTemplatesTemplateIDGet(templateID: string, zapTraceSpan?: string, options: any = {}): RequestArgs {\n+ // verify required parameter 'templateID' is not null or undefined\n+ if (templateID === null || templateID === undefined) {\n+ throw new RequiredError('templateID','Required parameter templateID was null or undefined when calling documentsTemplatesTemplateIDGet.');\n+ }\n+ const localVarPath = `/documents/templates/{templateID}`\n+ .replace(`{${\"templateID\"}}`, encodeURIComponent(String(templateID)));\n+ const localVarUrlObj = url.parse(localVarPath, true);\n+ let baseOptions;\n+ if (configuration) {\n+ baseOptions = configuration.baseOptions;\n+ }\n+ const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions, options);\n+ const localVarHeaderParameter = {} as any;\n+ const localVarQueryParameter = {} as any;\n+\n+ if (zapTraceSpan !== undefined && zapTraceSpan !== null) {\n+ localVarHeaderParameter['Zap-Trace-Span'] = String(zapTraceSpan);\n+ }\n+\n+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);\n+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943\n+ delete localVarUrlObj.search;\n+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);\n+\n+ return {\n+ url: url.format(localVarUrlObj),\n+ options: localVarRequestOptions,\n+ };\n+ },\n+ /**\n+ *\n+ * @param {string} templateID ID of template\n+ * @param {DocumentUpdate} documentUpdate template that will be updated\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ */\n+ documentsTemplatesTemplateIDPut(templateID: string, documentUpdate: DocumentUpdate, zapTraceSpan?: string, options: any = {}): RequestArgs {\n+ // verify required parameter 'templateID' is not null or undefined\n+ if (templateID === null || templateID === undefined) {\n+ throw new RequiredError('templateID','Required parameter templateID was null or undefined when calling documentsTemplatesTemplateIDPut.');\n+ }\n+ // verify required parameter 'documentUpdate' is not null or undefined\n+ if (documentUpdate === null || documentUpdate === undefined) {\n+ throw new RequiredError('documentUpdate','Required parameter documentUpdate was null or undefined when calling documentsTemplatesTemplateIDPut.');\n+ }\n+ const localVarPath = `/documents/templates/{templateID}`\n+ .replace(`{${\"templateID\"}}`, encodeURIComponent(String(templateID)));\n+ const localVarUrlObj = url.parse(localVarPath, true);\n+ let baseOptions;\n+ if (configuration) {\n+ baseOptions = configuration.baseOptions;\n+ }\n+ const localVarRequestOptions = Object.assign({ method: 'PUT' }, baseOptions, options);\n+ const localVarHeaderParameter = {} as any;\n+ const localVarQueryParameter = {} as any;\n+\n+ if (zapTraceSpan !== undefined && zapTraceSpan !== null) {\n+ localVarHeaderParameter['Zap-Trace-Span'] = String(zapTraceSpan);\n+ }\n+\n+ localVarHeaderParameter['Content-Type'] = 'application/json';\n+\n+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);\n+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943\n+ delete localVarUrlObj.search;\n+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);\n+ const needsSerialization = (<any>\"DocumentUpdate\" !== \"string\") || localVarRequestOptions.headers['Content-Type'] === 'application/json';\n+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(documentUpdate || {}) : (documentUpdate || \"\");\n+\n+ return {\n+ url: url.format(localVarUrlObj),\n+ options: localVarRequestOptions,\n+ };\n+ },\n+ }\n+};\n+\n+/**\n+ * TemplatesApi - functional programming interface\n+ * @export\n+ */\n+export const TemplatesApiFp = function(configuration?: Configuration) {\n+ return {\n+ /**\n+ *\n+ * @param {string} org specifies the name of the organization of the template\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ */\n+ documentsTemplatesGet(org: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Documents> {\n+ const localVarAxiosArgs = TemplatesApiAxiosParamCreator(configuration).documentsTemplatesGet(org, zapTraceSpan, options);\n+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\n+ const axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\n+ return axios.request(axiosRequestArgs);\n+ };\n+ },\n+ /**\n+ *\n+ * @summary Create a template\n+ * @param {DocumentCreate} documentCreate template that will be created\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ */\n+ documentsTemplatesPost(documentCreate: DocumentCreate, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Document> {\n+ const localVarAxiosArgs = TemplatesApiAxiosParamCreator(configuration).documentsTemplatesPost(documentCreate, zapTraceSpan, options);\n+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\n+ const axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\n+ return axios.request(axiosRequestArgs);\n+ };\n+ },\n+ /**\n+ *\n+ * @param {string} templateID ID of template\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ */\n+ documentsTemplatesTemplateIDGet(templateID: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Document> {\n+ const localVarAxiosArgs = TemplatesApiAxiosParamCreator(configuration).documentsTemplatesTemplateIDGet(templateID, zapTraceSpan, options);\n+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\n+ const axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\n+ return axios.request(axiosRequestArgs);\n+ };\n+ },\n+ /**\n+ *\n+ * @param {string} templateID ID of template\n+ * @param {DocumentUpdate} documentUpdate template that will be updated\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ */\n+ documentsTemplatesTemplateIDPut(templateID: string, documentUpdate: DocumentUpdate, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Document> {\n+ const localVarAxiosArgs = TemplatesApiAxiosParamCreator(configuration).documentsTemplatesTemplateIDPut(templateID, documentUpdate, zapTraceSpan, options);\n+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\n+ const axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\n+ return axios.request(axiosRequestArgs);\n+ };\n+ },\n+ }\n+};\n+\n+/**\n+ * TemplatesApi - factory interface\n+ * @export\n+ */\n+export const TemplatesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {\n+ return {\n+ /**\n+ *\n+ * @param {string} org specifies the name of the organization of the template\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ */\n+ documentsTemplatesGet(org: string, zapTraceSpan?: string, options?: any) {\n+ return TemplatesApiFp(configuration).documentsTemplatesGet(org, zapTraceSpan, options)(axios, basePath);\n+ },\n+ /**\n+ *\n+ * @summary Create a template\n+ * @param {DocumentCreate} documentCreate template that will be created\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ */\n+ documentsTemplatesPost(documentCreate: DocumentCreate, zapTraceSpan?: string, options?: any) {\n+ return TemplatesApiFp(configuration).documentsTemplatesPost(documentCreate, zapTraceSpan, options)(axios, basePath);\n+ },\n+ /**\n+ *\n+ * @param {string} templateID ID of template\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ */\n+ documentsTemplatesTemplateIDGet(templateID: string, zapTraceSpan?: string, options?: any) {\n+ return TemplatesApiFp(configuration).documentsTemplatesTemplateIDGet(templateID, zapTraceSpan, options)(axios, basePath);\n+ },\n+ /**\n+ *\n+ * @param {string} templateID ID of template\n+ * @param {DocumentUpdate} documentUpdate template that will be updated\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ */\n+ documentsTemplatesTemplateIDPut(templateID: string, documentUpdate: DocumentUpdate, zapTraceSpan?: string, options?: any) {\n+ return TemplatesApiFp(configuration).documentsTemplatesTemplateIDPut(templateID, documentUpdate, zapTraceSpan, options)(axios, basePath);\n+ },\n+ };\n+};\n+\n+/**\n+ * TemplatesApi - object-oriented interface\n+ * @export\n+ * @class TemplatesApi\n+ * @extends {BaseAPI}\n+ */\n+export class TemplatesApi extends BaseAPI {\n+ /**\n+ *\n+ * @param {string} org specifies the name of the organization of the template\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ * @memberof TemplatesApi\n+ */\n+ public documentsTemplatesGet(org: string, zapTraceSpan?: string, options?: any) {\n+ return TemplatesApiFp(this.configuration).documentsTemplatesGet(org, zapTraceSpan, options)(this.axios, this.basePath);\n+ }\n+\n+ /**\n+ *\n+ * @summary Create a template\n+ * @param {DocumentCreate} documentCreate template that will be created\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ * @memberof TemplatesApi\n+ */\n+ public documentsTemplatesPost(documentCreate: DocumentCreate, zapTraceSpan?: string, options?: any) {\n+ return TemplatesApiFp(this.configuration).documentsTemplatesPost(documentCreate, zapTraceSpan, options)(this.axios, this.basePath);\n+ }\n+\n+ /**\n+ *\n+ * @param {string} templateID ID of template\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ * @memberof TemplatesApi\n+ */\n+ public documentsTemplatesTemplateIDGet(templateID: string, zapTraceSpan?: string, options?: any) {\n+ return TemplatesApiFp(this.configuration).documentsTemplatesTemplateIDGet(templateID, zapTraceSpan, options)(this.axios, this.basePath);\n+ }\n+\n+ /**\n+ *\n+ * @param {string} templateID ID of template\n+ * @param {DocumentUpdate} documentUpdate template that will be updated\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ * @memberof TemplatesApi\n+ */\n+ public documentsTemplatesTemplateIDPut(templateID: string, documentUpdate: DocumentUpdate, zapTraceSpan?: string, options?: any) {\n+ return TemplatesApiFp(this.configuration).documentsTemplatesTemplateIDPut(templateID, documentUpdate, zapTraceSpan, options)(this.axios, this.basePath);\n+ }\n+\n+}\n+\n/**\n* UsersApi - axios parameter creator\n* @export\n" }, { "change_type": "MODIFY", "old_path": "src/index.ts", "new_path": "src/index.ts", "diff": "@@ -15,6 +15,7 @@ import TelegrafConfigs from './wrappers/telegrafConfigs'\nimport Users from './wrappers/users'\nimport Variables from './wrappers/variables'\nimport Write from './wrappers/write'\n+import Templates from './wrappers/templates'\nexport * from './types'\nexport * from './api'\n@@ -37,6 +38,7 @@ export default class Client {\npublic users: Users\npublic variables: Variables\npublic write: Write\n+ public templates: Templates\nconstructor(basePath: string) {\nthis.auth = new Auth(basePath)\n@@ -56,5 +58,6 @@ export default class Client {\nthis.users = new Users(basePath)\nthis.variables = new Variables(basePath)\nthis.write = new Write(basePath)\n+ this.templates = new Templates(basePath)\n}\n}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/wrappers/templates.ts", "diff": "+import {TemplatesApi, DocumentListEntry, Document, DocumentCreate} from '../api'\n+\n+export default class {\n+ private service: TemplatesApi\n+\n+ constructor(basePath: string) {\n+ this.service = new TemplatesApi({basePath})\n+ }\n+\n+ public async getAll(orgName: string): Promise<DocumentListEntry[]> {\n+ const {data} = await this.service.documentsTemplatesGet(orgName)\n+\n+ if (data.documents) {\n+ return data.documents\n+ }\n+\n+ return []\n+ }\n+\n+ public async get(templateID: string): Promise<Document> {\n+ const {data} = await this.service.documentsTemplatesTemplateIDGet(\n+ templateID\n+ )\n+\n+ return data\n+ }\n+\n+ public async create(templateCreate: DocumentCreate): Promise<Document> {\n+ const {data} = await this.service.documentsTemplatesPost(templateCreate)\n+\n+ return data\n+ }\n+}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Create wrapper for templates api
305,166
07.03.2019 13:03:05
18,000
90ea7bba8e706b82764c7c296f0fb89d16ccb8d4
fix(wrappers/telegrafs): ensure labels for telegrafs
[ { "change_type": "MODIFY", "old_path": "src/types/index.ts", "new_path": "src/types/index.ts", "diff": "-import {Bucket, Cell, Dashboard, Task, View} from '../api'\n+import {Bucket, Cell, Dashboard, Task, Telegraf, View} from '../api'\nimport {Label as APILabel} from '../api'\nexport interface ILabelProperties {\n@@ -25,6 +25,10 @@ export interface ITask extends Task {\nlabels: ILabel[]\n}\n+export interface ITelegraf extends Telegraf {\n+ labels: ILabel[]\n+}\n+\ntype DashboardPicked = Pick<Dashboard, 'orgID' | 'id' | 'name' | 'cells'>\ntype DashboardOriginal = Pick<\nDashboard,\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/telegrafConfigs.ts", "new_path": "src/wrappers/telegrafConfigs.ts", "diff": "-import {\n- Organization,\n- Telegraf,\n- TelegrafPluginConfig,\n- TelegrafRequest,\n- TelegrafsApi,\n-} from '../api'\n-import {ILabel} from '../types'\n+import {Organization, Telegraf, TelegrafRequest, TelegrafsApi} from '../api'\n+import {ILabel, ITelegraf} from '../types'\nimport {addLabelDefaults} from './labels'\n+const addDefaults = (telegraf: Telegraf): ITelegraf => {\n+ return {\n+ ...telegraf,\n+ labels: (telegraf.labels || []).map(addLabelDefaults),\n+ }\n+}\n+\n+const addDefaultsToAll = (telegrafs: Telegraf[]): ITelegraf[] =>\n+ telegrafs.map(telegraf => addDefaults(telegraf))\n+\nexport default class {\nprivate service: TelegrafsApi\n@@ -15,14 +19,14 @@ export default class {\nthis.service = new TelegrafsApi({basePath})\n}\n- public async getAll(): Promise<TelegrafPluginConfig[]> {\n+ public async getAll(): Promise<ITelegraf[]> {\nconst {\ndata: {configurations},\n} = await this.service.telegrafsGet('')\n- return configurations || []\n+ return addDefaultsToAll(configurations || [])\n}\n- public async getAllByOrg(org: Organization): Promise<TelegrafPluginConfig[]> {\n+ public async getAllByOrg(org: Organization): Promise<ITelegraf[]> {\nif (!org.id) {\nthrow new Error('organization must have an id')\n}\n@@ -31,7 +35,7 @@ export default class {\ndata: {configurations},\n} = await this.service.telegrafsGet(org.id)\n- return configurations || []\n+ return addDefaultsToAll(configurations || [])\n}\npublic async getTOML(id: string): Promise<string> {\n@@ -50,19 +54,22 @@ export default class {\nreturn data as string\n}\n- public async get(id: string): Promise<Telegraf> {\n+ public async get(id: string): Promise<ITelegraf> {\nconst {data} = await this.service.telegrafsTelegrafIDGet(id)\n- return data\n+ return addDefaults(data)\n}\n- public async create(props: Telegraf): Promise<Telegraf> {\n+ public async create(props: Telegraf): Promise<ITelegraf> {\nconst {data} = await this.service.telegrafsPost(props)\n- return data\n+ return addDefaults(data)\n}\n- public async update(id: string, props: Partial<Telegraf>): Promise<Telegraf> {\n+ public async update(\n+ id: string,\n+ props: Partial<Telegraf>\n+ ): Promise<ITelegraf> {\nconst original = await this.get(id)\nconst update = {...original, ...props} as TelegrafRequest\n@@ -71,7 +78,7 @@ export default class {\nupdate\n)\n- return updated\n+ return addDefaults(updated)\n}\npublic async delete(id: string): Promise<Response> {\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
fix(wrappers/telegrafs): ensure labels for telegrafs
305,161
12.03.2019 16:10:46
25,200
eb2a98d36c1494fd19669a070a369cc121181132
Fix return type of dashboards get all byorgID
[ { "change_type": "MODIFY", "old_path": "src/wrappers/dashboards.ts", "new_path": "src/wrappers/dashboards.ts", "diff": "@@ -66,7 +66,7 @@ export default class {\nreturn addDefaultsToAll(data.dashboards || [])\n}\n- public async getAllByOrgID(orgID: string): Promise<Dashboard[]> {\n+ public async getAllByOrgID(orgID: string): Promise<IDashboard[]> {\nconst {data} = await this.service.dashboardsGet(\nundefined,\nundefined,\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Fix return type of dashboards get all byorgID
305,164
12.03.2019 16:57:34
25,200
da5a0ed8e5420c8400514fd5c66bed02b38a1fcc
Make release-patch script
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"tsc\": \"tsc -p ./tsconfig.json --noEmit --pretty\",\n\"eslint\": \"eslint 'src/**/*.ts'\",\n\"eslint:fix\": \"eslint --fix 'src/**/*.ts'\",\n- \"release\": \"release-it minor --git.tagName 'Bump version ${version}'\"\n+ \"release-patch\": \"release-it patch --git.tagName 'Bump version ${version}'\"\n},\n\"types\": \"index.d.ts\",\n\"keywords\": [\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Make release-patch script
305,164
12.03.2019 17:02:30
25,200
9e98d96bbc36c0df92b2300e7b4b891575623b66
Use simple release tag name
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"tsc\": \"tsc -p ./tsconfig.json --noEmit --pretty\",\n\"eslint\": \"eslint 'src/**/*.ts'\",\n\"eslint:fix\": \"eslint --fix 'src/**/*.ts'\",\n- \"release-patch\": \"release-it patch --git.tagName='Bump version ${version}'\"\n+ \"release-patch\": \"release-it patch\"\n},\n\"types\": \"index.d.ts\",\n\"keywords\": [\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Use simple release tag name
305,161
14.03.2019 12:37:46
25,200
498c41fa6ec8e4f114228bf10b08ac0cdc835c51
Add required types to Document
[ { "change_type": "MODIFY", "old_path": "src/api/api.ts", "new_path": "src/api/api.ts", "diff": "@@ -1178,25 +1178,25 @@ export interface Document {\n* @type {string}\n* @memberof Document\n*/\n- id?: string;\n+ id: string;\n/**\n*\n* @type {DocumentMeta}\n* @memberof Document\n*/\n- meta?: DocumentMeta;\n+ meta: DocumentMeta;\n/**\n*\n* @type {any}\n* @memberof Document\n*/\n- content?: any;\n+ content: any;\n/**\n*\n* @type {Array<Label>}\n* @memberof Document\n*/\n- labels?: Array<Label>;\n+ labels: Array<Label>;\n}\n/**\n@@ -1210,13 +1210,13 @@ export interface DocumentCreate {\n* @type {DocumentMeta}\n* @memberof DocumentCreate\n*/\n- meta?: DocumentMeta;\n+ meta: DocumentMeta;\n/**\n*\n* @type {any}\n* @memberof DocumentCreate\n*/\n- content?: any;\n+ content: any;\n/**\n* must specify one of orgID and org\n* @type {string}\n@@ -1248,19 +1248,19 @@ export interface DocumentListEntry {\n* @type {string}\n* @memberof DocumentListEntry\n*/\n- id?: string;\n+ id: string;\n/**\n*\n* @type {DocumentMeta}\n* @memberof DocumentListEntry\n*/\n- meta?: DocumentMeta;\n+ meta: DocumentMeta;\n/**\n*\n* @type {Array<Label>}\n* @memberof DocumentListEntry\n*/\n- labels?: Array<Label>;\n+ labels: Array<Label>;\n}\n/**\n@@ -1274,13 +1274,13 @@ export interface DocumentMeta {\n* @type {string}\n* @memberof DocumentMeta\n*/\n- name?: string;\n+ name: string;\n/**\n*\n* @type {string}\n* @memberof DocumentMeta\n*/\n- version?: string;\n+ version: string;\n}\n/**\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add required types to Document
305,161
14.03.2019 12:56:49
25,200
73d6095cc9846f707bd04f0ee53c6ee0640b397f
Convert documents to template before returning
[ { "change_type": "MODIFY", "old_path": "src/types/index.ts", "new_path": "src/types/index.ts", "diff": "-import {Bucket, Cell, Dashboard, Task, Telegraf, View} from '../api'\n+import {Bucket, Cell, Dashboard, Task, Telegraf, View, Document} from '../api'\nimport {Label as APILabel} from '../api'\nexport interface ILabelProperties {\n@@ -52,27 +52,20 @@ interface IKeyValuePairs {\n[key: string]: any\n}\n-export interface ITemplate {\n- id?: string\n- meta: ITemplateMeta\n+export interface ITemplate extends Document {\ncontent: ITemplateContent\n- labels?: string[]\n-}\n-\n-interface ITemplateMeta extends IKeyValuePairs {\n- name: string\n- version: string\n+ labels: ILabel[]\n}\ninterface ITemplateContent {\ndata: ITemplateData\n- included?: ITemplateIncluded[]\n+ included: ITemplateIncluded[]\n}\ninterface ITemplateData {\ntype: TemplateType\nattributes: IKeyValuePairs\n- relationships?: {[key in TemplateType]?: {data: IRelationship[]}}\n+ relationships: {[key in TemplateType]?: {data: IRelationship[]}}\n}\ninterface IRelationship {\n@@ -89,14 +82,14 @@ interface ITemplateIncluded {\nexport interface ITaskTemplate extends ITemplate {\ncontent: {\ndata: ITaskTemplateData\n- included?: ITaskTemplateIncluded[]\n+ included: ITaskTemplateIncluded[]\n}\n}\ninterface ITaskTemplateData extends ITemplateData {\ntype: TemplateType.Task\nattributes: {name: string; flux: string}\n- relationships?: {\n+ relationships: {\n[TemplateType.Label]: {data: ILabelRelationship[]}\n}\n}\n@@ -142,14 +135,14 @@ export interface ICellIncluded extends ITemplateIncluded {\nexport interface IDashboardTemplate extends ITemplate {\ncontent: {\ndata: IDashboardTemplateData\n- included?: IDashboardTemplateIncluded[]\n+ included: IDashboardTemplateIncluded[]\n}\n}\ninterface IDashboardTemplateData extends ITemplateData {\ntype: TemplateType.Dashboard\nattributes: IDashboard\n- relationships?: {\n+ relationships: {\n[TemplateType.Label]: {data: ILabelRelationship[]}\n[TemplateType.Cell]: {data: ICellRelationship[]}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/templates.ts", "new_path": "src/wrappers/templates.ts", "diff": "import {TemplatesApi, DocumentListEntry, Document, DocumentCreate} from '../api'\n+import {ITemplate} from '../types'\n+import {addLabelDefaults} from './labels'\n+\n+export const addTemplateDefaults = (d: Document): ITemplate => ({\n+ ...d,\n+ content: {data: {}, included: [], ...d.content},\n+ labels: d.labels.map(addLabelDefaults),\n+})\nexport default class {\nprivate service: TemplatesApi\n@@ -17,17 +25,17 @@ export default class {\nreturn []\n}\n- public async get(templateID: string): Promise<Document> {\n+ public async get(templateID: string): Promise<ITemplate> {\nconst {data} = await this.service.documentsTemplatesTemplateIDGet(\ntemplateID\n)\n- return data\n+ return addTemplateDefaults(data)\n}\n- public async create(templateCreate: DocumentCreate): Promise<Document> {\n+ public async create(templateCreate: DocumentCreate): Promise<ITemplate> {\nconst {data} = await this.service.documentsTemplatesPost(templateCreate)\n- return data\n+ return addTemplateDefaults(data)\n}\n}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Convert documents to template before returning
305,161
15.03.2019 13:29:27
25,200
a80af38e9936d75475f7e126134730b2d525f9c4
Clean up template types
[ { "change_type": "MODIFY", "old_path": "src/types/index.ts", "new_path": "src/types/index.ts", "diff": "@@ -52,51 +52,31 @@ interface IKeyValuePairs {\n[key: string]: any\n}\n-export interface ITemplate extends Document {\n- content: ITemplateContent\n+// Templates\n+interface ITemplateBase extends Document {\n+ content: {data: ITemplateData; included: ITemplateIncluded[]}\nlabels: ILabel[]\n}\n-interface ITemplateContent {\n- data: ITemplateData\n- included: ITemplateIncluded[]\n-}\n-\n+// TODO: be more specific about what attributes can be\ninterface ITemplateData {\ntype: TemplateType\nattributes: IKeyValuePairs\nrelationships: {[key in TemplateType]?: {data: IRelationship[]}}\n}\n-interface IRelationship {\n- type: TemplateType\n- id: string\n-}\n-\ninterface ITemplateIncluded {\ntype: TemplateType\nid: string\nattributes: IKeyValuePairs\n}\n-export interface ITaskTemplate extends ITemplate {\n- content: {\n- data: ITaskTemplateData\n- included: ITaskTemplateIncluded[]\n- }\n-}\n+// Template Relationships\n+type IRelationship = ICellRelationship | ILabelRelationship | IViewRelationship\n-interface ITaskTemplateData extends ITemplateData {\n- type: TemplateType.Task\n- attributes: {name: string; flux: string}\n- relationships: {\n- [TemplateType.Label]: {data: ILabelRelationship[]}\n- }\n-}\n-\n-interface ITaskTemplateIncluded extends ITemplateIncluded {\n- type: TemplateType.Label\n- attributes: {name: string; properties: ILabelProperties}\n+interface ICellRelationship {\n+ type: TemplateType.Cell\n+ id: string\n}\nexport interface ILabelRelationship {\n@@ -104,26 +84,17 @@ export interface ILabelRelationship {\nid: string\n}\n-export interface ILabelIncluded extends ITemplateIncluded {\n- type: TemplateType.Label\n- attributes: {name: string; properties: ILabelProperties}\n-}\n-\ninterface IViewRelationship {\ntype: TemplateType.View\nid: string\n}\n+// Template Includeds\nexport interface IViewIncluded extends ITemplateIncluded {\ntype: TemplateType.View\nattributes: View\n}\n-interface ICellRelationship {\n- type: TemplateType.Cell\n- id: string\n-}\n-\nexport interface ICellIncluded extends ITemplateIncluded {\ntype: TemplateType.Cell\nattributes: Cell\n@@ -132,10 +103,24 @@ export interface ICellIncluded extends ITemplateIncluded {\n}\n}\n-export interface IDashboardTemplate extends ITemplate {\n- content: {\n- data: IDashboardTemplateData\n- included: IDashboardTemplateIncluded[]\n+export interface ILabelIncluded extends ITemplateIncluded {\n+ type: TemplateType.Label\n+ attributes: ILabel\n+}\n+\n+export type ITaskTemplateIncluded = ILabelIncluded\n+\n+export type IDashboardTemplateIncluded =\n+ | ICellIncluded\n+ | IViewIncluded\n+ | ILabelIncluded\n+\n+// Template Datas\n+interface ITaskTemplateData extends ITemplateData {\n+ type: TemplateType.Task\n+ attributes: {name: string; flux: string}\n+ relationships: {\n+ [TemplateType.Label]: {data: ILabelRelationship[]}\n}\n}\n@@ -148,7 +133,19 @@ interface IDashboardTemplateData extends ITemplateData {\n}\n}\n-export type IDashboardTemplateIncluded =\n- | ICellIncluded\n- | IViewIncluded\n- | ILabelIncluded\n+// Templates\n+export interface ITaskTemplate extends ITemplateBase {\n+ content: {\n+ data: ITaskTemplateData\n+ included: ITaskTemplateIncluded[]\n+ }\n+}\n+\n+export interface IDashboardTemplate extends ITemplateBase {\n+ content: {\n+ data: IDashboardTemplateData\n+ included: IDashboardTemplateIncluded[]\n+ }\n+}\n+\n+export type ITemplate = ITaskTemplate | IDashboardTemplate\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Clean up template types
305,165
13.03.2019 16:14:30
25,200
aea4bd46d1ce6f29b2e7f976230217704632f73d
Regenerate client code and update types
[ { "change_type": "MODIFY", "old_path": "src/api/api.ts", "new_path": "src/api/api.ts", "diff": "@@ -495,31 +495,43 @@ export interface BucketLinks {\n* @type {string}\n* @memberof BucketLinks\n*/\n- self?: string;\n+ labels?: string;\n/**\n* URI of resource.\n* @type {string}\n* @memberof BucketLinks\n*/\n- org?: string;\n+ logs?: string;\n/**\n* URI of resource.\n* @type {string}\n* @memberof BucketLinks\n*/\n- write?: string;\n+ members?: string;\n/**\n* URI of resource.\n* @type {string}\n* @memberof BucketLinks\n*/\n- members?: string;\n+ org?: string;\n/**\n* URI of resource.\n* @type {string}\n* @memberof BucketLinks\n*/\nowners?: string;\n+ /**\n+ * URI of resource.\n+ * @type {string}\n+ * @memberof BucketLinks\n+ */\n+ self?: string;\n+ /**\n+ * URI of resource.\n+ * @type {string}\n+ * @memberof BucketLinks\n+ */\n+ write?: string;\n}\n/**\n@@ -640,12 +652,6 @@ export interface Cell {\n* @memberof Cell\n*/\nlinks?: CellLinks;\n- /**\n- *\n- * @type {string}\n- * @memberof Cell\n- */\n- name?: string;\n/**\n*\n* @type {number}\n@@ -1762,10 +1768,10 @@ export interface Label {\nname?: string;\n/**\n* Key/Value pairs associated with this label. Keys can be removed by sending an update with an empty value.\n- * @type {any}\n+ * @type {{ [key: string]: string; }}\n* @memberof Label\n*/\n- properties?: any;\n+ properties?: { [key: string]: string; };\n}\n/**\n@@ -2596,6 +2602,12 @@ export interface OrganizationLinks {\n* @memberof OrganizationLinks\n*/\ndashboards?: string;\n+ /**\n+ * URI of resource.\n+ * @type {string}\n+ * @memberof OrganizationLinks\n+ */\n+ logs?: string;\n}\n/**\n@@ -3255,6 +3267,46 @@ export interface QueryVariablePropertiesValues {\nlanguage?: string;\n}\n+/**\n+ *\n+ * @export\n+ * @interface Ready\n+ */\n+export interface Ready {\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof Ready\n+ */\n+ status?: Ready.StatusEnum;\n+ /**\n+ *\n+ * @type {Date}\n+ * @memberof Ready\n+ */\n+ start?: Date;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof Ready\n+ */\n+ up?: string;\n+}\n+\n+/**\n+ * @export\n+ * @namespace Ready\n+ */\n+export namespace Ready {\n+ /**\n+ * @export\n+ * @enum {string}\n+ */\n+ export enum StatusEnum {\n+ Ready = 'ready'\n+ }\n+}\n+\n/**\n* expressions begin and end with `/` and are regular expressions with syntax accepted by RE2\n* @export\n@@ -3813,12 +3865,6 @@ export interface ScraperTargetResponse extends ScraperTargetRequest {\n* @memberof ScraperTargetResponse\n*/\nbucket?: string;\n- /**\n- * name of scraper target\n- * @type {string}\n- * @memberof ScraperTargetResponse\n- */\n- name?: string;\n/**\n*\n* @type {any}\n@@ -4270,35 +4316,41 @@ export namespace TaskCreateRequest {\n*/\nexport interface TaskLinks {\n/**\n- *\n+ * URI of resource.\n* @type {string}\n* @memberof TaskLinks\n*/\nself?: string;\n/**\n- *\n+ * URI of resource.\n* @type {string}\n* @memberof TaskLinks\n*/\nowners?: string;\n/**\n- *\n+ * URI of resource.\n* @type {string}\n* @memberof TaskLinks\n*/\nmembers?: string;\n/**\n- *\n+ * URI of resource.\n* @type {string}\n* @memberof TaskLinks\n*/\nruns?: string;\n/**\n- *\n+ * URI of resource.\n* @type {string}\n* @memberof TaskLinks\n*/\nlogs?: string;\n+ /**\n+ * URI of resource.\n+ * @type {string}\n+ * @memberof TaskLinks\n+ */\n+ labels?: string;\n}\n/**\n@@ -7920,7 +7972,7 @@ export const BucketsApiFp = function(configuration?: Configuration) {\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- bucketsBucketIDLabelsGet(bucketID: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<InlineResponse200> {\n+ bucketsBucketIDLabelsGet(bucketID: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<LabelsResponse> {\nconst localVarAxiosArgs = BucketsApiAxiosParamCreator(configuration).bucketsBucketIDLabelsGet(bucketID, zapTraceSpan, options);\nreturn (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\nconst axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\n@@ -13018,7 +13070,7 @@ export const OrganizationsApiFp = function(configuration?: Configuration) {\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- orgsOrgIDLabelsGet(orgID: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<InlineResponse200> {\n+ orgsOrgIDLabelsGet(orgID: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<LabelsResponse> {\nconst localVarAxiosArgs = OrganizationsApiAxiosParamCreator(configuration).orgsOrgIDLabelsGet(orgID, zapTraceSpan, options);\nreturn (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\nconst axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\n@@ -14450,11 +14502,10 @@ export const ReadyApiAxiosParamCreator = function (configuration?: Configuration\n/**\n*\n* @summary Get the readiness of a instance at startup. Allow us to confirm the instance is prepared to accept requests.\n- * @param {string} [zapTraceSpan] OpenTracing span context\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- readyGet(zapTraceSpan?: string, options: any = {}): RequestArgs {\n+ readyGet(options: any = {}): RequestArgs {\nconst localVarPath = `/ready`;\nconst localVarUrlObj = url.parse(localVarPath, true);\nlet baseOptions;\n@@ -14465,10 +14516,6 @@ export const ReadyApiAxiosParamCreator = function (configuration?: Configuration\nconst localVarHeaderParameter = {} as any;\nconst localVarQueryParameter = {} as any;\n- if (zapTraceSpan !== undefined && zapTraceSpan !== null) {\n- localVarHeaderParameter['Zap-Trace-Span'] = String(zapTraceSpan);\n- }\n-\nlocalVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);\n// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943\ndelete localVarUrlObj.search;\n@@ -14491,12 +14538,11 @@ export const ReadyApiFp = function(configuration?: Configuration) {\n/**\n*\n* @summary Get the readiness of a instance at startup. Allow us to confirm the instance is prepared to accept requests.\n- * @param {string} [zapTraceSpan] OpenTracing span context\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- readyGet(zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Check> {\n- const localVarAxiosArgs = ReadyApiAxiosParamCreator(configuration).readyGet(zapTraceSpan, options);\n+ readyGet(options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Ready> {\n+ const localVarAxiosArgs = ReadyApiAxiosParamCreator(configuration).readyGet(options);\nreturn (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\nconst axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\nreturn axios.request(axiosRequestArgs);\n@@ -14514,12 +14560,11 @@ export const ReadyApiFactory = function (configuration?: Configuration, basePath\n/**\n*\n* @summary Get the readiness of a instance at startup. Allow us to confirm the instance is prepared to accept requests.\n- * @param {string} [zapTraceSpan] OpenTracing span context\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- readyGet(zapTraceSpan?: string, options?: any) {\n- return ReadyApiFp(configuration).readyGet(zapTraceSpan, options)(axios, basePath);\n+ readyGet(options?: any) {\n+ return ReadyApiFp(configuration).readyGet(options)(axios, basePath);\n},\n};\n};\n@@ -14534,13 +14579,12 @@ export class ReadyApi extends BaseAPI {\n/**\n*\n* @summary Get the readiness of a instance at startup. Allow us to confirm the instance is prepared to accept requests.\n- * @param {string} [zapTraceSpan] OpenTracing span context\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n* @memberof ReadyApi\n*/\n- public readyGet(zapTraceSpan?: string, options?: any) {\n- return ReadyApiFp(this.configuration).readyGet(zapTraceSpan, options)(this.axios, this.basePath);\n+ public readyGet(options?: any) {\n+ return ReadyApiFp(this.configuration).readyGet(options)(this.axios, this.basePath);\n}\n}\n@@ -15198,7 +15242,7 @@ export const ScraperTargetsApiFp = function(configuration?: Configuration) {\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- scrapersScraperTargetIDLabelsGet(scraperTargetID: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<InlineResponse200> {\n+ scrapersScraperTargetIDLabelsGet(scraperTargetID: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<LabelsResponse> {\nconst localVarAxiosArgs = ScraperTargetsApiAxiosParamCreator(configuration).scrapersScraperTargetIDLabelsGet(scraperTargetID, zapTraceSpan, options);\nreturn (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\nconst axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\n@@ -17766,7 +17810,7 @@ export const TasksApiFp = function(configuration?: Configuration) {\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- tasksTaskIDLabelsGet(taskID: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<InlineResponse200> {\n+ tasksTaskIDLabelsGet(taskID: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<LabelsResponse> {\nconst localVarAxiosArgs = TasksApiAxiosParamCreator(configuration).tasksTaskIDLabelsGet(taskID, zapTraceSpan, options);\nreturn (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\nconst axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\n" }, { "change_type": "MODIFY", "old_path": "src/types/index.ts", "new_path": "src/types/index.ts", "diff": "import {Bucket, Cell, Dashboard, Task, Telegraf, View, Document} from '../api'\nimport {Label as APILabel} from '../api'\n-export interface ILabelProperties {\n+interface KV {\n+ [x: string]: string\n+}\n+\n+export interface ILabelProperties extends KV {\ncolor: string\n- description?: string\n+ description: string\n}\nexport interface ILabel extends APILabel {\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/labels.ts", "new_path": "src/wrappers/labels.ts", "diff": "@@ -9,7 +9,8 @@ export const addLabelDefaults = (l: APILabel): ILabel => ({\nproperties: {\n...l.properties,\n// add defualt color hex if missing\n- color: l.properties.color || DEFAULT_LABEL_COLOR,\n+ color: (l.properties || {}).color || DEFAULT_LABEL_COLOR,\n+ description: (l.properties || {}).description || '',\n},\n})\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Regenerate client code and update types
305,172
18.03.2019 11:47:22
25,200
6f8fedf085875249a21e78669d39d3d1ecb51c57
feat(labels): update label name
[ { "change_type": "MODIFY", "old_path": "package-lock.json", "new_path": "package-lock.json", "diff": "{\n\"name\": \"@influxdata/influx\",\n- \"version\": \"0.2.37\",\n+ \"version\": \"0.2.42\",\n\"lockfileVersion\": 1,\n\"requires\": true,\n\"dependencies\": {\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "{\n\"name\": \"@influxdata/influx\",\n- \"version\": \"0.2.42\",\n+ \"version\": \"0.2.43\",\n\"description\": \"Influxdb v2 client\",\n\"main\": \"dist/index.js\",\n\"scripts\": {\n" }, { "change_type": "MODIFY", "old_path": "src/api/api.ts", "new_path": "src/api/api.ts", "diff": "@@ -1674,46 +1674,6 @@ export interface InlineResponse200 {\nlinks?: Links;\n}\n-/**\n- *\n- * @export\n- * @interface InlineResponse2001\n- */\n-export interface InlineResponse2001 {\n- /**\n- *\n- * @type {Array<Task>}\n- * @memberof InlineResponse2001\n- */\n- tasks?: Array<Task>;\n- /**\n- *\n- * @type {Links}\n- * @memberof InlineResponse2001\n- */\n- links?: Links;\n-}\n-\n-/**\n- *\n- * @export\n- * @interface InlineResponse2002\n- */\n-export interface InlineResponse2002 {\n- /**\n- *\n- * @type {Array<Run>}\n- * @memberof InlineResponse2002\n- */\n- runs?: Array<Run>;\n- /**\n- *\n- * @type {Links}\n- * @memberof InlineResponse2002\n- */\n- links?: Links;\n-}\n-\n/**\n* represents integer numbers\n* @export\n@@ -1814,6 +1774,12 @@ export interface LabelResponse {\n* @interface LabelUpdate\n*/\nexport interface LabelUpdate {\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof LabelUpdate\n+ */\n+ name?: string;\n/**\n* Key/Value pairs associated with this label. Keys can be removed by sending an update with an empty value.\n* @type {any}\n@@ -3789,6 +3755,26 @@ export interface RunManually {\nscheduledFor?: Date;\n}\n+/**\n+ *\n+ * @export\n+ * @interface Runs\n+ */\n+export interface Runs {\n+ /**\n+ *\n+ * @type {Links}\n+ * @memberof Runs\n+ */\n+ links?: Links;\n+ /**\n+ *\n+ * @type {Array<Run>}\n+ * @memberof Runs\n+ */\n+ runs?: Array<Run>;\n+}\n+\n/**\n*\n* @export\n@@ -4418,6 +4404,26 @@ export namespace TaskUpdateRequest {\n}\n}\n+/**\n+ *\n+ * @export\n+ * @interface Tasks\n+ */\n+export interface Tasks {\n+ /**\n+ *\n+ * @type {Links}\n+ * @memberof Tasks\n+ */\n+ links?: Links;\n+ /**\n+ *\n+ * @type {Array<Task>}\n+ * @memberof Tasks\n+ */\n+ tasks?: Array<Task>;\n+}\n+\n/**\n*\n* @export\n@@ -8036,7 +8042,7 @@ export const BucketsApiFp = function(configuration?: Configuration) {\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- bucketsBucketIDMembersGet(bucketID: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<ResourceOwners> {\n+ bucketsBucketIDMembersGet(bucketID: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<ResourceMembers> {\nconst localVarAxiosArgs = BucketsApiAxiosParamCreator(configuration).bucketsBucketIDMembersGet(bucketID, zapTraceSpan, options);\nreturn (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\nconst axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\n@@ -8083,7 +8089,7 @@ export const BucketsApiFp = function(configuration?: Configuration) {\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- bucketsBucketIDOwnersGet(bucketID: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<ResourceMembers> {\n+ bucketsBucketIDOwnersGet(bucketID: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<ResourceOwners> {\nconst localVarAxiosArgs = BucketsApiAxiosParamCreator(configuration).bucketsBucketIDOwnersGet(bucketID, zapTraceSpan, options);\nreturn (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\nconst axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\n@@ -17750,7 +17756,7 @@ export const TasksApiFp = function(configuration?: Configuration) {\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- tasksGet(zapTraceSpan?: string, after?: string, user?: string, org?: string, orgID?: string, limit?: number, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<InlineResponse2001> {\n+ tasksGet(zapTraceSpan?: string, after?: string, user?: string, org?: string, orgID?: string, limit?: number, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Tasks> {\nconst localVarAxiosArgs = TasksApiAxiosParamCreator(configuration).tasksGet(zapTraceSpan, after, user, org, orgID, limit, options);\nreturn (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\nconst axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\n@@ -17986,7 +17992,7 @@ export const TasksApiFp = function(configuration?: Configuration) {\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- tasksTaskIDRunsGet(taskID: string, zapTraceSpan?: string, after?: string, limit?: number, afterTime?: Date, beforeTime?: Date, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<InlineResponse2002> {\n+ tasksTaskIDRunsGet(taskID: string, zapTraceSpan?: string, after?: string, limit?: number, afterTime?: Date, beforeTime?: Date, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Runs> {\nconst localVarAxiosArgs = TasksApiAxiosParamCreator(configuration).tasksTaskIDRunsGet(taskID, zapTraceSpan, after, limit, afterTime, beforeTime, options);\nreturn (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\nconst axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\n@@ -19236,7 +19242,7 @@ export const TelegrafsApiFp = function(configuration?: Configuration) {\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- telegrafsTelegrafIDDelete(telegrafID: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Telegraf> {\n+ telegrafsTelegrafIDDelete(telegrafID: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Response> {\nconst localVarAxiosArgs = TelegrafsApiAxiosParamCreator(configuration).telegrafsTelegrafIDDelete(telegrafID, zapTraceSpan, options);\nreturn (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\nconst axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\n@@ -22064,7 +22070,7 @@ export const UsersApiFp = function(configuration?: Configuration) {\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- bucketsBucketIDMembersGet(bucketID: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<ResourceOwners> {\n+ bucketsBucketIDMembersGet(bucketID: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<ResourceMembers> {\nconst localVarAxiosArgs = UsersApiAxiosParamCreator(configuration).bucketsBucketIDMembersGet(bucketID, zapTraceSpan, options);\nreturn (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\nconst axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\n@@ -22111,7 +22117,7 @@ export const UsersApiFp = function(configuration?: Configuration) {\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- bucketsBucketIDOwnersGet(bucketID: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<ResourceMembers> {\n+ bucketsBucketIDOwnersGet(bucketID: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<ResourceOwners> {\nconst localVarAxiosArgs = UsersApiAxiosParamCreator(configuration).bucketsBucketIDOwnersGet(bucketID, zapTraceSpan, options);\nreturn (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\nconst axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/labels.ts", "new_path": "src/wrappers/labels.ts", "diff": "@@ -56,13 +56,10 @@ export default class {\nreturn addLabelDefaults(label)\n}\n- public async update(\n- id: string,\n- properties: ILabelProperties\n- ): Promise<ILabel> {\n+ public async update(id: string, l: ILabel): Promise<ILabel> {\nconst {\ndata: {label},\n- } = await this.service.labelsLabelIDPatch(id, {properties})\n+ } = await this.service.labelsLabelIDPatch(id, l)\nif (!label) {\nthrow new Error('Failed to update label')\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
feat(labels): update label name
305,172
18.03.2019 14:07:54
25,200
53457befb1cdf461b247318fb177eebac5a6604c
chore: change update to match task update pattern
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "{\n\"name\": \"@influxdata/influx\",\n- \"version\": \"0.2.43\",\n+ \"version\": \"0.2.42\",\n\"description\": \"Influxdb v2 client\",\n\"main\": \"dist/index.js\",\n\"scripts\": {\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/labels.ts", "new_path": "src/wrappers/labels.ts", "diff": "@@ -56,10 +56,14 @@ export default class {\nreturn addLabelDefaults(label)\n}\n- public async update(id: string, l: ILabel): Promise<ILabel> {\n+ public async update(id: string, updates: Partial<ILabel>): Promise<ILabel> {\n+ const original = await this.get(id)\nconst {\ndata: {label},\n- } = await this.service.labelsLabelIDPatch(id, l)\n+ } = await this.service.labelsLabelIDPatch(id, {\n+ ...original,\n+ ...updates,\n+ })\nif (!label) {\nthrow new Error('Failed to update label')\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
chore: change update to match task update pattern
305,161
18.03.2019 15:43:15
25,200
f456aabc445de8f539be8e9ed580cc747d81b2ab
Add TemplateSummary type, and defaults
[ { "change_type": "MODIFY", "old_path": "src/types/index.ts", "new_path": "src/types/index.ts", "diff": "import {Bucket, Cell, Dashboard, Task, Telegraf, View, Document} from '../api'\n-import {Label as APILabel} from '../api'\n+import {Label as APILabel, DocumentListEntry} from '../api'\ninterface KV {\n[x: string]: string\n@@ -153,3 +153,7 @@ export interface IDashboardTemplate extends ITemplateBase {\n}\nexport type ITemplate = ITaskTemplate | IDashboardTemplate\n+\n+export interface TemplateSummary extends DocumentListEntry {\n+ labels: ILabel[]\n+}\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/templates.ts", "new_path": "src/wrappers/templates.ts", "diff": "import {TemplatesApi, DocumentListEntry, Document, DocumentCreate} from '../api'\n-import {ITemplate} from '../types'\n+import {ITemplate, TemplateSummary} from '../types'\nimport {addLabelDefaults} from './labels'\n-export const addTemplateDefaults = (d: Document): ITemplate => ({\n+const addTemplateDefaults = (d: Document): ITemplate => ({\n...d,\ncontent: {data: {}, included: [], ...d.content},\nlabels: d.labels.map(addLabelDefaults),\n})\n+const addTemplateSummaryDefaults = (d: DocumentListEntry): TemplateSummary => ({\n+ ...d,\n+ labels: d.labels.map(addLabelDefaults),\n+})\n+\nexport default class {\nprivate service: TemplatesApi\n@@ -15,11 +20,11 @@ export default class {\nthis.service = new TemplatesApi({basePath})\n}\n- public async getAll(orgName: string): Promise<DocumentListEntry[]> {\n+ public async getAll(orgName: string): Promise<TemplateSummary[]> {\nconst {data} = await this.service.documentsTemplatesGet(orgName)\nif (data.documents) {\n- return data.documents\n+ return data.documents.map(addTemplateSummaryDefaults)\n}\nreturn []\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add TemplateSummary type, and defaults
305,161
18.03.2019 17:33:55
25,200
a542022279ec261ded1abba16763fa870b22aa26
Add guaranteed labels parameter to templates
[ { "change_type": "MODIFY", "old_path": "src/api/api.ts", "new_path": "src/api/api.ts", "diff": "@@ -1202,7 +1202,7 @@ export interface Document {\n* @type {Array<Label>}\n* @memberof Document\n*/\n- labels: Array<Label>;\n+ labels?: Array<Label>;\n}\n/**\n@@ -1266,7 +1266,7 @@ export interface DocumentListEntry {\n* @type {Array<Label>}\n* @memberof DocumentListEntry\n*/\n- labels: Array<Label>;\n+ labels?: Array<Label>;\n}\n/**\n" }, { "change_type": "MODIFY", "old_path": "src/types/index.ts", "new_path": "src/types/index.ts", "diff": "@@ -59,7 +59,7 @@ interface IKeyValuePairs {\n// Templates\ninterface ITemplateBase extends Document {\ncontent: {data: ITemplateData; included: ITemplateIncluded[]}\n- labels: ILabel[]\n+ labels?: ILabel[]\n}\n// TODO: be more specific about what attributes can be\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/templates.ts", "new_path": "src/wrappers/templates.ts", "diff": "@@ -2,16 +2,22 @@ import {TemplatesApi, DocumentListEntry, Document, DocumentCreate} from '../api'\nimport {ITemplate, TemplateSummary} from '../types'\nimport {addLabelDefaults} from './labels'\n-const addTemplateDefaults = (d: Document): ITemplate => ({\n+const addTemplateDefaults = (d: Document): ITemplate => {\n+ const labels = d.labels || []\n+ return {\n...d,\ncontent: {data: {}, included: [], ...d.content},\n- labels: d.labels.map(addLabelDefaults),\n-})\n+ labels: labels.map(addLabelDefaults),\n+ }\n+}\n-const addTemplateSummaryDefaults = (d: DocumentListEntry): TemplateSummary => ({\n+const addTemplateSummaryDefaults = (d: DocumentListEntry): TemplateSummary => {\n+ const labels = d.labels || []\n+ return {\n...d,\n- labels: d.labels.map(addLabelDefaults),\n-})\n+ labels: labels.map(addLabelDefaults),\n+ }\n+}\nexport default class {\nprivate service: TemplatesApi\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add guaranteed labels parameter to templates
305,164
19.03.2019 11:13:50
25,200
6e9db81f079b8195bc2b4b6652997bd6f6ea0066
Update api for required orgID on labels
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"description\": \"Influxdb v2 client\",\n\"main\": \"dist/index.js\",\n\"scripts\": {\n- \"precommit\": \"npm run vet\",\n\"prepublishOnly\": \"npm run build\",\n\"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\n\"generate\": \"openapi-generator generate -g typescript-axios -o src/api -i https://raw.githubusercontent.com/influxdata/influxdb/master/http/swagger.yml\",\n},\n\"dependencies\": {\n\"axios\": \"^0.18.0\"\n+ },\n+ \"husky\": {\n+ \"hooks\": {\n+ \"pre-commit\": \"npm run vet\"\n+ }\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/api/api.ts", "new_path": "src/api/api.ts", "diff": "@@ -1720,6 +1720,12 @@ export interface Label {\n* @memberof Label\n*/\nid?: string;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof Label\n+ */\n+ orgID?: string;\n/**\n*\n* @type {string}\n@@ -1734,6 +1740,32 @@ export interface Label {\nproperties?: { [key: string]: string; };\n}\n+/**\n+ *\n+ * @export\n+ * @interface LabelCreateRequest\n+ */\n+export interface LabelCreateRequest {\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof LabelCreateRequest\n+ */\n+ orgID: string;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof LabelCreateRequest\n+ */\n+ name?: string;\n+ /**\n+ * Key/Value pairs associated with this label. Keys can be removed by sending an update with an empty value.\n+ * @type {{ [key: string]: string; }}\n+ * @memberof LabelCreateRequest\n+ */\n+ properties?: { [key: string]: string; };\n+}\n+\n/**\n*\n* @export\n@@ -2752,7 +2784,13 @@ export namespace PermissionResource {\nSources = 'sources',\nTasks = 'tasks',\nTelegrafs = 'telegrafs',\n- Users = 'users'\n+ Users = 'users',\n+ Variables = 'variables',\n+ Scrapers = 'scrapers',\n+ Secrets = 'secrets',\n+ Labels = 'labels',\n+ Views = 'views',\n+ Documents = 'documents'\n}\n}\n@@ -4450,14 +4488,6 @@ export interface Telegraf extends TelegrafRequest {\nlabels?: Array<Label>;\n}\n-/**\n- *\n- * @export\n- * @interface TelegrafPluginConfig\n- */\n-export interface TelegrafPluginConfig {\n-}\n-\n/**\n*\n* @export\n@@ -4482,12 +4512,6 @@ export interface TelegrafPluginInputCpu {\n* @memberof TelegrafPluginInputCpu\n*/\ncomment?: string;\n- /**\n- *\n- * @type {TelegrafPluginConfig}\n- * @memberof TelegrafPluginInputCpu\n- */\n- config: TelegrafPluginConfig;\n}\n/**\n@@ -4511,21 +4535,6 @@ export namespace TelegrafPluginInputCpu {\n}\n}\n-/**\n- *\n- * @export\n- * @interface TelegrafPluginInputCpuRequest\n- */\n-export interface TelegrafPluginInputCpuRequest extends TelegrafRequestPlugin {\n-}\n-\n-/**\n- * @export\n- * @namespace TelegrafPluginInputCpuRequest\n- */\n-export namespace TelegrafPluginInputCpuRequest {\n-}\n-\n/**\n*\n* @export\n@@ -4550,12 +4559,6 @@ export interface TelegrafPluginInputDisk {\n* @memberof TelegrafPluginInputDisk\n*/\ncomment?: string;\n- /**\n- *\n- * @type {TelegrafPluginConfig}\n- * @memberof TelegrafPluginInputDisk\n- */\n- config: TelegrafPluginConfig;\n}\n/**\n@@ -4579,21 +4582,6 @@ export namespace TelegrafPluginInputDisk {\n}\n}\n-/**\n- *\n- * @export\n- * @interface TelegrafPluginInputDiskRequest\n- */\n-export interface TelegrafPluginInputDiskRequest extends TelegrafRequestPlugin {\n-}\n-\n-/**\n- * @export\n- * @namespace TelegrafPluginInputDiskRequest\n- */\n-export namespace TelegrafPluginInputDiskRequest {\n-}\n-\n/**\n*\n* @export\n@@ -4618,12 +4606,6 @@ export interface TelegrafPluginInputDiskio {\n* @memberof TelegrafPluginInputDiskio\n*/\ncomment?: string;\n- /**\n- *\n- * @type {TelegrafPluginConfig}\n- * @memberof TelegrafPluginInputDiskio\n- */\n- config: TelegrafPluginConfig;\n}\n/**\n@@ -4647,21 +4629,6 @@ export namespace TelegrafPluginInputDiskio {\n}\n}\n-/**\n- *\n- * @export\n- * @interface TelegrafPluginInputDiskioRequest\n- */\n-export interface TelegrafPluginInputDiskioRequest extends TelegrafRequestPlugin {\n-}\n-\n-/**\n- * @export\n- * @namespace TelegrafPluginInputDiskioRequest\n- */\n-export namespace TelegrafPluginInputDiskioRequest {\n-}\n-\n/**\n*\n* @export\n@@ -4729,21 +4696,6 @@ export interface TelegrafPluginInputDockerConfig {\nendpoint: string;\n}\n-/**\n- *\n- * @export\n- * @interface TelegrafPluginInputDockerRequest\n- */\n-export interface TelegrafPluginInputDockerRequest extends TelegrafRequestPlugin {\n-}\n-\n-/**\n- * @export\n- * @namespace TelegrafPluginInputDockerRequest\n- */\n-export namespace TelegrafPluginInputDockerRequest {\n-}\n-\n/**\n*\n* @export\n@@ -4811,21 +4763,6 @@ export interface TelegrafPluginInputFileConfig {\nfiles?: Array<string>;\n}\n-/**\n- *\n- * @export\n- * @interface TelegrafPluginInputFileRequest\n- */\n-export interface TelegrafPluginInputFileRequest extends TelegrafRequestPlugin {\n-}\n-\n-/**\n- * @export\n- * @namespace TelegrafPluginInputFileRequest\n- */\n-export namespace TelegrafPluginInputFileRequest {\n-}\n-\n/**\n*\n* @export\n@@ -4850,12 +4787,6 @@ export interface TelegrafPluginInputKernel {\n* @memberof TelegrafPluginInputKernel\n*/\ncomment?: string;\n- /**\n- *\n- * @type {TelegrafPluginConfig}\n- * @memberof TelegrafPluginInputKernel\n- */\n- config: TelegrafPluginConfig;\n}\n/**\n@@ -4879,21 +4810,6 @@ export namespace TelegrafPluginInputKernel {\n}\n}\n-/**\n- *\n- * @export\n- * @interface TelegrafPluginInputKernelRequest\n- */\n-export interface TelegrafPluginInputKernelRequest extends TelegrafRequestPlugin {\n-}\n-\n-/**\n- * @export\n- * @namespace TelegrafPluginInputKernelRequest\n- */\n-export namespace TelegrafPluginInputKernelRequest {\n-}\n-\n/**\n*\n* @export\n@@ -4961,21 +4877,6 @@ export interface TelegrafPluginInputKubernetesConfig {\nurl?: string;\n}\n-/**\n- *\n- * @export\n- * @interface TelegrafPluginInputKubernetesRequest\n- */\n-export interface TelegrafPluginInputKubernetesRequest extends TelegrafRequestPlugin {\n-}\n-\n-/**\n- * @export\n- * @namespace TelegrafPluginInputKubernetesRequest\n- */\n-export namespace TelegrafPluginInputKubernetesRequest {\n-}\n-\n/**\n*\n* @export\n@@ -5043,21 +4944,6 @@ export interface TelegrafPluginInputLogParserConfig {\nfiles?: Array<string>;\n}\n-/**\n- *\n- * @export\n- * @interface TelegrafPluginInputLogParserRequest\n- */\n-export interface TelegrafPluginInputLogParserRequest extends TelegrafRequestPlugin {\n-}\n-\n-/**\n- * @export\n- * @namespace TelegrafPluginInputLogParserRequest\n- */\n-export namespace TelegrafPluginInputLogParserRequest {\n-}\n-\n/**\n*\n* @export\n@@ -5082,12 +4968,6 @@ export interface TelegrafPluginInputMem {\n* @memberof TelegrafPluginInputMem\n*/\ncomment?: string;\n- /**\n- *\n- * @type {TelegrafPluginConfig}\n- * @memberof TelegrafPluginInputMem\n- */\n- config: TelegrafPluginConfig;\n}\n/**\n@@ -5111,21 +4991,6 @@ export namespace TelegrafPluginInputMem {\n}\n}\n-/**\n- *\n- * @export\n- * @interface TelegrafPluginInputMemRequest\n- */\n-export interface TelegrafPluginInputMemRequest extends TelegrafRequestPlugin {\n-}\n-\n-/**\n- * @export\n- * @namespace TelegrafPluginInputMemRequest\n- */\n-export namespace TelegrafPluginInputMemRequest {\n-}\n-\n/**\n*\n* @export\n@@ -5150,12 +5015,6 @@ export interface TelegrafPluginInputNet {\n* @memberof TelegrafPluginInputNet\n*/\ncomment?: string;\n- /**\n- *\n- * @type {TelegrafPluginConfig}\n- * @memberof TelegrafPluginInputNet\n- */\n- config: TelegrafPluginConfig;\n}\n/**\n@@ -5179,21 +5038,6 @@ export namespace TelegrafPluginInputNet {\n}\n}\n-/**\n- *\n- * @export\n- * @interface TelegrafPluginInputNetRequest\n- */\n-export interface TelegrafPluginInputNetRequest extends TelegrafRequestPlugin {\n-}\n-\n-/**\n- * @export\n- * @namespace TelegrafPluginInputNetRequest\n- */\n-export namespace TelegrafPluginInputNetRequest {\n-}\n-\n/**\n*\n* @export\n@@ -5218,12 +5062,6 @@ export interface TelegrafPluginInputNetResponse {\n* @memberof TelegrafPluginInputNetResponse\n*/\ncomment?: string;\n- /**\n- *\n- * @type {TelegrafPluginConfig}\n- * @memberof TelegrafPluginInputNetResponse\n- */\n- config: TelegrafPluginConfig;\n}\n/**\n@@ -5247,21 +5085,6 @@ export namespace TelegrafPluginInputNetResponse {\n}\n}\n-/**\n- *\n- * @export\n- * @interface TelegrafPluginInputNetResponseRequest\n- */\n-export interface TelegrafPluginInputNetResponseRequest extends TelegrafRequestPlugin {\n-}\n-\n-/**\n- * @export\n- * @namespace TelegrafPluginInputNetResponseRequest\n- */\n-export namespace TelegrafPluginInputNetResponseRequest {\n-}\n-\n/**\n*\n* @export\n@@ -5286,12 +5109,6 @@ export interface TelegrafPluginInputNginx {\n* @memberof TelegrafPluginInputNginx\n*/\ncomment?: string;\n- /**\n- *\n- * @type {TelegrafPluginConfig}\n- * @memberof TelegrafPluginInputNginx\n- */\n- config: TelegrafPluginConfig;\n}\n/**\n@@ -5315,21 +5132,6 @@ export namespace TelegrafPluginInputNginx {\n}\n}\n-/**\n- *\n- * @export\n- * @interface TelegrafPluginInputNginxRequest\n- */\n-export interface TelegrafPluginInputNginxRequest extends TelegrafRequestPlugin {\n-}\n-\n-/**\n- * @export\n- * @namespace TelegrafPluginInputNginxRequest\n- */\n-export namespace TelegrafPluginInputNginxRequest {\n-}\n-\n/**\n*\n* @export\n@@ -5354,12 +5156,6 @@ export interface TelegrafPluginInputProcesses {\n* @memberof TelegrafPluginInputProcesses\n*/\ncomment?: string;\n- /**\n- *\n- * @type {TelegrafPluginConfig}\n- * @memberof TelegrafPluginInputProcesses\n- */\n- config: TelegrafPluginConfig;\n}\n/**\n@@ -5383,21 +5179,6 @@ export namespace TelegrafPluginInputProcesses {\n}\n}\n-/**\n- *\n- * @export\n- * @interface TelegrafPluginInputProcessesRequest\n- */\n-export interface TelegrafPluginInputProcessesRequest extends TelegrafRequestPlugin {\n-}\n-\n-/**\n- * @export\n- * @namespace TelegrafPluginInputProcessesRequest\n- */\n-export namespace TelegrafPluginInputProcessesRequest {\n-}\n-\n/**\n*\n* @export\n@@ -5465,21 +5246,6 @@ export interface TelegrafPluginInputProcstatConfig {\nexe?: string;\n}\n-/**\n- *\n- * @export\n- * @interface TelegrafPluginInputProcstatRequest\n- */\n-export interface TelegrafPluginInputProcstatRequest extends TelegrafRequestPlugin {\n-}\n-\n-/**\n- * @export\n- * @namespace TelegrafPluginInputProcstatRequest\n- */\n-export namespace TelegrafPluginInputProcstatRequest {\n-}\n-\n/**\n*\n* @export\n@@ -5547,21 +5313,6 @@ export interface TelegrafPluginInputPrometheusConfig {\nurls?: Array<string>;\n}\n-/**\n- *\n- * @export\n- * @interface TelegrafPluginInputPrometheusRequest\n- */\n-export interface TelegrafPluginInputPrometheusRequest extends TelegrafRequestPlugin {\n-}\n-\n-/**\n- * @export\n- * @namespace TelegrafPluginInputPrometheusRequest\n- */\n-export namespace TelegrafPluginInputPrometheusRequest {\n-}\n-\n/**\n*\n* @export\n@@ -5635,21 +5386,6 @@ export interface TelegrafPluginInputRedisConfig {\npassword?: string;\n}\n-/**\n- *\n- * @export\n- * @interface TelegrafPluginInputRedisRequest\n- */\n-export interface TelegrafPluginInputRedisRequest extends TelegrafRequestPlugin {\n-}\n-\n-/**\n- * @export\n- * @namespace TelegrafPluginInputRedisRequest\n- */\n-export namespace TelegrafPluginInputRedisRequest {\n-}\n-\n/**\n*\n* @export\n@@ -5674,12 +5410,6 @@ export interface TelegrafPluginInputSwap {\n* @memberof TelegrafPluginInputSwap\n*/\ncomment?: string;\n- /**\n- *\n- * @type {TelegrafPluginConfig}\n- * @memberof TelegrafPluginInputSwap\n- */\n- config: TelegrafPluginConfig;\n}\n/**\n@@ -5703,21 +5433,6 @@ export namespace TelegrafPluginInputSwap {\n}\n}\n-/**\n- *\n- * @export\n- * @interface TelegrafPluginInputSwapRequest\n- */\n-export interface TelegrafPluginInputSwapRequest extends TelegrafRequestPlugin {\n-}\n-\n-/**\n- * @export\n- * @namespace TelegrafPluginInputSwapRequest\n- */\n-export namespace TelegrafPluginInputSwapRequest {\n-}\n-\n/**\n*\n* @export\n@@ -5785,21 +5500,6 @@ export interface TelegrafPluginInputSyslogConfig {\nserver?: string;\n}\n-/**\n- *\n- * @export\n- * @interface TelegrafPluginInputSyslogRequest\n- */\n-export interface TelegrafPluginInputSyslogRequest extends TelegrafRequestPlugin {\n-}\n-\n-/**\n- * @export\n- * @namespace TelegrafPluginInputSyslogRequest\n- */\n-export namespace TelegrafPluginInputSyslogRequest {\n-}\n-\n/**\n*\n* @export\n@@ -5824,12 +5524,6 @@ export interface TelegrafPluginInputSystem {\n* @memberof TelegrafPluginInputSystem\n*/\ncomment?: string;\n- /**\n- *\n- * @type {TelegrafPluginConfig}\n- * @memberof TelegrafPluginInputSystem\n- */\n- config: TelegrafPluginConfig;\n}\n/**\n@@ -5853,21 +5547,6 @@ export namespace TelegrafPluginInputSystem {\n}\n}\n-/**\n- *\n- * @export\n- * @interface TelegrafPluginInputSystemRequest\n- */\n-export interface TelegrafPluginInputSystemRequest extends TelegrafRequestPlugin {\n-}\n-\n-/**\n- * @export\n- * @namespace TelegrafPluginInputSystemRequest\n- */\n-export namespace TelegrafPluginInputSystemRequest {\n-}\n-\n/**\n*\n* @export\n@@ -5892,12 +5571,6 @@ export interface TelegrafPluginInputTail {\n* @memberof TelegrafPluginInputTail\n*/\ncomment?: string;\n- /**\n- *\n- * @type {TelegrafPluginConfig}\n- * @memberof TelegrafPluginInputTail\n- */\n- config: TelegrafPluginConfig;\n}\n/**\n@@ -5921,21 +5594,6 @@ export namespace TelegrafPluginInputTail {\n}\n}\n-/**\n- *\n- * @export\n- * @interface TelegrafPluginInputTailRequest\n- */\n-export interface TelegrafPluginInputTailRequest extends TelegrafRequestPlugin {\n-}\n-\n-/**\n- * @export\n- * @namespace TelegrafPluginInputTailRequest\n- */\n-export namespace TelegrafPluginInputTailRequest {\n-}\n-\n/**\n*\n* @export\n@@ -6038,21 +5696,6 @@ export namespace TelegrafPluginOutputFileConfigFiles {\n}\n}\n-/**\n- *\n- * @export\n- * @interface TelegrafPluginOutputFileRequest\n- */\n-export interface TelegrafPluginOutputFileRequest extends TelegrafRequestPlugin {\n-}\n-\n-/**\n- * @export\n- * @namespace TelegrafPluginOutputFileRequest\n- */\n-export namespace TelegrafPluginOutputFileRequest {\n-}\n-\n/**\n*\n* @export\n@@ -6138,21 +5781,6 @@ export interface TelegrafPluginOutputInfluxDBV2Config {\nbucket: string;\n}\n-/**\n- *\n- * @export\n- * @interface TelegrafPluginOutputInfluxDBV2Request\n- */\n-export interface TelegrafPluginOutputInfluxDBV2Request extends TelegrafRequestPlugin {\n-}\n-\n-/**\n- * @export\n- * @namespace TelegrafPluginOutputInfluxDBV2Request\n- */\n-export namespace TelegrafPluginOutputInfluxDBV2Request {\n-}\n-\n/**\n*\n* @export\n@@ -6205,32 +5833,12 @@ export interface TelegrafRequestAgent {\ncollectionInterval?: number;\n}\n-/**\n- *\n- * @export\n- * @interface TelegrafRequestConfig\n- */\n-export interface TelegrafRequestConfig {\n-}\n-\n/**\n*\n* @export\n* @interface TelegrafRequestPlugin\n*/\nexport interface TelegrafRequestPlugin {\n- /**\n- *\n- * @type {string}\n- * @memberof TelegrafRequestPlugin\n- */\n- name: string;\n- /**\n- *\n- * @type {string}\n- * @memberof TelegrafRequestPlugin\n- */\n- type: TelegrafRequestPlugin.TypeEnum;\n}\n/**\n@@ -6238,14 +5846,6 @@ export interface TelegrafRequestPlugin {\n* @namespace TelegrafRequestPlugin\n*/\nexport namespace TelegrafRequestPlugin {\n- /**\n- * @export\n- * @enum {string}\n- */\n- export enum TypeEnum {\n- Input = 'input',\n- Output = 'output'\n- }\n}\n/**\n@@ -11574,14 +11174,14 @@ export const LabelsApiAxiosParamCreator = function (configuration?: Configuratio\n/**\n*\n* @summary Create a label\n- * @param {Label} label label to create\n+ * @param {LabelCreateRequest} labelCreateRequest label to create\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- labelsPost(label: Label, options: any = {}): RequestArgs {\n- // verify required parameter 'label' is not null or undefined\n- if (label === null || label === undefined) {\n- throw new RequiredError('label','Required parameter label was null or undefined when calling labelsPost.');\n+ labelsPost(labelCreateRequest: LabelCreateRequest, options: any = {}): RequestArgs {\n+ // verify required parameter 'labelCreateRequest' is not null or undefined\n+ if (labelCreateRequest === null || labelCreateRequest === undefined) {\n+ throw new RequiredError('labelCreateRequest','Required parameter labelCreateRequest was null or undefined when calling labelsPost.');\n}\nconst localVarPath = `/labels`;\nconst localVarUrlObj = url.parse(localVarPath, true);\n@@ -11599,8 +11199,8 @@ export const LabelsApiAxiosParamCreator = function (configuration?: Configuratio\n// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943\ndelete localVarUrlObj.search;\nlocalVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);\n- const needsSerialization = (<any>\"Label\" !== \"string\") || localVarRequestOptions.headers['Content-Type'] === 'application/json';\n- localVarRequestOptions.data = needsSerialization ? JSON.stringify(label || {}) : (label || \"\");\n+ const needsSerialization = (<any>\"LabelCreateRequest\" !== \"string\") || localVarRequestOptions.headers['Content-Type'] === 'application/json';\n+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(labelCreateRequest || {}) : (labelCreateRequest || \"\");\nreturn {\nurl: url.format(localVarUrlObj),\n@@ -11678,12 +11278,12 @@ export const LabelsApiFp = function(configuration?: Configuration) {\n/**\n*\n* @summary Create a label\n- * @param {Label} label label to create\n+ * @param {LabelCreateRequest} labelCreateRequest label to create\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- labelsPost(label: Label, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<LabelResponse> {\n- const localVarAxiosArgs = LabelsApiAxiosParamCreator(configuration).labelsPost(label, options);\n+ labelsPost(labelCreateRequest: LabelCreateRequest, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<LabelResponse> {\n+ const localVarAxiosArgs = LabelsApiAxiosParamCreator(configuration).labelsPost(labelCreateRequest, options);\nreturn (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\nconst axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\nreturn axios.request(axiosRequestArgs);\n@@ -11744,12 +11344,12 @@ export const LabelsApiFactory = function (configuration?: Configuration, basePat\n/**\n*\n* @summary Create a label\n- * @param {Label} label label to create\n+ * @param {LabelCreateRequest} labelCreateRequest label to create\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- labelsPost(label: Label, options?: any) {\n- return LabelsApiFp(configuration).labelsPost(label, options)(axios, basePath);\n+ labelsPost(labelCreateRequest: LabelCreateRequest, options?: any) {\n+ return LabelsApiFp(configuration).labelsPost(labelCreateRequest, options)(axios, basePath);\n},\n};\n};\n@@ -11815,13 +11415,13 @@ export class LabelsApi extends BaseAPI {\n/**\n*\n* @summary Create a label\n- * @param {Label} label label to create\n+ * @param {LabelCreateRequest} labelCreateRequest label to create\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n* @memberof LabelsApi\n*/\n- public labelsPost(label: Label, options?: any) {\n- return LabelsApiFp(this.configuration).labelsPost(label, options)(this.axios, this.basePath);\n+ public labelsPost(labelCreateRequest: LabelCreateRequest, options?: any) {\n+ return LabelsApiFp(this.configuration).labelsPost(labelCreateRequest, options)(this.axios, this.basePath);\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/types/index.ts", "new_path": "src/types/index.ts", "diff": "@@ -2,7 +2,7 @@ import {Bucket, Cell, Dashboard, Task, Telegraf, View, Document} from '../api'\nimport {Label as APILabel, DocumentListEntry} from '../api'\ninterface KV {\n- [x: string]: string\n+ [key: string]: string\n}\nexport interface ILabelProperties extends KV {\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/dashboards.ts", "new_path": "src/wrappers/dashboards.ts", "diff": "@@ -302,7 +302,10 @@ export default class {\nlabelsIncluded\n)\n- const createdLabels = await this.createLabels(labelsToCreate)\n+ const createdLabels = await this.createLabels(\n+ dashboard.orgID,\n+ labelsToCreate\n+ )\nconst createdLabelIDs = createdLabels.map(l => l.id || '')\nawait this.addLabels(dashboard.id, [...createdLabelIDs, ...labelIDsToAdd])\n@@ -315,13 +318,14 @@ export default class {\n}\nprivate async createLabels(\n+ orgID: string,\nlabelsToCreate: ILabelIncluded[]\n): Promise<Label[]> {\nconst pendingLabels = labelsToCreate.map(l => {\nconst {\nattributes: {name, properties},\n} = l\n- return this.labelsService.labelsPost({name, properties})\n+ return this.labelsService.labelsPost({name, properties, orgID})\n})\nconst labelsResponse = await Promise.all(pendingLabels)\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/labels.ts", "new_path": "src/wrappers/labels.ts", "diff": "@@ -41,13 +41,14 @@ export default class {\nreturn (labels || []).map(addLabelDefaults)\n}\n- public async create(\n- name: string,\n+ public async create(request: {\n+ orgID: string\n+ name: string\nproperties: ILabelProperties\n- ): Promise<ILabel> {\n+ }): Promise<ILabel> {\nconst {\ndata: {label},\n- } = await this.service.labelsPost({name, properties})\n+ } = await this.service.labelsPost(request)\nif (!label) {\nthrow new Error('Failed to create label')\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/tasks.ts", "new_path": "src/wrappers/tasks.ts", "diff": "@@ -234,7 +234,10 @@ export default class {\nlabelsIncluded\n)\n- const createdLabels = await this.createLabels(labelsToCreate)\n+ const createdLabels = await this.createLabels(\n+ createdTask.orgID,\n+ labelsToCreate\n+ )\nconst createdLabelIDs = createdLabels.map(l => l.id || '')\nawait this.addLabels(createdTask.id, [...createdLabelIDs, ...labelIDsToAdd])\n@@ -259,13 +262,14 @@ export default class {\n}\nprivate async createLabels(\n+ orgID: string,\nlabelsToCreate: ILabelIncluded[]\n): Promise<Label[]> {\nconst pendingLabels = labelsToCreate.map(l => {\nconst name = l.attributes.name\nconst properties = l.attributes.properties\n- return this.labelsService.labelsPost({name, properties})\n+ return this.labelsService.labelsPost({orgID, name, properties})\n})\nconst labelsResponse = await Promise.all(pendingLabels)\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Update api for required orgID on labels
305,161
20.03.2019 13:44:22
25,200
79d31d7134f1af792354006df8aaac19b571e1dd
Add variable type to dashboard template
[ { "change_type": "MODIFY", "old_path": "src/types/index.ts", "new_path": "src/types/index.ts", "diff": "-import {Bucket, Cell, Dashboard, Task, Telegraf, View, Document} from '../api'\n+import {\n+ Bucket,\n+ Cell,\n+ Dashboard,\n+ Task,\n+ Telegraf,\n+ View,\n+ Document,\n+ Variable,\n+} from '../api'\nimport {Label as APILabel, DocumentListEntry} from '../api'\ninterface KV {\n@@ -50,6 +59,7 @@ export enum TemplateType {\nDashboard = 'dashboard',\nView = 'view',\nCell = 'cell',\n+ Variable = 'variable',\n}\ninterface IKeyValuePairs {\n@@ -76,7 +86,11 @@ interface ITemplateIncluded {\n}\n// Template Relationships\n-type IRelationship = ICellRelationship | ILabelRelationship | IViewRelationship\n+type IRelationship =\n+ | ICellRelationship\n+ | ILabelRelationship\n+ | IViewRelationship\n+ | IVariableRelationship\ninterface ICellRelationship {\ntype: TemplateType.Cell\n@@ -88,6 +102,11 @@ export interface ILabelRelationship {\nid: string\n}\n+export interface IVariableRelationship {\n+ type: TemplateType.Variable\n+ id: string\n+}\n+\ninterface IViewRelationship {\ntype: TemplateType.View\nid: string\n@@ -112,12 +131,18 @@ export interface ILabelIncluded extends ITemplateIncluded {\nattributes: ILabel\n}\n+export interface IVariableIncluded extends ITemplateIncluded {\n+ type: TemplateType.Variable\n+ attributes: Variable\n+}\n+\nexport type ITaskTemplateIncluded = ILabelIncluded\nexport type IDashboardTemplateIncluded =\n| ICellIncluded\n| IViewIncluded\n| ILabelIncluded\n+ | IVariableIncluded\n// Template Datas\ninterface ITaskTemplateData extends ITemplateData {\n@@ -134,6 +159,7 @@ interface IDashboardTemplateData extends ITemplateData {\nrelationships: {\n[TemplateType.Label]: {data: ILabelRelationship[]}\n[TemplateType.Cell]: {data: ICellRelationship[]}\n+ [TemplateType.Variable]: {data: IVariableRelationship[]}\n}\n}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add variable type to dashboard template
305,164
21.03.2019 14:49:26
25,200
1c73ab8326ef951a4bcaf397e03e5eb878f3aec7
Add wrapper method to create authorizations
[ { "change_type": "MODIFY", "old_path": "src/wrappers/authorizations.ts", "new_path": "src/wrappers/authorizations.ts", "diff": "@@ -39,6 +39,12 @@ export default class {\nreturn authorizations || []\n}\n+ public async create(auth: Authorization): Promise<Authorization> {\n+ const {data} = await this.service.authorizationsPost(auth)\n+\n+ return data\n+ }\n+\npublic async update(\nid: string,\nupdate: Partial<Authorization>\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add wrapper method to create authorizations
305,161
21.03.2019 15:24:21
25,200
81adc6b9f27139c4e16ecabff61df38517f20fb1
Add create all function to labels
[ { "change_type": "MODIFY", "old_path": "src/wrappers/labels.ts", "new_path": "src/wrappers/labels.ts", "diff": "@@ -57,6 +57,17 @@ export default class {\nreturn addLabelDefaults(label)\n}\n+ public async createAll(\n+ labels: {\n+ orgID: string\n+ name: string\n+ properties: ILabelProperties\n+ }[]\n+ ): Promise<ILabel[]> {\n+ const pendingLabels = labels.map(r => this.create(r))\n+ return await Promise.all(pendingLabels)\n+ }\n+\npublic async update(id: string, updates: Partial<ILabel>): Promise<ILabel> {\nconst original = await this.get(id)\nconst {\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add create all function to labels
305,161
21.03.2019 16:03:30
25,200
96b9ddaf96e2dc2e1481aa8208f157bf0827e022
Add create all function for variables
[ { "change_type": "MODIFY", "old_path": "src/wrappers/variables.ts", "new_path": "src/wrappers/variables.ts", "diff": "@@ -45,6 +45,11 @@ export default class {\nreturn data\n}\n+ public async createAll(variables: Variable[]): Promise<Variable[]> {\n+ const pendingVariables = variables.map(v => this.create(v))\n+ return await Promise.all(pendingVariables)\n+ }\n+\npublic async delete(id: string): Promise<Response> {\nconst {data} = await this.service.variablesVariableIDDelete(id)\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add create all function for variables
305,164
25.03.2019 09:53:54
25,200
d3c8da58617238f894673a4a6b2ba9bdd2015510
Introduce sagas for transactions Implement for labels createAll
[ { "change_type": "ADD", "old_path": null, "new_path": "src/utils/sagas.ts", "diff": "+interface Saga<T> {\n+ action: () => Promise<T>\n+ rollback: (result?: T) => Promise<void>\n+ result?: T\n+}\n+\n+async function rollback<T>(index: number, sagas: Saga<T>[]) {\n+ for (let i = index; i >= 0; i--) {\n+ await sagas[i].rollback(sagas[i].result)\n+ }\n+}\n+\n+async function saga<T>(sagas: Saga<T>[]): Promise<Array<T>> {\n+ for (let i = 0; i < sagas.length; i++) {\n+ try {\n+ const result = await sagas[i].action()\n+ sagas[i].result = result\n+ } catch (e) {\n+ console.error(e)\n+ await rollback<T>(i - 1, sagas)\n+ throw new Error(\n+ 'Failed to complete 1 or more actions, successful actions rolled back'\n+ )\n+ }\n+ }\n+\n+ return sagas.map(s => s.result).filter((r): r is T => !!r)\n+}\n+\n+export default saga\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/labels.ts", "new_path": "src/wrappers/labels.ts", "diff": "import {Label as APILabel, LabelsApi} from '../api'\nimport {ILabel} from '../types'\nimport {ILabelProperties} from '../types'\n+import saga from '../utils/sagas'\nconst DEFAULT_LABEL_COLOR = '#326BBA'\n@@ -64,8 +65,20 @@ export default class {\nproperties: ILabelProperties\n}[]\n): Promise<ILabel[]> {\n- const pendingLabels = labels.map(r => this.create(r))\n- return await Promise.all(pendingLabels)\n+ const pendingLabels = labels.map(r => {\n+ return {\n+ action: async () => {\n+ return await this.create(r)\n+ },\n+ rollback: async (r?: ILabel) => {\n+ if (r && r.id) {\n+ this.delete(r.id)\n+ }\n+ },\n+ }\n+ })\n+\n+ return await saga(pendingLabels)\n}\npublic async update(id: string, updates: Partial<ILabel>): Promise<ILabel> {\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Introduce sagas for transactions - Implement for labels createAll
305,168
25.03.2019 15:46:07
25,200
5fc458c37128fb125f26a1559eb13837cee86eb1
Update templates wrapper with delete api call
[ { "change_type": "MODIFY", "old_path": "src/api/api.ts", "new_path": "src/api/api.ts", "diff": "@@ -1654,26 +1654,6 @@ export interface IndexExpression {\nindex?: Expression;\n}\n-/**\n- *\n- * @export\n- * @interface InlineResponse200\n- */\n-export interface InlineResponse200 {\n- /**\n- *\n- * @type {Array<Label>}\n- * @memberof InlineResponse200\n- */\n- labels?: Array<Label>;\n- /**\n- *\n- * @type {Links}\n- * @memberof InlineResponse200\n- */\n- links?: Links;\n-}\n-\n/**\n* represents integer numbers\n* @export\n@@ -4234,7 +4214,7 @@ export interface Task {\n*/\ncron?: string;\n/**\n- * Duration to delay after the schedule, before executing the task; parsed from flux.\n+ * Duration to delay after the schedule, before executing the task; parsed from flux, if set to zero it will remove this option and use 0 as the default.\n* @type {string}\n* @memberof Task\n*/\n@@ -6374,7 +6354,6 @@ export enum WritePrecision {\nMs = 'ms',\nS = 's',\nUs = 'us',\n- U = 'u',\nNs = 'ns'\n}\n@@ -7610,7 +7589,7 @@ export const BucketsApiFp = function(configuration?: Configuration) {\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- bucketsBucketIDLabelsPost(bucketID: string, labelMapping: LabelMapping, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<InlineResponse200> {\n+ bucketsBucketIDLabelsPost(bucketID: string, labelMapping: LabelMapping, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<LabelsResponse> {\nconst localVarAxiosArgs = BucketsApiAxiosParamCreator(configuration).bucketsBucketIDLabelsPost(bucketID, labelMapping, zapTraceSpan, options);\nreturn (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\nconst axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\n@@ -14441,19 +14420,19 @@ export const ScraperTargetsApiAxiosParamCreator = function (configuration?: Conf\n*\n* @summary add a label to a scraper target\n* @param {string} scraperTargetID ID of the scraper target\n- * @param {Label} label label to add\n+ * @param {LabelMapping} labelMapping label to add\n* @param {string} [zapTraceSpan] OpenTracing span context\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- scrapersScraperTargetIDLabelsPost(scraperTargetID: string, label: Label, zapTraceSpan?: string, options: any = {}): RequestArgs {\n+ scrapersScraperTargetIDLabelsPost(scraperTargetID: string, labelMapping: LabelMapping, zapTraceSpan?: string, options: any = {}): RequestArgs {\n// verify required parameter 'scraperTargetID' is not null or undefined\nif (scraperTargetID === null || scraperTargetID === undefined) {\nthrow new RequiredError('scraperTargetID','Required parameter scraperTargetID was null or undefined when calling scrapersScraperTargetIDLabelsPost.');\n}\n- // verify required parameter 'label' is not null or undefined\n- if (label === null || label === undefined) {\n- throw new RequiredError('label','Required parameter label was null or undefined when calling scrapersScraperTargetIDLabelsPost.');\n+ // verify required parameter 'labelMapping' is not null or undefined\n+ if (labelMapping === null || labelMapping === undefined) {\n+ throw new RequiredError('labelMapping','Required parameter labelMapping was null or undefined when calling scrapersScraperTargetIDLabelsPost.');\n}\nconst localVarPath = `/scrapers/{scraperTargetID}/labels`\n.replace(`{${\"scraperTargetID\"}}`, encodeURIComponent(String(scraperTargetID)));\n@@ -14476,8 +14455,8 @@ export const ScraperTargetsApiAxiosParamCreator = function (configuration?: Conf\n// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943\ndelete localVarUrlObj.search;\nlocalVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);\n- const needsSerialization = (<any>\"Label\" !== \"string\") || localVarRequestOptions.headers['Content-Type'] === 'application/json';\n- localVarRequestOptions.data = needsSerialization ? JSON.stringify(label || {}) : (label || \"\");\n+ const needsSerialization = (<any>\"LabelMapping\" !== \"string\") || localVarRequestOptions.headers['Content-Type'] === 'application/json';\n+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(labelMapping || {}) : (labelMapping || \"\");\nreturn {\nurl: url.format(localVarUrlObj),\n@@ -14892,13 +14871,13 @@ export const ScraperTargetsApiFp = function(configuration?: Configuration) {\n*\n* @summary add a label to a scraper target\n* @param {string} scraperTargetID ID of the scraper target\n- * @param {Label} label label to add\n+ * @param {LabelMapping} labelMapping label to add\n* @param {string} [zapTraceSpan] OpenTracing span context\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- scrapersScraperTargetIDLabelsPost(scraperTargetID: string, label: Label, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<InlineResponse200> {\n- const localVarAxiosArgs = ScraperTargetsApiAxiosParamCreator(configuration).scrapersScraperTargetIDLabelsPost(scraperTargetID, label, zapTraceSpan, options);\n+ scrapersScraperTargetIDLabelsPost(scraperTargetID: string, labelMapping: LabelMapping, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<LabelsResponse> {\n+ const localVarAxiosArgs = ScraperTargetsApiAxiosParamCreator(configuration).scrapersScraperTargetIDLabelsPost(scraperTargetID, labelMapping, zapTraceSpan, options);\nreturn (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\nconst axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\nreturn axios.request(axiosRequestArgs);\n@@ -15093,13 +15072,13 @@ export const ScraperTargetsApiFactory = function (configuration?: Configuration,\n*\n* @summary add a label to a scraper target\n* @param {string} scraperTargetID ID of the scraper target\n- * @param {Label} label label to add\n+ * @param {LabelMapping} labelMapping label to add\n* @param {string} [zapTraceSpan] OpenTracing span context\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- scrapersScraperTargetIDLabelsPost(scraperTargetID: string, label: Label, zapTraceSpan?: string, options?: any) {\n- return ScraperTargetsApiFp(configuration).scrapersScraperTargetIDLabelsPost(scraperTargetID, label, zapTraceSpan, options)(axios, basePath);\n+ scrapersScraperTargetIDLabelsPost(scraperTargetID: string, labelMapping: LabelMapping, zapTraceSpan?: string, options?: any) {\n+ return ScraperTargetsApiFp(configuration).scrapersScraperTargetIDLabelsPost(scraperTargetID, labelMapping, zapTraceSpan, options)(axios, basePath);\n},\n/**\n*\n@@ -15275,14 +15254,14 @@ export class ScraperTargetsApi extends BaseAPI {\n*\n* @summary add a label to a scraper target\n* @param {string} scraperTargetID ID of the scraper target\n- * @param {Label} label label to add\n+ * @param {LabelMapping} labelMapping label to add\n* @param {string} [zapTraceSpan] OpenTracing span context\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n* @memberof ScraperTargetsApi\n*/\n- public scrapersScraperTargetIDLabelsPost(scraperTargetID: string, label: Label, zapTraceSpan?: string, options?: any) {\n- return ScraperTargetsApiFp(this.configuration).scrapersScraperTargetIDLabelsPost(scraperTargetID, label, zapTraceSpan, options)(this.axios, this.basePath);\n+ public scrapersScraperTargetIDLabelsPost(scraperTargetID: string, labelMapping: LabelMapping, zapTraceSpan?: string, options?: any) {\n+ return ScraperTargetsApiFp(this.configuration).scrapersScraperTargetIDLabelsPost(scraperTargetID, labelMapping, zapTraceSpan, options)(this.axios, this.basePath);\n}\n/**\n@@ -19477,6 +19456,44 @@ export const TemplatesApiAxiosParamCreator = function (configuration?: Configura\noptions: localVarRequestOptions,\n};\n},\n+ /**\n+ *\n+ * @summary delete a template document\n+ * @param {string} templateID ID of template\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ */\n+ documentsTemplatesTemplateIDDelete(templateID: string, zapTraceSpan?: string, options: any = {}): RequestArgs {\n+ // verify required parameter 'templateID' is not null or undefined\n+ if (templateID === null || templateID === undefined) {\n+ throw new RequiredError('templateID','Required parameter templateID was null or undefined when calling documentsTemplatesTemplateIDDelete.');\n+ }\n+ const localVarPath = `/documents/templates/{templateID}`\n+ .replace(`{${\"templateID\"}}`, encodeURIComponent(String(templateID)));\n+ const localVarUrlObj = url.parse(localVarPath, true);\n+ let baseOptions;\n+ if (configuration) {\n+ baseOptions = configuration.baseOptions;\n+ }\n+ const localVarRequestOptions = Object.assign({ method: 'DELETE' }, baseOptions, options);\n+ const localVarHeaderParameter = {} as any;\n+ const localVarQueryParameter = {} as any;\n+\n+ if (zapTraceSpan !== undefined && zapTraceSpan !== null) {\n+ localVarHeaderParameter['Zap-Trace-Span'] = String(zapTraceSpan);\n+ }\n+\n+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);\n+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943\n+ delete localVarUrlObj.search;\n+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);\n+\n+ return {\n+ url: url.format(localVarUrlObj),\n+ options: localVarRequestOptions,\n+ };\n+ },\n/**\n*\n* @param {string} templateID ID of template\n@@ -19598,6 +19615,21 @@ export const TemplatesApiFp = function(configuration?: Configuration) {\nreturn axios.request(axiosRequestArgs);\n};\n},\n+ /**\n+ *\n+ * @summary delete a template document\n+ * @param {string} templateID ID of template\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ */\n+ documentsTemplatesTemplateIDDelete(templateID: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Response> {\n+ const localVarAxiosArgs = TemplatesApiAxiosParamCreator(configuration).documentsTemplatesTemplateIDDelete(templateID, zapTraceSpan, options);\n+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\n+ const axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\n+ return axios.request(axiosRequestArgs);\n+ };\n+ },\n/**\n*\n* @param {string} templateID ID of template\n@@ -19657,6 +19689,17 @@ export const TemplatesApiFactory = function (configuration?: Configuration, base\ndocumentsTemplatesPost(documentCreate: DocumentCreate, zapTraceSpan?: string, options?: any) {\nreturn TemplatesApiFp(configuration).documentsTemplatesPost(documentCreate, zapTraceSpan, options)(axios, basePath);\n},\n+ /**\n+ *\n+ * @summary delete a template document\n+ * @param {string} templateID ID of template\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ */\n+ documentsTemplatesTemplateIDDelete(templateID: string, zapTraceSpan?: string, options?: any) {\n+ return TemplatesApiFp(configuration).documentsTemplatesTemplateIDDelete(templateID, zapTraceSpan, options)(axios, basePath);\n+ },\n/**\n*\n* @param {string} templateID ID of template\n@@ -19713,6 +19756,19 @@ export class TemplatesApi extends BaseAPI {\nreturn TemplatesApiFp(this.configuration).documentsTemplatesPost(documentCreate, zapTraceSpan, options)(this.axios, this.basePath);\n}\n+ /**\n+ *\n+ * @summary delete a template document\n+ * @param {string} templateID ID of template\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ * @memberof TemplatesApi\n+ */\n+ public documentsTemplatesTemplateIDDelete(templateID: string, zapTraceSpan?: string, options?: any) {\n+ return TemplatesApiFp(this.configuration).documentsTemplatesTemplateIDDelete(templateID, zapTraceSpan, options)(this.axios, this.basePath);\n+ }\n+\n/**\n*\n* @param {string} templateID ID of template\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/templates.ts", "new_path": "src/wrappers/templates.ts", "diff": "@@ -49,4 +49,12 @@ export default class {\nreturn addTemplateDefaults(data)\n}\n+\n+ public async delete(templateID: string): Promise<Response> {\n+ const {data} = await this.service.documentsTemplatesTemplateIDDelete(\n+ templateID\n+ )\n+\n+ return data\n+ }\n}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Update templates wrapper with delete api call
305,166
26.03.2019 11:25:17
14,400
a1ec4520ff219bab0e8a596d96dd624e9455e7eb
rm(wrappers/tasks/createFromTemplate): prefer wrapping calls in UI
[ { "change_type": "MODIFY", "old_path": "src/wrappers/tasks.ts", "new_path": "src/wrappers/tasks.ts", "diff": "-import {Label, LabelsApi, LogEvent, Run, Task, TasksApi, User} from '../api'\n-import {\n- ILabel,\n- ILabelIncluded,\n- ITask,\n- ITaskTemplate,\n- TemplateType,\n-} from '../types'\n+import {LogEvent, Run, Task, TasksApi, User} from '../api'\n+import {ILabel, ITask} from '../types'\nimport {addLabelDefaults} from './labels'\nconst addDefaults = (task: Task): ITask => {\n@@ -20,11 +14,9 @@ const addDefaultsToAll = (tasks: Task[]): ITask[] =>\nexport default class {\nprivate service: TasksApi\n- private labelsService: LabelsApi\nconstructor(basePath: string) {\nthis.service = new TasksApi({basePath})\n- this.labelsService = new LabelsApi({basePath})\n}\npublic async create(org: string, script: string): Promise<ITask> {\n@@ -177,108 +169,6 @@ export default class {\nreturn this.get(createdTask.id)\n}\n- public async createFromTemplate(\n- template: ITaskTemplate,\n- orgID: string\n- ): Promise<ITask> {\n- const {content} = template\n-\n- if (\n- content.data.type !== TemplateType.Task ||\n- template.meta.version !== '1'\n- ) {\n- throw new Error('Can not create task from this template')\n- }\n-\n- const flux = content.data.attributes.flux\n-\n- const createdTask = await this.createByOrgID(orgID, flux)\n-\n- if (!createdTask || !createdTask.id) {\n- throw new Error('Could not create task')\n- }\n-\n- await this.createLabelsFromTemplate(template, createdTask)\n-\n- const task = await this.get(createdTask.id)\n-\n- return task\n- }\n-\n- private async createLabelsFromTemplate(\n- template: ITaskTemplate,\n- createdTask: ITask\n- ) {\n- if (!createdTask || !createdTask.id) {\n- throw new Error('Can not add labels to undefined Task')\n- }\n-\n- const {\n- content: {included},\n- } = template\n-\n- if (!included || !included.length) {\n- return\n- }\n-\n- const labelsIncluded = included.filter(\n- (r): r is ILabelIncluded => r.type === TemplateType.Label\n- )\n-\n- const {data} = await this.labelsService.labelsGet()\n- const existingLabels = data.labels || []\n-\n- const labelIDsToAdd = this.findLabelIDsToAdd(existingLabels, labelsIncluded)\n- const labelsToCreate = this.findLabelsToCreate(\n- existingLabels,\n- labelsIncluded\n- )\n-\n- const createdLabels = await this.createLabels(\n- createdTask.orgID,\n- labelsToCreate\n- )\n- const createdLabelIDs = createdLabels.map(l => l.id || '')\n-\n- await this.addLabels(createdTask.id, [...createdLabelIDs, ...labelIDsToAdd])\n- }\n-\n- private findLabelIDsToAdd(\n- currentLabels: Label[],\n- labels: ILabelIncluded[]\n- ): string[] {\n- return currentLabels\n- .filter(el => !!labels.find(l => l.attributes.name === el.name))\n- .map(l => l.id || '')\n- }\n-\n- private findLabelsToCreate(\n- currentLabels: Label[],\n- labels: ILabelIncluded[]\n- ): ILabelIncluded[] {\n- return labels.filter(\n- l => !currentLabels.find(el => l.attributes.name === el.name)\n- )\n- }\n-\n- private async createLabels(\n- orgID: string,\n- labelsToCreate: ILabelIncluded[]\n- ): Promise<Label[]> {\n- const pendingLabels = labelsToCreate.map(l => {\n- const name = l.attributes.name\n- const properties = l.attributes.properties\n-\n- return this.labelsService.labelsPost({orgID, name, properties})\n- })\n-\n- const labelsResponse = await Promise.all(pendingLabels)\n-\n- return labelsResponse\n- .map(lr => lr.data.label)\n- .filter((cl): cl is Label => !!cl)\n- }\n-\nprivate async cloneLabels(\noriginalTask: Task,\nnewTask: Task\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
rm(wrappers/tasks/createFromTemplate): prefer wrapping calls in UI
305,161
26.03.2019 11:33:52
25,200
4cd2b6cfdca81e6cfcc8a60b53ee089bc6769a8f
Remove templating methods from dashboards
[ { "change_type": "MODIFY", "old_path": "src/wrappers/dashboards.ts", "new_path": "src/wrappers/dashboards.ts", "diff": "@@ -4,20 +4,10 @@ import {\nCreateDashboardRequest,\nDashboard,\nDashboardsApi,\n- Label,\n- LabelsApi,\nProtosApi,\nView,\n} from '../api'\n-import {\n- ICellIncluded,\n- IDashboard,\n- IDashboardTemplate,\n- IDashboardTemplateIncluded,\n- ILabel,\n- ILabelIncluded,\n- TemplateType,\n-} from '../types'\n+import {IDashboard, ILabel} from '../types'\nimport {addLabelDefaults} from './labels'\nconst addDefaults = (dashboard: Dashboard): IDashboard => {\n@@ -39,13 +29,11 @@ export default class {\nprivate service: DashboardsApi\nprivate cellsService: CellsApi\nprivate protosService: ProtosApi\n- private labelsService: LabelsApi\nconstructor(basePath: string) {\nthis.cellsService = new CellsApi({basePath})\nthis.protosService = new ProtosApi({basePath})\nthis.service = new DashboardsApi({basePath})\n- this.labelsService = new LabelsApi({basePath})\n}\npublic async get(id: string): Promise<IDashboard> {\n@@ -242,198 +230,6 @@ export default class {\nreturn this.get(createdDashboard.id)\n}\n- public async createFromTemplate(\n- template: IDashboardTemplate,\n- orgID: string\n- ): Promise<IDashboard> {\n- const {content} = template\n-\n- if (\n- content.data.type !== TemplateType.Dashboard ||\n- template.meta.version !== '1'\n- ) {\n- throw new Error('Can not create dashboard from this template')\n- }\n-\n- const {name, description} = content.data.attributes\n-\n- const createdDashboard = await this.create({orgID, name, description})\n-\n- if (!createdDashboard || !createdDashboard.id) {\n- throw new Error('Failed to create dashboard')\n- }\n-\n- await Promise.all([\n- await this.createLabelsFromTemplate(template, createdDashboard),\n- await this.createCellsFromTemplate(template, createdDashboard),\n- ])\n-\n- const dashboard = await this.get(createdDashboard.id)\n-\n- return addDefaults(dashboard)\n- }\n-\n- private async createLabelsFromTemplate(\n- template: IDashboardTemplate,\n- dashboard: IDashboard\n- ) {\n- if (!dashboard || !dashboard.id) {\n- throw new Error('Can not add labels to undefined Dashboard')\n- }\n-\n- const {\n- content: {included},\n- } = template\n-\n- if (!included || !included.length) {\n- return\n- }\n-\n- const labelsIncluded = this.findIncludedLabels(included)\n-\n- const {\n- data: {labels},\n- } = await this.labelsService.labelsGet()\n- const existingLabels = labels || []\n-\n- const labelIDsToAdd = this.findLabelIDsToAdd(existingLabels, labelsIncluded)\n- const labelsToCreate = this.findLabelsToCreate(\n- existingLabels,\n- labelsIncluded\n- )\n-\n- const createdLabels = await this.createLabels(\n- dashboard.orgID,\n- labelsToCreate\n- )\n- const createdLabelIDs = createdLabels.map(l => l.id || '')\n-\n- await this.addLabels(dashboard.id, [...createdLabelIDs, ...labelIDsToAdd])\n- }\n-\n- private findIncludedLabels(resources: IDashboardTemplateIncluded[]) {\n- return resources.filter(\n- (r): r is ILabelIncluded => r.type === TemplateType.Label\n- )\n- }\n-\n- private async createLabels(\n- orgID: string,\n- labelsToCreate: ILabelIncluded[]\n- ): Promise<Label[]> {\n- const pendingLabels = labelsToCreate.map(l => {\n- const {\n- attributes: {name, properties},\n- } = l\n- return this.labelsService.labelsPost({name, properties, orgID})\n- })\n-\n- const labelsResponse = await Promise.all(pendingLabels)\n-\n- return labelsResponse\n- .map(lr => lr.data.label)\n- .filter((cl): cl is Label => !!cl)\n- }\n-\n- private findLabelIDsToAdd(\n- currentLabels: Label[],\n- labels: ILabelIncluded[]\n- ): string[] {\n- return currentLabels\n- .filter(el => !!labels.find(l => el.name === l.attributes.name))\n- .map(l => l.id || '')\n- }\n-\n- private findLabelsToCreate(\n- currentLabels: Label[],\n- labels: ILabelIncluded[]\n- ): ILabelIncluded[] {\n- return labels.filter(\n- l => !currentLabels.find(el => el.name === l.attributes.name)\n- )\n- }\n-\n- private async createCellsFromTemplate(\n- template: IDashboardTemplate,\n- createdDashboard: IDashboard\n- ) {\n- const {content} = template\n-\n- if (\n- !content.data.relationships ||\n- !content.data.relationships[TemplateType.Cell]\n- ) {\n- return\n- }\n-\n- const cellRelationships = content.data.relationships[TemplateType.Cell].data\n-\n- const includedResources = content.included || []\n-\n- const cellsToCreate = includedResources.reduce(\n- (acc, ir) => {\n- if (ir.type === TemplateType.Cell) {\n- const found = cellRelationships.some(\n- cr => cr.type === TemplateType.Cell && cr.id === ir.id\n- )\n- if (found) {\n- acc = [...acc, ir]\n- }\n- }\n- return acc\n- },\n- [] as ICellIncluded[]\n- )\n-\n- const pendingCells = cellsToCreate.map(c => {\n- const {\n- attributes: {x, y, w, h},\n- } = c\n- return this.createCell(createdDashboard.id, {x, y, w, h})\n- })\n-\n- const cellResponses = await Promise.all(pendingCells)\n-\n- this.createViewsFromTemplate(\n- template,\n- cellResponses,\n- cellsToCreate,\n- createdDashboard\n- )\n- }\n-\n- private async createViewsFromTemplate(\n- template: IDashboardTemplate,\n- createdCells: Cell[],\n- originalCellsIncluded: ICellIncluded[],\n- createdDashboard: IDashboard\n- ) {\n- const pendingViews = createdCells.map((c, i) => {\n- const cellFromTemplate = originalCellsIncluded[i]\n- const viewRelationship =\n- cellFromTemplate.relationships[TemplateType.View].data\n- const includedResources = template.content.included || []\n-\n- const includedView = includedResources.find(ir => {\n- return ir.type === TemplateType.View && ir.id === viewRelationship.id\n- })\n-\n- if (includedView) {\n- return this.updateView(\n- createdDashboard.id,\n- c.id || '',\n- includedView.attributes\n- )\n- }\n- })\n-\n- const definedPendingViews = pendingViews.filter(\n- (pv): pv is Promise<View> => !!pv\n- )\n-\n- await Promise.all(definedPendingViews)\n- }\n-\nprivate async cloneLabels(\noriginalDashboard: Dashboard,\nnewDashboard: Dashboard\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Remove templating methods from dashboards
305,168
26.03.2019 11:09:18
25,200
9772dca424b39ce2c1841b32f8433b9aad554bd8
Update templates wrapper for cloning a template
[ { "change_type": "MODIFY", "old_path": "src/wrappers/templates.ts", "new_path": "src/wrappers/templates.ts", "diff": "@@ -57,4 +57,28 @@ export default class {\nreturn data\n}\n+\n+ public async clone(templateID: string): Promise<ITemplate> {\n+ const {data} = await this.service.documentsTemplatesTemplateIDGet(\n+ templateID\n+ )\n+\n+ let labels: string[] = []\n+ if (data.labels) {\n+ labels = data.labels.map(l => l.name).filter((b): b is string => !!b)\n+ }\n+\n+ const name = `${data.meta.name} (clone)`\n+\n+ const meta = {...data.meta, name}\n+ const templateToCreate = {...data, labels, meta}\n+\n+ const createdTemplate = await this.create(templateToCreate)\n+\n+ if (!createdTemplate || !createdTemplate.id) {\n+ throw new Error('Could not clone template')\n+ }\n+\n+ return createdTemplate\n+ }\n}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Update templates wrapper for cloning a template
305,168
26.03.2019 13:21:10
25,200
0c4b9b1d4eda7b53773aa842a4000ab61a5dd8d1
Update templates wrapper clone function to include org
[ { "change_type": "MODIFY", "old_path": "src/wrappers/templates.ts", "new_path": "src/wrappers/templates.ts", "diff": "@@ -58,20 +58,26 @@ export default class {\nreturn data\n}\n- public async clone(templateID: string): Promise<ITemplate> {\n+ public async clone(templateID: string, orgID: string): Promise<ITemplate> {\nconst {data} = await this.service.documentsTemplatesTemplateIDGet(\ntemplateID\n)\n- let labels: string[] = []\n- if (data.labels) {\n- labels = data.labels.map(l => l.name).filter((b): b is string => !!b)\n+ const {labels, content, meta} = data\n+\n+ let labelsData: string[] = []\n+ if (labels) {\n+ labelsData = labels.map(l => l.name).filter((b): b is string => !!b)\n}\n- const name = `${data.meta.name} (clone)`\n+ const name = `${meta.name} (clone)`\n- const meta = {...data.meta, name}\n- const templateToCreate = {...data, labels, meta}\n+ const templateToCreate = {\n+ meta: {...meta, name},\n+ content,\n+ orgID,\n+ labels: labelsData,\n+ }\nconst createdTemplate = await this.create(templateToCreate)\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Update templates wrapper clone function to include org
305,169
26.03.2019 11:04:06
25,200
3f3ac271ffd92594a66abd365696dae5d74f27d5
Add wrapper for updating a Template
[ { "change_type": "MODIFY", "old_path": "package-lock.json", "new_path": "package-lock.json", "diff": "{\n\"name\": \"@influxdata/influx\",\n- \"version\": \"0.2.42\",\n+ \"version\": \"0.2.52\",\n\"lockfileVersion\": 1,\n\"requires\": true,\n\"dependencies\": {\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/templates.ts", "new_path": "src/wrappers/templates.ts", "diff": "@@ -44,6 +44,19 @@ export default class {\nreturn addTemplateDefaults(data)\n}\n+ public async update(\n+ id: string,\n+ props: Partial<ITemplate>\n+ ): Promise<ITemplate> {\n+ const original = await this.get(id)\n+ const {data} = await this.service.documentsTemplatesTemplateIDPut(id, {\n+ ...original,\n+ ...props,\n+ })\n+\n+ return addTemplateDefaults(data)\n+ }\n+\npublic async create(templateCreate: DocumentCreate): Promise<ITemplate> {\nconst {data} = await this.service.documentsTemplatesPost(templateCreate)\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add wrapper for updating a Template
305,164
28.03.2019 11:23:00
25,200
572a9ba40e8292aa721cc570be2c3b42ce962305
Add get to users wrapper fix getAll to follow standard format
[ { "change_type": "MODIFY", "old_path": "src/wrappers/users.ts", "new_path": "src/wrappers/users.ts", "diff": "-import {User, Users, UsersApi} from '../api'\n+import {User, UsersApi} from '../api'\nexport default class {\nprivate service: UsersApi\n@@ -13,9 +13,15 @@ export default class {\nreturn data\n}\n- public async getAllUsers(): Promise<Users> {\n- const {data} = await this.service.usersGet()\n+ public async get(id: string): Promise<User> {\n+ const {data} = await this.service.usersUserIDGet(id)\nreturn data\n}\n+\n+ public async getAll(): Promise<User[]> {\n+ const {data} = await this.service.usersGet()\n+\n+ return data.users || []\n+ }\n}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add get to users wrapper - fix getAll to follow standard format
305,168
01.04.2019 12:25:23
25,200
bcea6868eaa33ebe0bb3b6e3125ab1d3471d32c9
Update telegraf and dashboard labels to remove multiple
[ { "change_type": "MODIFY", "old_path": "src/wrappers/dashboards.ts", "new_path": "src/wrappers/dashboards.ts", "diff": "@@ -182,6 +182,15 @@ export default class {\nreturn data\n}\n+ public removeLabels(\n+ dashboardID: string,\n+ labelIDs: string[]\n+ ): Promise<Response[]> {\n+ const promises = labelIDs.map(l => this.removeLabel(dashboardID, l))\n+\n+ return Promise.all(promises)\n+ }\n+\npublic async getView(dashboardID: string, cellID: string): Promise<View> {\nconst {data} = await this.service.dashboardsDashboardIDCellsCellIDViewGet(\ndashboardID,\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/telegrafConfigs.ts", "new_path": "src/wrappers/telegrafConfigs.ts", "diff": "@@ -103,12 +103,6 @@ export default class {\nreturn addLabelDefaults(data.label)\n}\n- public async addLabels(id: string, labels: ILabel[]): Promise<ILabel[]> {\n- const pendingLabels = labels.map(l => this.addLabel(id, l))\n-\n- return Promise.all(pendingLabels)\n- }\n-\npublic async removeLabel(id: string, label: ILabel): Promise<Response> {\nif (!label.id) {\nthrow new Error('label must have id')\n@@ -121,4 +115,16 @@ export default class {\nreturn data\n}\n+\n+ public async addLabels(id: string, labels: ILabel[]): Promise<ILabel[]> {\n+ const pendingLabels = labels.map(l => this.addLabel(id, l))\n+\n+ return Promise.all(pendingLabels)\n+ }\n+\n+ public async removeLabels(id: string, labels: ILabel[]): Promise<Response[]> {\n+ const promises = labels.map(l => this.removeLabel(id, l))\n+\n+ return Promise.all(promises)\n+ }\n}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Update telegraf and dashboard labels to remove multiple
305,168
01.04.2019 13:35:27
25,200
5ef19bbdb725619e2e16ce4f73460f786bb25c83
Update the telegraf and dashboards addLabels to include saga pattern
[ { "change_type": "MODIFY", "old_path": "src/wrappers/dashboards.ts", "new_path": "src/wrappers/dashboards.ts", "diff": "@@ -9,6 +9,7 @@ import {\n} from '../api'\nimport {IDashboard, ILabel} from '../types'\nimport {addLabelDefaults} from './labels'\n+import saga from '../utils/sagas'\nconst addDefaults = (dashboard: Dashboard): IDashboard => {\nreturn {\n@@ -163,11 +164,20 @@ export default class {\ndashboardID: string,\nlabelIDs: string[]\n): Promise<ILabel[]> {\n- return Promise.all(\n- labelIDs.map(labelID => {\n- return this.addLabel(dashboardID, labelID)\n+ const pendingLabels = labelIDs.map(l => {\n+ return {\n+ action: async () => {\n+ return await this.addLabel(dashboardID, l)\n+ },\n+ rollback: async (r?: ILabel) => {\n+ if (r && r.id) {\n+ this.delete(r.id)\n+ }\n+ },\n+ }\n})\n- )\n+\n+ return await saga(pendingLabels)\n}\npublic async removeLabel(\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/telegrafConfigs.ts", "new_path": "src/wrappers/telegrafConfigs.ts", "diff": "import {Organization, Telegraf, TelegrafRequest, TelegrafsApi} from '../api'\nimport {ILabel, ITelegraf} from '../types'\nimport {addLabelDefaults} from './labels'\n+import saga from '../utils/sagas'\nconst addDefaults = (telegraf: Telegraf): ITelegraf => {\nreturn {\n@@ -117,9 +118,20 @@ export default class {\n}\npublic async addLabels(id: string, labels: ILabel[]): Promise<ILabel[]> {\n- const pendingLabels = labels.map(l => this.addLabel(id, l))\n+ const pendingLabels = labels.map(l => {\n+ return {\n+ action: async () => {\n+ return await this.addLabel(id, l)\n+ },\n+ rollback: async (r?: ILabel) => {\n+ if (r && r.id) {\n+ this.delete(r.id)\n+ }\n+ },\n+ }\n+ })\n- return Promise.all(pendingLabels)\n+ return await saga(pendingLabels)\n}\npublic async removeLabels(id: string, labels: ILabel[]): Promise<Response[]> {\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Update the telegraf and dashboards addLabels to include saga pattern
305,161
01.04.2019 16:10:57
25,200
123a3d373529f191c55ac8faaf5d239be0239860
Add createBucket type and optional orgID to getAll
[ { "change_type": "MODIFY", "old_path": "src/wrappers/buckets.ts", "new_path": "src/wrappers/buckets.ts", "diff": "@@ -2,6 +2,11 @@ import {Bucket, BucketsApi} from '../api'\nimport {IBucket} from '../types'\nimport {addLabelDefaults} from './labels'\n+type BucketPicked = Pick<Bucket, 'organizationID' | 'name'>\n+type BucketRest = Pick<Bucket, Exclude<keyof Bucket, keyof BucketPicked>>\n+type BucketRequired = {[P in keyof BucketPicked]-?: BucketPicked[P]}\n+type BucketCreate = BucketRequired & BucketRest\n+\nconst addDefaults = (bucket: Bucket): IBucket => ({\n...bucket,\nlabels: (bucket.labels || []).map(addLabelDefaults),\n@@ -23,15 +28,21 @@ export default class {\nreturn addDefaults(data)\n}\n- public async getAllByOrg(org: string): Promise<IBucket[]> {\n+ public async getAll(orgID?: string): Promise<IBucket[]> {\nconst {\ndata: {buckets},\n- } = await this.service.bucketsGet(undefined, undefined, undefined, org)\n+ } = await this.service.bucketsGet(\n+ undefined,\n+ undefined,\n+ undefined,\n+ undefined,\n+ orgID\n+ )\nreturn addDefaultsToAll(buckets || [])\n}\n- public async create(bucket: Bucket): Promise<IBucket> {\n+ public async create(bucket: BucketCreate): Promise<IBucket> {\nconst {data} = await this.service.bucketsPost(bucket)\nreturn addDefaults(data)\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add createBucket type and optional orgID to getAll
305,161
01.04.2019 16:27:21
25,200
0570b5a26dfd28bcd0fc7e12f18c8ae1f43ec794
Add getAll with optional orgID to variables
[ { "change_type": "MODIFY", "old_path": "src/wrappers/variables.ts", "new_path": "src/wrappers/variables.ts", "diff": "@@ -31,10 +31,10 @@ export default class {\nreturn variables || []\n}\n- public async getAll(): Promise<Variable[]> {\n+ public async getAll(orgID?: string): Promise<Variable[]> {\nconst {\ndata: {variables},\n- } = await this.service.variablesGet()\n+ } = await this.service.variablesGet(undefined, undefined, orgID)\nreturn variables || []\n}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add getAll with optional orgID to variables
305,168
02.04.2019 14:08:55
25,200
cea27d57b1ca9dbfe4ee17311449a1c03a3de50c
Update variables to contain add/remove variables
[ { "change_type": "MODIFY", "old_path": "src/api/api.ts", "new_path": "src/api/api.ts", "diff": "@@ -2136,10 +2136,10 @@ export interface MapVariableProperties {\ntype?: MapVariableProperties.TypeEnum;\n/**\n*\n- * @type {any}\n+ * @type {{ [key: string]: string; }}\n* @memberof MapVariableProperties\n*/\n- values?: any;\n+ values?: { [key: string]: string; };\n}\n/**\n@@ -6203,10 +6203,10 @@ export namespace V1ViewPropertiesLegend {\nexport interface Variable {\n/**\n*\n- * @type {UsersLinks}\n+ * @type {VariableLinks}\n* @memberof Variable\n*/\n- links?: UsersLinks;\n+ links?: VariableLinks;\n/**\n*\n* @type {string}\n@@ -6231,6 +6231,12 @@ export interface Variable {\n* @memberof Variable\n*/\nselected?: Array<string>;\n+ /**\n+ *\n+ * @type {Array<Label>}\n+ * @memberof Variable\n+ */\n+ labels?: Array<Label>;\n/**\n*\n* @type {any}\n@@ -6265,6 +6271,32 @@ export interface VariableAssignment {\ninit?: Expression;\n}\n+/**\n+ *\n+ * @export\n+ * @interface VariableLinks\n+ */\n+export interface VariableLinks {\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof VariableLinks\n+ */\n+ self?: string;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof VariableLinks\n+ */\n+ org?: string;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof VariableLinks\n+ */\n+ labels?: string;\n+}\n+\n/**\n*\n* @export\n@@ -23734,6 +23766,135 @@ export const VariablesApiAxiosParamCreator = function (configuration?: Configura\noptions: localVarRequestOptions,\n};\n},\n+ /**\n+ *\n+ * @summary list all labels for a variable\n+ * @param {string} variableID ID of the variable\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ */\n+ variablesVariableIDLabelsGet(variableID: string, zapTraceSpan?: string, options: any = {}): RequestArgs {\n+ // verify required parameter 'variableID' is not null or undefined\n+ if (variableID === null || variableID === undefined) {\n+ throw new RequiredError('variableID','Required parameter variableID was null or undefined when calling variablesVariableIDLabelsGet.');\n+ }\n+ const localVarPath = `/variables/{variableID}/labels`\n+ .replace(`{${\"variableID\"}}`, encodeURIComponent(String(variableID)));\n+ const localVarUrlObj = url.parse(localVarPath, true);\n+ let baseOptions;\n+ if (configuration) {\n+ baseOptions = configuration.baseOptions;\n+ }\n+ const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions, options);\n+ const localVarHeaderParameter = {} as any;\n+ const localVarQueryParameter = {} as any;\n+\n+ if (zapTraceSpan !== undefined && zapTraceSpan !== null) {\n+ localVarHeaderParameter['Zap-Trace-Span'] = String(zapTraceSpan);\n+ }\n+\n+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);\n+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943\n+ delete localVarUrlObj.search;\n+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);\n+\n+ return {\n+ url: url.format(localVarUrlObj),\n+ options: localVarRequestOptions,\n+ };\n+ },\n+ /**\n+ *\n+ * @summary delete a label from a variable\n+ * @param {string} variableID ID of the variable\n+ * @param {string} labelID the label id to delete\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ */\n+ variablesVariableIDLabelsLabelIDDelete(variableID: string, labelID: string, zapTraceSpan?: string, options: any = {}): RequestArgs {\n+ // verify required parameter 'variableID' is not null or undefined\n+ if (variableID === null || variableID === undefined) {\n+ throw new RequiredError('variableID','Required parameter variableID was null or undefined when calling variablesVariableIDLabelsLabelIDDelete.');\n+ }\n+ // verify required parameter 'labelID' is not null or undefined\n+ if (labelID === null || labelID === undefined) {\n+ throw new RequiredError('labelID','Required parameter labelID was null or undefined when calling variablesVariableIDLabelsLabelIDDelete.');\n+ }\n+ const localVarPath = `/variables/{variableID}/labels/{labelID}`\n+ .replace(`{${\"variableID\"}}`, encodeURIComponent(String(variableID)))\n+ .replace(`{${\"labelID\"}}`, encodeURIComponent(String(labelID)));\n+ const localVarUrlObj = url.parse(localVarPath, true);\n+ let baseOptions;\n+ if (configuration) {\n+ baseOptions = configuration.baseOptions;\n+ }\n+ const localVarRequestOptions = Object.assign({ method: 'DELETE' }, baseOptions, options);\n+ const localVarHeaderParameter = {} as any;\n+ const localVarQueryParameter = {} as any;\n+\n+ if (zapTraceSpan !== undefined && zapTraceSpan !== null) {\n+ localVarHeaderParameter['Zap-Trace-Span'] = String(zapTraceSpan);\n+ }\n+\n+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);\n+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943\n+ delete localVarUrlObj.search;\n+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);\n+\n+ return {\n+ url: url.format(localVarUrlObj),\n+ options: localVarRequestOptions,\n+ };\n+ },\n+ /**\n+ *\n+ * @summary add a label to a variable\n+ * @param {string} variableID ID of the variable\n+ * @param {LabelMapping} labelMapping label to add\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ */\n+ variablesVariableIDLabelsPost(variableID: string, labelMapping: LabelMapping, zapTraceSpan?: string, options: any = {}): RequestArgs {\n+ // verify required parameter 'variableID' is not null or undefined\n+ if (variableID === null || variableID === undefined) {\n+ throw new RequiredError('variableID','Required parameter variableID was null or undefined when calling variablesVariableIDLabelsPost.');\n+ }\n+ // verify required parameter 'labelMapping' is not null or undefined\n+ if (labelMapping === null || labelMapping === undefined) {\n+ throw new RequiredError('labelMapping','Required parameter labelMapping was null or undefined when calling variablesVariableIDLabelsPost.');\n+ }\n+ const localVarPath = `/variables/{variableID}/labels`\n+ .replace(`{${\"variableID\"}}`, encodeURIComponent(String(variableID)));\n+ const localVarUrlObj = url.parse(localVarPath, true);\n+ let baseOptions;\n+ if (configuration) {\n+ baseOptions = configuration.baseOptions;\n+ }\n+ const localVarRequestOptions = Object.assign({ method: 'POST' }, baseOptions, options);\n+ const localVarHeaderParameter = {} as any;\n+ const localVarQueryParameter = {} as any;\n+\n+ if (zapTraceSpan !== undefined && zapTraceSpan !== null) {\n+ localVarHeaderParameter['Zap-Trace-Span'] = String(zapTraceSpan);\n+ }\n+\n+ localVarHeaderParameter['Content-Type'] = 'application/json';\n+\n+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);\n+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943\n+ delete localVarUrlObj.search;\n+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);\n+ const needsSerialization = (<any>\"LabelMapping\" !== \"string\") || localVarRequestOptions.headers['Content-Type'] === 'application/json';\n+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(labelMapping || {}) : (labelMapping || \"\");\n+\n+ return {\n+ url: url.format(localVarUrlObj),\n+ options: localVarRequestOptions,\n+ };\n+ },\n/**\n*\n* @summary update a variable\n@@ -23898,6 +24059,53 @@ export const VariablesApiFp = function(configuration?: Configuration) {\nreturn axios.request(axiosRequestArgs);\n};\n},\n+ /**\n+ *\n+ * @summary list all labels for a variable\n+ * @param {string} variableID ID of the variable\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ */\n+ variablesVariableIDLabelsGet(variableID: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<LabelsResponse> {\n+ const localVarAxiosArgs = VariablesApiAxiosParamCreator(configuration).variablesVariableIDLabelsGet(variableID, zapTraceSpan, options);\n+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\n+ const axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\n+ return axios.request(axiosRequestArgs);\n+ };\n+ },\n+ /**\n+ *\n+ * @summary delete a label from a variable\n+ * @param {string} variableID ID of the variable\n+ * @param {string} labelID the label id to delete\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ */\n+ variablesVariableIDLabelsLabelIDDelete(variableID: string, labelID: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Response> {\n+ const localVarAxiosArgs = VariablesApiAxiosParamCreator(configuration).variablesVariableIDLabelsLabelIDDelete(variableID, labelID, zapTraceSpan, options);\n+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\n+ const axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\n+ return axios.request(axiosRequestArgs);\n+ };\n+ },\n+ /**\n+ *\n+ * @summary add a label to a variable\n+ * @param {string} variableID ID of the variable\n+ * @param {LabelMapping} labelMapping label to add\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ */\n+ variablesVariableIDLabelsPost(variableID: string, labelMapping: LabelMapping, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<LabelResponse> {\n+ const localVarAxiosArgs = VariablesApiAxiosParamCreator(configuration).variablesVariableIDLabelsPost(variableID, labelMapping, zapTraceSpan, options);\n+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\n+ const axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\n+ return axios.request(axiosRequestArgs);\n+ };\n+ },\n/**\n*\n* @summary update a variable\n@@ -23984,6 +24192,41 @@ export const VariablesApiFactory = function (configuration?: Configuration, base\nvariablesVariableIDGet(variableID: string, zapTraceSpan?: string, options?: any) {\nreturn VariablesApiFp(configuration).variablesVariableIDGet(variableID, zapTraceSpan, options)(axios, basePath);\n},\n+ /**\n+ *\n+ * @summary list all labels for a variable\n+ * @param {string} variableID ID of the variable\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ */\n+ variablesVariableIDLabelsGet(variableID: string, zapTraceSpan?: string, options?: any) {\n+ return VariablesApiFp(configuration).variablesVariableIDLabelsGet(variableID, zapTraceSpan, options)(axios, basePath);\n+ },\n+ /**\n+ *\n+ * @summary delete a label from a variable\n+ * @param {string} variableID ID of the variable\n+ * @param {string} labelID the label id to delete\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ */\n+ variablesVariableIDLabelsLabelIDDelete(variableID: string, labelID: string, zapTraceSpan?: string, options?: any) {\n+ return VariablesApiFp(configuration).variablesVariableIDLabelsLabelIDDelete(variableID, labelID, zapTraceSpan, options)(axios, basePath);\n+ },\n+ /**\n+ *\n+ * @summary add a label to a variable\n+ * @param {string} variableID ID of the variable\n+ * @param {LabelMapping} labelMapping label to add\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ */\n+ variablesVariableIDLabelsPost(variableID: string, labelMapping: LabelMapping, zapTraceSpan?: string, options?: any) {\n+ return VariablesApiFp(configuration).variablesVariableIDLabelsPost(variableID, labelMapping, zapTraceSpan, options)(axios, basePath);\n+ },\n/**\n*\n* @summary update a variable\n@@ -24071,6 +24314,47 @@ export class VariablesApi extends BaseAPI {\nreturn VariablesApiFp(this.configuration).variablesVariableIDGet(variableID, zapTraceSpan, options)(this.axios, this.basePath);\n}\n+ /**\n+ *\n+ * @summary list all labels for a variable\n+ * @param {string} variableID ID of the variable\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ * @memberof VariablesApi\n+ */\n+ public variablesVariableIDLabelsGet(variableID: string, zapTraceSpan?: string, options?: any) {\n+ return VariablesApiFp(this.configuration).variablesVariableIDLabelsGet(variableID, zapTraceSpan, options)(this.axios, this.basePath);\n+ }\n+\n+ /**\n+ *\n+ * @summary delete a label from a variable\n+ * @param {string} variableID ID of the variable\n+ * @param {string} labelID the label id to delete\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ * @memberof VariablesApi\n+ */\n+ public variablesVariableIDLabelsLabelIDDelete(variableID: string, labelID: string, zapTraceSpan?: string, options?: any) {\n+ return VariablesApiFp(this.configuration).variablesVariableIDLabelsLabelIDDelete(variableID, labelID, zapTraceSpan, options)(this.axios, this.basePath);\n+ }\n+\n+ /**\n+ *\n+ * @summary add a label to a variable\n+ * @param {string} variableID ID of the variable\n+ * @param {LabelMapping} labelMapping label to add\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {*} [options] Override http request option.\n+ * @throws {RequiredError}\n+ * @memberof VariablesApi\n+ */\n+ public variablesVariableIDLabelsPost(variableID: string, labelMapping: LabelMapping, zapTraceSpan?: string, options?: any) {\n+ return VariablesApiFp(this.configuration).variablesVariableIDLabelsPost(variableID, labelMapping, zapTraceSpan, options)(this.axios, this.basePath);\n+ }\n+\n/**\n*\n* @summary update a variable\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/dashboards.ts", "new_path": "src/wrappers/dashboards.ts", "diff": "@@ -171,7 +171,7 @@ export default class {\n},\nrollback: async (r?: ILabel) => {\nif (r && r.id) {\n- this.delete(r.id)\n+ this.removeLabel(dashboardID, r.id)\n}\n},\n}\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/telegrafConfigs.ts", "new_path": "src/wrappers/telegrafConfigs.ts", "diff": "@@ -125,7 +125,7 @@ export default class {\n},\nrollback: async (r?: ILabel) => {\nif (r && r.id) {\n- this.delete(r.id)\n+ this.removeLabel(id, r)\n}\n},\n}\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/variables.ts", "new_path": "src/wrappers/variables.ts", "diff": "import {Variable, VariablesApi} from '../api'\n+import {ILabel} from '../types'\n+import {addLabelDefaults} from './labels'\n+import saga from '../utils/sagas'\nexport default class {\nprivate service: VariablesApi\n@@ -55,4 +58,60 @@ export default class {\nreturn data\n}\n+\n+ public async addLabel(variableID: string, labelID: string): Promise<ILabel> {\n+ const {data} = await this.service.variablesVariableIDLabelsPost(\n+ variableID,\n+ {\n+ labelID,\n+ }\n+ )\n+\n+ if (!data.label) {\n+ throw new Error('Failed to add label')\n+ }\n+\n+ return addLabelDefaults(data.label)\n+ }\n+\n+ public async addLabels(\n+ variableID: string,\n+ labelIDs: string[]\n+ ): Promise<ILabel[]> {\n+ const pendingLabels = labelIDs.map(l => {\n+ return {\n+ action: async () => {\n+ return await this.addLabel(variableID, l)\n+ },\n+ rollback: async (r?: ILabel) => {\n+ if (r && r.id) {\n+ this.removeLabel(variableID, r.id)\n+ }\n+ },\n+ }\n+ })\n+\n+ return await saga(pendingLabels)\n+ }\n+\n+ public async removeLabel(\n+ variableID: string,\n+ labelID: string\n+ ): Promise<Response> {\n+ const {data} = await this.service.variablesVariableIDLabelsLabelIDDelete(\n+ variableID,\n+ labelID\n+ )\n+\n+ return data\n+ }\n+\n+ public removeLabels(\n+ variableID: string,\n+ labelIDs: string[]\n+ ): Promise<Response[]> {\n+ const promises = labelIDs.map(l => this.removeLabel(variableID, l))\n+\n+ return Promise.all(promises)\n+ }\n}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Update variables to contain add/remove variables
305,166
03.04.2019 11:38:05
14,400
5550abe6abb10a00c76a7915fdd811d926158bcf
fix(wrapper/variable.labels): ensure defaults and labels
[ { "change_type": "MODIFY", "old_path": "src/types/index.ts", "new_path": "src/types/index.ts", "diff": "@@ -42,6 +42,10 @@ export interface ITelegraf extends Telegraf {\nlabels: ILabel[]\n}\n+export interface IVariable extends Variable {\n+ labels: ILabel[]\n+}\n+\ntype DashboardPicked = Pick<Dashboard, 'orgID' | 'id' | 'name' | 'cells'>\ntype DashboardOriginal = Pick<\nDashboard,\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/variables.ts", "new_path": "src/wrappers/variables.ts", "diff": "import {Variable, VariablesApi} from '../api'\n-import {ILabel} from '../types'\n+import {ILabel, IVariable} from '../types'\nimport {addLabelDefaults} from './labels'\nimport saga from '../utils/sagas'\n+const addDefaults = (variable: Variable): IVariable => {\n+ return {\n+ ...variable,\n+ labels: (variable.labels || []).map(addLabelDefaults),\n+ }\n+}\n+\nexport default class {\nprivate service: VariablesApi\n@@ -10,28 +17,31 @@ export default class {\nthis.service = new VariablesApi({basePath})\n}\n- public async get(id: string): Promise<Variable> {\n+ public async get(id: string): Promise<IVariable> {\nconst {data: variable} = await this.service.variablesVariableIDGet(id)\n- return variable\n+ return addDefaults(variable)\n}\n- public async update(id: string, props: Partial<Variable>): Promise<Variable> {\n+ public async update(\n+ id: string,\n+ props: Partial<Variable>\n+ ): Promise<IVariable> {\nconst original = await this.get(id)\nconst {data} = await this.service.variablesVariableIDPatch(id, {\n...original,\n...props,\n})\n- return data\n+ return addDefaults(data)\n}\n- public async getAllByOrg(org: string): Promise<Variable[]> {\n+ public async getAllByOrg(org: string): Promise<IVariable[]> {\nconst {\ndata: {variables},\n} = await this.service.variablesGet(undefined, org)\n- return variables || []\n+ return (variables || []).map(v => addDefaults(v))\n}\npublic async getAll(orgID?: string): Promise<Variable[]> {\n@@ -39,18 +49,20 @@ export default class {\ndata: {variables},\n} = await this.service.variablesGet(undefined, undefined, orgID)\n- return variables || []\n+ return (variables || []).map(v => addDefaults(v))\n}\n- public async create(variable: Variable): Promise<Variable> {\n+ public async create(variable: Variable): Promise<IVariable> {\nconst {data} = await this.service.variablesPost(variable)\n- return data\n+ return addDefaults(data)\n}\n- public async createAll(variables: Variable[]): Promise<Variable[]> {\n+ public async createAll(variables: Variable[]): Promise<IVariable[]> {\nconst pendingVariables = variables.map(v => this.create(v))\n- return await Promise.all(pendingVariables)\n+ const createdVars = await Promise.all(pendingVariables)\n+\n+ return createdVars.map(v => addDefaults(v))\n}\npublic async delete(id: string): Promise<Response> {\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
fix(wrapper/variable.labels): ensure defaults and labels
305,166
03.04.2019 12:03:18
14,400
cf9ac70fa76b88c8785158428a24193704454bfa
fix(wrappers/template.labels): require labels array
[ { "change_type": "MODIFY", "old_path": "src/types/index.ts", "new_path": "src/types/index.ts", "diff": "@@ -69,7 +69,7 @@ interface IKeyValuePairs {\n// Templates\ninterface ITemplateBase extends Document {\ncontent: {data: ITemplateData; included: ITemplateIncluded[]}\n- labels?: ILabel[]\n+ labels: ILabel[]\n}\n// TODO: be more specific about what attributes can be\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
fix(wrappers/template.labels): require labels array
305,165
03.04.2019 11:00:27
25,200
c194427d547f5d0c5815da7034ae9927428dde34
Add optional orgID to dashboards getAll
[ { "change_type": "MODIFY", "old_path": "src/wrappers/dashboards.ts", "new_path": "src/wrappers/dashboards.ts", "diff": "@@ -43,19 +43,7 @@ export default class {\nreturn addDefaults(data)\n}\n- public async getAll(): Promise<IDashboard[]> {\n- const {data} = await this.service.dashboardsGet(undefined)\n-\n- return addDefaultsToAll(data.dashboards || [])\n- }\n-\n- public async getAllByOrg(org: string): Promise<IDashboard[]> {\n- const {data} = await this.service.dashboardsGet(org)\n-\n- return addDefaultsToAll(data.dashboards || [])\n- }\n-\n- public async getAllByOrgID(orgID: string): Promise<IDashboard[]> {\n+ public async getAll(orgID?: string): Promise<IDashboard[]> {\nconst {data} = await this.service.dashboardsGet(\nundefined,\nundefined,\n@@ -67,6 +55,12 @@ export default class {\nreturn addDefaultsToAll(data.dashboards || [])\n}\n+ public async getAllByOrg(org: string): Promise<IDashboard[]> {\n+ const {data} = await this.service.dashboardsGet(org)\n+\n+ return addDefaultsToAll(data.dashboards || [])\n+ }\n+\npublic async create(props: CreateDashboardRequest): Promise<IDashboard> {\nconst {data} = await this.service.dashboardsPost(props)\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add optional orgID to dashboards getAll
305,166
03.04.2019 21:13:01
14,400
85c9df22cb5a892c0aafd8145ed40c86a7bf6e7a
fix(wrappers/vars.getall): return IVar array
[ { "change_type": "MODIFY", "old_path": "src/wrappers/variables.ts", "new_path": "src/wrappers/variables.ts", "diff": "@@ -44,7 +44,7 @@ export default class {\nreturn (variables || []).map(v => addDefaults(v))\n}\n- public async getAll(orgID?: string): Promise<Variable[]> {\n+ public async getAll(orgID?: string): Promise<IVariable[]> {\nconst {\ndata: {variables},\n} = await this.service.variablesGet(undefined, undefined, orgID)\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
fix(wrappers/vars.getall): return IVar array
305,164
04.04.2019 10:55:24
25,200
7e2ce5cb2be398a0966de8fb7c7e89b02371d9ab
Update client from swagger Remove protos Add orgIDs to getALL
[ { "change_type": "MODIFY", "old_path": "src/api/api.ts", "new_path": "src/api/api.ts", "diff": "@@ -902,20 +902,6 @@ export interface CreateDashboardRequest {\ndescription?: string;\n}\n-/**\n- *\n- * @export\n- * @interface CreateProtoResourcesRequest\n- */\n-export interface CreateProtoResourcesRequest {\n- /**\n- *\n- * @type {string}\n- * @memberof CreateProtoResourcesRequest\n- */\n- orgID?: string;\n-}\n-\n/**\n*\n* @export\n@@ -2869,72 +2855,6 @@ export interface Property {\nexport interface PropertyKey {\n}\n-/**\n- *\n- * @export\n- * @interface Proto\n- */\n-export interface Proto {\n- /**\n- *\n- * @type {ProtoLinks}\n- * @memberof Proto\n- */\n- links?: ProtoLinks;\n- /**\n- *\n- * @type {string}\n- * @memberof Proto\n- */\n- id?: string;\n- /**\n- * user-facing name of the proto\n- * @type {string}\n- * @memberof Proto\n- */\n- name?: string;\n- /**\n- *\n- * @type {Array<Dashboard>}\n- * @memberof Proto\n- */\n- dashboards?: Array<Dashboard>;\n- /**\n- *\n- * @type {{ [key: string]: View; }}\n- * @memberof Proto\n- */\n- views?: { [key: string]: View; };\n-}\n-\n-/**\n- *\n- * @export\n- * @interface ProtoLinks\n- */\n-export interface ProtoLinks {\n- /**\n- *\n- * @type {string}\n- * @memberof ProtoLinks\n- */\n- dashboard?: string;\n-}\n-\n-/**\n- *\n- * @export\n- * @interface Protos\n- */\n-export interface Protos {\n- /**\n- *\n- * @type {Array<Proto>}\n- * @memberof Protos\n- */\n- protos?: Array<Proto>;\n-}\n-\n/**\n* query influx with specified return formatting. The spec and query fields are mutually exclusive.\n* @export\n@@ -3522,12 +3442,6 @@ export interface Routes {\n* @memberof Routes\n*/\norgs?: string;\n- /**\n- *\n- * @type {string}\n- * @memberof Routes\n- */\n- protos?: string;\n/**\n*\n* @type {RoutesQuery}\n@@ -6234,6 +6148,12 @@ export interface Variable {\n* @memberof Variable\n*/\nname: string;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof Variable\n+ */\n+ description?: string;\n/**\n*\n* @type {Array<string>}\n@@ -11044,10 +10964,16 @@ export const LabelsApiAxiosParamCreator = function (configuration?: Configuratio\n/**\n*\n* @summary Get all labels\n+ * @param {string} orgID specifies the organization of the resource\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- labelsGet(options: any = {}): RequestArgs {\n+ labelsGet(orgID: string, zapTraceSpan?: string, options: any = {}): RequestArgs {\n+ // verify required parameter 'orgID' is not null or undefined\n+ if (orgID === null || orgID === undefined) {\n+ throw new RequiredError('orgID','Required parameter orgID was null or undefined when calling labelsGet.');\n+ }\nconst localVarPath = `/labels`;\nconst localVarUrlObj = url.parse(localVarPath, true);\nlet baseOptions;\n@@ -11058,6 +10984,14 @@ export const LabelsApiAxiosParamCreator = function (configuration?: Configuratio\nconst localVarHeaderParameter = {} as any;\nconst localVarQueryParameter = {} as any;\n+ if (orgID !== undefined) {\n+ localVarQueryParameter['orgID'] = orgID;\n+ }\n+\n+ if (zapTraceSpan !== undefined && zapTraceSpan !== null) {\n+ localVarHeaderParameter['Zap-Trace-Span'] = String(zapTraceSpan);\n+ }\n+\nlocalVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);\n// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943\ndelete localVarUrlObj.search;\n@@ -11239,11 +11173,13 @@ export const LabelsApiFp = function(configuration?: Configuration) {\n/**\n*\n* @summary Get all labels\n+ * @param {string} orgID specifies the organization of the resource\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- labelsGet(options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<LabelsResponse> {\n- const localVarAxiosArgs = LabelsApiAxiosParamCreator(configuration).labelsGet(options);\n+ labelsGet(orgID: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<LabelsResponse> {\n+ const localVarAxiosArgs = LabelsApiAxiosParamCreator(configuration).labelsGet(orgID, zapTraceSpan, options);\nreturn (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\nconst axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\nreturn axios.request(axiosRequestArgs);\n@@ -11321,11 +11257,13 @@ export const LabelsApiFactory = function (configuration?: Configuration, basePat\n/**\n*\n* @summary Get all labels\n+ * @param {string} orgID specifies the organization of the resource\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- labelsGet(options?: any) {\n- return LabelsApiFp(configuration).labelsGet(options)(axios, basePath);\n+ labelsGet(orgID: string, zapTraceSpan?: string, options?: any) {\n+ return LabelsApiFp(configuration).labelsGet(orgID, zapTraceSpan, options)(axios, basePath);\n},\n/**\n*\n@@ -11384,12 +11322,14 @@ export class LabelsApi extends BaseAPI {\n/**\n*\n* @summary Get all labels\n+ * @param {string} orgID specifies the organization of the resource\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n* @memberof LabelsApi\n*/\n- public labelsGet(options?: any) {\n- return LabelsApiFp(this.configuration).labelsGet(options)(this.axios, this.basePath);\n+ public labelsGet(orgID: string, zapTraceSpan?: string, options?: any) {\n+ return LabelsApiFp(this.configuration).labelsGet(orgID, zapTraceSpan, options)(this.axios, this.basePath);\n}\n/**\n@@ -13401,199 +13341,6 @@ export class OrganizationsApi extends BaseAPI {\n}\n-/**\n- * ProtosApi - axios parameter creator\n- * @export\n- */\n-export const ProtosApiAxiosParamCreator = function (configuration?: Configuration) {\n- return {\n- /**\n- *\n- * @summary List of available protos (templates of tasks/dashboards/etc)\n- * @param {string} [zapTraceSpan] OpenTracing span context\n- * @param {*} [options] Override http request option.\n- * @throws {RequiredError}\n- */\n- protosGet(zapTraceSpan?: string, options: any = {}): RequestArgs {\n- const localVarPath = `/protos`;\n- const localVarUrlObj = url.parse(localVarPath, true);\n- let baseOptions;\n- if (configuration) {\n- baseOptions = configuration.baseOptions;\n- }\n- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions, options);\n- const localVarHeaderParameter = {} as any;\n- const localVarQueryParameter = {} as any;\n-\n- if (zapTraceSpan !== undefined && zapTraceSpan !== null) {\n- localVarHeaderParameter['Zap-Trace-Span'] = String(zapTraceSpan);\n- }\n-\n- localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);\n- // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943\n- delete localVarUrlObj.search;\n- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);\n-\n- return {\n- url: url.format(localVarUrlObj),\n- options: localVarRequestOptions,\n- };\n- },\n- /**\n- *\n- * @summary Create instance of a proto dashboard\n- * @param {string} protoID ID of proto\n- * @param {CreateProtoResourcesRequest} createProtoResourcesRequest organization that the dashboard will be created as\n- * @param {string} [zapTraceSpan] OpenTracing span context\n- * @param {*} [options] Override http request option.\n- * @throws {RequiredError}\n- */\n- protosProtoIDDashboardsPost(protoID: string, createProtoResourcesRequest: CreateProtoResourcesRequest, zapTraceSpan?: string, options: any = {}): RequestArgs {\n- // verify required parameter 'protoID' is not null or undefined\n- if (protoID === null || protoID === undefined) {\n- throw new RequiredError('protoID','Required parameter protoID was null or undefined when calling protosProtoIDDashboardsPost.');\n- }\n- // verify required parameter 'createProtoResourcesRequest' is not null or undefined\n- if (createProtoResourcesRequest === null || createProtoResourcesRequest === undefined) {\n- throw new RequiredError('createProtoResourcesRequest','Required parameter createProtoResourcesRequest was null or undefined when calling protosProtoIDDashboardsPost.');\n- }\n- const localVarPath = `/protos/{protoID}/dashboards`\n- .replace(`{${\"protoID\"}}`, encodeURIComponent(String(protoID)));\n- const localVarUrlObj = url.parse(localVarPath, true);\n- let baseOptions;\n- if (configuration) {\n- baseOptions = configuration.baseOptions;\n- }\n- const localVarRequestOptions = Object.assign({ method: 'POST' }, baseOptions, options);\n- const localVarHeaderParameter = {} as any;\n- const localVarQueryParameter = {} as any;\n-\n- if (zapTraceSpan !== undefined && zapTraceSpan !== null) {\n- localVarHeaderParameter['Zap-Trace-Span'] = String(zapTraceSpan);\n- }\n-\n- localVarHeaderParameter['Content-Type'] = 'application/json';\n-\n- localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);\n- // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943\n- delete localVarUrlObj.search;\n- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);\n- const needsSerialization = (<any>\"CreateProtoResourcesRequest\" !== \"string\") || localVarRequestOptions.headers['Content-Type'] === 'application/json';\n- localVarRequestOptions.data = needsSerialization ? JSON.stringify(createProtoResourcesRequest || {}) : (createProtoResourcesRequest || \"\");\n-\n- return {\n- url: url.format(localVarUrlObj),\n- options: localVarRequestOptions,\n- };\n- },\n- }\n-};\n-\n-/**\n- * ProtosApi - functional programming interface\n- * @export\n- */\n-export const ProtosApiFp = function(configuration?: Configuration) {\n- return {\n- /**\n- *\n- * @summary List of available protos (templates of tasks/dashboards/etc)\n- * @param {string} [zapTraceSpan] OpenTracing span context\n- * @param {*} [options] Override http request option.\n- * @throws {RequiredError}\n- */\n- protosGet(zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Protos> {\n- const localVarAxiosArgs = ProtosApiAxiosParamCreator(configuration).protosGet(zapTraceSpan, options);\n- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\n- const axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\n- return axios.request(axiosRequestArgs);\n- };\n- },\n- /**\n- *\n- * @summary Create instance of a proto dashboard\n- * @param {string} protoID ID of proto\n- * @param {CreateProtoResourcesRequest} createProtoResourcesRequest organization that the dashboard will be created as\n- * @param {string} [zapTraceSpan] OpenTracing span context\n- * @param {*} [options] Override http request option.\n- * @throws {RequiredError}\n- */\n- protosProtoIDDashboardsPost(protoID: string, createProtoResourcesRequest: CreateProtoResourcesRequest, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Dashboards> {\n- const localVarAxiosArgs = ProtosApiAxiosParamCreator(configuration).protosProtoIDDashboardsPost(protoID, createProtoResourcesRequest, zapTraceSpan, options);\n- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\n- const axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\n- return axios.request(axiosRequestArgs);\n- };\n- },\n- }\n-};\n-\n-/**\n- * ProtosApi - factory interface\n- * @export\n- */\n-export const ProtosApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {\n- return {\n- /**\n- *\n- * @summary List of available protos (templates of tasks/dashboards/etc)\n- * @param {string} [zapTraceSpan] OpenTracing span context\n- * @param {*} [options] Override http request option.\n- * @throws {RequiredError}\n- */\n- protosGet(zapTraceSpan?: string, options?: any) {\n- return ProtosApiFp(configuration).protosGet(zapTraceSpan, options)(axios, basePath);\n- },\n- /**\n- *\n- * @summary Create instance of a proto dashboard\n- * @param {string} protoID ID of proto\n- * @param {CreateProtoResourcesRequest} createProtoResourcesRequest organization that the dashboard will be created as\n- * @param {string} [zapTraceSpan] OpenTracing span context\n- * @param {*} [options] Override http request option.\n- * @throws {RequiredError}\n- */\n- protosProtoIDDashboardsPost(protoID: string, createProtoResourcesRequest: CreateProtoResourcesRequest, zapTraceSpan?: string, options?: any) {\n- return ProtosApiFp(configuration).protosProtoIDDashboardsPost(protoID, createProtoResourcesRequest, zapTraceSpan, options)(axios, basePath);\n- },\n- };\n-};\n-\n-/**\n- * ProtosApi - object-oriented interface\n- * @export\n- * @class ProtosApi\n- * @extends {BaseAPI}\n- */\n-export class ProtosApi extends BaseAPI {\n- /**\n- *\n- * @summary List of available protos (templates of tasks/dashboards/etc)\n- * @param {string} [zapTraceSpan] OpenTracing span context\n- * @param {*} [options] Override http request option.\n- * @throws {RequiredError}\n- * @memberof ProtosApi\n- */\n- public protosGet(zapTraceSpan?: string, options?: any) {\n- return ProtosApiFp(this.configuration).protosGet(zapTraceSpan, options)(this.axios, this.basePath);\n- }\n-\n- /**\n- *\n- * @summary Create instance of a proto dashboard\n- * @param {string} protoID ID of proto\n- * @param {CreateProtoResourcesRequest} createProtoResourcesRequest organization that the dashboard will be created as\n- * @param {string} [zapTraceSpan] OpenTracing span context\n- * @param {*} [options] Override http request option.\n- * @throws {RequiredError}\n- * @memberof ProtosApi\n- */\n- public protosProtoIDDashboardsPost(protoID: string, createProtoResourcesRequest: CreateProtoResourcesRequest, zapTraceSpan?: string, options?: any) {\n- return ProtosApiFp(this.configuration).protosProtoIDDashboardsPost(protoID, createProtoResourcesRequest, zapTraceSpan, options)(this.axios, this.basePath);\n- }\n-\n-}\n-\n/**\n* QueryApi - axios parameter creator\n* @export\n@@ -14224,10 +13971,16 @@ export const ScraperTargetsApiAxiosParamCreator = function (configuration?: Conf\n/**\n*\n* @summary get all scraper targets\n+ * @param {string} orgID specifies the organization of the resource\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- scrapersGet(options: any = {}): RequestArgs {\n+ scrapersGet(orgID: string, zapTraceSpan?: string, options: any = {}): RequestArgs {\n+ // verify required parameter 'orgID' is not null or undefined\n+ if (orgID === null || orgID === undefined) {\n+ throw new RequiredError('orgID','Required parameter orgID was null or undefined when calling scrapersGet.');\n+ }\nconst localVarPath = `/scrapers`;\nconst localVarUrlObj = url.parse(localVarPath, true);\nlet baseOptions;\n@@ -14238,6 +13991,14 @@ export const ScraperTargetsApiAxiosParamCreator = function (configuration?: Conf\nconst localVarHeaderParameter = {} as any;\nconst localVarQueryParameter = {} as any;\n+ if (orgID !== undefined) {\n+ localVarQueryParameter['orgID'] = orgID;\n+ }\n+\n+ if (zapTraceSpan !== undefined && zapTraceSpan !== null) {\n+ localVarHeaderParameter['Zap-Trace-Span'] = String(zapTraceSpan);\n+ }\n+\nlocalVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);\n// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943\ndelete localVarUrlObj.search;\n@@ -14821,11 +14582,13 @@ export const ScraperTargetsApiFp = function(configuration?: Configuration) {\n/**\n*\n* @summary get all scraper targets\n+ * @param {string} orgID specifies the organization of the resource\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- scrapersGet(options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<ScraperTargetResponses> {\n- const localVarAxiosArgs = ScraperTargetsApiAxiosParamCreator(configuration).scrapersGet(options);\n+ scrapersGet(orgID: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<ScraperTargetResponses> {\n+ const localVarAxiosArgs = ScraperTargetsApiAxiosParamCreator(configuration).scrapersGet(orgID, zapTraceSpan, options);\nreturn (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\nconst axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\nreturn axios.request(axiosRequestArgs);\n@@ -15046,11 +14809,13 @@ export const ScraperTargetsApiFactory = function (configuration?: Configuration,\n/**\n*\n* @summary get all scraper targets\n+ * @param {string} orgID specifies the organization of the resource\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- scrapersGet(options?: any) {\n- return ScraperTargetsApiFp(configuration).scrapersGet(options)(axios, basePath);\n+ scrapersGet(orgID: string, zapTraceSpan?: string, options?: any) {\n+ return ScraperTargetsApiFp(configuration).scrapersGet(orgID, zapTraceSpan, options)(axios, basePath);\n},\n/**\n*\n@@ -15216,12 +14981,14 @@ export class ScraperTargetsApi extends BaseAPI {\n/**\n*\n* @summary get all scraper targets\n+ * @param {string} orgID specifies the organization of the resource\n+ * @param {string} [zapTraceSpan] OpenTracing span context\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n* @memberof ScraperTargetsApi\n*/\n- public scrapersGet(options?: any) {\n- return ScraperTargetsApiFp(this.configuration).scrapersGet(options)(this.axios, this.basePath);\n+ public scrapersGet(orgID: string, zapTraceSpan?: string, options?: any) {\n+ return ScraperTargetsApiFp(this.configuration).scrapersGet(orgID, zapTraceSpan, options)(this.axios, this.basePath);\n}\n/**\n" }, { "change_type": "MODIFY", "old_path": "src/index.ts", "new_path": "src/index.ts", "diff": "@@ -5,7 +5,6 @@ import Dashboards from './wrappers/dashboards'\nimport Labels from './wrappers/labels'\nimport Links from './wrappers/links'\nimport Organizations from './wrappers/organizations'\n-import Protos from './wrappers/protos'\nimport Queries from './wrappers/queries'\nimport Scrapers from './wrappers/scrapers'\nimport Setup from './wrappers/setup'\n@@ -28,7 +27,6 @@ export default class Client {\npublic labels: Labels\npublic links: Links\npublic organizations: Organizations\n- public protos: Protos\npublic queries: Queries\npublic scrapers: Scrapers\npublic setup: Setup\n@@ -48,7 +46,6 @@ export default class Client {\nthis.labels = new Labels(basePath)\nthis.links = new Links(basePath)\nthis.organizations = new Organizations(basePath)\n- this.protos = new Protos(basePath)\nthis.queries = new Queries(basePath)\nthis.scrapers = new Scrapers(basePath)\nthis.setup = new Setup(basePath)\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/dashboards.ts", "new_path": "src/wrappers/dashboards.ts", "diff": "@@ -4,7 +4,6 @@ import {\nCreateDashboardRequest,\nDashboard,\nDashboardsApi,\n- ProtosApi,\nView,\n} from '../api'\nimport {IDashboard, ILabel} from '../types'\n@@ -29,11 +28,9 @@ const addDefaultsToAll = (dashboards: Dashboard[]): IDashboard[] => {\nexport default class {\nprivate service: DashboardsApi\nprivate cellsService: CellsApi\n- private protosService: ProtosApi\nconstructor(basePath: string) {\nthis.cellsService = new CellsApi({basePath})\n- this.protosService = new ProtosApi({basePath})\nthis.service = new DashboardsApi({basePath})\n}\n@@ -86,24 +83,6 @@ export default class {\nreturn data\n}\n- public async createFromProto(\n- protoID: string,\n- orgID?: string\n- ): Promise<IDashboard[]> {\n- let request = {}\n-\n- if (orgID) {\n- request = {orgID}\n- }\n-\n- const {data} = await this.protosService.protosProtoIDDashboardsPost(\n- protoID,\n- request\n- )\n-\n- return addDefaultsToAll(data.dashboards || [])\n- }\n-\npublic async deleteCell(\ndashboardID: string,\ncellID: string\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/labels.ts", "new_path": "src/wrappers/labels.ts", "diff": "@@ -34,10 +34,10 @@ export default class {\nreturn addLabelDefaults(label)\n}\n- public async getAll(): Promise<ILabel[]> {\n+ public async getAll(orgID: string): Promise<ILabel[]> {\nconst {\ndata: {labels},\n- } = await this.service.labelsGet()\n+ } = await this.service.labelsGet(orgID)\nreturn (labels || []).map(addLabelDefaults)\n}\n" }, { "change_type": "DELETE", "old_path": "src/wrappers/protos.ts", "new_path": null, "diff": "-import {Proto, ProtosApi} from '../api'\n-\n-export default class {\n- private service: ProtosApi\n-\n- constructor(basePath: string) {\n- this.service = new ProtosApi({basePath})\n- }\n-\n- public async getAll(): Promise<Proto[]> {\n- const {data} = await this.service.protosGet()\n-\n- return data.protos || []\n- }\n-}\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/scrapers.ts", "new_path": "src/wrappers/scrapers.ts", "diff": "@@ -11,10 +11,10 @@ export default class {\nthis.service = new ScraperTargetsApi({basePath})\n}\n- public async getAll(): Promise<ScraperTargetResponse[]> {\n+ public async getAll(orgID: string): Promise<ScraperTargetResponse[]> {\nconst {\ndata: {configurations},\n- } = await this.service.scrapersGet()\n+ } = await this.service.scrapersGet(orgID)\nreturn configurations || []\n}\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/telegrafConfigs.ts", "new_path": "src/wrappers/telegrafConfigs.ts", "diff": "@@ -20,10 +20,10 @@ export default class {\nthis.service = new TelegrafsApi({basePath})\n}\n- public async getAll(): Promise<ITelegraf[]> {\n+ public async getAll(orgID: string = ''): Promise<ITelegraf[]> {\nconst {\ndata: {configurations},\n- } = await this.service.telegrafsGet('')\n+ } = await this.service.telegrafsGet(orgID)\nreturn addDefaultsToAll(configurations || [])\n}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Update client from swagger - Remove protos - Add orgIDs to getALL
305,161
05.04.2019 14:22:57
25,200
4ab67a3e238dc479fa6fef1bf384b7618b8b30bc
add orgID to templates getAll
[ { "change_type": "MODIFY", "old_path": "src/api/api.ts", "new_path": "src/api/api.ts", "diff": "@@ -19185,16 +19185,13 @@ export const TemplatesApiAxiosParamCreator = function (configuration?: Configura\nreturn {\n/**\n*\n- * @param {string} org specifies the name of the organization of the template\n* @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {string} [org] specifies the name of the organization of the template\n+ * @param {string} [orgID] specifies the organization id of the template\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- documentsTemplatesGet(org: string, zapTraceSpan?: string, options: any = {}): RequestArgs {\n- // verify required parameter 'org' is not null or undefined\n- if (org === null || org === undefined) {\n- throw new RequiredError('org','Required parameter org was null or undefined when calling documentsTemplatesGet.');\n- }\n+ documentsTemplatesGet(zapTraceSpan?: string, org?: string, orgID?: string, options: any = {}): RequestArgs {\nconst localVarPath = `/documents/templates`;\nconst localVarUrlObj = url.parse(localVarPath, true);\nlet baseOptions;\n@@ -19209,6 +19206,10 @@ export const TemplatesApiAxiosParamCreator = function (configuration?: Configura\nlocalVarQueryParameter['org'] = org;\n}\n+ if (orgID !== undefined) {\n+ localVarQueryParameter['orgID'] = orgID;\n+ }\n+\nif (zapTraceSpan !== undefined && zapTraceSpan !== null) {\nlocalVarHeaderParameter['Zap-Trace-Span'] = String(zapTraceSpan);\n}\n@@ -19396,13 +19397,14 @@ export const TemplatesApiFp = function(configuration?: Configuration) {\nreturn {\n/**\n*\n- * @param {string} org specifies the name of the organization of the template\n* @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {string} [org] specifies the name of the organization of the template\n+ * @param {string} [orgID] specifies the organization id of the template\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- documentsTemplatesGet(org: string, zapTraceSpan?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Documents> {\n- const localVarAxiosArgs = TemplatesApiAxiosParamCreator(configuration).documentsTemplatesGet(org, zapTraceSpan, options);\n+ documentsTemplatesGet(zapTraceSpan?: string, org?: string, orgID?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Documents> {\n+ const localVarAxiosArgs = TemplatesApiAxiosParamCreator(configuration).documentsTemplatesGet(zapTraceSpan, org, orgID, options);\nreturn (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\nconst axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\nreturn axios.request(axiosRequestArgs);\n@@ -19478,13 +19480,14 @@ export const TemplatesApiFactory = function (configuration?: Configuration, base\nreturn {\n/**\n*\n- * @param {string} org specifies the name of the organization of the template\n* @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {string} [org] specifies the name of the organization of the template\n+ * @param {string} [orgID] specifies the organization id of the template\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- documentsTemplatesGet(org: string, zapTraceSpan?: string, options?: any) {\n- return TemplatesApiFp(configuration).documentsTemplatesGet(org, zapTraceSpan, options)(axios, basePath);\n+ documentsTemplatesGet(zapTraceSpan?: string, org?: string, orgID?: string, options?: any) {\n+ return TemplatesApiFp(configuration).documentsTemplatesGet(zapTraceSpan, org, orgID, options)(axios, basePath);\n},\n/**\n*\n@@ -19541,14 +19544,15 @@ export const TemplatesApiFactory = function (configuration?: Configuration, base\nexport class TemplatesApi extends BaseAPI {\n/**\n*\n- * @param {string} org specifies the name of the organization of the template\n* @param {string} [zapTraceSpan] OpenTracing span context\n+ * @param {string} [org] specifies the name of the organization of the template\n+ * @param {string} [orgID] specifies the organization id of the template\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n* @memberof TemplatesApi\n*/\n- public documentsTemplatesGet(org: string, zapTraceSpan?: string, options?: any) {\n- return TemplatesApiFp(this.configuration).documentsTemplatesGet(org, zapTraceSpan, options)(this.axios, this.basePath);\n+ public documentsTemplatesGet(zapTraceSpan?: string, org?: string, orgID?: string, options?: any) {\n+ return TemplatesApiFp(this.configuration).documentsTemplatesGet(zapTraceSpan, org, orgID, options)(this.axios, this.basePath);\n}\n/**\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/templates.ts", "new_path": "src/wrappers/templates.ts", "diff": "@@ -26,8 +26,12 @@ export default class {\nthis.service = new TemplatesApi({basePath})\n}\n- public async getAll(orgName: string): Promise<TemplateSummary[]> {\n- const {data} = await this.service.documentsTemplatesGet(orgName)\n+ public async getAll(orgID?: string): Promise<TemplateSummary[]> {\n+ const {data} = await this.service.documentsTemplatesGet(\n+ undefined,\n+ undefined,\n+ orgID\n+ )\nif (data.documents) {\nreturn data.documents.map(addTemplateSummaryDefaults)\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
add orgID to templates getAll
305,172
08.04.2019 15:31:02
25,200
9a3111fca617bf3c19aa4904cd47a197b7d59ea9
chore(dashboards): clone takes an orgID
[ { "change_type": "MODIFY", "old_path": "dist/wrappers/dashboards.d.ts", "new_path": "dist/wrappers/dashboards.d.ts", "diff": "@@ -19,7 +19,7 @@ export default class {\nremoveLabels(dashboardID: string, labelIDs: string[]): Promise<Response[]>;\ngetView(dashboardID: string, cellID: string): Promise<View>;\nupdateView(dashboardID: string, cellID: string, view: Partial<View>): Promise<View>;\n- clone(dashboardID: string, cloneName: string): Promise<IDashboard | null>;\n+ clone(dashboardID: string, cloneName: string, orgID: string): Promise<IDashboard | null>;\nprivate cloneLabels;\nprivate cloneViews;\n}\n" }, { "change_type": "MODIFY", "old_path": "dist/wrappers/dashboards.js", "new_path": "dist/wrappers/dashboards.js", "diff": "@@ -278,15 +278,15 @@ var default_1 = (function () {\n});\n});\n};\n- default_1.prototype.clone = function (dashboardID, cloneName) {\n+ default_1.prototype.clone = function (dashboardID, cloneName, orgID) {\nreturn __awaiter(this, void 0, void 0, function () {\n- var original, name, description, orgID, dashboardWithoutCells, createdDashboard;\n+ var original, name, description, dashboardWithoutCells, createdDashboard;\nreturn __generator(this, function (_a) {\nswitch (_a.label) {\ncase 0: return [4, this.get(dashboardID)];\ncase 1:\noriginal = _a.sent();\n- name = original.name, description = original.description, orgID = original.orgID;\n+ name = original.name, description = original.description;\ndashboardWithoutCells = { name: name, description: description, orgID: orgID };\nreturn [4, this.create(__assign({}, dashboardWithoutCells, { name: cloneName }))];\ncase 2:\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/dashboards.ts", "new_path": "src/wrappers/dashboards.ts", "diff": "@@ -199,11 +199,12 @@ export default class {\npublic async clone(\ndashboardID: string,\n- cloneName: string\n+ cloneName: string,\n+ orgID: string\n): Promise<IDashboard | null> {\nconst original = await this.get(dashboardID)\n- const {name, description, orgID} = original\n+ const {name, description} = original\nconst dashboardWithoutCells = {name, description, orgID}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
chore(dashboards): clone takes an orgID
305,166
10.04.2019 15:53:21
14,400
e105b07e72f40c8a48557f193f2f91a404a79bf5
fix(types/template): add variabletemplate
[ { "change_type": "MODIFY", "old_path": "dist/types/index.d.ts", "new_path": "dist/types/index.d.ts", "diff": "@@ -108,6 +108,7 @@ export interface IVariableIncluded extends ITemplateIncluded {\n}\nexport declare type ITaskTemplateIncluded = ILabelIncluded;\nexport declare type IDashboardTemplateIncluded = ICellIncluded | IViewIncluded | ILabelIncluded | IVariableIncluded;\n+export declare type IVariableTemplateIncluded = IVariableIncluded | ILabelIncluded;\ninterface ITaskTemplateData extends ITemplateData {\ntype: TemplateType.Task;\nattributes: {\n@@ -135,6 +136,18 @@ interface IDashboardTemplateData extends ITemplateData {\n};\n};\n}\n+interface VariableTemplateData extends ITemplateData {\n+ type: TemplateType.Variable;\n+ attributes: Omit<Variable, 'labels' | 'links'>;\n+ relationships: {\n+ [TemplateType.Label]: {\n+ data: ILabelRelationship[];\n+ };\n+ [TemplateType.Variable]: {\n+ data: IVariableRelationship[];\n+ };\n+ };\n+}\nexport interface ITaskTemplate extends ITemplateBase {\ncontent: {\ndata: ITaskTemplateData;\n@@ -147,8 +160,15 @@ export interface IDashboardTemplate extends ITemplateBase {\nincluded: IDashboardTemplateIncluded[];\n};\n}\n-export declare type ITemplate = ITaskTemplate | IDashboardTemplate;\n+export interface IVariableTemplate extends ITemplateBase {\n+ content: {\n+ data: VariableTemplateData;\n+ included: IVariableTemplateIncluded[];\n+ };\n+}\n+export declare type ITemplate = ITaskTemplate | IDashboardTemplate | IVariableTemplate;\nexport interface TemplateSummary extends DocumentListEntry {\nlabels: ILabel[];\n}\n+declare type Omit<K, V> = Pick<K, Exclude<keyof K, V>>;\nexport {};\n" }, { "change_type": "MODIFY", "old_path": "src/types/index.ts", "new_path": "src/types/index.ts", "diff": "@@ -148,6 +148,8 @@ export type IDashboardTemplateIncluded =\n| ILabelIncluded\n| IVariableIncluded\n+export type IVariableTemplateIncluded = IVariableIncluded | ILabelIncluded\n+\n// Template Datas\ninterface ITaskTemplateData extends ITemplateData {\ntype: TemplateType.Task\n@@ -167,6 +169,15 @@ interface IDashboardTemplateData extends ITemplateData {\n}\n}\n+interface VariableTemplateData extends ITemplateData {\n+ type: TemplateType.Variable\n+ attributes: Omit<Variable, 'labels' | 'links'>\n+ relationships: {\n+ [TemplateType.Label]: {data: ILabelRelationship[]}\n+ [TemplateType.Variable]: {data: IVariableRelationship[]}\n+ }\n+}\n+\n// Templates\nexport interface ITaskTemplate extends ITemplateBase {\ncontent: {\n@@ -182,8 +193,17 @@ export interface IDashboardTemplate extends ITemplateBase {\n}\n}\n-export type ITemplate = ITaskTemplate | IDashboardTemplate\n+export interface IVariableTemplate extends ITemplateBase {\n+ content: {\n+ data: VariableTemplateData\n+ included: IVariableTemplateIncluded[]\n+ }\n+}\n+\n+export type ITemplate = ITaskTemplate | IDashboardTemplate | IVariableTemplate\nexport interface TemplateSummary extends DocumentListEntry {\nlabels: ILabel[]\n}\n+\n+type Omit<K, V> = Pick<K, Exclude<keyof K, V>>\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
fix(types/template): add variabletemplate
305,161
12.04.2019 17:18:39
25,200
e18eca8e3510d7372919d105a81b97ae069208d1
Add orgID to tasks getAll
[ { "change_type": "MODIFY", "old_path": "dist/wrappers/tasks.d.ts", "new_path": "dist/wrappers/tasks.d.ts", "diff": "@@ -6,9 +6,8 @@ export default class {\ncreate(org: string, script: string): Promise<ITask>;\ncreateByOrgID(orgID: string, script: string): Promise<ITask>;\nget(id: string): Promise<ITask>;\n- getAll(): Promise<ITask[]>;\n+ getAll(orgID?: string): Promise<ITask[]>;\ngetAllByOrg(org: string): Promise<ITask[]>;\n- getAllByOrgID(orgID: string): Promise<ITask[]>;\ngetAllByUser(user: User): Promise<ITask[]>;\nupdate(id: string, updates: Partial<Task>): Promise<ITask>;\nupdateStatus(id: string, status: Task.StatusEnum): Promise<Task>;\n" }, { "change_type": "MODIFY", "old_path": "dist/wrappers/tasks.js", "new_path": "dist/wrappers/tasks.js", "diff": "@@ -97,12 +97,12 @@ var default_1 = (function () {\n});\n});\n};\n- default_1.prototype.getAll = function () {\n+ default_1.prototype.getAll = function (orgID) {\nreturn __awaiter(this, void 0, void 0, function () {\nvar tasks;\nreturn __generator(this, function (_a) {\nswitch (_a.label) {\n- case 0: return [4, this.service.tasksGet()];\n+ case 0: return [4, this.service.tasksGet(undefined, undefined, undefined, undefined, orgID)];\ncase 1:\ntasks = (_a.sent()).data.tasks;\nreturn [2, addDefaultsToAll(tasks || [])];\n@@ -123,19 +123,6 @@ var default_1 = (function () {\n});\n});\n};\n- default_1.prototype.getAllByOrgID = function (orgID) {\n- return __awaiter(this, void 0, void 0, function () {\n- var tasks;\n- return __generator(this, function (_a) {\n- switch (_a.label) {\n- case 0: return [4, this.service.tasksGet(undefined, undefined, undefined, undefined, orgID)];\n- case 1:\n- tasks = (_a.sent()).data.tasks;\n- return [2, addDefaultsToAll(tasks || [])];\n- }\n- });\n- });\n- };\ndefault_1.prototype.getAllByUser = function (user) {\nreturn __awaiter(this, void 0, void 0, function () {\nvar data;\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/tasks.ts", "new_path": "src/wrappers/tasks.ts", "diff": "@@ -37,10 +37,16 @@ export default class {\nreturn addDefaults(data)\n}\n- public async getAll(): Promise<ITask[]> {\n+ public async getAll(orgID?: string): Promise<ITask[]> {\nconst {\ndata: {tasks},\n- } = await this.service.tasksGet()\n+ } = await this.service.tasksGet(\n+ undefined,\n+ undefined,\n+ undefined,\n+ undefined,\n+ orgID\n+ )\nreturn addDefaultsToAll(tasks || [])\n}\n@@ -53,20 +59,6 @@ export default class {\nreturn addDefaultsToAll(tasks || [])\n}\n- public async getAllByOrgID(orgID: string): Promise<ITask[]> {\n- const {\n- data: {tasks},\n- } = await this.service.tasksGet(\n- undefined,\n- undefined,\n- undefined,\n- undefined,\n- orgID\n- )\n-\n- return addDefaultsToAll(tasks || [])\n- }\n-\npublic async getAllByUser(user: User): Promise<ITask[]> {\nconst {data} = await this.service.tasksGet(undefined, undefined, user.id)\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add orgID to tasks getAll
305,161
15.04.2019 10:36:31
25,200
2000c7d03889c447a3c97a57191b32f5fa684fba
Add orgID parameter to getAll authorizations
[ { "change_type": "MODIFY", "old_path": "dist/api/api.d.ts", "new_path": "dist/api/api.d.ts", "diff": "@@ -1445,28 +1445,28 @@ export declare const AuthorizationsApiAxiosParamCreator: (configuration?: Config\nauthorizationsAuthIDDelete(authID: string, zapTraceSpan?: string | undefined, options?: any): RequestArgs;\nauthorizationsAuthIDGet(authID: string, zapTraceSpan?: string | undefined, options?: any): RequestArgs;\nauthorizationsAuthIDPatch(authID: string, authorizationUpdateRequest: AuthorizationUpdateRequest, zapTraceSpan?: string | undefined, options?: any): RequestArgs;\n- authorizationsGet(zapTraceSpan?: string | undefined, userID?: string | undefined, user?: string | undefined, options?: any): RequestArgs;\n+ authorizationsGet(zapTraceSpan?: string | undefined, userID?: string | undefined, user?: string | undefined, orgID?: string | undefined, org?: string | undefined, options?: any): RequestArgs;\nauthorizationsPost(authorization: Authorization, zapTraceSpan?: string | undefined, options?: any): RequestArgs;\n};\nexport declare const AuthorizationsApiFp: (configuration?: Configuration | undefined) => {\nauthorizationsAuthIDDelete(authID: string, zapTraceSpan?: string | undefined, options?: any): (axios?: AxiosInstance | undefined, basePath?: string | undefined) => AxiosPromise<Response>;\nauthorizationsAuthIDGet(authID: string, zapTraceSpan?: string | undefined, options?: any): (axios?: AxiosInstance | undefined, basePath?: string | undefined) => AxiosPromise<Authorization>;\nauthorizationsAuthIDPatch(authID: string, authorizationUpdateRequest: AuthorizationUpdateRequest, zapTraceSpan?: string | undefined, options?: any): (axios?: AxiosInstance | undefined, basePath?: string | undefined) => AxiosPromise<Authorization>;\n- authorizationsGet(zapTraceSpan?: string | undefined, userID?: string | undefined, user?: string | undefined, options?: any): (axios?: AxiosInstance | undefined, basePath?: string | undefined) => AxiosPromise<Authorizations>;\n+ authorizationsGet(zapTraceSpan?: string | undefined, userID?: string | undefined, user?: string | undefined, orgID?: string | undefined, org?: string | undefined, options?: any): (axios?: AxiosInstance | undefined, basePath?: string | undefined) => AxiosPromise<Authorizations>;\nauthorizationsPost(authorization: Authorization, zapTraceSpan?: string | undefined, options?: any): (axios?: AxiosInstance | undefined, basePath?: string | undefined) => AxiosPromise<Authorization>;\n};\nexport declare const AuthorizationsApiFactory: (configuration?: Configuration | undefined, basePath?: string | undefined, axios?: AxiosInstance | undefined) => {\nauthorizationsAuthIDDelete(authID: string, zapTraceSpan?: string | undefined, options?: any): AxiosPromise<Response>;\nauthorizationsAuthIDGet(authID: string, zapTraceSpan?: string | undefined, options?: any): AxiosPromise<Authorization>;\nauthorizationsAuthIDPatch(authID: string, authorizationUpdateRequest: AuthorizationUpdateRequest, zapTraceSpan?: string | undefined, options?: any): AxiosPromise<Authorization>;\n- authorizationsGet(zapTraceSpan?: string | undefined, userID?: string | undefined, user?: string | undefined, options?: any): AxiosPromise<Authorizations>;\n+ authorizationsGet(zapTraceSpan?: string | undefined, userID?: string | undefined, user?: string | undefined, orgID?: string | undefined, org?: string | undefined, options?: any): AxiosPromise<Authorizations>;\nauthorizationsPost(authorization: Authorization, zapTraceSpan?: string | undefined, options?: any): AxiosPromise<Authorization>;\n};\nexport declare class AuthorizationsApi extends BaseAPI {\nauthorizationsAuthIDDelete(authID: string, zapTraceSpan?: string, options?: any): AxiosPromise<Response>;\nauthorizationsAuthIDGet(authID: string, zapTraceSpan?: string, options?: any): AxiosPromise<Authorization>;\nauthorizationsAuthIDPatch(authID: string, authorizationUpdateRequest: AuthorizationUpdateRequest, zapTraceSpan?: string, options?: any): AxiosPromise<Authorization>;\n- authorizationsGet(zapTraceSpan?: string, userID?: string, user?: string, options?: any): AxiosPromise<Authorizations>;\n+ authorizationsGet(zapTraceSpan?: string, userID?: string, user?: string, orgID?: string, org?: string, options?: any): AxiosPromise<Authorizations>;\nauthorizationsPost(authorization: Authorization, zapTraceSpan?: string, options?: any): AxiosPromise<Authorization>;\n}\nexport declare const BucketsApiAxiosParamCreator: (configuration?: Configuration | undefined) => {\n" }, { "change_type": "MODIFY", "old_path": "dist/api/api.js", "new_path": "dist/api/api.js", "diff": "@@ -695,7 +695,7 @@ exports.AuthorizationsApiAxiosParamCreator = function (configuration) {\noptions: localVarRequestOptions,\n};\n},\n- authorizationsGet: function (zapTraceSpan, userID, user, options) {\n+ authorizationsGet: function (zapTraceSpan, userID, user, orgID, org, options) {\nif (options === void 0) { options = {}; }\nvar localVarPath = \"/authorizations\";\nvar localVarUrlObj = url.parse(localVarPath, true);\n@@ -712,6 +712,12 @@ exports.AuthorizationsApiAxiosParamCreator = function (configuration) {\nif (user !== undefined) {\nlocalVarQueryParameter['user'] = user;\n}\n+ if (orgID !== undefined) {\n+ localVarQueryParameter['orgID'] = orgID;\n+ }\n+ if (org !== undefined) {\n+ localVarQueryParameter['org'] = org;\n+ }\nif (zapTraceSpan !== undefined && zapTraceSpan !== null) {\nlocalVarHeaderParameter['Zap-Trace-Span'] = String(zapTraceSpan);\n}\n@@ -782,8 +788,8 @@ exports.AuthorizationsApiFp = function (configuration) {\nreturn axios.request(axiosRequestArgs);\n};\n},\n- authorizationsGet: function (zapTraceSpan, userID, user, options) {\n- var localVarAxiosArgs = exports.AuthorizationsApiAxiosParamCreator(configuration).authorizationsGet(zapTraceSpan, userID, user, options);\n+ authorizationsGet: function (zapTraceSpan, userID, user, orgID, org, options) {\n+ var localVarAxiosArgs = exports.AuthorizationsApiAxiosParamCreator(configuration).authorizationsGet(zapTraceSpan, userID, user, orgID, org, options);\nreturn function (axios, basePath) {\nif (axios === void 0) { axios = axios_1.default; }\nif (basePath === void 0) { basePath = BASE_PATH; }\n@@ -813,8 +819,8 @@ exports.AuthorizationsApiFactory = function (configuration, basePath, axios) {\nauthorizationsAuthIDPatch: function (authID, authorizationUpdateRequest, zapTraceSpan, options) {\nreturn exports.AuthorizationsApiFp(configuration).authorizationsAuthIDPatch(authID, authorizationUpdateRequest, zapTraceSpan, options)(axios, basePath);\n},\n- authorizationsGet: function (zapTraceSpan, userID, user, options) {\n- return exports.AuthorizationsApiFp(configuration).authorizationsGet(zapTraceSpan, userID, user, options)(axios, basePath);\n+ authorizationsGet: function (zapTraceSpan, userID, user, orgID, org, options) {\n+ return exports.AuthorizationsApiFp(configuration).authorizationsGet(zapTraceSpan, userID, user, orgID, org, options)(axios, basePath);\n},\nauthorizationsPost: function (authorization, zapTraceSpan, options) {\nreturn exports.AuthorizationsApiFp(configuration).authorizationsPost(authorization, zapTraceSpan, options)(axios, basePath);\n@@ -835,8 +841,8 @@ var AuthorizationsApi = (function (_super) {\nAuthorizationsApi.prototype.authorizationsAuthIDPatch = function (authID, authorizationUpdateRequest, zapTraceSpan, options) {\nreturn exports.AuthorizationsApiFp(this.configuration).authorizationsAuthIDPatch(authID, authorizationUpdateRequest, zapTraceSpan, options)(this.axios, this.basePath);\n};\n- AuthorizationsApi.prototype.authorizationsGet = function (zapTraceSpan, userID, user, options) {\n- return exports.AuthorizationsApiFp(this.configuration).authorizationsGet(zapTraceSpan, userID, user, options)(this.axios, this.basePath);\n+ AuthorizationsApi.prototype.authorizationsGet = function (zapTraceSpan, userID, user, orgID, org, options) {\n+ return exports.AuthorizationsApiFp(this.configuration).authorizationsGet(zapTraceSpan, userID, user, orgID, org, options)(this.axios, this.basePath);\n};\nAuthorizationsApi.prototype.authorizationsPost = function (authorization, zapTraceSpan, options) {\nreturn exports.AuthorizationsApiFp(this.configuration).authorizationsPost(authorization, zapTraceSpan, options)(this.axios, this.basePath);\n" }, { "change_type": "MODIFY", "old_path": "dist/wrappers/authorizations.d.ts", "new_path": "dist/wrappers/authorizations.d.ts", "diff": "@@ -4,7 +4,7 @@ export default class {\nconstructor(basePath: string);\nget(id: string): Promise<Authorization>;\ngetAuthorizationToken(username: string): Promise<string | null>;\n- getAll(): Promise<Authorization[]>;\n+ getAll(orgID?: string): Promise<Authorization[]>;\ngetAllByUsername(username: string): Promise<Authorization[]>;\ncreate(auth: Authorization): Promise<Authorization>;\nupdate(id: string, update: Partial<Authorization>): Promise<Authorization>;\n" }, { "change_type": "MODIFY", "old_path": "dist/wrappers/authorizations.js", "new_path": "dist/wrappers/authorizations.js", "diff": "@@ -80,12 +80,12 @@ var default_1 = (function () {\n});\n});\n};\n- default_1.prototype.getAll = function () {\n+ default_1.prototype.getAll = function (orgID) {\nreturn __awaiter(this, void 0, void 0, function () {\nvar authorizations;\nreturn __generator(this, function (_a) {\nswitch (_a.label) {\n- case 0: return [4, this.service.authorizationsGet()];\n+ case 0: return [4, this.service.authorizationsGet(undefined, undefined, undefined, orgID)];\ncase 1:\nauthorizations = (_a.sent()).data.authorizations;\nreturn [2, authorizations || []];\n" }, { "change_type": "MODIFY", "old_path": "src/api/api.ts", "new_path": "src/api/api.ts", "diff": "@@ -6402,10 +6402,12 @@ export const AuthorizationsApiAxiosParamCreator = function (configuration?: Conf\n* @param {string} [zapTraceSpan] OpenTracing span context\n* @param {string} [userID] filter authorizations belonging to a user id\n* @param {string} [user] filter authorizations belonging to a user name\n+ * @param {string} [orgID] filter authorizations belonging to a org id\n+ * @param {string} [org] filter authorizations belonging to a org name\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- authorizationsGet(zapTraceSpan?: string, userID?: string, user?: string, options: any = {}): RequestArgs {\n+ authorizationsGet(zapTraceSpan?: string, userID?: string, user?: string, orgID?: string, org?: string, options: any = {}): RequestArgs {\nconst localVarPath = `/authorizations`;\nconst localVarUrlObj = url.parse(localVarPath, true);\nlet baseOptions;\n@@ -6424,6 +6426,14 @@ export const AuthorizationsApiAxiosParamCreator = function (configuration?: Conf\nlocalVarQueryParameter['user'] = user;\n}\n+ if (orgID !== undefined) {\n+ localVarQueryParameter['orgID'] = orgID;\n+ }\n+\n+ if (org !== undefined) {\n+ localVarQueryParameter['org'] = org;\n+ }\n+\nif (zapTraceSpan !== undefined && zapTraceSpan !== null) {\nlocalVarHeaderParameter['Zap-Trace-Span'] = String(zapTraceSpan);\n}\n@@ -6540,11 +6550,13 @@ export const AuthorizationsApiFp = function(configuration?: Configuration) {\n* @param {string} [zapTraceSpan] OpenTracing span context\n* @param {string} [userID] filter authorizations belonging to a user id\n* @param {string} [user] filter authorizations belonging to a user name\n+ * @param {string} [orgID] filter authorizations belonging to a org id\n+ * @param {string} [org] filter authorizations belonging to a org name\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- authorizationsGet(zapTraceSpan?: string, userID?: string, user?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Authorizations> {\n- const localVarAxiosArgs = AuthorizationsApiAxiosParamCreator(configuration).authorizationsGet(zapTraceSpan, userID, user, options);\n+ authorizationsGet(zapTraceSpan?: string, userID?: string, user?: string, orgID?: string, org?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Authorizations> {\n+ const localVarAxiosArgs = AuthorizationsApiAxiosParamCreator(configuration).authorizationsGet(zapTraceSpan, userID, user, orgID, org, options);\nreturn (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {\nconst axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})\nreturn axios.request(axiosRequestArgs);\n@@ -6614,11 +6626,13 @@ export const AuthorizationsApiFactory = function (configuration?: Configuration,\n* @param {string} [zapTraceSpan] OpenTracing span context\n* @param {string} [userID] filter authorizations belonging to a user id\n* @param {string} [user] filter authorizations belonging to a user name\n+ * @param {string} [orgID] filter authorizations belonging to a org id\n+ * @param {string} [org] filter authorizations belonging to a org name\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n*/\n- authorizationsGet(zapTraceSpan?: string, userID?: string, user?: string, options?: any) {\n- return AuthorizationsApiFp(configuration).authorizationsGet(zapTraceSpan, userID, user, options)(axios, basePath);\n+ authorizationsGet(zapTraceSpan?: string, userID?: string, user?: string, orgID?: string, org?: string, options?: any) {\n+ return AuthorizationsApiFp(configuration).authorizationsGet(zapTraceSpan, userID, user, orgID, org, options)(axios, basePath);\n},\n/**\n*\n@@ -6687,12 +6701,14 @@ export class AuthorizationsApi extends BaseAPI {\n* @param {string} [zapTraceSpan] OpenTracing span context\n* @param {string} [userID] filter authorizations belonging to a user id\n* @param {string} [user] filter authorizations belonging to a user name\n+ * @param {string} [orgID] filter authorizations belonging to a org id\n+ * @param {string} [org] filter authorizations belonging to a org name\n* @param {*} [options] Override http request option.\n* @throws {RequiredError}\n* @memberof AuthorizationsApi\n*/\n- public authorizationsGet(zapTraceSpan?: string, userID?: string, user?: string, options?: any) {\n- return AuthorizationsApiFp(this.configuration).authorizationsGet(zapTraceSpan, userID, user, options)(this.axios, this.basePath);\n+ public authorizationsGet(zapTraceSpan?: string, userID?: string, user?: string, orgID?: string, org?: string, options?: any) {\n+ return AuthorizationsApiFp(this.configuration).authorizationsGet(zapTraceSpan, userID, user, orgID, org, options)(this.axios, this.basePath);\n}\n/**\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/authorizations.ts", "new_path": "src/wrappers/authorizations.ts", "diff": "@@ -23,10 +23,15 @@ export default class {\nreturn null\n}\n- public async getAll(): Promise<Authorization[]> {\n+ public async getAll(orgID?: string): Promise<Authorization[]> {\nconst {\ndata: {authorizations},\n- } = await this.service.authorizationsGet()\n+ } = await this.service.authorizationsGet(\n+ undefined,\n+ undefined,\n+ undefined,\n+ orgID\n+ )\nreturn authorizations || []\n}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add orgID parameter to getAll authorizations
305,164
18.04.2019 16:07:21
25,200
e12edf42cbc143e0d926945dd881ad5a4ebf2e6b
Add initial implementation of streaming queries
[ { "change_type": "ADD", "old_path": null, "new_path": "dist/utils/platform.d.ts", "diff": "+export declare const isInBrowser: () => boolean;\n" }, { "change_type": "ADD", "old_path": null, "new_path": "dist/utils/platform.js", "diff": "+\"use strict\";\n+Object.defineProperty(exports, \"__esModule\", { value: true });\n+exports.isInBrowser = function () {\n+ return typeof window !== 'undefined';\n+};\n" }, { "change_type": "ADD", "old_path": null, "new_path": "dist/utils/request/browser.d.ts", "diff": "+import { ServiceOptions } from '../../types';\n+import { Stream } from 'stream';\n+export declare class CancellationError extends Error {\n+}\n+export default function (orgID: string, basePath: string, baseOptions: ServiceOptions, query: string, extern: File): {\n+ stream: Stream;\n+ cancel: () => void;\n+};\n" }, { "change_type": "ADD", "old_path": null, "new_path": "dist/utils/request/browser.js", "diff": "+\"use strict\";\n+var __extends = (this && this.__extends) || (function () {\n+ var extendStatics = function (d, b) {\n+ extendStatics = Object.setPrototypeOf ||\n+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n+ return extendStatics(d, b);\n+ };\n+ return function (d, b) {\n+ extendStatics(d, b);\n+ function __() { this.constructor = d; }\n+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n+ };\n+})();\n+Object.defineProperty(exports, \"__esModule\", { value: true });\n+var stream_1 = require(\"stream\");\n+var CancellationError = (function (_super) {\n+ __extends(CancellationError, _super);\n+ function CancellationError() {\n+ return _super !== null && _super.apply(this, arguments) || this;\n+ }\n+ return CancellationError;\n+}(Error));\n+exports.CancellationError = CancellationError;\n+var CHECK_LIMIT_INTERVAL = 200;\n+function default_1(orgID, basePath, baseOptions, query, extern) {\n+ var out = new stream_1.PassThrough({ encoding: 'utf8' });\n+ var fullURL = basePath + \"/query?orgID=\" + encodeURIComponent(orgID);\n+ var xhr = new XMLHttpRequest();\n+ var rowCountIndex = 0;\n+ var row = '';\n+ var interval = null;\n+ var handleData = function () {\n+ for (var i = rowCountIndex; i < xhr.responseText.length; i++) {\n+ row += xhr.responseText[i];\n+ if (xhr.responseText[i] === '\\n') {\n+ out.write(row);\n+ row = '';\n+ }\n+ }\n+ };\n+ var handleError = function () {\n+ var bodyError = null;\n+ clearInterval(interval);\n+ try {\n+ bodyError = JSON.parse(xhr.responseText).message;\n+ }\n+ catch (_a) {\n+ if (xhr.responseText && xhr.responseText.trim() !== '') {\n+ bodyError = xhr.responseText;\n+ }\n+ }\n+ out.emit('error', bodyError);\n+ };\n+ xhr.onload = function () {\n+ clearInterval(interval);\n+ if (xhr.status === 200) {\n+ handleData();\n+ out.end();\n+ }\n+ else {\n+ handleError();\n+ }\n+ };\n+ xhr.onerror = handleError;\n+ var dialect = { annotations: ['group', 'datatype', 'default'] };\n+ var body = extern ? { query: query, dialect: dialect, extern: extern } : { query: query, dialect: dialect };\n+ xhr.open('POST', fullURL + \"/query?orgID=\" + encodeURIComponent(orgID));\n+ xhr.setRequestHeader('Content-Type', 'application/json');\n+ if (baseOptions && baseOptions.headers) {\n+ xhr.setRequestHeader('Authorization', baseOptions.headers.Authorization);\n+ }\n+ xhr.send(JSON.stringify(body));\n+ interval = setInterval(handleData, CHECK_LIMIT_INTERVAL);\n+ return {\n+ stream: out,\n+ cancel: function () {\n+ xhr.abort();\n+ out.end();\n+ },\n+ };\n+}\n+exports.default = default_1;\n" }, { "change_type": "ADD", "old_path": null, "new_path": "dist/utils/request/node.d.ts", "diff": "+import { ServiceOptions } from '../../types';\n+import { Stream } from 'stream';\n+export declare class CancellationError extends Error {\n+}\n+export default function (orgID: string, basePath: string, baseOptions: ServiceOptions, query: string, extern: File): {\n+ stream: Stream;\n+ cancel: () => void;\n+};\n" }, { "change_type": "ADD", "old_path": null, "new_path": "dist/utils/request/node.js", "diff": "+\"use strict\";\n+var __extends = (this && this.__extends) || (function () {\n+ var extendStatics = function (d, b) {\n+ extendStatics = Object.setPrototypeOf ||\n+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n+ return extendStatics(d, b);\n+ };\n+ return function (d, b) {\n+ extendStatics(d, b);\n+ function __() { this.constructor = d; }\n+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n+ };\n+})();\n+var __assign = (this && this.__assign) || function () {\n+ __assign = Object.assign || function(t) {\n+ for (var s, i = 1, n = arguments.length; i < n; i++) {\n+ s = arguments[i];\n+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n+ t[p] = s[p];\n+ }\n+ return t;\n+ };\n+ return __assign.apply(this, arguments);\n+};\n+var __importDefault = (this && this.__importDefault) || function (mod) {\n+ return (mod && mod.__esModule) ? mod : { \"default\": mod };\n+};\n+Object.defineProperty(exports, \"__esModule\", { value: true });\n+var axios_1 = __importDefault(require(\"axios\"));\n+var stream_1 = require(\"stream\");\n+var CancellationError = (function (_super) {\n+ __extends(CancellationError, _super);\n+ function CancellationError() {\n+ return _super !== null && _super.apply(this, arguments) || this;\n+ }\n+ return CancellationError;\n+}(Error));\n+exports.CancellationError = CancellationError;\n+function default_1(orgID, basePath, baseOptions, query, extern) {\n+ var fullURL = basePath + \"/query?orgID=\" + encodeURIComponent(orgID);\n+ var dialect = { annotations: ['group', 'datatype', 'default'] };\n+ var body = extern ? { query: query, dialect: dialect, extern: extern } : { query: query, dialect: dialect };\n+ var source = axios_1.default.CancelToken.source();\n+ var headers = __assign({}, (baseOptions.headers || {}), { 'Content-Type': 'application/json' });\n+ var out = new stream_1.PassThrough({ encoding: 'utf8' });\n+ axios_1.default.post(fullURL, body, {\n+ headers: headers,\n+ responseType: 'stream',\n+ cancelToken: source.token,\n+ })\n+ .then(function (resp) {\n+ resp.data.on('data', function (d) {\n+ out.write(d.toString());\n+ });\n+ resp.data.on('error', function (err) {\n+ out.emit('error', err);\n+ });\n+ resp.data.on('end', function () {\n+ out.end();\n+ });\n+ })\n+ .catch(function (err) {\n+ if (!axios_1.default.isCancel(err)) {\n+ out.emit('error', err);\n+ }\n+ });\n+ return {\n+ stream: out,\n+ cancel: function () {\n+ source.cancel();\n+ out.end();\n+ },\n+ };\n+}\n+exports.default = default_1;\n" }, { "change_type": "ADD", "old_path": null, "new_path": "dist/wrappers/query.d.ts", "diff": "+import { ServiceOptions } from '../types';\n+import { Stream } from 'stream';\n+export default class {\n+ private basePath;\n+ private baseOptions;\n+ constructor(basePath: string, baseOptions: ServiceOptions);\n+ execute(orgID: string, query: string, extern?: File): {\n+ stream: Stream;\n+ cancel: () => void;\n+ };\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "dist/wrappers/query.js", "diff": "+\"use strict\";\n+Object.defineProperty(exports, \"__esModule\", { value: true });\n+var platform_1 = require(\"../utils/platform\");\n+var default_1 = (function () {\n+ function default_1(basePath, baseOptions) {\n+ this.basePath = basePath;\n+ this.baseOptions = baseOptions;\n+ }\n+ default_1.prototype.execute = function (orgID, query, extern) {\n+ if (platform_1.isInBrowser()) {\n+ return require('../utils/request/browser')(orgID, this.basePath, this.baseOptions, query, extern);\n+ }\n+ else {\n+ return require('../utils/request/node')(orgID, this.basePath, this.baseOptions, query, extern);\n+ }\n+ };\n+ return default_1;\n+}());\n+exports.default = default_1;\n" }, { "change_type": "MODIFY", "old_path": "src/types/index.ts", "new_path": "src/types/index.ts", "diff": "@@ -7,4 +7,3 @@ export interface ServiceOptions {\nAuthorization: string\n}\n}\n-\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/utils/platform.ts", "diff": "+export const isInBrowser = (): boolean => {\n+ return typeof window !== 'undefined'\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/utils/request/browser.ts", "diff": "+import {ServiceOptions} from '../../types'\n+import {PassThrough, Stream} from 'stream'\n+\n+export class CancellationError extends Error {}\n+const CHECK_LIMIT_INTERVAL = 200\n+\n+export default function(\n+ orgID: string,\n+ basePath: string,\n+ baseOptions: ServiceOptions,\n+ query: string,\n+ extern: File\n+): {stream: Stream; cancel: () => void} {\n+ const out = new PassThrough({encoding: 'utf8'})\n+ const fullURL = `${basePath}/query?orgID=${encodeURIComponent(orgID)}`\n+\n+ const xhr = new XMLHttpRequest()\n+ let rowCountIndex = 0\n+ let row = ''\n+ let interval: any = null\n+\n+ const handleData = (): void => {\n+ for (let i = rowCountIndex; i < xhr.responseText.length; i++) {\n+ row += xhr.responseText[i]\n+ if (xhr.responseText[i] === '\\n') {\n+ out.write(row)\n+ row = ''\n+ }\n+ }\n+ }\n+\n+ const handleError = () => {\n+ let bodyError = null\n+\n+ clearInterval(interval)\n+\n+ try {\n+ bodyError = JSON.parse(xhr.responseText).message\n+ } catch {\n+ if (xhr.responseText && xhr.responseText.trim() !== '') {\n+ bodyError = xhr.responseText\n+ }\n+ }\n+\n+ out.emit('error', bodyError)\n+ }\n+\n+ xhr.onload = () => {\n+ clearInterval(interval)\n+ if (xhr.status === 200) {\n+ handleData()\n+ out.end()\n+ } else {\n+ handleError()\n+ }\n+ }\n+\n+ xhr.onerror = handleError\n+\n+ const dialect = {annotations: ['group', 'datatype', 'default']}\n+ const body = extern ? {query, dialect, extern} : {query, dialect}\n+\n+ xhr.open('POST', `${fullURL}/query?orgID=${encodeURIComponent(orgID)}`)\n+ xhr.setRequestHeader('Content-Type', 'application/json')\n+ if (baseOptions && baseOptions.headers) {\n+ xhr.setRequestHeader('Authorization', baseOptions.headers.Authorization)\n+ }\n+ xhr.send(JSON.stringify(body))\n+\n+ interval = setInterval(handleData, CHECK_LIMIT_INTERVAL)\n+\n+ return {\n+ stream: out,\n+ cancel() {\n+ xhr.abort()\n+ out.end()\n+ },\n+ }\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/utils/request/node.ts", "diff": "+import {ServiceOptions} from '../../types'\n+import Axios from 'axios'\n+import {PassThrough, Stream} from 'stream'\n+\n+export class CancellationError extends Error {}\n+\n+export default function(\n+ orgID: string,\n+ basePath: string,\n+ baseOptions: ServiceOptions,\n+ query: string,\n+ extern: File\n+): {stream: Stream; cancel: () => void} {\n+ const fullURL = `${basePath}/query?orgID=${encodeURIComponent(orgID)}`\n+ const dialect = {annotations: ['group', 'datatype', 'default']}\n+ const body = extern ? {query, dialect, extern} : {query, dialect}\n+ const source = Axios.CancelToken.source()\n+\n+ let headers = {\n+ ...(baseOptions.headers || {}),\n+ 'Content-Type': 'application/json',\n+ }\n+\n+ const out = new PassThrough({encoding: 'utf8'})\n+\n+ Axios.post(fullURL, body, {\n+ headers: headers,\n+ responseType: 'stream',\n+ cancelToken: source.token,\n+ })\n+ .then(resp => {\n+ resp.data.on('data', (d: {toString: () => string}) => {\n+ out.write(d.toString())\n+ })\n+\n+ resp.data.on('error', (err: Error) => {\n+ out.emit('error', err)\n+ })\n+\n+ resp.data.on('end', () => {\n+ out.end()\n+ })\n+ })\n+ .catch(err => {\n+ if (!Axios.isCancel(err)) {\n+ out.emit('error', err)\n+ }\n+ })\n+\n+ return {\n+ stream: out,\n+ cancel() {\n+ source.cancel()\n+ out.end()\n+ },\n+ }\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/wrappers/query.ts", "diff": "+import {ServiceOptions} from '../types'\n+import {isInBrowser} from '../utils/platform'\n+import {Stream} from 'stream'\n+\n+export default class {\n+ private basePath: string\n+ private baseOptions: ServiceOptions\n+\n+ constructor(basePath: string, baseOptions: ServiceOptions) {\n+ this.basePath = basePath\n+ this.baseOptions = baseOptions\n+ }\n+\n+ public execute(\n+ orgID: string,\n+ query: string,\n+ extern?: File\n+ ): {stream: Stream; cancel: () => void} {\n+ if (isInBrowser()) {\n+ return require('../utils/request/browser')(\n+ orgID,\n+ this.basePath,\n+ this.baseOptions,\n+ query,\n+ extern\n+ )\n+ } else {\n+ return require('../utils/request/node')(\n+ orgID,\n+ this.basePath,\n+ this.baseOptions,\n+ query,\n+ extern\n+ )\n+ }\n+ }\n+}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add initial implementation of streaming queries
305,164
19.04.2019 11:36:41
25,200
8e0581aed968967506ecb18f229f72d9dda519fd
Expose query execution to client
[ { "change_type": "MODIFY", "old_path": "dist/wrappers/queries.d.ts", "new_path": "dist/wrappers/queries.d.ts", "diff": "import { Package } from '../api';\nimport { ServiceOptions } from '../types';\n+import { Stream } from 'stream';\nexport default class {\nprivate service;\n+ private basePath;\n+ private baseOptions;\nconstructor(basePath: string, baseOptions: ServiceOptions);\nast(query: string): Promise<Package | undefined>;\n+ execute(orgID: string, query: string, extern?: File): {\n+ stream: Stream;\n+ cancel: () => void;\n+ };\n}\n" }, { "change_type": "MODIFY", "old_path": "dist/wrappers/queries.js", "new_path": "dist/wrappers/queries.js", "diff": "@@ -36,9 +36,12 @@ var __generator = (this && this.__generator) || function (thisArg, body) {\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar api_1 = require(\"../api\");\n+var platform_1 = require(\"../utils/platform\");\nvar default_1 = (function () {\nfunction default_1(basePath, baseOptions) {\nthis.service = new api_1.QueryApi({ basePath: basePath, baseOptions: baseOptions });\n+ this.basePath = basePath;\n+ this.baseOptions = baseOptions;\n}\ndefault_1.prototype.ast = function (query) {\nreturn __awaiter(this, void 0, void 0, function () {\n@@ -55,6 +58,14 @@ var default_1 = (function () {\n});\n});\n};\n+ default_1.prototype.execute = function (orgID, query, extern) {\n+ if (platform_1.isInBrowser()) {\n+ return require('../utils/request/browser')(orgID, this.basePath, this.baseOptions, query, extern);\n+ }\n+ else {\n+ return require('../utils/request/node')(orgID, this.basePath, this.baseOptions, query, extern);\n+ }\n+ };\nreturn default_1;\n}());\nexports.default = default_1;\n" }, { "change_type": "DELETE", "old_path": "dist/wrappers/query.d.ts", "new_path": null, "diff": "-import { ServiceOptions } from '../types';\n-import { Stream } from 'stream';\n-export default class {\n- private basePath;\n- private baseOptions;\n- constructor(basePath: string, baseOptions: ServiceOptions);\n- execute(orgID: string, query: string, extern?: File): {\n- stream: Stream;\n- cancel: () => void;\n- };\n-}\n" }, { "change_type": "DELETE", "old_path": "dist/wrappers/query.js", "new_path": null, "diff": "-\"use strict\";\n-Object.defineProperty(exports, \"__esModule\", { value: true });\n-var platform_1 = require(\"../utils/platform\");\n-var default_1 = (function () {\n- function default_1(basePath, baseOptions) {\n- this.basePath = basePath;\n- this.baseOptions = baseOptions;\n- }\n- default_1.prototype.execute = function (orgID, query, extern) {\n- if (platform_1.isInBrowser()) {\n- return require('../utils/request/browser')(orgID, this.basePath, this.baseOptions, query, extern);\n- }\n- else {\n- return require('../utils/request/node')(orgID, this.basePath, this.baseOptions, query, extern);\n- }\n- };\n- return default_1;\n-}());\n-exports.default = default_1;\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/queries.ts", "new_path": "src/wrappers/queries.ts", "diff": "import {Package, QueryApi} from '../api'\nimport {ServiceOptions} from '../types'\n+import {isInBrowser} from '../utils/platform'\n+import {Stream} from 'stream'\nexport default class {\nprivate service: QueryApi\n+ private basePath: string\n+ private baseOptions: ServiceOptions\nconstructor(basePath: string, baseOptions: ServiceOptions) {\nthis.service = new QueryApi({basePath, baseOptions})\n+ this.basePath = basePath\n+ this.baseOptions = baseOptions\n}\npublic async ast(query: string): Promise<Package | undefined> {\n@@ -15,4 +21,28 @@ export default class {\nreturn data.ast\n}\n+\n+ public execute(\n+ orgID: string,\n+ query: string,\n+ extern?: File\n+ ): {stream: Stream; cancel: () => void} {\n+ if (isInBrowser()) {\n+ return require('../utils/request/browser')(\n+ orgID,\n+ this.basePath,\n+ this.baseOptions,\n+ query,\n+ extern\n+ )\n+ } else {\n+ return require('../utils/request/node')(\n+ orgID,\n+ this.basePath,\n+ this.baseOptions,\n+ query,\n+ extern\n+ )\n+ }\n+ }\n}\n" }, { "change_type": "DELETE", "old_path": "src/wrappers/query.ts", "new_path": null, "diff": "-import {ServiceOptions} from '../types'\n-import {isInBrowser} from '../utils/platform'\n-import {Stream} from 'stream'\n-\n-export default class {\n- private basePath: string\n- private baseOptions: ServiceOptions\n-\n- constructor(basePath: string, baseOptions: ServiceOptions) {\n- this.basePath = basePath\n- this.baseOptions = baseOptions\n- }\n-\n- public execute(\n- orgID: string,\n- query: string,\n- extern?: File\n- ): {stream: Stream; cancel: () => void} {\n- if (isInBrowser()) {\n- return require('../utils/request/browser')(\n- orgID,\n- this.basePath,\n- this.baseOptions,\n- query,\n- extern\n- )\n- } else {\n- return require('../utils/request/node')(\n- orgID,\n- this.basePath,\n- this.baseOptions,\n- query,\n- extern\n- )\n- }\n- }\n-}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Expose query execution to client
305,164
19.04.2019 13:57:56
25,200
39bec174ffade9426634991546291cd2fb508090
Fix File type used for query
[ { "change_type": "MODIFY", "old_path": "dist/utils/request/browser.d.ts", "new_path": "dist/utils/request/browser.d.ts", "diff": "-import { ServiceOptions } from '../../types';\n+import { ServiceOptions, File } from '../../types';\nimport { Stream } from 'stream';\nexport declare class CancellationError extends Error {\n}\n" }, { "change_type": "MODIFY", "old_path": "dist/utils/request/node.d.ts", "new_path": "dist/utils/request/node.d.ts", "diff": "-import { ServiceOptions } from '../../types';\n+import { ServiceOptions, File } from '../../types';\nimport { Stream } from 'stream';\nexport declare class CancellationError extends Error {\n}\n" }, { "change_type": "MODIFY", "old_path": "dist/wrappers/queries.d.ts", "new_path": "dist/wrappers/queries.d.ts", "diff": "import { Package } from '../api';\n-import { ServiceOptions } from '../types';\n+import { ServiceOptions, File } from '../types';\nimport { Stream } from 'stream';\nexport default class {\nprivate service;\n" }, { "change_type": "MODIFY", "old_path": "src/utils/request/browser.ts", "new_path": "src/utils/request/browser.ts", "diff": "-import {ServiceOptions} from '../../types'\n+import {ServiceOptions, File} from '../../types'\nimport {PassThrough, Stream} from 'stream'\nexport class CancellationError extends Error {}\n" }, { "change_type": "MODIFY", "old_path": "src/utils/request/node.ts", "new_path": "src/utils/request/node.ts", "diff": "-import {ServiceOptions} from '../../types'\n+import {ServiceOptions, File} from '../../types'\nimport Axios from 'axios'\nimport {PassThrough, Stream} from 'stream'\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/queries.ts", "new_path": "src/wrappers/queries.ts", "diff": "import {Package, QueryApi} from '../api'\n-import {ServiceOptions} from '../types'\n+import {ServiceOptions, File} from '../types'\nimport {isInBrowser} from '../utils/platform'\nimport {Stream} from 'stream'\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Fix File type used for query
305,164
19.04.2019 14:27:05
25,200
738a35047336964d1337ef7b1e1e2a86d6407739
Fix request imports
[ { "change_type": "MODIFY", "old_path": "dist/utils/request/browser.d.ts", "new_path": "dist/utils/request/browser.d.ts", "diff": "@@ -2,7 +2,7 @@ import { ServiceOptions, File } from '../../types';\nimport { Stream } from 'stream';\nexport declare class CancellationError extends Error {\n}\n-export default function (orgID: string, basePath: string, baseOptions: ServiceOptions, query: string, extern: File): {\n+export default function (orgID: string, basePath: string, baseOptions: ServiceOptions, query: string, extern?: File): {\nstream: Stream;\ncancel: () => void;\n};\n" }, { "change_type": "MODIFY", "old_path": "dist/utils/request/node.d.ts", "new_path": "dist/utils/request/node.d.ts", "diff": "@@ -2,7 +2,7 @@ import { ServiceOptions, File } from '../../types';\nimport { Stream } from 'stream';\nexport declare class CancellationError extends Error {\n}\n-export default function (orgID: string, basePath: string, baseOptions: ServiceOptions, query: string, extern: File): {\n+export default function (orgID: string, basePath: string, baseOptions: ServiceOptions, query: string, extern?: File): {\nstream: Stream;\ncancel: () => void;\n};\n" }, { "change_type": "MODIFY", "old_path": "dist/wrappers/queries.js", "new_path": "dist/wrappers/queries.js", "diff": "@@ -34,9 +34,14 @@ var __generator = (this && this.__generator) || function (thisArg, body) {\nif (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n}\n};\n+var __importDefault = (this && this.__importDefault) || function (mod) {\n+ return (mod && mod.__esModule) ? mod : { \"default\": mod };\n+};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar api_1 = require(\"../api\");\nvar platform_1 = require(\"../utils/platform\");\n+var node_1 = __importDefault(require(\"../utils/request/node\"));\n+var browser_1 = __importDefault(require(\"../utils/request/browser\"));\nvar default_1 = (function () {\nfunction default_1(basePath, baseOptions) {\nthis.service = new api_1.QueryApi({ basePath: basePath, baseOptions: baseOptions });\n@@ -60,10 +65,10 @@ var default_1 = (function () {\n};\ndefault_1.prototype.execute = function (orgID, query, extern) {\nif (platform_1.isInBrowser()) {\n- return require('../utils/request/browser')(orgID, this.basePath, this.baseOptions, query, extern);\n+ return browser_1.default(orgID, this.basePath, this.baseOptions, query, extern);\n}\nelse {\n- return require('../utils/request/node')(orgID, this.basePath, this.baseOptions, query, extern);\n+ return node_1.default(orgID, this.basePath, this.baseOptions, query, extern);\n}\n};\nreturn default_1;\n" }, { "change_type": "MODIFY", "old_path": "src/utils/request/browser.ts", "new_path": "src/utils/request/browser.ts", "diff": "@@ -9,7 +9,7 @@ export default function(\nbasePath: string,\nbaseOptions: ServiceOptions,\nquery: string,\n- extern: File\n+ extern?: File\n): {stream: Stream; cancel: () => void} {\nconst out = new PassThrough({encoding: 'utf8'})\nconst fullURL = `${basePath}/query?orgID=${encodeURIComponent(orgID)}`\n" }, { "change_type": "MODIFY", "old_path": "src/utils/request/node.ts", "new_path": "src/utils/request/node.ts", "diff": "@@ -9,7 +9,7 @@ export default function(\nbasePath: string,\nbaseOptions: ServiceOptions,\nquery: string,\n- extern: File\n+ extern?: File\n): {stream: Stream; cancel: () => void} {\nconst fullURL = `${basePath}/query?orgID=${encodeURIComponent(orgID)}`\nconst dialect = {annotations: ['group', 'datatype', 'default']}\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/queries.ts", "new_path": "src/wrappers/queries.ts", "diff": "@@ -2,6 +2,8 @@ import {Package, QueryApi} from '../api'\nimport {ServiceOptions, File} from '../types'\nimport {isInBrowser} from '../utils/platform'\nimport {Stream} from 'stream'\n+import nodeQuery from '../utils/request/node'\n+import browserQuery from '../utils/request/browser'\nexport default class {\nprivate service: QueryApi\n@@ -28,21 +30,9 @@ export default class {\nextern?: File\n): {stream: Stream; cancel: () => void} {\nif (isInBrowser()) {\n- return require('../utils/request/browser')(\n- orgID,\n- this.basePath,\n- this.baseOptions,\n- query,\n- extern\n- )\n+ return browserQuery(orgID, this.basePath, this.baseOptions, query, extern)\n} else {\n- return require('../utils/request/node')(\n- orgID,\n- this.basePath,\n- this.baseOptions,\n- query,\n- extern\n- )\n+ return nodeQuery(orgID, this.basePath, this.baseOptions, query, extern)\n}\n}\n}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Fix request imports
305,164
19.04.2019 14:51:46
25,200
e769ca3777f9cdabe672bd2b523de776d04f28ac
Fix browser request url
[ { "change_type": "MODIFY", "old_path": "dist/utils/request/browser.js", "new_path": "dist/utils/request/browser.js", "diff": "@@ -65,7 +65,7 @@ function default_1(orgID, basePath, baseOptions, query, extern) {\nxhr.onerror = handleError;\nvar dialect = { annotations: ['group', 'datatype', 'default'] };\nvar body = extern ? { query: query, dialect: dialect, extern: extern } : { query: query, dialect: dialect };\n- xhr.open('POST', fullURL + \"/query?orgID=\" + encodeURIComponent(orgID));\n+ xhr.open('POST', fullURL);\nxhr.setRequestHeader('Content-Type', 'application/json');\nif (baseOptions && baseOptions.headers) {\nxhr.setRequestHeader('Authorization', baseOptions.headers.Authorization);\n" }, { "change_type": "MODIFY", "old_path": "src/utils/request/browser.ts", "new_path": "src/utils/request/browser.ts", "diff": "@@ -60,7 +60,7 @@ export default function(\nconst dialect = {annotations: ['group', 'datatype', 'default']}\nconst body = extern ? {query, dialect, extern} : {query, dialect}\n- xhr.open('POST', `${fullURL}/query?orgID=${encodeURIComponent(orgID)}`)\n+ xhr.open('POST', fullURL)\nxhr.setRequestHeader('Content-Type', 'application/json')\nif (baseOptions && baseOptions.headers) {\nxhr.setRequestHeader('Authorization', baseOptions.headers.Authorization)\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Fix browser request url
305,164
22.04.2019 14:42:40
25,200
35846372ad32653268056405dae1fa5b0586e4fe
Return status code for queries that error
[ { "change_type": "MODIFY", "old_path": "dist/index.js", "new_path": "dist/index.js", "diff": "@@ -40,7 +40,7 @@ var Client = (function () {\nfunction Client(basePath, token) {\nvar options = {};\nif (token) {\n- options = __assign({}, options, { headers: { Authorization: \"token \" + token } });\n+ options = __assign({}, options, { headers: { Authorization: \"Token \" + token } });\n}\nthis.auth = new auth_1.default(basePath, options);\nthis.authorizations = new authorizations_1.default(basePath, options);\n" }, { "change_type": "MODIFY", "old_path": "dist/utils/request/browser.js", "new_path": "dist/utils/request/browser.js", "diff": "@@ -50,6 +50,7 @@ function default_1(orgID, basePath, baseOptions, query, extern) {\nbodyError = xhr.responseText;\n}\n}\n+ bodyError.status = xhr.status;\nout.emit('error', bodyError);\n};\nxhr.onload = function () {\n" }, { "change_type": "MODIFY", "old_path": "dist/utils/request/node.js", "new_path": "dist/utils/request/node.js", "diff": "@@ -54,7 +54,8 @@ function default_1(orgID, basePath, baseOptions, query, extern) {\nout.write(d.toString());\n});\nresp.data.on('error', function (err) {\n- out.emit('error', err);\n+ var fullError = __assign({}, err, { status: resp.status });\n+ out.emit('error', fullError);\n});\nresp.data.on('end', function () {\nout.end();\n@@ -62,6 +63,8 @@ function default_1(orgID, basePath, baseOptions, query, extern) {\n})\n.catch(function (err) {\nif (!axios_1.default.isCancel(err)) {\n+ var response = err.response;\n+ err.status = (response || {}).status;\nout.emit('error', err);\n}\n});\n" }, { "change_type": "MODIFY", "old_path": "src/index.ts", "new_path": "src/index.ts", "diff": "@@ -84,7 +84,7 @@ export default class Client {\nlet options = {}\nif (token) {\n- options = {...options, headers: {Authorization: `token ${token}`}}\n+ options = {...options, headers: {Authorization: `Token ${token}`}}\n}\nthis.auth = new Auth(basePath, options)\n" }, { "change_type": "MODIFY", "old_path": "src/utils/request/browser.ts", "new_path": "src/utils/request/browser.ts", "diff": "@@ -42,6 +42,8 @@ export default function(\n}\n}\n+ bodyError.status = xhr.status\n+\nout.emit('error', bodyError)\n}\n" }, { "change_type": "MODIFY", "old_path": "src/utils/request/node.ts", "new_path": "src/utils/request/node.ts", "diff": "@@ -34,7 +34,8 @@ export default function(\n})\nresp.data.on('error', (err: Error) => {\n- out.emit('error', err)\n+ const fullError = {...err, status: resp.status}\n+ out.emit('error', fullError)\n})\nresp.data.on('end', () => {\n@@ -43,6 +44,8 @@ export default function(\n})\n.catch(err => {\nif (!Axios.isCancel(err)) {\n+ const {response} = err\n+ err.status = (response || {}).status\nout.emit('error', err)\n}\n})\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Return status code for queries that error
305,164
24.04.2019 11:01:13
25,200
477f91630ca10e9866c6a4f2fbb7eeab5c54c436
Standardize write api to use orgID
[ { "change_type": "MODIFY", "old_path": "dist/wrappers/write.d.ts", "new_path": "dist/wrappers/write.d.ts", "diff": "@@ -8,6 +8,6 @@ export default class {\nprivate serviceOptions;\nconstructor(basePath: string, baseOptions: ServiceOptions);\nreadonly WritePrecision: typeof WritePrecision;\n- create(org: string, bucket: string, data: string, options?: Partial<ICreateOptions>): Promise<Response>;\n+ create(orgID: string, bucket: string, data: string, options?: Partial<ICreateOptions>): Promise<Response>;\n}\nexport {};\n" }, { "change_type": "MODIFY", "old_path": "dist/wrappers/write.js", "new_path": "dist/wrappers/write.js", "diff": "@@ -48,7 +48,7 @@ var default_1 = (function () {\nenumerable: true,\nconfigurable: true\n});\n- default_1.prototype.create = function (org, bucket, data, options) {\n+ default_1.prototype.create = function (orgID, bucket, data, options) {\nif (options === void 0) { options = {}; }\nreturn __awaiter(this, void 0, void 0, function () {\nvar precision, response;\n@@ -56,7 +56,7 @@ var default_1 = (function () {\nswitch (_a.label) {\ncase 0:\nprecision = options.precision || api_1.WritePrecision.Ns;\n- return [4, this.service.writePost(org, bucket, data, undefined, undefined, undefined, undefined, undefined, precision, this.serviceOptions)];\n+ return [4, this.service.writePost(orgID, bucket, data, undefined, undefined, undefined, undefined, undefined, precision, this.serviceOptions)];\ncase 1:\nresponse = (_a.sent()).data;\nreturn [2, response];\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/write.ts", "new_path": "src/wrappers/write.ts", "diff": "@@ -19,7 +19,7 @@ export default class {\n}\npublic async create(\n- org: string,\n+ orgID: string,\nbucket: string,\ndata: string,\noptions: Partial<ICreateOptions> = {}\n@@ -27,7 +27,7 @@ export default class {\nconst precision = options.precision || WritePrecision.Ns\nconst {data: response} = await this.service.writePost(\n- org,\n+ orgID,\nbucket,\ndata,\nundefined,\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Standardize write api to use orgID
305,164
24.04.2019 13:11:08
25,200
e8856631bb5215869df4291a18e918b7d7cc0b4d
Initial documentation write query
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "This library is a work in progress and should not be considered production ready pre v1.0\n+## Usage\n+\n+Initializing the client\n+\n+```typescript\n+\n+import Client from '@influxdata/influx'\n+\n+const client = new Client('basepath', 'token')\n+\n+```\n+\n+### Querying\n+\n+Using the client to execute a query\n+\n+```typescript\n+\n+const query = `\n+ from(bucket:\"defbuck\")\n+ |> range(start: -1d)\n+`\n+\n+const {stream, cancel} = client.queries.execute('someorgid', query)\n+\n+```\n+\n+The returned stream will emit data on row at a time and follows the convention of a node.js stream\n+\n+```typescript\n+\n+stream.on('data', (row) => {\n+ console.log(row)\n+})\n+\n+stream.on('error', (err) => {\n+ // handler error\n+})\n+\n+stream.on('end', () => {\n+ // data done\n+})\n+\n+```\n+\n+or\n+\n+```typescript\n+\n+stream.pipe(process.stdout)\n+\n+```\n+\n+The returned cancel is a function that when called will cancel the request (it does not cause an error)\n+\n+```typescript\n+\n+cancel() // Cancels request\n+\n+```\n+\n+### Writing\n+\n+Data written to the database should be in line protocol\n+\n+```typescript\n+\n+const data = '' // Line protocal string\n+\n+const response = await client.write.create('orgID', 'bucketID', data)\n+\n+```\n+\n## Development requirements\n- OpenJDK 8 or higher\n" }, { "change_type": "ADD", "old_path": null, "new_path": "dist/examples/query.d.ts", "diff": "+export {};\n" }, { "change_type": "ADD", "old_path": null, "new_path": "dist/examples/query.js", "diff": "+\"use strict\";\n+var __importDefault = (this && this.__importDefault) || function (mod) {\n+ return (mod && mod.__esModule) ? mod : { \"default\": mod };\n+};\n+Object.defineProperty(exports, \"__esModule\", { value: true });\n+var index_1 = __importDefault(require(\"../index\"));\n+var token = process.env.INFLUXDB_TOKEN;\n+var client = new index_1.default('http://localhost:9999/api/v2', token);\n+var query = \"\\n from(bucket:\\\"defbuck\\\")\\n |> range(start: -1d)\\n\";\n+var response = client.queries.execute('someorgid', query);\n+response.stream.on('data', function (_row) {\n+});\n+response.stream.on('error', function (_err) {\n+});\n+response.stream.on('end', function () {\n+});\n" }, { "change_type": "ADD", "old_path": null, "new_path": "dist/examples/write.d.ts", "diff": "+export {};\n" }, { "change_type": "ADD", "old_path": null, "new_path": "dist/examples/write.js", "diff": "+\"use strict\";\n+var __importDefault = (this && this.__importDefault) || function (mod) {\n+ return (mod && mod.__esModule) ? mod : { \"default\": mod };\n+};\n+Object.defineProperty(exports, \"__esModule\", { value: true });\n+var index_1 = __importDefault(require(\"../index\"));\n+var token = process.env.INFLUXDB_TOKEN;\n+var client = new index_1.default('http://localhost:9999/api/v2', token);\n+var data = '';\n+var bucket = 'bucket';\n+var orgID = 'orgID';\n+client.write.create(orgID, bucket, data);\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/examples/query.ts", "diff": "+import Client from '../index'\n+\n+const token = process.env.INFLUXDB_TOKEN\n+const client = new Client('http://localhost:9999/api/v2', token)\n+\n+const query = `\n+ from(bucket:\"defbuck\")\n+ |> range(start: -1d)\n+`\n+\n+const response = client.queries.execute('someorgid', query)\n+\n+response.stream.on('data', _row => {\n+ // handle row of data\n+})\n+\n+response.stream.on('error', _err => {\n+ // handler error\n+})\n+\n+response.stream.on('end', () => {\n+ // data done\n+})\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/examples/write.ts", "diff": "+import Client from '../index'\n+\n+const token = process.env.INFLUXDB_TOKEN\n+const client = new Client('http://localhost:9999/api/v2', token)\n+\n+const data = ''\n+const bucket = 'bucket'\n+const orgID = 'orgID'\n+\n+client.write.create(orgID, bucket, data)\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Initial documentation - write - query
305,164
24.04.2019 13:17:03
25,200
41ac49e4f64554e93ad2f3f607168c10f722ac35
Exclude examples from compilation
[ { "change_type": "DELETE", "old_path": "dist/examples/query.d.ts", "new_path": null, "diff": "-export {};\n" }, { "change_type": "DELETE", "old_path": "dist/examples/query.js", "new_path": null, "diff": "-\"use strict\";\n-var __importDefault = (this && this.__importDefault) || function (mod) {\n- return (mod && mod.__esModule) ? mod : { \"default\": mod };\n-};\n-Object.defineProperty(exports, \"__esModule\", { value: true });\n-var index_1 = __importDefault(require(\"../index\"));\n-var token = process.env.INFLUXDB_TOKEN;\n-var client = new index_1.default('http://localhost:9999/api/v2', token);\n-var query = \"\\n from(bucket:\\\"defbuck\\\")\\n |> range(start: -1d)\\n\";\n-var response = client.queries.execute('someorgid', query);\n-response.stream.on('data', function (_row) {\n-});\n-response.stream.on('error', function (_err) {\n-});\n-response.stream.on('end', function () {\n-});\n" }, { "change_type": "DELETE", "old_path": "dist/examples/write.d.ts", "new_path": null, "diff": "-export {};\n" }, { "change_type": "DELETE", "old_path": "dist/examples/write.js", "new_path": null, "diff": "-\"use strict\";\n-var __importDefault = (this && this.__importDefault) || function (mod) {\n- return (mod && mod.__esModule) ? mod : { \"default\": mod };\n-};\n-Object.defineProperty(exports, \"__esModule\", { value: true });\n-var index_1 = __importDefault(require(\"../index\"));\n-var token = process.env.INFLUXDB_TOKEN;\n-var client = new index_1.default('http://localhost:9999/api/v2', token);\n-var data = '';\n-var bucket = 'bucket';\n-var orgID = 'orgID';\n-client.write.create(orgID, bucket, data);\n" }, { "change_type": "MODIFY", "old_path": "tsconfig.json", "new_path": "tsconfig.json", "diff": "{\n+ \"exclude\": [\n+ \"src/examples\"\n+ ],\n\"compilerOptions\": {\n/* Basic Options */\n\"target\": \"es5\", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Exclude examples from compilation
305,164
24.04.2019 16:03:22
25,200
0b53f132e78f2b3ca26cb819bbecf6e44f937e16
Emit full error if query fails
[ { "change_type": "MODIFY", "old_path": "dist/utils/request/browser.js", "new_path": "dist/utils/request/browser.js", "diff": "@@ -50,8 +50,9 @@ function default_1(orgID, basePath, baseOptions, query, extern) {\nbodyError = xhr.responseText;\n}\n}\n- bodyError.status = xhr.status;\n- out.emit('error', bodyError);\n+ var err = new Error(bodyError);\n+ err.status = xhr.status;\n+ out.emit('error', err);\n};\nxhr.onload = function () {\nclearInterval(interval);\n" }, { "change_type": "MODIFY", "old_path": "src/utils/request/browser.ts", "new_path": "src/utils/request/browser.ts", "diff": "@@ -4,6 +4,10 @@ import {PassThrough, Stream} from 'stream'\nexport class CancellationError extends Error {}\nconst CHECK_LIMIT_INTERVAL = 200\n+interface ResponseError extends Error {\n+ status?: number\n+}\n+\nexport default function(\norgID: string,\nbasePath: string,\n@@ -41,10 +45,10 @@ export default function(\nbodyError = xhr.responseText\n}\n}\n+ const err: ResponseError = new Error(bodyError)\n+ err.status = xhr.status\n- bodyError.status = xhr.status\n-\n- out.emit('error', bodyError)\n+ out.emit('error', err)\n}\nxhr.onload = () => {\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Emit full error if query fails
305,174
07.05.2019 10:12:49
25,200
d5eb75bbf061875ca1bd4d892647af2c4759ffad
Fix data race in streaming CSV parsing
[ { "change_type": "MODIFY", "old_path": "dist/utils/request/browser.js", "new_path": "dist/utils/request/browser.js", "diff": "@@ -27,21 +27,25 @@ function default_1(orgID, basePath, baseOptions, query, extern) {\nvar out = new stream_1.PassThrough({ encoding: 'utf8' });\nvar fullURL = basePath + \"/query?orgID=\" + encodeURIComponent(orgID);\nvar xhr = new XMLHttpRequest();\n- var rowCountIndex = 0;\n+ var currentIndex = 0;\n+ var timer = null;\nvar row = '';\n- var interval = null;\nvar handleData = function () {\n- for (var i = rowCountIndex; i < xhr.responseText.length; i++) {\n+ var i0 = currentIndex;\n+ var i1 = xhr.responseText.length;\n+ for (var i = i0; i < i1; i++) {\nrow += xhr.responseText[i];\nif (xhr.responseText[i] === '\\n') {\nout.write(row);\nrow = '';\n}\n}\n+ currentIndex = i1;\n+ timer = setTimeout(handleData, CHECK_LIMIT_INTERVAL);\n};\nvar handleError = function () {\nvar bodyError = null;\n- clearInterval(interval);\n+ clearTimeout(timer);\ntry {\nbodyError = JSON.parse(xhr.responseText).message;\n}\n@@ -55,7 +59,7 @@ function default_1(orgID, basePath, baseOptions, query, extern) {\nout.emit('error', err);\n};\nxhr.onload = function () {\n- clearInterval(interval);\n+ clearTimeout(timer);\nif (xhr.status === 200) {\nhandleData();\nout.end();\n@@ -73,7 +77,7 @@ function default_1(orgID, basePath, baseOptions, query, extern) {\nxhr.setRequestHeader('Authorization', baseOptions.headers.Authorization);\n}\nxhr.send(JSON.stringify(body));\n- interval = setInterval(handleData, CHECK_LIMIT_INTERVAL);\n+ timer = setTimeout(handleData, CHECK_LIMIT_INTERVAL);\nreturn {\nstream: out,\ncancel: function () {\n" }, { "change_type": "MODIFY", "old_path": "package-lock.json", "new_path": "package-lock.json", "diff": "{\n\"name\": \"@influxdata/influx\",\n- \"version\": \"0.2.62\",\n+ \"version\": \"0.3.3\",\n\"lockfileVersion\": 1,\n\"requires\": true,\n\"dependencies\": {\n" }, { "change_type": "MODIFY", "old_path": "src/utils/request/browser.ts", "new_path": "src/utils/request/browser.ts", "diff": "@@ -19,24 +19,32 @@ export default function(\nconst fullURL = `${basePath}/query?orgID=${encodeURIComponent(orgID)}`\nconst xhr = new XMLHttpRequest()\n- let rowCountIndex = 0\n+\n+ let currentIndex = 0\n+ let timer: any = null\nlet row = ''\n- let interval: any = null\nconst handleData = (): void => {\n- for (let i = rowCountIndex; i < xhr.responseText.length; i++) {\n+ const i0 = currentIndex\n+ const i1 = xhr.responseText.length\n+\n+ for (let i = i0; i < i1; i++) {\nrow += xhr.responseText[i]\n+\nif (xhr.responseText[i] === '\\n') {\nout.write(row)\nrow = ''\n}\n}\n+\n+ currentIndex = i1\n+ timer = setTimeout(handleData, CHECK_LIMIT_INTERVAL)\n}\nconst handleError = () => {\nlet bodyError = null\n- clearInterval(interval)\n+ clearTimeout(timer)\ntry {\nbodyError = JSON.parse(xhr.responseText).message\n@@ -52,7 +60,7 @@ export default function(\n}\nxhr.onload = () => {\n- clearInterval(interval)\n+ clearTimeout(timer)\nif (xhr.status === 200) {\nhandleData()\nout.end()\n@@ -73,7 +81,7 @@ export default function(\n}\nxhr.send(JSON.stringify(body))\n- interval = setInterval(handleData, CHECK_LIMIT_INTERVAL)\n+ timer = setTimeout(handleData, CHECK_LIMIT_INTERVAL)\nreturn {\nstream: out,\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Fix data race in streaming CSV parsing
305,164
03.06.2019 10:47:17
25,200
ac0ba3ffcb467e79b91fa0cb9025e6f8dc63d1d7
Update axios dependency
[ { "change_type": "MODIFY", "old_path": "package-lock.json", "new_path": "package-lock.json", "diff": "\"dev\": true\n},\n\"axios\": {\n- \"version\": \"0.18.0\",\n- \"resolved\": \"http://registry.npmjs.org/axios/-/axios-0.18.0.tgz\",\n- \"integrity\": \"sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=\",\n+ \"version\": \"0.19.0\",\n+ \"resolved\": \"https://registry.npmjs.org/axios/-/axios-0.19.0.tgz\",\n+ \"integrity\": \"sha512-1uvKqKQta3KBxIz14F2v06AEHZ/dIoeKfbTRkK1E5oqjDnuEerLmYTgJB5AiQZHJcljpg1TuRzdjDR06qNk0DQ==\",\n\"requires\": {\n- \"follow-redirects\": \"^1.3.0\",\n- \"is-buffer\": \"^1.1.5\"\n+ \"follow-redirects\": \"1.5.10\",\n+ \"is-buffer\": \"^2.0.2\"\n+ },\n+ \"dependencies\": {\n+ \"is-buffer\": {\n+ \"version\": \"2.0.3\",\n+ \"resolved\": \"https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz\",\n+ \"integrity\": \"sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==\"\n+ }\n}\n},\n\"balanced-match\": {\n\"is-buffer\": {\n\"version\": \"1.1.6\",\n\"resolved\": \"https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz\",\n- \"integrity\": \"sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==\"\n+ \"integrity\": \"sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==\",\n+ \"dev\": true\n},\n\"is-ci\": {\n\"version\": \"2.0.0\",\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "{\n\"name\": \"@influxdata/influx\",\n- \"version\": \"0.2.62\",\n+ \"version\": \"0.3.3\",\n\"description\": \"Influxdb v2 client\",\n\"main\": \"dist/index.js\",\n\"scripts\": {\n\"typescript\": \"^3.2.2\"\n},\n\"dependencies\": {\n- \"axios\": \"^0.18.0\"\n+ \"axios\": \"^0.19.0\"\n},\n\"husky\": {\n\"hooks\": {\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Update axios dependency
305,174
20.06.2019 10:27:33
25,200
0911a12853c53bbc3e20092d78e6b1cacf377878
Fix cloning templates with labels
[ { "change_type": "MODIFY", "old_path": "dist/wrappers/templates.js", "new_path": "dist/wrappers/templates.js", "diff": "@@ -175,23 +175,21 @@ var default_1 = (function () {\n};\ndefault_1.prototype.clone = function (templateID, orgID) {\nreturn __awaiter(this, void 0, void 0, function () {\n- var data, labels, content, meta, labelsData, name, templateToCreate, createdTemplate;\n+ var data, content, meta, labels, labelIDs, name, templateToCreate, createdTemplate;\nreturn __generator(this, function (_a) {\nswitch (_a.label) {\ncase 0: return [4, this.service.getDocumentsTemplatesID(templateID, undefined, this.serviceOptions)];\ncase 1:\ndata = (_a.sent()).data;\n- labels = data.labels, content = data.content, meta = data.meta;\n- labelsData = [];\n- if (labels) {\n- labelsData = labels.map(function (l) { return l.name; }).filter(function (b) { return !!b; });\n- }\n+ content = data.content, meta = data.meta;\n+ labels = data.labels || [];\n+ labelIDs = labels.map(function (label) { return label.id; });\nname = meta.name + \" (clone)\";\ntemplateToCreate = {\nmeta: __assign({}, meta, { name: name }),\ncontent: content,\norgID: orgID,\n- labels: labelsData,\n+ labels: labelIDs,\n};\nreturn [4, this.create(templateToCreate)];\ncase 2:\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/templates.ts", "new_path": "src/wrappers/templates.ts", "diff": "@@ -144,12 +144,10 @@ export default class {\nthis.serviceOptions\n)\n- const {labels, content, meta} = data\n+ const {content, meta} = data\n- let labelsData: string[] = []\n- if (labels) {\n- labelsData = labels.map(l => l.name).filter((b): b is string => !!b)\n- }\n+ const labels = data.labels || []\n+ const labelIDs = labels.map(label => label.id as string)\nconst name = `${meta.name} (clone)`\n@@ -157,7 +155,7 @@ export default class {\nmeta: {...meta, name},\ncontent,\norgID,\n- labels: labelsData,\n+ labels: labelIDs,\n}\nconst createdTemplate = await this.create(templateToCreate)\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Fix cloning templates with labels
305,168
20.06.2019 14:58:12
25,200
9fb321e6199692b2711fc8b40874553a05d74a9d
Update tasks wrapper's create to include token in post api
[ { "change_type": "MODIFY", "old_path": "dist/wrappers/tasks.d.ts", "new_path": "dist/wrappers/tasks.d.ts", "diff": "@@ -2,10 +2,11 @@ import { LogEvent, Run, Task, User } from '../api';\nimport { ILabel, ITask, ServiceOptions } from '../types';\nexport default class {\nprivate service;\n+ private authService;\nprivate serviceOptions;\nconstructor(basePath: string, baseOptions: ServiceOptions);\n- create(org: string, script: string): Promise<ITask>;\n- createByOrgID(orgID: string, script: string): Promise<ITask>;\n+ create(org: string, script: string, token: string): Promise<ITask>;\n+ createByOrgID(orgID: string, script: string, token: string): Promise<ITask>;\nget(id: string): Promise<ITask>;\ngetAll(orgID?: string): Promise<ITask[]>;\ngetAllByOrg(org: string): Promise<ITask[]>;\n" }, { "change_type": "MODIFY", "old_path": "dist/wrappers/tasks.js", "new_path": "dist/wrappers/tasks.js", "diff": "@@ -59,12 +59,12 @@ var default_1 = (function () {\nthis.service = new api_1.TasksApi({ basePath: basePath, baseOptions: baseOptions });\nthis.serviceOptions = baseOptions;\n}\n- default_1.prototype.create = function (org, script) {\n+ default_1.prototype.create = function (org, script, token) {\nreturn __awaiter(this, void 0, void 0, function () {\nvar data;\nreturn __generator(this, function (_a) {\nswitch (_a.label) {\n- case 0: return [4, this.service.postTasks({ org: org, flux: script }, undefined, this.serviceOptions)];\n+ case 0: return [4, this.service.postTasks({ org: org, flux: script, token: token }, undefined, this.serviceOptions)];\ncase 1:\ndata = (_a.sent()).data;\nreturn [2, addDefaults(data)];\n@@ -72,12 +72,12 @@ var default_1 = (function () {\n});\n});\n};\n- default_1.prototype.createByOrgID = function (orgID, script) {\n+ default_1.prototype.createByOrgID = function (orgID, script, token) {\nreturn __awaiter(this, void 0, void 0, function () {\nvar data;\nreturn __generator(this, function (_a) {\nswitch (_a.label) {\n- case 0: return [4, this.service.postTasks({ orgID: orgID, flux: script }, undefined, this.serviceOptions)];\n+ case 0: return [4, this.service.postTasks({ orgID: orgID, flux: script, token: token }, undefined, this.serviceOptions)];\ncase 1:\ndata = (_a.sent()).data;\nreturn [2, addDefaults(data)];\n@@ -260,20 +260,23 @@ var default_1 = (function () {\n};\ndefault_1.prototype.clone = function (taskID) {\nreturn __awaiter(this, void 0, void 0, function () {\n- var original, createdTask;\n+ var original, data, createdTask;\nreturn __generator(this, function (_a) {\nswitch (_a.label) {\ncase 0: return [4, this.get(taskID)];\ncase 1:\noriginal = _a.sent();\n- return [4, this.create(original.org || '', original.flux)];\n+ return [4, this.authService.getAuthorizationsID(original.authorizationID || '')];\ncase 2:\n+ data = (_a.sent()).data;\n+ return [4, this.create(original.org || '', original.flux, data.token || '')];\n+ case 3:\ncreatedTask = _a.sent();\nif (!createdTask || !createdTask.id) {\nthrow new Error('Could not create task');\n}\nreturn [4, this.cloneLabels(original, createdTask)];\n- case 3:\n+ case 4:\n_a.sent();\nreturn [2, this.get(createdTask.id)];\n}\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/tasks.ts", "new_path": "src/wrappers/tasks.ts", "diff": "-import {LogEvent, Run, Task, TasksApi, User} from '../api'\n+import {LogEvent, Run, Task, TasksApi, User, AuthorizationsApi} from '../api'\nimport {ILabel, ITask, ServiceOptions} from '../types'\nimport {addLabelDefaults} from './labels'\n@@ -14,6 +14,7 @@ const addDefaultsToAll = (tasks: Task[]): ITask[] =>\nexport default class {\nprivate service: TasksApi\n+ private authService: AuthorizationsApi\nprivate serviceOptions: ServiceOptions\nconstructor(basePath: string, baseOptions: ServiceOptions) {\n@@ -21,9 +22,13 @@ export default class {\nthis.serviceOptions = baseOptions\n}\n- public async create(org: string, script: string): Promise<ITask> {\n+ public async create(\n+ org: string,\n+ script: string,\n+ token: string\n+ ): Promise<ITask> {\nconst {data} = await this.service.postTasks(\n- {org, flux: script},\n+ {org, flux: script, token},\nundefined,\nthis.serviceOptions\n)\n@@ -31,9 +36,13 @@ export default class {\nreturn addDefaults(data)\n}\n- public async createByOrgID(orgID: string, script: string): Promise<ITask> {\n+ public async createByOrgID(\n+ orgID: string,\n+ script: string,\n+ token: string\n+ ): Promise<ITask> {\nconst {data} = await this.service.postTasks(\n- {orgID, flux: script},\n+ {orgID, flux: script, token},\nundefined,\nthis.serviceOptions\n)\n@@ -224,7 +233,15 @@ export default class {\npublic async clone(taskID: string): Promise<ITask> {\nconst original = await this.get(taskID)\n- const createdTask = await this.create(original.org || '', original.flux)\n+ const {data} = await this.authService.getAuthorizationsID(\n+ original.authorizationID || ''\n+ )\n+\n+ const createdTask = await this.create(\n+ original.org || '',\n+ original.flux,\n+ data.token || ''\n+ )\nif (!createdTask || !createdTask.id) {\nthrow new Error('Could not create task')\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Update tasks wrapper's create to include token in post api
305,168
20.06.2019 15:16:45
25,200
f67dc5a78c3f9f940de6ad259fea91ed3eba0dce
Fix initialization for authService in tasks wrapper
[ { "change_type": "MODIFY", "old_path": "dist/wrappers/tasks.js", "new_path": "dist/wrappers/tasks.js", "diff": "@@ -57,6 +57,7 @@ var addDefaultsToAll = function (tasks) {\nvar default_1 = (function () {\nfunction default_1(basePath, baseOptions) {\nthis.service = new api_1.TasksApi({ basePath: basePath, baseOptions: baseOptions });\n+ this.authService = new api_1.AuthorizationsApi({ basePath: basePath, baseOptions: baseOptions });\nthis.serviceOptions = baseOptions;\n}\ndefault_1.prototype.create = function (org, script, token) {\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/tasks.ts", "new_path": "src/wrappers/tasks.ts", "diff": "@@ -19,6 +19,7 @@ export default class {\nconstructor(basePath: string, baseOptions: ServiceOptions) {\nthis.service = new TasksApi({basePath, baseOptions})\n+ this.authService = new AuthorizationsApi({basePath, baseOptions})\nthis.serviceOptions = baseOptions\n}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Fix initialization for authService in tasks wrapper
305,174
21.06.2019 14:09:01
25,200
e82fa82ee0aa26e5de8331ce29c095c87148bc0c
Update README.md, publish scripts
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -48,19 +48,27 @@ const response = await client.write.create('orgID', 'bucketID', data)\n```\n-## Development requirements\n+## Development\n+\n+### Requirements\n- OpenJDK 8 or higher\n- Node 10.x or higher\n-## Development\n+### Installing dependencies\n+\n+```\n+yarn\n+```\n+\n+### Generating base from swagger\n```\n-npm i\n+yarn run generate\n```\n-## Generating base from swagger\n+### Releasing a new version\n```\n-npm run generate\n+yarn version\n```\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"lint\": \"eslint 'src/**/*.ts'\",\n\"lint:fix\": \"eslint --fix 'src/**/*.ts'\",\n\"generate\": \"openapi-generator generate -g typescript-axios -o src/api -i https://raw.githubusercontent.com/influxdata/influxdb/master/http/swagger.yml\",\n- \"prepublishOnly\": \"yarn install --frozen-lockfile && yarn run test && yarn run build && bump --commit 'Release v%s' --tag 'v%s' --push\"\n+ \"preversion\": \"yarn install --frozen-lockfile && yarn run test && yarn run build\",\n+ \"postversion\": \"yarn publish --access public && git push && echo \\\"Successfully released version $npm_package_version!\\\"\"\n},\n\"homepage\": \"https://github.com/influxdata/influxdb-client-js\",\n\"keywords\": [\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Update README.md, publish scripts
305,174
21.06.2019 14:14:34
25,200
392728df50ca191281dc80fb614d568b669097b8
Tweak publish workflow
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -70,5 +70,5 @@ yarn run generate\n### Releasing a new version\n```\n-yarn version\n+yarn publish --access=public\n```\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"lint:fix\": \"eslint --fix 'src/**/*.ts'\",\n\"generate\": \"openapi-generator generate -g typescript-axios -o src/api -i https://raw.githubusercontent.com/influxdata/influxdb/master/http/swagger.yml\",\n\"preversion\": \"yarn install --frozen-lockfile && yarn run test && yarn run build\",\n- \"postversion\": \"yarn publish --access public && git push && echo \\\"Successfully released version $npm_package_version!\\\"\"\n+ \"postversion\": \"git push --tags && echo \\\"Successfully released version $npm_package_version!\\\"\"\n},\n\"homepage\": \"https://github.com/influxdata/influxdb-client-js\",\n\"keywords\": [\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Tweak publish workflow
305,174
03.07.2019 09:40:21
25,200
8c6a13b4dca152415055ee4078d5e617c1a8e08c
Add publishing script
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -69,6 +69,15 @@ yarn run generate\n### Releasing a new version\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 logged into Yarn (`yarn login`)\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-yarn publish --access=public\n+./publish\n```\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"typecheck\": \"tsc --noEmit --pretty\",\n\"lint\": \"eslint 'src/**/*.ts'\",\n\"lint:fix\": \"eslint --fix 'src/**/*.ts'\",\n- \"generate\": \"openapi-generator generate -g typescript-axios -o src/api -i https://raw.githubusercontent.com/influxdata/influxdb/master/http/swagger.yml\",\n- \"preversion\": \"yarn install --frozen-lockfile && yarn run test && yarn run build\",\n- \"postversion\": \"git push --tags && echo \\\"Successfully released version $npm_package_version!\\\"\"\n+ \"generate\": \"openapi-generator generate -g typescript-axios -o src/api -i https://raw.githubusercontent.com/influxdata/influxdb/master/http/swagger.yml\"\n},\n\"homepage\": \"https://github.com/influxdata/influxdb-client-js\",\n\"keywords\": [\n" }, { "change_type": "ADD", "old_path": null, "new_path": "publish", "diff": "+yarn install --frozen-lockfile && \\\n+ yarn run test && \\\n+ yarn run build && \\\n+ yarn publish --minor --access=public && \\\n+ git push --follow-tags && \\\n+ echo \"Publish successful\"\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add publishing script
305,161
12.07.2019 14:44:43
25,200
0ab3542b01ba6edd9582468ed7f1ef67b698e0fd
Add oathID to user
[ { "change_type": "MODIFY", "old_path": "src/api/api.ts", "new_path": "src/api/api.ts", "diff": "@@ -6207,6 +6207,12 @@ export interface User {\n* @memberof User\n*/\nid?: string;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof User\n+ */\n+ oauthID?: string;\n/**\n*\n* @type {string}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add oathID to user
305,161
15.07.2019 17:32:21
25,200
6dd928a69e22541175255d54a9a80153f808250d
Add wrappers for checks and notifications
[ { "change_type": "MODIFY", "old_path": "src/index.ts", "new_path": "src/index.ts", "diff": "@@ -19,8 +19,8 @@ export {CancellationError, LargeResponseError} from './utils/errors'\nexport * from './api'\nexport * from './types'\n-// Must locally re-export manually generated ast types to resolve\n-// ts compiler ambiguity with swagger generated AST types.\n+// Must locally re-export manually generated types to resolve\n+// ts compiler ambiguity with swagger generated types.\nexport {\nArrayExpression,\nBadStatement,\n@@ -62,6 +62,8 @@ export {\nVariableAssignment,\n} from './types/ast'\n+export {Check, NotificationRule, ThresholdCheck} from './types/alerts'\n+\nexport class Client {\npublic auth: Auth\npublic authorizations: Authorizations\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/types/alerts.ts", "diff": "+import {\n+ DeadmanCheck,\n+ ThresholdCheck as ThresholdCheckGen,\n+ GreaterThreshold as GreaterThresholdGen,\n+ LesserThreshold as LesserThresholdGen,\n+ RangeThreshold as RangeThresholdGen,\n+ SlackNotificationRule,\n+ PagerDutyNotificationRule,\n+ SMTPNotificationRule,\n+} from '../api'\n+\n+export interface ThresholdCheck extends ThresholdCheckGen {\n+ thresholds: Array<\n+ GreaterThresholdGen | LesserThresholdGen | RangeThresholdGen\n+ >\n+}\n+\n+export type Check = DeadmanCheck | ThresholdCheck\n+\n+export type NotificationRule =\n+ | SlackNotificationRule\n+ | PagerDutyNotificationRule\n+ | SMTPNotificationRule\n" }, { "change_type": "MODIFY", "old_path": "src/types/index.ts", "new_path": "src/types/index.ts", "diff": "export * from './labels'\nexport * from './templates'\nexport * from './ast'\n+export * from './alerts'\nexport interface ServiceOptions {\nheaders?: {\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/wrappers/checks.ts", "diff": "+import {ChecksApi} from '../api'\n+import {Check, ServiceOptions} from '../types'\n+import {addLabelDefaults} from './labels'\n+import {AxiosResponse} from 'axios'\n+\n+const addDefaults = (check: Check): Check => ({\n+ ...check,\n+ labels: (check.labels || []).map(addLabelDefaults),\n+})\n+\n+const addDefaultsToAll = (checks: Check[]): Check[] => checks.map(addDefaults)\n+\n+export default class {\n+ private service: ChecksApi\n+ private serviceOptions: ServiceOptions\n+\n+ constructor(basePath: string, baseOptions: ServiceOptions) {\n+ this.service = new ChecksApi({basePath, baseOptions})\n+ this.serviceOptions = baseOptions\n+ }\n+\n+ public async get(id: string): Promise<Check> {\n+ const {data} = (await this.service.getChecksID(\n+ id,\n+ undefined,\n+ this.serviceOptions\n+ )) as AxiosResponse<Check>\n+\n+ return addDefaults(data)\n+ }\n+\n+ public async getAll(orgID: string): Promise<Check[]> {\n+ const {data} = (await this.service.getChecks(\n+ orgID,\n+ undefined,\n+ undefined,\n+ this.serviceOptions\n+ )) as AxiosResponse<Array<Check>>\n+\n+ return addDefaultsToAll(data || [])\n+ }\n+\n+ public async create(check: Check): Promise<Check> {\n+ const {data} = (await this.service.createCheck(\n+ check,\n+ this.serviceOptions\n+ )) as AxiosResponse<Check>\n+\n+ return addDefaults(data)\n+ }\n+\n+ public async update(id: string, check: Partial<Check>): Promise<Check> {\n+ const {data} = (await this.service.patchChecksID(\n+ id,\n+ check,\n+ undefined,\n+ this.serviceOptions\n+ )) as AxiosResponse<Check>\n+\n+ return addDefaults(data)\n+ }\n+\n+ public async delete(id: string): Promise<Response> {\n+ const {data} = await this.service.deleteChecksID(\n+ id,\n+ undefined,\n+ this.serviceOptions\n+ )\n+\n+ return data\n+ }\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/wrappers/notifications.ts", "diff": "+import {NotificationRulesApi} from '../api'\n+import {NotificationRule, ServiceOptions} from '../types'\n+import {addLabelDefaults} from './labels'\n+import {AxiosResponse} from 'axios'\n+\n+const addDefaults = (notificationRule: NotificationRule): NotificationRule => ({\n+ ...notificationRule,\n+ labels: (notificationRule.labels || []).map(addLabelDefaults),\n+})\n+\n+const addDefaultsToAll = (\n+ notificationRule: NotificationRule[]\n+): NotificationRule[] => notificationRule.map(addDefaults)\n+\n+export default class {\n+ private service: NotificationRulesApi\n+ private serviceOptions: ServiceOptions\n+\n+ constructor(basePath: string, baseOptions: ServiceOptions) {\n+ this.service = new NotificationRulesApi({basePath, baseOptions})\n+ this.serviceOptions = baseOptions\n+ }\n+\n+ public async get(id: string): Promise<NotificationRule> {\n+ const {data} = (await this.service.getNotificationRulesID(\n+ id,\n+ undefined,\n+ this.serviceOptions\n+ )) as AxiosResponse<NotificationRule>\n+\n+ return addDefaults(data)\n+ }\n+\n+ public async getAll(orgID: string): Promise<NotificationRule[]> {\n+ const {data} = (await this.service.getNotificationRules(\n+ orgID,\n+ undefined,\n+ undefined,\n+ undefined,\n+ this.serviceOptions\n+ )) as AxiosResponse<Array<NotificationRule>>\n+\n+ return addDefaultsToAll(data || [])\n+ }\n+\n+ public async getAllForCheck(\n+ orgID: string,\n+ checkID: string\n+ ): Promise<NotificationRule[]> {\n+ const {data} = (await this.service.getNotificationRules(\n+ orgID,\n+ undefined,\n+ undefined,\n+ checkID,\n+ this.serviceOptions\n+ )) as AxiosResponse<Array<NotificationRule>>\n+\n+ return addDefaultsToAll(data || [])\n+ }\n+\n+ public async create(\n+ notificationRule: NotificationRule\n+ ): Promise<NotificationRule> {\n+ const {data} = (await this.service.createNotificationRule(\n+ notificationRule,\n+ this.serviceOptions\n+ )) as AxiosResponse<NotificationRule>\n+\n+ return addDefaults(data)\n+ }\n+\n+ public async update(\n+ id: string,\n+ notificationRule: Partial<NotificationRule>\n+ ): Promise<NotificationRule> {\n+ const {data} = (await this.service.patchNotificationRulesID(\n+ id,\n+ notificationRule,\n+ undefined,\n+ this.serviceOptions\n+ )) as AxiosResponse<NotificationRule>\n+\n+ return addDefaults(data)\n+ }\n+\n+ public async delete(id: string): Promise<Response> {\n+ const {data} = await this.service.deleteNotificationRulesID(\n+ id,\n+ undefined,\n+ this.serviceOptions\n+ )\n+\n+ return data\n+ }\n+}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add wrappers for checks and notifications
305,161
16.07.2019 12:21:47
25,200
137477d1eb74766a2732b6ec9ca094a96c0b4139
fix getAll in checks and notifications
[ { "change_type": "MODIFY", "old_path": "src/index.ts", "new_path": "src/index.ts", "diff": "@@ -62,7 +62,13 @@ export {\nVariableAssignment,\n} from './types/ast'\n-export {Check, NotificationRule, ThresholdCheck} from './types/alerts'\n+export {\n+ Check,\n+ NotificationRule,\n+ ThresholdCheck,\n+ Checks,\n+ NotificationRules,\n+} from './types/alerts'\nexport class Client {\npublic auth: Auth\n" }, { "change_type": "MODIFY", "old_path": "src/types/alerts.ts", "new_path": "src/types/alerts.ts", "diff": "@@ -7,6 +7,7 @@ import {\nSlackNotificationRule,\nPagerDutyNotificationRule,\nSMTPNotificationRule,\n+ Links,\n} from '../api'\nexport interface ThresholdCheck extends ThresholdCheckGen {\n@@ -17,7 +18,17 @@ export interface ThresholdCheck extends ThresholdCheckGen {\nexport type Check = DeadmanCheck | ThresholdCheck\n+export interface Checks {\n+ checks: Array<Check>\n+ links: Links\n+}\n+\nexport type NotificationRule =\n| SlackNotificationRule\n| PagerDutyNotificationRule\n| SMTPNotificationRule\n+\n+export interface NotificationRules {\n+ notificationRules: Array<NotificationRule>\n+ links: Links\n+}\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/checks.ts", "new_path": "src/wrappers/checks.ts", "diff": "import {ChecksApi} from '../api'\n-import {Check, ServiceOptions} from '../types'\n+import {Check, Checks, ServiceOptions} from '../types'\nimport {addLabelDefaults} from './labels'\nimport {AxiosResponse} from 'axios'\n@@ -30,14 +30,16 @@ export default class {\n}\npublic async getAll(orgID: string): Promise<Check[]> {\n- const {data} = (await this.service.getChecks(\n+ const {\n+ data: {checks},\n+ } = (await this.service.getChecks(\norgID,\nundefined,\nundefined,\nthis.serviceOptions\n- )) as AxiosResponse<Array<Check>>\n+ )) as AxiosResponse<Checks>\n- return addDefaultsToAll(data || [])\n+ return addDefaultsToAll(checks || [])\n}\npublic async create(check: Check): Promise<Check> {\n" }, { "change_type": "MODIFY", "old_path": "src/wrappers/notifications.ts", "new_path": "src/wrappers/notifications.ts", "diff": "import {NotificationRulesApi} from '../api'\n-import {NotificationRule, ServiceOptions} from '../types'\n+import {NotificationRule, ServiceOptions, NotificationRules} from '../types'\nimport {addLabelDefaults} from './labels'\nimport {AxiosResponse} from 'axios'\n@@ -32,30 +32,34 @@ export default class {\n}\npublic async getAll(orgID: string): Promise<NotificationRule[]> {\n- const {data} = (await this.service.getNotificationRules(\n+ const {\n+ data: {notificationRules},\n+ } = (await this.service.getNotificationRules(\norgID,\nundefined,\nundefined,\nundefined,\nthis.serviceOptions\n- )) as AxiosResponse<Array<NotificationRule>>\n+ )) as AxiosResponse<NotificationRules>\n- return addDefaultsToAll(data || [])\n+ return addDefaultsToAll(notificationRules || [])\n}\npublic async getAllForCheck(\norgID: string,\ncheckID: string\n): Promise<NotificationRule[]> {\n- const {data} = (await this.service.getNotificationRules(\n+ const {\n+ data: {notificationRules},\n+ } = (await this.service.getNotificationRules(\norgID,\nundefined,\nundefined,\ncheckID,\nthis.serviceOptions\n- )) as AxiosResponse<Array<NotificationRule>>\n+ )) as AxiosResponse<NotificationRules>\n- return addDefaultsToAll(data || [])\n+ return addDefaultsToAll(notificationRules || [])\n}\npublic async create(\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
fix getAll in checks and notifications
305,161
17.07.2019 11:17:54
25,200
6c2435d03fd3e96ac50e38c67e69ad6937ebfcac
regenerate after view and type additions to swagger
[ { "change_type": "MODIFY", "old_path": "src/api/api.ts", "new_path": "src/api/api.ts", "diff": "@@ -796,6 +796,12 @@ export interface CheckBase {\n* @memberof CheckBase\n*/\nid?: string;\n+ /**\n+ *\n+ * @type {CheckType}\n+ * @memberof CheckBase\n+ */\n+ type: CheckType;\n/**\n*\n* @type {string}\n@@ -927,15 +933,19 @@ export enum CheckStatusLevel {\n/**\n*\n* @export\n- * @interface CheckViewProperties\n+ * @enum {string}\n*/\n-export interface CheckViewProperties {\n+export enum CheckType {\n+ Deadman = 'deadman',\n+ Threshold = 'threshold'\n+}\n+\n/**\n*\n- * @type {string}\n- * @memberof CheckViewProperties\n+ * @export\n+ * @interface CheckViewProperties\n*/\n- type?: CheckViewProperties.TypeEnum;\n+export interface CheckViewProperties extends ViewProperties {\n/**\n*\n* @type {string}\n@@ -955,13 +965,6 @@ export interface CheckViewProperties {\n* @namespace CheckViewProperties\n*/\nexport namespace CheckViewProperties {\n- /**\n- * @export\n- * @enum {string}\n- */\n- export enum TypeEnum {\n- Check = 'check'\n- }\n}\n/**\n@@ -1864,12 +1867,6 @@ export interface FunctionExpression {\n* @interface GaugeViewProperties\n*/\nexport interface GaugeViewProperties extends ViewProperties {\n- /**\n- *\n- * @type {string}\n- * @memberof GaugeViewProperties\n- */\n- type?: GaugeViewProperties.TypeEnum;\n/**\n*\n* @type {string}\n@@ -1901,13 +1898,6 @@ export interface GaugeViewProperties extends ViewProperties {\n* @namespace GaugeViewProperties\n*/\nexport namespace GaugeViewProperties {\n- /**\n- * @export\n- * @enum {string}\n- */\n- export enum TypeEnum {\n- Gauge = 'gauge'\n- }\n}\n/**\n@@ -1915,7 +1905,7 @@ export namespace GaugeViewProperties {\n* @export\n* @interface GreaterThreshold\n*/\n-export interface GreaterThreshold extends ThresholdConfig {\n+export interface GreaterThreshold extends ThresholdBase {\n/**\n*\n* @type {number}\n@@ -1974,15 +1964,90 @@ export namespace HealthCheck {\n/**\n*\n* @export\n- * @interface HistogramViewProperties\n+ * @interface HeatmapViewProperties\n*/\n-export interface HistogramViewProperties extends ViewProperties {\n+export interface HeatmapViewProperties extends ViewProperties {\n/**\n*\n* @type {string}\n- * @memberof HistogramViewProperties\n+ * @memberof HeatmapViewProperties\n*/\n- type?: HistogramViewProperties.TypeEnum;\n+ xColumn?: string;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof HeatmapViewProperties\n+ */\n+ yColumn?: string;\n+ /**\n+ *\n+ * @type {Array<number>}\n+ * @memberof HeatmapViewProperties\n+ */\n+ xDomain?: Array<number>;\n+ /**\n+ *\n+ * @type {Array<number>}\n+ * @memberof HeatmapViewProperties\n+ */\n+ yDomain?: Array<number>;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof HeatmapViewProperties\n+ */\n+ xAxisLabel?: string;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof HeatmapViewProperties\n+ */\n+ yAxisLabel?: string;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof HeatmapViewProperties\n+ */\n+ xPrefix?: string;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof HeatmapViewProperties\n+ */\n+ xSuffix?: string;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof HeatmapViewProperties\n+ */\n+ yPrefix?: string;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof HeatmapViewProperties\n+ */\n+ ySuffix?: string;\n+ /**\n+ *\n+ * @type {number}\n+ * @memberof HeatmapViewProperties\n+ */\n+ binSize?: number;\n+}\n+\n+/**\n+ * @export\n+ * @namespace HeatmapViewProperties\n+ */\n+export namespace HeatmapViewProperties {\n+}\n+\n+/**\n+ *\n+ * @export\n+ * @interface HistogramViewProperties\n+ */\n+export interface HistogramViewProperties extends ViewProperties {\n/**\n*\n* @type {string}\n@@ -2026,13 +2091,6 @@ export interface HistogramViewProperties extends ViewProperties {\n* @namespace HistogramViewProperties\n*/\nexport namespace HistogramViewProperties {\n- /**\n- * @export\n- * @enum {string}\n- */\n- export enum TypeEnum {\n- Histogram = 'histogram'\n- }\n}\n/**\n@@ -2336,7 +2394,7 @@ export namespace Legend {\n* @export\n* @interface LesserThreshold\n*/\n-export interface LesserThreshold extends ThresholdConfig {\n+export interface LesserThreshold extends ThresholdBase {\n/**\n*\n* @type {number}\n@@ -2392,12 +2450,6 @@ export interface LinePlusSingleStatProperties extends ViewProperties {\n* @memberof LinePlusSingleStatProperties\n*/\naxes?: Axes;\n- /**\n- *\n- * @type {string}\n- * @memberof LinePlusSingleStatProperties\n- */\n- type?: LinePlusSingleStatProperties.TypeEnum;\n/**\n*\n* @type {Legend}\n@@ -2429,13 +2481,6 @@ export interface LinePlusSingleStatProperties extends ViewProperties {\n* @namespace LinePlusSingleStatProperties\n*/\nexport namespace LinePlusSingleStatProperties {\n- /**\n- * @export\n- * @enum {string}\n- */\n- export enum TypeEnum {\n- LinePlusSingleStat = 'line-plus-single-stat'\n- }\n}\n/**\n@@ -2587,18 +2632,6 @@ export interface LogEvent {\n* @interface LogViewProperties\n*/\nexport interface LogViewProperties {\n- /**\n- *\n- * @type {string}\n- * @memberof LogViewProperties\n- */\n- shape: LogViewProperties.ShapeEnum;\n- /**\n- *\n- * @type {string}\n- * @memberof LogViewProperties\n- */\n- type: LogViewProperties.TypeEnum;\n/**\n* Defines the order, names, and visibility of columns in the log viewer table\n* @type {Array<LogViewerColumn>}\n@@ -2607,27 +2640,6 @@ export interface LogViewProperties {\ncolumns: Array<LogViewerColumn>;\n}\n-/**\n- * @export\n- * @namespace LogViewProperties\n- */\n-export namespace LogViewProperties {\n- /**\n- * @export\n- * @enum {string}\n- */\n- export enum ShapeEnum {\n- ChronografV2 = 'chronograf-v2'\n- }\n- /**\n- * @export\n- * @enum {string}\n- */\n- export enum TypeEnum {\n- LogViewer = 'log-viewer'\n- }\n-}\n-\n/**\n* Contains a specific column's settings.\n* @export\n@@ -2771,13 +2783,13 @@ export interface MarkdownViewProperties {\n* @type {string}\n* @memberof MarkdownViewProperties\n*/\n- type?: MarkdownViewProperties.TypeEnum;\n+ note?: string;\n/**\n*\n* @type {string}\n* @memberof MarkdownViewProperties\n*/\n- note?: string;\n+ type?: MarkdownViewProperties.TypeEnum;\n}\n/**\n@@ -3017,6 +3029,12 @@ export interface NotificationEndpointBase {\n* @memberof NotificationEndpointBase\n*/\nlabels?: Array<Label>;\n+ /**\n+ *\n+ * @type {NotificationEndpointType}\n+ * @memberof NotificationEndpointBase\n+ */\n+ type: NotificationEndpointType;\n}\n/**\n@@ -3034,6 +3052,18 @@ export namespace NotificationEndpointBase {\n}\n}\n+/**\n+ *\n+ * @export\n+ * @enum {string}\n+ */\n+export enum NotificationEndpointType {\n+ Slack = 'slack',\n+ Smtp = 'smtp',\n+ Pagerduty = 'pagerduty',\n+ Webhook = 'webhook'\n+}\n+\n/**\n*\n* @export\n@@ -3118,11 +3148,11 @@ export interface NotificationRuleBase {\n*/\nname?: string;\n/**\n- * the type of notification\n- * @type {string}\n+ *\n+ * @type {NotificationRuleType}\n* @memberof NotificationRuleBase\n*/\n- type?: NotificationRuleBase.TypeEnum;\n+ type: NotificationRuleType;\n/**\n*\n* @type {string}\n@@ -3198,16 +3228,18 @@ export namespace NotificationRuleBase {\nActive = 'active',\nInactive = 'inactive'\n}\n+}\n+\n/**\n+ *\n* @export\n* @enum {string}\n*/\n- export enum TypeEnum {\n+export enum NotificationRuleType {\nSlack = 'slack',\nSmtp = 'smtp',\nPagerduty = 'pagerduty'\n}\n-}\n/**\n*\n@@ -4060,7 +4092,7 @@ export interface QueryVariablePropertiesValues {\n* @export\n* @interface RangeThreshold\n*/\n-export interface RangeThreshold extends ThresholdConfig {\n+export interface RangeThreshold extends ThresholdBase {\n/**\n*\n* @type {number}\n@@ -4685,6 +4717,93 @@ export interface SMTPNotificationRule extends NotificationRuleBase {\nexport namespace SMTPNotificationRule {\n}\n+/**\n+ *\n+ * @export\n+ * @interface ScatterViewProperties\n+ */\n+export interface ScatterViewProperties extends ViewProperties {\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof ScatterViewProperties\n+ */\n+ xColumn?: string;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof ScatterViewProperties\n+ */\n+ yColumn?: string;\n+ /**\n+ *\n+ * @type {Array<string>}\n+ * @memberof ScatterViewProperties\n+ */\n+ fillColumns?: Array<string>;\n+ /**\n+ *\n+ * @type {Array<string>}\n+ * @memberof ScatterViewProperties\n+ */\n+ symbolColumns?: Array<string>;\n+ /**\n+ *\n+ * @type {Array<number>}\n+ * @memberof ScatterViewProperties\n+ */\n+ xDomain?: Array<number>;\n+ /**\n+ *\n+ * @type {Array<number>}\n+ * @memberof ScatterViewProperties\n+ */\n+ yDomain?: Array<number>;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof ScatterViewProperties\n+ */\n+ xAxisLabel?: string;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof ScatterViewProperties\n+ */\n+ yAxisLabel?: string;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof ScatterViewProperties\n+ */\n+ xPrefix?: string;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof ScatterViewProperties\n+ */\n+ xSuffix?: string;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof ScatterViewProperties\n+ */\n+ yPrefix?: string;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof ScatterViewProperties\n+ */\n+ ySuffix?: string;\n+}\n+\n+/**\n+ * @export\n+ * @namespace ScatterViewProperties\n+ */\n+export namespace ScatterViewProperties {\n+}\n+\n/**\n*\n* @export\n@@ -4824,12 +4943,6 @@ export interface SecretKeysResponse extends SecretKeys {\n* @interface SingleStatViewProperties\n*/\nexport interface SingleStatViewProperties extends ViewProperties {\n- /**\n- *\n- * @type {string}\n- * @memberof SingleStatViewProperties\n- */\n- type?: SingleStatViewProperties.TypeEnum;\n/**\n*\n* @type {string}\n@@ -4861,13 +4974,6 @@ export interface SingleStatViewProperties extends ViewProperties {\n* @namespace SingleStatViewProperties\n*/\nexport namespace SingleStatViewProperties {\n- /**\n- * @export\n- * @enum {string}\n- */\n- export enum TypeEnum {\n- SingleStat = 'single-stat'\n- }\n}\n/**\n@@ -5158,12 +5264,6 @@ export interface StringLiteral {\n* @interface TableViewProperties\n*/\nexport interface TableViewProperties extends ViewProperties {\n- /**\n- *\n- * @type {string}\n- * @memberof TableViewProperties\n- */\n- type?: TableViewProperties.TypeEnum;\n/**\n*\n* @type {any}\n@@ -5195,13 +5295,6 @@ export interface TableViewProperties extends ViewProperties {\n* @namespace TableViewProperties\n*/\nexport namespace TableViewProperties {\n- /**\n- * @export\n- * @enum {string}\n- */\n- export enum TypeEnum {\n- Table = 'table'\n- }\n}\n/**\n@@ -6968,6 +7061,32 @@ export interface TestStatement {\nassignment?: VariableAssignment;\n}\n+/**\n+ *\n+ * @export\n+ * @interface ThresholdBase\n+ */\n+export interface ThresholdBase {\n+ /**\n+ *\n+ * @type {CheckStatusLevel}\n+ * @memberof ThresholdBase\n+ */\n+ level?: CheckStatusLevel;\n+ /**\n+ * if true, only alert if all values meet threshold\n+ * @type {boolean}\n+ * @memberof ThresholdBase\n+ */\n+ allValues?: boolean;\n+ /**\n+ *\n+ * @type {ThresholdType}\n+ * @memberof ThresholdBase\n+ */\n+ type: ThresholdType;\n+}\n+\n/**\n*\n* @export\n@@ -6992,27 +7111,12 @@ export namespace ThresholdCheck {\n/**\n*\n* @export\n- * @interface ThresholdConfig\n- */\n-export interface ThresholdConfig {\n- /**\n- *\n- * @type {CheckStatusLevel}\n- * @memberof ThresholdConfig\n- */\n- level?: CheckStatusLevel;\n- /**\n- * if true, only alert if all values meet threshold\n- * @type {boolean}\n- * @memberof ThresholdConfig\n- */\n- allValues?: boolean;\n- /**\n- *\n- * @type {string}\n- * @memberof ThresholdConfig\n+ * @enum {string}\n*/\n- type?: string;\n+export enum ThresholdType {\n+ Greater = 'greater',\n+ Lesser = 'lesser',\n+ Range = 'range'\n}\n/**\n@@ -7366,12 +7470,24 @@ export interface ViewProperties {\n* @memberof ViewProperties\n*/\ncolors?: Array<DashboardColor>;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof ViewProperties\n+ */\n+ shape?: ViewProperties.ShapeEnum;\n/**\n*\n* @type {string}\n* @memberof ViewProperties\n*/\nnote?: string;\n+ /**\n+ *\n+ * @type {ViewType}\n+ * @memberof ViewProperties\n+ */\n+ type: ViewType;\n/**\n* if true, will display note when empty\n* @type {boolean}\n@@ -7380,6 +7496,40 @@ export interface ViewProperties {\nshowNoteWhenEmpty?: boolean;\n}\n+/**\n+ * @export\n+ * @namespace ViewProperties\n+ */\n+export namespace ViewProperties {\n+ /**\n+ * @export\n+ * @enum {string}\n+ */\n+ export enum ShapeEnum {\n+ ChronografV2 = 'chronograf-v2'\n+ }\n+}\n+\n+/**\n+ *\n+ * @export\n+ * @enum {string}\n+ */\n+export enum ViewType {\n+ Xy = 'xy',\n+ LinePlusSingleStat = 'line-plus-single-stat',\n+ SingleStat = 'single-stat',\n+ Gauge = 'gauge',\n+ Table = 'table',\n+ Markdown = 'markdown',\n+ LogViewer = 'log-viewer',\n+ Histogram = 'histogram',\n+ Heatmap = 'heatmap',\n+ Scatter = 'scatter',\n+ Check = 'check',\n+ Empty = 'empty'\n+}\n+\n/**\n*\n* @export\n@@ -7427,6 +7577,19 @@ export enum WritePrecision {\nNs = 'ns'\n}\n+/**\n+ *\n+ * @export\n+ * @enum {string}\n+ */\n+export enum XYGeomType {\n+ Line = 'line',\n+ Step = 'step',\n+ Stacked = 'stacked',\n+ Bar = 'bar',\n+ MonotoneX = 'monotoneX'\n+}\n+\n/**\n*\n* @export\n@@ -7441,46 +7604,41 @@ export interface XYViewProperties extends ViewProperties {\naxes?: Axes;\n/**\n*\n- * @type {string}\n+ * @type {Legend}\n* @memberof XYViewProperties\n*/\n- type?: XYViewProperties.TypeEnum;\n+ legend?: Legend;\n/**\n*\n- * @type {Legend}\n+ * @type {string}\n* @memberof XYViewProperties\n*/\n- legend?: Legend;\n+ xColumn?: string;\n/**\n*\n* @type {string}\n* @memberof XYViewProperties\n*/\n- geom?: XYViewProperties.GeomEnum;\n-}\n-\n+ yColumn?: string;\n/**\n- * @export\n- * @namespace XYViewProperties\n+ *\n+ * @type {boolean}\n+ * @memberof XYViewProperties\n*/\n-export namespace XYViewProperties {\n+ shadeBelow?: boolean;\n/**\n- * @export\n- * @enum {string}\n+ *\n+ * @type {XYGeomType}\n+ * @memberof XYViewProperties\n*/\n- export enum TypeEnum {\n- Xy = 'xy'\n+ geom?: XYGeomType;\n}\n+\n/**\n* @export\n- * @enum {string}\n+ * @namespace XYViewProperties\n*/\n- export enum GeomEnum {\n- Line = 'line',\n- Step = 'step',\n- Stacked = 'stacked',\n- Bar = 'bar'\n- }\n+export namespace XYViewProperties {\n}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
regenerate after view and type additions to swagger
305,161
17.07.2019 12:03:15
25,200
0e1e4d980fea46bd6f50cd172721f8598052d9e6
Add view type modifications
[ { "change_type": "MODIFY", "old_path": "src/index.ts", "new_path": "src/index.ts", "diff": "@@ -70,6 +70,33 @@ export {\nNotificationRules,\n} from './types/alerts'\n+export {\n+ View,\n+ ViewProperties,\n+ XYViewProperties,\n+ LinePlusSingleStatProperties,\n+ SingleStatViewProperties,\n+ TableViewProperties,\n+ GaugeViewProperties,\n+ HistogramViewProperties,\n+ HeatmapViewProperties,\n+ ScatterViewProperties,\n+ CheckViewProperties,\n+ EmptyViewProperties,\n+ MarkdownViewProperties,\n+ XYView,\n+ LinePlusSingleStatView,\n+ SingleStatView,\n+ TableView,\n+ GaugeView,\n+ HistogramView,\n+ HeatmapView,\n+ ScatterView,\n+ CheckView,\n+ EmptyView,\n+ MarkdownView,\n+} from './types/dashboards'\n+\nexport class Client {\npublic auth: Auth\npublic authorizations: Authorizations\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/types/dashboards.ts", "diff": "+import {\n+ View as ViewGen,\n+ ViewType,\n+ XYViewProperties as XYViewPropertiesGen,\n+ LinePlusSingleStatProperties as LinePlusSingleStatPropertiesGen,\n+ SingleStatViewProperties as SingleStatViewPropertiesGen,\n+ TableViewProperties as TableViewPropertiesGen,\n+ GaugeViewProperties as GaugeViewPropertiesGen,\n+ HistogramViewProperties as HistogramViewPropertiesGen,\n+ HeatmapViewProperties as HeatmapViewPropertiesGen,\n+ ScatterViewProperties as ScatterViewPropertiesGen,\n+ CheckViewProperties as CheckViewPropertiesGen,\n+ RenamableField,\n+} from '../api'\n+\n+export interface View<T extends ViewProperties = ViewProperties>\n+ extends ViewGen {\n+ properties?: T\n+ dashboardID?: string\n+ cellID?: string\n+}\n+\n+export type ViewProperties =\n+ | XYViewProperties\n+ | LinePlusSingleStatProperties\n+ | SingleStatViewProperties\n+ | TableViewProperties\n+ | GaugeViewProperties\n+ | MarkdownViewProperties\n+ | EmptyViewProperties\n+ | HistogramViewProperties\n+ | HeatmapViewProperties\n+ | ScatterViewProperties\n+ | CheckViewProperties\n+\n+export interface XYViewProperties extends XYViewPropertiesGen {\n+ type: ViewType.Xy\n+}\n+export type XYView = View<XYViewProperties>\n+\n+export interface LinePlusSingleStatProperties\n+ extends LinePlusSingleStatPropertiesGen {\n+ type: ViewType.LinePlusSingleStat\n+}\n+export type LinePlusSingleStatView = View<LinePlusSingleStatProperties>\n+\n+export interface SingleStatViewProperties extends SingleStatViewPropertiesGen {\n+ type: ViewType.SingleStat\n+}\n+export type SingleStatView = View<SingleStatViewProperties>\n+\n+export interface TableViewProperties extends TableViewPropertiesGen {\n+ type: ViewType.Table\n+ tableOptions: TableOptions\n+}\n+export type TableView = View<TableViewProperties>\n+\n+export interface GaugeViewProperties extends GaugeViewPropertiesGen {\n+ type: ViewType.Gauge\n+}\n+export type GaugeView = View<GaugeViewProperties>\n+\n+export interface HistogramViewProperties extends HistogramViewPropertiesGen {\n+ type: ViewType.Histogram\n+}\n+export type HistogramView = View<HistogramViewProperties>\n+\n+export interface HeatmapViewProperties extends HeatmapViewPropertiesGen {\n+ type: ViewType.Heatmap\n+}\n+export type HeatmapView = View<HeatmapViewProperties>\n+\n+export interface ScatterViewProperties extends ScatterViewPropertiesGen {\n+ type: ViewType.Scatter\n+}\n+export type ScatterView = View<ScatterViewProperties>\n+\n+export interface CheckViewProperties extends CheckViewPropertiesGen {\n+ type: ViewType.Check\n+}\n+export type CheckView = View<CheckViewProperties>\n+\n+// views which do not extend generated view properties base\n+export interface MarkdownViewProperties {\n+ type: ViewType.Markdown\n+ text: string\n+}\n+export type MarkdownView = View<MarkdownViewProperties>\n+\n+export interface EmptyViewProperties {\n+ type: ViewType.Empty\n+}\n+export type EmptyView = View<EmptyViewProperties>\n+\n+//\n+\n+export interface TableOptions {\n+ verticalTimeAxis: boolean\n+ sortBy: RenamableField\n+ wrapping: TableWrappingType\n+ fixFirstColumn: boolean\n+}\n+\n+export enum TableWrappingType {\n+ Truncate = 'truncate',\n+ Wrap = 'wrap',\n+ SingleLine = 'single-line',\n+}\n" }, { "change_type": "MODIFY", "old_path": "src/types/index.ts", "new_path": "src/types/index.ts", "diff": "@@ -2,6 +2,7 @@ export * from './labels'\nexport * from './templates'\nexport * from './ast'\nexport * from './alerts'\n+export * from './dashboards'\nexport interface ServiceOptions {\nheaders?: {\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add view type modifications
305,161
17.07.2019 12:15:54
25,200
467fef3199a498c7ad3ad9e280abf4966f138179
Add new wrappers to client class
[ { "change_type": "MODIFY", "old_path": "src/index.ts", "new_path": "src/index.ts", "diff": "@@ -14,6 +14,8 @@ import Users from './wrappers/users'\nimport Variables from './wrappers/variables'\nimport Write from './wrappers/write'\nimport Templates from './wrappers/templates'\n+import Checks from './wrappers/checks'\n+import NotificationRules from './wrappers/notifications'\nexport {CancellationError, LargeResponseError} from './utils/errors'\n@@ -114,6 +116,8 @@ export class Client {\npublic variables: Variables\npublic write: Write\npublic templates: Templates\n+ public checks: Checks\n+ public notificationRules: NotificationRules\nconstructor(basePath: string, token?: string) {\nlet options = {}\n@@ -138,5 +142,7 @@ export class Client {\nthis.variables = new Variables(basePath, options)\nthis.write = new Write(basePath, options)\nthis.templates = new Templates(basePath, options)\n+ this.checks = new Checks(basePath, options)\n+ this.notificationRules = new NotificationRules(basePath, options)\n}\n}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add new wrappers to client class
305,161
17.07.2019 20:24:23
25,200
7bdaf9760947c1391f8028fbad9470eda5d87d87
Release patch versions with ./publish
[ { "change_type": "MODIFY", "old_path": "publish", "new_path": "publish", "diff": "yarn install --frozen-lockfile && \\\nyarn run test && \\\nyarn run build && \\\n- yarn publish --minor --access=public && \\\n+ yarn publish --patch --access=public && \\\ngit push --follow-tags && \\\necho \"Publish successful\"\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Release patch versions with ./publish
305,161
17.07.2019 20:29:07
25,200
cf7b9c60932b0162ab4c5466bad0fbe6f8094034
generate dashboard query types
[ { "change_type": "MODIFY", "old_path": "src/api/api.ts", "new_path": "src/api/api.ts", "diff": "@@ -350,11 +350,21 @@ export interface Axis {\n*/\nbase?: string;\n/**\n- * Scale is the axis formatting scale. Supported: \\\"log\\\", \\\"linear\\\"\n- * @type {string}\n+ *\n+ * @type {AxisScaleType}\n* @memberof Axis\n*/\n- scale?: string;\n+ scale?: AxisScaleType;\n+}\n+\n+/**\n+ * Scale is the axis formatting scale. Supported: \\\"log\\\", \\\"linear\\\"\n+ * @export\n+ * @enum {string}\n+ */\n+export enum AxisScaleType {\n+ Log = 'log',\n+ Linear = 'linear'\n}\n/**\n@@ -621,6 +631,86 @@ export interface Buckets {\nbuckets?: Array<Bucket>;\n}\n+/**\n+ *\n+ * @export\n+ * @interface BuilderConfig\n+ */\n+export interface BuilderConfig {\n+ /**\n+ *\n+ * @type {Array<string>}\n+ * @memberof BuilderConfig\n+ */\n+ buckets?: Array<string>;\n+ /**\n+ *\n+ * @type {Array<BuilderTagsType>}\n+ * @memberof BuilderConfig\n+ */\n+ tags?: Array<BuilderTagsType>;\n+ /**\n+ *\n+ * @type {Array<BuilderFunctionsType>}\n+ * @memberof BuilderConfig\n+ */\n+ functions?: Array<BuilderFunctionsType>;\n+ /**\n+ *\n+ * @type {BuilderConfigAggregateWindow}\n+ * @memberof BuilderConfig\n+ */\n+ aggregateWindow?: BuilderConfigAggregateWindow;\n+}\n+\n+/**\n+ *\n+ * @export\n+ * @interface BuilderConfigAggregateWindow\n+ */\n+export interface BuilderConfigAggregateWindow {\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof BuilderConfigAggregateWindow\n+ */\n+ name?: string;\n+}\n+\n+/**\n+ *\n+ * @export\n+ * @interface BuilderFunctionsType\n+ */\n+export interface BuilderFunctionsType {\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof BuilderFunctionsType\n+ */\n+ name?: string;\n+}\n+\n+/**\n+ *\n+ * @export\n+ * @interface BuilderTagsType\n+ */\n+export interface BuilderTagsType {\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof BuilderTagsType\n+ */\n+ key?: string;\n+ /**\n+ *\n+ * @type {Array<string>}\n+ * @memberof BuilderTagsType\n+ */\n+ values?: Array<string>;\n+}\n+\n/**\n* declares a builtin identifier and its type\n* @export\n@@ -1193,10 +1283,10 @@ export interface DashboardColor {\nname?: string;\n/**\n* Value is the data value mapped to this color\n- * @type {string}\n+ * @type {number}\n* @memberof DashboardColor\n*/\n- value?: string;\n+ value?: number;\n}\n/**\n@@ -1222,55 +1312,29 @@ export namespace DashboardColor {\n*/\nexport interface DashboardQuery {\n/**\n- * Optional Y-axis user-facing label\n+ * The text of the flux query\n* @type {string}\n* @memberof DashboardQuery\n*/\n- label?: string;\n+ text?: string;\n/**\n*\n- * @type {DashboardQueryRange}\n+ * @type {QueryEditMode}\n* @memberof DashboardQuery\n*/\n- range?: DashboardQueryRange;\n+ editMode?: QueryEditMode;\n/**\n*\n* @type {string}\n* @memberof DashboardQuery\n*/\n- query: string;\n- /**\n- * Optional URI for data source for this query\n- * @type {string}\n- * @memberof DashboardQuery\n- */\n- source?: string;\n+ name?: string;\n/**\n*\n- * @type {QueryConfig}\n+ * @type {BuilderConfig}\n* @memberof DashboardQuery\n*/\n- queryConfig?: QueryConfig;\n-}\n-\n-/**\n- * Optional default range of the Y-axis\n- * @export\n- * @interface DashboardQueryRange\n- */\n-export interface DashboardQueryRange {\n- /**\n- * Upper bound of the display range of the Y-axis\n- * @type {number}\n- * @memberof DashboardQueryRange\n- */\n- upper: number;\n- /**\n- * Lower bound of the display range of the Y-axis\n- * @type {number}\n- * @memberof DashboardQueryRange\n- */\n- lower: number;\n+ builderConfig?: BuilderConfig;\n}\n/**\n@@ -3928,109 +3992,11 @@ export namespace Query {\n/**\n*\n* @export\n- * @interface QueryConfig\n- */\n-export interface QueryConfig {\n- /**\n- *\n- * @type {string}\n- * @memberof QueryConfig\n- */\n- id?: string;\n- /**\n- *\n- * @type {string}\n- * @memberof QueryConfig\n- */\n- database: string;\n- /**\n- *\n- * @type {string}\n- * @memberof QueryConfig\n- */\n- measurement: string;\n- /**\n- *\n- * @type {string}\n- * @memberof QueryConfig\n- */\n- retentionPolicy: string;\n- /**\n- *\n- * @type {boolean}\n- * @memberof QueryConfig\n- */\n- areTagsAccepted: boolean;\n- /**\n- *\n- * @type {string}\n- * @memberof QueryConfig\n- */\n- rawText?: string;\n- /**\n- *\n- * @type {any}\n- * @memberof QueryConfig\n- */\n- tags: any;\n- /**\n- *\n- * @type {QueryConfigGroupBy}\n- * @memberof QueryConfig\n- */\n- groupBy: QueryConfigGroupBy;\n- /**\n- *\n- * @type {Array<Field>}\n- * @memberof QueryConfig\n- */\n- fields: Array<Field>;\n- /**\n- *\n- * @type {QueryConfigRange}\n- * @memberof QueryConfig\n- */\n- range?: QueryConfigRange;\n-}\n-\n-/**\n- *\n- * @export\n- * @interface QueryConfigGroupBy\n- */\n-export interface QueryConfigGroupBy {\n- /**\n- *\n- * @type {string}\n- * @memberof QueryConfigGroupBy\n- */\n- time: string;\n- /**\n- *\n- * @type {Array<string>}\n- * @memberof QueryConfigGroupBy\n- */\n- tags: Array<string>;\n-}\n-\n-/**\n- *\n- * @export\n- * @interface QueryConfigRange\n- */\n-export interface QueryConfigRange {\n- /**\n- *\n- * @type {string}\n- * @memberof QueryConfigRange\n- */\n- lower: string;\n- /**\n- *\n- * @type {string}\n- * @memberof QueryConfigRange\n+ * @enum {string}\n*/\n- upper: string;\n+export enum QueryEditMode {\n+ Builder = 'builder',\n+ Advanced = 'advanced'\n}\n/**\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
generate dashboard query types
305,161
22.07.2019 15:20:14
25,200
c4311e25eccd63162a16f2f8f90f4e5cdfce9d7a
Extend alert types to more distinguishable types.
[ { "change_type": "MODIFY", "old_path": "src/index.ts", "new_path": "src/index.ts", "diff": "@@ -67,9 +67,16 @@ export {\nexport {\nCheck,\nNotificationRule,\n- ThresholdCheck,\nChecks,\n+ DeadmanCheck,\n+ ThresholdCheck,\nNotificationRules,\n+ GreaterThresold,\n+ LesserThreshold,\n+ RangeThreshold,\n+ SlackNotificationRule,\n+ SMTPNotificationRule,\n+ PagerDutyNotificationRule,\n} from './types/alerts'\nexport {\n" }, { "change_type": "MODIFY", "old_path": "src/types/alerts.ts", "new_path": "src/types/alerts.ts", "diff": "import {\n- DeadmanCheck,\n+ DeadmanCheck as DeadmanCheckGen,\nThresholdCheck as ThresholdCheckGen,\n+ CheckType,\nGreaterThreshold as GreaterThresholdGen,\nLesserThreshold as LesserThresholdGen,\nRangeThreshold as RangeThresholdGen,\n- SlackNotificationRule,\n- PagerDutyNotificationRule,\n- SMTPNotificationRule,\n+ ThresholdType,\n+ SlackNotificationRule as SlackNotificationRuleGen,\n+ PagerDutyNotificationRule as PagerDutyNotificationRuleGen,\n+ SMTPNotificationRule as SMTPNotificationRuleGen,\n+ NotificationRuleType,\nLinks,\n} from '../api'\n+export interface GreaterThresold extends GreaterThresholdGen {\n+ type: ThresholdType.Greater\n+}\n+\n+export interface LesserThreshold extends LesserThresholdGen {\n+ type: ThresholdType.Lesser\n+}\n+\n+export interface RangeThreshold extends RangeThresholdGen {\n+ type: ThresholdType.Range\n+}\n+\nexport interface ThresholdCheck extends ThresholdCheckGen {\n- thresholds: Array<\n- GreaterThresholdGen | LesserThresholdGen | RangeThresholdGen\n- >\n+ type: CheckType.Threshold\n+ thresholds: Array<GreaterThresold | LesserThreshold | RangeThreshold>\n+}\n+\n+export interface DeadmanCheck extends DeadmanCheckGen {\n+ type: CheckType.Deadman\n}\nexport type Check = DeadmanCheck | ThresholdCheck\n@@ -23,6 +41,19 @@ export interface Checks {\nlinks: Links\n}\n+export interface SlackNotificationRule extends SlackNotificationRuleGen {\n+ type: NotificationRuleType.Slack\n+}\n+\n+export interface PagerDutyNotificationRule\n+ extends PagerDutyNotificationRuleGen {\n+ type: NotificationRuleType.Pagerduty\n+}\n+\n+export interface SMTPNotificationRule extends SMTPNotificationRuleGen {\n+ type: NotificationRuleType.Smtp\n+}\n+\nexport type NotificationRule =\n| SlackNotificationRule\n| PagerDutyNotificationRule\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Extend alert types to more distinguishable types.
305,161
22.07.2019 15:46:06
25,200
41bafcd925acdfc67f05c61b0d4d2c45d416861b
Fix type in greaterthreshold
[ { "change_type": "MODIFY", "old_path": "src/index.ts", "new_path": "src/index.ts", "diff": "@@ -71,7 +71,7 @@ export {\nDeadmanCheck,\nThresholdCheck,\nNotificationRules,\n- GreaterThresold,\n+ GreaterThreshold,\nLesserThreshold,\nRangeThreshold,\nSlackNotificationRule,\n" }, { "change_type": "MODIFY", "old_path": "src/types/alerts.ts", "new_path": "src/types/alerts.ts", "diff": "@@ -13,7 +13,7 @@ import {\nLinks,\n} from '../api'\n-export interface GreaterThresold extends GreaterThresholdGen {\n+export interface GreaterThreshold extends GreaterThresholdGen {\ntype: ThresholdType.Greater\n}\n@@ -27,7 +27,7 @@ export interface RangeThreshold extends RangeThresholdGen {\nexport interface ThresholdCheck extends ThresholdCheckGen {\ntype: CheckType.Threshold\n- thresholds: Array<GreaterThresold | LesserThreshold | RangeThreshold>\n+ thresholds: Array<GreaterThreshold | LesserThreshold | RangeThreshold>\n}\nexport interface DeadmanCheck extends DeadmanCheckGen {\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Fix type in greaterthreshold
305,161
22.07.2019 15:48:50
25,200
cd61f3d8f0485a399e39177aa21bed86f754e43e
Add checkThreshold type
[ { "change_type": "MODIFY", "old_path": "src/types/alerts.ts", "new_path": "src/types/alerts.ts", "diff": "@@ -25,9 +25,11 @@ export interface RangeThreshold extends RangeThresholdGen {\ntype: ThresholdType.Range\n}\n+export type CheckThreshold = GreaterThreshold | LesserThreshold | RangeThreshold\n+\nexport interface ThresholdCheck extends ThresholdCheckGen {\ntype: CheckType.Threshold\n- thresholds: Array<GreaterThreshold | LesserThreshold | RangeThreshold>\n+ thresholds: Array<CheckThreshold>\n}\nexport interface DeadmanCheck extends DeadmanCheckGen {\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add checkThreshold type
305,168
06.09.2019 18:20:27
25,200
5ae0cd2452cfc7ce8eb0aae8864bb93ff18915b4
Add bucket type to js client api
[ { "change_type": "MODIFY", "old_path": "src/api/api.ts", "new_path": "src/api/api.ts", "diff": "@@ -477,6 +477,12 @@ export interface Bucket {\n* @memberof Bucket\n*/\nid?: string;\n+ /**\n+ *\n+ * @type {string}\n+ * @memberof Bucket\n+ */\n+ type?: Bucket.TypeEnum;\n/**\n*\n* @type {string}\n@@ -527,6 +533,21 @@ export interface Bucket {\nlabels?: Array<Label>;\n}\n+/**\n+ * @export\n+ * @namespace Bucket\n+ */\n+export namespace Bucket {\n+ /**\n+ * @export\n+ * @enum {string}\n+ */\n+ export enum TypeEnum {\n+ User = 'user',\n+ System = 'system'\n+ }\n+}\n+\n/**\n*\n* @export\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
Add bucket type to js client api
305,159
29.11.2019 22:54:40
-3,600
04ab4881350b6a97388f390be15116ae0545a83f
introduce node transport layer
[ { "change_type": "MODIFY", "old_path": ".eslintrc.json", "new_path": ".eslintrc.json", "diff": "\"plugin:prettier/recommended\",\n\"prettier/@typescript-eslint\"\n],\n- \"rules\": {}\n+ \"rules\": {\n+ \"@typescript-eslint/no-explicit-any\": \"off\",\n+ \"@typescript-eslint/no-unused-vars\": [\n+ \"error\",\n+ {\"varsIgnorePattern\": \"^_\", \"argsIgnorePattern\": \"^_\"}\n+ ],\n+ \"@typescript-eslint/no-empty-function\": \"off\"\n+ }\n}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/client/InfluxDBClient.ts", "diff": "+import WriteApi from './WriteApi'\n+\n+/**\n+ * InfluxDB 2.0 client that uses HTTP API described in https://v2.docs.influxdata.com/v2.0/reference/api/ .\n+ */\n+export default interface InfluxDBClient {\n+ getWriteApi(): WriteApi\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/client/InfluxDBClientFactory.ts", "diff": "+/**\n+ * Factory that creates an instance of a InfluxDB 2.0 client.\n+ */\n+export class InfluxDBClientFactory {\n+ public static create(): void {\n+ // TODO return InfluxDBClient\n+ }\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/client/WriteApi.ts", "diff": "+import {WritePrecission} from './options'\n+\n+/**\n+ * The asynchronous non-blocking API to Write time-series data into InfluxDB 2.0.\n+ * <p>\n+ * The data are formatted in <a href=\"https://bit.ly/2QL99fu\">Line Protocol</a>.\n+ * <p>\n+ */\n+export default interface WriteApi {\n+ /**\n+ * Write Line Protocol record into specified bucket.\n+ *\n+ * @param record specifies the record in InfluxDB Line Protocol.\n+ * @param precision specifies the precision for the generated timestamp\n+ * @param bucket specifies the destination bucket for writes\n+ * @param org specifies the destination organization for writes\n+ */\n+ writeRecord(\n+ record: string,\n+ precision?: WritePrecission,\n+ bucket?: string,\n+ org?: string\n+ ): void\n+\n+ // /**\n+ // * Write Line Protocol record into specified bucket.\n+ // *\n+ // * @param record specifies the record in InfluxDB Line Protocol.\n+ // * @param precision specifies the precision for the generated timestamp\n+ // * @param bucket specifies the destination bucket for writes\n+ // * @param org specifies the destination organization for writes\n+ // */\n+ // writeRecords(\n+ // records: Array<string>,\n+ // precision?: WritePrecission,\n+ // bucket?: string,\n+ // org?: string\n+ // ): void\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/client/errors.ts", "diff": "+interface RetriableDecision {\n+ canRetry(): boolean\n+ retryAfter(): number\n+}\n+\n+export function isStatusCodeRetriable(statusCode: number): boolean {\n+ return statusCode == 429 || statusCode == 503\n+}\n+\n+/**\n+ * A general HTTP error.\n+ */\n+export class HttpError extends Error implements RetriableDecision {\n+ private _retryAfter: number\n+\n+ constructor(\n+ readonly statusCode: number,\n+ readonly statusMessage: string | undefined,\n+ readonly body?: string,\n+ retryAfter?: string | undefined\n+ ) {\n+ super()\n+ if (body) {\n+ this.message = `A ${statusCode} ${statusMessage} error occurred: ${body}`\n+ } else {\n+ this.message = `${statusCode} ${statusMessage}`\n+ }\n+ if (typeof retryAfter === 'string') {\n+ // try to parse the supplied number as milliseconds\n+ this._retryAfter = parseInt(retryAfter)\n+ } else {\n+ this._retryAfter = NaN\n+ }\n+ }\n+ canRetry(): boolean {\n+ return isStatusCodeRetriable(this.statusCode)\n+ }\n+ retryAfter(): number {\n+ return this._retryAfter\n+ }\n+}\n+\n+//see https://nodejs.org/api/errors.html\n+const RETRY_CODES = [\n+ 'ECONNRESET',\n+ 'ENOTFOUND',\n+ 'ESOCKETTIMEDOUT',\n+ 'ETIMEDOUT',\n+ 'ECONNREFUSED',\n+ 'EHOSTUNREACH',\n+ 'EPIPE',\n+]\n+\n+/**\n+ * Tests the error to know whether a possible HTTP call can be retried.\n+ * @param error Test whether the givver e\n+ */\n+export function canRetryHttpCall(error: Error): boolean {\n+ if (!error) {\n+ return false\n+ } else if (error instanceof HttpError) {\n+ return isStatusCodeRetriable(error.statusCode)\n+ } else if ((error as any).code && RETRY_CODES.includes((error as any).code)) {\n+ return true\n+ }\n+ return false\n+}\n+\n+export class RequestTimedOutError extends Error implements RetriableDecision {\n+ constructor() {\n+ super()\n+ this.message = 'Request timed out'\n+ }\n+ canRetry(): boolean {\n+ return true\n+ }\n+ retryAfter(): number {\n+ return 0\n+ }\n+}\n+\n+export class ResponseAbortedError extends Error implements RetriableDecision {\n+ constructor() {\n+ super()\n+ this.message = 'Response aborted'\n+ }\n+ canRetry(): boolean {\n+ return true\n+ }\n+ retryAfter(): number {\n+ return 0\n+ }\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/client/impl/InfluxDBClientImpl.ts", "diff": "+import InfluxDBClient from '../InfluxDBClient'\n+import {ClientOptions} from '../options'\n+import WriteApi from '../WriteApi'\n+import WriteApiImpl from './WriteApiImpl'\n+\n+export class InfluxDBClientImpl implements InfluxDBClient {\n+ constructor(private options: ClientOptions) {}\n+ public getWriteApi(): WriteApi {\n+ return new WriteApiImpl(this.options)\n+ }\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/client/impl/NodeHttpTransport.ts", "diff": "+import {ConnectionOptions} from '../options'\n+import {URL} from 'url'\n+import * as http from 'http'\n+import * as https from 'https'\n+import {Buffer} from 'buffer'\n+import {\n+ RequestTimedOutError,\n+ ResponseAbortedError,\n+ canRetryHttpCall,\n+ HttpError,\n+} from '../errors'\n+\n+const DEFAULT_OPTIONS: Partial<ConnectionOptions> = {\n+ timeout: 10000,\n+ maxRetries: 3,\n+ retryJitter: 1000,\n+}\n+\n+/** Informs about changes in the communication with the server */\n+export interface CommunicationCallbacks {\n+ /**\n+ * Data chunk was received, can be called mupliple times.\n+ */\n+ next(data: any): void\n+ /**\n+ * An error message was received.\n+ */\n+ error(error: Error): void\n+ /**\n+ * Response was fully read.\n+ */\n+ complete(): void\n+}\n+\n+/**\n+ * Transport layer on top of node http or https library.\n+ */\n+export class NodeHttpTransport {\n+ private defaultOptions: {[key: string]: any}\n+ private requestApi: (\n+ options: http.RequestOptions,\n+ callback: (res: http.IncomingMessage) => void\n+ ) => http.ClientRequest\n+\n+ /**\n+ * Creates a node transport using for the client options supplied.\n+ * @param connectionOptions client options\n+ */\n+ constructor(connectionOptions: ConnectionOptions | {[key: string]: any}) {\n+ const url = new URL(connectionOptions.url)\n+ this.defaultOptions = {\n+ ...DEFAULT_OPTIONS,\n+ ...connectionOptions,\n+ port: url.port,\n+ protocol: url.protocol,\n+ method: 'POST',\n+ }\n+ if (url.protocol === 'http') {\n+ this.requestApi = http.request\n+ } else if (url.protocol === 'https') {\n+ this.requestApi = https.request\n+ } else {\n+ throw new Error('Unsupported URL: ' + connectionOptions.url)\n+ }\n+ }\n+\n+ send(\n+ path: string,\n+ headers: {[key: string]: string},\n+ body = '',\n+ callbacks?: Partial<CommunicationCallbacks>\n+ ): void {\n+ const message = this.createRequestMessage(path, headers, body)\n+ this.request(message, callbacks)\n+ }\n+\n+ /**\n+ * Creates configuration for a specific request that encapluates everything that is\n+ * required to send data.\n+ *\n+ * @param path API path starting with '/' and containing also query parameters\n+ * @param headers HTTP headers to use in\n+ * @return configuration suitable for making the request\n+ */\n+ private createRequestMessage(\n+ path: string,\n+ headers: {[key: string]: string},\n+ body = ''\n+ ): {[key: string]: any} {\n+ const bodyBuffer = body ? Buffer.from(body, 'utf-8') : undefined\n+ const options: {[key: string]: any} = {\n+ ...this.defaultOptions,\n+ path,\n+ headers: {\n+ 'content-type': 'text/plain; charset=utf-8',\n+ ...headers,\n+ },\n+ body: bodyBuffer,\n+ }\n+ if (bodyBuffer) {\n+ options.headers['content-length'] = bodyBuffer.length\n+ }\n+\n+ return options\n+ }\n+\n+ /**\n+ * Sends the\n+ * @param requestMessage\n+ * @param callbacks\n+ */\n+ private request(\n+ requestMessage: {[key: string]: any},\n+ callbacks?: Partial<CommunicationCallbacks>\n+ ): void {\n+ const listeners = this.createRetriableCallbacks(requestMessage, callbacks)\n+ const req = this.requestApi(requestMessage, (res: http.IncomingMessage) => {\n+ res.on('aborted', () => {\n+ listeners.error(new ResponseAbortedError())\n+ })\n+ const statusCode = res.statusCode || 600\n+ if (statusCode >= 300) {\n+ let body = ''\n+ res.on('data', s => {\n+ if (body.length < 2000) body += s.toString()\n+ })\n+ res.on('end', () =>\n+ listeners.error(new HttpError(statusCode, res.statusMessage, body))\n+ )\n+ } else {\n+ res.on('data', listeners.next)\n+ res.on('end', listeners.complete)\n+ }\n+ })\n+ // Support older Nodes which don't allow .timeout() in the\n+ // request options\n+ if (typeof req.setTimeout === 'function') {\n+ req.setTimeout(requestMessage.timeout)\n+ }\n+\n+ req.on('timeout', () => {\n+ listeners.error(new RequestTimedOutError())\n+ })\n+ req.on('error', () => {\n+ listeners.error(new RequestTimedOutError())\n+ })\n+ req.on('close', listeners.complete)\n+\n+ if (requestMessage.body) {\n+ req.write(requestMessage.body)\n+ }\n+ req.end()\n+ }\n+\n+ private createRetriableCallbacks(\n+ requestMessage: {[key: string]: any},\n+ callbacks: Partial<CommunicationCallbacks> = {}\n+ ): CommunicationCallbacks {\n+ let state = 0\n+ return {\n+ next: (data: any): void => {\n+ if (state === 0 && callbacks.next) {\n+ callbacks.next(data)\n+ }\n+ },\n+ error: (error: Error): void => {\n+ if (state === 0 && canRetryHttpCall(error)) {\n+ const retries = requestMessage.retries || 0\n+ if (retries < this.defaultOptions.maxRetries) {\n+ requestMessage.retries = retries + 1\n+ return this.request(requestMessage, callbacks)\n+ }\n+ }\n+ state = 1\n+ if (callbacks.error) callbacks.error(error)\n+ },\n+ complete: (): void => {\n+ if (state === 0) {\n+ state = 2\n+ if (callbacks.complete) callbacks.complete()\n+ }\n+ },\n+ }\n+ }\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/client/impl/WriteApiImpl.ts", "diff": "+import WriteApi from '../WriteApi'\n+import {WritePrecission, ConnectionOptions} from '..'\n+import {NodeHttpTransport} from './NodeHttpTransport'\n+\n+export default class WriteApiImpl implements WriteApi {\n+ private transport: NodeHttpTransport\n+\n+ constructor(connectionOptions: ConnectionOptions) {\n+ this.transport = new NodeHttpTransport(connectionOptions)\n+ }\n+\n+ writeRecord(\n+ record: string,\n+ precision?: WritePrecission,\n+ bucket?: string,\n+ org?: string\n+ ): void {\n+ // TODO make it better\n+ this.transport.send(\n+ `/write?org=${org}&bucket=${bucket}&precision=${precision}`,\n+ {},\n+ record\n+ )\n+ }\n+ // writeRecords(\n+ // records: string[],\n+ // precision?: WritePrecission,\n+ // bucket?: string,\n+ // org?: string\n+ // ): void {\n+ // throw new Error('Method not implemented.')\n+ // }\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/client/index.ts", "diff": "+export * from './InfluxDBClient'\n+export * from './InfluxDBClientFactory'\n+export * from './options'\n+export * from './errors'\n+export * from './WriteApi'\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/client/options.ts", "diff": "+export interface ConnectionOptions {\n+ /** base URL */\n+ url: string\n+ /** authentication token */\n+ token: string\n+ /** socket timeout */\n+ timeout?: number\n+ /** maximum number of retries for HTTP calls that could succeed when called again */\n+ maxRetries?: number\n+ /** extra jitter delay when retrying HTTP calls */\n+ retryJitter?: number\n+}\n+\n+// export interface WriteOptions {\n+// /** default tags to add to every write */\n+// defaultTags: {[key: string]: string}\n+// }\n+\n+/* eslint-disable @typescript-eslint/no-empty-interface */\n+export interface ClientOptions extends ConnectionOptions {}\n+/* eslint-enabled @typescript-eslint/no-empty-interface */\n+\n+export const enum WritePrecission {\n+ /** nanosecond */\n+ ns = 'ns',\n+ /* microsecond */\n+ us = 'us',\n+ /** millisecond */\n+ ms = 'ms',\n+ /* second */\n+ s = 's',\n+ /** don't send timestamp, let server generate timestamp value */\n+ none = '',\n+}\n" }, { "change_type": "MODIFY", "old_path": "src/index.ts", "new_path": "src/index.ts", "diff": "-export class Client {}\n+export * from './client'\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
introduce node transport layer
305,159
02.12.2019 09:34:26
-3,600
404e1b0e4aadf472e58e308e3d8e28433f19433b
allow to cancel communication
[ { "change_type": "MODIFY", "old_path": "src/client/impl/NodeHttpTransport.ts", "new_path": "src/client/impl/NodeHttpTransport.ts", "diff": "@@ -19,7 +19,7 @@ const DEFAULT_OPTIONS: Partial<ConnectionOptions> = {\n/** Informs about changes in the communication with the server */\nexport interface CommunicationCallbacks {\n/**\n- * Data chunk was received, can be called mupliple times.\n+ * Data chunk received, can be called mupliple times.\n*/\nnext(data: any): void\n/**\n@@ -32,6 +32,30 @@ export interface CommunicationCallbacks {\ncomplete(): void\n}\n+/**\n+ * Cancellation of asynchronous query.\n+ */\n+export interface Cancellable {\n+ /**\n+ * Attempt to cancel execution of this query.\n+ */\n+ cancel(): void\n+\n+ /**\n+ * Is communication canceled.\n+ */\n+ isCancelled(): boolean\n+}\n+class CancellableImpl implements Cancellable {\n+ private cancelled = false\n+ cancel(): void {\n+ this.cancelled = true\n+ }\n+ isCancelled(): boolean {\n+ return this.cancelled\n+ }\n+}\n+\n/**\n* Transport layer on top of node http or https library.\n*/\n@@ -64,14 +88,27 @@ export class NodeHttpTransport {\n}\n}\n+ /**\n+ * Sends data to server and receive communication events via communication callbacks.\n+ *\n+ * @param path HTTP path\n+ * @param headers HTTP headers\n+ * @param method HTTP method\n+ * @param body message body\n+ * @param callbacks communication callbacks\n+ * @return a handle that can cancel the communication\n+ */\nsend(\npath: string,\nheaders: {[key: string]: string},\n+ method = 'POST',\nbody = '',\ncallbacks?: Partial<CommunicationCallbacks>\n- ): void {\n- const message = this.createRequestMessage(path, headers, body)\n- this.request(message, callbacks)\n+ ): Cancellable {\n+ const message = this.createRequestMessage(path, headers, method, body)\n+ const cancellable = new CancellableImpl()\n+ this.request(message, cancellable, callbacks)\n+ return cancellable\n}\n/**\n@@ -80,17 +117,21 @@ export class NodeHttpTransport {\n*\n* @param path API path starting with '/' and containing also query parameters\n* @param headers HTTP headers to use in\n+ * @param method HTTP method\n+ * @param body request body\n* @return configuration suitable for making the request\n*/\nprivate createRequestMessage(\npath: string,\nheaders: {[key: string]: string},\n- body = ''\n+ method: string,\n+ body: string\n): {[key: string]: any} {\nconst bodyBuffer = body ? Buffer.from(body, 'utf-8') : undefined\nconst options: {[key: string]: any} = {\n...this.defaultOptions,\npath,\n+ method,\nheaders: {\n'content-type': 'text/plain; charset=utf-8',\n...headers,\n@@ -111,10 +152,22 @@ export class NodeHttpTransport {\n*/\nprivate request(\nrequestMessage: {[key: string]: any},\n+ cancellable: Cancellable,\ncallbacks?: Partial<CommunicationCallbacks>\n): void {\n- const listeners = this.createRetriableCallbacks(requestMessage, callbacks)\n+ const listeners = this.createRetriableCallbacks(\n+ requestMessage,\n+ cancellable,\n+ callbacks\n+ )\n+ if (cancellable.isCancelled) {\n+ listeners.complete()\n+ return\n+ }\nconst req = this.requestApi(requestMessage, (res: http.IncomingMessage) => {\n+ if (cancellable.isCancelled()) {\n+ return\n+ }\nres.on('aborted', () => {\nlisteners.error(new ResponseAbortedError())\n})\n@@ -154,6 +207,7 @@ export class NodeHttpTransport {\nprivate createRetriableCallbacks(\nrequestMessage: {[key: string]: any},\n+ cancellable: Cancellable,\ncallbacks: Partial<CommunicationCallbacks> = {}\n): CommunicationCallbacks {\nlet state = 0\n@@ -168,7 +222,7 @@ export class NodeHttpTransport {\nconst retries = requestMessage.retries || 0\nif (retries < this.defaultOptions.maxRetries) {\nrequestMessage.retries = retries + 1\n- return this.request(requestMessage, callbacks)\n+ return this.request(requestMessage, cancellable, callbacks)\n}\n}\nstate = 1\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
allow to cancel communication
305,159
02.12.2019 10:11:56
-3,600
3c01692a02a384dab81eb69f028fc956ce8f8e49
accept retry delay from errors
[ { "change_type": "MODIFY", "old_path": "src/client/errors.ts", "new_path": "src/client/errors.ts", "diff": "-interface RetriableDecision {\n+export interface RetriableDecision {\ncanRetry(): boolean\n+ /**\n+ * Get the delay in millisecond to retry the action. Can return negative number\n+ * to let the implementation decide the delay.\n+ */\nretryAfter(): number\n}\n@@ -58,8 +62,8 @@ const RETRY_CODES = [\nexport function canRetryHttpCall(error: Error): boolean {\nif (!error) {\nreturn false\n- } else if (error instanceof HttpError) {\n- return isStatusCodeRetriable(error.statusCode)\n+ } else if (typeof (error as any).canRetry === 'function') {\n+ return !!((error as any).retryAfter as () => boolean)()\n} else if ((error as any).code && RETRY_CODES.includes((error as any).code)) {\nreturn true\n}\n@@ -75,7 +79,7 @@ export class RequestTimedOutError extends Error implements RetriableDecision {\nreturn true\n}\nretryAfter(): number {\n- return 0\n+ return -1\n}\n}\n@@ -88,6 +92,6 @@ export class ResponseAbortedError extends Error implements RetriableDecision {\nreturn true\n}\nretryAfter(): number {\n- return 0\n+ return -1\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/client/impl/NodeHttpTransport.ts", "new_path": "src/client/impl/NodeHttpTransport.ts", "diff": "@@ -61,6 +61,7 @@ class CancellableImpl implements Cancellable {\n*/\nexport class NodeHttpTransport {\nprivate defaultOptions: {[key: string]: any}\n+ private retryJitter: number\nprivate requestApi: (\noptions: http.RequestOptions,\ncallback: (res: http.IncomingMessage) => void\n@@ -79,6 +80,8 @@ export class NodeHttpTransport {\nprotocol: url.protocol,\nmethod: 'POST',\n}\n+ this.retryJitter =\n+ this.defaultOptions.retryJitter > 0 ? this.defaultOptions.retryJitter : 0\nif (url.protocol === 'http') {\nthis.requestApi = http.request\n} else if (url.protocol === 'https') {\n@@ -160,7 +163,7 @@ export class NodeHttpTransport {\ncancellable,\ncallbacks\n)\n- if (cancellable.isCancelled) {\n+ if (cancellable.isCancelled()) {\nlisteners.complete()\nreturn\n}\n@@ -211,7 +214,7 @@ export class NodeHttpTransport {\ncallbacks: Partial<CommunicationCallbacks> = {}\n): CommunicationCallbacks {\nlet state = 0\n- return {\n+ const retVal = {\nnext: (data: any): void => {\nif (state === 0 && callbacks.next) {\ncallbacks.next(data)\n@@ -219,13 +222,17 @@ export class NodeHttpTransport {\n},\nerror: (error: Error): void => {\nif (state === 0 && canRetryHttpCall(error)) {\n+ state = 1\nconst retries = requestMessage.retries || 0\nif (retries < this.defaultOptions.maxRetries) {\nrequestMessage.retries = retries + 1\n- return this.request(requestMessage, cancellable, callbacks)\n+ setTimeout(\n+ () => this.request(requestMessage, cancellable, callbacks),\n+ this.getRetryDelay(error)\n+ )\n+ return\n}\n}\n- state = 1\nif (callbacks.error) callbacks.error(error)\n},\ncomplete: (): void => {\n@@ -235,5 +242,17 @@ export class NodeHttpTransport {\n}\n},\n}\n+ return retVal\n+ }\n+\n+ private getRetryDelay(error: Error): number {\n+ let delay = -1\n+ if ((error as any).retryAfter) {\n+ delay = ((error as any).retryAfter as () => number)()\n+ }\n+ if (delay < 0) {\n+ delay = Math.round(Math.random() * this.retryJitter)\n+ }\n+ return delay\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/client/options.ts", "new_path": "src/client/options.ts", "diff": "@@ -7,7 +7,7 @@ export interface ConnectionOptions {\ntimeout?: number\n/** maximum number of retries for HTTP calls that could succeed when called again */\nmaxRetries?: number\n- /** extra jitter delay when retrying HTTP calls */\n+ /** include random milliseconds when retrying HTTP calls */\nretryJitter?: number\n}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
accept retry delay from errors
305,159
02.12.2019 10:23:35
-3,600
8cf869a79c80b8c6016941aac3df7c6f4bcdb65d
cancel retry timeouts on cancel
[ { "change_type": "MODIFY", "old_path": "src/client/impl/NodeHttpTransport.ts", "new_path": "src/client/impl/NodeHttpTransport.ts", "diff": "@@ -48,12 +48,21 @@ export interface Cancellable {\n}\nclass CancellableImpl implements Cancellable {\nprivate cancelled = false\n+ timeouts: Array<() => void> = []\ncancel(): void {\nthis.cancelled = true\n+ if (this.timeouts.length > 0) {\n+ this.timeouts.forEach(x => x())\n+ this.timeouts = []\n+ }\n}\nisCancelled(): boolean {\nreturn this.cancelled\n}\n+\n+ addCancelableAction(action: () => void): void {\n+ this.timeouts.push(action)\n+ }\n}\n/**\n@@ -148,14 +157,9 @@ export class NodeHttpTransport {\nreturn options\n}\n- /**\n- * Sends the\n- * @param requestMessage\n- * @param callbacks\n- */\nprivate request(\nrequestMessage: {[key: string]: any},\n- cancellable: Cancellable,\n+ cancellable: CancellableImpl,\ncallbacks?: Partial<CommunicationCallbacks>\n): void {\nconst listeners = this.createRetriableCallbacks(\n@@ -210,7 +214,7 @@ export class NodeHttpTransport {\nprivate createRetriableCallbacks(\nrequestMessage: {[key: string]: any},\n- cancellable: Cancellable,\n+ cancellable: CancellableImpl,\ncallbacks: Partial<CommunicationCallbacks> = {}\n): CommunicationCallbacks {\nlet state = 0\n@@ -226,10 +230,11 @@ export class NodeHttpTransport {\nconst retries = requestMessage.retries || 0\nif (retries < this.defaultOptions.maxRetries) {\nrequestMessage.retries = retries + 1\n- setTimeout(\n+ const cancelHandle = setTimeout(\n() => this.request(requestMessage, cancellable, callbacks),\nthis.getRetryDelay(error)\n)\n+ cancellable.addCancelableAction(() => clearTimeout(cancelHandle))\nreturn\n}\n}\n" } ]
TypeScript
MIT License
influxdata/influxdb-client-js
cancel retry timeouts on cancel