@mpgd/adapter-capacitor 0.4.3 → 0.4.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/dist/index.d.ts +1 -1
- package/dist/index.js +5 -3
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type BridgeRequest, type BridgeResponse } from '@mpgd/bridge';
|
|
2
2
|
import type { PlatformGateway, PlatformTarget } from '@mpgd/platform';
|
|
3
3
|
export interface NativeBridge {
|
|
4
4
|
request(input: BridgeRequest): Promise<BridgeResponse>;
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { decodeBridgeStorageLoadData, } from '@mpgd/bridge';
|
|
1
2
|
import { CapacitorGameServices } from '@mpgd/capacitor-game-services';
|
|
2
3
|
export function createCapacitorPlatformGateway(input) {
|
|
3
4
|
const bridge = input.bridge ?? CapacitorGameServices;
|
|
@@ -20,7 +21,9 @@ export function createCapacitorPlatformGateway(input) {
|
|
|
20
21
|
}
|
|
21
22
|
return {
|
|
22
23
|
target: input.target,
|
|
23
|
-
getCapabilities
|
|
24
|
+
async getCapabilities() {
|
|
25
|
+
return { ...await request('runtime.getCapabilities', {}) };
|
|
26
|
+
},
|
|
24
27
|
identity: {
|
|
25
28
|
getPlayer: () => request('identity.getPlayer', {}),
|
|
26
29
|
getSession: () => request('identity.getSession', {}),
|
|
@@ -63,8 +66,7 @@ export function createCapacitorPlatformGateway(input) {
|
|
|
63
66
|
},
|
|
64
67
|
storage: {
|
|
65
68
|
async load(payload) {
|
|
66
|
-
|
|
67
|
-
return value === null ? null : { value };
|
|
69
|
+
return decodeBridgeStorageLoadData(await request('storage.load', payload));
|
|
68
70
|
},
|
|
69
71
|
save: (payload) => request('storage.save', payload),
|
|
70
72
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpgd/adapter-capacitor",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"description": "Capacitor platform adapter for mpgd Android and iOS shells.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"dist"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@mpgd/bridge": "0.
|
|
38
|
-
"@mpgd/
|
|
39
|
-
"@mpgd/
|
|
37
|
+
"@mpgd/bridge": "0.7.0",
|
|
38
|
+
"@mpgd/capacitor-game-services": "0.4.3",
|
|
39
|
+
"@mpgd/platform": "0.8.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"ttsc": "0.18.4",
|