@abtnode/core 1.17.8-beta-20260108-224855-28496abb → 1.17.8-beta-20260111-112953-aed5ff39

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.
Files changed (66) hide show
  1. package/lib/api/team/access-key-manager.js +104 -0
  2. package/lib/api/team/invitation-manager.js +461 -0
  3. package/lib/api/team/notification-manager.js +189 -0
  4. package/lib/api/team/oauth-manager.js +60 -0
  5. package/lib/api/team/org-crud-manager.js +202 -0
  6. package/lib/api/team/org-manager.js +56 -0
  7. package/lib/api/team/org-member-manager.js +403 -0
  8. package/lib/api/team/org-query-manager.js +126 -0
  9. package/lib/api/team/org-resource-manager.js +186 -0
  10. package/lib/api/team/passport-manager.js +670 -0
  11. package/lib/api/team/rbac-manager.js +335 -0
  12. package/lib/api/team/session-manager.js +540 -0
  13. package/lib/api/team/store-manager.js +198 -0
  14. package/lib/api/team/tag-manager.js +230 -0
  15. package/lib/api/team/user-auth-manager.js +132 -0
  16. package/lib/api/team/user-manager.js +78 -0
  17. package/lib/api/team/user-query-manager.js +299 -0
  18. package/lib/api/team/user-social-manager.js +354 -0
  19. package/lib/api/team/user-update-manager.js +224 -0
  20. package/lib/api/team/verify-code-manager.js +161 -0
  21. package/lib/api/team.js +439 -3287
  22. package/lib/blocklet/manager/disk/auth-manager.js +68 -0
  23. package/lib/blocklet/manager/disk/backup-manager.js +288 -0
  24. package/lib/blocklet/manager/disk/cleanup-manager.js +157 -0
  25. package/lib/blocklet/manager/disk/component-manager.js +83 -0
  26. package/lib/blocklet/manager/disk/config-manager.js +191 -0
  27. package/lib/blocklet/manager/disk/controller-manager.js +64 -0
  28. package/lib/blocklet/manager/disk/delete-reset-manager.js +328 -0
  29. package/lib/blocklet/manager/disk/download-manager.js +96 -0
  30. package/lib/blocklet/manager/disk/env-config-manager.js +311 -0
  31. package/lib/blocklet/manager/disk/federated-manager.js +651 -0
  32. package/lib/blocklet/manager/disk/hook-manager.js +124 -0
  33. package/lib/blocklet/manager/disk/install-component-manager.js +95 -0
  34. package/lib/blocklet/manager/disk/install-core-manager.js +448 -0
  35. package/lib/blocklet/manager/disk/install-download-manager.js +313 -0
  36. package/lib/blocklet/manager/disk/install-manager.js +36 -0
  37. package/lib/blocklet/manager/disk/install-upgrade-manager.js +340 -0
  38. package/lib/blocklet/manager/disk/job-manager.js +467 -0
  39. package/lib/blocklet/manager/disk/lifecycle-manager.js +26 -0
  40. package/lib/blocklet/manager/disk/notification-manager.js +343 -0
  41. package/lib/blocklet/manager/disk/query-manager.js +562 -0
  42. package/lib/blocklet/manager/disk/settings-manager.js +507 -0
  43. package/lib/blocklet/manager/disk/start-manager.js +611 -0
  44. package/lib/blocklet/manager/disk/stop-restart-manager.js +292 -0
  45. package/lib/blocklet/manager/disk/update-manager.js +153 -0
  46. package/lib/blocklet/manager/disk.js +669 -5796
  47. package/lib/blocklet/manager/helper/blue-green-start-blocklet.js +5 -0
  48. package/lib/blocklet/manager/lock.js +18 -0
  49. package/lib/event/index.js +28 -24
  50. package/lib/router/helper.js +5 -1
  51. package/lib/util/blocklet/app-utils.js +192 -0
  52. package/lib/util/blocklet/blocklet-loader.js +258 -0
  53. package/lib/util/blocklet/config-manager.js +232 -0
  54. package/lib/util/blocklet/did-document.js +240 -0
  55. package/lib/util/blocklet/environment.js +555 -0
  56. package/lib/util/blocklet/health-check.js +449 -0
  57. package/lib/util/blocklet/install-utils.js +365 -0
  58. package/lib/util/blocklet/logo.js +57 -0
  59. package/lib/util/blocklet/meta-utils.js +269 -0
  60. package/lib/util/blocklet/port-manager.js +141 -0
  61. package/lib/util/blocklet/process-manager.js +504 -0
  62. package/lib/util/blocklet/runtime-info.js +105 -0
  63. package/lib/util/blocklet/validation.js +418 -0
  64. package/lib/util/blocklet.js +98 -3066
  65. package/lib/util/wallet-app-notification.js +40 -0
  66. package/package.json +22 -22
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Get access keys
3
+ * @param {Object} api - TeamAPI instance
4
+ * @param {Object} params
5
+ * @param {string} params.teamDid - Team DID
6
+ * @param {Object} context
7
+ * @returns {Promise<Object>}
8
+ */
9
+ async function getAccessKeys(api, { teamDid, ...data }, context) {
10
+ const state = await api.getAccessKeyState(teamDid);
11
+ return state.findPaginated(data, context);
12
+ }
13
+
14
+ /**
15
+ * Get access key
16
+ * @param {Object} api - TeamAPI instance
17
+ * @param {Object} params
18
+ * @param {string} params.teamDid - Team DID
19
+ * @param {string} params.accessKeyId - Access key ID
20
+ * @param {Object} context
21
+ * @returns {Promise<Object>}
22
+ */
23
+ async function getAccessKey(api, { teamDid, accessKeyId }, context) {
24
+ const state = await api.getAccessKeyState(teamDid);
25
+ return state.detail({ accessKeyId }, context);
26
+ }
27
+
28
+ /**
29
+ * Create access key
30
+ * @param {Object} api - TeamAPI instance
31
+ * @param {Object} params
32
+ * @param {string} params.teamDid - Team DID
33
+ * @param {Object} context
34
+ * @returns {Promise<Object>}
35
+ */
36
+ async function createAccessKey(api, { teamDid, ...data }, context) {
37
+ const state = await api.getAccessKeyState(teamDid);
38
+ return state.create(Object.assign({ componentDid: teamDid }, data), context);
39
+ }
40
+
41
+ /**
42
+ * Update access key
43
+ * @param {Object} api - TeamAPI instance
44
+ * @param {Object} params
45
+ * @param {string} params.teamDid - Team DID
46
+ * @param {Object} context
47
+ * @returns {Promise<Object>}
48
+ */
49
+ async function updateAccessKey(api, { teamDid, ...data }, context) {
50
+ const state = await api.getAccessKeyState(teamDid);
51
+ return state.update(data, context);
52
+ }
53
+
54
+ /**
55
+ * Delete access key
56
+ * @param {Object} api - TeamAPI instance
57
+ * @param {Object} params
58
+ * @param {string} params.teamDid - Team DID
59
+ * @param {string} params.accessKeyId - Access key ID
60
+ * @param {Object} context
61
+ * @returns {Promise<Object>}
62
+ */
63
+ async function deleteAccessKey(api, { teamDid, accessKeyId }, context) {
64
+ const state = await api.getAccessKeyState(teamDid);
65
+ return state.remove({ accessKeyId }, context);
66
+ }
67
+
68
+ /**
69
+ * Refresh last used
70
+ * @param {Object} api - TeamAPI instance
71
+ * @param {Object} params
72
+ * @param {string} params.teamDid - Team DID
73
+ * @param {string} params.accessKeyId - Access key ID
74
+ * @param {Object} context
75
+ * @returns {Promise<Object>}
76
+ */
77
+ async function refreshLastUsed(api, { teamDid, accessKeyId }, context) {
78
+ const state = await api.getAccessKeyState(teamDid);
79
+ return state.refreshLastUsed(accessKeyId, context);
80
+ }
81
+
82
+ /**
83
+ * Verify access key
84
+ * @param {Object} api - TeamAPI instance
85
+ * @param {Object} params
86
+ * @param {string} params.teamDid - Team DID
87
+ * @param {Object} context
88
+ * @returns {Promise<Object>}
89
+ */
90
+ async function verifyAccessKey(api, { teamDid, ...data }, context) {
91
+ const state = await api.getAccessKeyState(teamDid);
92
+ const accessKey = await state.verify(data, context);
93
+ return accessKey;
94
+ }
95
+
96
+ module.exports = {
97
+ getAccessKeys,
98
+ getAccessKey,
99
+ createAccessKey,
100
+ updateAccessKey,
101
+ deleteAccessKey,
102
+ refreshLastUsed,
103
+ verifyAccessKey,
104
+ };
@@ -0,0 +1,461 @@
1
+ const dayjs = require('@abtnode/util/lib/dayjs');
2
+ const logger = require('@abtnode/logger')('@abtnode/core:api:team:invitation');
3
+ const { CustomError } = require('@blocklet/error');
4
+
5
+ const { validateUserRolePassport } = require('../../util/validate-user-role-passport');
6
+
7
+ /**
8
+ * Format transfer data
9
+ * @param {Object} data - Transfer data
10
+ * @returns {Object}
11
+ */
12
+ const formatTransferData = (data) => ({
13
+ transferId: data.id,
14
+ remark: data.remark || '',
15
+ expireDate: new Date(data.expireDate).toString(),
16
+ appDid: data.appDid,
17
+ status: data.status || '',
18
+ });
19
+
20
+ /**
21
+ * Create member invitation
22
+ * @param {Object} api - TeamAPI instance
23
+ * @param {Object} params
24
+ * @param {string} params.teamDid - Team DID
25
+ * @param {string} params.role - Role name
26
+ * @param {number} params.expireTime - Expire time
27
+ * @param {string} params.remark - Remark
28
+ * @param {string} params.sourceAppPid - Source app PID
29
+ * @param {Object} params.display - Display settings
30
+ * @param {number} params.passportExpireTime - Passport expire time
31
+ * @param {string} params.orgId - Org ID
32
+ * @param {Array} params.inviteUserDids - Invite user DIDs
33
+ * @param {Object} context
34
+ * @param {Function} validatePassportDisplay - Validation function
35
+ * @returns {Promise<Object>}
36
+ */
37
+ async function createMemberInvitation(
38
+ api,
39
+ {
40
+ teamDid,
41
+ role: roleName,
42
+ expireTime,
43
+ remark,
44
+ sourceAppPid,
45
+ display = null,
46
+ passportExpireTime = null,
47
+ orgId = '',
48
+ inviteUserDids = [],
49
+ },
50
+ context,
51
+ { validatePassportDisplay }
52
+ ) {
53
+ await api.teamManager.checkEnablePassportIssuance(teamDid);
54
+
55
+ if (expireTime && expireTime <= 0) {
56
+ throw new Error('Expire time must be greater than 0');
57
+ }
58
+ if (!roleName) {
59
+ throw new Error('Role cannot be empty');
60
+ }
61
+
62
+ if (passportExpireTime && dayjs(passportExpireTime).isBefore(dayjs())) {
63
+ throw new Error('Passport expire time must be greater than current time');
64
+ }
65
+
66
+ const roles = await api.getRoles({ teamDid, orgId });
67
+ const role = roles.find((r) => r.name === roleName);
68
+ if (!role) {
69
+ throw new Error(`Role does not exist: ${roleName}`);
70
+ }
71
+ await validatePassportDisplay(role, display);
72
+
73
+ if (remark && remark.length > 50) {
74
+ throw new Error('Remark length should NOT be more than 50 characters');
75
+ }
76
+
77
+ const { user } = context;
78
+ if (!user || !user.did) {
79
+ throw new Error('Inviter does not exist');
80
+ }
81
+
82
+ // 如果邀请加入组织,则不验证 role 和 passport
83
+ if (!orgId && (user?.role || '').startsWith('blocklet-')) {
84
+ const userInfo = await api.getUser({ teamDid, user });
85
+ validateUserRolePassport({
86
+ role: (user?.role || '').replace('blocklet-', ''),
87
+ passports: userInfo?.passports || [],
88
+ });
89
+ }
90
+
91
+ const expireDate = Date.now() + (expireTime || api.memberInviteExpireTime);
92
+ const state = await api.getSessionState(teamDid);
93
+ const { id: inviteId } = await state.start({
94
+ type: 'invite',
95
+ role: roleName,
96
+ remark,
97
+ expireDate,
98
+ inviter: user,
99
+ teamDid,
100
+ orgId,
101
+ inviteUserDids,
102
+ sourceAppPid,
103
+ display,
104
+ passportExpireTime,
105
+ });
106
+
107
+ logger.info('Create invite member', { role: roleName, user, inviteId, display });
108
+
109
+ return {
110
+ inviteId,
111
+ role: roleName,
112
+ remark,
113
+ expireDate: new Date(expireDate).toString(),
114
+ inviter: user,
115
+ teamDid,
116
+ sourceAppPid,
117
+ display,
118
+ };
119
+ }
120
+
121
+ /**
122
+ * Get invitation
123
+ * @param {Object} api - TeamAPI instance
124
+ * @param {Object} params
125
+ * @param {string} params.teamDid - Team DID
126
+ * @param {string} params.inviteId - Invite ID
127
+ * @returns {Promise<Object|null>}
128
+ */
129
+ async function getInvitation(api, { teamDid, inviteId }) {
130
+ if (!teamDid || !inviteId) {
131
+ return null;
132
+ }
133
+
134
+ const state = await api.getSessionState(teamDid);
135
+ const invitation = await state.read(inviteId);
136
+ if (!invitation) {
137
+ return null;
138
+ }
139
+
140
+ return {
141
+ inviteId: invitation.id,
142
+ role: invitation.role,
143
+ remark: invitation.remark,
144
+ expireDate: new Date(invitation.expireDate).toString(),
145
+ inviter: invitation.inviter,
146
+ teamDid: invitation.teamDid,
147
+ status: invitation.status,
148
+ receiver: invitation.receiver,
149
+ sourceAppPid: invitation.sourceAppPid || null,
150
+ display: invitation.display || null,
151
+ orgId: invitation.orgId || null,
152
+ inviteUserDids: invitation.inviteUserDids || [],
153
+ passportExpireTime: invitation.passportExpireTime || null,
154
+ };
155
+ }
156
+
157
+ /**
158
+ * Get invitations
159
+ * @param {Object} api - TeamAPI instance
160
+ * @param {Object} params
161
+ * @param {string} params.teamDid - Team DID
162
+ * @param {Function} params.filter - Filter function
163
+ * @param {string} params.orgId - Org ID
164
+ * @param {Object} context
165
+ * @returns {Promise<Array>}
166
+ */
167
+ async function getInvitations(api, { teamDid, filter, orgId = '' }, context = {}) {
168
+ const state = await api.getSessionState(teamDid);
169
+ let invitations = [];
170
+ if (orgId) {
171
+ const org = await api.getOrg({ teamDid, id: orgId }, context);
172
+ const { user } = context;
173
+ if (!org) {
174
+ throw new CustomError(404, `Org does not exist: ${orgId}`);
175
+ }
176
+ if (org.ownerDid !== user?.did) {
177
+ throw new CustomError(403, `You are not the owner of the org: ${orgId}`);
178
+ }
179
+ }
180
+ const query = { type: 'invite' };
181
+ if (orgId) {
182
+ query['__data.orgId'] = orgId;
183
+ } else {
184
+ query.$or = [{ '__data.orgId': { $exists: false } }, { '__data.orgId': '' }];
185
+ }
186
+ invitations = await state.find(query);
187
+
188
+ return invitations.filter(filter || ((x) => x.status !== 'success')).map((d) => ({
189
+ inviteId: d.id,
190
+ role: d.role,
191
+ remark: d.remark,
192
+ expireDate: new Date(d.expireDate).toString(),
193
+ inviter: d.inviter,
194
+ teamDid: d.teamDid,
195
+ status: d.status,
196
+ receiver: d.receiver,
197
+ sourceAppPid: d.sourceAppPid || null,
198
+ display: d.display || null,
199
+ orgId: d.orgId || null,
200
+ inviteUserDids: d.inviteUserDids || [],
201
+ passportExpireTime: d.passportExpireTime || null,
202
+ }));
203
+ }
204
+
205
+ /**
206
+ * Delete invitation
207
+ * @param {Object} api - TeamAPI instance
208
+ * @param {Object} params
209
+ * @param {string} params.teamDid - Team DID
210
+ * @param {string} params.inviteId - Invite ID
211
+ * @returns {Promise<boolean>}
212
+ */
213
+ async function deleteInvitation(api, { teamDid, inviteId }) {
214
+ if (!inviteId) {
215
+ throw new Error('InviteId cannot be empty');
216
+ }
217
+
218
+ const state = await api.getSessionState(teamDid);
219
+ await state.end(inviteId);
220
+
221
+ logger.info('Delete invite session', { inviteId });
222
+
223
+ return true;
224
+ }
225
+
226
+ /**
227
+ * Check invitation
228
+ * @param {Object} api - TeamAPI instance
229
+ * @param {Object} params
230
+ * @param {string} params.teamDid - Team DID
231
+ * @param {string} params.inviteId - Invite ID
232
+ * @returns {Promise<Object>}
233
+ */
234
+ async function checkInvitation(api, { teamDid, inviteId }) {
235
+ const state = await api.getSessionState(teamDid);
236
+
237
+ const invitation = await state.read(inviteId);
238
+
239
+ if (!invitation) {
240
+ throw new Error(`The invitation does not exist: ${inviteId}`);
241
+ }
242
+
243
+ const { role, expireDate, remark } = invitation;
244
+
245
+ if (Date.now() > expireDate) {
246
+ logger.error('Invite id has expired', { inviteId, expireAt: new Date(expireDate) });
247
+
248
+ throw new Error(`The invitation has expired: ${inviteId}`);
249
+ }
250
+
251
+ const roles = await api.getRoles({ teamDid });
252
+ const orgRoles = await api.getRoles({ teamDid, orgId: invitation.orgId });
253
+ const allRoles = [...roles, ...orgRoles];
254
+ if (!allRoles.some((r) => r.name === role)) {
255
+ throw new Error(`Role does not exist: ${role}`);
256
+ }
257
+
258
+ return {
259
+ role,
260
+ remark,
261
+ };
262
+ }
263
+
264
+ /**
265
+ * Close invitation
266
+ * @param {Object} api - TeamAPI instance
267
+ * @param {Object} params
268
+ * @param {string} params.teamDid - Team DID
269
+ * @param {string} params.inviteId - Invite ID
270
+ * @param {string} params.status - Status
271
+ * @param {Object} params.receiver - Receiver
272
+ * @param {boolean} params.isOrgInvite - Is org invite
273
+ * @param {number} params.timeout - Timeout
274
+ * @returns {Promise<void>}
275
+ */
276
+ async function closeInvitation(api, { teamDid, inviteId, status, receiver, isOrgInvite, timeout = 30 * 1000 }) {
277
+ const state = await api.getSessionState(teamDid);
278
+
279
+ const invitation = await state.read(inviteId);
280
+
281
+ if (!invitation) {
282
+ throw new Error(`The invitation does not exist: ${inviteId}`);
283
+ }
284
+ let shouldRemoveInviteSession = false;
285
+ if (isOrgInvite && invitation?.inviteUserDids?.length > 0) {
286
+ const unReceiverUserDids = invitation.inviteUserDids.filter((did) => did !== receiver.did);
287
+ shouldRemoveInviteSession = unReceiverUserDids.length === 0;
288
+ await state.update(inviteId, {
289
+ receiver,
290
+ inviteUserDids: unReceiverUserDids,
291
+ ...(shouldRemoveInviteSession ? { status } : {}),
292
+ });
293
+ } else {
294
+ await state.update(inviteId, { status, receiver });
295
+ shouldRemoveInviteSession = true;
296
+ }
297
+
298
+ if (shouldRemoveInviteSession) {
299
+ setTimeout(async () => {
300
+ try {
301
+ logger.info('Invitation session closed', { inviteId });
302
+ await state.end(inviteId);
303
+ } catch (error) {
304
+ logger.error('close invitation failed', { error });
305
+ }
306
+ }, timeout);
307
+ }
308
+ }
309
+
310
+ /**
311
+ * Create transfer invitation (server owner transfer)
312
+ * @param {Object} api - TeamAPI instance
313
+ * @param {Object} params
314
+ * @param {string} params.teamDid - Team DID
315
+ * @param {string} params.remark - Remark
316
+ * @param {Object} context
317
+ * @param {Object} deps - Dependencies
318
+ * @returns {Promise<Object>}
319
+ */
320
+ function createTransferInvitation(api, { teamDid, remark }, context = {}, deps) {
321
+ return createMemberInvitation(
322
+ api,
323
+ { teamDid, expireTime: api.transferOwnerExpireTime, remark, role: 'owner' },
324
+ context,
325
+ deps
326
+ );
327
+ }
328
+
329
+ /**
330
+ * Create transfer app owner session
331
+ * @param {Object} api - TeamAPI instance
332
+ * @param {Object} params
333
+ * @param {string} params.appDid - App DID
334
+ * @param {string} params.remark - Remark
335
+ * @returns {Promise<Object>}
336
+ */
337
+ async function createTransferAppOwnerSession(api, { appDid, remark = '' }) {
338
+ const expireTime = api.transferOwnerExpireTime;
339
+
340
+ await api.teamManager.checkEnableTransferAppOwner(appDid);
341
+
342
+ if (remark && remark.length > 50) {
343
+ throw new Error('Remark length should NOT be more than 50 characters');
344
+ }
345
+
346
+ const expireDate = Date.now() + expireTime;
347
+ const state = await api.getSessionState(appDid);
348
+ const { id: transferId } = await state.start({
349
+ type: 'transfer-app-owner',
350
+ remark,
351
+ expireDate,
352
+ appDid,
353
+ });
354
+
355
+ logger.info('createTransferAppOwnerSession', { appDid, transferId });
356
+
357
+ return {
358
+ transferId,
359
+ remark,
360
+ expireDate: new Date(expireDate).toString(),
361
+ appDid,
362
+ status: 'created',
363
+ };
364
+ }
365
+
366
+ /**
367
+ * Get transfer app owner session
368
+ * @param {Object} api - TeamAPI instance
369
+ * @param {Object} params
370
+ * @param {string} params.appDid - App DID
371
+ * @param {string} params.transferId - Transfer ID
372
+ * @returns {Promise<Object|null>}
373
+ */
374
+ async function getTransferAppOwnerSession(api, { appDid, transferId }) {
375
+ if (!appDid || !transferId) {
376
+ return null;
377
+ }
378
+
379
+ const state = await api.getSessionState(appDid);
380
+
381
+ const transfer = await state.read(transferId);
382
+ if (!transfer) {
383
+ return null;
384
+ }
385
+
386
+ return formatTransferData(transfer);
387
+ }
388
+
389
+ /**
390
+ * Check transfer app owner session
391
+ * @param {Object} api - TeamAPI instance
392
+ * @param {Object} params
393
+ * @param {string} params.appDid - App DID
394
+ * @param {string} params.transferId - Transfer ID
395
+ * @returns {Promise<Object>}
396
+ */
397
+ async function checkTransferAppOwnerSession(api, { appDid, transferId }) {
398
+ const state = await api.getSessionState(appDid);
399
+
400
+ const transfer = await state.read(transferId);
401
+
402
+ if (!transfer) {
403
+ throw new Error(`The transfer session does not exist: ${transferId}`);
404
+ }
405
+
406
+ const { expireDate } = transfer;
407
+
408
+ if (Date.now() > expireDate) {
409
+ logger.error('Transfer session has expired', { transferId, expireAt: new Date(expireDate) });
410
+
411
+ throw new Error(`The transfer session has expired: ${transferId}`);
412
+ }
413
+
414
+ return formatTransferData(transfer);
415
+ }
416
+
417
+ /**
418
+ * Close transfer app owner session
419
+ * @param {Object} api - TeamAPI instance
420
+ * @param {Object} params
421
+ * @param {string} params.appPid - App PID
422
+ * @param {string} params.transferId - Transfer ID
423
+ * @param {string} params.status - Status
424
+ * @param {number} params.timeout - Timeout
425
+ * @returns {Promise<void>}
426
+ */
427
+ async function closeTransferAppOwnerSession(api, { appPid, transferId, status, timeout = 30 * 1000 }) {
428
+ const state = await api.getSessionState(appPid);
429
+
430
+ const session = await state.read(transferId);
431
+
432
+ if (!session) {
433
+ throw new Error(`The transfer app owner session does not exist: ${transferId}`);
434
+ }
435
+
436
+ await state.update(transferId, { status });
437
+
438
+ setTimeout(async () => {
439
+ try {
440
+ await state.end(transferId);
441
+ logger.info('Transfer session closed', { transferId });
442
+ } catch (error) {
443
+ logger.error('close transfer session failed', { transferId, error });
444
+ }
445
+ }, timeout);
446
+ }
447
+
448
+ module.exports = {
449
+ formatTransferData,
450
+ createMemberInvitation,
451
+ getInvitation,
452
+ getInvitations,
453
+ deleteInvitation,
454
+ checkInvitation,
455
+ closeInvitation,
456
+ createTransferInvitation,
457
+ createTransferAppOwnerSession,
458
+ getTransferAppOwnerSession,
459
+ checkTransferAppOwnerSession,
460
+ closeTransferAppOwnerSession,
461
+ };