@clickhouse/client-common 0.3.0 → 1.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/LICENSE +2 -2
- package/README.md +12 -0
- package/dist/client.d.ts +15 -65
- package/dist/client.js +25 -52
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +159 -0
- package/dist/config.js +292 -0
- package/dist/config.js.map +1 -0
- package/dist/connection.d.ts +9 -5
- package/dist/data_formatter/format_query_params.js +28 -3
- package/dist/data_formatter/format_query_params.js.map +1 -1
- package/dist/data_formatter/format_query_settings.js.map +1 -1
- package/dist/data_formatter/formatter.d.ts +26 -9
- package/dist/data_formatter/formatter.js +7 -27
- package/dist/data_formatter/formatter.js.map +1 -1
- package/dist/error/parse_error.js.map +1 -1
- package/dist/index.d.ts +10 -8
- package/dist/index.js +11 -6
- package/dist/index.js.map +1 -1
- package/dist/logger.js +1 -1
- package/dist/logger.js.map +1 -1
- package/dist/result.d.ts +47 -8
- package/dist/settings.d.ts +1 -1
- package/dist/settings.js.map +1 -1
- package/dist/ts_utils.d.ts +4 -0
- package/dist/ts_utils.js +3 -0
- package/dist/ts_utils.js.map +1 -0
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/index.js +0 -2
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/url.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/utils/permutations.d.ts +0 -1
- package/dist/utils/permutations.js +0 -12
- package/dist/utils/permutations.js.map +0 -1
- package/dist/utils/string.d.ts +0 -1
- package/dist/utils/string.js +0 -8
- package/dist/utils/string.js.map +0 -1
package/dist/config.js
ADDED
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.enumConfigURLValue = exports.numberConfigURLValue = exports.booleanConfigURLValue = exports.loadConfigOptionsFromURL = exports.createUrl = exports.mergeConfigs = exports.getConnectionParams = exports.prepareConfigWithURL = void 0;
|
|
4
|
+
const logger_1 = require("./logger");
|
|
5
|
+
/**
|
|
6
|
+
* Validates and normalizes the provided "base" config.
|
|
7
|
+
* Warns about deprecated configuration parameters usage.
|
|
8
|
+
* Parses the common URL parameters into the configuration parameters (these are the same for all implementations).
|
|
9
|
+
* Parses implementation-specific URL parameters using the handler provided by that implementation.
|
|
10
|
+
* Merges these parameters with the base config and implementation-specific defaults.
|
|
11
|
+
* Enforces certain defaults in case of deprecated keys or readonly mode.
|
|
12
|
+
*/
|
|
13
|
+
function prepareConfigWithURL(baseConfigOptions, logger, handleImplURLParams) {
|
|
14
|
+
const baseConfig = { ...baseConfigOptions };
|
|
15
|
+
if (baseConfig.additional_headers !== undefined) {
|
|
16
|
+
logger.warn({
|
|
17
|
+
module: 'Config',
|
|
18
|
+
message: '"additional_headers" is deprecated. Use "http_headers" instead.',
|
|
19
|
+
});
|
|
20
|
+
baseConfig.http_headers = baseConfig.additional_headers;
|
|
21
|
+
delete baseConfig.additional_headers;
|
|
22
|
+
}
|
|
23
|
+
let configURL;
|
|
24
|
+
if (baseConfig.host !== undefined) {
|
|
25
|
+
logger.warn({
|
|
26
|
+
module: 'Config',
|
|
27
|
+
message: '"host" is deprecated. Use "url" instead.',
|
|
28
|
+
});
|
|
29
|
+
configURL = createUrl(baseConfig.host);
|
|
30
|
+
delete baseConfig.host;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
configURL = createUrl(baseConfig.url);
|
|
34
|
+
}
|
|
35
|
+
const [url, configFromURL] = loadConfigOptionsFromURL(configURL, handleImplURLParams);
|
|
36
|
+
const config = mergeConfigs(baseConfig, configFromURL, logger);
|
|
37
|
+
if (config.pathname !== undefined) {
|
|
38
|
+
url.pathname = config.pathname;
|
|
39
|
+
}
|
|
40
|
+
config.url = url;
|
|
41
|
+
return config;
|
|
42
|
+
}
|
|
43
|
+
exports.prepareConfigWithURL = prepareConfigWithURL;
|
|
44
|
+
function getConnectionParams(config, logger) {
|
|
45
|
+
return {
|
|
46
|
+
url: config.url,
|
|
47
|
+
application_id: config.application,
|
|
48
|
+
request_timeout: config.request_timeout ?? 30000,
|
|
49
|
+
max_open_connections: config.max_open_connections ?? 10,
|
|
50
|
+
compression: {
|
|
51
|
+
decompress_response: config.compression?.response ?? false,
|
|
52
|
+
compress_request: config.compression?.request ?? false,
|
|
53
|
+
},
|
|
54
|
+
username: config.username ?? 'default',
|
|
55
|
+
password: config.password ?? '',
|
|
56
|
+
database: config.database ?? 'default',
|
|
57
|
+
log_writer: new logger_1.LogWriter(logger, 'Connection', config.log?.level),
|
|
58
|
+
keep_alive: { enabled: config.keep_alive?.enabled ?? true },
|
|
59
|
+
clickhouse_settings: config.clickhouse_settings ?? {},
|
|
60
|
+
http_headers: config.http_headers ?? {},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
exports.getConnectionParams = getConnectionParams;
|
|
64
|
+
/**
|
|
65
|
+
* Merge two versions of the config: base (hardcoded) from the instance creation and the URL parsed one.
|
|
66
|
+
* URL config takes priority and overrides the base config parameters.
|
|
67
|
+
* If a value is overridden, then a warning will be logged (even if the log level is OFF).
|
|
68
|
+
*/
|
|
69
|
+
function mergeConfigs(baseConfig, configFromURL, logger) {
|
|
70
|
+
function deepMerge(base, fromURL, path = []) {
|
|
71
|
+
for (const key of Object.keys(fromURL)) {
|
|
72
|
+
if (typeof fromURL[key] === 'object') {
|
|
73
|
+
deepMerge(base, fromURL[key], path.concat(key));
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
let baseAtPath = base;
|
|
77
|
+
for (const key of path) {
|
|
78
|
+
if (baseAtPath[key] === undefined) {
|
|
79
|
+
baseAtPath[key] = {};
|
|
80
|
+
}
|
|
81
|
+
baseAtPath = baseAtPath[key];
|
|
82
|
+
}
|
|
83
|
+
const baseAtKey = baseAtPath[key];
|
|
84
|
+
if (baseAtKey !== undefined) {
|
|
85
|
+
const fullPath = path.concat(key).join('.');
|
|
86
|
+
logger.warn({
|
|
87
|
+
module: 'Config',
|
|
88
|
+
message: `"${fullPath}" is overridden by a URL parameter.`,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
baseAtPath[key] = fromURL[key];
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const config = { ...baseConfig };
|
|
96
|
+
deepMerge(config, configFromURL);
|
|
97
|
+
return config;
|
|
98
|
+
}
|
|
99
|
+
exports.mergeConfigs = mergeConfigs;
|
|
100
|
+
function createUrl(configURL) {
|
|
101
|
+
let url;
|
|
102
|
+
try {
|
|
103
|
+
if (typeof configURL === 'string' || configURL instanceof URL) {
|
|
104
|
+
url = new URL(configURL);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
return new URL('http://localhost:8123');
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
catch (err) {
|
|
111
|
+
throw new Error('ClickHouse URL is malformed. Expected format: http[s]://[username:password@]hostname:port[/database][?param1=value1¶m2=value2]');
|
|
112
|
+
}
|
|
113
|
+
if (url.protocol !== 'http:' && url.protocol !== 'https:') {
|
|
114
|
+
throw new Error(`ClickHouse URL protocol must be either http or https. Got: ${url.protocol}`);
|
|
115
|
+
}
|
|
116
|
+
if (url.port === '' || isNaN(Number(url.port))) {
|
|
117
|
+
throw new Error('ClickHouse URL must contain a valid port number.');
|
|
118
|
+
}
|
|
119
|
+
return url;
|
|
120
|
+
}
|
|
121
|
+
exports.createUrl = createUrl;
|
|
122
|
+
/**
|
|
123
|
+
* @param url potentially contains auth, database and URL params to parse the configuration from
|
|
124
|
+
* @param handleExtraURLParams some platform-specific URL params might be unknown by the common package;
|
|
125
|
+
* use this function defined in the implementation to handle them. Logs warnings in case of hardcode overrides.
|
|
126
|
+
*/
|
|
127
|
+
function loadConfigOptionsFromURL(url, handleExtraURLParams) {
|
|
128
|
+
let config = {};
|
|
129
|
+
if (url.username.trim() !== '') {
|
|
130
|
+
config.username = url.username;
|
|
131
|
+
}
|
|
132
|
+
// no trim for password
|
|
133
|
+
if (url.password !== '') {
|
|
134
|
+
config.password = url.password;
|
|
135
|
+
}
|
|
136
|
+
if (url.pathname.trim().length > 1) {
|
|
137
|
+
config.database = url.pathname.slice(1);
|
|
138
|
+
}
|
|
139
|
+
const urlSearchParamsKeys = [...url.searchParams.keys()];
|
|
140
|
+
if (urlSearchParamsKeys.length > 0) {
|
|
141
|
+
const unknownParams = new Set();
|
|
142
|
+
const settingPrefix = 'clickhouse_setting_';
|
|
143
|
+
const settingShortPrefix = 'ch_';
|
|
144
|
+
const httpHeaderPrefix = 'http_header_';
|
|
145
|
+
urlSearchParamsKeys.forEach((key) => {
|
|
146
|
+
let paramWasProcessed = true;
|
|
147
|
+
const value = url.searchParams.get(key);
|
|
148
|
+
if (key.startsWith(settingPrefix)) {
|
|
149
|
+
// clickhouse_settings_*
|
|
150
|
+
const settingKey = key.slice(settingPrefix.length);
|
|
151
|
+
if (config.clickhouse_settings === undefined) {
|
|
152
|
+
config.clickhouse_settings = {};
|
|
153
|
+
}
|
|
154
|
+
config.clickhouse_settings[settingKey] = value;
|
|
155
|
+
}
|
|
156
|
+
else if (key.startsWith(settingShortPrefix)) {
|
|
157
|
+
// ch_*
|
|
158
|
+
const settingKey = key.slice(settingShortPrefix.length);
|
|
159
|
+
if (config.clickhouse_settings === undefined) {
|
|
160
|
+
config.clickhouse_settings = {};
|
|
161
|
+
}
|
|
162
|
+
config.clickhouse_settings[settingKey] = value;
|
|
163
|
+
}
|
|
164
|
+
else if (key.startsWith(httpHeaderPrefix)) {
|
|
165
|
+
// http_headers_*
|
|
166
|
+
const headerKey = key.slice(httpHeaderPrefix.length);
|
|
167
|
+
if (config.http_headers === undefined) {
|
|
168
|
+
config.http_headers = {};
|
|
169
|
+
}
|
|
170
|
+
config.http_headers[headerKey] = value;
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
// static known parameters
|
|
174
|
+
switch (key) {
|
|
175
|
+
case 'application':
|
|
176
|
+
config.application = value;
|
|
177
|
+
break;
|
|
178
|
+
case 'pathname':
|
|
179
|
+
config.pathname = value;
|
|
180
|
+
break;
|
|
181
|
+
case 'session_id':
|
|
182
|
+
config.session_id = value;
|
|
183
|
+
break;
|
|
184
|
+
case 'request_timeout':
|
|
185
|
+
config.request_timeout = numberConfigURLValue({
|
|
186
|
+
key,
|
|
187
|
+
value,
|
|
188
|
+
min: 0,
|
|
189
|
+
});
|
|
190
|
+
break;
|
|
191
|
+
case 'max_open_connections':
|
|
192
|
+
config.max_open_connections = numberConfigURLValue({
|
|
193
|
+
key,
|
|
194
|
+
value,
|
|
195
|
+
min: 1,
|
|
196
|
+
});
|
|
197
|
+
break;
|
|
198
|
+
case 'compression_request':
|
|
199
|
+
if (config.compression === undefined) {
|
|
200
|
+
config.compression = {};
|
|
201
|
+
}
|
|
202
|
+
config.compression.request = booleanConfigURLValue({ key, value });
|
|
203
|
+
break;
|
|
204
|
+
case 'compression_response':
|
|
205
|
+
if (config.compression === undefined) {
|
|
206
|
+
config.compression = {};
|
|
207
|
+
}
|
|
208
|
+
config.compression.response = booleanConfigURLValue({
|
|
209
|
+
key,
|
|
210
|
+
value,
|
|
211
|
+
});
|
|
212
|
+
break;
|
|
213
|
+
case 'log_level':
|
|
214
|
+
if (config.log === undefined) {
|
|
215
|
+
config.log = {};
|
|
216
|
+
}
|
|
217
|
+
config.log.level = enumConfigURLValue({
|
|
218
|
+
key,
|
|
219
|
+
value,
|
|
220
|
+
enumObject: logger_1.ClickHouseLogLevel,
|
|
221
|
+
});
|
|
222
|
+
break;
|
|
223
|
+
case 'keep_alive_enabled':
|
|
224
|
+
if (config.keep_alive === undefined) {
|
|
225
|
+
config.keep_alive = {};
|
|
226
|
+
}
|
|
227
|
+
config.keep_alive.enabled = booleanConfigURLValue({ key, value });
|
|
228
|
+
break;
|
|
229
|
+
default:
|
|
230
|
+
paramWasProcessed = false;
|
|
231
|
+
unknownParams.add(key);
|
|
232
|
+
break;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
if (paramWasProcessed) {
|
|
236
|
+
// so it won't be passed to the impl URL params handler
|
|
237
|
+
url.searchParams.delete(key);
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
if (handleExtraURLParams !== null) {
|
|
241
|
+
const res = handleExtraURLParams(config, url);
|
|
242
|
+
config = res.config;
|
|
243
|
+
if (unknownParams.size > 0) {
|
|
244
|
+
res.handled_params.forEach((k) => unknownParams.delete(k));
|
|
245
|
+
}
|
|
246
|
+
if (res.unknown_params.size > 0) {
|
|
247
|
+
res.unknown_params.forEach((k) => unknownParams.add(k));
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
if (unknownParams.size > 0) {
|
|
251
|
+
throw new Error(`Unknown URL parameters: ${Array.from(unknownParams).join(', ')}`);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
// clean up the final ClickHouse URL to be used in the connection
|
|
255
|
+
const clickHouseURL = new URL(`${url.protocol}//${url.host}`);
|
|
256
|
+
return [clickHouseURL, config];
|
|
257
|
+
}
|
|
258
|
+
exports.loadConfigOptionsFromURL = loadConfigOptionsFromURL;
|
|
259
|
+
function booleanConfigURLValue({ key, value, }) {
|
|
260
|
+
const trimmed = value.trim();
|
|
261
|
+
if (trimmed === 'true' || trimmed === '1')
|
|
262
|
+
return true;
|
|
263
|
+
if (trimmed === 'false' || trimmed === '0')
|
|
264
|
+
return false;
|
|
265
|
+
throw new Error(`"${key}" has invalid boolean value: ${trimmed}. Expected one of: 0, 1, true, false.`);
|
|
266
|
+
}
|
|
267
|
+
exports.booleanConfigURLValue = booleanConfigURLValue;
|
|
268
|
+
function numberConfigURLValue({ key, value, min, max, }) {
|
|
269
|
+
const trimmed = value.trim();
|
|
270
|
+
const number = Number(trimmed);
|
|
271
|
+
if (isNaN(number))
|
|
272
|
+
throw new Error(`"${key}" has invalid numeric value: ${trimmed}`);
|
|
273
|
+
if (min !== undefined && number < min) {
|
|
274
|
+
throw new Error(`"${key}" value ${trimmed} is less than min allowed ${min}`);
|
|
275
|
+
}
|
|
276
|
+
if (max !== undefined && number > max) {
|
|
277
|
+
throw new Error(`"${key}" value ${trimmed} is greater than max allowed ${max}`);
|
|
278
|
+
}
|
|
279
|
+
return number;
|
|
280
|
+
}
|
|
281
|
+
exports.numberConfigURLValue = numberConfigURLValue;
|
|
282
|
+
function enumConfigURLValue({ key, value, enumObject, }) {
|
|
283
|
+
const values = Object.keys(enumObject).filter((item) => isNaN(Number(item)));
|
|
284
|
+
const trimmed = value.trim();
|
|
285
|
+
if (!values.includes(trimmed)) {
|
|
286
|
+
const expected = values.join(', ');
|
|
287
|
+
throw new Error(`"${key}" has invalid value: ${trimmed}. Expected one of: ${expected}.`);
|
|
288
|
+
}
|
|
289
|
+
return enumObject[trimmed];
|
|
290
|
+
}
|
|
291
|
+
exports.enumConfigURLValue = enumConfigURLValue;
|
|
292
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../packages/client-common/src/config.ts"],"names":[],"mappings":";;;AAIA,qCAAwD;AAsJxD;;;;;;;GAOG;AACH,SAAgB,oBAAoB,CAClC,iBAAoD,EACpD,MAAc,EACd,mBAAuD;IAEvD,MAAM,UAAU,GAAG,EAAE,GAAG,iBAAiB,EAAE,CAAA;IAC3C,IAAI,UAAU,CAAC,kBAAkB,KAAK,SAAS,EAAE,CAAC;QAChD,MAAM,CAAC,IAAI,CAAC;YACV,MAAM,EAAE,QAAQ;YAChB,OAAO,EACL,iEAAiE;SACpE,CAAC,CAAA;QACF,UAAU,CAAC,YAAY,GAAG,UAAU,CAAC,kBAAkB,CAAA;QACvD,OAAO,UAAU,CAAC,kBAAkB,CAAA;IACtC,CAAC;IACD,IAAI,SAAS,CAAA;IACb,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAClC,MAAM,CAAC,IAAI,CAAC;YACV,MAAM,E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,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClC,MAAM,IAAI,KAAK,CACb,IAAI,GAAG,wBAAwB,OAAO,sBAAsB,QAAQ,GAAG,CACxE,CAAA;IACH,CAAC;IACD,OAAO,UAAU,CAAC,OAAc,CAAC,CAAA;AACnC,CAAC;AApBD,gDAoBC"}
|
package/dist/connection.d.ts
CHANGED
|
@@ -5,17 +5,21 @@ export interface ConnectionParams {
|
|
|
5
5
|
url: URL;
|
|
6
6
|
request_timeout: number;
|
|
7
7
|
max_open_connections: number;
|
|
8
|
-
compression:
|
|
9
|
-
decompress_response: boolean;
|
|
10
|
-
compress_request: boolean;
|
|
11
|
-
};
|
|
8
|
+
compression: CompressionSettings;
|
|
12
9
|
username: string;
|
|
13
10
|
password: string;
|
|
14
11
|
database: string;
|
|
15
12
|
clickhouse_settings: ClickHouseSettings;
|
|
16
13
|
log_writer: LogWriter;
|
|
14
|
+
keep_alive: {
|
|
15
|
+
enabled: boolean;
|
|
16
|
+
};
|
|
17
17
|
application_id?: string;
|
|
18
|
-
|
|
18
|
+
http_headers?: Record<string, string>;
|
|
19
|
+
}
|
|
20
|
+
export interface CompressionSettings {
|
|
21
|
+
decompress_response: boolean;
|
|
22
|
+
compress_request: boolean;
|
|
19
23
|
}
|
|
20
24
|
export interface ConnBaseQueryParams {
|
|
21
25
|
query: string;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.formatQueryParams = void 0;
|
|
4
|
-
const utils_1 = require("../utils");
|
|
5
4
|
function formatQueryParams(value, wrapStringInQuotes = false) {
|
|
6
5
|
if (value === null || value === undefined)
|
|
7
6
|
return '\\N';
|
|
@@ -16,8 +15,29 @@ function formatQueryParams(value, wrapStringInQuotes = false) {
|
|
|
16
15
|
if (typeof value === 'boolean')
|
|
17
16
|
return value ? '1' : '0';
|
|
18
17
|
if (typeof value === 'string') {
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
let result = '';
|
|
19
|
+
for (let i = 0; i < value.length; i++) {
|
|
20
|
+
switch (value.charCodeAt(i)) {
|
|
21
|
+
case TabASCII:
|
|
22
|
+
result += '\\t';
|
|
23
|
+
break;
|
|
24
|
+
case NewlineASCII:
|
|
25
|
+
result += '\\n';
|
|
26
|
+
break;
|
|
27
|
+
case CarriageReturnASCII:
|
|
28
|
+
result += '\\r';
|
|
29
|
+
break;
|
|
30
|
+
case SingleQuoteASCII:
|
|
31
|
+
result += `\\'`;
|
|
32
|
+
break;
|
|
33
|
+
case BackslashASCII:
|
|
34
|
+
result += '\\\\';
|
|
35
|
+
break;
|
|
36
|
+
default:
|
|
37
|
+
result += value[i];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return wrapStringInQuotes ? `'${result}'` : result;
|
|
21
41
|
}
|
|
22
42
|
if (Array.isArray(value)) {
|
|
23
43
|
const formatted = value.map((v) => formatQueryParams(v, true));
|
|
@@ -43,4 +63,9 @@ function formatQueryParams(value, wrapStringInQuotes = false) {
|
|
|
43
63
|
throw new Error(`Unsupported value in query parameters: [${value}].`);
|
|
44
64
|
}
|
|
45
65
|
exports.formatQueryParams = formatQueryParams;
|
|
66
|
+
const TabASCII = 9;
|
|
67
|
+
const NewlineASCII = 10;
|
|
68
|
+
const CarriageReturnASCII = 13;
|
|
69
|
+
const SingleQuoteASCII = 39;
|
|
70
|
+
const BackslashASCII = 92;
|
|
46
71
|
//# sourceMappingURL=format_query_params.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format_query_params.js","sourceRoot":"","sources":["../../../../packages/client-common/src/data_formatter/format_query_params.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"format_query_params.js","sourceRoot":"","sources":["../../../../packages/client-common/src/data_formatter/format_query_params.ts"],"names":[],"mappings":";;;AAAA,SAAgB,iBAAiB,CAC/B,KAAU,EACV,kBAA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,QAAQ,GAAG,CAAC,CAAA;AAClB,MAAM,YAAY,GAAG,EAAE,CAAA;AACvB,MAAM,mBAAmB,GAAG,EAAE,CAAA;AAC9B,MAAM,gBAAgB,GAAG,EAAE,CAAA;AAC3B,MAAM,cAAc,GAAG,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format_query_settings.js","sourceRoot":"","sources":["../../../../packages/client-common/src/data_formatter/format_query_settings.ts"],"names":[],"mappings":";;;AAAA,0CAAyC;AAEzC,SAAgB,mBAAmB,CACjC,KAA8C;IAE9C,IAAI,OAAO,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAA;IACxD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAA;IACnD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC3C,mEAAmE;IACnE,uDAAuD;IACvD,4CAA4C;IAC5C,IAAI,KAAK,YAAY,sBAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"format_query_settings.js","sourceRoot":"","sources":["../../../../packages/client-common/src/data_formatter/format_query_settings.ts"],"names":[],"mappings":";;;AAAA,0CAAyC;AAEzC,SAAgB,mBAAmB,CACjC,KAA8C;IAE9C,IAAI,OAAO,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAA;IACxD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAA;IACnD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC3C,mEAAmE;IACnE,uDAAuD;IACvD,4CAA4C;IAC5C,IAAI,KAAK,YAAY,sBAAW,EAAE,CAAC;QACjC,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAA;IACzB,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,yCAAyC,KAAK,IAAI,CAAC,CAAA;AACrE,CAAC;AAbD,kDAaC"}
|
|
@@ -1,18 +1,35 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const streamableJSONFormats: readonly ["JSONEachRow", "JSONStringsEachRow", "JSONCompactEachRow", "JSONCompactStringsEachRow", "JSONCompactEachRowWithNames", "JSONCompactEachRowWithNamesAndTypes", "JSONCompactStringsEachRowWithNames", "JSONCompactStringsEachRowWithNamesAndTypes"];
|
|
2
|
+
declare const recordsJSONFormats: readonly ["JSONObjectEachRow"];
|
|
3
|
+
declare const singleDocumentJSONFormats: readonly ["JSON", "JSONStrings", "JSONCompact", "JSONCompactStrings", "JSONColumnsWithMetadata"];
|
|
2
4
|
declare const supportedRawFormats: readonly ["CSV", "CSVWithNames", "CSVWithNamesAndTypes", "TabSeparated", "TabSeparatedRaw", "TabSeparatedWithNames", "TabSeparatedWithNamesAndTypes", "CustomSeparated", "CustomSeparatedWithNames", "CustomSeparatedWithNamesAndTypes", "Parquet"];
|
|
3
|
-
|
|
5
|
+
/** CSV, TSV, etc. - can be streamed, but cannot be decoded as JSON. */
|
|
4
6
|
export type RawDataFormat = (typeof supportedRawFormats)[number];
|
|
7
|
+
/** Each row is returned as a separate JSON object or an array, and these formats can be streamed. */
|
|
8
|
+
export type StreamableJSONDataFormat = (typeof streamableJSONFormats)[number];
|
|
9
|
+
/** Returned as a single {@link ResponseJSON} object, cannot be streamed. */
|
|
10
|
+
export type SingleDocumentJSONFormat = (typeof singleDocumentJSONFormats)[number];
|
|
11
|
+
/** Returned as a single object { row_1: T, row_2: T, ...} <br/>
|
|
12
|
+
* (i.e. Record<string, T>), cannot be streamed. */
|
|
13
|
+
export type RecordsJSONFormat = (typeof recordsJSONFormats)[number];
|
|
14
|
+
/** All allowed JSON formats, whether streamable or not. */
|
|
15
|
+
export type JSONDataFormat = StreamableJSONDataFormat | SingleDocumentJSONFormat | RecordsJSONFormat;
|
|
16
|
+
/** Data formats that are currently supported by the client. <br/>
|
|
17
|
+
* This is a union of the following types:<br/>
|
|
18
|
+
* * {@link JSONDataFormat}
|
|
19
|
+
* * {@link RawDataFormat}
|
|
20
|
+
* * {@link StreamableDataFormat}
|
|
21
|
+
* * {@link StreamableJSONDataFormat}
|
|
22
|
+
* * {@link SingleDocumentJSONFormat}
|
|
23
|
+
* * {@link RecordsJSONFormat}
|
|
24
|
+
* @see https://clickhouse.com/docs/en/interfaces/formats */
|
|
5
25
|
export type DataFormat = JSONDataFormat | RawDataFormat;
|
|
6
26
|
declare const streamableFormat: readonly ["JSONEachRow", "JSONStringsEachRow", "JSONCompactEachRow", "JSONCompactStringsEachRow", "JSONCompactEachRowWithNames", "JSONCompactEachRowWithNamesAndTypes", "JSONCompactStringsEachRowWithNames", "JSONCompactStringsEachRowWithNamesAndTypes", "CSV", "CSVWithNames", "CSVWithNamesAndTypes", "TabSeparated", "TabSeparatedRaw", "TabSeparatedWithNames", "TabSeparatedWithNamesAndTypes", "CustomSeparated", "CustomSeparatedWithNames", "CustomSeparatedWithNamesAndTypes", "Parquet"];
|
|
7
|
-
|
|
27
|
+
/** All data formats that can be streamed, whether it can be decoded as JSON or not. */
|
|
28
|
+
export type StreamableDataFormat = (typeof streamableFormat)[number];
|
|
29
|
+
export declare function isNotStreamableJSONFamily(format: DataFormat): format is SingleDocumentJSONFormat;
|
|
30
|
+
export declare function isStreamableJSONFamily(format: DataFormat): format is StreamableJSONDataFormat;
|
|
8
31
|
export declare function isSupportedRawFormat(dataFormat: DataFormat): boolean;
|
|
9
32
|
export declare function validateStreamFormat(format: any): format is StreamableDataFormat;
|
|
10
|
-
/**
|
|
11
|
-
* Decodes a string in a ClickHouse format into a plain JavaScript object or an array of objects.
|
|
12
|
-
* @param text a string in a ClickHouse data format
|
|
13
|
-
* @param format One of the supported formats: https://clickhouse.com/docs/en/interfaces/formats/
|
|
14
|
-
*/
|
|
15
|
-
export declare function decode(text: string, format: DataFormat): any;
|
|
16
33
|
/**
|
|
17
34
|
* Encodes a single row of values into a string in a JSON format acceptable by ClickHouse.
|
|
18
35
|
* @param value a single value to encode.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.encodeJSON = exports.
|
|
3
|
+
exports.encodeJSON = exports.validateStreamFormat = exports.isSupportedRawFormat = exports.isStreamableJSONFamily = exports.isNotStreamableJSONFamily = void 0;
|
|
4
4
|
const streamableJSONFormats = [
|
|
5
5
|
'JSONEachRow',
|
|
6
6
|
'JSONStringsEachRow',
|
|
@@ -11,15 +11,16 @@ const streamableJSONFormats = [
|
|
|
11
11
|
'JSONCompactStringsEachRowWithNames',
|
|
12
12
|
'JSONCompactStringsEachRowWithNamesAndTypes',
|
|
13
13
|
];
|
|
14
|
+
const recordsJSONFormats = ['JSONObjectEachRow'];
|
|
14
15
|
const singleDocumentJSONFormats = [
|
|
15
16
|
'JSON',
|
|
16
17
|
'JSONStrings',
|
|
17
18
|
'JSONCompact',
|
|
18
19
|
'JSONCompactStrings',
|
|
19
20
|
'JSONColumnsWithMetadata',
|
|
20
|
-
'JSONObjectEachRow',
|
|
21
21
|
];
|
|
22
22
|
const supportedJSONFormats = [
|
|
23
|
+
...recordsJSONFormats,
|
|
23
24
|
...singleDocumentJSONFormats,
|
|
24
25
|
...streamableJSONFormats,
|
|
25
26
|
];
|
|
@@ -36,19 +37,19 @@ const supportedRawFormats = [
|
|
|
36
37
|
'CustomSeparatedWithNamesAndTypes',
|
|
37
38
|
'Parquet',
|
|
38
39
|
];
|
|
39
|
-
// TODO add others formats
|
|
40
40
|
const streamableFormat = [
|
|
41
41
|
...streamableJSONFormats,
|
|
42
42
|
...supportedRawFormats,
|
|
43
43
|
];
|
|
44
44
|
function isNotStreamableJSONFamily(format) {
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
return (singleDocumentJSONFormats.includes(format) ||
|
|
46
|
+
recordsJSONFormats.includes(format));
|
|
47
47
|
}
|
|
48
|
+
exports.isNotStreamableJSONFamily = isNotStreamableJSONFamily;
|
|
48
49
|
function isStreamableJSONFamily(format) {
|
|
49
|
-
// @ts-expect-error JSON is not assignable to streamableJSONFormats
|
|
50
50
|
return streamableJSONFormats.includes(format);
|
|
51
51
|
}
|
|
52
|
+
exports.isStreamableJSONFamily = isStreamableJSONFamily;
|
|
52
53
|
function isSupportedRawFormat(dataFormat) {
|
|
53
54
|
return supportedRawFormats.includes(dataFormat);
|
|
54
55
|
}
|
|
@@ -60,27 +61,6 @@ function validateStreamFormat(format) {
|
|
|
60
61
|
return true;
|
|
61
62
|
}
|
|
62
63
|
exports.validateStreamFormat = validateStreamFormat;
|
|
63
|
-
/**
|
|
64
|
-
* Decodes a string in a ClickHouse format into a plain JavaScript object or an array of objects.
|
|
65
|
-
* @param text a string in a ClickHouse data format
|
|
66
|
-
* @param format One of the supported formats: https://clickhouse.com/docs/en/interfaces/formats/
|
|
67
|
-
*/
|
|
68
|
-
function decode(text, format) {
|
|
69
|
-
if (isNotStreamableJSONFamily(format)) {
|
|
70
|
-
return JSON.parse(text);
|
|
71
|
-
}
|
|
72
|
-
if (isStreamableJSONFamily(format)) {
|
|
73
|
-
return text
|
|
74
|
-
.split('\n')
|
|
75
|
-
.filter(Boolean)
|
|
76
|
-
.map((l) => decode(l, 'JSON'));
|
|
77
|
-
}
|
|
78
|
-
if (isSupportedRawFormat(format)) {
|
|
79
|
-
throw new Error(`Cannot decode ${format} to JSON`);
|
|
80
|
-
}
|
|
81
|
-
throw new Error(`The client does not support [${format}] format decoding.`);
|
|
82
|
-
}
|
|
83
|
-
exports.decode = decode;
|
|
84
64
|
/**
|
|
85
65
|
* Encodes a single row of values into a string in a JSON format acceptable by ClickHouse.
|
|
86
66
|
* @param value a single value to encode.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatter.js","sourceRoot":"","sources":["../../../../packages/client-common/src/data_formatter/formatter.ts"],"names":[],"mappings":";;;AAAA,MAAM,qBAAqB,GAAG;IAC5B,aAAa;IACb,oBAAoB;IACpB,oBAAoB;IACpB,2BAA2B;IAC3B,6BAA6B;IAC7B,qCAAqC;IACrC,oCAAoC;IACpC,4CAA4C;CACpC,CAAA;AACV,MAAM,yBAAyB,GAAG;IAChC,MAAM;IACN,aAAa;IACb,aAAa;IACb,oBAAoB;IACpB,yBAAyB;
|
|
1
|
+
{"version":3,"file":"formatter.js","sourceRoot":"","sources":["../../../../packages/client-common/src/data_formatter/formatter.ts"],"names":[],"mappings":";;;AAAA,MAAM,qBAAqB,GAAG;IAC5B,aAAa;IACb,oBAAoB;IACpB,oBAAoB;IACpB,2BAA2B;IAC3B,6BAA6B;IAC7B,qCAAqC;IACrC,oCAAoC;IACpC,4CAA4C;CACpC,CAAA;AACV,MAAM,kBAAkB,GAAG,CAAC,mBAAmB,CAAU,CAAA;AACzD,MAAM,yBAAyB,GAAG;IAChC,MAAM;IACN,aAAa;IACb,aAAa;IACb,oBAAoB;IACpB,yBAAyB;CACjB,CAAA;AACV,MAAM,oBAAoB,GAAG;IAC3B,GAAG,kBAAkB;IACrB,GAAG,yBAAyB;IAC5B,GAAG,qBAAqB;CAChB,CAAA;AACV,MAAM,mBAAmB,GAAG;IAC1B,KAAK;IACL,cAAc;IACd,sBAAsB;IACtB,cAAc;IACd,iBAAiB;IACjB,uBAAuB;IACvB,+BAA+B;IAC/B,iBAAiB;IACjB,0BAA0B;IAC1B,kCAAkC;IAClC,SAAS;CACD,CAAA;AAiCV,MAAM,gBAAgB,GAAG;IACvB,GAAG,qBAAqB;IACxB,GAAG,mBAAmB;CACd,CAAA;AAKV,SAAgB,yBAAyB,CACvC,MAAkB;IAElB,OAAO,CACJ,yBAA+C,CAAC,QAAQ,CAAC,MAAM,CAAC;QAChE,kBAAwC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAC3D,CAAA;AACH,CAAC;AAPD,8DAOC;AAED,SAAgB,sBAAsB,CACpC,MAAkB;IAElB,OAAQ,qBAA2C,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;AACtE,CAAC;AAJD,wDAIC;AAED,SAAgB,oBAAoB,CAAC,UAAsB;IACzD,OAAQ,mBAAyC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAA;AACxE,CAAC;AAFD,oDAEC;AAED,SAAgB,oBAAoB,CAClC,MAAW;IAEX,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CACb,GAAG,MAAM,kDAAkD,gBAAgB,CAAC,IAAI,CAC9E,GAAG,CACJ,EAAE,CACJ,CAAA;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAXD,oDAWC;AAED;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,KAAU,EAAE,MAAkB;IACvD,IAAK,oBAA0C,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACjE,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,CAAA;IACrC,CAAC;IACD,MAAM,IAAI,KAAK,CACb,iDAAiD,MAAM,WAAW,CACnE,CAAA;AACH,CAAC;AAPD,gCAOC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse_error.js","sourceRoot":"","sources":["../../../../packages/client-common/src/error/parse_error.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GACX,8FAA8F,CAAA;AAOhG,MAAa,eAAgB,SAAQ,KAAK;IAGxC,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAyB;QACxD,KAAK,CAAC,OAAO,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"parse_error.js","sourceRoot":"","sources":["../../../../packages/client-common/src/error/parse_error.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GACX,8FAA8F,CAAA;AAOhG,MAAa,eAAgB,SAAQ,KAAK;IAGxC,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAyB;QACxD,KAAK,CAAC,OAAO,CAAC,CAAA;QAHP;;;;;WAAY;QACZ;;;;;WAAwB;QAG/B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAEhB,qCAAqC;QACrC,gIAAgI;QAChI,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,eAAe,CAAC,SAAS,CAAC,CAAA;IACxD,CAAC;CACF;AAZD,0CAYC;AAED,SAAgB,UAAU,CAAC,KAAqB;IAC9C,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAA;IAC3C,MAAM,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAA;IACpD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IACpC,MAAM,MAAM,GAAG,KAAK,EAAE,MAA2C,CAAA;IACjE,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,IAAI,eAAe,CAAC,MAAM,CAAC,CAAA;IACpC,CAAC;SAAM,CAAC;QACN,OAAO,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAA;IAChD,CAAC;AACH,CAAC;AAVD,gCAUC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
/** Should be re-exported by the implementation */
|
|
2
|
-
export { type
|
|
3
|
-
export
|
|
4
|
-
export {
|
|
2
|
+
export { type BaseQueryParams, type QueryParams, type QueryResult, type ExecParams, type InsertParams, type InsertValues, ClickHouseClient, type CommandParams, type CommandResult, type ExecResult, type InsertResult, type PingResult, } from './client';
|
|
3
|
+
export { type BaseClickHouseClientConfigOptions } from './config';
|
|
4
|
+
export type { Row, BaseResultSet, ResultJSONType, RowJSONType, ResultStream, } from './result';
|
|
5
|
+
export type { DataFormat, RawDataFormat, JSONDataFormat, StreamableDataFormat, StreamableJSONDataFormat, SingleDocumentJSONFormat, } from './data_formatter';
|
|
5
6
|
export { ClickHouseError } from './error';
|
|
6
7
|
export { ClickHouseLogLevel, type ErrorLogParams, type WarnLogParams, type Logger, type LogParams, } from './logger';
|
|
7
8
|
export type { ClickHouseSummary, WithClickHouseSummary, ResponseJSON, InputJSON, InputJSONObjectEachRow, } from './clickhouse_types';
|
|
8
9
|
export { type ClickHouseSettings, type MergeTreeSettings, SettingsMap, } from './settings';
|
|
9
|
-
/** For implementations usage only */
|
|
10
|
-
export { encodeJSON, isSupportedRawFormat,
|
|
11
|
-
export { type ValuesEncoder, type MakeResultSet, type MakeConnection, } from './
|
|
10
|
+
/** For implementations usage only - should not be re-exported */
|
|
11
|
+
export { formatQuerySettings, formatQueryParams, encodeJSON, isSupportedRawFormat, isStreamableJSONFamily, isNotStreamableJSONFamily, validateStreamFormat, } from './data_formatter';
|
|
12
|
+
export { type ValuesEncoder, type MakeResultSet, type MakeConnection, type HandleImplSpecificURLParams, type ImplementationDetails, booleanConfigURLValue, enumConfigURLValue, getConnectionParams, numberConfigURLValue, } from './config';
|
|
12
13
|
export { withCompressionHeaders, isSuccessfulResponse, toSearchParams, transformUrl, withHttpSettings, } from './utils';
|
|
13
14
|
export { LogWriter, DefaultLogger, type LogWriterParams } from './logger';
|
|
14
15
|
export { parseError } from './error';
|
|
15
|
-
export type { Connection, ConnectionParams, ConnInsertResult, ConnExecResult, ConnQueryResult, ConnBaseQueryParams, ConnBaseResult, ConnInsertParams, ConnPingResult, ConnOperation, } from './connection';
|
|
16
|
-
export
|
|
16
|
+
export type { CompressionSettings, Connection, ConnectionParams, ConnInsertResult, ConnExecResult, ConnQueryResult, ConnBaseQueryParams, ConnBaseResult, ConnInsertParams, ConnPingResult, ConnOperation, } from './connection';
|
|
17
|
+
export type { QueryParamsWithFormat } from './client';
|
|
18
|
+
export type { IsSame } from './ts_utils';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.parseError = exports.DefaultLogger = exports.LogWriter = exports.withHttpSettings = exports.transformUrl = exports.toSearchParams = exports.isSuccessfulResponse = exports.withCompressionHeaders = exports.numberConfigURLValue = exports.getConnectionParams = exports.enumConfigURLValue = exports.booleanConfigURLValue = exports.validateStreamFormat = exports.isNotStreamableJSONFamily = exports.isStreamableJSONFamily = exports.isSupportedRawFormat = exports.encodeJSON = exports.formatQueryParams = exports.formatQuerySettings = exports.SettingsMap = exports.ClickHouseLogLevel = exports.ClickHouseError = exports.ClickHouseClient = void 0;
|
|
4
4
|
/** Should be re-exported by the implementation */
|
|
5
5
|
var client_1 = require("./client");
|
|
6
6
|
Object.defineProperty(exports, "ClickHouseClient", { enumerable: true, get: function () { return client_1.ClickHouseClient; } });
|
|
@@ -10,12 +10,20 @@ var logger_1 = require("./logger");
|
|
|
10
10
|
Object.defineProperty(exports, "ClickHouseLogLevel", { enumerable: true, get: function () { return logger_1.ClickHouseLogLevel; } });
|
|
11
11
|
var settings_1 = require("./settings");
|
|
12
12
|
Object.defineProperty(exports, "SettingsMap", { enumerable: true, get: function () { return settings_1.SettingsMap; } });
|
|
13
|
-
/** For implementations usage only */
|
|
13
|
+
/** For implementations usage only - should not be re-exported */
|
|
14
14
|
var data_formatter_1 = require("./data_formatter");
|
|
15
|
+
Object.defineProperty(exports, "formatQuerySettings", { enumerable: true, get: function () { return data_formatter_1.formatQuerySettings; } });
|
|
16
|
+
Object.defineProperty(exports, "formatQueryParams", { enumerable: true, get: function () { return data_formatter_1.formatQueryParams; } });
|
|
15
17
|
Object.defineProperty(exports, "encodeJSON", { enumerable: true, get: function () { return data_formatter_1.encodeJSON; } });
|
|
16
18
|
Object.defineProperty(exports, "isSupportedRawFormat", { enumerable: true, get: function () { return data_formatter_1.isSupportedRawFormat; } });
|
|
17
|
-
Object.defineProperty(exports, "
|
|
19
|
+
Object.defineProperty(exports, "isStreamableJSONFamily", { enumerable: true, get: function () { return data_formatter_1.isStreamableJSONFamily; } });
|
|
20
|
+
Object.defineProperty(exports, "isNotStreamableJSONFamily", { enumerable: true, get: function () { return data_formatter_1.isNotStreamableJSONFamily; } });
|
|
18
21
|
Object.defineProperty(exports, "validateStreamFormat", { enumerable: true, get: function () { return data_formatter_1.validateStreamFormat; } });
|
|
22
|
+
var config_1 = require("./config");
|
|
23
|
+
Object.defineProperty(exports, "booleanConfigURLValue", { enumerable: true, get: function () { return config_1.booleanConfigURLValue; } });
|
|
24
|
+
Object.defineProperty(exports, "enumConfigURLValue", { enumerable: true, get: function () { return config_1.enumConfigURLValue; } });
|
|
25
|
+
Object.defineProperty(exports, "getConnectionParams", { enumerable: true, get: function () { return config_1.getConnectionParams; } });
|
|
26
|
+
Object.defineProperty(exports, "numberConfigURLValue", { enumerable: true, get: function () { return config_1.numberConfigURLValue; } });
|
|
19
27
|
var utils_1 = require("./utils");
|
|
20
28
|
Object.defineProperty(exports, "withCompressionHeaders", { enumerable: true, get: function () { return utils_1.withCompressionHeaders; } });
|
|
21
29
|
Object.defineProperty(exports, "isSuccessfulResponse", { enumerable: true, get: function () { return utils_1.isSuccessfulResponse; } });
|
|
@@ -27,7 +35,4 @@ Object.defineProperty(exports, "LogWriter", { enumerable: true, get: function ()
|
|
|
27
35
|
Object.defineProperty(exports, "DefaultLogger", { enumerable: true, get: function () { return logger_2.DefaultLogger; } });
|
|
28
36
|
var error_2 = require("./error");
|
|
29
37
|
Object.defineProperty(exports, "parseError", { enumerable: true, get: function () { return error_2.parseError; } });
|
|
30
|
-
var data_formatter_2 = require("./data_formatter");
|
|
31
|
-
Object.defineProperty(exports, "formatQuerySettings", { enumerable: true, get: function () { return data_formatter_2.formatQuerySettings; } });
|
|
32
|
-
Object.defineProperty(exports, "formatQueryParams", { enumerable: true, get: function () { return data_formatter_2.formatQueryParams; } });
|
|
33
38
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/client-common/src/index.ts"],"names":[],"mappings":";;;AAAA,kDAAkD;AAClD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/client-common/src/index.ts"],"names":[],"mappings":";;;AAAA,kDAAkD;AAClD,mCAaiB;AANf,0GAAA,gBAAgB,OAAA;AAuBlB,iCAAyC;AAAhC,wGAAA,eAAe,OAAA;AACxB,mCAMiB;AALf,4GAAA,kBAAkB,OAAA;AAapB,uCAImB;AADjB,uGAAA,WAAW,OAAA;AAGb,iEAAiE;AACjE,mDAQyB;AAPvB,qHAAA,mBAAmB,OAAA;AACnB,mHAAA,iBAAiB,OAAA;AACjB,4GAAA,UAAU,OAAA;AACV,sHAAA,oBAAoB,OAAA;AACpB,wHAAA,sBAAsB,OAAA;AACtB,2HAAA,yBAAyB,OAAA;AACzB,sHAAA,oBAAoB,OAAA;AAEtB,mCAUiB;AAJf,+GAAA,qBAAqB,OAAA;AACrB,4GAAA,kBAAkB,OAAA;AAClB,6GAAA,mBAAmB,OAAA;AACnB,8GAAA,oBAAoB,OAAA;AAEtB,iCAMgB;AALd,+GAAA,sBAAsB,OAAA;AACtB,6GAAA,oBAAoB,OAAA;AACpB,uGAAA,cAAc,OAAA;AACd,qGAAA,YAAY,OAAA;AACZ,yGAAA,gBAAgB,OAAA;AAElB,mCAAyE;AAAhE,mGAAA,SAAS,OAAA;AAAE,uGAAA,aAAa,OAAA;AACjC,iCAAoC;AAA3B,mGAAA,UAAU,OAAA"}
|