@blocklet/js-sdk 1.16.34-beta-20241129-100152-679bd732 → 1.16.34-beta-20241205-145120-3a7aa096
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 +57 -3
- package/dist/index.d.ts +57 -3
- package/dist/index.mjs +1130 -25
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -169,6 +169,7 @@ type Blocklet = {
|
|
|
169
169
|
};
|
|
170
170
|
|
|
171
171
|
declare class BlockletService {
|
|
172
|
+
getBlocklet(): Blocklet;
|
|
172
173
|
getBlocklet(baseUrl?: string, force?: boolean): Promise<Blocklet>;
|
|
173
174
|
loadBlocklet(): Promise<void>;
|
|
174
175
|
getPrefix(blocklet?: Blocklet): string;
|
|
@@ -215,10 +216,16 @@ declare class UserSessionService {
|
|
|
215
216
|
did: string;
|
|
216
217
|
appUrl?: string;
|
|
217
218
|
}): Promise<UserSession[]>;
|
|
218
|
-
|
|
219
|
+
/**
|
|
220
|
+
* 获取个人的所有登录会话
|
|
221
|
+
*/
|
|
222
|
+
getMyLoginSessions({ appUrl }?: {
|
|
223
|
+
appUrl?: string;
|
|
224
|
+
}): Promise<UserSession[]>;
|
|
225
|
+
loginByUserSession({ id, appPid, userDid, passportId, appUrl, }: {
|
|
219
226
|
appPid: string;
|
|
220
227
|
userDid: string;
|
|
221
|
-
|
|
228
|
+
id: string;
|
|
222
229
|
passportId: string;
|
|
223
230
|
appUrl?: string;
|
|
224
231
|
}): Promise<UserSession[]>;
|
|
@@ -234,6 +241,52 @@ declare class ComponentService {
|
|
|
234
241
|
getUrl(name: string, ...parts: string[]): string;
|
|
235
242
|
}
|
|
236
243
|
|
|
244
|
+
type AppInfo = {
|
|
245
|
+
appId: string;
|
|
246
|
+
appName: string;
|
|
247
|
+
appDescription: string;
|
|
248
|
+
appLogo: string;
|
|
249
|
+
appPid: string;
|
|
250
|
+
appUrl: string;
|
|
251
|
+
version: string;
|
|
252
|
+
sourceAppPid: string;
|
|
253
|
+
provider: string;
|
|
254
|
+
};
|
|
255
|
+
type ServerInfo = {
|
|
256
|
+
appId: string;
|
|
257
|
+
appName: string;
|
|
258
|
+
appDescription: string;
|
|
259
|
+
appUrl: string;
|
|
260
|
+
sourceAppPid: string;
|
|
261
|
+
provider: string;
|
|
262
|
+
type: 'server';
|
|
263
|
+
};
|
|
264
|
+
declare class FederatedService {
|
|
265
|
+
private api;
|
|
266
|
+
private blocklet;
|
|
267
|
+
constructor({ api, blocklet }: {
|
|
268
|
+
api: Axios;
|
|
269
|
+
blocklet?: BlockletService;
|
|
270
|
+
});
|
|
271
|
+
getTrustedDomains(): Promise<Array<string>>;
|
|
272
|
+
getMaster(blocklet?: Blocklet): {
|
|
273
|
+
appId: string;
|
|
274
|
+
appPid: string;
|
|
275
|
+
appName: string;
|
|
276
|
+
appDescription: string;
|
|
277
|
+
appUrl: string;
|
|
278
|
+
appLogo: string;
|
|
279
|
+
version: string;
|
|
280
|
+
};
|
|
281
|
+
getConfig(blocklet?: Blocklet): Record<string, any>;
|
|
282
|
+
getFederatedEnabled(blocklet?: Blocklet): boolean;
|
|
283
|
+
getSourceAppPid(blocklet?: Blocklet): string;
|
|
284
|
+
getFederatedApp(blocklet?: Blocklet): AppInfo | null;
|
|
285
|
+
getCurrentApp(blocklet?: Blocklet): AppInfo | ServerInfo;
|
|
286
|
+
getApps(blocklet?: Blocklet): (AppInfo | ServerInfo)[];
|
|
287
|
+
getBlockletData(appUrl: string): Promise<any>;
|
|
288
|
+
}
|
|
289
|
+
|
|
237
290
|
declare function getCSRFToken(): string;
|
|
238
291
|
|
|
239
292
|
declare class BlockletSDK {
|
|
@@ -242,10 +295,11 @@ declare class BlockletSDK {
|
|
|
242
295
|
userSession: UserSessionService;
|
|
243
296
|
token: TokenService;
|
|
244
297
|
blocklet: BlockletService;
|
|
298
|
+
federated: FederatedService;
|
|
245
299
|
constructor();
|
|
246
300
|
}
|
|
247
301
|
declare function createAxios(config?: AxiosRequestConfig, requestParams?: RequestParams): axios.AxiosInstance;
|
|
248
302
|
declare function createFetch(options?: RequestInit, requestParams?: RequestParams): (input: string | Request | URL, options?: RequestInit) => Promise<Response>;
|
|
249
303
|
declare const getBlockletSDK: () => BlockletSDK;
|
|
250
304
|
|
|
251
|
-
export { AuthService, BlockletSDK, BlockletService, ComponentService, type NotificationConfig, type PrivacyConfig, type SpaceGateway, TokenService, type UserPublicInfo, type UserSession, UserSessionService, type UserSessionUser, type Webhook, createAxios, createFetch, getBlockletSDK, getCSRFToken };
|
|
305
|
+
export { AuthService, BlockletSDK, BlockletService, ComponentService, FederatedService, type NotificationConfig, type PrivacyConfig, type SpaceGateway, TokenService, type UserPublicInfo, type UserSession, UserSessionService, type UserSessionUser, type Webhook, createAxios, createFetch, getBlockletSDK, getCSRFToken };
|
package/dist/index.d.ts
CHANGED
|
@@ -169,6 +169,7 @@ type Blocklet = {
|
|
|
169
169
|
};
|
|
170
170
|
|
|
171
171
|
declare class BlockletService {
|
|
172
|
+
getBlocklet(): Blocklet;
|
|
172
173
|
getBlocklet(baseUrl?: string, force?: boolean): Promise<Blocklet>;
|
|
173
174
|
loadBlocklet(): Promise<void>;
|
|
174
175
|
getPrefix(blocklet?: Blocklet): string;
|
|
@@ -215,10 +216,16 @@ declare class UserSessionService {
|
|
|
215
216
|
did: string;
|
|
216
217
|
appUrl?: string;
|
|
217
218
|
}): Promise<UserSession[]>;
|
|
218
|
-
|
|
219
|
+
/**
|
|
220
|
+
* 获取个人的所有登录会话
|
|
221
|
+
*/
|
|
222
|
+
getMyLoginSessions({ appUrl }?: {
|
|
223
|
+
appUrl?: string;
|
|
224
|
+
}): Promise<UserSession[]>;
|
|
225
|
+
loginByUserSession({ id, appPid, userDid, passportId, appUrl, }: {
|
|
219
226
|
appPid: string;
|
|
220
227
|
userDid: string;
|
|
221
|
-
|
|
228
|
+
id: string;
|
|
222
229
|
passportId: string;
|
|
223
230
|
appUrl?: string;
|
|
224
231
|
}): Promise<UserSession[]>;
|
|
@@ -234,6 +241,52 @@ declare class ComponentService {
|
|
|
234
241
|
getUrl(name: string, ...parts: string[]): string;
|
|
235
242
|
}
|
|
236
243
|
|
|
244
|
+
type AppInfo = {
|
|
245
|
+
appId: string;
|
|
246
|
+
appName: string;
|
|
247
|
+
appDescription: string;
|
|
248
|
+
appLogo: string;
|
|
249
|
+
appPid: string;
|
|
250
|
+
appUrl: string;
|
|
251
|
+
version: string;
|
|
252
|
+
sourceAppPid: string;
|
|
253
|
+
provider: string;
|
|
254
|
+
};
|
|
255
|
+
type ServerInfo = {
|
|
256
|
+
appId: string;
|
|
257
|
+
appName: string;
|
|
258
|
+
appDescription: string;
|
|
259
|
+
appUrl: string;
|
|
260
|
+
sourceAppPid: string;
|
|
261
|
+
provider: string;
|
|
262
|
+
type: 'server';
|
|
263
|
+
};
|
|
264
|
+
declare class FederatedService {
|
|
265
|
+
private api;
|
|
266
|
+
private blocklet;
|
|
267
|
+
constructor({ api, blocklet }: {
|
|
268
|
+
api: Axios;
|
|
269
|
+
blocklet?: BlockletService;
|
|
270
|
+
});
|
|
271
|
+
getTrustedDomains(): Promise<Array<string>>;
|
|
272
|
+
getMaster(blocklet?: Blocklet): {
|
|
273
|
+
appId: string;
|
|
274
|
+
appPid: string;
|
|
275
|
+
appName: string;
|
|
276
|
+
appDescription: string;
|
|
277
|
+
appUrl: string;
|
|
278
|
+
appLogo: string;
|
|
279
|
+
version: string;
|
|
280
|
+
};
|
|
281
|
+
getConfig(blocklet?: Blocklet): Record<string, any>;
|
|
282
|
+
getFederatedEnabled(blocklet?: Blocklet): boolean;
|
|
283
|
+
getSourceAppPid(blocklet?: Blocklet): string;
|
|
284
|
+
getFederatedApp(blocklet?: Blocklet): AppInfo | null;
|
|
285
|
+
getCurrentApp(blocklet?: Blocklet): AppInfo | ServerInfo;
|
|
286
|
+
getApps(blocklet?: Blocklet): (AppInfo | ServerInfo)[];
|
|
287
|
+
getBlockletData(appUrl: string): Promise<any>;
|
|
288
|
+
}
|
|
289
|
+
|
|
237
290
|
declare function getCSRFToken(): string;
|
|
238
291
|
|
|
239
292
|
declare class BlockletSDK {
|
|
@@ -242,10 +295,11 @@ declare class BlockletSDK {
|
|
|
242
295
|
userSession: UserSessionService;
|
|
243
296
|
token: TokenService;
|
|
244
297
|
blocklet: BlockletService;
|
|
298
|
+
federated: FederatedService;
|
|
245
299
|
constructor();
|
|
246
300
|
}
|
|
247
301
|
declare function createAxios(config?: AxiosRequestConfig, requestParams?: RequestParams): axios.AxiosInstance;
|
|
248
302
|
declare function createFetch(options?: RequestInit, requestParams?: RequestParams): (input: string | Request | URL, options?: RequestInit) => Promise<Response>;
|
|
249
303
|
declare const getBlockletSDK: () => BlockletSDK;
|
|
250
304
|
|
|
251
|
-
export { AuthService, BlockletSDK, BlockletService, ComponentService, type NotificationConfig, type PrivacyConfig, type SpaceGateway, TokenService, type UserPublicInfo, type UserSession, UserSessionService, type UserSessionUser, type Webhook, createAxios, createFetch, getBlockletSDK, getCSRFToken };
|
|
305
|
+
export { AuthService, BlockletSDK, BlockletService, ComponentService, FederatedService, type NotificationConfig, type PrivacyConfig, type SpaceGateway, TokenService, type UserPublicInfo, type UserSession, UserSessionService, type UserSessionUser, type Webhook, createAxios, createFetch, getBlockletSDK, getCSRFToken };
|