Skip to content

Commit

Permalink
feat(dependencies): update
Browse files Browse the repository at this point in the history
  • Loading branch information
anymaniax committed Jun 13, 2020
1 parent 918d19d commit 554c842
Show file tree
Hide file tree
Showing 17 changed files with 651 additions and 607 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -89,7 +89,6 @@ typings/
# dotenv environment variables file
.env

public
lib
.cache

Expand Down
51 changes: 13 additions & 38 deletions samples/basic/api/endpoints/petstoreFromFileSpec.ts
@@ -1,11 +1,10 @@
/*
* Generated by orval v2.1.2 馃嵑
* Generated by orval v2.2.2 馃嵑
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
*/
import { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';

import { AxiosInstance, AxiosPromise } from 'axios';
export interface Pet {
id: number;
name: string;
Expand All @@ -21,49 +20,25 @@ export interface Error {

export type listPetsParams = { limit?: number };


export interface SwaggerPetstore {
// List all pets
listPets(
params?: listPetsParams,
): AxiosPromise<Pets>;
listPets(params?: listPetsParams): AxiosPromise<Pets>;
// Create a pet
createPets(

): AxiosPromise<unknown>;
createPets(): AxiosPromise<unknown>;
// Info for a specific pet
showPetById(
petId: string,
testId: string,
): AxiosPromise<Pet>;
showPetById(petId: string, testId: string): AxiosPromise<Pet>;
}


export const getSwaggerPetstore = (axios: AxiosInstance): SwaggerPetstore => ({
listPets(
params?: listPetsParams,
): AxiosPromise<Pets> {
return axios.get(
`/pets`,
{
params,
},
);
listPets(params?: listPetsParams): AxiosPromise<Pets> {
return axios.get(`/pets`, {
params,
});
},
createPets(

): AxiosPromise<unknown> {
return axios.post(
`/pets`,
undefined,
);
createPets(): AxiosPromise<unknown> {
return axios.post(`/pets`, undefined);
},
showPetById(
petId: string,
testId: string,
): AxiosPromise<Pet> {
return axios.get(
`/pets/${petId}/test/${testId}`,
);
showPetById(petId: string, testId: string): AxiosPromise<Pet> {
return axios.get(`/pets/${petId}/test/${testId}`);
},
});
51 changes: 13 additions & 38 deletions samples/basic/api/endpoints/petstoreFromFileSpecWithConfig.ts
@@ -1,11 +1,10 @@
/*
* Generated by orval v2.1.2 馃嵑
* Generated by orval v2.2.2 馃嵑
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
*/
import { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';

import { AxiosInstance, AxiosPromise } from 'axios';
export interface Pet {
id: number;
name: string;
Expand All @@ -21,49 +20,25 @@ export interface Error {

export type listPetsParams = { limit?: number };


export interface SwaggerPetstore {
// List all pets
listPets(
params?: listPetsParams,
): AxiosPromise<Pets>;
listPets(params?: listPetsParams): AxiosPromise<Pets>;
// Create a pet
createPets(

): AxiosPromise<unknown>;
createPets(): AxiosPromise<unknown>;
// Info for a specific pet
showPetById(
petId: string,
testId: string,
): AxiosPromise<Pet>;
showPetById(petId: string, testId: string): AxiosPromise<Pet>;
}


export const getSwaggerPetstore = (axios: AxiosInstance): SwaggerPetstore => ({
listPets(
params?: listPetsParams,
): AxiosPromise<Pets> {
return axios.get(
`/pets`,
{
params,
},
);
listPets(params?: listPetsParams): AxiosPromise<Pets> {
return axios.get(`/pets`, {
params,
});
},
createPets(

): AxiosPromise<unknown> {
return axios.post(
`/pets`,
undefined,
);
createPets(): AxiosPromise<unknown> {
return axios.post(`/pets`, undefined);
},
showPetById(
petId: string,
testId: string,
): AxiosPromise<Pet> {
return axios.get(
`/pets/${petId}/test/${testId}`,
);
showPetById(petId: string, testId: string): AxiosPromise<Pet> {
return axios.get(`/pets/${petId}/test/${testId}`);
},
});
96 changes: 41 additions & 55 deletions samples/basic/api/endpoints/petstoreFromFileSpecWithTransformer.ts
@@ -1,27 +1,18 @@
/*
* Generated by orval v2.1.2 馃嵑
* Generated by orval v2.2.2 馃嵑
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
*/
import { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
import { AxiosInstance, AxiosPromise } from 'axios';
import faker from 'faker';
import {
Pet,
Pets,
listPetsParams,
} from '../model';
import { listPetsParams, Pet, Pets } from '../model';

export interface SwaggerPetstore {
// List all pets
listPets(
params?: listPetsParams,
version?: number,
): AxiosPromise<Pets>;
listPets(params?: listPetsParams, version?: number): AxiosPromise<Pets>;
// Create a pet
createPets(
version?: number,
): AxiosPromise<unknown>;
createPets(version?: number): AxiosPromise<unknown>;
// Info for a specific pet
showPetById(
petId: string,
Expand All @@ -30,58 +21,53 @@ export interface SwaggerPetstore {
): AxiosPromise<Pet>;
}


export const getSwaggerPetstore = (axios: AxiosInstance): SwaggerPetstore => ({
listPets(
params?: listPetsParams,
version = 1,
): AxiosPromise<Pets> {
type Mutator = (url: string, config?: AxiosRequestConfig) => [string, AxiosRequestConfig | undefined]
listPets(params?: listPetsParams, version = 1): AxiosPromise<Pets> {
type Mutator = <T>(url: string, config?: T) => [string, T | undefined];

const mutator: Mutator = (url, config) => [url, { ...config, responseType: 'json' }]
const mutator: Mutator = (url, config) => [
url,
{ ...config, responseType: 'json' },
];

return axios.get(...mutator(
`/v${version}/pets`,
{
return axios.get(
...mutator(`/v${version}/pets`, {
params,
},
));
},
createPets(
version = 1,
): AxiosPromise<unknown> {
return axios.post(
`/v${version}/pets`,
undefined,
}),
);
},
showPetById(
petId: string,
testId: string,
version = 1,
): AxiosPromise<Pet> {
return axios.get(
`/v${version}/pets/${petId}/test/${testId}`,
);
createPets(version = 1): AxiosPromise<unknown> {
return axios.post(`/v${version}/pets`, undefined);
},
showPetById(petId: string, testId: string, version = 1): AxiosPromise<Pet> {
return axios.get(`/v${version}/pets/${petId}/test/${testId}`);
},
});


export const getSwaggerPetstoreMock = (): SwaggerPetstore => ({
listPets(params?: listPetsParams,
version?: number,): AxiosPromise<Pets> {
return Promise.resolve([...Array(faker.random.number({min: 1, max: 10}))].map(() => ({id: 2, name: 'jon', tag: faker.helpers.randomize(['jon', undefined])}))).then(data => ({data})) as AxiosPromise<Pets>
listPets(params?: listPetsParams, version?: number): AxiosPromise<Pets> {
return Promise.resolve(
[...Array(faker.random.number({ min: 1, max: 10 }))].map(() => ({
id: faker.random.number(),
name: faker.random.word(),
tag: faker.helpers.randomize([faker.random.word(), undefined]),
})),
).then((data) => ({ data })) as AxiosPromise<Pets>;
},
createPets(version?: number,): AxiosPromise<unknown> {
return Promise.resolve(undefined).then(data => ({data})) as AxiosPromise<unknown>
createPets(version?: number): AxiosPromise<unknown> {
return Promise.resolve(undefined).then((data) => ({
data,
})) as AxiosPromise<unknown>;
},
showPetById(petId: string,
showPetById(
petId: string,
testId: string,
version?: number,): AxiosPromise<Pet> {
return Promise.resolve((() => ({
id: faker.random.number({ min: 1, max: 99 }),
name: faker.name.firstName(),
tag: faker.helpers.randomize([faker.random.word(), undefined]),
}))()).then(data => ({data})) as AxiosPromise<Pet>
version?: number,
): AxiosPromise<Pet> {
return Promise.resolve({
id: faker.random.number(),
name: faker.random.word(),
tag: faker.helpers.randomize([faker.random.word(), undefined]),
}).then((data) => ({ data })) as AxiosPromise<Pet>;
},
})
});
2 changes: 1 addition & 1 deletion samples/basic/api/model/error.ts
@@ -1,5 +1,5 @@
/*
* Generated by orval v2.1.2 馃嵑
* Generated by orval v2.2.2 馃嵑
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion samples/basic/api/model/listPetsParams.ts
@@ -1,5 +1,5 @@
/*
* Generated by orval v2.1.2 馃嵑
* Generated by orval v2.2.2 馃嵑
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion samples/basic/api/model/pet.ts
@@ -1,5 +1,5 @@
/*
* Generated by orval v2.1.2 馃嵑
* Generated by orval v2.2.2 馃嵑
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion samples/basic/api/model/pets.ts
@@ -1,5 +1,5 @@
/*
* Generated by orval v2.1.2 馃嵑
* Generated by orval v2.2.2 馃嵑
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
Expand Down
19 changes: 14 additions & 5 deletions samples/basic/yarn.lock
Expand Up @@ -14,14 +14,23 @@
resolve "^1.14.2"

"@rollup/plugin-typescript@^4.1.1":
version "4.1.1"
resolved "https://registry.yarnpkg.com/@rollup/plugin-typescript/-/plugin-typescript-4.1.1.tgz#bcb38ca4d89a35da2238a6f1136af460a1b2cb09"
integrity sha512-KYZCn1Iw9hZWkeEPqPs5YjlmvSjR7UdezVca8z0e8rm/29wU24UD9Y4IZHhnc9tm749hzsgBTiOUxA85gfShEQ==
version "4.1.2"
resolved "https://registry.yarnpkg.com/@rollup/plugin-typescript/-/plugin-typescript-4.1.2.tgz#6f910430276ae3e53a47a12ad65820627e7b6ad9"
integrity sha512-+7UlGat/99e2JbmGNnIauxwEhYLwrL7adO/tSJxUN57xrrS3Ps+ZzYpLCDGPZJ57j+ZJTZLLN89KXW9JMEB+jg==
dependencies:
"@rollup/pluginutils" "^3.0.1"
resolve "^1.14.1"

"@rollup/pluginutils@^3.0.1", "@rollup/pluginutils@^3.0.8":
"@rollup/pluginutils@^3.0.1":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b"
integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==
dependencies:
"@types/estree" "0.0.39"
estree-walker "^1.0.1"
picomatch "^2.2.2"

"@rollup/pluginutils@^3.0.8":
version "3.0.9"
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.0.9.tgz#aa6adca2c45e5a1b950103a999e3cddfe49fd775"
integrity sha512-TLZavlfPAZYI7v33wQh4mTP6zojne14yok3DNSLcjoG/Hirxfkonn6icP5rrNWRn8nZsirJBFFpijVOJzkUHDg==
Expand Down Expand Up @@ -385,7 +394,7 @@ path-type@^3.0.0:
dependencies:
pify "^3.0.0"

picomatch@^2.0.5:
picomatch@^2.0.5, picomatch@^2.2.2:
version "2.2.2"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad"
integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==
Expand Down
Binary file added samples/react-app/public/favicon.ico
Binary file not shown.
43 changes: 43 additions & 0 deletions samples/react-app/public/index.html
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
Binary file added samples/react-app/public/logo192.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/react-app/public/logo512.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 554c842

Please sign in to comment.