@hpcc-js/comms 3.23.0 → 3.23.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/README.md CHANGED
@@ -3,18 +3,18 @@ This package is part of the mono repository "@hpcc-js" (aka Visualization Framew
3
3
 
4
4
  ## WsSQL2
5
5
 
6
- `SQL2Service` exposes the WsSQL2 operations (`ExecuteQuery`, `ExplainQuery`, `FetchResultSet`, `CloseResultSet`, `LogicalFileMeta`, `SplitQuery`, and `Ping`) with request and response types in `WsSQL2`.
6
+ `SQL2Service` exposes the WsSQL2 operations (`ExecuteQuery`, `ExplainQuery`, `FetchResultSet`, `CloseResultSet`, `LogicalFileMetadata`, `SplitQuery`, and `Ping`) with request and response types in `WsSQL2`.
7
7
 
8
8
  ```ts
9
9
  import { SQL2Service } from "@hpcc-js/comms";
10
10
 
11
11
  const sql = new SQL2Service({ baseUrl: "http://localhost:8510" });
12
12
  const { CursorId, ResultSetMetadata } = await sql.ExecuteQuery({
13
- SqlText: "SELECT 1", IncludeResultSetMetadata: true
13
+ SQLText: "SELECT 1", IncludeResultSetMetadata: true
14
14
  });
15
15
  try {
16
- const { Rows, Complete } = await sql.FetchResultSet({ CursorId, FetchSize: 100 });
17
- console.log(ResultSetMetadata, Rows, Complete);
16
+ const { RowsJSON, Complete } = await sql.FetchResultSet({ CursorId, RowCount: 100 });
17
+ console.log(ResultSetMetadata, RowsJSON, Complete);
18
18
  } finally {
19
19
  await sql.CloseResultSet({ CursorId });
20
20
  }
@@ -3,7 +3,7 @@ import { Cache as e, Dispatch as t, Edge as n, Graph as r, Message as i, SAXStac
3
3
  var x = Object.defineProperty, __name = (e, t) => x(e, "name", {
4
4
  value: t,
5
5
  configurable: !0
6
- }), te = "@hpcc-js/comms", S = "3.23.0", C = "3.38.0", w = y("comms/connection.ts");
6
+ }), te = "@hpcc-js/comms", S = "3.23.1", C = "3.38.2", w = y("comms/connection.ts");
7
7
  function instanceOfIOptions(e) {
8
8
  return "baseUrl" in e;
9
9
  }
@@ -2166,7 +2166,7 @@ var SMCService = class extends SMCServiceBase {
2166
2166
  }
2167
2167
  }, SQL2ServiceBase = class extends Service {
2168
2168
  constructor(e) {
2169
- super(e, "WsSQL2", "1.00");
2169
+ super(e, "WsSQL2", "1.01");
2170
2170
  }
2171
2171
  CloseResultSet(e, t) {
2172
2172
  return this._connection.send("CloseResultSet", e, "json", !1, t, "CloseResultSetResponse");
@@ -2180,8 +2180,8 @@ var SMCService = class extends SMCServiceBase {
2180
2180
  FetchResultSet(e, t) {
2181
2181
  return this._connection.send("FetchResultSet", e, "json", !1, t, "FetchResultSetResponse");
2182
2182
  }
2183
- LogicalFileMeta(e, t) {
2184
- return this._connection.send("LogicalFileMeta", e, "json", !1, t, "LogicalFileMetaResponse");
2183
+ LogicalFileMetadata(e, t) {
2184
+ return this._connection.send("LogicalFileMetadata", e, "json", !1, t, "LogicalFileMetadataResponse");
2185
2185
  }
2186
2186
  Ping(e, t) {
2187
2187
  return this._connection.send("Ping", e, "json", !1, t, "WsSQL2PingResponse");
@@ -5804,10 +5804,10 @@ function checkExceptions(e) {
5804
5804
  if (e.Exceptions) throw Error(e.Exceptions.Exception?.map((e) => e.Message ?? e.Code).join("; ") || "WsSQL2 request failed");
5805
5805
  }
5806
5806
  function rowsFrom(e) {
5807
- if (typeof e.Rows != "string") throw Error("WsSQL2 response is missing Rows");
5807
+ if (typeof e.RowsJSON != "string") throw Error("WsSQL2 response is missing RowsJSON");
5808
5808
  let t;
5809
5809
  try {
5810
- t = JSON.parse(e.Rows);
5810
+ t = JSON.parse(e.RowsJSON);
5811
5811
  } catch (e) {
5812
5812
  let t = e instanceof Error ? e.message : String(e);
5813
5813
  throw Object.assign(/* @__PURE__ */ Error(`Error parsing WsSQL2 Rows JSON '${t}'`), { cause: e });
@@ -5846,20 +5846,20 @@ var SQLConnection = class {
5846
5846
  }
5847
5847
  async explainQuery(e) {
5848
5848
  if (this.checkOpen(), !e.trim()) throw Error("SQL text is required");
5849
- let t = await this.service.ExplainQuery({ SqlText: e });
5849
+ let t = await this.service.ExplainQuery({ SQLText: e });
5850
5850
  return checkExceptions(t), t;
5851
5851
  }
5852
5852
  async logicalFileMeta(e) {
5853
5853
  if (this.checkOpen(), !e.trim()) throw Error("Logical file name is required");
5854
- let t = await this.service.LogicalFileMeta({ LogicalName: e });
5855
- return checkExceptions(t), t.LogicalFileMeta;
5854
+ let t = await this.service.LogicalFileMetadata({ LogicalName: e });
5855
+ return checkExceptions(t), t.LogicalFileMetadata;
5856
5856
  }
5857
5857
  async ping() {
5858
5858
  return this.checkOpen(), await this.service.Ping({}), !0;
5859
5859
  }
5860
5860
  async splitQuery(e) {
5861
5861
  if (this.checkOpen(), !e.trim()) return [];
5862
- let t = await this.service.SplitQuery({ SqlText: e });
5862
+ let t = await this.service.SplitQuery({ SQLText: e });
5863
5863
  checkExceptions(t);
5864
5864
  let n = t.Statements?.Statement ?? [];
5865
5865
  if (!Array.isArray(n) || !n.every((e) => typeof e == "string")) throw Error("WsSQL2 response has invalid Statements");
@@ -5916,7 +5916,7 @@ var SQLConnection = class {
5916
5916
  async runQuery(e) {
5917
5917
  if (await this.result?.close(), this.result = void 0, this.closed) throw Error("SQL statement is closed");
5918
5918
  let t = await this.service.ExecuteQuery({
5919
- SqlText: e,
5919
+ SQLText: e,
5920
5920
  IncludeResultSetMetadata: !0
5921
5921
  }), n = t.ResultSetMetadata?.Column, r = t.CursorId ? new SQLResultSet(this.service, n ?? [], t.CursorId, this.fetchSize) : void 0;
5922
5922
  this.result = r;
@@ -5997,7 +5997,7 @@ var SQLConnection = class {
5997
5997
  if (this.checkOpen(), this.complete) return !1;
5998
5998
  let e = await this.service.FetchResultSet({
5999
5999
  CursorId: this.cursor,
6000
- FetchSize: this.fetchSize
6000
+ RowCount: this.fetchSize
6001
6001
  });
6002
6002
  if (checkExceptions(e), typeof e.Complete != "boolean") throw Error("WsSQL2 fetch response is missing Complete");
6003
6003
  let t = rowsFrom(e);