@vrplatform/api 1.3.1-1368 → 1.3.1-1419
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/build/main/cache.d.ts +2 -5
- package/build/main/cache.js.map +1 -1
- package/build/main/error.js +3 -3
- package/build/main/error.js.map +1 -1
- package/build/main/generated/v1.d.ts +21498 -15969
- package/build/main/generated/v1.js.map +1 -1
- package/build/main/types.d.ts +8 -13
- package/build/main/types.js.map +1 -1
- package/build/module/cache.d.ts +2 -5
- package/build/module/cache.js.map +1 -1
- package/build/module/error.js +3 -3
- package/build/module/error.js.map +1 -1
- package/build/module/generated/v1.d.ts +21498 -15969
- package/build/module/generated/v1.js.map +1 -1
- package/build/module/types.d.ts +8 -13
- package/build/module/types.js.map +1 -1
- package/package.json +1 -2
- package/src/cache.ts +2 -2
- package/src/error.ts +4 -3
- package/src/generated/v1.ts +21498 -15969
- package/src/types.ts +14 -14
package/src/types.ts
CHANGED
|
@@ -43,27 +43,27 @@ type RequestBodyCombinations = {
|
|
|
43
43
|
[Path in keyof paths]: {
|
|
44
44
|
[Method in keyof paths[Path]]: paths[Path][Method] extends never
|
|
45
45
|
? never
|
|
46
|
-
: paths[Path][Method] extends
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
? `${Method & string}:${Path}`
|
|
52
|
-
: never;
|
|
46
|
+
: ExtractJsonRequestBody<paths[Path][Method]> extends never
|
|
47
|
+
? never
|
|
48
|
+
: `${Method & string}:${Path}`;
|
|
53
49
|
}[keyof paths[Path]];
|
|
54
50
|
}[keyof paths];
|
|
55
51
|
|
|
52
|
+
type ExtractJsonRequestBody<T> = T extends {
|
|
53
|
+
requestBody?: infer RequestBody;
|
|
54
|
+
}
|
|
55
|
+
? RequestBody extends {
|
|
56
|
+
content: { 'application/json': infer Data };
|
|
57
|
+
}
|
|
58
|
+
? Data
|
|
59
|
+
: never
|
|
60
|
+
: never;
|
|
61
|
+
|
|
56
62
|
export type RequestBody<T extends RequestBodyCombinations> =
|
|
57
63
|
T extends `${infer Method}:${infer Path}`
|
|
58
64
|
? Path extends keyof paths
|
|
59
65
|
? Method extends keyof paths[Path]
|
|
60
|
-
? paths[Path][Method]
|
|
61
|
-
requestBody: {
|
|
62
|
-
content: { 'application/json': infer Data };
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
? Data
|
|
66
|
-
: never
|
|
66
|
+
? ExtractJsonRequestBody<paths[Path][Method]>
|
|
67
67
|
: never
|
|
68
68
|
: never
|
|
69
69
|
: never;
|