mirror of
https://github.com/ferdikoomen/openapi-typescript-codegen.git
synced 2025-12-08 20:16:21 +00:00
- Adding wip for Angular client
This commit is contained in:
parent
40ef68fec4
commit
975d44e27b
@ -12,7 +12,7 @@ const params = program
|
||||
.version(pkg.version)
|
||||
.requiredOption('-i, --input <value>', 'OpenAPI specification, can be a path, url or string content (required)')
|
||||
.requiredOption('-o, --output <value>', 'Output directory (required)')
|
||||
.option('-c, --client <value>', 'HTTP client to generate [fetch, xhr, node, axios]', 'fetch')
|
||||
.option('-c, --client <value>', 'HTTP client to generate [fetch, xhr, node, axios, angular]', 'fetch')
|
||||
.option('--useOptions', 'Use options instead of arguments')
|
||||
.option('--useUnionTypes', 'Use union types instead of enums')
|
||||
.option('--exportCore <value>', 'Write core files to disk', true)
|
||||
|
||||
23
package.json
23
package.json
@ -58,17 +58,15 @@
|
||||
"codecov": "codecov --token=66c30c23-8954-4892-bef9-fbaed0a2e42b"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node-fetch": "^2.5.12",
|
||||
"abort-controller": "^3.0.0",
|
||||
"axios": "^0.25.0",
|
||||
"camelcase": "^6.3.0",
|
||||
"commander": "^8.3.0",
|
||||
"form-data": "^4.0.0",
|
||||
"handlebars": "^4.7.6",
|
||||
"json-schema-ref-parser": "^9.0.7",
|
||||
"node-fetch": "^2.6.6"
|
||||
"json-schema-ref-parser": "^9.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular/common": "13.1.3",
|
||||
"@angular/core": "13.1.3",
|
||||
"@angular/platform-browser": "13.1.3",
|
||||
"@babel/cli": "7.16.8",
|
||||
"@babel/core": "7.16.12",
|
||||
"@babel/preset-env": "7.16.11",
|
||||
@ -80,18 +78,23 @@
|
||||
"@types/glob": "7.2.0",
|
||||
"@types/jest": "27.4.0",
|
||||
"@types/node": "17.0.10",
|
||||
"@types/node-fetch": "^2.5.12",
|
||||
"@types/qs": "6.9.7",
|
||||
"@typescript-eslint/eslint-plugin": "5.10.0",
|
||||
"@typescript-eslint/parser": "5.10.0",
|
||||
"@typescript-eslint/eslint-plugin": "5.10.1",
|
||||
"@typescript-eslint/parser": "5.10.1",
|
||||
"abort-controller": "^3.0.0",
|
||||
"axios": "^0.25.0",
|
||||
"codecov": "3.8.3",
|
||||
"eslint": "8.7.0",
|
||||
"eslint-config-prettier": "8.3.0",
|
||||
"eslint-plugin-prettier": "4.0.0",
|
||||
"eslint-plugin-simple-import-sort": "7.0.0",
|
||||
"express": "4.17.2",
|
||||
"form-data": "^4.0.0",
|
||||
"glob": "7.2.0",
|
||||
"jest": "27.4.7",
|
||||
"jest-cli": "27.4.7",
|
||||
"node-fetch": "^2.6.6",
|
||||
"prettier": "2.5.1",
|
||||
"puppeteer": "13.1.1",
|
||||
"qs": "6.10.3",
|
||||
@ -99,8 +102,10 @@
|
||||
"rollup": "2.66.0",
|
||||
"rollup-plugin-node-externals": "3.1.2",
|
||||
"rollup-plugin-terser": "7.0.2",
|
||||
"rxjs": "7.5.2",
|
||||
"ts-node": "10.4.0",
|
||||
"tslib": "2.3.1",
|
||||
"typescript": "4.5.5"
|
||||
"typescript": "4.5.5",
|
||||
"zone.js": "0.11.4"
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,4 +3,5 @@ export enum HttpClient {
|
||||
XHR = 'xhr',
|
||||
NODE = 'node',
|
||||
AXIOS = 'axios',
|
||||
ANGULAR = 'angular',
|
||||
}
|
||||
|
||||
42
src/templates/core/angular/getHeaders.hbs
Normal file
42
src/templates/core/angular/getHeaders.hbs
Normal file
@ -0,0 +1,42 @@
|
||||
async function getHeaders(options: ApiRequestOptions): Promise<HttpHeaders> {
|
||||
const token = await resolve(options, OpenAPI.TOKEN);
|
||||
const username = await resolve(options, OpenAPI.USERNAME);
|
||||
const password = await resolve(options, OpenAPI.PASSWORD);
|
||||
const additionalHeaders = await resolve(options, OpenAPI.HEADERS);
|
||||
|
||||
const defaultHeaders = Object.entries({
|
||||
Accept: 'application/json',
|
||||
...additionalHeaders,
|
||||
...options.headers,
|
||||
})
|
||||
.filter(([_, value]) => isDefined(value))
|
||||
.reduce((headers, [key, value]) => ({
|
||||
...headers,
|
||||
[key]: String(value),
|
||||
}), {} as Record<string, string>);
|
||||
|
||||
const headers = new HttpHeaders(defaultHeaders);
|
||||
|
||||
if (isStringWithValue(token)) {
|
||||
headers.append('Authorization', `Bearer ${token}`);
|
||||
}
|
||||
|
||||
if (isStringWithValue(username) && isStringWithValue(password)) {
|
||||
const credentials = base64(`${username}:${password}`);
|
||||
headers.append('Authorization', `Basic ${credentials}`);
|
||||
}
|
||||
|
||||
if (options.body) {
|
||||
if (options.mediaType) {
|
||||
headers.append('Content-Type', options.mediaType);
|
||||
} else if (isBlob(options.body)) {
|
||||
headers.append('Content-Type', options.body.type || 'application/octet-stream');
|
||||
} else if (isString(options.body)) {
|
||||
headers.append('Content-Type', 'text/plain');
|
||||
} else if (!isFormData(options.body)) {
|
||||
headers.append('Content-Type', 'application/json');
|
||||
}
|
||||
}
|
||||
|
||||
return headers;
|
||||
}
|
||||
12
src/templates/core/angular/getRequestBody.hbs
Normal file
12
src/templates/core/angular/getRequestBody.hbs
Normal file
@ -0,0 +1,12 @@
|
||||
function getRequestBody(options: ApiRequestOptions): BodyInit | undefined {
|
||||
if (options.body) {
|
||||
if (options.mediaType?.includes('/json')) {
|
||||
return JSON.stringify(options.body)
|
||||
} else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {
|
||||
return options.body;
|
||||
} else {
|
||||
return JSON.stringify(options.body);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
18
src/templates/core/angular/getResponseBody.hbs
Normal file
18
src/templates/core/angular/getResponseBody.hbs
Normal file
@ -0,0 +1,18 @@
|
||||
async function getResponseBody(response: Response): Promise<any> {
|
||||
if (response.status !== 204) {
|
||||
try {
|
||||
const contentType = response.headers.get('Content-Type');
|
||||
if (contentType) {
|
||||
const isJSON = contentType.toLowerCase().startsWith('application/json');
|
||||
if (isJSON) {
|
||||
return await response.json();
|
||||
} else {
|
||||
return await response.text();
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
9
src/templates/core/angular/getResponseHeader.hbs
Normal file
9
src/templates/core/angular/getResponseHeader.hbs
Normal file
@ -0,0 +1,9 @@
|
||||
function getResponseHeader(response: Response, responseHeader?: string): string | undefined {
|
||||
if (responseHeader) {
|
||||
const content = response.headers.get(responseHeader);
|
||||
if (isString(content)) {
|
||||
return content;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
97
src/templates/core/angular/request.hbs
Normal file
97
src/templates/core/angular/request.hbs
Normal file
@ -0,0 +1,97 @@
|
||||
{{>header}}
|
||||
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { ApiError } from './ApiError';
|
||||
import type { ApiRequestOptions } from './ApiRequestOptions';
|
||||
import type { ApiResult } from './ApiResult';
|
||||
import { CancelablePromise } from './CancelablePromise';
|
||||
import type { OnCancel } from './CancelablePromise';
|
||||
import { OpenAPI } from './OpenAPI';
|
||||
|
||||
{{>functions/isDefined}}
|
||||
|
||||
|
||||
{{>functions/isString}}
|
||||
|
||||
|
||||
{{>functions/isStringWithValue}}
|
||||
|
||||
|
||||
{{>functions/isBlob}}
|
||||
|
||||
|
||||
{{>functions/isFormData}}
|
||||
|
||||
|
||||
{{>functions/base64}}
|
||||
|
||||
|
||||
{{>functions/getQueryString}}
|
||||
|
||||
|
||||
{{>functions/getUrl}}
|
||||
|
||||
|
||||
{{>functions/getFormData}}
|
||||
|
||||
|
||||
{{>functions/resolve}}
|
||||
|
||||
|
||||
{{>angular/getHeaders}}
|
||||
|
||||
|
||||
{{>angular/getRequestBody}}
|
||||
|
||||
|
||||
{{>angular/sendRequest}}
|
||||
|
||||
|
||||
{{>angular/getResponseHeader}}
|
||||
|
||||
|
||||
{{>angular/getResponseBody}}
|
||||
|
||||
|
||||
{{>functions/catchErrors}}
|
||||
|
||||
|
||||
/**
|
||||
* Request using fetch client
|
||||
* @param http The Angular HTTP client
|
||||
* @param options The request options from the service
|
||||
* @returns CancelablePromise<T>
|
||||
* @throws ApiError
|
||||
*/
|
||||
export function request<T>(http: HttpClient, options: ApiRequestOptions): Observable<T> {
|
||||
return new CancelablePromise<T>(async (resolve, reject, onCancel) => {
|
||||
try {
|
||||
const url = getUrl(options);
|
||||
const formData = getFormData(options);
|
||||
const body = getRequestBody(options);
|
||||
const headers = await getHeaders(options);
|
||||
|
||||
if (!onCancel.isCancelled) {
|
||||
const response = await sendRequest(options, url, formData, body, headers, onCancel);
|
||||
const responseBody = await getResponseBody(response);
|
||||
const responseHeader = getResponseHeader(response, options.responseHeader);
|
||||
|
||||
const result: ApiResult = {
|
||||
url,
|
||||
ok: response.ok,
|
||||
status: response.status,
|
||||
statusText: response.statusText,
|
||||
body: responseHeader || responseBody,
|
||||
};
|
||||
|
||||
catchErrors(options, result);
|
||||
|
||||
resolve(result.body);
|
||||
}
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
25
src/templates/core/angular/sendRequest.hbs
Normal file
25
src/templates/core/angular/sendRequest.hbs
Normal file
@ -0,0 +1,25 @@
|
||||
async function sendRequest(
|
||||
options: ApiRequestOptions,
|
||||
url: string,
|
||||
formData: FormData | undefined,
|
||||
body: BodyInit | undefined,
|
||||
headers: Headers,
|
||||
onCancel: OnCancel
|
||||
): Promise<Response> {
|
||||
const controller = new AbortController();
|
||||
|
||||
const request: RequestInit = {
|
||||
headers,
|
||||
body: body || formData,
|
||||
method: options.method,
|
||||
signal: controller.signal,
|
||||
};
|
||||
|
||||
if (OpenAPI.WITH_CREDENTIALS) {
|
||||
request.credentials = OpenAPI.CREDENTIALS;
|
||||
}
|
||||
|
||||
onCancel(() => controller.abort());
|
||||
|
||||
return await fetch(url, request);
|
||||
}
|
||||
@ -65,7 +65,7 @@ import { OpenAPI } from './OpenAPI';
|
||||
* @throws ApiError
|
||||
*/
|
||||
export function request<T>(options: ApiRequestOptions): CancelablePromise<T> {
|
||||
return new CancelablePromise(async (resolve, reject, onCancel) => {
|
||||
return new CancelablePromise<T>(async (resolve, reject, onCancel) => {
|
||||
try {
|
||||
const url = getUrl(options);
|
||||
const formData = getFormData(options);
|
||||
|
||||
@ -62,7 +62,7 @@ import { OpenAPI } from './OpenAPI';
|
||||
* @throws ApiError
|
||||
*/
|
||||
export function request<T>(options: ApiRequestOptions): CancelablePromise<T> {
|
||||
return new CancelablePromise(async (resolve, reject, onCancel) => {
|
||||
return new CancelablePromise<T>(async (resolve, reject, onCancel) => {
|
||||
try {
|
||||
const url = getUrl(options);
|
||||
const formData = getFormData(options);
|
||||
|
||||
@ -66,7 +66,7 @@ import { OpenAPI } from './OpenAPI';
|
||||
* @throws ApiError
|
||||
*/
|
||||
export function request<T>(options: ApiRequestOptions): CancelablePromise<T> {
|
||||
return new CancelablePromise(async (resolve, reject, onCancel) => {
|
||||
return new CancelablePromise<T>(async (resolve, reject, onCancel) => {
|
||||
try {
|
||||
const url = getUrl(options);
|
||||
const formData = getFormData(options);
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
{{~#equals @root.httpClient 'fetch'}}{{>fetch/request}}{{/equals~}}
|
||||
{{~#equals @root.httpClient 'xhr'}}{{>xhr/request}}{{/equals~}}
|
||||
{{~#equals @root.httpClient 'axios'}}{{>axios/request}}{{/equals~}}
|
||||
{{~#equals @root.httpClient 'angular'}}{{>angular/request}}{{/equals~}}
|
||||
{{~#equals @root.httpClient 'node'}}{{>node/request}}{{/equals~}}
|
||||
|
||||
@ -65,7 +65,7 @@ import { OpenAPI } from './OpenAPI';
|
||||
* @throws ApiError
|
||||
*/
|
||||
export function request<T>(options: ApiRequestOptions): CancelablePromise<T> {
|
||||
return new CancelablePromise(async (resolve, reject, onCancel) => {
|
||||
return new CancelablePromise<T>(async (resolve, reject, onCancel) => {
|
||||
try {
|
||||
const url = getUrl(options);
|
||||
const formData = getFormData(options);
|
||||
|
||||
@ -1,17 +1,35 @@
|
||||
{{>header}}
|
||||
|
||||
{{#equals @root.httpClient 'angular'}}
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
{{/equals}}
|
||||
|
||||
{{#if imports}}
|
||||
{{#each imports}}
|
||||
import type { {{{this}}} } from '../models/{{{this}}}';
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
{{#notEquals @root.httpClient 'angular'}}
|
||||
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||
{{/notEquals}}
|
||||
import { request as __request } from '../core/request';
|
||||
{{#if @root.useVersion}}
|
||||
import { OpenAPI } from '../core/OpenAPI';
|
||||
{{/if}}
|
||||
|
||||
{{#equals @root.httpClient 'angular'}}
|
||||
@Injectable()
|
||||
{{/equals}}
|
||||
export class {{{name}}}{{{@root.postfix}}} {
|
||||
{{#equals @root.httpClient 'angular'}}
|
||||
private readonly http: HttpClient;
|
||||
|
||||
constructor(http: HttpClient) {
|
||||
this.http = http;
|
||||
}
|
||||
{{/equals}}
|
||||
|
||||
{{#each operations}}
|
||||
/**
|
||||
@ -36,8 +54,14 @@ export class {{{name}}}{{{@root.postfix}}} {
|
||||
{{/each}}
|
||||
* @throws ApiError
|
||||
*/
|
||||
{{#equals @root.httpClient 'angular'}}
|
||||
public {{{name}}}({{>parameters}}): Observable<{{>result}}> {
|
||||
return __request(this.http, {
|
||||
{{/equals}}
|
||||
{{#notEquals @root.httpClient 'angular'}}
|
||||
public static {{{name}}}({{>parameters}}): CancelablePromise<{{>result}}> {
|
||||
return __request({
|
||||
{{/notEquals}}
|
||||
method: '{{{method}}}',
|
||||
path: `{{{path}}}`,
|
||||
{{#if parametersCookie}}
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
{{~#equals @root.httpClient 'fetch'}}Blob{{/equals~}}
|
||||
{{~#equals @root.httpClient 'xhr'}}Blob{{/equals~}}
|
||||
{{~#equals @root.httpClient 'axios'}}Blob{{/equals~}}
|
||||
{{~#equals @root.httpClient 'angular'}}Blob{{/equals~}}
|
||||
{{~#equals @root.httpClient 'node'}}Blob{{/equals~}}
|
||||
{{~else~}}
|
||||
{{{base}}}
|
||||
|
||||
@ -17,6 +17,12 @@ import fetchGetResponseBody from '../templates/core/fetch/getResponseBody.hbs';
|
||||
import fetchGetResponseHeader from '../templates/core/fetch/getResponseHeader.hbs';
|
||||
import fetchRequest from '../templates/core/fetch/request.hbs';
|
||||
import fetchSendRequest from '../templates/core/fetch/sendRequest.hbs';
|
||||
import angularGetHeaders from '../templates/core/angular/getHeaders.hbs';
|
||||
import angularGetRequestBody from '../templates/core/angular/getRequestBody.hbs';
|
||||
import angularGetResponseBody from '../templates/core/angular/getResponseBody.hbs';
|
||||
import angularGetResponseHeader from '../templates/core/angular/getResponseHeader.hbs';
|
||||
import angularRequest from '../templates/core/angular/request.hbs';
|
||||
import angularSendRequest from '../templates/core/angular/sendRequest.hbs';
|
||||
import functionBase64 from '../templates/core/functions/base64.hbs';
|
||||
import functionCatchErrors from '../templates/core/functions/catchErrors.hbs';
|
||||
import functionGetFormData from '../templates/core/functions/getFormData.hbs';
|
||||
@ -197,5 +203,13 @@ export function registerHandlebarTemplates(root: {
|
||||
Handlebars.registerPartial('axios/sendRequest', Handlebars.template(axiosSendRequest));
|
||||
Handlebars.registerPartial('axios/request', Handlebars.template(axiosRequest));
|
||||
|
||||
// Specific files for the angular client implementation
|
||||
Handlebars.registerPartial('angular/getHeaders', Handlebars.template(angularGetHeaders));
|
||||
Handlebars.registerPartial('angular/getRequestBody', Handlebars.template(angularGetRequestBody));
|
||||
Handlebars.registerPartial('angular/getResponseBody', Handlebars.template(angularGetResponseBody));
|
||||
Handlebars.registerPartial('angular/getResponseHeader', Handlebars.template(angularGetResponseHeader));
|
||||
Handlebars.registerPartial('angular/sendRequest', Handlebars.template(angularSendRequest));
|
||||
Handlebars.registerPartial('angular/request', Handlebars.template(angularRequest));
|
||||
|
||||
return templates;
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ const generate = async (input, output) => {
|
||||
await OpenAPI.generate({
|
||||
input,
|
||||
output,
|
||||
httpClient: OpenAPI.HttpClient.NODE,
|
||||
httpClient: OpenAPI.HttpClient.ANGULAR,
|
||||
useOptions: false,
|
||||
useUnionTypes: false,
|
||||
exportCore: true,
|
||||
|
||||
@ -83,7 +83,7 @@
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "This is the parameter that is send as request body",
|
||||
"description": "This is the parameter that is sent as request body",
|
||||
"name": "parameterBody",
|
||||
"in": "body",
|
||||
"type": "string",
|
||||
@ -162,7 +162,7 @@
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "This is the parameter that is send as request body",
|
||||
"description": "This is the parameter that is sent as request body",
|
||||
"name": "PARAMETER-BODY",
|
||||
"in": "body",
|
||||
"type": "string",
|
||||
@ -568,7 +568,7 @@
|
||||
"operationId": "CollectionFormat",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "This is an array parameter that is send as csv format (comma-separated values)",
|
||||
"description": "This is an array parameter that is sent as csv format (comma-separated values)",
|
||||
"name": "parameterArrayCSV",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
@ -579,7 +579,7 @@
|
||||
"collectionFormat": "csv"
|
||||
},
|
||||
{
|
||||
"description": "This is an array parameter that is send as ssv format (space-separated values)",
|
||||
"description": "This is an array parameter that is sent as ssv format (space-separated values)",
|
||||
"name": "parameterArraySSV",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
@ -590,7 +590,7 @@
|
||||
"collectionFormat": "ssv"
|
||||
},
|
||||
{
|
||||
"description": "This is an array parameter that is send as tsv format (tab-separated values)",
|
||||
"description": "This is an array parameter that is sent as tsv format (tab-separated values)",
|
||||
"name": "parameterArrayTSV",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
@ -601,7 +601,7 @@
|
||||
"collectionFormat": "tsv"
|
||||
},
|
||||
{
|
||||
"description": "This is an array parameter that is send as pipes format (pipe-separated values)",
|
||||
"description": "This is an array parameter that is sent as pipes format (pipe-separated values)",
|
||||
"name": "parameterArrayPipes",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
@ -612,7 +612,7 @@
|
||||
"collectionFormat": "pipes"
|
||||
},
|
||||
{
|
||||
"description": "This is an array parameter that is send as multi format (multiple parameter instances)",
|
||||
"description": "This is an array parameter that is sent as multi format (multiple parameter instances)",
|
||||
"name": "parameterArrayMulti",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
|
||||
@ -808,7 +808,7 @@
|
||||
"operationId": "CollectionFormat",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "This is an array parameter that is send as csv format (comma-separated values)",
|
||||
"description": "This is an array parameter that is sent as csv format (comma-separated values)",
|
||||
"name": "parameterArrayCSV",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
@ -822,7 +822,7 @@
|
||||
"collectionFormat": "csv"
|
||||
},
|
||||
{
|
||||
"description": "This is an array parameter that is send as ssv format (space-separated values)",
|
||||
"description": "This is an array parameter that is sent as ssv format (space-separated values)",
|
||||
"name": "parameterArraySSV",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
@ -836,7 +836,7 @@
|
||||
"collectionFormat": "ssv"
|
||||
},
|
||||
{
|
||||
"description": "This is an array parameter that is send as tsv format (tab-separated values)",
|
||||
"description": "This is an array parameter that is sent as tsv format (tab-separated values)",
|
||||
"name": "parameterArrayTSV",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
@ -850,7 +850,7 @@
|
||||
"collectionFormat": "tsv"
|
||||
},
|
||||
{
|
||||
"description": "This is an array parameter that is send as pipes format (pipe-separated values)",
|
||||
"description": "This is an array parameter that is sent as pipes format (pipe-separated values)",
|
||||
"name": "parameterArrayPipes",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
@ -864,7 +864,7 @@
|
||||
"collectionFormat": "pipes"
|
||||
},
|
||||
{
|
||||
"description": "This is an array parameter that is send as multi format (multiple parameter instances)",
|
||||
"description": "This is an array parameter that is sent as multi format (multiple parameter instances)",
|
||||
"name": "parameterArrayMulti",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
|
||||
@ -14,7 +14,8 @@
|
||||
"noImplicitAny": true,
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"allowSyntheticDefaultImports": true
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"experimentalDecorators": true
|
||||
},
|
||||
|
||||
"files": [
|
||||
|
||||
3
types/index.d.ts
vendored
3
types/index.d.ts
vendored
@ -3,12 +3,13 @@ export declare enum HttpClient {
|
||||
XHR = 'xhr',
|
||||
NODE = 'node',
|
||||
AXIOS = 'axios',
|
||||
ANGULAR = 'angular',
|
||||
}
|
||||
|
||||
export type Options = {
|
||||
input: string | Record<string, any>;
|
||||
output: string;
|
||||
httpClient?: HttpClient | 'fetch' | 'xhr' | 'node' | 'axios';
|
||||
httpClient?: HttpClient | 'fetch' | 'xhr' | 'node' | 'axios' | 'angular';
|
||||
useOptions?: boolean;
|
||||
useUnionTypes?: boolean;
|
||||
exportCore?: boolean;
|
||||
|
||||
131
yarn.lock
131
yarn.lock
@ -2,6 +2,27 @@
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@angular/common@13.1.3":
|
||||
version "13.1.3"
|
||||
resolved "https://registry.yarnpkg.com/@angular/common/-/common-13.1.3.tgz#4c80f45cfd00a17543559c5fbebe0a7a7cf403ed"
|
||||
integrity sha512-8qf5syeXUogf3+GSu6IRJjrk46UKh9L0QuLx+OSIl/df0y1ewx7e28q3BAUEEnOnKrLzpPNxWs2iwModc4KYfg==
|
||||
dependencies:
|
||||
tslib "^2.3.0"
|
||||
|
||||
"@angular/core@13.1.3":
|
||||
version "13.1.3"
|
||||
resolved "https://registry.yarnpkg.com/@angular/core/-/core-13.1.3.tgz#4afd71f674f9ead1aada81315f84846cdba10fa4"
|
||||
integrity sha512-rvCnIAonRx7VnH2Mv9lQR+UYdlFQQetZCjPw8QOswOspEpHpEPDrp1HxDIqJnHxNqW0n8J3Zev/VgQYr0481UA==
|
||||
dependencies:
|
||||
tslib "^2.3.0"
|
||||
|
||||
"@angular/platform-browser@13.1.3":
|
||||
version "13.1.3"
|
||||
resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-13.1.3.tgz#69d90b10e89e11f14f5798d1b6fd788255a6114e"
|
||||
integrity sha512-mnWjdr9UTNZvGk8jPI6O9FIhun8Q/0ghy3dg3I9AfRzEG4vPiIZW1ICksTiB+jV9etzhKpidtmg71bwgeXax1A==
|
||||
dependencies:
|
||||
tslib "^2.3.0"
|
||||
|
||||
"@apidevtools/json-schema-ref-parser@9.0.9":
|
||||
version "9.0.9"
|
||||
resolved "https://registry.yarnpkg.com/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz#d720f9256e3609621280584f2b47ae165359268b"
|
||||
@ -1593,14 +1614,14 @@
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
"@typescript-eslint/eslint-plugin@5.10.0":
|
||||
version "5.10.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.10.0.tgz#e90afea96dff8620892ad216b0e4ccdf8ee32d3a"
|
||||
integrity sha512-XXVKnMsq2fuu9K2KsIxPUGqb6xAImz8MEChClbXmE3VbveFtBUU5bzM6IPVWqzyADIgdkS2Ws/6Xo7W2TeZWjQ==
|
||||
"@typescript-eslint/eslint-plugin@5.10.1":
|
||||
version "5.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.10.1.tgz#870195d0f2146b36d11fc71131b75aba52354c69"
|
||||
integrity sha512-xN3CYqFlyE/qOcy978/L0xLR2HlcAGIyIK5sMOasxaaAPfQRj/MmMV6OC3I7NZO84oEUdWCOju34Z9W8E0pFDQ==
|
||||
dependencies:
|
||||
"@typescript-eslint/scope-manager" "5.10.0"
|
||||
"@typescript-eslint/type-utils" "5.10.0"
|
||||
"@typescript-eslint/utils" "5.10.0"
|
||||
"@typescript-eslint/scope-manager" "5.10.1"
|
||||
"@typescript-eslint/type-utils" "5.10.1"
|
||||
"@typescript-eslint/utils" "5.10.1"
|
||||
debug "^4.3.2"
|
||||
functional-red-black-tree "^1.0.1"
|
||||
ignore "^5.1.8"
|
||||
@ -1608,69 +1629,69 @@
|
||||
semver "^7.3.5"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/parser@5.10.0":
|
||||
version "5.10.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.10.0.tgz#8f59e036f5f1cffc178cacbd5ccdd02aeb96c91c"
|
||||
integrity sha512-pJB2CCeHWtwOAeIxv8CHVGJhI5FNyJAIpx5Pt72YkK3QfEzt6qAlXZuyaBmyfOdM62qU0rbxJzNToPTVeJGrQw==
|
||||
"@typescript-eslint/parser@5.10.1":
|
||||
version "5.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.10.1.tgz#4ce9633cc33fc70bc13786cb793c1a76fe5ad6bd"
|
||||
integrity sha512-GReo3tjNBwR5RnRO0K2wDIDN31cM3MmDtgyQ85oAxAmC5K3j/g85IjP+cDfcqDsDDBf1HNKQAD0WqOYL8jXqUA==
|
||||
dependencies:
|
||||
"@typescript-eslint/scope-manager" "5.10.0"
|
||||
"@typescript-eslint/types" "5.10.0"
|
||||
"@typescript-eslint/typescript-estree" "5.10.0"
|
||||
"@typescript-eslint/scope-manager" "5.10.1"
|
||||
"@typescript-eslint/types" "5.10.1"
|
||||
"@typescript-eslint/typescript-estree" "5.10.1"
|
||||
debug "^4.3.2"
|
||||
|
||||
"@typescript-eslint/scope-manager@5.10.0":
|
||||
version "5.10.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.10.0.tgz#bb5d872e8b9e36203908595507fbc4d3105329cb"
|
||||
integrity sha512-tgNgUgb4MhqK6DoKn3RBhyZ9aJga7EQrw+2/OiDk5hKf3pTVZWyqBi7ukP+Z0iEEDMF5FDa64LqODzlfE4O/Dg==
|
||||
"@typescript-eslint/scope-manager@5.10.1":
|
||||
version "5.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.10.1.tgz#f0539c73804d2423506db2475352a4dec36cd809"
|
||||
integrity sha512-Lyvi559Gvpn94k7+ElXNMEnXu/iundV5uFmCUNnftbFrUbAJ1WBoaGgkbOBm07jVZa682oaBU37ao/NGGX4ZDg==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "5.10.0"
|
||||
"@typescript-eslint/visitor-keys" "5.10.0"
|
||||
"@typescript-eslint/types" "5.10.1"
|
||||
"@typescript-eslint/visitor-keys" "5.10.1"
|
||||
|
||||
"@typescript-eslint/type-utils@5.10.0":
|
||||
version "5.10.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.10.0.tgz#8524b9479c19c478347a7df216827e749e4a51e5"
|
||||
integrity sha512-TzlyTmufJO5V886N+hTJBGIfnjQDQ32rJYxPaeiyWKdjsv2Ld5l8cbS7pxim4DeNs62fKzRSt8Q14Evs4JnZyQ==
|
||||
"@typescript-eslint/type-utils@5.10.1":
|
||||
version "5.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.10.1.tgz#5e526c00142585e40ab1503e83f1ff608c367405"
|
||||
integrity sha512-AfVJkV8uck/UIoDqhu+ptEdBoQATON9GXnhOpPLzkQRJcSChkvD//qsz9JVffl2goxX+ybs5klvacE9vmrQyCw==
|
||||
dependencies:
|
||||
"@typescript-eslint/utils" "5.10.0"
|
||||
"@typescript-eslint/utils" "5.10.1"
|
||||
debug "^4.3.2"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/types@5.10.0":
|
||||
version "5.10.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.10.0.tgz#beb3cb345076f5b088afe996d57bcd1dfddaa75c"
|
||||
integrity sha512-wUljCgkqHsMZbw60IbOqT/puLfyqqD5PquGiBo1u1IS3PLxdi3RDGlyf032IJyh+eQoGhz9kzhtZa+VC4eWTlQ==
|
||||
"@typescript-eslint/types@5.10.1":
|
||||
version "5.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.10.1.tgz#dca9bd4cb8c067fc85304a31f38ec4766ba2d1ea"
|
||||
integrity sha512-ZvxQ2QMy49bIIBpTqFiOenucqUyjTQ0WNLhBM6X1fh1NNlYAC6Kxsx8bRTY3jdYsYg44a0Z/uEgQkohbR0H87Q==
|
||||
|
||||
"@typescript-eslint/typescript-estree@5.10.0":
|
||||
version "5.10.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.0.tgz#4be24a3dea0f930bb1397c46187d0efdd955a224"
|
||||
integrity sha512-x+7e5IqfwLwsxTdliHRtlIYkgdtYXzE0CkFeV6ytAqq431ZyxCFzNMNR5sr3WOlIG/ihVZr9K/y71VHTF/DUQA==
|
||||
"@typescript-eslint/typescript-estree@5.10.1":
|
||||
version "5.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.1.tgz#b268e67be0553f8790ba3fe87113282977adda15"
|
||||
integrity sha512-PwIGnH7jIueXv4opcwEbVGDATjGPO1dx9RkUl5LlHDSe+FXxPwFL5W/qYd5/NHr7f6lo/vvTrAzd0KlQtRusJQ==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "5.10.0"
|
||||
"@typescript-eslint/visitor-keys" "5.10.0"
|
||||
"@typescript-eslint/types" "5.10.1"
|
||||
"@typescript-eslint/visitor-keys" "5.10.1"
|
||||
debug "^4.3.2"
|
||||
globby "^11.0.4"
|
||||
is-glob "^4.0.3"
|
||||
semver "^7.3.5"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/utils@5.10.0":
|
||||
version "5.10.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.10.0.tgz#c3d152a85da77c400e37281355561c72fb1b5a65"
|
||||
integrity sha512-IGYwlt1CVcFoE2ueW4/ioEwybR60RAdGeiJX/iDAw0t5w0wK3S7QncDwpmsM70nKgGTuVchEWB8lwZwHqPAWRg==
|
||||
"@typescript-eslint/utils@5.10.1":
|
||||
version "5.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.10.1.tgz#fa682a33af47080ba2c4368ee0ad2128213a1196"
|
||||
integrity sha512-RRmlITiUbLuTRtn/gcPRi4202niF+q7ylFLCKu4c+O/PcpRvZ/nAUwQ2G00bZgpWkhrNLNnvhZLbDn8Ml0qsQw==
|
||||
dependencies:
|
||||
"@types/json-schema" "^7.0.9"
|
||||
"@typescript-eslint/scope-manager" "5.10.0"
|
||||
"@typescript-eslint/types" "5.10.0"
|
||||
"@typescript-eslint/typescript-estree" "5.10.0"
|
||||
"@typescript-eslint/scope-manager" "5.10.1"
|
||||
"@typescript-eslint/types" "5.10.1"
|
||||
"@typescript-eslint/typescript-estree" "5.10.1"
|
||||
eslint-scope "^5.1.1"
|
||||
eslint-utils "^3.0.0"
|
||||
|
||||
"@typescript-eslint/visitor-keys@5.10.0":
|
||||
version "5.10.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.0.tgz#770215497ad67cd15a572b52089991d5dfe06281"
|
||||
integrity sha512-GMxj0K1uyrFLPKASLmZzCuSddmjZVbVj3Ouy5QVuIGKZopxvOr24JsS7gruz6C3GExE01mublZ3mIBOaon9zuQ==
|
||||
"@typescript-eslint/visitor-keys@5.10.1":
|
||||
version "5.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.1.tgz#29102de692f59d7d34ecc457ed59ab5fc558010b"
|
||||
integrity sha512-NjQ0Xinhy9IL979tpoTRuLKxMc0zJC7QVSdeerXs2/QvOy2yRkzX5dRb10X5woNUdJgU8G3nYRDlI33sq1K4YQ==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "5.10.0"
|
||||
"@typescript-eslint/types" "5.10.1"
|
||||
eslint-visitor-keys "^3.0.0"
|
||||
|
||||
abab@^2.0.3, abab@^2.0.5:
|
||||
@ -4423,6 +4444,13 @@ run-parallel@^1.1.9:
|
||||
dependencies:
|
||||
queue-microtask "^1.2.2"
|
||||
|
||||
rxjs@7.5.2:
|
||||
version "7.5.2"
|
||||
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.2.tgz#11e4a3a1dfad85dbf7fb6e33cbba17668497490b"
|
||||
integrity sha512-PwDt186XaL3QN5qXj/H9DGyHhP3/RYYgZZwqBv9Tv8rsAaiwFH1IsJJlcgD37J7UW5a6O67qX0KWKS3/pu0m4w==
|
||||
dependencies:
|
||||
tslib "^2.1.0"
|
||||
|
||||
safe-buffer@5.2.1, safe-buffer@^5.1.0, safe-buffer@~5.2.0:
|
||||
version "5.2.1"
|
||||
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
|
||||
@ -4825,7 +4853,7 @@ ts-node@10.4.0:
|
||||
make-error "^1.1.1"
|
||||
yn "3.1.1"
|
||||
|
||||
tslib@2.3.1:
|
||||
tslib@2.3.1, tslib@^2.0.0, tslib@^2.1.0, tslib@^2.3.0:
|
||||
version "2.3.1"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01"
|
||||
integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==
|
||||
@ -5156,3 +5184,10 @@ yocto-queue@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251"
|
||||
integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==
|
||||
|
||||
zone.js@0.11.4:
|
||||
version "0.11.4"
|
||||
resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.11.4.tgz#0f70dcf6aba80f698af5735cbb257969396e8025"
|
||||
integrity sha512-DDh2Ab+A/B+9mJyajPjHFPWfYU1H+pdun4wnnk0OcQTNjem1XQSZ2CDW+rfZEUDjv5M19SBqAkjZi0x5wuB5Qw==
|
||||
dependencies:
|
||||
tslib "^2.0.0"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user