@hpcc-js/comms 3.15.4 → 3.15.6

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 (130) hide show
  1. package/LICENSE +43 -43
  2. package/README.md +50 -50
  3. package/dist/browser/index.js +1 -1
  4. package/dist/browser/index.js.map +1 -1
  5. package/dist/browser/index.umd.cjs +1 -1
  6. package/dist/browser/index.umd.cjs.map +1 -1
  7. package/dist/node/index.cjs +10 -10
  8. package/dist/node/index.cjs.map +4 -4
  9. package/dist/node/index.js +9 -9
  10. package/dist/node/index.js.map +4 -4
  11. package/package.json +7 -7
  12. package/src/__package__.ts +3 -3
  13. package/src/clienttools/eclMeta.ts +506 -506
  14. package/src/clienttools/eclcc.ts +628 -628
  15. package/src/connection.ts +288 -288
  16. package/src/ecl/activity.ts +82 -82
  17. package/src/ecl/dfuWorkunit.ts +363 -363
  18. package/src/ecl/graph.ts +196 -196
  19. package/src/ecl/logicalFile.ts +196 -196
  20. package/src/ecl/machine.ts +63 -63
  21. package/src/ecl/query.ts +265 -265
  22. package/src/ecl/queryGraph.ts +813 -813
  23. package/src/ecl/resource.ts +39 -39
  24. package/src/ecl/result.ts +245 -245
  25. package/src/ecl/scope.ts +188 -188
  26. package/src/ecl/sourceFile.ts +34 -34
  27. package/src/ecl/store.ts +154 -154
  28. package/src/ecl/targetCluster.ts +149 -149
  29. package/src/ecl/timer.ts +42 -42
  30. package/src/ecl/topology.ts +131 -131
  31. package/src/ecl/workunit.ts +1340 -1340
  32. package/src/ecl/xsdParser.ts +267 -267
  33. package/src/espConnection.ts +164 -164
  34. package/src/index.browser.ts +1 -1
  35. package/src/index.common.ts +40 -40
  36. package/src/index.node.ts +48 -48
  37. package/src/pem/trustwave.ts +909 -909
  38. package/src/services/fileSpray.ts +73 -73
  39. package/src/services/wsAccess.ts +8 -8
  40. package/src/services/wsAccount.ts +27 -27
  41. package/src/services/wsCloud.ts +73 -73
  42. package/src/services/wsCodesign.ts +18 -18
  43. package/src/services/wsDFU.ts +34 -34
  44. package/src/services/wsDFUXRef.ts +121 -121
  45. package/src/services/wsDali.ts +8 -8
  46. package/src/services/wsEcl.ts +123 -123
  47. package/src/services/wsElk.ts +8 -8
  48. package/src/services/wsLogaccess.ts +270 -270
  49. package/src/services/wsMachine.ts +89 -89
  50. package/src/services/wsPackageProcess.ts +8 -8
  51. package/src/services/wsResources.ts +8 -8
  52. package/src/services/wsSMC.ts +80 -80
  53. package/src/services/wsSasha.ts +7 -7
  54. package/src/services/wsStore.ts +32 -32
  55. package/src/services/wsTopology.ts +45 -45
  56. package/src/services/wsWorkunits.ts +151 -151
  57. package/src/services/wsdl/FileSpray/v1.23/FileSpray.ts +1008 -1008
  58. package/src/services/wsdl/FileSpray/v1.25/FileSpray.ts +1040 -1040
  59. package/src/services/wsdl/FileSpray/v1.26/FileSpray.ts +929 -929
  60. package/src/services/wsdl/FileSpray/v1.27/FileSpray.ts +930 -930
  61. package/src/services/wsdl/WsCloud/v1/WsCloud.ts +38 -38
  62. package/src/services/wsdl/WsCloud/v1.02/WsCloud.ts +77 -77
  63. package/src/services/wsdl/WsDFUXRef/v1.02/WsDFUXRef.ts +224 -224
  64. package/src/services/wsdl/WsDFUXRef/v1.04/WsDFUXRef.ts +228 -227
  65. package/src/services/wsdl/WsDali/v1.04/WsDali.ts +216 -216
  66. package/src/services/wsdl/WsDali/v1.07/WsDali.ts +72 -72
  67. package/src/services/wsdl/WsDfu/v1.62/WsDfu.ts +1455 -1455
  68. package/src/services/wsdl/WsDfu/v1.63/WsDfu.ts +1465 -1465
  69. package/src/services/wsdl/WsDfu/v1.65/WsDfu.ts +1244 -1244
  70. package/src/services/wsdl/WsDfu/v1.66/WsDfu.ts +1267 -1267
  71. package/src/services/wsdl/WsDfu/v1.67/WsDfu.ts +1268 -1268
  72. package/src/services/wsdl/WsDfu/v1.68/WsDfu.ts +1301 -0
  73. package/src/services/wsdl/WsESDLConfig/v1.5/WsESDLConfig.ts +366 -0
  74. package/src/services/wsdl/WsFileIO/v1.01/WsFileIO.ts +104 -104
  75. package/src/services/wsdl/WsPackageProcess/v1.04/WsPackageProcess.ts +519 -519
  76. package/src/services/wsdl/WsPackageProcess/v1.07/WsPackageProcess.ts +500 -500
  77. package/src/services/wsdl/WsPackageProcess/v1.08/WsPackageProcess.ts +503 -0
  78. package/src/services/wsdl/WsResources/v1.01/WsResources.ts +119 -119
  79. package/src/services/wsdl/WsSMC/v1.24/WsSMC.ts +665 -665
  80. package/src/services/wsdl/WsSMC/v1.27/WsSMC.ts +591 -591
  81. package/src/services/wsdl/WsSMC/v1.28/WsSMC.ts +645 -645
  82. package/src/services/wsdl/WsSMC/v1.29/WsSMC.ts +660 -660
  83. package/src/services/wsdl/WsSasha/v1.01/WsSasha.ts +18 -18
  84. package/src/services/wsdl/WsTopology/v1.31/WsTopology.ts +856 -856
  85. package/src/services/wsdl/WsTopology/v1.32/WsTopology.ts +786 -786
  86. package/src/services/wsdl/WsTopology/v1.33/WsTopology.ts +835 -835
  87. package/src/services/wsdl/WsWorkunits/v1.88/WsWorkunits.ts +2944 -2944
  88. package/src/services/wsdl/WsWorkunits/v1.94/WsWorkunits.ts +3072 -3072
  89. package/src/services/wsdl/WsWorkunits/v1.95/WsWorkunits.ts +3073 -3073
  90. package/src/services/wsdl/WsWorkunits/v1.97/WsWorkunits.ts +3134 -3134
  91. package/src/services/wsdl/WsWorkunits/v1.98/WsWorkunits.ts +3182 -3182
  92. package/src/services/wsdl/WsWorkunits/v1.99/WsWorkunits.ts +3162 -3162
  93. package/src/services/wsdl/WsWorkunits/v2/WsWorkunits.ts +3153 -3153
  94. package/src/services/wsdl/WsWorkunits/v2.02/WsWorkunits.ts +3162 -3162
  95. package/src/services/wsdl/WsWorkunits/v2.03/WsWorkunits.ts +3164 -3164
  96. package/src/services/wsdl/WsWorkunits/v2.04/WsWorkunits.ts +3171 -3171
  97. package/src/services/wsdl/WsWorkunits/v2.05/WsWorkunits.ts +3177 -0
  98. package/src/services/wsdl/ws_access/v1.16/ws_access.ts +1086 -1086
  99. package/src/services/wsdl/ws_access/v1.17/ws_access.ts +1023 -1023
  100. package/src/services/wsdl/ws_account/v1.05/ws_account.ts +111 -111
  101. package/src/services/wsdl/ws_account/v1.06/ws_account.ts +109 -109
  102. package/src/services/wsdl/ws_account/v1.07/ws_account.ts +114 -114
  103. package/src/services/wsdl/ws_codesign/v1.1/ws_codesign.ts +95 -95
  104. package/src/services/wsdl/ws_elk/v1/ws_elk.ts +47 -47
  105. package/src/services/wsdl/ws_logaccess/v1/ws_logaccess.ts +83 -83
  106. package/src/services/wsdl/ws_logaccess/v1.02/ws_logaccess.ts +161 -161
  107. package/src/services/wsdl/ws_logaccess/v1.03/ws_logaccess.ts +190 -190
  108. package/src/services/wsdl/ws_logaccess/v1.04/ws_logaccess.ts +215 -215
  109. package/src/services/wsdl/ws_logaccess/v1.05/ws_logaccess.ts +219 -219
  110. package/src/services/wsdl/ws_logaccess/v1.08/ws_logaccess.ts +267 -267
  111. package/src/services/wsdl/ws_machine/v1.17/ws_machine.ts +567 -567
  112. package/src/services/wsdl/ws_machine/v1.18/ws_machine.ts +497 -497
  113. package/src/services/wsdl/ws_machine/v1.19/ws_machine.ts +497 -497
  114. package/src/services/wsdl/wsstore/v1.02/wsstore.ts +239 -239
  115. package/types/services/wsPackageProcess.d.ts +1 -1
  116. package/types/services/wsWorkunits.d.ts +1 -1
  117. package/types/services/wsdl/FileSpray/v1.27/FileSpray.d.ts +506 -506
  118. package/types/services/wsdl/WsCloud/v1.02/WsCloud.d.ts +18 -18
  119. package/types/services/wsdl/WsDFUXRef/v1.04/WsDFUXRef.d.ts +58 -57
  120. package/types/services/wsdl/WsDali/v1.07/WsDali.d.ts +42 -42
  121. package/types/services/wsdl/WsPackageProcess/{v1.07 → v1.08}/WsPackageProcess.d.ts +121 -118
  122. package/types/services/wsdl/WsSasha/v1.01/WsSasha.d.ts +13 -13
  123. package/types/services/wsdl/WsTopology/v1.33/WsTopology.d.ts +360 -360
  124. package/types/services/wsdl/WsWorkunits/v2.05/WsWorkunits.d.ts +2571 -0
  125. package/types/services/wsdl/ws_access/v1.17/ws_access.d.ts +268 -268
  126. package/types/services/wsdl/ws_account/v1.07/ws_account.d.ts +34 -34
  127. package/types/services/wsdl/ws_codesign/v1.1/ws_codesign.d.ts +22 -22
  128. package/types/services/wsdl/ws_elk/v1/ws_elk.d.ts +12 -12
  129. package/types/services/wsdl/wsstore/v1.02/wsstore.d.ts +61 -61
  130. package/types/services/wsdl/WsWorkunits/v2.04/WsWorkunits.d.ts +0 -2565
@@ -1,196 +1,196 @@
1
- import { Cache, scopedLogger, StateObject } from "@hpcc-js/util";
2
- import { IConnection, IOptions } from "../connection.ts";
3
- import { DFUService, WsDfu } from "../services/wsDFU.ts";
4
- import { ESPExceptions } from "../espConnection.ts";
5
-
6
- const logger = scopedLogger("logicalFile.ts");
7
-
8
- export class LogicalFileCache extends Cache<{ BaseUrl: string, Cluster: string, Name: string }, LogicalFile> {
9
- constructor() {
10
- super((obj) => {
11
- return `${obj.BaseUrl}-${obj.Cluster}-${obj.Name}`;
12
- });
13
- }
14
- }
15
- const _store = new LogicalFileCache();
16
-
17
- export interface DFUPartEx extends WsDfu.DFUPart {
18
- // From WsDfu.DFUFilePartsOnCluster ---
19
- Cluster: string;
20
- BaseDir: string;
21
- ReplicateDir: string;
22
- Replicate: boolean;
23
- CanReplicate: boolean;
24
- }
25
-
26
- export interface FileDetailEx extends WsDfu.FileDetail {
27
- Cluster: string;
28
- StateID?: number;
29
- }
30
-
31
- export class LogicalFile extends StateObject<FileDetailEx, FileDetailEx> implements FileDetailEx {
32
- protected connection: DFUService;
33
- get BaseUrl() { return this.connection.baseUrl; }
34
-
35
- get Cluster(): string { return this.get("Cluster"); }
36
- get Name(): string { return this.get("Name"); }
37
-
38
- get Filename(): string { return this.get("Filename"); }
39
- get Prefix(): string { return this.get("Prefix"); }
40
- get NodeGroup(): string { return this.get("NodeGroup"); }
41
- get NumParts(): number { return this.get("NumParts"); }
42
- get Description(): string { return this.get("Description"); }
43
- get Dir(): string { return this.get("Dir"); }
44
- get PathMask(): string { return this.get("PathMask"); }
45
- get Filesize(): string { return this.get("Filesize"); }
46
- get FileSizeInt64(): number { return this.get("FileSizeInt64"); }
47
- get RecordSize(): string { return this.get("RecordSize"); }
48
- get RecordCount(): string { return this.get("RecordCount"); }
49
- get RecordSizeInt64(): number { return this.get("RecordSizeInt64"); }
50
- get RecordCountInt64(): number { return this.get("RecordCountInt64"); }
51
- get Wuid(): string { return this.get("Wuid"); }
52
- get Owner(): string { return this.get("Owner"); }
53
- get JobName(): string { return this.get("JobName"); }
54
- get Persistent(): string { return this.get("Persistent"); }
55
- get Format(): string { return this.get("Format"); }
56
- get MaxRecordSize(): string { return this.get("MaxRecordSize"); }
57
- get CsvSeparate(): string { return this.get("CsvSeparate"); }
58
- get CsvQuote(): string { return this.get("CsvQuote"); }
59
- get CsvTerminate(): string { return this.get("CsvTerminate"); }
60
- get CsvEscape(): string { return this.get("CsvEscape"); }
61
- get Modified(): string { return this.get("Modified"); }
62
- get Ecl(): string { return this.get("Ecl"); }
63
- get Stat(): WsDfu.Stat { return this.get("Stat"); }
64
- get DFUFilePartsOnClusters(): WsDfu.DFUFilePartsOnClusters { return this.get("DFUFilePartsOnClusters"); }
65
- get isSuperfile(): boolean { return this.get("isSuperfile"); }
66
- get ShowFileContent(): boolean { return this.get("ShowFileContent"); }
67
- get subfiles(): WsDfu.subfiles { return this.get("subfiles"); }
68
- get Superfiles(): WsDfu.Superfiles { return this.get("Superfiles"); }
69
- get ProtectList(): WsDfu.ProtectList { return this.get("ProtectList"); }
70
- get FromRoxieCluster(): boolean { return this.get("FromRoxieCluster"); }
71
- get Graphs(): WsDfu.Graphs { return this.get("Graphs"); }
72
- get UserPermission(): string { return this.get("UserPermission"); }
73
- get ContentType(): string { return this.get("ContentType"); }
74
- get CompressedFileSize(): number { return this.get("CompressedFileSize"); }
75
- get PercentCompressed(): string { return this.get("PercentCompressed"); }
76
- get IsCompressed(): boolean { return this.get("IsCompressed"); }
77
- get BrowseData(): boolean { return this.get("BrowseData"); }
78
- get jsonInfo(): string { return this.get("jsonInfo"); }
79
- get binInfo(): WsDfu.base64Binary { return this.get("binInfo"); }
80
- get PackageID(): string { return this.get("PackageID"); }
81
- get Partition(): WsDfu.Partition { return this.get("Partition"); }
82
- get Blooms(): WsDfu.Blooms { return this.get("Blooms"); }
83
- get ExpireDays(): number { return this.get("ExpireDays"); }
84
- get KeyType(): string { return this.get("KeyType"); }
85
- get IsRestricted(): boolean { return this.get("IsRestricted"); }
86
- get AtRestCost(): number { return this.get("AtRestCost"); }
87
- get AccessCost(): number { return this.get("AccessCost"); }
88
- get StateID(): number { return this.get("StateID"); }
89
- get ExpirationDate(): string { return this.get("ExpirationDate"); }
90
- get ExtendedIndexInfo(): WsDfu.ExtendedIndexInfo { return this.get("ExtendedIndexInfo"); }
91
- get CompressionType(): string { return this.get("CompressionType"); }
92
-
93
- get properties(): FileDetailEx { return this.get(); }
94
-
95
- static attach(optsConnection: IOptions | IConnection | DFUService, Cluster: string, Name: string, state?: FileDetailEx): LogicalFile {
96
- const retVal: LogicalFile = _store.get({ BaseUrl: optsConnection.baseUrl, Cluster, Name }, () => {
97
- return new LogicalFile(optsConnection, Cluster, Name);
98
- });
99
- if (state) {
100
- retVal.set(state);
101
- }
102
- return retVal;
103
- }
104
-
105
- protected constructor(optsConnection: IOptions | IConnection | DFUService, Cluster: string, Name: string) {
106
- super();
107
- if (optsConnection instanceof DFUService) {
108
- this.connection = optsConnection;
109
- } else {
110
- this.connection = new DFUService(optsConnection);
111
- }
112
-
113
- this.clear({
114
- Cluster,
115
- Name
116
- });
117
- }
118
-
119
- filePartsOnCluster() {
120
- return [...(this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster || [])];
121
- }
122
-
123
- fileParts() {
124
- const retVal: DFUPartEx[] = [];
125
- for (const poc of this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster || []) {
126
- for (const part of poc?.DFUFileParts?.DFUPart || []) {
127
- const row = { ...poc, ...part };
128
- delete row.DFUFileParts;
129
- retVal.push(row);
130
- }
131
- }
132
- return retVal;
133
- }
134
-
135
- update(request: Partial<WsDfu.DFUInfoRequest>): Promise<WsDfu.DFUInfoResponse> {
136
- return this.connection.DFUInfo({
137
- ...request,
138
- ...{
139
- Cluster: this.Cluster,
140
- Name: this.Name
141
- }
142
- }).then((response) => {
143
- this.set({
144
- Cluster: this.Cluster,
145
- ...response.FileDetail
146
- });
147
- return response;
148
- });
149
- }
150
-
151
- fetchInfo(): Promise<WsDfu.FileDetail> {
152
- return this.connection.DFUInfo({ Cluster: this.Cluster, Name: this.Name }).then(response => {
153
- this.set({
154
- Cluster: this.Cluster,
155
- ...response.FileDetail,
156
- ProtectList: response?.FileDetail?.ProtectList ?? { DFUFileProtect: [] }
157
- });
158
- return response.FileDetail;
159
- }).catch((e: ESPExceptions) => {
160
- // deleted ---
161
- const fileMissing = e.Exception.some((exception) => {
162
- if (exception.Code === 20038) {
163
- this.set("Name", this.Name + " (Deleted)");
164
- this.set("StateID", 999);
165
- return true;
166
- }
167
- return false;
168
- });
169
- if (!fileMissing) {
170
- logger.warning(`Unexpected ESP exception: ${e.message}`);
171
- throw e;
172
- }
173
- return {} as FileDetailEx;
174
- });
175
- }
176
-
177
- fetchDefFile(format: WsDfu.DFUDefFileFormat): Promise<string> {
178
- return this.connection.DFUFile({ Name: this.Name, Format: format });
179
- }
180
-
181
- fetchAllLogicalFiles(): Promise<string[]> {
182
- return this.connection.recursiveFetchLogicalFiles([this]);
183
- }
184
-
185
- fetchListHistory(): Promise<WsDfu.Origin[]> {
186
- return this.connection.ListHistory({ Name: this.Name }).then(response => {
187
- return response?.History?.Origin || [];
188
- });
189
- }
190
-
191
- eraseHistory(): Promise<WsDfu.Origin[]> {
192
- return this.connection.EraseHistory({ Name: this.Name }).then(response => {
193
- return response?.History?.Origin || [];
194
- });
195
- }
196
- }
1
+ import { Cache, scopedLogger, StateObject } from "@hpcc-js/util";
2
+ import { IConnection, IOptions } from "../connection.ts";
3
+ import { DFUService, WsDfu } from "../services/wsDFU.ts";
4
+ import { ESPExceptions } from "../espConnection.ts";
5
+
6
+ const logger = scopedLogger("logicalFile.ts");
7
+
8
+ export class LogicalFileCache extends Cache<{ BaseUrl: string, Cluster: string, Name: string }, LogicalFile> {
9
+ constructor() {
10
+ super((obj) => {
11
+ return `${obj.BaseUrl}-${obj.Cluster}-${obj.Name}`;
12
+ });
13
+ }
14
+ }
15
+ const _store = new LogicalFileCache();
16
+
17
+ export interface DFUPartEx extends WsDfu.DFUPart {
18
+ // From WsDfu.DFUFilePartsOnCluster ---
19
+ Cluster: string;
20
+ BaseDir: string;
21
+ ReplicateDir: string;
22
+ Replicate: boolean;
23
+ CanReplicate: boolean;
24
+ }
25
+
26
+ export interface FileDetailEx extends WsDfu.FileDetail {
27
+ Cluster: string;
28
+ StateID?: number;
29
+ }
30
+
31
+ export class LogicalFile extends StateObject<FileDetailEx, FileDetailEx> implements FileDetailEx {
32
+ protected connection: DFUService;
33
+ get BaseUrl() { return this.connection.baseUrl; }
34
+
35
+ get Cluster(): string { return this.get("Cluster"); }
36
+ get Name(): string { return this.get("Name"); }
37
+
38
+ get Filename(): string { return this.get("Filename"); }
39
+ get Prefix(): string { return this.get("Prefix"); }
40
+ get NodeGroup(): string { return this.get("NodeGroup"); }
41
+ get NumParts(): number { return this.get("NumParts"); }
42
+ get Description(): string { return this.get("Description"); }
43
+ get Dir(): string { return this.get("Dir"); }
44
+ get PathMask(): string { return this.get("PathMask"); }
45
+ get Filesize(): string { return this.get("Filesize"); }
46
+ get FileSizeInt64(): number { return this.get("FileSizeInt64"); }
47
+ get RecordSize(): string { return this.get("RecordSize"); }
48
+ get RecordCount(): string { return this.get("RecordCount"); }
49
+ get RecordSizeInt64(): number { return this.get("RecordSizeInt64"); }
50
+ get RecordCountInt64(): number { return this.get("RecordCountInt64"); }
51
+ get Wuid(): string { return this.get("Wuid"); }
52
+ get Owner(): string { return this.get("Owner"); }
53
+ get JobName(): string { return this.get("JobName"); }
54
+ get Persistent(): string { return this.get("Persistent"); }
55
+ get Format(): string { return this.get("Format"); }
56
+ get MaxRecordSize(): string { return this.get("MaxRecordSize"); }
57
+ get CsvSeparate(): string { return this.get("CsvSeparate"); }
58
+ get CsvQuote(): string { return this.get("CsvQuote"); }
59
+ get CsvTerminate(): string { return this.get("CsvTerminate"); }
60
+ get CsvEscape(): string { return this.get("CsvEscape"); }
61
+ get Modified(): string { return this.get("Modified"); }
62
+ get Ecl(): string { return this.get("Ecl"); }
63
+ get Stat(): WsDfu.Stat { return this.get("Stat"); }
64
+ get DFUFilePartsOnClusters(): WsDfu.DFUFilePartsOnClusters { return this.get("DFUFilePartsOnClusters"); }
65
+ get isSuperfile(): boolean { return this.get("isSuperfile"); }
66
+ get ShowFileContent(): boolean { return this.get("ShowFileContent"); }
67
+ get subfiles(): WsDfu.subfiles { return this.get("subfiles"); }
68
+ get Superfiles(): WsDfu.Superfiles { return this.get("Superfiles"); }
69
+ get ProtectList(): WsDfu.ProtectList { return this.get("ProtectList"); }
70
+ get FromRoxieCluster(): boolean { return this.get("FromRoxieCluster"); }
71
+ get Graphs(): WsDfu.Graphs { return this.get("Graphs"); }
72
+ get UserPermission(): string { return this.get("UserPermission"); }
73
+ get ContentType(): string { return this.get("ContentType"); }
74
+ get CompressedFileSize(): number { return this.get("CompressedFileSize"); }
75
+ get PercentCompressed(): string { return this.get("PercentCompressed"); }
76
+ get IsCompressed(): boolean { return this.get("IsCompressed"); }
77
+ get BrowseData(): boolean { return this.get("BrowseData"); }
78
+ get jsonInfo(): string { return this.get("jsonInfo"); }
79
+ get binInfo(): WsDfu.base64Binary { return this.get("binInfo"); }
80
+ get PackageID(): string { return this.get("PackageID"); }
81
+ get Partition(): WsDfu.Partition { return this.get("Partition"); }
82
+ get Blooms(): WsDfu.Blooms { return this.get("Blooms"); }
83
+ get ExpireDays(): number { return this.get("ExpireDays"); }
84
+ get KeyType(): string { return this.get("KeyType"); }
85
+ get IsRestricted(): boolean { return this.get("IsRestricted"); }
86
+ get AtRestCost(): number { return this.get("AtRestCost"); }
87
+ get AccessCost(): number { return this.get("AccessCost"); }
88
+ get StateID(): number { return this.get("StateID"); }
89
+ get ExpirationDate(): string { return this.get("ExpirationDate"); }
90
+ get ExtendedIndexInfo(): WsDfu.ExtendedIndexInfo { return this.get("ExtendedIndexInfo"); }
91
+ get CompressionType(): string { return this.get("CompressionType"); }
92
+
93
+ get properties(): FileDetailEx { return this.get(); }
94
+
95
+ static attach(optsConnection: IOptions | IConnection | DFUService, Cluster: string, Name: string, state?: FileDetailEx): LogicalFile {
96
+ const retVal: LogicalFile = _store.get({ BaseUrl: optsConnection.baseUrl, Cluster, Name }, () => {
97
+ return new LogicalFile(optsConnection, Cluster, Name);
98
+ });
99
+ if (state) {
100
+ retVal.set(state);
101
+ }
102
+ return retVal;
103
+ }
104
+
105
+ protected constructor(optsConnection: IOptions | IConnection | DFUService, Cluster: string, Name: string) {
106
+ super();
107
+ if (optsConnection instanceof DFUService) {
108
+ this.connection = optsConnection;
109
+ } else {
110
+ this.connection = new DFUService(optsConnection);
111
+ }
112
+
113
+ this.clear({
114
+ Cluster,
115
+ Name
116
+ });
117
+ }
118
+
119
+ filePartsOnCluster() {
120
+ return [...(this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster || [])];
121
+ }
122
+
123
+ fileParts() {
124
+ const retVal: DFUPartEx[] = [];
125
+ for (const poc of this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster || []) {
126
+ for (const part of poc?.DFUFileParts?.DFUPart || []) {
127
+ const row = { ...poc, ...part };
128
+ delete row.DFUFileParts;
129
+ retVal.push(row);
130
+ }
131
+ }
132
+ return retVal;
133
+ }
134
+
135
+ update(request: Partial<WsDfu.DFUInfoRequest>): Promise<WsDfu.DFUInfoResponse> {
136
+ return this.connection.DFUInfo({
137
+ ...request,
138
+ ...{
139
+ Cluster: this.Cluster,
140
+ Name: this.Name
141
+ }
142
+ }).then((response) => {
143
+ this.set({
144
+ Cluster: this.Cluster,
145
+ ...response.FileDetail
146
+ });
147
+ return response;
148
+ });
149
+ }
150
+
151
+ fetchInfo(): Promise<WsDfu.FileDetail> {
152
+ return this.connection.DFUInfo({ Cluster: this.Cluster, Name: this.Name }).then(response => {
153
+ this.set({
154
+ Cluster: this.Cluster,
155
+ ...response.FileDetail,
156
+ ProtectList: response?.FileDetail?.ProtectList ?? { DFUFileProtect: [] }
157
+ });
158
+ return response.FileDetail;
159
+ }).catch((e: ESPExceptions) => {
160
+ // deleted ---
161
+ const fileMissing = e.Exception.some((exception) => {
162
+ if (exception.Code === 20038) {
163
+ this.set("Name", this.Name + " (Deleted)");
164
+ this.set("StateID", 999);
165
+ return true;
166
+ }
167
+ return false;
168
+ });
169
+ if (!fileMissing) {
170
+ logger.warning(`Unexpected ESP exception: ${e.message}`);
171
+ throw e;
172
+ }
173
+ return {} as FileDetailEx;
174
+ });
175
+ }
176
+
177
+ fetchDefFile(format: WsDfu.DFUDefFileFormat): Promise<string> {
178
+ return this.connection.DFUFile({ Name: this.Name, Format: format });
179
+ }
180
+
181
+ fetchAllLogicalFiles(): Promise<string[]> {
182
+ return this.connection.recursiveFetchLogicalFiles([this]);
183
+ }
184
+
185
+ fetchListHistory(): Promise<WsDfu.Origin[]> {
186
+ return this.connection.ListHistory({ Name: this.Name }).then(response => {
187
+ return response?.History?.Origin || [];
188
+ });
189
+ }
190
+
191
+ eraseHistory(): Promise<WsDfu.Origin[]> {
192
+ return this.connection.EraseHistory({ Name: this.Name }).then(response => {
193
+ return response?.History?.Origin || [];
194
+ });
195
+ }
196
+ }
@@ -1,63 +1,63 @@
1
- import { Cache, StateObject } from "@hpcc-js/util";
2
- import { IConnection, IOptions } from "../connection.ts";
3
- import { WsMachine, MachineService } from "../services/wsMachine.ts";
4
-
5
- export class MachineCache extends Cache<{ Address: string }, Machine> {
6
- constructor() {
7
- super((obj) => {
8
- return obj.Address;
9
- });
10
- }
11
- }
12
- const _machines = new MachineCache();
13
-
14
- export interface MachineInfoEx extends WsMachine.MachineInfoEx {
15
- }
16
-
17
- export class Machine extends StateObject<MachineInfoEx, MachineInfoEx> implements MachineInfoEx {
18
- protected connection: MachineService;
19
-
20
- get Address(): string { return this.get("Address"); }
21
- get ConfigAddress(): string { return this.get("ConfigAddress"); }
22
- get Name(): string { return this.get("Name"); }
23
- get ProcessType(): string { return this.get("ProcessType"); }
24
- get DisplayType(): string { return this.get("DisplayType"); }
25
- get Description(): string { return this.get("Description"); }
26
- get AgentVersion(): string { return this.get("AgentVersion"); }
27
- get Contact(): string { return this.get("Contact"); }
28
- get Location(): string { return this.get("Location"); }
29
- get UpTime(): string { return this.get("UpTime"); }
30
- get ComponentName(): string { return this.get("ComponentName"); }
31
- get ComponentPath(): string { return this.get("ComponentPath"); }
32
- get RoxieState(): string { return this.get("RoxieState"); }
33
- get RoxieStateDetails(): string { return this.get("RoxieStateDetails"); }
34
- get OS(): number { return this.get("OS"); }
35
- get ProcessNumber(): number { return this.get("ProcessNumber"); }
36
- get Channels(): number { return this.get("Channels"); }
37
- get Processors(): WsMachine.Processors { return this.get("Processors"); }
38
- get Storage(): WsMachine.Storage { return this.get("Storage"); }
39
- get Running(): WsMachine.Running { return this.get("Running"); }
40
- get PhysicalMemory(): WsMachine.PhysicalMemory { return this.get("PhysicalMemory"); }
41
- get VirtualMemory(): WsMachine.VirtualMemory { return this.get("VirtualMemory"); }
42
- get ComponentInfo(): WsMachine.ComponentInfo { return this.get("ComponentInfo"); }
43
- get Exception(): string { return this.get("Exception"); }
44
-
45
- static attach(optsConnection: IOptions | IConnection | MachineService, address: string, state?: WsMachine.MachineInfoEx): Machine {
46
- const retVal: Machine = _machines.get({ Address: address }, () => {
47
- return new Machine(optsConnection);
48
- });
49
- if (state) {
50
- retVal.set(state);
51
- }
52
- return retVal;
53
- }
54
-
55
- private constructor(optsConnection: IOptions | IConnection | MachineService) {
56
- super();
57
- if (optsConnection instanceof MachineService) {
58
- this.connection = optsConnection;
59
- } else {
60
- this.connection = new MachineService(optsConnection);
61
- }
62
- }
63
- }
1
+ import { Cache, StateObject } from "@hpcc-js/util";
2
+ import { IConnection, IOptions } from "../connection.ts";
3
+ import { WsMachine, MachineService } from "../services/wsMachine.ts";
4
+
5
+ export class MachineCache extends Cache<{ Address: string }, Machine> {
6
+ constructor() {
7
+ super((obj) => {
8
+ return obj.Address;
9
+ });
10
+ }
11
+ }
12
+ const _machines = new MachineCache();
13
+
14
+ export interface MachineInfoEx extends WsMachine.MachineInfoEx {
15
+ }
16
+
17
+ export class Machine extends StateObject<MachineInfoEx, MachineInfoEx> implements MachineInfoEx {
18
+ protected connection: MachineService;
19
+
20
+ get Address(): string { return this.get("Address"); }
21
+ get ConfigAddress(): string { return this.get("ConfigAddress"); }
22
+ get Name(): string { return this.get("Name"); }
23
+ get ProcessType(): string { return this.get("ProcessType"); }
24
+ get DisplayType(): string { return this.get("DisplayType"); }
25
+ get Description(): string { return this.get("Description"); }
26
+ get AgentVersion(): string { return this.get("AgentVersion"); }
27
+ get Contact(): string { return this.get("Contact"); }
28
+ get Location(): string { return this.get("Location"); }
29
+ get UpTime(): string { return this.get("UpTime"); }
30
+ get ComponentName(): string { return this.get("ComponentName"); }
31
+ get ComponentPath(): string { return this.get("ComponentPath"); }
32
+ get RoxieState(): string { return this.get("RoxieState"); }
33
+ get RoxieStateDetails(): string { return this.get("RoxieStateDetails"); }
34
+ get OS(): number { return this.get("OS"); }
35
+ get ProcessNumber(): number { return this.get("ProcessNumber"); }
36
+ get Channels(): number { return this.get("Channels"); }
37
+ get Processors(): WsMachine.Processors { return this.get("Processors"); }
38
+ get Storage(): WsMachine.Storage { return this.get("Storage"); }
39
+ get Running(): WsMachine.Running { return this.get("Running"); }
40
+ get PhysicalMemory(): WsMachine.PhysicalMemory { return this.get("PhysicalMemory"); }
41
+ get VirtualMemory(): WsMachine.VirtualMemory { return this.get("VirtualMemory"); }
42
+ get ComponentInfo(): WsMachine.ComponentInfo { return this.get("ComponentInfo"); }
43
+ get Exception(): string { return this.get("Exception"); }
44
+
45
+ static attach(optsConnection: IOptions | IConnection | MachineService, address: string, state?: WsMachine.MachineInfoEx): Machine {
46
+ const retVal: Machine = _machines.get({ Address: address }, () => {
47
+ return new Machine(optsConnection);
48
+ });
49
+ if (state) {
50
+ retVal.set(state);
51
+ }
52
+ return retVal;
53
+ }
54
+
55
+ private constructor(optsConnection: IOptions | IConnection | MachineService) {
56
+ super();
57
+ if (optsConnection instanceof MachineService) {
58
+ this.connection = optsConnection;
59
+ } else {
60
+ this.connection = new MachineService(optsConnection);
61
+ }
62
+ }
63
+ }