@23blocks/block-files 4.0.0 → 5.0.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/CHANGELOG.md +277 -0
- package/dist/index.esm.js +215 -145
- package/dist/src/lib/services/delegations.service.d.ts +2 -2
- package/dist/src/lib/services/delegations.service.d.ts.map +1 -1
- package/dist/src/lib/services/entity-files.service.d.ts +3 -3
- package/dist/src/lib/services/file-access-requests.service.d.ts +2 -2
- package/dist/src/lib/services/file-access-requests.service.d.ts.map +1 -1
- package/dist/src/lib/services/file-access.service.d.ts +3 -3
- package/dist/src/lib/services/file-access.service.d.ts.map +1 -1
- package/dist/src/lib/services/file-schemas.service.d.ts +2 -2
- package/dist/src/lib/services/file-schemas.service.d.ts.map +1 -1
- package/dist/src/lib/services/file-tags.service.d.ts +4 -4
- package/dist/src/lib/services/file-tags.service.d.ts.map +1 -1
- package/dist/src/lib/services/storage-files.service.d.ts +2 -2
- package/dist/src/lib/services/storage-files.service.d.ts.map +1 -1
- package/dist/src/lib/services/user-files.service.d.ts +15 -15
- package/dist/src/lib/services/user-files.service.d.ts.map +1 -1
- package/dist/src/lib/types/delegation.d.ts +9 -14
- package/dist/src/lib/types/delegation.d.ts.map +1 -1
- package/dist/src/lib/types/entity-file.d.ts +17 -13
- package/dist/src/lib/types/entity-file.d.ts.map +1 -1
- package/dist/src/lib/types/file-access-request.d.ts +7 -11
- package/dist/src/lib/types/file-access-request.d.ts.map +1 -1
- package/dist/src/lib/types/file-access.d.ts +10 -13
- package/dist/src/lib/types/file-access.d.ts.map +1 -1
- package/dist/src/lib/types/file-category.d.ts +15 -15
- package/dist/src/lib/types/file-category.d.ts.map +1 -1
- package/dist/src/lib/types/file-schema.d.ts +3 -17
- package/dist/src/lib/types/file-schema.d.ts.map +1 -1
- package/dist/src/lib/types/file-tag.d.ts +18 -18
- package/dist/src/lib/types/file-tag.d.ts.map +1 -1
- package/dist/src/lib/types/storage-file.d.ts +79 -24
- package/dist/src/lib/types/storage-file.d.ts.map +1 -1
- package/dist/src/lib/types/user-file.d.ts +95 -24
- package/dist/src/lib/types/user-file.d.ts.map +1 -1
- package/package.json +3 -1
package/dist/index.esm.js
CHANGED
|
@@ -132,7 +132,6 @@ function createStorageFilesService(transport, _config) {
|
|
|
132
132
|
if (data.fileType) formData.append('file_type', data.fileType);
|
|
133
133
|
if (data.generateThumbnail !== undefined) formData.append('generate_thumbnail', String(data.generateThumbnail));
|
|
134
134
|
if (data.generatePreview !== undefined) formData.append('generate_preview', String(data.generatePreview));
|
|
135
|
-
if (data.payload) formData.append('payload', JSON.stringify(data.payload));
|
|
136
135
|
if (data.tags) formData.append('tags', JSON.stringify(data.tags));
|
|
137
136
|
const response = await transport.post('/storage_files/upload', formData, {
|
|
138
137
|
headers: {
|
|
@@ -144,16 +143,35 @@ function createStorageFilesService(transport, _config) {
|
|
|
144
143
|
async create (data) {
|
|
145
144
|
const response = await transport.post('/storage_files', {
|
|
146
145
|
file: {
|
|
147
|
-
|
|
148
|
-
owner_type: data.ownerType,
|
|
149
|
-
file_name: data.fileName,
|
|
146
|
+
name: data.name,
|
|
150
147
|
file_type: data.fileType,
|
|
151
148
|
file_size: data.fileSize,
|
|
152
|
-
|
|
149
|
+
url: data.url,
|
|
150
|
+
thumbnail_url: data.thumbnailUrl,
|
|
151
|
+
media_url: data.mediaUrl,
|
|
152
|
+
image_url: data.imageUrl,
|
|
153
153
|
content_url: data.contentUrl,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
154
|
+
description: data.description,
|
|
155
|
+
original_name: data.originalName,
|
|
156
|
+
original_file: data.originalFile,
|
|
157
|
+
virtual_folder: data.virtualFolder,
|
|
158
|
+
category_name: data.categoryName,
|
|
159
|
+
category_unique_id: data.categoryUniqueId,
|
|
160
|
+
is_public: data.isPublic,
|
|
161
|
+
access_level: data.accessLevel,
|
|
162
|
+
ai_enabled: data.aiEnabled,
|
|
163
|
+
is_temp: data.isTemp,
|
|
164
|
+
raw_content: data.rawContent,
|
|
165
|
+
content: data.content,
|
|
166
|
+
file_structure: data.fileStructure,
|
|
167
|
+
metadata: data.metadata,
|
|
168
|
+
structured_content: data.structuredContent,
|
|
169
|
+
schema_model: data.schemaModel,
|
|
170
|
+
vectorDB: data.vectorDB,
|
|
171
|
+
is_expirable: data.isExpirable,
|
|
172
|
+
issued_at: data.issuedAt,
|
|
173
|
+
expires_at: data.expiresAt,
|
|
174
|
+
issued_by: data.issuedBy,
|
|
157
175
|
tags: data.tags
|
|
158
176
|
}
|
|
159
177
|
});
|
|
@@ -162,14 +180,35 @@ function createStorageFilesService(transport, _config) {
|
|
|
162
180
|
async update (uniqueId, data) {
|
|
163
181
|
const response = await transport.put(`/storage_files/${uniqueId}`, {
|
|
164
182
|
file: {
|
|
165
|
-
|
|
183
|
+
name: data.name,
|
|
166
184
|
file_type: data.fileType,
|
|
167
|
-
|
|
185
|
+
file_size: data.fileSize,
|
|
186
|
+
url: data.url,
|
|
168
187
|
thumbnail_url: data.thumbnailUrl,
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
188
|
+
media_url: data.mediaUrl,
|
|
189
|
+
image_url: data.imageUrl,
|
|
190
|
+
content_url: data.contentUrl,
|
|
191
|
+
description: data.description,
|
|
192
|
+
original_name: data.originalName,
|
|
193
|
+
original_file: data.originalFile,
|
|
194
|
+
virtual_folder: data.virtualFolder,
|
|
195
|
+
category_name: data.categoryName,
|
|
196
|
+
category_unique_id: data.categoryUniqueId,
|
|
197
|
+
is_public: data.isPublic,
|
|
198
|
+
access_level: data.accessLevel,
|
|
199
|
+
ai_enabled: data.aiEnabled,
|
|
200
|
+
is_temp: data.isTemp,
|
|
201
|
+
raw_content: data.rawContent,
|
|
202
|
+
content: data.content,
|
|
203
|
+
file_structure: data.fileStructure,
|
|
204
|
+
metadata: data.metadata,
|
|
205
|
+
structured_content: data.structuredContent,
|
|
206
|
+
schema_model: data.schemaModel,
|
|
207
|
+
vectorDB: data.vectorDB,
|
|
208
|
+
is_expirable: data.isExpirable,
|
|
209
|
+
issued_at: data.issuedAt,
|
|
210
|
+
expires_at: data.expiresAt,
|
|
211
|
+
issued_by: data.issuedBy,
|
|
173
212
|
tags: data.tags
|
|
174
213
|
}
|
|
175
214
|
});
|
|
@@ -251,13 +290,8 @@ function createEntityFilesService(transport, _config) {
|
|
|
251
290
|
},
|
|
252
291
|
async attach (data) {
|
|
253
292
|
const response = await transport.post('/entity_files', {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
entity_type: data.entityType,
|
|
257
|
-
file_unique_id: data.fileUniqueId,
|
|
258
|
-
display_order: data.displayOrder,
|
|
259
|
-
payload: data.payload
|
|
260
|
-
}
|
|
293
|
+
file_unique_id: data.fileUniqueId,
|
|
294
|
+
association_type: data.associationType
|
|
261
295
|
});
|
|
262
296
|
return decodeOne(response, entityFileMapper);
|
|
263
297
|
},
|
|
@@ -267,10 +301,15 @@ function createEntityFilesService(transport, _config) {
|
|
|
267
301
|
async update (uniqueId, data) {
|
|
268
302
|
const response = await transport.put(`/entity_files/${uniqueId}`, {
|
|
269
303
|
file: {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
304
|
+
name: data.name,
|
|
305
|
+
url: data.url,
|
|
306
|
+
thumbnail_url: data.thumbnailUrl,
|
|
307
|
+
media_url: data.mediaUrl,
|
|
308
|
+
content_url: data.contentUrl,
|
|
309
|
+
image_url: data.imageUrl,
|
|
310
|
+
file_type: data.fileType,
|
|
311
|
+
file_size: data.fileSize,
|
|
312
|
+
description: data.description
|
|
274
313
|
}
|
|
275
314
|
});
|
|
276
315
|
return decodeOne(response, entityFileMapper);
|
|
@@ -347,31 +386,21 @@ function createFileSchemasService(transport, _config) {
|
|
|
347
386
|
},
|
|
348
387
|
async create (data) {
|
|
349
388
|
const response = await transport.post('/file_schemas', {
|
|
350
|
-
|
|
389
|
+
schema: {
|
|
351
390
|
code: data.code,
|
|
352
391
|
name: data.name,
|
|
353
392
|
description: data.description,
|
|
354
|
-
|
|
355
|
-
max_file_size: data.maxFileSize,
|
|
356
|
-
required: data.required,
|
|
357
|
-
multiple: data.multiple,
|
|
358
|
-
payload: data.payload
|
|
393
|
+
schema_model: data.schemaModel
|
|
359
394
|
}
|
|
360
395
|
});
|
|
361
396
|
return decodeOne(response, fileSchemaMapper);
|
|
362
397
|
},
|
|
363
398
|
async update (uniqueId, data) {
|
|
364
399
|
const response = await transport.put(`/file_schemas/${uniqueId}`, {
|
|
365
|
-
|
|
400
|
+
schema: {
|
|
366
401
|
name: data.name,
|
|
367
402
|
description: data.description,
|
|
368
|
-
|
|
369
|
-
max_file_size: data.maxFileSize,
|
|
370
|
-
required: data.required,
|
|
371
|
-
multiple: data.multiple,
|
|
372
|
-
enabled: data.enabled,
|
|
373
|
-
status: data.status,
|
|
374
|
-
payload: data.payload
|
|
403
|
+
schema_model: data.schemaModel
|
|
375
404
|
}
|
|
376
405
|
});
|
|
377
406
|
return decodeOne(response, fileSchemaMapper);
|
|
@@ -427,14 +456,35 @@ function createUserFilesService(transport, _config) {
|
|
|
427
456
|
async add (userUniqueId, data) {
|
|
428
457
|
const response = await transport.post(`/users/${userUniqueId}/files`, {
|
|
429
458
|
file: {
|
|
430
|
-
|
|
459
|
+
name: data.name,
|
|
431
460
|
file_type: data.fileType,
|
|
432
461
|
file_size: data.fileSize,
|
|
433
|
-
mime_type: data.mimeType,
|
|
434
462
|
url: data.url,
|
|
435
463
|
thumbnail_url: data.thumbnailUrl,
|
|
436
|
-
|
|
437
|
-
|
|
464
|
+
media_url: data.mediaUrl,
|
|
465
|
+
content_url: data.contentUrl,
|
|
466
|
+
image_url: data.imageUrl,
|
|
467
|
+
description: data.description,
|
|
468
|
+
original_name: data.originalName,
|
|
469
|
+
original_file: data.originalFile,
|
|
470
|
+
virtual_folder: data.virtualFolder,
|
|
471
|
+
category_name: data.categoryName,
|
|
472
|
+
category_unique_id: data.categoryUniqueId,
|
|
473
|
+
tags: data.tags,
|
|
474
|
+
is_public: data.isPublic,
|
|
475
|
+
access_level: data.accessLevel,
|
|
476
|
+
ai_enabled: data.aiEnabled,
|
|
477
|
+
is_temp: data.isTemp,
|
|
478
|
+
raw_content: data.rawContent,
|
|
479
|
+
content: data.content,
|
|
480
|
+
file_structure: data.fileStructure,
|
|
481
|
+
metadata: data.metadata,
|
|
482
|
+
structured_content: data.structuredContent,
|
|
483
|
+
schema_model: data.schemaModel,
|
|
484
|
+
is_expirable: data.isExpirable,
|
|
485
|
+
issued_at: data.issuedAt,
|
|
486
|
+
expires_at: data.expiresAt,
|
|
487
|
+
issued_by: data.issuedBy
|
|
438
488
|
}
|
|
439
489
|
});
|
|
440
490
|
return decodeOne(response, userFileMapper);
|
|
@@ -442,11 +492,35 @@ function createUserFilesService(transport, _config) {
|
|
|
442
492
|
async update (userUniqueId, fileUniqueId, data) {
|
|
443
493
|
const response = await transport.put(`/users/${userUniqueId}/files/${fileUniqueId}`, {
|
|
444
494
|
file: {
|
|
445
|
-
|
|
495
|
+
name: data.name,
|
|
446
496
|
file_type: data.fileType,
|
|
497
|
+
file_size: data.fileSize,
|
|
498
|
+
url: data.url,
|
|
447
499
|
thumbnail_url: data.thumbnailUrl,
|
|
448
|
-
|
|
449
|
-
|
|
500
|
+
media_url: data.mediaUrl,
|
|
501
|
+
content_url: data.contentUrl,
|
|
502
|
+
image_url: data.imageUrl,
|
|
503
|
+
description: data.description,
|
|
504
|
+
original_name: data.originalName,
|
|
505
|
+
original_file: data.originalFile,
|
|
506
|
+
virtual_folder: data.virtualFolder,
|
|
507
|
+
category_name: data.categoryName,
|
|
508
|
+
category_unique_id: data.categoryUniqueId,
|
|
509
|
+
tags: data.tags,
|
|
510
|
+
is_public: data.isPublic,
|
|
511
|
+
access_level: data.accessLevel,
|
|
512
|
+
ai_enabled: data.aiEnabled,
|
|
513
|
+
is_temp: data.isTemp,
|
|
514
|
+
raw_content: data.rawContent,
|
|
515
|
+
content: data.content,
|
|
516
|
+
file_structure: data.fileStructure,
|
|
517
|
+
metadata: data.metadata,
|
|
518
|
+
structured_content: data.structuredContent,
|
|
519
|
+
schema_model: data.schemaModel,
|
|
520
|
+
is_expirable: data.isExpirable,
|
|
521
|
+
issued_at: data.issuedAt,
|
|
522
|
+
expires_at: data.expiresAt,
|
|
523
|
+
issued_by: data.issuedBy
|
|
450
524
|
}
|
|
451
525
|
});
|
|
452
526
|
return decodeOne(response, userFileMapper);
|
|
@@ -456,12 +530,8 @@ function createUserFilesService(transport, _config) {
|
|
|
456
530
|
},
|
|
457
531
|
async presignUpload (userUniqueId, data) {
|
|
458
532
|
const response = await transport.put(`/users/${userUniqueId}/presign_upload`, {
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
file_type: data.fileType,
|
|
462
|
-
mime_type: data.mimeType,
|
|
463
|
-
schema_unique_id: data.schemaUniqueId
|
|
464
|
-
}
|
|
533
|
+
file_name: data.fileName,
|
|
534
|
+
serialization: data.serialization
|
|
465
535
|
});
|
|
466
536
|
return {
|
|
467
537
|
presignedUrl: response.presigned_url,
|
|
@@ -472,13 +542,9 @@ function createUserFilesService(transport, _config) {
|
|
|
472
542
|
},
|
|
473
543
|
async multipartPresign (userUniqueId, data) {
|
|
474
544
|
const response = await transport.post(`/users/${userUniqueId}/multipart_presign_upload`, {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
file_size: data.fileSize,
|
|
479
|
-
mime_type: data.mimeType,
|
|
480
|
-
part_size: data.partSize
|
|
481
|
-
}
|
|
545
|
+
filename: data.fileName,
|
|
546
|
+
part_count: data.partCount,
|
|
547
|
+
serialization: data.serialization
|
|
482
548
|
});
|
|
483
549
|
return {
|
|
484
550
|
uploadId: response.upload_id,
|
|
@@ -491,14 +557,13 @@ function createUserFilesService(transport, _config) {
|
|
|
491
557
|
},
|
|
492
558
|
async multipartComplete (userUniqueId, data) {
|
|
493
559
|
const response = await transport.post(`/users/${userUniqueId}/multipart_complete_upload`, {
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
}
|
|
560
|
+
filename: data.fileName,
|
|
561
|
+
upload_id: data.uploadId,
|
|
562
|
+
parts: data.parts.map((p)=>({
|
|
563
|
+
ETag: p.etag,
|
|
564
|
+
PartNumber: p.partNumber
|
|
565
|
+
})),
|
|
566
|
+
serialization: data.serialization
|
|
502
567
|
});
|
|
503
568
|
return decodeOne(response, userFileMapper);
|
|
504
569
|
},
|
|
@@ -518,10 +583,10 @@ function createUserFilesService(transport, _config) {
|
|
|
518
583
|
const response = await transport.put(`/users/${userUniqueId}/files/${fileUniqueId}/unpublish`, {});
|
|
519
584
|
return decodeOne(response, userFileMapper);
|
|
520
585
|
},
|
|
521
|
-
async addTag (userUniqueId, fileUniqueId,
|
|
586
|
+
async addTag (userUniqueId, fileUniqueId, tagValue) {
|
|
522
587
|
const response = await transport.post(`/users/${userUniqueId}/files/${fileUniqueId}/tags`, {
|
|
523
588
|
tag: {
|
|
524
|
-
|
|
589
|
+
tag: tagValue
|
|
525
590
|
}
|
|
526
591
|
});
|
|
527
592
|
return decodeOne(response, userFileMapper);
|
|
@@ -529,15 +594,22 @@ function createUserFilesService(transport, _config) {
|
|
|
529
594
|
async removeTag (userUniqueId, fileUniqueId, tagUniqueId) {
|
|
530
595
|
await transport.delete(`/users/${userUniqueId}/files/${fileUniqueId}/tags/${tagUniqueId}`);
|
|
531
596
|
},
|
|
532
|
-
async bulkUpdateTags (userUniqueId,
|
|
597
|
+
async bulkUpdateTags (userUniqueId, tags) {
|
|
533
598
|
await transport.post(`/users/${userUniqueId}/tags`, {
|
|
534
|
-
|
|
535
|
-
|
|
599
|
+
file: {
|
|
600
|
+
tags
|
|
536
601
|
}
|
|
537
602
|
});
|
|
538
603
|
},
|
|
539
|
-
async requestAccess (userUniqueId, fileUniqueId) {
|
|
540
|
-
await transport.post(`/users/${userUniqueId}/files/${fileUniqueId}/requests/access`, {
|
|
604
|
+
async requestAccess (userUniqueId, fileUniqueId, data) {
|
|
605
|
+
await transport.post(`/users/${userUniqueId}/files/${fileUniqueId}/requests/access`, {
|
|
606
|
+
access: {
|
|
607
|
+
user_unique_id: data.userUniqueId,
|
|
608
|
+
access_type: data.accessType,
|
|
609
|
+
starts_at: data.startsAt,
|
|
610
|
+
expires_at: data.expiresAt
|
|
611
|
+
}
|
|
612
|
+
});
|
|
541
613
|
},
|
|
542
614
|
async getAccess (userUniqueId, fileUniqueId) {
|
|
543
615
|
const response = await transport.get(`/users/${userUniqueId}/files/${fileUniqueId}/access`);
|
|
@@ -556,9 +628,11 @@ function createUserFilesService(transport, _config) {
|
|
|
556
628
|
async grantAccess (userUniqueId, fileUniqueId, data) {
|
|
557
629
|
const response = await transport.post(`/users/${userUniqueId}/files/${fileUniqueId}/access/grant`, {
|
|
558
630
|
access: {
|
|
559
|
-
|
|
631
|
+
user_unique_id: data.userUniqueId,
|
|
560
632
|
access_type: data.accessType,
|
|
561
|
-
expires_at: data.expiresAt
|
|
633
|
+
expires_at: data.expiresAt,
|
|
634
|
+
starts_at: data.startsAt,
|
|
635
|
+
user_unique_ids: data.userUniqueIds
|
|
562
636
|
}
|
|
563
637
|
});
|
|
564
638
|
var _response_unique_id, _response_file_unique_id, _response_grantee_unique_id, _response_access_type;
|
|
@@ -630,12 +704,12 @@ function createUserFilesService(transport, _config) {
|
|
|
630
704
|
async listGrantedDelegations (userUniqueId) {
|
|
631
705
|
const response = await transport.get(`/users/${userUniqueId}/delegations/granted`);
|
|
632
706
|
return (response.data || []).map((item)=>{
|
|
633
|
-
var _item_unique_id, _item_granter_unique_id, _item_grantee_unique_id,
|
|
707
|
+
var _item_unique_id, _item_granter_unique_id, _item_grantee_unique_id, _item_access_type;
|
|
634
708
|
return {
|
|
635
709
|
uniqueId: String((_item_unique_id = item['unique_id']) != null ? _item_unique_id : ''),
|
|
636
710
|
granterUniqueId: String((_item_granter_unique_id = item['granter_unique_id']) != null ? _item_granter_unique_id : ''),
|
|
637
711
|
granteeUniqueId: String((_item_grantee_unique_id = item['grantee_unique_id']) != null ? _item_grantee_unique_id : ''),
|
|
638
|
-
|
|
712
|
+
accessType: String((_item_access_type = item['access_type']) != null ? _item_access_type : ''),
|
|
639
713
|
createdAt: new Date(item['created_at']),
|
|
640
714
|
expiresAt: item['expires_at'] ? new Date(item['expires_at']) : undefined
|
|
641
715
|
};
|
|
@@ -644,12 +718,12 @@ function createUserFilesService(transport, _config) {
|
|
|
644
718
|
async listReceivedDelegations (userUniqueId) {
|
|
645
719
|
const response = await transport.get(`/users/${userUniqueId}/delegations/received`);
|
|
646
720
|
return (response.data || []).map((item)=>{
|
|
647
|
-
var _item_unique_id, _item_granter_unique_id, _item_grantee_unique_id,
|
|
721
|
+
var _item_unique_id, _item_granter_unique_id, _item_grantee_unique_id, _item_access_type;
|
|
648
722
|
return {
|
|
649
723
|
uniqueId: String((_item_unique_id = item['unique_id']) != null ? _item_unique_id : ''),
|
|
650
724
|
granterUniqueId: String((_item_granter_unique_id = item['granter_unique_id']) != null ? _item_granter_unique_id : ''),
|
|
651
725
|
granteeUniqueId: String((_item_grantee_unique_id = item['grantee_unique_id']) != null ? _item_grantee_unique_id : ''),
|
|
652
|
-
|
|
726
|
+
accessType: String((_item_access_type = item['access_type']) != null ? _item_access_type : ''),
|
|
653
727
|
createdAt: new Date(item['created_at']),
|
|
654
728
|
expiresAt: item['expires_at'] ? new Date(item['expires_at']) : undefined
|
|
655
729
|
};
|
|
@@ -657,30 +731,31 @@ function createUserFilesService(transport, _config) {
|
|
|
657
731
|
},
|
|
658
732
|
async getDelegation (userUniqueId, delegationUniqueId) {
|
|
659
733
|
const response = await transport.get(`/users/${userUniqueId}/delegations/${delegationUniqueId}`);
|
|
660
|
-
var _response_unique_id, _response_granter_unique_id, _response_grantee_unique_id,
|
|
734
|
+
var _response_unique_id, _response_granter_unique_id, _response_grantee_unique_id, _response_access_type;
|
|
661
735
|
return {
|
|
662
736
|
uniqueId: String((_response_unique_id = response['unique_id']) != null ? _response_unique_id : ''),
|
|
663
737
|
granterUniqueId: String((_response_granter_unique_id = response['granter_unique_id']) != null ? _response_granter_unique_id : ''),
|
|
664
738
|
granteeUniqueId: String((_response_grantee_unique_id = response['grantee_unique_id']) != null ? _response_grantee_unique_id : ''),
|
|
665
|
-
|
|
739
|
+
accessType: String((_response_access_type = response['access_type']) != null ? _response_access_type : ''),
|
|
666
740
|
createdAt: new Date(response['created_at']),
|
|
667
741
|
expiresAt: response['expires_at'] ? new Date(response['expires_at']) : undefined
|
|
668
742
|
};
|
|
669
743
|
},
|
|
670
744
|
async createDelegation (userUniqueId, data) {
|
|
671
745
|
const response = await transport.post(`/users/${userUniqueId}/delegations`, {
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
expires_at: data.expiresAt
|
|
746
|
+
access: {
|
|
747
|
+
grantee_user_unique_id: data.granteeUserUniqueId,
|
|
748
|
+
access_type: data.accessType,
|
|
749
|
+
expires_at: data.expiresAt,
|
|
750
|
+
starts_at: data.startsAt
|
|
676
751
|
}
|
|
677
752
|
});
|
|
678
|
-
var _response_unique_id, _response_granter_unique_id, _response_grantee_unique_id,
|
|
753
|
+
var _response_unique_id, _response_granter_unique_id, _response_grantee_unique_id, _response_access_type;
|
|
679
754
|
return {
|
|
680
755
|
uniqueId: String((_response_unique_id = response['unique_id']) != null ? _response_unique_id : ''),
|
|
681
756
|
granterUniqueId: String((_response_granter_unique_id = response['granter_unique_id']) != null ? _response_granter_unique_id : ''),
|
|
682
757
|
granteeUniqueId: String((_response_grantee_unique_id = response['grantee_unique_id']) != null ? _response_grantee_unique_id : ''),
|
|
683
|
-
|
|
758
|
+
accessType: String((_response_access_type = response['access_type']) != null ? _response_access_type : ''),
|
|
684
759
|
createdAt: new Date(response['created_at']),
|
|
685
760
|
expiresAt: response['expires_at'] ? new Date(response['expires_at']) : undefined
|
|
686
761
|
};
|
|
@@ -736,11 +811,11 @@ function createFileCategoriesService(transport, _config) {
|
|
|
736
811
|
code: data.code,
|
|
737
812
|
name: data.name,
|
|
738
813
|
description: data.description,
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
814
|
+
parent_id: data.parentId,
|
|
815
|
+
thumbnail_url: data.thumbnailUrl,
|
|
816
|
+
image_url: data.imageUrl,
|
|
817
|
+
content_url: data.contentUrl,
|
|
818
|
+
display_order: data.displayOrder
|
|
744
819
|
}
|
|
745
820
|
});
|
|
746
821
|
return decodeOne(response, fileCategoryMapper);
|
|
@@ -750,13 +825,13 @@ function createFileCategoriesService(transport, _config) {
|
|
|
750
825
|
category: {
|
|
751
826
|
name: data.name,
|
|
752
827
|
description: data.description,
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
828
|
+
parent_id: data.parentId,
|
|
829
|
+
thumbnail_url: data.thumbnailUrl,
|
|
830
|
+
image_url: data.imageUrl,
|
|
831
|
+
content_url: data.contentUrl,
|
|
832
|
+
display_order: data.displayOrder,
|
|
757
833
|
enabled: data.enabled,
|
|
758
|
-
status: data.status
|
|
759
|
-
payload: data.payload
|
|
834
|
+
status: data.status
|
|
760
835
|
}
|
|
761
836
|
});
|
|
762
837
|
return decodeOne(response, fileCategoryMapper);
|
|
@@ -810,12 +885,12 @@ function createFileTagsService(transport, _config) {
|
|
|
810
885
|
async create (data) {
|
|
811
886
|
const response = await transport.post('/tags', {
|
|
812
887
|
tag: {
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
888
|
+
tag: data.tag,
|
|
889
|
+
unique_id: data.uniqueId,
|
|
890
|
+
thumbnail_url: data.thumbnailUrl,
|
|
891
|
+
image_url: data.imageUrl,
|
|
892
|
+
content_url: data.contentUrl,
|
|
893
|
+
media_url: data.mediaUrl
|
|
819
894
|
}
|
|
820
895
|
});
|
|
821
896
|
return decodeOne(response, fileTagMapper);
|
|
@@ -823,13 +898,13 @@ function createFileTagsService(transport, _config) {
|
|
|
823
898
|
async update (uniqueId, data) {
|
|
824
899
|
const response = await transport.put(`/tags/${uniqueId}`, {
|
|
825
900
|
tag: {
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
901
|
+
tag: data.tag,
|
|
902
|
+
unique_id: data.uniqueId,
|
|
903
|
+
thumbnail_url: data.thumbnailUrl,
|
|
904
|
+
image_url: data.imageUrl,
|
|
905
|
+
content_url: data.contentUrl,
|
|
906
|
+
media_url: data.mediaUrl,
|
|
907
|
+
status: data.status
|
|
833
908
|
}
|
|
834
909
|
});
|
|
835
910
|
return decodeOne(response, fileTagMapper);
|
|
@@ -837,9 +912,11 @@ function createFileTagsService(transport, _config) {
|
|
|
837
912
|
async delete (uniqueId) {
|
|
838
913
|
await transport.delete(`/tags/${uniqueId}`);
|
|
839
914
|
},
|
|
840
|
-
async addToFile (userUniqueId, fileUniqueId,
|
|
915
|
+
async addToFile (userUniqueId, fileUniqueId, tagValue) {
|
|
841
916
|
await transport.post(`/users/${userUniqueId}/files/${fileUniqueId}/tags`, {
|
|
842
|
-
|
|
917
|
+
tag: {
|
|
918
|
+
tag: tagValue
|
|
919
|
+
}
|
|
843
920
|
});
|
|
844
921
|
},
|
|
845
922
|
async removeFromFile (userUniqueId, fileUniqueId, tagUniqueId) {
|
|
@@ -888,25 +965,22 @@ function createDelegationsService(transport, _config) {
|
|
|
888
965
|
},
|
|
889
966
|
async create (userUniqueId, data) {
|
|
890
967
|
const response = await transport.post(`/users/${userUniqueId}/delegations`, {
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
folder_unique_id: data.folderUniqueId,
|
|
895
|
-
permissions: data.permissions,
|
|
968
|
+
access: {
|
|
969
|
+
grantee_user_unique_id: data.granteeUserUniqueId,
|
|
970
|
+
access_type: data.accessType,
|
|
896
971
|
expires_at: data.expiresAt,
|
|
897
|
-
|
|
972
|
+
starts_at: data.startsAt
|
|
898
973
|
}
|
|
899
974
|
});
|
|
900
975
|
return decodeOne(response, fileDelegationMapper);
|
|
901
976
|
},
|
|
902
977
|
async update (userUniqueId, uniqueId, data) {
|
|
903
978
|
const response = await transport.put(`/users/${userUniqueId}/delegations/${uniqueId}`, {
|
|
904
|
-
|
|
905
|
-
|
|
979
|
+
access: {
|
|
980
|
+
access_type: data.accessType,
|
|
981
|
+
grantee_user_unique_id: data.granteeUserUniqueId,
|
|
906
982
|
expires_at: data.expiresAt,
|
|
907
|
-
|
|
908
|
-
status: data.status,
|
|
909
|
-
payload: data.payload
|
|
983
|
+
starts_at: data.startsAt
|
|
910
984
|
}
|
|
911
985
|
});
|
|
912
986
|
return decodeOne(response, fileDelegationMapper);
|
|
@@ -972,25 +1046,23 @@ function createFileAccessService(transport, _config) {
|
|
|
972
1046
|
},
|
|
973
1047
|
async grant (data) {
|
|
974
1048
|
const response = await transport.post('/file_accesses', {
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
grantee_type: data.granteeType,
|
|
979
|
-
access_level: data.accessLevel,
|
|
1049
|
+
access: {
|
|
1050
|
+
user_unique_id: data.userUniqueId,
|
|
1051
|
+
access_type: data.accessType,
|
|
980
1052
|
expires_at: data.expiresAt,
|
|
981
|
-
|
|
1053
|
+
starts_at: data.startsAt,
|
|
1054
|
+
user_unique_ids: data.userUniqueIds
|
|
982
1055
|
}
|
|
983
1056
|
});
|
|
984
1057
|
return decodeOne(response, fileAccessMapper);
|
|
985
1058
|
},
|
|
986
1059
|
async update (uniqueId, data) {
|
|
987
1060
|
const response = await transport.put(`/file_accesses/${uniqueId}`, {
|
|
988
|
-
|
|
989
|
-
|
|
1061
|
+
access: {
|
|
1062
|
+
access_type: data.accessType,
|
|
990
1063
|
expires_at: data.expiresAt,
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
payload: data.payload
|
|
1064
|
+
starts_at: data.startsAt,
|
|
1065
|
+
user_unique_id: data.userUniqueId
|
|
994
1066
|
}
|
|
995
1067
|
});
|
|
996
1068
|
return decodeOne(response, fileAccessMapper);
|
|
@@ -1098,21 +1170,19 @@ const fileAccessRequestMapper = {
|
|
|
1098
1170
|
},
|
|
1099
1171
|
async create (data) {
|
|
1100
1172
|
const response = await transport.post('/file_access_requests', {
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1173
|
+
access: {
|
|
1174
|
+
user_unique_id: data.userUniqueId,
|
|
1175
|
+
access_type: data.accessType,
|
|
1176
|
+
starts_at: data.startsAt,
|
|
1177
|
+
expires_at: data.expiresAt
|
|
1106
1178
|
}
|
|
1107
1179
|
});
|
|
1108
1180
|
return decodeOne(response, fileAccessRequestMapper);
|
|
1109
1181
|
},
|
|
1110
1182
|
async review (uniqueId, decision) {
|
|
1111
1183
|
const response = await transport.put(`/file_access_requests/${uniqueId}/review`, {
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
review_note: decision.reviewNote,
|
|
1115
|
-
grant_expires_at: decision.grantExpiresAt
|
|
1184
|
+
access: {
|
|
1185
|
+
expires_at: decision.expiresAt
|
|
1116
1186
|
}
|
|
1117
1187
|
});
|
|
1118
1188
|
return decodeOne(response, fileAccessRequestMapper);
|
|
@@ -18,7 +18,7 @@ export interface DelegationsService {
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a new file delegation
|
|
20
20
|
* @param userUniqueId - The unique identifier of the delegating user
|
|
21
|
-
* @param data - Delegation details including
|
|
21
|
+
* @param data - Delegation details including grantee, access type, and optional dates
|
|
22
22
|
* @returns The newly created FileDelegation record
|
|
23
23
|
*/
|
|
24
24
|
create(userUniqueId: string, data: CreateFileDelegationRequest): Promise<FileDelegation>;
|
|
@@ -26,7 +26,7 @@ export interface DelegationsService {
|
|
|
26
26
|
* Update an existing file delegation
|
|
27
27
|
* @param userUniqueId - The unique identifier of the delegating user
|
|
28
28
|
* @param uniqueId - The unique identifier of the delegation to update
|
|
29
|
-
* @param data - Fields to update such as
|
|
29
|
+
* @param data - Fields to update such as access type or dates
|
|
30
30
|
* @returns The updated FileDelegation record
|
|
31
31
|
*/
|
|
32
32
|
update(userUniqueId: string, uniqueId: string, data: UpdateFileDelegationRequest): Promise<FileDelegation>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegations.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/delegations.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,cAAc,EACd,2BAA2B,EAC3B,2BAA2B,EAC3B,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AAGhC,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC;IAEpG;;;;;OAKG;IACH,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAErE;;;;;OAKG;IACH,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,2BAA2B,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAEzF;;;;;;OAMG;IACH,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,2BAA2B,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAE3G;;;;;OAKG;IACH,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9D;;;;OAIG;IACH,uBAAuB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;CAC1E;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,kBAAkB,
|
|
1
|
+
{"version":3,"file":"delegations.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/delegations.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,cAAc,EACd,2BAA2B,EAC3B,2BAA2B,EAC3B,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AAGhC,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC;IAEpG;;;;;OAKG;IACH,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAErE;;;;;OAKG;IACH,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,2BAA2B,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAEzF;;;;;;OAMG;IACH,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,2BAA2B,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAE3G;;;;;OAKG;IACH,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9D;;;;OAIG;IACH,uBAAuB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;CAC1E;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,kBAAkB,CAqD9G"}
|
|
@@ -14,8 +14,8 @@ export interface EntityFilesService {
|
|
|
14
14
|
*/
|
|
15
15
|
get(uniqueId: string): Promise<EntityFile>;
|
|
16
16
|
/**
|
|
17
|
-
* Attach a file to an entity
|
|
18
|
-
* @param data - Association details including
|
|
17
|
+
* Attach a file to an entity (associate_file action uses top-level params)
|
|
18
|
+
* @param data - Association details including file unique id and optional association type
|
|
19
19
|
* @returns The newly created EntityFile association
|
|
20
20
|
*/
|
|
21
21
|
attach(data: AttachFileRequest): Promise<EntityFile>;
|
|
@@ -28,7 +28,7 @@ export interface EntityFilesService {
|
|
|
28
28
|
/**
|
|
29
29
|
* Update an entity-file association
|
|
30
30
|
* @param uniqueId - The unique identifier of the entity-file record
|
|
31
|
-
* @param data - Fields to update such as
|
|
31
|
+
* @param data - Fields to update such as name, url, or description
|
|
32
32
|
* @returns The updated EntityFile record
|
|
33
33
|
*/
|
|
34
34
|
update(uniqueId: string, data: UpdateEntityFileRequest): Promise<EntityFile>;
|