@darco2903/altv-web-api 2.1.0 → 2.2.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 CHANGED
@@ -823,6 +823,168 @@ export declare function createClient(origin: string): {
823
823
  body: unknown;
824
824
  headers: Headers;
825
825
  }>;
826
+ queuePlaylist: (args: {
827
+ params: {
828
+ roomId: string;
829
+ };
830
+ body: {
831
+ playlistId: string;
832
+ videoId?: string | undefined;
833
+ };
834
+ cache?: RequestCache | undefined;
835
+ extraHeaders?: Record<string, string | undefined> | undefined;
836
+ fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
837
+ overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
838
+ }) => Promise<{
839
+ status: 500;
840
+ body: {
841
+ code: "INTERNAL_SERVER_ERROR";
842
+ error: string;
843
+ name: "APIError";
844
+ };
845
+ headers: Headers;
846
+ } | {
847
+ status: 401;
848
+ body: {
849
+ code: "UNAUTHORIZED";
850
+ error: "Unauthorized";
851
+ name: "APIError";
852
+ };
853
+ headers: Headers;
854
+ } | {
855
+ status: 403;
856
+ body: {
857
+ code: "FORBIDDEN";
858
+ error: "Forbidden";
859
+ name: "APIError";
860
+ };
861
+ headers: Headers;
862
+ } | {
863
+ status: 200;
864
+ body: {
865
+ added: number;
866
+ skipped: number;
867
+ total: number;
868
+ };
869
+ headers: Headers;
870
+ } | {
871
+ status: 400;
872
+ body: {
873
+ code: "INVALID_VIDEO_ID";
874
+ error: "The provided video ID is invalid";
875
+ name: "APIError";
876
+ } | {
877
+ name: "ZodError";
878
+ issues: import("zod").objectOutputType<{
879
+ path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
880
+ message: import("zod").ZodOptional<import("zod").ZodString>;
881
+ code: import("zod").ZodNativeEnum<{
882
+ invalid_type: "invalid_type";
883
+ invalid_literal: "invalid_literal";
884
+ custom: "custom";
885
+ invalid_union: "invalid_union";
886
+ invalid_union_discriminator: "invalid_union_discriminator";
887
+ invalid_enum_value: "invalid_enum_value";
888
+ unrecognized_keys: "unrecognized_keys";
889
+ invalid_arguments: "invalid_arguments";
890
+ invalid_return_type: "invalid_return_type";
891
+ invalid_date: "invalid_date";
892
+ invalid_string: "invalid_string";
893
+ too_small: "too_small";
894
+ too_big: "too_big";
895
+ invalid_intersection_types: "invalid_intersection_types";
896
+ not_multiple_of: "not_multiple_of";
897
+ not_finite: "not_finite";
898
+ }>;
899
+ }, import("zod").ZodAny, "strip">[];
900
+ } | {
901
+ code: "INVALID_PLAYLIST_ID";
902
+ error: "The provided playlist ID is invalid";
903
+ name: "APIError";
904
+ };
905
+ headers: Headers;
906
+ } | {
907
+ status: 404;
908
+ body: {
909
+ code: "ROOM_NOT_FOUND";
910
+ error: "The requested room was not found";
911
+ name: "APIError";
912
+ } | {
913
+ code: "PLAYLIST_UNAVAILABLE";
914
+ error: "This playlist can't be read, it may be private";
915
+ name: "APIError";
916
+ };
917
+ headers: Headers;
918
+ } | {
919
+ status: 409;
920
+ body: {
921
+ code: "QUEUE_FULL";
922
+ error: "The queue of this room is full";
923
+ name: "APIError";
924
+ };
925
+ headers: Headers;
926
+ } | {
927
+ status: 429;
928
+ body: {
929
+ code: "TOO_MANY_SEARCHES";
930
+ error: "Too many searches are running";
931
+ name: "APIError";
932
+ };
933
+ headers: Headers;
934
+ } | {
935
+ status: 100 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 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 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
936
+ body: unknown;
937
+ headers: Headers;
938
+ }>;
939
+ queueClear: (args: {
940
+ params: {
941
+ roomId: string;
942
+ };
943
+ cache?: RequestCache | undefined;
944
+ extraHeaders?: Record<string, string | undefined> | undefined;
945
+ fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
946
+ overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
947
+ }) => Promise<{
948
+ status: 500;
949
+ body: {
950
+ code: "INTERNAL_SERVER_ERROR";
951
+ error: string;
952
+ name: "APIError";
953
+ };
954
+ headers: Headers;
955
+ } | {
956
+ status: 401;
957
+ body: {
958
+ code: "UNAUTHORIZED";
959
+ error: "Unauthorized";
960
+ name: "APIError";
961
+ };
962
+ headers: Headers;
963
+ } | {
964
+ status: 403;
965
+ body: {
966
+ code: "FORBIDDEN";
967
+ error: "Forbidden";
968
+ name: "APIError";
969
+ };
970
+ headers: Headers;
971
+ } | {
972
+ status: 200;
973
+ body: undefined;
974
+ headers: Headers;
975
+ } | {
976
+ status: 404;
977
+ body: {
978
+ code: "ROOM_NOT_FOUND";
979
+ error: "The requested room was not found";
980
+ name: "APIError";
981
+ };
982
+ headers: Headers;
983
+ } | {
984
+ status: 400 | 100 | 409 | 429 | 101 | 102 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 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 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
985
+ body: unknown;
986
+ headers: Headers;
987
+ }>;
826
988
  queueRemove: (args: {
827
989
  params: {
828
990
  roomId: string;
@@ -1870,6 +1870,326 @@ declare const _default: {
1870
1870
  }>]>;
1871
1871
  };
1872
1872
  };
1873
+ queuePlaylist: {
1874
+ description: "Add a YouTube playlist to the queue of a room, as many tracks as fit. It plays right away if the room has nothing to play. A Mix only exists around a video, it needs videoId";
1875
+ method: "POST";
1876
+ body: import("zod").ZodObject<{
1877
+ playlistId: import("zod").ZodString;
1878
+ videoId: import("zod").ZodOptional<import("zod").ZodString>;
1879
+ }, "strip", import("zod").ZodTypeAny, {
1880
+ playlistId: string;
1881
+ videoId?: string | undefined;
1882
+ }, {
1883
+ playlistId: string;
1884
+ videoId?: string | undefined;
1885
+ }>;
1886
+ path: "/api/v2/room/:roomId/queue/playlist";
1887
+ responses: {
1888
+ 500: import("zod").ZodObject<{
1889
+ code: import("zod").ZodType<"INTERNAL_SERVER_ERROR", import("zod").ZodTypeDef, "INTERNAL_SERVER_ERROR">;
1890
+ error: import("zod").ZodType<string, import("zod").ZodTypeDef, string>;
1891
+ name: import("zod").ZodLiteral<"APIError">;
1892
+ }, "strip", import("zod").ZodTypeAny, {
1893
+ code: "INTERNAL_SERVER_ERROR";
1894
+ error: string;
1895
+ name: "APIError";
1896
+ }, {
1897
+ code: "INTERNAL_SERVER_ERROR";
1898
+ error: string;
1899
+ name: "APIError";
1900
+ }>;
1901
+ 404: import("zod").ZodUnion<[import("zod").ZodObject<{
1902
+ code: import("zod").ZodType<"ROOM_NOT_FOUND", import("zod").ZodTypeDef, "ROOM_NOT_FOUND">;
1903
+ error: import("zod").ZodType<"The requested room was not found", import("zod").ZodTypeDef, "The requested room was not found">;
1904
+ name: import("zod").ZodLiteral<"APIError">;
1905
+ }, "strip", import("zod").ZodTypeAny, {
1906
+ code: "ROOM_NOT_FOUND";
1907
+ error: "The requested room was not found";
1908
+ name: "APIError";
1909
+ }, {
1910
+ code: "ROOM_NOT_FOUND";
1911
+ error: "The requested room was not found";
1912
+ name: "APIError";
1913
+ }>, import("zod").ZodObject<{
1914
+ code: import("zod").ZodType<"PLAYLIST_UNAVAILABLE", import("zod").ZodTypeDef, "PLAYLIST_UNAVAILABLE">;
1915
+ error: import("zod").ZodType<"This playlist can't be read, it may be private", import("zod").ZodTypeDef, "This playlist can't be read, it may be private">;
1916
+ name: import("zod").ZodLiteral<"APIError">;
1917
+ }, "strip", import("zod").ZodTypeAny, {
1918
+ code: "PLAYLIST_UNAVAILABLE";
1919
+ error: "This playlist can't be read, it may be private";
1920
+ name: "APIError";
1921
+ }, {
1922
+ code: "PLAYLIST_UNAVAILABLE";
1923
+ error: "This playlist can't be read, it may be private";
1924
+ name: "APIError";
1925
+ }>]>;
1926
+ 409: import("zod").ZodObject<{
1927
+ code: import("zod").ZodType<"QUEUE_FULL", import("zod").ZodTypeDef, "QUEUE_FULL">;
1928
+ error: import("zod").ZodType<"The queue of this room is full", import("zod").ZodTypeDef, "The queue of this room is full">;
1929
+ name: import("zod").ZodLiteral<"APIError">;
1930
+ }, "strip", import("zod").ZodTypeAny, {
1931
+ code: "QUEUE_FULL";
1932
+ error: "The queue of this room is full";
1933
+ name: "APIError";
1934
+ }, {
1935
+ code: "QUEUE_FULL";
1936
+ error: "The queue of this room is full";
1937
+ name: "APIError";
1938
+ }>;
1939
+ 429: import("zod").ZodObject<{
1940
+ code: import("zod").ZodType<"TOO_MANY_SEARCHES", import("zod").ZodTypeDef, "TOO_MANY_SEARCHES">;
1941
+ error: import("zod").ZodType<"Too many searches are running", import("zod").ZodTypeDef, "Too many searches are running">;
1942
+ name: import("zod").ZodLiteral<"APIError">;
1943
+ }, "strip", import("zod").ZodTypeAny, {
1944
+ code: "TOO_MANY_SEARCHES";
1945
+ error: "Too many searches are running";
1946
+ name: "APIError";
1947
+ }, {
1948
+ code: "TOO_MANY_SEARCHES";
1949
+ error: "Too many searches are running";
1950
+ name: "APIError";
1951
+ }>;
1952
+ 401: import("zod").ZodObject<{
1953
+ code: import("zod").ZodType<"UNAUTHORIZED", import("zod").ZodTypeDef, "UNAUTHORIZED">;
1954
+ error: import("zod").ZodType<"Unauthorized", import("zod").ZodTypeDef, "Unauthorized">;
1955
+ name: import("zod").ZodLiteral<"APIError">;
1956
+ }, "strip", import("zod").ZodTypeAny, {
1957
+ code: "UNAUTHORIZED";
1958
+ error: "Unauthorized";
1959
+ name: "APIError";
1960
+ }, {
1961
+ code: "UNAUTHORIZED";
1962
+ error: "Unauthorized";
1963
+ name: "APIError";
1964
+ }>;
1965
+ 403: import("zod").ZodObject<{
1966
+ code: import("zod").ZodType<"FORBIDDEN", import("zod").ZodTypeDef, "FORBIDDEN">;
1967
+ error: import("zod").ZodType<"Forbidden", import("zod").ZodTypeDef, "Forbidden">;
1968
+ name: import("zod").ZodLiteral<"APIError">;
1969
+ }, "strip", import("zod").ZodTypeAny, {
1970
+ code: "FORBIDDEN";
1971
+ error: "Forbidden";
1972
+ name: "APIError";
1973
+ }, {
1974
+ code: "FORBIDDEN";
1975
+ error: "Forbidden";
1976
+ name: "APIError";
1977
+ }>;
1978
+ 200: import("zod").ZodObject<{
1979
+ added: import("zod").ZodNumber;
1980
+ skipped: import("zod").ZodNumber;
1981
+ total: import("zod").ZodNumber;
1982
+ }, "strip", import("zod").ZodTypeAny, {
1983
+ added: number;
1984
+ skipped: number;
1985
+ total: number;
1986
+ }, {
1987
+ added: number;
1988
+ skipped: number;
1989
+ total: number;
1990
+ }>;
1991
+ 400: import("zod").ZodUnion<[import("zod").ZodObject<{
1992
+ name: import("zod").ZodLiteral<"ZodError">;
1993
+ issues: import("zod").ZodArray<import("zod").ZodObject<{
1994
+ path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
1995
+ message: import("zod").ZodOptional<import("zod").ZodString>;
1996
+ code: import("zod").ZodNativeEnum<{
1997
+ invalid_type: "invalid_type";
1998
+ invalid_literal: "invalid_literal";
1999
+ custom: "custom";
2000
+ invalid_union: "invalid_union";
2001
+ invalid_union_discriminator: "invalid_union_discriminator";
2002
+ invalid_enum_value: "invalid_enum_value";
2003
+ unrecognized_keys: "unrecognized_keys";
2004
+ invalid_arguments: "invalid_arguments";
2005
+ invalid_return_type: "invalid_return_type";
2006
+ invalid_date: "invalid_date";
2007
+ invalid_string: "invalid_string";
2008
+ too_small: "too_small";
2009
+ too_big: "too_big";
2010
+ invalid_intersection_types: "invalid_intersection_types";
2011
+ not_multiple_of: "not_multiple_of";
2012
+ not_finite: "not_finite";
2013
+ }>;
2014
+ }, "strip", import("zod").ZodAny, import("zod").objectOutputType<{
2015
+ path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
2016
+ message: import("zod").ZodOptional<import("zod").ZodString>;
2017
+ code: import("zod").ZodNativeEnum<{
2018
+ invalid_type: "invalid_type";
2019
+ invalid_literal: "invalid_literal";
2020
+ custom: "custom";
2021
+ invalid_union: "invalid_union";
2022
+ invalid_union_discriminator: "invalid_union_discriminator";
2023
+ invalid_enum_value: "invalid_enum_value";
2024
+ unrecognized_keys: "unrecognized_keys";
2025
+ invalid_arguments: "invalid_arguments";
2026
+ invalid_return_type: "invalid_return_type";
2027
+ invalid_date: "invalid_date";
2028
+ invalid_string: "invalid_string";
2029
+ too_small: "too_small";
2030
+ too_big: "too_big";
2031
+ invalid_intersection_types: "invalid_intersection_types";
2032
+ not_multiple_of: "not_multiple_of";
2033
+ not_finite: "not_finite";
2034
+ }>;
2035
+ }, import("zod").ZodAny, "strip">, import("zod").objectInputType<{
2036
+ path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
2037
+ message: import("zod").ZodOptional<import("zod").ZodString>;
2038
+ code: import("zod").ZodNativeEnum<{
2039
+ invalid_type: "invalid_type";
2040
+ invalid_literal: "invalid_literal";
2041
+ custom: "custom";
2042
+ invalid_union: "invalid_union";
2043
+ invalid_union_discriminator: "invalid_union_discriminator";
2044
+ invalid_enum_value: "invalid_enum_value";
2045
+ unrecognized_keys: "unrecognized_keys";
2046
+ invalid_arguments: "invalid_arguments";
2047
+ invalid_return_type: "invalid_return_type";
2048
+ invalid_date: "invalid_date";
2049
+ invalid_string: "invalid_string";
2050
+ too_small: "too_small";
2051
+ too_big: "too_big";
2052
+ invalid_intersection_types: "invalid_intersection_types";
2053
+ not_multiple_of: "not_multiple_of";
2054
+ not_finite: "not_finite";
2055
+ }>;
2056
+ }, import("zod").ZodAny, "strip">>, "many">;
2057
+ }, "strip", import("zod").ZodTypeAny, {
2058
+ name: "ZodError";
2059
+ issues: import("zod").objectOutputType<{
2060
+ path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
2061
+ message: import("zod").ZodOptional<import("zod").ZodString>;
2062
+ code: import("zod").ZodNativeEnum<{
2063
+ invalid_type: "invalid_type";
2064
+ invalid_literal: "invalid_literal";
2065
+ custom: "custom";
2066
+ invalid_union: "invalid_union";
2067
+ invalid_union_discriminator: "invalid_union_discriminator";
2068
+ invalid_enum_value: "invalid_enum_value";
2069
+ unrecognized_keys: "unrecognized_keys";
2070
+ invalid_arguments: "invalid_arguments";
2071
+ invalid_return_type: "invalid_return_type";
2072
+ invalid_date: "invalid_date";
2073
+ invalid_string: "invalid_string";
2074
+ too_small: "too_small";
2075
+ too_big: "too_big";
2076
+ invalid_intersection_types: "invalid_intersection_types";
2077
+ not_multiple_of: "not_multiple_of";
2078
+ not_finite: "not_finite";
2079
+ }>;
2080
+ }, import("zod").ZodAny, "strip">[];
2081
+ }, {
2082
+ name: "ZodError";
2083
+ issues: import("zod").objectInputType<{
2084
+ path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
2085
+ message: import("zod").ZodOptional<import("zod").ZodString>;
2086
+ code: import("zod").ZodNativeEnum<{
2087
+ invalid_type: "invalid_type";
2088
+ invalid_literal: "invalid_literal";
2089
+ custom: "custom";
2090
+ invalid_union: "invalid_union";
2091
+ invalid_union_discriminator: "invalid_union_discriminator";
2092
+ invalid_enum_value: "invalid_enum_value";
2093
+ unrecognized_keys: "unrecognized_keys";
2094
+ invalid_arguments: "invalid_arguments";
2095
+ invalid_return_type: "invalid_return_type";
2096
+ invalid_date: "invalid_date";
2097
+ invalid_string: "invalid_string";
2098
+ too_small: "too_small";
2099
+ too_big: "too_big";
2100
+ invalid_intersection_types: "invalid_intersection_types";
2101
+ not_multiple_of: "not_multiple_of";
2102
+ not_finite: "not_finite";
2103
+ }>;
2104
+ }, import("zod").ZodAny, "strip">[];
2105
+ }>, import("zod").ZodObject<{
2106
+ code: import("zod").ZodType<"INVALID_VIDEO_ID", import("zod").ZodTypeDef, "INVALID_VIDEO_ID">;
2107
+ error: import("zod").ZodType<"The provided video ID is invalid", import("zod").ZodTypeDef, "The provided video ID is invalid">;
2108
+ name: import("zod").ZodLiteral<"APIError">;
2109
+ }, "strip", import("zod").ZodTypeAny, {
2110
+ code: "INVALID_VIDEO_ID";
2111
+ error: "The provided video ID is invalid";
2112
+ name: "APIError";
2113
+ }, {
2114
+ code: "INVALID_VIDEO_ID";
2115
+ error: "The provided video ID is invalid";
2116
+ name: "APIError";
2117
+ }>, import("zod").ZodObject<{
2118
+ code: import("zod").ZodType<"INVALID_PLAYLIST_ID", import("zod").ZodTypeDef, "INVALID_PLAYLIST_ID">;
2119
+ error: import("zod").ZodType<"The provided playlist ID is invalid", import("zod").ZodTypeDef, "The provided playlist ID is invalid">;
2120
+ name: import("zod").ZodLiteral<"APIError">;
2121
+ }, "strip", import("zod").ZodTypeAny, {
2122
+ code: "INVALID_PLAYLIST_ID";
2123
+ error: "The provided playlist ID is invalid";
2124
+ name: "APIError";
2125
+ }, {
2126
+ code: "INVALID_PLAYLIST_ID";
2127
+ error: "The provided playlist ID is invalid";
2128
+ name: "APIError";
2129
+ }>]>;
2130
+ };
2131
+ };
2132
+ queueClear: {
2133
+ description: "Remove every track from the queue of a room";
2134
+ method: "DELETE";
2135
+ body: import("zod").ZodUndefined;
2136
+ path: "/api/v2/room/:roomId/queue";
2137
+ responses: {
2138
+ 500: import("zod").ZodObject<{
2139
+ code: import("zod").ZodType<"INTERNAL_SERVER_ERROR", import("zod").ZodTypeDef, "INTERNAL_SERVER_ERROR">;
2140
+ error: import("zod").ZodType<string, import("zod").ZodTypeDef, string>;
2141
+ name: import("zod").ZodLiteral<"APIError">;
2142
+ }, "strip", import("zod").ZodTypeAny, {
2143
+ code: "INTERNAL_SERVER_ERROR";
2144
+ error: string;
2145
+ name: "APIError";
2146
+ }, {
2147
+ code: "INTERNAL_SERVER_ERROR";
2148
+ error: string;
2149
+ name: "APIError";
2150
+ }>;
2151
+ 404: import("zod").ZodObject<{
2152
+ code: import("zod").ZodType<"ROOM_NOT_FOUND", import("zod").ZodTypeDef, "ROOM_NOT_FOUND">;
2153
+ error: import("zod").ZodType<"The requested room was not found", import("zod").ZodTypeDef, "The requested room was not found">;
2154
+ name: import("zod").ZodLiteral<"APIError">;
2155
+ }, "strip", import("zod").ZodTypeAny, {
2156
+ code: "ROOM_NOT_FOUND";
2157
+ error: "The requested room was not found";
2158
+ name: "APIError";
2159
+ }, {
2160
+ code: "ROOM_NOT_FOUND";
2161
+ error: "The requested room was not found";
2162
+ name: "APIError";
2163
+ }>;
2164
+ 401: import("zod").ZodObject<{
2165
+ code: import("zod").ZodType<"UNAUTHORIZED", import("zod").ZodTypeDef, "UNAUTHORIZED">;
2166
+ error: import("zod").ZodType<"Unauthorized", import("zod").ZodTypeDef, "Unauthorized">;
2167
+ name: import("zod").ZodLiteral<"APIError">;
2168
+ }, "strip", import("zod").ZodTypeAny, {
2169
+ code: "UNAUTHORIZED";
2170
+ error: "Unauthorized";
2171
+ name: "APIError";
2172
+ }, {
2173
+ code: "UNAUTHORIZED";
2174
+ error: "Unauthorized";
2175
+ name: "APIError";
2176
+ }>;
2177
+ 403: import("zod").ZodObject<{
2178
+ code: import("zod").ZodType<"FORBIDDEN", import("zod").ZodTypeDef, "FORBIDDEN">;
2179
+ error: import("zod").ZodType<"Forbidden", import("zod").ZodTypeDef, "Forbidden">;
2180
+ name: import("zod").ZodLiteral<"APIError">;
2181
+ }, "strip", import("zod").ZodTypeAny, {
2182
+ code: "FORBIDDEN";
2183
+ error: "Forbidden";
2184
+ name: "APIError";
2185
+ }, {
2186
+ code: "FORBIDDEN";
2187
+ error: "Forbidden";
2188
+ name: "APIError";
2189
+ }>;
2190
+ 200: typeof import("@ts-rest/core").ContractNoBody;
2191
+ };
2192
+ };
1873
2193
  queueRemove: {
1874
2194
  description: "Remove a track from the queue of a room";
1875
2195
  method: "DELETE";
@@ -1178,6 +1178,328 @@ declare const _default: {
1178
1178
  }>]>;
1179
1179
  };
1180
1180
  };
1181
+ queuePlaylist: {
1182
+ description: "Add a YouTube playlist to the queue of a room, as many tracks as fit. It plays right away if the room has nothing to play. A Mix only exists around a video, it needs videoId";
1183
+ method: "POST";
1184
+ body: z.ZodObject<{
1185
+ playlistId: z.ZodString;
1186
+ videoId: z.ZodOptional<z.ZodString>;
1187
+ }, "strip", z.ZodTypeAny, {
1188
+ playlistId: string;
1189
+ videoId?: string | undefined;
1190
+ }, {
1191
+ playlistId: string;
1192
+ videoId?: string | undefined;
1193
+ }>;
1194
+ path: "/room/:roomId/queue/playlist";
1195
+ responses: {
1196
+ 500: z.ZodObject<{
1197
+ code: z.ZodType<"INTERNAL_SERVER_ERROR", z.ZodTypeDef, "INTERNAL_SERVER_ERROR">;
1198
+ error: z.ZodType<string, z.ZodTypeDef, string>;
1199
+ name: z.ZodLiteral<"APIError">;
1200
+ }, "strip", z.ZodTypeAny, {
1201
+ code: "INTERNAL_SERVER_ERROR";
1202
+ error: string;
1203
+ name: "APIError";
1204
+ }, {
1205
+ code: "INTERNAL_SERVER_ERROR";
1206
+ error: string;
1207
+ name: "APIError";
1208
+ }>;
1209
+ 404: z.ZodUnion<[z.ZodObject<{
1210
+ code: z.ZodType<"ROOM_NOT_FOUND", z.ZodTypeDef, "ROOM_NOT_FOUND">;
1211
+ error: z.ZodType<"The requested room was not found", z.ZodTypeDef, "The requested room was not found">;
1212
+ name: z.ZodLiteral<"APIError">;
1213
+ }, "strip", z.ZodTypeAny, {
1214
+ code: "ROOM_NOT_FOUND";
1215
+ error: "The requested room was not found";
1216
+ name: "APIError";
1217
+ }, {
1218
+ code: "ROOM_NOT_FOUND";
1219
+ error: "The requested room was not found";
1220
+ name: "APIError";
1221
+ }>, z.ZodObject<{
1222
+ code: z.ZodType<"PLAYLIST_UNAVAILABLE", z.ZodTypeDef, "PLAYLIST_UNAVAILABLE">;
1223
+ error: z.ZodType<"This playlist can't be read, it may be private", z.ZodTypeDef, "This playlist can't be read, it may be private">;
1224
+ name: z.ZodLiteral<"APIError">;
1225
+ }, "strip", z.ZodTypeAny, {
1226
+ code: "PLAYLIST_UNAVAILABLE";
1227
+ error: "This playlist can't be read, it may be private";
1228
+ name: "APIError";
1229
+ }, {
1230
+ code: "PLAYLIST_UNAVAILABLE";
1231
+ error: "This playlist can't be read, it may be private";
1232
+ name: "APIError";
1233
+ }>]>;
1234
+ 409: z.ZodObject<{
1235
+ code: z.ZodType<"QUEUE_FULL", z.ZodTypeDef, "QUEUE_FULL">;
1236
+ error: z.ZodType<"The queue of this room is full", z.ZodTypeDef, "The queue of this room is full">;
1237
+ name: z.ZodLiteral<"APIError">;
1238
+ }, "strip", z.ZodTypeAny, {
1239
+ code: "QUEUE_FULL";
1240
+ error: "The queue of this room is full";
1241
+ name: "APIError";
1242
+ }, {
1243
+ code: "QUEUE_FULL";
1244
+ error: "The queue of this room is full";
1245
+ name: "APIError";
1246
+ }>;
1247
+ 429: z.ZodObject<{
1248
+ code: z.ZodType<"TOO_MANY_SEARCHES", z.ZodTypeDef, "TOO_MANY_SEARCHES">;
1249
+ error: z.ZodType<"Too many searches are running", z.ZodTypeDef, "Too many searches are running">;
1250
+ name: z.ZodLiteral<"APIError">;
1251
+ }, "strip", z.ZodTypeAny, {
1252
+ code: "TOO_MANY_SEARCHES";
1253
+ error: "Too many searches are running";
1254
+ name: "APIError";
1255
+ }, {
1256
+ code: "TOO_MANY_SEARCHES";
1257
+ error: "Too many searches are running";
1258
+ name: "APIError";
1259
+ }>;
1260
+ 401: z.ZodObject<{
1261
+ code: z.ZodType<"UNAUTHORIZED", z.ZodTypeDef, "UNAUTHORIZED">;
1262
+ error: z.ZodType<"Unauthorized", z.ZodTypeDef, "Unauthorized">;
1263
+ name: z.ZodLiteral<"APIError">;
1264
+ }, "strip", z.ZodTypeAny, {
1265
+ code: "UNAUTHORIZED";
1266
+ error: "Unauthorized";
1267
+ name: "APIError";
1268
+ }, {
1269
+ code: "UNAUTHORIZED";
1270
+ error: "Unauthorized";
1271
+ name: "APIError";
1272
+ }>;
1273
+ 403: z.ZodObject<{
1274
+ code: z.ZodType<"FORBIDDEN", z.ZodTypeDef, "FORBIDDEN">;
1275
+ error: z.ZodType<"Forbidden", z.ZodTypeDef, "Forbidden">;
1276
+ name: z.ZodLiteral<"APIError">;
1277
+ }, "strip", z.ZodTypeAny, {
1278
+ code: "FORBIDDEN";
1279
+ error: "Forbidden";
1280
+ name: "APIError";
1281
+ }, {
1282
+ code: "FORBIDDEN";
1283
+ error: "Forbidden";
1284
+ name: "APIError";
1285
+ }>;
1286
+ 200: z.ZodObject<{
1287
+ added: z.ZodNumber;
1288
+ /** Can't be played: live, too long or without a duration */
1289
+ skipped: z.ZodNumber;
1290
+ /** Tracks of the playlist. A Mix has no end: added + skipped, it never looks cut */
1291
+ total: z.ZodNumber;
1292
+ }, "strip", z.ZodTypeAny, {
1293
+ added: number;
1294
+ skipped: number;
1295
+ total: number;
1296
+ }, {
1297
+ added: number;
1298
+ skipped: number;
1299
+ total: number;
1300
+ }>;
1301
+ 400: z.ZodUnion<[z.ZodObject<{
1302
+ name: z.ZodLiteral<"ZodError">;
1303
+ issues: z.ZodArray<z.ZodObject<{
1304
+ path: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">;
1305
+ message: z.ZodOptional<z.ZodString>;
1306
+ code: z.ZodNativeEnum<{
1307
+ invalid_type: "invalid_type";
1308
+ invalid_literal: "invalid_literal";
1309
+ custom: "custom";
1310
+ invalid_union: "invalid_union";
1311
+ invalid_union_discriminator: "invalid_union_discriminator";
1312
+ invalid_enum_value: "invalid_enum_value";
1313
+ unrecognized_keys: "unrecognized_keys";
1314
+ invalid_arguments: "invalid_arguments";
1315
+ invalid_return_type: "invalid_return_type";
1316
+ invalid_date: "invalid_date";
1317
+ invalid_string: "invalid_string";
1318
+ too_small: "too_small";
1319
+ too_big: "too_big";
1320
+ invalid_intersection_types: "invalid_intersection_types";
1321
+ not_multiple_of: "not_multiple_of";
1322
+ not_finite: "not_finite";
1323
+ }>;
1324
+ }, "strip", z.ZodAny, z.objectOutputType<{
1325
+ path: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">;
1326
+ message: z.ZodOptional<z.ZodString>;
1327
+ code: z.ZodNativeEnum<{
1328
+ invalid_type: "invalid_type";
1329
+ invalid_literal: "invalid_literal";
1330
+ custom: "custom";
1331
+ invalid_union: "invalid_union";
1332
+ invalid_union_discriminator: "invalid_union_discriminator";
1333
+ invalid_enum_value: "invalid_enum_value";
1334
+ unrecognized_keys: "unrecognized_keys";
1335
+ invalid_arguments: "invalid_arguments";
1336
+ invalid_return_type: "invalid_return_type";
1337
+ invalid_date: "invalid_date";
1338
+ invalid_string: "invalid_string";
1339
+ too_small: "too_small";
1340
+ too_big: "too_big";
1341
+ invalid_intersection_types: "invalid_intersection_types";
1342
+ not_multiple_of: "not_multiple_of";
1343
+ not_finite: "not_finite";
1344
+ }>;
1345
+ }, z.ZodAny, "strip">, z.objectInputType<{
1346
+ path: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">;
1347
+ message: z.ZodOptional<z.ZodString>;
1348
+ code: z.ZodNativeEnum<{
1349
+ invalid_type: "invalid_type";
1350
+ invalid_literal: "invalid_literal";
1351
+ custom: "custom";
1352
+ invalid_union: "invalid_union";
1353
+ invalid_union_discriminator: "invalid_union_discriminator";
1354
+ invalid_enum_value: "invalid_enum_value";
1355
+ unrecognized_keys: "unrecognized_keys";
1356
+ invalid_arguments: "invalid_arguments";
1357
+ invalid_return_type: "invalid_return_type";
1358
+ invalid_date: "invalid_date";
1359
+ invalid_string: "invalid_string";
1360
+ too_small: "too_small";
1361
+ too_big: "too_big";
1362
+ invalid_intersection_types: "invalid_intersection_types";
1363
+ not_multiple_of: "not_multiple_of";
1364
+ not_finite: "not_finite";
1365
+ }>;
1366
+ }, z.ZodAny, "strip">>, "many">;
1367
+ }, "strip", z.ZodTypeAny, {
1368
+ name: "ZodError";
1369
+ issues: z.objectOutputType<{
1370
+ path: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">;
1371
+ message: z.ZodOptional<z.ZodString>;
1372
+ code: z.ZodNativeEnum<{
1373
+ invalid_type: "invalid_type";
1374
+ invalid_literal: "invalid_literal";
1375
+ custom: "custom";
1376
+ invalid_union: "invalid_union";
1377
+ invalid_union_discriminator: "invalid_union_discriminator";
1378
+ invalid_enum_value: "invalid_enum_value";
1379
+ unrecognized_keys: "unrecognized_keys";
1380
+ invalid_arguments: "invalid_arguments";
1381
+ invalid_return_type: "invalid_return_type";
1382
+ invalid_date: "invalid_date";
1383
+ invalid_string: "invalid_string";
1384
+ too_small: "too_small";
1385
+ too_big: "too_big";
1386
+ invalid_intersection_types: "invalid_intersection_types";
1387
+ not_multiple_of: "not_multiple_of";
1388
+ not_finite: "not_finite";
1389
+ }>;
1390
+ }, z.ZodAny, "strip">[];
1391
+ }, {
1392
+ name: "ZodError";
1393
+ issues: z.objectInputType<{
1394
+ path: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">;
1395
+ message: z.ZodOptional<z.ZodString>;
1396
+ code: z.ZodNativeEnum<{
1397
+ invalid_type: "invalid_type";
1398
+ invalid_literal: "invalid_literal";
1399
+ custom: "custom";
1400
+ invalid_union: "invalid_union";
1401
+ invalid_union_discriminator: "invalid_union_discriminator";
1402
+ invalid_enum_value: "invalid_enum_value";
1403
+ unrecognized_keys: "unrecognized_keys";
1404
+ invalid_arguments: "invalid_arguments";
1405
+ invalid_return_type: "invalid_return_type";
1406
+ invalid_date: "invalid_date";
1407
+ invalid_string: "invalid_string";
1408
+ too_small: "too_small";
1409
+ too_big: "too_big";
1410
+ invalid_intersection_types: "invalid_intersection_types";
1411
+ not_multiple_of: "not_multiple_of";
1412
+ not_finite: "not_finite";
1413
+ }>;
1414
+ }, z.ZodAny, "strip">[];
1415
+ }>, z.ZodObject<{
1416
+ code: z.ZodType<"INVALID_VIDEO_ID", z.ZodTypeDef, "INVALID_VIDEO_ID">;
1417
+ error: z.ZodType<"The provided video ID is invalid", z.ZodTypeDef, "The provided video ID is invalid">;
1418
+ name: z.ZodLiteral<"APIError">;
1419
+ }, "strip", z.ZodTypeAny, {
1420
+ code: "INVALID_VIDEO_ID";
1421
+ error: "The provided video ID is invalid";
1422
+ name: "APIError";
1423
+ }, {
1424
+ code: "INVALID_VIDEO_ID";
1425
+ error: "The provided video ID is invalid";
1426
+ name: "APIError";
1427
+ }>, z.ZodObject<{
1428
+ code: z.ZodType<"INVALID_PLAYLIST_ID", z.ZodTypeDef, "INVALID_PLAYLIST_ID">;
1429
+ error: z.ZodType<"The provided playlist ID is invalid", z.ZodTypeDef, "The provided playlist ID is invalid">;
1430
+ name: z.ZodLiteral<"APIError">;
1431
+ }, "strip", z.ZodTypeAny, {
1432
+ code: "INVALID_PLAYLIST_ID";
1433
+ error: "The provided playlist ID is invalid";
1434
+ name: "APIError";
1435
+ }, {
1436
+ code: "INVALID_PLAYLIST_ID";
1437
+ error: "The provided playlist ID is invalid";
1438
+ name: "APIError";
1439
+ }>]>;
1440
+ };
1441
+ };
1442
+ queueClear: {
1443
+ description: "Remove every track from the queue of a room";
1444
+ method: "DELETE";
1445
+ body: z.ZodUndefined;
1446
+ path: "/room/:roomId/queue";
1447
+ responses: {
1448
+ 500: z.ZodObject<{
1449
+ code: z.ZodType<"INTERNAL_SERVER_ERROR", z.ZodTypeDef, "INTERNAL_SERVER_ERROR">;
1450
+ error: z.ZodType<string, z.ZodTypeDef, string>;
1451
+ name: z.ZodLiteral<"APIError">;
1452
+ }, "strip", z.ZodTypeAny, {
1453
+ code: "INTERNAL_SERVER_ERROR";
1454
+ error: string;
1455
+ name: "APIError";
1456
+ }, {
1457
+ code: "INTERNAL_SERVER_ERROR";
1458
+ error: string;
1459
+ name: "APIError";
1460
+ }>;
1461
+ 404: z.ZodObject<{
1462
+ code: z.ZodType<"ROOM_NOT_FOUND", z.ZodTypeDef, "ROOM_NOT_FOUND">;
1463
+ error: z.ZodType<"The requested room was not found", z.ZodTypeDef, "The requested room was not found">;
1464
+ name: z.ZodLiteral<"APIError">;
1465
+ }, "strip", z.ZodTypeAny, {
1466
+ code: "ROOM_NOT_FOUND";
1467
+ error: "The requested room was not found";
1468
+ name: "APIError";
1469
+ }, {
1470
+ code: "ROOM_NOT_FOUND";
1471
+ error: "The requested room was not found";
1472
+ name: "APIError";
1473
+ }>;
1474
+ 401: z.ZodObject<{
1475
+ code: z.ZodType<"UNAUTHORIZED", z.ZodTypeDef, "UNAUTHORIZED">;
1476
+ error: z.ZodType<"Unauthorized", z.ZodTypeDef, "Unauthorized">;
1477
+ name: z.ZodLiteral<"APIError">;
1478
+ }, "strip", z.ZodTypeAny, {
1479
+ code: "UNAUTHORIZED";
1480
+ error: "Unauthorized";
1481
+ name: "APIError";
1482
+ }, {
1483
+ code: "UNAUTHORIZED";
1484
+ error: "Unauthorized";
1485
+ name: "APIError";
1486
+ }>;
1487
+ 403: z.ZodObject<{
1488
+ code: z.ZodType<"FORBIDDEN", z.ZodTypeDef, "FORBIDDEN">;
1489
+ error: z.ZodType<"Forbidden", z.ZodTypeDef, "Forbidden">;
1490
+ name: z.ZodLiteral<"APIError">;
1491
+ }, "strip", z.ZodTypeAny, {
1492
+ code: "FORBIDDEN";
1493
+ error: "Forbidden";
1494
+ name: "APIError";
1495
+ }, {
1496
+ code: "FORBIDDEN";
1497
+ error: "Forbidden";
1498
+ name: "APIError";
1499
+ }>;
1500
+ 200: typeof import("@ts-rest/core").ContractNoBody;
1501
+ };
1502
+ };
1181
1503
  queueRemove: {
1182
1504
  description: "Remove a track from the queue of a room";
1183
1505
  method: "DELETE";
@@ -13,6 +13,7 @@ const internalError = {
13
13
  const noTrack = apiError(z.literal("NO_TRACK"), z.literal("The room has no track"));
14
14
  const queueItemNotFound = apiError(z.literal("QUEUE_ITEM_NOT_FOUND"), z.literal("The queue doesn't have this track"));
15
15
  const invalidVideoId = apiError(z.literal("INVALID_VIDEO_ID"), z.literal("The provided video ID is invalid"));
16
+ const queueFull = apiError(z.literal("QUEUE_FULL"), z.literal("The queue of this room is full"));
16
17
  export default c.router({
17
18
  create: {
18
19
  method: "POST",
@@ -107,7 +108,50 @@ export default c.router({
107
108
  400: z.union([ZodErrorSchema, invalidVideoId]),
108
109
  ...authResponses,
109
110
  ...notFound,
110
- 409: apiError(z.literal("QUEUE_FULL"), z.literal("The queue of this room is full")),
111
+ 409: queueFull,
112
+ ...internalError,
113
+ },
114
+ },
115
+ queuePlaylist: {
116
+ method: "POST",
117
+ path: "/room/:roomId/queue/playlist",
118
+ description: "Add a YouTube playlist to the queue of a room, as many tracks as fit. It plays right away if the room has nothing to play. A Mix only exists around a video, it needs videoId",
119
+ body: z.object({
120
+ playlistId: z.string(),
121
+ videoId: z.string().optional(),
122
+ }),
123
+ responses: {
124
+ 200: apiSuccess(z.object({
125
+ added: z.number(),
126
+ /** Can't be played: live, too long or without a duration */
127
+ skipped: z.number(),
128
+ /** Tracks of the playlist. A Mix has no end: added + skipped, it never looks cut */
129
+ total: z.number(),
130
+ })),
131
+ 400: z.union([
132
+ ZodErrorSchema,
133
+ invalidVideoId,
134
+ apiError(z.literal("INVALID_PLAYLIST_ID"), z.literal("The provided playlist ID is invalid")),
135
+ ]),
136
+ ...authResponses,
137
+ 404: z.union([
138
+ notFound[404],
139
+ apiError(z.literal("PLAYLIST_UNAVAILABLE"), z.literal("This playlist can't be read, it may be private")),
140
+ ]),
141
+ 409: queueFull,
142
+ 429: apiError(z.literal("TOO_MANY_SEARCHES"), z.literal("Too many searches are running")),
143
+ ...internalError,
144
+ },
145
+ },
146
+ queueClear: {
147
+ method: "DELETE",
148
+ path: "/room/:roomId/queue",
149
+ description: "Remove every track from the queue of a room",
150
+ body: z.undefined(),
151
+ responses: {
152
+ 200: c.noBody(),
153
+ ...authResponses,
154
+ ...notFound,
111
155
  ...internalError,
112
156
  },
113
157
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@darco2903/altv-web-api",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "keywords": [],