@blocklet/js-sdk 1.17.8-beta-20260119-034126-467341b7 → 1.17.8-beta-20260121-102603-f9d0176f
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 +386 -304
- package/dist/index.mjs +698 -850
- package/dist/index.mjs.map +1 -0
- package/package.json +20 -13
- package/dist/index.d.ts +0 -360
package/dist/index.d.mts
CHANGED
|
@@ -1,360 +1,442 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { TComponentInternalInfo } from
|
|
6
|
-
import { BlockletStatus } from
|
|
1
|
+
import { USER_SESSION_STATUS } from "@abtnode/constant";
|
|
2
|
+
import * as axios0 from "axios";
|
|
3
|
+
import { Axios, AxiosRequestConfig } from "axios";
|
|
4
|
+
import { TNavigationItem, TTheme } from "@blocklet/meta/lib/types";
|
|
5
|
+
import { TComponentInternalInfo } from "@blocklet/meta/lib/blocklet";
|
|
6
|
+
import { BlockletStatus } from "@blocklet/meta/lib/constants";
|
|
7
7
|
|
|
8
|
+
//#region src/services/token.d.ts
|
|
8
9
|
declare class TokenService {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
getSessionToken(config: any): string;
|
|
11
|
+
setSessionToken(value: string): void;
|
|
12
|
+
removeSessionToken(): void;
|
|
13
|
+
getRefreshToken(): string;
|
|
14
|
+
setRefreshToken(value: string): void;
|
|
15
|
+
removeRefreshToken(): void;
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/services/auth.d.ts
|
|
17
19
|
type UserPublicInfo = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
avatar: string;
|
|
21
|
+
did: string;
|
|
22
|
+
fullName: string;
|
|
23
|
+
sourceAppPid: string | null;
|
|
22
24
|
};
|
|
23
25
|
type Webhook = {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
type: 'slack' | 'api';
|
|
27
|
+
url: string;
|
|
26
28
|
};
|
|
27
29
|
type NotificationConfig = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
webhooks?: Webhook[];
|
|
31
|
+
notifications?: {
|
|
32
|
+
email?: boolean;
|
|
33
|
+
wallet?: boolean;
|
|
34
|
+
phone?: boolean;
|
|
35
|
+
};
|
|
34
36
|
};
|
|
35
37
|
type PrivacyConfig = {
|
|
36
|
-
|
|
38
|
+
[key: string]: boolean;
|
|
37
39
|
};
|
|
38
40
|
interface SpaceGateway {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
did: string;
|
|
42
|
+
name: string;
|
|
43
|
+
url: string;
|
|
44
|
+
endpoint: string;
|
|
43
45
|
}
|
|
44
46
|
declare enum OrgQueryType {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
OWNED = "owned",
|
|
48
|
+
JOINED = "joined",
|
|
47
49
|
}
|
|
48
50
|
declare class AuthService {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
51
|
+
private api;
|
|
52
|
+
private token;
|
|
53
|
+
constructor({
|
|
54
|
+
api,
|
|
55
|
+
token
|
|
56
|
+
}: {
|
|
57
|
+
api: Axios;
|
|
58
|
+
token: TokenService;
|
|
59
|
+
});
|
|
60
|
+
getUserPublicInfo({
|
|
61
|
+
did
|
|
62
|
+
}: {
|
|
63
|
+
did: string;
|
|
64
|
+
}): Promise<UserPublicInfo>;
|
|
65
|
+
getUserPrivacyConfig({
|
|
66
|
+
did
|
|
67
|
+
}: {
|
|
68
|
+
did: string;
|
|
69
|
+
}): Promise<PrivacyConfig>;
|
|
70
|
+
saveUserPrivacyConfig(config: PrivacyConfig): Promise<PrivacyConfig>;
|
|
71
|
+
getUserNotificationConfig(): Promise<NotificationConfig>;
|
|
72
|
+
saveUserNotificationConfig(config: NotificationConfig): Promise<NotificationConfig>;
|
|
73
|
+
testNotificationWebhook(webhook: Webhook): Promise<{
|
|
74
|
+
success: boolean;
|
|
75
|
+
}>;
|
|
76
|
+
getProfileUrl({
|
|
77
|
+
did,
|
|
78
|
+
locale
|
|
79
|
+
}: {
|
|
80
|
+
did: string;
|
|
81
|
+
locale: string;
|
|
82
|
+
}): Promise<string>;
|
|
83
|
+
getProfile(): Promise<any>;
|
|
84
|
+
refreshProfile(): Promise<void>;
|
|
85
|
+
followUser({
|
|
86
|
+
userDid
|
|
87
|
+
}: {
|
|
88
|
+
userDid: string;
|
|
89
|
+
}): Promise<void>;
|
|
90
|
+
unfollowUser({
|
|
91
|
+
userDid
|
|
92
|
+
}: {
|
|
93
|
+
userDid: string;
|
|
94
|
+
}): Promise<void>;
|
|
95
|
+
isFollowingUser({
|
|
96
|
+
userDid
|
|
97
|
+
}: {
|
|
98
|
+
userDid: string;
|
|
99
|
+
}): Promise<boolean>;
|
|
100
|
+
saveProfile({
|
|
101
|
+
locale,
|
|
102
|
+
inviter,
|
|
103
|
+
metadata,
|
|
104
|
+
address
|
|
105
|
+
}: {
|
|
106
|
+
locale?: string;
|
|
107
|
+
inviter?: string;
|
|
108
|
+
metadata?: any;
|
|
109
|
+
address?: any;
|
|
110
|
+
}): Promise<any>;
|
|
111
|
+
updateDidSpace({
|
|
112
|
+
spaceGateway
|
|
113
|
+
}: {
|
|
114
|
+
spaceGateway: SpaceGateway;
|
|
115
|
+
}): Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* 指定要退出登录的设备 id
|
|
118
|
+
* 指定要退出登录的会话状态
|
|
119
|
+
* @param {{ visitorId: string, status: string }} { visitorId, status }
|
|
120
|
+
* @return {Promise<void>}
|
|
121
|
+
*/
|
|
122
|
+
logout({
|
|
123
|
+
visitorId,
|
|
124
|
+
status,
|
|
125
|
+
includeFederated
|
|
126
|
+
}: {
|
|
127
|
+
visitorId?: string;
|
|
128
|
+
status?: string;
|
|
129
|
+
includeFederated?: boolean;
|
|
130
|
+
}): Promise<void>;
|
|
131
|
+
/**
|
|
132
|
+
* 删除当前登录用户
|
|
133
|
+
* @return {Promise<{did: string}>}
|
|
134
|
+
*/
|
|
135
|
+
destroyMyself(): Promise<{
|
|
136
|
+
did: string;
|
|
137
|
+
}>;
|
|
138
|
+
/**
|
|
139
|
+
* org 相关
|
|
140
|
+
*/
|
|
141
|
+
getOrgs({
|
|
142
|
+
search,
|
|
143
|
+
type,
|
|
144
|
+
page,
|
|
145
|
+
pageSize
|
|
146
|
+
}: {
|
|
147
|
+
search?: string;
|
|
148
|
+
page: number;
|
|
149
|
+
pageSize: number;
|
|
150
|
+
type?: OrgQueryType | '';
|
|
151
|
+
}): Promise<any>;
|
|
152
|
+
getOrg(orgId: string): Promise<any>;
|
|
153
|
+
createOrg(org: any): Promise<any>;
|
|
154
|
+
getRole(name: string): Promise<any>;
|
|
155
|
+
addResourceToOrg({
|
|
156
|
+
orgId,
|
|
157
|
+
resourceId,
|
|
158
|
+
type,
|
|
159
|
+
metadata
|
|
160
|
+
}: {
|
|
161
|
+
orgId: string;
|
|
162
|
+
resourceId: string;
|
|
163
|
+
type?: string;
|
|
164
|
+
metadata?: any;
|
|
165
|
+
}): Promise<any>;
|
|
166
|
+
migrateResourceToOrg({
|
|
167
|
+
form,
|
|
168
|
+
to,
|
|
169
|
+
resourceId
|
|
170
|
+
}: {
|
|
171
|
+
form: string;
|
|
172
|
+
to: string;
|
|
173
|
+
resourceId: string;
|
|
174
|
+
}): Promise<any>;
|
|
132
175
|
}
|
|
133
|
-
|
|
176
|
+
//#endregion
|
|
177
|
+
//#region src/types/index.d.ts
|
|
178
|
+
/**
|
|
179
|
+
* 签名验证函数类型
|
|
180
|
+
* @param data - 待验证的数据(JSON 字符串)
|
|
181
|
+
* @param signature - 签名值
|
|
182
|
+
* @param appPk - 应用公钥
|
|
183
|
+
* @param appId - 应用 DID
|
|
184
|
+
* @returns 验证结果,支持同步或异步
|
|
185
|
+
*/
|
|
186
|
+
type VerifyFn = (data: string, signature: string, appPk: string, appId: string) => boolean | Promise<boolean>;
|
|
134
187
|
type RequestParams = {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
188
|
+
lazy?: boolean;
|
|
189
|
+
lazyTime?: number;
|
|
190
|
+
componentDid?: string;
|
|
191
|
+
verifyFn?: VerifyFn;
|
|
138
192
|
};
|
|
139
193
|
type BlockletComponent = TComponentInternalInfo & {
|
|
140
|
-
|
|
194
|
+
status: keyof typeof BlockletStatus;
|
|
141
195
|
};
|
|
142
196
|
type BlockletSettings = {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
};
|
|
157
|
-
config: Record<string, any>;
|
|
197
|
+
session: {
|
|
198
|
+
ttl: number;
|
|
199
|
+
cacheTtl: number;
|
|
200
|
+
};
|
|
201
|
+
federated: {
|
|
202
|
+
master: {
|
|
203
|
+
appId: string;
|
|
204
|
+
appPid: string;
|
|
205
|
+
appName: string;
|
|
206
|
+
appDescription: string;
|
|
207
|
+
appUrl: string;
|
|
208
|
+
appLogo: string;
|
|
209
|
+
version: string;
|
|
158
210
|
};
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
211
|
+
config: Record<string, any>;
|
|
212
|
+
};
|
|
213
|
+
oauth: Record<string, {
|
|
214
|
+
enabled: boolean;
|
|
215
|
+
[x: string]: any;
|
|
216
|
+
}>;
|
|
163
217
|
};
|
|
164
218
|
type Blocklet = {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
219
|
+
[x: string]: any;
|
|
220
|
+
did: string;
|
|
221
|
+
appId: string;
|
|
222
|
+
appPk: string;
|
|
223
|
+
appIds?: string[];
|
|
224
|
+
appPid: string;
|
|
225
|
+
appName: string;
|
|
226
|
+
appDescription: string;
|
|
227
|
+
appLogo: string;
|
|
228
|
+
appLogoRect: string;
|
|
229
|
+
appUrl: string;
|
|
230
|
+
domainAliases?: string[];
|
|
231
|
+
isComponent: boolean;
|
|
232
|
+
prefix: string;
|
|
233
|
+
groupPrefix: string;
|
|
234
|
+
pageGroup: string;
|
|
235
|
+
version: string;
|
|
236
|
+
mode: string;
|
|
237
|
+
tenantMode: 'single' | 'multiple';
|
|
238
|
+
theme: TTheme;
|
|
239
|
+
navigation: TNavigationItem[];
|
|
240
|
+
preferences: Record<string, any>;
|
|
241
|
+
languages: {
|
|
242
|
+
code: string;
|
|
243
|
+
name: string;
|
|
244
|
+
}[];
|
|
245
|
+
passportColor: string;
|
|
246
|
+
componentMountPoints: BlockletComponent[];
|
|
247
|
+
alsoKnownAs: string[];
|
|
248
|
+
trustedFactories: string[];
|
|
249
|
+
status: string;
|
|
250
|
+
serverDid: string;
|
|
251
|
+
serverVersion: string;
|
|
252
|
+
componentId: string;
|
|
253
|
+
webWalletUrl: string;
|
|
254
|
+
updatedAt: number;
|
|
255
|
+
settings: BlockletSettings;
|
|
202
256
|
};
|
|
203
|
-
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region src/services/blocklet.d.ts
|
|
204
259
|
declare class BlockletService {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
260
|
+
getBlocklet(): Blocklet;
|
|
261
|
+
getBlocklet(baseUrl?: string, force?: boolean): Promise<Blocklet>;
|
|
262
|
+
loadBlocklet(): Promise<void>;
|
|
263
|
+
getPrefix(blocklet?: Blocklet): any;
|
|
209
264
|
}
|
|
210
|
-
|
|
265
|
+
//#endregion
|
|
266
|
+
//#region src/services/user-session.d.ts
|
|
211
267
|
type UserSessionUser = {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
268
|
+
avatar: string;
|
|
269
|
+
did: string;
|
|
270
|
+
email: string;
|
|
271
|
+
fullName: string;
|
|
272
|
+
pk: string;
|
|
273
|
+
remark?: string;
|
|
274
|
+
role: string;
|
|
275
|
+
roleTitle: string;
|
|
276
|
+
sourceAppPid: string | null;
|
|
277
|
+
sourceProvider: 'wallet' | 'auth0' | 'nft';
|
|
222
278
|
};
|
|
223
279
|
type UserSession = {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
280
|
+
appName: string;
|
|
281
|
+
appPid: string;
|
|
282
|
+
extra: {
|
|
283
|
+
walletOS: 'android' | 'ios' | 'web';
|
|
284
|
+
};
|
|
285
|
+
id: string;
|
|
286
|
+
lastLoginIp: string;
|
|
287
|
+
passportId: string | null;
|
|
288
|
+
ua: string;
|
|
289
|
+
createdAt?: string;
|
|
290
|
+
updatedAt: string;
|
|
291
|
+
status?: string;
|
|
292
|
+
user?: UserSessionUser;
|
|
293
|
+
userDid: string;
|
|
294
|
+
visitorId: string;
|
|
239
295
|
};
|
|
240
296
|
type UserSessionList = {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
page: number;
|
|
244
|
-
pageSize: number;
|
|
245
|
-
total: number;
|
|
246
|
-
};
|
|
247
|
-
};
|
|
248
|
-
type UserSessionQuery = {
|
|
297
|
+
list: UserSession[];
|
|
298
|
+
paging: {
|
|
249
299
|
page: number;
|
|
250
300
|
pageSize: number;
|
|
251
|
-
|
|
301
|
+
total: number;
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
type UserSessionQuery = {
|
|
305
|
+
page: number;
|
|
306
|
+
pageSize: number;
|
|
307
|
+
status?: USER_SESSION_STATUS.ONLINE | USER_SESSION_STATUS.EXPIRED | USER_SESSION_STATUS.OFFLINE;
|
|
252
308
|
};
|
|
253
309
|
declare class UserSessionService {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
310
|
+
private api;
|
|
311
|
+
private blocklet;
|
|
312
|
+
constructor({
|
|
313
|
+
api,
|
|
314
|
+
blocklet
|
|
315
|
+
}: {
|
|
316
|
+
api: Axios;
|
|
317
|
+
blocklet?: BlockletService;
|
|
318
|
+
});
|
|
319
|
+
getBaseUrl(appUrl?: string): string | undefined;
|
|
320
|
+
getUserSessions({
|
|
321
|
+
did,
|
|
322
|
+
appUrl
|
|
323
|
+
}: {
|
|
324
|
+
did: string;
|
|
325
|
+
appUrl?: string;
|
|
326
|
+
}): Promise<UserSession[]>;
|
|
327
|
+
/**
|
|
328
|
+
* 获取个人的所有登录会话
|
|
329
|
+
*/
|
|
330
|
+
getMyLoginSessions({
|
|
331
|
+
appUrl
|
|
332
|
+
}?: {
|
|
333
|
+
appUrl?: string;
|
|
334
|
+
}, params?: UserSessionQuery): Promise<UserSessionList>;
|
|
335
|
+
loginByUserSession({
|
|
336
|
+
id,
|
|
337
|
+
appPid,
|
|
338
|
+
userDid,
|
|
339
|
+
passportId,
|
|
340
|
+
appUrl
|
|
341
|
+
}: {
|
|
342
|
+
appPid: string;
|
|
343
|
+
userDid: string;
|
|
344
|
+
id: string;
|
|
345
|
+
passportId: string;
|
|
346
|
+
appUrl?: string;
|
|
347
|
+
}): Promise<UserSession[]>;
|
|
278
348
|
}
|
|
279
|
-
|
|
349
|
+
//#endregion
|
|
350
|
+
//#region src/services/component.d.ts
|
|
280
351
|
declare class ComponentService {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
352
|
+
private blocklet;
|
|
353
|
+
constructor({
|
|
354
|
+
blocklet
|
|
355
|
+
}?: {
|
|
356
|
+
blocklet?: Blocklet;
|
|
357
|
+
});
|
|
358
|
+
getComponent(name: string): never;
|
|
359
|
+
getComponentMountPoint(name?: string): string;
|
|
360
|
+
getUrl(name: string, ...parts: string[]): string;
|
|
288
361
|
}
|
|
289
|
-
|
|
362
|
+
//#endregion
|
|
363
|
+
//#region src/services/federated.d.ts
|
|
290
364
|
type AppInfo = {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
365
|
+
appId: string;
|
|
366
|
+
appName: string;
|
|
367
|
+
appDescription: string;
|
|
368
|
+
appLogo: string;
|
|
369
|
+
appPid: string;
|
|
370
|
+
appUrl: string;
|
|
371
|
+
version: string;
|
|
372
|
+
sourceAppPid: string;
|
|
373
|
+
provider: string;
|
|
300
374
|
};
|
|
301
375
|
type ServerInfo = {
|
|
376
|
+
appId: string;
|
|
377
|
+
appName: string;
|
|
378
|
+
appDescription: string;
|
|
379
|
+
appUrl: string;
|
|
380
|
+
sourceAppPid: string;
|
|
381
|
+
provider: string;
|
|
382
|
+
type: 'server';
|
|
383
|
+
};
|
|
384
|
+
declare class FederatedService {
|
|
385
|
+
private api;
|
|
386
|
+
private blocklet;
|
|
387
|
+
private blockletDataCache;
|
|
388
|
+
constructor({
|
|
389
|
+
api,
|
|
390
|
+
blocklet
|
|
391
|
+
}: {
|
|
392
|
+
api: Axios;
|
|
393
|
+
blocklet?: BlockletService;
|
|
394
|
+
});
|
|
395
|
+
getTrustedDomains(): Promise<Array<string>>;
|
|
396
|
+
getMaster(blocklet?: Blocklet): {
|
|
302
397
|
appId: string;
|
|
398
|
+
appPid: string;
|
|
303
399
|
appName: string;
|
|
304
400
|
appDescription: string;
|
|
305
401
|
appUrl: string;
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
blocklet?: BlockletService;
|
|
317
|
-
});
|
|
318
|
-
getTrustedDomains(): Promise<Array<string>>;
|
|
319
|
-
getMaster(blocklet?: Blocklet): {
|
|
320
|
-
appId: string;
|
|
321
|
-
appPid: string;
|
|
322
|
-
appName: string;
|
|
323
|
-
appDescription: string;
|
|
324
|
-
appUrl: string;
|
|
325
|
-
appLogo: string;
|
|
326
|
-
version: string;
|
|
327
|
-
};
|
|
328
|
-
getConfig(blocklet?: Blocklet): Record<string, any>;
|
|
329
|
-
getFederatedEnabled(blocklet?: Blocklet): boolean;
|
|
330
|
-
getSourceAppPid(blocklet?: Blocklet): string;
|
|
331
|
-
getFederatedApp(blocklet?: Blocklet): AppInfo | null;
|
|
332
|
-
getCurrentApp(blocklet?: Blocklet): AppInfo | ServerInfo;
|
|
333
|
-
getApps(blocklet?: Blocklet): any[];
|
|
334
|
-
getBlockletData(appUrl: string, force?: boolean): Promise<any>;
|
|
402
|
+
appLogo: string;
|
|
403
|
+
version: string;
|
|
404
|
+
};
|
|
405
|
+
getConfig(blocklet?: Blocklet): Record<string, any>;
|
|
406
|
+
getFederatedEnabled(blocklet?: Blocklet): boolean;
|
|
407
|
+
getSourceAppPid(blocklet?: Blocklet): string;
|
|
408
|
+
getFederatedApp(blocklet?: Blocklet): AppInfo | null;
|
|
409
|
+
getCurrentApp(blocklet?: Blocklet): AppInfo | ServerInfo;
|
|
410
|
+
getApps(blocklet?: Blocklet): any[];
|
|
411
|
+
getBlockletData(appUrl: string, force?: boolean): Promise<any>;
|
|
335
412
|
}
|
|
336
|
-
|
|
413
|
+
//#endregion
|
|
414
|
+
//#region src/libs/csrf.d.ts
|
|
337
415
|
declare function getCSRFToken(): string;
|
|
338
416
|
declare function getLoginToken(): string;
|
|
339
417
|
declare function getCSRFTokenByLoginToken(): Promise<{
|
|
340
|
-
|
|
341
|
-
|
|
418
|
+
loginToken: string;
|
|
419
|
+
csrfToken: string | null;
|
|
342
420
|
}>;
|
|
343
|
-
|
|
421
|
+
//#endregion
|
|
422
|
+
//#region src/index.d.ts
|
|
423
|
+
interface BlockletSDKOptions {
|
|
424
|
+
verifyFn?: VerifyFn;
|
|
425
|
+
}
|
|
344
426
|
declare class BlockletSDK {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
427
|
+
api: Axios;
|
|
428
|
+
user: AuthService;
|
|
429
|
+
userSession: UserSessionService;
|
|
430
|
+
token: TokenService;
|
|
431
|
+
blocklet: BlockletService;
|
|
432
|
+
federated: FederatedService;
|
|
433
|
+
constructor(options?: BlockletSDKOptions);
|
|
352
434
|
}
|
|
353
|
-
declare function createAxios(config?: AxiosRequestConfig, requestParams?: RequestParams):
|
|
435
|
+
declare function createAxios(config?: AxiosRequestConfig, requestParams?: RequestParams): axios0.AxiosInstance;
|
|
354
436
|
declare function createFetch(options?: RequestInit, requestParams?: RequestParams): (input: string | Request | URL, options?: RequestInit & {
|
|
355
|
-
|
|
437
|
+
secure?: boolean;
|
|
356
438
|
}) => Promise<Response>;
|
|
357
|
-
declare const getBlockletSDK: () => BlockletSDK;
|
|
358
|
-
|
|
359
|
-
export { AuthService, BlockletSDK, BlockletService, ComponentService, FederatedService, OrgQueryType, TokenService, UserSessionService, createAxios, createFetch, getBlockletSDK, getCSRFToken, getCSRFTokenByLoginToken, getLoginToken };
|
|
360
|
-
|
|
439
|
+
declare const getBlockletSDK: (options?: BlockletSDKOptions) => BlockletSDK;
|
|
440
|
+
//#endregion
|
|
441
|
+
export { AuthService, BlockletSDK, BlockletSDKOptions, BlockletService, ComponentService, FederatedService, NotificationConfig, OrgQueryType, PrivacyConfig, SpaceGateway, TokenService, UserPublicInfo, UserSession, UserSessionList, UserSessionQuery, UserSessionService, UserSessionUser, type VerifyFn, Webhook, createAxios, createFetch, getBlockletSDK, getCSRFToken, getCSRFTokenByLoginToken, getLoginToken };
|
|
442
|
+
//# sourceMappingURL=index.d.mts.map
|