@unisource/sdk 0.2.0 → 0.3.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/README.md +55 -23
- package/dist/index.d.mts +560 -21
- package/dist/index.mjs +433 -38
- package/package.json +8 -4
- package/src/client.ts +472 -233
- package/src/fileRecords.ts +99 -87
- package/src/folders.ts +97 -84
- package/src/index.ts +198 -106
- package/src/mainStorage.ts +40 -0
- package/src/primitives.ts +30 -25
- package/src/releases.ts +132 -0
- package/src/services.ts +135 -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<{
|
|
@@ -375,6 +464,8 @@ declare const auditLogListQuerySchema: z.ZodObject<{
|
|
|
375
464
|
file_deleted: "file_deleted";
|
|
376
465
|
folder_deleted: "folder_deleted";
|
|
377
466
|
quota_exceeded: "quota_exceeded";
|
|
467
|
+
quota_reconciled: "quota_reconciled";
|
|
468
|
+
share_link_accessed: "share_link_accessed";
|
|
378
469
|
upload_completed: "upload_completed";
|
|
379
470
|
}>>;
|
|
380
471
|
resource_type: z.ZodOptional<z.ZodEnum<{
|
|
@@ -395,6 +486,8 @@ declare const auditLogListResponseSchema: z.ZodObject<{
|
|
|
395
486
|
file_deleted: "file_deleted";
|
|
396
487
|
folder_deleted: "folder_deleted";
|
|
397
488
|
quota_exceeded: "quota_exceeded";
|
|
489
|
+
quota_reconciled: "quota_reconciled";
|
|
490
|
+
share_link_accessed: "share_link_accessed";
|
|
398
491
|
upload_completed: "upload_completed";
|
|
399
492
|
}>;
|
|
400
493
|
resource_type: z.ZodEnum<{
|
|
@@ -411,6 +504,371 @@ declare const auditLogListResponseSchema: z.ZodObject<{
|
|
|
411
504
|
limit: z.ZodNumber;
|
|
412
505
|
}, z.core.$strip>;
|
|
413
506
|
type AuditLogListResponse = z.infer<typeof auditLogListResponseSchema>;
|
|
507
|
+
declare const adminUserSchema: z.ZodObject<{
|
|
508
|
+
id: z.ZodString;
|
|
509
|
+
name: z.ZodString;
|
|
510
|
+
email: z.ZodString;
|
|
511
|
+
status: z.ZodBoolean;
|
|
512
|
+
labels: z.ZodArray<z.ZodString>;
|
|
513
|
+
role: z.ZodString;
|
|
514
|
+
has_service_access: z.ZodBoolean;
|
|
515
|
+
max_storage_bytes: z.ZodNullable<z.ZodNumber>;
|
|
516
|
+
effective_max_storage_bytes: z.ZodNumber;
|
|
517
|
+
current_used_bytes: z.ZodNumber;
|
|
518
|
+
registration: z.ZodNumber;
|
|
519
|
+
email_verification: z.ZodBoolean;
|
|
520
|
+
}, z.core.$strip>;
|
|
521
|
+
type AdminUser = z.infer<typeof adminUserSchema>;
|
|
522
|
+
declare const adminUserListResponseSchema: z.ZodObject<{
|
|
523
|
+
items: z.ZodArray<z.ZodObject<{
|
|
524
|
+
id: z.ZodString;
|
|
525
|
+
name: z.ZodString;
|
|
526
|
+
email: z.ZodString;
|
|
527
|
+
status: z.ZodBoolean;
|
|
528
|
+
labels: z.ZodArray<z.ZodString>;
|
|
529
|
+
role: z.ZodString;
|
|
530
|
+
has_service_access: z.ZodBoolean;
|
|
531
|
+
max_storage_bytes: z.ZodNullable<z.ZodNumber>;
|
|
532
|
+
effective_max_storage_bytes: z.ZodNumber;
|
|
533
|
+
current_used_bytes: z.ZodNumber;
|
|
534
|
+
registration: z.ZodNumber;
|
|
535
|
+
email_verification: z.ZodBoolean;
|
|
536
|
+
}, z.core.$strip>>;
|
|
537
|
+
total: z.ZodNumber;
|
|
538
|
+
offset: z.ZodNumber;
|
|
539
|
+
limit: z.ZodNumber;
|
|
540
|
+
}, z.core.$strip>;
|
|
541
|
+
type AdminUserListResponse = z.infer<typeof adminUserListResponseSchema>;
|
|
542
|
+
declare const adminUserUpdateRequestSchema: z.ZodObject<{
|
|
543
|
+
name: z.ZodOptional<z.ZodString>;
|
|
544
|
+
email: z.ZodOptional<z.ZodString>;
|
|
545
|
+
status: z.ZodOptional<z.ZodBoolean>;
|
|
546
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
547
|
+
role: z.ZodOptional<z.ZodEnum<{
|
|
548
|
+
admin: "admin";
|
|
549
|
+
plus: "plus";
|
|
550
|
+
user: "user";
|
|
551
|
+
}>>;
|
|
552
|
+
max_storage_bytes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
553
|
+
}, z.core.$strip>;
|
|
554
|
+
type AdminUserUpdateRequest = z.infer<typeof adminUserUpdateRequestSchema>;
|
|
555
|
+
declare const adminUserUpdateResponseSchema: z.ZodObject<{
|
|
556
|
+
user: z.ZodObject<{
|
|
557
|
+
id: z.ZodString;
|
|
558
|
+
name: z.ZodString;
|
|
559
|
+
email: z.ZodString;
|
|
560
|
+
status: z.ZodBoolean;
|
|
561
|
+
labels: z.ZodArray<z.ZodString>;
|
|
562
|
+
role: z.ZodString;
|
|
563
|
+
has_service_access: z.ZodBoolean;
|
|
564
|
+
max_storage_bytes: z.ZodNullable<z.ZodNumber>;
|
|
565
|
+
effective_max_storage_bytes: z.ZodNumber;
|
|
566
|
+
current_used_bytes: z.ZodNumber;
|
|
567
|
+
registration: z.ZodNumber;
|
|
568
|
+
email_verification: z.ZodBoolean;
|
|
569
|
+
}, z.core.$strip>;
|
|
570
|
+
}, z.core.$strip>;
|
|
571
|
+
type AdminUserUpdateResponse = z.infer<typeof adminUserUpdateResponseSchema>;
|
|
572
|
+
declare const adminUserPasswordResetRequestSchema: z.ZodObject<{
|
|
573
|
+
password: z.ZodString;
|
|
574
|
+
}, z.core.$strip>;
|
|
575
|
+
type AdminUserPasswordResetRequest = z.infer<typeof adminUserPasswordResetRequestSchema>;
|
|
576
|
+
declare const adminUserPasswordResetResponseSchema: z.ZodObject<{
|
|
577
|
+
success: z.ZodLiteral<true>;
|
|
578
|
+
user_id: z.ZodString;
|
|
579
|
+
}, z.core.$strip>;
|
|
580
|
+
type AdminUserPasswordResetResponse = z.infer<typeof adminUserPasswordResetResponseSchema>;
|
|
581
|
+
//#endregion
|
|
582
|
+
//#region src/mainStorage.d.ts
|
|
583
|
+
declare const mainStorageListQuerySchema: z.ZodObject<{
|
|
584
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
585
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
586
|
+
}, z.core.$strip>;
|
|
587
|
+
type MainStorageListQuery = z.infer<typeof mainStorageListQuerySchema>;
|
|
588
|
+
declare const mainStorageListResponseSchema: z.ZodObject<{
|
|
589
|
+
items: z.ZodArray<z.ZodObject<{
|
|
590
|
+
id: z.ZodString;
|
|
591
|
+
service_id: z.ZodString;
|
|
592
|
+
user_id: z.ZodString;
|
|
593
|
+
folder_id: z.ZodNullable<z.ZodString>;
|
|
594
|
+
upload_id: z.ZodNullable<z.ZodString>;
|
|
595
|
+
filename: z.ZodString;
|
|
596
|
+
size: z.ZodNumber;
|
|
597
|
+
mime_type: z.ZodString;
|
|
598
|
+
storage_destination: z.ZodEnum<{
|
|
599
|
+
appwrite: "appwrite";
|
|
600
|
+
r2: "r2";
|
|
601
|
+
}>;
|
|
602
|
+
is_trashed: z.ZodBoolean;
|
|
603
|
+
trashed_at: z.ZodNullable<z.ZodNumber>;
|
|
604
|
+
created_at: z.ZodNumber;
|
|
605
|
+
updated_at: z.ZodNumber;
|
|
606
|
+
}, z.core.$strip>>;
|
|
607
|
+
next_cursor: z.ZodNullable<z.ZodString>;
|
|
608
|
+
}, z.core.$strip>;
|
|
609
|
+
type MainStorageListResponse = z.infer<typeof mainStorageListResponseSchema>;
|
|
610
|
+
declare const mainStorageRenameRequestSchema: z.ZodObject<{
|
|
611
|
+
filename: z.ZodString;
|
|
612
|
+
}, z.core.$strip>;
|
|
613
|
+
type MainStorageRenameRequest = z.infer<typeof mainStorageRenameRequestSchema>;
|
|
614
|
+
declare const mainStorageDeleteResponseSchema: z.ZodObject<{
|
|
615
|
+
success: z.ZodBoolean;
|
|
616
|
+
file_id: z.ZodString;
|
|
617
|
+
}, z.core.$strip>;
|
|
618
|
+
type MainStorageDeleteResponse = z.infer<typeof mainStorageDeleteResponseSchema>;
|
|
619
|
+
declare const mainStorageRestoreResponseSchema: z.ZodObject<{
|
|
620
|
+
success: z.ZodBoolean;
|
|
621
|
+
file_id: z.ZodString;
|
|
622
|
+
}, z.core.$strip>;
|
|
623
|
+
type MainStorageRestoreResponse = z.infer<typeof mainStorageRestoreResponseSchema>;
|
|
624
|
+
//#endregion
|
|
625
|
+
//#region src/releases.d.ts
|
|
626
|
+
declare const releaseDTOSchema: z.ZodObject<{
|
|
627
|
+
id: z.ZodString;
|
|
628
|
+
service_id: z.ZodString;
|
|
629
|
+
name: z.ZodString;
|
|
630
|
+
size: z.ZodNumber;
|
|
631
|
+
r2_key: z.ZodString;
|
|
632
|
+
tags: z.ZodArray<z.ZodString>;
|
|
633
|
+
notes: z.ZodNullable<z.ZodString>;
|
|
634
|
+
force_update: z.ZodBoolean;
|
|
635
|
+
uploaded_by: z.ZodString;
|
|
636
|
+
upload_status: z.ZodEnum<{
|
|
637
|
+
completed: "completed";
|
|
638
|
+
failed: "failed";
|
|
639
|
+
pending: "pending";
|
|
640
|
+
}>;
|
|
641
|
+
created_at: z.ZodString;
|
|
642
|
+
}, z.core.$strip>;
|
|
643
|
+
type ReleaseDTO = z.infer<typeof releaseDTOSchema>;
|
|
644
|
+
declare const releaseUploadInitRequestSchema: z.ZodObject<{
|
|
645
|
+
name: z.ZodString;
|
|
646
|
+
filename: z.ZodString;
|
|
647
|
+
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
648
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
649
|
+
force_update: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
650
|
+
}, z.core.$strip>;
|
|
651
|
+
type ReleaseUploadInitRequest = z.input<typeof releaseUploadInitRequestSchema>;
|
|
652
|
+
declare const releaseUploadInitResponseSchema: z.ZodObject<{
|
|
653
|
+
release_id: z.ZodString;
|
|
654
|
+
presigned_url: z.ZodString;
|
|
655
|
+
r2_key: z.ZodString;
|
|
656
|
+
expires_at: z.ZodNumber;
|
|
657
|
+
}, z.core.$strip>;
|
|
658
|
+
type ReleaseUploadInitResponse = z.infer<typeof releaseUploadInitResponseSchema>;
|
|
659
|
+
declare const releaseUploadCompleteRequestSchema: z.ZodObject<{
|
|
660
|
+
release_id: z.ZodString;
|
|
661
|
+
size: z.ZodNumber;
|
|
662
|
+
}, z.core.$strip>;
|
|
663
|
+
type ReleaseUploadCompleteRequest = z.infer<typeof releaseUploadCompleteRequestSchema>;
|
|
664
|
+
declare const releaseUploadCompleteResponseSchema: z.ZodObject<{
|
|
665
|
+
success: z.ZodLiteral<true>;
|
|
666
|
+
release_id: z.ZodString;
|
|
667
|
+
status: z.ZodLiteral<"completed">;
|
|
668
|
+
}, z.core.$strip>;
|
|
669
|
+
type ReleaseUploadCompleteResponse = z.infer<typeof releaseUploadCompleteResponseSchema>;
|
|
670
|
+
declare const releaseUploadFailResponseSchema: z.ZodObject<{
|
|
671
|
+
success: z.ZodLiteral<true>;
|
|
672
|
+
release_id: z.ZodString;
|
|
673
|
+
status: z.ZodLiteral<"failed">;
|
|
674
|
+
}, z.core.$strip>;
|
|
675
|
+
type ReleaseUploadFailResponse = z.infer<typeof releaseUploadFailResponseSchema>;
|
|
676
|
+
declare const releasesListQuerySchema: z.ZodObject<{
|
|
677
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
678
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
679
|
+
}, z.core.$strip>;
|
|
680
|
+
type ReleasesListQuery = z.infer<typeof releasesListQuerySchema>;
|
|
681
|
+
declare const releasesListResponseSchema: z.ZodObject<{
|
|
682
|
+
items: z.ZodArray<z.ZodObject<{
|
|
683
|
+
id: z.ZodString;
|
|
684
|
+
service_id: z.ZodString;
|
|
685
|
+
name: z.ZodString;
|
|
686
|
+
size: z.ZodNumber;
|
|
687
|
+
r2_key: z.ZodString;
|
|
688
|
+
tags: z.ZodArray<z.ZodString>;
|
|
689
|
+
notes: z.ZodNullable<z.ZodString>;
|
|
690
|
+
force_update: z.ZodBoolean;
|
|
691
|
+
uploaded_by: z.ZodString;
|
|
692
|
+
upload_status: z.ZodEnum<{
|
|
693
|
+
completed: "completed";
|
|
694
|
+
failed: "failed";
|
|
695
|
+
pending: "pending";
|
|
696
|
+
}>;
|
|
697
|
+
created_at: z.ZodString;
|
|
698
|
+
}, z.core.$strip>>;
|
|
699
|
+
next_cursor: z.ZodNullable<z.ZodString>;
|
|
700
|
+
}, z.core.$strip>;
|
|
701
|
+
type ReleasesListResponse = z.infer<typeof releasesListResponseSchema>;
|
|
702
|
+
declare const releaseUpdateRequestSchema: z.ZodObject<{
|
|
703
|
+
name: z.ZodOptional<z.ZodString>;
|
|
704
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
705
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
706
|
+
force_update: z.ZodOptional<z.ZodBoolean>;
|
|
707
|
+
}, z.core.$strip>;
|
|
708
|
+
type ReleaseUpdateRequest = z.infer<typeof releaseUpdateRequestSchema>;
|
|
709
|
+
declare const releaseDeleteResponseSchema: z.ZodObject<{
|
|
710
|
+
success: z.ZodLiteral<true>;
|
|
711
|
+
release_id: z.ZodString;
|
|
712
|
+
}, z.core.$strip>;
|
|
713
|
+
type ReleaseDeleteResponse = z.infer<typeof releaseDeleteResponseSchema>;
|
|
714
|
+
declare const releaseSyncManifestSchema: z.ZodObject<{
|
|
715
|
+
id: z.ZodOptional<z.ZodString>;
|
|
716
|
+
name: z.ZodString;
|
|
717
|
+
r2_key: z.ZodString;
|
|
718
|
+
size: z.ZodNumber;
|
|
719
|
+
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
720
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
721
|
+
force_update: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
722
|
+
}, z.core.$strip>;
|
|
723
|
+
type ReleaseSyncManifest = z.input<typeof releaseSyncManifestSchema>;
|
|
724
|
+
declare const releaseSyncRequestSchema: z.ZodObject<{
|
|
725
|
+
releases: z.ZodArray<z.ZodObject<{
|
|
726
|
+
id: z.ZodOptional<z.ZodString>;
|
|
727
|
+
name: z.ZodString;
|
|
728
|
+
r2_key: z.ZodString;
|
|
729
|
+
size: z.ZodNumber;
|
|
730
|
+
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
731
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
732
|
+
force_update: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
733
|
+
}, z.core.$strip>>;
|
|
734
|
+
}, z.core.$strip>;
|
|
735
|
+
type ReleaseSyncRequest = z.input<typeof releaseSyncRequestSchema>;
|
|
736
|
+
declare const releaseSyncResultSchema: z.ZodObject<{
|
|
737
|
+
release_id: z.ZodString;
|
|
738
|
+
success: z.ZodBoolean;
|
|
739
|
+
status: z.ZodEnum<{
|
|
740
|
+
completed: "completed";
|
|
741
|
+
failed: "failed";
|
|
742
|
+
pending: "pending";
|
|
743
|
+
}>;
|
|
744
|
+
}, z.core.$strip>;
|
|
745
|
+
type ReleaseSyncResult = z.infer<typeof releaseSyncResultSchema>;
|
|
746
|
+
declare const releaseSyncResponseSchema: z.ZodObject<{
|
|
747
|
+
synced: z.ZodNumber;
|
|
748
|
+
results: z.ZodArray<z.ZodObject<{
|
|
749
|
+
release_id: z.ZodString;
|
|
750
|
+
success: z.ZodBoolean;
|
|
751
|
+
status: z.ZodEnum<{
|
|
752
|
+
completed: "completed";
|
|
753
|
+
failed: "failed";
|
|
754
|
+
pending: "pending";
|
|
755
|
+
}>;
|
|
756
|
+
}, z.core.$strip>>;
|
|
757
|
+
}, z.core.$strip>;
|
|
758
|
+
type ReleaseSyncResponse = z.infer<typeof releaseSyncResponseSchema>;
|
|
759
|
+
//#endregion
|
|
760
|
+
//#region src/shareLinks.d.ts
|
|
761
|
+
declare const shareLinkSchema: z.ZodObject<{
|
|
762
|
+
id: z.ZodString;
|
|
763
|
+
service_id: z.ZodString;
|
|
764
|
+
file_id: z.ZodString;
|
|
765
|
+
user_id: z.ZodString;
|
|
766
|
+
slug: z.ZodString;
|
|
767
|
+
name: z.ZodNullable<z.ZodString>;
|
|
768
|
+
has_password: z.ZodBoolean;
|
|
769
|
+
expires_at: z.ZodNullable<z.ZodNumber>;
|
|
770
|
+
download_count: z.ZodNumber;
|
|
771
|
+
max_downloads: z.ZodNullable<z.ZodNumber>;
|
|
772
|
+
is_active: z.ZodBoolean;
|
|
773
|
+
created_at: z.ZodNumber;
|
|
774
|
+
updated_at: z.ZodNumber;
|
|
775
|
+
}, z.core.$strip>;
|
|
776
|
+
type ShareLink = z.infer<typeof shareLinkSchema>;
|
|
777
|
+
declare const shareLinkCreateRequestSchema: z.ZodObject<{
|
|
778
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
779
|
+
name: z.ZodOptional<z.ZodString>;
|
|
780
|
+
password: z.ZodOptional<z.ZodString>;
|
|
781
|
+
expires_at: z.ZodOptional<z.ZodNumber>;
|
|
782
|
+
max_downloads: z.ZodOptional<z.ZodNumber>;
|
|
783
|
+
}, z.core.$strip>;
|
|
784
|
+
type ShareLinkCreateRequest = z.infer<typeof shareLinkCreateRequestSchema>;
|
|
785
|
+
declare const shareLinkUpdateRequestSchema: z.ZodObject<{
|
|
786
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
787
|
+
is_active: z.ZodOptional<z.ZodBoolean>;
|
|
788
|
+
password: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
789
|
+
expires_at: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
790
|
+
max_downloads: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
791
|
+
}, z.core.$strip>;
|
|
792
|
+
type ShareLinkUpdateRequest = z.infer<typeof shareLinkUpdateRequestSchema>;
|
|
793
|
+
declare const shareLinkListResponseSchema: z.ZodObject<{
|
|
794
|
+
items: z.ZodArray<z.ZodObject<{
|
|
795
|
+
id: z.ZodString;
|
|
796
|
+
service_id: z.ZodString;
|
|
797
|
+
file_id: z.ZodString;
|
|
798
|
+
user_id: z.ZodString;
|
|
799
|
+
slug: z.ZodString;
|
|
800
|
+
name: z.ZodNullable<z.ZodString>;
|
|
801
|
+
has_password: z.ZodBoolean;
|
|
802
|
+
expires_at: z.ZodNullable<z.ZodNumber>;
|
|
803
|
+
download_count: z.ZodNumber;
|
|
804
|
+
max_downloads: z.ZodNullable<z.ZodNumber>;
|
|
805
|
+
is_active: z.ZodBoolean;
|
|
806
|
+
created_at: z.ZodNumber;
|
|
807
|
+
updated_at: z.ZodNumber;
|
|
808
|
+
}, z.core.$strip>>;
|
|
809
|
+
}, z.core.$strip>;
|
|
810
|
+
type ShareLinkListResponse = z.infer<typeof shareLinkListResponseSchema>;
|
|
811
|
+
declare const shareLinkCreateResponseSchema: z.ZodObject<{
|
|
812
|
+
link: z.ZodObject<{
|
|
813
|
+
id: z.ZodString;
|
|
814
|
+
service_id: z.ZodString;
|
|
815
|
+
file_id: z.ZodString;
|
|
816
|
+
user_id: z.ZodString;
|
|
817
|
+
slug: z.ZodString;
|
|
818
|
+
name: z.ZodNullable<z.ZodString>;
|
|
819
|
+
has_password: z.ZodBoolean;
|
|
820
|
+
expires_at: z.ZodNullable<z.ZodNumber>;
|
|
821
|
+
download_count: z.ZodNumber;
|
|
822
|
+
max_downloads: z.ZodNullable<z.ZodNumber>;
|
|
823
|
+
is_active: z.ZodBoolean;
|
|
824
|
+
created_at: z.ZodNumber;
|
|
825
|
+
updated_at: z.ZodNumber;
|
|
826
|
+
}, z.core.$strip>;
|
|
827
|
+
}, z.core.$strip>;
|
|
828
|
+
type ShareLinkCreateResponse = z.infer<typeof shareLinkCreateResponseSchema>;
|
|
829
|
+
declare const shareLinkUpdateResponseSchema: z.ZodObject<{
|
|
830
|
+
link: z.ZodObject<{
|
|
831
|
+
id: z.ZodString;
|
|
832
|
+
service_id: z.ZodString;
|
|
833
|
+
file_id: z.ZodString;
|
|
834
|
+
user_id: z.ZodString;
|
|
835
|
+
slug: z.ZodString;
|
|
836
|
+
name: z.ZodNullable<z.ZodString>;
|
|
837
|
+
has_password: z.ZodBoolean;
|
|
838
|
+
expires_at: z.ZodNullable<z.ZodNumber>;
|
|
839
|
+
download_count: z.ZodNumber;
|
|
840
|
+
max_downloads: z.ZodNullable<z.ZodNumber>;
|
|
841
|
+
is_active: z.ZodBoolean;
|
|
842
|
+
created_at: z.ZodNumber;
|
|
843
|
+
updated_at: z.ZodNumber;
|
|
844
|
+
}, z.core.$strip>;
|
|
845
|
+
}, z.core.$strip>;
|
|
846
|
+
type ShareLinkUpdateResponse = z.infer<typeof shareLinkUpdateResponseSchema>;
|
|
847
|
+
declare const publicFileAccessResponseSchema: z.ZodObject<{
|
|
848
|
+
file_id: z.ZodString;
|
|
849
|
+
filename: z.ZodString;
|
|
850
|
+
size: z.ZodNumber;
|
|
851
|
+
mime_type: z.ZodString;
|
|
852
|
+
requires_password: z.ZodLiteral<false>;
|
|
853
|
+
download_url: z.ZodString;
|
|
854
|
+
url_expires_at: z.ZodNumber;
|
|
855
|
+
link_name: z.ZodNullable<z.ZodString>;
|
|
856
|
+
link_expires_at: z.ZodNullable<z.ZodNumber>;
|
|
857
|
+
}, z.core.$strip>;
|
|
858
|
+
type PublicFileAccessResponse = z.infer<typeof publicFileAccessResponseSchema>;
|
|
859
|
+
declare const publicFileLockedResponseSchema: z.ZodObject<{
|
|
860
|
+
filename: z.ZodString;
|
|
861
|
+
size: z.ZodNumber;
|
|
862
|
+
mime_type: z.ZodString;
|
|
863
|
+
requires_password: z.ZodLiteral<true>;
|
|
864
|
+
link_name: z.ZodNullable<z.ZodString>;
|
|
865
|
+
}, z.core.$strip>;
|
|
866
|
+
type PublicFileLockedResponse = z.infer<typeof publicFileLockedResponseSchema>;
|
|
867
|
+
declare const shareLinkDeleteResponseSchema: z.ZodObject<{
|
|
868
|
+
success: z.ZodLiteral<true>;
|
|
869
|
+
id: z.ZodString;
|
|
870
|
+
}, z.core.$strip>;
|
|
871
|
+
type ShareLinkDeleteResponse = z.infer<typeof shareLinkDeleteResponseSchema>;
|
|
414
872
|
//#endregion
|
|
415
873
|
//#region src/client.d.ts
|
|
416
874
|
declare class UnisourceError extends Error {
|
|
@@ -433,46 +891,127 @@ interface UnisourceClientConfig {
|
|
|
433
891
|
*/
|
|
434
892
|
getToken: () => string | null | undefined | Promise<string | null | undefined>;
|
|
435
893
|
}
|
|
894
|
+
declare function getPublicFileInfo(baseUrl: string, slug: string, signal?: AbortSignal): Promise<PublicFileAccessResponse | PublicFileLockedResponse>;
|
|
895
|
+
declare function unlockPublicFile(baseUrl: string, slug: string, password: string, signal?: AbortSignal): Promise<PublicFileAccessResponse | PublicFileLockedResponse>;
|
|
436
896
|
declare class UnisourceClient {
|
|
437
897
|
private config;
|
|
438
898
|
constructor(config: UnisourceClientConfig);
|
|
899
|
+
private request;
|
|
900
|
+
private withAsUser;
|
|
439
901
|
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>;
|
|
902
|
+
/** 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 */
|
|
903
|
+
appwriteInit: (body: UploadAppwriteInitRequest, signal?: AbortSignal) => Promise<UploadAppwriteInitResponse>; /** Confirm that the file was successfully uploaded to storage */
|
|
904
|
+
complete: (body: UploadLifecycleRequest, signal?: AbortSignal) => Promise<UploadCompleteResponse>; /** Mark an upload as failed and release reserved quota */
|
|
905
|
+
fail: (body: UploadLifecycleRequest, signal?: AbortSignal) => Promise<UploadFailResponse>;
|
|
444
906
|
};
|
|
445
907
|
readonly myFiles: {
|
|
446
|
-
/** List files owned by the authenticated user */list: (query?: FileRecordsListQuery
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
908
|
+
/** List files owned by the authenticated user */list: (query?: FileRecordsListQuery, signal?: AbortSignal, options?: {
|
|
909
|
+
asUser?: string;
|
|
910
|
+
}) => Promise<FileRecordsListResponse>; /** List files in the trash */
|
|
911
|
+
trash: (query?: {
|
|
912
|
+
cursor?: string;
|
|
913
|
+
limit?: number;
|
|
914
|
+
}, signal?: AbortSignal, options?: {
|
|
915
|
+
asUser?: string;
|
|
916
|
+
}) => Promise<FileRecordsListResponse>; /** Get a single file record */
|
|
917
|
+
get: (id: string, signal?: AbortSignal, options?: {
|
|
918
|
+
asUser?: string;
|
|
919
|
+
}) => Promise<FileRecordDetailResponse>; /** Get a time-limited download URL (never cached by proxy) */
|
|
920
|
+
downloadUrl: (id: string, signal?: AbortSignal, options?: {
|
|
921
|
+
asUser?: string;
|
|
922
|
+
}) => Promise<FileDownloadUrlResponse>; /** Move file to a different folder (null = root) */
|
|
923
|
+
move: (id: string, body: FileMoveRequest, signal?: AbortSignal, options?: {
|
|
924
|
+
asUser?: string;
|
|
925
|
+
}) => Promise<{
|
|
450
926
|
file: FileRecord;
|
|
451
927
|
}>; /** Soft-delete (move to trash) or permanently delete */
|
|
452
928
|
delete: (id: string, query?: {
|
|
453
929
|
permanent?: boolean;
|
|
930
|
+
}, signal?: AbortSignal, options?: {
|
|
931
|
+
asUser?: string;
|
|
454
932
|
}) => Promise<FileDeleteResponse>; /** Restore a file from trash */
|
|
455
|
-
restore: (id: string
|
|
933
|
+
restore: (id: string, signal?: AbortSignal, options?: {
|
|
934
|
+
asUser?: string;
|
|
935
|
+
}) => Promise<FileRestoreResponse>; /** Rename a file */
|
|
936
|
+
update: (id: string, body: FileUpdateRequest, signal?: AbortSignal, options?: {
|
|
937
|
+
asUser?: string;
|
|
938
|
+
}) => Promise<FileUpdateResponse>;
|
|
456
939
|
};
|
|
457
940
|
readonly folders: {
|
|
458
|
-
/** List folders owned by the authenticated user */list: (query?: FolderListQuery
|
|
459
|
-
|
|
460
|
-
|
|
941
|
+
/** List folders owned by the authenticated user */list: (query?: FolderListQuery, signal?: AbortSignal, options?: {
|
|
942
|
+
asUser?: string;
|
|
943
|
+
}) => Promise<FolderListResponse>; /** Get a single folder by ID */
|
|
944
|
+
get: (id: string, signal?: AbortSignal, options?: {
|
|
945
|
+
asUser?: string;
|
|
946
|
+
}) => Promise<FolderDetailResponse>; /** Create a new folder */
|
|
947
|
+
create: (body: FolderCreateRequest, signal?: AbortSignal, options?: {
|
|
948
|
+
asUser?: string;
|
|
949
|
+
}) => Promise<FolderCreateResponse>; /** Update folder name or color tag */
|
|
950
|
+
update: (id: string, body: FolderUpdateRequest, signal?: AbortSignal, options?: {
|
|
951
|
+
asUser?: string;
|
|
952
|
+
}) => Promise<FolderUpdateResponse>; /** Soft-delete or permanently delete a folder and its contents */
|
|
461
953
|
delete: (id: string, query?: {
|
|
462
954
|
permanent?: boolean;
|
|
955
|
+
}, signal?: AbortSignal, options?: {
|
|
956
|
+
asUser?: string;
|
|
463
957
|
}) => Promise<FolderDeleteResponse>; /** Restore a folder from trash */
|
|
464
|
-
restore: (id: string
|
|
958
|
+
restore: (id: string, signal?: AbortSignal, options?: {
|
|
959
|
+
asUser?: string;
|
|
960
|
+
}) => Promise<FolderRestoreResponse>;
|
|
961
|
+
};
|
|
962
|
+
readonly mainStorage: {
|
|
963
|
+
/** List files in the main storage pool */list: (query?: MainStorageListQuery) => Promise<MainStorageListResponse>; /** Get a single main-storage file record */
|
|
964
|
+
get: (fileId: string) => Promise<FileRecord>; /** Rename a main-storage file */
|
|
965
|
+
rename: (fileId: string, filename: string) => Promise<FileRecord>; /** Delete a main-storage file (soft by default; pass permanent=true for hard delete) */
|
|
966
|
+
delete: (fileId: string, permanent?: boolean) => Promise<MainStorageDeleteResponse>; /** Restore a soft-deleted main-storage file */
|
|
967
|
+
restore: (fileId: string) => Promise<MainStorageRestoreResponse>;
|
|
968
|
+
upload: {
|
|
969
|
+
/** Initiate an R2 upload targeting main storage */r2Init: (input: Omit<UploadR2InitRequest, 'is_main_storage'>) => Promise<UploadR2InitResponse>; /** Initiate an Appwrite upload targeting main storage */
|
|
970
|
+
appwriteInit: (input: Omit<UploadAppwriteInitRequest, 'is_main_storage'>) => Promise<UploadAppwriteInitResponse>; /** Confirm a main-storage upload completed */
|
|
971
|
+
complete: (uploadId: string) => Promise<UploadCompleteResponse>; /** Mark a main-storage upload as failed */
|
|
972
|
+
fail: (uploadId: string) => Promise<UploadFailResponse>;
|
|
973
|
+
};
|
|
974
|
+
};
|
|
975
|
+
readonly releases: {
|
|
976
|
+
upload: {
|
|
977
|
+
/** Initiate a release upload — returns a presigned PUT URL */init: (body: ReleaseUploadInitRequest, signal?: AbortSignal) => Promise<ReleaseUploadInitResponse>; /** Confirm that a release object was successfully uploaded */
|
|
978
|
+
complete: (body: ReleaseUploadCompleteRequest, signal?: AbortSignal) => Promise<ReleaseUploadCompleteResponse>; /** Mark a release upload as failed */
|
|
979
|
+
fail: (releaseId: string, signal?: AbortSignal) => Promise<ReleaseUploadFailResponse>;
|
|
980
|
+
}; /** List releases for the configured service */
|
|
981
|
+
list: (query?: ReleasesListQuery, signal?: AbortSignal) => Promise<ReleasesListResponse>; /** Get a single release */
|
|
982
|
+
get: (releaseId: string, signal?: AbortSignal) => Promise<ReleaseDTO>; /** Get the latest completed release */
|
|
983
|
+
latest: (signal?: AbortSignal) => Promise<ReleaseDTO>; /** Update release metadata */
|
|
984
|
+
update: (releaseId: string, body: ReleaseUpdateRequest, signal?: AbortSignal) => Promise<ReleaseDTO>; /** Delete a release and its completed object, when applicable */
|
|
985
|
+
delete: (releaseId: string, signal?: AbortSignal) => Promise<ReleaseDeleteResponse>; /** Sync existing release manifests into the backend */
|
|
986
|
+
sync: (body: ReleaseSyncRequest, signal?: AbortSignal) => Promise<ReleaseSyncResponse>;
|
|
465
987
|
};
|
|
466
988
|
readonly admin: {
|
|
467
|
-
/** Get service info and quota limits */serviceDetail: () => Promise<ServiceDetailResponse>; /**
|
|
468
|
-
|
|
989
|
+
/** Get service info and quota limits */serviceDetail: (signal?: AbortSignal) => Promise<ServiceDetailResponse>; /** Update custom service-wide limits */
|
|
990
|
+
updateService: (body: AdminServiceUpdateRequest, signal?: AbortSignal) => Promise<AdminServiceUpdateResponse>; /** Get real-time storage usage for the service */
|
|
991
|
+
usage: (signal?: AbortSignal) => Promise<ServiceUsageResponse>; /** List all uploads (pending/completed/failed) for this service */
|
|
469
992
|
listUploads: (query?: {
|
|
470
|
-
status?:
|
|
993
|
+
status?: UploadStatus;
|
|
471
994
|
cursor?: string;
|
|
472
995
|
limit?: number;
|
|
473
|
-
}) => Promise<UploadsListResponse>; /**
|
|
474
|
-
|
|
996
|
+
}, signal?: AbortSignal) => Promise<UploadsListResponse>; /** Get a single upload for this service */
|
|
997
|
+
getUpload: (id: string, signal?: AbortSignal) => Promise<UploadRecordDetailResponse>; /** Get a time-limited download URL for an upload owned by this service */
|
|
998
|
+
downloadUploadUrl: (id: string, signal?: AbortSignal) => Promise<FileDownloadUrlResponse>; /** Permanently delete an upload owned by this service */
|
|
999
|
+
deleteUpload: (id: string, signal?: AbortSignal) => Promise<FileDeleteResponse>; /** List audit log events for this service */
|
|
1000
|
+
auditLog: (query?: AuditLogListQuery, signal?: AbortSignal) => Promise<AuditLogListResponse>; /** List Appwrite users together with service-specific metadata */
|
|
1001
|
+
listUsers: (query?: {
|
|
1002
|
+
search?: string;
|
|
1003
|
+
offset?: number;
|
|
1004
|
+
limit?: number;
|
|
1005
|
+
}, signal?: AbortSignal) => Promise<AdminUserListResponse>; /** Update Appwrite user properties and service-specific quota/role */
|
|
1006
|
+
updateUser: (userId: string, body: AdminUserUpdateRequest, signal?: AbortSignal) => Promise<AdminUserUpdateResponse>; /** Overwrite a user's password and revoke active sessions */
|
|
1007
|
+
resetUserPassword: (userId: string, body: AdminUserPasswordResetRequest, signal?: AbortSignal) => Promise<AdminUserPasswordResetResponse>;
|
|
1008
|
+
};
|
|
1009
|
+
readonly shareLinks: {
|
|
1010
|
+
/** Create a public share link for a file */create: (fileId: string, body: ShareLinkCreateRequest, signal?: AbortSignal) => Promise<ShareLinkCreateResponse>; /** List all share links for a file */
|
|
1011
|
+
list: (fileId: string, signal?: AbortSignal) => Promise<ShareLinkListResponse>; /** Update a share link (rename, toggle, change password/expiry) */
|
|
1012
|
+
update: (linkId: string, body: ShareLinkUpdateRequest, signal?: AbortSignal) => Promise<ShareLinkUpdateResponse>; /** Permanently delete a share link */
|
|
1013
|
+
delete: (linkId: string, signal?: AbortSignal) => Promise<ShareLinkDeleteResponse>;
|
|
475
1014
|
};
|
|
476
1015
|
}
|
|
477
1016
|
//#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 };
|
|
1017
|
+
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, MainStorageListQuery, MainStorageListResponse, MainStorageRenameRequest, 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, mainStorageListQuerySchema, mainStorageListResponseSchema, mainStorageRenameRequestSchema, 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 };
|