diff --git a/packages/comms/package.json b/packages/comms/package.json index c73560707f..2bbf8cb66e 100644 --- a/packages/comms/package.json +++ b/packages/comms/package.json @@ -52,6 +52,7 @@ "wsdl-logaccess": "node ./lib-cjs/index.js -k --url=http://localhost:8010/ws_logaccess?wsdl --outDir=./src/services/wsdl", "wsdl-machine": "node ./lib-cjs/index.js -k --url=http://localhost:8010/ws_machine?wsdl --outDir=./src/services/wsdl", "wsdl-packageprocess": "node ./lib-cjs/index.js -k --url=http://localhost:8010/WsPackageProcess?wsdl --outDir=./src/services/wsdl", + "wsdl-sasha": "node ./lib-cjs/index.js -k --url=http://localhost:8010/WsSasha?wsdl --outDir=./src/services/wsdl", "wsdl-smc": "node ./lib-cjs/index.js -k --url=http://localhost:8010/WsSMC?wsdl --outDir=./src/services/wsdl", "wsdl-resources": "node ./lib-cjs/index.js -k --url=http://localhost:8010/ws_resources?wsdl --outDir=./src/services/wsdl", "wsdl-store": "node ./lib-cjs/index.js -k --url=http://localhost:8010/WsStore?wsdl --outDir=./src/services/wsdl", diff --git a/packages/comms/src/index-common.ts b/packages/comms/src/index-common.ts index e80da8f697..bb6ca34419 100644 --- a/packages/comms/src/index-common.ts +++ b/packages/comms/src/index-common.ts @@ -14,6 +14,7 @@ export * from "./services/wsLogaccess"; export * from "./services/wsMachine"; export * from "./services/wsPackageProcess"; export * from "./services/wsResources"; +export * from "./services/wsSasha"; export * from "./services/wsSMC"; export * from "./services/wsStore"; export * from "./services/wsTopology"; diff --git a/packages/comms/src/services/wsSasha.ts b/packages/comms/src/services/wsSasha.ts new file mode 100644 index 0000000000..62ceabed27 --- /dev/null +++ b/packages/comms/src/services/wsSasha.ts @@ -0,0 +1,8 @@ +import { SashaServiceBase, WsSasha } from "./wsdl/WsSasha/v1.01/WsSasha"; + +export { + WsSasha +}; + +export class SashaService extends SashaServiceBase { +} \ No newline at end of file diff --git a/packages/comms/src/services/wsdl/WsSasha/v1.01/WsSasha.ts b/packages/comms/src/services/wsdl/WsSasha/v1.01/WsSasha.ts new file mode 100644 index 0000000000..8d20a4fe98 --- /dev/null +++ b/packages/comms/src/services/wsdl/WsSasha/v1.01/WsSasha.ts @@ -0,0 +1,100 @@ +import { IConnection, IOptions } from "../../../../connection"; +import { Service } from "../../../../espConnection"; + +export namespace WsSasha { + + export type unsignedInt = number; + + export enum WUTypes { + ECL = "ECL", + DFU = "DFU" + } + + export interface ArchiveWURequest { + Wuid?: string; + WUType?: WUTypes; + DeleteOnSuccess?: boolean; + } + + export interface Exception { + Code: string; + Audience: string; + Source: string; + Message: string; + } + + export interface Exceptions { + Source: string; + Exception: Exception[]; + } + + export interface ResultResponse { + Exceptions: Exceptions; + Result: string; + } + + export interface GetVersionRequest { + + } + + export interface ListWURequest { + WUType?: WUTypes; + Wuid?: string; + Cluster?: string; + Owner?: string; + JobName?: string; + State?: string; + FromDate?: string; + ToDate?: string; + Archived?: boolean; + Online?: boolean; + IncludeDT?: boolean; + BeforeWU?: string; + AfterWU?: string; + MaxNumberWUs?: unsignedInt; + Descending?: boolean; + OutputFields?: string; + } + + export interface WSSashaPingRequest { + + } + + export interface WSSashaPingResponse { + + } + + export interface RestoreWURequest { + Wuid?: string; + WUType?: WUTypes; + } + +} + +export class SashaServiceBase extends Service { + + constructor(optsConnection: IOptions | IConnection) { + super(optsConnection, "WSSasha", "1.01"); + } + + ArchiveWU(request: Partial): Promise { + return this._connection.send("ArchiveWU", request, "json", false, undefined, "ResultResponse"); + } + + GetVersion(request: Partial): Promise { + return this._connection.send("GetVersion", request, "json", false, undefined, "ResultResponse"); + } + + ListWU(request: Partial): Promise { + return this._connection.send("ListWU", request, "json", false, undefined, "ResultResponse"); + } + + Ping(request: Partial): Promise { + return this._connection.send("Ping", request, "json", false, undefined, "WSSashaPingResponse"); + } + + RestoreWU(request: Partial): Promise { + return this._connection.send("RestoreWU", request, "json", false, undefined, "ResultResponse"); + } + +} diff --git a/tests/test-comms/src/services/wsSasha.spec.ts b/tests/test-comms/src/services/wsSasha.spec.ts new file mode 100644 index 0000000000..26acf3ea82 --- /dev/null +++ b/tests/test-comms/src/services/wsSasha.spec.ts @@ -0,0 +1,11 @@ +import { expect } from "chai"; + +import { SashaService } from "@hpcc-js/comms"; +import { ESP_URL } from "../testLib"; + +describe("WsSasha", function () { + it("basic", function () { + const service = new SashaService({ baseUrl: ESP_URL }); + expect(service).exist; + }); +});