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 <[email protected]>
  • Loading branch information
jordanshatford committed Apr 16, 2024
1 parent 59eeef2 commit 8e72c38
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 68 deletions.
2 changes: 1 addition & 1 deletion apps/web/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export default [
{
ignores: ['build/', '.svelte-kit/']
},
...svelte,
...svelte
];
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"format": "prettier --write ."
},
"devDependencies": {
"@hey-api/openapi-ts": "^0.38.1",
"@hey-api/openapi-ts": "^0.39.0",
"@yd/api": "workspace:*",
"@yd/config": "workspace:*",
"prettier": "^3.2.5",
Expand Down
6 changes: 3 additions & 3 deletions packages/client/src/defaults.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { type DownloadOptions, DownloadQualityEnum, VideoFormatEnum } from './generated';
import type { DownloadOptions } from './generated';

// Default download options to use on various platforms.
export const DEFAULT_DOWNLOAD_OPTIONS: DownloadOptions = {
format: VideoFormatEnum.MP4,
quality: DownloadQualityEnum.BEST,
format: 'mp4',
quality: 'best',
embed_metadata: true,
embed_thumbnail: false,
embed_subtitles: false
Expand Down
32 changes: 32 additions & 0 deletions packages/client/src/generated/enums.gen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// This file is auto-generated by @hey-api/openapi-ts

export const AudioFormatEnum = {
AAC: 'aac',
FLAC: 'flac',
M4A: 'm4a',
MP3: 'mp3',
OPUS: 'opus',
WAV: 'wav'
} as const;

export const DownloadQualityEnum = {
BEST: 'best',
WORST: 'worst'
} as const;

export const DownloadStateEnum = {
WAITING: 'WAITING',
DOWNLOADING: 'DOWNLOADING',
PROCESSING: 'PROCESSING',
DONE: 'DONE',
ERROR: 'ERROR'
} as const;

export const VideoFormatEnum = {
AVI: 'avi',
FLV: 'flv',
MKV: 'mkv',
MOV: 'mov',
MP4: 'mp4',
WEBM: 'webm'
} as const;
4 changes: 2 additions & 2 deletions packages/client/src/generated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
export { ApiError } from './core/ApiError';
export { CancelablePromise, CancelError } from './core/CancelablePromise';
export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI';
export * from './models';
export * from './services';
export * from './models.gen';
export * from './services.gen';
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@

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

export const AudioFormatEnum = {
AAC: 'aac',
FLAC: 'flac',
M4A: 'm4a',
MP3: 'mp3',
OPUS: 'opus',
WAV: 'wav'
} as const;

export type AvailableDownloadOptions = {
format: Array<AudioFormat | VideoFormat>;
quality: Array<DownloadQuality>;
Expand Down Expand Up @@ -46,21 +37,8 @@ export type DownloadOptions = {

export type DownloadQuality = 'best' | 'worst';

export const DownloadQualityEnum = {
BEST: 'best',
WORST: 'worst'
} as const;

export type DownloadState = 'WAITING' | 'DOWNLOADING' | 'PROCESSING' | 'DONE' | 'ERROR';

export const DownloadStateEnum = {
WAITING: 'WAITING',
DOWNLOADING: 'DOWNLOADING',
PROCESSING: 'PROCESSING',
DONE: 'DONE',
ERROR: 'ERROR'
} as const;

export type DownloadStatus = {
state: DownloadState;
downloaded_bytes?: number | null;
Expand Down Expand Up @@ -97,15 +75,6 @@ export type Video = {

export type VideoFormat = 'avi' | 'flv' | 'mkv' | 'mov' | 'mp4' | 'webm';

export const VideoFormatEnum = {
AVI: 'avi',
FLV: 'flv',
MKV: 'mkv',
MOV: 'mov',
MP4: 'mp4',
WEBM: 'webm'
} as const;

export type $OpenApiTs = {
'/search': {
get: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import type { CancelablePromise } from './core/CancelablePromise';
import { OpenAPI } from './core/OpenAPI';
import { request as __request } from './core/request';
import type { $OpenApiTs } from './models';
import type { $OpenApiTs } from './models.gen';

export class SearchService {
/**
Expand All @@ -22,9 +22,9 @@ export class SearchService {
query
},
errors: {
403: `Forbidden`,
404: `Not Found`,
422: `Validation Error`
403: 'Forbidden',
404: 'Not Found',
422: 'Validation Error'
}
});
}
Expand All @@ -39,8 +39,8 @@ export class SearchService {
method: 'GET',
url: '/search/next',
errors: {
403: `Forbidden`,
404: `Not Found`
403: 'Forbidden',
404: 'Not Found'
}
});
}
Expand All @@ -61,9 +61,9 @@ export class SearchService {
id
},
errors: {
403: `Forbidden`,
404: `Not Found`,
422: `Validation Error`
403: 'Forbidden',
404: 'Not Found',
422: 'Validation Error'
}
});
}
Expand Down Expand Up @@ -92,7 +92,7 @@ export class SessionService {
method: 'DELETE',
url: '/session',
errors: {
403: `Forbidden`
403: 'Forbidden'
}
});
}
Expand All @@ -109,7 +109,7 @@ export class SessionService {
method: 'GET',
url: '/session/validate',
errors: {
403: `Forbidden`
403: 'Forbidden'
}
});
}
Expand All @@ -126,7 +126,7 @@ export class DownloadsService {
method: 'GET',
url: '/downloads',
errors: {
403: `Forbidden`
403: 'Forbidden'
}
});
}
Expand All @@ -146,8 +146,8 @@ export class DownloadsService {
body: requestBody,
mediaType: 'application/json',
errors: {
403: `Forbidden`,
422: `Validation Error`
403: 'Forbidden',
422: 'Validation Error'
}
});
}
Expand All @@ -167,8 +167,8 @@ export class DownloadsService {
body: requestBody,
mediaType: 'application/json',
errors: {
403: `Forbidden`,
422: `Validation Error`
403: 'Forbidden',
422: 'Validation Error'
}
});
}
Expand All @@ -185,7 +185,7 @@ export class DownloadsService {
method: 'GET',
url: '/downloads/options',
errors: {
403: `Forbidden`
403: 'Forbidden'
}
});
}
Expand All @@ -206,9 +206,9 @@ export class DownloadsService {
download_id: downloadId
},
errors: {
403: `Forbidden`,
404: `Not Found`,
422: `Validation Error`
403: 'Forbidden',
404: 'Not Found',
422: 'Validation Error'
}
});
}
Expand All @@ -229,9 +229,9 @@ export class DownloadsService {
download_id: downloadId
},
errors: {
403: `Forbidden`,
404: `Not Found`,
422: `Validation Error`
403: 'Forbidden',
404: 'Not Found',
422: 'Validation Error'
}
});
}
Expand All @@ -252,9 +252,9 @@ export class DownloadsService {
download_id: downloadId
},
errors: {
403: `Forbidden`,
404: `Not Found`,
422: `Validation Error`
403: 'Forbidden',
404: 'Not Found',
422: 'Validation Error'
}
});
}
Expand Down
1 change: 1 addition & 0 deletions packages/client/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './generated';
export * from './generated/enums.gen';
export * from './defaults';
export * from './DownloadsStatusService';
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8e72c38

Please sign in to comment.