@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/src/services.ts
CHANGED
|
@@ -1,69 +1,135 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { nonEmptyString, positiveInt, unixTimestamp } from './primitives';
|
|
3
|
-
|
|
4
|
-
// ─── Service record ───────────────────────────────────────────────────────────
|
|
5
|
-
|
|
6
|
-
/** Public service info returned to admins. Never exposes secrets. */
|
|
7
|
-
export const serviceSchema = z.object({
|
|
8
|
-
id: nonEmptyString,
|
|
9
|
-
name: nonEmptyString,
|
|
10
|
-
max_storage_bytes: positiveInt,
|
|
11
|
-
current_used_bytes: z.number().int().nonnegative(),
|
|
12
|
-
max_file_size_bytes: positiveInt,
|
|
13
|
-
created_at: unixTimestamp,
|
|
14
|
-
});
|
|
15
|
-
export type Service = z.infer<typeof serviceSchema>;
|
|
16
|
-
|
|
17
|
-
export const serviceDetailResponseSchema = z.object({
|
|
18
|
-
service: serviceSchema,
|
|
19
|
-
});
|
|
20
|
-
export type ServiceDetailResponse = z.infer<typeof serviceDetailResponseSchema>;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
export
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
});
|
|
69
|
-
export type
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { nonEmptyString, positiveInt, unixTimestamp } from './primitives';
|
|
3
|
+
|
|
4
|
+
// ─── Service record ───────────────────────────────────────────────────────────
|
|
5
|
+
|
|
6
|
+
/** Public service info returned to admins. Never exposes secrets. */
|
|
7
|
+
export const serviceSchema = z.object({
|
|
8
|
+
id: nonEmptyString,
|
|
9
|
+
name: nonEmptyString,
|
|
10
|
+
max_storage_bytes: positiveInt,
|
|
11
|
+
current_used_bytes: z.number().int().nonnegative(),
|
|
12
|
+
max_file_size_bytes: positiveInt,
|
|
13
|
+
created_at: unixTimestamp,
|
|
14
|
+
});
|
|
15
|
+
export type Service = z.infer<typeof serviceSchema>;
|
|
16
|
+
|
|
17
|
+
export const serviceDetailResponseSchema = z.object({
|
|
18
|
+
service: serviceSchema,
|
|
19
|
+
});
|
|
20
|
+
export type ServiceDetailResponse = z.infer<typeof serviceDetailResponseSchema>;
|
|
21
|
+
|
|
22
|
+
export const adminServiceUpdateRequestSchema = z
|
|
23
|
+
.object({
|
|
24
|
+
max_storage_bytes: positiveInt.optional(),
|
|
25
|
+
max_file_size_bytes: positiveInt.optional(),
|
|
26
|
+
})
|
|
27
|
+
.refine(
|
|
28
|
+
(v) => v.max_storage_bytes !== undefined || v.max_file_size_bytes !== undefined,
|
|
29
|
+
{ message: 'At least one of max_storage_bytes or max_file_size_bytes must be provided' }
|
|
30
|
+
);
|
|
31
|
+
export type AdminServiceUpdateRequest = z.infer<typeof adminServiceUpdateRequestSchema>;
|
|
32
|
+
|
|
33
|
+
export const adminServiceUpdateResponseSchema = serviceDetailResponseSchema;
|
|
34
|
+
export type AdminServiceUpdateResponse = z.infer<typeof adminServiceUpdateResponseSchema>;
|
|
35
|
+
|
|
36
|
+
// ─── Service usage summary ────────────────────────────────────────────────────
|
|
37
|
+
|
|
38
|
+
export const serviceUsageResponseSchema = z.object({
|
|
39
|
+
service_id: nonEmptyString,
|
|
40
|
+
max_storage_bytes: positiveInt,
|
|
41
|
+
current_used_bytes: z.number().int().nonnegative(),
|
|
42
|
+
used_percent: z.number().min(0).max(100),
|
|
43
|
+
});
|
|
44
|
+
export type ServiceUsageResponse = z.infer<typeof serviceUsageResponseSchema>;
|
|
45
|
+
|
|
46
|
+
// ─── Audit log event ──────────────────────────────────────────────────────────
|
|
47
|
+
|
|
48
|
+
export const auditEventActionSchema = z.enum([
|
|
49
|
+
'upload_completed',
|
|
50
|
+
'file_deleted',
|
|
51
|
+
'folder_deleted',
|
|
52
|
+
'quota_exceeded',
|
|
53
|
+
'share_link_accessed',
|
|
54
|
+
'quota_reconciled',
|
|
55
|
+
]);
|
|
56
|
+
export type AuditEventAction = z.infer<typeof auditEventActionSchema>;
|
|
57
|
+
|
|
58
|
+
export const auditEventSchema = z.object({
|
|
59
|
+
id: nonEmptyString,
|
|
60
|
+
service_id: nonEmptyString,
|
|
61
|
+
user_id: nonEmptyString,
|
|
62
|
+
action: auditEventActionSchema,
|
|
63
|
+
resource_type: z.enum(['file', 'folder', 'service']),
|
|
64
|
+
resource_id: nonEmptyString,
|
|
65
|
+
metadata: z.record(z.string(), z.unknown()).nullable(),
|
|
66
|
+
ip_address: z.string().nullable(),
|
|
67
|
+
created_at: unixTimestamp,
|
|
68
|
+
});
|
|
69
|
+
export type AuditEvent = z.infer<typeof auditEventSchema>;
|
|
70
|
+
|
|
71
|
+
export const auditLogListQuerySchema = z.object({
|
|
72
|
+
user_id: nonEmptyString.optional(),
|
|
73
|
+
action: auditEventActionSchema.optional(),
|
|
74
|
+
resource_type: z.enum(['file', 'folder', 'service']).optional(),
|
|
75
|
+
cursor: nonEmptyString.optional(),
|
|
76
|
+
limit: z.number().int().min(1).max(200).optional(),
|
|
77
|
+
});
|
|
78
|
+
export type AuditLogListQuery = z.infer<typeof auditLogListQuerySchema>;
|
|
79
|
+
|
|
80
|
+
export const auditLogListResponseSchema = z.object({
|
|
81
|
+
items: z.array(auditEventSchema),
|
|
82
|
+
next_cursor: z.string().nullable(),
|
|
83
|
+
limit: positiveInt,
|
|
84
|
+
});
|
|
85
|
+
export type AuditLogListResponse = z.infer<typeof auditLogListResponseSchema>;
|
|
86
|
+
|
|
87
|
+
export const adminUserSchema = z.object({
|
|
88
|
+
id: nonEmptyString,
|
|
89
|
+
name: z.string(),
|
|
90
|
+
email: z.string().email(),
|
|
91
|
+
status: z.boolean(),
|
|
92
|
+
labels: z.array(z.string()),
|
|
93
|
+
role: nonEmptyString,
|
|
94
|
+
has_service_access: z.boolean(),
|
|
95
|
+
max_storage_bytes: positiveInt.nullable(),
|
|
96
|
+
effective_max_storage_bytes: positiveInt,
|
|
97
|
+
current_used_bytes: z.number().int().nonnegative(),
|
|
98
|
+
registration: unixTimestamp,
|
|
99
|
+
email_verification: z.boolean(),
|
|
100
|
+
});
|
|
101
|
+
export type AdminUser = z.infer<typeof adminUserSchema>;
|
|
102
|
+
|
|
103
|
+
export const adminUserListResponseSchema = z.object({
|
|
104
|
+
items: z.array(adminUserSchema),
|
|
105
|
+
total: z.number().int().nonnegative(),
|
|
106
|
+
offset: z.number().int().nonnegative(),
|
|
107
|
+
limit: positiveInt,
|
|
108
|
+
});
|
|
109
|
+
export type AdminUserListResponse = z.infer<typeof adminUserListResponseSchema>;
|
|
110
|
+
|
|
111
|
+
export const adminUserUpdateRequestSchema = z.object({
|
|
112
|
+
name: z.string().trim().min(1).max(128).optional(),
|
|
113
|
+
email: z.string().trim().email().optional(),
|
|
114
|
+
status: z.boolean().optional(),
|
|
115
|
+
labels: z.array(z.string().trim().min(1)).max(32).optional(),
|
|
116
|
+
role: z.enum(['user', 'plus', 'admin']).optional(),
|
|
117
|
+
max_storage_bytes: positiveInt.nullable().optional(),
|
|
118
|
+
});
|
|
119
|
+
export type AdminUserUpdateRequest = z.infer<typeof adminUserUpdateRequestSchema>;
|
|
120
|
+
|
|
121
|
+
export const adminUserUpdateResponseSchema = z.object({
|
|
122
|
+
user: adminUserSchema,
|
|
123
|
+
});
|
|
124
|
+
export type AdminUserUpdateResponse = z.infer<typeof adminUserUpdateResponseSchema>;
|
|
125
|
+
|
|
126
|
+
export const adminUserPasswordResetRequestSchema = z.object({
|
|
127
|
+
password: z.string().min(8).max(256),
|
|
128
|
+
});
|
|
129
|
+
export type AdminUserPasswordResetRequest = z.infer<typeof adminUserPasswordResetRequestSchema>;
|
|
130
|
+
|
|
131
|
+
export const adminUserPasswordResetResponseSchema = z.object({
|
|
132
|
+
success: z.literal(true),
|
|
133
|
+
user_id: nonEmptyString,
|
|
134
|
+
});
|
|
135
|
+
export type AdminUserPasswordResetResponse = z.infer<typeof adminUserPasswordResetResponseSchema>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { nonEmptyString, positiveInt, unixTimestamp } from './primitives';
|
|
3
|
+
|
|
4
|
+
export const shareLinkSchema = z.object({
|
|
5
|
+
id: nonEmptyString,
|
|
6
|
+
service_id: nonEmptyString,
|
|
7
|
+
file_id: nonEmptyString,
|
|
8
|
+
user_id: nonEmptyString,
|
|
9
|
+
slug: nonEmptyString,
|
|
10
|
+
name: z.string().nullable(),
|
|
11
|
+
has_password: z.boolean(),
|
|
12
|
+
expires_at: unixTimestamp.nullable(),
|
|
13
|
+
download_count: z.number().int().nonnegative(),
|
|
14
|
+
max_downloads: positiveInt.nullable(),
|
|
15
|
+
is_active: z.boolean(),
|
|
16
|
+
created_at: unixTimestamp,
|
|
17
|
+
updated_at: unixTimestamp,
|
|
18
|
+
});
|
|
19
|
+
export type ShareLink = z.infer<typeof shareLinkSchema>;
|
|
20
|
+
|
|
21
|
+
export const shareLinkCreateRequestSchema = z.object({
|
|
22
|
+
slug: z.string().trim().min(3).max(64).optional(),
|
|
23
|
+
name: z.string().trim().max(128).optional(),
|
|
24
|
+
password: z.string().min(1).optional(),
|
|
25
|
+
expires_at: unixTimestamp.optional(),
|
|
26
|
+
max_downloads: positiveInt.optional(),
|
|
27
|
+
});
|
|
28
|
+
export type ShareLinkCreateRequest = z.infer<typeof shareLinkCreateRequestSchema>;
|
|
29
|
+
|
|
30
|
+
export const shareLinkUpdateRequestSchema = z
|
|
31
|
+
.object({
|
|
32
|
+
name: z.string().trim().max(128).nullable().optional(),
|
|
33
|
+
is_active: z.boolean().optional(),
|
|
34
|
+
password: z.string().min(1).nullable().optional(),
|
|
35
|
+
expires_at: unixTimestamp.nullable().optional(),
|
|
36
|
+
max_downloads: positiveInt.nullable().optional(),
|
|
37
|
+
})
|
|
38
|
+
.refine(
|
|
39
|
+
(v) =>
|
|
40
|
+
v.name !== undefined ||
|
|
41
|
+
v.is_active !== undefined ||
|
|
42
|
+
v.password !== undefined ||
|
|
43
|
+
v.expires_at !== undefined ||
|
|
44
|
+
v.max_downloads !== undefined,
|
|
45
|
+
{ message: 'At least one field must be provided' }
|
|
46
|
+
);
|
|
47
|
+
export type ShareLinkUpdateRequest = z.infer<typeof shareLinkUpdateRequestSchema>;
|
|
48
|
+
|
|
49
|
+
export const shareLinkListResponseSchema = z.object({
|
|
50
|
+
items: z.array(shareLinkSchema),
|
|
51
|
+
});
|
|
52
|
+
export type ShareLinkListResponse = z.infer<typeof shareLinkListResponseSchema>;
|
|
53
|
+
|
|
54
|
+
export const shareLinkCreateResponseSchema = z.object({
|
|
55
|
+
link: shareLinkSchema,
|
|
56
|
+
});
|
|
57
|
+
export type ShareLinkCreateResponse = z.infer<typeof shareLinkCreateResponseSchema>;
|
|
58
|
+
|
|
59
|
+
export const shareLinkUpdateResponseSchema = z.object({
|
|
60
|
+
link: shareLinkSchema,
|
|
61
|
+
});
|
|
62
|
+
export type ShareLinkUpdateResponse = z.infer<typeof shareLinkUpdateResponseSchema>;
|
|
63
|
+
|
|
64
|
+
// Returned when link has no password OR after unlock
|
|
65
|
+
export const publicFileAccessResponseSchema = z.object({
|
|
66
|
+
file_id: nonEmptyString,
|
|
67
|
+
filename: nonEmptyString,
|
|
68
|
+
size: positiveInt,
|
|
69
|
+
mime_type: nonEmptyString,
|
|
70
|
+
requires_password: z.literal(false),
|
|
71
|
+
download_url: z.string().url(),
|
|
72
|
+
url_expires_at: unixTimestamp,
|
|
73
|
+
link_name: z.string().nullable(),
|
|
74
|
+
link_expires_at: unixTimestamp.nullable(),
|
|
75
|
+
});
|
|
76
|
+
export type PublicFileAccessResponse = z.infer<typeof publicFileAccessResponseSchema>;
|
|
77
|
+
|
|
78
|
+
// Returned when link requires password (no download URL)
|
|
79
|
+
export const publicFileLockedResponseSchema = z.object({
|
|
80
|
+
filename: nonEmptyString,
|
|
81
|
+
size: positiveInt,
|
|
82
|
+
mime_type: nonEmptyString,
|
|
83
|
+
requires_password: z.literal(true),
|
|
84
|
+
link_name: z.string().nullable(),
|
|
85
|
+
});
|
|
86
|
+
export type PublicFileLockedResponse = z.infer<typeof publicFileLockedResponseSchema>;
|
|
87
|
+
|
|
88
|
+
// ─── Delete ───────────────────────────────────────────────────────────────────
|
|
89
|
+
export const shareLinkDeleteResponseSchema = z.object({
|
|
90
|
+
success: z.literal(true),
|
|
91
|
+
id: nonEmptyString,
|
|
92
|
+
});
|
|
93
|
+
export type ShareLinkDeleteResponse = z.infer<typeof shareLinkDeleteResponseSchema>;
|
package/src/uploads.ts
CHANGED
|
@@ -1,90 +1,99 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { nonEmptyString, positiveInt, uploadDestinationSchema } from './primitives';
|
|
3
|
-
|
|
4
|
-
// ─── Init: R2 ────────────────────────────────────────────────────────────────
|
|
5
|
-
|
|
6
|
-
export const uploadR2InitRequestSchema = z.object({
|
|
7
|
-
filename: nonEmptyString,
|
|
8
|
-
size: positiveInt,
|
|
9
|
-
mime_type: nonEmptyString,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
export
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
export
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
export
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
export
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { nonEmptyString, positiveInt, uploadDestinationSchema, uploadStatusSchema, FILES_DEFAULT_LIMIT, FILES_MAX_LIMIT } from './primitives';
|
|
3
|
+
|
|
4
|
+
// ─── Init: R2 ────────────────────────────────────────────────────────────────
|
|
5
|
+
|
|
6
|
+
export const uploadR2InitRequestSchema = z.object({
|
|
7
|
+
filename: nonEmptyString,
|
|
8
|
+
size: positiveInt,
|
|
9
|
+
mime_type: nonEmptyString,
|
|
10
|
+
folder_id: nonEmptyString.optional(),
|
|
11
|
+
is_main_storage: z.boolean().optional().default(false),
|
|
12
|
+
});
|
|
13
|
+
export type UploadR2InitRequest = z.infer<typeof uploadR2InitRequestSchema>;
|
|
14
|
+
|
|
15
|
+
export const uploadR2InitResponseSchema = z.object({
|
|
16
|
+
upload_id: nonEmptyString,
|
|
17
|
+
destination: z.literal('r2'),
|
|
18
|
+
presigned_url: z.string().url(),
|
|
19
|
+
storage_key: nonEmptyString,
|
|
20
|
+
bucket: nonEmptyString,
|
|
21
|
+
expires_at: positiveInt,
|
|
22
|
+
});
|
|
23
|
+
export type UploadR2InitResponse = z.infer<typeof uploadR2InitResponseSchema>;
|
|
24
|
+
|
|
25
|
+
// ─── Init: Appwrite ───────────────────────────────────────────────────────────
|
|
26
|
+
|
|
27
|
+
export const uploadAppwriteInitRequestSchema = z.object({
|
|
28
|
+
filename: nonEmptyString,
|
|
29
|
+
size: positiveInt,
|
|
30
|
+
mime_type: nonEmptyString,
|
|
31
|
+
folder_id: nonEmptyString.optional(),
|
|
32
|
+
is_main_storage: z.boolean().optional().default(false),
|
|
33
|
+
});
|
|
34
|
+
export type UploadAppwriteInitRequest = z.infer<typeof uploadAppwriteInitRequestSchema>;
|
|
35
|
+
|
|
36
|
+
export const uploadAppwriteInitResponseSchema = z.object({
|
|
37
|
+
upload_id: nonEmptyString,
|
|
38
|
+
destination: z.literal('appwrite'),
|
|
39
|
+
appwrite_endpoint: z.string().url(),
|
|
40
|
+
appwrite_project_id: nonEmptyString,
|
|
41
|
+
appwrite_bucket_id: nonEmptyString,
|
|
42
|
+
file_id: nonEmptyString,
|
|
43
|
+
expires_at: positiveInt,
|
|
44
|
+
});
|
|
45
|
+
export type UploadAppwriteInitResponse = z.infer<typeof uploadAppwriteInitResponseSchema>;
|
|
46
|
+
|
|
47
|
+
// ─── Lifecycle ────────────────────────────────────────────────────────────────
|
|
48
|
+
|
|
49
|
+
export const uploadLifecycleRequestSchema = z.object({
|
|
50
|
+
upload_id: nonEmptyString,
|
|
51
|
+
is_main_storage: z.boolean().optional().default(false),
|
|
52
|
+
});
|
|
53
|
+
export type UploadLifecycleRequest = z.infer<typeof uploadLifecycleRequestSchema>;
|
|
54
|
+
|
|
55
|
+
export const uploadCompleteResponseSchema = z.object({
|
|
56
|
+
success: z.literal(true),
|
|
57
|
+
upload_id: nonEmptyString,
|
|
58
|
+
status: z.literal('completed'),
|
|
59
|
+
});
|
|
60
|
+
export type UploadCompleteResponse = z.infer<typeof uploadCompleteResponseSchema>;
|
|
61
|
+
|
|
62
|
+
export const uploadFailResponseSchema = z.object({
|
|
63
|
+
success: z.literal(true),
|
|
64
|
+
upload_id: nonEmptyString,
|
|
65
|
+
status: z.literal('failed'),
|
|
66
|
+
});
|
|
67
|
+
export type UploadFailResponse = z.infer<typeof uploadFailResponseSchema>;
|
|
68
|
+
|
|
69
|
+
// ─── Admin: list uploads ──────────────────────────────────────────────────────
|
|
70
|
+
|
|
71
|
+
export { FILES_DEFAULT_LIMIT, FILES_MAX_LIMIT };
|
|
72
|
+
|
|
73
|
+
/** Raw upload record — returned by admin `/files` endpoints. */
|
|
74
|
+
export const uploadRecordSchema = z.object({
|
|
75
|
+
id: nonEmptyString,
|
|
76
|
+
service_id: nonEmptyString,
|
|
77
|
+
user_id: nonEmptyString.nullable(),
|
|
78
|
+
filename: nonEmptyString,
|
|
79
|
+
size: positiveInt,
|
|
80
|
+
mime_type: nonEmptyString,
|
|
81
|
+
destination: uploadDestinationSchema,
|
|
82
|
+
status: uploadStatusSchema,
|
|
83
|
+
expires_at: positiveInt,
|
|
84
|
+
created_at: positiveInt,
|
|
85
|
+
updated_at: positiveInt,
|
|
86
|
+
});
|
|
87
|
+
export type UploadRecord = z.infer<typeof uploadRecordSchema>;
|
|
88
|
+
|
|
89
|
+
export const uploadsListResponseSchema = z.object({
|
|
90
|
+
items: z.array(uploadRecordSchema),
|
|
91
|
+
next_cursor: z.string().nullable(),
|
|
92
|
+
limit: positiveInt,
|
|
93
|
+
});
|
|
94
|
+
export type UploadsListResponse = z.infer<typeof uploadsListResponseSchema>;
|
|
95
|
+
|
|
96
|
+
export const uploadRecordDetailResponseSchema = z.object({
|
|
97
|
+
upload: uploadRecordSchema,
|
|
98
|
+
});
|
|
99
|
+
export type UploadRecordDetailResponse = z.infer<typeof uploadRecordDetailResponseSchema>;
|