Skip to content

Commit c3a9fc6

Browse files
committed
chore(api): regenerate openapi and frontend generated client
1 parent 3ea0aa2 commit c3a9fc6

4 files changed

Lines changed: 363 additions & 173 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// This file is auto-generated by @hey-api/openapi-ts
22

3-
export { createFeed, getApiMetadata, getHealthStatus, getLivenessProbe, getReadinessProbe, listStrategies, type Options, renderFeedByToken } from './sdk.gen';
4-
export type { ClientOptions, CreateFeedData, CreateFeedError, CreateFeedErrors, CreateFeedResponse, CreateFeedResponses, GetApiMetadataData, GetApiMetadataResponse, GetApiMetadataResponses, GetHealthStatusData, GetHealthStatusError, GetHealthStatusErrors, GetHealthStatusResponse, GetHealthStatusResponses, GetLivenessProbeData, GetLivenessProbeResponse, GetLivenessProbeResponses, GetReadinessProbeData, GetReadinessProbeResponse, GetReadinessProbeResponses, ListStrategiesData, ListStrategiesResponse, ListStrategiesResponses, RenderFeedByTokenData, RenderFeedByTokenError, RenderFeedByTokenErrors, RenderFeedByTokenResponse, RenderFeedByTokenResponses } from './types.gen';
3+
export { createFeed, getApiMetadata, getFeedStatus, getHealthStatus, getLivenessProbe, getReadinessProbe, listStrategies, type Options, renderFeedByToken } from './sdk.gen';
4+
export type { ClientOptions, CreateFeedData, CreateFeedError, CreateFeedErrors, CreateFeedResponse, CreateFeedResponses, FeedConversionState, FeedCreationResponse, FeedMetadata, FeedRetrySummary, FeedStatusResponse, FeedWarning, GetApiMetadataData, GetApiMetadataResponse, GetApiMetadataResponses, GetFeedStatusData, GetFeedStatusError, GetFeedStatusErrors, GetFeedStatusResponse, GetFeedStatusResponses, GetHealthStatusData, GetHealthStatusError, GetHealthStatusErrors, GetHealthStatusResponse, GetHealthStatusResponses, GetLivenessProbeData, GetLivenessProbeResponse, GetLivenessProbeResponses, GetReadinessProbeData, GetReadinessProbeResponse, GetReadinessProbeResponses, ListStrategiesData, ListStrategiesResponse, ListStrategiesResponses, RenderFeedByTokenData, RenderFeedByTokenError, RenderFeedByTokenErrors, RenderFeedByTokenResponse, RenderFeedByTokenResponses, StructuredError, StructuredErrorResponse } from './types.gen';

frontend/src/api/generated/sdk.gen.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import type { Client, Options as Options2, TDataShape } from './client';
44
import { client } from './client.gen';
5-
import type { CreateFeedData, CreateFeedErrors, CreateFeedResponses, GetApiMetadataData, GetApiMetadataResponses, GetHealthStatusData, GetHealthStatusErrors, GetHealthStatusResponses, GetLivenessProbeData, GetLivenessProbeResponses, GetReadinessProbeData, GetReadinessProbeResponses, ListStrategiesData, ListStrategiesResponses, RenderFeedByTokenData, RenderFeedByTokenErrors, RenderFeedByTokenResponses } from './types.gen';
5+
import type { CreateFeedData, CreateFeedErrors, CreateFeedResponses, GetApiMetadataData, GetApiMetadataResponses, GetFeedStatusData, GetFeedStatusErrors, GetFeedStatusResponses, GetHealthStatusData, GetHealthStatusErrors, GetHealthStatusResponses, GetLivenessProbeData, GetLivenessProbeResponses, GetReadinessProbeData, GetReadinessProbeResponses, ListStrategiesData, ListStrategiesResponses, RenderFeedByTokenData, RenderFeedByTokenErrors, RenderFeedByTokenResponses } from './types.gen';
66

77
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
88
/**
@@ -47,6 +47,13 @@ export const createFeed = <ThrowOnError extends boolean = false>(options: Option
4747
*/
4848
export const renderFeedByToken = <ThrowOnError extends boolean = false>(options: Options<RenderFeedByTokenData, ThrowOnError>) => (options.client ?? client).get<RenderFeedByTokenResponses, RenderFeedByTokenErrors, ThrowOnError>({ url: '/feeds/{token}', ...options });
4949

50+
/**
51+
* Get feed status
52+
*
53+
* Returns readiness and degradation metadata for a generated feed.
54+
*/
55+
export const getFeedStatus = <ThrowOnError extends boolean = false>(options: Options<GetFeedStatusData, ThrowOnError>) => (options.client ?? client).get<GetFeedStatusResponses, GetFeedStatusErrors, ThrowOnError>({ url: '/feeds/{token}/status', ...options });
56+
5057
/**
5158
* Authenticated health check
5259
*

frontend/src/api/generated/types.gen.ts

Lines changed: 113 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,71 @@ export type ClientOptions = {
44
baseUrl: 'https://api.html2rss.dev/api/v1' | 'http://127.0.0.1:4000/api/v1' | (string & {});
55
};
66

7+
export type StructuredErrorResponse = {
8+
error: StructuredError;
9+
success: boolean;
10+
};
11+
12+
export type StructuredError = {
13+
code: string;
14+
kind: 'auth' | 'input' | 'network' | 'server';
15+
message: string;
16+
next_action: 'enter_token' | 'correct_input' | 'retry' | 'wait' | 'none';
17+
next_strategy?: string;
18+
retry_action: 'alternate' | 'primary' | 'none';
19+
retryable: boolean;
20+
};
21+
22+
export type FeedCreationResponse = {
23+
data: {
24+
conversion: FeedConversionState;
25+
feed: FeedMetadata;
26+
};
27+
meta: {
28+
created: boolean;
29+
};
30+
success: boolean;
31+
};
32+
33+
export type FeedConversionState = {
34+
preview_status: 'pending' | 'ready' | 'degraded' | 'unavailable';
35+
readiness_phase: 'link_created' | 'feed_ready' | 'feed_not_ready_yet' | 'preview_unavailable';
36+
retry?: FeedRetrySummary;
37+
warnings: Array<FeedWarning>;
38+
};
39+
40+
export type FeedMetadata = {
41+
created_at: string;
42+
feed_token: string;
43+
id: string;
44+
json_public_url: string;
45+
name: string;
46+
public_url: string;
47+
updated_at: string;
48+
url: string;
49+
};
50+
51+
export type FeedRetrySummary = {
52+
automatic: boolean;
53+
from: string;
54+
to: string;
55+
};
56+
57+
export type FeedStatusResponse = {
58+
data: {
59+
conversion: FeedConversionState;
60+
feed: FeedMetadata;
61+
};
62+
success: boolean;
63+
};
64+
65+
export type FeedWarning = {
66+
code: string;
67+
message: string;
68+
next_action: 'enter_token' | 'correct_input' | 'retry' | 'wait' | 'none';
69+
retryable: boolean;
70+
};
71+
772
export type GetApiMetadataData = {
873
body?: never;
974
path?: never;
@@ -42,7 +107,6 @@ export type GetApiMetadataResponse = GetApiMetadataResponses[keyof GetApiMetadat
42107

43108
export type CreateFeedData = {
44109
body?: {
45-
strategy: string;
46110
url: string;
47111
};
48112
headers: {
@@ -54,26 +118,22 @@ export type CreateFeedData = {
54118
};
55119

56120
export type CreateFeedErrors = {
121+
/**
122+
* returns bad request for invalid input payloads
123+
*/
124+
400: StructuredErrorResponse;
57125
/**
58126
* returns 401 with UNAUTHORIZED error payload
59127
*/
60-
401: {
61-
error: {
62-
code: string;
63-
message: string;
64-
};
65-
success: boolean;
66-
};
128+
401: StructuredErrorResponse;
67129
/**
68130
* returns forbidden for authenticated requests when auto source is disabled
69131
*/
70-
403: {
71-
error: {
72-
code: string;
73-
message: string;
74-
};
75-
success: boolean;
76-
};
132+
403: StructuredErrorResponse;
133+
/**
134+
* returns error when feed creation fails
135+
*/
136+
500: StructuredErrorResponse;
77137
};
78138

79139
export type CreateFeedError = CreateFeedErrors[keyof CreateFeedErrors];
@@ -82,25 +142,7 @@ export type CreateFeedResponses = {
82142
/**
83143
* normalizes hostname-only input to https before feed creation
84144
*/
85-
201: {
86-
data: {
87-
feed: {
88-
created_at: string;
89-
feed_token: string;
90-
id: string;
91-
json_public_url: string;
92-
name: string;
93-
public_url: string;
94-
strategy: string;
95-
updated_at: string;
96-
url: string;
97-
};
98-
};
99-
meta: {
100-
created: boolean;
101-
};
102-
success: boolean;
103-
};
145+
201: FeedCreationResponse;
104146
};
105147

106148
export type CreateFeedResponse = CreateFeedResponses[keyof CreateFeedResponses];
@@ -140,6 +182,41 @@ export type RenderFeedByTokenResponses = {
140182

141183
export type RenderFeedByTokenResponse = RenderFeedByTokenResponses[keyof RenderFeedByTokenResponses];
142184

185+
export type GetFeedStatusData = {
186+
body?: never;
187+
path: {
188+
token: string;
189+
};
190+
query?: never;
191+
url: '/feeds/{token}/status';
192+
};
193+
194+
export type GetFeedStatusErrors = {
195+
/**
196+
* returns unauthorized for invalid tokens
197+
*/
198+
401: StructuredErrorResponse;
199+
/**
200+
* returns forbidden when auto source is disabled
201+
*/
202+
403: StructuredErrorResponse;
203+
/**
204+
* returns non-cacheable status errors when feed resolution fails
205+
*/
206+
500: StructuredErrorResponse;
207+
};
208+
209+
export type GetFeedStatusError = GetFeedStatusErrors[keyof GetFeedStatusErrors];
210+
211+
export type GetFeedStatusResponses = {
212+
/**
213+
* returns structured feed status and preview metadata
214+
*/
215+
200: FeedStatusResponse;
216+
};
217+
218+
export type GetFeedStatusResponse = GetFeedStatusResponses[keyof GetFeedStatusResponses];
219+
143220
export type GetHealthStatusData = {
144221
body?: never;
145222
headers: {
@@ -154,23 +231,11 @@ export type GetHealthStatusErrors = {
154231
/**
155232
* returns 401 with UNAUTHORIZED error payload
156233
*/
157-
401: {
158-
error: {
159-
code: string;
160-
message: string;
161-
};
162-
success: boolean;
163-
};
234+
401: StructuredErrorResponse;
164235
/**
165236
* returns error when configuration fails
166237
*/
167-
500: {
168-
error: {
169-
code: string;
170-
message: string;
171-
};
172-
success: boolean;
173-
};
238+
500: StructuredErrorResponse;
174239
};
175240

176241
export type GetHealthStatusError = GetHealthStatusErrors[keyof GetHealthStatusErrors];

0 commit comments

Comments
 (0)