@itwin/core-mobile 4.0.0-dev.10 → 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.
Files changed (64) hide show
  1. package/CHANGELOG.md +58 -1
  2. package/README.md +1 -1
  3. package/lib/cjs/MobileBackend.d.ts +7 -7
  4. package/lib/cjs/MobileBackend.js +28 -24
  5. package/lib/cjs/MobileBackend.js.map +1 -1
  6. package/lib/cjs/MobileFrontend.d.ts +5 -5
  7. package/lib/cjs/MobileFrontend.js +25 -21
  8. package/lib/cjs/MobileFrontend.js.map +1 -1
  9. package/lib/cjs/__DOC_ONLY__.d.ts +33 -33
  10. package/lib/cjs/__DOC_ONLY__.js +56 -52
  11. package/lib/cjs/__DOC_ONLY__.js.map +1 -1
  12. package/lib/cjs/backend/MobileAuthorizationBackend.d.ts +17 -17
  13. package/lib/cjs/backend/MobileAuthorizationBackend.d.ts.map +1 -1
  14. package/lib/cjs/backend/MobileAuthorizationBackend.js +54 -46
  15. package/lib/cjs/backend/MobileAuthorizationBackend.js.map +1 -1
  16. package/lib/cjs/backend/MobileFileHandler.d.ts +112 -112
  17. package/lib/cjs/backend/MobileFileHandler.d.ts.map +1 -1
  18. package/lib/cjs/backend/MobileFileHandler.js +263 -263
  19. package/lib/cjs/backend/MobileFileHandler.js.map +1 -1
  20. package/lib/cjs/backend/MobileHost.d.ts +72 -72
  21. package/lib/cjs/backend/MobileHost.d.ts.map +1 -1
  22. package/lib/cjs/backend/MobileHost.js +151 -156
  23. package/lib/cjs/backend/MobileHost.js.map +1 -1
  24. package/lib/cjs/backend/MobileRpcServer.d.ts +21 -19
  25. package/lib/cjs/backend/MobileRpcServer.d.ts.map +1 -1
  26. package/lib/cjs/backend/MobileRpcServer.js +179 -156
  27. package/lib/cjs/backend/MobileRpcServer.js.map +1 -1
  28. package/lib/cjs/backend/Request.d.ts +117 -149
  29. package/lib/cjs/backend/Request.d.ts.map +1 -1
  30. package/lib/cjs/backend/Request.js +255 -267
  31. package/lib/cjs/backend/Request.js.map +1 -1
  32. package/lib/cjs/common/MobileAppChannel.d.ts +4 -4
  33. package/lib/cjs/common/MobileAppChannel.js +11 -11
  34. package/lib/cjs/common/MobileAppProps.d.ts +35 -35
  35. package/lib/cjs/common/MobileAppProps.d.ts.map +1 -1
  36. package/lib/cjs/common/MobileAppProps.js +26 -26
  37. package/lib/cjs/common/MobileEventLoop.d.ts +11 -11
  38. package/lib/cjs/common/MobileEventLoop.js +30 -30
  39. package/lib/cjs/common/MobileEventLoop.js.map +1 -1
  40. package/lib/cjs/common/MobileIpc.d.ts +17 -17
  41. package/lib/cjs/common/MobileIpc.js +70 -70
  42. package/lib/cjs/common/MobilePush.d.ts +20 -20
  43. package/lib/cjs/common/MobilePush.js +53 -53
  44. package/lib/cjs/common/MobilePush.js.map +1 -1
  45. package/lib/cjs/common/MobileRpcManager.d.ts +40 -40
  46. package/lib/cjs/common/MobileRpcManager.js +110 -110
  47. package/lib/cjs/common/MobileRpcManager.js.map +1 -1
  48. package/lib/cjs/common/MobileRpcProtocol.d.ts +58 -58
  49. package/lib/cjs/common/MobileRpcProtocol.d.ts.map +1 -1
  50. package/lib/cjs/common/MobileRpcProtocol.js +277 -277
  51. package/lib/cjs/common/MobileRpcProtocol.js.map +1 -1
  52. package/lib/cjs/common/MobileRpcRequest.d.ts +20 -20
  53. package/lib/cjs/common/MobileRpcRequest.js +50 -50
  54. package/lib/cjs/frontend/MobileApp.d.ts +23 -23
  55. package/lib/cjs/frontend/MobileApp.d.ts.map +1 -1
  56. package/lib/cjs/frontend/MobileApp.js +79 -80
  57. package/lib/cjs/frontend/MobileApp.js.map +1 -1
  58. package/lib/cjs/frontend/MobileAuthorizationFrontend.d.ts +17 -17
  59. package/lib/cjs/frontend/MobileAuthorizationFrontend.d.ts.map +1 -1
  60. package/lib/cjs/frontend/MobileAuthorizationFrontend.js +54 -46
  61. package/lib/cjs/frontend/MobileAuthorizationFrontend.js.map +1 -1
  62. package/lib/cjs/test/ios/MobilePlatform.test.d.ts +1 -1
  63. package/lib/cjs/test/ios/MobilePlatform.test.js +84 -84
  64. package/package.json +18 -27
package/CHANGELOG.md CHANGED
@@ -1,6 +1,63 @@
1
1
  # Change Log - @itwin/core-mobile
2
2
 
3
- This log was last generated on Thu, 26 Jan 2023 22:53:27 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 25 Apr 2023 17:50:35 GMT and should not be manually modified.
4
+
5
+ ## 3.7.4
6
+ Tue, 25 Apr 2023 17:50:35 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 3.7.3
11
+ Thu, 20 Apr 2023 13:19:29 GMT
12
+
13
+ _Version update only_
14
+
15
+ ## 3.7.2
16
+ Wed, 12 Apr 2023 13:12:42 GMT
17
+
18
+ _Version update only_
19
+
20
+ ## 3.7.1
21
+ Mon, 03 Apr 2023 15:15:37 GMT
22
+
23
+ _Version update only_
24
+
25
+ ## 3.7.0
26
+ Wed, 29 Mar 2023 15:02:27 GMT
27
+
28
+ ### Updates
29
+
30
+ - Fix mobile getAccessToken error handling
31
+ - React to IModelApp.rpcInterfaces and BentleyCloudRpcManager changes.
32
+
33
+ ## 3.6.3
34
+ Mon, 27 Mar 2023 16:26:47 GMT
35
+
36
+ _Version update only_
37
+
38
+ ## 3.6.2
39
+ Fri, 17 Mar 2023 17:52:32 GMT
40
+
41
+ _Version update only_
42
+
43
+ ## 3.6.1
44
+ Fri, 24 Feb 2023 22:00:48 GMT
45
+
46
+ _Version update only_
47
+
48
+ ## 3.6.0
49
+ Wed, 08 Feb 2023 14:58:40 GMT
50
+
51
+ ### Updates
52
+
53
+ - Fixed bug which prevented mobile lifecycle events from being received on frontend.
54
+ - Fix for mobile app lifcycle crash
55
+ - React to RPC deprecations.
56
+
57
+ ## 3.5.6
58
+ Fri, 24 Feb 2023 16:02:47 GMT
59
+
60
+ _Version update only_
4
61
 
5
62
  ## 3.5.5
6
63
  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-electron__ package contains the electron utilities to write an iTwin.js application based on Electron.
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
@@ -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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- // Barrel file for backend of a mobile application
18
- __exportStar(require("./backend/MobileAuthorizationBackend"), exports);
19
- __exportStar(require("./backend/MobileFileHandler"), exports);
20
- __exportStar(require("./backend/MobileHost"), exports);
21
- __exportStar(require("./common/MobileAppProps"), exports);
22
- __exportStar(require("./common/MobileRpcManager"), exports);
23
- __exportStar(require("./common/MobileRpcProtocol"), exports);
24
- __exportStar(require("./common/MobileRpcRequest"), exports);
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;;;;;;;;;;;;AAE/F,kDAAkD;AAElD,uEAAqD;AACrD,8DAA4C;AAC5C,uDAAqC;AACrC,0DAAwC;AACxC,4DAA0C;AAC1C,6DAA2C;AAC3C,4DAA0C","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// Barrel file for backend of a mobile application\r\n\r\nexport * from \"./backend/MobileAuthorizationBackend\";\r\nexport * from \"./backend/MobileFileHandler\";\r\nexport * from \"./backend/MobileHost\";\r\nexport * from \"./common/MobileAppProps\";\r\nexport * from \"./common/MobileRpcManager\";\r\nexport * from \"./common/MobileRpcProtocol\";\r\nexport * from \"./common/MobileRpcRequest\";\r\n"]}
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":["/*---------------------------------------------------------------------------------------------\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// Barrel file for backend of a mobile application\r\n\r\nexport * from \"./backend/MobileAuthorizationBackend\";\r\nexport * from \"./backend/MobileFileHandler\";\r\nexport * from \"./backend/MobileHost\";\r\nexport * from \"./common/MobileAppProps\";\r\nexport * from \"./common/MobileRpcManager\";\r\nexport * from \"./common/MobileRpcProtocol\";\r\nexport * from \"./common/MobileRpcRequest\";\r\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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./common/MobileAppProps"), exports);
18
- __exportStar(require("./common/MobileRpcManager"), exports);
19
- __exportStar(require("./common/MobileRpcProtocol"), exports);
20
- __exportStar(require("./common/MobileRpcRequest"), exports);
21
- __exportStar(require("./frontend/MobileApp"), exports);
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;;;;;;;;;;;;AAE/F,0DAAwC;AACxC,4DAA0C;AAC1C,6DAA2C;AAC3C,4DAA0C;AAC1C,uDAAqC","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\nexport * from \"./common/MobileAppProps\";\r\nexport * from \"./common/MobileRpcManager\";\r\nexport * from \"./common/MobileRpcProtocol\";\r\nexport * from \"./common/MobileRpcRequest\";\r\nexport * from \"./frontend/MobileApp\";\r\n"]}
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":["/*---------------------------------------------------------------------------------------------\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\nexport * from \"./common/MobileAppProps\";\r\nexport * from \"./common/MobileRpcManager\";\r\nexport * from \"./common/MobileRpcProtocol\";\r\nexport * from \"./common/MobileRpcRequest\";\r\nexport * from \"./frontend/MobileApp\";\r\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
@@ -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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- // THIS FILE EXISTS ONLY FOR DOCUMENTATION GENERATION.
18
- // It imports both frontend and backend code, which is not legal anywhere.
19
- // Do not import it in real code!
20
- __exportStar(require("./MobileBackend"), exports);
21
- __exportStar(require("./MobileFrontend"), exports);
22
- /** @docs-package-description
23
- * 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.
24
- */
25
- /**
26
- * @docs-group-description MobileApp
27
- * Classes for configuring and administering an iTwin.js application on mobile.
28
- */
29
- /**
30
- * @docs-group-description MobileAppProps
31
- * Configuration options for use with MobileApp.
32
- */
33
- /**
34
- * @docs-group-description MobileHost
35
- * Classes for configuring and administering the backend host on mobile.
36
- */
37
- /**
38
- * @docs-group-description MobileRpcManager
39
- * Coordinates usage of RPC interfaces for mobile applications.
40
- */
41
- /**
42
- * @docs-group-description MobileRpcServer
43
- * Provides RPC handling for the backend host on mobile.
44
- */
45
- /**
46
- * @docs-group-description iModelHub
47
- * Classes for interacting with iModelHub.
48
- */
49
- /**
50
- * @docs-group-description RpcInterface
51
- * Used to define a set of operations exposed by a service that a client can call, using configurable protocols.
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;;;;;;;;;;;;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":["/*---------------------------------------------------------------------------------------------\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// THIS FILE EXISTS ONLY FOR DOCUMENTATION GENERATION.\r\n// It imports both frontend and backend code, which is not legal anywhere.\r\n// Do not import it in real code!\r\n\r\nexport * from \"./MobileBackend\";\r\nexport * from \"./MobileFrontend\";\r\n\r\n/** @docs-package-description\r\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.\r\n */\r\n/**\r\n * @docs-group-description MobileApp\r\n * Classes for configuring and administering an iTwin.js application on mobile.\r\n */\r\n/**\r\n * @docs-group-description MobileAppProps\r\n * Configuration options for use with MobileApp.\r\n */\r\n/**\r\n * @docs-group-description MobileHost\r\n * Classes for configuring and administering the backend host on mobile.\r\n */\r\n/**\r\n * @docs-group-description MobileRpcManager\r\n * Coordinates usage of RPC interfaces for mobile applications.\r\n */\r\n/**\r\n * @docs-group-description MobileRpcServer\r\n * Provides RPC handling for the backend host on mobile.\r\n */\r\n/**\r\n * @docs-group-description iModelHub\r\n * Classes for interacting with iModelHub.\r\n */\r\n/**\r\n * @docs-group-description RpcInterface\r\n * Used to define a set of operations exposed by a service that a client can call, using configurable protocols.\r\n */\r\n"]}
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":["/*---------------------------------------------------------------------------------------------\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// THIS FILE EXISTS ONLY FOR DOCUMENTATION GENERATION.\r\n// It imports both frontend and backend code, which is not legal anywhere.\r\n// Do not import it in real code!\r\n\r\nexport * from \"./MobileBackend\";\r\nexport * from \"./MobileFrontend\";\r\n\r\n/** @docs-package-description\r\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.\r\n */\r\n/**\r\n * @docs-group-description MobileApp\r\n * Classes for configuring and administering an iTwin.js application on mobile.\r\n */\r\n/**\r\n * @docs-group-description MobileAppProps\r\n * Configuration options for use with MobileApp.\r\n */\r\n/**\r\n * @docs-group-description MobileHost\r\n * Classes for configuring and administering the backend host on mobile.\r\n */\r\n/**\r\n * @docs-group-description MobileRpcManager\r\n * Coordinates usage of RPC interfaces for mobile applications.\r\n */\r\n/**\r\n * @docs-group-description MobileRpcServer\r\n * Provides RPC handling for the backend host on mobile.\r\n */\r\n/**\r\n * @docs-group-description iModelHub\r\n * Classes for interacting with iModelHub.\r\n */\r\n/**\r\n * @docs-group-description RpcInterface\r\n * Used to define a set of operations exposed by a service that a client can call, using configurable protocols.\r\n */\r\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 +1 @@
1
- {"version":3,"file":"MobileAuthorizationBackend.d.ts","sourceRoot":"","sources":["../../../src/backend/MobileAuthorizationBackend.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAGzD;;GAEG;AACH,qBAAa,0BAA2B,YAAW,mBAAmB;IACpE,OAAO,CAAC,YAAY,CAAmB;IACvC,OAAO,CAAC,eAAe,CAAmB;IAC1C,OAAO,CAAC,aAAa,CAAW;IAChC,OAAO,CAAC,cAAc,CAAS;IAE/B,OAAO,KAAK,WAAW,GAEtB;IAEY,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC;IAkB5C,cAAc,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM;CAIpE"}
1
+ {"version":3,"file":"MobileAuthorizationBackend.d.ts","sourceRoot":"","sources":["../../../src/backend/MobileAuthorizationBackend.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAGzD;;GAEG;AACH,qBAAa,0BAA2B,YAAW,mBAAmB;IACpE,OAAO,CAAC,YAAY,CAAmB;IACvC,OAAO,CAAC,eAAe,CAAmB;IAC1C,OAAO,CAAC,aAAa,CAAW;IAChC,OAAO,CAAC,cAAc,CAAS;IAE/B,OAAO,KAAK,WAAW,GAEtB;IAEY,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC;IAwB5C,cAAc,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM;CAIpE"}
@@ -1,47 +1,55 @@
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 !== null && accessToken !== void 0 ? 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
+ // NOTE: This function is from the AuthorizationClient interface. That interface documents
27
+ // this function to return an empty string if no token is available, NOT throw an exception.
28
+ return ""; // short-circuits any recursive use of this function
29
+ }
30
+ if (this._accessToken && !this._hasExpired) {
31
+ return this._accessToken;
32
+ }
33
+ else {
34
+ try {
35
+ this._fetchingToken = true;
36
+ const result = await MobileHost_1.MobileHost.authGetAccessToken();
37
+ this._accessToken = result[0];
38
+ this._expirationDate = result[1] ? new Date(result[1]) : undefined;
39
+ return this._accessToken;
40
+ }
41
+ catch (_ex) {
42
+ return "";
43
+ }
44
+ finally {
45
+ this._fetchingToken = false;
46
+ }
47
+ }
48
+ }
49
+ setAccessToken(accessToken, expirationDate) {
50
+ this._accessToken = accessToken ?? "";
51
+ this._expirationDate = expirationDate ? new Date(expirationDate) : undefined;
52
+ }
53
+ }
54
+ exports.MobileAuthorizationBackend = MobileAuthorizationBackend;
47
55
  //# 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,aAAX,WAAW,cAAX,WAAW,GAAI,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":["/*---------------------------------------------------------------------------------------------\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 OIDC\r\n */\r\n\r\nimport { AccessToken } from \"@itwin/core-bentley\";\r\nimport { AuthorizationClient } from \"@itwin/core-common\";\r\nimport { MobileHost } from \"./MobileHost\";\r\n\r\n/** Utility to provide and cache auth tokens from native mobile apps to IModelHost.\r\n * @internal\r\n */\r\nexport class MobileAuthorizationBackend implements AuthorizationClient {\r\n private _accessToken: AccessToken = \"\";\r\n private _expirationDate: Date | undefined;\r\n private _expiryBuffer = 60 * 10; // ten minutes\r\n private _fetchingToken = false;\r\n\r\n private get _hasExpired(): boolean {\r\n return this._expirationDate !== undefined && this._expirationDate.getTime() - Date.now() <= this._expiryBuffer * 1000;\r\n }\r\n\r\n public async getAccessToken(): Promise<AccessToken> {\r\n if (this._fetchingToken) {\r\n return Promise.reject(); // short-circuits any recursive use of this function\r\n }\r\n\r\n if (this._accessToken && !this._hasExpired) {\r\n return this._accessToken;\r\n } else {\r\n this._fetchingToken = true;\r\n const result = await MobileHost.authGetAccessToken();\r\n this._accessToken = result[0];\r\n if (result[1])\r\n this._expirationDate = new Date(result[1]);\r\n this._fetchingToken = false;\r\n return this._accessToken;\r\n }\r\n }\r\n\r\n public setAccessToken(accessToken?: string, expirationDate?: string) {\r\n this._accessToken = accessToken ?? \"\";\r\n this._expirationDate = expirationDate ? new Date(expirationDate) : undefined;\r\n }\r\n}\r\n"]}
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;IAkCjC,CAAC;IAhCC,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,0FAA0F;YAC1F,4FAA4F;YAC5F,OAAO,EAAE,CAAC,CAAC,oDAAoD;SAChE;QAED,IAAI,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YAC1C,OAAO,IAAI,CAAC,YAAY,CAAC;SAC1B;aAAM;YACL,IAAI;gBACF,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;gBAC3B,MAAM,MAAM,GAAG,MAAM,uBAAU,CAAC,kBAAkB,EAAE,CAAC;gBACrD,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;gBAC9B,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;gBACnE,OAAO,IAAI,CAAC,YAAY,CAAC;aAC1B;YAAC,OAAO,GAAG,EAAE;gBACZ,OAAO,EAAE,CAAC;aACX;oBAAS;gBACR,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;aAC7B;SACF;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;AAtCD,gEAsCC","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 OIDC\r\n */\r\n\r\nimport { AccessToken } from \"@itwin/core-bentley\";\r\nimport { AuthorizationClient } from \"@itwin/core-common\";\r\nimport { MobileHost } from \"./MobileHost\";\r\n\r\n/** Utility to provide and cache auth tokens from native mobile apps to IModelHost.\r\n * @internal\r\n */\r\nexport class MobileAuthorizationBackend implements AuthorizationClient {\r\n private _accessToken: AccessToken = \"\";\r\n private _expirationDate: Date | undefined;\r\n private _expiryBuffer = 60 * 10; // ten minutes\r\n private _fetchingToken = false;\r\n\r\n private get _hasExpired(): boolean {\r\n return this._expirationDate !== undefined && this._expirationDate.getTime() - Date.now() <= this._expiryBuffer * 1000;\r\n }\r\n\r\n public async getAccessToken(): Promise<AccessToken> {\r\n if (this._fetchingToken) {\r\n // NOTE: This function is from the AuthorizationClient interface. That interface documents\r\n // this function to return an empty string if no token is available, NOT throw an exception.\r\n return \"\"; // short-circuits any recursive use of this function\r\n }\r\n\r\n if (this._accessToken && !this._hasExpired) {\r\n return this._accessToken;\r\n } else {\r\n try {\r\n this._fetchingToken = true;\r\n const result = await MobileHost.authGetAccessToken();\r\n this._accessToken = result[0];\r\n this._expirationDate = result[1] ? new Date(result[1]) : undefined;\r\n return this._accessToken;\r\n } catch (_ex) {\r\n return \"\";\r\n } finally {\r\n this._fetchingToken = false;\r\n }\r\n }\r\n }\r\n\r\n public setAccessToken(accessToken?: string, expirationDate?: string) {\r\n this._accessToken = accessToken ?? \"\";\r\n this._expirationDate = expirationDate ? new Date(expirationDate) : undefined;\r\n }\r\n}\r\n"]}