@photon-os/sdk 1.0.0-alpha.0 → 1.0.0-alpha.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/dist/index.d.mts +32 -1
- package/dist/index.d.ts +32 -1
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -20,6 +20,18 @@ type PreferenceValue = string | number | boolean | null | PreferenceValue[] | {
|
|
|
20
20
|
[key: string]: PreferenceValue;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Represents a linked Second Life account visible to apps via the SDK.
|
|
25
|
+
*/
|
|
26
|
+
type SecondLifeAccount = {
|
|
27
|
+
/** Second Life avatar UUID (key) */
|
|
28
|
+
avatarUuid: string;
|
|
29
|
+
/** Second Life avatar display name */
|
|
30
|
+
avatarName: string;
|
|
31
|
+
/** When the account was linked (ISO 8601 timestamp) */
|
|
32
|
+
linkedAt: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
23
35
|
/**
|
|
24
36
|
* Represents the authenticated user visible to apps via the SDK.
|
|
25
37
|
* This is a read-only, minimal representation.
|
|
@@ -36,6 +48,10 @@ type AppLaunchResult = {
|
|
|
36
48
|
error: Error | null;
|
|
37
49
|
app: AppDefinition;
|
|
38
50
|
};
|
|
51
|
+
type LinkingCode = {
|
|
52
|
+
code: string;
|
|
53
|
+
expiresAt: string;
|
|
54
|
+
};
|
|
39
55
|
type OperatingSystemAPI = {
|
|
40
56
|
system_homeButton: () => Promise<void>;
|
|
41
57
|
apps_getInstalledApps: () => Promise<AppDefinition[]>;
|
|
@@ -50,8 +66,22 @@ type OperatingSystemAPI = {
|
|
|
50
66
|
prefs_getShared: (key: string) => Promise<PreferenceValue>;
|
|
51
67
|
prefs_setShared: (key: string, value: PreferenceValue) => Promise<void>;
|
|
52
68
|
prefs_deleteShared: (key: string) => Promise<void>;
|
|
69
|
+
accounts_getLinkedSecondLifeAccounts: () => Promise<SecondLifeAccount[]>;
|
|
70
|
+
accounts_unlinkSecondLifeAccount: (avatarUuid: string) => Promise<void>;
|
|
71
|
+
accounts_generateLinkingCode: () => Promise<LinkingCode>;
|
|
53
72
|
};
|
|
54
73
|
|
|
74
|
+
declare class AccountManager {
|
|
75
|
+
private os;
|
|
76
|
+
constructor(os: OS);
|
|
77
|
+
/** Get all Second Life accounts linked to the current user */
|
|
78
|
+
getLinkedSecondLifeAccounts(): Promise<SecondLifeAccount[]>;
|
|
79
|
+
/** Unlink a Second Life account from the current user */
|
|
80
|
+
unlinkSecondLifeAccount(avatarUuid: string): Promise<void>;
|
|
81
|
+
/** Generate a linking code for connecting a Second Life account */
|
|
82
|
+
generateLinkingCode(): Promise<LinkingCode>;
|
|
83
|
+
}
|
|
84
|
+
|
|
55
85
|
declare class AppManager {
|
|
56
86
|
private os;
|
|
57
87
|
constructor(os: OS);
|
|
@@ -111,6 +141,7 @@ type OSConfig = {
|
|
|
111
141
|
target: Window;
|
|
112
142
|
};
|
|
113
143
|
declare class OS {
|
|
144
|
+
accounts: AccountManager;
|
|
114
145
|
apps: AppManager;
|
|
115
146
|
prefs: PreferencesManager;
|
|
116
147
|
user: UserManager;
|
|
@@ -122,4 +153,4 @@ declare class OS {
|
|
|
122
153
|
|
|
123
154
|
declare const VERSION = "1.0.0";
|
|
124
155
|
|
|
125
|
-
export { type AppBundleId, type AppDefinition, type AppLaunchResult, OS, type OSConfig, type OperatingSystemAPI, type PhotonUser, type PreferenceValue, type RunningAppInstance, VERSION };
|
|
156
|
+
export { type AppBundleId, type AppDefinition, type AppLaunchResult, type LinkingCode, OS, type OSConfig, type OperatingSystemAPI, type PhotonUser, type PreferenceValue, type RunningAppInstance, type SecondLifeAccount, VERSION };
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,18 @@ type PreferenceValue = string | number | boolean | null | PreferenceValue[] | {
|
|
|
20
20
|
[key: string]: PreferenceValue;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Represents a linked Second Life account visible to apps via the SDK.
|
|
25
|
+
*/
|
|
26
|
+
type SecondLifeAccount = {
|
|
27
|
+
/** Second Life avatar UUID (key) */
|
|
28
|
+
avatarUuid: string;
|
|
29
|
+
/** Second Life avatar display name */
|
|
30
|
+
avatarName: string;
|
|
31
|
+
/** When the account was linked (ISO 8601 timestamp) */
|
|
32
|
+
linkedAt: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
23
35
|
/**
|
|
24
36
|
* Represents the authenticated user visible to apps via the SDK.
|
|
25
37
|
* This is a read-only, minimal representation.
|
|
@@ -36,6 +48,10 @@ type AppLaunchResult = {
|
|
|
36
48
|
error: Error | null;
|
|
37
49
|
app: AppDefinition;
|
|
38
50
|
};
|
|
51
|
+
type LinkingCode = {
|
|
52
|
+
code: string;
|
|
53
|
+
expiresAt: string;
|
|
54
|
+
};
|
|
39
55
|
type OperatingSystemAPI = {
|
|
40
56
|
system_homeButton: () => Promise<void>;
|
|
41
57
|
apps_getInstalledApps: () => Promise<AppDefinition[]>;
|
|
@@ -50,8 +66,22 @@ type OperatingSystemAPI = {
|
|
|
50
66
|
prefs_getShared: (key: string) => Promise<PreferenceValue>;
|
|
51
67
|
prefs_setShared: (key: string, value: PreferenceValue) => Promise<void>;
|
|
52
68
|
prefs_deleteShared: (key: string) => Promise<void>;
|
|
69
|
+
accounts_getLinkedSecondLifeAccounts: () => Promise<SecondLifeAccount[]>;
|
|
70
|
+
accounts_unlinkSecondLifeAccount: (avatarUuid: string) => Promise<void>;
|
|
71
|
+
accounts_generateLinkingCode: () => Promise<LinkingCode>;
|
|
53
72
|
};
|
|
54
73
|
|
|
74
|
+
declare class AccountManager {
|
|
75
|
+
private os;
|
|
76
|
+
constructor(os: OS);
|
|
77
|
+
/** Get all Second Life accounts linked to the current user */
|
|
78
|
+
getLinkedSecondLifeAccounts(): Promise<SecondLifeAccount[]>;
|
|
79
|
+
/** Unlink a Second Life account from the current user */
|
|
80
|
+
unlinkSecondLifeAccount(avatarUuid: string): Promise<void>;
|
|
81
|
+
/** Generate a linking code for connecting a Second Life account */
|
|
82
|
+
generateLinkingCode(): Promise<LinkingCode>;
|
|
83
|
+
}
|
|
84
|
+
|
|
55
85
|
declare class AppManager {
|
|
56
86
|
private os;
|
|
57
87
|
constructor(os: OS);
|
|
@@ -111,6 +141,7 @@ type OSConfig = {
|
|
|
111
141
|
target: Window;
|
|
112
142
|
};
|
|
113
143
|
declare class OS {
|
|
144
|
+
accounts: AccountManager;
|
|
114
145
|
apps: AppManager;
|
|
115
146
|
prefs: PreferencesManager;
|
|
116
147
|
user: UserManager;
|
|
@@ -122,4 +153,4 @@ declare class OS {
|
|
|
122
153
|
|
|
123
154
|
declare const VERSION = "1.0.0";
|
|
124
155
|
|
|
125
|
-
export { type AppBundleId, type AppDefinition, type AppLaunchResult, OS, type OSConfig, type OperatingSystemAPI, type PhotonUser, type PreferenceValue, type RunningAppInstance, VERSION };
|
|
156
|
+
export { type AppBundleId, type AppDefinition, type AppLaunchResult, type LinkingCode, OS, type OSConfig, type OperatingSystemAPI, type PhotonUser, type PreferenceValue, type RunningAppInstance, type SecondLifeAccount, VERSION };
|
package/dist/index.js
CHANGED
|
@@ -1188,6 +1188,28 @@ module.exports = __toCommonJS(index_exports);
|
|
|
1188
1188
|
// src/framework/OS.ts
|
|
1189
1189
|
var pmrpc = __toESM(require_pm_rpc_min());
|
|
1190
1190
|
|
|
1191
|
+
// src/framework/AccountManager.ts
|
|
1192
|
+
var AccountManager = class {
|
|
1193
|
+
constructor(os) {
|
|
1194
|
+
this.os = os;
|
|
1195
|
+
}
|
|
1196
|
+
/** Get all Second Life accounts linked to the current user */
|
|
1197
|
+
async getLinkedSecondLifeAccounts() {
|
|
1198
|
+
const api2 = await this.os.getRPCAPI();
|
|
1199
|
+
return await api2.accounts_getLinkedSecondLifeAccounts();
|
|
1200
|
+
}
|
|
1201
|
+
/** Unlink a Second Life account from the current user */
|
|
1202
|
+
async unlinkSecondLifeAccount(avatarUuid) {
|
|
1203
|
+
const api2 = await this.os.getRPCAPI();
|
|
1204
|
+
await api2.accounts_unlinkSecondLifeAccount(avatarUuid);
|
|
1205
|
+
}
|
|
1206
|
+
/** Generate a linking code for connecting a Second Life account */
|
|
1207
|
+
async generateLinkingCode() {
|
|
1208
|
+
const api2 = await this.os.getRPCAPI();
|
|
1209
|
+
return await api2.accounts_generateLinkingCode();
|
|
1210
|
+
}
|
|
1211
|
+
};
|
|
1212
|
+
|
|
1191
1213
|
// src/framework/AppManager.ts
|
|
1192
1214
|
var AppManager = class {
|
|
1193
1215
|
constructor(os) {
|
|
@@ -1280,6 +1302,7 @@ var UserManager = class {
|
|
|
1280
1302
|
var OS = class {
|
|
1281
1303
|
constructor(config = { target: window.parent }) {
|
|
1282
1304
|
this.config = config;
|
|
1305
|
+
this.accounts = new AccountManager(this);
|
|
1283
1306
|
this.apps = new AppManager(this);
|
|
1284
1307
|
this.prefs = new PreferencesManager(this);
|
|
1285
1308
|
this.user = new UserManager(this);
|