azure-kusto-ingest 2.2.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +5 -0
- package/.eslintrc.js +247 -0
- package/.mocharc.json +2 -2
- package/.prettierignore +8 -0
- package/.prettierrc.json +5 -0
- package/README.md +64 -62
- package/example.js +20 -30
- package/index.d.ts +24 -2
- package/index.js +46 -6
- package/index.js.map +1 -1
- package/package.json +70 -55
- package/source/abstractKustoClient.d.ts +2 -2
- package/source/abstractKustoClient.js +4 -2
- package/source/abstractKustoClient.js.map +1 -1
- package/source/columnMappings.d.ts +114 -0
- package/source/columnMappings.js +240 -0
- package/source/columnMappings.js.map +1 -0
- package/source/descriptors.d.ts +4 -3
- package/source/descriptors.js +17 -7
- package/source/descriptors.js.map +1 -1
- package/source/errors.d.ts +3 -0
- package/source/errors.js +13 -0
- package/source/errors.js.map +1 -0
- package/source/ingestClient.d.ts +2 -2
- package/source/ingestClient.js +1 -3
- package/source/ingestClient.js.map +1 -1
- package/source/ingestionBlobInfo.js +10 -7
- package/source/ingestionBlobInfo.js.map +1 -1
- package/source/ingestionProperties.d.ts +96 -40
- package/source/ingestionProperties.js +166 -84
- package/source/ingestionProperties.js.map +1 -1
- package/source/managedStreamingIngestClient.d.ts +36 -0
- package/source/managedStreamingIngestClient.js +106 -0
- package/source/managedStreamingIngestClient.js.map +1 -0
- package/source/resourceManager.d.ts +1 -1
- package/source/resourceManager.js +14 -16
- package/source/resourceManager.js.map +1 -1
- package/source/retry.d.ts +10 -0
- package/source/retry.js +44 -0
- package/source/retry.js.map +1 -0
- package/source/status.js +6 -17
- package/source/status.js.map +1 -1
- package/source/statusQ.js +7 -6
- package/source/statusQ.js.map +1 -1
- package/source/streamUtils.d.ts +6 -0
- package/source/streamUtils.js +61 -0
- package/source/streamUtils.js.map +1 -0
- package/source/streamingIngestClient.d.ts +2 -3
- package/source/streamingIngestClient.js +5 -14
- package/source/streamingIngestClient.js.map +1 -1
- package/tsconfig.json +16 -16
- package/tsconfig.tsbuildinfo +1 -7177
- package/index.ts +0 -48
- package/tslint.json +0 -18
package/index.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import client from "./source/ingestClient";
|
|
2
2
|
import streamingIngestClient from "./source/streamingIngestClient";
|
|
3
|
+
import managedStreamingIngestClient from "./source/managedStreamingIngestClient";
|
|
3
4
|
import KustoIngestStatusQueues from "./source/status";
|
|
4
|
-
import {
|
|
5
|
+
import { DataFormat, IngestionMappingKind, ReportLevel, ReportMethod, ValidationImplications, ValidationOptions, ValidationPolicy } from "./source/ingestionProperties";
|
|
5
6
|
import { BlobDescriptor, CompressionType, FileDescriptor, StreamDescriptor } from "./source/descriptors";
|
|
7
|
+
import { ApacheAvroColumnMapping, AvroColumnMapping, ColumnMapping, ConstantTransformation, CsvColumnMapping, FieldTransformation, JsonColumnMapping, OrcColumnMapping, ParquetColumnMapping, SStreamColumnMapping, W3CLogFileMapping } from "./source/columnMappings";
|
|
8
|
+
export { Transformation as ColumnMappingTransformation } from "./source/columnMappings";
|
|
6
9
|
export declare const IngestClient: typeof client;
|
|
7
10
|
export declare const StreamingIngestClient: typeof streamingIngestClient;
|
|
11
|
+
export declare const ManagedStreamingIngestClient: typeof managedStreamingIngestClient;
|
|
8
12
|
export declare const IngestStatusQueues: typeof KustoIngestStatusQueues;
|
|
9
13
|
export { IngestionProperties } from "./source/ingestionProperties";
|
|
10
14
|
export declare const IngestionDescriptors: {
|
|
@@ -12,15 +16,33 @@ export declare const IngestionDescriptors: {
|
|
|
12
16
|
FileDescriptor: typeof FileDescriptor;
|
|
13
17
|
StreamDescriptor: typeof StreamDescriptor;
|
|
14
18
|
};
|
|
19
|
+
export { JsonColumnMapping, CsvColumnMapping, AvroColumnMapping, ParquetColumnMapping, OrcColumnMapping, W3CLogFileMapping, ValidationPolicy, ReportLevel, ReportMethod, ValidationImplications, ValidationOptions, DataFormat, IngestionMappingKind, CompressionType, ApacheAvroColumnMapping, SStreamColumnMapping, ConstantTransformation, FieldTransformation, ColumnMapping, };
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated - import directly instead
|
|
22
|
+
*/
|
|
15
23
|
export declare const IngestionPropertiesEnums: {
|
|
16
24
|
JsonColumnMapping: typeof JsonColumnMapping;
|
|
17
25
|
CsvColumnMapping: typeof CsvColumnMapping;
|
|
26
|
+
AvroColumnMapping: typeof AvroColumnMapping;
|
|
27
|
+
ParquetColumnMapping: typeof ParquetColumnMapping;
|
|
28
|
+
OrcColumnMapping: typeof OrcColumnMapping;
|
|
29
|
+
W3CLogFileMapping: typeof W3CLogFileMapping;
|
|
18
30
|
ValidationPolicy: typeof ValidationPolicy;
|
|
19
31
|
ReportLevel: typeof ReportLevel;
|
|
20
32
|
ReportMethod: typeof ReportMethod;
|
|
21
33
|
ValidationImplications: typeof ValidationImplications;
|
|
22
34
|
ValidationOptions: typeof ValidationOptions;
|
|
23
35
|
DataFormat: typeof DataFormat;
|
|
24
|
-
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated - use IngestionMappingKind instead
|
|
38
|
+
*/
|
|
39
|
+
IngestionMappingType: typeof IngestionMappingKind;
|
|
40
|
+
IngestionMappingKind: typeof IngestionMappingKind;
|
|
25
41
|
CompressionType: typeof CompressionType;
|
|
42
|
+
ApacheAvroColumnMapping: typeof ApacheAvroColumnMapping;
|
|
43
|
+
SStreamColumnMapping: typeof SStreamColumnMapping;
|
|
44
|
+
ConstantTransformation: typeof ConstantTransformation;
|
|
45
|
+
FieldTransformation: typeof FieldTransformation;
|
|
46
|
+
ColumnMapping: typeof ColumnMapping;
|
|
26
47
|
};
|
|
48
|
+
export { IngestionPropertiesValidationError } from "./source/errors";
|
package/index.js
CHANGED
|
@@ -5,32 +5,72 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
6
|
};
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.IngestionPropertiesEnums = exports.IngestionDescriptors = exports.IngestionProperties = exports.IngestStatusQueues = exports.StreamingIngestClient = exports.IngestClient = void 0;
|
|
8
|
+
exports.IngestionPropertiesValidationError = exports.IngestionPropertiesEnums = exports.ColumnMapping = exports.FieldTransformation = exports.ConstantTransformation = exports.SStreamColumnMapping = exports.ApacheAvroColumnMapping = exports.CompressionType = exports.IngestionMappingKind = exports.DataFormat = exports.ValidationOptions = exports.ValidationImplications = exports.ReportMethod = exports.ReportLevel = exports.ValidationPolicy = exports.W3CLogFileMapping = exports.OrcColumnMapping = exports.ParquetColumnMapping = exports.AvroColumnMapping = exports.CsvColumnMapping = exports.JsonColumnMapping = exports.IngestionDescriptors = exports.IngestionProperties = exports.IngestStatusQueues = exports.ManagedStreamingIngestClient = exports.StreamingIngestClient = exports.IngestClient = void 0;
|
|
9
9
|
const ingestClient_1 = __importDefault(require("./source/ingestClient"));
|
|
10
10
|
const streamingIngestClient_1 = __importDefault(require("./source/streamingIngestClient"));
|
|
11
|
+
const managedStreamingIngestClient_1 = __importDefault(require("./source/managedStreamingIngestClient"));
|
|
11
12
|
const status_1 = __importDefault(require("./source/status"));
|
|
12
13
|
const ingestionProperties_1 = require("./source/ingestionProperties");
|
|
14
|
+
Object.defineProperty(exports, "DataFormat", { enumerable: true, get: function () { return ingestionProperties_1.DataFormat; } });
|
|
15
|
+
Object.defineProperty(exports, "IngestionMappingKind", { enumerable: true, get: function () { return ingestionProperties_1.IngestionMappingKind; } });
|
|
16
|
+
Object.defineProperty(exports, "ReportLevel", { enumerable: true, get: function () { return ingestionProperties_1.ReportLevel; } });
|
|
17
|
+
Object.defineProperty(exports, "ReportMethod", { enumerable: true, get: function () { return ingestionProperties_1.ReportMethod; } });
|
|
18
|
+
Object.defineProperty(exports, "ValidationImplications", { enumerable: true, get: function () { return ingestionProperties_1.ValidationImplications; } });
|
|
19
|
+
Object.defineProperty(exports, "ValidationOptions", { enumerable: true, get: function () { return ingestionProperties_1.ValidationOptions; } });
|
|
20
|
+
Object.defineProperty(exports, "ValidationPolicy", { enumerable: true, get: function () { return ingestionProperties_1.ValidationPolicy; } });
|
|
13
21
|
const descriptors_1 = require("./source/descriptors");
|
|
22
|
+
Object.defineProperty(exports, "CompressionType", { enumerable: true, get: function () { return descriptors_1.CompressionType; } });
|
|
23
|
+
const columnMappings_1 = require("./source/columnMappings");
|
|
24
|
+
Object.defineProperty(exports, "ApacheAvroColumnMapping", { enumerable: true, get: function () { return columnMappings_1.ApacheAvroColumnMapping; } });
|
|
25
|
+
Object.defineProperty(exports, "AvroColumnMapping", { enumerable: true, get: function () { return columnMappings_1.AvroColumnMapping; } });
|
|
26
|
+
Object.defineProperty(exports, "ColumnMapping", { enumerable: true, get: function () { return columnMappings_1.ColumnMapping; } });
|
|
27
|
+
Object.defineProperty(exports, "ConstantTransformation", { enumerable: true, get: function () { return columnMappings_1.ConstantTransformation; } });
|
|
28
|
+
Object.defineProperty(exports, "CsvColumnMapping", { enumerable: true, get: function () { return columnMappings_1.CsvColumnMapping; } });
|
|
29
|
+
Object.defineProperty(exports, "FieldTransformation", { enumerable: true, get: function () { return columnMappings_1.FieldTransformation; } });
|
|
30
|
+
Object.defineProperty(exports, "JsonColumnMapping", { enumerable: true, get: function () { return columnMappings_1.JsonColumnMapping; } });
|
|
31
|
+
Object.defineProperty(exports, "OrcColumnMapping", { enumerable: true, get: function () { return columnMappings_1.OrcColumnMapping; } });
|
|
32
|
+
Object.defineProperty(exports, "ParquetColumnMapping", { enumerable: true, get: function () { return columnMappings_1.ParquetColumnMapping; } });
|
|
33
|
+
Object.defineProperty(exports, "SStreamColumnMapping", { enumerable: true, get: function () { return columnMappings_1.SStreamColumnMapping; } });
|
|
34
|
+
Object.defineProperty(exports, "W3CLogFileMapping", { enumerable: true, get: function () { return columnMappings_1.W3CLogFileMapping; } });
|
|
14
35
|
exports.IngestClient = ingestClient_1.default;
|
|
15
36
|
exports.StreamingIngestClient = streamingIngestClient_1.default;
|
|
37
|
+
exports.ManagedStreamingIngestClient = managedStreamingIngestClient_1.default;
|
|
16
38
|
exports.IngestStatusQueues = status_1.default;
|
|
17
39
|
var ingestionProperties_2 = require("./source/ingestionProperties");
|
|
18
40
|
Object.defineProperty(exports, "IngestionProperties", { enumerable: true, get: function () { return ingestionProperties_2.IngestionProperties; } });
|
|
19
41
|
exports.IngestionDescriptors = {
|
|
20
42
|
BlobDescriptor: descriptors_1.BlobDescriptor,
|
|
21
43
|
FileDescriptor: descriptors_1.FileDescriptor,
|
|
22
|
-
StreamDescriptor: descriptors_1.StreamDescriptor
|
|
44
|
+
StreamDescriptor: descriptors_1.StreamDescriptor,
|
|
23
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated - import directly instead
|
|
48
|
+
*/
|
|
24
49
|
exports.IngestionPropertiesEnums = {
|
|
25
|
-
JsonColumnMapping:
|
|
26
|
-
CsvColumnMapping:
|
|
50
|
+
JsonColumnMapping: columnMappings_1.JsonColumnMapping,
|
|
51
|
+
CsvColumnMapping: columnMappings_1.CsvColumnMapping,
|
|
52
|
+
AvroColumnMapping: columnMappings_1.AvroColumnMapping,
|
|
53
|
+
ParquetColumnMapping: columnMappings_1.ParquetColumnMapping,
|
|
54
|
+
OrcColumnMapping: columnMappings_1.OrcColumnMapping,
|
|
55
|
+
W3CLogFileMapping: columnMappings_1.W3CLogFileMapping,
|
|
27
56
|
ValidationPolicy: ingestionProperties_1.ValidationPolicy,
|
|
28
57
|
ReportLevel: ingestionProperties_1.ReportLevel,
|
|
29
58
|
ReportMethod: ingestionProperties_1.ReportMethod,
|
|
30
59
|
ValidationImplications: ingestionProperties_1.ValidationImplications,
|
|
31
60
|
ValidationOptions: ingestionProperties_1.ValidationOptions,
|
|
32
61
|
DataFormat: ingestionProperties_1.DataFormat,
|
|
33
|
-
|
|
34
|
-
|
|
62
|
+
/**
|
|
63
|
+
* @deprecated - use IngestionMappingKind instead
|
|
64
|
+
*/
|
|
65
|
+
IngestionMappingType: ingestionProperties_1.IngestionMappingKind,
|
|
66
|
+
IngestionMappingKind: ingestionProperties_1.IngestionMappingKind,
|
|
67
|
+
CompressionType: descriptors_1.CompressionType,
|
|
68
|
+
ApacheAvroColumnMapping: columnMappings_1.ApacheAvroColumnMapping,
|
|
69
|
+
SStreamColumnMapping: columnMappings_1.SStreamColumnMapping,
|
|
70
|
+
ConstantTransformation: columnMappings_1.ConstantTransformation,
|
|
71
|
+
FieldTransformation: columnMappings_1.FieldTransformation,
|
|
72
|
+
ColumnMapping: columnMappings_1.ColumnMapping,
|
|
35
73
|
};
|
|
74
|
+
var errors_1 = require("./source/errors");
|
|
75
|
+
Object.defineProperty(exports, "IngestionPropertiesValidationError", { enumerable: true, get: function () { return errors_1.IngestionPropertiesValidationError; } });
|
|
36
76
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;;;AAElC,yEAA2C;AAE3C,2FAAmE;AAEnE,6DAAsD;AAEtD,sEAQsC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;;;AAElC,yEAA2C;AAE3C,2FAAmE;AAEnE,yGAAiF;AAEjF,6DAAsD;AAEtD,sEAQsC;AA0ClC,2FAjDA,gCAAU,OAiDA;AACV,qGAjDA,0CAAoB,OAiDA;AALpB,4FA3CA,iCAAW,OA2CA;AACX,6FA3CA,kCAAY,OA2CA;AACZ,uGA3CA,4CAAsB,OA2CA;AACtB,kGA3CA,uCAAiB,OA2CA;AAJjB,iGAtCA,sCAAgB,OAsCA;AAnCpB,sDAAyG;AA0CrG,gGA1CqB,6BAAe,OA0CrB;AAzCnB,4DAYiC;AA8B7B,wGAzCA,wCAAuB,OAyCA;AAZvB,kGA5BA,kCAAiB,OA4BA;AAgBjB,8FA3CA,8BAAa,OA2CA;AAFb,uGAxCA,uCAAsB,OAwCA;AAftB,iGAxBA,iCAAgB,OAwBA;AAgBhB,oGAvCA,oCAAmB,OAuCA;AAjBnB,kGArBA,kCAAiB,OAqBA;AAIjB,iGAxBA,iCAAgB,OAwBA;AADhB,qGAtBA,qCAAoB,OAsBA;AAYpB,qGAjCA,qCAAoB,OAiCA;AAVpB,kGAtBA,kCAAiB,OAsBA;AAjBR,QAAA,YAAY,GAAG,sBAAM,CAAC;AACtB,QAAA,qBAAqB,GAAG,+BAAqB,CAAC;AAC9C,QAAA,4BAA4B,GAAG,sCAA4B,CAAC;AAC5D,QAAA,kBAAkB,GAAG,gBAAuB,CAAC;AAC1D,oEAAmE;AAA1D,0HAAA,mBAAmB,OAAA;AACf,QAAA,oBAAoB,GAAG;IAChC,cAAc,EAAd,4BAAc;IACd,cAAc,EAAd,4BAAc;IACd,gBAAgB,EAAhB,8BAAgB;CACnB,CAAC;AAwBF;;GAEG;AACU,QAAA,wBAAwB,GAAG;IACpC,iBAAiB,EAAjB,kCAAiB;IACjB,gBAAgB,EAAhB,iCAAgB;IAChB,iBAAiB,EAAjB,kCAAiB;IACjB,oBAAoB,EAApB,qCAAoB;IACpB,gBAAgB,EAAhB,iCAAgB;IAChB,iBAAiB,EAAjB,kCAAiB;IACjB,gBAAgB,EAAhB,sCAAgB;IAChB,WAAW,EAAX,iCAAW;IACX,YAAY,EAAZ,kCAAY;IACZ,sBAAsB,EAAtB,4CAAsB;IACtB,iBAAiB,EAAjB,uCAAiB;IACjB,UAAU,EAAV,gCAAU;IACV;;OAEG;IACH,oBAAoB,EAAE,0CAAoB;IAC1C,oBAAoB,EAApB,0CAAoB;IACpB,eAAe,EAAf,6BAAe;IACf,uBAAuB,EAAvB,wCAAuB;IACvB,oBAAoB,EAApB,qCAAoB;IACpB,sBAAsB,EAAtB,uCAAsB;IACtB,mBAAmB,EAAnB,oCAAmB;IACnB,aAAa,EAAb,8BAAa;CAChB,CAAC;AAEF,0CAAqE;AAA5D,4HAAA,kCAAkC,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,57 +1,72 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
|
|
2
|
+
"name": "azure-kusto-ingest",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "Azure Data Explorer Ingestion SDK",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">= 14.0.0"
|
|
9
|
+
},
|
|
10
|
+
"tags": [
|
|
11
|
+
"azure",
|
|
12
|
+
"kusto",
|
|
13
|
+
"sdk"
|
|
14
|
+
],
|
|
15
|
+
"keywords": [
|
|
16
|
+
"node",
|
|
17
|
+
"azure",
|
|
18
|
+
"kusto"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "npm link ../azure-kusto-data && tsc -b",
|
|
22
|
+
"prepublish": "npm run build",
|
|
23
|
+
"example": "npm run build && node example.js",
|
|
24
|
+
"lint": "npx eslint -c .eslintrc.js --ext .ts .",
|
|
25
|
+
"test": "npm run build && mocha --parallel --recursive test/*.js",
|
|
26
|
+
"e2e": "npm run build && mocha --parallel test/e2eTests/e2eTest.ts",
|
|
27
|
+
"allTests": "npm run build && mocha --parallel --timeout 240000 --recursive",
|
|
28
|
+
"testPipeline": "npm run build && nyc --reporter lcovonly mocha --timeout 240000 --recursive --reporter mocha-junit-reporter ",
|
|
29
|
+
"format": "npx prettier --write .",
|
|
30
|
+
"checkFormat": "npx prettier --check --end-of-line lf ."
|
|
31
|
+
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/Azure/azure-kusto-node.git",
|
|
35
|
+
"directory": "azure-kusto-ingest"
|
|
36
|
+
},
|
|
37
|
+
"author": "",
|
|
38
|
+
"license": "ISC",
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@azure/storage-blob": "12.1.2",
|
|
41
|
+
"@azure/storage-queue": "12.0.5",
|
|
42
|
+
"@types/node": "^14.14.13",
|
|
43
|
+
"@types/sinon": "^9.0.9",
|
|
44
|
+
"@types/stream-array": "^1.1.0",
|
|
45
|
+
"@types/stream-to-array": "^2.3.0",
|
|
46
|
+
"@types/uuid": "^8.3.0",
|
|
47
|
+
"@types/uuid-validate": "0.0.1",
|
|
48
|
+
"azure-kusto-data": "file:../azure-kusto-data",
|
|
49
|
+
"moment": "^2.22.2",
|
|
50
|
+
"stream-array": "^1.1.0",
|
|
51
|
+
"stream-to-array": "^2.3.0",
|
|
52
|
+
"uuid": "^8.3.2",
|
|
53
|
+
"uuid-validate": "0.0.3"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@types/mocha": "^8.2.0",
|
|
57
|
+
"@typescript-eslint/eslint-plugin": "^5.12.0",
|
|
58
|
+
"@typescript-eslint/parser": "^5.12.0",
|
|
59
|
+
"eslint": "^8.9.0",
|
|
60
|
+
"eslint-config-prettier": "^8.3.0",
|
|
61
|
+
"eslint-plugin-header": "^3.1.1",
|
|
62
|
+
"eslint-plugin-jsdoc": "^37.9.1",
|
|
63
|
+
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
64
|
+
"mocha": "^9.2.0",
|
|
65
|
+
"mocha-junit-reporter": "^2.0.2",
|
|
66
|
+
"nyc": "^15.1.0",
|
|
67
|
+
"prettier": "2.5.1",
|
|
68
|
+
"sinon": "^7.2.3",
|
|
69
|
+
"ts-node": "^9.1.1",
|
|
70
|
+
"typescript": "^4.1.3"
|
|
71
|
+
}
|
|
57
72
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import IngestionProperties from "./ingestionProperties";
|
|
3
3
|
import { FileDescriptor, StreamDescriptor } from "./descriptors";
|
|
4
|
-
import
|
|
4
|
+
import { Readable } from "stream";
|
|
5
5
|
export declare abstract class AbstractKustoClient {
|
|
6
6
|
defaultProps: IngestionProperties | null;
|
|
7
7
|
protected constructor(defaultProps?: IngestionProperties | null);
|
|
8
8
|
_mergeProps(newProperties?: IngestionProperties | null): IngestionProperties;
|
|
9
|
-
abstract ingestFromStream(stream: StreamDescriptor |
|
|
9
|
+
abstract ingestFromStream(stream: StreamDescriptor | Readable, ingestionProperties: IngestionProperties): Promise<any>;
|
|
10
10
|
abstract ingestFromFile(file: FileDescriptor | string, ingestionProperties: IngestionProperties): Promise<any>;
|
|
11
11
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
2
4
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
5
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
6
|
};
|
|
@@ -11,11 +13,11 @@ class AbstractKustoClient {
|
|
|
11
13
|
}
|
|
12
14
|
_mergeProps(newProperties) {
|
|
13
15
|
// no default props
|
|
14
|
-
if (newProperties
|
|
16
|
+
if (!newProperties || Object.keys(newProperties).length === 0) {
|
|
15
17
|
return this.defaultProps || new ingestionProperties_1.default({});
|
|
16
18
|
}
|
|
17
19
|
// no new props
|
|
18
|
-
if (this.defaultProps == null || Object.keys(this.defaultProps).length
|
|
20
|
+
if (this.defaultProps == null || Object.keys(this.defaultProps).length === 0) {
|
|
19
21
|
return newProperties || new ingestionProperties_1.default({});
|
|
20
22
|
}
|
|
21
23
|
// both exist - merge
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstractKustoClient.js","sourceRoot":"","sources":["abstractKustoClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"abstractKustoClient.js","sourceRoot":"","sources":["abstractKustoClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;;;AAElC,gFAAwD;AAIxD,MAAsB,mBAAmB;IACrC,YAA6B,eAA2C,IAAI;QAA/C,iBAAY,GAAZ,YAAY,CAAmC;IAAG,CAAC;IAEhF,WAAW,CAAC,aAA0C;QAClD,mBAAmB;QACnB,IAAI,CAAC,aAAa,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;YAC3D,OAAO,IAAI,CAAC,YAAY,IAAI,IAAI,6BAAmB,CAAC,EAAE,CAAC,CAAC;SAC3D;QAED,eAAe;QACf,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1E,OAAO,aAAa,IAAI,IAAI,6BAAmB,CAAC,EAAE,CAAC,CAAC;SACvD;QACD,qBAAqB;QACrB,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,IAAI,6BAAmB,CAAC,EAAE,CAAC,CAAC;IACjF,CAAC;CAKJ;AApBD,kDAoBC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { IngestionMappingKind } from "./ingestionProperties";
|
|
2
|
+
export declare enum FieldTransformation {
|
|
3
|
+
PropertyBagArrayToDictionary = "PropertyBagArrayToDictionary",
|
|
4
|
+
DateTimeFromUnixSeconds = "DateTimeFromUnixSeconds",
|
|
5
|
+
DateTimeFromUnixMilliseconds = "DateTimeFromUnixMilliseconds",
|
|
6
|
+
DateTimeFromUnixMicroseconds = "DateTimeFromUnixMicroseconds",
|
|
7
|
+
DateTimeFromUnixNanoseconds = "DateTimeFromUnixNanoseconds"
|
|
8
|
+
}
|
|
9
|
+
export declare enum ConstantTransformation {
|
|
10
|
+
SourceLocation = "SourceLocation",
|
|
11
|
+
SourceLineNumber = "SourceLineNumber"
|
|
12
|
+
}
|
|
13
|
+
export declare type Transformation = FieldTransformation | ConstantTransformation;
|
|
14
|
+
interface MappingProperties {
|
|
15
|
+
Field?: string;
|
|
16
|
+
Path?: string;
|
|
17
|
+
Ordinal?: number;
|
|
18
|
+
ConstValue?: string;
|
|
19
|
+
Transform?: Transformation;
|
|
20
|
+
}
|
|
21
|
+
declare type MappingPropertiesStrings = {
|
|
22
|
+
[key in keyof MappingProperties]: string;
|
|
23
|
+
};
|
|
24
|
+
interface ApiColumnMapping {
|
|
25
|
+
Column: string;
|
|
26
|
+
DataType?: string;
|
|
27
|
+
Properties?: MappingPropertiesStrings;
|
|
28
|
+
}
|
|
29
|
+
export declare abstract class ColumnMapping {
|
|
30
|
+
readonly columnName: string;
|
|
31
|
+
readonly cslDataType?: string | undefined;
|
|
32
|
+
readonly Properties?: MappingProperties | undefined;
|
|
33
|
+
protected constructor(columnName: string, cslDataType?: string | undefined, Properties?: MappingProperties | undefined);
|
|
34
|
+
abstract mappingKind: IngestionMappingKind;
|
|
35
|
+
toApiMapping(): ApiColumnMapping;
|
|
36
|
+
}
|
|
37
|
+
export declare class CsvColumnMapping extends ColumnMapping {
|
|
38
|
+
readonly columnName: string;
|
|
39
|
+
readonly cslDataType?: string | undefined;
|
|
40
|
+
readonly ordinal?: string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated Use the factory methods instead.
|
|
43
|
+
*/
|
|
44
|
+
protected constructor(columnName: string, cslDataType?: string | undefined, ordinal?: string | undefined, constantValue?: string);
|
|
45
|
+
static withOrdinal(columnName: string, ordinal: number, cslDataType?: string): CsvColumnMapping;
|
|
46
|
+
static withConstantValue(columnName: string, constantValue: string, cslDataType?: string): CsvColumnMapping;
|
|
47
|
+
mappingKind: IngestionMappingKind;
|
|
48
|
+
}
|
|
49
|
+
export declare class JsonColumnMapping extends ColumnMapping {
|
|
50
|
+
readonly columnName: string;
|
|
51
|
+
readonly jsonPath?: string | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated Use the factory methods instead.
|
|
54
|
+
*/
|
|
55
|
+
constructor(columnName: string, jsonPath?: string | undefined, cslDataType?: string | null, constantValue?: string, transform?: Transformation);
|
|
56
|
+
static withPath(columnName: string, path: string, cslDataType?: string, transform?: FieldTransformation): JsonColumnMapping;
|
|
57
|
+
static withConstantValue(columnName: string, constantValue: string, cslDataType?: string): JsonColumnMapping;
|
|
58
|
+
static withTransform(columnName: string, transform: ConstantTransformation, cslDataType?: string): JsonColumnMapping;
|
|
59
|
+
mappingKind: IngestionMappingKind;
|
|
60
|
+
}
|
|
61
|
+
export declare class AvroColumnMapping extends ColumnMapping {
|
|
62
|
+
readonly columnName: string;
|
|
63
|
+
private constructor();
|
|
64
|
+
static withPath(columnName: string, path: string, cslDataType?: string, transform?: FieldTransformation): AvroColumnMapping;
|
|
65
|
+
static withField(columnName: string, field: string, cslDataType?: string, transform?: FieldTransformation): AvroColumnMapping;
|
|
66
|
+
static withConstantValue(columnName: string, constantValue: string, cslDataType?: string): AvroColumnMapping;
|
|
67
|
+
static withTransform(columnName: string, transform: ConstantTransformation, cslDataType?: string): AvroColumnMapping;
|
|
68
|
+
mappingKind: IngestionMappingKind;
|
|
69
|
+
}
|
|
70
|
+
export declare class ApacheAvroColumnMapping extends ColumnMapping {
|
|
71
|
+
readonly columnName: string;
|
|
72
|
+
private constructor();
|
|
73
|
+
static withPath(columnName: string, path: string, cslDataType?: string, transform?: FieldTransformation): ApacheAvroColumnMapping;
|
|
74
|
+
static withField(columnName: string, field: string, cslDataType?: string, transform?: FieldTransformation): ApacheAvroColumnMapping;
|
|
75
|
+
static withConstantValue(columnName: string, constantValue: string, cslDataType?: string): ApacheAvroColumnMapping;
|
|
76
|
+
static withTransform(columnName: string, transform: ConstantTransformation, cslDataType?: string): ApacheAvroColumnMapping;
|
|
77
|
+
mappingKind: IngestionMappingKind;
|
|
78
|
+
}
|
|
79
|
+
export declare class SStreamColumnMapping extends ColumnMapping {
|
|
80
|
+
readonly columnName: string;
|
|
81
|
+
private constructor();
|
|
82
|
+
static withPath(columnName: string, path: string, cslDataType?: string, transform?: FieldTransformation): SStreamColumnMapping;
|
|
83
|
+
static withField(columnName: string, field: string, cslDataType?: string, transform?: FieldTransformation): SStreamColumnMapping;
|
|
84
|
+
static withConstantValue(columnName: string, constantValue: string, cslDataType?: string): SStreamColumnMapping;
|
|
85
|
+
static withTransform(columnName: string, transform: ConstantTransformation, cslDataType?: string): SStreamColumnMapping;
|
|
86
|
+
mappingKind: IngestionMappingKind;
|
|
87
|
+
}
|
|
88
|
+
export declare class ParquetColumnMapping extends ColumnMapping {
|
|
89
|
+
readonly columnName: string;
|
|
90
|
+
private constructor();
|
|
91
|
+
static withPath(columnName: string, path: string, cslDataType?: string, transform?: FieldTransformation): ParquetColumnMapping;
|
|
92
|
+
static withField(columnName: string, field: string, cslDataType?: string, transform?: FieldTransformation): ParquetColumnMapping;
|
|
93
|
+
static withConstantValue(columnName: string, constantValue: string, cslDataType?: string): ParquetColumnMapping;
|
|
94
|
+
static withTransform(columnName: string, transform: ConstantTransformation, cslDataType?: string): ParquetColumnMapping;
|
|
95
|
+
mappingKind: IngestionMappingKind;
|
|
96
|
+
}
|
|
97
|
+
export declare class OrcColumnMapping extends ColumnMapping {
|
|
98
|
+
readonly columnName: string;
|
|
99
|
+
private constructor();
|
|
100
|
+
static withPath(columnName: string, path: string, cslDataType?: string, transform?: FieldTransformation): OrcColumnMapping;
|
|
101
|
+
static withField(columnName: string, field: string, cslDataType?: string, transform?: FieldTransformation): OrcColumnMapping;
|
|
102
|
+
static withConstantValue(columnName: string, constantValue: string, cslDataType?: string): OrcColumnMapping;
|
|
103
|
+
static withTransform(columnName: string, transform: ConstantTransformation, cslDataType?: string): OrcColumnMapping;
|
|
104
|
+
mappingKind: IngestionMappingKind;
|
|
105
|
+
}
|
|
106
|
+
export declare class W3CLogFileMapping extends ColumnMapping {
|
|
107
|
+
readonly columnName: string;
|
|
108
|
+
private constructor();
|
|
109
|
+
static withField(columnName: string, field: string, cslDataType?: string, transform?: FieldTransformation): W3CLogFileMapping;
|
|
110
|
+
static withConstantValue(columnName: string, constantValue: string, cslDataType?: string): W3CLogFileMapping;
|
|
111
|
+
static withTransform(columnName: string, transform: ConstantTransformation, cslDataType?: string): W3CLogFileMapping;
|
|
112
|
+
mappingKind: IngestionMappingKind;
|
|
113
|
+
}
|
|
114
|
+
export {};
|