Skip to content

Commit 1e71bef

Browse files
committed
chore: update example to latest
1 parent e074588 commit 1e71bef

27 files changed

Lines changed: 55 additions & 41 deletions

File tree

examples/openapi-ts-angular-common/src/client/client/client.gen.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ export const createClient = (config: Config = {}): Client => {
127127

128128
const result: {
129129
request?: HttpRequest<unknown>;
130-
response: any;
130+
response?: any;
131131
} = {
132132
request: undefined,
133-
response: null,
133+
response: undefined,
134134
};
135135

136136
try {
@@ -180,7 +180,7 @@ export const createClient = (config: Config = {}): Client => {
180180
if (fn) {
181181
finalError = (await fn(
182182
finalError,
183-
result.response as any,
183+
result.response,
184184
result.request,
185185
options as any,
186186
)) as string;

examples/openapi-ts-angular-common/src/client/client/types.gen.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ export type RequestResult<
131131
error: TError[keyof TError];
132132
/** request may be undefined, because error may be from building the request object itself */
133133
request?: HttpRequest<unknown>;
134-
response: HttpErrorResponse & {
134+
/** response may be undefined, because error may be from building the request object itself or from a network error */
135+
response?: HttpErrorResponse & {
135136
error: TError[keyof TError] | null;
136137
};
137138
}

examples/openapi-ts-angular-common/src/client/client/utils.gen.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,8 @@ export const mergeHeaders = (
311311

312312
type ErrInterceptor<Err, Res, Req, Options> = (
313313
error: Err,
314-
response: Res,
314+
/** response may be undefined due to a network error where no response object is produced */
315+
response: Res | undefined,
315316
/** request may be undefined, because error may be from building the request object itself */
316317
request: Req | undefined,
317318
options: Options,

examples/openapi-ts-angular/src/client/client/client.gen.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ export const createClient = (config: Config = {}): Client => {
127127

128128
const result: {
129129
request?: HttpRequest<unknown>;
130-
response: any;
130+
response?: any;
131131
} = {
132132
request: undefined,
133-
response: null,
133+
response: undefined,
134134
};
135135

136136
try {
@@ -180,7 +180,7 @@ export const createClient = (config: Config = {}): Client => {
180180
if (fn) {
181181
finalError = (await fn(
182182
finalError,
183-
result.response as any,
183+
result.response,
184184
result.request,
185185
options as any,
186186
)) as string;

examples/openapi-ts-angular/src/client/client/types.gen.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ export type RequestResult<
131131
error: TError[keyof TError];
132132
/** request may be undefined, because error may be from building the request object itself */
133133
request?: HttpRequest<unknown>;
134-
response: HttpErrorResponse & {
134+
/** response may be undefined, because error may be from building the request object itself or from a network error */
135+
response?: HttpErrorResponse & {
135136
error: TError[keyof TError] | null;
136137
};
137138
}

examples/openapi-ts-angular/src/client/client/utils.gen.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,8 @@ export const mergeHeaders = (
311311

312312
type ErrInterceptor<Err, Res, Req, Options> = (
313313
error: Err,
314-
response: Res,
314+
/** response may be undefined due to a network error where no response object is produced */
315+
response: Res | undefined,
315316
/** request may be undefined, because error may be from building the request object itself */
316317
request: Req | undefined,
317318
options: Options,

examples/openapi-ts-fastify/src/client/client/client.gen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export const createClient = (config: Config = {}): Client => {
204204

205205
for (const fn of interceptors.error.fns) {
206206
if (fn) {
207-
finalError = (await fn(error, response, request, options as any)) as unknown;
207+
finalError = (await fn(finalError, response, request, options as any)) as unknown;
208208
}
209209
}
210210

@@ -220,7 +220,7 @@ export const createClient = (config: Config = {}): Client => {
220220
: {
221221
error: finalError,
222222
request,
223-
response: response as any,
223+
response,
224224
};
225225
}
226226
};

examples/openapi-ts-fastify/src/client/client/types.gen.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ export type RequestResult<
126126
) & {
127127
/** request may be undefined, because error may be from building the request object itself */
128128
request?: Request;
129-
response: Response;
129+
/** response may be undefined, because error may be from building the request object itself or from a network error */
130+
response?: Response;
130131
}
131132
>;
132133

examples/openapi-ts-fetch/src/client/client/client.gen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export const createClient = (config: Config = {}): Client => {
204204

205205
for (const fn of interceptors.error.fns) {
206206
if (fn) {
207-
finalError = (await fn(error, response, request, options as any)) as unknown;
207+
finalError = (await fn(finalError, response, request, options as any)) as unknown;
208208
}
209209
}
210210

@@ -220,7 +220,7 @@ export const createClient = (config: Config = {}): Client => {
220220
: {
221221
error: finalError,
222222
request,
223-
response: response as any,
223+
response,
224224
};
225225
}
226226
};

examples/openapi-ts-fetch/src/client/client/types.gen.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ export type RequestResult<
126126
) & {
127127
/** request may be undefined, because error may be from building the request object itself */
128128
request?: Request;
129-
response: Response;
129+
/** response may be undefined, because error may be from building the request object itself or from a network error */
130+
response?: Response;
130131
}
131132
>;
132133

0 commit comments

Comments
 (0)