@darco2903/altv-web-api 1.0.0-pre → 1.1.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/README.md
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Description
|
|
4
4
|
|
|
5
|
-
This API is a TypeScript client for the
|
|
5
|
+
This API is a TypeScript client for the AltV Web App.
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm install
|
|
10
|
+
npm install @darco2903/altv-web-api-<version>.tgz
|
|
11
11
|
npm install @ts-rest/core zod@3.22.3
|
|
12
12
|
```
|
|
13
13
|
|
|
@@ -17,7 +17,7 @@ Create an instance of the API
|
|
|
17
17
|
|
|
18
18
|
```ts
|
|
19
19
|
import { initClient } from "@ts-rest/core";
|
|
20
|
-
import { contract } from "
|
|
20
|
+
import { contract } from "@darco2903/altv-web-api";
|
|
21
21
|
|
|
22
22
|
const api = initClient(contract, {
|
|
23
23
|
baseUrl: "https://api.example.com",
|
package/dist/client.d.ts
CHANGED
package/dist/contract/index.d.ts
CHANGED
|
@@ -487,18 +487,21 @@ declare const _default: {
|
|
|
487
487
|
responses: {
|
|
488
488
|
200: import("zod").ZodObject<{
|
|
489
489
|
streamId: import("zod").ZodString;
|
|
490
|
+
title: import("zod").ZodString;
|
|
490
491
|
startTime: import("zod").ZodNumber;
|
|
491
492
|
duration: import("zod").ZodNumber;
|
|
492
493
|
url: import("zod").ZodString;
|
|
493
494
|
paused: import("zod").ZodBoolean;
|
|
494
495
|
}, "strip", import("zod").ZodTypeAny, {
|
|
495
496
|
streamId: string;
|
|
497
|
+
title: string;
|
|
496
498
|
startTime: number;
|
|
497
499
|
duration: number;
|
|
498
500
|
url: string;
|
|
499
501
|
paused: boolean;
|
|
500
502
|
}, {
|
|
501
503
|
streamId: string;
|
|
504
|
+
title: string;
|
|
502
505
|
startTime: number;
|
|
503
506
|
duration: number;
|
|
504
507
|
url: string;
|
|
@@ -652,7 +655,7 @@ declare const _default: {
|
|
|
652
655
|
body: import("zod").ZodUndefined;
|
|
653
656
|
path: "/api/v2/media-stream/play/:streamId";
|
|
654
657
|
responses: {
|
|
655
|
-
200: import("
|
|
658
|
+
200: typeof import("@ts-rest/core").ContractNoBody;
|
|
656
659
|
400: import("zod").ZodUnion<[import("zod").ZodObject<{
|
|
657
660
|
name: import("zod").ZodLiteral<"ZodError">;
|
|
658
661
|
issues: import("zod").ZodArray<import("zod").ZodObject<{
|
|
@@ -814,7 +817,7 @@ declare const _default: {
|
|
|
814
817
|
body: import("zod").ZodUndefined;
|
|
815
818
|
path: "/api/v2/media-stream/pause/:streamId";
|
|
816
819
|
responses: {
|
|
817
|
-
200: import("
|
|
820
|
+
200: typeof import("@ts-rest/core").ContractNoBody;
|
|
818
821
|
400: import("zod").ZodUnion<[import("zod").ZodObject<{
|
|
819
822
|
name: import("zod").ZodLiteral<"ZodError">;
|
|
820
823
|
issues: import("zod").ZodArray<import("zod").ZodObject<{
|
|
@@ -983,7 +986,7 @@ declare const _default: {
|
|
|
983
986
|
body: import("zod").ZodUndefined;
|
|
984
987
|
path: "/api/v2/media-stream/seek/:streamId";
|
|
985
988
|
responses: {
|
|
986
|
-
200: import("
|
|
989
|
+
200: typeof import("@ts-rest/core").ContractNoBody;
|
|
987
990
|
400: import("zod").ZodUnion<[import("zod").ZodObject<{
|
|
988
991
|
name: import("zod").ZodLiteral<"ZodError">;
|
|
989
992
|
issues: import("zod").ZodArray<import("zod").ZodObject<{
|
|
@@ -168,18 +168,22 @@ declare const _default: {
|
|
|
168
168
|
responses: {
|
|
169
169
|
200: z.ZodObject<{
|
|
170
170
|
streamId: z.ZodString;
|
|
171
|
+
title: z.ZodString;
|
|
171
172
|
startTime: z.ZodNumber;
|
|
173
|
+
/** seconds */
|
|
172
174
|
duration: z.ZodNumber;
|
|
173
175
|
url: z.ZodString;
|
|
174
176
|
paused: z.ZodBoolean;
|
|
175
177
|
}, "strip", z.ZodTypeAny, {
|
|
176
178
|
streamId: string;
|
|
179
|
+
title: string;
|
|
177
180
|
startTime: number;
|
|
178
181
|
duration: number;
|
|
179
182
|
url: string;
|
|
180
183
|
paused: boolean;
|
|
181
184
|
}, {
|
|
182
185
|
streamId: string;
|
|
186
|
+
title: string;
|
|
183
187
|
startTime: number;
|
|
184
188
|
duration: number;
|
|
185
189
|
url: string;
|
|
@@ -333,7 +337,7 @@ declare const _default: {
|
|
|
333
337
|
body: z.ZodUndefined;
|
|
334
338
|
path: "/media-stream/play/:streamId";
|
|
335
339
|
responses: {
|
|
336
|
-
200:
|
|
340
|
+
200: typeof import("@ts-rest/core").ContractNoBody;
|
|
337
341
|
400: z.ZodUnion<[z.ZodObject<{
|
|
338
342
|
name: z.ZodLiteral<"ZodError">;
|
|
339
343
|
issues: z.ZodArray<z.ZodObject<{
|
|
@@ -495,7 +499,7 @@ declare const _default: {
|
|
|
495
499
|
body: z.ZodUndefined;
|
|
496
500
|
path: "/media-stream/pause/:streamId";
|
|
497
501
|
responses: {
|
|
498
|
-
200:
|
|
502
|
+
200: typeof import("@ts-rest/core").ContractNoBody;
|
|
499
503
|
400: z.ZodUnion<[z.ZodObject<{
|
|
500
504
|
name: z.ZodLiteral<"ZodError">;
|
|
501
505
|
issues: z.ZodArray<z.ZodObject<{
|
|
@@ -664,7 +668,7 @@ declare const _default: {
|
|
|
664
668
|
body: z.ZodUndefined;
|
|
665
669
|
path: "/media-stream/seek/:streamId";
|
|
666
670
|
responses: {
|
|
667
|
-
200:
|
|
671
|
+
200: typeof import("@ts-rest/core").ContractNoBody;
|
|
668
672
|
400: z.ZodUnion<[z.ZodObject<{
|
|
669
673
|
name: z.ZodLiteral<"ZodError">;
|
|
670
674
|
issues: z.ZodArray<z.ZodObject<{
|
|
@@ -29,7 +29,9 @@ export default c.router({
|
|
|
29
29
|
responses: {
|
|
30
30
|
200: apiSuccess(z.object({
|
|
31
31
|
streamId: z.string(),
|
|
32
|
+
title: z.string(),
|
|
32
33
|
startTime: z.number(),
|
|
34
|
+
/** seconds */
|
|
33
35
|
duration: z.number(),
|
|
34
36
|
url: z.string(),
|
|
35
37
|
paused: z.boolean(),
|
|
@@ -48,7 +50,7 @@ export default c.router({
|
|
|
48
50
|
description: "Play a media stream",
|
|
49
51
|
body: z.undefined(),
|
|
50
52
|
responses: {
|
|
51
|
-
200:
|
|
53
|
+
200: c.noBody(),
|
|
52
54
|
400: z.union([
|
|
53
55
|
ZodErrorSchema,
|
|
54
56
|
apiError(z.literal("INVALID_STREAM_ID"), z.literal("The provided stream ID is invalid")),
|
|
@@ -64,7 +66,7 @@ export default c.router({
|
|
|
64
66
|
description: "Pause a media stream",
|
|
65
67
|
body: z.undefined(),
|
|
66
68
|
responses: {
|
|
67
|
-
200:
|
|
69
|
+
200: c.noBody(),
|
|
68
70
|
400: z.union([
|
|
69
71
|
ZodErrorSchema,
|
|
70
72
|
apiError(z.literal("INVALID_STREAM_ID"), z.literal("The provided stream ID is invalid")),
|
|
@@ -83,7 +85,7 @@ export default c.router({
|
|
|
83
85
|
}),
|
|
84
86
|
body: z.undefined(),
|
|
85
87
|
responses: {
|
|
86
|
-
200:
|
|
88
|
+
200: c.noBody(),
|
|
87
89
|
400: z.union([
|
|
88
90
|
ZodErrorSchema,
|
|
89
91
|
apiError(z.literal("INVALID_STREAM_ID"), z.literal("The provided stream ID is invalid")),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@darco2903/altv-web-api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"keywords": [],
|
|
@@ -39,11 +39,13 @@
|
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@ts-rest/core": "^3.52.1",
|
|
43
42
|
"@ts-rest/open-api": "^3.52.1",
|
|
44
43
|
"socket.io-client": "^4.8.1",
|
|
45
44
|
"zod": "^3.25.76"
|
|
46
45
|
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@ts-rest/core": "^3.52.1"
|
|
48
|
+
},
|
|
47
49
|
"devDependencies": {
|
|
48
50
|
"@types/node": "^24.8.1",
|
|
49
51
|
"prettier": "^3.6.2",
|