@itwin/core-mobile 4.0.0-dev.1 → 4.0.0-dev.100
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/CHANGELOG.md +58 -1
- package/README.md +1 -1
- package/lib/cjs/MobileBackend.d.ts +7 -7
- package/lib/cjs/MobileBackend.js +28 -24
- package/lib/cjs/MobileBackend.js.map +1 -1
- package/lib/cjs/MobileFrontend.d.ts +5 -5
- package/lib/cjs/MobileFrontend.js +25 -21
- package/lib/cjs/MobileFrontend.js.map +1 -1
- package/lib/cjs/__DOC_ONLY__.d.ts +33 -33
- package/lib/cjs/__DOC_ONLY__.js +56 -52
- package/lib/cjs/__DOC_ONLY__.js.map +1 -1
- package/lib/cjs/backend/MobileAuthorizationBackend.d.ts +17 -17
- package/lib/cjs/backend/MobileAuthorizationBackend.d.ts.map +1 -1
- package/lib/cjs/backend/MobileAuthorizationBackend.js +54 -46
- package/lib/cjs/backend/MobileAuthorizationBackend.js.map +1 -1
- package/lib/cjs/backend/MobileFileHandler.d.ts +112 -112
- package/lib/cjs/backend/MobileFileHandler.d.ts.map +1 -1
- package/lib/cjs/backend/MobileFileHandler.js +263 -263
- package/lib/cjs/backend/MobileFileHandler.js.map +1 -1
- package/lib/cjs/backend/MobileHost.d.ts +72 -72
- package/lib/cjs/backend/MobileHost.d.ts.map +1 -1
- package/lib/cjs/backend/MobileHost.js +151 -156
- package/lib/cjs/backend/MobileHost.js.map +1 -1
- package/lib/cjs/backend/MobileRpcServer.d.ts +21 -19
- package/lib/cjs/backend/MobileRpcServer.d.ts.map +1 -1
- package/lib/cjs/backend/MobileRpcServer.js +179 -156
- package/lib/cjs/backend/MobileRpcServer.js.map +1 -1
- package/lib/cjs/backend/Request.d.ts +117 -149
- package/lib/cjs/backend/Request.d.ts.map +1 -1
- package/lib/cjs/backend/Request.js +255 -267
- package/lib/cjs/backend/Request.js.map +1 -1
- package/lib/cjs/common/MobileAppChannel.d.ts +4 -4
- package/lib/cjs/common/MobileAppChannel.js +11 -11
- package/lib/cjs/common/MobileAppProps.d.ts +35 -35
- package/lib/cjs/common/MobileAppProps.d.ts.map +1 -1
- package/lib/cjs/common/MobileAppProps.js +26 -26
- package/lib/cjs/common/MobileEventLoop.d.ts +11 -11
- package/lib/cjs/common/MobileEventLoop.js +30 -30
- package/lib/cjs/common/MobileEventLoop.js.map +1 -1
- package/lib/cjs/common/MobileIpc.d.ts +17 -17
- package/lib/cjs/common/MobileIpc.js +70 -70
- package/lib/cjs/common/MobilePush.d.ts +20 -20
- package/lib/cjs/common/MobilePush.js +53 -53
- package/lib/cjs/common/MobilePush.js.map +1 -1
- package/lib/cjs/common/MobileRpcManager.d.ts +40 -40
- package/lib/cjs/common/MobileRpcManager.js +110 -110
- package/lib/cjs/common/MobileRpcManager.js.map +1 -1
- package/lib/cjs/common/MobileRpcProtocol.d.ts +58 -58
- package/lib/cjs/common/MobileRpcProtocol.d.ts.map +1 -1
- package/lib/cjs/common/MobileRpcProtocol.js +277 -277
- package/lib/cjs/common/MobileRpcProtocol.js.map +1 -1
- package/lib/cjs/common/MobileRpcRequest.d.ts +20 -20
- package/lib/cjs/common/MobileRpcRequest.js +50 -50
- package/lib/cjs/frontend/MobileApp.d.ts +23 -23
- package/lib/cjs/frontend/MobileApp.d.ts.map +1 -1
- package/lib/cjs/frontend/MobileApp.js +79 -80
- package/lib/cjs/frontend/MobileApp.js.map +1 -1
- package/lib/cjs/frontend/MobileAuthorizationFrontend.d.ts +17 -17
- package/lib/cjs/frontend/MobileAuthorizationFrontend.d.ts.map +1 -1
- package/lib/cjs/frontend/MobileAuthorizationFrontend.js +54 -46
- package/lib/cjs/frontend/MobileAuthorizationFrontend.js.map +1 -1
- package/lib/cjs/test/ios/MobilePlatform.test.d.ts +1 -1
- package/lib/cjs/test/ios/MobilePlatform.test.js +84 -84
- package/package.json +18 -27
|
@@ -1,150 +1,118 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import * as https from "https";
|
|
3
|
-
import { BentleyError, GetMetaDataFunction, HttpStatus } from "@itwin/core-bentley";
|
|
4
|
-
/** @internal */
|
|
5
|
-
export declare const requestIdHeaderName = "X-Correlation-Id";
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
static shouldRetry(error: any, response: any): boolean;
|
|
119
|
-
/**
|
|
120
|
-
* @internal
|
|
121
|
-
*/
|
|
122
|
-
static parseHttpStatus(statusType: number): HttpStatus;
|
|
123
|
-
/**
|
|
124
|
-
* @internal
|
|
125
|
-
*/
|
|
126
|
-
logMessage(): string;
|
|
127
|
-
/**
|
|
128
|
-
* Logs this error
|
|
129
|
-
* @internal
|
|
130
|
-
*/
|
|
131
|
-
log(): void;
|
|
132
|
-
}
|
|
133
|
-
/** Wrapper around making HTTP requests with the specific options.
|
|
134
|
-
*
|
|
135
|
-
* Usable in both a browser and node based environment.
|
|
136
|
-
*
|
|
137
|
-
* @param url Server URL to address the request
|
|
138
|
-
* @param options Options to pass to the request
|
|
139
|
-
* @returns Resolves to the response from the server
|
|
140
|
-
* @throws ResponseError if the request fails due to network issues, or if the returned status is *outside* the range of 200-299 (inclusive)
|
|
141
|
-
* @internal
|
|
142
|
-
*/
|
|
143
|
-
export declare function request(url: string, options: RequestOptions): Promise<Response>;
|
|
144
|
-
/**
|
|
145
|
-
* fetch json from HTTP request
|
|
146
|
-
* @param url server URL to address the request
|
|
147
|
-
* @internal
|
|
148
|
-
*/
|
|
149
|
-
export declare function getJson(url: string): Promise<any>;
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import * as https from "https";
|
|
3
|
+
import { BentleyError, GetMetaDataFunction, HttpStatus } from "@itwin/core-bentley";
|
|
4
|
+
/** @internal */
|
|
5
|
+
export declare const requestIdHeaderName = "X-Correlation-Id";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export interface RequestQueryStringifyOptions {
|
|
8
|
+
delimiter?: string;
|
|
9
|
+
encode?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** Option to control the time outs
|
|
12
|
+
* Use a short response timeout to detect unresponsive networks quickly, and a long deadline to give time for downloads on slow,
|
|
13
|
+
* but reliable, networks. Note that both of these timers limit how long uploads of attached files are allowed to take. Use long
|
|
14
|
+
* timeouts if you're uploading files.
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export interface RequestTimeoutOptions {
|
|
18
|
+
/** Sets a deadline (in milliseconds) for the entire request (including all uploads, redirects, server processing time) to complete.
|
|
19
|
+
* If the response isn't fully downloaded within that time, the request will be aborted
|
|
20
|
+
*/
|
|
21
|
+
deadline?: number;
|
|
22
|
+
/** Sets maximum time (in milliseconds) to wait for the first byte to arrive from the server, but it does not limit how long the entire
|
|
23
|
+
* download can take. Response timeout should be at least few seconds longer than just the time it takes the server to respond, because
|
|
24
|
+
* it also includes time to make DNS lookup, TCP/IP and TLS connections, and time to upload request data.
|
|
25
|
+
*/
|
|
26
|
+
response?: number;
|
|
27
|
+
}
|
|
28
|
+
/** @internal */
|
|
29
|
+
export interface RequestOptions {
|
|
30
|
+
method: string;
|
|
31
|
+
headers?: any;
|
|
32
|
+
body?: any;
|
|
33
|
+
responseType?: string;
|
|
34
|
+
timeout?: RequestTimeoutOptions;
|
|
35
|
+
stream?: any;
|
|
36
|
+
readStream?: any;
|
|
37
|
+
buffer?: any;
|
|
38
|
+
parser?: any;
|
|
39
|
+
accept?: string;
|
|
40
|
+
redirects?: number;
|
|
41
|
+
errorCallback?: (response: any) => ResponseError;
|
|
42
|
+
retryCallback?: (error: any, response: any) => boolean;
|
|
43
|
+
progressCallback?: ProgressCallback;
|
|
44
|
+
agent?: https.Agent;
|
|
45
|
+
retries?: number;
|
|
46
|
+
useCorsProxy?: boolean;
|
|
47
|
+
}
|
|
48
|
+
/** Response object if the request was successful. Note that the status within the range of 200-299 are considered as a success.
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
51
|
+
export interface Response {
|
|
52
|
+
body: any;
|
|
53
|
+
text: string | undefined;
|
|
54
|
+
header: any;
|
|
55
|
+
status: number;
|
|
56
|
+
}
|
|
57
|
+
/** @internal */
|
|
58
|
+
export interface ProgressInfo {
|
|
59
|
+
percent?: number;
|
|
60
|
+
total?: number;
|
|
61
|
+
loaded: number;
|
|
62
|
+
}
|
|
63
|
+
/** @internal */
|
|
64
|
+
export type ProgressCallback = (progress: ProgressInfo) => void;
|
|
65
|
+
/** Error object that's thrown/rejected if the Request fails due to a network error, or if the status is *not* in the range of 200-299 (inclusive)
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
export declare class ResponseError extends BentleyError {
|
|
69
|
+
protected _data?: any;
|
|
70
|
+
status?: number;
|
|
71
|
+
description?: string;
|
|
72
|
+
constructor(errorNumber: number | HttpStatus, message?: string, getMetaData?: GetMetaDataFunction);
|
|
73
|
+
/**
|
|
74
|
+
* Parses error from server's response
|
|
75
|
+
* @param response Http response from the server.
|
|
76
|
+
* @returns Parsed error.
|
|
77
|
+
* @internal
|
|
78
|
+
*/
|
|
79
|
+
static parse(response: any, log?: boolean): ResponseError;
|
|
80
|
+
/**
|
|
81
|
+
* Decides whether request should be retried or not
|
|
82
|
+
* @param error Error returned by request
|
|
83
|
+
* @param response Response returned by request
|
|
84
|
+
* @internal
|
|
85
|
+
*/
|
|
86
|
+
static shouldRetry(error: any, response: any): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* @internal
|
|
89
|
+
*/
|
|
90
|
+
static parseHttpStatus(statusType: number): HttpStatus;
|
|
91
|
+
/**
|
|
92
|
+
* @internal
|
|
93
|
+
*/
|
|
94
|
+
logMessage(): string;
|
|
95
|
+
/**
|
|
96
|
+
* Logs this error
|
|
97
|
+
* @internal
|
|
98
|
+
*/
|
|
99
|
+
log(): void;
|
|
100
|
+
}
|
|
101
|
+
/** Wrapper around making HTTP requests with the specific options.
|
|
102
|
+
*
|
|
103
|
+
* Usable in both a browser and node based environment.
|
|
104
|
+
*
|
|
105
|
+
* @param url Server URL to address the request
|
|
106
|
+
* @param options Options to pass to the request
|
|
107
|
+
* @returns Resolves to the response from the server
|
|
108
|
+
* @throws ResponseError if the request fails due to network issues, or if the returned status is *outside* the range of 200-299 (inclusive)
|
|
109
|
+
* @internal
|
|
110
|
+
*/
|
|
111
|
+
export declare function request(url: string, options: RequestOptions): Promise<Response>;
|
|
112
|
+
/**
|
|
113
|
+
* fetch json from HTTP request
|
|
114
|
+
* @param url server URL to address the request
|
|
115
|
+
* @internal
|
|
116
|
+
*/
|
|
117
|
+
export declare function getJson(url: string): Promise<any>;
|
|
150
118
|
//# sourceMappingURL=Request.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Request.d.ts","sourceRoot":"","sources":["../../../src/backend/Request.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Request.d.ts","sourceRoot":"","sources":["../../../src/backend/Request.ts"],"names":[],"mappings":";AAQA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,UAAU,EAAoB,MAAM,qBAAqB,CAAC;AAItG,gBAAgB;AAChB,eAAO,MAAM,mBAAmB,qBAAqB,CAAC;AAEtD,gBAAgB;AAChB,MAAM,WAAW,4BAA4B;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,gBAAgB;AAChB,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,YAAY,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