@unisource/sdk 0.2.0 → 0.3.1
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/README.md +55 -23
- package/dist/index.d.mts +623 -21
- package/dist/index.mjs +438 -38
- package/package.json +8 -4
- package/src/client.ts +474 -233
- package/src/fileRecords.ts +99 -87
- package/src/folders.ts +97 -84
- package/src/index.ts +198 -106
- package/src/mainStorage.ts +51 -0
- package/src/primitives.ts +30 -25
- package/src/releases.ts +132 -0
- package/src/services.ts +137 -69
- package/src/shareLinks.ts +93 -0
- package/src/uploads.ts +99 -90
- package/dist/index.d.ts +0 -478
- package/src/uploadDestination.ts +0 -4
package/dist/index.d.mts
CHANGED
|
@@ -4,6 +4,8 @@ import { z } from "zod";
|
|
|
4
4
|
declare const nonEmptyString: z.ZodString;
|
|
5
5
|
declare const positiveInt: z.ZodNumber;
|
|
6
6
|
declare const unixTimestamp: z.ZodNumber;
|
|
7
|
+
declare const FILES_DEFAULT_LIMIT = 25;
|
|
8
|
+
declare const FILES_MAX_LIMIT = 100;
|
|
7
9
|
declare const uploadDestinationSchema: z.ZodEnum<{
|
|
8
10
|
appwrite: "appwrite";
|
|
9
11
|
r2: "r2";
|
|
@@ -26,6 +28,8 @@ declare const uploadR2InitRequestSchema: z.ZodObject<{
|
|
|
26
28
|
filename: z.ZodString;
|
|
27
29
|
size: z.ZodNumber;
|
|
28
30
|
mime_type: z.ZodString;
|
|
31
|
+
folder_id: z.ZodOptional<z.ZodString>;
|
|
32
|
+
is_main_storage: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
29
33
|
}, z.core.$strip>;
|
|
30
34
|
type UploadR2InitRequest = z.infer<typeof uploadR2InitRequestSchema>;
|
|
31
35
|
declare const uploadR2InitResponseSchema: z.ZodObject<{
|
|
@@ -41,6 +45,8 @@ declare const uploadAppwriteInitRequestSchema: z.ZodObject<{
|
|
|
41
45
|
filename: z.ZodString;
|
|
42
46
|
size: z.ZodNumber;
|
|
43
47
|
mime_type: z.ZodString;
|
|
48
|
+
folder_id: z.ZodOptional<z.ZodString>;
|
|
49
|
+
is_main_storage: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
44
50
|
}, z.core.$strip>;
|
|
45
51
|
type UploadAppwriteInitRequest = z.infer<typeof uploadAppwriteInitRequestSchema>;
|
|
46
52
|
declare const uploadAppwriteInitResponseSchema: z.ZodObject<{
|
|
@@ -55,6 +61,7 @@ declare const uploadAppwriteInitResponseSchema: z.ZodObject<{
|
|
|
55
61
|
type UploadAppwriteInitResponse = z.infer<typeof uploadAppwriteInitResponseSchema>;
|
|
56
62
|
declare const uploadLifecycleRequestSchema: z.ZodObject<{
|
|
57
63
|
upload_id: z.ZodString;
|
|
64
|
+
is_main_storage: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
58
65
|
}, z.core.$strip>;
|
|
59
66
|
type UploadLifecycleRequest = z.infer<typeof uploadLifecycleRequestSchema>;
|
|
60
67
|
declare const uploadCompleteResponseSchema: z.ZodObject<{
|
|
@@ -69,8 +76,6 @@ declare const uploadFailResponseSchema: z.ZodObject<{
|
|
|
69
76
|
status: z.ZodLiteral<"failed">;
|
|
70
77
|
}, z.core.$strip>;
|
|
71
78
|
type UploadFailResponse = z.infer<typeof uploadFailResponseSchema>;
|
|
72
|
-
declare const FILES_DEFAULT_LIMIT = 25;
|
|
73
|
-
declare const FILES_MAX_LIMIT = 100;
|
|
74
79
|
/** Raw upload record — returned by admin `/files` endpoints. */
|
|
75
80
|
declare const uploadRecordSchema: z.ZodObject<{
|
|
76
81
|
id: z.ZodString;
|
|
@@ -118,6 +123,29 @@ declare const uploadsListResponseSchema: z.ZodObject<{
|
|
|
118
123
|
limit: z.ZodNumber;
|
|
119
124
|
}, z.core.$strip>;
|
|
120
125
|
type UploadsListResponse = z.infer<typeof uploadsListResponseSchema>;
|
|
126
|
+
declare const uploadRecordDetailResponseSchema: z.ZodObject<{
|
|
127
|
+
upload: z.ZodObject<{
|
|
128
|
+
id: z.ZodString;
|
|
129
|
+
service_id: z.ZodString;
|
|
130
|
+
user_id: z.ZodNullable<z.ZodString>;
|
|
131
|
+
filename: z.ZodString;
|
|
132
|
+
size: z.ZodNumber;
|
|
133
|
+
mime_type: z.ZodString;
|
|
134
|
+
destination: z.ZodEnum<{
|
|
135
|
+
appwrite: "appwrite";
|
|
136
|
+
r2: "r2";
|
|
137
|
+
}>;
|
|
138
|
+
status: z.ZodEnum<{
|
|
139
|
+
completed: "completed";
|
|
140
|
+
failed: "failed";
|
|
141
|
+
pending: "pending";
|
|
142
|
+
}>;
|
|
143
|
+
expires_at: z.ZodNumber;
|
|
144
|
+
created_at: z.ZodNumber;
|
|
145
|
+
updated_at: z.ZodNumber;
|
|
146
|
+
}, z.core.$strip>;
|
|
147
|
+
}, z.core.$strip>;
|
|
148
|
+
type UploadRecordDetailResponse = z.infer<typeof uploadRecordDetailResponseSchema>;
|
|
121
149
|
//#endregion
|
|
122
150
|
//#region src/fileRecords.d.ts
|
|
123
151
|
/**
|
|
@@ -219,6 +247,31 @@ declare const fileRestoreResponseSchema: z.ZodObject<{
|
|
|
219
247
|
id: z.ZodString;
|
|
220
248
|
}, z.core.$strip>;
|
|
221
249
|
type FileRestoreResponse = z.infer<typeof fileRestoreResponseSchema>;
|
|
250
|
+
declare const fileUpdateRequestSchema: z.ZodObject<{
|
|
251
|
+
filename: z.ZodString;
|
|
252
|
+
}, z.core.$strip>;
|
|
253
|
+
type FileUpdateRequest = z.infer<typeof fileUpdateRequestSchema>;
|
|
254
|
+
declare const fileUpdateResponseSchema: z.ZodObject<{
|
|
255
|
+
file: z.ZodObject<{
|
|
256
|
+
id: z.ZodString;
|
|
257
|
+
service_id: z.ZodString;
|
|
258
|
+
user_id: z.ZodString;
|
|
259
|
+
folder_id: z.ZodNullable<z.ZodString>;
|
|
260
|
+
upload_id: z.ZodNullable<z.ZodString>;
|
|
261
|
+
filename: z.ZodString;
|
|
262
|
+
size: z.ZodNumber;
|
|
263
|
+
mime_type: z.ZodString;
|
|
264
|
+
storage_destination: z.ZodEnum<{
|
|
265
|
+
appwrite: "appwrite";
|
|
266
|
+
r2: "r2";
|
|
267
|
+
}>;
|
|
268
|
+
is_trashed: z.ZodBoolean;
|
|
269
|
+
trashed_at: z.ZodNullable<z.ZodNumber>;
|
|
270
|
+
created_at: z.ZodNumber;
|
|
271
|
+
updated_at: z.ZodNumber;
|
|
272
|
+
}, z.core.$strip>;
|
|
273
|
+
}, z.core.$strip>;
|
|
274
|
+
type FileUpdateResponse = z.infer<typeof fileUpdateResponseSchema>;
|
|
222
275
|
//#endregion
|
|
223
276
|
//#region src/folders.d.ts
|
|
224
277
|
declare const folderSchema: z.ZodObject<{
|
|
@@ -236,6 +289,7 @@ declare const folderSchema: z.ZodObject<{
|
|
|
236
289
|
type Folder = z.infer<typeof folderSchema>;
|
|
237
290
|
declare const folderListQuerySchema: z.ZodObject<{
|
|
238
291
|
parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
292
|
+
trashed: z.ZodOptional<z.ZodBoolean>;
|
|
239
293
|
is_trashed: z.ZodOptional<z.ZodBoolean>;
|
|
240
294
|
cursor: z.ZodOptional<z.ZodString>;
|
|
241
295
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
@@ -306,6 +360,21 @@ declare const folderDeleteResponseSchema: z.ZodObject<{
|
|
|
306
360
|
folders_deleted: z.ZodOptional<z.ZodNumber>;
|
|
307
361
|
}, z.core.$strip>;
|
|
308
362
|
type FolderDeleteResponse = z.infer<typeof folderDeleteResponseSchema>;
|
|
363
|
+
declare const folderDetailResponseSchema: z.ZodObject<{
|
|
364
|
+
folder: z.ZodObject<{
|
|
365
|
+
id: z.ZodString;
|
|
366
|
+
service_id: z.ZodString;
|
|
367
|
+
user_id: z.ZodString;
|
|
368
|
+
parent_id: z.ZodNullable<z.ZodString>;
|
|
369
|
+
name: z.ZodString;
|
|
370
|
+
color_tag: z.ZodNullable<z.ZodString>;
|
|
371
|
+
is_trashed: z.ZodBoolean;
|
|
372
|
+
trashed_at: z.ZodNullable<z.ZodNumber>;
|
|
373
|
+
created_at: z.ZodNumber;
|
|
374
|
+
updated_at: z.ZodNumber;
|
|
375
|
+
}, z.core.$strip>;
|
|
376
|
+
}, z.core.$strip>;
|
|
377
|
+
type FolderDetailResponse = z.infer<typeof folderDetailResponseSchema>;
|
|
309
378
|
declare const folderRestoreResponseSchema: z.ZodObject<{
|
|
310
379
|
success: z.ZodLiteral<true>;
|
|
311
380
|
id: z.ZodString;
|
|
@@ -334,6 +403,22 @@ declare const serviceDetailResponseSchema: z.ZodObject<{
|
|
|
334
403
|
}, z.core.$strip>;
|
|
335
404
|
}, z.core.$strip>;
|
|
336
405
|
type ServiceDetailResponse = z.infer<typeof serviceDetailResponseSchema>;
|
|
406
|
+
declare const adminServiceUpdateRequestSchema: z.ZodObject<{
|
|
407
|
+
max_storage_bytes: z.ZodOptional<z.ZodNumber>;
|
|
408
|
+
max_file_size_bytes: z.ZodOptional<z.ZodNumber>;
|
|
409
|
+
}, z.core.$strip>;
|
|
410
|
+
type AdminServiceUpdateRequest = z.infer<typeof adminServiceUpdateRequestSchema>;
|
|
411
|
+
declare const adminServiceUpdateResponseSchema: z.ZodObject<{
|
|
412
|
+
service: z.ZodObject<{
|
|
413
|
+
id: z.ZodString;
|
|
414
|
+
name: z.ZodString;
|
|
415
|
+
max_storage_bytes: z.ZodNumber;
|
|
416
|
+
current_used_bytes: z.ZodNumber;
|
|
417
|
+
max_file_size_bytes: z.ZodNumber;
|
|
418
|
+
created_at: z.ZodNumber;
|
|
419
|
+
}, z.core.$strip>;
|
|
420
|
+
}, z.core.$strip>;
|
|
421
|
+
type AdminServiceUpdateResponse = z.infer<typeof adminServiceUpdateResponseSchema>;
|
|
337
422
|
declare const serviceUsageResponseSchema: z.ZodObject<{
|
|
338
423
|
service_id: z.ZodString;
|
|
339
424
|
max_storage_bytes: z.ZodNumber;
|
|
@@ -345,6 +430,8 @@ declare const auditEventActionSchema: z.ZodEnum<{
|
|
|
345
430
|
file_deleted: "file_deleted";
|
|
346
431
|
folder_deleted: "folder_deleted";
|
|
347
432
|
quota_exceeded: "quota_exceeded";
|
|
433
|
+
quota_reconciled: "quota_reconciled";
|
|
434
|
+
share_link_accessed: "share_link_accessed";
|
|
348
435
|
upload_completed: "upload_completed";
|
|
349
436
|
}>;
|
|
350
437
|
type AuditEventAction = z.infer<typeof auditEventActionSchema>;
|
|
@@ -356,6 +443,8 @@ declare const auditEventSchema: z.ZodObject<{
|
|
|
356
443
|
file_deleted: "file_deleted";
|
|
357
444
|
folder_deleted: "folder_deleted";
|
|
358
445
|
quota_exceeded: "quota_exceeded";
|
|
446
|
+
quota_reconciled: "quota_reconciled";
|
|
447
|
+
share_link_accessed: "share_link_accessed";
|
|
359
448
|
upload_completed: "upload_completed";
|
|
360
449
|
}>;
|
|
361
450
|
resource_type: z.ZodEnum<{
|
|
@@ -366,6 +455,8 @@ declare const auditEventSchema: z.ZodObject<{
|
|
|
366
455
|
resource_id: z.ZodString;
|
|
367
456
|
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
368
457
|
ip_address: z.ZodNullable<z.ZodString>;
|
|
458
|
+
actor_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
459
|
+
target_user_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
369
460
|
created_at: z.ZodNumber;
|
|
370
461
|
}, z.core.$strip>;
|
|
371
462
|
type AuditEvent = z.infer<typeof auditEventSchema>;
|
|
@@ -375,6 +466,8 @@ declare const auditLogListQuerySchema: z.ZodObject<{
|
|
|
375
466
|
file_deleted: "file_deleted";
|
|
376
467
|
folder_deleted: "folder_deleted";
|
|
377
468
|
quota_exceeded: "quota_exceeded";
|
|
469
|
+
quota_reconciled: "quota_reconciled";
|
|
470
|
+
share_link_accessed: "share_link_accessed";
|
|
378
471
|
upload_completed: "upload_completed";
|
|
379
472
|
}>>;
|
|
380
473
|
resource_type: z.ZodOptional<z.ZodEnum<{
|
|
@@ -395,6 +488,8 @@ declare const auditLogListResponseSchema: z.ZodObject<{
|
|
|
395
488
|
file_deleted: "file_deleted";
|
|
396
489
|
folder_deleted: "folder_deleted";
|
|
397
490
|
quota_exceeded: "quota_exceeded";
|
|
491
|
+
quota_reconciled: "quota_reconciled";
|
|
492
|
+
share_link_accessed: "share_link_accessed";
|
|
398
493
|
upload_completed: "upload_completed";
|
|
399
494
|
}>;
|
|
400
495
|
resource_type: z.ZodEnum<{
|
|
@@ -405,12 +500,438 @@ declare const auditLogListResponseSchema: z.ZodObject<{
|
|
|
405
500
|
resource_id: z.ZodString;
|
|
406
501
|
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
407
502
|
ip_address: z.ZodNullable<z.ZodString>;
|
|
503
|
+
actor_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
504
|
+
target_user_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
408
505
|
created_at: z.ZodNumber;
|
|
409
506
|
}, z.core.$strip>>;
|
|
410
507
|
next_cursor: z.ZodNullable<z.ZodString>;
|
|
411
508
|
limit: z.ZodNumber;
|
|
412
509
|
}, z.core.$strip>;
|
|
413
510
|
type AuditLogListResponse = z.infer<typeof auditLogListResponseSchema>;
|
|
511
|
+
declare const adminUserSchema: z.ZodObject<{
|
|
512
|
+
id: z.ZodString;
|
|
513
|
+
name: z.ZodString;
|
|
514
|
+
email: z.ZodString;
|
|
515
|
+
status: z.ZodBoolean;
|
|
516
|
+
labels: z.ZodArray<z.ZodString>;
|
|
517
|
+
role: z.ZodString;
|
|
518
|
+
has_service_access: z.ZodBoolean;
|
|
519
|
+
max_storage_bytes: z.ZodNullable<z.ZodNumber>;
|
|
520
|
+
effective_max_storage_bytes: z.ZodNumber;
|
|
521
|
+
current_used_bytes: z.ZodNumber;
|
|
522
|
+
registration: z.ZodNumber;
|
|
523
|
+
email_verification: z.ZodBoolean;
|
|
524
|
+
}, z.core.$strip>;
|
|
525
|
+
type AdminUser = z.infer<typeof adminUserSchema>;
|
|
526
|
+
declare const adminUserListResponseSchema: z.ZodObject<{
|
|
527
|
+
items: z.ZodArray<z.ZodObject<{
|
|
528
|
+
id: z.ZodString;
|
|
529
|
+
name: z.ZodString;
|
|
530
|
+
email: z.ZodString;
|
|
531
|
+
status: z.ZodBoolean;
|
|
532
|
+
labels: z.ZodArray<z.ZodString>;
|
|
533
|
+
role: z.ZodString;
|
|
534
|
+
has_service_access: z.ZodBoolean;
|
|
535
|
+
max_storage_bytes: z.ZodNullable<z.ZodNumber>;
|
|
536
|
+
effective_max_storage_bytes: z.ZodNumber;
|
|
537
|
+
current_used_bytes: z.ZodNumber;
|
|
538
|
+
registration: z.ZodNumber;
|
|
539
|
+
email_verification: z.ZodBoolean;
|
|
540
|
+
}, z.core.$strip>>;
|
|
541
|
+
total: z.ZodNumber;
|
|
542
|
+
offset: z.ZodNumber;
|
|
543
|
+
limit: z.ZodNumber;
|
|
544
|
+
}, z.core.$strip>;
|
|
545
|
+
type AdminUserListResponse = z.infer<typeof adminUserListResponseSchema>;
|
|
546
|
+
declare const adminUserUpdateRequestSchema: z.ZodObject<{
|
|
547
|
+
name: z.ZodOptional<z.ZodString>;
|
|
548
|
+
email: z.ZodOptional<z.ZodString>;
|
|
549
|
+
status: z.ZodOptional<z.ZodBoolean>;
|
|
550
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
551
|
+
role: z.ZodOptional<z.ZodEnum<{
|
|
552
|
+
admin: "admin";
|
|
553
|
+
plus: "plus";
|
|
554
|
+
user: "user";
|
|
555
|
+
}>>;
|
|
556
|
+
max_storage_bytes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
557
|
+
}, z.core.$strip>;
|
|
558
|
+
type AdminUserUpdateRequest = z.infer<typeof adminUserUpdateRequestSchema>;
|
|
559
|
+
declare const adminUserUpdateResponseSchema: z.ZodObject<{
|
|
560
|
+
user: z.ZodObject<{
|
|
561
|
+
id: z.ZodString;
|
|
562
|
+
name: z.ZodString;
|
|
563
|
+
email: z.ZodString;
|
|
564
|
+
status: z.ZodBoolean;
|
|
565
|
+
labels: z.ZodArray<z.ZodString>;
|
|
566
|
+
role: z.ZodString;
|
|
567
|
+
has_service_access: z.ZodBoolean;
|
|
568
|
+
max_storage_bytes: z.ZodNullable<z.ZodNumber>;
|
|
569
|
+
effective_max_storage_bytes: z.ZodNumber;
|
|
570
|
+
current_used_bytes: z.ZodNumber;
|
|
571
|
+
registration: z.ZodNumber;
|
|
572
|
+
email_verification: z.ZodBoolean;
|
|
573
|
+
}, z.core.$strip>;
|
|
574
|
+
}, z.core.$strip>;
|
|
575
|
+
type AdminUserUpdateResponse = z.infer<typeof adminUserUpdateResponseSchema>;
|
|
576
|
+
declare const adminUserPasswordResetRequestSchema: z.ZodObject<{
|
|
577
|
+
password: z.ZodString;
|
|
578
|
+
}, z.core.$strip>;
|
|
579
|
+
type AdminUserPasswordResetRequest = z.infer<typeof adminUserPasswordResetRequestSchema>;
|
|
580
|
+
declare const adminUserPasswordResetResponseSchema: z.ZodObject<{
|
|
581
|
+
success: z.ZodLiteral<true>;
|
|
582
|
+
user_id: z.ZodString;
|
|
583
|
+
}, z.core.$strip>;
|
|
584
|
+
type AdminUserPasswordResetResponse = z.infer<typeof adminUserPasswordResetResponseSchema>;
|
|
585
|
+
//#endregion
|
|
586
|
+
//#region src/mainStorage.d.ts
|
|
587
|
+
declare const mainStorageListQuerySchema: z.ZodObject<{
|
|
588
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
589
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
590
|
+
}, z.core.$strip>;
|
|
591
|
+
type MainStorageListQuery = z.infer<typeof mainStorageListQuerySchema>;
|
|
592
|
+
declare const mainStorageFileSchema: z.ZodObject<{
|
|
593
|
+
id: z.ZodString;
|
|
594
|
+
service_id: z.ZodString;
|
|
595
|
+
user_id: z.ZodString;
|
|
596
|
+
folder_id: z.ZodNullable<z.ZodString>;
|
|
597
|
+
upload_id: z.ZodNullable<z.ZodString>;
|
|
598
|
+
filename: z.ZodString;
|
|
599
|
+
size: z.ZodNumber;
|
|
600
|
+
mime_type: z.ZodString;
|
|
601
|
+
storage_destination: z.ZodEnum<{
|
|
602
|
+
appwrite: "appwrite";
|
|
603
|
+
r2: "r2";
|
|
604
|
+
}>;
|
|
605
|
+
is_trashed: z.ZodBoolean;
|
|
606
|
+
trashed_at: z.ZodNullable<z.ZodNumber>;
|
|
607
|
+
created_at: z.ZodNumber;
|
|
608
|
+
updated_at: z.ZodNumber;
|
|
609
|
+
}, z.core.$strip>;
|
|
610
|
+
type MainStorageFile = z.infer<typeof mainStorageFileSchema>;
|
|
611
|
+
declare const mainStorageListResponseSchema: z.ZodObject<{
|
|
612
|
+
items: z.ZodArray<z.ZodObject<{
|
|
613
|
+
id: z.ZodString;
|
|
614
|
+
service_id: z.ZodString;
|
|
615
|
+
user_id: z.ZodString;
|
|
616
|
+
folder_id: z.ZodNullable<z.ZodString>;
|
|
617
|
+
upload_id: z.ZodNullable<z.ZodString>;
|
|
618
|
+
filename: z.ZodString;
|
|
619
|
+
size: z.ZodNumber;
|
|
620
|
+
mime_type: z.ZodString;
|
|
621
|
+
storage_destination: z.ZodEnum<{
|
|
622
|
+
appwrite: "appwrite";
|
|
623
|
+
r2: "r2";
|
|
624
|
+
}>;
|
|
625
|
+
is_trashed: z.ZodBoolean;
|
|
626
|
+
trashed_at: z.ZodNullable<z.ZodNumber>;
|
|
627
|
+
created_at: z.ZodNumber;
|
|
628
|
+
updated_at: z.ZodNumber;
|
|
629
|
+
}, z.core.$strip>>;
|
|
630
|
+
next_cursor: z.ZodNullable<z.ZodString>;
|
|
631
|
+
}, z.core.$strip>;
|
|
632
|
+
type MainStorageListResponse = z.infer<typeof mainStorageListResponseSchema>;
|
|
633
|
+
declare const mainStorageDetailResponseSchema: z.ZodObject<{
|
|
634
|
+
id: z.ZodString;
|
|
635
|
+
service_id: z.ZodString;
|
|
636
|
+
user_id: z.ZodString;
|
|
637
|
+
folder_id: z.ZodNullable<z.ZodString>;
|
|
638
|
+
upload_id: z.ZodNullable<z.ZodString>;
|
|
639
|
+
filename: z.ZodString;
|
|
640
|
+
size: z.ZodNumber;
|
|
641
|
+
mime_type: z.ZodString;
|
|
642
|
+
storage_destination: z.ZodEnum<{
|
|
643
|
+
appwrite: "appwrite";
|
|
644
|
+
r2: "r2";
|
|
645
|
+
}>;
|
|
646
|
+
is_trashed: z.ZodBoolean;
|
|
647
|
+
trashed_at: z.ZodNullable<z.ZodNumber>;
|
|
648
|
+
created_at: z.ZodNumber;
|
|
649
|
+
updated_at: z.ZodNumber;
|
|
650
|
+
}, z.core.$strip>;
|
|
651
|
+
type MainStorageDetailResponse = z.infer<typeof mainStorageDetailResponseSchema>;
|
|
652
|
+
declare const mainStorageRenameRequestSchema: z.ZodObject<{
|
|
653
|
+
filename: z.ZodString;
|
|
654
|
+
}, z.core.$strip>;
|
|
655
|
+
type MainStorageRenameRequest = z.infer<typeof mainStorageRenameRequestSchema>;
|
|
656
|
+
declare const mainStorageRenameResponseSchema: z.ZodObject<{
|
|
657
|
+
file: z.ZodObject<{
|
|
658
|
+
id: z.ZodString;
|
|
659
|
+
service_id: z.ZodString;
|
|
660
|
+
user_id: z.ZodString;
|
|
661
|
+
folder_id: z.ZodNullable<z.ZodString>;
|
|
662
|
+
upload_id: z.ZodNullable<z.ZodString>;
|
|
663
|
+
filename: z.ZodString;
|
|
664
|
+
size: z.ZodNumber;
|
|
665
|
+
mime_type: z.ZodString;
|
|
666
|
+
storage_destination: z.ZodEnum<{
|
|
667
|
+
appwrite: "appwrite";
|
|
668
|
+
r2: "r2";
|
|
669
|
+
}>;
|
|
670
|
+
is_trashed: z.ZodBoolean;
|
|
671
|
+
trashed_at: z.ZodNullable<z.ZodNumber>;
|
|
672
|
+
created_at: z.ZodNumber;
|
|
673
|
+
updated_at: z.ZodNumber;
|
|
674
|
+
}, z.core.$strip>;
|
|
675
|
+
}, z.core.$strip>;
|
|
676
|
+
type MainStorageRenameResponse = z.infer<typeof mainStorageRenameResponseSchema>;
|
|
677
|
+
declare const mainStorageDeleteResponseSchema: z.ZodObject<{
|
|
678
|
+
success: z.ZodBoolean;
|
|
679
|
+
file_id: z.ZodString;
|
|
680
|
+
}, z.core.$strip>;
|
|
681
|
+
type MainStorageDeleteResponse = z.infer<typeof mainStorageDeleteResponseSchema>;
|
|
682
|
+
declare const mainStorageRestoreResponseSchema: z.ZodObject<{
|
|
683
|
+
success: z.ZodBoolean;
|
|
684
|
+
file_id: z.ZodString;
|
|
685
|
+
}, z.core.$strip>;
|
|
686
|
+
type MainStorageRestoreResponse = z.infer<typeof mainStorageRestoreResponseSchema>;
|
|
687
|
+
//#endregion
|
|
688
|
+
//#region src/releases.d.ts
|
|
689
|
+
declare const releaseDTOSchema: z.ZodObject<{
|
|
690
|
+
id: z.ZodString;
|
|
691
|
+
service_id: z.ZodString;
|
|
692
|
+
name: z.ZodString;
|
|
693
|
+
size: z.ZodNumber;
|
|
694
|
+
r2_key: z.ZodString;
|
|
695
|
+
tags: z.ZodArray<z.ZodString>;
|
|
696
|
+
notes: z.ZodNullable<z.ZodString>;
|
|
697
|
+
force_update: z.ZodBoolean;
|
|
698
|
+
uploaded_by: z.ZodString;
|
|
699
|
+
upload_status: z.ZodEnum<{
|
|
700
|
+
completed: "completed";
|
|
701
|
+
failed: "failed";
|
|
702
|
+
pending: "pending";
|
|
703
|
+
}>;
|
|
704
|
+
created_at: z.ZodString;
|
|
705
|
+
}, z.core.$strip>;
|
|
706
|
+
type ReleaseDTO = z.infer<typeof releaseDTOSchema>;
|
|
707
|
+
declare const releaseUploadInitRequestSchema: z.ZodObject<{
|
|
708
|
+
name: z.ZodString;
|
|
709
|
+
filename: z.ZodString;
|
|
710
|
+
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
711
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
712
|
+
force_update: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
713
|
+
}, z.core.$strip>;
|
|
714
|
+
type ReleaseUploadInitRequest = z.input<typeof releaseUploadInitRequestSchema>;
|
|
715
|
+
declare const releaseUploadInitResponseSchema: z.ZodObject<{
|
|
716
|
+
release_id: z.ZodString;
|
|
717
|
+
presigned_url: z.ZodString;
|
|
718
|
+
r2_key: z.ZodString;
|
|
719
|
+
expires_at: z.ZodNumber;
|
|
720
|
+
}, z.core.$strip>;
|
|
721
|
+
type ReleaseUploadInitResponse = z.infer<typeof releaseUploadInitResponseSchema>;
|
|
722
|
+
declare const releaseUploadCompleteRequestSchema: z.ZodObject<{
|
|
723
|
+
release_id: z.ZodString;
|
|
724
|
+
size: z.ZodNumber;
|
|
725
|
+
}, z.core.$strip>;
|
|
726
|
+
type ReleaseUploadCompleteRequest = z.infer<typeof releaseUploadCompleteRequestSchema>;
|
|
727
|
+
declare const releaseUploadCompleteResponseSchema: z.ZodObject<{
|
|
728
|
+
success: z.ZodLiteral<true>;
|
|
729
|
+
release_id: z.ZodString;
|
|
730
|
+
status: z.ZodLiteral<"completed">;
|
|
731
|
+
}, z.core.$strip>;
|
|
732
|
+
type ReleaseUploadCompleteResponse = z.infer<typeof releaseUploadCompleteResponseSchema>;
|
|
733
|
+
declare const releaseUploadFailResponseSchema: z.ZodObject<{
|
|
734
|
+
success: z.ZodLiteral<true>;
|
|
735
|
+
release_id: z.ZodString;
|
|
736
|
+
status: z.ZodLiteral<"failed">;
|
|
737
|
+
}, z.core.$strip>;
|
|
738
|
+
type ReleaseUploadFailResponse = z.infer<typeof releaseUploadFailResponseSchema>;
|
|
739
|
+
declare const releasesListQuerySchema: z.ZodObject<{
|
|
740
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
741
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
742
|
+
}, z.core.$strip>;
|
|
743
|
+
type ReleasesListQuery = z.infer<typeof releasesListQuerySchema>;
|
|
744
|
+
declare const releasesListResponseSchema: z.ZodObject<{
|
|
745
|
+
items: z.ZodArray<z.ZodObject<{
|
|
746
|
+
id: z.ZodString;
|
|
747
|
+
service_id: z.ZodString;
|
|
748
|
+
name: z.ZodString;
|
|
749
|
+
size: z.ZodNumber;
|
|
750
|
+
r2_key: z.ZodString;
|
|
751
|
+
tags: z.ZodArray<z.ZodString>;
|
|
752
|
+
notes: z.ZodNullable<z.ZodString>;
|
|
753
|
+
force_update: z.ZodBoolean;
|
|
754
|
+
uploaded_by: z.ZodString;
|
|
755
|
+
upload_status: z.ZodEnum<{
|
|
756
|
+
completed: "completed";
|
|
757
|
+
failed: "failed";
|
|
758
|
+
pending: "pending";
|
|
759
|
+
}>;
|
|
760
|
+
created_at: z.ZodString;
|
|
761
|
+
}, z.core.$strip>>;
|
|
762
|
+
next_cursor: z.ZodNullable<z.ZodString>;
|
|
763
|
+
}, z.core.$strip>;
|
|
764
|
+
type ReleasesListResponse = z.infer<typeof releasesListResponseSchema>;
|
|
765
|
+
declare const releaseUpdateRequestSchema: z.ZodObject<{
|
|
766
|
+
name: z.ZodOptional<z.ZodString>;
|
|
767
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
768
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
769
|
+
force_update: z.ZodOptional<z.ZodBoolean>;
|
|
770
|
+
}, z.core.$strip>;
|
|
771
|
+
type ReleaseUpdateRequest = z.infer<typeof releaseUpdateRequestSchema>;
|
|
772
|
+
declare const releaseDeleteResponseSchema: z.ZodObject<{
|
|
773
|
+
success: z.ZodLiteral<true>;
|
|
774
|
+
release_id: z.ZodString;
|
|
775
|
+
}, z.core.$strip>;
|
|
776
|
+
type ReleaseDeleteResponse = z.infer<typeof releaseDeleteResponseSchema>;
|
|
777
|
+
declare const releaseSyncManifestSchema: z.ZodObject<{
|
|
778
|
+
id: z.ZodOptional<z.ZodString>;
|
|
779
|
+
name: z.ZodString;
|
|
780
|
+
r2_key: z.ZodString;
|
|
781
|
+
size: z.ZodNumber;
|
|
782
|
+
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
783
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
784
|
+
force_update: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
785
|
+
}, z.core.$strip>;
|
|
786
|
+
type ReleaseSyncManifest = z.input<typeof releaseSyncManifestSchema>;
|
|
787
|
+
declare const releaseSyncRequestSchema: z.ZodObject<{
|
|
788
|
+
releases: z.ZodArray<z.ZodObject<{
|
|
789
|
+
id: z.ZodOptional<z.ZodString>;
|
|
790
|
+
name: z.ZodString;
|
|
791
|
+
r2_key: z.ZodString;
|
|
792
|
+
size: z.ZodNumber;
|
|
793
|
+
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
794
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
795
|
+
force_update: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
796
|
+
}, z.core.$strip>>;
|
|
797
|
+
}, z.core.$strip>;
|
|
798
|
+
type ReleaseSyncRequest = z.input<typeof releaseSyncRequestSchema>;
|
|
799
|
+
declare const releaseSyncResultSchema: z.ZodObject<{
|
|
800
|
+
release_id: z.ZodString;
|
|
801
|
+
success: z.ZodBoolean;
|
|
802
|
+
status: z.ZodEnum<{
|
|
803
|
+
completed: "completed";
|
|
804
|
+
failed: "failed";
|
|
805
|
+
pending: "pending";
|
|
806
|
+
}>;
|
|
807
|
+
}, z.core.$strip>;
|
|
808
|
+
type ReleaseSyncResult = z.infer<typeof releaseSyncResultSchema>;
|
|
809
|
+
declare const releaseSyncResponseSchema: z.ZodObject<{
|
|
810
|
+
synced: z.ZodNumber;
|
|
811
|
+
results: z.ZodArray<z.ZodObject<{
|
|
812
|
+
release_id: z.ZodString;
|
|
813
|
+
success: z.ZodBoolean;
|
|
814
|
+
status: z.ZodEnum<{
|
|
815
|
+
completed: "completed";
|
|
816
|
+
failed: "failed";
|
|
817
|
+
pending: "pending";
|
|
818
|
+
}>;
|
|
819
|
+
}, z.core.$strip>>;
|
|
820
|
+
}, z.core.$strip>;
|
|
821
|
+
type ReleaseSyncResponse = z.infer<typeof releaseSyncResponseSchema>;
|
|
822
|
+
//#endregion
|
|
823
|
+
//#region src/shareLinks.d.ts
|
|
824
|
+
declare const shareLinkSchema: z.ZodObject<{
|
|
825
|
+
id: z.ZodString;
|
|
826
|
+
service_id: z.ZodString;
|
|
827
|
+
file_id: z.ZodString;
|
|
828
|
+
user_id: z.ZodString;
|
|
829
|
+
slug: z.ZodString;
|
|
830
|
+
name: z.ZodNullable<z.ZodString>;
|
|
831
|
+
has_password: z.ZodBoolean;
|
|
832
|
+
expires_at: z.ZodNullable<z.ZodNumber>;
|
|
833
|
+
download_count: z.ZodNumber;
|
|
834
|
+
max_downloads: z.ZodNullable<z.ZodNumber>;
|
|
835
|
+
is_active: z.ZodBoolean;
|
|
836
|
+
created_at: z.ZodNumber;
|
|
837
|
+
updated_at: z.ZodNumber;
|
|
838
|
+
}, z.core.$strip>;
|
|
839
|
+
type ShareLink = z.infer<typeof shareLinkSchema>;
|
|
840
|
+
declare const shareLinkCreateRequestSchema: z.ZodObject<{
|
|
841
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
842
|
+
name: z.ZodOptional<z.ZodString>;
|
|
843
|
+
password: z.ZodOptional<z.ZodString>;
|
|
844
|
+
expires_at: z.ZodOptional<z.ZodNumber>;
|
|
845
|
+
max_downloads: z.ZodOptional<z.ZodNumber>;
|
|
846
|
+
}, z.core.$strip>;
|
|
847
|
+
type ShareLinkCreateRequest = z.infer<typeof shareLinkCreateRequestSchema>;
|
|
848
|
+
declare const shareLinkUpdateRequestSchema: z.ZodObject<{
|
|
849
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
850
|
+
is_active: z.ZodOptional<z.ZodBoolean>;
|
|
851
|
+
password: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
852
|
+
expires_at: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
853
|
+
max_downloads: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
854
|
+
}, z.core.$strip>;
|
|
855
|
+
type ShareLinkUpdateRequest = z.infer<typeof shareLinkUpdateRequestSchema>;
|
|
856
|
+
declare const shareLinkListResponseSchema: z.ZodObject<{
|
|
857
|
+
items: z.ZodArray<z.ZodObject<{
|
|
858
|
+
id: z.ZodString;
|
|
859
|
+
service_id: z.ZodString;
|
|
860
|
+
file_id: z.ZodString;
|
|
861
|
+
user_id: z.ZodString;
|
|
862
|
+
slug: z.ZodString;
|
|
863
|
+
name: z.ZodNullable<z.ZodString>;
|
|
864
|
+
has_password: z.ZodBoolean;
|
|
865
|
+
expires_at: z.ZodNullable<z.ZodNumber>;
|
|
866
|
+
download_count: z.ZodNumber;
|
|
867
|
+
max_downloads: z.ZodNullable<z.ZodNumber>;
|
|
868
|
+
is_active: z.ZodBoolean;
|
|
869
|
+
created_at: z.ZodNumber;
|
|
870
|
+
updated_at: z.ZodNumber;
|
|
871
|
+
}, z.core.$strip>>;
|
|
872
|
+
}, z.core.$strip>;
|
|
873
|
+
type ShareLinkListResponse = z.infer<typeof shareLinkListResponseSchema>;
|
|
874
|
+
declare const shareLinkCreateResponseSchema: z.ZodObject<{
|
|
875
|
+
link: z.ZodObject<{
|
|
876
|
+
id: z.ZodString;
|
|
877
|
+
service_id: z.ZodString;
|
|
878
|
+
file_id: z.ZodString;
|
|
879
|
+
user_id: z.ZodString;
|
|
880
|
+
slug: z.ZodString;
|
|
881
|
+
name: z.ZodNullable<z.ZodString>;
|
|
882
|
+
has_password: z.ZodBoolean;
|
|
883
|
+
expires_at: z.ZodNullable<z.ZodNumber>;
|
|
884
|
+
download_count: z.ZodNumber;
|
|
885
|
+
max_downloads: z.ZodNullable<z.ZodNumber>;
|
|
886
|
+
is_active: z.ZodBoolean;
|
|
887
|
+
created_at: z.ZodNumber;
|
|
888
|
+
updated_at: z.ZodNumber;
|
|
889
|
+
}, z.core.$strip>;
|
|
890
|
+
}, z.core.$strip>;
|
|
891
|
+
type ShareLinkCreateResponse = z.infer<typeof shareLinkCreateResponseSchema>;
|
|
892
|
+
declare const shareLinkUpdateResponseSchema: z.ZodObject<{
|
|
893
|
+
link: z.ZodObject<{
|
|
894
|
+
id: z.ZodString;
|
|
895
|
+
service_id: z.ZodString;
|
|
896
|
+
file_id: z.ZodString;
|
|
897
|
+
user_id: z.ZodString;
|
|
898
|
+
slug: z.ZodString;
|
|
899
|
+
name: z.ZodNullable<z.ZodString>;
|
|
900
|
+
has_password: z.ZodBoolean;
|
|
901
|
+
expires_at: z.ZodNullable<z.ZodNumber>;
|
|
902
|
+
download_count: z.ZodNumber;
|
|
903
|
+
max_downloads: z.ZodNullable<z.ZodNumber>;
|
|
904
|
+
is_active: z.ZodBoolean;
|
|
905
|
+
created_at: z.ZodNumber;
|
|
906
|
+
updated_at: z.ZodNumber;
|
|
907
|
+
}, z.core.$strip>;
|
|
908
|
+
}, z.core.$strip>;
|
|
909
|
+
type ShareLinkUpdateResponse = z.infer<typeof shareLinkUpdateResponseSchema>;
|
|
910
|
+
declare const publicFileAccessResponseSchema: z.ZodObject<{
|
|
911
|
+
file_id: z.ZodString;
|
|
912
|
+
filename: z.ZodString;
|
|
913
|
+
size: z.ZodNumber;
|
|
914
|
+
mime_type: z.ZodString;
|
|
915
|
+
requires_password: z.ZodLiteral<false>;
|
|
916
|
+
download_url: z.ZodString;
|
|
917
|
+
url_expires_at: z.ZodNumber;
|
|
918
|
+
link_name: z.ZodNullable<z.ZodString>;
|
|
919
|
+
link_expires_at: z.ZodNullable<z.ZodNumber>;
|
|
920
|
+
}, z.core.$strip>;
|
|
921
|
+
type PublicFileAccessResponse = z.infer<typeof publicFileAccessResponseSchema>;
|
|
922
|
+
declare const publicFileLockedResponseSchema: z.ZodObject<{
|
|
923
|
+
filename: z.ZodString;
|
|
924
|
+
size: z.ZodNumber;
|
|
925
|
+
mime_type: z.ZodString;
|
|
926
|
+
requires_password: z.ZodLiteral<true>;
|
|
927
|
+
link_name: z.ZodNullable<z.ZodString>;
|
|
928
|
+
}, z.core.$strip>;
|
|
929
|
+
type PublicFileLockedResponse = z.infer<typeof publicFileLockedResponseSchema>;
|
|
930
|
+
declare const shareLinkDeleteResponseSchema: z.ZodObject<{
|
|
931
|
+
success: z.ZodLiteral<true>;
|
|
932
|
+
id: z.ZodString;
|
|
933
|
+
}, z.core.$strip>;
|
|
934
|
+
type ShareLinkDeleteResponse = z.infer<typeof shareLinkDeleteResponseSchema>;
|
|
414
935
|
//#endregion
|
|
415
936
|
//#region src/client.d.ts
|
|
416
937
|
declare class UnisourceError extends Error {
|
|
@@ -433,46 +954,127 @@ interface UnisourceClientConfig {
|
|
|
433
954
|
*/
|
|
434
955
|
getToken: () => string | null | undefined | Promise<string | null | undefined>;
|
|
435
956
|
}
|
|
957
|
+
declare function getPublicFileInfo(baseUrl: string, slug: string, signal?: AbortSignal): Promise<PublicFileAccessResponse | PublicFileLockedResponse>;
|
|
958
|
+
declare function unlockPublicFile(baseUrl: string, slug: string, password: string, signal?: AbortSignal): Promise<PublicFileAccessResponse | PublicFileLockedResponse>;
|
|
436
959
|
declare class UnisourceClient {
|
|
437
960
|
private config;
|
|
438
961
|
constructor(config: UnisourceClientConfig);
|
|
962
|
+
private request;
|
|
963
|
+
private withAsUser;
|
|
439
964
|
readonly upload: {
|
|
440
|
-
/** Initiate an R2 upload — returns a presigned PUT URL */r2Init: (body: UploadR2InitRequest) => Promise<UploadR2InitResponse>; /** Initiate an Appwrite upload — returns credentials for direct SDK upload */
|
|
441
|
-
appwriteInit: (body: UploadAppwriteInitRequest) => Promise<UploadAppwriteInitResponse>; /** Confirm that the file was successfully uploaded to storage */
|
|
442
|
-
complete: (body: UploadLifecycleRequest) => Promise<UploadCompleteResponse>; /** Mark an upload as failed and release reserved quota */
|
|
443
|
-
fail: (body: UploadLifecycleRequest) => Promise<UploadFailResponse>;
|
|
965
|
+
/** Initiate an R2 upload — returns a presigned PUT URL */r2Init: (body: UploadR2InitRequest, signal?: AbortSignal) => Promise<UploadR2InitResponse>; /** Initiate an Appwrite upload — returns credentials for direct SDK upload */
|
|
966
|
+
appwriteInit: (body: UploadAppwriteInitRequest, signal?: AbortSignal) => Promise<UploadAppwriteInitResponse>; /** Confirm that the file was successfully uploaded to storage */
|
|
967
|
+
complete: (body: UploadLifecycleRequest, signal?: AbortSignal) => Promise<UploadCompleteResponse>; /** Mark an upload as failed and release reserved quota */
|
|
968
|
+
fail: (body: UploadLifecycleRequest, signal?: AbortSignal) => Promise<UploadFailResponse>;
|
|
444
969
|
};
|
|
445
970
|
readonly myFiles: {
|
|
446
|
-
/** List files owned by the authenticated user */list: (query?: FileRecordsListQuery
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
971
|
+
/** List files owned by the authenticated user */list: (query?: FileRecordsListQuery, signal?: AbortSignal, options?: {
|
|
972
|
+
asUser?: string;
|
|
973
|
+
}) => Promise<FileRecordsListResponse>; /** List files in the trash */
|
|
974
|
+
trash: (query?: {
|
|
975
|
+
cursor?: string;
|
|
976
|
+
limit?: number;
|
|
977
|
+
}, signal?: AbortSignal, options?: {
|
|
978
|
+
asUser?: string;
|
|
979
|
+
}) => Promise<FileRecordsListResponse>; /** Get a single file record */
|
|
980
|
+
get: (id: string, signal?: AbortSignal, options?: {
|
|
981
|
+
asUser?: string;
|
|
982
|
+
}) => Promise<FileRecordDetailResponse>; /** Get a time-limited download URL (never cached by proxy) */
|
|
983
|
+
downloadUrl: (id: string, signal?: AbortSignal, options?: {
|
|
984
|
+
asUser?: string;
|
|
985
|
+
}) => Promise<FileDownloadUrlResponse>; /** Move file to a different folder (null = root) */
|
|
986
|
+
move: (id: string, body: FileMoveRequest, signal?: AbortSignal, options?: {
|
|
987
|
+
asUser?: string;
|
|
988
|
+
}) => Promise<{
|
|
450
989
|
file: FileRecord;
|
|
451
990
|
}>; /** Soft-delete (move to trash) or permanently delete */
|
|
452
991
|
delete: (id: string, query?: {
|
|
453
992
|
permanent?: boolean;
|
|
993
|
+
}, signal?: AbortSignal, options?: {
|
|
994
|
+
asUser?: string;
|
|
454
995
|
}) => Promise<FileDeleteResponse>; /** Restore a file from trash */
|
|
455
|
-
restore: (id: string
|
|
996
|
+
restore: (id: string, signal?: AbortSignal, options?: {
|
|
997
|
+
asUser?: string;
|
|
998
|
+
}) => Promise<FileRestoreResponse>; /** Rename a file */
|
|
999
|
+
update: (id: string, body: FileUpdateRequest, signal?: AbortSignal, options?: {
|
|
1000
|
+
asUser?: string;
|
|
1001
|
+
}) => Promise<FileUpdateResponse>;
|
|
456
1002
|
};
|
|
457
1003
|
readonly folders: {
|
|
458
|
-
/** List folders owned by the authenticated user */list: (query?: FolderListQuery
|
|
459
|
-
|
|
460
|
-
|
|
1004
|
+
/** List folders owned by the authenticated user */list: (query?: FolderListQuery, signal?: AbortSignal, options?: {
|
|
1005
|
+
asUser?: string;
|
|
1006
|
+
}) => Promise<FolderListResponse>; /** Get a single folder by ID */
|
|
1007
|
+
get: (id: string, signal?: AbortSignal, options?: {
|
|
1008
|
+
asUser?: string;
|
|
1009
|
+
}) => Promise<FolderDetailResponse>; /** Create a new folder */
|
|
1010
|
+
create: (body: FolderCreateRequest, signal?: AbortSignal, options?: {
|
|
1011
|
+
asUser?: string;
|
|
1012
|
+
}) => Promise<FolderCreateResponse>; /** Update folder name or color tag */
|
|
1013
|
+
update: (id: string, body: FolderUpdateRequest, signal?: AbortSignal, options?: {
|
|
1014
|
+
asUser?: string;
|
|
1015
|
+
}) => Promise<FolderUpdateResponse>; /** Soft-delete or permanently delete a folder and its contents */
|
|
461
1016
|
delete: (id: string, query?: {
|
|
462
1017
|
permanent?: boolean;
|
|
1018
|
+
}, signal?: AbortSignal, options?: {
|
|
1019
|
+
asUser?: string;
|
|
463
1020
|
}) => Promise<FolderDeleteResponse>; /** Restore a folder from trash */
|
|
464
|
-
restore: (id: string
|
|
1021
|
+
restore: (id: string, signal?: AbortSignal, options?: {
|
|
1022
|
+
asUser?: string;
|
|
1023
|
+
}) => Promise<FolderRestoreResponse>;
|
|
1024
|
+
};
|
|
1025
|
+
readonly mainStorage: {
|
|
1026
|
+
/** List files in the main storage pool */list: (query?: MainStorageListQuery) => Promise<MainStorageListResponse>; /** Get a single main-storage file record */
|
|
1027
|
+
get: (fileId: string) => Promise<MainStorageDetailResponse>; /** Rename a main-storage file */
|
|
1028
|
+
rename: (fileId: string, filename: string) => Promise<MainStorageRenameResponse>; /** Delete a main-storage file (soft by default; pass permanent=true for hard delete) */
|
|
1029
|
+
delete: (fileId: string, permanent?: boolean) => Promise<MainStorageDeleteResponse>; /** Restore a soft-deleted main-storage file */
|
|
1030
|
+
restore: (fileId: string) => Promise<MainStorageRestoreResponse>;
|
|
1031
|
+
upload: {
|
|
1032
|
+
/** Initiate an R2 upload targeting main storage */r2Init: (input: Omit<UploadR2InitRequest, 'is_main_storage'>) => Promise<UploadR2InitResponse>; /** Initiate an Appwrite upload targeting main storage */
|
|
1033
|
+
appwriteInit: (input: Omit<UploadAppwriteInitRequest, 'is_main_storage'>) => Promise<UploadAppwriteInitResponse>; /** Confirm a main-storage upload completed */
|
|
1034
|
+
complete: (uploadId: string) => Promise<UploadCompleteResponse>; /** Mark a main-storage upload as failed */
|
|
1035
|
+
fail: (uploadId: string) => Promise<UploadFailResponse>;
|
|
1036
|
+
};
|
|
1037
|
+
};
|
|
1038
|
+
readonly releases: {
|
|
1039
|
+
upload: {
|
|
1040
|
+
/** Initiate a release upload — returns a presigned PUT URL */init: (body: ReleaseUploadInitRequest, signal?: AbortSignal) => Promise<ReleaseUploadInitResponse>; /** Confirm that a release object was successfully uploaded */
|
|
1041
|
+
complete: (body: ReleaseUploadCompleteRequest, signal?: AbortSignal) => Promise<ReleaseUploadCompleteResponse>; /** Mark a release upload as failed */
|
|
1042
|
+
fail: (releaseId: string, signal?: AbortSignal) => Promise<ReleaseUploadFailResponse>;
|
|
1043
|
+
}; /** List releases for the configured service */
|
|
1044
|
+
list: (query?: ReleasesListQuery, signal?: AbortSignal) => Promise<ReleasesListResponse>; /** Get a single release */
|
|
1045
|
+
get: (releaseId: string, signal?: AbortSignal) => Promise<ReleaseDTO>; /** Get the latest completed release */
|
|
1046
|
+
latest: (signal?: AbortSignal) => Promise<ReleaseDTO>; /** Update release metadata */
|
|
1047
|
+
update: (releaseId: string, body: ReleaseUpdateRequest, signal?: AbortSignal) => Promise<ReleaseDTO>; /** Delete a release and its completed object, when applicable */
|
|
1048
|
+
delete: (releaseId: string, signal?: AbortSignal) => Promise<ReleaseDeleteResponse>; /** Sync existing release manifests into the backend */
|
|
1049
|
+
sync: (body: ReleaseSyncRequest, signal?: AbortSignal) => Promise<ReleaseSyncResponse>;
|
|
465
1050
|
};
|
|
466
1051
|
readonly admin: {
|
|
467
|
-
/** Get service info and quota limits */serviceDetail: () => Promise<ServiceDetailResponse>; /**
|
|
468
|
-
|
|
1052
|
+
/** Get service info and quota limits */serviceDetail: (signal?: AbortSignal) => Promise<ServiceDetailResponse>; /** Update custom service-wide limits */
|
|
1053
|
+
updateService: (body: AdminServiceUpdateRequest, signal?: AbortSignal) => Promise<AdminServiceUpdateResponse>; /** Get real-time storage usage for the service */
|
|
1054
|
+
usage: (signal?: AbortSignal) => Promise<ServiceUsageResponse>; /** List all uploads (pending/completed/failed) for this service */
|
|
469
1055
|
listUploads: (query?: {
|
|
470
|
-
status?:
|
|
1056
|
+
status?: UploadStatus;
|
|
471
1057
|
cursor?: string;
|
|
472
1058
|
limit?: number;
|
|
473
|
-
}) => Promise<UploadsListResponse>; /**
|
|
474
|
-
|
|
1059
|
+
}, signal?: AbortSignal) => Promise<UploadsListResponse>; /** Get a single upload for this service */
|
|
1060
|
+
getUpload: (id: string, signal?: AbortSignal) => Promise<UploadRecordDetailResponse>; /** Get a time-limited download URL for an upload owned by this service */
|
|
1061
|
+
downloadUploadUrl: (id: string, signal?: AbortSignal) => Promise<FileDownloadUrlResponse>; /** Permanently delete an upload owned by this service */
|
|
1062
|
+
deleteUpload: (id: string, signal?: AbortSignal) => Promise<FileDeleteResponse>; /** List audit log events for this service */
|
|
1063
|
+
auditLog: (query?: AuditLogListQuery, signal?: AbortSignal) => Promise<AuditLogListResponse>; /** List Appwrite users together with service-specific metadata */
|
|
1064
|
+
listUsers: (query?: {
|
|
1065
|
+
search?: string;
|
|
1066
|
+
offset?: number;
|
|
1067
|
+
limit?: number;
|
|
1068
|
+
}, signal?: AbortSignal) => Promise<AdminUserListResponse>; /** Update Appwrite user properties and service-specific quota/role */
|
|
1069
|
+
updateUser: (userId: string, body: AdminUserUpdateRequest, signal?: AbortSignal) => Promise<AdminUserUpdateResponse>; /** Overwrite a user's password and revoke active sessions */
|
|
1070
|
+
resetUserPassword: (userId: string, body: AdminUserPasswordResetRequest, signal?: AbortSignal) => Promise<AdminUserPasswordResetResponse>;
|
|
1071
|
+
};
|
|
1072
|
+
readonly shareLinks: {
|
|
1073
|
+
/** Create a public share link for a file */create: (fileId: string, body: ShareLinkCreateRequest, signal?: AbortSignal) => Promise<ShareLinkCreateResponse>; /** List all share links for a file */
|
|
1074
|
+
list: (fileId: string, signal?: AbortSignal) => Promise<ShareLinkListResponse>; /** Update a share link (rename, toggle, change password/expiry) */
|
|
1075
|
+
update: (linkId: string, body: ShareLinkUpdateRequest, signal?: AbortSignal) => Promise<ShareLinkUpdateResponse>; /** Permanently delete a share link */
|
|
1076
|
+
delete: (linkId: string, signal?: AbortSignal) => Promise<ShareLinkDeleteResponse>;
|
|
475
1077
|
};
|
|
476
1078
|
}
|
|
477
1079
|
//#endregion
|
|
478
|
-
export { type ApiError, type AuditEvent, type AuditEventAction, type AuditLogListQuery, type AuditLogListResponse, FILES_DEFAULT_LIMIT, FILES_MAX_LIMIT, type FileDeleteResponse, type FileDownloadUrlResponse, type FileMoveRequest, type FileRecord, type FileRecordDetailResponse, type FileRecordsListQuery, type FileRecordsListResponse, type FileRestoreResponse, type Folder, type FolderCreateRequest, type FolderCreateResponse, type FolderDeleteResponse, type FolderListQuery, type FolderListResponse, type FolderRestoreResponse, type FolderUpdateRequest, type FolderUpdateResponse, type Service, type ServiceDetailResponse, type ServiceUsageResponse, UnisourceClient, type UnisourceClientConfig, UnisourceError, UnisourceNetworkError, type UploadAppwriteInitRequest, type UploadAppwriteInitResponse, type UploadCompleteResponse, type UploadDestination, type UploadFailResponse, type UploadLifecycleRequest, type UploadR2InitRequest, type UploadR2InitResponse, type UploadRecord, type UploadStatus, type UploadsListResponse, apiErrorSchema, auditEventActionSchema, auditEventSchema, auditLogListQuerySchema, auditLogListResponseSchema, fileDeleteResponseSchema, fileDownloadUrlResponseSchema, fileMoveRequestSchema, fileRecordDetailResponseSchema, fileRecordSchema, fileRecordsListQuerySchema, fileRecordsListResponseSchema, fileRestoreResponseSchema, folderCreateRequestSchema, folderCreateResponseSchema, folderDeleteResponseSchema, folderListQuerySchema, folderListResponseSchema, folderRestoreResponseSchema, folderSchema, folderUpdateRequestSchema, folderUpdateResponseSchema, nonEmptyString, positiveInt, serviceDetailResponseSchema, serviceSchema, serviceUsageResponseSchema, unixTimestamp, uploadAppwriteInitRequestSchema, uploadAppwriteInitResponseSchema, uploadCompleteResponseSchema, uploadDestinationSchema, uploadFailResponseSchema, uploadLifecycleRequestSchema, uploadR2InitRequestSchema, uploadR2InitResponseSchema, uploadRecordSchema, uploadStatusSchema, uploadsListResponseSchema };
|
|
1080
|
+
export { type AdminServiceUpdateRequest, type AdminServiceUpdateResponse, type AdminUser, type AdminUserListResponse, type AdminUserPasswordResetRequest, type AdminUserPasswordResetResponse, type AdminUserUpdateRequest, type AdminUserUpdateResponse, type ApiError, type AuditEvent, type AuditEventAction, type AuditLogListQuery, type AuditLogListResponse, FILES_DEFAULT_LIMIT, FILES_MAX_LIMIT, type FileDeleteResponse, type FileDownloadUrlResponse, type FileMoveRequest, type FileRecord, type FileRecordDetailResponse, type FileRecordsListQuery, type FileRecordsListResponse, type FileRestoreResponse, type FileUpdateRequest, type FileUpdateResponse, type Folder, type FolderCreateRequest, type FolderCreateResponse, type FolderDeleteResponse, type FolderDetailResponse, type FolderListQuery, type FolderListResponse, type FolderRestoreResponse, type FolderUpdateRequest, type FolderUpdateResponse, MainStorageDeleteResponse, MainStorageDetailResponse, MainStorageFile, MainStorageListQuery, MainStorageListResponse, MainStorageRenameRequest, MainStorageRenameResponse, MainStorageRestoreResponse, type PublicFileAccessResponse, type PublicFileLockedResponse, type ReleaseDTO, type ReleaseDeleteResponse, type ReleaseSyncManifest, type ReleaseSyncRequest, type ReleaseSyncResponse, type ReleaseSyncResult, type ReleaseUpdateRequest, type ReleaseUploadCompleteRequest, type ReleaseUploadCompleteResponse, type ReleaseUploadFailResponse, type ReleaseUploadInitRequest, type ReleaseUploadInitResponse, type ReleasesListQuery, type ReleasesListResponse, type Service, type ServiceDetailResponse, type ServiceUsageResponse, type ShareLink, type ShareLinkCreateRequest, type ShareLinkCreateResponse, type ShareLinkDeleteResponse, type ShareLinkListResponse, type ShareLinkUpdateRequest, type ShareLinkUpdateResponse, UnisourceClient, type UnisourceClientConfig, UnisourceError, UnisourceNetworkError, type UploadAppwriteInitRequest, type UploadAppwriteInitResponse, type UploadCompleteResponse, type UploadDestination, type UploadFailResponse, type UploadLifecycleRequest, type UploadR2InitRequest, type UploadR2InitResponse, type UploadRecord, type UploadRecordDetailResponse, type UploadStatus, type UploadsListResponse, adminServiceUpdateRequestSchema, adminServiceUpdateResponseSchema, adminUserListResponseSchema, adminUserPasswordResetRequestSchema, adminUserPasswordResetResponseSchema, adminUserSchema, adminUserUpdateRequestSchema, adminUserUpdateResponseSchema, apiErrorSchema, auditEventActionSchema, auditEventSchema, auditLogListQuerySchema, auditLogListResponseSchema, fileDeleteResponseSchema, fileDownloadUrlResponseSchema, fileMoveRequestSchema, fileRecordDetailResponseSchema, fileRecordSchema, fileRecordsListQuerySchema, fileRecordsListResponseSchema, fileRestoreResponseSchema, fileUpdateRequestSchema, fileUpdateResponseSchema, folderCreateRequestSchema, folderCreateResponseSchema, folderDeleteResponseSchema, folderDetailResponseSchema, folderListQuerySchema, folderListResponseSchema, folderRestoreResponseSchema, folderSchema, folderUpdateRequestSchema, folderUpdateResponseSchema, getPublicFileInfo, mainStorageDeleteResponseSchema, mainStorageDetailResponseSchema, mainStorageFileSchema, mainStorageListQuerySchema, mainStorageListResponseSchema, mainStorageRenameRequestSchema, mainStorageRenameResponseSchema, mainStorageRestoreResponseSchema, nonEmptyString, positiveInt, publicFileAccessResponseSchema, publicFileLockedResponseSchema, releaseDTOSchema, releaseDeleteResponseSchema, releaseSyncManifestSchema, releaseSyncRequestSchema, releaseSyncResponseSchema, releaseSyncResultSchema, releaseUpdateRequestSchema, releaseUploadCompleteRequestSchema, releaseUploadCompleteResponseSchema, releaseUploadFailResponseSchema, releaseUploadInitRequestSchema, releaseUploadInitResponseSchema, releasesListQuerySchema, releasesListResponseSchema, serviceDetailResponseSchema, serviceSchema, serviceUsageResponseSchema, shareLinkCreateRequestSchema, shareLinkCreateResponseSchema, shareLinkDeleteResponseSchema, shareLinkListResponseSchema, shareLinkSchema, shareLinkUpdateRequestSchema, shareLinkUpdateResponseSchema, unixTimestamp, unlockPublicFile, uploadAppwriteInitRequestSchema, uploadAppwriteInitResponseSchema, uploadCompleteResponseSchema, uploadDestinationSchema, uploadFailResponseSchema, uploadLifecycleRequestSchema, uploadR2InitRequestSchema, uploadR2InitResponseSchema, uploadRecordDetailResponseSchema, uploadRecordSchema, uploadStatusSchema, uploadsListResponseSchema };
|