@hpcc-js/comms 3.15.1 → 3.15.4
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 +10 -10
- package/dist/node/index.cjs.map +3 -3
- package/dist/node/index.js +10 -10
- package/dist/node/index.js.map +3 -3
- package/package.json +8 -8
- 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 -73
- 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 +270 -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/wsLogaccess.d.ts +1 -0
package/src/ecl/scope.ts
CHANGED
|
@@ -1,188 +1,188 @@
|
|
|
1
|
-
import { StateObject, StringAnyMap } from "@hpcc-js/util";
|
|
2
|
-
import { WsWorkunits } from "../services/wsWorkunits.ts";
|
|
3
|
-
import { Workunit } from "./workunit.ts";
|
|
4
|
-
|
|
5
|
-
export interface AttributeEx extends WsWorkunits.Property {
|
|
6
|
-
FormattedEnd?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export class Attribute extends StateObject<AttributeEx, AttributeEx> implements AttributeEx {
|
|
10
|
-
readonly scope: BaseScope;
|
|
11
|
-
|
|
12
|
-
get properties(): AttributeEx { return this.get(); }
|
|
13
|
-
get Name(): string { return this.get("Name"); }
|
|
14
|
-
get RawValue(): string { return this.get("RawValue"); }
|
|
15
|
-
get Formatted(): string { return this.get("Formatted"); }
|
|
16
|
-
get FormattedEnd(): string | undefined { return this.get("FormattedEnd"); }
|
|
17
|
-
get Measure(): string { return this.get("Measure"); }
|
|
18
|
-
get Creator(): string { return this.get("Creator"); }
|
|
19
|
-
get CreatorType(): string { return this.get("CreatorType"); }
|
|
20
|
-
|
|
21
|
-
constructor(scope: BaseScope, attribute: WsWorkunits.Property) {
|
|
22
|
-
super();
|
|
23
|
-
this.scope = scope;
|
|
24
|
-
this.set(attribute);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface ScopeEx extends WsWorkunits.Scope {
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface IScopeVisitor {
|
|
32
|
-
start(scope: BaseScope): boolean;
|
|
33
|
-
end(scope: BaseScope): boolean;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export class BaseScope extends StateObject<ScopeEx, ScopeEx> implements ScopeEx {
|
|
37
|
-
protected _attributeMap: { [key: string]: Attribute } = {};
|
|
38
|
-
protected _children: BaseScope[] = [];
|
|
39
|
-
|
|
40
|
-
get properties(): ScopeEx { return this.get(); }
|
|
41
|
-
get ScopeName(): string { return this.get("ScopeName"); }
|
|
42
|
-
get Id(): string { return this.get("Id"); }
|
|
43
|
-
get ScopeType(): string { return this.get("ScopeType"); }
|
|
44
|
-
get Properties(): WsWorkunits.Properties { return this.get("Properties", { Property: [] }); }
|
|
45
|
-
get Notes(): WsWorkunits.Notes { return this.get("Notes", { Note: [] }); }
|
|
46
|
-
get SinkActivity(): string { return this.get("SinkActivity"); }
|
|
47
|
-
get CAttributes(): Attribute[] {
|
|
48
|
-
// Match "started" and time elapsed
|
|
49
|
-
const retVal: Attribute[] = [];
|
|
50
|
-
const timeElapsed: { start: AttributeEx | null, end: AttributeEx | null } = {
|
|
51
|
-
start: null,
|
|
52
|
-
end: null
|
|
53
|
-
};
|
|
54
|
-
this.Properties.Property.forEach((scopeAttr) => {
|
|
55
|
-
if (scopeAttr.Measure === "ts" && scopeAttr.Name.indexOf("Started") >= 0) {
|
|
56
|
-
timeElapsed.start = scopeAttr;
|
|
57
|
-
} else if (this.ScopeName && scopeAttr.Measure === "ts" && scopeAttr.Name.indexOf("Finished") >= 0) {
|
|
58
|
-
timeElapsed.end = scopeAttr;
|
|
59
|
-
} else {
|
|
60
|
-
retVal.push(new Attribute(this, scopeAttr));
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
if (timeElapsed.start && timeElapsed.end) {
|
|
64
|
-
// const endTime = parser(timeElapsed.start.Formatted);
|
|
65
|
-
// endTime!.setMilliseconds(endTime!.getMilliseconds() + (+timeElapsed.elapsed.RawValue) / 1000000);
|
|
66
|
-
// timeElapsed.start.FormattedEnd = formatter(endTime!);
|
|
67
|
-
timeElapsed.start.FormattedEnd = timeElapsed.end.Formatted;
|
|
68
|
-
retVal.push(new Attribute(this, timeElapsed.start));
|
|
69
|
-
} else if (timeElapsed.start) {
|
|
70
|
-
retVal.push(new Attribute(this, timeElapsed.start));
|
|
71
|
-
} else if (timeElapsed.end) {
|
|
72
|
-
retVal.push(new Attribute(this, timeElapsed.end)); // Should not happen?
|
|
73
|
-
}
|
|
74
|
-
return retVal;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
constructor(scope: WsWorkunits.Scope) {
|
|
78
|
-
super();
|
|
79
|
-
this.update(scope);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
update(scope: WsWorkunits.Scope) {
|
|
83
|
-
this.set(scope);
|
|
84
|
-
this.CAttributes.forEach((attr) => {
|
|
85
|
-
this._attributeMap[attr.Name] = attr;
|
|
86
|
-
});
|
|
87
|
-
this.Properties.Property = [];
|
|
88
|
-
for (const key in this._attributeMap) {
|
|
89
|
-
if (this._attributeMap.hasOwnProperty(key)) {
|
|
90
|
-
this.Properties.Property.push(this._attributeMap[key].properties);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
parentScope(): string {
|
|
96
|
-
const scopeParts = this.ScopeName.split(":");
|
|
97
|
-
scopeParts.pop();
|
|
98
|
-
return scopeParts.join(":");
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
children(): BaseScope[];
|
|
102
|
-
children(_: BaseScope[]): BaseScope;
|
|
103
|
-
children(_?: BaseScope[]): BaseScope[] | BaseScope {
|
|
104
|
-
if (!arguments.length) return this._children;
|
|
105
|
-
this._children = _!;
|
|
106
|
-
return this;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
walk(visitor: IScopeVisitor): boolean {
|
|
110
|
-
if (visitor.start(this)) return true;
|
|
111
|
-
for (const scope of this.children()) {
|
|
112
|
-
if (scope.walk(visitor)) {
|
|
113
|
-
return true;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
return visitor.end(this);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
formattedAttrs(): StringAnyMap {
|
|
120
|
-
const retVal: StringAnyMap = {};
|
|
121
|
-
for (const attr in this._attributeMap) {
|
|
122
|
-
retVal[attr] = this._attributeMap[attr].Formatted || this._attributeMap[attr].RawValue;
|
|
123
|
-
}
|
|
124
|
-
return retVal;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
rawAttrs(): StringAnyMap {
|
|
128
|
-
const retVal: StringAnyMap = {};
|
|
129
|
-
for (const attr in this._attributeMap) {
|
|
130
|
-
retVal[attr] = this._attributeMap[attr].RawValue;
|
|
131
|
-
}
|
|
132
|
-
return retVal;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
hasAttr(name: string): boolean {
|
|
136
|
-
return this._attributeMap[name] !== undefined;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
attr(name: string): Attribute {
|
|
140
|
-
return this._attributeMap[name] || new Attribute(this, {
|
|
141
|
-
Creator: "",
|
|
142
|
-
CreatorType: "",
|
|
143
|
-
Formatted: "",
|
|
144
|
-
Measure: "",
|
|
145
|
-
Name: "",
|
|
146
|
-
RawValue: ""
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
attrMeasure(name: string): string {
|
|
151
|
-
return this._attributeMap[name].Measure;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
calcTooltip(parentScope?: BaseScope) {
|
|
155
|
-
let label = "";
|
|
156
|
-
const rows: string[] = [];
|
|
157
|
-
label = this.Id;
|
|
158
|
-
rows.push(`<tr><td class="key">ID:</td><td class="value">${this.Id}</td></tr>`);
|
|
159
|
-
if (parentScope) {
|
|
160
|
-
rows.push(`<tr><td class="key">Parent ID:</td><td class="value">${parentScope.Id}</td></tr>`);
|
|
161
|
-
}
|
|
162
|
-
rows.push(`<tr><td class="key">Scope:</td><td class="value">${this.ScopeName}</td></tr>`);
|
|
163
|
-
const attrs = this.formattedAttrs();
|
|
164
|
-
for (const key in attrs) {
|
|
165
|
-
if (key === "Label") {
|
|
166
|
-
label = attrs[key];
|
|
167
|
-
} else {
|
|
168
|
-
rows.push(`<tr><td class="key">${key}</td><td class="value">${attrs[key]}</td></tr>`);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
return `<div class="eclwatch_WUGraph_Tooltip" style="max-width:480px">
|
|
173
|
-
<h4 align="center">${label}</h4>
|
|
174
|
-
<table>
|
|
175
|
-
${rows.join("")}
|
|
176
|
-
</table>
|
|
177
|
-
</div>`;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
export class Scope extends BaseScope {
|
|
182
|
-
readonly wu: Workunit;
|
|
183
|
-
|
|
184
|
-
constructor(wu: Workunit, scope: WsWorkunits.Scope) {
|
|
185
|
-
super(scope);
|
|
186
|
-
this.wu = wu;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
1
|
+
import { StateObject, StringAnyMap } from "@hpcc-js/util";
|
|
2
|
+
import { WsWorkunits } from "../services/wsWorkunits.ts";
|
|
3
|
+
import { Workunit } from "./workunit.ts";
|
|
4
|
+
|
|
5
|
+
export interface AttributeEx extends WsWorkunits.Property {
|
|
6
|
+
FormattedEnd?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export class Attribute extends StateObject<AttributeEx, AttributeEx> implements AttributeEx {
|
|
10
|
+
readonly scope: BaseScope;
|
|
11
|
+
|
|
12
|
+
get properties(): AttributeEx { return this.get(); }
|
|
13
|
+
get Name(): string { return this.get("Name"); }
|
|
14
|
+
get RawValue(): string { return this.get("RawValue"); }
|
|
15
|
+
get Formatted(): string { return this.get("Formatted"); }
|
|
16
|
+
get FormattedEnd(): string | undefined { return this.get("FormattedEnd"); }
|
|
17
|
+
get Measure(): string { return this.get("Measure"); }
|
|
18
|
+
get Creator(): string { return this.get("Creator"); }
|
|
19
|
+
get CreatorType(): string { return this.get("CreatorType"); }
|
|
20
|
+
|
|
21
|
+
constructor(scope: BaseScope, attribute: WsWorkunits.Property) {
|
|
22
|
+
super();
|
|
23
|
+
this.scope = scope;
|
|
24
|
+
this.set(attribute);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface ScopeEx extends WsWorkunits.Scope {
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface IScopeVisitor {
|
|
32
|
+
start(scope: BaseScope): boolean;
|
|
33
|
+
end(scope: BaseScope): boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export class BaseScope extends StateObject<ScopeEx, ScopeEx> implements ScopeEx {
|
|
37
|
+
protected _attributeMap: { [key: string]: Attribute } = {};
|
|
38
|
+
protected _children: BaseScope[] = [];
|
|
39
|
+
|
|
40
|
+
get properties(): ScopeEx { return this.get(); }
|
|
41
|
+
get ScopeName(): string { return this.get("ScopeName"); }
|
|
42
|
+
get Id(): string { return this.get("Id"); }
|
|
43
|
+
get ScopeType(): string { return this.get("ScopeType"); }
|
|
44
|
+
get Properties(): WsWorkunits.Properties { return this.get("Properties", { Property: [] }); }
|
|
45
|
+
get Notes(): WsWorkunits.Notes { return this.get("Notes", { Note: [] }); }
|
|
46
|
+
get SinkActivity(): string { return this.get("SinkActivity"); }
|
|
47
|
+
get CAttributes(): Attribute[] {
|
|
48
|
+
// Match "started" and time elapsed
|
|
49
|
+
const retVal: Attribute[] = [];
|
|
50
|
+
const timeElapsed: { start: AttributeEx | null, end: AttributeEx | null } = {
|
|
51
|
+
start: null,
|
|
52
|
+
end: null
|
|
53
|
+
};
|
|
54
|
+
this.Properties.Property.forEach((scopeAttr) => {
|
|
55
|
+
if (scopeAttr.Measure === "ts" && scopeAttr.Name.indexOf("Started") >= 0) {
|
|
56
|
+
timeElapsed.start = scopeAttr;
|
|
57
|
+
} else if (this.ScopeName && scopeAttr.Measure === "ts" && scopeAttr.Name.indexOf("Finished") >= 0) {
|
|
58
|
+
timeElapsed.end = scopeAttr;
|
|
59
|
+
} else {
|
|
60
|
+
retVal.push(new Attribute(this, scopeAttr));
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
if (timeElapsed.start && timeElapsed.end) {
|
|
64
|
+
// const endTime = parser(timeElapsed.start.Formatted);
|
|
65
|
+
// endTime!.setMilliseconds(endTime!.getMilliseconds() + (+timeElapsed.elapsed.RawValue) / 1000000);
|
|
66
|
+
// timeElapsed.start.FormattedEnd = formatter(endTime!);
|
|
67
|
+
timeElapsed.start.FormattedEnd = timeElapsed.end.Formatted;
|
|
68
|
+
retVal.push(new Attribute(this, timeElapsed.start));
|
|
69
|
+
} else if (timeElapsed.start) {
|
|
70
|
+
retVal.push(new Attribute(this, timeElapsed.start));
|
|
71
|
+
} else if (timeElapsed.end) {
|
|
72
|
+
retVal.push(new Attribute(this, timeElapsed.end)); // Should not happen?
|
|
73
|
+
}
|
|
74
|
+
return retVal;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
constructor(scope: WsWorkunits.Scope) {
|
|
78
|
+
super();
|
|
79
|
+
this.update(scope);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
update(scope: WsWorkunits.Scope) {
|
|
83
|
+
this.set(scope);
|
|
84
|
+
this.CAttributes.forEach((attr) => {
|
|
85
|
+
this._attributeMap[attr.Name] = attr;
|
|
86
|
+
});
|
|
87
|
+
this.Properties.Property = [];
|
|
88
|
+
for (const key in this._attributeMap) {
|
|
89
|
+
if (this._attributeMap.hasOwnProperty(key)) {
|
|
90
|
+
this.Properties.Property.push(this._attributeMap[key].properties);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
parentScope(): string {
|
|
96
|
+
const scopeParts = this.ScopeName.split(":");
|
|
97
|
+
scopeParts.pop();
|
|
98
|
+
return scopeParts.join(":");
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
children(): BaseScope[];
|
|
102
|
+
children(_: BaseScope[]): BaseScope;
|
|
103
|
+
children(_?: BaseScope[]): BaseScope[] | BaseScope {
|
|
104
|
+
if (!arguments.length) return this._children;
|
|
105
|
+
this._children = _!;
|
|
106
|
+
return this;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
walk(visitor: IScopeVisitor): boolean {
|
|
110
|
+
if (visitor.start(this)) return true;
|
|
111
|
+
for (const scope of this.children()) {
|
|
112
|
+
if (scope.walk(visitor)) {
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return visitor.end(this);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
formattedAttrs(): StringAnyMap {
|
|
120
|
+
const retVal: StringAnyMap = {};
|
|
121
|
+
for (const attr in this._attributeMap) {
|
|
122
|
+
retVal[attr] = this._attributeMap[attr].Formatted || this._attributeMap[attr].RawValue;
|
|
123
|
+
}
|
|
124
|
+
return retVal;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
rawAttrs(): StringAnyMap {
|
|
128
|
+
const retVal: StringAnyMap = {};
|
|
129
|
+
for (const attr in this._attributeMap) {
|
|
130
|
+
retVal[attr] = this._attributeMap[attr].RawValue;
|
|
131
|
+
}
|
|
132
|
+
return retVal;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
hasAttr(name: string): boolean {
|
|
136
|
+
return this._attributeMap[name] !== undefined;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
attr(name: string): Attribute {
|
|
140
|
+
return this._attributeMap[name] || new Attribute(this, {
|
|
141
|
+
Creator: "",
|
|
142
|
+
CreatorType: "",
|
|
143
|
+
Formatted: "",
|
|
144
|
+
Measure: "",
|
|
145
|
+
Name: "",
|
|
146
|
+
RawValue: ""
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
attrMeasure(name: string): string {
|
|
151
|
+
return this._attributeMap[name].Measure;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
calcTooltip(parentScope?: BaseScope) {
|
|
155
|
+
let label = "";
|
|
156
|
+
const rows: string[] = [];
|
|
157
|
+
label = this.Id;
|
|
158
|
+
rows.push(`<tr><td class="key">ID:</td><td class="value">${this.Id}</td></tr>`);
|
|
159
|
+
if (parentScope) {
|
|
160
|
+
rows.push(`<tr><td class="key">Parent ID:</td><td class="value">${parentScope.Id}</td></tr>`);
|
|
161
|
+
}
|
|
162
|
+
rows.push(`<tr><td class="key">Scope:</td><td class="value">${this.ScopeName}</td></tr>`);
|
|
163
|
+
const attrs = this.formattedAttrs();
|
|
164
|
+
for (const key in attrs) {
|
|
165
|
+
if (key === "Label") {
|
|
166
|
+
label = attrs[key];
|
|
167
|
+
} else {
|
|
168
|
+
rows.push(`<tr><td class="key">${key}</td><td class="value">${attrs[key]}</td></tr>`);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return `<div class="eclwatch_WUGraph_Tooltip" style="max-width:480px">
|
|
173
|
+
<h4 align="center">${label}</h4>
|
|
174
|
+
<table>
|
|
175
|
+
${rows.join("")}
|
|
176
|
+
</table>
|
|
177
|
+
</div>`;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export class Scope extends BaseScope {
|
|
182
|
+
readonly wu: Workunit;
|
|
183
|
+
|
|
184
|
+
constructor(wu: Workunit, scope: WsWorkunits.Scope) {
|
|
185
|
+
super(scope);
|
|
186
|
+
this.wu = wu;
|
|
187
|
+
}
|
|
188
|
+
}
|
package/src/ecl/sourceFile.ts
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { StateObject } from "@hpcc-js/util";
|
|
2
|
-
import { IConnection, IOptions } from "../connection.ts";
|
|
3
|
-
import { WorkunitsService, WsWorkunits } from "../services/wsWorkunits.ts";
|
|
4
|
-
|
|
5
|
-
export interface ECLSourceFileEx extends WsWorkunits.ECLSourceFile {
|
|
6
|
-
Wuid: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export class SourceFile extends StateObject<ECLSourceFileEx, ECLSourceFileEx> implements ECLSourceFileEx {
|
|
10
|
-
protected connection: WorkunitsService;
|
|
11
|
-
|
|
12
|
-
get properties(): WsWorkunits.ECLSourceFile { return this.get(); }
|
|
13
|
-
get Wuid(): string { return this.get("Wuid"); }
|
|
14
|
-
get FileCluster(): string { return this.get("FileCluster"); }
|
|
15
|
-
get Name(): string { return this.get("Name"); }
|
|
16
|
-
get IsSuperFile(): boolean { return this.get("IsSuperFile"); }
|
|
17
|
-
get Subs(): number { return this.get("Subs"); }
|
|
18
|
-
get Count(): number { return this.get("Count"); }
|
|
19
|
-
get ECLSourceFiles(): WsWorkunits.ECLSourceFiles { return this.get("ECLSourceFiles"); }
|
|
20
|
-
|
|
21
|
-
constructor(optsConnection: IOptions | IConnection | WorkunitsService, wuid: string, eclSourceFile: WsWorkunits.ECLSourceFile) {
|
|
22
|
-
super();
|
|
23
|
-
if (optsConnection instanceof WorkunitsService) {
|
|
24
|
-
this.connection = optsConnection;
|
|
25
|
-
} else {
|
|
26
|
-
this.connection = new WorkunitsService(optsConnection);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
this.set({
|
|
30
|
-
Wuid: wuid,
|
|
31
|
-
...eclSourceFile
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
1
|
+
import { StateObject } from "@hpcc-js/util";
|
|
2
|
+
import { IConnection, IOptions } from "../connection.ts";
|
|
3
|
+
import { WorkunitsService, WsWorkunits } from "../services/wsWorkunits.ts";
|
|
4
|
+
|
|
5
|
+
export interface ECLSourceFileEx extends WsWorkunits.ECLSourceFile {
|
|
6
|
+
Wuid: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export class SourceFile extends StateObject<ECLSourceFileEx, ECLSourceFileEx> implements ECLSourceFileEx {
|
|
10
|
+
protected connection: WorkunitsService;
|
|
11
|
+
|
|
12
|
+
get properties(): WsWorkunits.ECLSourceFile { return this.get(); }
|
|
13
|
+
get Wuid(): string { return this.get("Wuid"); }
|
|
14
|
+
get FileCluster(): string { return this.get("FileCluster"); }
|
|
15
|
+
get Name(): string { return this.get("Name"); }
|
|
16
|
+
get IsSuperFile(): boolean { return this.get("IsSuperFile"); }
|
|
17
|
+
get Subs(): number { return this.get("Subs"); }
|
|
18
|
+
get Count(): number { return this.get("Count"); }
|
|
19
|
+
get ECLSourceFiles(): WsWorkunits.ECLSourceFiles { return this.get("ECLSourceFiles"); }
|
|
20
|
+
|
|
21
|
+
constructor(optsConnection: IOptions | IConnection | WorkunitsService, wuid: string, eclSourceFile: WsWorkunits.ECLSourceFile) {
|
|
22
|
+
super();
|
|
23
|
+
if (optsConnection instanceof WorkunitsService) {
|
|
24
|
+
this.connection = optsConnection;
|
|
25
|
+
} else {
|
|
26
|
+
this.connection = new WorkunitsService(optsConnection);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
this.set({
|
|
30
|
+
Wuid: wuid,
|
|
31
|
+
...eclSourceFile
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|