diff --git a/packages/comms/src/services/wsAccount.ts b/packages/comms/src/services/wsAccount.ts index 5a5a56a1fe..7df0008780 100644 --- a/packages/comms/src/services/wsAccount.ts +++ b/packages/comms/src/services/wsAccount.ts @@ -1,105 +1,11 @@ -import { IConnection, IOptions } from "../connection"; -import { ESPConnection, ESPExceptions } from "../espConnection"; +import { AccountServiceBase, WsAccount } from "./wsdl/ws_account/v1.06/ws_account"; +import { ESPExceptions } from "../espConnection"; -/* - Response structures generated via: - * http://localhost:8010/Ws_Account/?reqjson_ - * http://localhost:8010/Ws_Account/?respjson_ - * http://json2ts.com/ -*/ -export namespace WsAccount { +export { + WsAccount +}; - export interface MyAccountRequest { - } - - export interface WsAccountPingRequest { - } - - export interface UpdateUserRequest { - username: string; - oldpass: string; - newpass1: string; - newpass2: string; - } - - export interface UpdateUserInputRequest { - } - - export interface VerifyUserRequest { - application: string; - version: string; - } - - export interface Exception { - Code: string; - Audience: string; - Source: string; - Message: string; - } - - export interface Exceptions { - Source: string; - Exception: Exception[]; - } - - export interface MyAccountResponse { - Exceptions: Exceptions; - username: string; - firstName: string; - lastName: string; - passwordExpiration: string; - passwordDaysRemaining: number; - passwordExpirationWarningDays: number; - employeeID: string; - distinguishedName: string; - accountType: string; - passwordNeverExpires: boolean; - passwordIsExpired: boolean; - accountStatus: number; - } - - export interface WsAccountPingResponse { - } - - export interface UpdateUserResponse { - Exceptions: Exceptions; - retcode: number; - message: string; - } - - export interface UpdateUserInputResponse { - Exceptions: Exceptions; - username: string; - } - - export interface VerifyUserResponse { - Exceptions: Exceptions; - retcode: number; - } -} - -export class AccountService { - private _connection: ESPConnection; - - constructor(optsConnection: IOptions | IConnection) { - this._connection = new ESPConnection(optsConnection, "Ws_Account", "1.05"); - } - - connectionOptions(): IOptions { - return this._connection.opts(); - } - - MyAccount(request: WsAccount.MyAccountRequest): Promise { - return this._connection.send("MyAccount", request); - } - - UpdateUser(request: WsAccount.UpdateUserRequest): Promise { - return this._connection.send("UpdateUser", request); - } - - UpdateUserInput(request: WsAccount.UpdateUserInputRequest): Promise { - return this._connection.send("UpdateUserInput", request); - } +export class AccountService extends AccountServiceBase { VerifyUser(request: WsAccount.VerifyUserRequest): Promise { return this._connection.send("VerifyUser", request) @@ -117,4 +23,5 @@ export class AccountService { throw e; }); } + } diff --git a/packages/comms/src/services/wsdl/ws_account/v1.06/ws_account.ts b/packages/comms/src/services/wsdl/ws_account/v1.06/ws_account.ts new file mode 100644 index 0000000000..88f823a641 --- /dev/null +++ b/packages/comms/src/services/wsdl/ws_account/v1.06/ws_account.ts @@ -0,0 +1,109 @@ +import { IConnection, IOptions } from "../../../../connection"; +import { Service } from "../../../../espConnection"; + +export namespace WsAccount { + + export type int = number; + + export interface MyAccountRequest { + + } + + export interface Exception { + Code: string; + Audience: string; + Source: string; + Message: string; + } + + export interface Exceptions { + Source: string; + Exception: Exception[]; + } + + export interface MyAccountResponse { + Exceptions: Exceptions; + username: string; + firstName: string; + lastName: string; + passwordExpiration: string; + passwordDaysRemaining: int; + passwordExpirationWarningDays: int; + employeeID: string; + distinguishedName: string; + accountType: string; + passwordNeverExpires: boolean; + passwordIsExpired: boolean; + CanUpdatePassword: boolean; + accountStatus: int; + } + + export interface ws_accountPingRequest { + + } + + export interface ws_accountPingResponse { + + } + + export interface UpdateUserRequest { + username?: string; + oldpass?: string; + newpass1?: string; + newpass2?: string; + } + + export interface UpdateUserResponse { + Exceptions: Exceptions; + retcode: int; + message: string; + } + + export interface UpdateUserInputRequest { + + } + + export interface UpdateUserInputResponse { + Exceptions: Exceptions; + username: string; + } + + export interface VerifyUserRequest { + application?: string; + version?: string; + } + + export interface VerifyUserResponse { + Exceptions: Exceptions; + retcode: int; + } + +} + +export class AccountServiceBase extends Service { + + constructor(optsConnection: IOptions | IConnection) { + super(optsConnection, "ws_account", "1.06"); + } + + MyAccount(request: Partial): Promise { + return this._connection.send("MyAccount", request, "json", false, undefined, "MyAccountResponse"); + } + + Ping(request: Partial): Promise { + return this._connection.send("Ping", request, "json", false, undefined, "ws_accountPingResponse"); + } + + UpdateUser(request: Partial): Promise { + return this._connection.send("UpdateUser", request, "json", false, undefined, "UpdateUserResponse"); + } + + UpdateUserInput(request: Partial): Promise { + return this._connection.send("UpdateUserInput", request, "json", false, undefined, "UpdateUserInputResponse"); + } + + VerifyUser(request: Partial): Promise { + return this._connection.send("VerifyUser", request, "json", false, undefined, "VerifyUserResponse"); + } + +}