@darco2903/cdn-api 1.1.7 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +9 -10
- package/dist/contract/auth.d.ts +4 -2
- package/dist/contract/endpoint.d.ts +2 -2
- package/dist/contract/index.d.ts +101 -28
- package/dist/contract/key.d.ts +4 -2
- package/dist/contract/list.d.ts +45 -6
- package/dist/contract/record.d.ts +31 -4
- package/dist/contract/service.d.ts +2 -2
- package/dist/contract/stats.d.ts +6 -2
- package/dist/contract/upload.d.ts +7 -8
- package/dist/contract/upload.js +3 -3
- package/dist/types/upload.d.ts +0 -3
- package/dist/types/upload.js +0 -1
- package/dist/types.d.ts +2 -1
- package/dist/uploader.d.ts +9 -10
- package/dist/uploader.js +0 -1
- package/package.json +3 -3
package/dist/client.d.ts
CHANGED
|
@@ -497,8 +497,8 @@ export declare function createClient(origin: string): {
|
|
|
497
497
|
authorization?: string | undefined;
|
|
498
498
|
} | undefined;
|
|
499
499
|
}) => Promise<{
|
|
500
|
-
status:
|
|
501
|
-
body:
|
|
500
|
+
status: 204;
|
|
501
|
+
body: undefined;
|
|
502
502
|
headers: Headers;
|
|
503
503
|
} | {
|
|
504
504
|
status: 400;
|
|
@@ -557,7 +557,7 @@ export declare function createClient(origin: string): {
|
|
|
557
557
|
};
|
|
558
558
|
headers: Headers;
|
|
559
559
|
} | {
|
|
560
|
-
status: 201 | 202 | 203 |
|
|
560
|
+
status: 200 | 201 | 202 | 203 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 402 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
561
561
|
body: unknown;
|
|
562
562
|
headers: Headers;
|
|
563
563
|
}>;
|
|
@@ -568,7 +568,6 @@ export declare function createClient(origin: string): {
|
|
|
568
568
|
visible: boolean;
|
|
569
569
|
role: number;
|
|
570
570
|
size: number;
|
|
571
|
-
mimeType: string;
|
|
572
571
|
parts: number;
|
|
573
572
|
};
|
|
574
573
|
cache?: RequestCache | undefined;
|
|
@@ -655,8 +654,8 @@ export declare function createClient(origin: string): {
|
|
|
655
654
|
extraHeaders?: Record<string, string | undefined> | undefined;
|
|
656
655
|
overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
|
|
657
656
|
}) => Promise<{
|
|
658
|
-
status:
|
|
659
|
-
body:
|
|
657
|
+
status: 204;
|
|
658
|
+
body: undefined;
|
|
660
659
|
headers: Headers;
|
|
661
660
|
} | {
|
|
662
661
|
status: 400;
|
|
@@ -731,7 +730,7 @@ export declare function createClient(origin: string): {
|
|
|
731
730
|
};
|
|
732
731
|
headers: Headers;
|
|
733
732
|
} | {
|
|
734
|
-
status: 201 | 202 | 203 |
|
|
733
|
+
status: 200 | 201 | 202 | 203 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
735
734
|
body: unknown;
|
|
736
735
|
headers: Headers;
|
|
737
736
|
}>;
|
|
@@ -744,8 +743,8 @@ export declare function createClient(origin: string): {
|
|
|
744
743
|
extraHeaders?: Record<string, string | undefined> | undefined;
|
|
745
744
|
overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
|
|
746
745
|
}) => Promise<{
|
|
747
|
-
status:
|
|
748
|
-
body:
|
|
746
|
+
status: 204;
|
|
747
|
+
body: undefined;
|
|
749
748
|
headers: Headers;
|
|
750
749
|
} | {
|
|
751
750
|
status: 400;
|
|
@@ -808,7 +807,7 @@ export declare function createClient(origin: string): {
|
|
|
808
807
|
};
|
|
809
808
|
headers: Headers;
|
|
810
809
|
} | {
|
|
811
|
-
status: 201 | 202 | 203 |
|
|
810
|
+
status: 200 | 201 | 202 | 203 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
812
811
|
body: unknown;
|
|
813
812
|
headers: Headers;
|
|
814
813
|
}>;
|
package/dist/contract/auth.d.ts
CHANGED
|
@@ -11,9 +11,11 @@ declare const _default: {
|
|
|
11
11
|
authorization?: string | undefined;
|
|
12
12
|
}>;
|
|
13
13
|
responses: {
|
|
14
|
-
200: z.
|
|
14
|
+
200: z.ZodObject<{
|
|
15
|
+
access: z.ZodBoolean;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
17
|
access: boolean;
|
|
16
|
-
},
|
|
18
|
+
}, {
|
|
17
19
|
access: boolean;
|
|
18
20
|
}>;
|
|
19
21
|
500: z.ZodObject<{
|
|
@@ -21,7 +21,7 @@ declare const _default: {
|
|
|
21
21
|
authorization?: string | undefined;
|
|
22
22
|
}>;
|
|
23
23
|
responses: {
|
|
24
|
-
200: z.
|
|
24
|
+
200: z.ZodNull;
|
|
25
25
|
400: z.ZodObject<{
|
|
26
26
|
name: z.ZodLiteral<"ZodError">;
|
|
27
27
|
issues: z.ZodArray<z.ZodObject<{
|
|
@@ -222,7 +222,7 @@ declare const _default: {
|
|
|
222
222
|
authorization?: string | undefined;
|
|
223
223
|
}>;
|
|
224
224
|
responses: {
|
|
225
|
-
200: z.
|
|
225
|
+
200: z.ZodNull;
|
|
226
226
|
400: z.ZodObject<{
|
|
227
227
|
name: z.ZodLiteral<"ZodError">;
|
|
228
228
|
issues: z.ZodArray<z.ZodObject<{
|
package/dist/contract/index.d.ts
CHANGED
|
@@ -11,7 +11,19 @@ declare const _default: {
|
|
|
11
11
|
authorization?: string | undefined;
|
|
12
12
|
}>;
|
|
13
13
|
responses: {
|
|
14
|
-
200: import("zod").
|
|
14
|
+
200: import("zod").ZodArray<import("zod").ZodObject<{
|
|
15
|
+
storage_id: import("zod").ZodString;
|
|
16
|
+
filename: import("zod").ZodString;
|
|
17
|
+
size: import("zod").ZodNumber;
|
|
18
|
+
mime_type: import("zod").ZodString;
|
|
19
|
+
endpoints: import("zod").ZodArray<import("zod").ZodObject<{
|
|
20
|
+
endpoint: import("zod").ZodString;
|
|
21
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
22
|
+
endpoint: string;
|
|
23
|
+
}, {
|
|
24
|
+
endpoint: string;
|
|
25
|
+
}>, "many">;
|
|
26
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
15
27
|
filename: string;
|
|
16
28
|
size: number;
|
|
17
29
|
storage_id: string;
|
|
@@ -19,7 +31,7 @@ declare const _default: {
|
|
|
19
31
|
endpoints: {
|
|
20
32
|
endpoint: string;
|
|
21
33
|
}[];
|
|
22
|
-
}
|
|
34
|
+
}, {
|
|
23
35
|
filename: string;
|
|
24
36
|
size: number;
|
|
25
37
|
storage_id: string;
|
|
@@ -27,7 +39,7 @@ declare const _default: {
|
|
|
27
39
|
endpoints: {
|
|
28
40
|
endpoint: string;
|
|
29
41
|
}[];
|
|
30
|
-
}
|
|
42
|
+
}>, "many">;
|
|
31
43
|
500: import("zod").ZodObject<{
|
|
32
44
|
code: import("zod").ZodType<"INTERNAL_SERVER_ERROR", import("zod").ZodTypeDef, "INTERNAL_SERVER_ERROR">;
|
|
33
45
|
error: import("zod").ZodType<string, import("zod").ZodTypeDef, string>;
|
|
@@ -54,7 +66,34 @@ declare const _default: {
|
|
|
54
66
|
authorization?: string | undefined;
|
|
55
67
|
}>;
|
|
56
68
|
responses: {
|
|
57
|
-
200: import("zod").
|
|
69
|
+
200: import("zod").ZodArray<import("zod").ZodObject<{
|
|
70
|
+
storage_id: import("zod").ZodString;
|
|
71
|
+
filename: import("zod").ZodString;
|
|
72
|
+
size: import("zod").ZodNumber;
|
|
73
|
+
mime_type: import("zod").ZodString;
|
|
74
|
+
} & {
|
|
75
|
+
endpoints: import("zod").ZodArray<import("zod").ZodObject<{
|
|
76
|
+
endpoint: import("zod").ZodString;
|
|
77
|
+
} & {
|
|
78
|
+
created_at: import("zod").ZodDate;
|
|
79
|
+
updated_at: import("zod").ZodDate;
|
|
80
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
81
|
+
created_at: Date;
|
|
82
|
+
updated_at: Date;
|
|
83
|
+
endpoint: string;
|
|
84
|
+
}, {
|
|
85
|
+
created_at: Date;
|
|
86
|
+
updated_at: Date;
|
|
87
|
+
endpoint: string;
|
|
88
|
+
}>, "many">;
|
|
89
|
+
role: import("zod").ZodNumber;
|
|
90
|
+
user_id: import("zod").ZodNullable<import("zod").ZodString>;
|
|
91
|
+
type: import("zod").ZodEnum<["service", "system", "user"]>;
|
|
92
|
+
visible: import("zod").ZodBoolean;
|
|
93
|
+
active: import("zod").ZodBoolean;
|
|
94
|
+
created_at: import("zod").ZodDate;
|
|
95
|
+
updated_at: import("zod").ZodDate;
|
|
96
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
58
97
|
type: "user" | "system" | "service";
|
|
59
98
|
filename: string;
|
|
60
99
|
active: boolean;
|
|
@@ -71,7 +110,7 @@ declare const _default: {
|
|
|
71
110
|
endpoint: string;
|
|
72
111
|
}[];
|
|
73
112
|
user_id: string | null;
|
|
74
|
-
}
|
|
113
|
+
}, {
|
|
75
114
|
type: "user" | "system" | "service";
|
|
76
115
|
filename: string;
|
|
77
116
|
active: boolean;
|
|
@@ -88,7 +127,7 @@ declare const _default: {
|
|
|
88
127
|
endpoint: string;
|
|
89
128
|
}[];
|
|
90
129
|
user_id: string | null;
|
|
91
|
-
}
|
|
130
|
+
}>, "many">;
|
|
92
131
|
401: import("zod").ZodObject<{
|
|
93
132
|
code: import("zod").ZodType<"UNAUTHORIZED", import("zod").ZodTypeDef, "UNAUTHORIZED">;
|
|
94
133
|
error: import("zod").ZodType<"Unauthorized", import("zod").ZodTypeDef, "Unauthorized">;
|
|
@@ -143,7 +182,34 @@ declare const _default: {
|
|
|
143
182
|
authorization?: string | undefined;
|
|
144
183
|
}>;
|
|
145
184
|
responses: {
|
|
146
|
-
200: import("zod").
|
|
185
|
+
200: import("zod").ZodObject<{
|
|
186
|
+
storage_id: import("zod").ZodString;
|
|
187
|
+
filename: import("zod").ZodString;
|
|
188
|
+
size: import("zod").ZodNumber;
|
|
189
|
+
mime_type: import("zod").ZodString;
|
|
190
|
+
} & {
|
|
191
|
+
endpoints: import("zod").ZodArray<import("zod").ZodObject<{
|
|
192
|
+
endpoint: import("zod").ZodString;
|
|
193
|
+
} & {
|
|
194
|
+
created_at: import("zod").ZodDate;
|
|
195
|
+
updated_at: import("zod").ZodDate;
|
|
196
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
197
|
+
created_at: Date;
|
|
198
|
+
updated_at: Date;
|
|
199
|
+
endpoint: string;
|
|
200
|
+
}, {
|
|
201
|
+
created_at: Date;
|
|
202
|
+
updated_at: Date;
|
|
203
|
+
endpoint: string;
|
|
204
|
+
}>, "many">;
|
|
205
|
+
role: import("zod").ZodNumber;
|
|
206
|
+
user_id: import("zod").ZodNullable<import("zod").ZodString>;
|
|
207
|
+
type: import("zod").ZodEnum<["service", "system", "user"]>;
|
|
208
|
+
visible: import("zod").ZodBoolean;
|
|
209
|
+
active: import("zod").ZodBoolean;
|
|
210
|
+
created_at: import("zod").ZodDate;
|
|
211
|
+
updated_at: import("zod").ZodDate;
|
|
212
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
147
213
|
type: "user" | "system" | "service";
|
|
148
214
|
filename: string;
|
|
149
215
|
active: boolean;
|
|
@@ -160,7 +226,7 @@ declare const _default: {
|
|
|
160
226
|
endpoint: string;
|
|
161
227
|
}[];
|
|
162
228
|
user_id: string | null;
|
|
163
|
-
},
|
|
229
|
+
}, {
|
|
164
230
|
type: "user" | "system" | "service";
|
|
165
231
|
filename: string;
|
|
166
232
|
active: boolean;
|
|
@@ -304,7 +370,7 @@ declare const _default: {
|
|
|
304
370
|
authorization?: string | undefined;
|
|
305
371
|
}>;
|
|
306
372
|
responses: {
|
|
307
|
-
200: import("zod").
|
|
373
|
+
200: import("zod").ZodNull;
|
|
308
374
|
400: import("zod").ZodObject<{
|
|
309
375
|
name: import("zod").ZodLiteral<"ZodError">;
|
|
310
376
|
issues: import("zod").ZodArray<import("zod").ZodObject<{
|
|
@@ -485,7 +551,7 @@ declare const _default: {
|
|
|
485
551
|
authorization?: string | undefined;
|
|
486
552
|
}>;
|
|
487
553
|
responses: {
|
|
488
|
-
200: import("zod").
|
|
554
|
+
200: import("zod").ZodNull;
|
|
489
555
|
401: import("zod").ZodObject<{
|
|
490
556
|
code: import("zod").ZodType<"UNAUTHORIZED", import("zod").ZodTypeDef, "UNAUTHORIZED">;
|
|
491
557
|
error: import("zod").ZodType<"Unauthorized", import("zod").ZodTypeDef, "Unauthorized">;
|
|
@@ -555,7 +621,7 @@ declare const _default: {
|
|
|
555
621
|
authorization: string;
|
|
556
622
|
}>;
|
|
557
623
|
responses: {
|
|
558
|
-
200: import("zod").
|
|
624
|
+
200: import("zod").ZodNull;
|
|
559
625
|
400: import("zod").ZodObject<{
|
|
560
626
|
code: import("zod").ZodType<"BAD_REQUEST", import("zod").ZodTypeDef, "BAD_REQUEST">;
|
|
561
627
|
error: import("zod").ZodType<string, import("zod").ZodTypeDef, string>;
|
|
@@ -621,7 +687,7 @@ declare const _default: {
|
|
|
621
687
|
authorization: string;
|
|
622
688
|
}>;
|
|
623
689
|
responses: {
|
|
624
|
-
200: import("zod").
|
|
690
|
+
200: import("zod").ZodNull;
|
|
625
691
|
400: import("zod").ZodObject<{
|
|
626
692
|
name: import("zod").ZodLiteral<"ZodError">;
|
|
627
693
|
issues: import("zod").ZodArray<import("zod").ZodObject<{
|
|
@@ -784,11 +850,15 @@ declare const _default: {
|
|
|
784
850
|
method: "GET";
|
|
785
851
|
path: "/api/v2/stats";
|
|
786
852
|
responses: {
|
|
787
|
-
200: import("zod").
|
|
853
|
+
200: import("zod").ZodObject<{
|
|
854
|
+
record_count: import("zod").ZodNumber;
|
|
855
|
+
total_size: import("zod").ZodNumber;
|
|
856
|
+
max_size: import("zod").ZodNumber;
|
|
857
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
788
858
|
record_count: number;
|
|
789
859
|
total_size: number;
|
|
790
860
|
max_size: number;
|
|
791
|
-
},
|
|
861
|
+
}, {
|
|
792
862
|
record_count: number;
|
|
793
863
|
total_size: number;
|
|
794
864
|
max_size: number;
|
|
@@ -842,7 +912,7 @@ declare const _default: {
|
|
|
842
912
|
authorization?: string | undefined;
|
|
843
913
|
}>;
|
|
844
914
|
responses: {
|
|
845
|
-
|
|
915
|
+
204: import("zod").ZodUndefined;
|
|
846
916
|
400: import("zod").ZodUnion<[import("zod").ZodObject<{
|
|
847
917
|
name: import("zod").ZodLiteral<"ZodError">;
|
|
848
918
|
issues: import("zod").ZodArray<import("zod").ZodObject<{
|
|
@@ -1019,7 +1089,6 @@ declare const _default: {
|
|
|
1019
1089
|
active: import("zod").ZodBoolean;
|
|
1020
1090
|
} & {
|
|
1021
1091
|
size: import("zod").ZodNumber;
|
|
1022
|
-
mimeType: import("zod").ZodString;
|
|
1023
1092
|
parts: import("zod").ZodNumber;
|
|
1024
1093
|
}, "strip", import("zod").ZodTypeAny, {
|
|
1025
1094
|
filename: string;
|
|
@@ -1027,7 +1096,6 @@ declare const _default: {
|
|
|
1027
1096
|
visible: boolean;
|
|
1028
1097
|
role: number;
|
|
1029
1098
|
size: number;
|
|
1030
|
-
mimeType: string;
|
|
1031
1099
|
parts: number;
|
|
1032
1100
|
}, {
|
|
1033
1101
|
filename: string;
|
|
@@ -1035,15 +1103,16 @@ declare const _default: {
|
|
|
1035
1103
|
visible: boolean;
|
|
1036
1104
|
role: number;
|
|
1037
1105
|
size: number;
|
|
1038
|
-
mimeType: string;
|
|
1039
1106
|
parts: number;
|
|
1040
1107
|
}>;
|
|
1041
1108
|
method: "POST";
|
|
1042
1109
|
path: "/api/v2/upload/init";
|
|
1043
1110
|
responses: {
|
|
1044
|
-
200: import("zod").
|
|
1111
|
+
200: import("zod").ZodObject<{
|
|
1112
|
+
uploadId: import("zod").ZodString;
|
|
1113
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
1045
1114
|
uploadId: string;
|
|
1046
|
-
},
|
|
1115
|
+
}, {
|
|
1047
1116
|
uploadId: string;
|
|
1048
1117
|
}>;
|
|
1049
1118
|
400: import("zod").ZodUnion<[import("zod").ZodObject<{
|
|
@@ -1226,7 +1295,7 @@ declare const _default: {
|
|
|
1226
1295
|
contentType: "multipart/form-data";
|
|
1227
1296
|
path: "/api/v2/upload/part/:upload_id/:part";
|
|
1228
1297
|
responses: {
|
|
1229
|
-
|
|
1298
|
+
204: import("zod").ZodUndefined;
|
|
1230
1299
|
400: import("zod").ZodUnion<[import("zod").ZodObject<{
|
|
1231
1300
|
name: import("zod").ZodLiteral<"ZodError">;
|
|
1232
1301
|
issues: import("zod").ZodArray<import("zod").ZodObject<{
|
|
@@ -1426,7 +1495,7 @@ declare const _default: {
|
|
|
1426
1495
|
method: "POST";
|
|
1427
1496
|
path: "/api/v2/upload/end/:upload_id";
|
|
1428
1497
|
responses: {
|
|
1429
|
-
|
|
1498
|
+
204: import("zod").ZodUndefined;
|
|
1430
1499
|
400: import("zod").ZodObject<{
|
|
1431
1500
|
name: import("zod").ZodLiteral<"ZodError">;
|
|
1432
1501
|
issues: import("zod").ZodArray<import("zod").ZodObject<{
|
|
@@ -1601,9 +1670,11 @@ declare const _default: {
|
|
|
1601
1670
|
method: "GET";
|
|
1602
1671
|
path: "/api/v2/public-key";
|
|
1603
1672
|
responses: {
|
|
1604
|
-
200: import("zod").
|
|
1673
|
+
200: import("zod").ZodObject<{
|
|
1674
|
+
publicKey: import("zod").ZodString;
|
|
1675
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
1605
1676
|
publicKey: string;
|
|
1606
|
-
},
|
|
1677
|
+
}, {
|
|
1607
1678
|
publicKey: string;
|
|
1608
1679
|
}>;
|
|
1609
1680
|
};
|
|
@@ -1620,9 +1691,11 @@ declare const _default: {
|
|
|
1620
1691
|
authorization?: string | undefined;
|
|
1621
1692
|
}>;
|
|
1622
1693
|
responses: {
|
|
1623
|
-
200: import("zod").
|
|
1694
|
+
200: import("zod").ZodObject<{
|
|
1695
|
+
access: import("zod").ZodBoolean;
|
|
1696
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
1624
1697
|
access: boolean;
|
|
1625
|
-
},
|
|
1698
|
+
}, {
|
|
1626
1699
|
access: boolean;
|
|
1627
1700
|
}>;
|
|
1628
1701
|
500: import("zod").ZodObject<{
|
|
@@ -1663,7 +1736,7 @@ declare const _default: {
|
|
|
1663
1736
|
authorization?: string | undefined;
|
|
1664
1737
|
}>;
|
|
1665
1738
|
responses: {
|
|
1666
|
-
200: import("zod").
|
|
1739
|
+
200: import("zod").ZodNull;
|
|
1667
1740
|
400: import("zod").ZodObject<{
|
|
1668
1741
|
name: import("zod").ZodLiteral<"ZodError">;
|
|
1669
1742
|
issues: import("zod").ZodArray<import("zod").ZodObject<{
|
|
@@ -1864,7 +1937,7 @@ declare const _default: {
|
|
|
1864
1937
|
authorization?: string | undefined;
|
|
1865
1938
|
}>;
|
|
1866
1939
|
responses: {
|
|
1867
|
-
200: import("zod").
|
|
1940
|
+
200: import("zod").ZodNull;
|
|
1868
1941
|
400: import("zod").ZodObject<{
|
|
1869
1942
|
name: import("zod").ZodLiteral<"ZodError">;
|
|
1870
1943
|
issues: import("zod").ZodArray<import("zod").ZodObject<{
|
package/dist/contract/key.d.ts
CHANGED
|
@@ -4,9 +4,11 @@ declare const _default: {
|
|
|
4
4
|
method: "GET";
|
|
5
5
|
path: "/public-key";
|
|
6
6
|
responses: {
|
|
7
|
-
200: z.
|
|
7
|
+
200: z.ZodObject<{
|
|
8
|
+
publicKey: z.ZodString;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
10
|
publicKey: string;
|
|
9
|
-
},
|
|
11
|
+
}, {
|
|
10
12
|
publicKey: string;
|
|
11
13
|
}>;
|
|
12
14
|
};
|
package/dist/contract/list.d.ts
CHANGED
|
@@ -11,7 +11,19 @@ declare const _default: {
|
|
|
11
11
|
authorization?: string | undefined;
|
|
12
12
|
}>;
|
|
13
13
|
responses: {
|
|
14
|
-
200: z.
|
|
14
|
+
200: z.ZodArray<z.ZodObject<{
|
|
15
|
+
storage_id: z.ZodString;
|
|
16
|
+
filename: z.ZodString;
|
|
17
|
+
size: z.ZodNumber;
|
|
18
|
+
mime_type: z.ZodString;
|
|
19
|
+
endpoints: z.ZodArray<z.ZodObject<{
|
|
20
|
+
endpoint: z.ZodString;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
endpoint: string;
|
|
23
|
+
}, {
|
|
24
|
+
endpoint: string;
|
|
25
|
+
}>, "many">;
|
|
26
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
27
|
filename: string;
|
|
16
28
|
size: number;
|
|
17
29
|
storage_id: string;
|
|
@@ -19,7 +31,7 @@ declare const _default: {
|
|
|
19
31
|
endpoints: {
|
|
20
32
|
endpoint: string;
|
|
21
33
|
}[];
|
|
22
|
-
}
|
|
34
|
+
}, {
|
|
23
35
|
filename: string;
|
|
24
36
|
size: number;
|
|
25
37
|
storage_id: string;
|
|
@@ -27,7 +39,7 @@ declare const _default: {
|
|
|
27
39
|
endpoints: {
|
|
28
40
|
endpoint: string;
|
|
29
41
|
}[];
|
|
30
|
-
}
|
|
42
|
+
}>, "many">;
|
|
31
43
|
500: z.ZodObject<{
|
|
32
44
|
code: z.ZodType<"INTERNAL_SERVER_ERROR", z.ZodTypeDef, "INTERNAL_SERVER_ERROR">;
|
|
33
45
|
error: z.ZodType<string, z.ZodTypeDef, string>;
|
|
@@ -54,7 +66,34 @@ declare const _default: {
|
|
|
54
66
|
authorization?: string | undefined;
|
|
55
67
|
}>;
|
|
56
68
|
responses: {
|
|
57
|
-
200: z.
|
|
69
|
+
200: z.ZodArray<z.ZodObject<{
|
|
70
|
+
storage_id: z.ZodString;
|
|
71
|
+
filename: z.ZodString;
|
|
72
|
+
size: z.ZodNumber;
|
|
73
|
+
mime_type: z.ZodString;
|
|
74
|
+
} & {
|
|
75
|
+
endpoints: z.ZodArray<z.ZodObject<{
|
|
76
|
+
endpoint: z.ZodString;
|
|
77
|
+
} & {
|
|
78
|
+
created_at: z.ZodDate;
|
|
79
|
+
updated_at: z.ZodDate;
|
|
80
|
+
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
created_at: Date;
|
|
82
|
+
updated_at: Date;
|
|
83
|
+
endpoint: string;
|
|
84
|
+
}, {
|
|
85
|
+
created_at: Date;
|
|
86
|
+
updated_at: Date;
|
|
87
|
+
endpoint: string;
|
|
88
|
+
}>, "many">;
|
|
89
|
+
role: z.ZodNumber;
|
|
90
|
+
user_id: z.ZodNullable<z.ZodString>;
|
|
91
|
+
type: z.ZodEnum<["service", "system", "user"]>;
|
|
92
|
+
visible: z.ZodBoolean;
|
|
93
|
+
active: z.ZodBoolean;
|
|
94
|
+
created_at: z.ZodDate;
|
|
95
|
+
updated_at: z.ZodDate;
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
58
97
|
type: "user" | "system" | "service";
|
|
59
98
|
filename: string;
|
|
60
99
|
active: boolean;
|
|
@@ -71,7 +110,7 @@ declare const _default: {
|
|
|
71
110
|
endpoint: string;
|
|
72
111
|
}[];
|
|
73
112
|
user_id: string | null;
|
|
74
|
-
}
|
|
113
|
+
}, {
|
|
75
114
|
type: "user" | "system" | "service";
|
|
76
115
|
filename: string;
|
|
77
116
|
active: boolean;
|
|
@@ -88,7 +127,7 @@ declare const _default: {
|
|
|
88
127
|
endpoint: string;
|
|
89
128
|
}[];
|
|
90
129
|
user_id: string | null;
|
|
91
|
-
}
|
|
130
|
+
}>, "many">;
|
|
92
131
|
401: z.ZodObject<{
|
|
93
132
|
code: z.ZodType<"UNAUTHORIZED", z.ZodTypeDef, "UNAUTHORIZED">;
|
|
94
133
|
error: z.ZodType<"Unauthorized", z.ZodTypeDef, "Unauthorized">;
|
|
@@ -11,7 +11,34 @@ declare const _default: {
|
|
|
11
11
|
authorization?: string | undefined;
|
|
12
12
|
}>;
|
|
13
13
|
responses: {
|
|
14
|
-
200: z.
|
|
14
|
+
200: z.ZodObject<{
|
|
15
|
+
storage_id: z.ZodString;
|
|
16
|
+
filename: z.ZodString;
|
|
17
|
+
size: z.ZodNumber;
|
|
18
|
+
mime_type: z.ZodString;
|
|
19
|
+
} & {
|
|
20
|
+
endpoints: z.ZodArray<z.ZodObject<{
|
|
21
|
+
endpoint: z.ZodString;
|
|
22
|
+
} & {
|
|
23
|
+
created_at: z.ZodDate;
|
|
24
|
+
updated_at: z.ZodDate;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
created_at: Date;
|
|
27
|
+
updated_at: Date;
|
|
28
|
+
endpoint: string;
|
|
29
|
+
}, {
|
|
30
|
+
created_at: Date;
|
|
31
|
+
updated_at: Date;
|
|
32
|
+
endpoint: string;
|
|
33
|
+
}>, "many">;
|
|
34
|
+
role: z.ZodNumber;
|
|
35
|
+
user_id: z.ZodNullable<z.ZodString>;
|
|
36
|
+
type: z.ZodEnum<["service", "system", "user"]>;
|
|
37
|
+
visible: z.ZodBoolean;
|
|
38
|
+
active: z.ZodBoolean;
|
|
39
|
+
created_at: z.ZodDate;
|
|
40
|
+
updated_at: z.ZodDate;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
42
|
type: "user" | "system" | "service";
|
|
16
43
|
filename: string;
|
|
17
44
|
active: boolean;
|
|
@@ -28,7 +55,7 @@ declare const _default: {
|
|
|
28
55
|
endpoint: string;
|
|
29
56
|
}[];
|
|
30
57
|
user_id: string | null;
|
|
31
|
-
},
|
|
58
|
+
}, {
|
|
32
59
|
type: "user" | "system" | "service";
|
|
33
60
|
filename: string;
|
|
34
61
|
active: boolean;
|
|
@@ -172,7 +199,7 @@ declare const _default: {
|
|
|
172
199
|
authorization?: string | undefined;
|
|
173
200
|
}>;
|
|
174
201
|
responses: {
|
|
175
|
-
200: z.
|
|
202
|
+
200: z.ZodNull;
|
|
176
203
|
400: z.ZodObject<{
|
|
177
204
|
name: z.ZodLiteral<"ZodError">;
|
|
178
205
|
issues: z.ZodArray<z.ZodObject<{
|
|
@@ -353,7 +380,7 @@ declare const _default: {
|
|
|
353
380
|
authorization?: string | undefined;
|
|
354
381
|
}>;
|
|
355
382
|
responses: {
|
|
356
|
-
200: z.
|
|
383
|
+
200: z.ZodNull;
|
|
357
384
|
401: z.ZodObject<{
|
|
358
385
|
code: z.ZodType<"UNAUTHORIZED", z.ZodTypeDef, "UNAUTHORIZED">;
|
|
359
386
|
error: z.ZodType<"Unauthorized", z.ZodTypeDef, "Unauthorized">;
|
|
@@ -13,7 +13,7 @@ declare const _default: {
|
|
|
13
13
|
authorization: string;
|
|
14
14
|
}>;
|
|
15
15
|
responses: {
|
|
16
|
-
200: z.
|
|
16
|
+
200: z.ZodNull;
|
|
17
17
|
400: z.ZodObject<{
|
|
18
18
|
code: z.ZodType<"BAD_REQUEST", z.ZodTypeDef, "BAD_REQUEST">;
|
|
19
19
|
error: z.ZodType<string, z.ZodTypeDef, string>;
|
|
@@ -79,7 +79,7 @@ declare const _default: {
|
|
|
79
79
|
authorization: string;
|
|
80
80
|
}>;
|
|
81
81
|
responses: {
|
|
82
|
-
200: z.
|
|
82
|
+
200: z.ZodNull;
|
|
83
83
|
400: z.ZodObject<{
|
|
84
84
|
name: z.ZodLiteral<"ZodError">;
|
|
85
85
|
issues: z.ZodArray<z.ZodObject<{
|
package/dist/contract/stats.d.ts
CHANGED
|
@@ -4,11 +4,15 @@ declare const _default: {
|
|
|
4
4
|
method: "GET";
|
|
5
5
|
path: "/stats";
|
|
6
6
|
responses: {
|
|
7
|
-
200: z.
|
|
7
|
+
200: z.ZodObject<{
|
|
8
|
+
record_count: z.ZodNumber;
|
|
9
|
+
total_size: z.ZodNumber;
|
|
10
|
+
max_size: z.ZodNumber;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
12
|
record_count: number;
|
|
9
13
|
total_size: number;
|
|
10
14
|
max_size: number;
|
|
11
|
-
},
|
|
15
|
+
}, {
|
|
12
16
|
record_count: number;
|
|
13
17
|
total_size: number;
|
|
14
18
|
max_size: number;
|
|
@@ -32,7 +32,7 @@ declare const _default: {
|
|
|
32
32
|
authorization?: string | undefined;
|
|
33
33
|
}>;
|
|
34
34
|
responses: {
|
|
35
|
-
|
|
35
|
+
204: z.ZodUndefined;
|
|
36
36
|
400: z.ZodUnion<[z.ZodObject<{
|
|
37
37
|
name: z.ZodLiteral<"ZodError">;
|
|
38
38
|
issues: z.ZodArray<z.ZodObject<{
|
|
@@ -209,7 +209,6 @@ declare const _default: {
|
|
|
209
209
|
active: z.ZodBoolean;
|
|
210
210
|
} & {
|
|
211
211
|
size: z.ZodNumber;
|
|
212
|
-
mimeType: z.ZodString;
|
|
213
212
|
parts: z.ZodNumber;
|
|
214
213
|
}, "strip", z.ZodTypeAny, {
|
|
215
214
|
filename: string;
|
|
@@ -217,7 +216,6 @@ declare const _default: {
|
|
|
217
216
|
visible: boolean;
|
|
218
217
|
role: number;
|
|
219
218
|
size: number;
|
|
220
|
-
mimeType: string;
|
|
221
219
|
parts: number;
|
|
222
220
|
}, {
|
|
223
221
|
filename: string;
|
|
@@ -225,15 +223,16 @@ declare const _default: {
|
|
|
225
223
|
visible: boolean;
|
|
226
224
|
role: number;
|
|
227
225
|
size: number;
|
|
228
|
-
mimeType: string;
|
|
229
226
|
parts: number;
|
|
230
227
|
}>;
|
|
231
228
|
method: "POST";
|
|
232
229
|
path: "/upload/init";
|
|
233
230
|
responses: {
|
|
234
|
-
200: z.
|
|
231
|
+
200: z.ZodObject<{
|
|
232
|
+
uploadId: z.ZodString;
|
|
233
|
+
}, "strip", z.ZodTypeAny, {
|
|
235
234
|
uploadId: string;
|
|
236
|
-
},
|
|
235
|
+
}, {
|
|
237
236
|
uploadId: string;
|
|
238
237
|
}>;
|
|
239
238
|
400: z.ZodUnion<[z.ZodObject<{
|
|
@@ -416,7 +415,7 @@ declare const _default: {
|
|
|
416
415
|
contentType: "multipart/form-data";
|
|
417
416
|
path: "/upload/part/:upload_id/:part";
|
|
418
417
|
responses: {
|
|
419
|
-
|
|
418
|
+
204: z.ZodUndefined;
|
|
420
419
|
400: z.ZodUnion<[z.ZodObject<{
|
|
421
420
|
name: z.ZodLiteral<"ZodError">;
|
|
422
421
|
issues: z.ZodArray<z.ZodObject<{
|
|
@@ -616,7 +615,7 @@ declare const _default: {
|
|
|
616
615
|
method: "POST";
|
|
617
616
|
path: "/upload/end/:upload_id";
|
|
618
617
|
responses: {
|
|
619
|
-
|
|
618
|
+
204: z.ZodUndefined;
|
|
620
619
|
400: z.ZodObject<{
|
|
621
620
|
name: z.ZodLiteral<"ZodError">;
|
|
622
621
|
issues: z.ZodArray<z.ZodObject<{
|
package/dist/contract/upload.js
CHANGED
|
@@ -15,7 +15,7 @@ export default c.router({
|
|
|
15
15
|
data: jsonStringAs(uploadDataSchema),
|
|
16
16
|
}),
|
|
17
17
|
responses: {
|
|
18
|
-
|
|
18
|
+
204: apiSuccess(z.undefined()),
|
|
19
19
|
400: z.union([
|
|
20
20
|
ZodErrorSchema,
|
|
21
21
|
apiError(z.literal("BAD_REQUEST"), z.string()),
|
|
@@ -50,7 +50,7 @@ export default c.router({
|
|
|
50
50
|
file: z.any(),
|
|
51
51
|
}),
|
|
52
52
|
responses: {
|
|
53
|
-
|
|
53
|
+
204: apiSuccess(z.undefined()),
|
|
54
54
|
400: z.union([
|
|
55
55
|
ZodErrorSchema,
|
|
56
56
|
apiError(z.literal("BAD_REQUEST"), z.string()),
|
|
@@ -67,7 +67,7 @@ export default c.router({
|
|
|
67
67
|
path: "/upload/end/:upload_id",
|
|
68
68
|
body: z.undefined(),
|
|
69
69
|
responses: {
|
|
70
|
-
|
|
70
|
+
204: apiSuccess(z.undefined()),
|
|
71
71
|
400: ZodErrorSchema,
|
|
72
72
|
401: apiError(z.literal("UNAUTHORIZED"), z.literal("Unauthorized")),
|
|
73
73
|
403: apiError(z.literal("FORBIDDEN"), z.literal("Forbidden")),
|
package/dist/types/upload.d.ts
CHANGED
|
@@ -23,7 +23,6 @@ export declare const uploadInitSchema: z.ZodObject<{
|
|
|
23
23
|
active: z.ZodBoolean;
|
|
24
24
|
} & {
|
|
25
25
|
size: z.ZodNumber;
|
|
26
|
-
mimeType: z.ZodString;
|
|
27
26
|
parts: z.ZodNumber;
|
|
28
27
|
}, "strip", z.ZodTypeAny, {
|
|
29
28
|
filename: string;
|
|
@@ -31,7 +30,6 @@ export declare const uploadInitSchema: z.ZodObject<{
|
|
|
31
30
|
visible: boolean;
|
|
32
31
|
role: number;
|
|
33
32
|
size: number;
|
|
34
|
-
mimeType: string;
|
|
35
33
|
parts: number;
|
|
36
34
|
}, {
|
|
37
35
|
filename: string;
|
|
@@ -39,7 +37,6 @@ export declare const uploadInitSchema: z.ZodObject<{
|
|
|
39
37
|
visible: boolean;
|
|
40
38
|
role: number;
|
|
41
39
|
size: number;
|
|
42
|
-
mimeType: string;
|
|
43
40
|
parts: number;
|
|
44
41
|
}>;
|
|
45
42
|
export type UploadInit = z.infer<typeof uploadInitSchema>;
|
package/dist/types/upload.js
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z, type ZodType } from "zod";
|
|
2
|
-
|
|
2
|
+
import type { ContractNoBodyType } from "@ts-rest/core";
|
|
3
|
+
export declare const apiSuccess: <T extends ZodType | ContractNoBodyType>(schema: T) => T;
|
|
3
4
|
export declare const apiError: <T, U>(code: ZodType<T>, error: ZodType<U>) => z.ZodObject<{
|
|
4
5
|
code: z.ZodType<T, z.ZodTypeDef, T>;
|
|
5
6
|
error: z.ZodType<U, z.ZodTypeDef, U>;
|
package/dist/uploader.d.ts
CHANGED
|
@@ -499,8 +499,8 @@ export default class Uploader {
|
|
|
499
499
|
authorization?: string | undefined;
|
|
500
500
|
} | undefined;
|
|
501
501
|
}) => Promise<{
|
|
502
|
-
status:
|
|
503
|
-
body:
|
|
502
|
+
status: 204;
|
|
503
|
+
body: undefined;
|
|
504
504
|
headers: Headers;
|
|
505
505
|
} | {
|
|
506
506
|
status: 400;
|
|
@@ -559,7 +559,7 @@ export default class Uploader {
|
|
|
559
559
|
};
|
|
560
560
|
headers: Headers;
|
|
561
561
|
} | {
|
|
562
|
-
status: 201 | 202 | 203 |
|
|
562
|
+
status: 200 | 201 | 202 | 203 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 402 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
563
563
|
body: unknown;
|
|
564
564
|
headers: Headers;
|
|
565
565
|
}>;
|
|
@@ -570,7 +570,6 @@ export default class Uploader {
|
|
|
570
570
|
visible: boolean;
|
|
571
571
|
role: number;
|
|
572
572
|
size: number;
|
|
573
|
-
mimeType: string;
|
|
574
573
|
parts: number;
|
|
575
574
|
};
|
|
576
575
|
cache?: RequestCache | undefined;
|
|
@@ -657,8 +656,8 @@ export default class Uploader {
|
|
|
657
656
|
extraHeaders?: Record<string, string | undefined> | undefined;
|
|
658
657
|
overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
|
|
659
658
|
}) => Promise<{
|
|
660
|
-
status:
|
|
661
|
-
body:
|
|
659
|
+
status: 204;
|
|
660
|
+
body: undefined;
|
|
662
661
|
headers: Headers;
|
|
663
662
|
} | {
|
|
664
663
|
status: 400;
|
|
@@ -733,7 +732,7 @@ export default class Uploader {
|
|
|
733
732
|
};
|
|
734
733
|
headers: Headers;
|
|
735
734
|
} | {
|
|
736
|
-
status: 201 | 202 | 203 |
|
|
735
|
+
status: 200 | 201 | 202 | 203 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
737
736
|
body: unknown;
|
|
738
737
|
headers: Headers;
|
|
739
738
|
}>;
|
|
@@ -746,8 +745,8 @@ export default class Uploader {
|
|
|
746
745
|
extraHeaders?: Record<string, string | undefined> | undefined;
|
|
747
746
|
overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
|
|
748
747
|
}) => Promise<{
|
|
749
|
-
status:
|
|
750
|
-
body:
|
|
748
|
+
status: 204;
|
|
749
|
+
body: undefined;
|
|
751
750
|
headers: Headers;
|
|
752
751
|
} | {
|
|
753
752
|
status: 400;
|
|
@@ -810,7 +809,7 @@ export default class Uploader {
|
|
|
810
809
|
};
|
|
811
810
|
headers: Headers;
|
|
812
811
|
} | {
|
|
813
|
-
status: 201 | 202 | 203 |
|
|
812
|
+
status: 200 | 201 | 202 | 203 | 205 | 206 | 207 | 100 | 101 | 102 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
814
813
|
body: unknown;
|
|
815
814
|
headers: Headers;
|
|
816
815
|
}>;
|
package/dist/uploader.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@darco2903/cdn-api",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"zod": "^3.25.76"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@darco2903/secondthought": "^1.1
|
|
32
|
+
"@darco2903/secondthought": "^1.3.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/jsonwebtoken": "^9.0.10",
|
|
36
|
-
"@types/node": "^
|
|
36
|
+
"@types/node": "^24.12.2",
|
|
37
37
|
"prettier": "^3.8.1",
|
|
38
38
|
"rimraf": "^6.1.3",
|
|
39
39
|
"tsx": "^4.21.0",
|