@lifestreamdynamics/vault-sdk 1.1.0 → 1.2.0
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/client.d.ts +9 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +12 -0
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +12 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/resources/admin.d.ts +6 -0
- package/dist/resources/admin.d.ts.map +1 -1
- package/dist/resources/admin.js +8 -0
- package/dist/resources/admin.js.map +1 -1
- package/dist/resources/analytics.d.ts +44 -0
- package/dist/resources/analytics.d.ts.map +1 -0
- package/dist/resources/analytics.js +33 -0
- package/dist/resources/analytics.js.map +1 -0
- package/dist/resources/calendar.d.ts +16 -0
- package/dist/resources/calendar.d.ts.map +1 -1
- package/dist/resources/calendar.js +18 -0
- package/dist/resources/calendar.js.map +1 -1
- package/dist/resources/custom-domains.d.ts +42 -0
- package/dist/resources/custom-domains.d.ts.map +1 -0
- package/dist/resources/custom-domains.js +70 -0
- package/dist/resources/custom-domains.js.map +1 -0
- package/dist/resources/documents.d.ts +28 -0
- package/dist/resources/documents.d.ts.map +1 -1
- package/dist/resources/documents.js +40 -0
- package/dist/resources/documents.js.map +1 -1
- package/dist/resources/publish-vault.d.ts +51 -0
- package/dist/resources/publish-vault.d.ts.map +1 -0
- package/dist/resources/publish-vault.js +44 -0
- package/dist/resources/publish-vault.js.map +1 -0
- package/dist/resources/publish.d.ts +8 -0
- package/dist/resources/publish.d.ts.map +1 -1
- package/dist/resources/publish.js +24 -0
- package/dist/resources/publish.js.map +1 -1
- package/dist/resources/teams.d.ts +14 -0
- package/dist/resources/teams.d.ts.map +1 -1
- package/dist/resources/teams.js +28 -0
- package/dist/resources/teams.js.map +1 -1
- package/dist/resources/user.d.ts +224 -0
- package/dist/resources/user.d.ts.map +1 -1
- package/dist/resources/user.js +249 -0
- package/dist/resources/user.js.map +1 -1
- package/dist/resources/vaults.d.ts +57 -0
- package/dist/resources/vaults.d.ts.map +1 -1
- package/dist/resources/vaults.js +86 -1
- package/dist/resources/vaults.js.map +1 -1
- package/package.json +1 -1
package/dist/resources/user.d.ts
CHANGED
|
@@ -44,6 +44,64 @@ export interface StorageUsage {
|
|
|
44
44
|
/** Current subscription tier. */
|
|
45
45
|
tier: string;
|
|
46
46
|
}
|
|
47
|
+
/** An active session for the authenticated user. */
|
|
48
|
+
export interface AccountSession {
|
|
49
|
+
/** Unique session identifier. */
|
|
50
|
+
id: string;
|
|
51
|
+
/** ISO 8601 timestamp when the session was created. */
|
|
52
|
+
createdAt: string;
|
|
53
|
+
/** ISO 8601 timestamp when the session was last active. */
|
|
54
|
+
lastSeenAt: string;
|
|
55
|
+
/** IP address associated with the session, or `null` if unavailable. */
|
|
56
|
+
ipAddress: string | null;
|
|
57
|
+
/** User-Agent string for the session, or `null` if unavailable. */
|
|
58
|
+
userAgent: string | null;
|
|
59
|
+
/** Whether this is the currently active session. */
|
|
60
|
+
current: boolean;
|
|
61
|
+
}
|
|
62
|
+
/** A data export record for the authenticated user. */
|
|
63
|
+
export interface DataExportRecord {
|
|
64
|
+
/** Unique export identifier. */
|
|
65
|
+
id: string;
|
|
66
|
+
/** Current status of the export job. */
|
|
67
|
+
status: 'pending' | 'processing' | 'complete' | 'failed';
|
|
68
|
+
/** Export file format (e.g. `zip`). */
|
|
69
|
+
format: string;
|
|
70
|
+
/** ISO 8601 timestamp when the export was requested. */
|
|
71
|
+
createdAt: string;
|
|
72
|
+
/** ISO 8601 timestamp when the export completed, if applicable. */
|
|
73
|
+
completedAt?: string;
|
|
74
|
+
/** Presigned download URL, available once status is `complete`. */
|
|
75
|
+
downloadUrl?: string;
|
|
76
|
+
}
|
|
77
|
+
/** A consent record for the authenticated user. */
|
|
78
|
+
export interface ConsentRecord {
|
|
79
|
+
/** Type of consent (e.g. `tos`, `privacy_policy`). */
|
|
80
|
+
consentType: string;
|
|
81
|
+
/** Version of the document consented to. */
|
|
82
|
+
version: string;
|
|
83
|
+
/** Whether consent was granted (`true`) or withdrawn (`false`). */
|
|
84
|
+
granted: boolean;
|
|
85
|
+
/** ISO 8601 timestamp when consent was recorded. */
|
|
86
|
+
recordedAt: string;
|
|
87
|
+
}
|
|
88
|
+
/** A team invitation received by the authenticated user. */
|
|
89
|
+
export interface TeamInvitationInboxItem {
|
|
90
|
+
/** Unique invitation identifier. */
|
|
91
|
+
id: string;
|
|
92
|
+
/** Identifier of the team that sent the invitation. */
|
|
93
|
+
teamId: string;
|
|
94
|
+
/** Display name of the team. */
|
|
95
|
+
teamName: string;
|
|
96
|
+
/** Role the user will receive upon accepting. */
|
|
97
|
+
role: 'admin' | 'member';
|
|
98
|
+
/** Email or name of the user who sent the invitation. */
|
|
99
|
+
invitedBy: string;
|
|
100
|
+
/** ISO 8601 timestamp when the invitation was created. */
|
|
101
|
+
createdAt: string;
|
|
102
|
+
/** ISO 8601 timestamp when the invitation expires. */
|
|
103
|
+
expiresAt: string;
|
|
104
|
+
}
|
|
47
105
|
/**
|
|
48
106
|
* Resource for retrieving user profile and storage information.
|
|
49
107
|
*
|
|
@@ -88,5 +146,171 @@ export declare class UserResource {
|
|
|
88
146
|
* ```
|
|
89
147
|
*/
|
|
90
148
|
getStorage(): Promise<StorageUsage>;
|
|
149
|
+
/**
|
|
150
|
+
* Changes the authenticated user's password.
|
|
151
|
+
*
|
|
152
|
+
* @param params - Current and new password
|
|
153
|
+
* @returns Success message
|
|
154
|
+
* @throws {AuthenticationError} If current password is incorrect
|
|
155
|
+
* @throws {ValidationError} If new password fails validation
|
|
156
|
+
*/
|
|
157
|
+
changePassword(params: {
|
|
158
|
+
currentPassword: string;
|
|
159
|
+
newPassword: string;
|
|
160
|
+
}): Promise<{
|
|
161
|
+
message: string;
|
|
162
|
+
}>;
|
|
163
|
+
/**
|
|
164
|
+
* Initiates an email address change request. A verification email is sent to the new address.
|
|
165
|
+
*
|
|
166
|
+
* @param params - New email address and current password for verification
|
|
167
|
+
* @returns Success message
|
|
168
|
+
* @throws {AuthenticationError} If password is incorrect
|
|
169
|
+
* @throws {ConflictError} If the new email is already in use
|
|
170
|
+
*/
|
|
171
|
+
requestEmailChange(params: {
|
|
172
|
+
newEmail: string;
|
|
173
|
+
password: string;
|
|
174
|
+
}): Promise<{
|
|
175
|
+
message: string;
|
|
176
|
+
}>;
|
|
177
|
+
/**
|
|
178
|
+
* Confirms an email address change using the token sent to the new address.
|
|
179
|
+
*
|
|
180
|
+
* @param token - Verification token from the confirmation email
|
|
181
|
+
* @returns Success message
|
|
182
|
+
* @throws {ValidationError} If the token is invalid or expired
|
|
183
|
+
*/
|
|
184
|
+
confirmEmailChange(token: string): Promise<{
|
|
185
|
+
message: string;
|
|
186
|
+
}>;
|
|
187
|
+
/**
|
|
188
|
+
* Updates the authenticated user's display name or public profile slug.
|
|
189
|
+
*
|
|
190
|
+
* @param params - Fields to update (name and/or slug)
|
|
191
|
+
* @returns Success message
|
|
192
|
+
* @throws {ConflictError} If the requested slug is already taken
|
|
193
|
+
* @throws {ValidationError} If the slug format is invalid
|
|
194
|
+
*/
|
|
195
|
+
updateProfile(params: {
|
|
196
|
+
name?: string;
|
|
197
|
+
slug?: string;
|
|
198
|
+
}): Promise<{
|
|
199
|
+
message: string;
|
|
200
|
+
}>;
|
|
201
|
+
/**
|
|
202
|
+
* Schedules account deletion. The account is deleted after a grace period.
|
|
203
|
+
*
|
|
204
|
+
* @param params - Password for confirmation, optional deletion reason, and optional data export flag
|
|
205
|
+
* @returns Success message and scheduled deletion timestamp
|
|
206
|
+
* @throws {AuthenticationError} If password is incorrect
|
|
207
|
+
*/
|
|
208
|
+
requestAccountDeletion(params: {
|
|
209
|
+
password: string;
|
|
210
|
+
reason?: string;
|
|
211
|
+
exportData?: boolean;
|
|
212
|
+
}): Promise<{
|
|
213
|
+
message: string;
|
|
214
|
+
scheduledAt: string;
|
|
215
|
+
}>;
|
|
216
|
+
/**
|
|
217
|
+
* Cancels a pending account deletion request during the grace period.
|
|
218
|
+
*
|
|
219
|
+
* @returns Success message
|
|
220
|
+
* @throws {NotFoundError} If there is no pending deletion request
|
|
221
|
+
*/
|
|
222
|
+
cancelAccountDeletion(): Promise<{
|
|
223
|
+
message: string;
|
|
224
|
+
}>;
|
|
225
|
+
/**
|
|
226
|
+
* Lists all active sessions for the authenticated user.
|
|
227
|
+
*
|
|
228
|
+
* @returns Array of session objects, with the current session marked
|
|
229
|
+
* @throws {AuthenticationError} If not authenticated
|
|
230
|
+
*/
|
|
231
|
+
getSessions(): Promise<AccountSession[]>;
|
|
232
|
+
/**
|
|
233
|
+
* Revokes a specific session by ID, logging that session out immediately.
|
|
234
|
+
*
|
|
235
|
+
* @param sessionId - ID of the session to revoke
|
|
236
|
+
* @returns Success message
|
|
237
|
+
* @throws {NotFoundError} If the session does not exist
|
|
238
|
+
*/
|
|
239
|
+
revokeSession(sessionId: string): Promise<{
|
|
240
|
+
message: string;
|
|
241
|
+
}>;
|
|
242
|
+
/**
|
|
243
|
+
* Revokes all sessions except the current one, logging out all other devices.
|
|
244
|
+
*
|
|
245
|
+
* @returns Success message
|
|
246
|
+
* @throws {AuthenticationError} If not authenticated
|
|
247
|
+
*/
|
|
248
|
+
revokeAllSessions(): Promise<{
|
|
249
|
+
message: string;
|
|
250
|
+
}>;
|
|
251
|
+
/**
|
|
252
|
+
* Requests a full data export of the authenticated user's account.
|
|
253
|
+
*
|
|
254
|
+
* @param format - Export format (defaults to `zip` if omitted)
|
|
255
|
+
* @returns Data export record with status and ID for polling
|
|
256
|
+
* @throws {AuthenticationError} If not authenticated
|
|
257
|
+
*/
|
|
258
|
+
requestDataExport(format?: string): Promise<DataExportRecord>;
|
|
259
|
+
/**
|
|
260
|
+
* Retrieves the status of a previously requested data export.
|
|
261
|
+
*
|
|
262
|
+
* @param exportId - ID of the export to look up
|
|
263
|
+
* @returns Data export record including download URL once complete
|
|
264
|
+
* @throws {NotFoundError} If the export does not exist
|
|
265
|
+
*/
|
|
266
|
+
getDataExport(exportId: string): Promise<DataExportRecord>;
|
|
267
|
+
/**
|
|
268
|
+
* Lists all consent records for the authenticated user.
|
|
269
|
+
*
|
|
270
|
+
* @returns Array of consent records (ToS, privacy policy, etc.)
|
|
271
|
+
* @throws {AuthenticationError} If not authenticated
|
|
272
|
+
*/
|
|
273
|
+
getConsents(): Promise<ConsentRecord[]>;
|
|
274
|
+
/**
|
|
275
|
+
* Records a consent decision for a specific policy version.
|
|
276
|
+
*
|
|
277
|
+
* @param params - Consent type, version, and whether consent was granted
|
|
278
|
+
* @returns Success message
|
|
279
|
+
* @throws {AuthenticationError} If not authenticated
|
|
280
|
+
*/
|
|
281
|
+
recordConsent(params: {
|
|
282
|
+
consentType: string;
|
|
283
|
+
version: string;
|
|
284
|
+
granted: boolean;
|
|
285
|
+
}): Promise<{
|
|
286
|
+
message: string;
|
|
287
|
+
}>;
|
|
288
|
+
/**
|
|
289
|
+
* Lists all pending team invitations for the authenticated user.
|
|
290
|
+
*
|
|
291
|
+
* @returns Array of team invitation inbox items
|
|
292
|
+
* @throws {AuthenticationError} If not authenticated
|
|
293
|
+
*/
|
|
294
|
+
listTeamInvitations(): Promise<TeamInvitationInboxItem[]>;
|
|
295
|
+
/**
|
|
296
|
+
* Accepts a pending team invitation, joining the team with the assigned role.
|
|
297
|
+
*
|
|
298
|
+
* @param id - ID of the invitation to accept
|
|
299
|
+
* @returns Success message
|
|
300
|
+
* @throws {NotFoundError} If the invitation does not exist or has expired
|
|
301
|
+
*/
|
|
302
|
+
acceptTeamInvitation(id: string): Promise<{
|
|
303
|
+
message: string;
|
|
304
|
+
}>;
|
|
305
|
+
/**
|
|
306
|
+
* Declines a pending team invitation.
|
|
307
|
+
*
|
|
308
|
+
* @param id - ID of the invitation to decline
|
|
309
|
+
* @returns Success message
|
|
310
|
+
* @throws {NotFoundError} If the invitation does not exist or has expired
|
|
311
|
+
*/
|
|
312
|
+
declineTeamInvitation(id: string): Promise<{
|
|
313
|
+
message: string;
|
|
314
|
+
}>;
|
|
91
315
|
}
|
|
92
316
|
//# sourceMappingURL=user.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/resources/user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAGrC,wCAAwC;AACxC,MAAM,WAAW,IAAI;IACnB,8BAA8B;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,gBAAgB,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,yCAAyC;AACzC,MAAM,WAAW,YAAY;IAC3B,wBAAwB;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,2DAA2D;AAC3D,MAAM,WAAW,YAAY;IAC3B,0CAA0C;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,UAAU,EAAE,MAAM,CAAC;IACnB,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;GAWG;AAC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60
60
|
throw await handleError(error, 'Storage', '');
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Changes the authenticated user's password.
|
|
65
|
+
*
|
|
66
|
+
* @param params - Current and new password
|
|
67
|
+
* @returns Success message
|
|
68
|
+
* @throws {AuthenticationError} If current password is incorrect
|
|
69
|
+
* @throws {ValidationError} If new password fails validation
|
|
70
|
+
*/
|
|
71
|
+
async changePassword(params) {
|
|
72
|
+
try {
|
|
73
|
+
return await this.http.put('account/password', { json: params }).json();
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
throw await handleError(error, 'User', '');
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Initiates an email address change request. A verification email is sent to the new address.
|
|
81
|
+
*
|
|
82
|
+
* @param params - New email address and current password for verification
|
|
83
|
+
* @returns Success message
|
|
84
|
+
* @throws {AuthenticationError} If password is incorrect
|
|
85
|
+
* @throws {ConflictError} If the new email is already in use
|
|
86
|
+
*/
|
|
87
|
+
async requestEmailChange(params) {
|
|
88
|
+
try {
|
|
89
|
+
return await this.http.post('account/email', { json: params }).json();
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
throw await handleError(error, 'User', '');
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Confirms an email address change using the token sent to the new address.
|
|
97
|
+
*
|
|
98
|
+
* @param token - Verification token from the confirmation email
|
|
99
|
+
* @returns Success message
|
|
100
|
+
* @throws {ValidationError} If the token is invalid or expired
|
|
101
|
+
*/
|
|
102
|
+
async confirmEmailChange(token) {
|
|
103
|
+
try {
|
|
104
|
+
return await this.http.post('account/email/verify', { json: { token } }).json();
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
throw await handleError(error, 'User', '');
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Updates the authenticated user's display name or public profile slug.
|
|
112
|
+
*
|
|
113
|
+
* @param params - Fields to update (name and/or slug)
|
|
114
|
+
* @returns Success message
|
|
115
|
+
* @throws {ConflictError} If the requested slug is already taken
|
|
116
|
+
* @throws {ValidationError} If the slug format is invalid
|
|
117
|
+
*/
|
|
118
|
+
async updateProfile(params) {
|
|
119
|
+
try {
|
|
120
|
+
return await this.http.put('account/profile', { json: params }).json();
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
throw await handleError(error, 'User', '');
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Schedules account deletion. The account is deleted after a grace period.
|
|
128
|
+
*
|
|
129
|
+
* @param params - Password for confirmation, optional deletion reason, and optional data export flag
|
|
130
|
+
* @returns Success message and scheduled deletion timestamp
|
|
131
|
+
* @throws {AuthenticationError} If password is incorrect
|
|
132
|
+
*/
|
|
133
|
+
async requestAccountDeletion(params) {
|
|
134
|
+
try {
|
|
135
|
+
return await this.http
|
|
136
|
+
.post('account/delete', { json: params })
|
|
137
|
+
.json();
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
throw await handleError(error, 'User', '');
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Cancels a pending account deletion request during the grace period.
|
|
145
|
+
*
|
|
146
|
+
* @returns Success message
|
|
147
|
+
* @throws {NotFoundError} If there is no pending deletion request
|
|
148
|
+
*/
|
|
149
|
+
async cancelAccountDeletion() {
|
|
150
|
+
try {
|
|
151
|
+
return await this.http.post('account/delete/cancel').json();
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
throw await handleError(error, 'User', '');
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Lists all active sessions for the authenticated user.
|
|
159
|
+
*
|
|
160
|
+
* @returns Array of session objects, with the current session marked
|
|
161
|
+
* @throws {AuthenticationError} If not authenticated
|
|
162
|
+
*/
|
|
163
|
+
async getSessions() {
|
|
164
|
+
try {
|
|
165
|
+
const data = await this.http.get('account/sessions').json();
|
|
166
|
+
return data.sessions;
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
throw await handleError(error, 'User', '');
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Revokes a specific session by ID, logging that session out immediately.
|
|
174
|
+
*
|
|
175
|
+
* @param sessionId - ID of the session to revoke
|
|
176
|
+
* @returns Success message
|
|
177
|
+
* @throws {NotFoundError} If the session does not exist
|
|
178
|
+
*/
|
|
179
|
+
async revokeSession(sessionId) {
|
|
180
|
+
try {
|
|
181
|
+
return await this.http.delete(`account/sessions/${sessionId}`).json();
|
|
182
|
+
}
|
|
183
|
+
catch (error) {
|
|
184
|
+
throw await handleError(error, 'User', sessionId);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Revokes all sessions except the current one, logging out all other devices.
|
|
189
|
+
*
|
|
190
|
+
* @returns Success message
|
|
191
|
+
* @throws {AuthenticationError} If not authenticated
|
|
192
|
+
*/
|
|
193
|
+
async revokeAllSessions() {
|
|
194
|
+
try {
|
|
195
|
+
return await this.http.delete('account/sessions').json();
|
|
196
|
+
}
|
|
197
|
+
catch (error) {
|
|
198
|
+
throw await handleError(error, 'User', '');
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Requests a full data export of the authenticated user's account.
|
|
203
|
+
*
|
|
204
|
+
* @param format - Export format (defaults to `zip` if omitted)
|
|
205
|
+
* @returns Data export record with status and ID for polling
|
|
206
|
+
* @throws {AuthenticationError} If not authenticated
|
|
207
|
+
*/
|
|
208
|
+
async requestDataExport(format) {
|
|
209
|
+
try {
|
|
210
|
+
const data = await this.http
|
|
211
|
+
.post('account/export', { json: { format } })
|
|
212
|
+
.json();
|
|
213
|
+
return data.export;
|
|
214
|
+
}
|
|
215
|
+
catch (error) {
|
|
216
|
+
throw await handleError(error, 'User', '');
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Retrieves the status of a previously requested data export.
|
|
221
|
+
*
|
|
222
|
+
* @param exportId - ID of the export to look up
|
|
223
|
+
* @returns Data export record including download URL once complete
|
|
224
|
+
* @throws {NotFoundError} If the export does not exist
|
|
225
|
+
*/
|
|
226
|
+
async getDataExport(exportId) {
|
|
227
|
+
try {
|
|
228
|
+
const data = await this.http.get(`account/export/${exportId}`).json();
|
|
229
|
+
return data.export;
|
|
230
|
+
}
|
|
231
|
+
catch (error) {
|
|
232
|
+
throw await handleError(error, 'User', exportId);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Lists all consent records for the authenticated user.
|
|
237
|
+
*
|
|
238
|
+
* @returns Array of consent records (ToS, privacy policy, etc.)
|
|
239
|
+
* @throws {AuthenticationError} If not authenticated
|
|
240
|
+
*/
|
|
241
|
+
async getConsents() {
|
|
242
|
+
try {
|
|
243
|
+
const data = await this.http.get('account/consents').json();
|
|
244
|
+
return data.consents;
|
|
245
|
+
}
|
|
246
|
+
catch (error) {
|
|
247
|
+
throw await handleError(error, 'User', '');
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Records a consent decision for a specific policy version.
|
|
252
|
+
*
|
|
253
|
+
* @param params - Consent type, version, and whether consent was granted
|
|
254
|
+
* @returns Success message
|
|
255
|
+
* @throws {AuthenticationError} If not authenticated
|
|
256
|
+
*/
|
|
257
|
+
async recordConsent(params) {
|
|
258
|
+
try {
|
|
259
|
+
return await this.http.post('account/consents', { json: params }).json();
|
|
260
|
+
}
|
|
261
|
+
catch (error) {
|
|
262
|
+
throw await handleError(error, 'User', '');
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Lists all pending team invitations for the authenticated user.
|
|
267
|
+
*
|
|
268
|
+
* @returns Array of team invitation inbox items
|
|
269
|
+
* @throws {AuthenticationError} If not authenticated
|
|
270
|
+
*/
|
|
271
|
+
async listTeamInvitations() {
|
|
272
|
+
try {
|
|
273
|
+
const data = await this.http
|
|
274
|
+
.get('users/me/invitations')
|
|
275
|
+
.json();
|
|
276
|
+
return data.invitations;
|
|
277
|
+
}
|
|
278
|
+
catch (error) {
|
|
279
|
+
throw await handleError(error, 'User', '');
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Accepts a pending team invitation, joining the team with the assigned role.
|
|
284
|
+
*
|
|
285
|
+
* @param id - ID of the invitation to accept
|
|
286
|
+
* @returns Success message
|
|
287
|
+
* @throws {NotFoundError} If the invitation does not exist or has expired
|
|
288
|
+
*/
|
|
289
|
+
async acceptTeamInvitation(id) {
|
|
290
|
+
try {
|
|
291
|
+
return await this.http.post(`users/me/invitations/${id}/accept`).json();
|
|
292
|
+
}
|
|
293
|
+
catch (error) {
|
|
294
|
+
throw await handleError(error, 'User', id);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Declines a pending team invitation.
|
|
299
|
+
*
|
|
300
|
+
* @param id - ID of the invitation to decline
|
|
301
|
+
* @returns Success message
|
|
302
|
+
* @throws {NotFoundError} If the invitation does not exist or has expired
|
|
303
|
+
*/
|
|
304
|
+
async declineTeamInvitation(id) {
|
|
305
|
+
try {
|
|
306
|
+
return await this.http.post(`users/me/invitations/${id}/decline`).json();
|
|
307
|
+
}
|
|
308
|
+
catch (error) {
|
|
309
|
+
throw await handleError(error, 'User', id);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
63
312
|
}
|
|
64
313
|
//# sourceMappingURL=user.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/resources/user.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/resources/user.ts"],"names":[],"mappings":"A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15,6 +15,16 @@ export interface Vault {
|
|
|
15
15
|
createdAt: string;
|
|
16
16
|
/** ISO 8601 last-updated timestamp. */
|
|
17
17
|
updatedAt: string;
|
|
18
|
+
/** Whether the vault is archived. */
|
|
19
|
+
isArchived: boolean;
|
|
20
|
+
/** ISO 8601 timestamp when the vault was archived, or null. */
|
|
21
|
+
archivedAt: string | null;
|
|
22
|
+
/** Team ID if the vault belongs to a team, or null. */
|
|
23
|
+
teamId: string | null;
|
|
24
|
+
/** ID of the user who owns the vault. */
|
|
25
|
+
userId: string;
|
|
26
|
+
/** Base directory filter for this vault, or null. */
|
|
27
|
+
baseDir: string | null;
|
|
18
28
|
}
|
|
19
29
|
/** Node in the vault link graph. */
|
|
20
30
|
export interface LinkGraphNode {
|
|
@@ -45,6 +55,31 @@ export interface UnresolvedLink {
|
|
|
45
55
|
targetPath: string;
|
|
46
56
|
references: UnresolvedLinkReference[];
|
|
47
57
|
}
|
|
58
|
+
/** A node in the vault file tree. */
|
|
59
|
+
export interface VaultTreeNode {
|
|
60
|
+
name: string;
|
|
61
|
+
path: string;
|
|
62
|
+
type: 'file' | 'directory';
|
|
63
|
+
children?: VaultTreeNode[];
|
|
64
|
+
}
|
|
65
|
+
/** A vault export job record. */
|
|
66
|
+
export interface VaultExportRecord {
|
|
67
|
+
id: string;
|
|
68
|
+
vaultId: string;
|
|
69
|
+
status: 'pending' | 'processing' | 'complete' | 'failed';
|
|
70
|
+
format: 'zip';
|
|
71
|
+
includeMetadata: boolean;
|
|
72
|
+
downloadUrl?: string;
|
|
73
|
+
createdAt: string;
|
|
74
|
+
completedAt?: string;
|
|
75
|
+
}
|
|
76
|
+
/** Vault-level MFA configuration and verification state. */
|
|
77
|
+
export interface VaultMfaConfig {
|
|
78
|
+
mfaRequired: boolean;
|
|
79
|
+
sessionWindowMinutes: number;
|
|
80
|
+
userVerified?: boolean;
|
|
81
|
+
verificationExpiresAt?: string | null;
|
|
82
|
+
}
|
|
48
83
|
/**
|
|
49
84
|
* Resource for managing vaults.
|
|
50
85
|
*
|
|
@@ -213,5 +248,27 @@ export declare class VaultsResource {
|
|
|
213
248
|
* ```
|
|
214
249
|
*/
|
|
215
250
|
getUnresolvedLinks(vaultId: string): Promise<UnresolvedLink[]>;
|
|
251
|
+
getTree(vaultId: string): Promise<VaultTreeNode[]>;
|
|
252
|
+
archive(vaultId: string): Promise<Vault>;
|
|
253
|
+
unarchive(vaultId: string): Promise<Vault>;
|
|
254
|
+
createExport(vaultId: string, params?: {
|
|
255
|
+
includeMetadata?: boolean;
|
|
256
|
+
format?: 'zip';
|
|
257
|
+
}): Promise<VaultExportRecord>;
|
|
258
|
+
listExports(vaultId: string): Promise<VaultExportRecord[]>;
|
|
259
|
+
downloadExport(vaultId: string, exportId: string): Promise<Blob>;
|
|
260
|
+
transfer(vaultId: string, targetEmail: string): Promise<Vault>;
|
|
261
|
+
getMfaConfig(vaultId: string): Promise<VaultMfaConfig>;
|
|
262
|
+
setMfaConfig(vaultId: string, params: {
|
|
263
|
+
mfaRequired: boolean;
|
|
264
|
+
sessionWindowMinutes?: number;
|
|
265
|
+
}): Promise<VaultMfaConfig>;
|
|
266
|
+
verifyMfa(vaultId: string, params: {
|
|
267
|
+
method: 'totp' | 'backup_code';
|
|
268
|
+
code: string;
|
|
269
|
+
}): Promise<{
|
|
270
|
+
verified: boolean;
|
|
271
|
+
expiresAt: string;
|
|
272
|
+
}>;
|
|
216
273
|
}
|
|
217
274
|
//# sourceMappingURL=vaults.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vaults.d.ts","sourceRoot":"","sources":["../../src/resources/vaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAGrC,0CAA0C;AAC1C,MAAM,WAAW,KAAK;IACpB,+BAA+B;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,IA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