eh-api-client
Advanced tools
Comparing version 0.46.3 to 0.47.0
@@ -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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46512
1487
7