@vonage/client-sdk 1.0.1 → 1.0.2-rc.1

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.
@@ -682,7 +682,7 @@ export namespace vonage {
682
682
  }
683
683
  export namespace vonage {
684
684
  interface HttpClientJS {
685
- request(verb: string, url: string, headers: Json, body: Nullable<string>, callback: (p0: Nullable<vonage.HttpClientErrorJS>, p1: Nullable<string>) => void): void;
685
+ request(verb: string, url: string, headers: Json, body: Nullable<string>, callback: (p0: Nullable<vonage.HttpClientErrorJS>, p1: Nullable<vonage.HttpClientResponseJS>) => void): void;
686
686
  }
687
687
  interface SocketClientJS {
688
688
  delegate: Nullable<vonage.SocketClientDelegateJS>;
@@ -714,15 +714,22 @@ export namespace vonage {
714
714
  }
715
715
  export namespace vonage {
716
716
  class HttpClientErrorJS extends Error {
717
- constructor(message?: Nullable<string>, responseCode?: Nullable<number>, responseBody?: Nullable<string>, cause?: Nullable<Error>);
718
- get responseCode(): Nullable<number>;
719
- get responseBody(): Nullable<string>;
717
+ constructor(message?: Nullable<string>, cause?: Nullable<Error>);
720
718
  get coreError(): any/* com.vonage.clientcore.core.middlewares.http.HTTPClientError */;
721
719
  component1(): Nullable<string>;
722
- component2(): Nullable<number>;
723
- component3(): Nullable<string>;
724
- component4(): Nullable<Error>;
725
- copy(message?: Nullable<string>, responseCode?: Nullable<number>, responseBody?: Nullable<string>, cause?: Nullable<Error>): vonage.HttpClientErrorJS;
720
+ component2(): Nullable<Error>;
721
+ copy(message?: Nullable<string>, cause?: Nullable<Error>): vonage.HttpClientErrorJS;
722
+ toString(): string;
723
+ hashCode(): number;
724
+ equals(other: Nullable<any>): boolean;
725
+ }
726
+ class HttpClientResponseJS {
727
+ constructor(statusCode: number, body?: Nullable<string>);
728
+ get statusCode(): number;
729
+ get body(): Nullable<string>;
730
+ component1(): number;
731
+ component2(): Nullable<string>;
732
+ copy(statusCode?: number, body?: Nullable<string>): vonage.HttpClientResponseJS;
726
733
  toString(): string;
727
734
  hashCode(): number;
728
735
  equals(other: Nullable<any>): boolean;
@@ -3,6 +3,6 @@ import vonage from '../utils/vonage';
3
3
  type HttpHeaders = Record<string, string | number | boolean>;
4
4
  declare class HttpClient implements vonage.HttpClientJS {
5
5
  private stringToVerb;
6
- request(verb: string, url: string, headers: HttpHeaders, body: string | null, callback: (p0: KMPPackage.Nullable<vonage.HttpClientErrorJS>, p1: KMPPackage.Nullable<string>) => void): Promise<void>;
6
+ request(verb: string, url: string, headers: HttpHeaders, body: string | null, callback: (p0: KMPPackage.Nullable<vonage.HttpClientErrorJS>, p1: KMPPackage.Nullable<vonage.HttpClientResponseJS>) => void): Promise<void>;
7
7
  }
8
8
  export default HttpClient;