UNPKG

tianji-client-sdk

Version:

1,667 lines 178 kB
/** * The error information */ export type error_BAD_REQUEST = { /** * The error message */ message: string; /** * The error code */ code: string; /** * An array of issues that were responsible for the error */ issues?: Array<{ message: string; }>; }; /** * The error information */ export type error_UNAUTHORIZED = { /** * The error message */ message: string; /** * The error code */ code: string; /** * An array of issues that were responsible for the error */ issues?: Array<{ message: string; }>; }; /** * The error information */ export type error_FORBIDDEN = { /** * The error message */ message: string; /** * The error code */ code: string; /** * An array of issues that were responsible for the error */ issues?: Array<{ message: string; }>; }; /** * The error information */ export type error_INTERNAL_SERVER_ERROR = { /** * The error message */ message: string; /** * The error code */ code: string; /** * An array of issues that were responsible for the error */ issues?: Array<{ message: string; }>; }; /** * The error information */ export type error_NOT_FOUND = { /** * The error message */ message: string; /** * The error code */ code: string; /** * An array of issues that were responsible for the error */ issues?: Array<{ message: string; }>; }; export type $OpenApiTs = { '/ai/classifySurvey': { post: { req: { requestBody: { workspaceId: string; surveyId: string; startAt: number; endAt: number; runStrategy: 'skipExist' | 'skipInSuggest' | 'rebuildAll'; languageStrategy?: 'default' | 'user'; payloadContentField: string; suggestionCategory: Array<(string)>; }; }; res: { /** * Successful response */ 200: "ok"; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/ai/translateSurvey': { post: { req: { requestBody: { workspaceId: string; surveyId: string; startAt: number; endAt: number; runStrategy: 'skipExist' | 'rebuildAll'; languageStrategy?: 'default' | 'user'; payloadContentField: string; }; }; res: { /** * Successful response */ 200: "ok"; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/aiGateway/info': { get: { req: { gatewayId: string; workspaceId: string; }; res: { /** * Successful response */ 200: { id: string; workspaceId: string; name: string; modelApiKey?: string | null; customModelBaseUrl?: string | null; customModelName?: string | null; customModelInputPrice?: number | null; customModelOutputPrice?: number | null; createdAt: string; updatedAt: string; } | null; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Not found */ 404: error_NOT_FOUND; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/aiGateway/update': { patch: { req: { requestBody: { workspaceId: string; gatewayId: string; name: string; modelApiKey: string | null; customModelBaseUrl: string | null; customModelName: string | null; customModelInputPrice: number | null; customModelOutputPrice: number | null; }; }; res: { /** * Successful response */ 200: { id: string; workspaceId: string; name: string; modelApiKey?: string | null; customModelBaseUrl?: string | null; customModelName?: string | null; customModelInputPrice?: number | null; customModelOutputPrice?: number | null; createdAt: string; updatedAt: string; }; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Not found */ 404: error_NOT_FOUND; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/aiGateway/delete': { delete: { req: { gatewayId: string; workspaceId: string; }; res: { /** * Successful response */ 200: { id: string; workspaceId: string; name: string; modelApiKey?: string | null; customModelBaseUrl?: string | null; customModelName?: string | null; customModelInputPrice?: number | null; customModelOutputPrice?: number | null; createdAt: string; updatedAt: string; }; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Not found */ 404: error_NOT_FOUND; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/aiGateway/logs': { get: { req: { cursor?: string; gatewayId: string; limit?: number; logId?: string; workspaceId: string; }; res: { /** * Successful response */ 200: { items: Array<{ id: string; workspaceId: string; gatewayId: string; inputToken: number; outputToken: number; stream: boolean; modelName: string; status: 'Pending' | 'Success' | 'Failed'; duration: number; ttft: number; price: number; userId?: string | null; createdAt: string; updatedAt: string; requestPayload?: unknown; responsePayload?: unknown; }>; nextCursor?: string; }; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Not found */ 404: error_NOT_FOUND; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/aiGateway/model-pricing': { get: { req: { limit?: number; search?: string; workspaceId: string; }; res: { /** * Successful response */ 200: { providers: Array<{ id: string; name: string; api?: string; doc?: string; models: Array<{ id: string; name: string; attachment?: boolean; reasoning?: boolean; temperature?: boolean; tool_call?: boolean; knowledge?: string; release_date?: string; last_updated?: string; modalities?: { input?: Array<(string)>; output?: Array<(string)>; }; open_weights?: boolean; cost?: { input?: number; output?: number; cache_read?: number; }; limit?: { context?: number; output?: number; }; }>; }>; }; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Not found */ 404: error_NOT_FOUND; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/aiGateway/quota-alert': { get: { req: { gatewayId: string; workspaceId: string; }; res: { /** * Successful response */ 200: { id: string; dailyQuota: number; enabled: boolean; notificationId: string | null; lastAlertSentAt: string | null; alertLevel80Sent: boolean; alertLevel100Sent: boolean; alertLevel150Sent: boolean; } | null; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Not found */ 404: error_NOT_FOUND; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/aiGateway/quota-alert/upsert': { post: { req: { requestBody: { workspaceId: string; gatewayId: string; dailyQuota: number; enabled: boolean; notificationId: string | null; }; }; res: { /** * Successful response */ 200: { id: string; dailyQuota: number; enabled: boolean; notificationId: string | null; }; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/aiGateway/quota-alert/delete': { delete: { req: { gatewayId: string; workspaceId: string; }; res: { /** * Successful response */ 200: boolean; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Not found */ 404: error_NOT_FOUND; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/workspace/{workspaceId}/aiGateway/all': { get: { req: { workspaceId: string; }; res: { /** * Successful response */ 200: Array<{ id: string; workspaceId: string; name: string; modelApiKey?: string | null; customModelBaseUrl?: string | null; customModelName?: string | null; customModelInputPrice?: number | null; customModelOutputPrice?: number | null; createdAt: string; updatedAt: string; }>; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Not found */ 404: error_NOT_FOUND; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/workspace/{workspaceId}/aiGateway/create': { post: { req: { requestBody: { name: string; modelApiKey: string | null; customModelBaseUrl: string | null; customModelName: string | null; customModelInputPrice: number | null; customModelOutputPrice: number | null; }; workspaceId: string; }; res: { /** * Successful response */ 200: { id: string; workspaceId: string; name: string; modelApiKey?: string | null; customModelBaseUrl?: string | null; customModelName?: string | null; customModelInputPrice?: number | null; customModelOutputPrice?: number | null; createdAt: string; updatedAt: string; }; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/workspace/{workspaceId}/application/all': { get: { req: { workspaceId: string; }; res: { /** * Successful response */ 200: Array<{ id: string; workspaceId: string; name: string; createdAt: string; updatedAt: string; deletedAt?: string | null; }>; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Not found */ 404: error_NOT_FOUND; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/workspace/{workspaceId}/application/{applicationId}/info': { get: { req: { applicationId: string; workspaceId: string; }; res: { /** * Successful response */ 200: { id: string; workspaceId: string; name: string; createdAt: string; updatedAt: string; deletedAt?: string | null; applicationStoreInfos: Array<{ applicationId: string; storeType: string; storeId: string; appId: string; title: string; description: string; releaseNotes: string; url: string; downloads?: number | null; score?: number | null; ratingCount?: number | null; reviews?: number | null; version?: string | null; size?: number | null; createdAt: string; updatedAt: string; }>; } | null; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Not found */ 404: error_NOT_FOUND; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/workspace/{workspaceId}/application/create': { post: { req: { requestBody: { name: string; appstoreId?: string; playstoreId?: string; }; workspaceId: string; }; res: { /** * Successful response */ 200: { id: string; workspaceId: string; name: string; createdAt: string; updatedAt: string; deletedAt: string | null; }; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/workspace/{workspaceId}/application/{applicationId}/update': { patch: { req: { applicationId: string; requestBody: { name: string; appstoreId?: string; playstoreId?: string; }; workspaceId: string; }; res: { /** * Successful response */ 200: { id: string; workspaceId: string; name: string; createdAt: string; updatedAt: string; deletedAt: string | null; }; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Not found */ 404: error_NOT_FOUND; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/workspace/{workspaceId}/application/{applicationId}/delete': { delete: { req: { applicationId: string; workspaceId: string; }; res: { /** * Successful response */ 200: { id: string; workspaceId: string; name: string; createdAt: string; updatedAt: string; deletedAt: string | null; }; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Not found */ 404: error_NOT_FOUND; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/application/storeAppSearch': { get: { req: { keyword: string; storeType: 'appstore' | 'googleplay'; workspaceId: string; }; res: { /** * Successful response */ 200: Array<{ id?: string; appId: string; title: string; icon: string; }>; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Not found */ 404: error_NOT_FOUND; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/workspace/{workspaceId}/application/{applicationId}/storeInfoHistory': { get: { req: { applicationId: string; endAt: number; startAt: number; storeId?: string; storeType: 'appstore' | 'googleplay'; workspaceId: string; }; res: { /** * Successful response */ 200: Array<{ downloads?: number | null; score?: number | null; ratingCount?: number | null; reviews?: number | null; size?: number | null; createdAt: string; }>; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Not found */ 404: error_NOT_FOUND; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/workspace/{workspaceId}/application/{applicationId}/eventStats': { get: { req: { applicationId: string; endAt: number; startAt: number; timezone?: string; unit?: 'minute' | 'hour' | 'day' | 'month' | 'year'; workspaceId: string; }; res: { /** * Successful response */ 200: { current: Array<{ date: string; eventCount: number; sessionCount: number; totalTime: number; avgEventsPerSession: number; avgScreensPerSession: number; }>; previous: Array<{ date: string; eventCount: number; sessionCount: number; totalTime: number; avgEventsPerSession: number; avgScreensPerSession: number; }>; }; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Not found */ 404: error_NOT_FOUND; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/global/config': { get: { res: { /** * Successful response */ 200: { allowRegister: boolean; websiteId?: string; amapToken?: string; mapboxToken?: string; alphaMode: boolean; disableAnonymousTelemetry: boolean; customTrackerScriptName?: string; serverTimezone?: string; authProvider: Array<(string)>; customAuthProviderIcon?: string; smtpAvailable: boolean; enableBilling: boolean; enableAI: boolean; enableFunctionWorker: boolean; observability: { tianji: { baseUrl?: string; websiteId?: string; }; }; }; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/login': { post: { req: { requestBody: { username: string; password: string; }; }; res: { /** * Successful response */ 200: { info: { id: string; role: string; username: string; nickname: string | null; avatar: string | null; email: string | null; createdAt: string; updatedAt: string; deletedAt: string | null; currentWorkspaceId: string | null; workspaces: Array<{ role: string; workspace: { id: string; name: string; settings: { [key: string]: unknown; }; paused: boolean; }; }>; }; token: string; }; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/loginWithToken': { post: { req: { requestBody: { token: string; }; }; res: { /** * Successful response */ 200: { info: { id: string; role: string; username: string; nickname: string | null; avatar: string | null; email: string | null; createdAt: string; updatedAt: string; deletedAt: string | null; currentWorkspaceId: string | null; workspaces: Array<{ role: string; workspace: { id: string; name: string; settings: { [key: string]: unknown; }; paused: boolean; }; }>; }; token: string; }; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/register': { post: { req: { requestBody: { username: string; password: string; }; }; res: { /** * Successful response */ 200: { info: { id: string; role: string; username: string; nickname: string | null; avatar: string | null; email: string | null; createdAt: string; updatedAt: string; deletedAt: string | null; currentWorkspaceId: string | null; workspaces: Array<{ role: string; workspace: { id: string; name: string; settings: { [key: string]: unknown; }; paused: boolean; }; }>; }; token: string; }; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/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; currentWorkspaceId: string | null; workspaces: Array<{ role: string; workspace: { id: string; name: string; settings: { [key: string]: unknown; }; paused: boolean; }; }>; }; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/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; currentWorkspaceId: string | null; workspaces: Array<{ role: string; workspace: { id: string; name: string; settings: { [key: string]: unknown; }; paused: boolean; }; }>; }; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/workspace/rename': { patch: { req: { requestBody: { workspaceId: string; name: string; }; }; res: { /** * Successful response */ 200: { id: string; name: string; settings: { [key: string]: unknown; }; paused: boolean; }; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Not found */ 404: error_NOT_FOUND; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/workspace/{workspaceId}/del': { delete: { req: { workspaceId: string; }; res: { /** * Successful response */ 200: unknown; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Not found */ 404: error_NOT_FOUND; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/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; }; }>; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Not found */ 404: error_NOT_FOUND; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/workspace/{workspaceId}/updateSettings': { post: { req: { requestBody: { settings: { [key: string]: (unknown) | undefined; }; }; workspaceId: string; }; res: { /** * Successful response */ 200: { id: string; name: string; settings: { [key: string]: unknown; }; paused: boolean; }; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/workspace/{workspaceId}/invite': { post: { req: { requestBody: { emailOrId: string; role?: 'admin' | 'readOnly'; }; workspaceId: string; }; res: { /** * Successful response */ 200: unknown; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/workspace/{workspaceId}/tick': { delete: { req: { targetUserId: string; workspaceId: string; }; res: { /** * Successful response */ 200: unknown; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Not found */ 404: error_NOT_FOUND; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/workspace/{workspaceId}/updateMemberRole': { patch: { req: { requestBody: { userId: string; role: 'owner' | 'admin' | 'readOnly'; }; workspaceId: string; }; res: { /** * Successful response */ 200: unknown; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Not found */ 404: error_NOT_FOUND; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/workspace/{workspaceId}/getServiceCount': { get: { req: { workspaceId: string; }; res: { /** * Successful response */ 200: { website: number; application: number; monitor: number; server: number; telemetry: number; page: number; survey: number; feed: number; shortLink: number; aiGateway: number; functionWorker: number; }; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error_FORBIDDEN; /** * Not found */ 404: error_NOT_FOUND; /** * Internal server error */ 500: error_INTERNAL_SERVER_ERROR; }; }; }; '/workspace/{workspaceId}/website/{websiteId}/onlineCount': { get: { req: { websiteId: string; workspaceId: string; }; res: { /** * Successful response */ 200: number; /** * Invalid input data */ 400: error_BAD_REQUEST; /** * Authorization not provided */ 401: error_UNAUTHORIZED; /** * Insufficient access */ 403: error