Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npmignore cleanup; adding some types to Client #1049

Merged
merged 1 commit into from Feb 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .npmignore
Expand Up @@ -6,3 +6,4 @@ History.md
PUBLISHING.md
.*
/src
/docs
3 changes: 1 addition & 2 deletions package.json
Expand Up @@ -27,8 +27,7 @@
"types": "./lib/soap.d.ts",
"directories": {
"lib": "./lib",
"test": "./test",
"example": "./src/examples"
"test": "./test"
},
"scripts": {
"prepare": "npm run build",
Expand Down
16 changes: 9 additions & 7 deletions src/client.ts
Expand Up @@ -8,7 +8,9 @@ import * as BluebirdPromise from 'bluebird';
import * as concatStream from 'concat-stream';
import * as debugBuilder from 'debug';
import { EventEmitter } from 'events';
import { IncomingHttpHeaders } from 'http';
import * as _ from 'lodash';
import * as request from 'request';
import { v4 as uuid4 } from 'uuid';
import { HttpClient, Request } from './http';
import { IHeaders, IOptions, ISecurity, SoapMethod } from './types';
Expand Down Expand Up @@ -46,7 +48,13 @@ export interface Client {
export class Client extends EventEmitter {
[method: string]: any;
/** contains last full soap request for client logging */
public lastRequest: string;
public lastRequest?: string;
public lastMessage?: string;
public lastEndpoint?: string;
public lastRequestHeaders?: request.Headers;
public lastResponse?: any;
public lastResponseHeaders?: IncomingHttpHeaders;
public lastElapsedTime?: number;

private wsdl: WSDL;
private httpClient: HttpClient;
Expand All @@ -58,12 +66,6 @@ export class Client extends EventEmitter {
private SOAPAction: string;
private streamAllowed: boolean;
private normalizeNames: boolean;
private lastMessage: string;
private lastEndpoint: string;
private lastRequestHeaders;
private lastResponse;
private lastResponseHeaders;
private lastElapsedTime: number;

constructor(wsdl: WSDL, endpoint?: string, options?: IOptions) {
super();
Expand Down
6 changes: 3 additions & 3 deletions src/soap.ts
Expand Up @@ -8,7 +8,7 @@ import * as debugBuilder from 'debug';
import { Client } from './client';
import * as _security from './security';
import { Server, ServerType } from './server';
import { IOptions, IServerOptions } from './types';
import { IOptions, IServerOptions, IServices } from './types';
import { open_wsdl, WSDL } from './wsdl';

const debug = debugBuilder('node-soap:soap');
Expand Down Expand Up @@ -98,9 +98,9 @@ export function createClientAsync(url: string, options: IOptions, endpoint?: str
});
}

export function listen(server: ServerType, path: string, services: any, wsdl: string): Server;
export function listen(server: ServerType, path: string, services: IServices, wsdl: string): Server;
export function listen(server: ServerType, options: IServerOptions): Server;
export function listen(server: ServerType, p2: string | IServerOptions, services?: any, xml?: string): Server {
export function listen(server: ServerType, p2: string | IServerOptions, services?: IServices, xml?: string): Server {
let options: IServerOptions;
let path: string;
let uri = '';
Expand Down