@darco2903/altv-web-api 1.4.0 → 1.6.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 +236 -138
- package/dist/contract/history.d.ts +92 -0
- package/dist/contract/history.js +19 -0
- package/dist/contract/index.d.ts +395 -287
- package/dist/contract/index.js +2 -0
- package/dist/contract/mediaStream.d.ts +222 -92
- package/dist/contract/mediaStream.js +6 -6
- package/dist/contract/youtube.d.ts +83 -195
- package/dist/contract/youtube.js +4 -22
- package/dist/types/youtube.d.ts +2 -6
- package/dist/types/youtube.js +0 -16
- package/dist/types.d.ts +29 -0
- package/dist/types.js +5 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -3,85 +3,46 @@ export * from "./common.js";
|
|
|
3
3
|
import type { ClientToServerEvents, ServerToClientEvents } from "./socket/index.js";
|
|
4
4
|
export declare function createClient(origin: string): {
|
|
5
5
|
youtube: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
search: (args: {
|
|
7
|
+
query: {
|
|
8
|
+
q: string;
|
|
9
9
|
};
|
|
10
10
|
cache?: RequestCache | undefined;
|
|
11
11
|
extraHeaders?: Record<string, string | undefined> | undefined;
|
|
12
12
|
fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
|
|
13
13
|
overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
|
|
14
|
-
query?: {
|
|
15
|
-
filter?: "audio" | "audioandvideo" | "audioonly" | "video" | "videoandaudio" | "videoonly" | undefined;
|
|
16
|
-
quality?: "highest" | "highestaudio" | "highestvideo" | "lowest" | "lowestaudio" | "lowestvideo" | undefined;
|
|
17
|
-
} | undefined;
|
|
18
14
|
}) => Promise<{
|
|
19
|
-
status:
|
|
15
|
+
status: 500;
|
|
20
16
|
body: {
|
|
21
|
-
|
|
17
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
18
|
+
error: string;
|
|
19
|
+
name: "APIError";
|
|
22
20
|
};
|
|
23
21
|
headers: Headers;
|
|
24
22
|
} | {
|
|
25
|
-
status:
|
|
23
|
+
status: 401;
|
|
26
24
|
body: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
|
|
30
|
-
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
31
|
-
code: import("zod").ZodNativeEnum<{
|
|
32
|
-
invalid_type: "invalid_type";
|
|
33
|
-
invalid_literal: "invalid_literal";
|
|
34
|
-
custom: "custom";
|
|
35
|
-
invalid_union: "invalid_union";
|
|
36
|
-
invalid_union_discriminator: "invalid_union_discriminator";
|
|
37
|
-
invalid_enum_value: "invalid_enum_value";
|
|
38
|
-
unrecognized_keys: "unrecognized_keys";
|
|
39
|
-
invalid_arguments: "invalid_arguments";
|
|
40
|
-
invalid_return_type: "invalid_return_type";
|
|
41
|
-
invalid_date: "invalid_date";
|
|
42
|
-
invalid_string: "invalid_string";
|
|
43
|
-
too_small: "too_small";
|
|
44
|
-
too_big: "too_big";
|
|
45
|
-
invalid_intersection_types: "invalid_intersection_types";
|
|
46
|
-
not_multiple_of: "not_multiple_of";
|
|
47
|
-
not_finite: "not_finite";
|
|
48
|
-
}>;
|
|
49
|
-
}, import("zod").ZodAny, "strip">[];
|
|
50
|
-
} | {
|
|
51
|
-
code: "INVALID_VIDEO_ID";
|
|
52
|
-
error: "The provided video ID is invalid";
|
|
25
|
+
code: "UNAUTHORIZED";
|
|
26
|
+
error: "Unauthorized";
|
|
53
27
|
name: "APIError";
|
|
54
28
|
};
|
|
55
29
|
headers: Headers;
|
|
56
30
|
} | {
|
|
57
|
-
status:
|
|
31
|
+
status: 403;
|
|
58
32
|
body: {
|
|
59
|
-
code: "
|
|
60
|
-
error:
|
|
33
|
+
code: "FORBIDDEN";
|
|
34
|
+
error: "Forbidden";
|
|
61
35
|
name: "APIError";
|
|
62
36
|
};
|
|
63
37
|
headers: Headers;
|
|
64
38
|
} | {
|
|
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
39
|
status: 200;
|
|
79
40
|
body: {
|
|
80
41
|
results: {
|
|
81
42
|
videoId: string;
|
|
82
43
|
title: string;
|
|
83
|
-
duration: number | null;
|
|
84
44
|
channel: string | null;
|
|
45
|
+
duration: number | null;
|
|
85
46
|
thumbnail: string | null;
|
|
86
47
|
blocked: "live" | "too_long" | null;
|
|
87
48
|
}[];
|
|
@@ -115,14 +76,6 @@ export declare function createClient(origin: string): {
|
|
|
115
76
|
}, import("zod").ZodAny, "strip">[];
|
|
116
77
|
};
|
|
117
78
|
headers: Headers;
|
|
118
|
-
} | {
|
|
119
|
-
status: 500;
|
|
120
|
-
body: {
|
|
121
|
-
code: "INTERNAL_SERVER_ERROR";
|
|
122
|
-
error: string;
|
|
123
|
-
name: "APIError";
|
|
124
|
-
};
|
|
125
|
-
headers: Headers;
|
|
126
79
|
} | {
|
|
127
80
|
status: 429;
|
|
128
81
|
body: {
|
|
@@ -132,7 +85,7 @@ export declare function createClient(origin: string): {
|
|
|
132
85
|
};
|
|
133
86
|
headers: Headers;
|
|
134
87
|
} | {
|
|
135
|
-
status: 404 | 100 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 |
|
|
88
|
+
status: 404 | 100 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 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 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
136
89
|
body: unknown;
|
|
137
90
|
headers: Headers;
|
|
138
91
|
}>;
|
|
@@ -145,6 +98,30 @@ export declare function createClient(origin: string): {
|
|
|
145
98
|
fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
|
|
146
99
|
overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
|
|
147
100
|
}) => Promise<{
|
|
101
|
+
status: 500;
|
|
102
|
+
body: {
|
|
103
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
104
|
+
error: string;
|
|
105
|
+
name: "APIError";
|
|
106
|
+
};
|
|
107
|
+
headers: Headers;
|
|
108
|
+
} | {
|
|
109
|
+
status: 401;
|
|
110
|
+
body: {
|
|
111
|
+
code: "UNAUTHORIZED";
|
|
112
|
+
error: "Unauthorized";
|
|
113
|
+
name: "APIError";
|
|
114
|
+
};
|
|
115
|
+
headers: Headers;
|
|
116
|
+
} | {
|
|
117
|
+
status: 403;
|
|
118
|
+
body: {
|
|
119
|
+
code: "FORBIDDEN";
|
|
120
|
+
error: "Forbidden";
|
|
121
|
+
name: "APIError";
|
|
122
|
+
};
|
|
123
|
+
headers: Headers;
|
|
124
|
+
} | {
|
|
148
125
|
status: 200;
|
|
149
126
|
body: {
|
|
150
127
|
suggestions: string[];
|
|
@@ -179,15 +156,7 @@ export declare function createClient(origin: string): {
|
|
|
179
156
|
};
|
|
180
157
|
headers: Headers;
|
|
181
158
|
} | {
|
|
182
|
-
status:
|
|
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;
|
|
159
|
+
status: 404 | 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 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 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
191
160
|
body: unknown;
|
|
192
161
|
headers: Headers;
|
|
193
162
|
}>;
|
|
@@ -236,7 +205,7 @@ export declare function createClient(origin: string): {
|
|
|
236
205
|
};
|
|
237
206
|
headers: Headers;
|
|
238
207
|
} | {
|
|
239
|
-
status: 500 | 404 | 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 |
|
|
208
|
+
status: 500 | 401 | 403 | 404 | 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 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 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
240
209
|
body: unknown;
|
|
241
210
|
headers: Headers;
|
|
242
211
|
}>;
|
|
@@ -252,10 +221,59 @@ export declare function createClient(origin: string): {
|
|
|
252
221
|
};
|
|
253
222
|
headers: Headers;
|
|
254
223
|
} | {
|
|
255
|
-
status:
|
|
224
|
+
status: 500 | 401 | 403 | 400 | 404 | 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 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 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
256
225
|
body: unknown;
|
|
257
226
|
headers: Headers;
|
|
258
227
|
}>;
|
|
228
|
+
history: {
|
|
229
|
+
list: (args?: {
|
|
230
|
+
cache?: RequestCache | undefined;
|
|
231
|
+
extraHeaders?: Record<string, string | undefined> | undefined;
|
|
232
|
+
fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
|
|
233
|
+
overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
|
|
234
|
+
} | undefined) => Promise<{
|
|
235
|
+
status: 500;
|
|
236
|
+
body: {
|
|
237
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
238
|
+
error: string;
|
|
239
|
+
name: "APIError";
|
|
240
|
+
};
|
|
241
|
+
headers: Headers;
|
|
242
|
+
} | {
|
|
243
|
+
status: 401;
|
|
244
|
+
body: {
|
|
245
|
+
code: "UNAUTHORIZED";
|
|
246
|
+
error: "Unauthorized";
|
|
247
|
+
name: "APIError";
|
|
248
|
+
};
|
|
249
|
+
headers: Headers;
|
|
250
|
+
} | {
|
|
251
|
+
status: 403;
|
|
252
|
+
body: {
|
|
253
|
+
code: "FORBIDDEN";
|
|
254
|
+
error: "Forbidden";
|
|
255
|
+
name: "APIError";
|
|
256
|
+
};
|
|
257
|
+
headers: Headers;
|
|
258
|
+
} | {
|
|
259
|
+
status: 200;
|
|
260
|
+
body: {
|
|
261
|
+
tracks: {
|
|
262
|
+
videoId: string;
|
|
263
|
+
title: string;
|
|
264
|
+
channel: string | null;
|
|
265
|
+
duration: number | null;
|
|
266
|
+
thumbnail: string | null;
|
|
267
|
+
blocked: "live" | "too_long" | null;
|
|
268
|
+
}[];
|
|
269
|
+
};
|
|
270
|
+
headers: Headers;
|
|
271
|
+
} | {
|
|
272
|
+
status: 400 | 404 | 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 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 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
273
|
+
body: unknown;
|
|
274
|
+
headers: Headers;
|
|
275
|
+
}>;
|
|
276
|
+
};
|
|
259
277
|
mediaStream: {
|
|
260
278
|
init: (args: {
|
|
261
279
|
body: {
|
|
@@ -266,6 +284,30 @@ export declare function createClient(origin: string): {
|
|
|
266
284
|
fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
|
|
267
285
|
overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
|
|
268
286
|
}) => Promise<{
|
|
287
|
+
status: 500;
|
|
288
|
+
body: {
|
|
289
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
290
|
+
error: string;
|
|
291
|
+
name: "APIError";
|
|
292
|
+
};
|
|
293
|
+
headers: Headers;
|
|
294
|
+
} | {
|
|
295
|
+
status: 401;
|
|
296
|
+
body: {
|
|
297
|
+
code: "UNAUTHORIZED";
|
|
298
|
+
error: "Unauthorized";
|
|
299
|
+
name: "APIError";
|
|
300
|
+
};
|
|
301
|
+
headers: Headers;
|
|
302
|
+
} | {
|
|
303
|
+
status: 403;
|
|
304
|
+
body: {
|
|
305
|
+
code: "FORBIDDEN";
|
|
306
|
+
error: "Forbidden";
|
|
307
|
+
name: "APIError";
|
|
308
|
+
};
|
|
309
|
+
headers: Headers;
|
|
310
|
+
} | {
|
|
269
311
|
status: 200;
|
|
270
312
|
body: {
|
|
271
313
|
streamId: string;
|
|
@@ -304,15 +346,7 @@ export declare function createClient(origin: string): {
|
|
|
304
346
|
};
|
|
305
347
|
headers: Headers;
|
|
306
348
|
} | {
|
|
307
|
-
status:
|
|
308
|
-
body: {
|
|
309
|
-
code: "INTERNAL_SERVER_ERROR";
|
|
310
|
-
error: string;
|
|
311
|
-
name: "APIError";
|
|
312
|
-
};
|
|
313
|
-
headers: Headers;
|
|
314
|
-
} | {
|
|
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;
|
|
349
|
+
status: 404 | 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 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 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
316
350
|
body: unknown;
|
|
317
351
|
headers: Headers;
|
|
318
352
|
}>;
|
|
@@ -325,12 +359,20 @@ export declare function createClient(origin: string): {
|
|
|
325
359
|
fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
|
|
326
360
|
overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
|
|
327
361
|
}) => Promise<{
|
|
362
|
+
status: 500;
|
|
363
|
+
body: {
|
|
364
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
365
|
+
error: string;
|
|
366
|
+
name: "APIError";
|
|
367
|
+
};
|
|
368
|
+
headers: Headers;
|
|
369
|
+
} | {
|
|
328
370
|
status: 200;
|
|
329
371
|
body: {
|
|
330
|
-
streamId: string;
|
|
331
372
|
title: string;
|
|
332
|
-
startTime: number;
|
|
333
373
|
duration: number;
|
|
374
|
+
streamId: string;
|
|
375
|
+
startTime: number;
|
|
334
376
|
currentTime: number;
|
|
335
377
|
url: string;
|
|
336
378
|
paused: boolean;
|
|
@@ -389,15 +431,7 @@ export declare function createClient(origin: string): {
|
|
|
389
431
|
};
|
|
390
432
|
headers: Headers;
|
|
391
433
|
} | {
|
|
392
|
-
status:
|
|
393
|
-
body: {
|
|
394
|
-
code: "INTERNAL_SERVER_ERROR";
|
|
395
|
-
error: string;
|
|
396
|
-
name: "APIError";
|
|
397
|
-
};
|
|
398
|
-
headers: Headers;
|
|
399
|
-
} | {
|
|
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;
|
|
434
|
+
status: 401 | 403 | 404 | 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 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 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
401
435
|
body: unknown;
|
|
402
436
|
headers: Headers;
|
|
403
437
|
}>;
|
|
@@ -410,6 +444,30 @@ export declare function createClient(origin: string): {
|
|
|
410
444
|
fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
|
|
411
445
|
overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
|
|
412
446
|
}) => Promise<{
|
|
447
|
+
status: 500;
|
|
448
|
+
body: {
|
|
449
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
450
|
+
error: string;
|
|
451
|
+
name: "APIError";
|
|
452
|
+
};
|
|
453
|
+
headers: Headers;
|
|
454
|
+
} | {
|
|
455
|
+
status: 401;
|
|
456
|
+
body: {
|
|
457
|
+
code: "UNAUTHORIZED";
|
|
458
|
+
error: "Unauthorized";
|
|
459
|
+
name: "APIError";
|
|
460
|
+
};
|
|
461
|
+
headers: Headers;
|
|
462
|
+
} | {
|
|
463
|
+
status: 403;
|
|
464
|
+
body: {
|
|
465
|
+
code: "FORBIDDEN";
|
|
466
|
+
error: "Forbidden";
|
|
467
|
+
name: "APIError";
|
|
468
|
+
};
|
|
469
|
+
headers: Headers;
|
|
470
|
+
} | {
|
|
413
471
|
status: 200;
|
|
414
472
|
body: undefined;
|
|
415
473
|
headers: Headers;
|
|
@@ -445,14 +503,6 @@ export declare function createClient(origin: string): {
|
|
|
445
503
|
name: "APIError";
|
|
446
504
|
};
|
|
447
505
|
headers: Headers;
|
|
448
|
-
} | {
|
|
449
|
-
status: 500;
|
|
450
|
-
body: {
|
|
451
|
-
code: "INTERNAL_SERVER_ERROR";
|
|
452
|
-
error: string;
|
|
453
|
-
name: "APIError";
|
|
454
|
-
};
|
|
455
|
-
headers: Headers;
|
|
456
506
|
} | {
|
|
457
507
|
status: 404;
|
|
458
508
|
body: {
|
|
@@ -462,7 +512,7 @@ export declare function createClient(origin: string): {
|
|
|
462
512
|
};
|
|
463
513
|
headers: Headers;
|
|
464
514
|
} | {
|
|
465
|
-
status: 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 |
|
|
515
|
+
status: 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 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 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
466
516
|
body: unknown;
|
|
467
517
|
headers: Headers;
|
|
468
518
|
}>;
|
|
@@ -475,6 +525,30 @@ export declare function createClient(origin: string): {
|
|
|
475
525
|
fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
|
|
476
526
|
overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
|
|
477
527
|
}) => Promise<{
|
|
528
|
+
status: 500;
|
|
529
|
+
body: {
|
|
530
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
531
|
+
error: string;
|
|
532
|
+
name: "APIError";
|
|
533
|
+
};
|
|
534
|
+
headers: Headers;
|
|
535
|
+
} | {
|
|
536
|
+
status: 401;
|
|
537
|
+
body: {
|
|
538
|
+
code: "UNAUTHORIZED";
|
|
539
|
+
error: "Unauthorized";
|
|
540
|
+
name: "APIError";
|
|
541
|
+
};
|
|
542
|
+
headers: Headers;
|
|
543
|
+
} | {
|
|
544
|
+
status: 403;
|
|
545
|
+
body: {
|
|
546
|
+
code: "FORBIDDEN";
|
|
547
|
+
error: "Forbidden";
|
|
548
|
+
name: "APIError";
|
|
549
|
+
};
|
|
550
|
+
headers: Headers;
|
|
551
|
+
} | {
|
|
478
552
|
status: 200;
|
|
479
553
|
body: undefined;
|
|
480
554
|
headers: Headers;
|
|
@@ -510,14 +584,6 @@ export declare function createClient(origin: string): {
|
|
|
510
584
|
name: "APIError";
|
|
511
585
|
};
|
|
512
586
|
headers: Headers;
|
|
513
|
-
} | {
|
|
514
|
-
status: 500;
|
|
515
|
-
body: {
|
|
516
|
-
code: "INTERNAL_SERVER_ERROR";
|
|
517
|
-
error: string;
|
|
518
|
-
name: "APIError";
|
|
519
|
-
};
|
|
520
|
-
headers: Headers;
|
|
521
587
|
} | {
|
|
522
588
|
status: 404;
|
|
523
589
|
body: {
|
|
@@ -527,7 +593,7 @@ export declare function createClient(origin: string): {
|
|
|
527
593
|
};
|
|
528
594
|
headers: Headers;
|
|
529
595
|
} | {
|
|
530
|
-
status: 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 |
|
|
596
|
+
status: 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 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 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
531
597
|
body: unknown;
|
|
532
598
|
headers: Headers;
|
|
533
599
|
}>;
|
|
@@ -543,6 +609,30 @@ export declare function createClient(origin: string): {
|
|
|
543
609
|
fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
|
|
544
610
|
overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
|
|
545
611
|
}) => Promise<{
|
|
612
|
+
status: 500;
|
|
613
|
+
body: {
|
|
614
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
615
|
+
error: string;
|
|
616
|
+
name: "APIError";
|
|
617
|
+
};
|
|
618
|
+
headers: Headers;
|
|
619
|
+
} | {
|
|
620
|
+
status: 401;
|
|
621
|
+
body: {
|
|
622
|
+
code: "UNAUTHORIZED";
|
|
623
|
+
error: "Unauthorized";
|
|
624
|
+
name: "APIError";
|
|
625
|
+
};
|
|
626
|
+
headers: Headers;
|
|
627
|
+
} | {
|
|
628
|
+
status: 403;
|
|
629
|
+
body: {
|
|
630
|
+
code: "FORBIDDEN";
|
|
631
|
+
error: "Forbidden";
|
|
632
|
+
name: "APIError";
|
|
633
|
+
};
|
|
634
|
+
headers: Headers;
|
|
635
|
+
} | {
|
|
546
636
|
status: 200;
|
|
547
637
|
body: undefined;
|
|
548
638
|
headers: Headers;
|
|
@@ -578,14 +668,6 @@ export declare function createClient(origin: string): {
|
|
|
578
668
|
name: "APIError";
|
|
579
669
|
};
|
|
580
670
|
headers: Headers;
|
|
581
|
-
} | {
|
|
582
|
-
status: 500;
|
|
583
|
-
body: {
|
|
584
|
-
code: "INTERNAL_SERVER_ERROR";
|
|
585
|
-
error: string;
|
|
586
|
-
name: "APIError";
|
|
587
|
-
};
|
|
588
|
-
headers: Headers;
|
|
589
671
|
} | {
|
|
590
672
|
status: 404;
|
|
591
673
|
body: {
|
|
@@ -595,7 +677,7 @@ export declare function createClient(origin: string): {
|
|
|
595
677
|
};
|
|
596
678
|
headers: Headers;
|
|
597
679
|
} | {
|
|
598
|
-
status: 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 |
|
|
680
|
+
status: 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 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 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
599
681
|
body: unknown;
|
|
600
682
|
headers: Headers;
|
|
601
683
|
}>;
|
|
@@ -645,6 +727,30 @@ export declare function createClient(origin: string): {
|
|
|
645
727
|
fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
|
|
646
728
|
overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
|
|
647
729
|
}) => Promise<{
|
|
730
|
+
status: 500;
|
|
731
|
+
body: {
|
|
732
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
733
|
+
error: string;
|
|
734
|
+
name: "APIError";
|
|
735
|
+
};
|
|
736
|
+
headers: Headers;
|
|
737
|
+
} | {
|
|
738
|
+
status: 401;
|
|
739
|
+
body: {
|
|
740
|
+
code: "UNAUTHORIZED";
|
|
741
|
+
error: "Unauthorized";
|
|
742
|
+
name: "APIError";
|
|
743
|
+
};
|
|
744
|
+
headers: Headers;
|
|
745
|
+
} | {
|
|
746
|
+
status: 403;
|
|
747
|
+
body: {
|
|
748
|
+
code: "FORBIDDEN";
|
|
749
|
+
error: "Forbidden";
|
|
750
|
+
name: "APIError";
|
|
751
|
+
};
|
|
752
|
+
headers: Headers;
|
|
753
|
+
} | {
|
|
648
754
|
status: 200;
|
|
649
755
|
body: undefined;
|
|
650
756
|
headers: Headers;
|
|
@@ -684,14 +790,6 @@ export declare function createClient(origin: string): {
|
|
|
684
790
|
name: "APIError";
|
|
685
791
|
};
|
|
686
792
|
headers: Headers;
|
|
687
|
-
} | {
|
|
688
|
-
status: 500;
|
|
689
|
-
body: {
|
|
690
|
-
code: "INTERNAL_SERVER_ERROR";
|
|
691
|
-
error: string;
|
|
692
|
-
name: "APIError";
|
|
693
|
-
};
|
|
694
|
-
headers: Headers;
|
|
695
793
|
} | {
|
|
696
794
|
status: 404;
|
|
697
795
|
body: {
|
|
@@ -701,7 +799,7 @@ export declare function createClient(origin: string): {
|
|
|
701
799
|
};
|
|
702
800
|
headers: Headers;
|
|
703
801
|
} | {
|
|
704
|
-
status: 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 |
|
|
802
|
+
status: 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 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 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
705
803
|
body: unknown;
|
|
706
804
|
headers: Headers;
|
|
707
805
|
}>;
|
|
@@ -714,6 +812,14 @@ export declare function createClient(origin: string): {
|
|
|
714
812
|
fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
|
|
715
813
|
overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
|
|
716
814
|
}) => Promise<{
|
|
815
|
+
status: 500;
|
|
816
|
+
body: {
|
|
817
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
818
|
+
error: string;
|
|
819
|
+
name: "APIError";
|
|
820
|
+
};
|
|
821
|
+
headers: Headers;
|
|
822
|
+
} | {
|
|
717
823
|
status: 200;
|
|
718
824
|
body: any;
|
|
719
825
|
headers: Headers;
|
|
@@ -725,14 +831,6 @@ export declare function createClient(origin: string): {
|
|
|
725
831
|
name: "APIError";
|
|
726
832
|
};
|
|
727
833
|
headers: Headers;
|
|
728
|
-
} | {
|
|
729
|
-
status: 500;
|
|
730
|
-
body: {
|
|
731
|
-
code: "INTERNAL_SERVER_ERROR";
|
|
732
|
-
error: string;
|
|
733
|
-
name: "APIError";
|
|
734
|
-
};
|
|
735
|
-
headers: Headers;
|
|
736
834
|
} | {
|
|
737
835
|
status: 404;
|
|
738
836
|
body: {
|
|
@@ -742,7 +840,7 @@ export declare function createClient(origin: string): {
|
|
|
742
840
|
};
|
|
743
841
|
headers: Headers;
|
|
744
842
|
} | {
|
|
745
|
-
status: 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 |
|
|
843
|
+
status: 401 | 403 | 100 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 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 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
746
844
|
body: unknown;
|
|
747
845
|
headers: Headers;
|
|
748
846
|
}>;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
list: {
|
|
4
|
+
description: "Tracks the logged in user started recently, last played first";
|
|
5
|
+
method: "GET";
|
|
6
|
+
path: "/history";
|
|
7
|
+
responses: {
|
|
8
|
+
500: z.ZodObject<{
|
|
9
|
+
code: z.ZodType<"INTERNAL_SERVER_ERROR", z.ZodTypeDef, "INTERNAL_SERVER_ERROR">;
|
|
10
|
+
error: z.ZodType<string, z.ZodTypeDef, string>;
|
|
11
|
+
name: z.ZodLiteral<"APIError">;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
14
|
+
error: string;
|
|
15
|
+
name: "APIError";
|
|
16
|
+
}, {
|
|
17
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
18
|
+
error: string;
|
|
19
|
+
name: "APIError";
|
|
20
|
+
}>;
|
|
21
|
+
401: z.ZodObject<{
|
|
22
|
+
code: z.ZodType<"UNAUTHORIZED", z.ZodTypeDef, "UNAUTHORIZED">;
|
|
23
|
+
error: z.ZodType<"Unauthorized", z.ZodTypeDef, "Unauthorized">;
|
|
24
|
+
name: z.ZodLiteral<"APIError">;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
code: "UNAUTHORIZED";
|
|
27
|
+
error: "Unauthorized";
|
|
28
|
+
name: "APIError";
|
|
29
|
+
}, {
|
|
30
|
+
code: "UNAUTHORIZED";
|
|
31
|
+
error: "Unauthorized";
|
|
32
|
+
name: "APIError";
|
|
33
|
+
}>;
|
|
34
|
+
403: z.ZodObject<{
|
|
35
|
+
code: z.ZodType<"FORBIDDEN", z.ZodTypeDef, "FORBIDDEN">;
|
|
36
|
+
error: z.ZodType<"Forbidden", z.ZodTypeDef, "Forbidden">;
|
|
37
|
+
name: z.ZodLiteral<"APIError">;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
code: "FORBIDDEN";
|
|
40
|
+
error: "Forbidden";
|
|
41
|
+
name: "APIError";
|
|
42
|
+
}, {
|
|
43
|
+
code: "FORBIDDEN";
|
|
44
|
+
error: "Forbidden";
|
|
45
|
+
name: "APIError";
|
|
46
|
+
}>;
|
|
47
|
+
200: z.ZodObject<{
|
|
48
|
+
tracks: z.ZodArray<z.ZodObject<{
|
|
49
|
+
videoId: z.ZodString;
|
|
50
|
+
title: z.ZodString;
|
|
51
|
+
channel: z.ZodNullable<z.ZodString>;
|
|
52
|
+
duration: z.ZodNullable<z.ZodNumber>;
|
|
53
|
+
thumbnail: z.ZodNullable<z.ZodString>;
|
|
54
|
+
blocked: z.ZodNullable<z.ZodEnum<["live", "too_long"]>>;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
videoId: string;
|
|
57
|
+
title: string;
|
|
58
|
+
channel: string | null;
|
|
59
|
+
duration: number | null;
|
|
60
|
+
thumbnail: string | null;
|
|
61
|
+
blocked: "live" | "too_long" | null;
|
|
62
|
+
}, {
|
|
63
|
+
videoId: string;
|
|
64
|
+
title: string;
|
|
65
|
+
channel: string | null;
|
|
66
|
+
duration: number | null;
|
|
67
|
+
thumbnail: string | null;
|
|
68
|
+
blocked: "live" | "too_long" | null;
|
|
69
|
+
}>, "many">;
|
|
70
|
+
}, "strip", z.ZodTypeAny, {
|
|
71
|
+
tracks: {
|
|
72
|
+
videoId: string;
|
|
73
|
+
title: string;
|
|
74
|
+
channel: string | null;
|
|
75
|
+
duration: number | null;
|
|
76
|
+
thumbnail: string | null;
|
|
77
|
+
blocked: "live" | "too_long" | null;
|
|
78
|
+
}[];
|
|
79
|
+
}, {
|
|
80
|
+
tracks: {
|
|
81
|
+
videoId: string;
|
|
82
|
+
title: string;
|
|
83
|
+
channel: string | null;
|
|
84
|
+
duration: number | null;
|
|
85
|
+
thumbnail: string | null;
|
|
86
|
+
blocked: "live" | "too_long" | null;
|
|
87
|
+
}[];
|
|
88
|
+
}>;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
export default _default;
|