@pushwoosh/http-client 2.2.4 → 2.3.0
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.
- package/dist/RPC.d.ts +56 -0
- package/dist/RPC.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -1
package/dist/RPC.d.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { HttpClient } from './http-client.main';
|
|
2
|
+
export declare class RpcException extends Error {
|
|
3
|
+
code: number;
|
|
4
|
+
details: any;
|
|
5
|
+
readonly error: number;
|
|
6
|
+
constructor(message: string, code: number, details: any);
|
|
7
|
+
}
|
|
8
|
+
export declare type RpcCallback = (body: RpcFetchBody) => void;
|
|
9
|
+
export declare type RpcResponseSuccess = {
|
|
10
|
+
name: string;
|
|
11
|
+
result: any;
|
|
12
|
+
extra?: any;
|
|
13
|
+
};
|
|
14
|
+
export declare type RpcResponseError = {
|
|
15
|
+
name: string;
|
|
16
|
+
error: number;
|
|
17
|
+
message: string;
|
|
18
|
+
details: any;
|
|
19
|
+
};
|
|
20
|
+
export declare type RpcResponse = RpcResponseSuccess | RpcResponseError;
|
|
21
|
+
export declare type RpcFetchBody = {
|
|
22
|
+
auth?: {
|
|
23
|
+
logged: boolean;
|
|
24
|
+
};
|
|
25
|
+
responses: Array<RpcResponseSuccess | RpcResponseError>;
|
|
26
|
+
};
|
|
27
|
+
export declare class Rpc {
|
|
28
|
+
private httpClient;
|
|
29
|
+
private options;
|
|
30
|
+
private counter;
|
|
31
|
+
private listeners;
|
|
32
|
+
constructor(httpClient: HttpClient, options: {
|
|
33
|
+
withAuthorization: boolean;
|
|
34
|
+
log: (m: {
|
|
35
|
+
num: number;
|
|
36
|
+
type: string;
|
|
37
|
+
message: string;
|
|
38
|
+
data: any;
|
|
39
|
+
}) => void;
|
|
40
|
+
onException: <T extends {
|
|
41
|
+
message: string;
|
|
42
|
+
error: Error;
|
|
43
|
+
}>(t: T) => void;
|
|
44
|
+
});
|
|
45
|
+
subscribe(callback: RpcCallback): void;
|
|
46
|
+
callRemoteProcedure(name: string, params: any, logInfo: string, filesNames?: string[]): Promise<{
|
|
47
|
+
auth: RpcFetchBody['auth'];
|
|
48
|
+
response: RpcResponseSuccess;
|
|
49
|
+
}>;
|
|
50
|
+
callMany(calls: Array<{
|
|
51
|
+
name: string;
|
|
52
|
+
params?: any;
|
|
53
|
+
}>, logInfo: string): Promise<RpcFetchBody>;
|
|
54
|
+
private fetch;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=RPC.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RPC.d.ts","sourceRoot":"","sources":["../src/RPC.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,qBAAa,YAAa,SAAQ,KAAK;IAGD,IAAI,EAAE,MAAM;IAAS,OAAO,EAAE,GAAG;IAFrE,SAAgB,KAAK,EAAE,MAAM,CAAC;gBAElB,OAAO,EAAE,MAAM,EAAS,IAAI,EAAE,MAAM,EAAS,OAAO,EAAE,GAAG;CAKtE;AAED,oBAAY,WAAW,GAAG,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;AAEvD,oBAAY,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,GAAG,CAAC;IACZ,KAAK,CAAC,EAAE,GAAG,CAAC;CACb,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,GAAG,CAAC;CACd,CAAC;AAEF,oBAAY,WAAW,GAAG,kBAAkB,GAAG,gBAAgB,CAAC;AAMhE,oBAAY,YAAY,GAAG;IACzB,I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 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,OAAO,CAAC"}
|