-
Notifications
You must be signed in to change notification settings - Fork 1
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 #25 from comake/version/2.2.0
Version/2.2.0
- Loading branch information
Showing
18 changed files
with
335 additions
and
548 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
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
File renamed without changes.
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,8 +1,9 @@ | ||
import type { ApiSpecOptions } from './ApiSpecOptions'; | ||
import type { OpenApiNamespace } from './openapi-types/OpenApiNamespace'; | ||
import type { OpenApiOperationNamespace } from './openapi-types/OpenApiOperationNamespace'; | ||
|
||
export type ApiOperationNamespace< | ||
export type ApiNamespace< | ||
T extends ApiSpecOptions | ||
> = T['type'] extends 'openapi' | ||
? OpenApiOperationNamespace<T['value'], T['defaultConfiguration']> | ||
? OpenApiOperationNamespace<T['value']> & OpenApiNamespace | ||
: never; |
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,25 @@ | ||
import type { OpenApiClientConfiguration } from '@comake/openapi-operation-executor'; | ||
import type { AxiosRequestConfig } from 'axios'; | ||
|
||
interface BaseApiNamespaceArgs { | ||
defaultConfiguration?: OpenApiClientConfiguration; | ||
defaultOptions?: AxiosRequestConfig; | ||
} | ||
|
||
export class BaseApiNamespace { | ||
public defaultConfiguration: Record<string, any> = {}; | ||
public defaultOptions: AxiosRequestConfig = {}; | ||
|
||
public constructor(args: BaseApiNamespaceArgs) { | ||
this.defaultConfiguration = args.defaultConfiguration ?? {}; | ||
this.defaultOptions = args.defaultOptions ?? {}; | ||
} | ||
|
||
public setDefaultConfiguration(configuration: Record<string, any>): void { | ||
this.defaultConfiguration = configuration; | ||
} | ||
|
||
public setDefaultOptions(options: AxiosRequestConfig): void { | ||
this.defaultOptions = options; | ||
} | ||
} |
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 +1,7 @@ | ||
export type OperationHandler = (args: any, configuration: any, options?: any) => Promise<any>; | ||
import type { AxiosRequestConfig } from 'axios'; | ||
|
||
export type OperationHandler = ( | ||
args?: Record<string, any>, | ||
configuration?: Record<string, any>, | ||
options?: AxiosRequestConfig, | ||
) => Promise<any>; |
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
Oops, something went wrong.