@itwin/core-mobile 4.0.0-dev.8 → 4.0.0-dev.81
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 +48 -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.js +46 -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 +149 -156
- package/lib/cjs/backend/MobileHost.js.map +1 -1
- package/lib/cjs/backend/MobileRpcServer.d.ts +19 -19
- package/lib/cjs/backend/MobileRpcServer.js +156 -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/MobileAppChannel.js.map +1 -1
- 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/MobileAppProps.js.map +1 -1
- 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/MobileIpc.js.map +1 -1
- 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/common/MobileRpcRequest.js.map +1 -1
- 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/lib/cjs/test/ios/MobilePlatform.test.js.map +1 -1
- package/package.json +18 -26
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,53 @@
|
|
|
1
1
|
# Change Log - @itwin/core-mobile
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 12 Apr 2023 13:12:42 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 3.7.2
|
|
6
|
+
Wed, 12 Apr 2023 13:12:42 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 3.7.1
|
|
11
|
+
Mon, 03 Apr 2023 15:15:37 GMT
|
|
12
|
+
|
|
13
|
+
_Version update only_
|
|
14
|
+
|
|
15
|
+
## 3.7.0
|
|
16
|
+
Wed, 29 Mar 2023 15:02:27 GMT
|
|
17
|
+
|
|
18
|
+
### Updates
|
|
19
|
+
|
|
20
|
+
- Fix mobile getAccessToken error handling
|
|
21
|
+
- React to IModelApp.rpcInterfaces and BentleyCloudRpcManager changes.
|
|
22
|
+
|
|
23
|
+
## 3.6.3
|
|
24
|
+
Mon, 27 Mar 2023 16:26:47 GMT
|
|
25
|
+
|
|
26
|
+
_Version update only_
|
|
27
|
+
|
|
28
|
+
## 3.6.2
|
|
29
|
+
Fri, 17 Mar 2023 17:52:32 GMT
|
|
30
|
+
|
|
31
|
+
_Version update only_
|
|
32
|
+
|
|
33
|
+
## 3.6.1
|
|
34
|
+
Fri, 24 Feb 2023 22:00:48 GMT
|
|
35
|
+
|
|
36
|
+
_Version update only_
|
|
37
|
+
|
|
38
|
+
## 3.6.0
|
|
39
|
+
Wed, 08 Feb 2023 14:58:40 GMT
|
|
40
|
+
|
|
41
|
+
### Updates
|
|
42
|
+
|
|
43
|
+
- Fixed bug which prevented mobile lifecycle events from being received on frontend.
|
|
44
|
+
- Fix for mobile app lifcycle crash
|
|
45
|
+
- React to RPC deprecations.
|
|
46
|
+
|
|
47
|
+
## 3.5.6
|
|
48
|
+
Fri, 24 Feb 2023 16:02:47 GMT
|
|
49
|
+
|
|
50
|
+
_Version update only_
|
|
4
51
|
|
|
5
52
|
## 3.5.5
|
|
6
53
|
Thu, 26 Jan 2023 22:53:27 GMT
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Copyright © Bentley Systems, Incorporated. All rights reserved. See LICENSE.md
|
|
|
4
4
|
|
|
5
5
|
## Description
|
|
6
6
|
|
|
7
|
-
The __@itwin/core-
|
|
7
|
+
The __@itwin/core-mobile__ package contains the mobile utilities to write an iTwin.js application for mobile devices.
|
|
8
8
|
|
|
9
9
|
## Documentation
|
|
10
10
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from "./backend/MobileAuthorizationBackend";
|
|
2
|
-
export * from "./backend/MobileFileHandler";
|
|
3
|
-
export * from "./backend/MobileHost";
|
|
4
|
-
export * from "./common/MobileAppProps";
|
|
5
|
-
export * from "./common/MobileRpcManager";
|
|
6
|
-
export * from "./common/MobileRpcProtocol";
|
|
7
|
-
export * from "./common/MobileRpcRequest";
|
|
1
|
+
export * from "./backend/MobileAuthorizationBackend";
|
|
2
|
+
export * from "./backend/MobileFileHandler";
|
|
3
|
+
export * from "./backend/MobileHost";
|
|
4
|
+
export * from "./common/MobileAppProps";
|
|
5
|
+
export * from "./common/MobileRpcManager";
|
|
6
|
+
export * from "./common/MobileRpcProtocol";
|
|
7
|
+
export * from "./common/MobileRpcRequest";
|
|
8
8
|
//# sourceMappingURL=MobileBackend.d.ts.map
|
package/lib/cjs/MobileBackend.js
CHANGED
|
@@ -1,25 +1,29 @@
|
|
|
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
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
Object.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
__exportStar(require("./
|
|
23
|
-
__exportStar(require("./
|
|
24
|
-
__exportStar(require("./
|
|
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
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
18
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
// Barrel file for backend of a mobile application
|
|
22
|
+
__exportStar(require("./backend/MobileAuthorizationBackend"), exports);
|
|
23
|
+
__exportStar(require("./backend/MobileFileHandler"), exports);
|
|
24
|
+
__exportStar(require("./backend/MobileHost"), exports);
|
|
25
|
+
__exportStar(require("./common/MobileAppProps"), exports);
|
|
26
|
+
__exportStar(require("./common/MobileRpcManager"), exports);
|
|
27
|
+
__exportStar(require("./common/MobileRpcProtocol"), exports);
|
|
28
|
+
__exportStar(require("./common/MobileRpcRequest"), exports);
|
|
25
29
|
//# sourceMappingURL=MobileBackend.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileBackend.js","sourceRoot":"","sources":["../../src/MobileBackend.ts"],"names":[],"mappings":";AAAA;;;+FAG+F
|
|
1
|
+
{"version":3,"file":"MobileBackend.js","sourceRoot":"","sources":["../../src/MobileBackend.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;AAE/F,kDAAkD;AAElD,uEAAqD;AACrD,8DAA4C;AAC5C,uDAAqC;AACrC,0DAAwC;AACxC,4DAA0C;AAC1C,6DAA2C;AAC3C,4DAA0C","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n// Barrel file for backend of a mobile application\n\nexport * from \"./backend/MobileAuthorizationBackend\";\nexport * from \"./backend/MobileFileHandler\";\nexport * from \"./backend/MobileHost\";\nexport * from \"./common/MobileAppProps\";\nexport * from \"./common/MobileRpcManager\";\nexport * from \"./common/MobileRpcProtocol\";\nexport * from \"./common/MobileRpcRequest\";\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from "./common/MobileAppProps";
|
|
2
|
-
export * from "./common/MobileRpcManager";
|
|
3
|
-
export * from "./common/MobileRpcProtocol";
|
|
4
|
-
export * from "./common/MobileRpcRequest";
|
|
5
|
-
export * from "./frontend/MobileApp";
|
|
1
|
+
export * from "./common/MobileAppProps";
|
|
2
|
+
export * from "./common/MobileRpcManager";
|
|
3
|
+
export * from "./common/MobileRpcProtocol";
|
|
4
|
+
export * from "./common/MobileRpcRequest";
|
|
5
|
+
export * from "./frontend/MobileApp";
|
|
6
6
|
//# sourceMappingURL=MobileFrontend.d.ts.map
|
|
@@ -1,22 +1,26 @@
|
|
|
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
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
Object.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
__exportStar(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
__exportStar(require("./
|
|
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
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
18
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
__exportStar(require("./common/MobileAppProps"), exports);
|
|
22
|
+
__exportStar(require("./common/MobileRpcManager"), exports);
|
|
23
|
+
__exportStar(require("./common/MobileRpcProtocol"), exports);
|
|
24
|
+
__exportStar(require("./common/MobileRpcRequest"), exports);
|
|
25
|
+
__exportStar(require("./frontend/MobileApp"), exports);
|
|
22
26
|
//# sourceMappingURL=MobileFrontend.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileFrontend.js","sourceRoot":"","sources":["../../src/MobileFrontend.ts"],"names":[],"mappings":";AAAA;;;+FAG+F
|
|
1
|
+
{"version":3,"file":"MobileFrontend.js","sourceRoot":"","sources":["../../src/MobileFrontend.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;AAE/F,0DAAwC;AACxC,4DAA0C;AAC1C,6DAA2C;AAC3C,4DAA0C;AAC1C,uDAAqC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nexport * from \"./common/MobileAppProps\";\nexport * from \"./common/MobileRpcManager\";\nexport * from \"./common/MobileRpcProtocol\";\nexport * from \"./common/MobileRpcRequest\";\nexport * from \"./frontend/MobileApp\";\n"]}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
export * from "./MobileBackend";
|
|
2
|
-
export * from "./MobileFrontend";
|
|
3
|
-
/** @docs-package-description
|
|
4
|
-
* The core-mobile package provides the necessary tools to run an ITwin.js application on iOS and Android. It provides a layer of communication between native tooling for mobile apps and ITwin.js core.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* @docs-group-description MobileApp
|
|
8
|
-
* Classes for configuring and administering an iTwin.js application on mobile.
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* @docs-group-description MobileAppProps
|
|
12
|
-
* Configuration options for use with MobileApp.
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* @docs-group-description MobileHost
|
|
16
|
-
* Classes for configuring and administering the backend host on mobile.
|
|
17
|
-
*/
|
|
18
|
-
/**
|
|
19
|
-
* @docs-group-description MobileRpcManager
|
|
20
|
-
* Coordinates usage of RPC interfaces for mobile applications.
|
|
21
|
-
*/
|
|
22
|
-
/**
|
|
23
|
-
* @docs-group-description MobileRpcServer
|
|
24
|
-
* Provides RPC handling for the backend host on mobile.
|
|
25
|
-
*/
|
|
26
|
-
/**
|
|
27
|
-
* @docs-group-description iModelHub
|
|
28
|
-
* Classes for interacting with iModelHub.
|
|
29
|
-
*/
|
|
30
|
-
/**
|
|
31
|
-
* @docs-group-description RpcInterface
|
|
32
|
-
* Used to define a set of operations exposed by a service that a client can call, using configurable protocols.
|
|
33
|
-
*/
|
|
1
|
+
export * from "./MobileBackend";
|
|
2
|
+
export * from "./MobileFrontend";
|
|
3
|
+
/** @docs-package-description
|
|
4
|
+
* The core-mobile package provides the necessary tools to run an ITwin.js application on iOS and Android. It provides a layer of communication between native tooling for mobile apps and ITwin.js core.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @docs-group-description MobileApp
|
|
8
|
+
* Classes for configuring and administering an iTwin.js application on mobile.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* @docs-group-description MobileAppProps
|
|
12
|
+
* Configuration options for use with MobileApp.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* @docs-group-description MobileHost
|
|
16
|
+
* Classes for configuring and administering the backend host on mobile.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* @docs-group-description MobileRpcManager
|
|
20
|
+
* Coordinates usage of RPC interfaces for mobile applications.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* @docs-group-description MobileRpcServer
|
|
24
|
+
* Provides RPC handling for the backend host on mobile.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* @docs-group-description iModelHub
|
|
28
|
+
* Classes for interacting with iModelHub.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* @docs-group-description RpcInterface
|
|
32
|
+
* Used to define a set of operations exposed by a service that a client can call, using configurable protocols.
|
|
33
|
+
*/
|
|
34
34
|
//# sourceMappingURL=__DOC_ONLY__.d.ts.map
|
package/lib/cjs/__DOC_ONLY__.js
CHANGED
|
@@ -1,53 +1,57 @@
|
|
|
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
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
Object.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
|
-
/**
|
|
30
|
-
* @docs-group-description
|
|
31
|
-
*
|
|
32
|
-
*/
|
|
33
|
-
/**
|
|
34
|
-
* @docs-group-description
|
|
35
|
-
*
|
|
36
|
-
*/
|
|
37
|
-
/**
|
|
38
|
-
* @docs-group-description
|
|
39
|
-
*
|
|
40
|
-
*/
|
|
41
|
-
/**
|
|
42
|
-
* @docs-group-description
|
|
43
|
-
*
|
|
44
|
-
*/
|
|
45
|
-
/**
|
|
46
|
-
* @docs-group-description
|
|
47
|
-
*
|
|
48
|
-
*/
|
|
49
|
-
/**
|
|
50
|
-
* @docs-group-description
|
|
51
|
-
*
|
|
52
|
-
*/
|
|
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
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
18
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
// THIS FILE EXISTS ONLY FOR DOCUMENTATION GENERATION.
|
|
22
|
+
// It imports both frontend and backend code, which is not legal anywhere.
|
|
23
|
+
// Do not import it in real code!
|
|
24
|
+
__exportStar(require("./MobileBackend"), exports);
|
|
25
|
+
__exportStar(require("./MobileFrontend"), exports);
|
|
26
|
+
/** @docs-package-description
|
|
27
|
+
* The core-mobile package provides the necessary tools to run an ITwin.js application on iOS and Android. It provides a layer of communication between native tooling for mobile apps and ITwin.js core.
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* @docs-group-description MobileApp
|
|
31
|
+
* Classes for configuring and administering an iTwin.js application on mobile.
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* @docs-group-description MobileAppProps
|
|
35
|
+
* Configuration options for use with MobileApp.
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* @docs-group-description MobileHost
|
|
39
|
+
* Classes for configuring and administering the backend host on mobile.
|
|
40
|
+
*/
|
|
41
|
+
/**
|
|
42
|
+
* @docs-group-description MobileRpcManager
|
|
43
|
+
* Coordinates usage of RPC interfaces for mobile applications.
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* @docs-group-description MobileRpcServer
|
|
47
|
+
* Provides RPC handling for the backend host on mobile.
|
|
48
|
+
*/
|
|
49
|
+
/**
|
|
50
|
+
* @docs-group-description iModelHub
|
|
51
|
+
* Classes for interacting with iModelHub.
|
|
52
|
+
*/
|
|
53
|
+
/**
|
|
54
|
+
* @docs-group-description RpcInterface
|
|
55
|
+
* Used to define a set of operations exposed by a service that a client can call, using configurable protocols.
|
|
56
|
+
*/
|
|
53
57
|
//# sourceMappingURL=__DOC_ONLY__.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__DOC_ONLY__.js","sourceRoot":"","sources":["../../src/__DOC_ONLY__.ts"],"names":[],"mappings":";AAAA;;;+FAG+F
|
|
1
|
+
{"version":3,"file":"__DOC_ONLY__.js","sourceRoot":"","sources":["../../src/__DOC_ONLY__.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;AAE/F,sDAAsD;AACtD,0EAA0E;AAC1E,iCAAiC;AAEjC,kDAAgC;AAChC,mDAAiC;AAEjC;;GAEG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n// THIS FILE EXISTS ONLY FOR DOCUMENTATION GENERATION.\n// It imports both frontend and backend code, which is not legal anywhere.\n// Do not import it in real code!\n\nexport * from \"./MobileBackend\";\nexport * from \"./MobileFrontend\";\n\n/** @docs-package-description\n * The core-mobile package provides the necessary tools to run an ITwin.js application on iOS and Android. It provides a layer of communication between native tooling for mobile apps and ITwin.js core.\n */\n/**\n * @docs-group-description MobileApp\n * Classes for configuring and administering an iTwin.js application on mobile.\n */\n/**\n * @docs-group-description MobileAppProps\n * Configuration options for use with MobileApp.\n */\n/**\n * @docs-group-description MobileHost\n * Classes for configuring and administering the backend host on mobile.\n */\n/**\n * @docs-group-description MobileRpcManager\n * Coordinates usage of RPC interfaces for mobile applications.\n */\n/**\n * @docs-group-description MobileRpcServer\n * Provides RPC handling for the backend host on mobile.\n */\n/**\n * @docs-group-description iModelHub\n * Classes for interacting with iModelHub.\n */\n/**\n * @docs-group-description RpcInterface\n * Used to define a set of operations exposed by a service that a client can call, using configurable protocols.\n */\n"]}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module OIDC
|
|
3
|
-
*/
|
|
4
|
-
import { AccessToken } from "@itwin/core-bentley";
|
|
5
|
-
import { AuthorizationClient } from "@itwin/core-common";
|
|
6
|
-
/** Utility to provide and cache auth tokens from native mobile apps to IModelHost.
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export declare class MobileAuthorizationBackend implements AuthorizationClient {
|
|
10
|
-
private _accessToken;
|
|
11
|
-
private _expirationDate;
|
|
12
|
-
private _expiryBuffer;
|
|
13
|
-
private _fetchingToken;
|
|
14
|
-
private get _hasExpired();
|
|
15
|
-
getAccessToken(): Promise<AccessToken>;
|
|
16
|
-
setAccessToken(accessToken?: string, expirationDate?: string): void;
|
|
17
|
-
}
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module OIDC
|
|
3
|
+
*/
|
|
4
|
+
import { AccessToken } from "@itwin/core-bentley";
|
|
5
|
+
import { AuthorizationClient } from "@itwin/core-common";
|
|
6
|
+
/** Utility to provide and cache auth tokens from native mobile apps to IModelHost.
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare class MobileAuthorizationBackend implements AuthorizationClient {
|
|
10
|
+
private _accessToken;
|
|
11
|
+
private _expirationDate;
|
|
12
|
+
private _expiryBuffer;
|
|
13
|
+
private _fetchingToken;
|
|
14
|
+
private get _hasExpired();
|
|
15
|
+
getAccessToken(): Promise<AccessToken>;
|
|
16
|
+
setAccessToken(accessToken?: string, expirationDate?: string): void;
|
|
17
|
+
}
|
|
18
18
|
//# sourceMappingURL=MobileAuthorizationBackend.d.ts.map
|
|
@@ -1,47 +1,47 @@
|
|
|
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
|
-
/** @packageDocumentation
|
|
7
|
-
* @module OIDC
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.MobileAuthorizationBackend = void 0;
|
|
11
|
-
const MobileHost_1 = require("./MobileHost");
|
|
12
|
-
/** Utility to provide and cache auth tokens from native mobile apps to IModelHost.
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
class MobileAuthorizationBackend {
|
|
16
|
-
constructor() {
|
|
17
|
-
this._accessToken = "";
|
|
18
|
-
this._expiryBuffer = 60 * 10; // ten minutes
|
|
19
|
-
this._fetchingToken = false;
|
|
20
|
-
}
|
|
21
|
-
get _hasExpired() {
|
|
22
|
-
return this._expirationDate !== undefined && this._expirationDate.getTime() - Date.now() <= this._expiryBuffer * 1000;
|
|
23
|
-
}
|
|
24
|
-
async getAccessToken() {
|
|
25
|
-
if (this._fetchingToken) {
|
|
26
|
-
return Promise.reject(); // short-circuits any recursive use of this function
|
|
27
|
-
}
|
|
28
|
-
if (this._accessToken && !this._hasExpired) {
|
|
29
|
-
return this._accessToken;
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
this._fetchingToken = true;
|
|
33
|
-
const result = await MobileHost_1.MobileHost.authGetAccessToken();
|
|
34
|
-
this._accessToken = result[0];
|
|
35
|
-
if (result[1])
|
|
36
|
-
this._expirationDate = new Date(result[1]);
|
|
37
|
-
this._fetchingToken = false;
|
|
38
|
-
return this._accessToken;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
setAccessToken(accessToken, expirationDate) {
|
|
42
|
-
this._accessToken = accessToken
|
|
43
|
-
this._expirationDate = expirationDate ? new Date(expirationDate) : undefined;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
exports.MobileAuthorizationBackend = MobileAuthorizationBackend;
|
|
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
|
+
/** @packageDocumentation
|
|
7
|
+
* @module OIDC
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.MobileAuthorizationBackend = void 0;
|
|
11
|
+
const MobileHost_1 = require("./MobileHost");
|
|
12
|
+
/** Utility to provide and cache auth tokens from native mobile apps to IModelHost.
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
class MobileAuthorizationBackend {
|
|
16
|
+
constructor() {
|
|
17
|
+
this._accessToken = "";
|
|
18
|
+
this._expiryBuffer = 60 * 10; // ten minutes
|
|
19
|
+
this._fetchingToken = false;
|
|
20
|
+
}
|
|
21
|
+
get _hasExpired() {
|
|
22
|
+
return this._expirationDate !== undefined && this._expirationDate.getTime() - Date.now() <= this._expiryBuffer * 1000;
|
|
23
|
+
}
|
|
24
|
+
async getAccessToken() {
|
|
25
|
+
if (this._fetchingToken) {
|
|
26
|
+
return Promise.reject(); // short-circuits any recursive use of this function
|
|
27
|
+
}
|
|
28
|
+
if (this._accessToken && !this._hasExpired) {
|
|
29
|
+
return this._accessToken;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
this._fetchingToken = true;
|
|
33
|
+
const result = await MobileHost_1.MobileHost.authGetAccessToken();
|
|
34
|
+
this._accessToken = result[0];
|
|
35
|
+
if (result[1])
|
|
36
|
+
this._expirationDate = new Date(result[1]);
|
|
37
|
+
this._fetchingToken = false;
|
|
38
|
+
return this._accessToken;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
setAccessToken(accessToken, expirationDate) {
|
|
42
|
+
this._accessToken = accessToken ?? "";
|
|
43
|
+
this._expirationDate = expirationDate ? new Date(expirationDate) : undefined;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.MobileAuthorizationBackend = MobileAuthorizationBackend;
|
|
47
47
|
//# sourceMappingURL=MobileAuthorizationBackend.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileAuthorizationBackend.js","sourceRoot":"","sources":["../../../src/backend/MobileAuthorizationBackend.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH,6CAA0C;AAE1C;;GAEG;AACH,MAAa,0BAA0B;IAAvC;QACU,iBAAY,GAAgB,EAAE,CAAC;QAE/B,kBAAa,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,cAAc;QACvC,mBAAc,GAAG,KAAK,CAAC;IA4BjC,CAAC;IA1BC,IAAY,WAAW;QACrB,OAAO,IAAI,CAAC,eAAe,KAAK,SAAS,IAAI,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;IACxH,CAAC;IAEM,KAAK,CAAC,cAAc;QACzB,IAAI,IAAI,CAAC,cAAc,EAAE;YACvB,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,oDAAoD;SAC9E;QAED,IAAI,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YAC1C,OAAO,IAAI,CAAC,YAAY,CAAC;SAC1B;aAAM;YACL,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,uBAAU,CAAC,kBAAkB,EAAE,CAAC;YACrD,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YAC9B,IAAI,MAAM,CAAC,CAAC,CAAC;gBACX,IAAI,CAAC,eAAe,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YAC7C,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;YAC5B,OAAO,IAAI,CAAC,YAAY,CAAC;SAC1B;IACH,CAAC;IAEM,cAAc,CAAC,WAAoB,EAAE,cAAuB;QACjE,IAAI,CAAC,YAAY,GAAG,WAAW,
|
|
1
|
+
{"version":3,"file":"MobileAuthorizationBackend.js","sourceRoot":"","sources":["../../../src/backend/MobileAuthorizationBackend.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH,6CAA0C;AAE1C;;GAEG;AACH,MAAa,0BAA0B;IAAvC;QACU,iBAAY,GAAgB,EAAE,CAAC;QAE/B,kBAAa,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,cAAc;QACvC,mBAAc,GAAG,KAAK,CAAC;IA4BjC,CAAC;IA1BC,IAAY,WAAW;QACrB,OAAO,IAAI,CAAC,eAAe,KAAK,SAAS,IAAI,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;IACxH,CAAC;IAEM,KAAK,CAAC,cAAc;QACzB,IAAI,IAAI,CAAC,cAAc,EAAE;YACvB,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,oDAAoD;SAC9E;QAED,IAAI,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YAC1C,OAAO,IAAI,CAAC,YAAY,CAAC;SAC1B;aAAM;YACL,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;YAC3B,MAAM,MAAM,GAAG,MAAM,uBAAU,CAAC,kBAAkB,EAAE,CAAC;YACrD,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YAC9B,IAAI,MAAM,CAAC,CAAC,CAAC;gBACX,IAAI,CAAC,eAAe,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YAC7C,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;YAC5B,OAAO,IAAI,CAAC,YAAY,CAAC;SAC1B;IACH,CAAC;IAEM,cAAc,CAAC,WAAoB,EAAE,cAAuB;QACjE,IAAI,CAAC,YAAY,GAAG,WAAW,IAAI,EAAE,CAAC;QACtC,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/E,CAAC;CACF;AAhCD,gEAgCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OIDC\n */\n\nimport { AccessToken } from \"@itwin/core-bentley\";\nimport { AuthorizationClient } from \"@itwin/core-common\";\nimport { MobileHost } from \"./MobileHost\";\n\n/** Utility to provide and cache auth tokens from native mobile apps to IModelHost.\n * @internal\n */\nexport class MobileAuthorizationBackend implements AuthorizationClient {\n private _accessToken: AccessToken = \"\";\n private _expirationDate: Date | undefined;\n private _expiryBuffer = 60 * 10; // ten minutes\n private _fetchingToken = false;\n\n private get _hasExpired(): boolean {\n return this._expirationDate !== undefined && this._expirationDate.getTime() - Date.now() <= this._expiryBuffer * 1000;\n }\n\n public async getAccessToken(): Promise<AccessToken> {\n if (this._fetchingToken) {\n return Promise.reject(); // short-circuits any recursive use of this function\n }\n\n if (this._accessToken && !this._hasExpired) {\n return this._accessToken;\n } else {\n this._fetchingToken = true;\n const result = await MobileHost.authGetAccessToken();\n this._accessToken = result[0];\n if (result[1])\n this._expirationDate = new Date(result[1]);\n this._fetchingToken = false;\n return this._accessToken;\n }\n }\n\n public setAccessToken(accessToken?: string, expirationDate?: string) {\n this._accessToken = accessToken ?? \"\";\n this._expirationDate = expirationDate ? new Date(expirationDate) : undefined;\n }\n}\n"]}
|