Skip to content

Commit

Permalink
chore(client): generate using latest version of openapi ts
Browse files Browse the repository at this point in the history
Signed-off-by: Jordan Shatford <jordanshatford@live.com>
  • Loading branch information
jordanshatford committed Apr 11, 2024
1 parent 9730d2e commit 4435e0f
Show file tree
Hide file tree
Showing 6 changed files with 233 additions and 148 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"lint": "pnpm --recursive lint",
"format": "pnpm --recursive format",
"check": "pnpm --recursive check",
"deps:update": "pnpm --recursive up --latest && pnpm --filter @yd/api pre-commit:autoupdate",
"deps:update": "pnpm --recursive up --latest && pnpm --filter @yd/api pre-commit:autoupdate",
"commitlint": "commitlint --edit",
"changeset": "changeset"
},
Expand All @@ -30,7 +30,7 @@
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
"husky": "^9.0.11"
},
"packageManager": "pnpm@8.15.5+sha256.4b4efa12490e5055d59b9b9fc9438b7d581a6b7af3b5675eb5c5f447cee1a589",
"packageManager": "pnpm@8.15.6+sha256.01c01eeb990e379b31ef19c03e9d06a14afa5250b82e81303f88721c99ff2e6f",
"engines": {
"pnpm": ">=8",
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"format": "prettier --write ."
},
"devDependencies": {
"@hey-api/openapi-ts": "^0.37.0",
"@hey-api/openapi-ts": "^0.38.0",
"@yd/api": "workspace:*",
"@yd/config": "workspace:*",
"prettier": "^3.2.5",
"typescript": "^5.4.4"
"typescript": "^5.4.5"
}
}
2 changes: 2 additions & 0 deletions packages/client/src/generated/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// This file is auto-generated by @hey-api/openapi-ts

export { ApiError } from './core/ApiError';
export { CancelablePromise, CancelError } from './core/CancelablePromise';
export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI';
Expand Down
136 changes: 95 additions & 41 deletions packages/client/src/generated/models.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// This file is auto-generated by @hey-api/openapi-ts

export type AudioFormat = 'aac' | 'flac' | 'm4a' | 'mp3' | 'opus' | 'wav';

export const AudioFormatEnum = {
Expand Down Expand Up @@ -104,57 +106,109 @@ export const VideoFormatEnum = {
WEBM: 'webm'
} as const;

export type SearchData = {
payloads: {
GetSearch: {
query: string;
export type $OpenApiTs = {
'/search': {
get: {
req: {
query: string;
};
res: {
200: Array<Video>;
};
};
GetVideo: {
id: string;
};
'/search/next': {
get: {
res: {
200: Array<Video>;
};
};
};

responses: {
GetSearch: Array<Video>;
GetNextSearch: Array<Video>;
GetVideo: Video;
'/search/video': {
get: {
req: {
id: string;
};
res: {
200: Video;
};
};
};
};

export type SessionData = {
responses: {
GetSession: Session;
DeleteSession: void;
GetSessionValidate: Session;
'/session': {
get: {
res: {
200: Session;
};
};
delete: {
res: {
204: void;
};
};
};
};

export type DownloadsData = {
payloads: {
PutDownloads: {
requestBody: DownloadInput;
'/session/validate': {
get: {
res: {
200: Session;
};
};
PostDownloads: {
requestBody: DownloadInput;
};
'/downloads': {
get: {
res: {
200: Array<Download>;
};
};
GetDownload: {
downloadId: string;
put: {
req: {
requestBody: DownloadInput;
};
res: {
200: Download;
};
};
DeleteDownload: {
downloadId: string;
post: {
req: {
requestBody: DownloadInput;
};
res: {
201: Download;
};
};
GetDownloadFile: {
downloadId: string;
};
'/downloads/options': {
get: {
res: {
200: AvailableDownloadOptions;
};
};
};

responses: {
GetDownloads: Array<Download>;
PutDownloads: Download;
PostDownloads: Download;
GetDownloadsOptions: AvailableDownloadOptions;
GetDownload: Download;
DeleteDownload: void;
GetDownloadFile: Blob | File;
'/downloads/{download_id}': {
get: {
req: {
downloadId: string;
};
res: {
200: Download;
};
};
delete: {
req: {
downloadId: string;
};
res: {
204: void;
};
};
};
'/downloads/{download_id}/file': {
get: {
req: {
downloadId: string;
};
res: {
200: Blob | File;
};
};
};
};
44 changes: 23 additions & 21 deletions packages/client/src/generated/services.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// This file is auto-generated by @hey-api/openapi-ts

import type { CancelablePromise } from './core/CancelablePromise';
import { OpenAPI } from './core/OpenAPI';
import { request as __request } from './core/request';
import type { SearchData, SessionData, DownloadsData } from './models';
import type { $OpenApiTs } from './models';

export class SearchService {
/**
Expand All @@ -10,8 +12,8 @@ export class SearchService {
* @throws ApiError
*/
public static getSearch(
data: SearchData['payloads']['GetSearch']
): CancelablePromise<SearchData['responses']['GetSearch']> {
data: $OpenApiTs['/search']['get']['req']
): CancelablePromise<$OpenApiTs['/search']['get']['res'][200]> {
const { query } = data;
return __request(OpenAPI, {
method: 'GET',
Expand All @@ -32,7 +34,7 @@ export class SearchService {
* @returns Video Successful Response
* @throws ApiError
*/
public static getNextSearch(): CancelablePromise<SearchData['responses']['GetNextSearch']> {
public static getNextSearch(): CancelablePromise<$OpenApiTs['/search/next']['get']['res'][200]> {
return __request(OpenAPI, {
method: 'GET',
url: '/search/next',
Expand All @@ -49,8 +51,8 @@ export class SearchService {
* @throws ApiError
*/
public static getVideo(
data: SearchData['payloads']['GetVideo']
): CancelablePromise<SearchData['responses']['GetVideo']> {
data: $OpenApiTs['/search/video']['get']['req']
): CancelablePromise<$OpenApiTs['/search/video']['get']['res'][200]> {
const { id } = data;
return __request(OpenAPI, {
method: 'GET',
Expand All @@ -73,7 +75,7 @@ export class SessionService {
* @returns Session Successful Response
* @throws ApiError
*/
public static getSession(): CancelablePromise<SessionData['responses']['GetSession']> {
public static getSession(): CancelablePromise<$OpenApiTs['/session']['get']['res'][200]> {
return __request(OpenAPI, {
method: 'GET',
url: '/session'
Expand All @@ -85,7 +87,7 @@ export class SessionService {
* @returns void Successful Response
* @throws ApiError
*/
public static deleteSession(): CancelablePromise<SessionData['responses']['DeleteSession']> {
public static deleteSession(): CancelablePromise<$OpenApiTs['/session']['delete']['res'][204]> {
return __request(OpenAPI, {
method: 'DELETE',
url: '/session',
Expand All @@ -101,7 +103,7 @@ export class SessionService {
* @throws ApiError
*/
public static getSessionValidate(): CancelablePromise<
SessionData['responses']['GetSessionValidate']
$OpenApiTs['/session/validate']['get']['res'][200]
> {
return __request(OpenAPI, {
method: 'GET',
Expand All @@ -119,7 +121,7 @@ export class DownloadsService {
* @returns Download Successful Response
* @throws ApiError
*/
public static getDownloads(): CancelablePromise<DownloadsData['responses']['GetDownloads']> {
public static getDownloads(): CancelablePromise<$OpenApiTs['/downloads']['get']['res'][200]> {
return __request(OpenAPI, {
method: 'GET',
url: '/downloads',
Expand All @@ -135,8 +137,8 @@ export class DownloadsService {
* @throws ApiError
*/
public static putDownloads(
data: DownloadsData['payloads']['PutDownloads']
): CancelablePromise<DownloadsData['responses']['PutDownloads']> {
data: $OpenApiTs['/downloads']['put']['req']
): CancelablePromise<$OpenApiTs['/downloads']['put']['res'][200]> {
const { requestBody } = data;
return __request(OpenAPI, {
method: 'PUT',
Expand All @@ -156,8 +158,8 @@ export class DownloadsService {
* @throws ApiError
*/
public static postDownloads(
data: DownloadsData['payloads']['PostDownloads']
): CancelablePromise<DownloadsData['responses']['PostDownloads']> {
data: $OpenApiTs['/downloads']['post']['req']
): CancelablePromise<$OpenApiTs['/downloads']['post']['res'][201]> {
const { requestBody } = data;
return __request(OpenAPI, {
method: 'POST',
Expand All @@ -177,7 +179,7 @@ export class DownloadsService {
* @throws ApiError
*/
public static getDownloadsOptions(): CancelablePromise<
DownloadsData['responses']['GetDownloadsOptions']
$OpenApiTs['/downloads/options']['get']['res'][200]
> {
return __request(OpenAPI, {
method: 'GET',
Expand All @@ -194,8 +196,8 @@ export class DownloadsService {
* @throws ApiError
*/
public static getDownload(
data: DownloadsData['payloads']['GetDownload']
): CancelablePromise<DownloadsData['responses']['GetDownload']> {
data: $OpenApiTs['/downloads/{download_id}']['get']['req']
): CancelablePromise<$OpenApiTs['/downloads/{download_id}']['get']['res'][200]> {
const { downloadId } = data;
return __request(OpenAPI, {
method: 'GET',
Expand All @@ -217,8 +219,8 @@ export class DownloadsService {
* @throws ApiError
*/
public static deleteDownload(
data: DownloadsData['payloads']['DeleteDownload']
): CancelablePromise<DownloadsData['responses']['DeleteDownload']> {
data: $OpenApiTs['/downloads/{download_id}']['delete']['req']
): CancelablePromise<$OpenApiTs['/downloads/{download_id}']['delete']['res'][204]> {
const { downloadId } = data;
return __request(OpenAPI, {
method: 'DELETE',
Expand All @@ -240,8 +242,8 @@ export class DownloadsService {
* @throws ApiError
*/
public static getDownloadFile(
data: DownloadsData['payloads']['GetDownloadFile']
): CancelablePromise<DownloadsData['responses']['GetDownloadFile']> {
data: $OpenApiTs['/downloads/{download_id}/file']['get']['req']
): CancelablePromise<$OpenApiTs['/downloads/{download_id}/file']['get']['res'][200]> {
const { downloadId } = data;
return __request(OpenAPI, {
method: 'GET',
Expand Down
Loading

0 comments on commit 4435e0f

Please sign in to comment.