@clickhouse/client-web 1.8.1 → 1.9.1

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/dist/index.d.ts CHANGED
@@ -3,4 +3,4 @@ export { createClient } from './client';
3
3
  export { type WebClickHouseClientConfigOptions as ClickHouseClientConfigOptions } from './config';
4
4
  export { ResultSet } from './result_set';
5
5
  /** Re-export @clickhouse/client-common types */
6
- export { type BaseClickHouseClientConfigOptions, type BaseQueryParams, type QueryParams, type ExecParams, type InsertParams, type InsertValues, type CommandParams, type CommandResult, type ExecResult, type InsertResult, type DataFormat, type RawDataFormat, type JSONDataFormat, type StreamableDataFormat, type StreamableJSONDataFormat, type SingleDocumentJSONFormat, type Logger, type LogParams, type ErrorLogParams, type WarnLogParams, type ClickHouseSettings, type MergeTreeSettings, type Row, type ResponseJSON, type InputJSON, type InputJSONObjectEachRow, type BaseResultSet, type PingResult, ClickHouseError, ClickHouseLogLevel, SettingsMap, SupportedJSONFormats, SupportedRawFormats, StreamableFormats, StreamableJSONFormats, SingleDocumentJSONFormats, RecordsJSONFormats, type SimpleColumnType, type ParsedColumnSimple, type ParsedColumnEnum, type ParsedColumnFixedString, type ParsedColumnNullable, type ParsedColumnDecimal, type ParsedColumnDateTime, type ParsedColumnDateTime64, type ParsedColumnArray, type ParsedColumnTuple, type ParsedColumnMap, type ParsedColumnType, parseColumnType, SimpleColumnTypes, type ProgressRow, isProgressRow, type RowOrProgress, } from '@clickhouse/client-common';
6
+ export { type BaseClickHouseClientConfigOptions, type BaseQueryParams, type QueryParams, type ExecParams, type InsertParams, type InsertValues, type CommandParams, type CommandResult, type ExecResult, type InsertResult, type DataFormat, type RawDataFormat, type JSONDataFormat, type StreamableDataFormat, type StreamableJSONDataFormat, type SingleDocumentJSONFormat, type Logger, type LogParams, type ErrorLogParams, type WarnLogParams, type ClickHouseSettings, type MergeTreeSettings, type Row, type ResponseJSON, type InputJSON, type InputJSONObjectEachRow, type BaseResultSet, type PingResult, ClickHouseError, ClickHouseLogLevel, SettingsMap, SupportedJSONFormats, SupportedRawFormats, StreamableFormats, StreamableJSONFormats, SingleDocumentJSONFormats, RecordsJSONFormats, type SimpleColumnType, type ParsedColumnSimple, type ParsedColumnEnum, type ParsedColumnFixedString, type ParsedColumnNullable, type ParsedColumnDecimal, type ParsedColumnDateTime, type ParsedColumnDateTime64, type ParsedColumnArray, type ParsedColumnTuple, type ParsedColumnMap, type ParsedColumnType, parseColumnType, SimpleColumnTypes, type ProgressRow, isProgressRow, type RowOrProgress, TupleParam, } from '@clickhouse/client-common';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isProgressRow = exports.SimpleColumnTypes = exports.parseColumnType = exports.SettingsMap = exports.ClickHouseLogLevel = exports.ClickHouseError = exports.ResultSet = exports.createClient = void 0;
3
+ exports.TupleParam = exports.isProgressRow = exports.SimpleColumnTypes = exports.parseColumnType = exports.SettingsMap = exports.ClickHouseLogLevel = exports.ClickHouseError = exports.ResultSet = exports.createClient = void 0;
4
4
  var client_1 = require("./client");
5
5
  Object.defineProperty(exports, "createClient", { enumerable: true, get: function () { return client_1.createClient; } });
6
6
  var result_set_1 = require("./result_set");
@@ -13,4 +13,5 @@ Object.defineProperty(exports, "SettingsMap", { enumerable: true, get: function
13
13
  Object.defineProperty(exports, "parseColumnType", { enumerable: true, get: function () { return client_common_1.parseColumnType; } });
14
14
  Object.defineProperty(exports, "SimpleColumnTypes", { enumerable: true, get: function () { return client_common_1.SimpleColumnTypes; } });
15
15
  Object.defineProperty(exports, "isProgressRow", { enumerable: true, get: function () { return client_common_1.isProgressRow; } });
16
+ Object.defineProperty(exports, "TupleParam", { enumerable: true, get: function () { return client_common_1.TupleParam; } });
16
17
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/client-web/src/index.ts"],"names":[],"mappings":";;;AAIA,mCAAuC;AAA9B,sGAAA,YAAY,OAAA;AAErB,2CAAwC;AAA/B,uGAAA,SAAS,OAAA;AAElB,gDAAgD;AAChD,2DAuDkC;AA1BhC,gHAAA,eAAe,OAAA;AACf,mHAAA,kBAAkB,OAAA;AAClB,4GAAA,WAAW,OAAA;AAmBX,gHAAA,eAAe,OAAA;AACf,kHAAA,iBAAiB,OAAA;AAEjB,8GAAA,aAAa,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/client-web/src/index.ts"],"names":[],"mappings":";;;AAIA,mCAAuC;AAA9B,sGAAA,YAAY,OAAA;AAErB,2CAAwC;AAA/B,uGAAA,SAAS,OAAA;AAElB,gDAAgD;AAChD,2DAwDkC;AA3BhC,gHAAA,eAAe,OAAA;AACf,mHAAA,kBAAkB,OAAA;AAClB,4GAAA,WAAW,OAAA;AAmBX,gHAAA,eAAe,OAAA;AACf,kHAAA,iBAAiB,OAAA;AAEjB,8GAAA,aAAa,OAAA;AAEb,2GAAA,UAAU,OAAA"}
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isStream = isStream;
4
4
  exports.getAsText = getAsText;
5
+ // See https://github.com/v8/v8/commit/ea56bf5513d0cbd2a35a9035c5c2996272b8b728
6
+ const MaxStringLength = Math.pow(2, 29) - 24;
5
7
  function isStream(obj) {
6
8
  return (obj !== null && obj !== undefined && typeof obj.pipeThrough === 'function');
7
9
  }
@@ -12,7 +14,12 @@ async function getAsText(stream) {
12
14
  const reader = stream.getReader();
13
15
  while (!isDone) {
14
16
  const { done, value } = await reader.read();
15
- result += textDecoder.decode(value, { stream: true });
17
+ const decoded = textDecoder.decode(value, { stream: true });
18
+ if (decoded.length + result.length > MaxStringLength) {
19
+ throw new Error('The response length exceeds the maximum allowed size of V8 String: ' +
20
+ `${MaxStringLength}; consider limiting the amount of requested rows.`);
21
+ }
22
+ result += decoded;
16
23
  isDone = done;
17
24
  }
18
25
  // flush
@@ -1 +1 @@
1
- {"version":3,"file":"stream.js","sourceRoot":"","sources":["../../../../packages/client-web/src/utils/stream.ts"],"names":[],"mappings":";;AAAA,4BAIC;AAED,8BAgBC;AAtBD,SAAgB,QAAQ,CAAC,GAAQ;IAC/B,OAAO,CACL,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,IAAI,OAAO,GAAG,CAAC,WAAW,KAAK,UAAU,CAC3E,CAAA;AACH,CAAC;AAEM,KAAK,UAAU,SAAS,CAAC,MAAsB;IACpD,IAAI,MAAM,GAAG,EAAE,CAAA;IACf,IAAI,MAAM,GAAG,KAAK,CAAA;IAElB,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAA;IACrC,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,CAAA;IAEjC,OAAO,CAAC,MAAM,EAAE,CAAC;QACf,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;QAC3C,MAAM,IAAI,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;QACrD,MAAM,GAAG,IAAI,CAAA;IACf,CAAC;IAED,QAAQ;IACR,MAAM,IAAI,WAAW,CAAC,MAAM,EAAE,CAAA;IAC9B,OAAO,MAAM,CAAA;AACf,CAAC"}
1
+ {"version":3,"file":"stream.js","sourceRoot":"","sources":["../../../../packages/client-web/src/utils/stream.ts"],"names":[],"mappings":";;AAGA,4BAIC;AAED,8BAuBC;AAhCD,+EAA+E;AAC/E,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,CAAA;AAE5C,SAAgB,QAAQ,CAAC,GAAQ;IAC/B,OAAO,CACL,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,IAAI,OAAO,GAAG,CAAC,WAAW,KAAK,UAAU,CAC3E,CAAA;AACH,CAAC;AAEM,KAAK,UAAU,SAAS,CAAC,MAAsB;IACpD,IAAI,MAAM,GAAG,EAAE,CAAA;IACf,IAAI,MAAM,GAAG,KAAK,CAAA;IAElB,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAA;IACrC,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,CAAA;IAEjC,OAAO,CAAC,MAAM,EAAE,CAAC;QACf,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;QAC3C,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;QAC3D,IAAI,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,GAAG,eAAe,EAAE,CAAC;YACrD,MAAM,IAAI,KAAK,CACb,qEAAqE;gBACnE,GAAG,eAAe,mDAAmD,CACxE,CAAA;QACH,CAAC;QACD,MAAM,IAAI,OAAO,CAAA;QACjB,MAAM,GAAG,IAAI,CAAA;IACf,CAAC;IAED,QAAQ;IACR,MAAM,IAAI,WAAW,CAAC,MAAM,EAAE,CAAA;IAC9B,OAAO,MAAM,CAAA;AACf,CAAC"}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "1.8.1";
1
+ declare const _default: "1.9.1";
2
2
  export default _default;
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = '1.8.1';
3
+ exports.default = '1.9.1';
4
4
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@clickhouse/client-web",
3
3
  "description": "Official JS client for ClickHouse DB - Web API implementation",
4
4
  "homepage": "https://clickhouse.com",
5
- "version": "1.8.1",
5
+ "version": "1.9.1",
6
6
  "license": "Apache-2.0",
7
7
  "keywords": [
8
8
  "clickhouse",
@@ -20,6 +20,6 @@
20
20
  "dist"
21
21
  ],
22
22
  "dependencies": {
23
- "@clickhouse/client-common": "1.8.1"
23
+ "@clickhouse/client-common": "1.9.1"
24
24
  }
25
25
  }