From 8baef721d8fd4de35f08dbae16d012384185faee Mon Sep 17 00:00:00 2001 From: vargburz Date: Fri, 3 Feb 2023 18:07:43 +0300 Subject: [PATCH 1/2] add delimiter as option --- src/services/exporter.ts | 2 +- src/types.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/services/exporter.ts b/src/services/exporter.ts index ff5c4bb..0275676 100644 --- a/src/services/exporter.ts +++ b/src/services/exporter.ts @@ -109,7 +109,7 @@ export class Exporter { } private _initCsvStream() { - const csvStream = csv.createWriteStream({ headers: true }) + const csvStream = csv.createWriteStream({ headers: true, delimiter: this._task.csvDelimiter }) .on('error', async e => await this._updateProgress({ status: ExportStatus.ERROR, errorMessage: e.message })); const writableStream = fs.createWriteStream(this._getFilePath('csv')); diff --git a/src/types.ts b/src/types.ts index 654b128..90703d5 100644 --- a/src/types.ts +++ b/src/types.ts @@ -102,6 +102,7 @@ export type ExportTask = { from: number; to: number; }; + csvDelimiter: string; progress?: ExportProgress; id?: string; }; From 2e05aefce9c1097d7a3254b1d5777cf3e72836f2 Mon Sep 17 00:00:00 2001 From: vargburz Date: Fri, 3 Feb 2023 18:09:56 +0300 Subject: [PATCH 2/2] 0.7.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dbdf47d..b443b63 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "grafana-data-exporter", - "version": "0.7.1", + "version": "0.7.2", "description": "Server for fetching data from Grafana datasources", "scripts": { "start": "node dist/server.js",