Skip to content

Commit

Permalink
docs(samples): update
Browse files Browse the repository at this point in the history
  • Loading branch information
anymaniax committed May 17, 2024
1 parent c3443f9 commit 246cf4c
Show file tree
Hide file tree
Showing 141 changed files with 21,078 additions and 31,155 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ node_modules
**/dist
.husky
mockServiceWorker.js
yarn.lock
26 changes: 19 additions & 7 deletions samples/angular-app/src/api/endpoints/pets/pets.msw.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.28.2 🍺
* Generated by orval v6.29.0 🍺
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
Expand All @@ -25,13 +25,19 @@ export const getShowPetByIdResponseMock = () =>
tag: faker.helpers.arrayElement([faker.word.sample(), void 0]),
}))();

export const getListPetsMockHandler = (overrideResponse?: Pets) => {
return http.get('*/v:version/pets', async () => {
export const getListPetsMockHandler = (
overrideResponse?:
| Pets
| ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Pets),
) => {
return http.get('*/v:version/pets', async (info) => {
await delay(1000);
return new HttpResponse(
JSON.stringify(
overrideResponse !== undefined
? overrideResponse
? typeof overrideResponse === 'function'
? overrideResponse(info)
: overrideResponse
: getListPetsResponseMock(),
),
{
Expand All @@ -56,13 +62,19 @@ export const getCreatePetsMockHandler = () => {
});
};

export const getShowPetByIdMockHandler = (overrideResponse?: Pet) => {
return http.get('*/v:version/pets/:petId', async () => {
export const getShowPetByIdMockHandler = (
overrideResponse?:
| Pet
| ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Pet),
) => {
return http.get('*/v:version/pets/:petId', async (info) => {
await delay(1000);
return new HttpResponse(
JSON.stringify(
overrideResponse !== undefined
? overrideResponse
? typeof overrideResponse === 'function'
? overrideResponse(info)
: overrideResponse
: getShowPetByIdResponseMock(),
),
{
Expand Down
2 changes: 1 addition & 1 deletion samples/angular-app/src/api/endpoints/pets/pets.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.28.2 🍺
* Generated by orval v6.29.0 🍺
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion samples/angular-app/src/api/model/createPetsBody.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.28.2 🍺
* Generated by orval v6.29.0 🍺
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion samples/angular-app/src/api/model/error.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.28.2 🍺
* Generated by orval v6.29.0 🍺
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion samples/angular-app/src/api/model/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.28.2 🍺
* Generated by orval v6.29.0 🍺
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion samples/angular-app/src/api/model/listPetsParams.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.28.2 🍺
* Generated by orval v6.29.0 🍺
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion samples/angular-app/src/api/model/pet.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.28.2 🍺
* Generated by orval v6.29.0 🍺
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion samples/angular-app/src/api/model/pets.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.28.2 🍺
* Generated by orval v6.29.0 🍺
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
Expand Down
Loading

0 comments on commit 246cf4c

Please sign in to comment.