@hpcc-js/comms 2.91.2 → 2.92.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/dist/index.es6.js +101 -110
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +116 -125
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/index.node.js +116 -125
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.min.js +1 -1
- package/dist/index.node.min.js.map +1 -1
- package/lib-es6/__package__.js +2 -2
- package/lib-es6/__tests__/workunit.js +1 -1
- package/lib-es6/__tests__/workunit.js.map +1 -1
- package/lib-es6/ecl/dfuWorkunit.js +11 -5
- package/lib-es6/ecl/dfuWorkunit.js.map +1 -1
- package/lib-es6/ecl/graph.js.map +1 -1
- package/lib-es6/ecl/query.js +14 -9
- package/lib-es6/ecl/query.js.map +1 -1
- package/lib-es6/ecl/result.js +2 -1
- package/lib-es6/ecl/result.js.map +1 -1
- package/lib-es6/ecl/scope.js +5 -0
- package/lib-es6/ecl/scope.js.map +1 -1
- package/lib-es6/ecl/sourceFile.js.map +1 -1
- package/lib-es6/ecl/timer.js +10 -0
- package/lib-es6/ecl/timer.js.map +1 -1
- package/lib-es6/ecl/workunit.js +44 -40
- package/lib-es6/ecl/workunit.js.map +1 -1
- package/lib-es6/services/wsLogaccess.js +1 -1
- package/lib-es6/services/wsWorkunits.js +14 -60
- package/lib-es6/services/wsWorkunits.js.map +1 -1
- package/lib-es6/services/wsdl/WsWorkunits/v1.97/WsWorkunits.js +376 -0
- package/lib-es6/services/wsdl/WsWorkunits/v1.97/WsWorkunits.js.map +1 -0
- package/lib-es6/services/wsdl/WsWorkunits/v1.99/WsWorkunits.js +376 -0
- package/lib-es6/services/wsdl/WsWorkunits/v1.99/WsWorkunits.js.map +1 -0
- package/lib-es6/services/wsdl/WsWorkunits/v2/WsWorkunits.js +376 -0
- package/lib-es6/services/wsdl/WsWorkunits/v2/WsWorkunits.js.map +1 -0
- package/package.json +8 -7
- package/src/__package__.ts +2 -2
- package/src/__tests__/workunit.ts +1 -1
- package/src/ecl/dfuWorkunit.ts +7 -2
- package/src/ecl/graph.ts +4 -4
- package/src/ecl/query.ts +17 -16
- package/src/ecl/result.ts +36 -17
- package/src/ecl/scope.ts +10 -9
- package/src/ecl/sourceFile.ts +5 -5
- package/src/ecl/timer.ts +6 -4
- package/src/ecl/workunit.ts +87 -87
- package/src/services/wsWorkunits.ts +41 -2661
- package/src/services/wsdl/WsWorkunits/v1.97/WsWorkunits.ts +3134 -0
- package/src/services/wsdl/WsWorkunits/v1.99/WsWorkunits.ts +3162 -0
- package/src/services/wsdl/WsWorkunits/v2/WsWorkunits.ts +3165 -0
- package/types/__package__.d.ts +2 -2
- package/types/ecl/dfuWorkunit.d.ts.map +1 -1
- package/types/ecl/graph.d.ts +4 -4
- package/types/ecl/graph.d.ts.map +1 -1
- package/types/ecl/query.d.ts +16 -15
- package/types/ecl/query.d.ts.map +1 -1
- package/types/ecl/result.d.ts +26 -7
- package/types/ecl/result.d.ts.map +1 -1
- package/types/ecl/scope.d.ts +10 -9
- package/types/ecl/scope.d.ts.map +1 -1
- package/types/ecl/sourceFile.d.ts +5 -5
- package/types/ecl/sourceFile.d.ts.map +1 -1
- package/types/ecl/timer.d.ts +6 -4
- package/types/ecl/timer.d.ts.map +1 -1
- package/types/ecl/workunit.d.ts +66 -65
- package/types/ecl/workunit.d.ts.map +1 -1
- package/types/services/wsWorkunits.d.ts +17 -2256
- package/types/services/wsWorkunits.d.ts.map +1 -1
- package/types/services/wsdl/WsWorkunits/v1.97/WsWorkunits.d.ts +2529 -0
- package/types/services/wsdl/WsWorkunits/v1.97/WsWorkunits.d.ts.map +1 -0
- package/types/services/wsdl/WsWorkunits/v1.99/WsWorkunits.d.ts +2555 -0
- package/types/services/wsdl/WsWorkunits/v1.99/WsWorkunits.d.ts.map +1 -0
- package/types/services/wsdl/WsWorkunits/v2/WsWorkunits.d.ts +2558 -0
- package/types/services/wsdl/WsWorkunits/v2/WsWorkunits.d.ts.map +1 -0
- package/types-3.4/__package__.d.ts +2 -2
- package/types-3.4/ecl/graph.d.ts +4 -4
- package/types-3.4/ecl/query.d.ts +16 -15
- package/types-3.4/ecl/result.d.ts +26 -7
- package/types-3.4/ecl/scope.d.ts +10 -9
- package/types-3.4/ecl/sourceFile.d.ts +5 -5
- package/types-3.4/ecl/timer.d.ts +6 -4
- package/types-3.4/ecl/workunit.d.ts +66 -65
- package/types-3.4/services/wsWorkunits.d.ts +17 -2256
- package/types-3.4/services/wsdl/WsWorkunits/v1.97/WsWorkunits.d.ts +2529 -0
- package/types-3.4/services/wsdl/WsWorkunits/v1.99/WsWorkunits.d.ts +2555 -0
- package/types-3.4/services/wsdl/WsWorkunits/v2/WsWorkunits.d.ts +2558 -0
package/src/ecl/workunit.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Cache, deepMixinT, IEvent, scopedLogger, StateCallback, StateEvents, StateObject, StatePropCallback, StringAnyMap, XMLNode } from "@hpcc-js/util";
|
|
1
|
+
import { Cache, deepMixinT, IEvent, RecursivePartial, scopedLogger, StateCallback, StateEvents, StateObject, StatePropCallback, StringAnyMap, XMLNode } from "@hpcc-js/util";
|
|
2
2
|
import { format as d3Format } from "d3-format";
|
|
3
3
|
import { utcFormat, utcParse } from "d3-time-format";
|
|
4
4
|
import { IConnection, IOptions } from "../connection";
|
|
5
5
|
import { ESPExceptions } from "../espConnection";
|
|
6
6
|
import { WsSMC } from "../services/wsSMC";
|
|
7
7
|
import * as WsTopology from "../services/wsTopology";
|
|
8
|
-
import
|
|
8
|
+
import { WsWorkunits, WUStateID, WorkunitsService, WorkunitsServiceEx, WUUpdate } from "../services/wsWorkunits";
|
|
9
9
|
import { createGraph, createXGMMLGraph, ECLGraph, GraphCache, ScopeGraph, XGMMLGraph, XGMMLVertex } from "./graph";
|
|
10
10
|
import { Resource } from "./resource";
|
|
11
11
|
import { Result, ResultCache } from "./result";
|
|
@@ -149,8 +149,6 @@ function formatValues(item: IScope, key: string, dedup: DedupProperties): IPrope
|
|
|
149
149
|
|
|
150
150
|
const logger = scopedLogger("workunit.ts");
|
|
151
151
|
|
|
152
|
-
const WUStateID = WsWorkunits.WUStateID;
|
|
153
|
-
|
|
154
152
|
export class WorkunitCache extends Cache<{ BaseUrl: string, Wuid: string }, Workunit> {
|
|
155
153
|
constructor() {
|
|
156
154
|
super((obj) => {
|
|
@@ -167,7 +165,7 @@ export interface DebugState {
|
|
|
167
165
|
}
|
|
168
166
|
|
|
169
167
|
export interface IWorkunit {
|
|
170
|
-
ResultViews: WsWorkunits.
|
|
168
|
+
ResultViews: WsWorkunits.ResultViews;
|
|
171
169
|
HelpersCount: number;
|
|
172
170
|
}
|
|
173
171
|
|
|
@@ -183,34 +181,34 @@ export interface ITimeElapsed {
|
|
|
183
181
|
}
|
|
184
182
|
|
|
185
183
|
export type WorkunitEvents = "completed" | StateEvents;
|
|
186
|
-
export type UWorkunitState = WsWorkunits.
|
|
187
|
-
export type IWorkunitState = WsWorkunits.
|
|
188
|
-
export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implements WsWorkunits.
|
|
189
|
-
connection:
|
|
184
|
+
export type UWorkunitState = WsWorkunits.ECLWorkunit & WsWorkunits.Workunit & WsSMC.ActiveWorkunit & IWorkunit & IDebugWorkunit;
|
|
185
|
+
export type IWorkunitState = WsWorkunits.ECLWorkunit | WsWorkunits.Workunit | WsSMC.ActiveWorkunit | IWorkunit | IDebugWorkunit;
|
|
186
|
+
export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implements WsWorkunits.Workunit {
|
|
187
|
+
connection: WorkunitsService;
|
|
190
188
|
topologyConnection: WsTopology.TopologyService;
|
|
191
189
|
get BaseUrl() { return this.connection.baseUrl; }
|
|
192
190
|
|
|
193
191
|
private _debugMode: boolean = false;
|
|
194
192
|
private _debugAllGraph: any;
|
|
195
|
-
private _submitAction:
|
|
193
|
+
private _submitAction: WUUpdate.Action;
|
|
196
194
|
|
|
197
195
|
// Accessors ---
|
|
198
|
-
get properties(): WsWorkunits.
|
|
196
|
+
get properties(): WsWorkunits.ECLWorkunit & WsWorkunits.Workunit { return this.get(); }
|
|
199
197
|
get Wuid(): string { return this.get("Wuid"); }
|
|
200
198
|
get Owner(): string { return this.get("Owner", ""); }
|
|
201
199
|
get Cluster(): string { return this.get("Cluster", ""); }
|
|
202
200
|
get Jobname(): string { return this.get("Jobname", ""); }
|
|
203
201
|
get Description(): string { return this.get("Description", ""); }
|
|
204
202
|
get ActionEx(): string { return this.get("ActionEx", ""); }
|
|
205
|
-
get StateID():
|
|
206
|
-
get State(): string { return this.get("State") ||
|
|
203
|
+
get StateID(): WUStateID { return this.get("StateID", WUStateID.Unknown); }
|
|
204
|
+
get State(): string { return this.get("State") || WUStateID[this.StateID]; }
|
|
207
205
|
get Protected(): boolean { return this.get("Protected", false); }
|
|
208
|
-
get Exceptions(): WsWorkunits.
|
|
209
|
-
get ResultViews(): WsWorkunits.
|
|
206
|
+
get Exceptions(): WsWorkunits.Exceptions2 { return this.get("Exceptions", { ECLException: [] }); }
|
|
207
|
+
get ResultViews(): WsWorkunits.ResultViews { return this.get("ResultViews", { View: [] }); }
|
|
210
208
|
|
|
211
209
|
private _resultCache = new ResultCache();
|
|
212
210
|
get ResultCount(): number { return this.get("ResultCount", 0); }
|
|
213
|
-
get Results(): WsWorkunits.
|
|
211
|
+
get Results(): WsWorkunits.Results { return this.get("Results", { ECLResult: [] }); }
|
|
214
212
|
get CResults(): Result[] {
|
|
215
213
|
return this.Results.ECLResult.map((eclResult) => {
|
|
216
214
|
return this._resultCache.get(eclResult, () => {
|
|
@@ -225,7 +223,7 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
225
223
|
});
|
|
226
224
|
return retVal;
|
|
227
225
|
}
|
|
228
|
-
get Timers(): WsWorkunits.
|
|
226
|
+
get Timers(): WsWorkunits.Timers { return this.get("Timers", { ECLTimer: [] }); }
|
|
229
227
|
get CTimers(): Timer[] {
|
|
230
228
|
return this.Timers.ECLTimer.map((eclTimer) => {
|
|
231
229
|
return new Timer(this.connection, this.Wuid, eclTimer);
|
|
@@ -234,7 +232,7 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
234
232
|
|
|
235
233
|
private _graphCache = new GraphCache();
|
|
236
234
|
get GraphCount(): number { return this.get("GraphCount", 0); }
|
|
237
|
-
get Graphs(): WsWorkunits.
|
|
235
|
+
get Graphs(): WsWorkunits.Graphs { return this.get("Graphs", { ECLGraph: [] }); }
|
|
238
236
|
get CGraphs(): ECLGraph[] {
|
|
239
237
|
return this.Graphs.ECLGraph.map((eclGraph) => {
|
|
240
238
|
return this._graphCache.get(eclGraph, () => {
|
|
@@ -242,9 +240,9 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
242
240
|
});
|
|
243
241
|
});
|
|
244
242
|
}
|
|
245
|
-
get ThorLogList(): WsWorkunits.
|
|
243
|
+
get ThorLogList(): WsWorkunits.ThorLogList { return this.get("ThorLogList"); }
|
|
246
244
|
get ResourceURLCount(): number { return this.get("ResourceURLCount", 0); }
|
|
247
|
-
get ResourceURLs(): WsWorkunits.
|
|
245
|
+
get ResourceURLs(): WsWorkunits.ResourceURLs { return this.get("ResourceURLs", { URL: [] }); }
|
|
248
246
|
get CResourceURLs(): Resource[] {
|
|
249
247
|
return this.ResourceURLs.URL.map((url) => {
|
|
250
248
|
return new Resource(this, url);
|
|
@@ -254,7 +252,7 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
254
252
|
get DateTimeScheduled(): string { return this.get("DateTimeScheduled"); }
|
|
255
253
|
get IsPausing(): boolean { return this.get("IsPausing"); }
|
|
256
254
|
get ThorLCR(): boolean { return this.get("ThorLCR"); }
|
|
257
|
-
get ApplicationValues(): WsWorkunits.
|
|
255
|
+
get ApplicationValues(): WsWorkunits.ApplicationValues { return this.get("ApplicationValues", { ApplicationValue: [] }); }
|
|
258
256
|
get HasArchiveQuery(): boolean { return this.get("HasArchiveQuery"); }
|
|
259
257
|
get StateEx(): string { return this.get("StateEx"); }
|
|
260
258
|
get PriorityClass(): number { return this.get("PriorityClass"); }
|
|
@@ -262,23 +260,22 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
262
260
|
get Snapshot(): string { return this.get("Snapshot"); }
|
|
263
261
|
get ResultLimit(): number { return this.get("ResultLimit"); }
|
|
264
262
|
get EventSchedule(): number { return this.get("EventSchedule"); }
|
|
265
|
-
get
|
|
266
|
-
get Query(): WsWorkunits.WUInfo.Query { return this.get("Query"); }
|
|
263
|
+
get Query(): WsWorkunits.Query { return this.get("Query"); }
|
|
267
264
|
get HelpersCount(): number { return this.get("HelpersCount", 0); }
|
|
268
|
-
get Helpers(): WsWorkunits.
|
|
269
|
-
get DebugValues(): WsWorkunits.
|
|
270
|
-
get AllowedClusters(): WsWorkunits.
|
|
265
|
+
get Helpers(): WsWorkunits.Helpers { return this.get("Helpers", { ECLHelpFile: [] }); }
|
|
266
|
+
get DebugValues(): WsWorkunits.DebugValues { return this.get("DebugValues"); }
|
|
267
|
+
get AllowedClusters(): WsWorkunits.AllowedClusters { return this.get("AllowedClusters"); }
|
|
271
268
|
get ErrorCount(): number { return this.get("ErrorCount", 0); }
|
|
272
269
|
get WarningCount(): number { return this.get("WarningCount", 0); }
|
|
273
270
|
get InfoCount(): number { return this.get("InfoCount", 0); }
|
|
274
271
|
get AlertCount(): number { return this.get("AlertCount", 0); }
|
|
275
272
|
get SourceFileCount(): number { return this.get("SourceFileCount", 0); }
|
|
276
|
-
get SourceFiles(): WsWorkunits.
|
|
273
|
+
get SourceFiles(): WsWorkunits.SourceFiles { return this.get("SourceFiles", { ECLSourceFile: [] }); }
|
|
277
274
|
get CSourceFiles(): SourceFile[] {
|
|
278
275
|
return this.SourceFiles.ECLSourceFile.map(eclSourceFile => new SourceFile(this.connection, this.Wuid, eclSourceFile));
|
|
279
276
|
}
|
|
280
277
|
get VariableCount(): number { return this.get("VariableCount", 0); }
|
|
281
|
-
get Variables(): WsWorkunits.
|
|
278
|
+
get Variables(): WsWorkunits.Variables { return this.get("Variables", { ECLResult: [] }); }
|
|
282
279
|
get TimerCount(): number { return this.get("TimerCount", 0); }
|
|
283
280
|
get HasDebugValue(): boolean { return this.get("HasDebugValue"); }
|
|
284
281
|
get ApplicationValueCount(): number { return this.get("ApplicationValueCount", 0); }
|
|
@@ -297,8 +294,8 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
297
294
|
get Scope(): string { return this.get("Scope"); }
|
|
298
295
|
get AbortBy(): string { return this.get("AbortBy"); }
|
|
299
296
|
get AbortTime(): string { return this.get("AbortTime"); }
|
|
300
|
-
get Workflows(): WsWorkunits.
|
|
301
|
-
get TimingData(): WsWorkunits.
|
|
297
|
+
get Workflows(): WsWorkunits.Workflows { return this.get("Workflows"); }
|
|
298
|
+
get TimingData(): WsWorkunits.TimingData { return this.get("TimingData"); }
|
|
302
299
|
get HelpersDesc(): string { return this.get("HelpersDesc"); }
|
|
303
300
|
get GraphsDesc(): string { return this.get("GraphsDesc"); }
|
|
304
301
|
get SourceFilesDesc(): string { return this.get("SourceFilesDesc"); }
|
|
@@ -308,10 +305,12 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
308
305
|
get DebugValuesDesc(): string { return this.get("DebugValuesDesc"); }
|
|
309
306
|
get ApplicationValuesDesc(): string { return this.get("ApplicationValuesDesc"); }
|
|
310
307
|
get WorkflowsDesc(): string { return this.get("WorkflowsDesc"); }
|
|
311
|
-
get ServiceNames(): WsWorkunits.
|
|
308
|
+
get ServiceNames(): WsWorkunits.ServiceNames { return this.get("ServiceNames"); }
|
|
312
309
|
get CompileCost(): number { return this.get("CompileCost"); }
|
|
313
310
|
get ExecuteCost(): number { return this.get("ExecuteCost"); }
|
|
314
311
|
get FileAccessCost(): number { return this.get("FileAccessCost"); }
|
|
312
|
+
get NoAccess(): boolean { return this.get("NoAccess"); }
|
|
313
|
+
get ECLWUProcessList(): WsWorkunits.ECLWUProcessList { return this.get("ECLWUProcessList"); }
|
|
315
314
|
|
|
316
315
|
// Factories ---
|
|
317
316
|
static create(optsConnection: IOptions | IConnection): Promise<Workunit> {
|
|
@@ -341,7 +340,7 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
341
340
|
return Workunit.create(server).then((wu) => {
|
|
342
341
|
return wu.update({ QueryText: ecl });
|
|
343
342
|
}).then((wu) => {
|
|
344
|
-
return compileOnly ? wu.submit(target,
|
|
343
|
+
return compileOnly ? wu.submit(target, WUUpdate.Action.Compile) : wu.submit(target);
|
|
345
344
|
});
|
|
346
345
|
}
|
|
347
346
|
|
|
@@ -349,8 +348,8 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
349
348
|
return Workunit.submit(server, target, ecl, true);
|
|
350
349
|
}
|
|
351
350
|
|
|
352
|
-
static query(server: IOptions | IConnection, opts: WsWorkunits.WUQuery
|
|
353
|
-
const wsWorkunits = new
|
|
351
|
+
static query(server: IOptions | IConnection, opts: Partial<WsWorkunits.WUQuery>): Promise<Workunit[]> {
|
|
352
|
+
const wsWorkunits = new WorkunitsService(server);
|
|
354
353
|
return wsWorkunits.WUQuery(opts).then((response) => {
|
|
355
354
|
return response.Workunits.ECLWorkunit.map(function (wu) {
|
|
356
355
|
return Workunit.attach(server, wu.Wuid, wu);
|
|
@@ -361,7 +360,7 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
361
360
|
// --- --- ---
|
|
362
361
|
protected constructor(optsConnection: IOptions | IConnection, wuid?: string) {
|
|
363
362
|
super();
|
|
364
|
-
this.connection = new
|
|
363
|
+
this.connection = new WorkunitsService(optsConnection);
|
|
365
364
|
this.topologyConnection = new WsTopology.TopologyService(optsConnection);
|
|
366
365
|
this.clearState(wuid);
|
|
367
366
|
}
|
|
@@ -373,12 +372,12 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
373
372
|
});
|
|
374
373
|
}
|
|
375
374
|
|
|
376
|
-
update(request: Partial<WsWorkunits.WUUpdate
|
|
375
|
+
update(request: Partial<WsWorkunits.WUUpdate>): Promise<Workunit> {
|
|
377
376
|
return this.connection.WUUpdate({
|
|
378
377
|
...request,
|
|
379
378
|
...{
|
|
380
379
|
Wuid: this.Wuid,
|
|
381
|
-
StateOrig: this.
|
|
380
|
+
StateOrig: this.StateID,
|
|
382
381
|
JobnameOrig: this.Jobname,
|
|
383
382
|
DescriptionOrig: this.Description,
|
|
384
383
|
ProtectedOrig: this.Protected,
|
|
@@ -390,7 +389,7 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
390
389
|
});
|
|
391
390
|
}
|
|
392
391
|
|
|
393
|
-
submit(_cluster?: string, action:
|
|
392
|
+
submit(_cluster?: string, action: WUUpdate.Action = WUUpdate.Action.Run, resultLimit?: number): Promise<Workunit> {
|
|
394
393
|
let clusterPromise;
|
|
395
394
|
if (_cluster !== void 0) {
|
|
396
395
|
clusterPromise = Promise.resolve(_cluster);
|
|
@@ -401,8 +400,8 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
401
400
|
}
|
|
402
401
|
|
|
403
402
|
this._debugMode = false;
|
|
404
|
-
if (action ===
|
|
405
|
-
action =
|
|
403
|
+
if (action === WUUpdate.Action.Debug) {
|
|
404
|
+
action = WUUpdate.Action.Run;
|
|
406
405
|
this._debugMode = true;
|
|
407
406
|
}
|
|
408
407
|
|
|
@@ -432,7 +431,7 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
432
431
|
isComplete(): boolean {
|
|
433
432
|
switch (this.StateID) {
|
|
434
433
|
case WUStateID.Compiled:
|
|
435
|
-
return this.ActionEx === "compile" || this._submitAction ===
|
|
434
|
+
return this.ActionEx === "compile" || this._submitAction === WUUpdate.Action.Compile;
|
|
436
435
|
case WUStateID.Completed:
|
|
437
436
|
case WUStateID.Failed:
|
|
438
437
|
case WUStateID.Aborted:
|
|
@@ -487,47 +486,47 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
487
486
|
}
|
|
488
487
|
|
|
489
488
|
setToFailed() {
|
|
490
|
-
return this.WUAction(
|
|
489
|
+
return this.WUAction(WsWorkunits.ECLWUActions.SetToFailed);
|
|
491
490
|
}
|
|
492
491
|
|
|
493
492
|
pause() {
|
|
494
|
-
return this.WUAction(
|
|
493
|
+
return this.WUAction(WsWorkunits.ECLWUActions.Pause);
|
|
495
494
|
}
|
|
496
495
|
|
|
497
496
|
pauseNow() {
|
|
498
|
-
return this.WUAction(
|
|
497
|
+
return this.WUAction(WsWorkunits.ECLWUActions.PauseNow);
|
|
499
498
|
}
|
|
500
499
|
|
|
501
500
|
resume() {
|
|
502
|
-
return this.WUAction(
|
|
501
|
+
return this.WUAction(WsWorkunits.ECLWUActions.Resume);
|
|
503
502
|
}
|
|
504
503
|
|
|
505
504
|
abort() {
|
|
506
|
-
return this.WUAction(
|
|
505
|
+
return this.WUAction(WsWorkunits.ECLWUActions.Abort);
|
|
507
506
|
}
|
|
508
507
|
|
|
509
508
|
protect() {
|
|
510
|
-
return this.WUAction(
|
|
509
|
+
return this.WUAction(WsWorkunits.ECLWUActions.Protect);
|
|
511
510
|
}
|
|
512
511
|
|
|
513
512
|
unprotect() {
|
|
514
|
-
return this.WUAction(
|
|
513
|
+
return this.WUAction(WsWorkunits.ECLWUActions.Unprotect);
|
|
515
514
|
}
|
|
516
515
|
|
|
517
516
|
delete() {
|
|
518
|
-
return this.WUAction(
|
|
517
|
+
return this.WUAction(WsWorkunits.ECLWUActions.Delete);
|
|
519
518
|
}
|
|
520
519
|
|
|
521
520
|
restore() {
|
|
522
|
-
return this.WUAction(
|
|
521
|
+
return this.WUAction(WsWorkunits.ECLWUActions.Restore);
|
|
523
522
|
}
|
|
524
523
|
|
|
525
524
|
deschedule() {
|
|
526
|
-
return this.WUAction(
|
|
525
|
+
return this.WUAction(WsWorkunits.ECLWUActions.Deschedule);
|
|
527
526
|
}
|
|
528
527
|
|
|
529
528
|
reschedule() {
|
|
530
|
-
return this.WUAction(
|
|
529
|
+
return this.WUAction(WsWorkunits.ECLWUActions.Reschedule);
|
|
531
530
|
}
|
|
532
531
|
|
|
533
532
|
resubmit(): Promise<Workunit> {
|
|
@@ -563,7 +562,7 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
563
562
|
return this;
|
|
564
563
|
}
|
|
565
564
|
|
|
566
|
-
async refreshInfo(request?: Partial<WsWorkunits.WUInfo
|
|
565
|
+
async refreshInfo(request?: Partial<WsWorkunits.WUInfo>): Promise<this> {
|
|
567
566
|
await this.WUInfo(request);
|
|
568
567
|
return this;
|
|
569
568
|
}
|
|
@@ -573,7 +572,7 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
573
572
|
return this;
|
|
574
573
|
}
|
|
575
574
|
|
|
576
|
-
async refresh(full: boolean = false, request?: Partial<WsWorkunits.WUInfo
|
|
575
|
+
async refresh(full: boolean = false, request?: Partial<WsWorkunits.WUInfo>): Promise<this> {
|
|
577
576
|
if (full) {
|
|
578
577
|
await Promise.all([this.refreshInfo(request), this.refreshDebug()]);
|
|
579
578
|
} else {
|
|
@@ -582,18 +581,18 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
582
581
|
return this;
|
|
583
582
|
}
|
|
584
583
|
|
|
585
|
-
eclExceptions(): WsWorkunits.
|
|
584
|
+
eclExceptions(): WsWorkunits.ECLException[] {
|
|
586
585
|
return this.Exceptions.ECLException;
|
|
587
586
|
}
|
|
588
587
|
|
|
589
588
|
fetchArchive(): Promise<string> {
|
|
590
|
-
return this.connection.
|
|
589
|
+
return this.connection.WUFileEx({
|
|
591
590
|
Wuid: this.Wuid,
|
|
592
591
|
Type: "ArchiveQuery"
|
|
593
592
|
});
|
|
594
593
|
}
|
|
595
594
|
|
|
596
|
-
fetchECLExceptions(): Promise<WsWorkunits.
|
|
595
|
+
fetchECLExceptions(): Promise<WsWorkunits.ECLException[]> {
|
|
597
596
|
return this.WUInfo({ IncludeExceptions: true }).then(() => {
|
|
598
597
|
return this.eclExceptions();
|
|
599
598
|
});
|
|
@@ -611,13 +610,13 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
611
610
|
});
|
|
612
611
|
}
|
|
613
612
|
|
|
614
|
-
fetchQuery(): Promise<WsWorkunits.
|
|
613
|
+
fetchQuery(): Promise<WsWorkunits.Query> {
|
|
615
614
|
return this.WUInfo({ IncludeECL: true, TruncateEclTo64k: false }).then(() => {
|
|
616
615
|
return this.Query;
|
|
617
616
|
});
|
|
618
617
|
}
|
|
619
618
|
|
|
620
|
-
fetchHelpers(): Promise<WsWorkunits.
|
|
619
|
+
fetchHelpers(): Promise<WsWorkunits.ECLHelpFile[]> {
|
|
621
620
|
return this.WUInfo({ IncludeHelpers: true }).then(() => {
|
|
622
621
|
return this.Helpers?.ECLHelpFile || [];
|
|
623
622
|
});
|
|
@@ -641,15 +640,15 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
641
640
|
});
|
|
642
641
|
}
|
|
643
642
|
|
|
644
|
-
fetchDetailsMeta(request:
|
|
643
|
+
fetchDetailsMeta(request: RecursivePartial<WsWorkunits.WUDetailsMeta> = {}): Promise<WsWorkunits.WUDetailsMetaResponse> {
|
|
645
644
|
return this.WUDetailsMeta(request);
|
|
646
645
|
}
|
|
647
646
|
|
|
648
|
-
fetchDetailsRaw(request:
|
|
647
|
+
fetchDetailsRaw(request: RecursivePartial<WsWorkunits.WUDetails> = {}): Promise<WsWorkunits.Scope[]> {
|
|
649
648
|
return this.WUDetails(request).then(response => response.Scopes.Scope);
|
|
650
649
|
}
|
|
651
650
|
|
|
652
|
-
normalizeDetails(meta: WsWorkunits.
|
|
651
|
+
normalizeDetails(meta: WsWorkunits.WUDetailsMetaResponse, scopes: WsWorkunits.Scope[]): { meta: WsWorkunits.WUDetailsMetaResponse, columns: { [id: string]: any }, data: IScope[] } {
|
|
653
652
|
const columns: { [id: string]: any } = {
|
|
654
653
|
id: {
|
|
655
654
|
Measure: "label"
|
|
@@ -758,17 +757,17 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
758
757
|
};
|
|
759
758
|
}
|
|
760
759
|
|
|
761
|
-
fetchDetailsNormalized(request:
|
|
760
|
+
fetchDetailsNormalized(request: RecursivePartial<WsWorkunits.WUDetails> = {}): Promise<{ meta: WsWorkunits.WUDetailsMetaResponse, columns: { [id: string]: any }, data: IScope[] }> {
|
|
762
761
|
return Promise.all([this.fetchDetailsMeta(), this.fetchDetailsRaw(request)]).then(promises => {
|
|
763
762
|
return this.normalizeDetails(promises[0], promises[1]);
|
|
764
763
|
});
|
|
765
764
|
}
|
|
766
765
|
|
|
767
|
-
fetchInfo(request: Partial<WsWorkunits.WUInfo
|
|
766
|
+
fetchInfo(request: Partial<WsWorkunits.WUInfo> = {}): Promise<WsWorkunits.WUInfoResponse> {
|
|
768
767
|
return this.WUInfo(request);
|
|
769
768
|
}
|
|
770
769
|
|
|
771
|
-
fetchDetails(request:
|
|
770
|
+
fetchDetails(request: RecursivePartial<WsWorkunits.WUDetails> = {}): Promise<Scope[]> {
|
|
772
771
|
return this.WUDetails(request).then((response) => {
|
|
773
772
|
return response.Scopes.Scope.map((rawScope) => {
|
|
774
773
|
return new Scope(this, rawScope);
|
|
@@ -776,7 +775,7 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
776
775
|
});
|
|
777
776
|
}
|
|
778
777
|
|
|
779
|
-
fetchDetailsHierarchy(request: Partial<WsWorkunits.WUDetails
|
|
778
|
+
fetchDetailsHierarchy(request: Partial<WsWorkunits.WUDetails> = {}): Promise<Scope[]> {
|
|
780
779
|
return this.WUDetails(request).then((response) => {
|
|
781
780
|
const retVal: Scope[] = [];
|
|
782
781
|
|
|
@@ -812,12 +811,12 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
812
811
|
return this.fetchDetails({
|
|
813
812
|
ScopeFilter: {
|
|
814
813
|
MaxDepth: 999999,
|
|
815
|
-
Ids: graphIDs,
|
|
816
|
-
ScopeTypes: rootTypes
|
|
814
|
+
Ids: { id: graphIDs },
|
|
815
|
+
ScopeTypes: { ScopeType: rootTypes },
|
|
817
816
|
},
|
|
818
817
|
NestedFilter: {
|
|
819
818
|
Depth: 999999,
|
|
820
|
-
ScopeTypes: ["graph", "subgraph", "activity", "edge", "function"]
|
|
819
|
+
ScopeTypes: { ScopeType: ["graph", "subgraph", "activity", "edge", "function"] }
|
|
821
820
|
},
|
|
822
821
|
PropertiesToReturn: {
|
|
823
822
|
AllStatistics: true,
|
|
@@ -972,7 +971,7 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
972
971
|
}
|
|
973
972
|
|
|
974
973
|
// WsWorkunits passthroughs ---
|
|
975
|
-
protected WUQuery(_request: Partial<WsWorkunits.WUQuery
|
|
974
|
+
protected WUQuery(_request: Partial<WsWorkunits.WUQuery> = {}): Promise<WsWorkunits.WUQueryResponse> {
|
|
976
975
|
return this.connection.WUQuery({ ..._request, Wuid: this.Wuid }).then((response) => {
|
|
977
976
|
this.set(response.Workunits.ECLWorkunit[0]);
|
|
978
977
|
return response;
|
|
@@ -990,7 +989,7 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
990
989
|
logger.warning("Unexpected exception: ");
|
|
991
990
|
throw e;
|
|
992
991
|
}
|
|
993
|
-
return {} as WsWorkunits.
|
|
992
|
+
return {} as WsWorkunits.WUQueryResponse;
|
|
994
993
|
});
|
|
995
994
|
}
|
|
996
995
|
|
|
@@ -1002,10 +1001,11 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
1002
1001
|
});
|
|
1003
1002
|
}
|
|
1004
1003
|
|
|
1005
|
-
protected WUInfo(_request: Partial<WsWorkunits.WUInfo
|
|
1004
|
+
protected WUInfo(_request: Partial<WsWorkunits.WUInfo> = {}): Promise<WsWorkunits.WUInfoResponse> {
|
|
1006
1005
|
const includeResults = _request.IncludeResults || _request.IncludeResultsViewNames;
|
|
1007
1006
|
return this.connection.WUInfo({
|
|
1008
|
-
..._request,
|
|
1007
|
+
..._request,
|
|
1008
|
+
Wuid: this.Wuid,
|
|
1009
1009
|
IncludeResults: includeResults,
|
|
1010
1010
|
IncludeResultsViewNames: includeResults,
|
|
1011
1011
|
SuppressResultSchemas: false
|
|
@@ -1031,22 +1031,22 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
1031
1031
|
logger.warning("Unexpected exception: ");
|
|
1032
1032
|
throw e;
|
|
1033
1033
|
}
|
|
1034
|
-
return {} as WsWorkunits.
|
|
1034
|
+
return {} as WsWorkunits.WUInfoResponse;
|
|
1035
1035
|
});
|
|
1036
1036
|
}
|
|
1037
1037
|
|
|
1038
|
-
protected WUResubmit(request: Partial<WsWorkunits.WUResubmit
|
|
1039
|
-
return this.connection.WUResubmit(deepMixinT<WsWorkunits.WUResubmit
|
|
1040
|
-
Wuids: [this.Wuid]
|
|
1038
|
+
protected WUResubmit(request: Partial<WsWorkunits.WUResubmit>): Promise<WsWorkunits.WUResubmitResponse> {
|
|
1039
|
+
return this.connection.WUResubmit(deepMixinT<WsWorkunits.WUResubmit>({}, request, {
|
|
1040
|
+
Wuids: { Item: [this.Wuid] }
|
|
1041
1041
|
}));
|
|
1042
1042
|
}
|
|
1043
1043
|
|
|
1044
|
-
protected WUDetailsMeta(request: Partial<WsWorkunits.WUDetailsMeta
|
|
1044
|
+
protected WUDetailsMeta(request: Partial<WsWorkunits.WUDetailsMeta>): Promise<WsWorkunits.WUDetailsMetaResponse> {
|
|
1045
1045
|
return this.connection.WUDetailsMeta(request);
|
|
1046
1046
|
}
|
|
1047
1047
|
|
|
1048
|
-
protected WUDetails(request:
|
|
1049
|
-
return this.connection.WUDetails(deepMixinT<WsWorkunits.WUDetails
|
|
1048
|
+
protected WUDetails(request: RecursivePartial<WsWorkunits.WUDetails>): Promise<WsWorkunits.WUDetailsResponse> {
|
|
1049
|
+
return this.connection.WUDetails(deepMixinT<WsWorkunits.WUDetails>({
|
|
1050
1050
|
ScopeFilter: {
|
|
1051
1051
|
MaxDepth: 9999
|
|
1052
1052
|
},
|
|
@@ -1065,7 +1065,7 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
1065
1065
|
IncludeCreatorType: false
|
|
1066
1066
|
}
|
|
1067
1067
|
}, request, { WUID: this.Wuid })).then((response) => {
|
|
1068
|
-
return deepMixinT<WsWorkunits.
|
|
1068
|
+
return deepMixinT<WsWorkunits.WUDetailsResponse>({
|
|
1069
1069
|
Scopes: {
|
|
1070
1070
|
Scope: []
|
|
1071
1071
|
}
|
|
@@ -1073,9 +1073,9 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
1073
1073
|
});
|
|
1074
1074
|
}
|
|
1075
1075
|
|
|
1076
|
-
protected WUAction(actionType: WsWorkunits.
|
|
1076
|
+
protected WUAction(actionType: WsWorkunits.ECLWUActions): Promise<WsWorkunits.WUActionResponse> {
|
|
1077
1077
|
return this.connection.WUAction({
|
|
1078
|
-
Wuids: [this.Wuid],
|
|
1078
|
+
Wuids: { Item: [this.Wuid] },
|
|
1079
1079
|
WUActionType: actionType
|
|
1080
1080
|
}).then((response) => {
|
|
1081
1081
|
return this.refresh().then(() => {
|
|
@@ -1091,13 +1091,13 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
1091
1091
|
Cluster: this.Cluster,
|
|
1092
1092
|
JobName: name || this.Jobname,
|
|
1093
1093
|
AllowForeignFiles: true,
|
|
1094
|
-
Activate:
|
|
1094
|
+
Activate: WsWorkunits.WUQueryActivationMode.ActivateQuery,
|
|
1095
1095
|
Wait: 5000
|
|
1096
1096
|
});
|
|
1097
1097
|
}
|
|
1098
1098
|
|
|
1099
|
-
publishEx(request: Partial<WsWorkunits.
|
|
1100
|
-
const service = new
|
|
1099
|
+
publishEx(request: Partial<WsWorkunits.WUPublishWorkunit>) {
|
|
1100
|
+
const service = new WorkunitsServiceEx({ baseUrl: "" });
|
|
1101
1101
|
const publishRequest = {
|
|
1102
1102
|
Wuid: this.Wuid,
|
|
1103
1103
|
Cluster: this.Cluster,
|
|
@@ -1117,7 +1117,7 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
|
|
|
1117
1117
|
optsStr += ` ${key}='${opts[key]}'`;
|
|
1118
1118
|
}
|
|
1119
1119
|
}
|
|
1120
|
-
return this.connection.
|
|
1120
|
+
return this.connection.WUCDebugEx({
|
|
1121
1121
|
Wuid: this.Wuid,
|
|
1122
1122
|
Command: `<debug:${command} uid='${this.Wuid}'${optsStr}/>`
|
|
1123
1123
|
}).then((response) => {
|