Skip to content

Commit

Permalink
chore(client): generate using latest version
Browse files Browse the repository at this point in the history
Signed-off-by: Jordan Shatford <[email protected]>
  • Loading branch information
jordanshatford committed Apr 9, 2024
1 parent b6bab89 commit d18077c
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 52 deletions.
4 changes: 0 additions & 4 deletions apps/api/api.d.ts

This file was deleted.

4 changes: 4 additions & 0 deletions packages/client/client.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module '@yd/api' {
const json: any;
export default json;
}
2 changes: 1 addition & 1 deletion packages/client/openapi-ts.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export default defineConfig({
output: './src/generated',
client: 'fetch',
enums: 'javascript',
exportSchemas: false
schemas: false
});
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.35.0",
"@hey-api/openapi-ts": "^0.36.2",
"@yd/api": "workspace:*",
"@yd/config": "workspace:*",
"prettier": "^3.2.5",
Expand Down
55 changes: 55 additions & 0 deletions packages/client/src/generated/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,58 @@ export const VideoFormatEnum = {
MP4: 'mp4',
WEBM: 'webm'
} as const;

export type SearchData = {
payloads: {
GetSearch: {
query: string;
};
GetVideo: {
id: string;
};
};

responses: {
GetSearch: Array<Video>;
GetNextSearch: Array<Video>;
GetVideo: Video;
};
};

export type SessionData = {
responses: {
GetSession: Session;
DeleteSession: void;
GetSessionValidate: Session;
};
};

export type DownloadsData = {
payloads: {
PutDownloads: {
requestBody: DownloadInput;
};
PostDownloads: {
requestBody: DownloadInput;
};
GetDownload: {
downloadId: string;
};
DeleteDownload: {
downloadId: string;
};
GetDownloadFile: {
downloadId: string;
};
};

responses: {
GetDownloads: Array<Download>;
PutDownloads: Download;
PostDownloads: Download;
GetDownloadsOptions: AvailableDownloadOptions;
GetDownload: Download;
DeleteDownload: void;
GetDownloadFile: Blob | File;
};
};
73 changes: 31 additions & 42 deletions packages/client/src/generated/services.ts
Original file line number Diff line number Diff line change
@@ -1,42 +1,17 @@
import type { CancelablePromise } from './core/CancelablePromise';
import { OpenAPI } from './core/OpenAPI';
import { request as __request } from './core/request';
import type { Video, Session, AvailableDownloadOptions, Download, DownloadInput } from './models';

export type SearchData = {
GetSearch: {
query: string;
};
GetVideo: {
id: string;
};
};

export type DownloadsData = {
PutDownloads: {
requestBody: DownloadInput;
};
PostDownloads: {
requestBody: DownloadInput;
};
GetDownload: {
downloadId: string;
};
DeleteDownload: {
downloadId: string;
};
GetDownloadFile: {
downloadId: string;
};
};
import type { SearchData, SessionData, DownloadsData } from './models';

export class SearchService {
/**
* Get Search
* @returns Video Successful Response
* @throws ApiError
*/
public static getSearch(data: SearchData['GetSearch']): CancelablePromise<Array<Video>> {
public static getSearch(
data: SearchData['payloads']['GetSearch']
): CancelablePromise<SearchData['responses']['GetSearch']> {
const { query } = data;
return __request(OpenAPI, {
method: 'GET',
Expand All @@ -57,7 +32,7 @@ export class SearchService {
* @returns Video Successful Response
* @throws ApiError
*/
public static getNextSearch(): CancelablePromise<Array<Video>> {
public static getNextSearch(): CancelablePromise<SearchData['responses']['GetNextSearch']> {
return __request(OpenAPI, {
method: 'GET',
url: '/search/next',
Expand All @@ -73,7 +48,9 @@ export class SearchService {
* @returns Video Successful Response
* @throws ApiError
*/
public static getVideo(data: SearchData['GetVideo']): CancelablePromise<Video> {
public static getVideo(
data: SearchData['payloads']['GetVideo']
): CancelablePromise<SearchData['responses']['GetVideo']> {
const { id } = data;
return __request(OpenAPI, {
method: 'GET',
Expand All @@ -96,7 +73,7 @@ export class SessionService {
* @returns Session Successful Response
* @throws ApiError
*/
public static getSession(): CancelablePromise<Session> {
public static getSession(): CancelablePromise<SessionData['responses']['GetSession']> {
return __request(OpenAPI, {
method: 'GET',
url: '/session'
Expand All @@ -108,7 +85,7 @@ export class SessionService {
* @returns void Successful Response
* @throws ApiError
*/
public static deleteSession(): CancelablePromise<void> {
public static deleteSession(): CancelablePromise<SessionData['responses']['DeleteSession']> {
return __request(OpenAPI, {
method: 'DELETE',
url: '/session',
Expand All @@ -123,7 +100,9 @@ export class SessionService {
* @returns Session Successful Response
* @throws ApiError
*/
public static getSessionValidate(): CancelablePromise<Session> {
public static getSessionValidate(): CancelablePromise<
SessionData['responses']['GetSessionValidate']
> {
return __request(OpenAPI, {
method: 'GET',
url: '/session/validate',
Expand All @@ -140,7 +119,7 @@ export class DownloadsService {
* @returns Download Successful Response
* @throws ApiError
*/
public static getDownloads(): CancelablePromise<Array<Download>> {
public static getDownloads(): CancelablePromise<DownloadsData['responses']['GetDownloads']> {
return __request(OpenAPI, {
method: 'GET',
url: '/downloads',
Expand All @@ -155,7 +134,9 @@ export class DownloadsService {
* @returns Download Successful Response
* @throws ApiError
*/
public static putDownloads(data: DownloadsData['PutDownloads']): CancelablePromise<Download> {
public static putDownloads(
data: DownloadsData['payloads']['PutDownloads']
): CancelablePromise<DownloadsData['responses']['PutDownloads']> {
const { requestBody } = data;
return __request(OpenAPI, {
method: 'PUT',
Expand All @@ -174,7 +155,9 @@ export class DownloadsService {
* @returns Download Successful Response
* @throws ApiError
*/
public static postDownloads(data: DownloadsData['PostDownloads']): CancelablePromise<Download> {
public static postDownloads(
data: DownloadsData['payloads']['PostDownloads']
): CancelablePromise<DownloadsData['responses']['PostDownloads']> {
const { requestBody } = data;
return __request(OpenAPI, {
method: 'POST',
Expand All @@ -193,7 +176,9 @@ export class DownloadsService {
* @returns AvailableDownloadOptions Successful Response
* @throws ApiError
*/
public static getDownloadsOptions(): CancelablePromise<AvailableDownloadOptions> {
public static getDownloadsOptions(): CancelablePromise<
DownloadsData['responses']['GetDownloadsOptions']
> {
return __request(OpenAPI, {
method: 'GET',
url: '/downloads/options',
Expand All @@ -208,7 +193,9 @@ export class DownloadsService {
* @returns Download Successful Response
* @throws ApiError
*/
public static getDownload(data: DownloadsData['GetDownload']): CancelablePromise<Download> {
public static getDownload(
data: DownloadsData['payloads']['GetDownload']
): CancelablePromise<DownloadsData['responses']['GetDownload']> {
const { downloadId } = data;
return __request(OpenAPI, {
method: 'GET',
Expand All @@ -229,7 +216,9 @@ export class DownloadsService {
* @returns void Successful Response
* @throws ApiError
*/
public static deleteDownload(data: DownloadsData['DeleteDownload']): CancelablePromise<void> {
public static deleteDownload(
data: DownloadsData['payloads']['DeleteDownload']
): CancelablePromise<DownloadsData['responses']['DeleteDownload']> {
const { downloadId } = data;
return __request(OpenAPI, {
method: 'DELETE',
Expand All @@ -251,8 +240,8 @@ export class DownloadsService {
* @throws ApiError
*/
public static getDownloadFile(
data: DownloadsData['GetDownloadFile']
): CancelablePromise<Blob | File> {
data: DownloadsData['payloads']['GetDownloadFile']
): CancelablePromise<DownloadsData['responses']['GetDownloadFile']> {
const { downloadId } = data;
return __request(OpenAPI, {
method: 'GET',
Expand Down
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 d18077c

Please sign in to comment.