@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 +4 -4
- package/dist/browser/index.js +12 -12
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.umd.cjs +2 -2
- package/dist/browser/index.umd.cjs.map +1 -1
- package/dist/node/index.cjs +2 -2
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +12 -12
- package/dist/node/index.js.map +1 -1
- package/package.json +23 -23
- package/src/ecl/sql2.ts +11 -11
- package/src/services/wsSQL2.ts +1 -1
- package/src/services/wsdl/WsSQL2/current/WsSQL2.ts +15 -14
- package/src/services/wsdl/WsSQL2/v1.01/WsSQL2.ts +223 -0
- package/types/ecl/sql2.d.ts +1 -1
- package/types/services/wsSQL2.d.ts +1 -1
- package/types/services/wsdl/WsSQL2/{v1.00 → v1.01}/WsSQL2.d.ts +13 -12
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`, `
|
|
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
|
-
|
|
13
|
+
SQLText: "SELECT 1", IncludeResultSetMetadata: true
|
|
14
14
|
});
|
|
15
15
|
try {
|
|
16
|
-
const {
|
|
17
|
-
console.log(ResultSetMetadata,
|
|
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
|
}
|
package/dist/browser/index.js
CHANGED
|
@@ -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.
|
|
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.
|
|
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
|
-
|
|
2184
|
-
return this._connection.send("
|
|
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.
|
|
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.
|
|
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({
|
|
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.
|
|
5855
|
-
return checkExceptions(t), t.
|
|
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({
|
|
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
|
-
|
|
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
|
-
|
|
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);
|