init push
This commit is contained in:
59
web/app/src/request/ShareApp.ts
Normal file
59
web/app/src/request/ShareApp.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import { DomainAppInfoResp, DomainResponse } from "./types";
|
||||
|
||||
/**
|
||||
* @description GetAppInfo
|
||||
*
|
||||
* @tags share_app
|
||||
* @name GetShareV1AppWebInfo
|
||||
* @summary GetAppInfo
|
||||
* @request GET:/share/v1/app/web/info
|
||||
* @response `200` `(DomainResponse & {
|
||||
data?: DomainAppInfoResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getShareV1AppWebInfo = (params: RequestParams = {}) =>
|
||||
httpRequest<
|
||||
DomainResponse & {
|
||||
data?: DomainAppInfoResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/v1/app/web/info`,
|
||||
method: "GET",
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description GetWidgetAppInfo
|
||||
*
|
||||
* @tags share_app
|
||||
* @name GetShareV1AppWidgetInfo
|
||||
* @summary GetWidgetAppInfo
|
||||
* @request GET:/share/v1/app/widget/info
|
||||
* @response `200` `DomainResponse` OK
|
||||
*/
|
||||
|
||||
export const getShareV1AppWidgetInfo = (params: RequestParams = {}) =>
|
||||
httpRequest<DomainResponse>({
|
||||
path: `/share/v1/app/widget/info`,
|
||||
method: "GET",
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
100
web/app/src/request/ShareAuth.ts
Normal file
100
web/app/src/request/ShareAuth.ts
Normal file
@@ -0,0 +1,100 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DomainPWResponse,
|
||||
DomainResponse,
|
||||
GithubComChaitinPandaWikiApiShareV1AuthGetResp,
|
||||
V1AuthGitHubReq,
|
||||
V1AuthGitHubResp,
|
||||
V1AuthLoginSimpleReq,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description AuthGet
|
||||
*
|
||||
* @tags share_auth
|
||||
* @name GetShareV1AuthGet
|
||||
* @summary AuthGet
|
||||
* @request GET:/share/v1/auth/get
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiApiShareV1AuthGetResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getShareV1AuthGet = (params: RequestParams = {}) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiApiShareV1AuthGetResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/v1/auth/get`,
|
||||
method: "GET",
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description GitHub登录
|
||||
*
|
||||
* @tags ShareAuth
|
||||
* @name PostShareV1AuthGithub
|
||||
* @summary GitHub登录
|
||||
* @request POST:/share/v1/auth/github
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: V1AuthGitHubResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const postShareV1AuthGithub = (
|
||||
param: V1AuthGitHubReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: V1AuthGitHubResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/v1/auth/github`,
|
||||
method: "POST",
|
||||
body: param,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description AuthLoginSimple
|
||||
*
|
||||
* @tags share_auth
|
||||
* @name PostShareV1AuthLoginSimple
|
||||
* @summary AuthLoginSimple
|
||||
* @request POST:/share/v1/auth/login/simple
|
||||
* @response `200` `DomainResponse` OK
|
||||
*/
|
||||
|
||||
export const postShareV1AuthLoginSimple = (
|
||||
param: V1AuthLoginSimpleReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<DomainResponse>({
|
||||
path: `/share/v1/auth/login/simple`,
|
||||
method: "POST",
|
||||
body: param,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
60
web/app/src/request/ShareCaptcha.ts
Normal file
60
web/app/src/request/ShareCaptcha.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
ConstsRedeemCaptchaReq,
|
||||
GocapChallengeData,
|
||||
GocapVerificationResult,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description CreateCaptcha
|
||||
*
|
||||
* @tags share_captcha
|
||||
* @name PostShareV1CaptchaChallenge
|
||||
* @summary CreateCaptcha
|
||||
* @request POST:/share/v1/captcha/challenge
|
||||
* @response `200` `GocapChallengeData` OK
|
||||
*/
|
||||
|
||||
export const postShareV1CaptchaChallenge = (params: RequestParams = {}) =>
|
||||
httpRequest<GocapChallengeData>({
|
||||
path: `/share/v1/captcha/challenge`,
|
||||
method: "POST",
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description RedeemCaptcha
|
||||
*
|
||||
* @tags share_captcha
|
||||
* @name PostShareV1CaptchaRedeem
|
||||
* @summary RedeemCaptcha
|
||||
* @request POST:/share/v1/captcha/redeem
|
||||
* @response `200` `GocapVerificationResult` OK
|
||||
*/
|
||||
|
||||
export const postShareV1CaptchaRedeem = (
|
||||
body: ConstsRedeemCaptchaReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<GocapVerificationResult>({
|
||||
path: `/share/v1/captcha/redeem`,
|
||||
method: "POST",
|
||||
body: body,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
120
web/app/src/request/ShareChat.ts
Normal file
120
web/app/src/request/ShareChat.ts
Normal file
@@ -0,0 +1,120 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DomainChatRequest,
|
||||
DomainFeedbackRequest,
|
||||
DomainOpenAICompletionsRequest,
|
||||
DomainOpenAICompletionsResponse,
|
||||
DomainResponse,
|
||||
PostShareV1ChatMessageParams,
|
||||
V1WechatAppInfoResp,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description WechatAppInfo
|
||||
*
|
||||
* @tags share_chat
|
||||
* @name GetShareV1AppWechatInfo
|
||||
* @summary WechatAppInfo
|
||||
* @request GET:/share/v1/app/wechat/info
|
||||
* @response `200` `(DomainResponse & {
|
||||
data?: V1WechatAppInfoResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getShareV1AppWechatInfo = (params: RequestParams = {}) =>
|
||||
httpRequest<
|
||||
DomainResponse & {
|
||||
data?: V1WechatAppInfoResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/v1/app/wechat/info`,
|
||||
method: "GET",
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description OpenAI API compatible chat completions endpoint
|
||||
*
|
||||
* @tags share_chat
|
||||
* @name PostShareV1ChatCompletions
|
||||
* @summary ChatCompletions
|
||||
* @request POST:/share/v1/chat/completions
|
||||
* @response `200` `DomainOpenAICompletionsResponse` OK
|
||||
* @response `400` `DomainOpenAIErrorResponse` Bad Request
|
||||
*/
|
||||
|
||||
export const postShareV1ChatCompletions = (
|
||||
request: DomainOpenAICompletionsRequest,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<DomainOpenAICompletionsResponse>({
|
||||
path: `/share/v1/chat/completions`,
|
||||
method: "POST",
|
||||
body: request,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description Process user feedback for chat conversations
|
||||
*
|
||||
* @tags share_chat
|
||||
* @name PostShareV1ChatFeedback
|
||||
* @summary Handle chat feedback
|
||||
* @request POST:/share/v1/chat/feedback
|
||||
* @response `200` `DomainResponse` OK
|
||||
*/
|
||||
|
||||
export const postShareV1ChatFeedback = (
|
||||
request: DomainFeedbackRequest,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<DomainResponse>({
|
||||
path: `/share/v1/chat/feedback`,
|
||||
method: "POST",
|
||||
body: request,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description ChatMessage
|
||||
*
|
||||
* @tags share_chat
|
||||
* @name PostShareV1ChatMessage
|
||||
* @summary ChatMessage
|
||||
* @request POST:/share/v1/chat/message
|
||||
* @response `200` `DomainResponse` OK
|
||||
*/
|
||||
|
||||
export const postShareV1ChatMessage = (
|
||||
query: PostShareV1ChatMessageParams,
|
||||
request: DomainChatRequest,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<DomainResponse>({
|
||||
path: `/share/v1/chat/message`,
|
||||
method: "POST",
|
||||
query: query,
|
||||
body: request,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
48
web/app/src/request/ShareChatSearch.ts
Normal file
48
web/app/src/request/ShareChatSearch.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DomainChatSearchReq,
|
||||
DomainChatSearchResp,
|
||||
DomainResponse,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description ChatSearch
|
||||
*
|
||||
* @tags share_chat_search
|
||||
* @name PostShareV1ChatSearch
|
||||
* @summary ChatSearch
|
||||
* @request POST:/share/v1/chat/search
|
||||
* @response `200` `(DomainResponse & {
|
||||
data?: DomainChatSearchResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const postShareV1ChatSearch = (
|
||||
request: DomainChatSearchReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainResponse & {
|
||||
data?: DomainChatSearchResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/v1/chat/search`,
|
||||
method: "POST",
|
||||
body: request,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
79
web/app/src/request/ShareComment.ts
Normal file
79
web/app/src/request/ShareComment.ts
Normal file
@@ -0,0 +1,79 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DomainCommentReq,
|
||||
DomainPWResponse,
|
||||
GetShareV1CommentListParams,
|
||||
ShareShareCommentLists,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description CreateComment
|
||||
*
|
||||
* @tags share_comment
|
||||
* @name PostShareV1Comment
|
||||
* @summary CreateComment
|
||||
* @request POST:/share/v1/comment
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: string,
|
||||
|
||||
})` CommentID
|
||||
*/
|
||||
|
||||
export const postShareV1Comment = (
|
||||
comment: DomainCommentReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: string;
|
||||
}
|
||||
>({
|
||||
path: `/share/v1/comment`,
|
||||
method: "POST",
|
||||
body: comment,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description GetCommentList
|
||||
*
|
||||
* @tags share_comment
|
||||
* @name GetShareV1CommentList
|
||||
* @summary GetCommentList
|
||||
* @request GET:/share/v1/comment/list
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: ShareShareCommentLists,
|
||||
|
||||
})` CommentList
|
||||
*/
|
||||
|
||||
export const getShareV1CommentList = (
|
||||
query: GetShareV1CommentListParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: ShareShareCommentLists;
|
||||
}
|
||||
>({
|
||||
path: `/share/v1/comment/list`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
48
web/app/src/request/ShareConversation.ts
Normal file
48
web/app/src/request/ShareConversation.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DomainPWResponse,
|
||||
DomainShareConversationDetailResp,
|
||||
GetShareV1ConversationDetailParams,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description GetConversationDetail
|
||||
*
|
||||
* @tags share_conversation
|
||||
* @name GetShareV1ConversationDetail
|
||||
* @summary GetConversationDetail
|
||||
* @request GET:/share/v1/conversation/detail
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: DomainShareConversationDetailResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getShareV1ConversationDetail = (
|
||||
query: GetShareV1ConversationDetailParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: DomainShareConversationDetailResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/v1/conversation/detail`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
80
web/app/src/request/ShareFile.ts
Normal file
80
web/app/src/request/ShareFile.ts
Normal file
@@ -0,0 +1,80 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DomainResponse,
|
||||
PostShareV1CommonFileUploadPayload,
|
||||
V1FileUploadResp,
|
||||
V1ShareFileUploadUrlReq,
|
||||
V1ShareFileUploadUrlResp,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description 前台用户上传文件,目前只支持图片文件上传
|
||||
*
|
||||
* @tags ShareFile
|
||||
* @name PostShareV1CommonFileUpload
|
||||
* @summary 文件上传
|
||||
* @request POST:/share/v1/common/file/upload
|
||||
* @response `200` `(DomainResponse & {
|
||||
data?: V1FileUploadResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const postShareV1CommonFileUpload = (
|
||||
data: PostShareV1CommonFileUploadPayload,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainResponse & {
|
||||
data?: V1FileUploadResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/v1/common/file/upload`,
|
||||
method: "POST",
|
||||
body: data,
|
||||
type: ContentType.FormData,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 前台用户上传文件,目前只支持图片文件上传
|
||||
*
|
||||
* @tags ShareFile
|
||||
* @name PostShareV1CommonFileUploadUrl
|
||||
* @summary 文件上传
|
||||
* @request POST:/share/v1/common/file/upload/url
|
||||
* @response `200` `(DomainResponse & {
|
||||
data?: V1ShareFileUploadUrlResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const postShareV1CommonFileUploadUrl = (
|
||||
body: V1ShareFileUploadUrlReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainResponse & {
|
||||
data?: V1ShareFileUploadUrlResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/v1/common/file/upload/url`,
|
||||
method: "POST",
|
||||
body: body,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
37
web/app/src/request/ShareNav.ts
Normal file
37
web/app/src/request/ShareNav.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import { DomainResponse, GetShareV1NavListParams } from "./types";
|
||||
|
||||
/**
|
||||
* @description ShareNavList
|
||||
*
|
||||
* @tags share_nav
|
||||
* @name GetShareV1NavList
|
||||
* @summary 前台获取栏目列表
|
||||
* @request GET:/share/v1/nav/list
|
||||
* @response `200` `DomainResponse` OK
|
||||
*/
|
||||
|
||||
export const getShareV1NavList = (
|
||||
query: GetShareV1NavListParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<DomainResponse>({
|
||||
path: `/share/v1/nav/list`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
67
web/app/src/request/ShareNode.ts
Normal file
67
web/app/src/request/ShareNode.ts
Normal file
@@ -0,0 +1,67 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DomainResponse,
|
||||
GetShareV1NodeDetailParams,
|
||||
V1ShareNodeDetailResp,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description GetNodeDetail
|
||||
*
|
||||
* @tags share_node
|
||||
* @name GetShareV1NodeDetail
|
||||
* @summary GetNodeDetail
|
||||
* @request GET:/share/v1/node/detail
|
||||
* @response `200` `(DomainResponse & {
|
||||
data?: V1ShareNodeDetailResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getShareV1NodeDetail = (
|
||||
query: GetShareV1NodeDetailParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainResponse & {
|
||||
data?: V1ShareNodeDetailResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/v1/node/detail`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description ShareNodeList
|
||||
*
|
||||
* @tags share_node
|
||||
* @name GetShareV1NodeList
|
||||
* @summary ShareNodeList
|
||||
* @request GET:/share/v1/node/list
|
||||
* @response `200` `DomainResponse` OK
|
||||
*/
|
||||
|
||||
export const getShareV1NodeList = (params: RequestParams = {}) =>
|
||||
httpRequest<DomainResponse>({
|
||||
path: `/share/v1/node/list`,
|
||||
method: "GET",
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
71
web/app/src/request/ShareOpenapi.ts
Normal file
71
web/app/src/request/ShareOpenapi.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DomainPWResponse,
|
||||
GetShareV1OpenapiGithubCallbackParams,
|
||||
GithubComChaitinPandaWikiApiShareV1GitHubCallbackResp,
|
||||
PostShareV1OpenapiLarkBotKbIdParams,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description GitHub回调
|
||||
*
|
||||
* @tags ShareOpenapi
|
||||
* @name GetShareV1OpenapiGithubCallback
|
||||
* @summary GitHub回调
|
||||
* @request GET:/share/v1/openapi/github/callback
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiApiShareV1GitHubCallbackResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getShareV1OpenapiGithubCallback = (
|
||||
query: GetShareV1OpenapiGithubCallbackParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiApiShareV1GitHubCallbackResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/v1/openapi/github/callback`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description Lark机器人请求
|
||||
*
|
||||
* @tags ShareOpenapi
|
||||
* @name PostShareV1OpenapiLarkBotKbId
|
||||
* @summary Lark机器人请求
|
||||
* @request POST:/share/v1/openapi/lark/bot/{kb_id}
|
||||
* @response `200` `DomainPWResponse` OK
|
||||
*/
|
||||
|
||||
export const postShareV1OpenapiLarkBotKbId = (
|
||||
{ kbId, ...query }: PostShareV1OpenapiLarkBotKbIdParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<DomainPWResponse>({
|
||||
path: `/share/v1/openapi/lark/bot/${kbId}`,
|
||||
method: "POST",
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
37
web/app/src/request/ShareStat.ts
Normal file
37
web/app/src/request/ShareStat.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import { DomainResponse, DomainStatPageReq } from "./types";
|
||||
|
||||
/**
|
||||
* @description RecordPage
|
||||
*
|
||||
* @tags share_stat
|
||||
* @name PostShareV1StatPage
|
||||
* @summary RecordPage
|
||||
* @request POST:/share/v1/stat/page
|
||||
* @response `200` `DomainResponse` OK
|
||||
*/
|
||||
|
||||
export const postShareV1StatPage = (
|
||||
request: DomainStatPageReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<DomainResponse>({
|
||||
path: `/share/v1/stat/page`,
|
||||
method: "POST",
|
||||
body: request,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
40
web/app/src/request/Wechat.ts
Normal file
40
web/app/src/request/Wechat.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DomainResponse,
|
||||
GetShareV1AppWechatServiceAnswerParams,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description GetWechatAnswer
|
||||
*
|
||||
* @tags Wechat
|
||||
* @name GetShareV1AppWechatServiceAnswer
|
||||
* @summary GetWechatAnswer
|
||||
* @request GET:/share/v1/app/wechat/service/answer
|
||||
* @response `200` `DomainResponse` OK
|
||||
*/
|
||||
|
||||
export const getShareV1AppWechatServiceAnswer = (
|
||||
query: GetShareV1AppWechatServiceAnswerParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<DomainResponse>({
|
||||
path: `/share/v1/app/wechat/service/answer`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
75
web/app/src/request/Widget.ts
Normal file
75
web/app/src/request/Widget.ts
Normal file
@@ -0,0 +1,75 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DomainChatRequest,
|
||||
DomainChatSearchReq,
|
||||
DomainChatSearchResp,
|
||||
DomainResponse,
|
||||
PostShareV1ChatWidgetParams,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description ChatWidget
|
||||
*
|
||||
* @tags Widget
|
||||
* @name PostShareV1ChatWidget
|
||||
* @summary ChatWidget
|
||||
* @request POST:/share/v1/chat/widget
|
||||
* @response `200` `DomainResponse` OK
|
||||
*/
|
||||
|
||||
export const postShareV1ChatWidget = (
|
||||
query: PostShareV1ChatWidgetParams,
|
||||
request: DomainChatRequest,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<DomainResponse>({
|
||||
path: `/share/v1/chat/widget`,
|
||||
method: "POST",
|
||||
query: query,
|
||||
body: request,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description WidgetSearch
|
||||
*
|
||||
* @tags Widget
|
||||
* @name PostShareV1ChatWidgetSearch
|
||||
* @summary WidgetSearch
|
||||
* @request POST:/share/v1/chat/widget/search
|
||||
* @response `200` `(DomainResponse & {
|
||||
data?: DomainChatSearchResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const postShareV1ChatWidgetSearch = (
|
||||
request: DomainChatSearchReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainResponse & {
|
||||
data?: DomainChatSearchResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/v1/chat/widget/search`,
|
||||
method: "POST",
|
||||
body: request,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
348
web/app/src/request/httpClient.ts
Normal file
348
web/app/src/request/httpClient.ts
Normal file
@@ -0,0 +1,348 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import {
|
||||
getServerBasePath,
|
||||
getServerHeader,
|
||||
getServerPathname,
|
||||
getServerSearch,
|
||||
} from "@/utils/getServerHeader";
|
||||
import { message as alert } from "@ctzhian/ui";
|
||||
import { redirect } from "next/navigation";
|
||||
export type QueryParamsType = Record<string | number, any>;
|
||||
export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
|
||||
|
||||
export interface FullRequestParams extends Omit<RequestInit, "body"> {
|
||||
/** set parameter to `true` for call `securityWorker` for this request */
|
||||
secure?: boolean;
|
||||
/** request path */
|
||||
path: string;
|
||||
/** content type of request body */
|
||||
type?: ContentType;
|
||||
/** query params */
|
||||
query?: QueryParamsType;
|
||||
/** format of response (i.e. response.json() -> format: "json") */
|
||||
format?: ResponseFormat;
|
||||
/** request body */
|
||||
body?: unknown;
|
||||
/** base url */
|
||||
baseUrl?: string;
|
||||
/** request cancellation token */
|
||||
cancelToken?: CancelToken;
|
||||
}
|
||||
|
||||
export type RequestParams = Omit<
|
||||
FullRequestParams,
|
||||
"body" | "method" | "query" | "path"
|
||||
> & { isAlert?: boolean };
|
||||
|
||||
export interface DomainResponse {
|
||||
/** @example 200 */
|
||||
code?: number;
|
||||
data?: any;
|
||||
/** @example "OK" */
|
||||
message?: string;
|
||||
}
|
||||
|
||||
type ExtractDataProp<T> = T extends { data?: infer U } ? U : never;
|
||||
|
||||
export interface ApiConfig<SecurityDataType = unknown> {
|
||||
baseUrl?: string;
|
||||
baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
|
||||
securityWorker?: (
|
||||
securityData: SecurityDataType | null,
|
||||
) => Promise<RequestParams | void> | RequestParams | void;
|
||||
customFetch?: typeof fetch;
|
||||
}
|
||||
|
||||
export interface HttpResponse<D extends unknown, E extends unknown = unknown>
|
||||
extends Response {
|
||||
data: D;
|
||||
error: E;
|
||||
}
|
||||
|
||||
type CancelToken = Symbol | string | number;
|
||||
|
||||
export enum ContentType {
|
||||
Json = "application/json",
|
||||
FormData = "multipart/form-data",
|
||||
UrlEncoded = "application/x-www-form-urlencoded",
|
||||
Text = "text/plain",
|
||||
}
|
||||
|
||||
const pathnameWhiteList = ["/auth/login"];
|
||||
|
||||
const redirectToLogin = () => {
|
||||
const redirectAfterLogin = encodeURIComponent(
|
||||
location.href.replace(location.origin, ""),
|
||||
);
|
||||
const search = `redirect=${redirectAfterLogin}`;
|
||||
const pathname = `${window._BASE_PATH_ || ""}/auth/login`;
|
||||
window.location.href = [pathname, search]?.join("?");
|
||||
};
|
||||
|
||||
export class HttpClient<SecurityDataType = unknown> {
|
||||
public baseUrl: string = "";
|
||||
private securityData: SecurityDataType | null = null;
|
||||
private securityWorker?: ApiConfig<SecurityDataType>["securityWorker"];
|
||||
private abortControllers = new Map<CancelToken, AbortController>();
|
||||
private customFetch = (...fetchParams: Parameters<typeof fetch>) =>
|
||||
fetch(...fetchParams);
|
||||
|
||||
private baseApiParams: RequestParams = {
|
||||
credentials: "same-origin",
|
||||
headers: {},
|
||||
redirect: "follow",
|
||||
referrerPolicy: "no-referrer",
|
||||
};
|
||||
|
||||
constructor(apiConfig: ApiConfig<SecurityDataType> = {}) {
|
||||
Object.assign(this, apiConfig);
|
||||
}
|
||||
|
||||
public setSecurityData = (data: SecurityDataType | null) => {
|
||||
this.securityData = data;
|
||||
};
|
||||
|
||||
protected encodeQueryParam(key: string, value: any) {
|
||||
const encodedKey = encodeURIComponent(key);
|
||||
return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`;
|
||||
}
|
||||
|
||||
protected addQueryParam(query: QueryParamsType, key: string) {
|
||||
return this.encodeQueryParam(key, query[key]);
|
||||
}
|
||||
|
||||
protected addArrayQueryParam(query: QueryParamsType, key: string) {
|
||||
const value = query[key];
|
||||
return value.map((v: any) => this.encodeQueryParam(key, v)).join("&");
|
||||
}
|
||||
|
||||
protected toQueryString(rawQuery?: QueryParamsType): string {
|
||||
const query = rawQuery || {};
|
||||
const keys = Object.keys(query).filter(
|
||||
(key) => "undefined" !== typeof query[key],
|
||||
);
|
||||
return keys
|
||||
.map((key) =>
|
||||
Array.isArray(query[key])
|
||||
? this.addArrayQueryParam(query, key)
|
||||
: this.addQueryParam(query, key),
|
||||
)
|
||||
.join("&");
|
||||
}
|
||||
|
||||
protected addQueryParams(rawQuery?: QueryParamsType): string {
|
||||
const queryString = this.toQueryString(rawQuery);
|
||||
return queryString ? `?${queryString}` : "";
|
||||
}
|
||||
|
||||
private contentFormatters: Record<ContentType, (input: any) => any> = {
|
||||
[ContentType.Json]: (input: any) =>
|
||||
input !== null && (typeof input === "object" || typeof input === "string")
|
||||
? JSON.stringify(input)
|
||||
: input,
|
||||
[ContentType.Text]: (input: any) =>
|
||||
input !== null && typeof input !== "string"
|
||||
? JSON.stringify(input)
|
||||
: input,
|
||||
[ContentType.FormData]: (input: any) =>
|
||||
Object.keys(input || {}).reduce((formData, key) => {
|
||||
const property = input[key];
|
||||
formData.append(
|
||||
key,
|
||||
property instanceof Blob
|
||||
? property
|
||||
: typeof property === "object" && property !== null
|
||||
? JSON.stringify(property)
|
||||
: `${property}`,
|
||||
);
|
||||
return formData;
|
||||
}, new FormData()),
|
||||
[ContentType.UrlEncoded]: (input: any) => this.toQueryString(input),
|
||||
};
|
||||
|
||||
protected mergeRequestParams(
|
||||
params1: RequestParams,
|
||||
params2?: RequestParams,
|
||||
): RequestParams {
|
||||
return {
|
||||
...this.baseApiParams,
|
||||
...params1,
|
||||
...(params2 || {}),
|
||||
headers: {
|
||||
...(this.baseApiParams.headers || {}),
|
||||
...(params1.headers || {}),
|
||||
...((params2 && params2.headers) || {}),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
protected createAbortSignal = (
|
||||
cancelToken: CancelToken,
|
||||
): AbortSignal | undefined => {
|
||||
if (this.abortControllers.has(cancelToken)) {
|
||||
const abortController = this.abortControllers.get(cancelToken);
|
||||
if (abortController) {
|
||||
return abortController.signal;
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
|
||||
const abortController = new AbortController();
|
||||
this.abortControllers.set(cancelToken, abortController);
|
||||
return abortController.signal;
|
||||
};
|
||||
|
||||
public abortRequest = (cancelToken: CancelToken) => {
|
||||
const abortController = this.abortControllers.get(cancelToken);
|
||||
|
||||
if (abortController) {
|
||||
abortController.abort();
|
||||
this.abortControllers.delete(cancelToken);
|
||||
}
|
||||
};
|
||||
|
||||
public request = async <T = any, E = any>({
|
||||
isAlert = true,
|
||||
body,
|
||||
secure,
|
||||
path,
|
||||
type,
|
||||
query,
|
||||
format,
|
||||
baseUrl,
|
||||
cancelToken,
|
||||
...params
|
||||
}: FullRequestParams & { isAlert?: boolean }): Promise<
|
||||
ExtractDataProp<T>
|
||||
> => {
|
||||
const secureParams =
|
||||
((typeof secure === "boolean" ? secure : this.baseApiParams.secure) &&
|
||||
this.securityWorker &&
|
||||
(await this.securityWorker(this.securityData))) ||
|
||||
{};
|
||||
const requestParams = this.mergeRequestParams(params, secureParams);
|
||||
const queryString = query && this.toQueryString(query);
|
||||
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
|
||||
const responseFormat = format || requestParams.format || "json";
|
||||
|
||||
let customHeaders = {};
|
||||
if (typeof window === "undefined") {
|
||||
customHeaders = await getServerHeader();
|
||||
}
|
||||
|
||||
return this.customFetch(
|
||||
`${baseUrl || this.baseUrl || (typeof window !== "undefined" ? window._BASE_PATH_ : "")}${path}${queryString ? `?${queryString}` : ""}`,
|
||||
{
|
||||
...requestParams,
|
||||
headers: {
|
||||
...customHeaders,
|
||||
...(requestParams.headers || {}),
|
||||
...(type && type !== ContentType.FormData
|
||||
? { "Content-Type": type }
|
||||
: {}),
|
||||
},
|
||||
signal:
|
||||
(cancelToken
|
||||
? this.createAbortSignal(cancelToken)
|
||||
: requestParams.signal) || null,
|
||||
body:
|
||||
typeof body === "undefined" || body === null
|
||||
? null
|
||||
: payloadFormatter(body),
|
||||
},
|
||||
).then(async (response) => {
|
||||
if (response.status === 401) {
|
||||
if (typeof window === "undefined") {
|
||||
const pathname = await getServerPathname();
|
||||
if (!pathnameWhiteList.includes(pathname)) {
|
||||
const search = await getServerSearch();
|
||||
const basePath = await getServerBasePath();
|
||||
redirect(
|
||||
`${basePath}/auth/login?redirect=${encodeURIComponent(pathname + search)}`,
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof window !== "undefined") {
|
||||
if (!pathnameWhiteList.includes(window.location.pathname)) {
|
||||
if (response.status === 401) {
|
||||
redirectToLogin();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// if (response.status === 403) {
|
||||
// console.log("response 403:", response);
|
||||
// if (typeof window === "undefined") {
|
||||
// const pathname = await getServerPathname();
|
||||
// if (pathname !== "/block") {
|
||||
// redirect("/block");
|
||||
// }
|
||||
// }
|
||||
// if (typeof window !== "undefined") {
|
||||
// const pathname = window.location.pathname;
|
||||
// if (pathname !== "/block") {
|
||||
// window.location.href = "/block";
|
||||
// }
|
||||
// }
|
||||
// return Promise.reject(403);
|
||||
// }
|
||||
|
||||
// if (response.status === 404) {
|
||||
// if (typeof window === "undefined") {
|
||||
// notFound();
|
||||
// }
|
||||
// }
|
||||
|
||||
let data: any = {};
|
||||
|
||||
try {
|
||||
data = await response[responseFormat]();
|
||||
} catch (error) {}
|
||||
|
||||
if (cancelToken) {
|
||||
this.abortControllers.delete(cancelToken);
|
||||
}
|
||||
|
||||
if (
|
||||
!response.ok ||
|
||||
(data.code !== undefined && data.code !== 0) ||
|
||||
(data.success !== undefined && !data.success)
|
||||
) {
|
||||
if (typeof window !== "undefined") {
|
||||
const urlObj = new URL(response.url);
|
||||
if (urlObj.pathname !== "/api/v1/user/profile") {
|
||||
if (isAlert) {
|
||||
alert.error(
|
||||
(data as DomainResponse).message! || response.statusText,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
const errorMessage = { data, url: response.url, response };
|
||||
console.log("response error:", errorMessage);
|
||||
return Promise.reject({
|
||||
...data,
|
||||
code: response.status === 200 ? data.code : response.status,
|
||||
});
|
||||
}
|
||||
return data.data;
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export default new HttpClient({ baseUrl: process.env.TARGET }).request;
|
||||
16
web/app/src/request/index.ts
Normal file
16
web/app/src/request/index.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
export * from './ShareApp'
|
||||
export * from './ShareAuth'
|
||||
export * from './ShareCaptcha'
|
||||
export * from './ShareChat'
|
||||
export * from './ShareChatSearch'
|
||||
export * from './ShareComment'
|
||||
export * from './ShareConversation'
|
||||
export * from './ShareFile'
|
||||
export * from './ShareNav'
|
||||
export * from './ShareNode'
|
||||
export * from './ShareOpenapi'
|
||||
export * from './ShareStat'
|
||||
export * from './Wechat'
|
||||
export * from './Widget'
|
||||
export * from './types'
|
||||
|
||||
128
web/app/src/request/pro/ApiToken.ts
Normal file
128
web/app/src/request/pro/ApiToken.ts
Normal file
@@ -0,0 +1,128 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DeleteApiProV1TokenDeleteParams,
|
||||
DomainPWResponse,
|
||||
GetApiProV1TokenListParams,
|
||||
GithubComChaitinPandaWikiProApiTokenV1APITokenListItem,
|
||||
GithubComChaitinPandaWikiProApiTokenV1CreateAPITokenReq,
|
||||
GithubComChaitinPandaWikiProApiTokenV1UpdateAPITokenReq,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description 创建 APIToken
|
||||
*
|
||||
* @tags ApiToken
|
||||
* @name PostApiProV1TokenCreate
|
||||
* @summary 创建 APIToken
|
||||
* @request POST:/api/pro/v1/token/create
|
||||
* @secure
|
||||
* @response `200` `DomainPWResponse` OK
|
||||
*/
|
||||
|
||||
export const postApiProV1TokenCreate = (
|
||||
param: GithubComChaitinPandaWikiProApiTokenV1CreateAPITokenReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<DomainPWResponse>({
|
||||
path: `/api/pro/v1/token/create`,
|
||||
method: "POST",
|
||||
body: param,
|
||||
secure: true,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 删除指定的API Token,需要full_control权限
|
||||
*
|
||||
* @tags ApiToken
|
||||
* @name DeleteApiProV1TokenDelete
|
||||
* @summary 删除API Token
|
||||
* @request DELETE:/api/pro/v1/token/delete
|
||||
* @secure
|
||||
* @response `200` `DomainPWResponse` OK
|
||||
*/
|
||||
|
||||
export const deleteApiProV1TokenDelete = (
|
||||
query: DeleteApiProV1TokenDeleteParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<DomainPWResponse>({
|
||||
path: `/api/pro/v1/token/delete`,
|
||||
method: "DELETE",
|
||||
query: query,
|
||||
secure: true,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 获取当前用户的所有API Token列表,需要full_control权限
|
||||
*
|
||||
* @tags ApiToken
|
||||
* @name GetApiProV1TokenList
|
||||
* @summary 获取API Token列表
|
||||
* @request GET:/api/pro/v1/token/list
|
||||
* @secure
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: (GithubComChaitinPandaWikiProApiTokenV1APITokenListItem)[],
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getApiProV1TokenList = (
|
||||
query: GetApiProV1TokenListParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiTokenV1APITokenListItem[];
|
||||
}
|
||||
>({
|
||||
path: `/api/pro/v1/token/list`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
secure: true,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 更新API Token的名称和权限,需要full_control权限
|
||||
*
|
||||
* @tags ApiToken
|
||||
* @name PatchApiProV1TokenUpdate
|
||||
* @summary 更新API Token
|
||||
* @request PATCH:/api/pro/v1/token/update
|
||||
* @secure
|
||||
* @response `200` `DomainPWResponse` OK
|
||||
*/
|
||||
|
||||
export const patchApiProV1TokenUpdate = (
|
||||
request: GithubComChaitinPandaWikiProApiTokenV1UpdateAPITokenReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<DomainPWResponse>({
|
||||
path: `/api/pro/v1/token/update`,
|
||||
method: "PATCH",
|
||||
body: request,
|
||||
secure: true,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
103
web/app/src/request/pro/Auth.ts
Normal file
103
web/app/src/request/pro/Auth.ts
Normal file
@@ -0,0 +1,103 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DeleteApiProV1AuthDeleteParams,
|
||||
DomainPWResponse,
|
||||
DomainResponse,
|
||||
GetApiProV1AuthGetParams,
|
||||
GithubComChaitinPandaWikiProApiAuthV1AuthGetResp,
|
||||
GithubComChaitinPandaWikiProApiAuthV1AuthSetReq,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description 删除授权信息
|
||||
*
|
||||
* @tags Auth
|
||||
* @name DeleteApiProV1AuthDelete
|
||||
* @summary 删除授权信息
|
||||
* @request DELETE:/api/pro/v1/auth/delete
|
||||
* @secure
|
||||
* @response `200` `DomainResponse` OK
|
||||
*/
|
||||
|
||||
export const deleteApiProV1AuthDelete = (
|
||||
query: DeleteApiProV1AuthDeleteParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<DomainResponse>({
|
||||
path: `/api/pro/v1/auth/delete`,
|
||||
method: "DELETE",
|
||||
query: query,
|
||||
secure: true,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 获取授权信息
|
||||
*
|
||||
* @tags Auth
|
||||
* @name GetApiProV1AuthGet
|
||||
* @summary 获取授权信息
|
||||
* @request GET:/api/pro/v1/auth/get
|
||||
* @secure
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiAuthV1AuthGetResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getApiProV1AuthGet = (
|
||||
query: GetApiProV1AuthGetParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiAuthV1AuthGetResp;
|
||||
}
|
||||
>({
|
||||
path: `/api/pro/v1/auth/get`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
secure: true,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 设置授权信息
|
||||
*
|
||||
* @tags Auth
|
||||
* @name PostApiProV1AuthSet
|
||||
* @summary 设置授权信息
|
||||
* @request POST:/api/pro/v1/auth/set
|
||||
* @secure
|
||||
* @response `200` `DomainResponse` OK
|
||||
*/
|
||||
|
||||
export const postApiProV1AuthSet = (
|
||||
param: GithubComChaitinPandaWikiProApiAuthV1AuthSetReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<DomainResponse>({
|
||||
path: `/api/pro/v1/auth/set`,
|
||||
method: "POST",
|
||||
body: param,
|
||||
secure: true,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
230
web/app/src/request/pro/AuthGroup.ts
Normal file
230
web/app/src/request/pro/AuthGroup.ts
Normal file
@@ -0,0 +1,230 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DeleteApiProV1AuthGroupDeleteParams,
|
||||
DomainResponse,
|
||||
GetApiProV1AuthGroupDetailParams,
|
||||
GetApiProV1AuthGroupListParams,
|
||||
GetApiProV1AuthGroupTreeParams,
|
||||
GithubComChaitinPandaWikiProApiAuthV1AuthGroupCreateReq,
|
||||
GithubComChaitinPandaWikiProApiAuthV1AuthGroupCreateResp,
|
||||
GithubComChaitinPandaWikiProApiAuthV1AuthGroupDetailResp,
|
||||
GithubComChaitinPandaWikiProApiAuthV1AuthGroupListResp,
|
||||
GithubComChaitinPandaWikiProApiAuthV1AuthGroupMoveReq,
|
||||
GithubComChaitinPandaWikiProApiAuthV1AuthGroupTreeResp,
|
||||
GithubComChaitinPandaWikiProApiAuthV1AuthGroupUpdateReq,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description 创建用户组
|
||||
*
|
||||
* @tags AuthGroup
|
||||
* @name PostApiProV1AuthGroupCreate
|
||||
* @summary 创建用户组
|
||||
* @request POST:/api/pro/v1/auth/group/create
|
||||
* @secure
|
||||
* @response `200` `(DomainResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiAuthV1AuthGroupCreateResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const postApiProV1AuthGroupCreate = (
|
||||
param: GithubComChaitinPandaWikiProApiAuthV1AuthGroupCreateReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiAuthV1AuthGroupCreateResp;
|
||||
}
|
||||
>({
|
||||
path: `/api/pro/v1/auth/group/create`,
|
||||
method: "POST",
|
||||
body: param,
|
||||
secure: true,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 删除用户组
|
||||
*
|
||||
* @tags AuthGroup
|
||||
* @name DeleteApiProV1AuthGroupDelete
|
||||
* @summary 删除用户组
|
||||
* @request DELETE:/api/pro/v1/auth/group/delete
|
||||
* @secure
|
||||
* @response `200` `DomainResponse` OK
|
||||
*/
|
||||
|
||||
export const deleteApiProV1AuthGroupDelete = (
|
||||
query: DeleteApiProV1AuthGroupDeleteParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<DomainResponse>({
|
||||
path: `/api/pro/v1/auth/group/delete`,
|
||||
method: "DELETE",
|
||||
query: query,
|
||||
secure: true,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 获取用户组详情
|
||||
*
|
||||
* @tags AuthGroup
|
||||
* @name GetApiProV1AuthGroupDetail
|
||||
* @summary 获取用户组详情
|
||||
* @request GET:/api/pro/v1/auth/group/detail
|
||||
* @secure
|
||||
* @response `200` `(DomainResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiAuthV1AuthGroupDetailResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getApiProV1AuthGroupDetail = (
|
||||
query: GetApiProV1AuthGroupDetailParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiAuthV1AuthGroupDetailResp;
|
||||
}
|
||||
>({
|
||||
path: `/api/pro/v1/auth/group/detail`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
secure: true,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 获取用户组列表
|
||||
*
|
||||
* @tags AuthGroup
|
||||
* @name GetApiProV1AuthGroupList
|
||||
* @summary 获取用户组列表
|
||||
* @request GET:/api/pro/v1/auth/group/list
|
||||
* @secure
|
||||
* @response `200` `(DomainResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiAuthV1AuthGroupListResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getApiProV1AuthGroupList = (
|
||||
query: GetApiProV1AuthGroupListParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiAuthV1AuthGroupListResp;
|
||||
}
|
||||
>({
|
||||
path: `/api/pro/v1/auth/group/list`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
secure: true,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 移动用户组到新的父组下
|
||||
*
|
||||
* @tags AuthGroup
|
||||
* @name PatchApiProV1AuthGroupMove
|
||||
* @summary 移动用户组
|
||||
* @request PATCH:/api/pro/v1/auth/group/move
|
||||
* @secure
|
||||
* @response `200` `DomainResponse` OK
|
||||
*/
|
||||
|
||||
export const patchApiProV1AuthGroupMove = (
|
||||
param: GithubComChaitinPandaWikiProApiAuthV1AuthGroupMoveReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<DomainResponse>({
|
||||
path: `/api/pro/v1/auth/group/move`,
|
||||
method: "PATCH",
|
||||
body: param,
|
||||
secure: true,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 获取用户组树形结构
|
||||
*
|
||||
* @tags AuthGroup
|
||||
* @name GetApiProV1AuthGroupTree
|
||||
* @summary 获取用户组树形结构
|
||||
* @request GET:/api/pro/v1/auth/group/tree
|
||||
* @secure
|
||||
* @response `200` `(DomainResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiAuthV1AuthGroupTreeResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getApiProV1AuthGroupTree = (
|
||||
query: GetApiProV1AuthGroupTreeParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiAuthV1AuthGroupTreeResp;
|
||||
}
|
||||
>({
|
||||
path: `/api/pro/v1/auth/group/tree`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
secure: true,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 更新用户组名称和成员
|
||||
*
|
||||
* @tags AuthGroup
|
||||
* @name PatchApiProV1AuthGroupUpdate
|
||||
* @summary 更新用户组
|
||||
* @request PATCH:/api/pro/v1/auth/group/update
|
||||
* @secure
|
||||
* @response `200` `DomainResponse` OK
|
||||
*/
|
||||
|
||||
export const patchApiProV1AuthGroupUpdate = (
|
||||
param: GithubComChaitinPandaWikiProApiAuthV1AuthGroupUpdateReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<DomainResponse>({
|
||||
path: `/api/pro/v1/auth/group/update`,
|
||||
method: "PATCH",
|
||||
body: param,
|
||||
secure: true,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
50
web/app/src/request/pro/AuthOrg.ts
Normal file
50
web/app/src/request/pro/AuthOrg.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DomainResponse,
|
||||
GithubComChaitinPandaWikiProApiAuthV1AuthGroupSyncReq,
|
||||
GithubComChaitinPandaWikiProApiAuthV1AuthGroupSyncResp,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description 组织架构同步
|
||||
*
|
||||
* @tags AuthOrg
|
||||
* @name PostApiProV1AuthGroupSync
|
||||
* @summary 组织架构同步
|
||||
* @request POST:/api/pro/v1/auth/group/sync
|
||||
* @secure
|
||||
* @response `200` `(DomainResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiAuthV1AuthGroupSyncResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const postApiProV1AuthGroupSync = (
|
||||
param: GithubComChaitinPandaWikiProApiAuthV1AuthGroupSyncReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiAuthV1AuthGroupSyncResp;
|
||||
}
|
||||
>({
|
||||
path: `/api/pro/v1/auth/group/sync`,
|
||||
method: "POST",
|
||||
body: param,
|
||||
secure: true,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
73
web/app/src/request/pro/Block.ts
Normal file
73
web/app/src/request/pro/Block.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DomainPWResponse,
|
||||
DomainResponse,
|
||||
GetApiProV1BlockParams,
|
||||
GithubComChaitinPandaWikiProDomainBlockWords,
|
||||
GithubComChaitinPandaWikiProDomainCreateBlockWordsReq,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description Get question block words
|
||||
*
|
||||
* @tags block
|
||||
* @name GetApiProV1Block
|
||||
* @summary Get question block words
|
||||
* @request GET:/api/pro/v1/block
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProDomainBlockWords,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getApiProV1Block = (
|
||||
query: GetApiProV1BlockParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProDomainBlockWords;
|
||||
}
|
||||
>({
|
||||
path: `/api/pro/v1/block`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description Create new block words
|
||||
*
|
||||
* @tags block
|
||||
* @name PostApiProV1Block
|
||||
* @summary Create new block words
|
||||
* @request POST:/api/pro/v1/block
|
||||
* @response `200` `DomainResponse` OK
|
||||
*/
|
||||
|
||||
export const postApiProV1Block = (
|
||||
req: GithubComChaitinPandaWikiProDomainCreateBlockWordsReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<DomainResponse>({
|
||||
path: `/api/pro/v1/block`,
|
||||
method: "POST",
|
||||
body: req,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
37
web/app/src/request/pro/Comment.ts
Normal file
37
web/app/src/request/pro/Comment.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import { DomainCommentModerateListReq, DomainResponse } from "./types";
|
||||
|
||||
/**
|
||||
* @description BatchModerateComment
|
||||
*
|
||||
* @tags comment
|
||||
* @name PostApiProV1CommentModerate
|
||||
* @summary BatchModerateComment
|
||||
* @request POST:/api/pro/v1/comment_moderate
|
||||
* @response `200` `DomainResponse` success
|
||||
*/
|
||||
|
||||
export const postApiProV1CommentModerate = (
|
||||
req: DomainCommentModerateListReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<DomainResponse>({
|
||||
path: `/api/pro/v1/comment_moderate`,
|
||||
method: "POST",
|
||||
body: req,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
118
web/app/src/request/pro/Contribute.ts
Normal file
118
web/app/src/request/pro/Contribute.ts
Normal file
@@ -0,0 +1,118 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DomainResponse,
|
||||
GetApiProV1ContributeDetailParams,
|
||||
GetApiProV1ContributeListParams,
|
||||
GithubComChaitinPandaWikiProApiContributeV1ContributeAuditReq,
|
||||
GithubComChaitinPandaWikiProApiContributeV1ContributeAuditResp,
|
||||
GithubComChaitinPandaWikiProApiContributeV1ContributeDetailResp,
|
||||
GithubComChaitinPandaWikiProApiContributeV1ContributeListResp,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description 审核文档贡献,支持通过或拒绝
|
||||
*
|
||||
* @tags Contribute
|
||||
* @name PostApiProV1ContributeAudit
|
||||
* @summary 审核贡献
|
||||
* @request POST:/api/pro/v1/contribute/audit
|
||||
* @secure
|
||||
* @response `200` `(DomainResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiContributeV1ContributeAuditResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const postApiProV1ContributeAudit = (
|
||||
param: GithubComChaitinPandaWikiProApiContributeV1ContributeAuditReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiContributeV1ContributeAuditResp;
|
||||
}
|
||||
>({
|
||||
path: `/api/pro/v1/contribute/audit`,
|
||||
method: "POST",
|
||||
body: param,
|
||||
secure: true,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 根据ID获取文档贡献详情
|
||||
*
|
||||
* @tags Contribute
|
||||
* @name GetApiProV1ContributeDetail
|
||||
* @summary 获取贡献详情
|
||||
* @request GET:/api/pro/v1/contribute/detail
|
||||
* @secure
|
||||
* @response `200` `(DomainResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiContributeV1ContributeDetailResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getApiProV1ContributeDetail = (
|
||||
query: GetApiProV1ContributeDetailParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiContributeV1ContributeDetailResp;
|
||||
}
|
||||
>({
|
||||
path: `/api/pro/v1/contribute/detail`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
secure: true,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 获取文档贡献列表,支持按知识库和状态筛选
|
||||
*
|
||||
* @tags Contribute
|
||||
* @name GetApiProV1ContributeList
|
||||
* @summary 获取贡献列表
|
||||
* @request GET:/api/pro/v1/contribute/list
|
||||
* @secure
|
||||
* @response `200` `(DomainResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiContributeV1ContributeListResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getApiProV1ContributeList = (
|
||||
query: GetApiProV1ContributeListParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiContributeV1ContributeListResp;
|
||||
}
|
||||
>({
|
||||
path: `/api/pro/v1/contribute/list`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
secure: true,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
97
web/app/src/request/pro/DocumentFeedback.ts
Normal file
97
web/app/src/request/pro/DocumentFeedback.ts
Normal file
@@ -0,0 +1,97 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DeleteApiProV1DocumentFeedbackParams,
|
||||
DomainPWResponse,
|
||||
DomainResponse,
|
||||
GetApiProV1DocumentListParams,
|
||||
HandlerV1DocFeedBackLists,
|
||||
PostShareProV1DocumentFeedbackPayload,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description DeleteDocumentFeedbacks
|
||||
*
|
||||
* @tags documentFeedback
|
||||
* @name DeleteApiProV1DocumentFeedback
|
||||
* @summary DeleteDocumentFeedbacks
|
||||
* @request DELETE:/api/pro/v1/document/feedback
|
||||
* @response `200` `DomainResponse` OK
|
||||
*/
|
||||
|
||||
export const deleteApiProV1DocumentFeedback = (
|
||||
query: DeleteApiProV1DocumentFeedbackParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<DomainResponse>({
|
||||
path: `/api/pro/v1/document/feedback`,
|
||||
method: "DELETE",
|
||||
query: query,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description GetDocumentFeedbacks
|
||||
*
|
||||
* @tags documentFeedback
|
||||
* @name GetApiProV1DocumentList
|
||||
* @summary GetDocumentFeedbacks
|
||||
* @request GET:/api/pro/v1/document/list
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: HandlerV1DocFeedBackLists,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getApiProV1DocumentList = (
|
||||
query: GetApiProV1DocumentListParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: HandlerV1DocFeedBackLists;
|
||||
}
|
||||
>({
|
||||
path: `/api/pro/v1/document/list`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description Create Document Feedback
|
||||
*
|
||||
* @tags documentFeedback
|
||||
* @name PostShareProV1DocumentFeedback
|
||||
* @summary Create Document Feedback
|
||||
* @request POST:/share/pro/v1/document/feedback
|
||||
* @response `200` `DomainResponse` OK
|
||||
*/
|
||||
|
||||
export const postShareProV1DocumentFeedback = (
|
||||
data: PostShareProV1DocumentFeedbackPayload,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<DomainResponse>({
|
||||
path: `/share/pro/v1/document/feedback`,
|
||||
method: "POST",
|
||||
body: data,
|
||||
type: ContentType.FormData,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
93
web/app/src/request/pro/License.ts
Normal file
93
web/app/src/request/pro/License.ts
Normal file
@@ -0,0 +1,93 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DomainLicenseResp,
|
||||
DomainPWResponse,
|
||||
PostApiV1LicensePayload,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description Get license
|
||||
*
|
||||
* @tags license
|
||||
* @name GetApiV1License
|
||||
* @summary Get license
|
||||
* @request GET:/api/v1/license
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: DomainLicenseResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getApiV1License = (params: RequestParams = {}) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: DomainLicenseResp;
|
||||
}
|
||||
>({
|
||||
path: `/api/v1/license`,
|
||||
method: "GET",
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description Upload license
|
||||
*
|
||||
* @tags license
|
||||
* @name PostApiV1License
|
||||
* @summary Upload license
|
||||
* @request POST:/api/v1/license
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: DomainLicenseResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const postApiV1License = (
|
||||
data: PostApiV1LicensePayload,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: DomainLicenseResp;
|
||||
}
|
||||
>({
|
||||
path: `/api/v1/license`,
|
||||
method: "POST",
|
||||
body: data,
|
||||
type: ContentType.FormData,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description Unbind license and delete license record
|
||||
*
|
||||
* @tags license
|
||||
* @name DeleteApiV1License
|
||||
* @summary Unbind license
|
||||
* @request DELETE:/api/v1/license
|
||||
* @response `200` `DomainPWResponse` OK
|
||||
*/
|
||||
|
||||
export const deleteApiV1License = (params: RequestParams = {}) =>
|
||||
httpRequest<DomainPWResponse>({
|
||||
path: `/api/v1/license`,
|
||||
method: "DELETE",
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
80
web/app/src/request/pro/Node.ts
Normal file
80
web/app/src/request/pro/Node.ts
Normal file
@@ -0,0 +1,80 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DomainGetNodeReleaseDetailResp,
|
||||
DomainNodeReleaseListItem,
|
||||
DomainPWResponse,
|
||||
GetApiProV1NodeReleaseDetailParams,
|
||||
GetApiProV1NodeReleaseListParams,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description Get Node Release Detail
|
||||
*
|
||||
* @tags node
|
||||
* @name GetApiProV1NodeReleaseDetail
|
||||
* @summary Get Node Release Detail
|
||||
* @request GET:/api/pro/v1/node/release/detail
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: DomainGetNodeReleaseDetailResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getApiProV1NodeReleaseDetail = (
|
||||
query: GetApiProV1NodeReleaseDetailParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: DomainGetNodeReleaseDetailResp;
|
||||
}
|
||||
>({
|
||||
path: `/api/pro/v1/node/release/detail`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description Get Node Release List
|
||||
*
|
||||
* @tags node
|
||||
* @name GetApiProV1NodeReleaseList
|
||||
* @summary Get Node Release List
|
||||
* @request GET:/api/pro/v1/node/release/list
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: (DomainNodeReleaseListItem)[],
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getApiProV1NodeReleaseList = (
|
||||
query: GetApiProV1NodeReleaseListParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: DomainNodeReleaseListItem[];
|
||||
}
|
||||
>({
|
||||
path: `/api/pro/v1/node/release/list`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
79
web/app/src/request/pro/Prompt.ts
Normal file
79
web/app/src/request/pro/Prompt.ts
Normal file
@@ -0,0 +1,79 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DomainPWResponse,
|
||||
DomainPrompt,
|
||||
DomainUpdatePromptReq,
|
||||
GetApiProV1PromptParams,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description Get all prompts
|
||||
*
|
||||
* @tags prompt
|
||||
* @name GetApiProV1Prompt
|
||||
* @summary Get all prompts
|
||||
* @request GET:/api/pro/v1/prompt
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: DomainPrompt,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getApiProV1Prompt = (
|
||||
query: GetApiProV1PromptParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: DomainPrompt;
|
||||
}
|
||||
>({
|
||||
path: `/api/pro/v1/prompt`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description update prompt settings
|
||||
*
|
||||
* @tags prompt
|
||||
* @name PutApiProV1Prompt
|
||||
* @summary update prompt settings
|
||||
* @request PUT:/api/pro/v1/prompt
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: DomainPrompt,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const putApiProV1Prompt = (
|
||||
req: DomainUpdatePromptReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: DomainPrompt;
|
||||
}
|
||||
>({
|
||||
path: `/api/pro/v1/prompt`,
|
||||
method: "PUT",
|
||||
body: req,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
294
web/app/src/request/pro/ShareAuth.ts
Normal file
294
web/app/src/request/pro/ShareAuth.ts
Normal file
@@ -0,0 +1,294 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DomainPWResponse,
|
||||
GithubComChaitinPandaWikiProApiShareV1AuthCASReq,
|
||||
GithubComChaitinPandaWikiProApiShareV1AuthCASResp,
|
||||
GithubComChaitinPandaWikiProApiShareV1AuthDingTalkReq,
|
||||
GithubComChaitinPandaWikiProApiShareV1AuthDingTalkResp,
|
||||
GithubComChaitinPandaWikiProApiShareV1AuthFeishuReq,
|
||||
GithubComChaitinPandaWikiProApiShareV1AuthFeishuResp,
|
||||
GithubComChaitinPandaWikiProApiShareV1AuthGitHubReq,
|
||||
GithubComChaitinPandaWikiProApiShareV1AuthGitHubResp,
|
||||
GithubComChaitinPandaWikiProApiShareV1AuthInfoResp,
|
||||
GithubComChaitinPandaWikiProApiShareV1AuthLDAPReq,
|
||||
GithubComChaitinPandaWikiProApiShareV1AuthLDAPResp,
|
||||
GithubComChaitinPandaWikiProApiShareV1AuthLogoutResp,
|
||||
GithubComChaitinPandaWikiProApiShareV1AuthOAuthReq,
|
||||
GithubComChaitinPandaWikiProApiShareV1AuthOAuthResp,
|
||||
GithubComChaitinPandaWikiProApiShareV1AuthWecomReq,
|
||||
GithubComChaitinPandaWikiProApiShareV1AuthWecomResp,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description CAS登录
|
||||
*
|
||||
* @tags ShareAuth
|
||||
* @name PostShareProV1AuthCas
|
||||
* @summary CAS登录
|
||||
* @request POST:/share/pro/v1/auth/cas
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1AuthCASResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const postShareProV1AuthCas = (
|
||||
param: GithubComChaitinPandaWikiProApiShareV1AuthCASReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1AuthCASResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/pro/v1/auth/cas`,
|
||||
method: "POST",
|
||||
body: param,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 钉钉登录
|
||||
*
|
||||
* @tags ShareAuth
|
||||
* @name PostShareProV1AuthDingtalk
|
||||
* @summary 钉钉登录
|
||||
* @request POST:/share/pro/v1/auth/dingtalk
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1AuthDingTalkResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const postShareProV1AuthDingtalk = (
|
||||
param: GithubComChaitinPandaWikiProApiShareV1AuthDingTalkReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1AuthDingTalkResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/pro/v1/auth/dingtalk`,
|
||||
method: "POST",
|
||||
body: param,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 飞书登录
|
||||
*
|
||||
* @tags ShareAuth
|
||||
* @name PostShareProV1AuthFeishu
|
||||
* @summary 飞书登录
|
||||
* @request POST:/share/pro/v1/auth/feishu
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1AuthFeishuResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const postShareProV1AuthFeishu = (
|
||||
param: GithubComChaitinPandaWikiProApiShareV1AuthFeishuReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1AuthFeishuResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/pro/v1/auth/feishu`,
|
||||
method: "POST",
|
||||
body: param,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description GitHub登录
|
||||
*
|
||||
* @tags ShareAuth
|
||||
* @name PostShareProV1AuthGithub
|
||||
* @summary GitHub登录
|
||||
* @request POST:/share/pro/v1/auth/github
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1AuthGitHubResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const postShareProV1AuthGithub = (
|
||||
param: GithubComChaitinPandaWikiProApiShareV1AuthGitHubReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1AuthGitHubResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/pro/v1/auth/github`,
|
||||
method: "POST",
|
||||
body: param,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description AuthInfo
|
||||
*
|
||||
* @tags ShareAuth
|
||||
* @name GetShareProV1AuthInfo
|
||||
* @summary AuthInfo
|
||||
* @request GET:/share/pro/v1/auth/info
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1AuthInfoResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getShareProV1AuthInfo = (params: RequestParams = {}) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1AuthInfoResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/pro/v1/auth/info`,
|
||||
method: "GET",
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description LDAP登录
|
||||
*
|
||||
* @tags ShareAuth
|
||||
* @name PostShareProV1AuthLdap
|
||||
* @summary LDAP登录
|
||||
* @request POST:/share/pro/v1/auth/ldap
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1AuthLDAPResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const postShareProV1AuthLdap = (
|
||||
param: GithubComChaitinPandaWikiProApiShareV1AuthLDAPReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1AuthLDAPResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/pro/v1/auth/ldap`,
|
||||
method: "POST",
|
||||
body: param,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 用户登出
|
||||
*
|
||||
* @tags ShareAuth
|
||||
* @name PostShareProV1AuthLogout
|
||||
* @summary 用户登出
|
||||
* @request POST:/share/pro/v1/auth/logout
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1AuthLogoutResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const postShareProV1AuthLogout = (params: RequestParams = {}) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1AuthLogoutResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/pro/v1/auth/logout`,
|
||||
method: "POST",
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description OAuth登录
|
||||
*
|
||||
* @tags ShareAuth
|
||||
* @name PostShareProV1AuthOauth
|
||||
* @summary OAuth登录
|
||||
* @request POST:/share/pro/v1/auth/oauth
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1AuthOAuthResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const postShareProV1AuthOauth = (
|
||||
param: GithubComChaitinPandaWikiProApiShareV1AuthOAuthReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1AuthOAuthResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/pro/v1/auth/oauth`,
|
||||
method: "POST",
|
||||
body: param,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 企业微信登录
|
||||
*
|
||||
* @tags ShareAuth
|
||||
* @name PostShareProV1AuthWecom
|
||||
* @summary 企业微信登录
|
||||
* @request POST:/share/pro/v1/auth/wecom
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1AuthWecomResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const postShareProV1AuthWecom = (
|
||||
param: GithubComChaitinPandaWikiProApiShareV1AuthWecomReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1AuthWecomResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/pro/v1/auth/wecom`,
|
||||
method: "POST",
|
||||
body: param,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
48
web/app/src/request/pro/ShareContribute.ts
Normal file
48
web/app/src/request/pro/ShareContribute.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DomainResponse,
|
||||
GithubComChaitinPandaWikiProApiShareV1SubmitContributeReq,
|
||||
GithubComChaitinPandaWikiProApiShareV1SubmitContributeResp,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description 前台用户提交文档编辑或新增贡献
|
||||
*
|
||||
* @tags ShareContribute
|
||||
* @name PostShareProV1ContributeSubmit
|
||||
* @summary 提交文档贡献
|
||||
* @request POST:/share/pro/v1/contribute/submit
|
||||
* @response `200` `(DomainResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1SubmitContributeResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const postShareProV1ContributeSubmit = (
|
||||
param: GithubComChaitinPandaWikiProApiShareV1SubmitContributeReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1SubmitContributeResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/pro/v1/contribute/submit`,
|
||||
method: "POST",
|
||||
body: param,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
48
web/app/src/request/pro/ShareFile.ts
Normal file
48
web/app/src/request/pro/ShareFile.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DomainResponse,
|
||||
GithubComChaitinPandaWikiProApiShareV1FileUploadResp,
|
||||
PostShareProV1FileUploadPayload,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description 前台用户上传文件
|
||||
*
|
||||
* @tags ShareFile
|
||||
* @name PostShareProV1FileUpload
|
||||
* @summary 文件上传
|
||||
* @request POST:/share/pro/v1/file/upload
|
||||
* @response `200` `(DomainResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1FileUploadResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const postShareProV1FileUpload = (
|
||||
data: PostShareProV1FileUploadPayload,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1FileUploadResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/pro/v1/file/upload`,
|
||||
method: "POST",
|
||||
body: data,
|
||||
type: ContentType.FormData,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
208
web/app/src/request/pro/ShareOpenapi.ts
Normal file
208
web/app/src/request/pro/ShareOpenapi.ts
Normal file
@@ -0,0 +1,208 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import httpRequest, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DomainPWResponse,
|
||||
GetShareProV1OpenapiCasCallbackParams,
|
||||
GetShareProV1OpenapiDingtalkCallbackParams,
|
||||
GetShareProV1OpenapiFeishuCallbackParams,
|
||||
GetShareProV1OpenapiGithubCallbackParams,
|
||||
GetShareProV1OpenapiOauthCallbackParams,
|
||||
GetShareProV1OpenapiWecomCallbackParams,
|
||||
GithubComChaitinPandaWikiProApiShareV1CASCallbackResp,
|
||||
GithubComChaitinPandaWikiProApiShareV1DingtalkCallbackResp,
|
||||
GithubComChaitinPandaWikiProApiShareV1FeishuCallbackResp,
|
||||
GithubComChaitinPandaWikiProApiShareV1GitHubCallbackResp,
|
||||
GithubComChaitinPandaWikiProApiShareV1OAuthCallbackResp,
|
||||
GithubComChaitinPandaWikiProApiShareV1WecomCallbackResp,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description CAS回调
|
||||
*
|
||||
* @tags ShareOpenapi
|
||||
* @name GetShareProV1OpenapiCasCallback
|
||||
* @summary CAS回调
|
||||
* @request GET:/share/pro/v1/openapi/cas/callback
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1CASCallbackResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getShareProV1OpenapiCasCallback = (
|
||||
query: GetShareProV1OpenapiCasCallbackParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1CASCallbackResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/pro/v1/openapi/cas/callback`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description dingtalk回调
|
||||
*
|
||||
* @tags ShareOpenapi
|
||||
* @name GetShareProV1OpenapiDingtalkCallback
|
||||
* @summary dingtalk回调
|
||||
* @request GET:/share/pro/v1/openapi/dingtalk/callback
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1DingtalkCallbackResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getShareProV1OpenapiDingtalkCallback = (
|
||||
query: GetShareProV1OpenapiDingtalkCallbackParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1DingtalkCallbackResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/pro/v1/openapi/dingtalk/callback`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description feishu回调
|
||||
*
|
||||
* @tags ShareOpenapi
|
||||
* @name GetShareProV1OpenapiFeishuCallback
|
||||
* @summary feishu回调
|
||||
* @request GET:/share/pro/v1/openapi/feishu/callback
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1FeishuCallbackResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getShareProV1OpenapiFeishuCallback = (
|
||||
query: GetShareProV1OpenapiFeishuCallbackParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1FeishuCallbackResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/pro/v1/openapi/feishu/callback`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description GitHub回调
|
||||
*
|
||||
* @tags ShareOpenapi
|
||||
* @name GetShareProV1OpenapiGithubCallback
|
||||
* @summary GitHub回调
|
||||
* @request GET:/share/pro/v1/openapi/github/callback
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1GitHubCallbackResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getShareProV1OpenapiGithubCallback = (
|
||||
query: GetShareProV1OpenapiGithubCallbackParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1GitHubCallbackResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/pro/v1/openapi/github/callback`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description OAuth回调
|
||||
*
|
||||
* @tags ShareOpenapi
|
||||
* @name GetShareProV1OpenapiOauthCallback
|
||||
* @summary OAuth回调
|
||||
* @request GET:/share/pro/v1/openapi/oauth/callback
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1OAuthCallbackResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getShareProV1OpenapiOauthCallback = (
|
||||
query: GetShareProV1OpenapiOauthCallbackParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1OAuthCallbackResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/pro/v1/openapi/oauth/callback`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 企业微信回调
|
||||
*
|
||||
* @tags ShareOpenapi
|
||||
* @name GetShareProV1OpenapiWecomCallback
|
||||
* @summary 企业微信回调
|
||||
* @request GET:/share/pro/v1/openapi/wecom/callback
|
||||
* @response `200` `(DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1WecomCallbackResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getShareProV1OpenapiWecomCallback = (
|
||||
query: GetShareProV1OpenapiWecomCallbackParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
httpRequest<
|
||||
DomainPWResponse & {
|
||||
data?: GithubComChaitinPandaWikiProApiShareV1WecomCallbackResp;
|
||||
}
|
||||
>({
|
||||
path: `/share/pro/v1/openapi/wecom/callback`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
348
web/app/src/request/pro/httpClient.ts
Normal file
348
web/app/src/request/pro/httpClient.ts
Normal file
@@ -0,0 +1,348 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import {
|
||||
getServerBasePath,
|
||||
getServerHeader,
|
||||
getServerPathname,
|
||||
getServerSearch,
|
||||
} from "@/utils/getServerHeader";
|
||||
import { message as alert } from "@ctzhian/ui";
|
||||
import { redirect } from "next/navigation";
|
||||
export type QueryParamsType = Record<string | number, any>;
|
||||
export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
|
||||
|
||||
export interface FullRequestParams extends Omit<RequestInit, "body"> {
|
||||
/** set parameter to `true` for call `securityWorker` for this request */
|
||||
secure?: boolean;
|
||||
/** request path */
|
||||
path: string;
|
||||
/** content type of request body */
|
||||
type?: ContentType;
|
||||
/** query params */
|
||||
query?: QueryParamsType;
|
||||
/** format of response (i.e. response.json() -> format: "json") */
|
||||
format?: ResponseFormat;
|
||||
/** request body */
|
||||
body?: unknown;
|
||||
/** base url */
|
||||
baseUrl?: string;
|
||||
/** request cancellation token */
|
||||
cancelToken?: CancelToken;
|
||||
}
|
||||
|
||||
export type RequestParams = Omit<
|
||||
FullRequestParams,
|
||||
"body" | "method" | "query" | "path"
|
||||
> & { isAlert?: boolean };
|
||||
|
||||
export interface DomainResponse {
|
||||
/** @example 200 */
|
||||
code?: number;
|
||||
data?: any;
|
||||
/** @example "OK" */
|
||||
message?: string;
|
||||
}
|
||||
|
||||
type ExtractDataProp<T> = T extends { data?: infer U } ? U : never;
|
||||
|
||||
export interface ApiConfig<SecurityDataType = unknown> {
|
||||
baseUrl?: string;
|
||||
baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
|
||||
securityWorker?: (
|
||||
securityData: SecurityDataType | null,
|
||||
) => Promise<RequestParams | void> | RequestParams | void;
|
||||
customFetch?: typeof fetch;
|
||||
}
|
||||
|
||||
export interface HttpResponse<D extends unknown, E extends unknown = unknown>
|
||||
extends Response {
|
||||
data: D;
|
||||
error: E;
|
||||
}
|
||||
|
||||
type CancelToken = Symbol | string | number;
|
||||
|
||||
export enum ContentType {
|
||||
Json = "application/json",
|
||||
FormData = "multipart/form-data",
|
||||
UrlEncoded = "application/x-www-form-urlencoded",
|
||||
Text = "text/plain",
|
||||
}
|
||||
|
||||
const pathnameWhiteList = ["/auth/login"];
|
||||
|
||||
const redirectToLogin = () => {
|
||||
const redirectAfterLogin = encodeURIComponent(
|
||||
location.href.replace(location.origin, ""),
|
||||
);
|
||||
const search = `redirect=${redirectAfterLogin}`;
|
||||
const pathname = `${window._BASE_PATH_ || ""}/auth/login`;
|
||||
window.location.href = [pathname, search]?.join("?");
|
||||
};
|
||||
|
||||
export class HttpClient<SecurityDataType = unknown> {
|
||||
public baseUrl: string = "";
|
||||
private securityData: SecurityDataType | null = null;
|
||||
private securityWorker?: ApiConfig<SecurityDataType>["securityWorker"];
|
||||
private abortControllers = new Map<CancelToken, AbortController>();
|
||||
private customFetch = (...fetchParams: Parameters<typeof fetch>) =>
|
||||
fetch(...fetchParams);
|
||||
|
||||
private baseApiParams: RequestParams = {
|
||||
credentials: "same-origin",
|
||||
headers: {},
|
||||
redirect: "follow",
|
||||
referrerPolicy: "no-referrer",
|
||||
};
|
||||
|
||||
constructor(apiConfig: ApiConfig<SecurityDataType> = {}) {
|
||||
Object.assign(this, apiConfig);
|
||||
}
|
||||
|
||||
public setSecurityData = (data: SecurityDataType | null) => {
|
||||
this.securityData = data;
|
||||
};
|
||||
|
||||
protected encodeQueryParam(key: string, value: any) {
|
||||
const encodedKey = encodeURIComponent(key);
|
||||
return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`;
|
||||
}
|
||||
|
||||
protected addQueryParam(query: QueryParamsType, key: string) {
|
||||
return this.encodeQueryParam(key, query[key]);
|
||||
}
|
||||
|
||||
protected addArrayQueryParam(query: QueryParamsType, key: string) {
|
||||
const value = query[key];
|
||||
return value.map((v: any) => this.encodeQueryParam(key, v)).join("&");
|
||||
}
|
||||
|
||||
protected toQueryString(rawQuery?: QueryParamsType): string {
|
||||
const query = rawQuery || {};
|
||||
const keys = Object.keys(query).filter(
|
||||
(key) => "undefined" !== typeof query[key],
|
||||
);
|
||||
return keys
|
||||
.map((key) =>
|
||||
Array.isArray(query[key])
|
||||
? this.addArrayQueryParam(query, key)
|
||||
: this.addQueryParam(query, key),
|
||||
)
|
||||
.join("&");
|
||||
}
|
||||
|
||||
protected addQueryParams(rawQuery?: QueryParamsType): string {
|
||||
const queryString = this.toQueryString(rawQuery);
|
||||
return queryString ? `?${queryString}` : "";
|
||||
}
|
||||
|
||||
private contentFormatters: Record<ContentType, (input: any) => any> = {
|
||||
[ContentType.Json]: (input: any) =>
|
||||
input !== null && (typeof input === "object" || typeof input === "string")
|
||||
? JSON.stringify(input)
|
||||
: input,
|
||||
[ContentType.Text]: (input: any) =>
|
||||
input !== null && typeof input !== "string"
|
||||
? JSON.stringify(input)
|
||||
: input,
|
||||
[ContentType.FormData]: (input: any) =>
|
||||
Object.keys(input || {}).reduce((formData, key) => {
|
||||
const property = input[key];
|
||||
formData.append(
|
||||
key,
|
||||
property instanceof Blob
|
||||
? property
|
||||
: typeof property === "object" && property !== null
|
||||
? JSON.stringify(property)
|
||||
: `${property}`,
|
||||
);
|
||||
return formData;
|
||||
}, new FormData()),
|
||||
[ContentType.UrlEncoded]: (input: any) => this.toQueryString(input),
|
||||
};
|
||||
|
||||
protected mergeRequestParams(
|
||||
params1: RequestParams,
|
||||
params2?: RequestParams,
|
||||
): RequestParams {
|
||||
return {
|
||||
...this.baseApiParams,
|
||||
...params1,
|
||||
...(params2 || {}),
|
||||
headers: {
|
||||
...(this.baseApiParams.headers || {}),
|
||||
...(params1.headers || {}),
|
||||
...((params2 && params2.headers) || {}),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
protected createAbortSignal = (
|
||||
cancelToken: CancelToken,
|
||||
): AbortSignal | undefined => {
|
||||
if (this.abortControllers.has(cancelToken)) {
|
||||
const abortController = this.abortControllers.get(cancelToken);
|
||||
if (abortController) {
|
||||
return abortController.signal;
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
|
||||
const abortController = new AbortController();
|
||||
this.abortControllers.set(cancelToken, abortController);
|
||||
return abortController.signal;
|
||||
};
|
||||
|
||||
public abortRequest = (cancelToken: CancelToken) => {
|
||||
const abortController = this.abortControllers.get(cancelToken);
|
||||
|
||||
if (abortController) {
|
||||
abortController.abort();
|
||||
this.abortControllers.delete(cancelToken);
|
||||
}
|
||||
};
|
||||
|
||||
public request = async <T = any, E = any>({
|
||||
isAlert = true,
|
||||
body,
|
||||
secure,
|
||||
path,
|
||||
type,
|
||||
query,
|
||||
format,
|
||||
baseUrl,
|
||||
cancelToken,
|
||||
...params
|
||||
}: FullRequestParams & { isAlert?: boolean }): Promise<
|
||||
ExtractDataProp<T>
|
||||
> => {
|
||||
const secureParams =
|
||||
((typeof secure === "boolean" ? secure : this.baseApiParams.secure) &&
|
||||
this.securityWorker &&
|
||||
(await this.securityWorker(this.securityData))) ||
|
||||
{};
|
||||
const requestParams = this.mergeRequestParams(params, secureParams);
|
||||
const queryString = query && this.toQueryString(query);
|
||||
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
|
||||
const responseFormat = format || requestParams.format || "json";
|
||||
|
||||
let customHeaders = {};
|
||||
if (typeof window === "undefined") {
|
||||
customHeaders = await getServerHeader();
|
||||
}
|
||||
|
||||
return this.customFetch(
|
||||
`${baseUrl || this.baseUrl || (typeof window !== "undefined" ? window._BASE_PATH_ : "")}${path}${queryString ? `?${queryString}` : ""}`,
|
||||
{
|
||||
...requestParams,
|
||||
headers: {
|
||||
...customHeaders,
|
||||
...(requestParams.headers || {}),
|
||||
...(type && type !== ContentType.FormData
|
||||
? { "Content-Type": type }
|
||||
: {}),
|
||||
},
|
||||
signal:
|
||||
(cancelToken
|
||||
? this.createAbortSignal(cancelToken)
|
||||
: requestParams.signal) || null,
|
||||
body:
|
||||
typeof body === "undefined" || body === null
|
||||
? null
|
||||
: payloadFormatter(body),
|
||||
},
|
||||
).then(async (response) => {
|
||||
if (response.status === 401) {
|
||||
if (typeof window === "undefined") {
|
||||
const pathname = await getServerPathname();
|
||||
if (!pathnameWhiteList.includes(pathname)) {
|
||||
const search = await getServerSearch();
|
||||
const basePath = await getServerBasePath();
|
||||
redirect(
|
||||
`${basePath}/auth/login?redirect=${encodeURIComponent(pathname + search)}`,
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof window !== "undefined") {
|
||||
if (!pathnameWhiteList.includes(window.location.pathname)) {
|
||||
if (response.status === 401) {
|
||||
redirectToLogin();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// if (response.status === 403) {
|
||||
// console.log("response 403:", response);
|
||||
// if (typeof window === "undefined") {
|
||||
// const pathname = await getServerPathname();
|
||||
// if (pathname !== "/block") {
|
||||
// redirect("/block");
|
||||
// }
|
||||
// }
|
||||
// if (typeof window !== "undefined") {
|
||||
// const pathname = window.location.pathname;
|
||||
// if (pathname !== "/block") {
|
||||
// window.location.href = "/block";
|
||||
// }
|
||||
// }
|
||||
// return Promise.reject(403);
|
||||
// }
|
||||
|
||||
// if (response.status === 404) {
|
||||
// if (typeof window === "undefined") {
|
||||
// notFound();
|
||||
// }
|
||||
// }
|
||||
|
||||
let data: any = {};
|
||||
|
||||
try {
|
||||
data = await response[responseFormat]();
|
||||
} catch (error) {}
|
||||
|
||||
if (cancelToken) {
|
||||
this.abortControllers.delete(cancelToken);
|
||||
}
|
||||
|
||||
if (
|
||||
!response.ok ||
|
||||
(data.code !== undefined && data.code !== 0) ||
|
||||
(data.success !== undefined && !data.success)
|
||||
) {
|
||||
if (typeof window !== "undefined") {
|
||||
const urlObj = new URL(response.url);
|
||||
if (urlObj.pathname !== "/api/v1/user/profile") {
|
||||
if (isAlert) {
|
||||
alert.error(
|
||||
(data as DomainResponse).message! || response.statusText,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
const errorMessage = { data, url: response.url, response };
|
||||
console.log("response error:", errorMessage);
|
||||
return Promise.reject({
|
||||
...data,
|
||||
code: response.status === 200 ? data.code : response.status,
|
||||
});
|
||||
}
|
||||
return data.data;
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export default new HttpClient({ baseUrl: process.env.TARGET }).request;
|
||||
18
web/app/src/request/pro/index.ts
Normal file
18
web/app/src/request/pro/index.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
export * from './ApiToken'
|
||||
export * from './Auth'
|
||||
export * from './AuthGroup'
|
||||
export * from './AuthOrg'
|
||||
export * from './Block'
|
||||
export * from './Comment'
|
||||
export * from './Contribute'
|
||||
export * from './DocumentFeedback'
|
||||
export * from './License'
|
||||
export * from './Node'
|
||||
export * from './Prompt'
|
||||
export * from './ShareAuth'
|
||||
export * from './ShareContribute'
|
||||
export * from './ShareFile'
|
||||
export * from './ShareOpenapi'
|
||||
export * from './otherCustomer'
|
||||
export * from './types'
|
||||
|
||||
103
web/app/src/request/pro/otherCustomer.ts
Normal file
103
web/app/src/request/pro/otherCustomer.ts
Normal file
@@ -0,0 +1,103 @@
|
||||
|
||||
|
||||
import { RequestParams } from "./httpClient";
|
||||
import {
|
||||
GithubComChaitinPandaWikiProApiShareV1FileUploadResp,
|
||||
PostShareProV1FileUploadPayload,
|
||||
} from "./types";
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 使用 XMLHttpRequest 实现文件上传进度
|
||||
*/
|
||||
export const postShareProV1FileUploadWithProgress = (
|
||||
data: PostShareProV1FileUploadPayload,
|
||||
params: RequestParams & {
|
||||
onprogress?: (progress: { progress: number }) => void;
|
||||
abortSignal?: AbortSignal;
|
||||
} = {},
|
||||
): Promise<GithubComChaitinPandaWikiProApiShareV1FileUploadResp> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const { onprogress, abortSignal, ...requestParams } = params;
|
||||
|
||||
// 创建 FormData
|
||||
const formData = new FormData();
|
||||
Object.keys(data).forEach(key => {
|
||||
const value = data[key as keyof PostShareProV1FileUploadPayload];
|
||||
if (value instanceof File) {
|
||||
formData.append(key, value);
|
||||
} else if (value !== null && value !== undefined) {
|
||||
formData.append(key, String(value));
|
||||
}
|
||||
});
|
||||
|
||||
const xhr = new XMLHttpRequest();
|
||||
|
||||
// 设置上传进度监听
|
||||
xhr.upload.addEventListener('progress', (event) => {
|
||||
if (event.lengthComputable && onprogress) {
|
||||
const progress = (event.loaded / event.total) * 100;
|
||||
onprogress({ progress });
|
||||
}
|
||||
});
|
||||
|
||||
// 设置响应处理
|
||||
xhr.addEventListener('load', () => {
|
||||
if (xhr.status >= 200 && xhr.status < 300) {
|
||||
try {
|
||||
const response = JSON.parse(xhr.responseText);
|
||||
if (response.code === 0 || response.code === undefined) {
|
||||
resolve(response.data);
|
||||
} else {
|
||||
reject(new Error(response.message || '上传失败'));
|
||||
}
|
||||
} catch (error) {
|
||||
reject(new Error('响应解析失败'));
|
||||
}
|
||||
} else {
|
||||
reject(new Error(`HTTP ${xhr.status}: ${xhr.statusText}`));
|
||||
}
|
||||
});
|
||||
|
||||
// 设置错误处理
|
||||
xhr.addEventListener('error', () => {
|
||||
reject(new Error('网络错误'));
|
||||
});
|
||||
|
||||
// 设置中止处理
|
||||
xhr.addEventListener('abort', () => {
|
||||
reject(new Error('请求被中止'));
|
||||
});
|
||||
|
||||
// 监听中止信号
|
||||
if (abortSignal) {
|
||||
abortSignal.addEventListener('abort', () => {
|
||||
xhr.abort();
|
||||
});
|
||||
}
|
||||
|
||||
// 构建请求 URL
|
||||
const baseUrl = process.env.TARGET || (typeof window !== 'undefined' ? window._BASE_PATH_ : '');
|
||||
const url = `${baseUrl}/share/pro/v1/file/upload`;
|
||||
|
||||
// 发送请求
|
||||
xhr.open('POST', url);
|
||||
|
||||
// 设置请求头
|
||||
if (requestParams.headers) {
|
||||
Object.entries(requestParams.headers).forEach(([key, value]) => {
|
||||
if (typeof value === 'string') {
|
||||
xhr.setRequestHeader(key, value);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 设置凭据
|
||||
if (requestParams.credentials) {
|
||||
xhr.withCredentials = requestParams.credentials === 'include';
|
||||
}
|
||||
|
||||
xhr.send(formData);
|
||||
});
|
||||
};
|
||||
755
web/app/src/request/pro/types.ts
Normal file
755
web/app/src/request/pro/types.ts
Normal file
@@ -0,0 +1,755 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @format int32 */
|
||||
export enum DomainCommentStatus {
|
||||
CommentStatusReject = -1,
|
||||
CommentStatusPending = 0,
|
||||
CommentStatusAccepted = 1,
|
||||
}
|
||||
|
||||
export enum ConstsUserKBPermission {
|
||||
/** 无权限 */
|
||||
UserKBPermissionNull = "",
|
||||
/** 有权限 */
|
||||
UserKBPermissionNotNull = "not null",
|
||||
/** 完全控制 */
|
||||
UserKBPermissionFullControl = "full_control",
|
||||
/** 文档管理 */
|
||||
UserKBPermissionDocManage = "doc_manage",
|
||||
/** 数据运营 */
|
||||
UserKBPermissionDataOperate = "data_operate",
|
||||
}
|
||||
|
||||
export enum ConstsSourceType {
|
||||
SourceTypeDingTalk = "dingtalk",
|
||||
SourceTypeFeishu = "feishu",
|
||||
SourceTypeWeCom = "wecom",
|
||||
SourceTypeOAuth = "oauth",
|
||||
SourceTypeGitHub = "github",
|
||||
SourceTypeCAS = "cas",
|
||||
SourceTypeLDAP = "ldap",
|
||||
SourceTypeWidget = "widget",
|
||||
SourceTypeDingtalkBot = "dingtalk_bot",
|
||||
SourceTypeFeishuBot = "feishu_bot",
|
||||
SourceTypeLarkBot = "lark_bot",
|
||||
SourceTypeWechatBot = "wechat_bot",
|
||||
SourceTypeWecomAIBot = "wecom_ai_bot",
|
||||
SourceTypeWechatServiceBot = "wechat_service_bot",
|
||||
SourceTypeDiscordBot = "discord_bot",
|
||||
SourceTypeWechatOfficialAccount = "wechat_official_account",
|
||||
SourceTypeOpenAIAPI = "openai_api",
|
||||
SourceTypeMcpServer = "mcp_server",
|
||||
}
|
||||
|
||||
/** @format int32 */
|
||||
export enum ConstsLicenseEdition {
|
||||
/** 开源版 */
|
||||
LicenseEditionFree = 0,
|
||||
/** 专业版 */
|
||||
LicenseEditionProfession = 1,
|
||||
/** 企业版 */
|
||||
LicenseEditionEnterprise = 2,
|
||||
/** 商业版 */
|
||||
LicenseEditionBusiness = 3,
|
||||
}
|
||||
|
||||
export enum ConstsContributeType {
|
||||
ContributeTypeAdd = "add",
|
||||
ContributeTypeEdit = "edit",
|
||||
}
|
||||
|
||||
export enum ConstsContributeStatus {
|
||||
ContributeStatusPending = "pending",
|
||||
ContributeStatusApproved = "approved",
|
||||
ContributeStatusRejected = "rejected",
|
||||
}
|
||||
|
||||
export interface DomainCommentModerateListReq {
|
||||
ids: string[];
|
||||
status: DomainCommentStatus;
|
||||
}
|
||||
|
||||
export interface DomainDocumentFeedbackInfo {
|
||||
/** user */
|
||||
auth_user_id?: number;
|
||||
/** avatar */
|
||||
avatar?: string;
|
||||
email?: string;
|
||||
/** ip */
|
||||
remote_ip?: string;
|
||||
screen_shot?: string;
|
||||
user_name?: string;
|
||||
}
|
||||
|
||||
export interface DomainDocumentFeedbackListItem {
|
||||
content?: string;
|
||||
correction_suggestion?: string;
|
||||
created_at?: string;
|
||||
id?: string;
|
||||
info?: DomainDocumentFeedbackInfo;
|
||||
ip_address?: DomainIPAddress;
|
||||
kb_id?: string;
|
||||
node_id?: string;
|
||||
node_name?: string;
|
||||
user_id?: string;
|
||||
}
|
||||
|
||||
export interface DomainGetNodeReleaseDetailResp {
|
||||
content?: string;
|
||||
creator_account?: string;
|
||||
creator_id?: string;
|
||||
editor_account?: string;
|
||||
editor_id?: string;
|
||||
meta?: DomainNodeMeta;
|
||||
name?: string;
|
||||
node_id?: string;
|
||||
publisher_account?: string;
|
||||
publisher_id?: string;
|
||||
}
|
||||
|
||||
export interface DomainIPAddress {
|
||||
city?: string;
|
||||
country?: string;
|
||||
ip?: string;
|
||||
province?: string;
|
||||
}
|
||||
|
||||
export interface DomainLicenseResp {
|
||||
edition?: ConstsLicenseEdition;
|
||||
expired_at?: number;
|
||||
started_at?: number;
|
||||
state?: number;
|
||||
}
|
||||
|
||||
export interface DomainNodeMeta {
|
||||
content_type?: string;
|
||||
emoji?: string;
|
||||
summary?: string;
|
||||
}
|
||||
|
||||
export interface DomainNodeReleaseListItem {
|
||||
creator_account?: string;
|
||||
creator_id?: string;
|
||||
editor_account?: string;
|
||||
editor_id?: string;
|
||||
id?: string;
|
||||
meta?: DomainNodeMeta;
|
||||
name?: string;
|
||||
node_id?: string;
|
||||
publisher_account?: string;
|
||||
publisher_id?: string;
|
||||
release_id?: string;
|
||||
release_message?: string;
|
||||
release_name?: string;
|
||||
updated_at?: string;
|
||||
}
|
||||
|
||||
export interface DomainPWResponse {
|
||||
code?: number;
|
||||
data?: unknown;
|
||||
message?: string;
|
||||
success?: boolean;
|
||||
}
|
||||
|
||||
export interface DomainPrompt {
|
||||
content?: string;
|
||||
enable_preset?: boolean;
|
||||
/** 允许AI自动匹配用户提问的语言进行回复 */
|
||||
enable_preset_auto_language?: boolean;
|
||||
/** 允许AI结合通用知识进行补充回答 */
|
||||
enable_preset_general_info?: boolean;
|
||||
/** 在回答中显示引用来源 */
|
||||
enable_preset_reference?: boolean;
|
||||
summary_content?: string;
|
||||
}
|
||||
|
||||
export interface DomainResponse {
|
||||
data?: unknown;
|
||||
message?: string;
|
||||
success?: boolean;
|
||||
}
|
||||
|
||||
export interface DomainUpdatePromptReq {
|
||||
content?: string;
|
||||
enable_preset?: boolean;
|
||||
enable_preset_auto_language?: boolean;
|
||||
enable_preset_general_info?: boolean;
|
||||
enable_preset_reference?: boolean;
|
||||
kb_id: string;
|
||||
summary_content?: string;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiAuthV1AuthGetResp {
|
||||
agent_id?: string;
|
||||
authorize_url?: string;
|
||||
auths?: GithubComChaitinPandaWikiProApiAuthV1AuthItem[];
|
||||
avatar_field?: string;
|
||||
/** 绑定DN */
|
||||
bind_dn?: string;
|
||||
/** 绑定密码 */
|
||||
bind_password?: string;
|
||||
cas_url?: string;
|
||||
/** CAS特定配置 */
|
||||
cas_version?: string;
|
||||
client_id?: string;
|
||||
client_secret?: string;
|
||||
email_field?: string;
|
||||
id_field?: string;
|
||||
/** LDAP特定配置 */
|
||||
ldap_server_url?: string;
|
||||
name_field?: string;
|
||||
proxy?: string;
|
||||
scopes?: string[];
|
||||
source_type?: ConstsSourceType;
|
||||
token_url?: string;
|
||||
/** 用户基础DN */
|
||||
user_base_dn?: string;
|
||||
/** 用户查询过滤器 */
|
||||
user_filter?: string;
|
||||
user_info_url?: string;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiAuthV1AuthGroupCreateReq {
|
||||
ids: number[];
|
||||
kb_id: string;
|
||||
/**
|
||||
* @minLength 1
|
||||
* @maxLength 100
|
||||
*/
|
||||
name: string;
|
||||
parent_id?: number;
|
||||
position?: number;
|
||||
}
|
||||
|
||||
export type GithubComChaitinPandaWikiProApiAuthV1AuthGroupCreateResp = Record<
|
||||
string,
|
||||
any
|
||||
>;
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiAuthV1AuthGroupDetailResp {
|
||||
auth_ids?: number[];
|
||||
auths?: GithubComChaitinPandaWikiProApiAuthV1AuthItem[];
|
||||
children?: GithubComChaitinPandaWikiProApiAuthV1AuthGroupListItem[];
|
||||
created_at?: string;
|
||||
id?: number;
|
||||
name?: string;
|
||||
parent?: GithubComChaitinPandaWikiProApiAuthV1AuthGroupListItem;
|
||||
parent_id?: number;
|
||||
position?: number;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiAuthV1AuthGroupListItem {
|
||||
auth_ids?: number[];
|
||||
count?: number;
|
||||
created_at?: string;
|
||||
id?: number;
|
||||
name?: string;
|
||||
parent_id?: number;
|
||||
path?: string;
|
||||
position?: number;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiAuthV1AuthGroupListResp {
|
||||
list?: GithubComChaitinPandaWikiProApiAuthV1AuthGroupListItem[];
|
||||
total?: number;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiAuthV1AuthGroupMoveReq {
|
||||
id: number;
|
||||
kb_id: string;
|
||||
next_id?: number;
|
||||
parent_id?: number;
|
||||
prev_id?: number;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiAuthV1AuthGroupSyncReq {
|
||||
kb_id?: string;
|
||||
source_type: "dingtalk" | "wecom";
|
||||
}
|
||||
|
||||
export type GithubComChaitinPandaWikiProApiAuthV1AuthGroupSyncResp = Record<
|
||||
string,
|
||||
any
|
||||
>;
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiAuthV1AuthGroupTreeItem {
|
||||
auth_ids?: number[];
|
||||
children?: GithubComChaitinPandaWikiProApiAuthV1AuthGroupTreeItem[];
|
||||
count?: number;
|
||||
created_at?: string;
|
||||
id?: number;
|
||||
level?: number;
|
||||
name?: string;
|
||||
parent_id?: number;
|
||||
position?: number;
|
||||
sync_id: string;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiAuthV1AuthGroupTreeResp {
|
||||
list?: GithubComChaitinPandaWikiProApiAuthV1AuthGroupTreeItem[];
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiAuthV1AuthGroupUpdateReq {
|
||||
auth_ids?: number[];
|
||||
id: number;
|
||||
kb_id: string;
|
||||
name?: string;
|
||||
parent_id?: number;
|
||||
position?: number;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiAuthV1AuthItem {
|
||||
avatar_url?: string;
|
||||
created_at?: string;
|
||||
id?: number;
|
||||
ip?: string;
|
||||
last_login_time?: string;
|
||||
source_type?: ConstsSourceType;
|
||||
username?: string;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiAuthV1AuthSetReq {
|
||||
agent_id?: string;
|
||||
authorize_url?: string;
|
||||
avatar_field?: string;
|
||||
/** 绑定DN */
|
||||
bind_dn?: string;
|
||||
/** 绑定密码 */
|
||||
bind_password?: string;
|
||||
cas_url?: string;
|
||||
/** CAS特定配置 */
|
||||
cas_version?: string;
|
||||
client_id?: string;
|
||||
client_secret?: string;
|
||||
email_field?: string;
|
||||
id_field?: string;
|
||||
kb_id?: string;
|
||||
/** LDAP特定配置 */
|
||||
ldap_server_url?: string;
|
||||
name_field?: string;
|
||||
proxy?: string;
|
||||
scopes?: string[];
|
||||
source_type?: ConstsSourceType;
|
||||
token_url?: string;
|
||||
/** 用户基础DN */
|
||||
user_base_dn?: string;
|
||||
/** 用户查询过滤器 */
|
||||
user_filter?: string;
|
||||
user_info_url?: string;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiContributeV1ContributeAuditReq {
|
||||
id: string;
|
||||
kb_id: string;
|
||||
nav_id: string;
|
||||
parent_id?: string;
|
||||
position?: number;
|
||||
status: "approved" | "rejected";
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiContributeV1ContributeAuditResp {
|
||||
message?: string;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiContributeV1ContributeDetailResp {
|
||||
audit_time?: string;
|
||||
audit_user_id?: string;
|
||||
auth_id?: number;
|
||||
auth_name?: string;
|
||||
content?: string;
|
||||
created_at?: string;
|
||||
id?: string;
|
||||
kb_id?: string;
|
||||
meta?: GithubComChaitinPandaWikiProApiContributeV1NodeMeta;
|
||||
node_id?: string;
|
||||
node_name?: string;
|
||||
/** edit类型时返回原始node信息 */
|
||||
original_node?: GithubComChaitinPandaWikiProApiContributeV1OriginalNodeInfo;
|
||||
reason?: string;
|
||||
status?: ConstsContributeStatus;
|
||||
type?: ConstsContributeType;
|
||||
updated_at?: string;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiContributeV1ContributeItem {
|
||||
audit_time?: string;
|
||||
audit_user_id?: string;
|
||||
auth_id?: number;
|
||||
auth_name?: string;
|
||||
contribute_name?: string;
|
||||
created_at?: string;
|
||||
id?: string;
|
||||
ip_address?: DomainIPAddress;
|
||||
kb_id?: string;
|
||||
meta?: GithubComChaitinPandaWikiProApiContributeV1NodeMeta;
|
||||
node_id?: string;
|
||||
node_name?: string;
|
||||
reason?: string;
|
||||
remote_ip?: string;
|
||||
status?: ConstsContributeStatus;
|
||||
type?: ConstsContributeType;
|
||||
updated_at?: string;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiContributeV1ContributeListResp {
|
||||
list?: GithubComChaitinPandaWikiProApiContributeV1ContributeItem[];
|
||||
total?: number;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiContributeV1NodeMeta {
|
||||
content_type?: string;
|
||||
doc_width?: string;
|
||||
emoji?: string;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiContributeV1OriginalNodeInfo {
|
||||
content?: string;
|
||||
id?: string;
|
||||
meta?: GithubComChaitinPandaWikiProApiContributeV1NodeMeta;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiShareV1AuthCASReq {
|
||||
kb_id?: string;
|
||||
redirect_url?: string;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiShareV1AuthCASResp {
|
||||
url?: string;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiShareV1AuthDingTalkReq {
|
||||
kb_id?: string;
|
||||
redirect_url?: string;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiShareV1AuthDingTalkResp {
|
||||
url?: string;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiShareV1AuthFeishuReq {
|
||||
kb_id?: string;
|
||||
redirect_url?: string;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiShareV1AuthFeishuResp {
|
||||
url?: string;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiShareV1AuthGitHubReq {
|
||||
kb_id?: string;
|
||||
redirect_url?: string;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiShareV1AuthGitHubResp {
|
||||
url?: string;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiShareV1AuthInfoResp {
|
||||
avatar_url?: string;
|
||||
email?: string;
|
||||
/** Unique identifier for the authentication record */
|
||||
id?: number;
|
||||
username?: string;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiShareV1AuthLDAPReq {
|
||||
kb_id?: string;
|
||||
password: string;
|
||||
username: string;
|
||||
}
|
||||
|
||||
export type GithubComChaitinPandaWikiProApiShareV1AuthLDAPResp = Record<
|
||||
string,
|
||||
any
|
||||
>;
|
||||
|
||||
export type GithubComChaitinPandaWikiProApiShareV1AuthLogoutResp = Record<
|
||||
string,
|
||||
any
|
||||
>;
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiShareV1AuthOAuthReq {
|
||||
kb_id?: string;
|
||||
redirect_url?: string;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiShareV1AuthOAuthResp {
|
||||
url?: string;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiShareV1AuthWecomReq {
|
||||
is_app?: boolean;
|
||||
kb_id?: string;
|
||||
redirect_url?: string;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiShareV1AuthWecomResp {
|
||||
url?: string;
|
||||
}
|
||||
|
||||
export type GithubComChaitinPandaWikiProApiShareV1CASCallbackResp = Record<
|
||||
string,
|
||||
any
|
||||
>;
|
||||
|
||||
export type GithubComChaitinPandaWikiProApiShareV1DingtalkCallbackResp = Record<
|
||||
string,
|
||||
any
|
||||
>;
|
||||
|
||||
export type GithubComChaitinPandaWikiProApiShareV1FeishuCallbackResp = Record<
|
||||
string,
|
||||
any
|
||||
>;
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiShareV1FileUploadResp {
|
||||
key?: string;
|
||||
}
|
||||
|
||||
export type GithubComChaitinPandaWikiProApiShareV1GitHubCallbackResp = Record<
|
||||
string,
|
||||
any
|
||||
>;
|
||||
|
||||
export type GithubComChaitinPandaWikiProApiShareV1OAuthCallbackResp = Record<
|
||||
string,
|
||||
any
|
||||
>;
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiShareV1SubmitContributeReq {
|
||||
captcha_token: string;
|
||||
content?: string;
|
||||
content_type: "html" | "md";
|
||||
emoji?: string;
|
||||
name?: string;
|
||||
node_id?: string;
|
||||
reason: string;
|
||||
type: "add" | "edit";
|
||||
}
|
||||
|
||||
export type GithubComChaitinPandaWikiProApiShareV1SubmitContributeResp = Record<
|
||||
string,
|
||||
any
|
||||
>;
|
||||
|
||||
export type GithubComChaitinPandaWikiProApiShareV1WecomCallbackResp = Record<
|
||||
string,
|
||||
any
|
||||
>;
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiTokenV1APITokenListItem {
|
||||
created_at?: string;
|
||||
id?: string;
|
||||
name?: string;
|
||||
permission?: ConstsUserKBPermission;
|
||||
token?: string;
|
||||
updated_at?: string;
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiTokenV1CreateAPITokenReq {
|
||||
kb_id: string;
|
||||
name: string;
|
||||
permission: "full_control" | "doc_manage" | "data_operate";
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProApiTokenV1UpdateAPITokenReq {
|
||||
id: string;
|
||||
kb_id: string;
|
||||
name?: string;
|
||||
permission?: "full_control" | "doc_manage" | "data_operate";
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProDomainBlockWords {
|
||||
words?: string[];
|
||||
}
|
||||
|
||||
export interface GithubComChaitinPandaWikiProDomainCreateBlockWordsReq {
|
||||
block_words?: string[];
|
||||
kb_id: string;
|
||||
}
|
||||
|
||||
export interface HandlerV1DocFeedBackLists {
|
||||
data?: DomainDocumentFeedbackListItem[];
|
||||
total?: number;
|
||||
}
|
||||
|
||||
export interface DeleteApiProV1AuthDeleteParams {
|
||||
id?: number;
|
||||
kb_id?: string;
|
||||
}
|
||||
|
||||
export interface GetApiProV1AuthGetParams {
|
||||
kb_id?: string;
|
||||
source_type?:
|
||||
| "dingtalk"
|
||||
| "feishu"
|
||||
| "wecom"
|
||||
| "oauth"
|
||||
| "github"
|
||||
| "cas"
|
||||
| "ldap"
|
||||
| "widget"
|
||||
| "dingtalk_bot"
|
||||
| "feishu_bot"
|
||||
| "lark_bot"
|
||||
| "wechat_bot"
|
||||
| "wecom_ai_bot"
|
||||
| "wechat_service_bot"
|
||||
| "discord_bot"
|
||||
| "wechat_official_account"
|
||||
| "openai_api"
|
||||
| "mcp_server";
|
||||
}
|
||||
|
||||
export interface DeleteApiProV1AuthGroupDeleteParams {
|
||||
id: number;
|
||||
kb_id: string;
|
||||
}
|
||||
|
||||
export interface GetApiProV1AuthGroupDetailParams {
|
||||
id: number;
|
||||
kb_id: string;
|
||||
}
|
||||
|
||||
export interface GetApiProV1AuthGroupListParams {
|
||||
kb_id: string;
|
||||
/** @min 1 */
|
||||
page: number;
|
||||
/** @min 1 */
|
||||
per_page: number;
|
||||
}
|
||||
|
||||
export interface GetApiProV1AuthGroupTreeParams {
|
||||
kb_id: string;
|
||||
}
|
||||
|
||||
export interface GetApiProV1BlockParams {
|
||||
/** knowledge base ID */
|
||||
kb_id: string;
|
||||
}
|
||||
|
||||
export interface GetApiProV1ContributeDetailParams {
|
||||
id: string;
|
||||
kb_id: string;
|
||||
}
|
||||
|
||||
export interface GetApiProV1ContributeListParams {
|
||||
auth_name?: string;
|
||||
kb_id?: string;
|
||||
node_name?: string;
|
||||
/** @min 1 */
|
||||
page: number;
|
||||
/** @min 1 */
|
||||
per_page: number;
|
||||
status?: "pending" | "approved" | "rejected";
|
||||
}
|
||||
|
||||
export interface DeleteApiProV1DocumentFeedbackParams {
|
||||
/** @minItems 1 */
|
||||
ids: string[];
|
||||
}
|
||||
|
||||
export interface GetApiProV1DocumentListParams {
|
||||
kb_id: string;
|
||||
/** @min 1 */
|
||||
page: number;
|
||||
/** @min 1 */
|
||||
per_page: number;
|
||||
}
|
||||
|
||||
export interface GetApiProV1NodeReleaseDetailParams {
|
||||
id: string;
|
||||
kb_id: string;
|
||||
}
|
||||
|
||||
export interface GetApiProV1NodeReleaseListParams {
|
||||
kb_id: string;
|
||||
node_id: string;
|
||||
}
|
||||
|
||||
export interface GetApiProV1PromptParams {
|
||||
/** knowledge base ID */
|
||||
kb_id: string;
|
||||
}
|
||||
|
||||
export interface DeleteApiProV1TokenDeleteParams {
|
||||
id: string;
|
||||
kb_id: string;
|
||||
}
|
||||
|
||||
export interface GetApiProV1TokenListParams {
|
||||
/** 知识库ID */
|
||||
kb_id: string;
|
||||
}
|
||||
|
||||
export interface PostApiV1LicensePayload {
|
||||
/** license type */
|
||||
license_type: "file" | "code";
|
||||
/**
|
||||
* license file
|
||||
* @format binary
|
||||
*/
|
||||
license_file?: File;
|
||||
/** license code */
|
||||
license_code?: string;
|
||||
}
|
||||
|
||||
export interface PostShareProV1DocumentFeedbackPayload {
|
||||
/** Node ID */
|
||||
node_id: string;
|
||||
/** Content */
|
||||
content: string;
|
||||
/** Correction Suggestion */
|
||||
correction_suggestion?: string;
|
||||
/**
|
||||
* Screenshot
|
||||
* @format binary
|
||||
*/
|
||||
image?: File;
|
||||
}
|
||||
|
||||
export interface PostShareProV1FileUploadPayload {
|
||||
/** File */
|
||||
file: File;
|
||||
}
|
||||
|
||||
export interface GetShareProV1OpenapiCasCallbackParams {
|
||||
state?: string;
|
||||
ticket?: string;
|
||||
}
|
||||
|
||||
export interface GetShareProV1OpenapiDingtalkCallbackParams {
|
||||
code?: string;
|
||||
state?: string;
|
||||
}
|
||||
|
||||
export interface GetShareProV1OpenapiFeishuCallbackParams {
|
||||
code?: string;
|
||||
state?: string;
|
||||
}
|
||||
|
||||
export interface GetShareProV1OpenapiGithubCallbackParams {
|
||||
code?: string;
|
||||
state?: string;
|
||||
}
|
||||
|
||||
export interface GetShareProV1OpenapiOauthCallbackParams {
|
||||
code?: string;
|
||||
state?: string;
|
||||
}
|
||||
|
||||
export interface GetShareProV1OpenapiWecomCallbackParams {
|
||||
code?: string;
|
||||
state?: string;
|
||||
}
|
||||
2160
web/app/src/request/types.ts
Normal file
2160
web/app/src/request/types.ts
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user