mirror of https://github.com/halo-dev/halo-admin
feat: add supports for initialize preset plugins
parent
de2612da27
commit
090ed19a26
|
@ -129,13 +129,18 @@ export const ApiConsoleHaloRunV1alpha1PluginApiAxiosParamCreator = function (con
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Install a plugin by uploading a Jar file.
|
* Install a plugin by uploading a Jar file.
|
||||||
* @param {File} file
|
* @param {File} [file]
|
||||||
|
* @param {string} [source] Install source. Default is file.
|
||||||
|
* @param {string} [presetName] Plugin preset name. We will find the plugin from plugin presets
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
installPlugin: async (file: File, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
installPlugin: async (
|
||||||
// verify required parameter 'file' is not null or undefined
|
file?: File,
|
||||||
assertParamExists('installPlugin', 'file', file)
|
source?: string,
|
||||||
|
presetName?: string,
|
||||||
|
options: AxiosRequestConfig = {},
|
||||||
|
): Promise<RequestArgs> => {
|
||||||
const localVarPath = `/apis/api.console.halo.run/v1alpha1/plugins/install`
|
const localVarPath = `/apis/api.console.halo.run/v1alpha1/plugins/install`
|
||||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL)
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL)
|
||||||
|
@ -161,6 +166,14 @@ export const ApiConsoleHaloRunV1alpha1PluginApiAxiosParamCreator = function (con
|
||||||
localVarFormParams.append('file', file as any)
|
localVarFormParams.append('file', file as any)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (source !== undefined) {
|
||||||
|
localVarFormParams.append('source', source as any)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (presetName !== undefined) {
|
||||||
|
localVarFormParams.append('presetName', presetName as any)
|
||||||
|
}
|
||||||
|
|
||||||
localVarHeaderParameter['Content-Type'] = 'multipart/form-data'
|
localVarHeaderParameter['Content-Type'] = 'multipart/form-data'
|
||||||
|
|
||||||
setSearchParams(localVarUrlObj, localVarQueryParameter)
|
setSearchParams(localVarUrlObj, localVarQueryParameter)
|
||||||
|
@ -173,15 +186,50 @@ export const ApiConsoleHaloRunV1alpha1PluginApiAxiosParamCreator = function (con
|
||||||
options: localVarRequestOptions,
|
options: localVarRequestOptions,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* List all plugin presets in the system.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
listPluginPresets: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
const localVarPath = `/apis/api.console.halo.run/v1alpha1/plugin-presets`
|
||||||
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL)
|
||||||
|
let baseOptions
|
||||||
|
if (configuration) {
|
||||||
|
baseOptions = configuration.baseOptions
|
||||||
|
}
|
||||||
|
|
||||||
|
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }
|
||||||
|
const localVarHeaderParameter = {} as any
|
||||||
|
const localVarQueryParameter = {} as any
|
||||||
|
|
||||||
|
// authentication BasicAuth required
|
||||||
|
// http basic authentication required
|
||||||
|
setBasicAuthToObject(localVarRequestOptions, configuration)
|
||||||
|
|
||||||
|
// authentication BearerAuth required
|
||||||
|
// http bearer authentication required
|
||||||
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||||
|
|
||||||
|
setSearchParams(localVarUrlObj, localVarQueryParameter)
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}
|
||||||
|
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: toPathString(localVarUrlObj),
|
||||||
|
options: localVarRequestOptions,
|
||||||
|
}
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* List plugins using query criteria and sort params
|
* List plugins using query criteria and sort params
|
||||||
* @param {Array<string>} [sort] Sort property and direction of the list result. Supported fields: creationTimestamp
|
* @param {Array<string>} [sort] Sort property and direction of the list result. Supported fields: creationTimestamp
|
||||||
* @param {string} [keyword] Keyword of plugin name or description
|
* @param {string} [keyword] Keyword of plugin name or description
|
||||||
* @param {boolean} [enabled] Whether the plugin is enabled
|
* @param {boolean} [enabled] Whether the plugin is enabled
|
||||||
* @param {number} [size] Size of one page. Zero indicates no limit.
|
* @param {number} [size] Size of one page. Zero indicates no limit.
|
||||||
* @param {number} [page] The page number. Zero indicates no page.
|
|
||||||
* @param {Array<string>} [labelSelector] Label selector for filtering.
|
* @param {Array<string>} [labelSelector] Label selector for filtering.
|
||||||
* @param {Array<string>} [fieldSelector] Field selector for filtering.
|
* @param {Array<string>} [fieldSelector] Field selector for filtering.
|
||||||
|
* @param {number} [page] The page number. Zero indicates no page.
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
|
@ -190,9 +238,9 @@ export const ApiConsoleHaloRunV1alpha1PluginApiAxiosParamCreator = function (con
|
||||||
keyword?: string,
|
keyword?: string,
|
||||||
enabled?: boolean,
|
enabled?: boolean,
|
||||||
size?: number,
|
size?: number,
|
||||||
page?: number,
|
|
||||||
labelSelector?: Array<string>,
|
labelSelector?: Array<string>,
|
||||||
fieldSelector?: Array<string>,
|
fieldSelector?: Array<string>,
|
||||||
|
page?: number,
|
||||||
options: AxiosRequestConfig = {},
|
options: AxiosRequestConfig = {},
|
||||||
): Promise<RequestArgs> => {
|
): Promise<RequestArgs> => {
|
||||||
const localVarPath = `/apis/api.console.halo.run/v1alpha1/plugins`
|
const localVarPath = `/apis/api.console.halo.run/v1alpha1/plugins`
|
||||||
|
@ -231,10 +279,6 @@ export const ApiConsoleHaloRunV1alpha1PluginApiAxiosParamCreator = function (con
|
||||||
localVarQueryParameter['size'] = size
|
localVarQueryParameter['size'] = size
|
||||||
}
|
}
|
||||||
|
|
||||||
if (page !== undefined) {
|
|
||||||
localVarQueryParameter['page'] = page
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labelSelector) {
|
if (labelSelector) {
|
||||||
localVarQueryParameter['labelSelector'] = labelSelector
|
localVarQueryParameter['labelSelector'] = labelSelector
|
||||||
}
|
}
|
||||||
|
@ -243,6 +287,10 @@ export const ApiConsoleHaloRunV1alpha1PluginApiAxiosParamCreator = function (con
|
||||||
localVarQueryParameter['fieldSelector'] = fieldSelector
|
localVarQueryParameter['fieldSelector'] = fieldSelector
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (page !== undefined) {
|
||||||
|
localVarQueryParameter['page'] = page
|
||||||
|
}
|
||||||
|
|
||||||
setSearchParams(localVarUrlObj, localVarQueryParameter)
|
setSearchParams(localVarUrlObj, localVarQueryParameter)
|
||||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}
|
||||||
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }
|
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }
|
||||||
|
@ -347,15 +395,21 @@ export const ApiConsoleHaloRunV1alpha1PluginApiAxiosParamCreator = function (con
|
||||||
/**
|
/**
|
||||||
* Upgrade a plugin by uploading a Jar file
|
* Upgrade a plugin by uploading a Jar file
|
||||||
* @param {string} name
|
* @param {string} name
|
||||||
* @param {File} file
|
* @param {File} [file]
|
||||||
|
* @param {string} [source] Install source. Default is file.
|
||||||
|
* @param {string} [presetName] Plugin preset name. We will find the plugin from plugin presets
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
upgradePlugin: async (name: string, file: File, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
upgradePlugin: async (
|
||||||
|
name: string,
|
||||||
|
file?: File,
|
||||||
|
source?: string,
|
||||||
|
presetName?: string,
|
||||||
|
options: AxiosRequestConfig = {},
|
||||||
|
): Promise<RequestArgs> => {
|
||||||
// verify required parameter 'name' is not null or undefined
|
// verify required parameter 'name' is not null or undefined
|
||||||
assertParamExists('upgradePlugin', 'name', name)
|
assertParamExists('upgradePlugin', 'name', name)
|
||||||
// verify required parameter 'file' is not null or undefined
|
|
||||||
assertParamExists('upgradePlugin', 'file', file)
|
|
||||||
const localVarPath = `/apis/api.console.halo.run/v1alpha1/plugins/{name}/upgrade`.replace(
|
const localVarPath = `/apis/api.console.halo.run/v1alpha1/plugins/{name}/upgrade`.replace(
|
||||||
`{${'name'}}`,
|
`{${'name'}}`,
|
||||||
encodeURIComponent(String(name)),
|
encodeURIComponent(String(name)),
|
||||||
|
@ -384,6 +438,14 @@ export const ApiConsoleHaloRunV1alpha1PluginApiAxiosParamCreator = function (con
|
||||||
localVarFormParams.append('file', file as any)
|
localVarFormParams.append('file', file as any)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (source !== undefined) {
|
||||||
|
localVarFormParams.append('source', source as any)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (presetName !== undefined) {
|
||||||
|
localVarFormParams.append('presetName', presetName as any)
|
||||||
|
}
|
||||||
|
|
||||||
localVarHeaderParameter['Content-Type'] = 'multipart/form-data'
|
localVarHeaderParameter['Content-Type'] = 'multipart/form-data'
|
||||||
|
|
||||||
setSearchParams(localVarUrlObj, localVarQueryParameter)
|
setSearchParams(localVarUrlObj, localVarQueryParameter)
|
||||||
|
@ -434,15 +496,30 @@ export const ApiConsoleHaloRunV1alpha1PluginApiFp = function (configuration?: Co
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Install a plugin by uploading a Jar file.
|
* Install a plugin by uploading a Jar file.
|
||||||
* @param {File} file
|
* @param {File} [file]
|
||||||
|
* @param {string} [source] Install source. Default is file.
|
||||||
|
* @param {string} [presetName] Plugin preset name. We will find the plugin from plugin presets
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async installPlugin(
|
async installPlugin(
|
||||||
file: File,
|
file?: File,
|
||||||
|
source?: string,
|
||||||
|
presetName?: string,
|
||||||
options?: AxiosRequestConfig,
|
options?: AxiosRequestConfig,
|
||||||
): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Plugin>> {
|
): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Plugin>> {
|
||||||
const localVarAxiosArgs = await localVarAxiosParamCreator.installPlugin(file, options)
|
const localVarAxiosArgs = await localVarAxiosParamCreator.installPlugin(file, source, presetName, options)
|
||||||
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* List all plugin presets in the system.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async listPluginPresets(
|
||||||
|
options?: AxiosRequestConfig,
|
||||||
|
): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<Plugin>>> {
|
||||||
|
const localVarAxiosArgs = await localVarAxiosParamCreator.listPluginPresets(options)
|
||||||
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
@ -451,9 +528,9 @@ export const ApiConsoleHaloRunV1alpha1PluginApiFp = function (configuration?: Co
|
||||||
* @param {string} [keyword] Keyword of plugin name or description
|
* @param {string} [keyword] Keyword of plugin name or description
|
||||||
* @param {boolean} [enabled] Whether the plugin is enabled
|
* @param {boolean} [enabled] Whether the plugin is enabled
|
||||||
* @param {number} [size] Size of one page. Zero indicates no limit.
|
* @param {number} [size] Size of one page. Zero indicates no limit.
|
||||||
* @param {number} [page] The page number. Zero indicates no page.
|
|
||||||
* @param {Array<string>} [labelSelector] Label selector for filtering.
|
* @param {Array<string>} [labelSelector] Label selector for filtering.
|
||||||
* @param {Array<string>} [fieldSelector] Field selector for filtering.
|
* @param {Array<string>} [fieldSelector] Field selector for filtering.
|
||||||
|
* @param {number} [page] The page number. Zero indicates no page.
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
|
@ -462,9 +539,9 @@ export const ApiConsoleHaloRunV1alpha1PluginApiFp = function (configuration?: Co
|
||||||
keyword?: string,
|
keyword?: string,
|
||||||
enabled?: boolean,
|
enabled?: boolean,
|
||||||
size?: number,
|
size?: number,
|
||||||
page?: number,
|
|
||||||
labelSelector?: Array<string>,
|
labelSelector?: Array<string>,
|
||||||
fieldSelector?: Array<string>,
|
fieldSelector?: Array<string>,
|
||||||
|
page?: number,
|
||||||
options?: AxiosRequestConfig,
|
options?: AxiosRequestConfig,
|
||||||
): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PluginList>> {
|
): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PluginList>> {
|
||||||
const localVarAxiosArgs = await localVarAxiosParamCreator.listPlugins(
|
const localVarAxiosArgs = await localVarAxiosParamCreator.listPlugins(
|
||||||
|
@ -472,9 +549,9 @@ export const ApiConsoleHaloRunV1alpha1PluginApiFp = function (configuration?: Co
|
||||||
keyword,
|
keyword,
|
||||||
enabled,
|
enabled,
|
||||||
size,
|
size,
|
||||||
page,
|
|
||||||
labelSelector,
|
labelSelector,
|
||||||
fieldSelector,
|
fieldSelector,
|
||||||
|
page,
|
||||||
options,
|
options,
|
||||||
)
|
)
|
||||||
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)
|
||||||
|
@ -510,16 +587,20 @@ export const ApiConsoleHaloRunV1alpha1PluginApiFp = function (configuration?: Co
|
||||||
/**
|
/**
|
||||||
* Upgrade a plugin by uploading a Jar file
|
* Upgrade a plugin by uploading a Jar file
|
||||||
* @param {string} name
|
* @param {string} name
|
||||||
* @param {File} file
|
* @param {File} [file]
|
||||||
|
* @param {string} [source] Install source. Default is file.
|
||||||
|
* @param {string} [presetName] Plugin preset name. We will find the plugin from plugin presets
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async upgradePlugin(
|
async upgradePlugin(
|
||||||
name: string,
|
name: string,
|
||||||
file: File,
|
file?: File,
|
||||||
|
source?: string,
|
||||||
|
presetName?: string,
|
||||||
options?: AxiosRequestConfig,
|
options?: AxiosRequestConfig,
|
||||||
): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
||||||
const localVarAxiosArgs = await localVarAxiosParamCreator.upgradePlugin(name, file, options)
|
const localVarAxiosArgs = await localVarAxiosParamCreator.upgradePlugin(name, file, source, presetName, options)
|
||||||
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -567,10 +648,20 @@ export const ApiConsoleHaloRunV1alpha1PluginApiFactory = function (
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
installPlugin(
|
installPlugin(
|
||||||
requestParameters: ApiConsoleHaloRunV1alpha1PluginApiInstallPluginRequest,
|
requestParameters: ApiConsoleHaloRunV1alpha1PluginApiInstallPluginRequest = {},
|
||||||
options?: AxiosRequestConfig,
|
options?: AxiosRequestConfig,
|
||||||
): AxiosPromise<Plugin> {
|
): AxiosPromise<Plugin> {
|
||||||
return localVarFp.installPlugin(requestParameters.file, options).then((request) => request(axios, basePath))
|
return localVarFp
|
||||||
|
.installPlugin(requestParameters.file, requestParameters.source, requestParameters.presetName, options)
|
||||||
|
.then((request) => request(axios, basePath))
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* List all plugin presets in the system.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
listPluginPresets(options?: AxiosRequestConfig): AxiosPromise<Array<Plugin>> {
|
||||||
|
return localVarFp.listPluginPresets(options).then((request) => request(axios, basePath))
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* List plugins using query criteria and sort params
|
* List plugins using query criteria and sort params
|
||||||
|
@ -588,9 +679,9 @@ export const ApiConsoleHaloRunV1alpha1PluginApiFactory = function (
|
||||||
requestParameters.keyword,
|
requestParameters.keyword,
|
||||||
requestParameters.enabled,
|
requestParameters.enabled,
|
||||||
requestParameters.size,
|
requestParameters.size,
|
||||||
requestParameters.page,
|
|
||||||
requestParameters.labelSelector,
|
requestParameters.labelSelector,
|
||||||
requestParameters.fieldSelector,
|
requestParameters.fieldSelector,
|
||||||
|
requestParameters.page,
|
||||||
options,
|
options,
|
||||||
)
|
)
|
||||||
.then((request) => request(axios, basePath))
|
.then((request) => request(axios, basePath))
|
||||||
|
@ -632,7 +723,13 @@ export const ApiConsoleHaloRunV1alpha1PluginApiFactory = function (
|
||||||
options?: AxiosRequestConfig,
|
options?: AxiosRequestConfig,
|
||||||
): AxiosPromise<void> {
|
): AxiosPromise<void> {
|
||||||
return localVarFp
|
return localVarFp
|
||||||
.upgradePlugin(requestParameters.name, requestParameters.file, options)
|
.upgradePlugin(
|
||||||
|
requestParameters.name,
|
||||||
|
requestParameters.file,
|
||||||
|
requestParameters.source,
|
||||||
|
requestParameters.presetName,
|
||||||
|
options,
|
||||||
|
)
|
||||||
.then((request) => request(axios, basePath))
|
.then((request) => request(axios, basePath))
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -677,7 +774,21 @@ export interface ApiConsoleHaloRunV1alpha1PluginApiInstallPluginRequest {
|
||||||
* @type {File}
|
* @type {File}
|
||||||
* @memberof ApiConsoleHaloRunV1alpha1PluginApiInstallPlugin
|
* @memberof ApiConsoleHaloRunV1alpha1PluginApiInstallPlugin
|
||||||
*/
|
*/
|
||||||
readonly file: File
|
readonly file?: File
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Install source. Default is file.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ApiConsoleHaloRunV1alpha1PluginApiInstallPlugin
|
||||||
|
*/
|
||||||
|
readonly source?: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Plugin preset name. We will find the plugin from plugin presets
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ApiConsoleHaloRunV1alpha1PluginApiInstallPlugin
|
||||||
|
*/
|
||||||
|
readonly presetName?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -714,13 +825,6 @@ export interface ApiConsoleHaloRunV1alpha1PluginApiListPluginsRequest {
|
||||||
*/
|
*/
|
||||||
readonly size?: number
|
readonly size?: number
|
||||||
|
|
||||||
/**
|
|
||||||
* The page number. Zero indicates no page.
|
|
||||||
* @type {number}
|
|
||||||
* @memberof ApiConsoleHaloRunV1alpha1PluginApiListPlugins
|
|
||||||
*/
|
|
||||||
readonly page?: number
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Label selector for filtering.
|
* Label selector for filtering.
|
||||||
* @type {Array<string>}
|
* @type {Array<string>}
|
||||||
|
@ -734,6 +838,13 @@ export interface ApiConsoleHaloRunV1alpha1PluginApiListPluginsRequest {
|
||||||
* @memberof ApiConsoleHaloRunV1alpha1PluginApiListPlugins
|
* @memberof ApiConsoleHaloRunV1alpha1PluginApiListPlugins
|
||||||
*/
|
*/
|
||||||
readonly fieldSelector?: Array<string>
|
readonly fieldSelector?: Array<string>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The page number. Zero indicates no page.
|
||||||
|
* @type {number}
|
||||||
|
* @memberof ApiConsoleHaloRunV1alpha1PluginApiListPlugins
|
||||||
|
*/
|
||||||
|
readonly page?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -789,7 +900,21 @@ export interface ApiConsoleHaloRunV1alpha1PluginApiUpgradePluginRequest {
|
||||||
* @type {File}
|
* @type {File}
|
||||||
* @memberof ApiConsoleHaloRunV1alpha1PluginApiUpgradePlugin
|
* @memberof ApiConsoleHaloRunV1alpha1PluginApiUpgradePlugin
|
||||||
*/
|
*/
|
||||||
readonly file: File
|
readonly file?: File
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Install source. Default is file.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ApiConsoleHaloRunV1alpha1PluginApiUpgradePlugin
|
||||||
|
*/
|
||||||
|
readonly source?: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Plugin preset name. We will find the plugin from plugin presets
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ApiConsoleHaloRunV1alpha1PluginApiUpgradePlugin
|
||||||
|
*/
|
||||||
|
readonly presetName?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -839,11 +964,23 @@ export class ApiConsoleHaloRunV1alpha1PluginApi extends BaseAPI {
|
||||||
* @memberof ApiConsoleHaloRunV1alpha1PluginApi
|
* @memberof ApiConsoleHaloRunV1alpha1PluginApi
|
||||||
*/
|
*/
|
||||||
public installPlugin(
|
public installPlugin(
|
||||||
requestParameters: ApiConsoleHaloRunV1alpha1PluginApiInstallPluginRequest,
|
requestParameters: ApiConsoleHaloRunV1alpha1PluginApiInstallPluginRequest = {},
|
||||||
options?: AxiosRequestConfig,
|
options?: AxiosRequestConfig,
|
||||||
) {
|
) {
|
||||||
return ApiConsoleHaloRunV1alpha1PluginApiFp(this.configuration)
|
return ApiConsoleHaloRunV1alpha1PluginApiFp(this.configuration)
|
||||||
.installPlugin(requestParameters.file, options)
|
.installPlugin(requestParameters.file, requestParameters.source, requestParameters.presetName, options)
|
||||||
|
.then((request) => request(this.axios, this.basePath))
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List all plugin presets in the system.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof ApiConsoleHaloRunV1alpha1PluginApi
|
||||||
|
*/
|
||||||
|
public listPluginPresets(options?: AxiosRequestConfig) {
|
||||||
|
return ApiConsoleHaloRunV1alpha1PluginApiFp(this.configuration)
|
||||||
|
.listPluginPresets(options)
|
||||||
.then((request) => request(this.axios, this.basePath))
|
.then((request) => request(this.axios, this.basePath))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -864,9 +1001,9 @@ export class ApiConsoleHaloRunV1alpha1PluginApi extends BaseAPI {
|
||||||
requestParameters.keyword,
|
requestParameters.keyword,
|
||||||
requestParameters.enabled,
|
requestParameters.enabled,
|
||||||
requestParameters.size,
|
requestParameters.size,
|
||||||
requestParameters.page,
|
|
||||||
requestParameters.labelSelector,
|
requestParameters.labelSelector,
|
||||||
requestParameters.fieldSelector,
|
requestParameters.fieldSelector,
|
||||||
|
requestParameters.page,
|
||||||
options,
|
options,
|
||||||
)
|
)
|
||||||
.then((request) => request(this.axios, this.basePath))
|
.then((request) => request(this.axios, this.basePath))
|
||||||
|
@ -916,7 +1053,13 @@ export class ApiConsoleHaloRunV1alpha1PluginApi extends BaseAPI {
|
||||||
options?: AxiosRequestConfig,
|
options?: AxiosRequestConfig,
|
||||||
) {
|
) {
|
||||||
return ApiConsoleHaloRunV1alpha1PluginApiFp(this.configuration)
|
return ApiConsoleHaloRunV1alpha1PluginApiFp(this.configuration)
|
||||||
.upgradePlugin(requestParameters.name, requestParameters.file, options)
|
.upgradePlugin(
|
||||||
|
requestParameters.name,
|
||||||
|
requestParameters.file,
|
||||||
|
requestParameters.source,
|
||||||
|
requestParameters.presetName,
|
||||||
|
options,
|
||||||
|
)
|
||||||
.then((request) => request(this.axios, this.basePath))
|
.then((request) => request(this.axios, this.basePath))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ import type { Configuration } from './configuration'
|
||||||
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'
|
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'
|
||||||
import globalAxios from 'axios'
|
import globalAxios from 'axios'
|
||||||
|
|
||||||
export const BASE_PATH = 'http://localhost:8090'.replace(/\/+$/, '')
|
export const BASE_PATH = 'http://127.0.0.1:8090'.replace(/\/+$/, '')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -58,6 +58,12 @@ export interface PluginStatus {
|
||||||
* @memberof PluginStatus
|
* @memberof PluginStatus
|
||||||
*/
|
*/
|
||||||
logo?: string
|
logo?: string
|
||||||
|
/**
|
||||||
|
* Load location of the plugin, often a path.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof PluginStatus
|
||||||
|
*/
|
||||||
|
loadLocation?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export const PluginStatusPhaseEnum = {
|
export const PluginStatusPhaseEnum = {
|
||||||
|
|
|
@ -83,6 +83,31 @@ const handleSubmit = async () => {
|
||||||
await Promise.all(menuItemPromises);
|
await Promise.all(menuItemPromises);
|
||||||
await apiClient.extension.menu.createv1alpha1Menu({ menu: menu });
|
await apiClient.extension.menu.createv1alpha1Menu({ menu: menu });
|
||||||
|
|
||||||
|
// Install preset plugins
|
||||||
|
const { data: presetPlugins } = await apiClient.plugin.listPluginPresets();
|
||||||
|
const installPluginPromises = presetPlugins.map((plugin) => {
|
||||||
|
return apiClient.plugin.installPlugin({
|
||||||
|
source: "PRESET",
|
||||||
|
presetName: plugin.metadata.name as string,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
const installPluginResponses = await Promise.all(installPluginPromises);
|
||||||
|
|
||||||
|
await Promise.all(
|
||||||
|
installPluginResponses.map((response) => {
|
||||||
|
return apiClient.extension.plugin.updatepluginHaloRunV1alpha1Plugin({
|
||||||
|
name: response.data.metadata.name as string,
|
||||||
|
plugin: {
|
||||||
|
...response.data,
|
||||||
|
spec: {
|
||||||
|
...response.data.spec,
|
||||||
|
enabled: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
// Create system-states ConfigMap
|
// Create system-states ConfigMap
|
||||||
await apiClient.extension.configMap.createv1alpha1ConfigMap({
|
await apiClient.extension.configMap.createv1alpha1ConfigMap({
|
||||||
configMap: {
|
configMap: {
|
||||||
|
|
Loading…
Reference in New Issue