@darco2903/altv-web-api 1.2.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 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 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
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 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
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 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
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 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
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
  }>;
@@ -209,6 +334,26 @@ export declare function createClient(origin: string): {
209
334
  currentTime: number;
210
335
  url: string;
211
336
  paused: boolean;
337
+ scene: {
338
+ speakers: {
339
+ id: string;
340
+ x: number;
341
+ y: number;
342
+ z: number;
343
+ yaw: number;
344
+ pitch: number;
345
+ directional: boolean;
346
+ }[];
347
+ cars: {
348
+ id: string;
349
+ x: number;
350
+ z: number;
351
+ yaw: number;
352
+ doors: boolean[];
353
+ windows: boolean[];
354
+ radio: boolean;
355
+ }[];
356
+ };
212
357
  };
213
358
  headers: Headers;
214
359
  } | {
@@ -252,7 +397,7 @@ export declare function createClient(origin: string): {
252
397
  };
253
398
  headers: Headers;
254
399
  } | {
255
- 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 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
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;
256
401
  body: unknown;
257
402
  headers: Headers;
258
403
  }>;
@@ -317,7 +462,7 @@ export declare function createClient(origin: string): {
317
462
  };
318
463
  headers: Headers;
319
464
  } | {
320
- 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 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
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;
321
466
  body: unknown;
322
467
  headers: Headers;
323
468
  }>;
@@ -382,7 +527,7 @@ export declare function createClient(origin: string): {
382
527
  };
383
528
  headers: Headers;
384
529
  } | {
385
- 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 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
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;
386
531
  body: unknown;
387
532
  headers: Headers;
388
533
  }>;
@@ -450,7 +595,113 @@ export declare function createClient(origin: string): {
450
595
  };
451
596
  headers: Headers;
452
597
  } | {
453
- 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 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
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;
599
+ body: unknown;
600
+ headers: Headers;
601
+ }>;
602
+ scene: (args: {
603
+ params: {
604
+ streamId: string;
605
+ };
606
+ body: {
607
+ type: "addSpeaker";
608
+ speaker: {
609
+ x: number;
610
+ y: number;
611
+ z: number;
612
+ yaw: number;
613
+ pitch: number;
614
+ directional: boolean;
615
+ };
616
+ } | {
617
+ type: "addCar";
618
+ car: {
619
+ x: number;
620
+ z: number;
621
+ yaw: number;
622
+ };
623
+ } | {
624
+ type: "remove";
625
+ id: string;
626
+ } | {
627
+ type: "carDoor";
628
+ id: string;
629
+ index: number;
630
+ open: boolean;
631
+ } | {
632
+ type: "carWindow";
633
+ id: string;
634
+ index: number;
635
+ open: boolean;
636
+ } | {
637
+ type: "carRadio";
638
+ id: string;
639
+ on: boolean;
640
+ } | {
641
+ type: "reset";
642
+ };
643
+ cache?: RequestCache | undefined;
644
+ extraHeaders?: Record<string, string | undefined> | undefined;
645
+ fetchOptions?: import("@ts-rest/core").FetchOptions | undefined;
646
+ overrideClientOptions?: Partial<import("@ts-rest/core").OverrideableClientArgs> | undefined;
647
+ }) => Promise<{
648
+ status: 200;
649
+ body: undefined;
650
+ headers: Headers;
651
+ } | {
652
+ status: 400;
653
+ body: {
654
+ name: "ZodError";
655
+ issues: import("zod").objectOutputType<{
656
+ path: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">;
657
+ message: import("zod").ZodOptional<import("zod").ZodString>;
658
+ code: import("zod").ZodNativeEnum<{
659
+ invalid_type: "invalid_type";
660
+ invalid_literal: "invalid_literal";
661
+ custom: "custom";
662
+ invalid_union: "invalid_union";
663
+ invalid_union_discriminator: "invalid_union_discriminator";
664
+ invalid_enum_value: "invalid_enum_value";
665
+ unrecognized_keys: "unrecognized_keys";
666
+ invalid_arguments: "invalid_arguments";
667
+ invalid_return_type: "invalid_return_type";
668
+ invalid_date: "invalid_date";
669
+ invalid_string: "invalid_string";
670
+ too_small: "too_small";
671
+ too_big: "too_big";
672
+ invalid_intersection_types: "invalid_intersection_types";
673
+ not_multiple_of: "not_multiple_of";
674
+ not_finite: "not_finite";
675
+ }>;
676
+ }, import("zod").ZodAny, "strip">[];
677
+ } | {
678
+ code: "SCENE_FULL";
679
+ error: "The scene can't have more of this object";
680
+ name: "APIError";
681
+ } | {
682
+ code: "SCENE_OBJECT_NOT_FOUND";
683
+ error: "The scene object was not found";
684
+ name: "APIError";
685
+ };
686
+ headers: Headers;
687
+ } | {
688
+ status: 500;
689
+ body: {
690
+ code: "INTERNAL_SERVER_ERROR";
691
+ error: string;
692
+ name: "APIError";
693
+ };
694
+ headers: Headers;
695
+ } | {
696
+ status: 404;
697
+ body: {
698
+ code: "STREAM_NOT_FOUND";
699
+ error: "The requested stream was not found";
700
+ name: "APIError";
701
+ };
702
+ headers: Headers;
703
+ } | {
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;
454
705
  body: unknown;
455
706
  headers: Headers;
456
707
  }>;
@@ -491,7 +742,7 @@ export declare function createClient(origin: string): {
491
742
  };
492
743
  headers: Headers;
493
744
  } | {
494
- 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 | 429 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
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;
495
746
  body: unknown;
496
747
  headers: Headers;
497
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;