这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 3 additions & 22 deletions packages/custom-client/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { Selector } from '@hey-api/codegen-core';
import {
type Client,
clientDefaultConfig,
Expand All @@ -8,25 +7,9 @@ import {
definePluginConfig,
} from '@hey-api/openapi-ts';

type SelectorType = 'client';
export type IApi = any;

export type IApi = {
/**
* @param type Selector type.
* @param value Depends on `type`:
* - `client`: never
* @returns Selector array
*/
selector: (type: SelectorType, value?: string) => Selector;
};

export class Api implements IApi {
constructor(public meta: Pick<Config, 'name'>) {}

selector(...args: ReadonlyArray<string | undefined>): Selector {
return [this.meta.name, ...(args as Selector)];
}
}
export class Api implements IApi {}

export type Config = Client.Config & {
/**
Expand All @@ -39,9 +22,7 @@ export type CustomClientPlugin = DefinePlugin<Config, Config, IApi>;

export const defaultConfig: CustomClientPlugin['Config'] = {
...clientDefaultMeta,
api: new Api({
name: '@hey-api/custom-client',
}),
api: new Api(),
config: {
...clientDefaultConfig,
bundle: false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { Selector } from '@hey-api/codegen-core';
import {
type Client,
clientDefaultConfig,
Expand All @@ -8,25 +7,9 @@ import {
definePluginConfig,
} from '@hey-api/openapi-ts';

type SelectorType = 'client';
export type IApi = any;

export type IApi = {
/**
* @param type Selector type.
* @param value Depends on `type`:
* - `client`: never
* @returns Selector array
*/
selector: (type: SelectorType, value?: string) => Selector;
};

export class Api implements IApi {
constructor(public meta: Pick<Config, 'name'>) {}

selector(...args: ReadonlyArray<string | undefined>): Selector {
return [this.meta.name, ...(args as Selector)];
}
}
export class Api implements IApi {}

export type Config = Client.Config & {
/**
Expand All @@ -39,9 +22,7 @@ export type MyClientPlugin = DefinePlugin<Config, Config, IApi>;

export const defaultConfig: MyClientPlugin['Config'] = {
...clientDefaultMeta,
api: new Api({
name: __filename,
}),
api: new Api(),
config: clientDefaultConfig,
handler: clientPluginHandler,
name: __filename,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { Selector } from '@hey-api/codegen-core';
import {
type Client,
clientDefaultConfig,
Expand All @@ -8,25 +7,9 @@ import {
definePluginConfig,
} from '@hey-api/openapi-ts';

type SelectorType = 'client';
export type IApi = any;

export type IApi = {
/**
* @param type Selector type.
* @param value Depends on `type`:
* - `client`: never
* @returns Selector array
*/
selector: (type: SelectorType, value?: string) => Selector;
};

export class Api implements IApi {
constructor(public meta: Pick<Config, 'name'>) {}

selector(...args: ReadonlyArray<string | undefined>): Selector {
return [this.meta.name, ...(args as Selector)];
}
}
export class Api implements IApi {}

export type Config = Client.Config & {
/**
Expand All @@ -39,9 +22,7 @@ export type MyClientPlugin = DefinePlugin<Config, Config, IApi>;

export const defaultConfig: MyClientPlugin['Config'] = {
...clientDefaultMeta,
api: new Api({
name: __filename,
}),
api: new Api(),
config: clientDefaultConfig,
handler: clientPluginHandler,
name: __filename,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { Selector } from '@hey-api/codegen-core';
import {
type Client,
clientDefaultConfig,
Expand All @@ -8,25 +7,9 @@ import {
definePluginConfig,
} from '@hey-api/openapi-ts';

type SelectorType = 'client';
export type IApi = any;

export type IApi = {
/**
* @param type Selector type.
* @param value Depends on `type`:
* - `client`: never
* @returns Selector array
*/
selector: (type: SelectorType, value?: string) => Selector;
};

export class Api implements IApi {
constructor(public meta: Pick<Config, 'name'>) {}

selector(...args: ReadonlyArray<string | undefined>): Selector {
return [this.meta.name, ...(args as Selector)];
}
}
export class Api implements IApi {}

export type Config = Client.Config & {
/**
Expand All @@ -39,9 +22,7 @@ export type MyClientPlugin = DefinePlugin<Config, Config, IApi>;

export const defaultConfig: MyClientPlugin['Config'] = {
...clientDefaultMeta,
api: new Api({
name: __filename,
}),
api: new Api(),
config: clientDefaultConfig,
handler: clientPluginHandler,
name: __filename,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { Selector } from '@hey-api/codegen-core';
import {
type Client,
clientDefaultConfig,
Expand All @@ -8,25 +7,9 @@ import {
definePluginConfig,
} from '@hey-api/openapi-ts';

type SelectorType = 'client';
export type IApi = any;

export type IApi = {
/**
* @param type Selector type.
* @param value Depends on `type`:
* - `client`: never
* @returns Selector array
*/
selector: (type: SelectorType, value?: string) => Selector;
};

export class Api implements IApi {
constructor(public meta: Pick<Config, 'name'>) {}

selector(...args: ReadonlyArray<string | undefined>): Selector {
return [this.meta.name, ...(args as Selector)];
}
}
export class Api implements IApi {}

export type Config = Client.Config & {
/**
Expand All @@ -39,9 +22,7 @@ export type MyClientPlugin = DefinePlugin<Config, Config, IApi>;

export const defaultConfig: MyClientPlugin['Config'] = {
...clientDefaultMeta,
api: new Api({
name: __filename,
}),
api: new Api(),
config: clientDefaultConfig,
handler: clientPluginHandler,
name: __filename,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { Selector } from '@hey-api/codegen-core';
import {
type Client,
clientDefaultConfig,
Expand All @@ -8,25 +7,9 @@ import {
definePluginConfig,
} from '@hey-api/openapi-ts';

type SelectorType = 'client';
export type IApi = any;

export type IApi = {
/**
* @param type Selector type.
* @param value Depends on `type`:
* - `client`: never
* @returns Selector array
*/
selector: (type: SelectorType, value?: string) => Selector;
};

export class Api implements IApi {
constructor(public meta: Pick<Config, 'name'>) {}

selector(...args: ReadonlyArray<string | undefined>): Selector {
return [this.meta.name, ...(args as Selector)];
}
}
export class Api implements IApi {}

export type Config = Client.Config & {
/**
Expand All @@ -39,9 +22,7 @@ export type MyClientPlugin = DefinePlugin<Config, Config, IApi>;

export const defaultConfig: MyClientPlugin['Config'] = {
...clientDefaultMeta,
api: new Api({
name: __filename,
}),
api: new Api(),
config: clientDefaultConfig,
handler: clientPluginHandler,
name: __filename,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { Selector } from '@hey-api/codegen-core';
import {
type Client,
clientDefaultConfig,
Expand All @@ -8,25 +7,9 @@ import {
definePluginConfig,
} from '@hey-api/openapi-ts';

type SelectorType = 'client';
export type IApi = any;

export type IApi = {
/**
* @param type Selector type.
* @param value Depends on `type`:
* - `client`: never
* @returns Selector array
*/
selector: (type: SelectorType, value?: string) => Selector;
};

export class Api implements IApi {
constructor(public meta: Pick<Config, 'name'>) {}

selector(...args: ReadonlyArray<string | undefined>): Selector {
return [this.meta.name, ...(args as Selector)];
}
}
export class Api implements IApi {}

export type Config = Client.Config & {
/**
Expand All @@ -39,9 +22,7 @@ export type MyClientPlugin = DefinePlugin<Config, Config, IApi>;

export const defaultConfig: MyClientPlugin['Config'] = {
...clientDefaultMeta,
api: new Api({
name: __filename,
}),
api: new Api(),
config: clientDefaultConfig,
handler: clientPluginHandler,
name: __filename,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { Selector } from '@hey-api/codegen-core';
import {
type Client,
clientDefaultConfig,
Expand All @@ -8,25 +7,9 @@ import {
definePluginConfig,
} from '@hey-api/openapi-ts';

type SelectorType = 'client';
export type IApi = any;

export type IApi = {
/**
* @param type Selector type.
* @param value Depends on `type`:
* - `client`: never
* @returns Selector array
*/
selector: (type: SelectorType, value?: string) => Selector;
};

export class Api implements IApi {
constructor(public meta: Pick<Config, 'name'>) {}

selector(...args: ReadonlyArray<string | undefined>): Selector {
return [this.meta.name, ...(args as Selector)];
}
}
export class Api implements IApi {}

export type Config = Client.Config & {
/**
Expand All @@ -39,9 +22,7 @@ export type MyClientPlugin = DefinePlugin<Config, Config, IApi>;

export const defaultConfig: MyClientPlugin['Config'] = {
...clientDefaultMeta,
api: new Api({
name: __filename,
}),
api: new Api(),
config: clientDefaultConfig,
handler: clientPluginHandler,
name: __filename,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { Selector } from '@hey-api/codegen-core';
import {
type Client,
clientDefaultConfig,
Expand All @@ -8,25 +7,9 @@ import {
definePluginConfig,
} from '@hey-api/openapi-ts';

type SelectorType = 'client';
export type IApi = any;

export type IApi = {
/**
* @param type Selector type.
* @param value Depends on `type`:
* - `client`: never
* @returns Selector array
*/
selector: (type: SelectorType, value?: string) => Selector;
};

export class Api implements IApi {
constructor(public meta: Pick<Config, 'name'>) {}

selector(...args: ReadonlyArray<string | undefined>): Selector {
return [this.meta.name, ...(args as Selector)];
}
}
export class Api implements IApi {}

export type Config = Client.Config & {
/**
Expand All @@ -39,9 +22,7 @@ export type MyClientPlugin = DefinePlugin<Config, Config, IApi>;

export const defaultConfig: MyClientPlugin['Config'] = {
...clientDefaultMeta,
api: new Api({
name: __filename,
}),
api: new Api(),
config: clientDefaultConfig,
handler: clientPluginHandler,
name: __filename,
Expand Down
Loading
Loading