@itwin/core-mobile 4.8.0-dev.4 → 4.8.0-dev.41
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
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
# Change Log - @itwin/core-mobile
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 31 Jul 2024 13:39:32 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 4.7.8
|
|
6
|
+
Wed, 31 Jul 2024 13:38:04 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 4.7.7
|
|
11
|
+
Fri, 19 Jul 2024 14:52:42 GMT
|
|
12
|
+
|
|
13
|
+
_Version update only_
|
|
14
|
+
|
|
15
|
+
## 4.7.6
|
|
16
|
+
Fri, 12 Jul 2024 14:42:55 GMT
|
|
17
|
+
|
|
18
|
+
_Version update only_
|
|
19
|
+
|
|
20
|
+
## 4.7.5
|
|
21
|
+
Thu, 11 Jul 2024 15:24:55 GMT
|
|
22
|
+
|
|
23
|
+
_Version update only_
|
|
24
|
+
|
|
25
|
+
## 4.7.4
|
|
26
|
+
Mon, 01 Jul 2024 14:06:23 GMT
|
|
27
|
+
|
|
28
|
+
_Version update only_
|
|
29
|
+
|
|
30
|
+
## 4.7.3
|
|
31
|
+
Thu, 27 Jun 2024 21:09:02 GMT
|
|
32
|
+
|
|
33
|
+
_Version update only_
|
|
34
|
+
|
|
35
|
+
## 4.7.2
|
|
36
|
+
Sat, 22 Jun 2024 01:09:54 GMT
|
|
37
|
+
|
|
38
|
+
_Version update only_
|
|
39
|
+
|
|
40
|
+
## 4.7.1
|
|
41
|
+
Thu, 13 Jun 2024 22:47:32 GMT
|
|
42
|
+
|
|
43
|
+
_Version update only_
|
|
44
|
+
|
|
45
|
+
## 4.7.0
|
|
46
|
+
Wed, 12 Jun 2024 18:02:16 GMT
|
|
47
|
+
|
|
48
|
+
_Version update only_
|
|
4
49
|
|
|
5
50
|
## 4.6.2
|
|
6
51
|
Sat, 08 Jun 2024 00:50:25 GMT
|
|
@@ -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,
|
|
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,EAAwD,aAAa,EAAuB,MAAM,sBAAsB,CAAC;AAEhI,OAAO,EAAE,kBAAkB,EAAuB,MAAM,0BAA0B,CAAC;AAInF,YAAY;AACZ,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG;IAAE,SAAS,EAAE;QAAE,mBAAmB,CAAC,EAAE,KAAK,CAAA;KAAE,CAAA;CAAE,CAAC;AAoB3F,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;IAC1D,OAAc,wBAAwB,wBAA6B,MAAM,GAAG,SAAS,kBAAkB,MAAM,GAAG,SAAS,KAAK,IAAI,EAAI;WAClH,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,YAAY;WACQ,OAAO,CAAC,IAAI,CAAC,EAAE,aAAa;CAwBjD"}
|
|
@@ -30,7 +30,7 @@ class MobileAppNotifyHandler extends core_frontend_1.NotificationHandler {
|
|
|
30
30
|
/** @beta */
|
|
31
31
|
class MobileApp {
|
|
32
32
|
static async callBackend(methodName, ...args) {
|
|
33
|
-
return core_frontend_1.IpcApp.
|
|
33
|
+
return core_frontend_1.IpcApp[core_frontend_1._callIpcChannel](MobileAppChannel_1.mobileAppStrings.mobileAppChannel, methodName, ...args);
|
|
34
34
|
}
|
|
35
35
|
static get isValid() { return this._isValid; }
|
|
36
36
|
/** @beta */
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"MobileApp.js","sourceRoot":"","sources":["../../../src/frontend/MobileApp.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,sDAAyF;AACzF,oDAA0G;AAC1G,wDAAgI;AAChI,iEAA8D;AAE9D,iEAA8D;AAC9D,+EAA4E;AAK5E,yCAAyC;AACzC,MAAM,sBAAuB,SAAQ,mCAAmB;IACtD,IAAW,WAAW,KAAK,OAAO,mCAAgB,CAAC,eAAe,CAAC,CAAC,CAAC;IAE9D,mBAAmB;QACxB,qBAAM,CAAC,UAAU,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAAC;QACrD,IAAI,SAAS,CAAC,eAAe,CAAC,iBAAiB,KAAK,CAAC,EAAE,CAAC;YACtD,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAC9B,CAAC;QACD,SAAS,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC;IACzC,CAAC;IACM,wBAAwB,KAAK,SAAS,CAAC,oBAAoB,CAAC,UAAU,EAAE,CA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AAM,GAAG,IAAI,kCAAoB,EAAE,CAAC,CAAC,aAAa;QACxD,MAAM,yBAAS,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC,CAAC;QAEvE,sBAAsB,CAAC,QAAQ,EAAE,CAAC,CAAC,sCAAsC;IAC3E,CAAC;;AArCH,8BAsCC;AArCe,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;AAC5C,kCAAwB,GAAG,IAAI,sBAAO,EAAiF,CAAC;AAKvH,kBAAQ,GAAG,KAAK,CAAC;AA6BlC;;;;EAIE;AACF,SAAS,0BAA0B;IAChC,MAAc,CAAC,uBAAuB,GAAG,CAAC,GAAyB,EAAE,EAAE;QACtE,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtB,SAAS,CAAC,iBAAiB,CAAC,UAAU,EAAE,CAAC;QAC3C,CAAC;aAAM,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC5B,SAAS,CAAC,iBAAiB,CAAC,UAAU,EAAE,CAAC;QAC3C,CAAC;IACH,CAAC,CAAC;AACJ,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 { _callIpcChannel, IModelAppOptions, IpcApp, NativeApp, NativeAppOpts, NotificationHandler } from \"@itwin/core-frontend\";\r\nimport { mobileAppStrings } from \"../common/MobileAppChannel\";\r\nimport { MobileAppFunctions, MobileNotifications } from \"../common/MobileAppProps\";\r\nimport { MobileRpcManager } from \"../common/MobileRpcManager\";\r\nimport { MobileAuthorizationFrontend } from \"./MobileAuthorizationFrontend\";\r\n\r\n/** @beta */\r\nexport type MobileAppOpts = NativeAppOpts & { iModelApp: { authorizationClient?: never } };\r\n\r\n/** receive notifications from backend */\r\nclass MobileAppNotifyHandler extends NotificationHandler implements MobileNotifications {\r\n public get channelName() { return mobileAppStrings.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 notifyWillTerminate() { MobileApp.onWillTerminate.raiseEvent(); }\r\n public notifyAuthAccessTokenChanged(accessToken: string | undefined, expirationDate: string | undefined) {\r\n MobileApp.onAuthAccessTokenChanged.raiseEvent(accessToken, expirationDate);\r\n }\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 onAuthAccessTokenChanged = new BeEvent<(accessToken: string | undefined, expirationDate: string | undefined) => void>();\r\n public static async callBackend<T extends AsyncMethodsOf<MobileAppFunctions>>(methodName: T, ...args: Parameters<MobileAppFunctions[T]>) {\r\n return IpcApp[_callIpcChannel](mobileAppStrings.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 /** @beta */\r\n public static async startup(opts?: MobileAppOpts) {\r\n attachDirectEventCallbacks();\r\n\r\n const iModelAppOpts: IModelAppOptions = {\r\n ...opts?.iModelApp,\r\n };\r\n const authorizationClient = new MobileAuthorizationFrontend();\r\n iModelAppOpts.authorizationClient = authorizationClient;\r\n\r\n if (!this._isValid) {\r\n this.onAuthAccessTokenChanged.addListener((accessToken: string | undefined, expirationDate: string | undefined) => {\r\n authorizationClient.setAccessToken(accessToken, expirationDate);\r\n });\r\n\r\n const rpcInterfaces = opts?.iModelApp?.rpcInterfaces ?? [IModelReadRpcInterface, IModelTileRpcInterface]; // eslint-disable-line deprecation/deprecation\r\n MobileRpcManager.initializeClient(rpcInterfaces);\r\n this._isValid = true;\r\n }\r\n\r\n const socket = new IpcWebSocketFrontend(); // needs work\r\n await NativeApp.startup(socket, { ...opts, iModelApp: iModelAppOpts });\r\n\r\n MobileAppNotifyHandler.register(); // receives notifications from backend\r\n }\r\n}\r\n\r\n/*\r\n The suspend/resume lifecycle events cannot be reliably sent from the backend due to timing issues that arise when\r\n inter-operating with the actual suspend and resume behavior on the native side.\r\n Instead, they are sent directly to the browser here from platform-specific code.\r\n*/\r\nfunction attachDirectEventCallbacks() {\r\n (window as any)._imodeljs_rpc_lifecycle = (evt: \"suspend\" | \"resume\") => {\r\n if (evt === \"suspend\") {\r\n MobileApp.onEnterBackground.raiseEvent();\r\n } else if (evt === \"resume\") {\r\n MobileApp.onEnterForeground.raiseEvent();\r\n }\r\n };\r\n}\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/core-mobile",
|
|
3
|
-
"version": "4.8.0-dev.
|
|
3
|
+
"version": "4.8.0-dev.41",
|
|
4
4
|
"description": "iTwin.js MobileHost and MobileApp",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
"url": "http://www.bentley.com"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@itwin/core-backend": "^4.8.0-dev.
|
|
26
|
-
"@itwin/core-bentley": "^4.8.0-dev.
|
|
27
|
-
"@itwin/core-common": "^4.8.0-dev.
|
|
28
|
-
"@itwin/core-frontend": "^4.8.0-dev.
|
|
25
|
+
"@itwin/core-backend": "^4.8.0-dev.41",
|
|
26
|
+
"@itwin/core-bentley": "^4.8.0-dev.41",
|
|
27
|
+
"@itwin/core-common": "^4.8.0-dev.41",
|
|
28
|
+
"@itwin/core-frontend": "^4.8.0-dev.41"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"lodash": "^4.17.21",
|
|
32
32
|
"superagent": "^9.0.1",
|
|
33
|
-
"ws": "^7.5.
|
|
33
|
+
"ws": "^7.5.10"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@itwin/eslint-plugin": "^4.0.2",
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
"mocha": "^10.2.0",
|
|
50
50
|
"rimraf": "^3.0.2",
|
|
51
51
|
"typescript": "~5.3.3",
|
|
52
|
-
"@itwin/build-tools": "4.8.0-dev.
|
|
53
|
-
"@itwin/core-
|
|
54
|
-
"@itwin/core-bentley": "4.8.0-dev.
|
|
55
|
-
"@itwin/core-frontend": "4.8.0-dev.
|
|
56
|
-
"@itwin/core-
|
|
52
|
+
"@itwin/build-tools": "4.8.0-dev.41",
|
|
53
|
+
"@itwin/core-backend": "4.8.0-dev.41",
|
|
54
|
+
"@itwin/core-bentley": "4.8.0-dev.41",
|
|
55
|
+
"@itwin/core-frontend": "4.8.0-dev.41",
|
|
56
|
+
"@itwin/core-common": "4.8.0-dev.41"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "npm run -s build:cjs",
|