Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: minor openapi improvements #251

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions front/server/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ export class Client {
return await this.get(ip, ua, token, `/stream-stats/now/count-by-station`);
}

async get_stream_stats_item_since(ip: string | null, ua: string | null, token: string, num: number | string, unit: string): Promise<import("$api/stream-stats/last-[num][unit]/GET/Output").Output> {
async get_stream_stats_item_since(ip: string | null, ua: string | null, token: string, num: number | string, unit: string): Promise<import("$api/stream-stats/[last-unitvalue]/GET/Output").Output> {
return await this.get(ip, ua, token, `/stream-stats/last-${num}${unit}`);
}

async get_stream_stats_item_since_count(ip: string | null, ua: string | null, token: string, num: number | string, unit: string): Promise<import("$api/stream-stats/last-[num][unit]/count/GET/Output").Output> {
async get_stream_stats_item_since_count(ip: string | null, ua: string | null, token: string, num: number | string, unit: string): Promise<import("$api/stream-stats/[last-unitvalue]/count/GET/Output").Output> {
return await this.get(ip, ua, token, `/stream-stats/last-${num}${unit}/count`);
}
}
Expand Down Expand Up @@ -404,11 +404,11 @@ export class Accounts {
return await this.client.get(ip, ua, token, `/accounts/${account_id}/stream-stats/now/count-by-station`);
}

async get_stream_stats_item_since(ip: string | null, ua: string | null, token: string, account_id: string, num: number | string, unit: string): Promise<import("$api/accounts/[account]/stream-stats/last-[num][unit]/GET/Output").Output> {
async get_stream_stats_item_since(ip: string | null, ua: string | null, token: string, account_id: string, num: number | string, unit: string): Promise<import("$api/accounts/[account]/stream-stats/[last-unitvalue]/GET/Output").Output> {
return await this.client.get(ip, ua, token, `/accounts/${account_id}/stream-stats/last-${num}${unit}`);
}

async get_stream_stats_item_since_count(ip: string | null, ua: string | null, token: string, account_id: string, num: number | string, unit: string): Promise<import("$api/accounts/[account]/stream-stats/last-[num][unit]/count/GET/Output").Output> {
async get_stream_stats_item_since_count(ip: string | null, ua: string | null, token: string, account_id: string, num: number | string, unit: string): Promise<import("$api/accounts/[account]/stream-stats/[last-unitvalue]/count/GET/Output").Output> {
return await this.client.get(ip, ua, token, `/accounts/${account_id}/stream-stats/last-${num}${unit}/count`);
}
}
Expand Down Expand Up @@ -463,11 +463,11 @@ export class Stations {
return await this.client.get(ip, ua, token, `/stations/${id}/stream-stats/now/count`);
}

async get_stream_stats_item_since(ip: string | null, ua: string | null, token: string, id: string, num: number | string, unit: string): Promise<import("$api/stations/[station]/stream-stats/last-[num][unit]/GET/Output").Output> {
async get_stream_stats_item_since(ip: string | null, ua: string | null, token: string, id: string, num: number | string, unit: string): Promise<import("$api/stations/[station]/stream-stats/[last-unitvalue]/GET/Output").Output> {
return await this.client.get(ip, ua, token, `/stations/${id}/stream-stats/last-${num}${unit}`);
}

async get_stream_stats_item_since_count(ip: string | null, ua: string | null, token: string, id: string, num: number | string, unit: string): Promise<import("$api/stations/[station]/stream-stats/last-[num][unit]/count/GET/Output").Output> {
async get_stream_stats_item_since_count(ip: string | null, ua: string | null, token: string, id: string, num: number | string, unit: string): Promise<import("$api/stations/[station]/stream-stats/[last-unitvalue]/count/GET/Output").Output> {
return await this.client.get(ip, ua, token, `/stations/${id}/stream-stats/last-${num}${unit}/count`);
}

Expand Down
12 changes: 6 additions & 6 deletions openapi-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const process_dir = (target) => {
},
},

"4xx": {
"4XX": {
description: "A client error",
content: {
"application/json": {
Expand All @@ -116,16 +116,16 @@ const process_dir = (target) => {
}
},

"5xx": {
"5XX": {
description: "A server error",
content: {
"application/json": {
schema: { $ref: "#/components/schemas/Error" },
}
}
}
},
};
},
}
}
}

for (const name of filenames) {
Expand Down Expand Up @@ -166,7 +166,7 @@ process_dir(null)

const document = {

openapi: "3.0.0",
openapi: "3.0.3",

info: {
title: "Openstream Media Server API",
Expand Down
Loading
Loading