@tdengine/websocket 3.1.0 → 3.1.2

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 (62) hide show
  1. package/lib/example/all_type_query.d.ts +2 -0
  2. package/lib/example/all_type_query.d.ts.map +1 -0
  3. package/lib/example/all_type_query.js +89 -0
  4. package/lib/example/all_type_stmt.d.ts +2 -0
  5. package/lib/example/all_type_stmt.d.ts.map +1 -0
  6. package/lib/example/all_type_stmt.js +130 -0
  7. package/lib/example/basicBatchTmq.d.ts +2 -0
  8. package/lib/example/basicBatchTmq.d.ts.map +1 -0
  9. package/lib/example/basicBatchTmq.js +129 -0
  10. package/lib/example/basicSql.js +9 -7
  11. package/lib/example/basicStmt.js +34 -20
  12. package/lib/example/basicTmq.js +22 -20
  13. package/lib/example/logs/.007e668bb78549e9a304b8466671945ab2a1553e-audit.json +15 -0
  14. package/lib/example/logs/app-2024-10-12.log.gz +0 -0
  15. package/lib/example/logs/app-2024-11-06.log +542 -0
  16. package/lib/example/test.d.ts +2 -0
  17. package/lib/example/test.d.ts.map +1 -0
  18. package/lib/example/test.js +88 -0
  19. package/lib/src/client/wsClient.d.ts +2 -5
  20. package/lib/src/client/wsClient.d.ts.map +1 -1
  21. package/lib/src/client/wsClient.js +4 -54
  22. package/lib/src/client/wsConnector.js +3 -3
  23. package/lib/src/client/wsResponse.d.ts +10 -15
  24. package/lib/src/client/wsResponse.d.ts.map +1 -1
  25. package/lib/src/client/wsResponse.js +31 -19
  26. package/lib/src/common/constant.d.ts +23 -1
  27. package/lib/src/common/constant.d.ts.map +1 -1
  28. package/lib/src/common/constant.js +25 -22
  29. package/lib/src/common/log.js +1 -1
  30. package/lib/src/common/taosResult.d.ts +11 -5
  31. package/lib/src/common/taosResult.d.ts.map +1 -1
  32. package/lib/src/common/taosResult.js +106 -76
  33. package/lib/src/common/utils.d.ts +2 -0
  34. package/lib/src/common/utils.d.ts.map +1 -1
  35. package/lib/src/common/utils.js +34 -1
  36. package/lib/src/sql/wsRows.d.ts.map +1 -1
  37. package/lib/src/sql/wsRows.js +21 -10
  38. package/lib/src/sql/wsSql.d.ts.map +1 -1
  39. package/lib/src/sql/wsSql.js +29 -19
  40. package/lib/src/stmt/wsParams.js +40 -40
  41. package/lib/src/tmq/constant.d.ts +15 -0
  42. package/lib/src/tmq/constant.d.ts.map +1 -1
  43. package/lib/src/tmq/constant.js +17 -1
  44. package/lib/src/tmq/tmqResponse.d.ts +20 -8
  45. package/lib/src/tmq/tmqResponse.d.ts.map +1 -1
  46. package/lib/src/tmq/tmqResponse.js +214 -89
  47. package/lib/src/tmq/wsTmq.d.ts +0 -1
  48. package/lib/src/tmq/wsTmq.d.ts.map +1 -1
  49. package/lib/src/tmq/wsTmq.js +18 -32
  50. package/lib/test/bulkPulling/log.test.d.ts +2 -0
  51. package/lib/test/bulkPulling/log.test.d.ts.map +1 -0
  52. package/lib/test/bulkPulling/log.test.js +44 -0
  53. package/lib/test/bulkPulling/schemaless.test.js +7 -6
  54. package/lib/test/bulkPulling/sql.test.js +38 -18
  55. package/lib/test/bulkPulling/stmt.func.test.js +72 -56
  56. package/lib/test/bulkPulling/stmt.type.test.js +1 -5
  57. package/lib/test/bulkPulling/tmq.test.js +22 -15
  58. package/lib/test/bulkPulling/wsConnectPool.test.js +9 -2
  59. package/lib/test/utils.d.ts +0 -1
  60. package/lib/test/utils.d.ts.map +1 -1
  61. package/lib/test/utils.js +17 -17
  62. package/package.json +2 -2
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../example/test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const config_1 = require("../src/common/config");
4
+ const wsSql_1 = require("../src/sql/wsSql");
5
+ const utils_1 = require("../test/utils");
6
+ // const DSN = 'ws://root:taosdata@127.0.0.1:6041'
7
+ let dsn = 'ws://root:taosdata@192.168.1.98:6041';
8
+ let conf = new config_1.WSConfig(dsn);
9
+ const resultMap = new Map();
10
+ resultMap.set("POINT (4.0 8.0)", (0, utils_1.hexToBytes)("010100000000000000000010400000000000002040"));
11
+ resultMap.set("POINT (3.0 5.0)", (0, utils_1.hexToBytes)("010100000000000000000008400000000000001440"));
12
+ resultMap.set("LINESTRING (1.000000 1.000000, 2.000000 2.000000, 5.000000 5.000000)", (0, utils_1.hexToBytes)("010200000003000000000000000000f03f000000000000f03f0000000000000040000000000000004000000000000014400000000000001440"));
13
+ resultMap.set("POLYGON ((3.000000 6.000000, 5.000000 6.000000, 5.000000 8.000000, 3.000000 8.000000, 3.000000 6.000000))", (0, utils_1.hexToBytes)("010300000001000000050000000000000000000840000000000000184000000000000014400000000000001840000000000000144000000000000020400000000000000840000000000000204000000000000008400000000000001840"));
14
+ resultMap.set("POINT (7.0 9.0)", (0, utils_1.hexToBytes)("01010000000000000000001c400000000000002240"));
15
+ resultMap.set("0x7661726332", (0, utils_1.hexToBytes)("307837363631373236333332"));
16
+ resultMap.set("0x7661726333", (0, utils_1.hexToBytes)("307837363631373236333333"));
17
+ resultMap.set("0x7661726334", (0, utils_1.hexToBytes)("307837363631373236333334"));
18
+ resultMap.set("0x7661726335", (0, utils_1.hexToBytes)("307837363631373236333335"));
19
+ const table = 'ws_q_n';
20
+ const stable = 'ws_q_s';
21
+ const tableCN = 'ws_q_n_cn';
22
+ const stableCN = 'ws_q_s_cn';
23
+ const db = 'ws_q_db';
24
+ const jsonTable = 'ws_q_j';
25
+ const jsonTableCN = 'ws_q_j_cn';
26
+ const createDB = `create database if not exists ${db} keep 3650`;
27
+ const dropDB = `drop database if exists ${db}`;
28
+ const useDB = `use ${db}`;
29
+ const stableTags = [true, -1, -2, -3, BigInt(-4), 1, 2, 3, BigInt(4), parseFloat(3.1415.toFixed(5)), parseFloat(3.14159265.toFixed(15)), 'varchar_tag_1', 'nchar_tag_1'];
30
+ const stableCNTags = [false, -1 * 2, -2 * 2, -3 * 2, BigInt(-4 * 2), 1 * 2, 2 * 2, 3 * 2, BigInt(4 * 2), parseFloat((3.1415 * 2).toFixed(5)), parseFloat((3.14159265 * 2).toFixed(15)), 'varchar_标签_壹', 'nchar_标签_贰'];
31
+ const tableValues = [
32
+ [BigInt(1656677710000), 0, -1, -2, BigInt(-3), 0, 1, 2, BigInt(3), parseFloat(3.1415.toFixed(5)), parseFloat(3.14159265.toFixed(15)), 'varchar_col_1', 'nchar_col_1', true, 'NULL', 'POINT (4.0 8.0)', '0x7661726332'],
33
+ [BigInt(1656677720000), -1, -2, -3, BigInt(-4), 1, 2, 3, BigInt(4), parseFloat((3.1415 * 2).toFixed(5)), parseFloat((3.14159265 * 2).toFixed(15)), 'varchar_col_2', 'nchar_col_2', false, 'NULL', 'POINT (3.0 5.0)', '0x7661726333'],
34
+ [BigInt(1656677730000), -2, -3, -4, BigInt(-5), 2, 3, 4, BigInt(5), parseFloat((3.1415 * 3).toFixed(5)), parseFloat((3.14159265 * 3).toFixed(15)), 'varchar_col_3', 'nchar_col_3', true, 'NULL', 'LINESTRING (1.000000 1.000000, 2.000000 2.000000, 5.000000 5.000000)', '0x7661726334'],
35
+ [BigInt(1656677740000), -3, -4, -5, BigInt(-6), 3, 4, 5, BigInt(6), parseFloat((3.1415 * 4).toFixed(5)), parseFloat((3.14159265 * 4).toFixed(15)), 'varchar_col_4', 'nchar_col_4', false, 'NULL', 'POLYGON ((3.000000 6.000000, 5.000000 6.000000, 5.000000 8.000000, 3.000000 8.000000, 3.000000 6.000000))', '0x7661726335'],
36
+ [BigInt(1656677750000), -4, -5, -6, BigInt(-7), 4, 5, 6, BigInt(7), parseFloat((3.1415 * 5).toFixed(5)), parseFloat((3.14159265 * 5).toFixed(15)), 'varchar_col_5', 'nchar_col_5', true, 'NULL', 'POINT (7.0 9.0)', '0x7661726335'],
37
+ ];
38
+ const tableCNValues = [
39
+ [BigInt(1656677760000), 0, -1, -2, BigInt(-3), 0, 1, 2, BigInt(3), parseFloat(3.1415.toFixed(5)), parseFloat(3.14159265.toFixed(15)), 'varchar_列_壹', 'nchar_列_甲', true, 'NULL', 'POINT (4.0 8.0)', '0x7661726332'],
40
+ [BigInt(1656677770000), -1, -2, -3, BigInt(-4), 1, 2, 3, BigInt(4), parseFloat((3.1415 * 2).toFixed(5)), parseFloat((3.14159265 * 2).toFixed(15)), 'varchar_列_贰', 'nchar_列_乙', false, 'NULL', 'POINT (3.0 5.0)', '0x7661726333'],
41
+ [BigInt(1656677780000), -2, -3, -4, BigInt(-5), 2, 3, 4, BigInt(5), parseFloat((3.1415 * 3).toFixed(5)), parseFloat((3.14159265 * 3).toFixed(15)), 'varchar_列_叁', 'nchar_列_丙', true, 'NULL', 'LINESTRING (1.000000 1.000000, 2.000000 2.000000, 5.000000 5.000000)', '0x7661726334'],
42
+ [BigInt(1656677790000), -3, -4, -5, BigInt(-6), 3, 4, 5, BigInt(6), parseFloat((3.1415 * 4).toFixed(5)), parseFloat((3.14159265 * 4).toFixed(15)), 'varchar_列_肆', 'nchar_列_丁', false, 'NULL', 'POLYGON ((3.000000 6.000000, 5.000000 6.000000, 5.000000 8.000000, 3.000000 8.000000, 3.000000 6.000000))', '0x7661726335'],
43
+ [BigInt(1656677800000), -4, -5, -6, BigInt(-7), 4, 5, 6, BigInt(7), parseFloat((3.1415 * 5).toFixed(5)), parseFloat((3.14159265 * 5).toFixed(15)), 'varchar_列_伍', 'nchar_列_戊', true, 'NULL', 'POINT (7.0 9.0)', '0x7661726335'],
44
+ ];
45
+ const jsonTags = ["{\"key1\":\"taos\",\"key2\":null,\"key3\":\"TDengine\",\"key4\":0,\"key5\":false}"];
46
+ const jsonTagsCN = ["{\"key1\":\"taosdata\",\"key2\":null,\"key3\":\"TDengine涛思数据\",\"key4\":1,\"key5\":true}"];
47
+ // const selectStable = `select * from ${stable}`
48
+ const selectStableCN = `select * from ${stableCN}`;
49
+ // const selectTable = `select * from ${table}`
50
+ // const selectTableCN = `select * from ${tableCN}`
51
+ // const selectJsonTable = `select * from ${jsonTable}`
52
+ // const selectJsonTableCN = `select * from ${jsonTableCN}`
53
+ (async () => {
54
+ let ws = await wsSql_1.WsSql.open(conf);
55
+ await ws.exec(useDB);
56
+ let insertCN = (0, utils_1.insertStable)(tableCNValues, stableCNTags, stableCN);
57
+ let insertRes = await ws.exec(insertCN);
58
+ console.log("insertRes------", insertRes);
59
+ // let queryRes = await ws.exec(selectStableCN)
60
+ // let expectMeta = tableMeta.concat(tagMeta)
61
+ // let expectData = expectStableData(tableCNValues, stableCNTags)
62
+ // let actualMeta = queryRes.getMeta()
63
+ // let actualData = queryRes.getData()
64
+ await ws.close();
65
+ // if (actualData && actualMeta) {
66
+ // actualMeta.forEach((meta, index) => {
67
+ // expect(meta.name).toBe(expectMeta[index].name)
68
+ // expect(meta.type).toBe(expectMeta[index].type)
69
+ // expect(meta.length).toBe(expectMeta[index].length)
70
+ // })
71
+ // for (let i = 0; i < actualData.length; i++) {
72
+ // actualData[i].forEach((d, index) => {
73
+ // if (expectMeta[index].name == 'geo' || expectMeta[index].name == 'vbinary') {
74
+ // let buffer:ArrayBuffer = resultMap.get(expectData[i][index])
75
+ // if (buffer) {
76
+ // let dbData :ArrayBuffer = d
77
+ // console.log(i, index, dbData, expectData[i][index], buffer, compareUint8Arrays(new Uint8Array(dbData), new Uint8Array(buffer)))
78
+ // expect(compareUint8Arrays(new Uint8Array(dbData), new Uint8Array(buffer))).toBe(true)
79
+ // }
80
+ // } else {
81
+ // expect(d).toBe(expectData[i][index])
82
+ // }
83
+ // })
84
+ // }
85
+ // } else {
86
+ // throw new Error("retrieve empty result")
87
+ // }
88
+ })();
@@ -1,5 +1,4 @@
1
- import { TaosResult } from '../common/taosResult';
2
- import { WSQueryResponse, WSFetchResponse } from './wsResponse';
1
+ import { WSQueryResponse } from './wsResponse';
3
2
  export declare class WsClient {
4
3
  private _wsConnector?;
5
4
  private _timeout?;
@@ -8,11 +7,9 @@ export declare class WsClient {
8
7
  connect(database?: string | undefined | null): Promise<void>;
9
8
  execNoResp(queryMsg: string): Promise<void>;
10
9
  exec(queryMsg: string, bSqlQuery?: boolean): Promise<any>;
11
- sendBinaryMsg(reqId: bigint, action: string, message: ArrayBuffer, bSqlQuery?: boolean): Promise<any>;
10
+ sendBinaryMsg(reqId: bigint, action: string, message: ArrayBuffer, bSqlQuery?: boolean, bResultBinary?: boolean): Promise<any>;
12
11
  getState(): number;
13
12
  ready(): Promise<void>;
14
- fetch(res: WSQueryResponse): Promise<WSFetchResponse>;
15
- fetchBlock(fetchResponse: WSFetchResponse, taosResult: TaosResult): Promise<TaosResult>;
16
13
  sendMsg(msg: string): Promise<any>;
17
14
  freeResult(res: WSQueryResponse): Promise<unknown>;
18
15
  version(): Promise<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"wsClient.d.ts","sourceRoot":"","sources":["../../../src/client/wsClient.ts"],"names":[],"mappings":"AAGA,OAAO,EAA2B,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAE3E,OAAO,EAGH,eAAe,EACf,eAAe,EAClB,MAAM,cAAc,CAAC;AAKtB,qBAAa,QAAQ;IACjB,OAAO,CAAC,YAAY,CAAC,CAAqB;IAC1C,OAAO,CAAC,QAAQ,CAAC,CAA2B;IAC5C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAK;gBAEd,GAAG,EAAE,GAAG,EAAE,OAAQ,CAAC,EAAC,MAAM,GAAG,SAAS,GAAG,IAAI;IAOnD,OAAO,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAqC5D,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAU3C,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,GAAC,OAAc,GAAG,OAAO,CAAC,GAAG,CAAC;IAuB9D,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,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EAAE,WAAW,EAAE,SAAS,GAAC,OAAc,EAAE,aAAa,GAAE,OAAe,GAAG,OAAO,CAAC,GAAG,CAAC;IA0B/I,QAAQ;IAQF,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAetB,OAAO,CAAC,GAAG,EAAC,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAajC,UAAU,CAAC,GAAG,EAAE,eAAe;IAqB/B,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;IA4B1B,KAAK,IAAG,OAAO,CAAC,IAAI,CAAC;IAS3B,QAAQ,CAAC,GAAG,EAAE,GAAG;CASpB"}
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.WsClient = void 0;
7
7
  const json_bigint_1 = __importDefault(require("json-bigint"));
8
8
  const wsConnectorPool_1 = require("./wsConnectorPool");
9
- const taosResult_1 = require("../common/taosResult");
10
9
  const wsError_1 = require("../common/wsError");
11
10
  const wsResponse_1 = require("./wsResponse");
12
11
  const reqid_1 = require("../common/reqid");
@@ -81,10 +80,13 @@ class WsClient {
81
80
  });
82
81
  }
83
82
  // need to construct Response.
84
- async sendBinaryMsg(reqId, action, message, bSqlQuery = true) {
83
+ async sendBinaryMsg(reqId, action, message, bSqlQuery = true, bResultBinary = false) {
85
84
  return new Promise((resolve, reject) => {
86
85
  if (this._wsConnector && this._wsConnector.readyState() > 0) {
87
86
  this._wsConnector.sendBinaryMsg(reqId, action, message).then((e) => {
87
+ if (bResultBinary) {
88
+ resolve(e);
89
+ }
88
90
  if (e.msg.code == 0) {
89
91
  if (bSqlQuery) {
90
92
  resolve(new wsResponse_1.WSQueryResponse(e));
@@ -123,58 +125,6 @@ class WsClient {
123
125
  throw (new wsError_1.TDWebSocketClientError(wsError_1.ErrorCode.ERR_WEBSOCKET_CONNECTION_FAIL, `connection creation failed, url: ${this._url}`));
124
126
  }
125
127
  }
126
- async fetch(res) {
127
- let fetchMsg = {
128
- action: 'fetch',
129
- args: {
130
- req_id: reqid_1.ReqId.getReqID(),
131
- id: res.id,
132
- },
133
- };
134
- return new Promise((resolve, reject) => {
135
- let jsonStr = json_bigint_1.default.stringify(fetchMsg);
136
- log_1.default.debug('[wsQueryInterface.fetch.fetchMsg]===>' + jsonStr);
137
- if (this._wsConnector && this._wsConnector.readyState() > 0) {
138
- this._wsConnector.sendMsg(jsonStr).then((e) => {
139
- if (e.msg.code == 0) {
140
- resolve(new wsResponse_1.WSFetchResponse(e));
141
- }
142
- else {
143
- reject(new wsError_1.WebSocketInterfaceError(e.msg.code, e.msg.message));
144
- }
145
- }).catch((e) => { reject(e); });
146
- }
147
- else {
148
- reject(new wsError_1.TDWebSocketClientError(wsError_1.ErrorCode.ERR_CONNECTION_CLOSED, "invalid websocket connect"));
149
- }
150
- });
151
- }
152
- async fetchBlock(fetchResponse, taosResult) {
153
- let fetchBlockMsg = {
154
- action: 'fetch_block',
155
- args: {
156
- req_id: reqid_1.ReqId.getReqID(),
157
- id: fetchResponse.id,
158
- },
159
- };
160
- return new Promise((resolve, reject) => {
161
- let jsonStr = json_bigint_1.default.stringify(fetchBlockMsg);
162
- log_1.default.debug("[wsQueryInterface.fetchBlock.fetchBlockMsg]===>" + jsonStr);
163
- if (this._wsConnector && this._wsConnector.readyState() > 0) {
164
- this._wsConnector.sendMsg(jsonStr).then((e) => {
165
- let resp = e;
166
- taosResult.addTotalTime(resp.totalTime);
167
- // if retrieve JSON then reject with message
168
- // else is binary , so parse raw block to TaosResult
169
- (0, taosResult_1.parseBlock)(fetchResponse.rows, new wsResponse_1.WSFetchBlockResponse(resp.msg), taosResult);
170
- resolve(taosResult);
171
- }).catch((e) => reject(e));
172
- }
173
- else {
174
- reject(new wsError_1.TDWebSocketClientError(wsError_1.ErrorCode.ERR_CONNECTION_CLOSED, "invalid websocket connect"));
175
- }
176
- });
177
- }
178
128
  async sendMsg(msg) {
179
129
  return new Promise((resolve, reject) => {
180
130
  log_1.default.debug("[wsQueryInterface.sendMsg]===>" + msg);
@@ -22,7 +22,7 @@ class WebSocketConnector {
22
22
  if (timeout) {
23
23
  this._timeout = timeout;
24
24
  }
25
- this._wsConn = new websocket_1.w3cwebsocket(origin.concat(pathname).concat(search));
25
+ this._wsConn = new websocket_1.w3cwebsocket(origin.concat(pathname).concat(search), undefined, undefined, undefined, undefined, { maxReceivedFrameSize: 0x60000000, maxReceivedMessageSize: 0x60000000 });
26
26
  this._wsConn.onerror = function (err) { log_1.default.error(err.message); throw err; };
27
27
  this._wsConn.onclose = this._onclose;
28
28
  this._wsConn.onmessage = this._onmessage;
@@ -50,7 +50,7 @@ class WebSocketConnector {
50
50
  let data = event.data;
51
51
  log_1.default.debug("wsClient._onMessage()====" + (Object.prototype.toString.call(data)));
52
52
  if (Object.prototype.toString.call(data) === '[object ArrayBuffer]') {
53
- let id = new DataView(data, 8, 8).getBigUint64(0, true);
53
+ let id = new DataView(data, 26, 8).getBigUint64(0, true);
54
54
  wsEventCallback_1.WsEventCallback.instance().handleEventCallback({ id: id, action: '', req_id: BigInt(0) }, wsEventCallback_1.OnMessageType.MESSAGE_TYPE_ARRAYBUFFER, data);
55
55
  }
56
56
  else if (Object.prototype.toString.call(data) === '[object Blob]') {
@@ -122,7 +122,7 @@ class WebSocketConnector {
122
122
  wsEventCallback_1.WsEventCallback.instance().registerCallback({ action: action, req_id: reqId,
123
123
  timeout: this._timeout, id: reqId }, resolve, reject);
124
124
  }
125
- log_1.default.debug("[wsClient.sendBinaryMsg()]===>" + reqId, action, message.byteLength);
125
+ log_1.default.debug("[wsClient.sendBinaryMsg()]===>" + reqId + action + message.byteLength);
126
126
  this._wsConn.send(message);
127
127
  }
128
128
  else {
@@ -28,23 +28,18 @@ export declare class WSQueryResponse {
28
28
  constructor(resp: MessageResp);
29
29
  private initMsg;
30
30
  }
31
- export declare class WSFetchResponse {
32
- code: number;
33
- message: string;
34
- action: string;
35
- req_id: number;
36
- timing: bigint;
37
- id: bigint;
38
- completed: boolean;
39
- length: Array<number>;
40
- rows: number;
41
- totalTime: number;
42
- constructor(resp: MessageResp);
43
- }
44
31
  export declare class WSFetchBlockResponse {
45
- id: bigint;
46
- data: ArrayBuffer;
32
+ data: DataView | undefined;
33
+ action: bigint;
47
34
  timing: bigint;
35
+ reqId: bigint;
36
+ code: number;
37
+ blockLen: number;
38
+ message: string | undefined;
39
+ resultId: bigint | undefined;
40
+ finished: number | undefined;
41
+ metaType: number | undefined;
42
+ textDecoder: TextDecoder;
48
43
  constructor(msg: ArrayBuffer);
49
44
  }
50
45
  interface IWSConnResponse {
@@ -1 +1 @@
1
- {"version":3,"file":"wsResponse.d.ts","sourceRoot":"","sources":["../../../src/client/wsResponse.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,qBAAa,iBAAiB;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;gBACN,IAAI,EAAC,WAAW;CAO/B;AAED,qBAAa,eAAe;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IACpC,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IACpC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AAA;IAC5B,WAAW,EAAE,WAAW,CAAA;gBACZ,GAAG,EAAE,WAAW;CAgC/B;AAED,UAAU,eAAe;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,cAAc;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;gBAEH,GAAG,EAAE,eAAe;CAOnC"}
@@ -3,7 +3,8 @@
3
3
  * define ws Response type|class, for query?
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.WSConnResponse = exports.WSFetchBlockResponse = exports.WSFetchResponse = exports.WSQueryResponse = exports.WSVersionResponse = void 0;
6
+ exports.WSConnResponse = exports.WSFetchBlockResponse = exports.WSQueryResponse = exports.WSVersionResponse = void 0;
7
+ const taosResult_1 = require("../common/taosResult");
7
8
  class WSVersionResponse {
8
9
  constructor(resp) {
9
10
  this.version = resp.msg.version;
@@ -41,26 +42,37 @@ class WSQueryResponse {
41
42
  }
42
43
  }
43
44
  exports.WSQueryResponse = WSQueryResponse;
44
- class WSFetchResponse {
45
- constructor(resp) {
46
- this.totalTime = resp.totalTime;
47
- this.code = resp.msg.code;
48
- this.message = resp.msg.message;
49
- this.action = resp.msg.action;
50
- this.req_id = resp.msg.req_id;
51
- this.timing = BigInt(resp.msg.timing);
52
- this.id = BigInt(resp.msg.id);
53
- this.completed = resp.msg.completed;
54
- this.length = resp.msg.length;
55
- this.rows = resp.msg.rows;
56
- }
57
- }
58
- exports.WSFetchResponse = WSFetchResponse;
59
45
  class WSFetchBlockResponse {
60
46
  constructor(msg) {
61
- this.timing = new DataView(msg, 0, 8).getBigUint64(0, true);
62
- this.id = new DataView(msg, 8, 8).getBigUint64(0, true);
63
- this.data = msg.slice(16);
47
+ let dataView = new DataView(msg);
48
+ this.action = dataView.getBigUint64(8, true);
49
+ this.timing = dataView.getBigUint64(18, true);
50
+ this.reqId = dataView.getBigUint64(26, true);
51
+ this.code = dataView.getUint32(34, true);
52
+ this.textDecoder = new TextDecoder();
53
+ this.blockLen = 0;
54
+ if (this.code != 0) {
55
+ let len = dataView.getUint32(38, true);
56
+ this.message = (0, taosResult_1.readVarchar)(msg, 42, len, this.textDecoder);
57
+ return;
58
+ }
59
+ this.resultId = dataView.getBigUint64(42, true);
60
+ let offset = 50;
61
+ if (this.action == BigInt(8)) {
62
+ this.metaType = dataView.getUint16(50, true);
63
+ offset += 2;
64
+ }
65
+ else {
66
+ this.finished = dataView.getUint8(50);
67
+ if (this.finished == 1) {
68
+ return;
69
+ }
70
+ offset += 1;
71
+ }
72
+ this.blockLen = dataView.getUint32(offset, true);
73
+ if (this.blockLen > 0) {
74
+ this.data = new DataView(msg, offset + 4);
75
+ }
64
76
  }
65
77
  }
66
78
  exports.WSFetchBlockResponse = WSFetchBlockResponse;
@@ -4,9 +4,31 @@ export interface IndexableString {
4
4
  export interface StringIndexable {
5
5
  [index: string]: number;
6
6
  }
7
+ export declare const BinaryQueryMessage: bigint;
8
+ export declare const FetchRawBlockMessage: bigint;
7
9
  export declare const TDengineTypeName: IndexableString;
8
10
  export declare const ColumnsBlockType: StringIndexable;
9
- export declare const TDengineTypeCode: StringIndexable;
11
+ export declare enum TDengineTypeCode {
12
+ NULL = 0,
13
+ BOOL = 1,
14
+ TINYINT = 2,
15
+ SMALLINT = 3,
16
+ INT = 4,
17
+ BIGINT = 5,
18
+ FLOAT = 6,
19
+ DOUBLE = 7,
20
+ BINARY = 8,
21
+ VARCHAR = 8,
22
+ TIMESTAMP = 9,
23
+ NCHAR = 10,
24
+ TINYINT_UNSIGNED = 11,
25
+ SMALLINT_UNSIGNED = 12,
26
+ INT_UNSIGNED = 13,
27
+ BIGINT_UNSIGNED = 14,
28
+ JSON = 15,
29
+ VARBINARY = 16,
30
+ GEOMETRY = 20
31
+ }
10
32
  export declare const TDenginePrecision: IndexableString;
11
33
  export declare const TDengineTypeLength: StringIndexable;
12
34
  export declare const PrecisionLength: StringIndexable;
@@ -1 +1 @@
1
- {"version":3,"file":"constant.d.ts","sourceRoot":"","sources":["../../../src/common/constant.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC5B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAC1B;AAED,MAAM,WAAW,eAAe;IAC5B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAC1B;AAED,eAAO,MAAM,gBAAgB,EAAE,eAmB9B,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,eAM9B,CAAA;AAGD,eAAO,MAAM,gBAAgB,EAAE,eAoB9B,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,eAI/B,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,eAahC,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,eAI7B,CAAA"}
1
+ {"version":3,"file":"constant.d.ts","sourceRoot":"","sources":["../../../src/common/constant.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC5B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAC1B;AAED,MAAM,WAAW,eAAe;IAC5B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAC1B;AAED,eAAO,MAAM,kBAAkB,EAAE,MAAkB,CAAC;AACpD,eAAO,MAAM,oBAAoB,EAAE,MAAkB,CAAC;AAEtD,eAAO,MAAM,gBAAgB,EAAE,eAmB9B,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,eAM9B,CAAA;AAGD,oBAAY,gBAAgB;IACxB,IAAI,IAAI;IACR,IAAI,IAAI;IACR,OAAO,IAAI;IACX,QAAQ,IAAI;IACZ,GAAG,IAAI;IACP,MAAM,IAAI;IACV,KAAK,IAAI;IACT,MAAM,IAAI;IACV,MAAM,IAAI;IACV,OAAO,IAAI;IACX,SAAS,IAAI;IACb,KAAK,KAAK;IACV,gBAAgB,KAAK;IACrB,iBAAiB,KAAK;IACtB,YAAY,KAAK;IACjB,eAAe,KAAK;IACpB,IAAI,KAAK;IACT,SAAS,KAAK;IACd,QAAQ,KAAK;CAChB;AAED,eAAO,MAAM,iBAAiB,EAAE,eAI/B,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,eAahC,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,eAI7B,CAAA"}
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PrecisionLength = exports.TDengineTypeLength = exports.TDenginePrecision = exports.TDengineTypeCode = exports.ColumnsBlockType = exports.TDengineTypeName = void 0;
3
+ exports.PrecisionLength = exports.TDengineTypeLength = exports.TDenginePrecision = exports.TDengineTypeCode = exports.ColumnsBlockType = exports.TDengineTypeName = exports.FetchRawBlockMessage = exports.BinaryQueryMessage = void 0;
4
+ exports.BinaryQueryMessage = BigInt(6);
5
+ exports.FetchRawBlockMessage = BigInt(7);
4
6
  exports.TDengineTypeName = {
5
7
  0: 'NULL',
6
8
  1: 'BOOL',
@@ -28,27 +30,28 @@ exports.ColumnsBlockType = {
28
30
  'GEOMETRY': 3,
29
31
  'VARBINARY': 4,
30
32
  };
31
- exports.TDengineTypeCode = {
32
- 'NULL': 0,
33
- 'BOOL': 1,
34
- 'TINYINT': 2,
35
- 'SMALLINT': 3,
36
- 'INT': 4,
37
- 'BIGINT': 5,
38
- 'FLOAT': 6,
39
- 'DOUBLE': 7,
40
- 'BINARY': 8,
41
- 'VARCHAR': 8,
42
- 'TIMESTAMP': 9,
43
- 'NCHAR': 10,
44
- 'TINYINT UNSIGNED': 11,
45
- 'SMALLINT UNSIGNED': 12,
46
- 'INT UNSIGNED': 13,
47
- 'BIGINT UNSIGNED': 14,
48
- 'JSON': 15,
49
- 'VARBINARY': 16,
50
- 'GEOMETRY': 20,
51
- };
33
+ var TDengineTypeCode;
34
+ (function (TDengineTypeCode) {
35
+ TDengineTypeCode[TDengineTypeCode["NULL"] = 0] = "NULL";
36
+ TDengineTypeCode[TDengineTypeCode["BOOL"] = 1] = "BOOL";
37
+ TDengineTypeCode[TDengineTypeCode["TINYINT"] = 2] = "TINYINT";
38
+ TDengineTypeCode[TDengineTypeCode["SMALLINT"] = 3] = "SMALLINT";
39
+ TDengineTypeCode[TDengineTypeCode["INT"] = 4] = "INT";
40
+ TDengineTypeCode[TDengineTypeCode["BIGINT"] = 5] = "BIGINT";
41
+ TDengineTypeCode[TDengineTypeCode["FLOAT"] = 6] = "FLOAT";
42
+ TDengineTypeCode[TDengineTypeCode["DOUBLE"] = 7] = "DOUBLE";
43
+ TDengineTypeCode[TDengineTypeCode["BINARY"] = 8] = "BINARY";
44
+ TDengineTypeCode[TDengineTypeCode["VARCHAR"] = 8] = "VARCHAR";
45
+ TDengineTypeCode[TDengineTypeCode["TIMESTAMP"] = 9] = "TIMESTAMP";
46
+ TDengineTypeCode[TDengineTypeCode["NCHAR"] = 10] = "NCHAR";
47
+ TDengineTypeCode[TDengineTypeCode["TINYINT_UNSIGNED"] = 11] = "TINYINT_UNSIGNED";
48
+ TDengineTypeCode[TDengineTypeCode["SMALLINT_UNSIGNED"] = 12] = "SMALLINT_UNSIGNED";
49
+ TDengineTypeCode[TDengineTypeCode["INT_UNSIGNED"] = 13] = "INT_UNSIGNED";
50
+ TDengineTypeCode[TDengineTypeCode["BIGINT_UNSIGNED"] = 14] = "BIGINT_UNSIGNED";
51
+ TDengineTypeCode[TDengineTypeCode["JSON"] = 15] = "JSON";
52
+ TDengineTypeCode[TDengineTypeCode["VARBINARY"] = 16] = "VARBINARY";
53
+ TDengineTypeCode[TDengineTypeCode["GEOMETRY"] = 20] = "GEOMETRY";
54
+ })(TDengineTypeCode || (exports.TDengineTypeCode = TDengineTypeCode = {}));
52
55
  exports.TDenginePrecision = {
53
56
  0: 'MILLISECOND',
54
57
  1: "MICROSECOND",
@@ -19,7 +19,7 @@ const transport = new winston_daily_rotate_file_1.default({
19
19
  maxFiles: '14d', // Keep log files for 14 days
20
20
  handleExceptions: true, // Whether to handle exceptions
21
21
  json: false, // Whether to output logs in JSON format
22
- format: winston_1.default.format.combine(winston_1.default.format.timestamp(), customFormat),
22
+ format: winston_1.default.format.combine(winston_1.default.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }), customFormat),
23
23
  level: 'info', // set log level
24
24
  });
25
25
  const logger = winston_1.default.createLogger({
@@ -14,6 +14,7 @@ export interface MessageResp {
14
14
  msg: any;
15
15
  }
16
16
  export declare class TaosResult {
17
+ private _topic?;
17
18
  private _meta;
18
19
  private _data;
19
20
  private _precision;
@@ -22,8 +23,12 @@ export declare class TaosResult {
22
23
  /** unit nano seconds */
23
24
  private _timing;
24
25
  constructor(queryResponse?: WSQueryResponse);
26
+ setPrecision(precision: number): void;
25
27
  setRowsAndTime(rows: number, timing?: bigint): void;
28
+ getTopic(): string;
29
+ setTopic(topic?: string): void;
26
30
  getMeta(): Array<TDengineMeta> | null;
31
+ setMeta(metaData: ResponseMeta): void;
27
32
  getData(): Array<Array<any>> | null;
28
33
  setData(value: Array<Array<any>> | null): void;
29
34
  getAffectRows(): number | null | undefined;
@@ -37,13 +42,14 @@ export declare class TaosResult {
37
42
  */
38
43
  private getTDengineMeta;
39
44
  }
40
- export declare function parseBlock(rows: number, blocks: WSFetchBlockResponse, taosResult: TaosResult): TaosResult;
41
- export declare function _isVarType(meta: ResponseMeta): Number;
42
- export declare function readSolidDataToArray(buffer: ArrayBuffer, colBlockHead: number, rows: number, meta: ResponseMeta, bitMapArr: ArrayBuffer): any[];
43
- export declare function readSolidData(dataBuffer: ArrayBuffer, colDataHead: number, meta: ResponseMeta): Number | Boolean | BigInt;
45
+ export declare function parseBlock(blocks: WSFetchBlockResponse, taosResult: TaosResult): TaosResult;
46
+ export declare function _isVarType(metaType: number): Number;
47
+ export declare function readSolidDataToArray(dataBuffer: DataView, colBlockHead: number, rows: number, metaType: number, bitMapArr: Uint8Array): any[];
48
+ export declare function readSolidData(dataBuffer: DataView, colDataHead: number, meta: ResponseMeta): Number | Boolean | BigInt;
44
49
  export declare function readBinary(dataBuffer: ArrayBuffer, colDataHead: number, length: number): ArrayBuffer;
45
- export declare function readVarchar(dataBuffer: ArrayBuffer, colDataHead: number, length: number): string;
50
+ export declare function readVarchar(dataBuffer: ArrayBuffer, colDataHead: number, length: number, textDecoder: TextDecoder): string;
46
51
  export declare function readNchar(dataBuffer: ArrayBuffer, colDataHead: number, length: number): string;
52
+ export declare function getString(dataBuffer: DataView, colDataHead: number, length: number, textDecoder: TextDecoder): string;
47
53
  export declare function getCharOffset(n: number): number;
48
54
  export declare function setBitmapNull(c: number, n: number): number;
49
55
  export declare function bitmapLen(n: number): number;
@@ -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;AAM7E,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,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,w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