@hpcc-js/comms 2.82.1 → 2.82.2

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.
Files changed (117) hide show
  1. package/dist/index.es6.js +641 -47
  2. package/dist/index.es6.js.map +1 -1
  3. package/dist/index.js +642 -46
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.js +1 -1
  6. package/dist/index.min.js.map +1 -1
  7. package/dist/index.node.js +642 -46
  8. package/dist/index.node.js.map +1 -1
  9. package/dist/index.node.min.js +1 -1
  10. package/dist/index.node.min.js.map +1 -1
  11. package/lib-es6/__package__.js +2 -2
  12. package/lib-es6/ecl/dfuWorkunit.js +528 -0
  13. package/lib-es6/ecl/dfuWorkunit.js.map +1 -0
  14. package/lib-es6/ecl/workunit.js +2 -2
  15. package/lib-es6/ecl/workunit.js.map +1 -1
  16. package/lib-es6/index-common.js +1 -0
  17. package/lib-es6/index-common.js.map +1 -1
  18. package/lib-es6/services/fileSpray.js +9 -0
  19. package/lib-es6/services/fileSpray.js.map +1 -1
  20. package/lib-es6/services/wsLogaccess.js +75 -27
  21. package/lib-es6/services/wsLogaccess.js.map +1 -1
  22. package/lib-es6/services/wsdl/ws_logaccess/v1.04/ws_logaccess.js +85 -0
  23. package/lib-es6/services/wsdl/ws_logaccess/v1.04/ws_logaccess.js.map +1 -0
  24. package/package.json +6 -6
  25. package/src/__package__.ts +2 -2
  26. package/src/ecl/dfuWorkunit.ts +306 -0
  27. package/src/ecl/workunit.ts +2 -2
  28. package/src/index-common.ts +1 -0
  29. package/src/services/fileSpray.ts +108 -0
  30. package/src/services/wsLogaccess.ts +70 -26
  31. package/src/services/wsdl/ws_logaccess/v1.04/ws_logaccess.ts +215 -0
  32. package/types/__package__.d.ts +2 -2
  33. package/types/connection.d.ts +5 -5
  34. package/types/connection.d.ts.map +1 -1
  35. package/types/ecl/activity.d.ts +3 -3
  36. package/types/ecl/activity.d.ts.map +1 -1
  37. package/types/ecl/dfuWorkunit.d.ts +95 -0
  38. package/types/ecl/dfuWorkunit.d.ts.map +1 -0
  39. package/types/ecl/result.d.ts +3 -3
  40. package/types/ecl/result.d.ts.map +1 -1
  41. package/types/ecl/targetCluster.d.ts +2 -2
  42. package/types/ecl/targetCluster.d.ts.map +1 -1
  43. package/types/ecl/workunit.d.ts +4 -4
  44. package/types/ecl/workunit.d.ts.map +1 -1
  45. package/types/espConnection.d.ts +1 -1
  46. package/types/espConnection.d.ts.map +1 -1
  47. package/types/index-common.d.ts +1 -0
  48. package/types/index-common.d.ts.map +1 -1
  49. package/types/services/fileSpray.d.ts +95 -0
  50. package/types/services/fileSpray.d.ts.map +1 -1
  51. package/types/services/wsDFU.d.ts +1 -1
  52. package/types/services/wsDFU.d.ts.map +1 -1
  53. package/types/services/wsEcl.d.ts +5 -5
  54. package/types/services/wsEcl.d.ts.map +1 -1
  55. package/types/services/wsLogaccess.d.ts +3 -3
  56. package/types/services/wsLogaccess.d.ts.map +1 -1
  57. package/types/services/wsdl/FileSpray/v1.23/FileSpray.d.ts +5 -5
  58. package/types/services/wsdl/FileSpray/v1.23/FileSpray.d.ts.map +1 -1
  59. package/types/services/wsdl/WsDFUXRef/v1.02/WsDFUXRef.d.ts +2 -2
  60. package/types/services/wsdl/WsDFUXRef/v1.02/WsDFUXRef.d.ts.map +1 -1
  61. package/types/services/wsdl/WsDfu/v1.62/WsDfu.d.ts +4 -4
  62. package/types/services/wsdl/WsDfu/v1.62/WsDfu.d.ts.map +1 -1
  63. package/types/services/wsdl/WsFileIO/v1.01/WsFileIO.d.ts +2 -2
  64. package/types/services/wsdl/WsFileIO/v1.01/WsFileIO.d.ts.map +1 -1
  65. package/types/services/wsdl/WsPackageProcess/v1.04/WsPackageProcess.d.ts +1 -1
  66. package/types/services/wsdl/WsPackageProcess/v1.04/WsPackageProcess.d.ts.map +1 -1
  67. package/types/services/wsdl/WsResources/v1.01/WsResources.d.ts +1 -1
  68. package/types/services/wsdl/WsResources/v1.01/WsResources.d.ts.map +1 -1
  69. package/types/services/wsdl/WsSMC/v1.24/WsSMC.d.ts +3 -3
  70. package/types/services/wsdl/WsSMC/v1.24/WsSMC.d.ts.map +1 -1
  71. package/types/services/wsdl/WsTopology/v1.31/WsTopology.d.ts +4 -4
  72. package/types/services/wsdl/WsTopology/v1.31/WsTopology.d.ts.map +1 -1
  73. package/types/services/wsdl/WsWorkunits/v1.88/WsWorkunits.d.ts +8 -8
  74. package/types/services/wsdl/WsWorkunits/v1.88/WsWorkunits.d.ts.map +1 -1
  75. package/types/services/wsdl/ws_access/v1.16/ws_access.d.ts +4 -4
  76. package/types/services/wsdl/ws_access/v1.16/ws_access.d.ts.map +1 -1
  77. package/types/services/wsdl/ws_account/v1.05/ws_account.d.ts +1 -1
  78. package/types/services/wsdl/ws_account/v1.05/ws_account.d.ts.map +1 -1
  79. package/types/services/wsdl/ws_codesign/v1.1/ws_codesign.d.ts +1 -1
  80. package/types/services/wsdl/ws_codesign/v1.1/ws_codesign.d.ts.map +1 -1
  81. package/types/services/wsdl/ws_logaccess/v1/ws_logaccess.d.ts +3 -3
  82. package/types/services/wsdl/ws_logaccess/v1/ws_logaccess.d.ts.map +1 -1
  83. package/types/services/wsdl/ws_logaccess/v1.04/ws_logaccess.d.ts +171 -0
  84. package/types/services/wsdl/ws_logaccess/v1.04/ws_logaccess.d.ts.map +1 -0
  85. package/types/services/wsdl/ws_machine/v1.17/ws_machine.d.ts +3 -3
  86. package/types/services/wsdl/ws_machine/v1.17/ws_machine.d.ts.map +1 -1
  87. package/types/services/wsdl/wsstore/v1.02/wsstore.d.ts +1 -1
  88. package/types/services/wsdl/wsstore/v1.02/wsstore.d.ts.map +1 -1
  89. package/types-3.4/__package__.d.ts +2 -2
  90. package/types-3.4/connection.d.ts +5 -5
  91. package/types-3.4/ecl/activity.d.ts +3 -3
  92. package/types-3.4/ecl/dfuWorkunit.d.ts +95 -0
  93. package/types-3.4/ecl/result.d.ts +3 -3
  94. package/types-3.4/ecl/targetCluster.d.ts +2 -2
  95. package/types-3.4/ecl/workunit.d.ts +4 -4
  96. package/types-3.4/espConnection.d.ts +1 -1
  97. package/types-3.4/index-common.d.ts +1 -0
  98. package/types-3.4/services/fileSpray.d.ts +95 -0
  99. package/types-3.4/services/wsDFU.d.ts +1 -1
  100. package/types-3.4/services/wsEcl.d.ts +5 -5
  101. package/types-3.4/services/wsLogaccess.d.ts +3 -3
  102. package/types-3.4/services/wsdl/FileSpray/v1.23/FileSpray.d.ts +5 -5
  103. package/types-3.4/services/wsdl/WsDFUXRef/v1.02/WsDFUXRef.d.ts +2 -2
  104. package/types-3.4/services/wsdl/WsDfu/v1.62/WsDfu.d.ts +4 -4
  105. package/types-3.4/services/wsdl/WsFileIO/v1.01/WsFileIO.d.ts +2 -2
  106. package/types-3.4/services/wsdl/WsPackageProcess/v1.04/WsPackageProcess.d.ts +1 -1
  107. package/types-3.4/services/wsdl/WsResources/v1.01/WsResources.d.ts +1 -1
  108. package/types-3.4/services/wsdl/WsSMC/v1.24/WsSMC.d.ts +3 -3
  109. package/types-3.4/services/wsdl/WsTopology/v1.31/WsTopology.d.ts +4 -4
  110. package/types-3.4/services/wsdl/WsWorkunits/v1.88/WsWorkunits.d.ts +8 -8
  111. package/types-3.4/services/wsdl/ws_access/v1.16/ws_access.d.ts +4 -4
  112. package/types-3.4/services/wsdl/ws_account/v1.05/ws_account.d.ts +1 -1
  113. package/types-3.4/services/wsdl/ws_codesign/v1.1/ws_codesign.d.ts +1 -1
  114. package/types-3.4/services/wsdl/ws_logaccess/v1/ws_logaccess.d.ts +3 -3
  115. package/types-3.4/services/wsdl/ws_logaccess/v1.04/ws_logaccess.d.ts +171 -0
  116. package/types-3.4/services/wsdl/ws_machine/v1.17/ws_machine.d.ts +3 -3
  117. package/types-3.4/services/wsdl/wsstore/v1.02/wsstore.d.ts +1 -1
@@ -0,0 +1,306 @@
1
+ import { Cache, IEvent, scopedLogger, StateCallback, StateEvents, StateObject, StatePropCallback } from "@hpcc-js/util";
2
+ import { IConnection, IOptions } from "../connection";
3
+ import { ESPExceptions } from "../espConnection";
4
+ import { WsSMC } from "../services/wsSMC";
5
+ import { FileSpray, SprayFixedEx, FileSprayService, SprayVariableEx } from "../services/fileSpray";
6
+ import * as WsTopology from "../services/wsTopology";
7
+
8
+ const logger = scopedLogger("@hpcc-js/comms/dfuWorkunit.ts");
9
+
10
+ enum States {
11
+ Unknown = 0,
12
+ Scheduled,
13
+ Queued,
14
+ Started,
15
+ Aborted,
16
+ Failed,
17
+ Finished,
18
+ Monitoring,
19
+ Aborting,
20
+ NotFound = 999
21
+ }
22
+
23
+ export class DFUWorkunitCache extends Cache<{ BaseUrl: string, ID: string }, DFUWorkunit> {
24
+ constructor() {
25
+ super((obj) => {
26
+ return `${obj.BaseUrl}-${obj.ID}`;
27
+ });
28
+ }
29
+ }
30
+ const _workunits = new DFUWorkunitCache();
31
+
32
+ export type DFUWorkunitEvents = "finished" | StateEvents;
33
+ export type UDFUWorkunitState = FileSpray.DFUWorkunit;
34
+ export type IDFUWorkunitState = FileSpray.DFUWorkunit | WsSMC.ActiveWorkunit;
35
+ export class DFUWorkunit extends StateObject<UDFUWorkunitState, IDFUWorkunitState> implements FileSpray.DFUWorkunit {
36
+ connection: FileSprayService;
37
+ topologyConnection: WsTopology.TopologyService;
38
+ get BaseUrl() { return this.connection.baseUrl; }
39
+
40
+ // Accessors ---
41
+ get properties(): FileSpray.DFUWorkunit { return this.get(); }
42
+ get ID(): string { return this.get("ID"); }
43
+ get DFUServerName(): string { return this.get("DFUServerName"); }
44
+ get ClusterName(): string { return this.get("ClusterName"); }
45
+ get JobName(): string { return this.get("JobName"); }
46
+ get Queue(): string { return this.get("Queue"); }
47
+ get User(): string { return this.get("User"); }
48
+ get isProtected(): boolean { return this.get("isProtected"); }
49
+ get Command(): number { return this.get("Command"); }
50
+ get CommandMessage(): string { return this.get("CommandMessage"); }
51
+ get PercentDone(): number { return this.get("PercentDone"); }
52
+ get SecsLeft(): number { return this.get("SecsLeft"); }
53
+ get ProgressMessage(): string { return this.get("ProgressMessage"); }
54
+ get SummaryMessage(): string { return this.get("SummaryMessage"); }
55
+ get State(): number { return this.get("State", States.Unknown); }
56
+ get SourceLogicalName(): string { return this.get("SourceLogicalName"); }
57
+ get SourceIP(): string { return this.get("SourceIP"); }
58
+ get SourceFilePath(): string { return this.get("SourceFilePath"); }
59
+ get SourceDali(): string { return this.get("SourceDali"); }
60
+ get SourceRecordSize(): number { return this.get("SourceRecordSize"); }
61
+ get SourceFormat(): number { return this.get("SourceFormat"); }
62
+ get RowTag(): string { return this.get("RowTag"); }
63
+ get SourceNumParts(): number { return this.get("SourceNumParts"); }
64
+ get SourceDirectory(): string { return this.get("SourceDirectory"); }
65
+ get DestLogicalName(): string { return this.get("DestLogicalName"); }
66
+ get DestGroupName(): string { return this.get("DestGroupName"); }
67
+ get DestDirectory(): string { return this.get("DestDirectory"); }
68
+ get DestIP(): string { return this.get("DestIP"); }
69
+ get DestFilePath(): string { return this.get("DestFilePath"); }
70
+ get DestFormat(): number { return this.get("DestFormat"); }
71
+ get DestNumParts(): number { return this.get("DestNumParts"); }
72
+ get DestRecordSize(): number { return this.get("DestRecordSize"); }
73
+ get Replicate(): boolean { return this.get("Replicate"); }
74
+ get Overwrite(): boolean { return this.get("Overwrite"); }
75
+ get Compress(): boolean { return this.get("Compress"); }
76
+ get SourceCsvSeparate(): string { return this.get("SourceCsvSeparate"); }
77
+ get SourceCsvQuote(): string { return this.get("SourceCsvQuote"); }
78
+ get SourceCsvTerminate(): string { return this.get("SourceCsvTerminate"); }
79
+ get SourceCsvEscape(): string { return this.get("SourceCsvEscape"); }
80
+ get TimeStarted(): string { return this.get("TimeStarted"); }
81
+ get TimeStopped(): string { return this.get("TimeStopped"); }
82
+ get StateMessage(): string { return this.get("StateMessage"); }
83
+ get MonitorEventName(): string { return this.get("MonitorEventName"); }
84
+ get MonitorSub(): boolean { return this.get("MonitorSub"); }
85
+ get MonitorShotLimit(): number { return this.get("MonitorShotLimit"); }
86
+ get SourceDiffKeyName(): string { return this.get("SourceDiffKeyName"); }
87
+ get DestDiffKeyName(): string { return this.get("DestDiffKeyName"); }
88
+ get Archived(): boolean { return this.get("Archived"); }
89
+ get encrypt(): string { return this.get("encrypt"); }
90
+ get decrypt(): string { return this.get("decrypt"); }
91
+ get failIfNoSourceFile(): boolean { return this.get("failIfNoSourceFile"); }
92
+ get recordStructurePresent(): boolean { return this.get("recordStructurePresent"); }
93
+ get quotedTerminator(): boolean { return this.get("quotedTerminator"); }
94
+ get preserveCompression(): boolean { return this.get("preserveCompression"); }
95
+ get expireDays(): number { return this.get("expireDays"); }
96
+ get PreserveFileParts(): boolean { return this.get("PreserveFileParts"); }
97
+ get FileAccessCost(): number { return this.get("FileAccessCost"); }
98
+
99
+ // Factories ---
100
+ static create(optsConnection: IOptions | IConnection, dfuServerQueue: string): Promise<DFUWorkunit> {
101
+ const retVal: DFUWorkunit = new DFUWorkunit(optsConnection);
102
+ return retVal.connection.CreateDFUWorkunit({ DFUServerQueue: dfuServerQueue }).then((response) => {
103
+ _workunits.set(retVal);
104
+ retVal.set(response.result);
105
+ return retVal;
106
+ });
107
+ }
108
+
109
+ static attach(optsConnection: IOptions | IConnection, wuid: string, state?: IDFUWorkunitState): DFUWorkunit {
110
+ const retVal: DFUWorkunit = _workunits.get({ BaseUrl: optsConnection.baseUrl, ID: wuid }, () => {
111
+ return new DFUWorkunit(optsConnection, wuid);
112
+ });
113
+ if (state) {
114
+ retVal.set(state);
115
+ }
116
+ return retVal;
117
+ }
118
+
119
+ static sprayFixed(server: IOptions | IConnection, request: Partial<SprayFixedEx>): Promise<DFUWorkunit> {
120
+ const service = new FileSprayService(server);
121
+ return service.SprayFixedEx({
122
+ ...request
123
+ }).then(response => {
124
+ const wuid = response.wuid;
125
+ return service.GetDFUWorkunit({ wuid }).then(response => {
126
+ return DFUWorkunit.attach(server, wuid, response.result);
127
+ });
128
+ });
129
+ }
130
+
131
+ static sprayVariable(server: IOptions | IConnection, request: Partial<SprayVariableEx>): Promise<DFUWorkunit> {
132
+ const service = new FileSprayService(server);
133
+ return service.SprayVariableEx({
134
+ ...request
135
+ }).then(response => {
136
+ const wuid = response.wuid;
137
+ return service.GetDFUWorkunit({ wuid }).then(response => {
138
+ return DFUWorkunit.attach(server, wuid, response.result);
139
+ });
140
+ });
141
+ }
142
+
143
+ static despray(server: IOptions | IConnection, request: Partial<FileSpray.Despray>): Promise<DFUWorkunit> {
144
+ const service = new FileSprayService(server);
145
+ return service.DesprayEx({
146
+ ...request
147
+ }).then(response => {
148
+ const wuid = response.wuid;
149
+ return service.GetDFUWorkunit({ wuid }).then(response => {
150
+ return DFUWorkunit.attach(server, wuid, response.result);
151
+ });
152
+ });
153
+ }
154
+
155
+ isComplete(): boolean {
156
+ switch (this.State) {
157
+ case States.Finished:
158
+ case States.Failed:
159
+ case States.Aborted:
160
+ case States.NotFound:
161
+ return true;
162
+ default:
163
+ }
164
+ return false;
165
+ }
166
+
167
+ isFailed() {
168
+ if (this.isComplete() && this.State !== States.Finished) {
169
+ return true;
170
+ }
171
+ return false;
172
+ }
173
+
174
+ isDeleted() {
175
+ switch (this.State) {
176
+ case States.NotFound:
177
+ return true;
178
+ default:
179
+ }
180
+ return false;
181
+ }
182
+
183
+ isRunning(): boolean {
184
+ return !this.isComplete();
185
+ }
186
+
187
+ async refresh(full: boolean = false): Promise<this> {
188
+ await this.GetDFUWorkunit();
189
+ return this;
190
+ }
191
+
192
+ // Monitoring ---
193
+ protected _monitor(): void {
194
+ if (this.isComplete()) {
195
+ this._monitorTickCount = 0;
196
+ return;
197
+ }
198
+ super._monitor();
199
+ }
200
+
201
+ protected _monitorTimeoutDuration(): number {
202
+ const retVal = super._monitorTimeoutDuration();
203
+ if (this._monitorTickCount <= 1) { // Once
204
+ return 3000;
205
+ } else if (this._monitorTickCount <= 5) { // Twice
206
+ return 6000;
207
+ } else if (this._monitorTickCount <= 7) { // Twice
208
+ return 12000;
209
+ }
210
+ return retVal;
211
+ }
212
+
213
+ // Events ---
214
+ on(eventID: DFUWorkunitEvents, propIDorCallback: StateCallback | keyof UDFUWorkunitState, callback?: StatePropCallback): this {
215
+ if (this.isCallback(propIDorCallback)) {
216
+ switch (eventID) {
217
+ case "finished":
218
+ super.on("propChanged", "State", (changeInfo: IEvent) => {
219
+ if (this.isComplete()) {
220
+ propIDorCallback([changeInfo]);
221
+ }
222
+ });
223
+ break;
224
+ case "changed":
225
+ super.on(eventID, propIDorCallback);
226
+ break;
227
+ default:
228
+ }
229
+ } else {
230
+ switch (eventID) {
231
+ case "changed":
232
+ super.on(eventID, propIDorCallback, callback!);
233
+ break;
234
+ default:
235
+ }
236
+ }
237
+ this._monitor();
238
+ return this;
239
+ }
240
+
241
+ watchUntilComplete(callback?: StateCallback): Promise<this> {
242
+ return new Promise((resolve, _) => {
243
+ const watchHandle = this.watch((changes) => {
244
+ if (callback) {
245
+ callback(changes);
246
+ }
247
+ if (this.isComplete()) {
248
+ watchHandle.release();
249
+ resolve(this);
250
+ }
251
+ });
252
+ });
253
+ }
254
+
255
+ watchUntilRunning(callback?: StateCallback): Promise<this> {
256
+ return new Promise((resolve, _) => {
257
+ const watchHandle = this.watch((changes) => {
258
+ if (callback) {
259
+ callback(changes);
260
+ }
261
+ if (this.isComplete() || this.isRunning()) {
262
+ watchHandle.release();
263
+ resolve(this);
264
+ }
265
+ });
266
+ });
267
+ }
268
+
269
+ // --- --- ---
270
+ protected constructor(optsConnection: IOptions | IConnection, wuid?: string) {
271
+ super();
272
+ this.connection = new FileSprayService(optsConnection);
273
+ this.topologyConnection = new WsTopology.TopologyService(optsConnection);
274
+ this.clearState(wuid);
275
+ }
276
+
277
+ clearState(wuid?: string) {
278
+ this.clear({
279
+ ID: wuid,
280
+ State: States.Unknown
281
+ });
282
+ }
283
+
284
+ // FileSpray passthroughs ---
285
+ protected GetDFUWorkunit(_request: Partial<FileSpray.GetDFUWorkunit> = {}): Promise<FileSpray.GetDFUWorkunitResponse> {
286
+ return this.connection.GetDFUWorkunit({ ..._request, wuid: this.ID }).then((response) => {
287
+ this.set(response.result);
288
+ return response;
289
+ }).catch((e: ESPExceptions) => {
290
+ // deleted ---
291
+ const wuMissing = e.Exception.some((exception) => {
292
+ if (exception.Code === 20081) {
293
+ this.clearState(this.ID);
294
+ this.set("State", States.NotFound);
295
+ return true;
296
+ }
297
+ return false;
298
+ });
299
+ if (!wuMissing) {
300
+ logger.warning("Unexpected exception: ");
301
+ throw e;
302
+ }
303
+ return {} as FileSpray.GetDFUWorkunitResponse;
304
+ });
305
+ }
306
+ }
@@ -724,8 +724,8 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
724
724
  super._monitor();
725
725
  }
726
726
 
727
- protected _monitorTimeoutDuraction(): number {
728
- const retVal = super._monitorTimeoutDuraction();
727
+ protected _monitorTimeoutDuration(): number {
728
+ const retVal = super._monitorTimeoutDuration();
729
729
  if (this._monitorTickCount <= 1) { // Once
730
730
  return 1000;
731
731
  } else if (this._monitorTickCount <= 3) { // Twice
@@ -32,6 +32,7 @@ export * from "./ecl/store";
32
32
  export * from "./ecl/timer";
33
33
  export * from "./ecl/topology";
34
34
  export * from "./ecl/targetCluster";
35
+ export * from "./ecl/dfuWorkunit";
35
36
  export * from "./ecl/workunit";
36
37
  export * from "./ecl/xsdParser";
37
38
 
@@ -4,5 +4,113 @@ export {
4
4
  FileSpray
5
5
  };
6
6
 
7
+ export interface SprayFixedEx {
8
+ sourceIP?: string;
9
+ sourcePlane?: string;
10
+ sourcePath?: string;
11
+ srcxml?: string;
12
+ sourceFormat?: string;
13
+ sourceRecordSize?: number;
14
+ destGroup?: string;
15
+ destLogicalName?: string;
16
+ overwrite?: boolean;
17
+ replicate?: boolean;
18
+ ReplicateOffset?: number;
19
+ maxConnections?: number;
20
+ throttle?: number;
21
+ transferBufferSize?: number;
22
+ prefix?: string;
23
+ nosplit?: boolean;
24
+ norecover?: boolean;
25
+ compress?: boolean;
26
+ push?: boolean;
27
+ pull?: boolean;
28
+ noCommon?: boolean;
29
+ encrypt?: string;
30
+ decrypt?: string;
31
+ wrap?: boolean;
32
+ failIfNoSourceFile?: boolean;
33
+ recordStructurePresent?: boolean;
34
+ quotedTerminator?: boolean;
35
+ expireDays?: number;
36
+ DFUServerQueue?: string;
37
+ }
38
+
39
+ export interface SprayVariableEx {
40
+ sourceIP?: string;
41
+ sourcePlane?: string;
42
+ sourcePath?: string;
43
+ srcxml?: string;
44
+ sourceMaxRecordSize?: number;
45
+ sourceFormat?: number;
46
+ NoSourceCsvSeparator?: boolean;
47
+ sourceCsvSeparate?: string;
48
+ sourceCsvTerminate?: string;
49
+ sourceCsvQuote?: string;
50
+ sourceCsvEscape?: string;
51
+ sourceRowTag?: string;
52
+ destGroup?: string;
53
+ destLogicalName?: string;
54
+ overwrite?: boolean;
55
+ replicate?: boolean;
56
+ ReplicateOffset?: number;
57
+ maxConnections?: number;
58
+ throttle?: number;
59
+ transferBufferSize?: number;
60
+ prefix?: string;
61
+ nosplit?: boolean;
62
+ norecover?: boolean;
63
+ compress?: boolean;
64
+ push?: boolean;
65
+ pull?: boolean;
66
+ noCommon?: boolean;
67
+ encrypt?: string;
68
+ decrypt?: string;
69
+ failIfNoSourceFile?: boolean;
70
+ recordStructurePresent?: boolean;
71
+ quotedTerminator?: boolean;
72
+ sourceRowPath?: string;
73
+ isJSON?: boolean;
74
+ expireDays?: number;
75
+ DFUServerQueue?: string;
76
+ srcUsername?: string;
77
+ srcPassword?: string;
78
+ }
79
+
80
+ export interface DesprayEx {
81
+ destGroup?: string;
82
+ sourceLogicalName?: string;
83
+ destIP?: string;
84
+ destPath?: string;
85
+ destPlane?: string;
86
+ dstxml?: string;
87
+ overwrite?: boolean;
88
+ maxConnections?: number;
89
+ throttle?: number;
90
+ transferBufferSize?: number;
91
+ splitprefix?: string;
92
+ norecover?: boolean;
93
+ wrap?: boolean;
94
+ multiCopy?: boolean;
95
+ SingleConnection?: boolean;
96
+ DFUServerQueue?: string;
97
+ compress?: boolean;
98
+ encrypt?: string;
99
+ decrypt?: string;
100
+ }
101
+
7
102
  export class FileSprayService extends FileSprayServiceBase {
103
+
104
+ SprayFixedEx(request: SprayFixedEx): Promise<FileSpray.SprayFixedResponse> {
105
+ return this._connection.send("SprayFixed", request);
106
+ }
107
+
108
+ SprayVariableEx(request: SprayVariableEx): Promise<FileSpray.SprayResponse> {
109
+ return this._connection.send("SprayVariable", request, "json", false, null, "SprayResponse");
110
+ }
111
+
112
+ DesprayEx(request: DesprayEx): Promise<FileSpray.DesprayResponse> {
113
+ return this._connection.send("Despray", request);
114
+ }
115
+
8
116
  }
@@ -1,5 +1,5 @@
1
1
  import { scopedLogger } from "@hpcc-js/util";
2
- import { LogaccessServiceBase, WsLogaccess } from "./wsdl/ws_logaccess/v1.03/ws_logaccess";
2
+ import { LogaccessServiceBase, WsLogaccess } from "./wsdl/ws_logaccess/v1.04/ws_logaccess";
3
3
 
4
4
  const logger = scopedLogger("@hpcc-js/comms/services/wsLogaccess.ts");
5
5
 
@@ -9,7 +9,7 @@ export {
9
9
 
10
10
  export interface GetLogsExRequest {
11
11
  audience?: string;
12
- class?: string;
12
+ class?: string[];
13
13
  jobId?: string;
14
14
  message?: string;
15
15
  procId?: string;
@@ -35,7 +35,7 @@ export const enum LogType {
35
35
  export const enum TargetAudience {
36
36
  Operator = "OPR",
37
37
  User = "USR",
38
- Programmer = "PRO",
38
+ Programmer = "PRG",
39
39
  Audit = "ADT"
40
40
  }
41
41
 
@@ -133,7 +133,7 @@ export class LogaccessService extends LogaccessServiceBase {
133
133
  BinaryLogFilter: [{
134
134
  leftFilter: {
135
135
  LogCategory: WsLogaccess.LogAccessType.All,
136
- } as WsLogaccess.leftFilter,
136
+ },
137
137
  } as WsLogaccess.BinaryLogFilter]
138
138
  }
139
139
  },
@@ -149,34 +149,78 @@ export class LogaccessService extends LogaccessServiceBase {
149
149
  const filters: WsLogaccess.leftFilter[] = [];
150
150
  for (const key in request) {
151
151
  if (key in ElasticKnownColumns) {
152
- filters.push({
153
- LogCategory: WsLogaccess.LogAccessType.ByFieldName,
154
- SearchField: ElasticKnownColumns[key],
155
- SearchByValue: request[key]
156
- });
152
+ if (Array.isArray(request[key])) {
153
+ request[key].forEach(value => {
154
+ filters.push({
155
+ LogCategory: WsLogaccess.LogAccessType.ByFieldName,
156
+ SearchField: ElasticKnownColumns[key],
157
+ SearchByValue: value
158
+ });
159
+ });
160
+ } else {
161
+ filters.push({
162
+ LogCategory: WsLogaccess.LogAccessType.ByFieldName,
163
+ SearchField: ElasticKnownColumns[key],
164
+ SearchByValue: request[key]
165
+ });
166
+ }
167
+
157
168
  }
158
169
  }
159
170
 
160
- let binaryLogFilter = getLogsRequest.Filter.leftBinaryFilter.BinaryLogFilter[0];
161
- filters.forEach((filter, i) => {
162
- if (i === 0) {
163
- binaryLogFilter.leftFilter = filter;
164
- } else if (i === filters.length - 1) {
165
- binaryLogFilter.Operator = WsLogaccess.LogAccessFilterOperator.AND;
166
- binaryLogFilter.rightFilter = filter;
167
- } else {
168
- binaryLogFilter.Operator = WsLogaccess.LogAccessFilterOperator.AND;
169
- binaryLogFilter.rightBinaryFilter = {
170
- BinaryLogFilter: [{
171
- leftFilter: filter
172
- } as WsLogaccess.BinaryLogFilter]
171
+ if (filters.length > 2) {
172
+ let binaryLogFilter = getLogsRequest.Filter.leftBinaryFilter.BinaryLogFilter[0];
173
+ filters.forEach((filter, i) => {
174
+ let operator = WsLogaccess.LogAccessFilterOperator.AND;
175
+ if (i > 0) {
176
+ if (filters[i - 1].SearchField === filter.SearchField) {
177
+ operator = WsLogaccess.LogAccessFilterOperator.OR;
178
+ }
179
+ if (i === filters.length - 1) {
180
+ binaryLogFilter.Operator = operator;
181
+ binaryLogFilter.rightFilter = filter as WsLogaccess.rightFilter;
182
+ } else {
183
+ binaryLogFilter.Operator = operator;
184
+ binaryLogFilter.rightBinaryFilter = {
185
+ BinaryLogFilter: [{
186
+ leftFilter: filter
187
+ } as WsLogaccess.BinaryLogFilter]
188
+ };
189
+ binaryLogFilter = binaryLogFilter.rightBinaryFilter.BinaryLogFilter[0];
190
+ }
191
+ } else {
192
+ binaryLogFilter.leftFilter = filter as WsLogaccess.leftFilter;
193
+ }
194
+ });
195
+ } else {
196
+ delete getLogsRequest.Filter.leftBinaryFilter;
197
+ getLogsRequest.Filter.leftFilter = {
198
+ LogCategory: WsLogaccess.LogAccessType.All
199
+ } as WsLogaccess.leftFilter;
200
+ if (filters[0]?.SearchField) {
201
+ getLogsRequest.Filter.leftFilter = {
202
+ LogCategory: filters[0]?.LogCategory,
203
+ SearchField: filters[0]?.SearchField,
204
+ SearchByValue: filters[0]?.SearchByValue
173
205
  };
174
- binaryLogFilter = binaryLogFilter.rightBinaryFilter.BinaryLogFilter[0];
175
206
  }
176
- });
207
+ if (filters[1]?.SearchField) {
208
+ getLogsRequest.Filter.Operator = WsLogaccess.LogAccessFilterOperator.AND;
209
+ if (filters[0].SearchField === filters[1].SearchField) {
210
+ getLogsRequest.Filter.Operator = WsLogaccess.LogAccessFilterOperator.OR;
211
+ }
212
+ getLogsRequest.Filter.rightFilter = {
213
+ LogCategory: filters[0]?.LogCategory,
214
+ SearchField: filters[1]?.SearchField,
215
+ SearchByValue: filters[1]?.SearchByValue
216
+ };
217
+ }
218
+ }
177
219
 
178
- if (request.StartDate && request.EndDate) {
220
+ if (request.StartDate) {
179
221
  getLogsRequest.Range.StartDate = request.StartDate.toISOString();
222
+ }
223
+ if (request.EndDate) {
180
224
  getLogsRequest.Range.EndDate = request.EndDate.toISOString();
181
225
  }
182
226
 
@@ -197,7 +241,7 @@ export class LogaccessService extends LogaccessServiceBase {
197
241
  }
198
242
  return {
199
243
  lines: lines,
200
- total: response.TotalLogLinesAvailable || 10000
244
+ total: response.TotalLogLinesAvailable ?? 10000
201
245
  };
202
246
  } catch (e) {
203
247
  logger.error(e);