docs: update openapi files

This commit is contained in:
moonrailgun 2024-08-25 03:18:36 +08:00
parent 40df49e1db
commit 79a7a923d2
5 changed files with 331 additions and 30 deletions

View File

@ -47,7 +47,7 @@ export const OpenAPI: OpenAPIConfig = {
PASSWORD: undefined,
TOKEN: undefined,
USERNAME: undefined,
VERSION: '1.11.4',
VERSION: '1.13.1',
WITH_CREDENTIALS: false,
interceptors: {
request: new Interceptors(),

View File

@ -54,16 +54,118 @@ export class UserService {
}
export class WorkspaceService {
/**
* @param data The data for the request.
* @param data.requestBody
* @returns unknown Successful response
* @throws ApiError
*/
public static workspaceCreate(data: $OpenApiTs['/workspace//create']['post']['req']): CancelablePromise<$OpenApiTs['/workspace//create']['post']['res'][200]> {
return __request(OpenAPI, {
method: 'POST',
url: '/workspace//create',
body: data.requestBody,
mediaType: 'application/json'
});
}
/**
* @param data The data for the request.
* @param data.requestBody
* @returns unknown Successful response
* @throws ApiError
*/
public static workspaceSwitch(data: $OpenApiTs['/workspace//switch']['post']['req']): CancelablePromise<$OpenApiTs['/workspace//switch']['post']['res'][200]> {
return __request(OpenAPI, {
method: 'POST',
url: '/workspace//switch',
body: data.requestBody,
mediaType: 'application/json'
});
}
/**
* @param data The data for the request.
* @param data.workspaceId
* @returns unknown Successful response
* @throws ApiError
*/
public static workspaceGetServiceCount(data: $OpenApiTs['/workspace/{workspaceId}/getServiceCount']['get']['req']): CancelablePromise<$OpenApiTs['/workspace/{workspaceId}/getServiceCount']['get']['res'][200]> {
public static workspaceDelete(data: $OpenApiTs['/workspace//{workspaceId}']['delete']['req']): CancelablePromise<$OpenApiTs['/workspace//{workspaceId}']['delete']['res'][200]> {
return __request(OpenAPI, {
method: 'DELETE',
url: '/workspace//{workspaceId}',
path: {
workspaceId: data.workspaceId
}
});
}
/**
* @param data The data for the request.
* @param data.workspaceId
* @returns unknown Successful response
* @throws ApiError
*/
public static workspaceMembers(data: $OpenApiTs['/workspace//{workspaceId}/members']['get']['req']): CancelablePromise<$OpenApiTs['/workspace//{workspaceId}/members']['get']['res'][200]> {
return __request(OpenAPI, {
method: 'GET',
url: '/workspace/{workspaceId}/getServiceCount',
url: '/workspace//{workspaceId}/members',
path: {
workspaceId: data.workspaceId
}
});
}
/**
* @param data The data for the request.
* @param data.workspaceId
* @param data.requestBody
* @returns unknown Successful response
* @throws ApiError
*/
public static workspaceInvite(data: $OpenApiTs['/workspace//{workspaceId}/invite']['post']['req']): CancelablePromise<$OpenApiTs['/workspace//{workspaceId}/invite']['post']['res'][200]> {
return __request(OpenAPI, {
method: 'POST',
url: '/workspace//{workspaceId}/invite',
path: {
workspaceId: data.workspaceId
},
body: data.requestBody,
mediaType: 'application/json'
});
}
/**
* Administrator kicks a user out of a workspace.
* @param data The data for the request.
* @param data.workspaceId
* @param data.targetUserId
* @returns unknown Successful response
* @throws ApiError
*/
public static workspaceTick(data: $OpenApiTs['/workspace//{workspaceId}/tick']['delete']['req']): CancelablePromise<$OpenApiTs['/workspace//{workspaceId}/tick']['delete']['res'][200]> {
return __request(OpenAPI, {
method: 'DELETE',
url: '/workspace//{workspaceId}/tick',
path: {
workspaceId: data.workspaceId
},
query: {
targetUserId: data.targetUserId
}
});
}
/**
* @param data The data for the request.
* @param data.workspaceId
* @returns unknown Successful response
* @throws ApiError
*/
public static workspaceGetServiceCount(data: $OpenApiTs['/workspace//{workspaceId}/getServiceCount']['get']['req']): CancelablePromise<$OpenApiTs['/workspace//{workspaceId}/getServiceCount']['get']['res'][200]> {
return __request(OpenAPI, {
method: 'GET',
url: '/workspace//{workspaceId}/getServiceCount',
path: {
workspaceId: data.workspaceId
}
@ -998,10 +1100,11 @@ export class SurveyService {
* @param data.workspaceId
* @param data.surveyId
* @param data.requestBody
* @returns unknown Successful response
* @returns string Successful response
* @returns unknown Error response
* @throws ApiError
*/
public static surveySubmit(data: $OpenApiTs['/workspace/{workspaceId}/survey/{surveyId}/submit']['post']['req']): CancelablePromise<$OpenApiTs['/workspace/{workspaceId}/survey/{surveyId}/submit']['post']['res'][200]> {
public static surveySubmit(data: $OpenApiTs['/workspace/{workspaceId}/survey/{surveyId}/submit']['post']['req']): CancelablePromise<$OpenApiTs['/workspace/{workspaceId}/survey/{surveyId}/submit']['post']['res'][200] | $OpenApiTs['/workspace/{workspaceId}/survey/{surveyId}/submit']['post']['res'][200]> {
return __request(OpenAPI, {
method: 'POST',
url: '/workspace/{workspaceId}/survey/{surveyId}/submit',
@ -1305,4 +1408,22 @@ export class FeedService {
});
}
/**
* integrate with tencent-cloud webhook
* @param data The data for the request.
* @param data.channelId
* @returns string Successful response
* @returns unknown Error response
* @throws ApiError
*/
public static feedIntegrationTencentCloudAlarm(data: $OpenApiTs['/feed/{channelId}/tencent-cloud/alarm']['post']['req']): CancelablePromise<$OpenApiTs['/feed/{channelId}/tencent-cloud/alarm']['post']['res'][200] | $OpenApiTs['/feed/{channelId}/tencent-cloud/alarm']['post']['res'][200]> {
return __request(OpenAPI, {
method: 'POST',
url: '/feed/{channelId}/tencent-cloud/alarm',
path: {
channelId: data.channelId
}
});
}
}

View File

@ -15,6 +15,7 @@ export type $OpenApiTs = {
alphaMode: boolean;
disableAnonymousTelemetry: boolean;
customTrackerScriptName?: string;
authProvider: Array<(string)>;
};
};
};
@ -33,21 +34,18 @@ export type $OpenApiTs = {
*/
200: {
info: {
username: string;
id: string;
role: string;
username: string;
nickname: string | null;
avatar: string | null;
email: string | null;
createdAt: string;
updatedAt: string;
deletedAt: string | null;
currentWorkspace: {
id: string;
name: string;
dashboardLayout: {
layouts: {
[key: string]: (unknown[]);
};
items: unknown[];
} | null;
};
workspaces: Array<{
role: string;
@ -75,21 +73,18 @@ export type $OpenApiTs = {
*/
200: {
info: {
username: string;
id: string;
role: string;
username: string;
nickname: string | null;
avatar: string | null;
email: string | null;
createdAt: string;
updatedAt: string;
deletedAt: string | null;
currentWorkspace: {
id: string;
name: string;
dashboardLayout: {
layouts: {
[key: string]: (unknown[]);
};
items: unknown[];
} | null;
};
workspaces: Array<{
role: string;
@ -104,7 +99,147 @@ export type $OpenApiTs = {
};
};
};
'/workspace/{workspaceId}/getServiceCount': {
'/workspace//create': {
post: {
req: {
requestBody: {
name: string;
};
};
res: {
/**
* Successful response
*/
200: {
id: string;
role: string;
username: string;
nickname: string | null;
avatar: string | null;
email: string | null;
createdAt: string;
updatedAt: string;
deletedAt: string | null;
currentWorkspace: {
id: string;
name: string;
};
workspaces: Array<{
role: string;
workspace: {
id: string;
name: string;
};
}>;
};
};
};
};
'/workspace//switch': {
post: {
req: {
requestBody: {
workspaceId: string;
};
};
res: {
/**
* Successful response
*/
200: {
id: string;
role: string;
username: string;
nickname: string | null;
avatar: string | null;
email: string | null;
createdAt: string;
updatedAt: string;
deletedAt: string | null;
currentWorkspace: {
id: string;
name: string;
};
workspaces: Array<{
role: string;
workspace: {
id: string;
name: string;
};
}>;
};
};
};
};
'/workspace//{workspaceId}': {
delete: {
req: {
workspaceId: string;
};
res: {
/**
* Successful response
*/
200: unknown;
};
};
};
'/workspace//{workspaceId}/members': {
get: {
req: {
workspaceId: string;
};
res: {
/**
* Successful response
*/
200: Array<{
userId: string;
workspaceId: string;
role: string;
createdAt: string;
updatedAt: string;
user: {
username: string;
nickname: string | null;
email: string | null;
emailVerified: string | null;
};
}>;
};
};
};
'/workspace//{workspaceId}/invite': {
post: {
req: {
requestBody: {
targetUserEmail: string;
};
workspaceId: string;
};
res: {
/**
* Successful response
*/
200: unknown;
};
};
};
'/workspace//{workspaceId}/tick': {
delete: {
req: {
targetUserId: string;
workspaceId: string;
};
res: {
/**
* Successful response
*/
200: unknown;
};
};
};
'/workspace//{workspaceId}/getServiceCount': {
get: {
req: {
workspaceId: string;
@ -1095,6 +1230,8 @@ export type $OpenApiTs = {
options?: Array<(string)>;
}>;
};
feedChannelIds: Array<(string)>;
feedTemplate: string;
createdAt: string;
updatedAt: string;
}>;
@ -1123,6 +1260,8 @@ export type $OpenApiTs = {
options?: Array<(string)>;
}>;
};
feedChannelIds: Array<(string)>;
feedTemplate: string;
createdAt: string;
updatedAt: string;
} | null;
@ -1181,9 +1320,15 @@ export type $OpenApiTs = {
};
res: {
/**
* Successful response
* Error response
*/
200: unknown;
200: {
message: string;
code: string;
issues?: Array<{
message: string;
}>;
};
};
};
};
@ -1200,6 +1345,8 @@ export type $OpenApiTs = {
options?: Array<(string)>;
}>;
};
feedChannelIds: Array<(string)>;
feedTemplate: string;
};
workspaceId: string;
};
@ -1219,6 +1366,8 @@ export type $OpenApiTs = {
options?: Array<(string)>;
}>;
};
feedChannelIds: Array<(string)>;
feedTemplate: string;
createdAt: string;
updatedAt: string;
};
@ -1238,6 +1387,8 @@ export type $OpenApiTs = {
options?: Array<(string)>;
}>;
};
feedChannelIds?: Array<(string)>;
feedTemplate?: string;
};
surveyId: string;
workspaceId: string;
@ -1258,6 +1409,8 @@ export type $OpenApiTs = {
options?: Array<(string)>;
}>;
};
feedChannelIds: Array<(string)>;
feedTemplate: string;
createdAt: string;
updatedAt: string;
};
@ -1286,6 +1439,8 @@ export type $OpenApiTs = {
options?: Array<(string)>;
}>;
};
feedChannelIds: Array<(string)>;
feedTemplate: string;
createdAt: string;
updatedAt: string;
};
@ -1372,6 +1527,8 @@ export type $OpenApiTs = {
websiteAcceptedCount: number;
websiteEventCount: number;
monitorExecutionCount: number;
surveyCount: number;
feedEventCount: number;
};
};
};
@ -1389,7 +1546,7 @@ export type $OpenApiTs = {
id: string;
workspaceId: string;
name: string;
notifyFrequency: string;
notifyFrequency: 'none' | 'event' | 'day' | 'week' | 'month';
createdAt: string;
updatedAt: string;
_count: {
@ -1414,7 +1571,7 @@ export type $OpenApiTs = {
id: string;
workspaceId: string;
name: string;
notifyFrequency: string;
notifyFrequency: 'none' | 'event' | 'day' | 'week' | 'month';
createdAt: string;
updatedAt: string;
} | null;
@ -1428,7 +1585,7 @@ export type $OpenApiTs = {
requestBody: {
notificationIds?: Array<(string)>;
name: string;
notifyFrequency: string;
notifyFrequency: 'none' | 'event' | 'day' | 'week' | 'month';
};
workspaceId: string;
};
@ -1441,7 +1598,7 @@ export type $OpenApiTs = {
id: string;
workspaceId: string;
name: string;
notifyFrequency: string;
notifyFrequency: 'none' | 'event' | 'day' | 'week' | 'month';
createdAt: string;
updatedAt: string;
} | null;
@ -1485,7 +1642,7 @@ export type $OpenApiTs = {
req: {
requestBody: {
name: string;
notifyFrequency: string;
notifyFrequency: 'none' | 'event' | 'day' | 'week' | 'month';
notificationIds?: Array<(string)>;
};
workspaceId: string;
@ -1499,7 +1656,7 @@ export type $OpenApiTs = {
id: string;
workspaceId: string;
name: string;
notifyFrequency: string;
notifyFrequency: 'none' | 'event' | 'day' | 'week' | 'month';
createdAt: string;
updatedAt: string;
};
@ -1520,7 +1677,7 @@ export type $OpenApiTs = {
id: string;
workspaceId: string;
name: string;
notifyFrequency: string;
notifyFrequency: 'none' | 'event' | 'day' | 'week' | 'month';
createdAt: string;
updatedAt: string;
};
@ -1581,4 +1738,23 @@ export type $OpenApiTs = {
};
};
};
'/feed/{channelId}/tencent-cloud/alarm': {
post: {
req: {
channelId: string;
};
res: {
/**
* Error response
*/
200: {
message: string;
code: string;
issues?: Array<{
message: string;
}>;
};
};
};
};
};

View File

@ -1,6 +1,10 @@
import { trpcOpenapiDocument } from '../src/server/trpc';
import fs from 'fs-extra';
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const target = path.resolve(__dirname, '../website/openapi.json');
fs.writeJSON(target, trpcOpenapiDocument)

File diff suppressed because one or more lines are too long