@usions/sdk 2.11.0 → 2.11.1
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/package.json +5 -4
- package/types/index.d.ts +25 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usions/sdk",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.1",
|
|
4
4
|
"description": "Usion Mini App SDK for iframe games and services",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/modules/index.js",
|
|
@@ -40,13 +40,14 @@
|
|
|
40
40
|
"multiplayer",
|
|
41
41
|
"mini-app"
|
|
42
42
|
],
|
|
43
|
-
"homepage": "https://github.com/
|
|
43
|
+
"homepage": "https://github.com/ugshanyu/usionthemobile/tree/main/packages/sdk#readme",
|
|
44
44
|
"repository": {
|
|
45
45
|
"type": "git",
|
|
46
|
-
"url": "git+https://github.com/
|
|
46
|
+
"url": "git+https://github.com/ugshanyu/usionthemobile.git",
|
|
47
|
+
"directory": "packages/sdk"
|
|
47
48
|
},
|
|
48
49
|
"bugs": {
|
|
49
|
-
"url": "https://github.com/
|
|
50
|
+
"url": "https://github.com/ugshanyu/usionthemobile/issues"
|
|
50
51
|
},
|
|
51
52
|
"license": "MIT",
|
|
52
53
|
"publishConfig": {
|
package/types/index.d.ts
CHANGED
|
@@ -745,9 +745,34 @@ export interface UsionSDK {
|
|
|
745
745
|
lobby: LobbyModule;
|
|
746
746
|
leaderboard: LeaderboardModule;
|
|
747
747
|
matchmaking: MatchmakingModule;
|
|
748
|
+
cloud: CloudModule;
|
|
748
749
|
netcode: NetcodeModule;
|
|
749
750
|
}
|
|
750
751
|
|
|
752
|
+
/** Scoped server-persisted KV operations (per-user or shared). */
|
|
753
|
+
export interface CloudScope {
|
|
754
|
+
/** Get a value; resolves to null when the key doesn't exist. */
|
|
755
|
+
get(key: string, opts?: { serviceId?: string }): Promise<any>;
|
|
756
|
+
/** Set a JSON-serializable value (max 64 KB). Keys: 1-128 chars of A-Za-z0-9_.-:/ */
|
|
757
|
+
set(key: string, value: any, opts?: { serviceId?: string }): Promise<{ success: boolean; size: number }>;
|
|
758
|
+
/** Remove a key. */
|
|
759
|
+
remove(key: string, opts?: { serviceId?: string }): Promise<{ success: boolean; removed: boolean }>;
|
|
760
|
+
/** List keys in this scope's bucket. */
|
|
761
|
+
keys(opts?: { serviceId?: string }): Promise<string[]>;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* Server-persisted cloud storage. Per-user scope on the module itself
|
|
766
|
+
* (cloud saves synced across devices); `shared` is one bucket per app that
|
|
767
|
+
* all users read/write. Quotas: 64 KB/value, 200 keys + 1 MB per bucket.
|
|
768
|
+
*/
|
|
769
|
+
export interface CloudModule extends CloudScope {
|
|
770
|
+
shared: CloudScope & {
|
|
771
|
+
/** Atomically increment a shared numeric value (default delta 1). Resolves to the new value. */
|
|
772
|
+
incr(key: string, delta?: number, opts?: { serviceId?: string }): Promise<number>;
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
|
|
751
776
|
export interface Match { roomId: string; players: string[]; serviceId?: string; }
|
|
752
777
|
|
|
753
778
|
export interface MatchmakingModule {
|