Skip to content

Commit

Permalink
feat: add mail notiry test. (#639)
Browse files Browse the repository at this point in the history
* build: upgrade to v0.14.4

* feat: add mail notify test endpoint

* build: gen new api-client v0.14.3+2

* optimize: add test mail button in console Setting.vue

* docs: update CHANGELOG.MD
  • Loading branch information
ChiveHao committed Aug 1, 2024
1 parent 91f8715 commit fb71497
Show file tree
Hide file tree
Showing 15 changed files with 320 additions and 36 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

更新日志文档,版本顺序从新到旧,最新版本在最前(上)面。

# 0.14.4

## 新特性

- 控制台(Console)的邮件设置添加邮件测试按钮并对接服务端邮件测试接口

# 0.14.3

## 新特性
Expand Down
2 changes: 2 additions & 0 deletions api/src/main/java/run/ikaros/api/constant/SecurityConst.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ interface Target {
String API_CORE_SUBJECT_SYNC_PLATFORMS = API_PREFIX + "/subject/sync/platforms/**";
String API_CORE_TAG = API_PREFIX + "/tag/**";
String API_CORE_TAGS = API_PREFIX + "/tags/**";
String API_CORE_NOTIFY = API_PREFIX + "/notify/**";
String API_CORE_NOTIFIES = API_PREFIX + "/notifies/**";
String API_CORE_TASK = API_PREFIX + "/task/**";
String API_CORE_TASKS = API_PREFIX + "/tasks/**";
String API_CORE_PLUGIN = API_PREFIX + "/plugin/**";
Expand Down
2 changes: 1 addition & 1 deletion console/packages/api-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ npm publish
选择当前目录下的更改进行`git add .`

```bash
git commit -am "build: gen new api-client v0.14.3+1"
git commit -am "build: gen new api-client v0.14.3+2"
```

合成版(powershell),升级 package.json 版本,并启动服务端后,在 api-client 路径下:
Expand Down
2 changes: 1 addition & 1 deletion console/packages/api-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@runikaros/api-client",
"version": "0.14.3+1",
"version": "0.14.3+2",
"description": "Project ikaros console api-client package",
"type": "module",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions console/packages/api-client/src/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ api/v1alpha1-collection-episode-api.ts
api/v1alpha1-collection-subject-api.ts
api/v1alpha1-episode-api.ts
api/v1alpha1-indices-api.ts
api/v1alpha1-notify-api.ts
api/v1alpha1-plugin-api.ts
api/v1alpha1-role-api.ts
api/v1alpha1-role-authority-api.ts
Expand Down
1 change: 1 addition & 0 deletions console/packages/api-client/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export * from "./api/v1alpha1-collection-episode-api";
export * from "./api/v1alpha1-collection-subject-api";
export * from "./api/v1alpha1-episode-api";
export * from "./api/v1alpha1-indices-api";
export * from "./api/v1alpha1-notify-api";
export * from "./api/v1alpha1-plugin-api";
export * from "./api/v1alpha1-role-api";
export * from "./api/v1alpha1-role-authority-api";
Expand Down
26 changes: 13 additions & 13 deletions console/packages/api-client/src/api/v1alpha1-indices-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,16 @@ export const V1alpha1IndicesApiAxiosParamCreator = function (
* Search subjects with fuzzy query
* @param {string} keyword
* @param {number} [limit]
* @param {string} [highlightPostTag]
* @param {string} [highlightPreTag]
* @param {string} [highlightPostTag]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
searchSubject: async (
keyword: string,
limit?: number,
highlightPostTag?: string,
highlightPreTag?: string,
highlightPostTag?: string,
options: AxiosRequestConfig = {}
): Promise<RequestArgs> => {
// verify required parameter 'keyword' is not null or undefined
Expand Down Expand Up @@ -139,10 +139,6 @@ export const V1alpha1IndicesApiAxiosParamCreator = function (
localVarQueryParameter["limit"] = limit;
}

if (highlightPostTag !== undefined) {
localVarQueryParameter["highlightPostTag"] = highlightPostTag;
}

if (keyword !== undefined) {
localVarQueryParameter["keyword"] = keyword;
}
Expand All @@ -151,6 +147,10 @@ export const V1alpha1IndicesApiAxiosParamCreator = function (
localVarQueryParameter["highlightPreTag"] = highlightPreTag;
}

if (highlightPostTag !== undefined) {
localVarQueryParameter["highlightPostTag"] = highlightPostTag;
}

setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
Expand Down Expand Up @@ -199,25 +199,25 @@ export const V1alpha1IndicesApiFp = function (configuration?: Configuration) {
* Search subjects with fuzzy query
* @param {string} keyword
* @param {number} [limit]
* @param {string} [highlightPostTag]
* @param {string} [highlightPreTag]
* @param {string} [highlightPostTag]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async searchSubject(
keyword: string,
limit?: number,
highlightPostTag?: string,
highlightPreTag?: string,
highlightPostTag?: string,
options?: AxiosRequestConfig
): Promise<
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SubjectHints>
> {
const localVarAxiosArgs = await localVarAxiosParamCreator.searchSubject(
keyword,
limit,
highlightPostTag,
highlightPreTag,
highlightPostTag,
options
);
return createRequestFunction(
Expand Down Expand Up @@ -265,8 +265,8 @@ export const V1alpha1IndicesApiFactory = function (
.searchSubject(
requestParameters.keyword,
requestParameters.limit,
requestParameters.highlightPostTag,
requestParameters.highlightPreTag,
requestParameters.highlightPostTag,
options
)
.then((request) => request(axios, basePath));
Expand Down Expand Up @@ -299,14 +299,14 @@ export interface V1alpha1IndicesApiSearchSubjectRequest {
* @type {string}
* @memberof V1alpha1IndicesApiSearchSubject
*/
readonly highlightPostTag?: string;
readonly highlightPreTag?: string;

/**
*
* @type {string}
* @memberof V1alpha1IndicesApiSearchSubject
*/
readonly highlightPreTag?: string;
readonly highlightPostTag?: string;
}

/**
Expand Down Expand Up @@ -343,8 +343,8 @@ export class V1alpha1IndicesApi extends BaseAPI {
.searchSubject(
requestParameters.keyword,
requestParameters.limit,
requestParameters.highlightPostTag,
requestParameters.highlightPreTag,
requestParameters.highlightPostTag,
options
)
.then((request) => request(this.axios, this.basePath));
Expand Down
170 changes: 170 additions & 0 deletions console/packages/api-client/src/api/v1alpha1-notify-api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
/* tslint:disable */
/* eslint-disable */
/**
* Ikaros Open API Documentation
* Documentation for Ikaros Open API
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import type { Configuration } from "../configuration";
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios";
import globalAxios from "axios";
// Some imports not used depending on template conditions
// @ts-ignore
import {
DUMMY_BASE_URL,
assertParamExists,
setApiKeyToObject,
setBasicAuthToObject,
setBearerAuthToObject,
setOAuthToObject,
setSearchParams,
serializeDataIfNeeded,
toPathString,
createRequestFunction,
} from "../common";
// @ts-ignore
import {
BASE_PATH,
COLLECTION_FORMATS,
RequestArgs,
BaseAPI,
RequiredError,
} from "../base";
/**
* V1alpha1NotifyApi - axios parameter creator
* @export
*/
export const V1alpha1NotifyApiAxiosParamCreator = function (
configuration?: Configuration
) {
return {
/**
* Test mail send
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
testMailSend: async (
options: AxiosRequestConfig = {}
): Promise<RequestArgs> => {
const localVarPath = `/api/v1alpha1/notify/mail/test`;
// 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: "POST",
...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,
};
},
};
};

/**
* V1alpha1NotifyApi - functional programming interface
* @export
*/
export const V1alpha1NotifyApiFp = function (configuration?: Configuration) {
const localVarAxiosParamCreator =
V1alpha1NotifyApiAxiosParamCreator(configuration);
return {
/**
* Test mail send
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async testMailSend(
options?: AxiosRequestConfig
): Promise<
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>
> {
const localVarAxiosArgs = await localVarAxiosParamCreator.testMailSend(
options
);
return createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration
);
},
};
};

/**
* V1alpha1NotifyApi - factory interface
* @export
*/
export const V1alpha1NotifyApiFactory = function (
configuration?: Configuration,
basePath?: string,
axios?: AxiosInstance
) {
const localVarFp = V1alpha1NotifyApiFp(configuration);
return {
/**
* Test mail send
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
testMailSend(options?: AxiosRequestConfig): AxiosPromise<void> {
return localVarFp
.testMailSend(options)
.then((request) => request(axios, basePath));
},
};
};

/**
* V1alpha1NotifyApi - object-oriented interface
* @export
* @class V1alpha1NotifyApi
* @extends {BaseAPI}
*/
export class V1alpha1NotifyApi extends BaseAPI {
/**
* Test mail send
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof V1alpha1NotifyApi
*/
public testMailSend(options?: AxiosRequestConfig) {
return V1alpha1NotifyApiFp(this.configuration)
.testMailSend(options)
.then((request) => request(this.axios, this.basePath));
}
}
Loading

0 comments on commit fb71497

Please sign in to comment.