Skip to content

Commit d24d8f1

Browse files
committed
Updated snapshots
1 parent 30bc235 commit d24d8f1

File tree

1 file changed

+54
-28
lines changed

1 file changed

+54
-28
lines changed

test/__snapshots__/index.spec.ts.snap

Lines changed: 54 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -242,19 +242,19 @@ import { CancelablePromise } from './CancelablePromise';
242242
import type { OnCancel } from './CancelablePromise';
243243
import type { OpenAPIConfig } from './OpenAPI';
244244

245-
const isDefined = <T>(value: T | null | undefined): value is Exclude<T, null | undefined> => {
245+
export const isDefined = <T>(value: T | null | undefined): value is Exclude<T, null | undefined> => {
246246
return value !== undefined && value !== null;
247247
};
248248

249-
const isString = (value: any): value is string => {
249+
export const isString = (value: any): value is string => {
250250
return typeof value === 'string';
251251
};
252252

253-
const isStringWithValue = (value: any): value is string => {
253+
export const isStringWithValue = (value: any): value is string => {
254254
return isString(value) && value !== '';
255255
};
256256

257-
const isBlob = (value: any): value is Blob => {
257+
export const isBlob = (value: any): value is Blob => {
258258
return (
259259
typeof value === 'object' &&
260260
typeof value.type === 'string' &&
@@ -267,11 +267,11 @@ const isBlob = (value: any): value is Blob => {
267267
);
268268
};
269269

270-
const isFormData = (value: any): value is FormData => {
270+
export const isFormData = (value: any): value is FormData => {
271271
return value instanceof FormData;
272272
};
273273

274-
const base64 = (str: string): string => {
274+
export const base64 = (str: string): string => {
275275
try {
276276
return btoa(str);
277277
} catch (err) {
@@ -280,7 +280,7 @@ const base64 = (str: string): string => {
280280
}
281281
};
282282

283-
const getQueryString = (params: Record<string, any>): string => {
283+
export const getQueryString = (params: Record<string, any>): string => {
284284
const qs: string[] = [];
285285

286286
const append = (key: string, value: any) => {
@@ -333,7 +333,7 @@ const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => {
333333
return url;
334334
};
335335

336-
const getFormData = (options: ApiRequestOptions): FormData | undefined => {
336+
export const getFormData = (options: ApiRequestOptions): FormData | undefined => {
337337
if (options.formData) {
338338
const formData = new FormData();
339339

@@ -362,14 +362,14 @@ const getFormData = (options: ApiRequestOptions): FormData | undefined => {
362362

363363
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
364364

365-
const resolve = async <T>(options: ApiRequestOptions, resolver?: T | Resolver<T>): Promise<T | undefined> => {
365+
export const resolve = async <T>(options: ApiRequestOptions, resolver?: T | Resolver<T>): Promise<T | undefined> => {
366366
if (typeof resolver === 'function') {
367367
return (resolver as Resolver<T>)(options);
368368
}
369369
return resolver;
370370
};
371371

372-
const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise<Headers> => {
372+
export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise<Headers> => {
373373
const token = await resolve(options, config.TOKEN);
374374
const username = await resolve(options, config.USERNAME);
375375
const password = await resolve(options, config.PASSWORD);
@@ -410,7 +410,7 @@ const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Pr
410410
return new Headers(headers);
411411
};
412412

413-
const getRequestBody = (options: ApiRequestOptions): any => {
413+
export const getRequestBody = (options: ApiRequestOptions): any => {
414414
if (options.body !== undefined) {
415415
if (options.mediaType?.includes('/json')) {
416416
return JSON.stringify(options.body)
@@ -450,7 +450,7 @@ export const sendRequest = async (
450450
return await fetch(url, request);
451451
};
452452

453-
const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => {
453+
export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => {
454454
if (responseHeader) {
455455
const content = response.headers.get(responseHeader);
456456
if (isString(content)) {
@@ -460,7 +460,7 @@ const getResponseHeader = (response: Response, responseHeader?: string): string
460460
return undefined;
461461
};
462462

463-
const getResponseBody = async (response: Response): Promise<any> => {
463+
export const getResponseBody = async (response: Response): Promise<any> => {
464464
if (response.status !== 204) {
465465
try {
466466
const contentType = response.headers.get('Content-Type');
@@ -480,7 +480,7 @@ const getResponseBody = async (response: Response): Promise<any> => {
480480
return undefined;
481481
};
482482

483-
const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => {
483+
export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => {
484484
const errors: Record<number, string> = {
485485
400: 'Bad Request',
486486
401: 'Unauthorized',
@@ -3337,19 +3337,19 @@ import { CancelablePromise } from './CancelablePromise';
33373337
import type { OnCancel } from './CancelablePromise';
33383338
import type { OpenAPIConfig } from './OpenAPI';
33393339

3340-
const isDefined = <T>(value: T | null | undefined): value is Exclude<T, null | undefined> => {
3340+
export const isDefined = <T>(value: T | null | undefined): value is Exclude<T, null | undefined> => {
33413341
return value !== undefined && value !== null;
33423342
};
33433343

3344-
const isString = (value: any): value is string => {
3344+
export const isString = (value: any): value is string => {
33453345
return typeof value === 'string';
33463346
};
33473347

3348-
const isStringWithValue = (value: any): value is string => {
3348+
export const isStringWithValue = (value: any): value is string => {
33493349
return isString(value) && value !== '';
33503350
};
33513351

3352-
const isBlob = (value: any): value is Blob => {
3352+
export const isBlob = (value: any): value is Blob => {
33533353
return (
33543354
typeof value === 'object' &&
33553355
typeof value.type === 'string' &&
@@ -3362,11 +3362,11 @@ const isBlob = (value: any): value is Blob => {
33623362
);
33633363
};
33643364

3365-
const isFormData = (value: any): value is FormData => {
3365+
export const isFormData = (value: any): value is FormData => {
33663366
return value instanceof FormData;
33673367
};
33683368

3369-
const base64 = (str: string): string => {
3369+
export const base64 = (str: string): string => {
33703370
try {
33713371
return btoa(str);
33723372
} catch (err) {
@@ -3375,7 +3375,7 @@ const base64 = (str: string): string => {
33753375
}
33763376
};
33773377

3378-
const getQueryString = (params: Record<string, any>): string => {
3378+
export const getQueryString = (params: Record<string, any>): string => {
33793379
const qs: string[] = [];
33803380

33813381
const append = (key: string, value: any) => {
@@ -3428,7 +3428,7 @@ const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => {
34283428
return url;
34293429
};
34303430

3431-
const getFormData = (options: ApiRequestOptions): FormData | undefined => {
3431+
export const getFormData = (options: ApiRequestOptions): FormData | undefined => {
34323432
if (options.formData) {
34333433
const formData = new FormData();
34343434

@@ -3457,14 +3457,14 @@ const getFormData = (options: ApiRequestOptions): FormData | undefined => {
34573457

34583458
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
34593459

3460-
const resolve = async <T>(options: ApiRequestOptions, resolver?: T | Resolver<T>): Promise<T | undefined> => {
3460+
export const resolve = async <T>(options: ApiRequestOptions, resolver?: T | Resolver<T>): Promise<T | undefined> => {
34613461
if (typeof resolver === 'function') {
34623462
return (resolver as Resolver<T>)(options);
34633463
}
34643464
return resolver;
34653465
};
34663466

3467-
const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise<Headers> => {
3467+
export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise<Headers> => {
34683468
const token = await resolve(options, config.TOKEN);
34693469
const username = await resolve(options, config.USERNAME);
34703470
const password = await resolve(options, config.PASSWORD);
@@ -3505,7 +3505,7 @@ const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Pr
35053505
return new Headers(headers);
35063506
};
35073507

3508-
const getRequestBody = (options: ApiRequestOptions): any => {
3508+
export const getRequestBody = (options: ApiRequestOptions): any => {
35093509
if (options.body !== undefined) {
35103510
if (options.mediaType?.includes('/json')) {
35113511
return JSON.stringify(options.body)
@@ -3545,7 +3545,7 @@ export const sendRequest = async (
35453545
return await fetch(url, request);
35463546
};
35473547

3548-
const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => {
3548+
export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => {
35493549
if (responseHeader) {
35503550
const content = response.headers.get(responseHeader);
35513551
if (isString(content)) {
@@ -3555,7 +3555,7 @@ const getResponseHeader = (response: Response, responseHeader?: string): string
35553555
return undefined;
35563556
};
35573557

3558-
const getResponseBody = async (response: Response): Promise<any> => {
3558+
export const getResponseBody = async (response: Response): Promise<any> => {
35593559
if (response.status !== 204) {
35603560
try {
35613561
const contentType = response.headers.get('Content-Type');
@@ -3575,7 +3575,7 @@ const getResponseBody = async (response: Response): Promise<any> => {
35753575
return undefined;
35763576
};
35773577

3578-
const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => {
3578+
export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => {
35793579
const errors: Record<number, string> = {
35803580
400: 'Bad Request',
35813581
401: 'Unauthorized',
@@ -3711,6 +3711,7 @@ export type { Pageable } from './models/Pageable';
37113711
export type { SimpleBoolean } from './models/SimpleBoolean';
37123712
export type { SimpleFile } from './models/SimpleFile';
37133713
export type { SimpleInteger } from './models/SimpleInteger';
3714+
export type { SimpleParameter } from './models/SimpleParameter';
37143715
export type { SimpleReference } from './models/SimpleReference';
37153716
export type { SimpleString } from './models/SimpleString';
37163717
export type { SimpleStringWithPattern } from './models/SimpleStringWithPattern';
@@ -3780,6 +3781,7 @@ export { $Pageable } from './schemas/$Pageable';
37803781
export { $SimpleBoolean } from './schemas/$SimpleBoolean';
37813782
export { $SimpleFile } from './schemas/$SimpleFile';
37823783
export { $SimpleInteger } from './schemas/$SimpleInteger';
3784+
export { $SimpleParameter } from './schemas/$SimpleParameter';
37833785
export { $SimpleReference } from './schemas/$SimpleReference';
37843786
export { $SimpleString } from './schemas/$SimpleString';
37853787
export { $SimpleStringWithPattern } from './schemas/$SimpleStringWithPattern';
@@ -4907,6 +4909,19 @@ export type SimpleInteger = number;
49074909
"
49084910
`;
49094911

4912+
exports[`v3 should generate: test/generated/v3/models/SimpleParameter.ts 1`] = `
4913+
"/* istanbul ignore file */
4914+
/* tslint:disable */
4915+
/* eslint-disable */
4916+
4917+
/**
4918+
* This is a reusable parameter
4919+
*/
4920+
export type SimpleParameter = string;
4921+
"
4922+
`;
4923+
4924+
exports[`v3 should generate: test/generated/v3/models/SimpleReference.ts 1`] = `
49104925
"/* istanbul ignore file */
49114926
/* tslint:disable */
49124927
/* eslint-disable */
@@ -6234,6 +6249,17 @@ export const $SimpleInteger = {
62346249
"
62356250
`;
62366251

6252+
exports[`v3 should generate: test/generated/v3/schemas/$SimpleParameter.ts 1`] = `
6253+
"/* istanbul ignore file */
6254+
/* tslint:disable */
6255+
/* eslint-disable */
6256+
export const $SimpleParameter = {
6257+
type: 'string',
6258+
description: \`This is a reusable parameter\`,
6259+
} as const;
6260+
"
6261+
`;
6262+
62376263
exports[`v3 should generate: test/generated/v3/schemas/$SimpleReference.ts 1`] = `
62386264
"/* istanbul ignore file */
62396265
/* tslint:disable */

0 commit comments

Comments
 (0)