-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #151 from aspida/develop
chore(release): 0.16.5
- Loading branch information
Showing
17 changed files
with
1,629 additions
and
1,953 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
node_modules | ||
external_refs_sample | ||
samples | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
node_modules | ||
dist | ||
external_refs_sample |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
samples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"recommendations": ["dbaeumer.vscode-eslint"] | ||
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
module.exports = { | ||
import type { Config } from '@jest/types' | ||
|
||
const config: Config.InitialOptions = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
testPathIgnorePatterns: ['samples'], | ||
coveragePathIgnorePatterns: ['samples', 'dist'] | ||
} | ||
|
||
export default config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "openapi2aspida", | ||
"version": "0.16.4", | ||
"version": "0.16.5", | ||
"description": "Convert OpenAPI 3.0 or Swagger 2.0 definitions into aspida", | ||
"author": "Solufa <[email protected]>", | ||
"license": "MIT", | ||
|
@@ -14,8 +14,8 @@ | |
"release:major": "npm run release -- --release-as major", | ||
"release:minor": "npm run release -- --release-as minor", | ||
"release:patch": "npm run release -- --release-as patch", | ||
"lint": "eslint --ext .js,.ts .", | ||
"lint:fix": "npm run lint -- --fix", | ||
"lint": "eslint --ext .ts . && prettier --check \"./**/*.ts\"", | ||
"lint:fix": "eslint --ext .ts . --fix && prettier --write \"./**/*.ts\"", | ||
"test": "jest", | ||
"typecheck": "tsc --noEmit" | ||
}, | ||
|
@@ -46,7 +46,6 @@ | |
"standard", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:jest/recommended", | ||
"plugin:prettier/recommended", | ||
"prettier" | ||
], | ||
"parserOptions": { | ||
|
@@ -84,31 +83,31 @@ | |
] | ||
}, | ||
"dependencies": { | ||
"aspida": "^1.7.0", | ||
"aspida": "^1.7.1", | ||
"js-yaml": "^4.1.0", | ||
"openapi-types": "^8.0.0", | ||
"openapi-types": "^9.1.0", | ||
"swagger-parser": "^10.0.2", | ||
"swagger2openapi": "^7.0.5" | ||
"swagger2openapi": "^7.0.8" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^26.0.23", | ||
"@types/js-yaml": "^4.0.1", | ||
"@types/minimist": "^1.2.1", | ||
"@typescript-eslint/eslint-plugin": "^4.22.1", | ||
"@typescript-eslint/parser": "^4.22.1", | ||
"eslint": "^7.26.0", | ||
"@types/jest": "^26.0.24", | ||
"@types/js-yaml": "^4.0.2", | ||
"@types/minimist": "^1.2.2", | ||
"@typescript-eslint/eslint-plugin": "^4.28.4", | ||
"@typescript-eslint/parser": "^4.28.4", | ||
"eslint": "^7.31.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-config-standard": "^16.0.2", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-jest": "^24.3.6", | ||
"eslint-config-standard": "^16.0.3", | ||
"eslint-plugin-import": "^2.23.4", | ||
"eslint-plugin-jest": "^24.4.0", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-prettier": "^3.4.0", | ||
"eslint-plugin-promise": "^5.1.0", | ||
"eslint-plugin-standard": "^5.0.0", | ||
"jest": "^26.6.3", | ||
"prettier": "^2.3.0", | ||
"standard-version": "^9.3.0", | ||
"ts-jest": "^26.5.6", | ||
"typescript": "^4.2.4" | ||
"jest": "^27.0.6", | ||
"prettier": "^2.3.2", | ||
"standard-version": "^9.3.1", | ||
"ts-jest": "^27.0.4", | ||
"ts-node": "^10.1.0", | ||
"typescript": "^4.3.5" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
openapi: 3.0.0 | ||
info: | ||
version: "1.0.0" | ||
title: "Sample" | ||
paths: | ||
/user: | ||
get: | ||
responses: | ||
"200": | ||
description: "sample" | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
user: | ||
nullable: true | ||
anyOf: | ||
- $ref: "#/components/schemas/User" | ||
components: | ||
schemas: | ||
User: | ||
type: object | ||
properties: | ||
id: | ||
type: string | ||
roles: | ||
type: array | ||
items: | ||
oneOf: | ||
- $ref: "#/components/schemas/RoleA" | ||
- $ref: "#/components/schemas/RoleB" | ||
RoleA: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
RoleB: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
authority: | ||
type: string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* eslint-disable */ | ||
// prettier-ignore | ||
import { AspidaClient, BasicHeaders } from 'aspida' | ||
// prettier-ignore | ||
import { Methods as Methods0 } from './user' | ||
|
||
// prettier-ignore | ||
const api = <T>({ baseURL, fetch }: AspidaClient<T>) => { | ||
const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') | ||
const PATH0 = '/user' | ||
const GET = 'GET' | ||
|
||
return { | ||
user: { | ||
/** | ||
* @returns sample | ||
*/ | ||
get: (option?: { config?: T }) => | ||
fetch<Methods0['get']['resBody'], BasicHeaders, Methods0['get']['status']>(prefix, PATH0, GET, option).json(), | ||
/** | ||
* @returns sample | ||
*/ | ||
$get: (option?: { config?: T }) => | ||
fetch<Methods0['get']['resBody'], BasicHeaders, Methods0['get']['status']>(prefix, PATH0, GET, option).json().then(r => r.body), | ||
$path: () => `${prefix}${PATH0}` | ||
} | ||
} | ||
} | ||
|
||
// prettier-ignore | ||
export type ApiInstance = ReturnType<typeof api> | ||
// prettier-ignore | ||
export default api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* eslint-disable */ | ||
export type User = { | ||
id: string | ||
roles: (RoleA | RoleB)[] | ||
} | ||
|
||
export type RoleA = { | ||
name: string | ||
} | ||
|
||
export type RoleB = { | ||
name: string | ||
authority: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* eslint-disable */ | ||
// prettier-ignore | ||
import { AspidaClient, BasicHeaders } from 'aspida' | ||
// prettier-ignore | ||
import { Methods as Methods0 } from '.' | ||
|
||
// prettier-ignore | ||
const api = <T>({ baseURL, fetch }: AspidaClient<T>) => { | ||
const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, '') | ||
const PATH0 = '/user' | ||
const GET = 'GET' | ||
|
||
return { | ||
/** | ||
* @returns sample | ||
*/ | ||
get: (option?: { config?: T }) => | ||
fetch<Methods0['get']['resBody'], BasicHeaders, Methods0['get']['status']>(prefix, PATH0, GET, option).json(), | ||
/** | ||
* @returns sample | ||
*/ | ||
$get: (option?: { config?: T }) => | ||
fetch<Methods0['get']['resBody'], BasicHeaders, Methods0['get']['status']>(prefix, PATH0, GET, option).json().then(r => r.body), | ||
$path: () => `${prefix}${PATH0}` | ||
} | ||
} | ||
|
||
// prettier-ignore | ||
export type ApiInstance = ReturnType<typeof api> | ||
// prettier-ignore | ||
export default api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* eslint-disable */ | ||
import type * as Types from '../@types' | ||
|
||
export type Methods = { | ||
get: { | ||
status: 200 | ||
|
||
/** sample */ | ||
resBody: { | ||
user: Partial<Types.User> | null | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.