azure-kusto-ingest 2.2.2 → 3.1.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.
Files changed (54) hide show
  1. package/.eslintignore +5 -0
  2. package/.eslintrc.js +247 -0
  3. package/.mocharc.json +2 -2
  4. package/.prettierignore +8 -0
  5. package/.prettierrc.json +5 -0
  6. package/README.md +64 -62
  7. package/example.js +20 -30
  8. package/index.d.ts +24 -2
  9. package/index.js +46 -6
  10. package/index.js.map +1 -1
  11. package/package.json +70 -55
  12. package/source/abstractKustoClient.d.ts +7 -7
  13. package/source/abstractKustoClient.js +17 -16
  14. package/source/abstractKustoClient.js.map +1 -1
  15. package/source/columnMappings.d.ts +114 -0
  16. package/source/columnMappings.js +241 -0
  17. package/source/columnMappings.js.map +1 -0
  18. package/source/descriptors.d.ts +4 -3
  19. package/source/descriptors.js +17 -7
  20. package/source/descriptors.js.map +1 -1
  21. package/source/errors.d.ts +3 -0
  22. package/source/errors.js +13 -0
  23. package/source/errors.js.map +1 -0
  24. package/source/ingestClient.d.ts +6 -7
  25. package/source/ingestClient.js +7 -13
  26. package/source/ingestClient.js.map +1 -1
  27. package/source/ingestionBlobInfo.js +13 -10
  28. package/source/ingestionBlobInfo.js.map +1 -1
  29. package/source/ingestionProperties.d.ts +104 -40
  30. package/source/ingestionProperties.js +180 -84
  31. package/source/ingestionProperties.js.map +1 -1
  32. package/source/managedStreamingIngestClient.d.ts +36 -0
  33. package/source/managedStreamingIngestClient.js +103 -0
  34. package/source/managedStreamingIngestClient.js.map +1 -0
  35. package/source/resourceManager.d.ts +1 -1
  36. package/source/resourceManager.js +14 -16
  37. package/source/resourceManager.js.map +1 -1
  38. package/source/retry.d.ts +10 -0
  39. package/source/retry.js +44 -0
  40. package/source/retry.js.map +1 -0
  41. package/source/status.js +6 -17
  42. package/source/status.js.map +1 -1
  43. package/source/statusQ.js +7 -6
  44. package/source/statusQ.js.map +1 -1
  45. package/source/streamUtils.d.ts +6 -0
  46. package/source/streamUtils.js +61 -0
  47. package/source/streamUtils.js.map +1 -0
  48. package/source/streamingIngestClient.d.ts +5 -6
  49. package/source/streamingIngestClient.js +7 -19
  50. package/source/streamingIngestClient.js.map +1 -1
  51. package/tsconfig.json +16 -16
  52. package/tsconfig.tsbuildinfo +1 -1
  53. package/index.ts +0 -48
  54. package/tslint.json +0 -18
@@ -1,24 +1,88 @@
1
+ import { ColumnMapping } from "./columnMappings";
2
+ /**
3
+ * Data formats supported for Kusto ingestion.
4
+ */
1
5
  export declare enum DataFormat {
6
+ /**
7
+ * Comma-separated value.
8
+ */
2
9
  CSV = "csv",
10
+ /**
11
+ * Tab-separated value.
12
+ */
3
13
  TSV = "tsv",
14
+ /**
15
+ * Semicolon-separated value (the unique Azure Storage log format).
16
+ */
4
17
  SCSV = "scsv",
18
+ /**
19
+ * Start-Of-Header (CTRL-A)-separated value.
20
+ */
5
21
  SOHSV = "sohsv",
22
+ /**
23
+ * Pipeline-separated value (used by Cosmos).
24
+ */
6
25
  PSV = "psv",
26
+ /**
27
+ * Each record is a line and has just one field.
28
+ */
7
29
  TXT = "txt",
30
+ /**
31
+ * Whole stream is a single record with a single field.
32
+ */
33
+ RAW = "raw",
34
+ /**
35
+ * Tab-separated value with '\' escaping character.
36
+ */
37
+ TSVE = "tsve",
38
+ /**
39
+ * Data is in a JSON format, each line is record with a single JSON value.
40
+ */
8
41
  JSON = "json",
42
+ /**
43
+ * Data stream holds a single JSON value -- newlines are regular whitespace.
44
+ */
9
45
  SINGLEJSON = "singlejson",
46
+ /**
47
+ * The data stream is a concatenation of JSON documents (property bags all).
48
+ */
49
+ MULTIJSON = "multijson",
50
+ /**
51
+ * Avro format.
52
+ */
10
53
  AVRO = "avro",
54
+ /**
55
+ * Parquet format.
56
+ */
11
57
  PARQUET = "parquet",
12
- TSVE = "tsve",
13
- ORC = "orc"
58
+ /**
59
+ * Microsoft Cosmos structured streams format
60
+ */
61
+ SSTREAM = "sstream",
62
+ /**
63
+ * The Optimized Row Columnar (ORC)
64
+ */
65
+ ORC = "orc",
66
+ /**
67
+ * Avro format for ingesting through avro2json.
68
+ */
69
+ APACHEAVRO = "apacheavro",
70
+ /**
71
+ * W3C Extended Log File format.
72
+ */
73
+ W3CLogFile = "w3clogfile"
14
74
  }
15
- export declare enum IngestionMappingType {
75
+ export declare enum IngestionMappingKind {
16
76
  CSV = "Csv",
17
- PARQUET = "Parquet",
18
- AVRO = "Avro",
19
77
  JSON = "Json",
20
- ORC = "orc"
78
+ AVRO = "Avro",
79
+ PARQUET = "Parquet",
80
+ SSTREAM = "SStream",
81
+ ORC = "orc",
82
+ APACHEAVRO = "ApacheAvro",
83
+ W3CLOGFILE = "W3CLogFile"
21
84
  }
85
+ export declare const dataFormatMappingKind: (dataFormat: DataFormat) => IngestionMappingKind;
22
86
  export declare enum ValidationOptions {
23
87
  DoNotValidate = 0,
24
88
  ValidateCsvInputConstantColumns = 1,
@@ -32,6 +96,7 @@ export declare class ValidationPolicy {
32
96
  readonly validationOptions: ValidationOptions;
33
97
  readonly validationImplications: ValidationImplications;
34
98
  constructor(validationOptions?: ValidationOptions, validationImplications?: ValidationImplications);
99
+ toJSON(): Record<string, number>;
35
100
  }
36
101
  export declare enum ReportLevel {
37
102
  FailuresOnly = 0,
@@ -39,45 +104,44 @@ export declare enum ReportLevel {
39
104
  FailuresAndSuccesses = 2
40
105
  }
41
106
  export declare enum ReportMethod {
42
- Queue = 0
43
- }
44
- declare class ColumnMapping {
45
- }
46
- export declare class CsvColumnMapping extends ColumnMapping {
47
- readonly columnName: string;
48
- readonly cslDataType: string;
49
- readonly ordinal: string;
50
- constructor(columnName: string, cslDataType: string, ordinal: string);
107
+ Queue = 0,
108
+ Table = 1,
109
+ QueueAndTable = 2
51
110
  }
52
- export declare class JsonColumnMapping extends ColumnMapping {
53
- readonly columnName: string;
54
- readonly jsonPath: string;
55
- readonly cslDataType: string | null;
56
- constructor(columnName: string, jsonPath: string, cslDataType?: string | null);
57
- }
58
- declare class IngestionPropertiesFields {
59
- database?: string | null;
60
- table?: string | null;
61
- format?: string | null;
62
- ingestionMapping?: ColumnMapping[] | null;
63
- ingestionMappingReference?: string | null;
64
- ingestionMappingType?: string | null;
65
- additionalTags?: string | null;
66
- ingestIfNotExists?: string | null;
67
- ingestByTags?: string[] | null;
68
- dropByTags?: string[] | null;
69
- flushImmediately?: boolean | null;
70
- reportLevel?: ReportLevel | null;
71
- reportMethod?: ReportMethod | null;
72
- validationPolicy?: string | null;
111
+ export interface IngestionPropertiesFields {
112
+ database?: string;
113
+ table?: string;
114
+ format?: DataFormat;
115
+ /**
116
+ * @deprecated. Use ingestionMappingColumns instead.
117
+ */
118
+ ingestionMapping?: ColumnMapping[];
119
+ ingestionMappingColumns?: ColumnMapping[];
120
+ ingestionMappingReference?: string;
121
+ /**
122
+ * @deprecated. Use ingestionMappingKind instead.
123
+ */
124
+ ingestionMappingType?: IngestionMappingKind;
125
+ ingestionMappingKind?: IngestionMappingKind;
126
+ additionalTags?: string;
127
+ ingestIfNotExists?: string;
128
+ ingestByTags?: string[];
129
+ dropByTags?: string[];
130
+ flushImmediately?: boolean;
131
+ reportLevel?: ReportLevel;
132
+ reportMethod?: ReportMethod;
133
+ validationPolicy?: ValidationPolicy;
73
134
  additionalProperties?: {
74
135
  [additional: string]: any;
75
136
  } | null;
76
137
  }
77
- export declare class IngestionProperties extends IngestionPropertiesFields {
78
- constructor({ database, table, format, ingestionMapping, ingestionMappingReference, ingestionMappingType, additionalTags, ingestIfNotExists, ingestByTags, dropByTags, flushImmediately, reportLevel, reportMethod, validationPolicy, additionalProperties }: IngestionPropertiesFields);
138
+ export interface IngestionProperties extends IngestionPropertiesFields {
139
+ }
140
+ export declare class IngestionProperties {
141
+ constructor(data: Partial<IngestionPropertiesFields>);
79
142
  validate(): void;
80
- [extraProps: string]: any;
81
- merge(extraProps: any): IngestionProperties;
143
+ merge(extraProps: IngestionPropertiesInput): IngestionProperties;
144
+ setDefaults(): void;
82
145
  }
146
+ export declare type IngestionPropertiesInput = IngestionProperties | IngestionPropertiesFields | null | undefined;
83
147
  export default IngestionProperties;
@@ -2,30 +2,135 @@
2
2
  // Copyright (c) Microsoft Corporation.
3
3
  // Licensed under the MIT License.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.IngestionProperties = exports.JsonColumnMapping = exports.CsvColumnMapping = exports.ReportMethod = exports.ReportLevel = exports.ValidationPolicy = exports.ValidationImplications = exports.ValidationOptions = exports.IngestionMappingType = exports.DataFormat = void 0;
5
+ exports.IngestionProperties = exports.ReportMethod = exports.ReportLevel = exports.ValidationPolicy = exports.ValidationImplications = exports.ValidationOptions = exports.dataFormatMappingKind = exports.IngestionMappingKind = exports.DataFormat = void 0;
6
+ /* eslint-disable max-classes-per-file -- the main class is IngestionProperties, ValidationPolicy is a tiny class */
7
+ const errors_1 = require("./errors");
8
+ /**
9
+ * Data formats supported for Kusto ingestion.
10
+ */
6
11
  var DataFormat;
7
12
  (function (DataFormat) {
13
+ /**
14
+ * Comma-separated value.
15
+ */
8
16
  DataFormat["CSV"] = "csv";
17
+ /**
18
+ * Tab-separated value.
19
+ */
9
20
  DataFormat["TSV"] = "tsv";
21
+ /**
22
+ * Semicolon-separated value (the unique Azure Storage log format).
23
+ */
10
24
  DataFormat["SCSV"] = "scsv";
25
+ /**
26
+ * Start-Of-Header (CTRL-A)-separated value.
27
+ */
11
28
  DataFormat["SOHSV"] = "sohsv";
29
+ /**
30
+ * Pipeline-separated value (used by Cosmos).
31
+ */
12
32
  DataFormat["PSV"] = "psv";
33
+ /**
34
+ * Each record is a line and has just one field.
35
+ */
13
36
  DataFormat["TXT"] = "txt";
37
+ /**
38
+ * Whole stream is a single record with a single field.
39
+ */
40
+ DataFormat["RAW"] = "raw";
41
+ /**
42
+ * Tab-separated value with '\' escaping character.
43
+ */
44
+ DataFormat["TSVE"] = "tsve";
45
+ /**
46
+ * Data is in a JSON format, each line is record with a single JSON value.
47
+ */
14
48
  DataFormat["JSON"] = "json";
49
+ /**
50
+ * Data stream holds a single JSON value -- newlines are regular whitespace.
51
+ */
15
52
  DataFormat["SINGLEJSON"] = "singlejson";
53
+ /**
54
+ * The data stream is a concatenation of JSON documents (property bags all).
55
+ */
56
+ DataFormat["MULTIJSON"] = "multijson";
57
+ /**
58
+ * Avro format.
59
+ */
16
60
  DataFormat["AVRO"] = "avro";
61
+ /**
62
+ * Parquet format.
63
+ */
17
64
  DataFormat["PARQUET"] = "parquet";
18
- DataFormat["TSVE"] = "tsve";
65
+ /**
66
+ * Microsoft Cosmos structured streams format
67
+ */
68
+ DataFormat["SSTREAM"] = "sstream";
69
+ /**
70
+ * The Optimized Row Columnar (ORC)
71
+ */
19
72
  DataFormat["ORC"] = "orc";
73
+ /**
74
+ * Avro format for ingesting through avro2json.
75
+ */
76
+ DataFormat["APACHEAVRO"] = "apacheavro";
77
+ /**
78
+ * W3C Extended Log File format.
79
+ */
80
+ DataFormat["W3CLogFile"] = "w3clogfile";
20
81
  })(DataFormat = exports.DataFormat || (exports.DataFormat = {}));
21
- var IngestionMappingType;
22
- (function (IngestionMappingType) {
23
- IngestionMappingType["CSV"] = "Csv";
24
- IngestionMappingType["PARQUET"] = "Parquet";
25
- IngestionMappingType["AVRO"] = "Avro";
26
- IngestionMappingType["JSON"] = "Json";
27
- IngestionMappingType["ORC"] = "orc";
28
- })(IngestionMappingType = exports.IngestionMappingType || (exports.IngestionMappingType = {}));
82
+ var IngestionMappingKind;
83
+ (function (IngestionMappingKind) {
84
+ IngestionMappingKind["CSV"] = "Csv";
85
+ IngestionMappingKind["JSON"] = "Json";
86
+ IngestionMappingKind["AVRO"] = "Avro";
87
+ IngestionMappingKind["PARQUET"] = "Parquet";
88
+ IngestionMappingKind["SSTREAM"] = "SStream";
89
+ IngestionMappingKind["ORC"] = "orc";
90
+ IngestionMappingKind["APACHEAVRO"] = "ApacheAvro";
91
+ IngestionMappingKind["W3CLOGFILE"] = "W3CLogFile";
92
+ })(IngestionMappingKind = exports.IngestionMappingKind || (exports.IngestionMappingKind = {}));
93
+ const dataFormatMappingKind = (dataFormat) => {
94
+ switch (dataFormat) {
95
+ case DataFormat.CSV:
96
+ return IngestionMappingKind.CSV;
97
+ case DataFormat.TSV:
98
+ return IngestionMappingKind.CSV;
99
+ case DataFormat.SCSV:
100
+ return IngestionMappingKind.CSV;
101
+ case DataFormat.SOHSV:
102
+ return IngestionMappingKind.CSV;
103
+ case DataFormat.PSV:
104
+ return IngestionMappingKind.CSV;
105
+ case DataFormat.TXT:
106
+ return IngestionMappingKind.CSV;
107
+ case DataFormat.RAW:
108
+ return IngestionMappingKind.CSV;
109
+ case DataFormat.TSVE:
110
+ return IngestionMappingKind.CSV;
111
+ case DataFormat.JSON:
112
+ return IngestionMappingKind.JSON;
113
+ case DataFormat.SINGLEJSON:
114
+ return IngestionMappingKind.JSON;
115
+ case DataFormat.MULTIJSON:
116
+ return IngestionMappingKind.JSON;
117
+ case DataFormat.AVRO:
118
+ return IngestionMappingKind.AVRO;
119
+ case DataFormat.PARQUET:
120
+ return IngestionMappingKind.PARQUET;
121
+ case DataFormat.SSTREAM:
122
+ return IngestionMappingKind.SSTREAM;
123
+ case DataFormat.ORC:
124
+ return IngestionMappingKind.ORC;
125
+ case DataFormat.APACHEAVRO:
126
+ return IngestionMappingKind.APACHEAVRO;
127
+ case DataFormat.W3CLogFile:
128
+ return IngestionMappingKind.W3CLOGFILE;
129
+ default:
130
+ throw new errors_1.IngestionPropertiesValidationError(`Unsupported data format: ${dataFormat}`);
131
+ }
132
+ };
133
+ exports.dataFormatMappingKind = dataFormatMappingKind;
29
134
  var ValidationOptions;
30
135
  (function (ValidationOptions) {
31
136
  ValidationOptions[ValidationOptions["DoNotValidate"] = 0] = "DoNotValidate";
@@ -42,6 +147,12 @@ class ValidationPolicy {
42
147
  this.validationOptions = validationOptions;
43
148
  this.validationImplications = validationImplications;
44
149
  }
150
+ toJSON() {
151
+ return {
152
+ ValidationOptions: this.validationOptions,
153
+ ValidationImplications: this.validationImplications,
154
+ };
155
+ }
45
156
  }
46
157
  exports.ValidationPolicy = ValidationPolicy;
47
158
  var ReportLevel;
@@ -53,94 +164,79 @@ var ReportLevel;
53
164
  var ReportMethod;
54
165
  (function (ReportMethod) {
55
166
  ReportMethod[ReportMethod["Queue"] = 0] = "Queue";
167
+ ReportMethod[ReportMethod["Table"] = 1] = "Table";
168
+ ReportMethod[ReportMethod["QueueAndTable"] = 2] = "QueueAndTable";
56
169
  })(ReportMethod = exports.ReportMethod || (exports.ReportMethod = {}));
57
- class ColumnMapping {
58
- }
59
- class CsvColumnMapping extends ColumnMapping {
60
- constructor(columnName, cslDataType, ordinal) {
61
- super();
62
- this.columnName = columnName;
63
- this.cslDataType = cslDataType;
64
- this.ordinal = ordinal;
65
- }
66
- }
67
- exports.CsvColumnMapping = CsvColumnMapping;
68
- class JsonColumnMapping extends ColumnMapping {
69
- constructor(columnName, jsonPath, cslDataType = null) {
70
- super();
71
- this.columnName = columnName;
72
- this.jsonPath = jsonPath;
73
- this.cslDataType = cslDataType;
74
- }
75
- }
76
- exports.JsonColumnMapping = JsonColumnMapping;
77
- class IngestionPropertiesFields {
78
- constructor() {
79
- this.database = null;
80
- this.table = null;
81
- this.format = null;
82
- this.ingestionMapping = null;
83
- this.ingestionMappingReference = null;
84
- this.ingestionMappingType = null;
85
- this.additionalTags = null;
86
- this.ingestIfNotExists = null;
87
- this.ingestByTags = null;
88
- this.dropByTags = null;
89
- this.flushImmediately = null;
90
- this.reportLevel = null;
91
- this.reportMethod = null;
92
- this.validationPolicy = null;
93
- this.additionalProperties = null;
94
- }
95
- }
96
- class IngestionProperties extends IngestionPropertiesFields {
97
- constructor({ database = null, table = null, format = null, ingestionMapping = null, ingestionMappingReference = null, ingestionMappingType = null, additionalTags = null, ingestIfNotExists = null, ingestByTags = null, dropByTags = null, flushImmediately = null, reportLevel = null, reportMethod = null, validationPolicy = null, additionalProperties = null }) {
98
- super();
99
- if (ingestionMapping && ingestionMappingReference)
100
- throw new Error("Both mapping and a mapping reference detected");
101
- this.database = database;
102
- this.table = table;
103
- this.format = format;
104
- this.ingestionMapping = ingestionMapping;
105
- this.ingestionMappingType = ingestionMappingType;
106
- this.ingestionMappingReference = ingestionMappingReference;
107
- this.additionalTags = additionalTags;
108
- this.ingestIfNotExists = ingestIfNotExists;
109
- this.ingestByTags = ingestByTags;
110
- this.dropByTags = dropByTags;
111
- this.flushImmediately = flushImmediately;
112
- this.reportLevel = reportLevel;
113
- this.reportMethod = reportMethod;
114
- this.validationPolicy = validationPolicy;
115
- this.additionalProperties = additionalProperties;
170
+ // eslint-disable-next-line no-redeclare
171
+ class IngestionProperties {
172
+ constructor(data) {
173
+ Object.assign(this, data);
116
174
  }
117
175
  validate() {
118
- if (!this.flushImmediately)
119
- this.flushImmediately = false;
120
- if (!this.reportLevel)
121
- this.reportLevel = ReportLevel.DoNotReport;
122
- if (!this.reportMethod)
123
- this.reportMethod = ReportMethod.Queue;
124
176
  if (!this.database)
125
- throw new Error("Must define a target database");
177
+ throw new errors_1.IngestionPropertiesValidationError("Must define a target database");
126
178
  if (!this.table)
127
- throw new Error("Must define a target table");
179
+ throw new errors_1.IngestionPropertiesValidationError("Must define a target table");
128
180
  if (!this.format)
129
- throw new Error("Must define a data format");
130
- if (this.ingestionMapping && this.ingestionMappingReference)
131
- throw new Error("Both mapping and a mapping reference detected");
132
- if (!this.ingestionMapping && !this.ingestionMappingReference && this.format === DataFormat.JSON)
133
- throw new Error("Json must have a mapping defined");
181
+ throw new errors_1.IngestionPropertiesValidationError("Must define a data format");
182
+ if (this.ingestionMappingType && !this.ingestionMappingKind) {
183
+ this.ingestionMappingKind = this.ingestionMappingType;
184
+ }
185
+ if (this.ingestionMapping && !this.ingestionMappingColumns) {
186
+ this.ingestionMappingColumns = this.ingestionMapping;
187
+ }
188
+ if (!this.ingestionMappingColumns && !this.ingestionMappingReference) {
189
+ if (this.ingestionMappingKind) {
190
+ throw new errors_1.IngestionPropertiesValidationError("Cannot define ingestionMappingKind without either ingestionMappingColumns or" + " ingestionMappingReference");
191
+ }
192
+ }
193
+ else {
194
+ const mappingKind = (0, exports.dataFormatMappingKind)(this.format);
195
+ if (this.ingestionMappingKind && this.ingestionMappingKind !== mappingKind) {
196
+ throw new errors_1.IngestionPropertiesValidationError(`Mapping kind '${this.ingestionMappingKind}' does not match format '${this.format}' (should be '${mappingKind}')`);
197
+ }
198
+ if (this.ingestionMappingColumns) {
199
+ if (this.ingestionMappingReference) {
200
+ throw new errors_1.IngestionPropertiesValidationError("Cannot define both ingestionMappingColumns and ingestionMappingReference");
201
+ }
202
+ if (this.ingestionMappingColumns.length === 0) {
203
+ throw new errors_1.IngestionPropertiesValidationError("Must define at least one column mapping");
204
+ }
205
+ const wrongMappings = this.ingestionMappingColumns
206
+ .filter((m) => m.mappingKind !== mappingKind)
207
+ .map((m) => `Mapping kind mismatch for column '${m.columnName}' - expected data format kind - '${mappingKind}', but was '${m.mappingKind}'`);
208
+ if (wrongMappings.length > 0) {
209
+ throw new errors_1.IngestionPropertiesValidationError(`Invalid columns:\n${wrongMappings.join("\n")}`);
210
+ }
211
+ }
212
+ }
134
213
  }
135
214
  merge(extraProps) {
136
215
  const merged = new IngestionProperties(this);
216
+ if (!extraProps) {
217
+ return merged;
218
+ }
219
+ const assign = (obj, prop, value) => {
220
+ obj[prop] = value;
221
+ };
137
222
  for (const key of Object.keys(extraProps)) {
138
- if (extraProps[key] != null) {
139
- merged[key] = extraProps[key];
223
+ if (extraProps[key]) {
224
+ assign(merged, key, extraProps[key]);
140
225
  }
141
226
  }
142
227
  return merged;
143
228
  }
229
+ setDefaults() {
230
+ if (!this.format) {
231
+ this.format = DataFormat.CSV;
232
+ }
233
+ if (!this.reportLevel) {
234
+ this.reportLevel = ReportLevel.FailuresOnly;
235
+ }
236
+ if (!this.reportMethod) {
237
+ this.reportMethod = ReportMethod.Queue;
238
+ }
239
+ }
144
240
  }
145
241
  exports.IngestionProperties = IngestionProperties;
146
242
  exports.default = IngestionProperties;
@@ -1 +1 @@
1
- {"version":3,"file":"ingestionProperties.js","sourceRoot":"","sources":["ingestionProperties.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,IAAY,UAaX;AAbD,WAAY,UAAU;IAClB,yBAAW,CAAA;IACX,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,6BAAe,CAAA;IACf,yBAAW,CAAA;IACX,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,uCAAyB,CAAA;IACzB,2BAAa,CAAA;IACb,iCAAmB,CAAA;IACnB,2BAAa,CAAA;IACb,yBAAW,CAAA;AACf,CAAC,EAbW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAarB;AAED,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC5B,mCAAW,CAAA;IACX,2CAAmB,CAAA;IACnB,qCAAa,CAAA;IACb,qCAAa,CAAA;IACb,mCAAW,CAAA;AACf,CAAC,EANW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAM/B;AAED,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IACzB,2EAAiB,CAAA;IACjB,+GAAmC,CAAA;IACnC,+GAAmC,CAAA;AACvC,CAAC,EAJW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAI5B;AAGD,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAC9B,mEAAQ,CAAA;IACR,+EAAc,CAAA;AAClB,CAAC,EAHW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAGjC;AAGD,MAAa,gBAAgB;IACzB,YAAqB,oBAAuC,iBAAiB,CAAC,aAAa,EAAW,yBAAiD,sBAAsB,CAAC,UAAU;QAAnK,sBAAiB,GAAjB,iBAAiB,CAAqD;QAAW,2BAAsB,GAAtB,sBAAsB,CAA4D;IACxL,CAAC;CACJ;AAHD,4CAGC;AAED,IAAY,WAIX;AAJD,WAAY,WAAW;IACnB,6DAAgB,CAAA;IAChB,2DAAe,CAAA;IACf,6EAAwB,CAAA;AAC5B,CAAC,E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GAAG,CAC1I,CAAC;gBACN,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE;oBAC1B,MAAM,IAAI,2CAAkC,CAAC,qBAAqB,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;iBACjG;aACJ;SACJ;IACL,CAAC;IAED,KAAK,CAAC,UAAoC;QACtC,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAE7C,IAAI,CAAC,UAAU,EAAE;YACb,OAAO,MAAM,CAAC;SACjB;QAED,MAAM,MAAM,GAAG,CACX,GAA8B,EAC9B,IAAO,EACP,KAAQ,EACV,EAAE;YACA,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;QACtB,CAAC,CAAC;QAEF,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAwC,EAAE;YAC9E,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE;gBACjB,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;aACxC;SACJ;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,WAAW;QACP,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACd,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC;SAChC;QACD,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YACnB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC,YAAY,CAAC;SAC/C;QACD,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACpB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC;SAC1C;IACL,CAAC;CACJ;AAvFD,kDAuFC;AAID,kBAAe,mBAAmB,CAAC"}
@@ -0,0 +1,36 @@
1
+ /// <reference types="node" />
2
+ import { IngestionPropertiesInput } from "./ingestionProperties";
3
+ import { FileDescriptor, StreamDescriptor } from "./descriptors";
4
+ import { AbstractKustoClient } from "./abstractKustoClient";
5
+ import { KustoConnectionStringBuilder } from "azure-kusto-data";
6
+ import { KustoResponseDataSet } from "azure-kusto-data/source/response";
7
+ import { QueueSendMessageResponse } from "@azure/storage-queue";
8
+ import { Readable } from "stream";
9
+ declare class KustoManagedStreamingIngestClient extends AbstractKustoClient {
10
+ private streamingIngestClient;
11
+ private queuedIngestClient;
12
+ private baseSleepTimeSecs;
13
+ private baseJitterSecs;
14
+ /**
15
+ * Creates a KustoManagedStreamingIngestClient from a DM connection string.
16
+ * This method infers the engine connection string.
17
+ * For advanced usage, use the constructor that takes a DM connection string and an engine connection string.
18
+ *
19
+ * @param dmConnectionString The DM connection string.
20
+ * @param defaultProps The default ingestion properties.
21
+ */
22
+ static fromDmConnectionString(dmConnectionString: KustoConnectionStringBuilder, defaultProps?: IngestionPropertiesInput): KustoManagedStreamingIngestClient;
23
+ /**
24
+ * Creates a KustoManagedStreamingIngestClient from a engine connection string.
25
+ * This method infers the engine connection string.
26
+ * For advanced usage, use the constructor that takes an engine connection string and an engine connection string.
27
+ *
28
+ * @param engineConnectionString The engine connection string.
29
+ * @param defaultProps The default ingestion properties.
30
+ */
31
+ static fromEngineConnectionString(engineConnectionString: KustoConnectionStringBuilder, defaultProps?: IngestionPropertiesInput): KustoManagedStreamingIngestClient;
32
+ constructor(engineKcsb: string | KustoConnectionStringBuilder, dmKcsb: string | KustoConnectionStringBuilder, defaultProps?: IngestionPropertiesInput);
33
+ ingestFromStream(stream: StreamDescriptor | Readable, ingestionProperties?: IngestionPropertiesInput): Promise<any>;
34
+ ingestFromFile(file: FileDescriptor | string, ingestionProperties?: IngestionPropertiesInput): Promise<KustoResponseDataSet | QueueSendMessageResponse>;
35
+ }
36
+ export default KustoManagedStreamingIngestClient;