@darco2903/altv-web-api 1.3.0 → 1.4.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/dist/client.d.ts +135 -10
- package/dist/consts.d.ts +1 -1
- package/dist/consts.js +1 -1
- package/dist/contract/index.d.ts +346 -0
- package/dist/contract/youtube.d.ts +346 -0
- package/dist/contract/youtube.js +32 -1
- package/dist/types/youtube.d.ts +25 -0
- package/dist/types/youtube.js +10 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -62,7 +62,132 @@ export declare function createClient(origin: string): {
|
|
|
62
62
|
};
|
|
63
63
|
headers: Headers;
|
|
64
64
|
} | {
|
|
65
|
-
status: 404 | 100 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 |
|
|
65
|
+
status: 404 | 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
66
|
+
body: unknown;
|
|
67
|
+
headers: Headers;
|
|
68
|
+
}>;
|
|
69
|
+
search: (args: {
|
|
70
|
+
query: {
|
|
71
|
+
q: string;
|
|
72
|
+
};
|
|
73
|
+
cache?: RequestCache | undefined;
|
|
74
|
+
extraHeaders?: Record<string, string | undefined> | undefined;
|
|
75
|
+
fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
|
|
76
|
+
overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
|
|
77
|
+
}) => Promise<{
|
|
78
|
+
status: 200;
|
|
79
|
+
body: {
|
|
80
|
+
results: {
|
|
81
|
+
videoId: string;
|
|
82
|
+
title: string;
|
|
83
|
+
duration: number | null;
|
|
84
|
+
channel: string | null;
|
|
85
|
+
thumbnail: string | null;
|
|
86
|
+
blocked: "live" | "too_long" | null;
|
|
87
|
+
}[];
|
|
88
|
+
};
|
|
89
|
+
headers: Headers;
|
|
90
|
+
} | {
|
|
91
|
+
status: 400;
|
|
92
|
+
body: {
|
|
93
|
+
name: "ZodError";
|
|
94
|
+
issues: import("zod").objectOutputType<{
|
|
95
|
+
path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
|
|
96
|
+
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
97
|
+
code: import("zod").ZodNativeEnum<{
|
|
98
|
+
invalid_type: "invalid_type";
|
|
99
|
+
invalid_literal: "invalid_literal";
|
|
100
|
+
custom: "custom";
|
|
101
|
+
invalid_union: "invalid_union";
|
|
102
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
103
|
+
invalid_enum_value: "invalid_enum_value";
|
|
104
|
+
unrecognized_keys: "unrecognized_keys";
|
|
105
|
+
invalid_arguments: "invalid_arguments";
|
|
106
|
+
invalid_return_type: "invalid_return_type";
|
|
107
|
+
invalid_date: "invalid_date";
|
|
108
|
+
invalid_string: "invalid_string";
|
|
109
|
+
too_small: "too_small";
|
|
110
|
+
too_big: "too_big";
|
|
111
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
112
|
+
not_multiple_of: "not_multiple_of";
|
|
113
|
+
not_finite: "not_finite";
|
|
114
|
+
}>;
|
|
115
|
+
}, import("zod").ZodAny, "strip">[];
|
|
116
|
+
};
|
|
117
|
+
headers: Headers;
|
|
118
|
+
} | {
|
|
119
|
+
status: 500;
|
|
120
|
+
body: {
|
|
121
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
122
|
+
error: string;
|
|
123
|
+
name: "APIError";
|
|
124
|
+
};
|
|
125
|
+
headers: Headers;
|
|
126
|
+
} | {
|
|
127
|
+
status: 429;
|
|
128
|
+
body: {
|
|
129
|
+
code: "TOO_MANY_SEARCHES";
|
|
130
|
+
error: "Too many searches are running";
|
|
131
|
+
name: "APIError";
|
|
132
|
+
};
|
|
133
|
+
headers: Headers;
|
|
134
|
+
} | {
|
|
135
|
+
status: 404 | 100 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
136
|
+
body: unknown;
|
|
137
|
+
headers: Headers;
|
|
138
|
+
}>;
|
|
139
|
+
suggest: (args: {
|
|
140
|
+
query: {
|
|
141
|
+
q: string;
|
|
142
|
+
};
|
|
143
|
+
cache?: RequestCache | undefined;
|
|
144
|
+
extraHeaders?: Record<string, string | undefined> | undefined;
|
|
145
|
+
fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
|
|
146
|
+
overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
|
|
147
|
+
}) => Promise<{
|
|
148
|
+
status: 200;
|
|
149
|
+
body: {
|
|
150
|
+
suggestions: string[];
|
|
151
|
+
};
|
|
152
|
+
headers: Headers;
|
|
153
|
+
} | {
|
|
154
|
+
status: 400;
|
|
155
|
+
body: {
|
|
156
|
+
name: "ZodError";
|
|
157
|
+
issues: import("zod").objectOutputType<{
|
|
158
|
+
path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
|
|
159
|
+
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
160
|
+
code: import("zod").ZodNativeEnum<{
|
|
161
|
+
invalid_type: "invalid_type";
|
|
162
|
+
invalid_literal: "invalid_literal";
|
|
163
|
+
custom: "custom";
|
|
164
|
+
invalid_union: "invalid_union";
|
|
165
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
166
|
+
invalid_enum_value: "invalid_enum_value";
|
|
167
|
+
unrecognized_keys: "unrecognized_keys";
|
|
168
|
+
invalid_arguments: "invalid_arguments";
|
|
169
|
+
invalid_return_type: "invalid_return_type";
|
|
170
|
+
invalid_date: "invalid_date";
|
|
171
|
+
invalid_string: "invalid_string";
|
|
172
|
+
too_small: "too_small";
|
|
173
|
+
too_big: "too_big";
|
|
174
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
175
|
+
not_multiple_of: "not_multiple_of";
|
|
176
|
+
not_finite: "not_finite";
|
|
177
|
+
}>;
|
|
178
|
+
}, import("zod").ZodAny, "strip">[];
|
|
179
|
+
};
|
|
180
|
+
headers: Headers;
|
|
181
|
+
} | {
|
|
182
|
+
status: 500;
|
|
183
|
+
body: {
|
|
184
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
185
|
+
error: string;
|
|
186
|
+
name: "APIError";
|
|
187
|
+
};
|
|
188
|
+
headers: Headers;
|
|
189
|
+
} | {
|
|
190
|
+
status: 404 | 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
66
191
|
body: unknown;
|
|
67
192
|
headers: Headers;
|
|
68
193
|
}>;
|
|
@@ -111,7 +236,7 @@ export declare function createClient(origin: string): {
|
|
|
111
236
|
};
|
|
112
237
|
headers: Headers;
|
|
113
238
|
} | {
|
|
114
|
-
status: 500 | 404 | 100 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 |
|
|
239
|
+
status: 500 | 404 | 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
115
240
|
body: unknown;
|
|
116
241
|
headers: Headers;
|
|
117
242
|
}>;
|
|
@@ -127,7 +252,7 @@ export declare function createClient(origin: string): {
|
|
|
127
252
|
};
|
|
128
253
|
headers: Headers;
|
|
129
254
|
} | {
|
|
130
|
-
status: 400 | 500 | 404 | 100 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 |
|
|
255
|
+
status: 400 | 500 | 404 | 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
131
256
|
body: unknown;
|
|
132
257
|
headers: Headers;
|
|
133
258
|
}>;
|
|
@@ -187,7 +312,7 @@ export declare function createClient(origin: string): {
|
|
|
187
312
|
};
|
|
188
313
|
headers: Headers;
|
|
189
314
|
} | {
|
|
190
|
-
status: 404 | 100 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 |
|
|
315
|
+
status: 404 | 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
191
316
|
body: unknown;
|
|
192
317
|
headers: Headers;
|
|
193
318
|
}>;
|
|
@@ -272,7 +397,7 @@ export declare function createClient(origin: string): {
|
|
|
272
397
|
};
|
|
273
398
|
headers: Headers;
|
|
274
399
|
} | {
|
|
275
|
-
status: 404 | 100 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 |
|
|
400
|
+
status: 404 | 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
276
401
|
body: unknown;
|
|
277
402
|
headers: Headers;
|
|
278
403
|
}>;
|
|
@@ -337,7 +462,7 @@ export declare function createClient(origin: string): {
|
|
|
337
462
|
};
|
|
338
463
|
headers: Headers;
|
|
339
464
|
} | {
|
|
340
|
-
status: 100 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 |
|
|
465
|
+
status: 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
341
466
|
body: unknown;
|
|
342
467
|
headers: Headers;
|
|
343
468
|
}>;
|
|
@@ -402,7 +527,7 @@ export declare function createClient(origin: string): {
|
|
|
402
527
|
};
|
|
403
528
|
headers: Headers;
|
|
404
529
|
} | {
|
|
405
|
-
status: 100 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 |
|
|
530
|
+
status: 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
406
531
|
body: unknown;
|
|
407
532
|
headers: Headers;
|
|
408
533
|
}>;
|
|
@@ -470,7 +595,7 @@ export declare function createClient(origin: string): {
|
|
|
470
595
|
};
|
|
471
596
|
headers: Headers;
|
|
472
597
|
} | {
|
|
473
|
-
status: 100 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 |
|
|
598
|
+
status: 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
474
599
|
body: unknown;
|
|
475
600
|
headers: Headers;
|
|
476
601
|
}>;
|
|
@@ -576,7 +701,7 @@ export declare function createClient(origin: string): {
|
|
|
576
701
|
};
|
|
577
702
|
headers: Headers;
|
|
578
703
|
} | {
|
|
579
|
-
status: 100 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 |
|
|
704
|
+
status: 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
580
705
|
body: unknown;
|
|
581
706
|
headers: Headers;
|
|
582
707
|
}>;
|
|
@@ -617,7 +742,7 @@ export declare function createClient(origin: string): {
|
|
|
617
742
|
};
|
|
618
743
|
headers: Headers;
|
|
619
744
|
} | {
|
|
620
|
-
status: 100 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 |
|
|
745
|
+
status: 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 401 | 402 | 403 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
621
746
|
body: unknown;
|
|
622
747
|
headers: Headers;
|
|
623
748
|
}>;
|
package/dist/consts.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const YOUTUBE_QUERY_MAX_LENGTH = 100;
|
package/dist/consts.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const YOUTUBE_QUERY_MAX_LENGTH = 100;
|
package/dist/contract/index.d.ts
CHANGED
|
@@ -164,6 +164,352 @@ declare const _default: {
|
|
|
164
164
|
}>;
|
|
165
165
|
};
|
|
166
166
|
};
|
|
167
|
+
search: {
|
|
168
|
+
query: import("zod").ZodObject<{
|
|
169
|
+
q: import("zod").ZodString;
|
|
170
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
171
|
+
q: string;
|
|
172
|
+
}, {
|
|
173
|
+
q: string;
|
|
174
|
+
}>;
|
|
175
|
+
description: "Search YouTube videos";
|
|
176
|
+
method: "GET";
|
|
177
|
+
path: "/api/v2/youtube/search";
|
|
178
|
+
responses: {
|
|
179
|
+
200: import("zod").ZodObject<{
|
|
180
|
+
results: import("zod").ZodArray<import("zod").ZodObject<{
|
|
181
|
+
videoId: import("zod").ZodString;
|
|
182
|
+
title: import("zod").ZodString;
|
|
183
|
+
channel: import("zod").ZodNullable<import("zod").ZodString>;
|
|
184
|
+
duration: import("zod").ZodNullable<import("zod").ZodNumber>;
|
|
185
|
+
thumbnail: import("zod").ZodNullable<import("zod").ZodString>;
|
|
186
|
+
blocked: import("zod").ZodNullable<import("zod").ZodEnum<["live", "too_long"]>>;
|
|
187
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
188
|
+
videoId: string;
|
|
189
|
+
title: string;
|
|
190
|
+
duration: number | null;
|
|
191
|
+
channel: string | null;
|
|
192
|
+
thumbnail: string | null;
|
|
193
|
+
blocked: "live" | "too_long" | null;
|
|
194
|
+
}, {
|
|
195
|
+
videoId: string;
|
|
196
|
+
title: string;
|
|
197
|
+
duration: number | null;
|
|
198
|
+
channel: string | null;
|
|
199
|
+
thumbnail: string | null;
|
|
200
|
+
blocked: "live" | "too_long" | null;
|
|
201
|
+
}>, "many">;
|
|
202
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
203
|
+
results: {
|
|
204
|
+
videoId: string;
|
|
205
|
+
title: string;
|
|
206
|
+
duration: number | null;
|
|
207
|
+
channel: string | null;
|
|
208
|
+
thumbnail: string | null;
|
|
209
|
+
blocked: "live" | "too_long" | null;
|
|
210
|
+
}[];
|
|
211
|
+
}, {
|
|
212
|
+
results: {
|
|
213
|
+
videoId: string;
|
|
214
|
+
title: string;
|
|
215
|
+
duration: number | null;
|
|
216
|
+
channel: string | null;
|
|
217
|
+
thumbnail: string | null;
|
|
218
|
+
blocked: "live" | "too_long" | null;
|
|
219
|
+
}[];
|
|
220
|
+
}>;
|
|
221
|
+
400: import("zod").ZodObject<{
|
|
222
|
+
name: import("zod").ZodLiteral<"ZodError">;
|
|
223
|
+
issues: import("zod").ZodArray<import("zod").ZodObject<{
|
|
224
|
+
path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
|
|
225
|
+
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
226
|
+
code: import("zod").ZodNativeEnum<{
|
|
227
|
+
invalid_type: "invalid_type";
|
|
228
|
+
invalid_literal: "invalid_literal";
|
|
229
|
+
custom: "custom";
|
|
230
|
+
invalid_union: "invalid_union";
|
|
231
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
232
|
+
invalid_enum_value: "invalid_enum_value";
|
|
233
|
+
unrecognized_keys: "unrecognized_keys";
|
|
234
|
+
invalid_arguments: "invalid_arguments";
|
|
235
|
+
invalid_return_type: "invalid_return_type";
|
|
236
|
+
invalid_date: "invalid_date";
|
|
237
|
+
invalid_string: "invalid_string";
|
|
238
|
+
too_small: "too_small";
|
|
239
|
+
too_big: "too_big";
|
|
240
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
241
|
+
not_multiple_of: "not_multiple_of";
|
|
242
|
+
not_finite: "not_finite";
|
|
243
|
+
}>;
|
|
244
|
+
}, "strip", import("zod").ZodAny, import("zod").objectOutputType<{
|
|
245
|
+
path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
|
|
246
|
+
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
247
|
+
code: import("zod").ZodNativeEnum<{
|
|
248
|
+
invalid_type: "invalid_type";
|
|
249
|
+
invalid_literal: "invalid_literal";
|
|
250
|
+
custom: "custom";
|
|
251
|
+
invalid_union: "invalid_union";
|
|
252
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
253
|
+
invalid_enum_value: "invalid_enum_value";
|
|
254
|
+
unrecognized_keys: "unrecognized_keys";
|
|
255
|
+
invalid_arguments: "invalid_arguments";
|
|
256
|
+
invalid_return_type: "invalid_return_type";
|
|
257
|
+
invalid_date: "invalid_date";
|
|
258
|
+
invalid_string: "invalid_string";
|
|
259
|
+
too_small: "too_small";
|
|
260
|
+
too_big: "too_big";
|
|
261
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
262
|
+
not_multiple_of: "not_multiple_of";
|
|
263
|
+
not_finite: "not_finite";
|
|
264
|
+
}>;
|
|
265
|
+
}, import("zod").ZodAny, "strip">, import("zod").objectInputType<{
|
|
266
|
+
path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
|
|
267
|
+
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
268
|
+
code: import("zod").ZodNativeEnum<{
|
|
269
|
+
invalid_type: "invalid_type";
|
|
270
|
+
invalid_literal: "invalid_literal";
|
|
271
|
+
custom: "custom";
|
|
272
|
+
invalid_union: "invalid_union";
|
|
273
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
274
|
+
invalid_enum_value: "invalid_enum_value";
|
|
275
|
+
unrecognized_keys: "unrecognized_keys";
|
|
276
|
+
invalid_arguments: "invalid_arguments";
|
|
277
|
+
invalid_return_type: "invalid_return_type";
|
|
278
|
+
invalid_date: "invalid_date";
|
|
279
|
+
invalid_string: "invalid_string";
|
|
280
|
+
too_small: "too_small";
|
|
281
|
+
too_big: "too_big";
|
|
282
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
283
|
+
not_multiple_of: "not_multiple_of";
|
|
284
|
+
not_finite: "not_finite";
|
|
285
|
+
}>;
|
|
286
|
+
}, import("zod").ZodAny, "strip">>, "many">;
|
|
287
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
288
|
+
name: "ZodError";
|
|
289
|
+
issues: import("zod").objectOutputType<{
|
|
290
|
+
path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
|
|
291
|
+
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
292
|
+
code: import("zod").ZodNativeEnum<{
|
|
293
|
+
invalid_type: "invalid_type";
|
|
294
|
+
invalid_literal: "invalid_literal";
|
|
295
|
+
custom: "custom";
|
|
296
|
+
invalid_union: "invalid_union";
|
|
297
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
298
|
+
invalid_enum_value: "invalid_enum_value";
|
|
299
|
+
unrecognized_keys: "unrecognized_keys";
|
|
300
|
+
invalid_arguments: "invalid_arguments";
|
|
301
|
+
invalid_return_type: "invalid_return_type";
|
|
302
|
+
invalid_date: "invalid_date";
|
|
303
|
+
invalid_string: "invalid_string";
|
|
304
|
+
too_small: "too_small";
|
|
305
|
+
too_big: "too_big";
|
|
306
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
307
|
+
not_multiple_of: "not_multiple_of";
|
|
308
|
+
not_finite: "not_finite";
|
|
309
|
+
}>;
|
|
310
|
+
}, import("zod").ZodAny, "strip">[];
|
|
311
|
+
}, {
|
|
312
|
+
name: "ZodError";
|
|
313
|
+
issues: import("zod").objectInputType<{
|
|
314
|
+
path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
|
|
315
|
+
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
316
|
+
code: import("zod").ZodNativeEnum<{
|
|
317
|
+
invalid_type: "invalid_type";
|
|
318
|
+
invalid_literal: "invalid_literal";
|
|
319
|
+
custom: "custom";
|
|
320
|
+
invalid_union: "invalid_union";
|
|
321
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
322
|
+
invalid_enum_value: "invalid_enum_value";
|
|
323
|
+
unrecognized_keys: "unrecognized_keys";
|
|
324
|
+
invalid_arguments: "invalid_arguments";
|
|
325
|
+
invalid_return_type: "invalid_return_type";
|
|
326
|
+
invalid_date: "invalid_date";
|
|
327
|
+
invalid_string: "invalid_string";
|
|
328
|
+
too_small: "too_small";
|
|
329
|
+
too_big: "too_big";
|
|
330
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
331
|
+
not_multiple_of: "not_multiple_of";
|
|
332
|
+
not_finite: "not_finite";
|
|
333
|
+
}>;
|
|
334
|
+
}, import("zod").ZodAny, "strip">[];
|
|
335
|
+
}>;
|
|
336
|
+
429: import("zod").ZodObject<{
|
|
337
|
+
code: import("zod").ZodType<"TOO_MANY_SEARCHES", import("zod").ZodTypeDef, "TOO_MANY_SEARCHES">;
|
|
338
|
+
error: import("zod").ZodType<"Too many searches are running", import("zod").ZodTypeDef, "Too many searches are running">;
|
|
339
|
+
name: import("zod").ZodLiteral<"APIError">;
|
|
340
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
341
|
+
code: "TOO_MANY_SEARCHES";
|
|
342
|
+
error: "Too many searches are running";
|
|
343
|
+
name: "APIError";
|
|
344
|
+
}, {
|
|
345
|
+
code: "TOO_MANY_SEARCHES";
|
|
346
|
+
error: "Too many searches are running";
|
|
347
|
+
name: "APIError";
|
|
348
|
+
}>;
|
|
349
|
+
500: import("zod").ZodObject<{
|
|
350
|
+
code: import("zod").ZodType<"INTERNAL_SERVER_ERROR", import("zod").ZodTypeDef, "INTERNAL_SERVER_ERROR">;
|
|
351
|
+
error: import("zod").ZodType<string, import("zod").ZodTypeDef, string>;
|
|
352
|
+
name: import("zod").ZodLiteral<"APIError">;
|
|
353
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
354
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
355
|
+
error: string;
|
|
356
|
+
name: "APIError";
|
|
357
|
+
}, {
|
|
358
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
359
|
+
error: string;
|
|
360
|
+
name: "APIError";
|
|
361
|
+
}>;
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
suggest: {
|
|
365
|
+
query: import("zod").ZodObject<{
|
|
366
|
+
q: import("zod").ZodString;
|
|
367
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
368
|
+
q: string;
|
|
369
|
+
}, {
|
|
370
|
+
q: string;
|
|
371
|
+
}>;
|
|
372
|
+
description: "Get YouTube search suggestions for a partial query";
|
|
373
|
+
method: "GET";
|
|
374
|
+
path: "/api/v2/youtube/suggest";
|
|
375
|
+
responses: {
|
|
376
|
+
200: import("zod").ZodObject<{
|
|
377
|
+
suggestions: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
378
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
379
|
+
suggestions: string[];
|
|
380
|
+
}, {
|
|
381
|
+
suggestions: string[];
|
|
382
|
+
}>;
|
|
383
|
+
400: import("zod").ZodObject<{
|
|
384
|
+
name: import("zod").ZodLiteral<"ZodError">;
|
|
385
|
+
issues: import("zod").ZodArray<import("zod").ZodObject<{
|
|
386
|
+
path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
|
|
387
|
+
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
388
|
+
code: import("zod").ZodNativeEnum<{
|
|
389
|
+
invalid_type: "invalid_type";
|
|
390
|
+
invalid_literal: "invalid_literal";
|
|
391
|
+
custom: "custom";
|
|
392
|
+
invalid_union: "invalid_union";
|
|
393
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
394
|
+
invalid_enum_value: "invalid_enum_value";
|
|
395
|
+
unrecognized_keys: "unrecognized_keys";
|
|
396
|
+
invalid_arguments: "invalid_arguments";
|
|
397
|
+
invalid_return_type: "invalid_return_type";
|
|
398
|
+
invalid_date: "invalid_date";
|
|
399
|
+
invalid_string: "invalid_string";
|
|
400
|
+
too_small: "too_small";
|
|
401
|
+
too_big: "too_big";
|
|
402
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
403
|
+
not_multiple_of: "not_multiple_of";
|
|
404
|
+
not_finite: "not_finite";
|
|
405
|
+
}>;
|
|
406
|
+
}, "strip", import("zod").ZodAny, import("zod").objectOutputType<{
|
|
407
|
+
path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
|
|
408
|
+
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
409
|
+
code: import("zod").ZodNativeEnum<{
|
|
410
|
+
invalid_type: "invalid_type";
|
|
411
|
+
invalid_literal: "invalid_literal";
|
|
412
|
+
custom: "custom";
|
|
413
|
+
invalid_union: "invalid_union";
|
|
414
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
415
|
+
invalid_enum_value: "invalid_enum_value";
|
|
416
|
+
unrecognized_keys: "unrecognized_keys";
|
|
417
|
+
invalid_arguments: "invalid_arguments";
|
|
418
|
+
invalid_return_type: "invalid_return_type";
|
|
419
|
+
invalid_date: "invalid_date";
|
|
420
|
+
invalid_string: "invalid_string";
|
|
421
|
+
too_small: "too_small";
|
|
422
|
+
too_big: "too_big";
|
|
423
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
424
|
+
not_multiple_of: "not_multiple_of";
|
|
425
|
+
not_finite: "not_finite";
|
|
426
|
+
}>;
|
|
427
|
+
}, import("zod").ZodAny, "strip">, import("zod").objectInputType<{
|
|
428
|
+
path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
|
|
429
|
+
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
430
|
+
code: import("zod").ZodNativeEnum<{
|
|
431
|
+
invalid_type: "invalid_type";
|
|
432
|
+
invalid_literal: "invalid_literal";
|
|
433
|
+
custom: "custom";
|
|
434
|
+
invalid_union: "invalid_union";
|
|
435
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
436
|
+
invalid_enum_value: "invalid_enum_value";
|
|
437
|
+
unrecognized_keys: "unrecognized_keys";
|
|
438
|
+
invalid_arguments: "invalid_arguments";
|
|
439
|
+
invalid_return_type: "invalid_return_type";
|
|
440
|
+
invalid_date: "invalid_date";
|
|
441
|
+
invalid_string: "invalid_string";
|
|
442
|
+
too_small: "too_small";
|
|
443
|
+
too_big: "too_big";
|
|
444
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
445
|
+
not_multiple_of: "not_multiple_of";
|
|
446
|
+
not_finite: "not_finite";
|
|
447
|
+
}>;
|
|
448
|
+
}, import("zod").ZodAny, "strip">>, "many">;
|
|
449
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
450
|
+
name: "ZodError";
|
|
451
|
+
issues: import("zod").objectOutputType<{
|
|
452
|
+
path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
|
|
453
|
+
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
454
|
+
code: import("zod").ZodNativeEnum<{
|
|
455
|
+
invalid_type: "invalid_type";
|
|
456
|
+
invalid_literal: "invalid_literal";
|
|
457
|
+
custom: "custom";
|
|
458
|
+
invalid_union: "invalid_union";
|
|
459
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
460
|
+
invalid_enum_value: "invalid_enum_value";
|
|
461
|
+
unrecognized_keys: "unrecognized_keys";
|
|
462
|
+
invalid_arguments: "invalid_arguments";
|
|
463
|
+
invalid_return_type: "invalid_return_type";
|
|
464
|
+
invalid_date: "invalid_date";
|
|
465
|
+
invalid_string: "invalid_string";
|
|
466
|
+
too_small: "too_small";
|
|
467
|
+
too_big: "too_big";
|
|
468
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
469
|
+
not_multiple_of: "not_multiple_of";
|
|
470
|
+
not_finite: "not_finite";
|
|
471
|
+
}>;
|
|
472
|
+
}, import("zod").ZodAny, "strip">[];
|
|
473
|
+
}, {
|
|
474
|
+
name: "ZodError";
|
|
475
|
+
issues: import("zod").objectInputType<{
|
|
476
|
+
path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
|
|
477
|
+
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
478
|
+
code: import("zod").ZodNativeEnum<{
|
|
479
|
+
invalid_type: "invalid_type";
|
|
480
|
+
invalid_literal: "invalid_literal";
|
|
481
|
+
custom: "custom";
|
|
482
|
+
invalid_union: "invalid_union";
|
|
483
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
484
|
+
invalid_enum_value: "invalid_enum_value";
|
|
485
|
+
unrecognized_keys: "unrecognized_keys";
|
|
486
|
+
invalid_arguments: "invalid_arguments";
|
|
487
|
+
invalid_return_type: "invalid_return_type";
|
|
488
|
+
invalid_date: "invalid_date";
|
|
489
|
+
invalid_string: "invalid_string";
|
|
490
|
+
too_small: "too_small";
|
|
491
|
+
too_big: "too_big";
|
|
492
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
493
|
+
not_multiple_of: "not_multiple_of";
|
|
494
|
+
not_finite: "not_finite";
|
|
495
|
+
}>;
|
|
496
|
+
}, import("zod").ZodAny, "strip">[];
|
|
497
|
+
}>;
|
|
498
|
+
500: import("zod").ZodObject<{
|
|
499
|
+
code: import("zod").ZodType<"INTERNAL_SERVER_ERROR", import("zod").ZodTypeDef, "INTERNAL_SERVER_ERROR">;
|
|
500
|
+
error: import("zod").ZodType<string, import("zod").ZodTypeDef, string>;
|
|
501
|
+
name: import("zod").ZodLiteral<"APIError">;
|
|
502
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
503
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
504
|
+
error: string;
|
|
505
|
+
name: "APIError";
|
|
506
|
+
}, {
|
|
507
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
508
|
+
error: string;
|
|
509
|
+
name: "APIError";
|
|
510
|
+
}>;
|
|
511
|
+
};
|
|
512
|
+
};
|
|
167
513
|
};
|
|
168
514
|
sync: {
|
|
169
515
|
description: "Synchronize time with the server";
|
|
@@ -164,5 +164,351 @@ declare const _default: {
|
|
|
164
164
|
}>;
|
|
165
165
|
};
|
|
166
166
|
};
|
|
167
|
+
search: {
|
|
168
|
+
query: z.ZodObject<{
|
|
169
|
+
q: z.ZodString;
|
|
170
|
+
}, "strip", z.ZodTypeAny, {
|
|
171
|
+
q: string;
|
|
172
|
+
}, {
|
|
173
|
+
q: string;
|
|
174
|
+
}>;
|
|
175
|
+
description: "Search YouTube videos";
|
|
176
|
+
method: "GET";
|
|
177
|
+
path: "/youtube/search";
|
|
178
|
+
responses: {
|
|
179
|
+
200: z.ZodObject<{
|
|
180
|
+
results: z.ZodArray<z.ZodObject<{
|
|
181
|
+
videoId: z.ZodString;
|
|
182
|
+
title: z.ZodString;
|
|
183
|
+
channel: z.ZodNullable<z.ZodString>;
|
|
184
|
+
duration: z.ZodNullable<z.ZodNumber>;
|
|
185
|
+
thumbnail: z.ZodNullable<z.ZodString>;
|
|
186
|
+
blocked: z.ZodNullable<z.ZodEnum<["live", "too_long"]>>;
|
|
187
|
+
}, "strip", z.ZodTypeAny, {
|
|
188
|
+
videoId: string;
|
|
189
|
+
title: string;
|
|
190
|
+
duration: number | null;
|
|
191
|
+
channel: string | null;
|
|
192
|
+
thumbnail: string | null;
|
|
193
|
+
blocked: "live" | "too_long" | null;
|
|
194
|
+
}, {
|
|
195
|
+
videoId: string;
|
|
196
|
+
title: string;
|
|
197
|
+
duration: number | null;
|
|
198
|
+
channel: string | null;
|
|
199
|
+
thumbnail: string | null;
|
|
200
|
+
blocked: "live" | "too_long" | null;
|
|
201
|
+
}>, "many">;
|
|
202
|
+
}, "strip", z.ZodTypeAny, {
|
|
203
|
+
results: {
|
|
204
|
+
videoId: string;
|
|
205
|
+
title: string;
|
|
206
|
+
duration: number | null;
|
|
207
|
+
channel: string | null;
|
|
208
|
+
thumbnail: string | null;
|
|
209
|
+
blocked: "live" | "too_long" | null;
|
|
210
|
+
}[];
|
|
211
|
+
}, {
|
|
212
|
+
results: {
|
|
213
|
+
videoId: string;
|
|
214
|
+
title: string;
|
|
215
|
+
duration: number | null;
|
|
216
|
+
channel: string | null;
|
|
217
|
+
thumbnail: string | null;
|
|
218
|
+
blocked: "live" | "too_long" | null;
|
|
219
|
+
}[];
|
|
220
|
+
}>;
|
|
221
|
+
400: z.ZodObject<{
|
|
222
|
+
name: z.ZodLiteral<"ZodError">;
|
|
223
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
224
|
+
path: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">;
|
|
225
|
+
message: z.ZodOptional<z.ZodString>;
|
|
226
|
+
code: z.ZodNativeEnum<{
|
|
227
|
+
invalid_type: "invalid_type";
|
|
228
|
+
invalid_literal: "invalid_literal";
|
|
229
|
+
custom: "custom";
|
|
230
|
+
invalid_union: "invalid_union";
|
|
231
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
232
|
+
invalid_enum_value: "invalid_enum_value";
|
|
233
|
+
unrecognized_keys: "unrecognized_keys";
|
|
234
|
+
invalid_arguments: "invalid_arguments";
|
|
235
|
+
invalid_return_type: "invalid_return_type";
|
|
236
|
+
invalid_date: "invalid_date";
|
|
237
|
+
invalid_string: "invalid_string";
|
|
238
|
+
too_small: "too_small";
|
|
239
|
+
too_big: "too_big";
|
|
240
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
241
|
+
not_multiple_of: "not_multiple_of";
|
|
242
|
+
not_finite: "not_finite";
|
|
243
|
+
}>;
|
|
244
|
+
}, "strip", z.ZodAny, z.objectOutputType<{
|
|
245
|
+
path: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">;
|
|
246
|
+
message: z.ZodOptional<z.ZodString>;
|
|
247
|
+
code: z.ZodNativeEnum<{
|
|
248
|
+
invalid_type: "invalid_type";
|
|
249
|
+
invalid_literal: "invalid_literal";
|
|
250
|
+
custom: "custom";
|
|
251
|
+
invalid_union: "invalid_union";
|
|
252
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
253
|
+
invalid_enum_value: "invalid_enum_value";
|
|
254
|
+
unrecognized_keys: "unrecognized_keys";
|
|
255
|
+
invalid_arguments: "invalid_arguments";
|
|
256
|
+
invalid_return_type: "invalid_return_type";
|
|
257
|
+
invalid_date: "invalid_date";
|
|
258
|
+
invalid_string: "invalid_string";
|
|
259
|
+
too_small: "too_small";
|
|
260
|
+
too_big: "too_big";
|
|
261
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
262
|
+
not_multiple_of: "not_multiple_of";
|
|
263
|
+
not_finite: "not_finite";
|
|
264
|
+
}>;
|
|
265
|
+
}, z.ZodAny, "strip">, z.objectInputType<{
|
|
266
|
+
path: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">;
|
|
267
|
+
message: z.ZodOptional<z.ZodString>;
|
|
268
|
+
code: z.ZodNativeEnum<{
|
|
269
|
+
invalid_type: "invalid_type";
|
|
270
|
+
invalid_literal: "invalid_literal";
|
|
271
|
+
custom: "custom";
|
|
272
|
+
invalid_union: "invalid_union";
|
|
273
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
274
|
+
invalid_enum_value: "invalid_enum_value";
|
|
275
|
+
unrecognized_keys: "unrecognized_keys";
|
|
276
|
+
invalid_arguments: "invalid_arguments";
|
|
277
|
+
invalid_return_type: "invalid_return_type";
|
|
278
|
+
invalid_date: "invalid_date";
|
|
279
|
+
invalid_string: "invalid_string";
|
|
280
|
+
too_small: "too_small";
|
|
281
|
+
too_big: "too_big";
|
|
282
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
283
|
+
not_multiple_of: "not_multiple_of";
|
|
284
|
+
not_finite: "not_finite";
|
|
285
|
+
}>;
|
|
286
|
+
}, z.ZodAny, "strip">>, "many">;
|
|
287
|
+
}, "strip", z.ZodTypeAny, {
|
|
288
|
+
name: "ZodError";
|
|
289
|
+
issues: z.objectOutputType<{
|
|
290
|
+
path: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">;
|
|
291
|
+
message: z.ZodOptional<z.ZodString>;
|
|
292
|
+
code: z.ZodNativeEnum<{
|
|
293
|
+
invalid_type: "invalid_type";
|
|
294
|
+
invalid_literal: "invalid_literal";
|
|
295
|
+
custom: "custom";
|
|
296
|
+
invalid_union: "invalid_union";
|
|
297
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
298
|
+
invalid_enum_value: "invalid_enum_value";
|
|
299
|
+
unrecognized_keys: "unrecognized_keys";
|
|
300
|
+
invalid_arguments: "invalid_arguments";
|
|
301
|
+
invalid_return_type: "invalid_return_type";
|
|
302
|
+
invalid_date: "invalid_date";
|
|
303
|
+
invalid_string: "invalid_string";
|
|
304
|
+
too_small: "too_small";
|
|
305
|
+
too_big: "too_big";
|
|
306
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
307
|
+
not_multiple_of: "not_multiple_of";
|
|
308
|
+
not_finite: "not_finite";
|
|
309
|
+
}>;
|
|
310
|
+
}, z.ZodAny, "strip">[];
|
|
311
|
+
}, {
|
|
312
|
+
name: "ZodError";
|
|
313
|
+
issues: z.objectInputType<{
|
|
314
|
+
path: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">;
|
|
315
|
+
message: z.ZodOptional<z.ZodString>;
|
|
316
|
+
code: z.ZodNativeEnum<{
|
|
317
|
+
invalid_type: "invalid_type";
|
|
318
|
+
invalid_literal: "invalid_literal";
|
|
319
|
+
custom: "custom";
|
|
320
|
+
invalid_union: "invalid_union";
|
|
321
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
322
|
+
invalid_enum_value: "invalid_enum_value";
|
|
323
|
+
unrecognized_keys: "unrecognized_keys";
|
|
324
|
+
invalid_arguments: "invalid_arguments";
|
|
325
|
+
invalid_return_type: "invalid_return_type";
|
|
326
|
+
invalid_date: "invalid_date";
|
|
327
|
+
invalid_string: "invalid_string";
|
|
328
|
+
too_small: "too_small";
|
|
329
|
+
too_big: "too_big";
|
|
330
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
331
|
+
not_multiple_of: "not_multiple_of";
|
|
332
|
+
not_finite: "not_finite";
|
|
333
|
+
}>;
|
|
334
|
+
}, z.ZodAny, "strip">[];
|
|
335
|
+
}>;
|
|
336
|
+
429: z.ZodObject<{
|
|
337
|
+
code: z.ZodType<"TOO_MANY_SEARCHES", z.ZodTypeDef, "TOO_MANY_SEARCHES">;
|
|
338
|
+
error: z.ZodType<"Too many searches are running", z.ZodTypeDef, "Too many searches are running">;
|
|
339
|
+
name: z.ZodLiteral<"APIError">;
|
|
340
|
+
}, "strip", z.ZodTypeAny, {
|
|
341
|
+
code: "TOO_MANY_SEARCHES";
|
|
342
|
+
error: "Too many searches are running";
|
|
343
|
+
name: "APIError";
|
|
344
|
+
}, {
|
|
345
|
+
code: "TOO_MANY_SEARCHES";
|
|
346
|
+
error: "Too many searches are running";
|
|
347
|
+
name: "APIError";
|
|
348
|
+
}>;
|
|
349
|
+
500: z.ZodObject<{
|
|
350
|
+
code: z.ZodType<"INTERNAL_SERVER_ERROR", z.ZodTypeDef, "INTERNAL_SERVER_ERROR">;
|
|
351
|
+
error: z.ZodType<string, z.ZodTypeDef, string>;
|
|
352
|
+
name: z.ZodLiteral<"APIError">;
|
|
353
|
+
}, "strip", z.ZodTypeAny, {
|
|
354
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
355
|
+
error: string;
|
|
356
|
+
name: "APIError";
|
|
357
|
+
}, {
|
|
358
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
359
|
+
error: string;
|
|
360
|
+
name: "APIError";
|
|
361
|
+
}>;
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
suggest: {
|
|
365
|
+
query: z.ZodObject<{
|
|
366
|
+
q: z.ZodString;
|
|
367
|
+
}, "strip", z.ZodTypeAny, {
|
|
368
|
+
q: string;
|
|
369
|
+
}, {
|
|
370
|
+
q: string;
|
|
371
|
+
}>;
|
|
372
|
+
description: "Get YouTube search suggestions for a partial query";
|
|
373
|
+
method: "GET";
|
|
374
|
+
path: "/youtube/suggest";
|
|
375
|
+
responses: {
|
|
376
|
+
200: z.ZodObject<{
|
|
377
|
+
suggestions: z.ZodArray<z.ZodString, "many">;
|
|
378
|
+
}, "strip", z.ZodTypeAny, {
|
|
379
|
+
suggestions: string[];
|
|
380
|
+
}, {
|
|
381
|
+
suggestions: string[];
|
|
382
|
+
}>;
|
|
383
|
+
400: z.ZodObject<{
|
|
384
|
+
name: z.ZodLiteral<"ZodError">;
|
|
385
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
386
|
+
path: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">;
|
|
387
|
+
message: z.ZodOptional<z.ZodString>;
|
|
388
|
+
code: z.ZodNativeEnum<{
|
|
389
|
+
invalid_type: "invalid_type";
|
|
390
|
+
invalid_literal: "invalid_literal";
|
|
391
|
+
custom: "custom";
|
|
392
|
+
invalid_union: "invalid_union";
|
|
393
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
394
|
+
invalid_enum_value: "invalid_enum_value";
|
|
395
|
+
unrecognized_keys: "unrecognized_keys";
|
|
396
|
+
invalid_arguments: "invalid_arguments";
|
|
397
|
+
invalid_return_type: "invalid_return_type";
|
|
398
|
+
invalid_date: "invalid_date";
|
|
399
|
+
invalid_string: "invalid_string";
|
|
400
|
+
too_small: "too_small";
|
|
401
|
+
too_big: "too_big";
|
|
402
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
403
|
+
not_multiple_of: "not_multiple_of";
|
|
404
|
+
not_finite: "not_finite";
|
|
405
|
+
}>;
|
|
406
|
+
}, "strip", z.ZodAny, z.objectOutputType<{
|
|
407
|
+
path: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">;
|
|
408
|
+
message: z.ZodOptional<z.ZodString>;
|
|
409
|
+
code: z.ZodNativeEnum<{
|
|
410
|
+
invalid_type: "invalid_type";
|
|
411
|
+
invalid_literal: "invalid_literal";
|
|
412
|
+
custom: "custom";
|
|
413
|
+
invalid_union: "invalid_union";
|
|
414
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
415
|
+
invalid_enum_value: "invalid_enum_value";
|
|
416
|
+
unrecognized_keys: "unrecognized_keys";
|
|
417
|
+
invalid_arguments: "invalid_arguments";
|
|
418
|
+
invalid_return_type: "invalid_return_type";
|
|
419
|
+
invalid_date: "invalid_date";
|
|
420
|
+
invalid_string: "invalid_string";
|
|
421
|
+
too_small: "too_small";
|
|
422
|
+
too_big: "too_big";
|
|
423
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
424
|
+
not_multiple_of: "not_multiple_of";
|
|
425
|
+
not_finite: "not_finite";
|
|
426
|
+
}>;
|
|
427
|
+
}, z.ZodAny, "strip">, z.objectInputType<{
|
|
428
|
+
path: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">;
|
|
429
|
+
message: z.ZodOptional<z.ZodString>;
|
|
430
|
+
code: z.ZodNativeEnum<{
|
|
431
|
+
invalid_type: "invalid_type";
|
|
432
|
+
invalid_literal: "invalid_literal";
|
|
433
|
+
custom: "custom";
|
|
434
|
+
invalid_union: "invalid_union";
|
|
435
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
436
|
+
invalid_enum_value: "invalid_enum_value";
|
|
437
|
+
unrecognized_keys: "unrecognized_keys";
|
|
438
|
+
invalid_arguments: "invalid_arguments";
|
|
439
|
+
invalid_return_type: "invalid_return_type";
|
|
440
|
+
invalid_date: "invalid_date";
|
|
441
|
+
invalid_string: "invalid_string";
|
|
442
|
+
too_small: "too_small";
|
|
443
|
+
too_big: "too_big";
|
|
444
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
445
|
+
not_multiple_of: "not_multiple_of";
|
|
446
|
+
not_finite: "not_finite";
|
|
447
|
+
}>;
|
|
448
|
+
}, z.ZodAny, "strip">>, "many">;
|
|
449
|
+
}, "strip", z.ZodTypeAny, {
|
|
450
|
+
name: "ZodError";
|
|
451
|
+
issues: z.objectOutputType<{
|
|
452
|
+
path: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">;
|
|
453
|
+
message: z.ZodOptional<z.ZodString>;
|
|
454
|
+
code: z.ZodNativeEnum<{
|
|
455
|
+
invalid_type: "invalid_type";
|
|
456
|
+
invalid_literal: "invalid_literal";
|
|
457
|
+
custom: "custom";
|
|
458
|
+
invalid_union: "invalid_union";
|
|
459
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
460
|
+
invalid_enum_value: "invalid_enum_value";
|
|
461
|
+
unrecognized_keys: "unrecognized_keys";
|
|
462
|
+
invalid_arguments: "invalid_arguments";
|
|
463
|
+
invalid_return_type: "invalid_return_type";
|
|
464
|
+
invalid_date: "invalid_date";
|
|
465
|
+
invalid_string: "invalid_string";
|
|
466
|
+
too_small: "too_small";
|
|
467
|
+
too_big: "too_big";
|
|
468
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
469
|
+
not_multiple_of: "not_multiple_of";
|
|
470
|
+
not_finite: "not_finite";
|
|
471
|
+
}>;
|
|
472
|
+
}, z.ZodAny, "strip">[];
|
|
473
|
+
}, {
|
|
474
|
+
name: "ZodError";
|
|
475
|
+
issues: z.objectInputType<{
|
|
476
|
+
path: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">;
|
|
477
|
+
message: z.ZodOptional<z.ZodString>;
|
|
478
|
+
code: z.ZodNativeEnum<{
|
|
479
|
+
invalid_type: "invalid_type";
|
|
480
|
+
invalid_literal: "invalid_literal";
|
|
481
|
+
custom: "custom";
|
|
482
|
+
invalid_union: "invalid_union";
|
|
483
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
484
|
+
invalid_enum_value: "invalid_enum_value";
|
|
485
|
+
unrecognized_keys: "unrecognized_keys";
|
|
486
|
+
invalid_arguments: "invalid_arguments";
|
|
487
|
+
invalid_return_type: "invalid_return_type";
|
|
488
|
+
invalid_date: "invalid_date";
|
|
489
|
+
invalid_string: "invalid_string";
|
|
490
|
+
too_small: "too_small";
|
|
491
|
+
too_big: "too_big";
|
|
492
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
493
|
+
not_multiple_of: "not_multiple_of";
|
|
494
|
+
not_finite: "not_finite";
|
|
495
|
+
}>;
|
|
496
|
+
}, z.ZodAny, "strip">[];
|
|
497
|
+
}>;
|
|
498
|
+
500: z.ZodObject<{
|
|
499
|
+
code: z.ZodType<"INTERNAL_SERVER_ERROR", z.ZodTypeDef, "INTERNAL_SERVER_ERROR">;
|
|
500
|
+
error: z.ZodType<string, z.ZodTypeDef, string>;
|
|
501
|
+
name: z.ZodLiteral<"APIError">;
|
|
502
|
+
}, "strip", z.ZodTypeAny, {
|
|
503
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
504
|
+
error: string;
|
|
505
|
+
name: "APIError";
|
|
506
|
+
}, {
|
|
507
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
508
|
+
error: string;
|
|
509
|
+
name: "APIError";
|
|
510
|
+
}>;
|
|
511
|
+
};
|
|
512
|
+
};
|
|
167
513
|
};
|
|
168
514
|
export default _default;
|
package/dist/contract/youtube.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { initContract, ZodErrorSchema } from "@ts-rest/core";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { apiError, apiSuccess } from "../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import { YOUTUBE_QUERY_MAX_LENGTH } from "../consts.js";
|
|
5
|
+
import { youTubeFilterSchema, youTubeQualitySchema, youTubeSearchResultSchema, } from "../types/youtube.js";
|
|
5
6
|
const c = initContract();
|
|
7
|
+
const queryParams = z.object({
|
|
8
|
+
q: z.string().trim().min(1).max(YOUTUBE_QUERY_MAX_LENGTH),
|
|
9
|
+
});
|
|
6
10
|
export default c.router({
|
|
7
11
|
getLink: {
|
|
8
12
|
method: "GET",
|
|
@@ -24,4 +28,31 @@ export default c.router({
|
|
|
24
28
|
500: apiError(z.literal("INTERNAL_SERVER_ERROR"), z.string()),
|
|
25
29
|
},
|
|
26
30
|
},
|
|
31
|
+
search: {
|
|
32
|
+
method: "GET",
|
|
33
|
+
path: "/youtube/search",
|
|
34
|
+
description: "Search YouTube videos",
|
|
35
|
+
query: queryParams,
|
|
36
|
+
responses: {
|
|
37
|
+
200: apiSuccess(z.object({
|
|
38
|
+
results: z.array(youTubeSearchResultSchema),
|
|
39
|
+
})),
|
|
40
|
+
400: ZodErrorSchema,
|
|
41
|
+
429: apiError(z.literal("TOO_MANY_SEARCHES"), z.literal("Too many searches are running")),
|
|
42
|
+
500: apiError(z.literal("INTERNAL_SERVER_ERROR"), z.string()),
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
suggest: {
|
|
46
|
+
method: "GET",
|
|
47
|
+
path: "/youtube/suggest",
|
|
48
|
+
description: "Get YouTube search suggestions for a partial query",
|
|
49
|
+
query: queryParams,
|
|
50
|
+
responses: {
|
|
51
|
+
200: apiSuccess(z.object({
|
|
52
|
+
suggestions: z.array(z.string()),
|
|
53
|
+
})),
|
|
54
|
+
400: ZodErrorSchema,
|
|
55
|
+
500: apiError(z.literal("INTERNAL_SERVER_ERROR"), z.string()),
|
|
56
|
+
},
|
|
57
|
+
},
|
|
27
58
|
});
|
package/dist/types/youtube.d.ts
CHANGED
|
@@ -3,3 +3,28 @@ export declare const youTubeQualitySchema: z.ZodEnum<["highest", "highestaudio",
|
|
|
3
3
|
export type YouTubeQuality = z.infer<typeof youTubeQualitySchema>;
|
|
4
4
|
export declare const youTubeFilterSchema: z.ZodEnum<["audio", "audioandvideo", "audioonly", "video", "videoandaudio", "videoonly"]>;
|
|
5
5
|
export type YouTubeFilter = z.infer<typeof youTubeFilterSchema>;
|
|
6
|
+
export declare const youTubeSearchResultSchema: z.ZodObject<{
|
|
7
|
+
videoId: z.ZodString;
|
|
8
|
+
title: z.ZodString;
|
|
9
|
+
channel: z.ZodNullable<z.ZodString>;
|
|
10
|
+
/** Seconds, null if YouTube doesn't give it, e.g. for live videos */
|
|
11
|
+
duration: z.ZodNullable<z.ZodNumber>;
|
|
12
|
+
thumbnail: z.ZodNullable<z.ZodString>;
|
|
13
|
+
/** Why the video can't be streamed, null if it can */
|
|
14
|
+
blocked: z.ZodNullable<z.ZodEnum<["live", "too_long"]>>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
videoId: string;
|
|
17
|
+
title: string;
|
|
18
|
+
duration: number | null;
|
|
19
|
+
channel: string | null;
|
|
20
|
+
thumbnail: string | null;
|
|
21
|
+
blocked: "live" | "too_long" | null;
|
|
22
|
+
}, {
|
|
23
|
+
videoId: string;
|
|
24
|
+
title: string;
|
|
25
|
+
duration: number | null;
|
|
26
|
+
channel: string | null;
|
|
27
|
+
thumbnail: string | null;
|
|
28
|
+
blocked: "live" | "too_long" | null;
|
|
29
|
+
}>;
|
|
30
|
+
export type YouTubeSearchResult = z.infer<typeof youTubeSearchResultSchema>;
|
package/dist/types/youtube.js
CHANGED
|
@@ -15,3 +15,13 @@ export const youTubeFilterSchema = z.enum([
|
|
|
15
15
|
"videoandaudio",
|
|
16
16
|
"videoonly",
|
|
17
17
|
]);
|
|
18
|
+
export const youTubeSearchResultSchema = z.object({
|
|
19
|
+
videoId: z.string(),
|
|
20
|
+
title: z.string(),
|
|
21
|
+
channel: z.string().nullable(),
|
|
22
|
+
/** Seconds, null if YouTube doesn't give it, e.g. for live videos */
|
|
23
|
+
duration: z.number().nullable(),
|
|
24
|
+
thumbnail: z.string().url().nullable(),
|
|
25
|
+
/** Why the video can't be streamed, null if it can */
|
|
26
|
+
blocked: z.enum(["live", "too_long"]).nullable(),
|
|
27
|
+
});
|