@tdengine/websocket 3.1.9 → 3.2.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.
Files changed (121) hide show
  1. package/lib/example/all_type_query.js +26 -22
  2. package/lib/example/all_type_stmt.js +22 -20
  3. package/lib/example/basicBatchTmq.js +14 -14
  4. package/lib/example/basicSchemaless.js +11 -11
  5. package/lib/example/basicSql.js +10 -10
  6. package/lib/example/basicStmt.js +3 -3
  7. package/lib/example/basicTmq.js +8 -9
  8. package/lib/index.d.ts +1 -1
  9. package/lib/index.d.ts.map +1 -1
  10. package/lib/index.js +1 -1
  11. package/lib/src/client/wsClient.d.ts +3 -2
  12. package/lib/src/client/wsClient.d.ts.map +1 -1
  13. package/lib/src/client/wsClient.js +66 -40
  14. package/lib/src/client/wsConnector.d.ts.map +1 -1
  15. package/lib/src/client/wsConnector.js +40 -14
  16. package/lib/src/client/wsConnectorPool.d.ts.map +1 -1
  17. package/lib/src/client/wsConnectorPool.js +29 -14
  18. package/lib/src/client/wsEventCallback.d.ts.map +1 -1
  19. package/lib/src/client/wsEventCallback.js +6 -4
  20. package/lib/src/client/wsResponse.d.ts.map +1 -1
  21. package/lib/src/client/wsResponse.js +6 -2
  22. package/lib/src/common/config.d.ts +5 -3
  23. package/lib/src/common/config.d.ts.map +1 -1
  24. package/lib/src/common/config.js +15 -5
  25. package/lib/src/common/constant.d.ts +11 -1
  26. package/lib/src/common/constant.d.ts.map +1 -1
  27. package/lib/src/common/constant.js +48 -40
  28. package/lib/src/common/log.d.ts +1 -1
  29. package/lib/src/common/log.d.ts.map +1 -1
  30. package/lib/src/common/log.js +9 -7
  31. package/lib/src/common/reqid.d.ts.map +1 -1
  32. package/lib/src/common/reqid.js +7 -7
  33. package/lib/src/common/taosResult.d.ts.map +1 -1
  34. package/lib/src/common/taosResult.js +46 -27
  35. package/lib/src/common/ut8Helper.d.ts.map +1 -1
  36. package/lib/src/common/ut8Helper.js +8 -8
  37. package/lib/src/common/utils.d.ts.map +1 -1
  38. package/lib/src/common/utils.js +17 -16
  39. package/lib/src/common/wsError.d.ts.map +1 -1
  40. package/lib/src/common/wsError.js +3 -3
  41. package/lib/src/common/wsOptions.d.ts +1 -1
  42. package/lib/src/index.d.ts +3 -3
  43. package/lib/src/index.d.ts.map +1 -1
  44. package/lib/src/sql/wsProto.d.ts.map +1 -1
  45. package/lib/src/sql/wsRows.d.ts +3 -3
  46. package/lib/src/sql/wsRows.d.ts.map +1 -1
  47. package/lib/src/sql/wsRows.js +4 -2
  48. package/lib/src/sql/wsSql.d.ts +5 -5
  49. package/lib/src/sql/wsSql.d.ts.map +1 -1
  50. package/lib/src/sql/wsSql.js +23 -15
  51. package/lib/src/stmt/FieldBindParams.d.ts +9 -0
  52. package/lib/src/stmt/FieldBindParams.d.ts.map +1 -0
  53. package/lib/src/stmt/FieldBindParams.js +13 -0
  54. package/lib/src/stmt/wsColumnInfo.d.ts +12 -0
  55. package/lib/src/stmt/wsColumnInfo.d.ts.map +1 -0
  56. package/lib/src/stmt/wsColumnInfo.js +17 -0
  57. package/lib/src/stmt/wsParams1.d.ts +14 -0
  58. package/lib/src/stmt/wsParams1.d.ts.map +1 -0
  59. package/lib/src/stmt/wsParams1.js +300 -0
  60. package/lib/src/stmt/wsParams2.d.ts +14 -0
  61. package/lib/src/stmt/wsParams2.d.ts.map +1 -0
  62. package/lib/src/stmt/wsParams2.js +203 -0
  63. package/lib/src/stmt/wsParamsBase.d.ts +45 -0
  64. package/lib/src/stmt/wsParamsBase.d.ts.map +1 -0
  65. package/lib/src/stmt/wsParamsBase.js +220 -0
  66. package/lib/src/stmt/wsProto.d.ts +13 -1
  67. package/lib/src/stmt/wsProto.d.ts.map +1 -1
  68. package/lib/src/stmt/wsProto.js +206 -2
  69. package/lib/src/stmt/wsStmt.d.ts +6 -16
  70. package/lib/src/stmt/wsStmt.d.ts.map +1 -1
  71. package/lib/src/stmt/wsStmt.js +0 -201
  72. package/lib/src/stmt/wsStmt1.d.ts +30 -0
  73. package/lib/src/stmt/wsStmt1.d.ts.map +1 -0
  74. package/lib/src/stmt/wsStmt1.js +206 -0
  75. package/lib/src/stmt/wsStmt2.d.ts +37 -0
  76. package/lib/src/stmt/wsStmt2.d.ts.map +1 -0
  77. package/lib/src/stmt/wsStmt2.js +284 -0
  78. package/lib/src/stmt/wsTableInfo.d.ts +17 -0
  79. package/lib/src/stmt/wsTableInfo.d.ts.map +1 -0
  80. package/lib/src/stmt/wsTableInfo.js +54 -0
  81. package/lib/src/tmq/config.d.ts.map +1 -1
  82. package/lib/src/tmq/config.js +2 -2
  83. package/lib/src/tmq/constant.d.ts.map +1 -1
  84. package/lib/src/tmq/constant.js +28 -28
  85. package/lib/src/tmq/tmqResponse.d.ts.map +1 -1
  86. package/lib/src/tmq/tmqResponse.js +31 -17
  87. package/lib/src/tmq/wsTmq.d.ts +2 -2
  88. package/lib/src/tmq/wsTmq.d.ts.map +1 -1
  89. package/lib/src/tmq/wsTmq.js +32 -30
  90. package/lib/test/bulkPulling/cloud.tmq.test.js +11 -11
  91. package/lib/test/bulkPulling/decimal.test.js +50 -26
  92. package/lib/test/bulkPulling/log.test.js +8 -8
  93. package/lib/test/bulkPulling/queryTables.test.js +255 -49
  94. package/lib/test/bulkPulling/schemaless.test.js +34 -34
  95. package/lib/test/bulkPulling/sql.test.js +108 -66
  96. package/lib/test/bulkPulling/stmt1.func.test.d.ts +2 -0
  97. package/lib/test/bulkPulling/stmt1.func.test.d.ts.map +1 -0
  98. package/lib/test/bulkPulling/{stmt.func.test.js → stmt1.func.test.js} +128 -116
  99. package/lib/test/bulkPulling/stmt1.type.test.d.ts +2 -0
  100. package/lib/test/bulkPulling/stmt1.type.test.d.ts.map +1 -0
  101. package/lib/test/bulkPulling/stmt1.type.test.js +399 -0
  102. package/lib/test/bulkPulling/stmt2.func.test.d.ts +2 -0
  103. package/lib/test/bulkPulling/stmt2.func.test.d.ts.map +1 -0
  104. package/lib/test/bulkPulling/stmt2.func.test.js +543 -0
  105. package/lib/test/bulkPulling/stmt2.type.test.d.ts +2 -0
  106. package/lib/test/bulkPulling/stmt2.type.test.d.ts.map +1 -0
  107. package/lib/test/bulkPulling/{stmt.type.test.js → stmt2.type.test.js} +136 -49
  108. package/lib/test/bulkPulling/tmq.test.js +225 -31
  109. package/lib/test/bulkPulling/utils.test.js +2 -2
  110. package/lib/test/bulkPulling/wsConnectPool.test.js +20 -20
  111. package/lib/test/utils.d.ts.map +1 -1
  112. package/lib/test/utils.js +130 -129
  113. package/package.json +1 -1
  114. package/readme.md +1 -0
  115. package/lib/src/stmt/wsParams.d.ts +0 -41
  116. package/lib/src/stmt/wsParams.d.ts.map +0 -1
  117. package/lib/src/stmt/wsParams.js +0 -428
  118. package/lib/test/bulkPulling/stmt.func.test.d.ts +0 -2
  119. package/lib/test/bulkPulling/stmt.func.test.d.ts.map +0 -1
  120. package/lib/test/bulkPulling/stmt.type.test.d.ts +0 -2
  121. package/lib/test/bulkPulling/stmt.type.test.d.ts.map +0 -1
@@ -1,34 +1,35 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PrecisionLength = exports.TDengineTypeLength = exports.TDenginePrecision = exports.TSDB_OPTION_CONNECTION = exports.TDengineTypeCode = exports.ColumnsBlockType = exports.TDengineTypeName = exports.FetchRawBlockMessage = exports.BinaryQueryMessage = void 0;
3
+ exports.PrecisionLength = exports.TDengineTypeLength = exports.TDenginePrecision = exports.FieldBindType = exports.TSDB_OPTION_CONNECTION = exports.TDengineTypeCode = exports.ColumnsBlockType = exports.TDengineTypeName = exports.MinStmt2Version = exports.FetchRawBlockMessage = exports.BinaryQueryMessage = void 0;
4
4
  exports.BinaryQueryMessage = BigInt(6);
5
5
  exports.FetchRawBlockMessage = BigInt(7);
6
+ exports.MinStmt2Version = "3.3.6.0";
6
7
  exports.TDengineTypeName = {
7
- 0: 'NULL',
8
- 1: 'BOOL',
9
- 2: 'TINYINT',
10
- 3: 'SMALLINT',
11
- 4: 'INT',
12
- 5: 'BIGINT',
13
- 6: 'FLOAT',
14
- 7: 'DOUBLE',
15
- 8: 'VARCHAR',
16
- 9: 'TIMESTAMP',
17
- 10: 'NCHAR',
18
- 11: 'TINYINT UNSIGNED',
19
- 12: 'SMALLINT UNSIGNED',
20
- 13: 'INT UNSIGNED',
21
- 14: 'BIGINT UNSIGNED',
22
- 15: 'JSON',
23
- 16: 'VARBINARY',
24
- 20: 'GEOMETRY',
8
+ 0: "NULL",
9
+ 1: "BOOL",
10
+ 2: "TINYINT",
11
+ 3: "SMALLINT",
12
+ 4: "INT",
13
+ 5: "BIGINT",
14
+ 6: "FLOAT",
15
+ 7: "DOUBLE",
16
+ 8: "VARCHAR",
17
+ 9: "TIMESTAMP",
18
+ 10: "NCHAR",
19
+ 11: "TINYINT UNSIGNED",
20
+ 12: "SMALLINT UNSIGNED",
21
+ 13: "INT UNSIGNED",
22
+ 14: "BIGINT UNSIGNED",
23
+ 15: "JSON",
24
+ 16: "VARBINARY",
25
+ 20: "GEOMETRY",
25
26
  };
26
27
  exports.ColumnsBlockType = {
27
- 'SOLID': 0,
28
- 'VARCHAR': 1,
29
- 'NCHAR': 2,
30
- 'GEOMETRY': 3,
31
- 'VARBINARY': 4,
28
+ SOLID: 0,
29
+ VARCHAR: 1,
30
+ NCHAR: 2,
31
+ GEOMETRY: 3,
32
+ VARBINARY: 4,
32
33
  };
33
34
  var TDengineTypeCode;
34
35
  (function (TDengineTypeCode) {
@@ -61,27 +62,34 @@ var TSDB_OPTION_CONNECTION;
61
62
  TSDB_OPTION_CONNECTION[TSDB_OPTION_CONNECTION["TSDB_OPTION_CONNECTION_USER_IP"] = 2] = "TSDB_OPTION_CONNECTION_USER_IP";
62
63
  TSDB_OPTION_CONNECTION[TSDB_OPTION_CONNECTION["TSDB_OPTION_CONNECTION_USER_APP"] = 3] = "TSDB_OPTION_CONNECTION_USER_APP";
63
64
  })(TSDB_OPTION_CONNECTION || (exports.TSDB_OPTION_CONNECTION = TSDB_OPTION_CONNECTION = {}));
65
+ var FieldBindType;
66
+ (function (FieldBindType) {
67
+ FieldBindType[FieldBindType["TAOS_FIELD_COL"] = 1] = "TAOS_FIELD_COL";
68
+ FieldBindType[FieldBindType["TAOS_FIELD_TAG"] = 2] = "TAOS_FIELD_TAG";
69
+ FieldBindType[FieldBindType["TAOS_FIELD_QUERY"] = 3] = "TAOS_FIELD_QUERY";
70
+ FieldBindType[FieldBindType["TAOS_FIELD_TBNAME"] = 4] = "TAOS_FIELD_TBNAME";
71
+ })(FieldBindType || (exports.FieldBindType = FieldBindType = {}));
64
72
  exports.TDenginePrecision = {
65
- 0: 'MILLISECOND',
73
+ 0: "MILLISECOND",
66
74
  1: "MICROSECOND",
67
75
  2: "NANOSECOND",
68
76
  };
69
77
  exports.TDengineTypeLength = {
70
- 'BOOL': 1,
71
- 'TINYINT': 1,
72
- 'SMALLINT': 2,
73
- 'INT': 4,
74
- 'BIGINT': 8,
75
- 'FLOAT': 4,
76
- 'DOUBLE': 8,
77
- 'TIMESTAMP': 8,
78
- 'TINYINT UNSIGNED': 1,
79
- 'SMALLINT UNSIGNED': 2,
80
- 'INT UNSIGNED': 4,
81
- 'BIGINT UNSIGNED': 8,
78
+ [TDengineTypeCode.BOOL]: 1,
79
+ [TDengineTypeCode.TINYINT]: 1,
80
+ [TDengineTypeCode.SMALLINT]: 2,
81
+ [TDengineTypeCode.INT]: 4,
82
+ [TDengineTypeCode.BIGINT]: 8,
83
+ [TDengineTypeCode.FLOAT]: 4,
84
+ [TDengineTypeCode.DOUBLE]: 8,
85
+ [TDengineTypeCode.TIMESTAMP]: 8,
86
+ [TDengineTypeCode.TINYINT_UNSIGNED]: 1,
87
+ [TDengineTypeCode.SMALLINT_UNSIGNED]: 2,
88
+ [TDengineTypeCode.INT_UNSIGNED]: 4,
89
+ [TDengineTypeCode.BIGINT_UNSIGNED]: 8,
82
90
  };
83
91
  exports.PrecisionLength = {
84
- 'ms': 13,
85
- 'us': 16,
86
- 'ns': 19
92
+ ms: 13,
93
+ us: 16,
94
+ ns: 19,
87
95
  };
@@ -1,4 +1,4 @@
1
- import winston from 'winston';
1
+ import winston from "winston";
2
2
  declare const logger: winston.Logger;
3
3
  export declare function setLevel(level: string): void;
4
4
  export default logger;
@@ -1 +1 @@
1
- {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/common/log.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AA0B9B,QAAA,MAAM,MAAM,gBAGV,CAAC;AAEH,wBAAgB,QAAQ,CAAC,KAAK,EAAC,MAAM,QAEpC;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/common/log.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAgC9B,QAAA,MAAM,MAAM,gBAGV,CAAC;AAEH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,QAErC;AAED,eAAe,MAAM,CAAC"}
@@ -7,21 +7,23 @@ exports.setLevel = setLevel;
7
7
  const winston_1 = __importDefault(require("winston"));
8
8
  const winston_daily_rotate_file_1 = __importDefault(require("winston-daily-rotate-file"));
9
9
  const customFormat = winston_1.default.format.printf(({ level, message, label, timestamp }) => {
10
- if (message && typeof message === 'object' && typeof message.toJSON === 'function') {
10
+ if (message &&
11
+ typeof message === "object" &&
12
+ typeof message.toJSON === "function") {
11
13
  message = message.toJSON();
12
14
  }
13
15
  return `${timestamp} [${label}] ${level}: ${message}`;
14
16
  });
15
17
  const transport = new winston_daily_rotate_file_1.default({
16
- filename: './logs/app-%DATE%.log', // Here is the file name template
17
- datePattern: 'YYYY-MM-DD', // date format
18
+ filename: "./logs/app-%DATE%.log", // Here is the file name template
19
+ datePattern: "YYYY-MM-DD", // date format
18
20
  zippedArchive: true, // Whether to compress the archive file into gzip format
19
- maxSize: '20m', // Single file size limit
20
- maxFiles: '14d', // Keep log files for 14 days
21
+ maxSize: "20m", // Single file size limit
22
+ maxFiles: "14d", // Keep log files for 14 days
21
23
  handleExceptions: true, // Whether to handle exceptions
22
24
  json: false, // Whether to output logs in JSON format
23
- format: winston_1.default.format.combine(winston_1.default.format.label({ label: 'node.js websocket' }), winston_1.default.format.timestamp(), customFormat),
24
- level: 'info', // set log level
25
+ format: winston_1.default.format.combine(winston_1.default.format.label({ label: "node.js websocket" }), winston_1.default.format.timestamp(), customFormat),
26
+ level: "info", // set log level
25
27
  });
26
28
  const logger = winston_1.default.createLogger({
27
29
  transports: [transport],
@@ -1 +1 @@
1
- {"version":3,"file":"reqid.d.ts","sourceRoot":"","sources":["../../../src/common/reqid.ts"],"names":[],"mappings":"AA2BA,qBAAa,KAAK;IACd,OAAO,CAAC,MAAM,CAAC,KAAK,CAAK;IACzB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAI;IACvB,OAAO,CAAC,MAAM,CAAC,YAAY,CAA4B;IACvD,OAAO,CAAC,MAAM,CAAC,SAAS,CAAsC;WAahD,QAAQ,CAAC,MAAM,CAAC,EAAC,MAAM,GAAE,MAAM;CAgBhD"}
1
+ {"version":3,"file":"reqid.d.ts","sourceRoot":"","sources":["../../../src/common/reqid.ts"],"names":[],"mappings":"AA2BA,qBAAa,KAAK;IACd,OAAO,CAAC,MAAM,CAAC,KAAK,CAAK;IACzB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAK;IACxB,OAAO,CAAC,MAAM,CAAC,YAAY,CAA4B;IACvD,OAAO,CAAC,MAAM,CAAC,SAAS,CAAsC;WAahD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM;CAgBlD"}
@@ -14,12 +14,12 @@ function hexStringToNumber(hexString) {
14
14
  }
15
15
  function uuidToHash() {
16
16
  let uuid = (0, uuid_1.v4)();
17
- // create SHA-256 hash
18
- const hash = (0, crypto_1.createHash)('sha256');
19
- // update hash contact
17
+ // create SHA-256 hash
18
+ const hash = (0, crypto_1.createHash)("sha256");
19
+ // update hash contact
20
20
  hash.update(uuid);
21
- // get hex hash code
22
- const strHex = hash.digest('hex').substring(0, 8);
21
+ // get hex hash code
22
+ const strHex = hash.digest("hex").substring(0, 8);
23
23
  let hex = hexStringToNumber(strHex);
24
24
  return hex & 0xff;
25
25
  }
@@ -33,8 +33,8 @@ class ReqId {
33
33
  const view = new DataView(buffer);
34
34
  let ts = new Date().getTime() >> 8;
35
35
  view.setUint8(6, this._uuid >> 4);
36
- view.setUint8(5, (this._uuid & 0x0f) << 4 | this._pid);
37
- view.setUint8(4, ts >> 16 & 0xff);
36
+ view.setUint8(5, ((this._uuid & 0x0f) << 4) | this._pid);
37
+ view.setUint8(4, (ts >> 16) & 0xff);
38
38
  view.setUint16(2, ts & 0xffff, true);
39
39
  view.setUint16(0, no & 0xffff, true);
40
40
  let id = view.getBigInt64(0, true);
@@ -1 +1 @@
1
- {"version":3,"file":"taosResult.d.ts","sourceRoot":"","sources":["../../../src/common/taosResult.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAQ7E,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,YAAY;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAC,GAAG,CAAC;CACX;AAED,qBAAa,UAAU;IACnB,OAAO,CAAC,MAAM,CAAC,CAAQ;IACvB,OAAO,CAAC,KAAK,CAA6B;IAC1C,OAAO,CAAC,KAAK,CAA2B;IAExC,OAAO,CAAC,UAAU,CAA4B;IAC9C,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACjD,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,C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,MAAM,CAE/C;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE1D;AAMD,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3C"}
@@ -34,13 +34,16 @@ class TaosResult {
34
34
  this._data = null;
35
35
  }
36
36
  else {
37
- if (queryResponse.fields_count && queryResponse.fields_names && queryResponse.fields_types && queryResponse.fields_lengths) {
37
+ if (queryResponse.fields_count &&
38
+ queryResponse.fields_names &&
39
+ queryResponse.fields_types &&
40
+ queryResponse.fields_lengths) {
38
41
  let _meta = [];
39
42
  for (let i = 0; i < queryResponse.fields_count; i++) {
40
43
  _meta.push({
41
44
  name: queryResponse.fields_names[i],
42
45
  type: queryResponse.fields_types[i],
43
- length: queryResponse.fields_lengths[i]
46
+ length: queryResponse.fields_lengths[i],
44
47
  });
45
48
  }
46
49
  this._meta = _meta;
@@ -129,11 +132,11 @@ class TaosResult {
129
132
  getTDengineMeta() {
130
133
  if (this._meta) {
131
134
  let tdMeta = new Array();
132
- this._meta.forEach(m => {
135
+ this._meta.forEach((m) => {
133
136
  tdMeta.push({
134
137
  name: m.name,
135
138
  type: constant_1.TDengineTypeName[m.type],
136
- length: m.length
139
+ length: m.length,
137
140
  });
138
141
  });
139
142
  return tdMeta;
@@ -154,7 +157,7 @@ function parseBlock(blocks, taosResult) {
154
157
  taosResult.setTiming(blocks.timing);
155
158
  const INT_32_SIZE = 4;
156
159
  // Offset num of bytes from rawBlockBuffer.
157
- let bufferOffset = (4 * 5) + 8 + (4 + 1) * metaList.length;
160
+ let bufferOffset = 4 * 5 + 8 + (4 + 1) * metaList.length;
158
161
  let colLengthBlockSize = INT_32_SIZE * metaList.length;
159
162
  log_1.default.debug("===colLengthBlockSize:" + colLengthBlockSize);
160
163
  let bitMapSize = (rows + (1 << 3) - 1) >> 3;
@@ -170,44 +173,58 @@ function parseBlock(blocks, taosResult) {
170
173
  colBlockHead = 0 + colLengthBlockSize;
171
174
  // point to the head of columns's data in the block (include bitMap and offsetArray)
172
175
  let colDataHead = colBlockHead;
173
- // traverse row after row.
176
+ // traverse row after row.
174
177
  for (let j = 0; j < metaList.length; j++) {
175
178
  let isVarType = _isVarType(metaList[j].type);
176
179
  if (isVarType == constant_1.ColumnsBlockType.SOLID) {
177
- colDataHead = colBlockHead + bitMapSize + metaList[j].length * i;
180
+ colDataHead =
181
+ colBlockHead + bitMapSize + metaList[j].length * i;
178
182
  let byteArrayIndex = i >> 3;
179
183
  let bitwiseOffset = 7 - (i & 7);
180
184
  // let bitMapArr = dataBuffer.slice(colBlockHead, colBlockHead + bitMapSize)
181
185
  let bitMapArr = new DataView(dataView.buffer, dataView.byteOffset + colBlockHead, bitMapSize);
182
- let bitFlag = (bitMapArr.getUint8(byteArrayIndex) & (1 << bitwiseOffset)) >> bitwiseOffset;
186
+ let bitFlag = (bitMapArr.getUint8(byteArrayIndex) &
187
+ (1 << bitwiseOffset)) >>
188
+ bitwiseOffset;
183
189
  if (bitFlag == 1) {
184
190
  row.push("NULL");
185
191
  }
186
192
  else {
187
193
  row.push(readSolidData(dataView, colDataHead, metaList[j], taosResult.getFieldsScales(j)));
188
194
  }
189
- colBlockHead = colBlockHead + bitMapSize + dataView.getInt32(INT_32_SIZE * j, true);
195
+ colBlockHead =
196
+ colBlockHead +
197
+ bitMapSize +
198
+ dataView.getInt32(INT_32_SIZE * j, true);
190
199
  }
191
200
  else {
192
201
  // if null check
193
- let varOffset = dataView.getInt32(colBlockHead + (INT_32_SIZE * i), true);
202
+ let varOffset = dataView.getInt32(colBlockHead + INT_32_SIZE * i, true);
194
203
  if (varOffset == -1) {
195
204
  row.push("NULL");
196
- colBlockHead = colBlockHead + INT_32_SIZE * rows + dataView.getInt32(j * INT_32_SIZE, true);
205
+ colBlockHead =
206
+ colBlockHead +
207
+ INT_32_SIZE * rows +
208
+ dataView.getInt32(j * INT_32_SIZE, true);
197
209
  }
198
210
  else {
199
- colDataHead = colBlockHead + INT_32_SIZE * rows + varOffset;
211
+ colDataHead =
212
+ colBlockHead + INT_32_SIZE * rows + varOffset;
200
213
  let dataLength = dataView.getInt16(colDataHead, true);
201
214
  if (isVarType == constant_1.ColumnsBlockType.VARCHAR) {
202
215
  row.push(readVarchar(dataView.buffer, dataView.byteOffset + colDataHead + 2, dataLength, textDecoder));
203
216
  }
204
- else if (isVarType == constant_1.ColumnsBlockType.GEOMETRY || isVarType == constant_1.ColumnsBlockType.VARBINARY) {
217
+ else if (isVarType == constant_1.ColumnsBlockType.GEOMETRY ||
218
+ isVarType == constant_1.ColumnsBlockType.VARBINARY) {
205
219
  row.push(readBinary(dataView.buffer, dataView.byteOffset + colDataHead + 2, dataLength));
206
220
  }
207
221
  else {
208
222
  row.push(readNchar(dataView.buffer, dataView.byteOffset + colDataHead + 2, dataLength));
209
223
  }
210
- colBlockHead = colBlockHead + INT_32_SIZE * rows + dataView.getInt32(j * INT_32_SIZE, true);
224
+ colBlockHead =
225
+ colBlockHead +
226
+ INT_32_SIZE * rows +
227
+ dataView.getInt32(j * INT_32_SIZE, true);
211
228
  }
212
229
  }
213
230
  }
@@ -222,25 +239,25 @@ function parseBlock(blocks, taosResult) {
222
239
  function _isVarType(metaType) {
223
240
  switch (metaType) {
224
241
  case constant_1.TDengineTypeCode.NCHAR: {
225
- return constant_1.ColumnsBlockType['NCHAR'];
242
+ return constant_1.ColumnsBlockType["NCHAR"];
226
243
  }
227
244
  case constant_1.TDengineTypeCode.VARCHAR: {
228
- return constant_1.ColumnsBlockType['VARCHAR'];
245
+ return constant_1.ColumnsBlockType["VARCHAR"];
229
246
  }
230
247
  case constant_1.TDengineTypeCode.BINARY: {
231
- return constant_1.ColumnsBlockType['VARCHAR'];
248
+ return constant_1.ColumnsBlockType["VARCHAR"];
232
249
  }
233
250
  case constant_1.TDengineTypeCode.JSON: {
234
- return constant_1.ColumnsBlockType['VARCHAR'];
251
+ return constant_1.ColumnsBlockType["VARCHAR"];
235
252
  }
236
253
  case constant_1.TDengineTypeCode.GEOMETRY: {
237
- return constant_1.ColumnsBlockType['GEOMETRY'];
254
+ return constant_1.ColumnsBlockType["GEOMETRY"];
238
255
  }
239
256
  case constant_1.TDengineTypeCode.VARBINARY: {
240
257
  return constant_1.ColumnsBlockType.VARBINARY;
241
258
  }
242
259
  default: {
243
- return constant_1.ColumnsBlockType['SOLID'];
260
+ return constant_1.ColumnsBlockType["SOLID"];
244
261
  }
245
262
  }
246
263
  }
@@ -343,7 +360,9 @@ function readSolidDataToArray(dataBuffer, colBlockHead, rows, metaType, bitMapAr
343
360
  result.push(null);
344
361
  }
345
362
  else {
346
- result.push(parseFloat(dataBuffer.getFloat64(colBlockHead, true).toFixed(15)));
363
+ result.push(parseFloat(dataBuffer
364
+ .getFloat64(colBlockHead, true)
365
+ .toFixed(15)));
347
366
  }
348
367
  }
349
368
  break;
@@ -396,7 +415,7 @@ function readSolidDataToArray(dataBuffer, colBlockHead, rows, metaType, bitMapAr
396
415
  function readSolidData(dataBuffer, colDataHead, meta, fields_scale) {
397
416
  switch (meta.type) {
398
417
  case constant_1.TDengineTypeCode.BOOL: {
399
- return (Boolean)(dataBuffer.getInt8(colDataHead));
418
+ return Boolean(dataBuffer.getInt8(colDataHead));
400
419
  }
401
420
  case constant_1.TDengineTypeCode.TINYINT: {
402
421
  return dataBuffer.getInt8(colDataHead);
@@ -430,7 +449,7 @@ function readSolidData(dataBuffer, colDataHead, meta, fields_scale) {
430
449
  }
431
450
  case constant_1.TDengineTypeCode.TIMESTAMP: {
432
451
  return dataBuffer.getBigInt64(colDataHead, true);
433
- // could change
452
+ // could change
434
453
  }
435
454
  case constant_1.TDengineTypeCode.DECIMAL: {
436
455
  let decimalHighPart = dataBuffer.getBigInt64(colDataHead + 8, true);
@@ -463,7 +482,7 @@ function readNchar(dataBuffer, colDataHead, length) {
463
482
  for (let i = 0; i < length / 4; i++) {
464
483
  data.push((0, ut8Helper_1.appendRune)(dataView.getUint32(i * 4, true)));
465
484
  }
466
- return data.join('');
485
+ return data.join("");
467
486
  }
468
487
  function getString(dataBuffer, colDataHead, length, textDecoder) {
469
488
  // let buff = dataBuffer.slice(colDataHead, colDataHead + length - 1)
@@ -480,7 +499,7 @@ function isNull(bitMapArr, n) {
480
499
  let c = new Uint8Array(bitMapArr);
481
500
  let position = n >>> 3;
482
501
  let index = n & 0x7;
483
- return (c[position] & (1 << (7 - index))) == (1 << (7 - index));
502
+ return (c[position] & (1 << (7 - index))) == 1 << (7 - index);
484
503
  }
485
504
  function getCharOffset(n) {
486
505
  return n >> 3;
@@ -492,12 +511,12 @@ function bitPos(n) {
492
511
  return n & ((1 << 3) - 1);
493
512
  }
494
513
  function bitmapLen(n) {
495
- return ((n) + ((1 << 3) - 1)) >> 3;
514
+ return (n + ((1 << 3) - 1)) >> 3;
496
515
  }
497
516
  function getScaleFromRowBlock(buffer, colIndex, startOffset) {
498
517
  // for decimal: |___bytes___|__empty__|___prec___|__scale___|
499
518
  let backupPos = buffer.byteOffset + startOffset + 28 + colIndex * 5 + 1;
500
519
  let scaleBuffer = new DataView(buffer.buffer, backupPos);
501
520
  let scale = scaleBuffer.getInt32(0, true);
502
- return scale & 0xFF;
521
+ return scale & 0xff;
503
522
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ut8Helper.d.ts","sourceRoot":"","sources":["../../../src/common/ut8Helper.ts"],"names":[],"mappings":"AAsBA,wBAAgB,UAAU,CAAC,CAAC,EAAC,GAAG,UAiB/B"}
1
+ {"version":3,"file":"ut8Helper.d.ts","sourceRoot":"","sources":["../../../src/common/ut8Helper.ts"],"names":[],"mappings":"AAqBA,wBAAgB,UAAU,CAAC,CAAC,EAAE,GAAG,UA0BhC"}
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.appendRune = appendRune;
4
4
  // Numbers fundamental to the encoding.
5
5
  // the "error" Rune or "Unicode replacement character"
6
- const RuneError = '\uFFFD';
6
+ const RuneError = "\uFFFD";
7
7
  // Maximum valid Unicode code point.
8
- const MaxRune = '\U0010FFFF';
8
+ const MaxRune = "U0010FFFF";
9
9
  // Code points in the surrogate range are not valid for UTF-8.
10
- const surrogateMin = 0xD800;
11
- const surrogateMax = 0xDFFF;
10
+ const surrogateMin = 0xd800;
11
+ const surrogateMax = 0xdfff;
12
12
  const tx = 128;
13
13
  const t2 = 192;
14
14
  const t3 = 224;
@@ -27,16 +27,16 @@ function appendRune(r) {
27
27
  return Buffer.from(p).toString();
28
28
  }
29
29
  if (r <= rune2Max) {
30
- p.push(t2 | ((r >> 6) & 0xff), tx | (r & 0xff) & maskx);
30
+ p.push(t2 | ((r >> 6) & 0xff), tx | (r & 0xff & maskx));
31
31
  }
32
- else if ((r > MaxRune) || (surrogateMax <= r && r <= surrogateMax)) {
32
+ else if (r > MaxRune || (surrogateMax <= r && r <= surrogateMax)) {
33
33
  p.push(RuneError);
34
34
  }
35
35
  else if (r <= rune3Max) {
36
- p.push(t3 | ((r >> 12) & 0xff), tx | ((r >> 6) & 0xff) & maskx, tx | (r & 0xff) & maskx);
36
+ p.push(t3 | ((r >> 12) & 0xff), tx | ((r >> 6) & 0xff & maskx), tx | (r & 0xff & maskx));
37
37
  }
38
38
  else {
39
- p.push(t4 | ((r >> 18) & 0xff), tx | ((r >> 12) & 0xff) & maskx, tx | ((r >> 6) & 0xff) & maskx, tx | (r & 0xff) & maskx);
39
+ p.push(t4 | ((r >> 18) & 0xff), tx | ((r >> 12) & 0xff & maskx), tx | ((r >> 6) & 0xff & maskx), tx | (r & 0xff & maskx));
40
40
  }
41
41
  return Buffer.from(p).toString();
42
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/common/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGpC,wBAAgB,MAAM,CAAC,QAAQ,EAAC,QAAQ,GAAE,GAAG,CA6B5C;AAGD,wBAAgB,OAAO,CAAC,KAAK,EAAE,GAAG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wsError_1 = require("./wsError");
11
11
  function getUrl(wsConfig) {
12
12
  let url = new URL(wsConfig.getUrl());
13
13
  if (wsConfig.getUser()) {
14
- url.username = wsConfig.getUser() || '';
14
+ url.username = wsConfig.getUser() || "";
15
15
  }
16
16
  if (wsConfig.getPwd()) {
17
- url.password = wsConfig.getPwd() || '';
17
+ url.password = wsConfig.getPwd() || "";
18
18
  }
19
19
  let token = wsConfig.getToken();
20
20
  if (token) {
@@ -24,22 +24,22 @@ function getUrl(wsConfig) {
24
24
  if (timezone) {
25
25
  url.searchParams.set("timezone", timezone);
26
26
  }
27
- if (url.pathname && url.pathname !== '/') {
27
+ if (url.pathname && url.pathname !== "/") {
28
28
  wsConfig.setDb(url.pathname.slice(1));
29
29
  }
30
30
  if (url.searchParams.has("timezone")) {
31
- wsConfig.setTimezone(url.searchParams.get("timezone") || '');
31
+ wsConfig.setTimezone(url.searchParams.get("timezone") || "");
32
32
  }
33
- url.pathname = '/ws';
33
+ url.pathname = "/ws";
34
34
  return url;
35
35
  }
36
36
  function isEmpty(value) {
37
37
  if (value === null || value === undefined)
38
38
  return true;
39
- // if (typeof value === 'string' && value.trim() === '') return true;
39
+ // if (typeof value === 'string' && value.trim() === '') return true;
40
40
  if (Array.isArray(value) && value.length === 0)
41
41
  return true;
42
- // if (typeof value === 'object' && Object.keys(value).length === 0) return true;
42
+ // if (typeof value === 'object' && Object.keys(value).length === 0) return true;
43
43
  return false;
44
44
  }
45
45
  function getBinarySql(action, reqId, resultId, sql) {
@@ -71,16 +71,16 @@ function getBinarySql(action, reqId, resultId, sql) {
71
71
  return sqlBuffer;
72
72
  }
73
73
  function zigzagDecode(n) {
74
- return (n >> 1) ^ (-(n & 1));
74
+ return (n >> 1) ^ -(n & 1);
75
75
  }
76
76
  function safeDecodeURIComponent(str) {
77
77
  // Replace invalid "%" not followed by two hex characters with "%25"
78
- const cleaned = str.replace(/%(?![0-9A-Fa-f]{2})/g, '%25');
78
+ const cleaned = str.replace(/%(?![0-9A-Fa-f]{2})/g, "%25");
79
79
  try {
80
80
  return decodeURIComponent(cleaned);
81
81
  }
82
82
  catch (e) {
83
- throw (new wsError_1.TDWebSocketClientError(wsError_1.ErrorCode.ERR_INVALID_URL, `Decoding ${str} error: ${e}`));
83
+ throw new wsError_1.TDWebSocketClientError(wsError_1.ErrorCode.ERR_INVALID_URL, `Decoding ${str} error: ${e}`);
84
84
  }
85
85
  }
86
86
  /**
@@ -108,11 +108,11 @@ function compareVersions(v1, v2) {
108
108
  */
109
109
  function splitVersion(version) {
110
110
  // split main version and pre release tags
111
- const parts = version.split('-');
111
+ const parts = version.split("-");
112
112
  const main = parts[0];
113
113
  const prerelease = parts.length > 1 ? parts[1] : null;
114
114
  // split the main version into a numerical array
115
- const mainParts = main.split('.').map(Number);
115
+ const mainParts = main.split(".").map(Number);
116
116
  return [mainParts, prerelease];
117
117
  }
118
118
  /**
@@ -150,18 +150,19 @@ function decimalToString(valueStr, fields_scale) {
150
150
  let decimalStr = valueStr;
151
151
  if (fields_scale && fields_scale > 0) {
152
152
  const scale = Number(fields_scale);
153
- const isNegative = decimalStr.startsWith('-');
153
+ const isNegative = decimalStr.startsWith("-");
154
154
  const absStr = isNegative ? decimalStr.slice(1) : decimalStr;
155
155
  if (absStr.length <= scale) {
156
156
  // If the length of the number is less than or equal to the precision, add 0 before it.
157
- const paddedStr = absStr.padStart(scale + 1, '0');
158
- decimalStr = (isNegative ? '-' : '') + '0.' + paddedStr.slice(1);
157
+ const paddedStr = absStr.padStart(scale + 1, "0");
158
+ decimalStr = (isNegative ? "-" : "") + "0." + paddedStr.slice(1);
159
159
  }
160
160
  else {
161
161
  // 在指定位置插入小数点
162
162
  const integerPart = absStr.slice(0, absStr.length - scale);
163
163
  const decimalPart = absStr.slice(absStr.length - scale);
164
- decimalStr = (isNegative ? '-' : '') + integerPart + '.' + decimalPart;
164
+ decimalStr =
165
+ (isNegative ? "-" : "") + integerPart + "." + decimalPart;
165
166
  }
166
167
  }
167
168
  return decimalStr;
@@ -1 +1 @@
1
- {"version":3,"file":"wsError.d.ts","sourceRoot":"","sources":["../../../src/common/wsError.ts"],"names":[],"mappings":"AAAA,qBAAa,sBAAuB,SAAQ,KAAK;IAC7C,IAAI,EAAC,MAAM,CAAK;gBACJ,IAAI,EAAC,MAAM,EAAE,OAAO,GAAE,MAAW;CAahD;AACD,qBAAa,mBAAoB,SAAQ,sBAAsB;CAAI;AACnE,qBAAa,uBAAwB,SAAQ,sBAAsB;CAAG;AACtE,qBAAa,4BAA6B,SAAQ,uBAAuB;CAAE;AAC3E,qBAAa,eAAgB,SAAQ,sBAAsB;CAAE;AAC7D,qBAAa,SAAU,SAAQ,sBAAsB;CAAE;AAEvD,oBAAY,SAAS;IACjB,kBAAkB,MAAM;IACxB,eAAe,MAAM;IACrB,kBAAkB,MAAM;IACxB,wBAAwB,MAAM;IAC9B,6BAA6B,MAAM;IACnC,2BAA2B,MAAM;IACjC,0BAA0B,MAAM;IAChC,6BAA6B,MAAM;IACnC,qBAAqB,MAAM;IAC3B,8BAA8B,MAAM;IACpC,sCAAsC,MAAM;IAC5C,4CAA4C,MAAM;IAClD,+BAA+B,MAAM;CACxC"}
1
+ {"version":3,"file":"wsError.d.ts","sourceRoot":"","sources":["../../../src/common/wsError.ts"],"names":[],"mappings":"AAAA,qBAAa,sBAAuB,SAAQ,KAAK;IAC7C,IAAI,EAAE,MAAM,CAAK;gBACL,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,MAAW;CAajD;AACD,qBAAa,mBAAoB,SAAQ,sBAAsB;CAAI;AACnE,qBAAa,uBAAwB,SAAQ,sBAAsB;CAAI;AACvE,qBAAa,4BAA6B,SAAQ,uBAAuB;CAAI;AAC7E,qBAAa,eAAgB,SAAQ,sBAAsB;CAAI;AAC/D,qBAAa,SAAU,SAAQ,sBAAsB;CAAI;AAEzD,oBAAY,SAAS;IACjB,kBAAkB,MAAM;IACxB,eAAe,MAAM;IACrB,kBAAkB,MAAM;IACxB,wBAAwB,MAAM;IAC9B,6BAA6B,MAAM;IACnC,2BAA2B,MAAM;IACjC,0BAA0B,MAAM;IAChC,6BAA6B,MAAM;IACnC,qBAAqB,MAAM;IAC3B,8BAA8B,MAAM;IACpC,sCAAsC,MAAM;IAC5C,4CAA4C,MAAM;IAClD,+BAA+B,MAAM;CACxC"}
@@ -2,15 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ErrorCode = exports.TaosError = exports.TaosResultError = exports.WebSocketQueryInterFaceError = exports.WebSocketInterfaceError = exports.WebSocketQueryError = exports.TDWebSocketClientError = void 0;
4
4
  class TDWebSocketClientError extends Error {
5
- constructor(code, message = '') {
5
+ constructor(code, message = "") {
6
6
  super(message);
7
7
  this.code = 0;
8
8
  this.name = new.target.name;
9
9
  this.code = code;
10
- if (typeof Error.captureStackTrace === 'function') {
10
+ if (typeof Error.captureStackTrace === "function") {
11
11
  Error.captureStackTrace(this, new.target);
12
12
  }
13
- if (typeof Object.setPrototypeOf === 'function') {
13
+ if (typeof Object.setPrototypeOf === "function") {
14
14
  Object.setPrototypeOf(this, new.target.prototype);
15
15
  }
16
16
  else {
@@ -6,7 +6,7 @@ export interface Uri {
6
6
  scheme: string;
7
7
  url?: string;
8
8
  host?: string | undefined | null;
9
- path: '/rest/sql/' | string;
9
+ path: "/rest/sql/" | string;
10
10
  port?: number | undefined | null;
11
11
  query?: {
12
12
  [key: string]: string;
@@ -1,6 +1,6 @@
1
- import { WsSql } from './sql/wsSql';
2
- import { WSConfig } from './common/config';
3
- import { WsConsumer } from './tmq/wsTmq';
1
+ import { WsSql } from "./sql/wsSql";
2
+ import { WSConfig } from "./common/config";
3
+ import { WsConsumer } from "./tmq/wsTmq";
4
4
  declare let sqlConnect: (conf: WSConfig) => Promise<WsSql>;
5
5
  declare let tmqConnect: (configMap: Map<string, string>) => Promise<WsConsumer>;
6
6
  declare let setLogLevel: (level: string) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAKzC,QAAA,IAAI,UAAU,SAAgB,QAAQ,mBAQrC,CAAC;AAEF,QAAA,IAAI,UAAU,cAAqB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,wBAOrD,CAAC;AAEF,QAAA,IAAI,WAAW,UAAW,MAAM,SAE/B,CAAC;AAEF,QAAA,IAAI,OAAO,YAEV,CAAC;AACF,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIzC,QAAA,IAAI,UAAU,SAAgB,QAAQ,mBAOrC,CAAC;AAEF,QAAA,IAAI,UAAU,cAAqB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,wBAOrD,CAAC;AAEF,QAAA,IAAI,WAAW,UAAW,MAAM,SAE/B,CAAC;AAEF,QAAA,IAAI,OAAO,YAEV,CAAC;AACF,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"wsProto.d.ts","sourceRoot":"","sources":["../../../src/sql/wsProto.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,oBAAoB,CAAC;CAC9B;AAED,MAAM,WAAW,oBAAoB;IACjC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,oBAAY,SAAS;IACjB,cAAc,KAAK;IACnB,KAAK,MAAM;IACX,OAAO,MAAM;IACb,OAAO,MAAM;IACb,aAAa,OAAO;IACpB,aAAa,MAAM;IACnB,YAAY,OAAO;CACtB;AAED,oBAAY,eAAe;IACvB,oBAAoB,IAAU;IAC9B,0BAA0B,IAAI;IAC9B,0BAA0B,IAAI;CACjC"}
1
+ {"version":3,"file":"wsProto.d.ts","sourceRoot":"","sources":["../../../src/sql/wsProto.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,oBAAoB,CAAC;CAC9B;AAED,MAAM,WAAW,oBAAoB;IACjC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,oBAAY,SAAS;IACjB,cAAc,KAAK;IACnB,KAAK,MAAM;IACX,OAAO,MAAM;IACb,OAAO,MAAM;IACb,aAAa,OAAO;IACpB,aAAa,MAAM;IACnB,YAAY,OAAO;CACtB;AAED,oBAAY,eAAe;IACvB,oBAAoB,IAAI;IACxB,0BAA0B,IAAI;IAC9B,0BAA0B,IAAI;CACjC"}
@@ -1,6 +1,6 @@
1
- import { TDengineMeta } from '../common/taosResult';
2
- import { WSQueryResponse } from '../client/wsResponse';
3
- import { WsClient } from '../client/wsClient';
1
+ import { TDengineMeta } from "../common/taosResult";
2
+ import { WSQueryResponse } from "../client/wsResponse";
3
+ import { WsClient } from "../client/wsClient";
4
4
  export declare class WSRows {
5
5
  private _wsClient;
6
6
  private readonly _wsQueryResponse;