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

feat: front use openapi-fetch openapi client for sveltekit server and client requests #281

Merged
merged 9 commits into from
Feb 22, 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
6 changes: 3 additions & 3 deletions defs/Device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export type Device = {
ip: string;
ua: UserAgent;
created_at: DateTime;
last_used_at: DateTime | null;
user_id: string | null;
admin_id: string | null;
last_used_at: DateTime | null | undefined;
user_id: string | null | undefined;
admin_id: string | null | undefined;
};
4 changes: 2 additions & 2 deletions defs/PublicAdmin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ export type PublicAdmin = {
first_name: string;
last_name: string;
email: string;
language: string | null;
language: string | null | undefined;
system_metadata: Metadata;
created_at: DateTime;
updated_at: DateTime;
deleted_at: DateTime | null;
deleted_at: DateTime | null | undefined;
};
2 changes: 1 addition & 1 deletion defs/PublicPaymentMethod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export type PublicPaymentMethod = {
user_id: string;
created_at: DateTime;
updated_at: DateTime;
deleted_at: DateTime | null;
deleted_at: DateTime | null | undefined;
} & PublicPaymentMethodKind;
4 changes: 2 additions & 2 deletions defs/PublicPaymentMethodKind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
export type PublicPaymentMethodKind = { kind: "card" } & {
card_type: string;
last_4: string;
expiration_year: string | null;
expiration_month: string | null;
expiration_year: string | null | undefined;
expiration_month: string | null | undefined;
};
16 changes: 8 additions & 8 deletions defs/UserAgent.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

export type UserAgent = {
ua: string | null;
category: string | null;
browser_type: string | null;
vendor: string | null;
name: string | null;
version: string | null;
os: string | null;
os_version: string | null;
ua: string | null | undefined;
category: string | null | undefined;
browser_type: string | null | undefined;
vendor: string | null | undefined;
name: string | null | undefined;
version: string | null | undefined;
os: string | null | undefined;
os_version: string | null | undefined;
};
4 changes: 2 additions & 2 deletions defs/UserPublicAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import type { Metadata } from "./db/Metadata.js";
export type UserPublicAccount = {
_id: string;
plan_id: string;
payment_method_id: string | null;
payment_method_id: string | null | undefined;
name: string;
limits: AccountLimits;
created_at: DateTime;
updated_at: DateTime;
user_metadata: Metadata;
deleted_at: DateTime | null;
deleted_at: DateTime | null | undefined;
};
40 changes: 20 additions & 20 deletions defs/UserPublicStation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,33 @@ export type UserPublicStation = {
picture_id: string;
name: string;
slug: string;
slogan: string | null;
description: string | null;
slogan: string | null | undefined;
description: string | null | undefined;
type_of_content: StationTypeOfContent;
country_code: CountryCode;
lang_code: LangCode;
frequency: StationFrequency | null;
email: string | null;
phone: string | null;
whatsapp: string | null;
website_url: string | null;
twitter_url: string | null;
facebook_url: string | null;
instagram_url: string | null;
threads_url: string | null;
twitch_url: string | null;
tiktok_url: string | null;
youtube_url: string | null;
spotify_url: string | null;
radiocut_url: string | null;
app_store_url: string | null;
google_play_url: string | null;
frequency: StationFrequency | null | undefined;
email: string | null | undefined;
phone: string | null | undefined;
whatsapp: string | null | undefined;
website_url: string | null | undefined;
twitter_url: string | null | undefined;
facebook_url: string | null | undefined;
instagram_url: string | null | undefined;
threads_url: string | null | undefined;
twitch_url: string | null | undefined;
tiktok_url: string | null | undefined;
youtube_url: string | null | undefined;
spotify_url: string | null | undefined;
radiocut_url: string | null | undefined;
app_store_url: string | null | undefined;
google_play_url: string | null | undefined;
user_metadata: Metadata;
external_relay_url: string | null;
external_relay_url: string | null | undefined;
external_relay_redirect: boolean;
playlist_is_randomly_shuffled: boolean;
source_password: string;
created_at: DateTime;
updated_at: DateTime;
deleted_at: DateTime | null;
deleted_at: DateTime | null | undefined;
};
10 changes: 5 additions & 5 deletions defs/analytics/Analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ export type Analytics = {
max_concurrent_listeners?: number;
max_concurrent_listeners_date?: DateTime;
by_day: Array<AnalyticsItem<YearMonthDay>>;
by_hour: Array<AnalyticsItem<YearMonthDayHour>> | null;
by_browser: Array<AnalyticsItem<string | null>>;
by_os: Array<AnalyticsItem<string | null>>;
by_country: Array<AnalyticsItem<CountryCode | null>>;
by_hour: Array<AnalyticsItem<YearMonthDayHour>> | null | undefined;
by_browser: Array<AnalyticsItem<string | null | undefined>>;
by_os: Array<AnalyticsItem<string | null | undefined>>;
by_country: Array<AnalyticsItem<CountryCode | null | undefined>>;
by_station: Array<AnalyticsItem<string>>;
by_domain: Array<AnalyticsItem<string | null>>;
by_domain: Array<AnalyticsItem<string | null | undefined>>;
};
6 changes: 3 additions & 3 deletions defs/api/ApiKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export type ApiKey = {
_id: string;
is_current: boolean;
title: string;
user_id: string | null;
admin_id: string | null;
user_id: string | null | undefined;
admin_id: string | null | undefined;
created_at: DateTime;
last_used_at: DateTime | null;
last_used_at: DateTime | null | undefined;
};
14 changes: 7 additions & 7 deletions defs/api/PublicInvitation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ import type { InvitationUserSender } from "./InvitationUserSender.js";

export type PublicInvitation = {
id: string;
user_sender_id: string | null;
admin_sender_id: string | null;
user_sender_id: string | null | undefined;
admin_sender_id: string | null | undefined;
account_id: string;
receiver_email: string;
created_at: DateTime;
deleted_at: DateTime | null;
deleted_at: DateTime | null | undefined;
is_expired: boolean;
expires_at: DateTime;
account: InvitationAccount | null;
user_sender: InvitationUserSender | null;
admin_sender: InvitationAdminSender | null;
receiver: InvitationReceiver | null;
account: InvitationAccount | null | undefined;
user_sender: InvitationUserSender | null | undefined;
admin_sender: InvitationAdminSender | null | undefined;
receiver: InvitationReceiver | null | undefined;
} & AccountInvitationState;
8 changes: 4 additions & 4 deletions defs/api/analytics/GET/Query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import type { CountryCodeOrZZ } from "./CountryCodeOrZZ.js";
export type Query = {
kind: AnalyticsQueryKind;
stations: string[] | undefined;
browser: string | null;
os: string | null;
domain: string | null;
country_code: CountryCodeOrZZ | null;
browser: string | null | undefined;
os: string | null | undefined;
domain: string | null | undefined;
country_code: CountryCodeOrZZ | null | undefined;
min_duration_ms?: number;
};
6 changes: 3 additions & 3 deletions defs/api/app-analytics/GET/Query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import type { CountryCodeOrZZ } from "./CountryCodeOrZZ.js";
export type Query = {
kind: AnalyticsQueryKind;
stations: string[] | undefined;
app_kind: string | null;
app_version: string | null;
country_code: CountryCodeOrZZ | null;
app_kind: string | null | undefined;
app_version: string | null | undefined;
country_code: CountryCodeOrZZ | null | undefined;
min_duration_ms?: number;
};
2 changes: 1 addition & 1 deletion defs/api/auth/user/register/POST/Payload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export type Payload = {
plan_id: string;
email: string;
password: string;
phone: string | null;
phone: string | null | undefined;
language?: string;
user_user_metadata?: Metadata;
user_system_metadata?: Metadata;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export type UnauthenticatedAcceptPayloadData = {
token: string;
first_name: string;
last_name: string;
phone: string | null;
phone: string | null | undefined;
password: string;
};
2 changes: 1 addition & 1 deletion defs/api/me/api-keys/[id]/PATCH/Payload.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

export type Payload = { title: string | null };
export type Payload = { title: string | null | undefined };
1 change: 0 additions & 1 deletion defs/api/plans/GET/Query.schema.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"description": "TODO: add pagination",
"type": "object",
"properties": {
"skip": {
Expand Down
38 changes: 19 additions & 19 deletions defs/api/stations/POST/Payload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,28 @@ export type Payload = {
account_id: string;
picture_id: string;
name: string;
slogan: string | null;
description: string | null;
slogan: string | null | undefined;
description: string | null | undefined;
type_of_content: StationTypeOfContent;
country_code: CountryCode;
lang_code: LangCode;
email: string | null;
phone: string | null;
whatsapp: string | null;
website_url: string | null;
twitter_url: string | null;
facebook_url: string | null;
instagram_url: string | null;
threads_url: string | null;
youtube_url: string | null;
twitch_url: string | null;
tiktok_url: string | null;
spotify_url: string | null;
radiocut_url: string | null;
google_play_url: string | null;
app_store_url: string | null;
frequency: StationFrequency | null;
external_relay_url: string | null;
email: string | null | undefined;
phone: string | null | undefined;
whatsapp: string | null | undefined;
website_url: string | null | undefined;
twitter_url: string | null | undefined;
facebook_url: string | null | undefined;
instagram_url: string | null | undefined;
threads_url: string | null | undefined;
youtube_url: string | null | undefined;
twitch_url: string | null | undefined;
tiktok_url: string | null | undefined;
spotify_url: string | null | undefined;
radiocut_url: string | null | undefined;
google_play_url: string | null | undefined;
app_store_url: string | null | undefined;
frequency: StationFrequency | null | undefined;
external_relay_url: string | null | undefined;
user_metadata?: Metadata;
system_metadata?: Metadata;
};
16 changes: 8 additions & 8 deletions defs/api/stations/[station]/files/[file]/metadata/PUT/Payload.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

export type Payload = {
title?: string | null;
artist?: string | null;
album?: string | null;
album_artist?: string | null;
genre?: string | null;
year?: number | null;
comment?: string | null;
track?: number | null;
title?: string | null | undefined;
artist?: string | null | undefined;
album?: string | null | undefined;
album_artist?: string | null | undefined;
genre?: string | null | undefined;
year?: number | null | undefined;
comment?: string | null | undefined;
track?: number | null | undefined;
};
13 changes: 8 additions & 5 deletions defs/api/stations/[station]/now-playing/GET/Output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
export type Output =
| ({ kind: "none" } & {
start_on_connect: boolean;
external_relay_url: string | null;
external_relay_error: string | null;
external_relay_url: string | null | undefined;
external_relay_error: string | null | undefined;
})
| ({ kind: "live" } & {
title: string | null | undefined;
artist: string | null | undefined;
})
| ({ kind: "live" } & { title: string | null; artist: string | null })
| ({ kind: "external-relay" } & { url: string })
| ({ kind: "playlist" } & {
file_id: string;
filename: string;
title: string | null;
artist: string | null;
title: string | null | undefined;
artist: string | null | undefined;
});
2 changes: 1 addition & 1 deletion defs/api/users/POST/Payload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Metadata } from "../../../db/Metadata.js";

export type Payload = {
email: string;
phone: string | null;
phone: string | null | undefined;
password: string;
first_name: string;
last_name: string;
Expand Down
8 changes: 4 additions & 4 deletions defs/api/users/[user]/PATCH/Payload.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

export type Payload = {
first_name: string | null;
last_name: string | null;
phone: string | null | null;
language: string | null | null;
first_name: string | null | undefined;
last_name: string | null | undefined;
phone: string | null | undefined | null | undefined;
language: string | null | undefined | null | undefined;
};
6 changes: 3 additions & 3 deletions defs/app-analytics/Analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ export type Analytics = {
max_concurrent_listeners?: number;
max_concurrent_listeners_date?: DateTime;
by_day: Array<AnalyticsItem<YearMonthDay>>;
by_hour: Array<AnalyticsItem<YearMonthDayHour>> | null;
by_country: Array<AnalyticsItem<CountryCode | null>>;
by_hour: Array<AnalyticsItem<YearMonthDayHour>> | null | undefined;
by_country: Array<AnalyticsItem<CountryCode | null | undefined>>;
by_station: Array<AnalyticsItem<string>>;
by_app_kind: Array<AnalyticsItem<string | null>>;
by_app_kind: Array<AnalyticsItem<string | null | undefined>>;
by_app_version: Array<AnalyticsItem<AppKindVersion>>;
};
5 changes: 4 additions & 1 deletion defs/app-analytics/AppKindVersion.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

export type AppKindVersion = { kind: string | null; version: number | null };
export type AppKindVersion = {
kind: string | null | undefined;
version: number | null | undefined;
};
4 changes: 2 additions & 2 deletions defs/db/Account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import type { Metadata } from "./Metadata.js";
export type Account = {
_id: string;
plan_id: string;
payment_method_id: string | null;
payment_method_id: string | null | undefined;
name: string;
limits: AccountLimits;
user_metadata: Metadata;
system_metadata: Metadata;
created_at: DateTime;
updated_at: DateTime;
deleted_at: DateTime | null;
deleted_at: DateTime | null | undefined;
};
4 changes: 2 additions & 2 deletions defs/db/Admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ export type Admin = {
last_name: string;
email: string;
password: string;
language: string | null;
language: string | null | undefined;
system_metadata: Metadata;
created_at: DateTime;
updated_at: DateTime;
deleted_at: DateTime | null;
deleted_at: DateTime | null | undefined;
};
Loading
Loading