@hpcc-js/comms 3.1.0 → 3.3.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.
Files changed (46) hide show
  1. package/dist/index.browser.js +6318 -0
  2. package/dist/index.browser.js.map +1 -0
  3. package/dist/index.browser.umd.cjs +7 -0
  4. package/dist/index.browser.umd.cjs.map +1 -0
  5. package/dist/index.node.js +2 -2
  6. package/dist/index.node.js.map +3 -3
  7. package/package.json +23 -18
  8. package/src/__package__.ts +2 -2
  9. package/src/ecl/activity.ts +1 -3
  10. package/src/ecl/logicalFile.ts +4 -1
  11. package/src/ecl/query.ts +4 -1
  12. package/src/ecl/targetCluster.ts +1 -3
  13. package/src/ecl/topology.ts +4 -1
  14. package/src/espConnection.ts +8 -0
  15. package/src/index.browser.ts +1 -0
  16. package/src/index.node.ts +1 -1
  17. package/src/services/wsAccount.ts +1 -1
  18. package/src/services/wsCloud.ts +1 -1
  19. package/src/services/wsDali.ts +1 -1
  20. package/src/services/wsEcl.ts +1 -1
  21. package/src/services/wsElk.ts +1 -1
  22. package/src/services/wsMachine.ts +1 -1
  23. package/src/services/wsPackageProcess.ts +1 -1
  24. package/src/services/wsResources.ts +1 -1
  25. package/src/services/wsWorkunits.ts +0 -8
  26. package/types/__package__.d.ts +2 -2
  27. package/types/ecl/logicalFile.d.ts +1 -1
  28. package/types/ecl/query.d.ts +1 -1
  29. package/types/ecl/topology.d.ts +1 -1
  30. package/types/espConnection.d.ts +2 -0
  31. package/types/index.browser.d.ts +1 -0
  32. package/types/index.node.d.ts +1 -1
  33. package/types/services/wsAccount.d.ts +1 -1
  34. package/types/services/wsCloud.d.ts +1 -1
  35. package/types/services/wsDali.d.ts +1 -1
  36. package/types/services/wsEcl.d.ts +1 -1
  37. package/types/services/wsElk.d.ts +1 -1
  38. package/types/services/wsMachine.d.ts +1 -1
  39. package/types/services/wsPackageProcess.d.ts +1 -1
  40. package/types/services/wsResources.d.ts +1 -1
  41. package/types/services/wsWorkunits.d.ts +0 -3
  42. package/dist/index.js +0 -7
  43. package/dist/index.js.map +0 -7
  44. package/src/index.ts +0 -1
  45. /package/src/{index-common.ts → index.common.ts} +0 -0
  46. /package/types/{index-common.d.ts → index.common.d.ts} +0 -0
package/package.json CHANGED
@@ -1,18 +1,21 @@
1
1
  {
2
2
  "name": "@hpcc-js/comms",
3
- "version": "3.1.0",
3
+ "version": "3.3.0",
4
4
  "description": "hpcc-js - Communications",
5
5
  "type": "module",
6
+ "main": "./dist/index.node.js",
7
+ "module": "./dist/index.browser.js",
6
8
  "exports": {
7
9
  ".": {
8
- "types": "./types/index.node.d.ts",
10
+ "types": "./types/index.browser.d.ts",
9
11
  "node": "./dist/index.node.js",
10
- "default": "./dist/index.js"
11
- }
12
+ "import": "./dist/index.browser.js",
13
+ "require": "./dist/index.browser.umd.cjs"
14
+ },
15
+ "./dist/*": "./dist/*"
12
16
  },
13
- "module": "./dist/index.node.js",
14
- "browser": "./dist/index.js",
15
- "types": "./types/index.node.d.ts",
17
+ "browser": "./dist/index.browser.umd.cjs",
18
+ "types": "./types/index.browser.d.ts",
16
19
  "files": [
17
20
  "dist/*",
18
21
  "src/*",
@@ -20,12 +23,13 @@
20
23
  ],
21
24
  "scripts": {
22
25
  "clean": "rimraf --glob lib* types dist *.tsbuildinfo .turbo",
23
- "bundle": "node esbuild.js",
24
- "bundle-watch": "npm run bundle -- --development --watch",
26
+ "bundle-node": "node ./esbuild.js",
27
+ "bundle-browser": "vite build",
28
+ "bundle": "run-s bundle-browser bundle-node",
29
+ "bundle-watch": "vite",
25
30
  "gen-types": "tsc --project tsconfig.json",
26
31
  "gen-types-watch": "npm run gen-types -- --watch",
27
32
  "build": "run-p gen-types bundle",
28
- "stamp": "node ../../node_modules/@hpcc-js/bundle/src/stamp.js",
29
33
  "lint": "eslint ./src",
30
34
  "lint-fix": "eslint --fix src/**/*.ts",
31
35
  "docs": "typedoc --options tdoptions.json .",
@@ -33,8 +37,8 @@
33
37
  "test-node": "vitest run --project node",
34
38
  "test": "vitest run",
35
39
  "coverage": "vitest run --coverage",
36
- "update": "npx -y npm-check-updates -u -t minor",
37
- "update-major": "npx -y npm-check-updates -u",
40
+ "update": "npx --yes npm-check-updates -u -t minor",
41
+ "update-major": "npx --yes npm-check-updates -u",
38
42
  "wsdl-access": "node ./lib-esm/index.js -k --url=http://localhost:8010/ws_access?wsdl --outDir=./src/services/wsdl",
39
43
  "wsdl-account": "node ./lib-esm/index.js -k --url=http://localhost:8010/Ws_Account?wsdl --outDir=./src/services/wsdl",
40
44
  "wsdl-cloud": "node ./lib-esm/index.js -k --url=http://localhost:8010/WsCloud?wsdl --outDir=./src/services/wsdl",
@@ -58,17 +62,18 @@
58
62
  "wsdl-all": "npm-run-all --aggregate-output -c --serial build --parallel wsdl-*"
59
63
  },
60
64
  "dependencies": {
61
- "@hpcc-js/ddl-shim": "^2.22.0",
62
- "@hpcc-js/util": "^3.1.0",
63
- "@xmldom/xmldom": "0.9.4",
65
+ "@hpcc-js/util": "^3.3.0",
66
+ "@xmldom/xmldom": "0.9.5",
64
67
  "abort-controller": "3.0.0",
68
+ "data-uri-to-buffer": "6.0.2",
65
69
  "node-fetch": "3.3.2",
66
70
  "safe-buffer": "5.2.1",
67
71
  "tmp": "0.2.3",
68
- "undici": "5.28.4"
72
+ "undici": "6.21.0"
69
73
  },
70
74
  "devDependencies": {
71
- "@hpcc-js/esbuild-plugins": "^1.2.0",
75
+ "@hpcc-js/ddl-shim": "^3.0.0",
76
+ "@hpcc-js/esbuild-plugins": "^1.4.0",
72
77
  "@types/d3-request": "1.0.9",
73
78
  "@types/d3-time-format": "2.3.4",
74
79
  "@types/node": "^18",
@@ -90,5 +95,5 @@
90
95
  "url": "https://github.com/hpcc-systems/Visualization/issues"
91
96
  },
92
97
  "homepage": "https://github.com/hpcc-systems/Visualization",
93
- "gitHead": "3f6146539f487dca08a35cdd5f94ca29609b4343"
98
+ "gitHead": "145a4d4c8189c70f08e9804e63959d6dd398bd9f"
94
99
  }
@@ -1,3 +1,3 @@
1
1
  export const PKG_NAME = "@hpcc-js/comms";
2
- export const PKG_VERSION = "3.1.0";
3
- export const BUILD_VERSION = "2.107.0";
2
+ export const PKG_VERSION = "3.3.0";
3
+ export const BUILD_VERSION = "3.3.0";
@@ -41,9 +41,7 @@ export class Activity extends StateObject<UActivityState, IActivityState> implem
41
41
  _activity = new Activity(optsConnection);
42
42
  }
43
43
  if (state) {
44
- _activity.set({
45
- ...state
46
- });
44
+ _activity.set(state);
47
45
  }
48
46
  return _activity;
49
47
  }
@@ -91,10 +91,13 @@ export class LogicalFile extends StateObject<FileDetailEx, FileDetailEx> impleme
91
91
 
92
92
  get properties(): FileDetailEx { return this.get(); }
93
93
 
94
- static attach(optsConnection: IOptions | IConnection | DFUService, Cluster: string, Name: string): LogicalFile {
94
+ static attach(optsConnection: IOptions | IConnection | DFUService, Cluster: string, Name: string, state?: FileDetailEx): LogicalFile {
95
95
  const retVal: LogicalFile = _store.get({ BaseUrl: optsConnection.baseUrl, Cluster, Name }, () => {
96
96
  return new LogicalFile(optsConnection, Cluster, Name);
97
97
  });
98
+ if (state) {
99
+ retVal.set(state);
100
+ }
98
101
  return retVal;
99
102
  }
100
103
 
package/src/ecl/query.ts CHANGED
@@ -78,10 +78,13 @@ export class Query extends StateObject<QueryEx, QueryEx> implements QueryEx {
78
78
  } as QueryEx);
79
79
  }
80
80
 
81
- static attach(optsConnection: IOptions | IConnection, querySet: string, queryId: string): Query {
81
+ static attach(optsConnection: IOptions | IConnection, querySet: string, queryId: string, state?: QueryEx): Query {
82
82
  const retVal: Query = _queries.get({ BaseUrl: optsConnection.baseUrl, QuerySet: querySet, QueryId: queryId } as QueryEx, () => {
83
83
  return new Query(optsConnection, querySet, queryId);
84
84
  });
85
+ if (state) {
86
+ retVal.set(state);
87
+ }
85
88
  return retVal;
86
89
  }
87
90
 
@@ -43,9 +43,7 @@ export class TargetCluster extends StateObject<UTargetClusterState, ITargetClust
43
43
  return new TargetCluster(optsConnection, name);
44
44
  });
45
45
  if (state) {
46
- retVal.set({
47
- ...state
48
- });
46
+ retVal.set(state);
49
47
  }
50
48
  return retVal;
51
49
  }
@@ -30,10 +30,13 @@ export class Topology extends StateObject<TopologyStateEx, TopologyStateEx> impl
30
30
  get LogicalClusters(): WsTopology.TpLogicalCluster[] { return this.get("LogicalClusters"); }
31
31
  get Services(): WsTopology.ServiceList { return this.get("Services"); }
32
32
 
33
- static attach(optsConnection: IOptions | IConnection | TopologyService) {
33
+ static attach(optsConnection: IOptions | IConnection | TopologyService, state?: TopologyStateEx): Topology {
34
34
  const retVal: Topology = _topology.get({ BaseUrl: optsConnection.baseUrl }, () => {
35
35
  return new Topology(optsConnection);
36
36
  });
37
+ if (state) {
38
+ retVal.set(state);
39
+ }
37
40
  return retVal;
38
41
  }
39
42
 
@@ -161,4 +161,12 @@ export class Service {
161
161
  constructor(optsConnection: IOptions | IConnection, service: string, version: string) {
162
162
  this._connection = new ESPConnection(optsConnection, service, version);
163
163
  }
164
+
165
+ opts() {
166
+ return this._connection.opts();
167
+ }
168
+
169
+ connection(): ESPConnection {
170
+ return this._connection.clone();
171
+ }
164
172
  }
@@ -0,0 +1 @@
1
+ export * from "./index.common.ts";
package/src/index.node.ts CHANGED
@@ -65,7 +65,7 @@ if (typeof root.btoa === "undefined") {
65
65
  };
66
66
  }
67
67
 
68
- export * from "./index-common.ts";
68
+ export * from "./index.common.ts";
69
69
 
70
70
  // Client Tools ---
71
71
  export * from "./clienttools/eclcc.ts";
@@ -2,7 +2,7 @@ import { AccountServiceBase, WsAccount } from "./wsdl/ws_account/v1.06/ws_accoun
2
2
  import { ESPExceptions } from "../espConnection.ts";
3
3
 
4
4
  export {
5
- WsAccount
5
+ type WsAccount
6
6
  };
7
7
 
8
8
  export class AccountService extends AccountServiceBase {
@@ -1,7 +1,7 @@
1
1
  import { CloudServiceBase, WsCloud } from "./wsdl/WsCloud/v1/WsCloud.ts";
2
2
 
3
3
  export {
4
- WsCloud
4
+ type WsCloud
5
5
  };
6
6
 
7
7
  export class CloudService extends CloudServiceBase {
@@ -1,7 +1,7 @@
1
1
  import { DaliServiceBase, WsDali } from "./wsdl/WsDali/v1.07/WsDali.ts";
2
2
 
3
3
  export {
4
- WsDali
4
+ type WsDali
5
5
  };
6
6
 
7
7
  export class DaliService extends DaliServiceBase {
@@ -1,4 +1,4 @@
1
- import { DDL2 } from "@hpcc-js/ddl-shim";
1
+ import type { DDL2 } from "@hpcc-js/ddl-shim";
2
2
  import { IConnection, IOptions } from "../connection.ts";
3
3
  import { ESPExceptions, Service } from "../espConnection.ts";
4
4
 
@@ -1,7 +1,7 @@
1
1
  import { ElkServiceBase, WsElk } from "./wsdl/ws_elk/v1/ws_elk.ts";
2
2
 
3
3
  export {
4
- WsElk
4
+ type WsElk
5
5
  };
6
6
 
7
7
  export class ElkService extends ElkServiceBase {
@@ -4,7 +4,7 @@ import { max as d3Max, mean as d3Mean } from "d3-array";
4
4
  import { MachineServiceBase, WsMachine } from "./wsdl/ws_machine/v1.17/ws_machine.ts";
5
5
 
6
6
  export {
7
- WsMachine
7
+ type WsMachine
8
8
  };
9
9
 
10
10
  export namespace WsMachineEx {
@@ -1,7 +1,7 @@
1
1
  import { PackageProcessServiceBase, WsPackageProcess } from "./wsdl/WsPackageProcess/v1.04/WsPackageProcess.ts";
2
2
 
3
3
  export {
4
- WsPackageProcess
4
+ type WsPackageProcess
5
5
  };
6
6
 
7
7
  export class PackageProcessService extends PackageProcessServiceBase {
@@ -1,7 +1,7 @@
1
1
  import { ResourcesServiceBase, WsResources } from "./wsdl/WsResources/v1.01/WsResources.ts";
2
2
 
3
3
  export {
4
- WsResources
4
+ type WsResources
5
5
  };
6
6
 
7
7
  export class ResourcesService extends ResourcesServiceBase {
@@ -67,14 +67,6 @@ export class WorkunitsService extends WorkunitsServiceBase {
67
67
  super(optsConnection);
68
68
  }
69
69
 
70
- opts() {
71
- return this._connection.opts();
72
- }
73
-
74
- connection(): ESPConnection {
75
- return this._connection.clone();
76
- }
77
-
78
70
  Ping(): Promise<WsWorkunits.WsWorkunitsPingResponse> {
79
71
  return this._connection.send("Ping", {}, "json", false, undefined, "WsWorkunitsPingResponse").then((response) => {
80
72
  return { result: true };
@@ -1,3 +1,3 @@
1
1
  export declare const PKG_NAME = "@hpcc-js/comms";
2
- export declare const PKG_VERSION = "3.1.0";
3
- export declare const BUILD_VERSION = "2.107.0";
2
+ export declare const PKG_VERSION = "3.2.0";
3
+ export declare const BUILD_VERSION = "3.2.1";
@@ -78,7 +78,7 @@ export declare class LogicalFile extends StateObject<FileDetailEx, FileDetailEx>
78
78
  get ExpirationDate(): string;
79
79
  get ExtendedIndexInfo(): WsDfu.ExtendedIndexInfo;
80
80
  get properties(): FileDetailEx;
81
- static attach(optsConnection: IOptions | IConnection | DFUService, Cluster: string, Name: string): LogicalFile;
81
+ static attach(optsConnection: IOptions | IConnection | DFUService, Cluster: string, Name: string, state?: FileDetailEx): LogicalFile;
82
82
  protected constructor(optsConnection: IOptions | IConnection | DFUService, Cluster: string, Name: string);
83
83
  filePartsOnCluster(): WsDfu.DFUFilePartsOnCluster[];
84
84
  fileParts(): DFUPartEx[];
@@ -42,7 +42,7 @@ export declare class Query extends StateObject<QueryEx, QueryEx> implements Quer
42
42
  get WUTimers(): WsWorkunits.WUTimers;
43
43
  get PriorityID(): number;
44
44
  private constructor();
45
- static attach(optsConnection: IOptions | IConnection, querySet: string, queryId: string): Query;
45
+ static attach(optsConnection: IOptions | IConnection, querySet: string, queryId: string, state?: QueryEx): Query;
46
46
  private _eclService;
47
47
  protected wsEclService(): Promise<EclService | undefined>;
48
48
  private fetchDetails;
@@ -20,7 +20,7 @@ export declare class Topology extends StateObject<TopologyStateEx, TopologyState
20
20
  get CTargetClusters(): TargetCluster[];
21
21
  get LogicalClusters(): WsTopology.TpLogicalCluster[];
22
22
  get Services(): WsTopology.ServiceList;
23
- static attach(optsConnection: IOptions | IConnection | TopologyService): Topology;
23
+ static attach(optsConnection: IOptions | IConnection | TopologyService, state?: TopologyStateEx): Topology;
24
24
  protected constructor(optsConnection: IOptions | IConnection | TopologyService);
25
25
  GetESPServiceBaseURL(type?: string): Promise<string>;
26
26
  fetchTargetClusters(): Promise<TargetCluster[]>;
@@ -38,4 +38,6 @@ export declare class Service {
38
38
  protected _connection: ESPConnection;
39
39
  get baseUrl(): string;
40
40
  constructor(optsConnection: IOptions | IConnection, service: string, version: string);
41
+ opts(): IOptions;
42
+ connection(): ESPConnection;
41
43
  }
@@ -0,0 +1 @@
1
+ export * from "./index.common.ts";
@@ -1,3 +1,3 @@
1
- export * from "./index-common.ts";
1
+ export * from "./index.common.ts";
2
2
  export * from "./clienttools/eclcc.ts";
3
3
  export * from "./clienttools/eclMeta.ts";
@@ -1,5 +1,5 @@
1
1
  import { AccountServiceBase, WsAccount } from "./wsdl/ws_account/v1.06/ws_account.ts";
2
- export { WsAccount };
2
+ export { type WsAccount };
3
3
  export declare class AccountService extends AccountServiceBase {
4
4
  VerifyUser(request: WsAccount.VerifyUserRequest): Promise<WsAccount.VerifyUserResponse>;
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import { CloudServiceBase, WsCloud } from "./wsdl/WsCloud/v1/WsCloud.ts";
2
- export { WsCloud };
2
+ export { type WsCloud };
3
3
  export declare class CloudService extends CloudServiceBase {
4
4
  getPODs(): Promise<object[]>;
5
5
  }
@@ -1,4 +1,4 @@
1
1
  import { DaliServiceBase, WsDali } from "./wsdl/WsDali/v1.07/WsDali.ts";
2
- export { WsDali };
2
+ export { type WsDali };
3
3
  export declare class DaliService extends DaliServiceBase {
4
4
  }
@@ -1,4 +1,4 @@
1
- import { DDL2 } from "@hpcc-js/ddl-shim";
1
+ import type { DDL2 } from "@hpcc-js/ddl-shim";
2
2
  import { IConnection, IOptions } from "../connection.ts";
3
3
  import { Service } from "../espConnection.ts";
4
4
  export type IFieldType = DDL2.IFieldType;
@@ -1,4 +1,4 @@
1
1
  import { ElkServiceBase, WsElk } from "./wsdl/ws_elk/v1/ws_elk.ts";
2
- export { WsElk };
2
+ export { type WsElk };
3
3
  export declare class ElkService extends ElkServiceBase {
4
4
  }
@@ -1,5 +1,5 @@
1
1
  import { MachineServiceBase, WsMachine } from "./wsdl/ws_machine/v1.17/ws_machine.ts";
2
- export { WsMachine };
2
+ export { type WsMachine };
3
3
  export declare namespace WsMachineEx {
4
4
  interface DiskUsage extends WsMachine.DiskUsage {
5
5
  Total: number;
@@ -1,4 +1,4 @@
1
1
  import { PackageProcessServiceBase, WsPackageProcess } from "./wsdl/WsPackageProcess/v1.04/WsPackageProcess.ts";
2
- export { WsPackageProcess };
2
+ export { type WsPackageProcess };
3
3
  export declare class PackageProcessService extends PackageProcessServiceBase {
4
4
  }
@@ -1,4 +1,4 @@
1
1
  import { ResourcesServiceBase, WsResources } from "./wsdl/WsResources/v1.01/WsResources.ts";
2
- export { WsResources };
2
+ export { type WsResources };
3
3
  export declare class ResourcesService extends ResourcesServiceBase {
4
4
  }
@@ -1,7 +1,6 @@
1
1
  import { XMLNode } from "@hpcc-js/util";
2
2
  import { WsWorkunits, WorkunitsServiceBase } from "./wsdl/WsWorkunits/v2/WsWorkunits.ts";
3
3
  import { IConnection, IOptions } from "../connection.ts";
4
- import { ESPConnection } from "../espConnection.ts";
5
4
  export { WsWorkunits };
6
5
  export declare enum WUStateID {
7
6
  Unknown = 0,
@@ -43,8 +42,6 @@ export declare function isWUQueryECLWorkunit(_: WsWorkunits.ECLWorkunit | WsWork
43
42
  export declare function isWUInfoWorkunit(_: WsWorkunits.ECLWorkunit | WsWorkunits.Workunit): _ is WsWorkunits.Workunit;
44
43
  export declare class WorkunitsService extends WorkunitsServiceBase {
45
44
  constructor(optsConnection: IOptions | IConnection);
46
- opts(): IOptions;
47
- connection(): ESPConnection;
48
45
  Ping(): Promise<WsWorkunits.WsWorkunitsPingResponse>;
49
46
  WUQuery(request?: Partial<WsWorkunits.WUQuery>, abortSignal?: AbortSignal): Promise<WsWorkunits.WUQueryResponse>;
50
47
  WUInfo(_request: Partial<WsWorkunits.WUInfo>): Promise<WsWorkunits.WUInfoResponse>;