@darco2903/altv-web-api 1.5.0 → 2.0.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 +360 -114
- package/dist/contract/history.d.ts +92 -0
- package/dist/contract/history.js +19 -0
- package/dist/contract/index.d.ts +615 -299
- package/dist/contract/index.js +4 -0
- package/dist/contract/mediaStream.d.ts +1 -1398
- package/dist/contract/mediaStream.js +3 -116
- package/dist/contract/room.d.ts +1623 -0
- package/dist/contract/room.js +155 -0
- package/dist/contract/youtube.d.ts +4 -4
- package/dist/socket/index.d.ts +1 -1
- package/dist/socket/index.js +1 -1
- package/dist/socket/room.d.ts +28 -0
- package/dist/socket/types.d.ts +3 -3
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/room.d.ts +241 -0
- package/dist/types/room.js +36 -0
- package/dist/types/scene.d.ts +4 -4
- package/dist/types/scene.js +2 -2
- package/dist/types/youtube.d.ts +2 -2
- package/package.json +1 -1
- package/dist/socket/mediaStream.d.ts +0 -21
- /package/dist/socket/{mediaStream.js → room.js} +0 -0
|
@@ -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;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { initContract } from "@ts-rest/core";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { apiError, apiSuccess, authResponses } from "../types.js";
|
|
4
|
+
import { youTubeSearchResultSchema } from "../types/youtube.js";
|
|
5
|
+
const c = initContract();
|
|
6
|
+
export default c.router({
|
|
7
|
+
list: {
|
|
8
|
+
method: "GET",
|
|
9
|
+
path: "/history",
|
|
10
|
+
description: "Tracks the logged in user started recently, last played first",
|
|
11
|
+
responses: {
|
|
12
|
+
200: apiSuccess(z.object({
|
|
13
|
+
tracks: z.array(youTubeSearchResultSchema),
|
|
14
|
+
})),
|
|
15
|
+
...authResponses,
|
|
16
|
+
500: apiError(z.literal("INTERNAL_SERVER_ERROR"), z.string()),
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
});
|