@hpcc-js/comms 3.14.4 → 3.15.0
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/LICENSE +43 -43
- package/README.md +50 -50
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.umd.cjs +1 -1
- package/dist/browser/index.umd.cjs.map +1 -1
- package/dist/node/index.cjs +8 -8
- package/dist/node/index.cjs.map +3 -3
- package/dist/node/index.js +7 -7
- package/dist/node/index.js.map +3 -3
- package/package.json +6 -6
- package/src/__package__.ts +3 -3
- package/src/clienttools/eclMeta.ts +506 -506
- package/src/clienttools/eclcc.ts +628 -628
- package/src/connection.ts +288 -288
- package/src/ecl/activity.ts +82 -82
- package/src/ecl/dfuWorkunit.ts +363 -363
- package/src/ecl/graph.ts +196 -196
- package/src/ecl/logicalFile.ts +196 -196
- package/src/ecl/machine.ts +63 -63
- package/src/ecl/query.ts +265 -265
- package/src/ecl/queryGraph.ts +813 -813
- package/src/ecl/resource.ts +39 -39
- package/src/ecl/result.ts +245 -245
- package/src/ecl/scope.ts +188 -188
- package/src/ecl/sourceFile.ts +34 -34
- package/src/ecl/store.ts +154 -154
- package/src/ecl/targetCluster.ts +149 -149
- package/src/ecl/timer.ts +42 -42
- package/src/ecl/topology.ts +131 -131
- package/src/ecl/workunit.ts +1340 -1340
- package/src/ecl/xsdParser.ts +267 -267
- package/src/espConnection.ts +164 -164
- package/src/index.browser.ts +1 -1
- package/src/index.common.ts +40 -40
- package/src/index.node.ts +48 -48
- package/src/pem/trustwave.ts +909 -909
- package/src/services/fileSpray.ts +73 -48
- package/src/services/wsAccess.ts +8 -8
- package/src/services/wsAccount.ts +27 -27
- package/src/services/wsCloud.ts +73 -73
- package/src/services/wsCodesign.ts +18 -18
- package/src/services/wsDFU.ts +34 -34
- package/src/services/wsDFUXRef.ts +121 -121
- package/src/services/wsDali.ts +8 -8
- package/src/services/wsEcl.ts +123 -123
- package/src/services/wsElk.ts +8 -8
- package/src/services/wsLogaccess.ts +267 -267
- package/src/services/wsMachine.ts +89 -89
- package/src/services/wsPackageProcess.ts +8 -8
- package/src/services/wsResources.ts +8 -8
- package/src/services/wsSMC.ts +80 -80
- package/src/services/wsSasha.ts +7 -7
- package/src/services/wsStore.ts +32 -32
- package/src/services/wsTopology.ts +45 -45
- package/src/services/wsWorkunits.ts +151 -151
- package/src/services/wsdl/FileSpray/v1.23/FileSpray.ts +1008 -1008
- package/src/services/wsdl/FileSpray/v1.25/FileSpray.ts +1040 -1040
- package/src/services/wsdl/FileSpray/v1.26/FileSpray.ts +929 -929
- package/src/services/wsdl/FileSpray/v1.27/FileSpray.ts +930 -930
- package/src/services/wsdl/WsCloud/v1/WsCloud.ts +38 -38
- package/src/services/wsdl/WsCloud/v1.02/WsCloud.ts +77 -77
- package/src/services/wsdl/WsDFUXRef/v1.02/WsDFUXRef.ts +224 -224
- package/src/services/wsdl/WsDFUXRef/v1.04/WsDFUXRef.ts +227 -227
- package/src/services/wsdl/WsDali/v1.04/WsDali.ts +216 -216
- package/src/services/wsdl/WsDfu/v1.62/WsDfu.ts +1455 -1455
- package/src/services/wsdl/WsDfu/v1.63/WsDfu.ts +1465 -1465
- package/src/services/wsdl/WsDfu/v1.65/WsDfu.ts +1244 -1244
- package/src/services/wsdl/WsDfu/v1.66/WsDfu.ts +1267 -1267
- package/src/services/wsdl/WsDfu/v1.67/WsDfu.ts +1268 -1268
- package/src/services/wsdl/WsFileIO/v1.01/WsFileIO.ts +104 -104
- package/src/services/wsdl/WsPackageProcess/v1.04/WsPackageProcess.ts +519 -519
- package/src/services/wsdl/WsPackageProcess/v1.07/WsPackageProcess.ts +500 -500
- package/src/services/wsdl/WsResources/v1.01/WsResources.ts +119 -119
- package/src/services/wsdl/WsSMC/v1.24/WsSMC.ts +665 -665
- package/src/services/wsdl/WsSMC/v1.27/WsSMC.ts +591 -591
- package/src/services/wsdl/WsSMC/v1.28/WsSMC.ts +645 -645
- package/src/services/wsdl/WsSMC/v1.29/WsSMC.ts +660 -660
- package/src/services/wsdl/WsTopology/v1.31/WsTopology.ts +856 -856
- package/src/services/wsdl/WsTopology/v1.32/WsTopology.ts +786 -786
- package/src/services/wsdl/WsTopology/v1.33/WsTopology.ts +835 -835
- package/src/services/wsdl/WsWorkunits/v1.88/WsWorkunits.ts +2944 -2944
- package/src/services/wsdl/WsWorkunits/v1.94/WsWorkunits.ts +3072 -3072
- package/src/services/wsdl/WsWorkunits/v1.95/WsWorkunits.ts +3073 -3073
- package/src/services/wsdl/WsWorkunits/v1.97/WsWorkunits.ts +3134 -3134
- package/src/services/wsdl/WsWorkunits/v1.98/WsWorkunits.ts +3182 -3182
- package/src/services/wsdl/WsWorkunits/v1.99/WsWorkunits.ts +3162 -3162
- package/src/services/wsdl/WsWorkunits/v2/WsWorkunits.ts +3153 -3153
- package/src/services/wsdl/WsWorkunits/v2.02/WsWorkunits.ts +3162 -3162
- package/src/services/wsdl/WsWorkunits/v2.03/WsWorkunits.ts +3164 -3164
- package/src/services/wsdl/WsWorkunits/v2.04/WsWorkunits.ts +3171 -3171
- package/src/services/wsdl/ws_access/v1.16/ws_access.ts +1086 -1086
- package/src/services/wsdl/ws_access/v1.17/ws_access.ts +1023 -1023
- package/src/services/wsdl/ws_account/v1.05/ws_account.ts +111 -111
- package/src/services/wsdl/ws_account/v1.06/ws_account.ts +109 -109
- package/src/services/wsdl/ws_account/v1.07/ws_account.ts +114 -114
- package/src/services/wsdl/ws_codesign/v1.1/ws_codesign.ts +95 -95
- package/src/services/wsdl/ws_elk/v1/ws_elk.ts +47 -47
- package/src/services/wsdl/ws_logaccess/v1/ws_logaccess.ts +83 -83
- package/src/services/wsdl/ws_logaccess/v1.02/ws_logaccess.ts +161 -161
- package/src/services/wsdl/ws_logaccess/v1.03/ws_logaccess.ts +190 -190
- package/src/services/wsdl/ws_logaccess/v1.04/ws_logaccess.ts +215 -215
- package/src/services/wsdl/ws_logaccess/v1.05/ws_logaccess.ts +219 -219
- package/src/services/wsdl/ws_logaccess/v1.08/ws_logaccess.ts +267 -267
- package/src/services/wsdl/ws_machine/v1.17/ws_machine.ts +567 -567
- package/src/services/wsdl/ws_machine/v1.18/ws_machine.ts +497 -497
- package/src/services/wsdl/ws_machine/v1.19/ws_machine.ts +497 -497
- package/src/services/wsdl/wsstore/v1.02/wsstore.ts +239 -239
- package/types/services/fileSpray.d.ts +13 -0
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
import { DFUXRefServiceBase, type WsDFUXRef } from "./wsdl/WsDFUXRef/v1.04/WsDFUXRef.ts";
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
type WsDFUXRef
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
export namespace WsDFUXRefEx {
|
|
8
|
-
|
|
9
|
-
export interface Request {
|
|
10
|
-
DFUXRefArrayActionRequest: WsDFUXRef.DFUXRefArrayActionRequest;
|
|
11
|
-
DFUXRefBuildRequest: WsDFUXRef.DFUXRefBuildRequest;
|
|
12
|
-
DFUXRefBuildCancelRequest: WsDFUXRef.DFUXRefBuildCancelRequest;
|
|
13
|
-
DFUXRefCleanDirectoriesRequest: WsDFUXRef.DFUXRefCleanDirectoriesRequest;
|
|
14
|
-
DFUXRefDirectoriesQueryRequest: WsDFUXRef.DFUXRefDirectoriesQueryRequest;
|
|
15
|
-
DFUXRefFoundFilesQueryRequest: WsDFUXRef.DFUXRefFoundFilesQueryRequest;
|
|
16
|
-
DFUXRefListRequest: WsDFUXRef.DFUXRefListRequest;
|
|
17
|
-
DFUXRefLostFilesQueryRequest: WsDFUXRef.DFUXRefLostFilesQueryRequest;
|
|
18
|
-
DFUXRefMessagesQueryRequest: WsDFUXRef.DFUXRefMessagesQueryRequest;
|
|
19
|
-
DFUXRefOrphanFilesQueryRequest: WsDFUXRef.DFUXRefOrphanFilesQueryRequest;
|
|
20
|
-
DFUXRefUnusedFilesRequest: WsDFUXRef.DFUXRefUnusedFilesRequest;
|
|
21
|
-
WsDFUXRefPingRequest: WsDFUXRef.WsDFUXRefPingRequest;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface Directory {
|
|
25
|
-
Num: string;
|
|
26
|
-
Name: string;
|
|
27
|
-
MaxSize: string;
|
|
28
|
-
MaxIP: string;
|
|
29
|
-
MinSize: string;
|
|
30
|
-
MinIP: string;
|
|
31
|
-
Size: string;
|
|
32
|
-
PositiveSkew: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
interface DFUXRefDirectoriesQueryResult {
|
|
36
|
-
Directory: Directory[];
|
|
37
|
-
Cluster: string;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface DFUXRefDirectoriesQueryResponseEx {
|
|
41
|
-
DFUXRefDirectoriesQueryResult: DFUXRefDirectoriesQueryResult;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface Part {
|
|
45
|
-
Num: string;
|
|
46
|
-
Node: string;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export interface DFUXRefFile {
|
|
50
|
-
Size: string;
|
|
51
|
-
Partmask: string;
|
|
52
|
-
Modified: Date;
|
|
53
|
-
Numparts: string;
|
|
54
|
-
Part: Part[];
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface DFUXRefFoundFilesQueryResult {
|
|
58
|
-
File: DFUXRefFile[];
|
|
59
|
-
Cluster: string;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export interface XRefNode {
|
|
63
|
-
Name: string;
|
|
64
|
-
Modified: string;
|
|
65
|
-
Status: string;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export interface DFUXRefListResult {
|
|
69
|
-
XRefNode: XRefNode[];
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export interface DFUXRefListResponseEx {
|
|
73
|
-
DFUXRefListResult: DFUXRefListResult;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export interface File2 {
|
|
77
|
-
Partslost: string;
|
|
78
|
-
Name: string;
|
|
79
|
-
Partmask: string;
|
|
80
|
-
Modified: Date;
|
|
81
|
-
Numparts: string;
|
|
82
|
-
Part: Part[];
|
|
83
|
-
Cluster: string;
|
|
84
|
-
Size: string;
|
|
85
|
-
Primarylost: string;
|
|
86
|
-
Replicatedlost: string;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export interface DFUXRefLostFilesQueryResult {
|
|
90
|
-
File: File2[];
|
|
91
|
-
Cluster: string;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export interface Warning {
|
|
95
|
-
Text: string;
|
|
96
|
-
File: string;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export interface DFUXRefMessagesQueryResult {
|
|
100
|
-
Warning: Warning[];
|
|
101
|
-
Cluster: string;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export interface DFUXRefOrphanFilesQueryResult {
|
|
105
|
-
File: DFUXRefFile[];
|
|
106
|
-
Cluster: string;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export class DFUXRefService extends DFUXRefServiceBase {
|
|
112
|
-
|
|
113
|
-
DFUXRefDirectoriesEx(request: Partial<WsDFUXRef.DFUXRefDirectoriesQueryRequest>): Promise<WsDFUXRefEx.DFUXRefDirectoriesQueryResponseEx> {
|
|
114
|
-
return this._connection.send("DFUXRefDirectories", request, "json", false, undefined, "DFUXRefDirectoriesQueryResponse");
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
DFUXRefListEx(request: Partial<WsDFUXRef.DFUXRefListRequest>): Promise<WsDFUXRefEx.DFUXRefListResponseEx> {
|
|
118
|
-
return this._connection.send("DFUXRefList", request, "json", false, undefined, "DFUXRefListResponse");
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
}
|
|
1
|
+
import { DFUXRefServiceBase, type WsDFUXRef } from "./wsdl/WsDFUXRef/v1.04/WsDFUXRef.ts";
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
type WsDFUXRef
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export namespace WsDFUXRefEx {
|
|
8
|
+
|
|
9
|
+
export interface Request {
|
|
10
|
+
DFUXRefArrayActionRequest: WsDFUXRef.DFUXRefArrayActionRequest;
|
|
11
|
+
DFUXRefBuildRequest: WsDFUXRef.DFUXRefBuildRequest;
|
|
12
|
+
DFUXRefBuildCancelRequest: WsDFUXRef.DFUXRefBuildCancelRequest;
|
|
13
|
+
DFUXRefCleanDirectoriesRequest: WsDFUXRef.DFUXRefCleanDirectoriesRequest;
|
|
14
|
+
DFUXRefDirectoriesQueryRequest: WsDFUXRef.DFUXRefDirectoriesQueryRequest;
|
|
15
|
+
DFUXRefFoundFilesQueryRequest: WsDFUXRef.DFUXRefFoundFilesQueryRequest;
|
|
16
|
+
DFUXRefListRequest: WsDFUXRef.DFUXRefListRequest;
|
|
17
|
+
DFUXRefLostFilesQueryRequest: WsDFUXRef.DFUXRefLostFilesQueryRequest;
|
|
18
|
+
DFUXRefMessagesQueryRequest: WsDFUXRef.DFUXRefMessagesQueryRequest;
|
|
19
|
+
DFUXRefOrphanFilesQueryRequest: WsDFUXRef.DFUXRefOrphanFilesQueryRequest;
|
|
20
|
+
DFUXRefUnusedFilesRequest: WsDFUXRef.DFUXRefUnusedFilesRequest;
|
|
21
|
+
WsDFUXRefPingRequest: WsDFUXRef.WsDFUXRefPingRequest;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface Directory {
|
|
25
|
+
Num: string;
|
|
26
|
+
Name: string;
|
|
27
|
+
MaxSize: string;
|
|
28
|
+
MaxIP: string;
|
|
29
|
+
MinSize: string;
|
|
30
|
+
MinIP: string;
|
|
31
|
+
Size: string;
|
|
32
|
+
PositiveSkew: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface DFUXRefDirectoriesQueryResult {
|
|
36
|
+
Directory: Directory[];
|
|
37
|
+
Cluster: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface DFUXRefDirectoriesQueryResponseEx {
|
|
41
|
+
DFUXRefDirectoriesQueryResult: DFUXRefDirectoriesQueryResult;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface Part {
|
|
45
|
+
Num: string;
|
|
46
|
+
Node: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface DFUXRefFile {
|
|
50
|
+
Size: string;
|
|
51
|
+
Partmask: string;
|
|
52
|
+
Modified: Date;
|
|
53
|
+
Numparts: string;
|
|
54
|
+
Part: Part[];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface DFUXRefFoundFilesQueryResult {
|
|
58
|
+
File: DFUXRefFile[];
|
|
59
|
+
Cluster: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface XRefNode {
|
|
63
|
+
Name: string;
|
|
64
|
+
Modified: string;
|
|
65
|
+
Status: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface DFUXRefListResult {
|
|
69
|
+
XRefNode: XRefNode[];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface DFUXRefListResponseEx {
|
|
73
|
+
DFUXRefListResult: DFUXRefListResult;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface File2 {
|
|
77
|
+
Partslost: string;
|
|
78
|
+
Name: string;
|
|
79
|
+
Partmask: string;
|
|
80
|
+
Modified: Date;
|
|
81
|
+
Numparts: string;
|
|
82
|
+
Part: Part[];
|
|
83
|
+
Cluster: string;
|
|
84
|
+
Size: string;
|
|
85
|
+
Primarylost: string;
|
|
86
|
+
Replicatedlost: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface DFUXRefLostFilesQueryResult {
|
|
90
|
+
File: File2[];
|
|
91
|
+
Cluster: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface Warning {
|
|
95
|
+
Text: string;
|
|
96
|
+
File: string;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface DFUXRefMessagesQueryResult {
|
|
100
|
+
Warning: Warning[];
|
|
101
|
+
Cluster: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface DFUXRefOrphanFilesQueryResult {
|
|
105
|
+
File: DFUXRefFile[];
|
|
106
|
+
Cluster: string;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export class DFUXRefService extends DFUXRefServiceBase {
|
|
112
|
+
|
|
113
|
+
DFUXRefDirectoriesEx(request: Partial<WsDFUXRef.DFUXRefDirectoriesQueryRequest>): Promise<WsDFUXRefEx.DFUXRefDirectoriesQueryResponseEx> {
|
|
114
|
+
return this._connection.send("DFUXRefDirectories", request, "json", false, undefined, "DFUXRefDirectoriesQueryResponse");
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
DFUXRefListEx(request: Partial<WsDFUXRef.DFUXRefListRequest>): Promise<WsDFUXRefEx.DFUXRefListResponseEx> {
|
|
118
|
+
return this._connection.send("DFUXRefList", request, "json", false, undefined, "DFUXRefListResponse");
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
}
|
package/src/services/wsDali.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DaliServiceBase, WsDali } from "./wsdl/WsDali/v1.07/WsDali.ts";
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
type WsDali
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
export class DaliService extends DaliServiceBase {
|
|
8
|
-
}
|
|
1
|
+
import { DaliServiceBase, WsDali } from "./wsdl/WsDali/v1.07/WsDali.ts";
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
type WsDali
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export class DaliService extends DaliServiceBase {
|
|
8
|
+
}
|
package/src/services/wsEcl.ts
CHANGED
|
@@ -1,123 +1,123 @@
|
|
|
1
|
-
import type { DDL2 } from "@hpcc-js/ddl-shim";
|
|
2
|
-
import { IConnection, IOptions } from "../connection.ts";
|
|
3
|
-
import { ESPExceptions, Service } from "../espConnection.ts";
|
|
4
|
-
|
|
5
|
-
export type IFieldType = DDL2.IFieldType;
|
|
6
|
-
export type IField = DDL2.IField;
|
|
7
|
-
|
|
8
|
-
export type IWsEclRequest = IField[];
|
|
9
|
-
export type IWsEclResult = IField[];
|
|
10
|
-
export type IWsEclResponse = { [id: string]: IField[] };
|
|
11
|
-
|
|
12
|
-
function jsonToIField(id: string, item: any): IField {
|
|
13
|
-
const type = typeof item;
|
|
14
|
-
switch (type) {
|
|
15
|
-
case "boolean":
|
|
16
|
-
case "number":
|
|
17
|
-
case "string":
|
|
18
|
-
return { id, type };
|
|
19
|
-
case "object":
|
|
20
|
-
if (item.Row instanceof Array) {
|
|
21
|
-
item = item.Row;
|
|
22
|
-
}
|
|
23
|
-
if (item instanceof Array) {
|
|
24
|
-
return {
|
|
25
|
-
id,
|
|
26
|
-
type: "dataset",
|
|
27
|
-
children: jsonToIFieldArr(item[0])
|
|
28
|
-
};
|
|
29
|
-
} else if (item instanceof Object) {
|
|
30
|
-
if (item.Item && item.Item instanceof Array && item.Item.length === 1) {
|
|
31
|
-
const fieldType = typeof item.Item[0];
|
|
32
|
-
if (fieldType === "string" || fieldType === "number") {
|
|
33
|
-
return {
|
|
34
|
-
id,
|
|
35
|
-
type: "set",
|
|
36
|
-
fieldType
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
throw new Error("Unknown field type");
|
|
40
|
-
}
|
|
41
|
-
return {
|
|
42
|
-
id,
|
|
43
|
-
type: "object",
|
|
44
|
-
fields: jsonToIFieldObj(item)
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
// Fall through ---
|
|
48
|
-
default:
|
|
49
|
-
throw new Error("Unknown field type");
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function jsonToIFieldArr(json: any): IField[] {
|
|
54
|
-
if (json.Row && json.Row instanceof Array) {
|
|
55
|
-
json = json.Row[0];
|
|
56
|
-
}
|
|
57
|
-
const retVal: IField[] = [];
|
|
58
|
-
for (const key in json) {
|
|
59
|
-
retVal.push(jsonToIField(key, json[key]));
|
|
60
|
-
}
|
|
61
|
-
return retVal;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function jsonToIFieldObj(json: any): { [id: string]: IField } {
|
|
65
|
-
const fields = {};
|
|
66
|
-
for (const key in json) {
|
|
67
|
-
fields[key] = jsonToIField(key, json[key]);
|
|
68
|
-
}
|
|
69
|
-
return fields;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export class EclService extends Service {
|
|
73
|
-
|
|
74
|
-
constructor(optsConnection: IOptions | IConnection) {
|
|
75
|
-
super(optsConnection, "WsEcl", "0");
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
opts() {
|
|
79
|
-
return this._connection.opts();
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
requestJson(querySet: string, queryId: string): Promise<IWsEclRequest> {
|
|
83
|
-
// http://192.168.3.22:8002/WsEcl/example/request/query/roxie/peopleaccounts/json?display
|
|
84
|
-
return this._connection.send(`example/request/query/${querySet}/${queryId}/json`, {}, "text").then(response => {
|
|
85
|
-
const requestSchema = JSON.parse(response);
|
|
86
|
-
for (const key in requestSchema) {
|
|
87
|
-
return requestSchema[key];
|
|
88
|
-
}
|
|
89
|
-
return {};
|
|
90
|
-
}).then(jsonToIFieldArr);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
responseJson(querySet: string, queryId: string): Promise<IWsEclResponse> {
|
|
94
|
-
// http://192.168.3.22:8002/WsEcl/example/response/query/roxie/peopleaccounts/json?display
|
|
95
|
-
return this._connection.send(`example/response/query/${querySet}/${queryId}/json`, {}, "text").then(response => {
|
|
96
|
-
const responseSchema = JSON.parse(response);
|
|
97
|
-
for (const key in responseSchema) {
|
|
98
|
-
return responseSchema[key].Results;
|
|
99
|
-
}
|
|
100
|
-
return {};
|
|
101
|
-
}).then(resultsJson => {
|
|
102
|
-
const retVal: IWsEclResponse = {};
|
|
103
|
-
for (const key in resultsJson) {
|
|
104
|
-
retVal[key] = jsonToIFieldArr(resultsJson[key]);
|
|
105
|
-
}
|
|
106
|
-
return retVal;
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
submit(querySet: string, queryId: string, request: object) {
|
|
111
|
-
// http://192.168.3.22:8002/WsEcl/submit/query/roxie/peopleaccounts.1/json
|
|
112
|
-
const action = `submit/query/${querySet}/${queryId}`;
|
|
113
|
-
return this._connection.send(action, request, "json2").then(response => {
|
|
114
|
-
if (response.Results && response.Results.Exception) {
|
|
115
|
-
throw new ESPExceptions(action, request, {
|
|
116
|
-
Source: "wsEcl.submit",
|
|
117
|
-
Exception: response.Results.Exception
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
return response.Results;
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
}
|
|
1
|
+
import type { DDL2 } from "@hpcc-js/ddl-shim";
|
|
2
|
+
import { IConnection, IOptions } from "../connection.ts";
|
|
3
|
+
import { ESPExceptions, Service } from "../espConnection.ts";
|
|
4
|
+
|
|
5
|
+
export type IFieldType = DDL2.IFieldType;
|
|
6
|
+
export type IField = DDL2.IField;
|
|
7
|
+
|
|
8
|
+
export type IWsEclRequest = IField[];
|
|
9
|
+
export type IWsEclResult = IField[];
|
|
10
|
+
export type IWsEclResponse = { [id: string]: IField[] };
|
|
11
|
+
|
|
12
|
+
function jsonToIField(id: string, item: any): IField {
|
|
13
|
+
const type = typeof item;
|
|
14
|
+
switch (type) {
|
|
15
|
+
case "boolean":
|
|
16
|
+
case "number":
|
|
17
|
+
case "string":
|
|
18
|
+
return { id, type };
|
|
19
|
+
case "object":
|
|
20
|
+
if (item.Row instanceof Array) {
|
|
21
|
+
item = item.Row;
|
|
22
|
+
}
|
|
23
|
+
if (item instanceof Array) {
|
|
24
|
+
return {
|
|
25
|
+
id,
|
|
26
|
+
type: "dataset",
|
|
27
|
+
children: jsonToIFieldArr(item[0])
|
|
28
|
+
};
|
|
29
|
+
} else if (item instanceof Object) {
|
|
30
|
+
if (item.Item && item.Item instanceof Array && item.Item.length === 1) {
|
|
31
|
+
const fieldType = typeof item.Item[0];
|
|
32
|
+
if (fieldType === "string" || fieldType === "number") {
|
|
33
|
+
return {
|
|
34
|
+
id,
|
|
35
|
+
type: "set",
|
|
36
|
+
fieldType
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
throw new Error("Unknown field type");
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
id,
|
|
43
|
+
type: "object",
|
|
44
|
+
fields: jsonToIFieldObj(item)
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
// Fall through ---
|
|
48
|
+
default:
|
|
49
|
+
throw new Error("Unknown field type");
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function jsonToIFieldArr(json: any): IField[] {
|
|
54
|
+
if (json.Row && json.Row instanceof Array) {
|
|
55
|
+
json = json.Row[0];
|
|
56
|
+
}
|
|
57
|
+
const retVal: IField[] = [];
|
|
58
|
+
for (const key in json) {
|
|
59
|
+
retVal.push(jsonToIField(key, json[key]));
|
|
60
|
+
}
|
|
61
|
+
return retVal;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function jsonToIFieldObj(json: any): { [id: string]: IField } {
|
|
65
|
+
const fields = {};
|
|
66
|
+
for (const key in json) {
|
|
67
|
+
fields[key] = jsonToIField(key, json[key]);
|
|
68
|
+
}
|
|
69
|
+
return fields;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export class EclService extends Service {
|
|
73
|
+
|
|
74
|
+
constructor(optsConnection: IOptions | IConnection) {
|
|
75
|
+
super(optsConnection, "WsEcl", "0");
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
opts() {
|
|
79
|
+
return this._connection.opts();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
requestJson(querySet: string, queryId: string): Promise<IWsEclRequest> {
|
|
83
|
+
// http://192.168.3.22:8002/WsEcl/example/request/query/roxie/peopleaccounts/json?display
|
|
84
|
+
return this._connection.send(`example/request/query/${querySet}/${queryId}/json`, {}, "text").then(response => {
|
|
85
|
+
const requestSchema = JSON.parse(response);
|
|
86
|
+
for (const key in requestSchema) {
|
|
87
|
+
return requestSchema[key];
|
|
88
|
+
}
|
|
89
|
+
return {};
|
|
90
|
+
}).then(jsonToIFieldArr);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
responseJson(querySet: string, queryId: string): Promise<IWsEclResponse> {
|
|
94
|
+
// http://192.168.3.22:8002/WsEcl/example/response/query/roxie/peopleaccounts/json?display
|
|
95
|
+
return this._connection.send(`example/response/query/${querySet}/${queryId}/json`, {}, "text").then(response => {
|
|
96
|
+
const responseSchema = JSON.parse(response);
|
|
97
|
+
for (const key in responseSchema) {
|
|
98
|
+
return responseSchema[key].Results;
|
|
99
|
+
}
|
|
100
|
+
return {};
|
|
101
|
+
}).then(resultsJson => {
|
|
102
|
+
const retVal: IWsEclResponse = {};
|
|
103
|
+
for (const key in resultsJson) {
|
|
104
|
+
retVal[key] = jsonToIFieldArr(resultsJson[key]);
|
|
105
|
+
}
|
|
106
|
+
return retVal;
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
submit(querySet: string, queryId: string, request: object) {
|
|
111
|
+
// http://192.168.3.22:8002/WsEcl/submit/query/roxie/peopleaccounts.1/json
|
|
112
|
+
const action = `submit/query/${querySet}/${queryId}`;
|
|
113
|
+
return this._connection.send(action, request, "json2").then(response => {
|
|
114
|
+
if (response.Results && response.Results.Exception) {
|
|
115
|
+
throw new ESPExceptions(action, request, {
|
|
116
|
+
Source: "wsEcl.submit",
|
|
117
|
+
Exception: response.Results.Exception
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
return response.Results;
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
package/src/services/wsElk.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ElkServiceBase, WsElk } from "./wsdl/ws_elk/v1/ws_elk.ts";
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
type WsElk
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
export class ElkService extends ElkServiceBase {
|
|
8
|
-
}
|
|
1
|
+
import { ElkServiceBase, WsElk } from "./wsdl/ws_elk/v1/ws_elk.ts";
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
type WsElk
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export class ElkService extends ElkServiceBase {
|
|
8
|
+
}
|