Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eh-api-client

Package Overview
Dependencies
Maintainers
2
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eh-api-client - npm Package Compare versions

Comparing version 0.46.3 to 0.47.0

88

index.d.ts

@@ -5,45 +5,71 @@ // Type definitions for eh-api-client 0.24.0

declare class Client {
fork(subUrl): Client;
request(method): Promise<any>;
exists(url, options?, cb?): Promise<boolean>;
get(options, body?, cb?): Promise<any>;
post(options, body?, cb?): Promise<any>;
put(options, body?, cb?): Promise<any>;
head(options, body?, cb?): Promise<any>;
patch(options, body?, cb?): Promise<any>;
delete(options, body?, cb?): Promise<any>;
interface OptionsObj extends Record<string, unknown> {
url?: string | string [];
}
export type Options = OptionsObj | string | string[]
export type Callback<T extends any> = (err: unknown, data: T, res: unknown, req: unknown) => void
export declare class Client {
fork(subUrl: string): Client;
request<T extends any>(method: string, options: Options, cb?: Callback<T> ): Promise<T>;
request<T extends any>(method: string, options: Options, body: unknown, cb?: Callback<T> ): Promise<T>;
exists(url: string, cb?: Callback<boolean>): Promise<boolean>;
exists(url: string, options: Options, cb?: Callback<boolean>): Promise<boolean>;
get<T extends any>(options: Options, cb?: Callback<T>): Promise<T>;
post<T extends any>(options: Options, cb?: Callback<T>): Promise<T>;
post<T extends any>(options: Options, body: unknown, cb?: Callback<T>): Promise<T>;
put<T extends any>(options: Options, cb?: Callback<T>): Promise<T>;
put<T extends any>(options: Options, body: unknown, cb?: Callback<T>): Promise<T>;
head<T extends any>(options: Options, cb?: Callback<unknown>): Promise<unknown>;
patch<T extends any>(options: Options, cb?: Callback<T>): Promise<T>;
patch<T extends any>(options: Options, body: unknown, cb?: Callback<T>): Promise<T>;
delete<T extends any>(options: Options, cb?: Callback<T>): Promise<T>;
setSessionId(sessionId: string): void;
setRequestId(requestId: string): void;
setDeviceId(deviceId: string): void;
addRequestModificator(modificator): void;
setHeaders(headers: any): void;
prototype: any;
addRequestModificator(modificator: (params: Record<string, unknown>) => Record<string, unknown>): void;
setHeaders(headers: Record<string, string>): void;
prototype: Client;
}
declare class APIFactory {
Client: Client;
secret: string
getClientByContext(context: any): Client;
constructor(apiURL);
setRetryOptions(options: any);
setAgentOptions(options: any);
setSecret(secret: string);
exists(options?, cb?): Promise<boolean>;
export interface RetryOptions {
maxAttempts?: number;
retryDelay?: number;
retryStrategy?: (err: unknown, params: Record<string, unknown>) => boolean;
}
export declare class APIFactory {
Client: { new ():Client };
secret: string | null
constructor(apiURL: string);
getClientByContext(context: unknown): Client;
setRetryOptions(options: RetryOptions): void;
setAgentOptions(options: Record<string, unknown>): void;
setSecret(secret: string): void;
exists(cb?: Callback<boolean>): Promise<boolean>;
exists(options: Options, cb?: Callback<boolean>): Promise<boolean>;
getClient(userId: number, app: string): Client;
getRawClient(): Client;
get(options, body?, cb?): Promise<any>;
post(options, body?, cb?): Promise<any>;
put(options, body?, cb?): Promise<any>;
head(options, body?, cb?): Promise<any>;
patch(options, body?, cb?): Promise<any>;
delete(options, body?, cb?): Promise<any>;
get<T extends any>(options: Options, cb?: Callback<T>): Promise<T>;
post<T extends any>(options: Options, cb?: Callback<T>): Promise<T>;
post<T extends any>(options: Options, body: unknown, cb?: Callback<T>): Promise<T>;
put<T extends any>(options: Options, cb?: Callback<T>): Promise<T>;
put<T extends any>(options: Options, body: unknown, cb?: Callback<T>): Promise<T>;
head<T extends any>(options: Options, cb?: Callback<unknown>): Promise<unknown>;
patch<T extends any>(options: Options, cb?: Callback<T>): Promise<T>;
patch<T extends any>(options: Options, body: unknown, cb?: Callback<T>): Promise<T>;
delete<T extends any>(options: Options, cb?: Callback<T>): Promise<T>;
static on(event: string, cb: any): void
static on(event: string, cb: (...args: unknown[]) => unknown): void
static setAsyncLocalStorage(asyncLocalStorage): void
static getFromStore(property: string): string
static setClientProperties(client: Client, contenxt: any): void
static setClientProperties(client: Client, contenxt: unknown): void
}
export = APIFactory
export default APIFactory
{
"name": "eh-api-client",
"version": "0.46.3",
"version": "0.47.0",
"description": "Node.js rest client",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc