@itwin/core-mobile 3.0.0-extension.0 → 3.1.0-dev.5
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 +76 -1
- package/LICENSE.md +1 -1
- package/lib/cjs/MobileBackend.d.ts +5 -2
- package/lib/cjs/MobileBackend.d.ts.map +1 -1
- package/lib/cjs/MobileBackend.js +5 -2
- package/lib/cjs/MobileBackend.js.map +1 -1
- package/lib/cjs/MobileFrontend.d.ts +4 -1
- package/lib/cjs/MobileFrontend.d.ts.map +1 -1
- package/lib/cjs/MobileFrontend.js +4 -1
- package/lib/cjs/MobileFrontend.js.map +1 -1
- package/lib/cjs/__DOC_ONLY__.d.ts +2 -8
- package/lib/cjs/__DOC_ONLY__.d.ts.map +1 -1
- package/lib/cjs/__DOC_ONLY__.js +2 -8
- package/lib/cjs/__DOC_ONLY__.js.map +1 -1
- package/lib/cjs/backend/MobileAuthorizationBackend.d.ts +48 -6
- package/lib/cjs/backend/MobileAuthorizationBackend.d.ts.map +1 -1
- package/lib/cjs/backend/MobileAuthorizationBackend.js +57 -10
- package/lib/cjs/backend/MobileAuthorizationBackend.js.map +1 -1
- package/lib/cjs/backend/MobileFileHandler.d.ts +28 -3
- package/lib/cjs/backend/MobileFileHandler.d.ts.map +1 -1
- package/lib/cjs/backend/MobileFileHandler.js +39 -8
- package/lib/cjs/backend/MobileFileHandler.js.map +1 -1
- package/lib/cjs/backend/MobileHost.d.ts +7 -10
- package/lib/cjs/backend/MobileHost.d.ts.map +1 -1
- package/lib/cjs/backend/MobileHost.js +6 -15
- package/lib/cjs/backend/MobileHost.js.map +1 -1
- package/lib/cjs/backend/MobileRpcServer.d.ts +1 -0
- package/lib/cjs/backend/MobileRpcServer.d.ts.map +1 -1
- package/lib/cjs/backend/MobileRpcServer.js +2 -1
- package/lib/cjs/backend/MobileRpcServer.js.map +1 -1
- package/lib/cjs/backend/Request.d.ts +150 -0
- package/lib/cjs/backend/Request.d.ts.map +1 -0
- package/lib/cjs/backend/Request.js +268 -0
- package/lib/cjs/backend/Request.js.map +1 -0
- package/lib/cjs/common/MobileAppChannel.d.ts +5 -0
- package/lib/cjs/common/MobileAppChannel.d.ts.map +1 -0
- package/lib/cjs/common/MobileAppChannel.js +12 -0
- package/lib/cjs/common/MobileAppChannel.js.map +1 -0
- package/lib/cjs/common/MobileAppProps.d.ts +5 -5
- package/lib/cjs/common/MobileAppProps.d.ts.map +1 -1
- package/lib/cjs/common/MobileAppProps.js +3 -5
- package/lib/cjs/common/MobileAppProps.js.map +1 -1
- package/lib/cjs/frontend/MobileApp.d.ts +1 -1
- package/lib/cjs/frontend/MobileApp.d.ts.map +1 -1
- package/lib/cjs/frontend/MobileApp.js +4 -4
- package/lib/cjs/frontend/MobileApp.js.map +1 -1
- package/package.json +26 -18
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getJson = exports.request = exports.ResponseError = exports.requestIdHeaderName = void 0;
|
|
4
|
+
/*---------------------------------------------------------------------------------------------
|
|
5
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
+
*--------------------------------------------------------------------------------------------*/
|
|
8
|
+
/** @packageDocumentation
|
|
9
|
+
* @module iTwinServiceClients
|
|
10
|
+
*/
|
|
11
|
+
const deepAssign = require("deep-assign");
|
|
12
|
+
const qs_1 = require("qs");
|
|
13
|
+
const sarequest = require("superagent");
|
|
14
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
15
|
+
const loggerCategory = "core-mobile-backend.Request";
|
|
16
|
+
/** @internal */
|
|
17
|
+
exports.requestIdHeaderName = "X-Correlation-Id";
|
|
18
|
+
/** 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)
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
class ResponseError extends core_bentley_1.BentleyError {
|
|
22
|
+
constructor(errorNumber, message, getMetaData) {
|
|
23
|
+
super(errorNumber, message, getMetaData);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Parses error from server's response
|
|
27
|
+
* @param response Http response from the server.
|
|
28
|
+
* @returns Parsed error.
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
static parse(response, log = true) {
|
|
32
|
+
const error = new ResponseError(ResponseError.parseHttpStatus(response.statusType));
|
|
33
|
+
if (!response) {
|
|
34
|
+
error.message = "Couldn't get response object.";
|
|
35
|
+
return error;
|
|
36
|
+
}
|
|
37
|
+
if (response.response) {
|
|
38
|
+
if (response.response.error) {
|
|
39
|
+
error.name = response.response.error.name || error.name;
|
|
40
|
+
error.description = response.response.error.message;
|
|
41
|
+
}
|
|
42
|
+
if (response.response.res) {
|
|
43
|
+
error.message = response.response.res.statusMessage;
|
|
44
|
+
}
|
|
45
|
+
if (response.response.body && Object.keys(response.response.body).length > 0) {
|
|
46
|
+
error._data = {};
|
|
47
|
+
deepAssign(error._data, response.response.body);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
error._data = response.response.text;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
error.status = response.status || response.statusCode;
|
|
54
|
+
error.name = response.code || response.name || error.name;
|
|
55
|
+
error.message = error.message || response.message || response.statusMessage;
|
|
56
|
+
if (log)
|
|
57
|
+
error.log();
|
|
58
|
+
return error;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Decides whether request should be retried or not
|
|
62
|
+
* @param error Error returned by request
|
|
63
|
+
* @param response Response returned by request
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
66
|
+
static shouldRetry(error, response) {
|
|
67
|
+
if (error !== undefined && error !== null) {
|
|
68
|
+
if ((error.status === undefined || error.status === null) && (error.res === undefined || error.res === null)) {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return (response !== undefined && response.statusType === core_bentley_1.HttpStatus.ServerError);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
77
|
+
static parseHttpStatus(statusType) {
|
|
78
|
+
switch (statusType) {
|
|
79
|
+
case 1:
|
|
80
|
+
return core_bentley_1.HttpStatus.Info;
|
|
81
|
+
case 2:
|
|
82
|
+
return core_bentley_1.HttpStatus.Success;
|
|
83
|
+
case 3:
|
|
84
|
+
return core_bentley_1.HttpStatus.Redirection;
|
|
85
|
+
case 4:
|
|
86
|
+
return core_bentley_1.HttpStatus.ClientError;
|
|
87
|
+
case 5:
|
|
88
|
+
return core_bentley_1.HttpStatus.ServerError;
|
|
89
|
+
default:
|
|
90
|
+
return core_bentley_1.HttpStatus.Success;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* @internal
|
|
95
|
+
*/
|
|
96
|
+
logMessage() {
|
|
97
|
+
return `${this.status} ${this.name}: ${this.message}`;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Logs this error
|
|
101
|
+
* @internal
|
|
102
|
+
*/
|
|
103
|
+
log() {
|
|
104
|
+
core_bentley_1.Logger.logError(loggerCategory, this.logMessage(), () => this.getMetaData());
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
exports.ResponseError = ResponseError;
|
|
108
|
+
const logResponse = (req, startTime) => (res) => {
|
|
109
|
+
const elapsed = new Date().getTime() - startTime;
|
|
110
|
+
const elapsedTime = `${elapsed}ms`;
|
|
111
|
+
core_bentley_1.Logger.logTrace(loggerCategory, `${req.method.toUpperCase()} ${res.status} ${req.url} (${elapsedTime})`);
|
|
112
|
+
};
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/promise-function-async
|
|
114
|
+
const logRequest = (req) => {
|
|
115
|
+
const startTime = new Date().getTime();
|
|
116
|
+
return req.on("response", logResponse(req, startTime));
|
|
117
|
+
};
|
|
118
|
+
/** Wrapper around making HTTP requests with the specific options.
|
|
119
|
+
*
|
|
120
|
+
* Usable in both a browser and node based environment.
|
|
121
|
+
*
|
|
122
|
+
* @param url Server URL to address the request
|
|
123
|
+
* @param options Options to pass to the request
|
|
124
|
+
* @returns Resolves to the response from the server
|
|
125
|
+
* @throws ResponseError if the request fails due to network issues, or if the returned status is *outside* the range of 200-299 (inclusive)
|
|
126
|
+
* @internal
|
|
127
|
+
*/
|
|
128
|
+
async function request(url, options) {
|
|
129
|
+
let sareq = sarequest(options.method, url);
|
|
130
|
+
if (options.retries)
|
|
131
|
+
sareq = sareq.retry(options.retries, options.retryCallback);
|
|
132
|
+
if (core_bentley_1.Logger.isEnabled(loggerCategory, core_bentley_1.LogLevel.Trace))
|
|
133
|
+
sareq = sareq.use(logRequest);
|
|
134
|
+
if (options.headers)
|
|
135
|
+
sareq = sareq.set(options.headers);
|
|
136
|
+
let queryStr = "";
|
|
137
|
+
let fullUrl = "";
|
|
138
|
+
if (options.qs && Object.keys(options.qs).length > 0) {
|
|
139
|
+
const stringifyOptions = { delimiter: "&", encode: false };
|
|
140
|
+
queryStr = (0, qs_1.stringify)(options.qs, stringifyOptions);
|
|
141
|
+
sareq = sareq.query(queryStr);
|
|
142
|
+
fullUrl = `${url}?${queryStr}`;
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
fullUrl = url;
|
|
146
|
+
}
|
|
147
|
+
core_bentley_1.Logger.logInfo(loggerCategory, fullUrl);
|
|
148
|
+
if (options.accept)
|
|
149
|
+
sareq = sareq.accept(options.accept);
|
|
150
|
+
if (options.body)
|
|
151
|
+
sareq = sareq.send(options.body);
|
|
152
|
+
if (options.timeout)
|
|
153
|
+
sareq = sareq.timeout(options.timeout);
|
|
154
|
+
if (options.responseType)
|
|
155
|
+
sareq = sareq.responseType(options.responseType);
|
|
156
|
+
if (options.redirects)
|
|
157
|
+
sareq = sareq.redirects(options.redirects);
|
|
158
|
+
else
|
|
159
|
+
sareq = sareq.redirects(0);
|
|
160
|
+
if (options.buffer)
|
|
161
|
+
sareq = sareq.buffer(options.buffer);
|
|
162
|
+
if (options.parser)
|
|
163
|
+
sareq = sareq.parse(options.parser);
|
|
164
|
+
/** Default to any globally supplied proxy, unless an agent is specified in this call */
|
|
165
|
+
if (options.agent)
|
|
166
|
+
sareq = sareq.agent(options.agent);
|
|
167
|
+
if (options.progressCallback) {
|
|
168
|
+
sareq = sareq.on("progress", (event) => {
|
|
169
|
+
if (event) {
|
|
170
|
+
options.progressCallback({
|
|
171
|
+
loaded: event.loaded,
|
|
172
|
+
total: event.total,
|
|
173
|
+
percent: event.percent,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
const errorCallback = options.errorCallback ? options.errorCallback : ResponseError.parse;
|
|
179
|
+
if (options.readStream) {
|
|
180
|
+
if (typeof window !== "undefined")
|
|
181
|
+
throw new Error("This option is not supported on browsers");
|
|
182
|
+
return new Promise((resolve, reject) => {
|
|
183
|
+
sareq = sareq.type("blob");
|
|
184
|
+
options
|
|
185
|
+
.readStream
|
|
186
|
+
.pipe(sareq)
|
|
187
|
+
.on("error", (error) => {
|
|
188
|
+
const parsedError = errorCallback(error);
|
|
189
|
+
reject(parsedError);
|
|
190
|
+
})
|
|
191
|
+
.on("end", () => {
|
|
192
|
+
const retResponse = {
|
|
193
|
+
status: 201,
|
|
194
|
+
header: undefined,
|
|
195
|
+
body: undefined,
|
|
196
|
+
text: undefined,
|
|
197
|
+
};
|
|
198
|
+
resolve(retResponse);
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
if (options.stream) {
|
|
203
|
+
if (typeof window !== "undefined")
|
|
204
|
+
throw new Error("This option is not supported on browsers");
|
|
205
|
+
return new Promise((resolve, reject) => {
|
|
206
|
+
sareq
|
|
207
|
+
.on("response", (res) => {
|
|
208
|
+
if (res.statusCode !== 200) {
|
|
209
|
+
const parsedError = errorCallback(res);
|
|
210
|
+
reject(parsedError);
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
})
|
|
214
|
+
.pipe(options.stream)
|
|
215
|
+
.on("error", (error) => {
|
|
216
|
+
const parsedError = errorCallback(error);
|
|
217
|
+
reject(parsedError);
|
|
218
|
+
})
|
|
219
|
+
.on("finish", () => {
|
|
220
|
+
const retResponse = {
|
|
221
|
+
status: 200,
|
|
222
|
+
header: undefined,
|
|
223
|
+
body: undefined,
|
|
224
|
+
text: undefined,
|
|
225
|
+
};
|
|
226
|
+
resolve(retResponse);
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
// console.log("%s %s %s", url, options.method, queryStr);
|
|
231
|
+
/**
|
|
232
|
+
* Note:
|
|
233
|
+
* Javascript's fetch returns status.OK if error is between 200-299 inclusive, and doesn't reject in this case.
|
|
234
|
+
* Fetch only rejects if there's some network issue (permissions issue or similar)
|
|
235
|
+
* Superagent rejects network issues, and errors outside the range of 200-299. We are currently using
|
|
236
|
+
* superagent, but may eventually switch to JavaScript's fetch library.
|
|
237
|
+
*/
|
|
238
|
+
try {
|
|
239
|
+
const response = await sareq;
|
|
240
|
+
const retResponse = {
|
|
241
|
+
body: response.body,
|
|
242
|
+
text: response.text,
|
|
243
|
+
header: response.header,
|
|
244
|
+
status: response.status,
|
|
245
|
+
};
|
|
246
|
+
return retResponse;
|
|
247
|
+
}
|
|
248
|
+
catch (error) {
|
|
249
|
+
const parsedError = errorCallback(error);
|
|
250
|
+
throw parsedError;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
exports.request = request;
|
|
254
|
+
/**
|
|
255
|
+
* fetch json from HTTP request
|
|
256
|
+
* @param url server URL to address the request
|
|
257
|
+
* @internal
|
|
258
|
+
*/
|
|
259
|
+
async function getJson(url) {
|
|
260
|
+
const options = {
|
|
261
|
+
method: "GET",
|
|
262
|
+
responseType: "json",
|
|
263
|
+
};
|
|
264
|
+
const data = await request(url, options);
|
|
265
|
+
return data.body;
|
|
266
|
+
}
|
|
267
|
+
exports.getJson = getJson;
|
|
268
|
+
//# sourceMappingURL=Request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Request.js","sourceRoot":"","sources":["../../../src/backend/Request.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,0CAA0C;AAG1C,2BAAkD;AAClD,wCAAwC;AACxC,sDAAsG;AAEtG,MAAM,cAAc,GAAW,6BAA6B,CAAC;AAE7D,gBAAgB;AACH,QAAA,mBAAmB,GAAG,kBAAkB,CAAC;AA0GtD;;GAEG;AACH,MAAa,aAAc,SAAQ,2BAAY;IAI7C,YAAmB,WAAgC,EAAE,OAAgB,EAAE,WAAiC;QACtG,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;IAC3C,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,KAAK,CAAC,QAAa,EAAE,GAAG,GAAG,IAAI;QAC3C,MAAM,KAAK,GAAG,IAAI,aAAa,CAAC,aAAa,CAAC,eAAe,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;QACpF,IAAI,CAAC,QAAQ,EAAE;YACb,KAAK,CAAC,OAAO,GAAG,+BAA+B,CAAC;YAChD,OAAO,KAAK,CAAC;SACd;QAED,IAAI,QAAQ,CAAC,QAAQ,EAAE;YACrB,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE;gBAC3B,KAAK,CAAC,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC;gBACxD,KAAK,CAAC,WAAW,GAAG,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC;aACrD;YACD,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE;gBACzB,KAAK,CAAC,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC;aACrD;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;AAPD,0BAOC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module iTwinServiceClients\r\n */\r\nimport * as deepAssign from \"deep-assign\";\r\nimport * as _ from \"lodash\";\r\nimport * as https from \"https\";\r\nimport { IStringifyOptions, stringify } from \"qs\";\r\nimport * as sarequest from \"superagent\";\r\nimport { BentleyError, GetMetaDataFunction, HttpStatus, Logger, LogLevel } from \"@itwin/core-bentley\";\r\n\r\nconst loggerCategory: string = \"core-mobile-backend.Request\";\r\n\r\n/** @internal */\r\nexport const requestIdHeaderName = \"X-Correlation-Id\";\r\n\r\n/** Typical option to query REST API. Note that services may not quite support these fields,\r\n * and the interface is only provided as a hint.\r\n * @internal\r\n */\r\nexport interface RequestQueryOptions {\r\n /**\r\n * Select string used by the query (use the mapped EC property names, and not TypeScript property names)\r\n * Example: \"Name,Size,Description\"\r\n */\r\n $select?: string;\r\n\r\n /**\r\n * Filter string used by the query (use the mapped EC property names, and not TypeScript property names)\r\n * Example: \"Name like '*.pdf' and Size lt 1000\"\r\n */\r\n $filter?: string;\r\n\r\n /** Sets the limit on the number of entries to be returned by the query */\r\n $top?: number;\r\n\r\n /** Sets the number of entries to be skipped */\r\n $skip?: number;\r\n\r\n /**\r\n * Orders the return values (use the mapped EC property names, and not TypeScript property names)\r\n * Example: \"Size desc\"\r\n */\r\n $orderby?: string;\r\n\r\n /**\r\n * Sets the limit on the number of entries to be returned by a single response.\r\n * Can be used with a Top option. For example if Top is set to 1000 and PageSize\r\n * is set to 100 then 10 requests will be performed to get result.\r\n */\r\n $pageSize?: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface RequestQueryStringifyOptions {\r\n delimiter?: string;\r\n encode?: boolean;\r\n}\r\n\r\n/** Option to control the time outs\r\n * Use a short response timeout to detect unresponsive networks quickly, and a long deadline to give time for downloads on slow,\r\n * but reliable, networks. Note that both of these timers limit how long uploads of attached files are allowed to take. Use long\r\n * timeouts if you're uploading files.\r\n * @internal\r\n */\r\nexport interface RequestTimeoutOptions {\r\n /** Sets a deadline (in milliseconds) for the entire request (including all uploads, redirects, server processing time) to complete.\r\n * If the response isn't fully downloaded within that time, the request will be aborted\r\n */\r\n deadline?: number;\r\n\r\n /** 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\r\n * download can take. Response timeout should be at least few seconds longer than just the time it takes the server to respond, because\r\n * it also includes time to make DNS lookup, TCP/IP and TLS connections, and time to upload request data.\r\n */\r\n response?: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface RequestOptions {\r\n method: string;\r\n headers?: any; // {Mas-App-Guid, Mas-UUid, User-Agent}\r\n body?: any;\r\n qs?: any | RequestQueryOptions;\r\n responseType?: string;\r\n timeout?: RequestTimeoutOptions; // Optional timeouts. If unspecified, an arbitrary default is setup.\r\n stream?: any; // Optional stream to read the response to/from (only for NodeJs applications)\r\n readStream?: any; // Optional stream to read input from (only for NodeJs applications)\r\n buffer?: any;\r\n parser?: any;\r\n accept?: string;\r\n redirects?: number;\r\n errorCallback?: (response: any) => ResponseError;\r\n retryCallback?: (error: any, response: any) => boolean;\r\n progressCallback?: ProgressCallback;\r\n agent?: https.Agent;\r\n retries?: number;\r\n useCorsProxy?: boolean;\r\n}\r\n\r\n/** Response object if the request was successful. Note that the status within the range of 200-299 are considered as a success.\r\n * @internal\r\n */\r\nexport interface Response {\r\n body: any; // Parsed body of response\r\n text: string | undefined; // Returned for responseType:text\r\n header: any; // Parsed headers of response\r\n status: number; // Status code of response\r\n}\r\n\r\n/** @internal */\r\nexport interface ProgressInfo {\r\n percent?: number;\r\n total?: number;\r\n loaded: number;\r\n}\r\n\r\n/** @internal */\r\nexport type ProgressCallback = (progress: ProgressInfo) => void;\r\n\r\n/** 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)\r\n * @internal\r\n */\r\nexport class ResponseError extends BentleyError {\r\n protected _data?: any;\r\n public status?: number;\r\n public description?: string;\r\n public constructor(errorNumber: number | HttpStatus, message?: string, getMetaData?: GetMetaDataFunction) {\r\n super(errorNumber, message, getMetaData);\r\n }\r\n\r\n /**\r\n * Parses error from server's response\r\n * @param response Http response from the server.\r\n * @returns Parsed error.\r\n * @internal\r\n */\r\n public static parse(response: any, log = true): ResponseError {\r\n const error = new ResponseError(ResponseError.parseHttpStatus(response.statusType));\r\n if (!response) {\r\n error.message = \"Couldn't get response object.\";\r\n return error;\r\n }\r\n\r\n if (response.response) {\r\n if (response.response.error) {\r\n error.name = response.response.error.name || error.name;\r\n error.description = response.response.error.message;\r\n }\r\n if (response.response.res) {\r\n error.message = response.response.res.statusMessage;\r\n }\r\n if (response.response.body && Object.keys(response.response.body).length > 0) {\r\n error._data = {};\r\n deepAssign(error._data, response.response.body);\r\n } else {\r\n error._data = response.response.text;\r\n }\r\n }\r\n\r\n error.status = response.status || response.statusCode;\r\n error.name = response.code || response.name || error.name;\r\n error.message = error.message || response.message || response.statusMessage;\r\n\r\n if (log)\r\n error.log();\r\n\r\n return error;\r\n }\r\n\r\n /**\r\n * Decides whether request should be retried or not\r\n * @param error Error returned by request\r\n * @param response Response returned by request\r\n * @internal\r\n */\r\n public static shouldRetry(error: any, response: any): boolean {\r\n if (error !== undefined && error !== null) {\r\n if ((error.status === undefined || error.status === null) && (error.res === undefined || error.res === null)) {\r\n return true;\r\n }\r\n }\r\n return (response !== undefined && response.statusType === HttpStatus.ServerError);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static parseHttpStatus(statusType: number): HttpStatus {\r\n switch (statusType) {\r\n case 1:\r\n return HttpStatus.Info;\r\n case 2:\r\n return HttpStatus.Success;\r\n case 3:\r\n return HttpStatus.Redirection;\r\n case 4:\r\n return HttpStatus.ClientError;\r\n case 5:\r\n return HttpStatus.ServerError;\r\n default:\r\n return HttpStatus.Success;\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public logMessage(): string {\r\n return `${this.status} ${this.name}: ${this.message}`;\r\n }\r\n\r\n /**\r\n * Logs this error\r\n * @internal\r\n */\r\n public log(): void {\r\n Logger.logError(loggerCategory, this.logMessage(), () => this.getMetaData());\r\n }\r\n}\r\n\r\nconst logResponse = (req: sarequest.SuperAgentRequest, startTime: number) => (res: sarequest.Response) => {\r\n const elapsed = new Date().getTime() - startTime;\r\n const elapsedTime = `${elapsed}ms`;\r\n Logger.logTrace(loggerCategory, `${req.method.toUpperCase()} ${res.status} ${req.url} (${elapsedTime})`);\r\n};\r\n\r\n// eslint-disable-next-line @typescript-eslint/promise-function-async\r\nconst logRequest = (req: sarequest.SuperAgentRequest): sarequest.SuperAgentRequest => {\r\n const startTime = new Date().getTime();\r\n return req.on(\"response\", logResponse(req, startTime));\r\n};\r\n\r\n/** Wrapper around making HTTP requests with the specific options.\r\n *\r\n * Usable in both a browser and node based environment.\r\n *\r\n * @param url Server URL to address the request\r\n * @param options Options to pass to the request\r\n * @returns Resolves to the response from the server\r\n * @throws ResponseError if the request fails due to network issues, or if the returned status is *outside* the range of 200-299 (inclusive)\r\n * @internal\r\n */\r\nexport async function request(url: string, options: RequestOptions): Promise<Response> {\r\n let sareq: sarequest.SuperAgentRequest = sarequest(options.method, url);\r\n if (options.retries)\r\n sareq = sareq.retry(options.retries, options.retryCallback);\r\n\r\n if (Logger.isEnabled(loggerCategory, LogLevel.Trace))\r\n sareq = sareq.use(logRequest);\r\n\r\n if (options.headers)\r\n sareq = sareq.set(options.headers);\r\n\r\n let queryStr: string = \"\";\r\n let fullUrl: string = \"\";\r\n if (options.qs && Object.keys(options.qs).length > 0) {\r\n const stringifyOptions: IStringifyOptions = { delimiter: \"&\", encode: false };\r\n queryStr = stringify(options.qs, stringifyOptions);\r\n sareq = sareq.query(queryStr);\r\n fullUrl = `${url}?${queryStr}`;\r\n } else {\r\n fullUrl = url;\r\n }\r\n\r\n Logger.logInfo(loggerCategory, fullUrl);\r\n\r\n if (options.accept)\r\n sareq = sareq.accept(options.accept);\r\n\r\n if (options.body)\r\n sareq = sareq.send(options.body);\r\n\r\n if (options.timeout)\r\n sareq = sareq.timeout(options.timeout);\r\n\r\n if (options.responseType)\r\n sareq = sareq.responseType(options.responseType);\r\n\r\n if (options.redirects)\r\n sareq = sareq.redirects(options.redirects);\r\n else\r\n sareq = sareq.redirects(0);\r\n\r\n if (options.buffer)\r\n sareq = sareq.buffer(options.buffer);\r\n\r\n if (options.parser)\r\n sareq = sareq.parse(options.parser);\r\n\r\n /** Default to any globally supplied proxy, unless an agent is specified in this call */\r\n if (options.agent)\r\n sareq = sareq.agent(options.agent);\r\n\r\n if (options.progressCallback) {\r\n sareq = sareq.on(\"progress\", (event: sarequest.ProgressEvent) => {\r\n if (event) {\r\n options.progressCallback!({\r\n loaded: event.loaded,\r\n total: event.total,\r\n percent: event.percent,\r\n });\r\n }\r\n });\r\n }\r\n\r\n const errorCallback = options.errorCallback ? options.errorCallback : ResponseError.parse;\r\n\r\n if (options.readStream) {\r\n if (typeof window !== \"undefined\")\r\n throw new Error(\"This option is not supported on browsers\");\r\n\r\n return new Promise<Response>((resolve, reject) => {\r\n sareq = sareq.type(\"blob\");\r\n options\r\n .readStream\r\n .pipe(sareq)\r\n .on(\"error\", (error: any) => {\r\n const parsedError = errorCallback(error);\r\n reject(parsedError);\r\n })\r\n .on(\"end\", () => {\r\n const retResponse: Response = {\r\n status: 201,\r\n header: undefined,\r\n body: undefined,\r\n text: undefined,\r\n };\r\n resolve(retResponse);\r\n });\r\n });\r\n }\r\n\r\n if (options.stream) {\r\n if (typeof window !== \"undefined\")\r\n throw new Error(\"This option is not supported on browsers\");\r\n\r\n return new Promise<Response>((resolve, reject) => {\r\n sareq\r\n .on(\"response\", (res: any) => {\r\n if (res.statusCode !== 200) {\r\n const parsedError = errorCallback(res);\r\n reject(parsedError);\r\n return;\r\n }\r\n })\r\n .pipe(options.stream)\r\n .on(\"error\", (error: any) => {\r\n const parsedError = errorCallback(error);\r\n reject(parsedError);\r\n })\r\n .on(\"finish\", () => {\r\n const retResponse: Response = {\r\n status: 200,\r\n header: undefined,\r\n body: undefined,\r\n text: undefined,\r\n };\r\n resolve(retResponse);\r\n });\r\n });\r\n }\r\n\r\n // console.log(\"%s %s %s\", url, options.method, queryStr);\r\n\r\n /**\r\n * Note:\r\n * Javascript's fetch returns status.OK if error is between 200-299 inclusive, and doesn't reject in this case.\r\n * Fetch only rejects if there's some network issue (permissions issue or similar)\r\n * Superagent rejects network issues, and errors outside the range of 200-299. We are currently using\r\n * superagent, but may eventually switch to JavaScript's fetch library.\r\n */\r\n try {\r\n const response = await sareq;\r\n const retResponse: Response = {\r\n body: response.body,\r\n text: response.text,\r\n header: response.header,\r\n status: response.status,\r\n };\r\n return retResponse;\r\n } catch (error) {\r\n const parsedError = errorCallback(error);\r\n throw parsedError;\r\n }\r\n}\r\n\r\n/**\r\n * fetch json from HTTP request\r\n * @param url server URL to address the request\r\n * @internal\r\n */\r\nexport async function getJson(url: string): Promise<any> {\r\n const options: RequestOptions = {\r\n method: \"GET\",\r\n responseType: \"json\",\r\n };\r\n const data = await request(url, options);\r\n return data.body;\r\n}\r\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MobileAppChannel.d.ts","sourceRoot":"","sources":["../../../src/common/MobileAppChannel.ts"],"names":[],"mappings":"AAKA,gBAAgB;AAChB,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAC5C,gBAAgB;AAChB,eAAO,MAAM,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.mobileAppNotify = exports.mobileAppChannel = void 0;
|
|
8
|
+
/** @internal */
|
|
9
|
+
exports.mobileAppChannel = "mobileApp";
|
|
10
|
+
/** @internal */
|
|
11
|
+
exports.mobileAppNotify = "mobileApp-notify";
|
|
12
|
+
//# sourceMappingURL=MobileAppChannel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MobileAppChannel.js","sourceRoot":"","sources":["../../../src/common/MobileAppChannel.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,gBAAgB;AACH,QAAA,gBAAgB,GAAG,WAAW,CAAC;AAC5C,gBAAgB;AACH,QAAA,eAAe,GAAG,kBAAkB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @internal */\r\nexport const mobileAppChannel = \"mobileApp\";\r\n/** @internal */\r\nexport const mobileAppNotify = \"mobileApp-notify\";\r\n"]}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
/** @
|
|
2
|
-
export declare const mobileAppChannel = "mobileApp";
|
|
3
|
-
/** @internal */
|
|
4
|
-
export declare const mobileAppNotify = "mobileApp-notify";
|
|
1
|
+
/** @beta */
|
|
5
2
|
export declare enum Orientation {
|
|
6
3
|
Unknown = 0,
|
|
7
4
|
Portrait = 1,
|
|
@@ -11,12 +8,14 @@ export declare enum Orientation {
|
|
|
11
8
|
FaceUp = 16,
|
|
12
9
|
FaceDown = 32
|
|
13
10
|
}
|
|
11
|
+
/** @beta */
|
|
14
12
|
export declare enum BatteryState {
|
|
15
13
|
Unknown = 0,
|
|
16
14
|
Unplugged = 1,
|
|
17
15
|
Charging = 2,
|
|
18
16
|
Full = 3
|
|
19
17
|
}
|
|
18
|
+
/** @beta */
|
|
20
19
|
export interface MobileNotifications {
|
|
21
20
|
notifyMemoryWarning: () => void;
|
|
22
21
|
notifyOrientationChanged: () => void;
|
|
@@ -24,10 +23,11 @@ export interface MobileNotifications {
|
|
|
24
23
|
notifyEnterBackground: () => void;
|
|
25
24
|
notifyWillTerminate: () => void;
|
|
26
25
|
}
|
|
26
|
+
/** @beta */
|
|
27
27
|
export declare type DeviceEvents = "memoryWarning" | "orientationChanged" | "enterForeground" | "enterBackground" | "willTerminate";
|
|
28
28
|
/**
|
|
29
29
|
* The methods that may be invoked via Ipc from the frontend of a Mobile App that are implemented on its backend.
|
|
30
|
-
* @
|
|
30
|
+
* @beta
|
|
31
31
|
*/
|
|
32
32
|
export interface MobileAppFunctions {
|
|
33
33
|
reconnect: (connection: number) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileAppProps.d.ts","sourceRoot":"","sources":["../../../src/common/MobileAppProps.ts"],"names":[],"mappings":"AAKA,
|
|
1
|
+
{"version":3,"file":"MobileAppProps.d.ts","sourceRoot":"","sources":["../../../src/common/MobileAppProps.ts"],"names":[],"mappings":"AAKA,YAAY;AACZ,oBAAY,WAAW;IACrB,OAAO,IAAI;IACX,QAAQ,IAAM;IACd,kBAAkB,IAAM;IACxB,aAAa,IAAM;IACnB,cAAc,IAAM;IACpB,MAAM,KAAO;IACb,QAAQ,KAAO;CAChB;AAED,YAAY;AACZ,oBAAY,YAAY;IACtB,OAAO,IAAI;IACX,SAAS,IAAI;IACb,QAAQ,IAAI;IACZ,IAAI,IAAI;CACT;AAED,YAAY;AACZ,MAAM,WAAW,mBAAmB;IAClC,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,wBAAwB,EAAE,MAAM,IAAI,CAAC;IACrC,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAClC,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAClC,mBAAmB,EAAE,MAAM,IAAI,CAAC;CACjC;AAED,YAAY;AACZ,oBAAY,YAAY,GAAG,eAAe,GAAG,oBAAoB,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,eAAe,CAAC;AAE5H;;;EAGE;AACF,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAClD"}
|
|
@@ -4,11 +4,8 @@
|
|
|
4
4
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.BatteryState = exports.Orientation =
|
|
8
|
-
/** @
|
|
9
|
-
exports.mobileAppChannel = "mobileApp";
|
|
10
|
-
/** @internal */
|
|
11
|
-
exports.mobileAppNotify = "mobileApp-notify";
|
|
7
|
+
exports.BatteryState = exports.Orientation = void 0;
|
|
8
|
+
/** @beta */
|
|
12
9
|
var Orientation;
|
|
13
10
|
(function (Orientation) {
|
|
14
11
|
Orientation[Orientation["Unknown"] = 0] = "Unknown";
|
|
@@ -19,6 +16,7 @@ var Orientation;
|
|
|
19
16
|
Orientation[Orientation["FaceUp"] = 16] = "FaceUp";
|
|
20
17
|
Orientation[Orientation["FaceDown"] = 32] = "FaceDown";
|
|
21
18
|
})(Orientation = exports.Orientation || (exports.Orientation = {}));
|
|
19
|
+
/** @beta */
|
|
22
20
|
var BatteryState;
|
|
23
21
|
(function (BatteryState) {
|
|
24
22
|
BatteryState[BatteryState["Unknown"] = 0] = "Unknown";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileAppProps.js","sourceRoot":"","sources":["../../../src/common/MobileAppProps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,
|
|
1
|
+
{"version":3,"file":"MobileAppProps.js","sourceRoot":"","sources":["../../../src/common/MobileAppProps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,YAAY;AACZ,IAAY,WAQX;AARD,WAAY,WAAW;IACrB,mDAAW,CAAA;IACX,qDAAc,CAAA;IACd,yEAAwB,CAAA;IACxB,+DAAmB,CAAA;IACnB,iEAAoB,CAAA;IACpB,kDAAa,CAAA;IACb,sDAAe,CAAA;AACjB,CAAC,EARW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAQtB;AAED,YAAY;AACZ,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,qDAAW,CAAA;IACX,yDAAa,CAAA;IACb,uDAAY,CAAA;IACZ,+CAAQ,CAAA;AACV,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @beta */\r\nexport enum Orientation {\r\n Unknown = 0,\r\n Portrait = 0x1,\r\n PortraitUpsideDown = 0x2,\r\n LandscapeLeft = 0x4,\r\n LandscapeRight = 0x8,\r\n FaceUp = 0x10,\r\n FaceDown = 0x20,\r\n}\r\n\r\n/** @beta */\r\nexport enum BatteryState {\r\n Unknown = 0,\r\n Unplugged = 1,\r\n Charging = 2,\r\n Full = 3,\r\n}\r\n\r\n/** @beta */\r\nexport interface MobileNotifications {\r\n notifyMemoryWarning: () => void;\r\n notifyOrientationChanged: () => void;\r\n notifyEnterForeground: () => void;\r\n notifyEnterBackground: () => void;\r\n notifyWillTerminate: () => void;\r\n}\r\n\r\n/** @beta */\r\nexport type DeviceEvents = \"memoryWarning\" | \"orientationChanged\" | \"enterForeground\" | \"enterBackground\" | \"willTerminate\";\r\n\r\n/**\r\n* The methods that may be invoked via Ipc from the frontend of a Mobile App that are implemented on its backend.\r\n* @beta\r\n*/\r\nexport interface MobileAppFunctions {\r\n reconnect: (connection: number) => Promise<void>;\r\n}\r\n"]}
|
|
@@ -12,7 +12,7 @@ export declare class MobileApp {
|
|
|
12
12
|
private static _isValid;
|
|
13
13
|
static get isValid(): boolean;
|
|
14
14
|
/**
|
|
15
|
-
* This is called by either
|
|
15
|
+
* This is called by either AndroidApp.startup or IOSApp.startup - it should not be called directly
|
|
16
16
|
* @internal
|
|
17
17
|
*/
|
|
18
18
|
static startup(opts?: NativeAppOpts): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileApp.d.ts","sourceRoot":"","sources":["../../../src/frontend/MobileApp.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,OAAO,EAAU,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAEzF,OAAO,EAAqB,aAAa,EAAuB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"MobileApp.d.ts","sourceRoot":"","sources":["../../../src/frontend/MobileApp.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,OAAO,EAAU,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAEzF,OAAO,EAAqB,aAAa,EAAuB,MAAM,sBAAsB,CAAC;AAE7F,OAAO,EAAE,kBAAkB,EAAuB,MAAM,0BAA0B,CAAC;AAoBnF,YAAY;AACZ,qBAAa,SAAS;IACpB,OAAc,eAAe,gBAAqB,IAAI,EAAI;IAC1D,OAAc,oBAAoB,gBAAqB,IAAI,EAAI;IAC/D,OAAc,iBAAiB,gBAAqB,IAAI,EAAI;IAC5D,OAAc,iBAAiB,gBAAqB,IAAI,EAAI;IAC5D,OAAc,eAAe,gBAAqB,IAAI,EAAI;WACtC,WAAW,CAAC,CAAC,SAAS,cAAc,CAAC,kBAAkB,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAIvI,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAS;IAChC,WAAkB,OAAO,YAA4B;IACrD;;;OAGG;WACiB,OAAO,CAAC,IAAI,CAAC,EAAE,aAAa;CAWjD"}
|
|
@@ -8,11 +8,11 @@ exports.MobileApp = void 0;
|
|
|
8
8
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
9
9
|
const core_common_1 = require("@itwin/core-common");
|
|
10
10
|
const core_frontend_1 = require("@itwin/core-frontend");
|
|
11
|
-
const
|
|
11
|
+
const MobileAppChannel_1 = require("../common/MobileAppChannel");
|
|
12
12
|
const MobileRpcManager_1 = require("../common/MobileRpcManager");
|
|
13
13
|
/** receive notifications from backend */
|
|
14
14
|
class MobileAppNotifyHandler extends core_frontend_1.NotificationHandler {
|
|
15
|
-
get channelName() { return
|
|
15
|
+
get channelName() { return MobileAppChannel_1.mobileAppNotify; }
|
|
16
16
|
notifyMemoryWarning() {
|
|
17
17
|
core_bentley_1.Logger.logWarning("mobileApp", "Low memory warning");
|
|
18
18
|
if (MobileApp.onMemoryWarning.numberOfListeners === 0) {
|
|
@@ -28,11 +28,11 @@ class MobileAppNotifyHandler extends core_frontend_1.NotificationHandler {
|
|
|
28
28
|
/** @beta */
|
|
29
29
|
class MobileApp {
|
|
30
30
|
static async callBackend(methodName, ...args) {
|
|
31
|
-
return core_frontend_1.IpcApp.callIpcChannel(
|
|
31
|
+
return core_frontend_1.IpcApp.callIpcChannel(MobileAppChannel_1.mobileAppChannel, methodName, ...args);
|
|
32
32
|
}
|
|
33
33
|
static get isValid() { return this._isValid; }
|
|
34
34
|
/**
|
|
35
|
-
* This is called by either
|
|
35
|
+
* This is called by either AndroidApp.startup or IOSApp.startup - it should not be called directly
|
|
36
36
|
* @internal
|
|
37
37
|
*/
|
|
38
38
|
static async startup(opts) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileApp.js","sourceRoot":"","sources":["../../../src/frontend/MobileApp.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,sDAAyF;AACzF,oDAA0G;AAC1G,wDAA6F;AAC7F,
|
|
1
|
+
{"version":3,"file":"MobileApp.js","sourceRoot":"","sources":["../../../src/frontend/MobileApp.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,sDAAyF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CAAsB,CAAC,CAAC;YACzG,mCAAgB,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;YACjD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;SACtB;QACD,MAAM,MAAM,GAAG,IAAI,kCAAoB,EAAE,CAAC,CAAC,aAAa;QACxD,MAAM,yBAAS,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAEtC,sBAAsB,CAAC,QAAQ,EAAE,CAAC,CAAC,sCAAsC;IAC3E,CAAC;;AA1BH,8BA2BC;AA1Be,yBAAe,GAAG,IAAI,sBAAO,EAAc,CAAC;AAC5C,8BAAoB,GAAG,IAAI,sBAAO,EAAc,CAAC;AACjD,2BAAiB,GAAG,IAAI,sBAAO,EAAc,CAAC;AAC9C,2BAAiB,GAAG,IAAI,sBAAO,EAAc,CAAC;AAC9C,yBAAe,GAAG,IAAI,sBAAO,EAAc,CAAC;AAK3C,kBAAQ,GAAG,KAAK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { AsyncMethodsOf, BeEvent, Logger, PromiseReturnType } from \"@itwin/core-bentley\";\r\nimport { IModelReadRpcInterface, IModelTileRpcInterface, IpcWebSocketFrontend } from \"@itwin/core-common\";\r\nimport { IpcApp, NativeApp, NativeAppOpts, NotificationHandler } from \"@itwin/core-frontend\";\r\nimport { mobileAppChannel, mobileAppNotify } from \"../common/MobileAppChannel\";\r\nimport { MobileAppFunctions, MobileNotifications } from \"../common/MobileAppProps\";\r\nimport { MobileRpcManager } from \"../common/MobileRpcManager\";\r\n\r\n/** receive notifications from backend */\r\nclass MobileAppNotifyHandler extends NotificationHandler implements MobileNotifications {\r\n public get channelName() { return mobileAppNotify; }\r\n\r\n public notifyMemoryWarning() {\r\n Logger.logWarning(\"mobileApp\", \"Low memory warning\");\r\n if (MobileApp.onMemoryWarning.numberOfListeners === 0) {\r\n alert(\"Low memory warning\");\r\n }\r\n MobileApp.onMemoryWarning.raiseEvent();\r\n }\r\n public notifyOrientationChanged() { MobileApp.onOrientationChanged.raiseEvent(); }\r\n public notifyEnterForeground() { MobileApp.onEnterBackground.raiseEvent(); }\r\n public notifyEnterBackground() { MobileApp.onEnterBackground.raiseEvent(); }\r\n public notifyWillTerminate() { MobileApp.onWillTerminate.raiseEvent(); }\r\n}\r\n\r\n/** @beta */\r\nexport class MobileApp {\r\n public static onMemoryWarning = new BeEvent<() => void>();\r\n public static onOrientationChanged = new BeEvent<() => void>();\r\n public static onEnterForeground = new BeEvent<() => void>();\r\n public static onEnterBackground = new BeEvent<() => void>();\r\n public static onWillTerminate = new BeEvent<() => void>();\r\n public static async callBackend<T extends AsyncMethodsOf<MobileAppFunctions>>(methodName: T, ...args: Parameters<MobileAppFunctions[T]>) {\r\n return IpcApp.callIpcChannel(mobileAppChannel, methodName, ...args) as PromiseReturnType<MobileAppFunctions[T]>;\r\n }\r\n\r\n private static _isValid = false;\r\n public static get isValid() { return this._isValid; }\r\n /**\r\n * This is called by either AndroidApp.startup or IOSApp.startup - it should not be called directly\r\n * @internal\r\n */\r\n public static async startup(opts?: NativeAppOpts) {\r\n if (!this._isValid) {\r\n const rpcInterfaces = opts?.iModelApp?.rpcInterfaces ?? [IModelReadRpcInterface, IModelTileRpcInterface];\r\n MobileRpcManager.initializeClient(rpcInterfaces);\r\n this._isValid = true;\r\n }\r\n const socket = new IpcWebSocketFrontend(); // needs work\r\n await NativeApp.startup(socket, opts);\r\n\r\n MobileAppNotifyHandler.register(); // receives notifications from backend\r\n }\r\n}\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/core-mobile",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0-dev.5",
|
|
4
4
|
"description": "iTwin.js MobileHost and MobileApp",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "https://github.com/
|
|
11
|
+
"url": "https://github.com/iTwin/itwinjs-core/tree/master/core/core-mobile"
|
|
12
12
|
},
|
|
13
13
|
"keywords": [
|
|
14
14
|
"Bentley",
|
|
@@ -21,32 +21,39 @@
|
|
|
21
21
|
"url": "http://www.bentley.com"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@itwin/core-
|
|
25
|
-
"@itwin/core-
|
|
26
|
-
"@itwin/core-common": "^3.
|
|
27
|
-
"@itwin/core-frontend": "^3.
|
|
28
|
-
"@
|
|
29
|
-
|
|
24
|
+
"@itwin/core-backend": "^3.1.0-dev.5",
|
|
25
|
+
"@itwin/core-bentley": "^3.1.0-dev.5",
|
|
26
|
+
"@itwin/core-common": "^3.1.0-dev.5",
|
|
27
|
+
"@itwin/core-frontend": "^3.1.0-dev.5",
|
|
28
|
+
"@itwin/presentation-common": "^3.1.0-dev.5"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"deep-assign": "^2.0.0",
|
|
32
|
+
"lodash": "^4.17.10",
|
|
30
33
|
"js-base64": "^3.6.1",
|
|
34
|
+
"qs": "^6.5.1",
|
|
35
|
+
"superagent": "^7.0.1",
|
|
31
36
|
"ws": "^7.5.3"
|
|
32
37
|
},
|
|
33
38
|
"devDependencies": {
|
|
34
|
-
"@itwin/
|
|
35
|
-
"@itwin/
|
|
36
|
-
"@itwin/
|
|
37
|
-
"@
|
|
38
|
-
"@itwin/core-
|
|
39
|
-
"@itwin/
|
|
40
|
-
"@itwin/
|
|
41
|
-
"@itwin/presentation-common": "3.0.0-extension.0",
|
|
39
|
+
"@itwin/build-tools": "3.1.0-dev.5",
|
|
40
|
+
"@itwin/core-backend": "3.1.0-dev.5",
|
|
41
|
+
"@itwin/core-bentley": "3.1.0-dev.5",
|
|
42
|
+
"@itwin/core-common": "3.1.0-dev.5",
|
|
43
|
+
"@itwin/core-frontend": "3.1.0-dev.5",
|
|
44
|
+
"@itwin/eslint-plugin": "3.1.0-dev.5",
|
|
45
|
+
"@itwin/presentation-common": "3.1.0-dev.5",
|
|
42
46
|
"@types/chai": "^4.1.4",
|
|
47
|
+
"@types/deep-assign": "^0.1.0",
|
|
43
48
|
"@types/fs-extra": "^4.0.7",
|
|
49
|
+
"@types/lodash": "^4.14.0",
|
|
44
50
|
"@types/mocha": "^8.2.2",
|
|
45
51
|
"@types/node": "14.14.31",
|
|
52
|
+
"@types/qs": "^6.5.0",
|
|
53
|
+
"@types/superagent": "^4.1.14",
|
|
46
54
|
"@types/ws": "^6.0.4",
|
|
47
55
|
"chai": "^4.1.2",
|
|
48
56
|
"chai-as-promised": "^7",
|
|
49
|
-
"cpx": "^1.5.0",
|
|
50
57
|
"dotenv": "^10.0.0",
|
|
51
58
|
"dotenv-expand": "^5.1.0",
|
|
52
59
|
"eslint": "^7.11.0",
|
|
@@ -72,5 +79,6 @@
|
|
|
72
79
|
"lint": "eslint -f visualstudio \"./src/**/*.ts\" 1>&2",
|
|
73
80
|
"test": "",
|
|
74
81
|
"cover": ""
|
|
75
|
-
}
|
|
82
|
+
},
|
|
83
|
+
"readme": "# @itwin/core-mobile\r\n\r\nCopyright © Bentley Systems, Incorporated. All rights reserved. See LICENSE.md for license terms and full copyright notice. See LICENSE.md in the project root for license terms and full copyright notice.\r\n\r\n## Description\r\n\r\nThe __@itwin/core-electron__ package contains the electron utilities to write an iTwin.js application based on Electron.\r\n\r\n## Documentation\r\n\r\nSee the [iTwin.js](https://www.itwinjs.org) documentation for more information.\r\n"
|
|
76
84
|
}
|