@mix-space-lts/api-client 2.4.2 → 2.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter-D1g1obyM.d.mts +25 -0
- package/dist/adapter-DLzJOGbI.d.cts +25 -0
- package/dist/adaptors/axios.cjs +63 -0
- package/dist/adaptors/axios.d.cts +7 -0
- package/dist/adaptors/axios.d.mts +7 -0
- package/dist/adaptors/axios.mjs +32 -0
- package/dist/adaptors/fetch.cjs +77 -0
- package/dist/adaptors/fetch.d.cts +6 -0
- package/dist/adaptors/fetch.d.mts +6 -0
- package/dist/adaptors/fetch.mjs +75 -0
- package/dist/adaptors/umi-request.cjs +35 -0
- package/dist/adaptors/umi-request.d.cts +7 -0
- package/dist/adaptors/umi-request.d.mts +7 -0
- package/dist/adaptors/umi-request.mjs +32 -0
- package/dist/index.cjs +1340 -0
- package/dist/index.d.cts +2653 -0
- package/dist/index.d.mts +2653 -0
- package/dist/index.mjs +1296 -0
- package/package.json +5 -2
- package/readme.md +15 -15
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,2653 @@
|
|
|
1
|
+
import { n as IRequestAdapter, r as RequestOptions, t as IAdaptorRequestResponseType } from "./adapter-DLzJOGbI.cjs";
|
|
2
|
+
|
|
3
|
+
//#region interfaces/controller.d.ts
|
|
4
|
+
interface IController {
|
|
5
|
+
base: string;
|
|
6
|
+
name: string | string[];
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region interfaces/types.d.ts
|
|
10
|
+
type Class<T> = new (...args: any[]) => T;
|
|
11
|
+
type SelectFields<T extends string> = `${'+' | '-' | ''}${T}`[];
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region interfaces/client.d.ts
|
|
14
|
+
interface IClientOptions {
|
|
15
|
+
controllers: Class<IController>[];
|
|
16
|
+
getCodeMessageFromException: <T = Error>(error: T) => {
|
|
17
|
+
message?: string | undefined | null;
|
|
18
|
+
code?: number | undefined | null;
|
|
19
|
+
};
|
|
20
|
+
customThrowResponseError: <T extends Error = Error>(err: any) => T;
|
|
21
|
+
transformResponse: <T = any>(data: any) => T;
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @default (res) => res.data
|
|
25
|
+
*/
|
|
26
|
+
getDataFromResponse: <T = any>(response: unknown) => T;
|
|
27
|
+
}
|
|
28
|
+
type ClientOptions = Partial<IClientOptions>;
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region interfaces/request.d.ts
|
|
31
|
+
type NoStringIndex<T> = { [K in keyof T as string extends K ? never : K]: T[K] };
|
|
32
|
+
interface IRequestHandler<ResponseWrapper> {
|
|
33
|
+
(path?: string | number): IRequestHandler<ResponseWrapper>;
|
|
34
|
+
get: <P = unknown>(options?: Omit<NoStringIndex<RequestOptions>, 'data'>) => RequestProxyResult<P, ResponseWrapper>;
|
|
35
|
+
post: <P = unknown>(options?: RequestOptions) => RequestProxyResult<P, ResponseWrapper>;
|
|
36
|
+
patch: <P = unknown>(options?: RequestOptions) => RequestProxyResult<P, ResponseWrapper>;
|
|
37
|
+
delete: <P = unknown>(options?: Omit<NoStringIndex<RequestOptions>, 'data'>) => RequestProxyResult<P, ResponseWrapper>;
|
|
38
|
+
put: <P = unknown>(options?: RequestOptions) => RequestProxyResult<P, ResponseWrapper>;
|
|
39
|
+
toString: (withBase?: boolean) => string;
|
|
40
|
+
valueOf: (withBase?: boolean) => string;
|
|
41
|
+
[key: string]: IRequestHandler<ResponseWrapper>;
|
|
42
|
+
}
|
|
43
|
+
type RequestProxyResult<T, ResponseWrapper, R = (ResponseWrapper extends unknown ? {
|
|
44
|
+
data: T;
|
|
45
|
+
[key: string]: any;
|
|
46
|
+
} : ResponseWrapper extends {
|
|
47
|
+
data: T;
|
|
48
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, 'data'> & {
|
|
49
|
+
data: T;
|
|
50
|
+
})> = Promise<ResponseProxyExtraRaw<T, R, ResponseWrapper>>;
|
|
51
|
+
type CamelToSnake<T extends string, P extends string = ''> = string extends T ? string : T extends `${infer C0}${infer R}` ? CamelToSnake<R, `${P}${C0 extends Lowercase<C0> ? '' : '_'}${Lowercase<C0>}`> : P;
|
|
52
|
+
type CamelKeysToSnake<T> = { [K in keyof T as CamelToSnake<Extract<K, string>>]: T[K] };
|
|
53
|
+
type ResponseWrapperType<Response, RawData, T> = {
|
|
54
|
+
$raw: Response extends {
|
|
55
|
+
data: infer T;
|
|
56
|
+
} ? Response : Response extends unknown ? {
|
|
57
|
+
[i: string]: any;
|
|
58
|
+
data: RawData extends unknown ? CamelKeysToSnake<T> : RawData;
|
|
59
|
+
} : Response;
|
|
60
|
+
$request: {
|
|
61
|
+
path: string;
|
|
62
|
+
method: string;
|
|
63
|
+
[k: string]: string;
|
|
64
|
+
};
|
|
65
|
+
$serialized: T;
|
|
66
|
+
};
|
|
67
|
+
type ResponseProxyExtraRaw<T, RawData = unknown, Response = unknown> = T extends object ? T & ResponseWrapperType<Response, RawData, T> : T extends unknown ? T & ResponseWrapperType<Response, RawData, T> : unknown;
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region core/client.d.ts
|
|
70
|
+
declare class HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
71
|
+
private readonly _endpoint;
|
|
72
|
+
private _adaptor;
|
|
73
|
+
private options;
|
|
74
|
+
private readonly _proxy;
|
|
75
|
+
constructor(_endpoint: string, _adaptor: T, options?: Omit<ClientOptions, 'controllers'>);
|
|
76
|
+
private initGetClient;
|
|
77
|
+
injectControllers(...Controller: Class<IController>[]): void;
|
|
78
|
+
injectControllers(Controller: Class<IController>[]): void;
|
|
79
|
+
get endpoint(): string;
|
|
80
|
+
get instance(): T;
|
|
81
|
+
request(options: {
|
|
82
|
+
url: string;
|
|
83
|
+
method?: string;
|
|
84
|
+
data?: any;
|
|
85
|
+
params?: any;
|
|
86
|
+
}): Promise<IAdaptorRequestResponseType<any>>;
|
|
87
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
88
|
+
private buildRoute;
|
|
89
|
+
}
|
|
90
|
+
declare function createClient<T extends IRequestAdapter>(adapter: T): <ResponseWrapper = (T extends {
|
|
91
|
+
responseWrapper: infer Type;
|
|
92
|
+
} ? Type extends undefined ? unknown : Type : unknown)>(endpoint: string, options?: ClientOptions) => HTTPClient<T, ResponseWrapper>;
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region core/error.d.ts
|
|
95
|
+
declare class RequestError extends Error {
|
|
96
|
+
status: number;
|
|
97
|
+
path: string;
|
|
98
|
+
raw: any;
|
|
99
|
+
constructor(message: string, status: number, path: string, raw: any);
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region controllers/ack.d.ts
|
|
103
|
+
declare module '@mix-space-lts/api-client' {
|
|
104
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
105
|
+
ack: AckController<ResponseWrapper>;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* @support core >= 4.4.0
|
|
110
|
+
*/
|
|
111
|
+
declare class AckController<ResponseWrapper> implements IController {
|
|
112
|
+
private client;
|
|
113
|
+
base: string;
|
|
114
|
+
name: string;
|
|
115
|
+
constructor(client: HTTPClient);
|
|
116
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
117
|
+
read(type: 'post' | 'note', id: string): RequestProxyResult<never, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
118
|
+
[key: string]: any;
|
|
119
|
+
data: never;
|
|
120
|
+
} : ResponseWrapper extends {
|
|
121
|
+
data: never;
|
|
122
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
123
|
+
data: never;
|
|
124
|
+
}>;
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region ../../apps/core/src/constants/db.constant.d.ts
|
|
128
|
+
declare enum CollectionRefTypes {
|
|
129
|
+
Post = "posts",
|
|
130
|
+
Note = "notes",
|
|
131
|
+
Page = "pages",
|
|
132
|
+
Recently = "recentlies"
|
|
133
|
+
}
|
|
134
|
+
//#endregion
|
|
135
|
+
//#region models/base.d.ts
|
|
136
|
+
interface Count {
|
|
137
|
+
read: number;
|
|
138
|
+
like: number;
|
|
139
|
+
}
|
|
140
|
+
interface Image {
|
|
141
|
+
height: number;
|
|
142
|
+
width: number;
|
|
143
|
+
type: string;
|
|
144
|
+
accent?: string;
|
|
145
|
+
src: string;
|
|
146
|
+
blurHash?: string;
|
|
147
|
+
}
|
|
148
|
+
interface Pager {
|
|
149
|
+
total: number;
|
|
150
|
+
size: number;
|
|
151
|
+
currentPage: number;
|
|
152
|
+
totalPage: number;
|
|
153
|
+
hasPrevPage: boolean;
|
|
154
|
+
hasNextPage: boolean;
|
|
155
|
+
}
|
|
156
|
+
interface PaginateResult<T> {
|
|
157
|
+
data: T[];
|
|
158
|
+
pagination: Pager;
|
|
159
|
+
}
|
|
160
|
+
interface BaseModel {
|
|
161
|
+
created: string;
|
|
162
|
+
id: string;
|
|
163
|
+
}
|
|
164
|
+
interface BaseCommentIndexModel extends BaseModel {
|
|
165
|
+
commentsIndex?: number;
|
|
166
|
+
allowComment: boolean;
|
|
167
|
+
}
|
|
168
|
+
interface TextBaseModelMarkdown extends BaseCommentIndexModel {
|
|
169
|
+
title: string;
|
|
170
|
+
text: string;
|
|
171
|
+
contentFormat?: 'markdown';
|
|
172
|
+
content?: undefined;
|
|
173
|
+
images?: Image[];
|
|
174
|
+
modified: string | null;
|
|
175
|
+
meta?: Record<string, any> | null;
|
|
176
|
+
}
|
|
177
|
+
interface TextBaseModelLexical extends BaseCommentIndexModel {
|
|
178
|
+
title: string;
|
|
179
|
+
text?: string;
|
|
180
|
+
contentFormat: 'lexical';
|
|
181
|
+
content: string;
|
|
182
|
+
images?: Image[];
|
|
183
|
+
modified: string | null;
|
|
184
|
+
meta?: Record<string, any> | null;
|
|
185
|
+
}
|
|
186
|
+
type TextBaseModel = TextBaseModelMarkdown | TextBaseModelLexical;
|
|
187
|
+
type ModelWithLiked<T> = T & {
|
|
188
|
+
liked: boolean;
|
|
189
|
+
};
|
|
190
|
+
interface TranslationMeta {
|
|
191
|
+
sourceLang: string;
|
|
192
|
+
targetLang: string;
|
|
193
|
+
translatedAt: string;
|
|
194
|
+
}
|
|
195
|
+
type ModelWithTranslation<T> = T & {
|
|
196
|
+
isTranslated: boolean;
|
|
197
|
+
translationMeta?: TranslationMeta;
|
|
198
|
+
availableTranslations?: string[];
|
|
199
|
+
};
|
|
200
|
+
//#endregion
|
|
201
|
+
//#region models/post.d.ts
|
|
202
|
+
type PostModel = TextBaseModel & {
|
|
203
|
+
summary?: string | null;
|
|
204
|
+
copyright: boolean;
|
|
205
|
+
tags: string[];
|
|
206
|
+
count: Count;
|
|
207
|
+
slug: string;
|
|
208
|
+
categoryId: string;
|
|
209
|
+
images: Image[];
|
|
210
|
+
category: CategoryModel;
|
|
211
|
+
pin?: string | null;
|
|
212
|
+
pinOrder?: number;
|
|
213
|
+
related?: Pick<PostModel, 'id' | 'category' | 'categoryId' | 'created' | 'modified' | 'title' | 'slug' | 'summary'>[];
|
|
214
|
+
};
|
|
215
|
+
//#endregion
|
|
216
|
+
//#region models/category.d.ts
|
|
217
|
+
declare enum CategoryType {
|
|
218
|
+
Category = 0,
|
|
219
|
+
Tag = 1
|
|
220
|
+
}
|
|
221
|
+
interface CategoryModel extends BaseModel {
|
|
222
|
+
type: CategoryType;
|
|
223
|
+
count: number;
|
|
224
|
+
slug: string;
|
|
225
|
+
name: string;
|
|
226
|
+
}
|
|
227
|
+
type CategoryWithChildrenModel = CategoryModel & {
|
|
228
|
+
children: Pick<PostModel, 'id' | 'title' | 'slug' | 'modified' | 'created'>[];
|
|
229
|
+
};
|
|
230
|
+
type CategoryEntries = {
|
|
231
|
+
entries: Record<string, CategoryWithChildrenModel>;
|
|
232
|
+
};
|
|
233
|
+
interface TagModel {
|
|
234
|
+
count: number;
|
|
235
|
+
name: string;
|
|
236
|
+
}
|
|
237
|
+
//#endregion
|
|
238
|
+
//#region models/activity.d.ts
|
|
239
|
+
interface ActivityPresence {
|
|
240
|
+
operationTime: number;
|
|
241
|
+
identity: string;
|
|
242
|
+
roomName: string;
|
|
243
|
+
position: number;
|
|
244
|
+
joinedAt: number;
|
|
245
|
+
connectedAt: number;
|
|
246
|
+
updatedAt: number;
|
|
247
|
+
readerId?: string;
|
|
248
|
+
displayName?: string;
|
|
249
|
+
}
|
|
250
|
+
interface RoomOmittedNote {
|
|
251
|
+
title: string;
|
|
252
|
+
nid: number;
|
|
253
|
+
id: string;
|
|
254
|
+
created: string;
|
|
255
|
+
}
|
|
256
|
+
interface RoomOmittedPage {
|
|
257
|
+
title: string;
|
|
258
|
+
slug: string;
|
|
259
|
+
id: string;
|
|
260
|
+
created: string;
|
|
261
|
+
}
|
|
262
|
+
interface RoomOmittedPost {
|
|
263
|
+
slug: string;
|
|
264
|
+
title: string;
|
|
265
|
+
categoryId: string;
|
|
266
|
+
category: CategoryModel;
|
|
267
|
+
id: string;
|
|
268
|
+
created: string;
|
|
269
|
+
}
|
|
270
|
+
interface RoomsData {
|
|
271
|
+
rooms: string[];
|
|
272
|
+
roomCount: {
|
|
273
|
+
[key: string]: number;
|
|
274
|
+
};
|
|
275
|
+
objects: {
|
|
276
|
+
posts: RoomOmittedPost[];
|
|
277
|
+
notes: RoomOmittedNote[];
|
|
278
|
+
pages: RoomOmittedPage[];
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
interface RecentActivities {
|
|
282
|
+
like: RecentLike[];
|
|
283
|
+
comment: RecentComment[];
|
|
284
|
+
recent: RecentRecent[];
|
|
285
|
+
post: RecentPost[];
|
|
286
|
+
note: RecentNote[];
|
|
287
|
+
}
|
|
288
|
+
interface RecentComment {
|
|
289
|
+
created: string;
|
|
290
|
+
author: string;
|
|
291
|
+
text: string;
|
|
292
|
+
id: string;
|
|
293
|
+
title: string;
|
|
294
|
+
slug?: string;
|
|
295
|
+
type: string;
|
|
296
|
+
avatar: string;
|
|
297
|
+
nid?: string;
|
|
298
|
+
}
|
|
299
|
+
interface RecentLike {
|
|
300
|
+
created: string;
|
|
301
|
+
id: string;
|
|
302
|
+
type: CollectionRefTypes.Post | CollectionRefTypes.Note;
|
|
303
|
+
nid?: number;
|
|
304
|
+
slug?: string;
|
|
305
|
+
title: string;
|
|
306
|
+
}
|
|
307
|
+
interface RecentNote {
|
|
308
|
+
id: string;
|
|
309
|
+
created: string;
|
|
310
|
+
title: string;
|
|
311
|
+
modified: string;
|
|
312
|
+
nid: number;
|
|
313
|
+
}
|
|
314
|
+
interface RecentPost {
|
|
315
|
+
id: string;
|
|
316
|
+
created: string;
|
|
317
|
+
title: string;
|
|
318
|
+
modified: string;
|
|
319
|
+
slug: string;
|
|
320
|
+
}
|
|
321
|
+
interface RecentRecent {
|
|
322
|
+
id: string;
|
|
323
|
+
content: string;
|
|
324
|
+
up: number;
|
|
325
|
+
down: number;
|
|
326
|
+
created: string;
|
|
327
|
+
}
|
|
328
|
+
interface LastYearPublication {
|
|
329
|
+
posts: PostsItem[];
|
|
330
|
+
notes: NotesItem[];
|
|
331
|
+
}
|
|
332
|
+
interface PostsItem {
|
|
333
|
+
id: string;
|
|
334
|
+
created: string;
|
|
335
|
+
title: string;
|
|
336
|
+
slug: string;
|
|
337
|
+
categoryId: string;
|
|
338
|
+
category: Category;
|
|
339
|
+
}
|
|
340
|
+
interface Category {
|
|
341
|
+
id: string;
|
|
342
|
+
type: number;
|
|
343
|
+
name: string;
|
|
344
|
+
slug: string;
|
|
345
|
+
created: string;
|
|
346
|
+
}
|
|
347
|
+
interface NotesItem {
|
|
348
|
+
id: string;
|
|
349
|
+
created: string;
|
|
350
|
+
title: string;
|
|
351
|
+
mood: string;
|
|
352
|
+
weather: string;
|
|
353
|
+
nid: number;
|
|
354
|
+
bookmark: boolean;
|
|
355
|
+
}
|
|
356
|
+
//#endregion
|
|
357
|
+
//#region models/topic.d.ts
|
|
358
|
+
interface TopicModel extends BaseModel {
|
|
359
|
+
description?: string;
|
|
360
|
+
introduce: string;
|
|
361
|
+
name: string;
|
|
362
|
+
slug: string;
|
|
363
|
+
icon?: string;
|
|
364
|
+
}
|
|
365
|
+
//#endregion
|
|
366
|
+
//#region models/note.d.ts
|
|
367
|
+
type NoteModel = TextBaseModel & {
|
|
368
|
+
isPublished: boolean;
|
|
369
|
+
count: {
|
|
370
|
+
read: number;
|
|
371
|
+
like: number;
|
|
372
|
+
};
|
|
373
|
+
mood?: string;
|
|
374
|
+
weather?: string;
|
|
375
|
+
bookmark?: boolean;
|
|
376
|
+
publicAt?: Date;
|
|
377
|
+
password?: string | null;
|
|
378
|
+
nid: number;
|
|
379
|
+
slug?: string;
|
|
380
|
+
location?: string;
|
|
381
|
+
coordinates?: Coordinate;
|
|
382
|
+
topic?: TopicModel;
|
|
383
|
+
topicId?: string;
|
|
384
|
+
};
|
|
385
|
+
interface Coordinate {
|
|
386
|
+
latitude: number;
|
|
387
|
+
longitude: number;
|
|
388
|
+
}
|
|
389
|
+
interface NoteWrappedPayload {
|
|
390
|
+
data: NoteModel;
|
|
391
|
+
next?: Partial<NoteModel>;
|
|
392
|
+
prev?: Partial<NoteModel>;
|
|
393
|
+
}
|
|
394
|
+
interface NoteWrappedWithLikedPayload {
|
|
395
|
+
data: ModelWithLiked<NoteModel>;
|
|
396
|
+
next?: Partial<NoteModel>;
|
|
397
|
+
prev?: Partial<NoteModel>;
|
|
398
|
+
}
|
|
399
|
+
interface NoteWrappedWithLikedAndTranslationPayload {
|
|
400
|
+
data: ModelWithLiked<ModelWithTranslation<NoteModel>>;
|
|
401
|
+
next?: Partial<NoteModel>;
|
|
402
|
+
prev?: Partial<NoteModel>;
|
|
403
|
+
}
|
|
404
|
+
//#endregion
|
|
405
|
+
//#region models/page.d.ts
|
|
406
|
+
declare enum EnumPageType {
|
|
407
|
+
'md' = "md",
|
|
408
|
+
'html' = "html",
|
|
409
|
+
'frame' = "frame"
|
|
410
|
+
}
|
|
411
|
+
type PageModel = TextBaseModel & {
|
|
412
|
+
created: string;
|
|
413
|
+
slug: string;
|
|
414
|
+
subtitle?: string;
|
|
415
|
+
order?: number;
|
|
416
|
+
type?: EnumPageType;
|
|
417
|
+
options?: object;
|
|
418
|
+
};
|
|
419
|
+
//#endregion
|
|
420
|
+
//#region models/say.d.ts
|
|
421
|
+
interface SayModel extends BaseModel {
|
|
422
|
+
text: string;
|
|
423
|
+
source?: string;
|
|
424
|
+
author?: string;
|
|
425
|
+
}
|
|
426
|
+
//#endregion
|
|
427
|
+
//#region models/setting.d.ts
|
|
428
|
+
declare class SeoOptionModel {
|
|
429
|
+
title: string;
|
|
430
|
+
description: string;
|
|
431
|
+
icon?: string;
|
|
432
|
+
keywords?: string[];
|
|
433
|
+
}
|
|
434
|
+
declare class UrlOptionModel {
|
|
435
|
+
webUrl: string;
|
|
436
|
+
adminUrl: string;
|
|
437
|
+
serverUrl: string;
|
|
438
|
+
wsUrl: string;
|
|
439
|
+
}
|
|
440
|
+
declare class SmtpOptionsModel {
|
|
441
|
+
port?: number;
|
|
442
|
+
host?: string;
|
|
443
|
+
secure?: boolean;
|
|
444
|
+
}
|
|
445
|
+
declare class SmtpConfigModel {
|
|
446
|
+
user?: string;
|
|
447
|
+
pass?: string;
|
|
448
|
+
options?: SmtpOptionsModel;
|
|
449
|
+
}
|
|
450
|
+
declare class ResendConfigModel {
|
|
451
|
+
apiKey?: string;
|
|
452
|
+
}
|
|
453
|
+
declare class MailOptionsModel {
|
|
454
|
+
enable: boolean;
|
|
455
|
+
provider?: 'smtp' | 'resend';
|
|
456
|
+
from?: string;
|
|
457
|
+
smtp?: SmtpConfigModel;
|
|
458
|
+
resend?: ResendConfigModel;
|
|
459
|
+
}
|
|
460
|
+
declare class CommentOptionsModel {
|
|
461
|
+
antiSpam: boolean;
|
|
462
|
+
disableComment: boolean;
|
|
463
|
+
allowGuestComment: boolean;
|
|
464
|
+
spamKeywords?: string[];
|
|
465
|
+
blockIps?: string[];
|
|
466
|
+
disableNoChinese?: boolean;
|
|
467
|
+
}
|
|
468
|
+
declare class BackupOptionsModel {
|
|
469
|
+
enable: boolean;
|
|
470
|
+
secretId?: string;
|
|
471
|
+
secretKey?: string;
|
|
472
|
+
bucket?: string;
|
|
473
|
+
region: string;
|
|
474
|
+
}
|
|
475
|
+
declare class BaiduSearchOptionsModel {
|
|
476
|
+
enable: boolean;
|
|
477
|
+
token?: string;
|
|
478
|
+
}
|
|
479
|
+
declare class BingSearchOptionsModel {
|
|
480
|
+
enable: boolean;
|
|
481
|
+
token?: string;
|
|
482
|
+
}
|
|
483
|
+
declare class AlgoliaSearchOptionsModel {
|
|
484
|
+
enable: boolean;
|
|
485
|
+
apiKey?: string;
|
|
486
|
+
appId?: string;
|
|
487
|
+
indexName?: string;
|
|
488
|
+
}
|
|
489
|
+
declare class AdminExtraModel {
|
|
490
|
+
background?: string;
|
|
491
|
+
gaodemapKey?: string;
|
|
492
|
+
title?: string;
|
|
493
|
+
/**
|
|
494
|
+
* 是否开启后台反代访问
|
|
495
|
+
*/
|
|
496
|
+
enableAdminProxy?: boolean;
|
|
497
|
+
}
|
|
498
|
+
declare class ThirdPartyServiceIntegrationModel {
|
|
499
|
+
githubToken?: string;
|
|
500
|
+
}
|
|
501
|
+
interface IConfig {
|
|
502
|
+
seo: SeoOptionModel;
|
|
503
|
+
url: UrlOptionModel;
|
|
504
|
+
mailOptions: MailOptionsModel;
|
|
505
|
+
commentOptions: CommentOptionsModel;
|
|
506
|
+
backupOptions: BackupOptionsModel;
|
|
507
|
+
baiduSearchOptions: BaiduSearchOptionsModel;
|
|
508
|
+
algoliaSearchOptions: AlgoliaSearchOptionsModel;
|
|
509
|
+
adminExtra: AdminExtraModel;
|
|
510
|
+
thirdPartyServiceIntegration: ThirdPartyServiceIntegrationModel;
|
|
511
|
+
}
|
|
512
|
+
declare type IConfigKeys = keyof IConfig;
|
|
513
|
+
//#endregion
|
|
514
|
+
//#region models/user.d.ts
|
|
515
|
+
interface UserModel extends BaseModel {
|
|
516
|
+
introduce: string;
|
|
517
|
+
mail: string;
|
|
518
|
+
url: string;
|
|
519
|
+
name: string;
|
|
520
|
+
socialIds: Record<string, string>;
|
|
521
|
+
username: string;
|
|
522
|
+
modified: string;
|
|
523
|
+
v: number;
|
|
524
|
+
lastLoginTime: string;
|
|
525
|
+
lastLoginIp?: string;
|
|
526
|
+
avatar: string;
|
|
527
|
+
postID: string;
|
|
528
|
+
}
|
|
529
|
+
type TLogin = {
|
|
530
|
+
token: string;
|
|
531
|
+
expiresIn: number;
|
|
532
|
+
lastLoginTime: null | string;
|
|
533
|
+
lastLoginIp?: null | string;
|
|
534
|
+
} & Pick<UserModel, 'name' | 'username' | 'created' | 'url' | 'mail' | 'avatar' | 'id'>;
|
|
535
|
+
type BetterAuthUserRole = 'owner' | 'reader';
|
|
536
|
+
interface BetterAuthUser {
|
|
537
|
+
id: string;
|
|
538
|
+
email?: string | null;
|
|
539
|
+
name?: string | null;
|
|
540
|
+
image?: string | null;
|
|
541
|
+
role?: BetterAuthUserRole;
|
|
542
|
+
handle?: string | null;
|
|
543
|
+
username?: string | null;
|
|
544
|
+
displayUsername?: string | null;
|
|
545
|
+
[key: string]: unknown;
|
|
546
|
+
}
|
|
547
|
+
interface BetterAuthSession {
|
|
548
|
+
id?: string;
|
|
549
|
+
token: string;
|
|
550
|
+
userId: string;
|
|
551
|
+
expiresAt: string;
|
|
552
|
+
createdAt: string;
|
|
553
|
+
updatedAt: string;
|
|
554
|
+
ipAddress?: string | null;
|
|
555
|
+
userAgent?: string | null;
|
|
556
|
+
provider?: string | null;
|
|
557
|
+
[key: string]: unknown;
|
|
558
|
+
}
|
|
559
|
+
interface BetterAuthSignInResult {
|
|
560
|
+
token: string;
|
|
561
|
+
user: BetterAuthUser;
|
|
562
|
+
}
|
|
563
|
+
interface BetterAuthSessionResult {
|
|
564
|
+
session: BetterAuthSession;
|
|
565
|
+
user: BetterAuthUser;
|
|
566
|
+
}
|
|
567
|
+
interface OwnerSessionResult extends BetterAuthUser {
|
|
568
|
+
provider?: string;
|
|
569
|
+
providerAccountId?: string;
|
|
570
|
+
session?: BetterAuthSession;
|
|
571
|
+
}
|
|
572
|
+
type CheckLoggedResult = {
|
|
573
|
+
ok: number;
|
|
574
|
+
isGuest: boolean;
|
|
575
|
+
};
|
|
576
|
+
type OwnerAllowLoginResult = {
|
|
577
|
+
password: boolean;
|
|
578
|
+
passkey: boolean;
|
|
579
|
+
} & Record<string, boolean>;
|
|
580
|
+
//#endregion
|
|
581
|
+
//#region models/aggregate.d.ts
|
|
582
|
+
interface AggregateAIConfig {
|
|
583
|
+
enableSummary: boolean;
|
|
584
|
+
}
|
|
585
|
+
interface AggregateRoot {
|
|
586
|
+
user: UserModel;
|
|
587
|
+
seo: SeoOptionModel;
|
|
588
|
+
url: Url;
|
|
589
|
+
commentOptions?: Pick<CommentOptionsModel, 'disableComment' | 'allowGuestComment'>;
|
|
590
|
+
categories: CategoryModel[];
|
|
591
|
+
pageMeta: Pick<PageModel, 'title' | 'id' | 'slug' | 'order'>[] | null;
|
|
592
|
+
/**
|
|
593
|
+
* @available 4.2.2
|
|
594
|
+
*/
|
|
595
|
+
latestNoteId: {
|
|
596
|
+
id: string;
|
|
597
|
+
nid: number;
|
|
598
|
+
};
|
|
599
|
+
/**
|
|
600
|
+
* @available 9.2.0
|
|
601
|
+
*/
|
|
602
|
+
ai?: AggregateAIConfig;
|
|
603
|
+
}
|
|
604
|
+
interface AggregateRootWithTheme<Theme = unknown> extends AggregateRoot {
|
|
605
|
+
theme?: Theme;
|
|
606
|
+
}
|
|
607
|
+
interface Url {
|
|
608
|
+
wsUrl: string;
|
|
609
|
+
serverUrl: string;
|
|
610
|
+
webUrl: string;
|
|
611
|
+
}
|
|
612
|
+
interface AggregateTopNote extends Pick<NoteModel, 'id' | 'title' | 'created' | 'nid' | 'images' | 'mood' | 'weather'> {}
|
|
613
|
+
interface AggregateTopPost extends Pick<PostModel, 'id' | 'slug' | 'created' | 'title' | 'category' | 'images' | 'summary'> {}
|
|
614
|
+
interface AggregateTop {
|
|
615
|
+
notes: AggregateTopNote[];
|
|
616
|
+
posts: AggregateTopPost[];
|
|
617
|
+
says: SayModel[];
|
|
618
|
+
}
|
|
619
|
+
declare enum TimelineType {
|
|
620
|
+
Post = 0,
|
|
621
|
+
Note = 1
|
|
622
|
+
}
|
|
623
|
+
interface TimelineData {
|
|
624
|
+
notes?: Pick<NoteModel, 'id' | 'nid' | 'title' | 'weather' | 'mood' | 'created' | 'modified' | 'bookmark'>[];
|
|
625
|
+
posts?: (Pick<PostModel, 'id' | 'title' | 'slug' | 'created' | 'modified' | 'category'> & {
|
|
626
|
+
url: string;
|
|
627
|
+
})[];
|
|
628
|
+
}
|
|
629
|
+
interface LatestPostItem extends Pick<PostModel, 'id' | 'title' | 'slug' | 'created' | 'modified' | 'tags'> {
|
|
630
|
+
category: Pick<CategoryModel, 'name' | 'slug'> | null;
|
|
631
|
+
}
|
|
632
|
+
interface LatestNoteItem extends Pick<NoteModel, 'id' | 'title' | 'nid' | 'created' | 'modified' | 'mood' | 'weather' | 'bookmark'> {}
|
|
633
|
+
interface LatestData {
|
|
634
|
+
posts?: LatestPostItem[];
|
|
635
|
+
notes?: LatestNoteItem[];
|
|
636
|
+
}
|
|
637
|
+
type LatestCombinedItem = (LatestPostItem & {
|
|
638
|
+
type: 'post';
|
|
639
|
+
}) | (LatestNoteItem & {
|
|
640
|
+
type: 'note';
|
|
641
|
+
});
|
|
642
|
+
interface AggregateStat {
|
|
643
|
+
allComments: number;
|
|
644
|
+
categories: number;
|
|
645
|
+
comments: number;
|
|
646
|
+
linkApply: number;
|
|
647
|
+
links: number;
|
|
648
|
+
notes: number;
|
|
649
|
+
pages: number;
|
|
650
|
+
posts: number;
|
|
651
|
+
says: number;
|
|
652
|
+
recently: number;
|
|
653
|
+
unreadComments: number;
|
|
654
|
+
online: number;
|
|
655
|
+
todayMaxOnline: string;
|
|
656
|
+
todayOnlineTotal: string;
|
|
657
|
+
callTime: number;
|
|
658
|
+
uv: number;
|
|
659
|
+
todayIpAccessCount: number;
|
|
660
|
+
}
|
|
661
|
+
//#endregion
|
|
662
|
+
//#region models/ai.d.ts
|
|
663
|
+
interface AISummaryModel {
|
|
664
|
+
id: string;
|
|
665
|
+
created: string;
|
|
666
|
+
summary: string;
|
|
667
|
+
hash: string;
|
|
668
|
+
refId: string;
|
|
669
|
+
lang: string;
|
|
670
|
+
}
|
|
671
|
+
interface AITranslationModel {
|
|
672
|
+
id: string;
|
|
673
|
+
created: string;
|
|
674
|
+
hash: string;
|
|
675
|
+
refId: string;
|
|
676
|
+
refType: string;
|
|
677
|
+
lang: string;
|
|
678
|
+
sourceLang: string;
|
|
679
|
+
title: string;
|
|
680
|
+
text: string;
|
|
681
|
+
subtitle?: string;
|
|
682
|
+
summary?: string;
|
|
683
|
+
tags?: string[];
|
|
684
|
+
aiModel?: string;
|
|
685
|
+
aiProvider?: string;
|
|
686
|
+
}
|
|
687
|
+
interface AIDeepReadingModel {
|
|
688
|
+
id: string;
|
|
689
|
+
hash: string;
|
|
690
|
+
refId: string;
|
|
691
|
+
keyPoints: string[];
|
|
692
|
+
criticalAnalysis: string;
|
|
693
|
+
content: string;
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
696
|
+
* SSE Stream Event Types
|
|
697
|
+
*
|
|
698
|
+
* Note: All data fields are transmitted as strings over SSE.
|
|
699
|
+
* Objects are JSON.stringify'd before sending.
|
|
700
|
+
*/
|
|
701
|
+
type AISummaryStreamEvent = {
|
|
702
|
+
type: 'token';
|
|
703
|
+
data: string;
|
|
704
|
+
} | {
|
|
705
|
+
type: 'done';
|
|
706
|
+
data: undefined;
|
|
707
|
+
} | {
|
|
708
|
+
type: 'error';
|
|
709
|
+
data: string;
|
|
710
|
+
};
|
|
711
|
+
type AITranslationStreamEvent = {
|
|
712
|
+
type: 'token';
|
|
713
|
+
data: string;
|
|
714
|
+
} | {
|
|
715
|
+
type: 'done';
|
|
716
|
+
data: undefined;
|
|
717
|
+
} | {
|
|
718
|
+
type: 'error';
|
|
719
|
+
data: string;
|
|
720
|
+
};
|
|
721
|
+
//#endregion
|
|
722
|
+
//#region models/auth.d.ts
|
|
723
|
+
interface AuthUser {
|
|
724
|
+
id: string;
|
|
725
|
+
email: string;
|
|
726
|
+
isOwner: boolean;
|
|
727
|
+
image: string;
|
|
728
|
+
name: string;
|
|
729
|
+
provider: string;
|
|
730
|
+
handle: string;
|
|
731
|
+
}
|
|
732
|
+
//#endregion
|
|
733
|
+
//#region models/comment.d.ts
|
|
734
|
+
interface CommentModel extends BaseModel {
|
|
735
|
+
refType: CollectionRefTypes;
|
|
736
|
+
ref: string;
|
|
737
|
+
state: number;
|
|
738
|
+
author: string;
|
|
739
|
+
text: string;
|
|
740
|
+
mail?: string;
|
|
741
|
+
url?: string;
|
|
742
|
+
ip?: string;
|
|
743
|
+
agent?: string;
|
|
744
|
+
pin?: boolean;
|
|
745
|
+
avatar: string;
|
|
746
|
+
parentCommentId?: string | null;
|
|
747
|
+
rootCommentId?: string | null;
|
|
748
|
+
replyCount?: number;
|
|
749
|
+
latestReplyAt?: string | null;
|
|
750
|
+
isDeleted?: boolean;
|
|
751
|
+
deletedAt?: string;
|
|
752
|
+
isWhispers?: boolean;
|
|
753
|
+
location?: string;
|
|
754
|
+
authProvider?: string;
|
|
755
|
+
readerId?: string;
|
|
756
|
+
editedAt?: string;
|
|
757
|
+
}
|
|
758
|
+
interface CommentReplyWindow {
|
|
759
|
+
total: number;
|
|
760
|
+
returned: number;
|
|
761
|
+
threshold: number;
|
|
762
|
+
hasHidden: boolean;
|
|
763
|
+
hiddenCount: number;
|
|
764
|
+
nextCursor?: string;
|
|
765
|
+
}
|
|
766
|
+
interface CommentThreadItem extends CommentModel {
|
|
767
|
+
replies: CommentModel[];
|
|
768
|
+
replyWindow: CommentReplyWindow;
|
|
769
|
+
}
|
|
770
|
+
interface CommentThreadReplies {
|
|
771
|
+
replies: CommentModel[];
|
|
772
|
+
nextCursor?: string;
|
|
773
|
+
remaining: number;
|
|
774
|
+
done: boolean;
|
|
775
|
+
}
|
|
776
|
+
interface CommentRef {
|
|
777
|
+
id: string;
|
|
778
|
+
categoryId?: string;
|
|
779
|
+
slug: string;
|
|
780
|
+
title: string;
|
|
781
|
+
category?: CategoryModel;
|
|
782
|
+
}
|
|
783
|
+
declare enum CommentState {
|
|
784
|
+
Unread = 0,
|
|
785
|
+
Read = 1,
|
|
786
|
+
Junk = 2
|
|
787
|
+
}
|
|
788
|
+
//#endregion
|
|
789
|
+
//#region models/link.d.ts
|
|
790
|
+
declare enum LinkType {
|
|
791
|
+
Friend = 0,
|
|
792
|
+
Collection = 1
|
|
793
|
+
}
|
|
794
|
+
declare enum LinkState {
|
|
795
|
+
Pass = 0,
|
|
796
|
+
Audit = 1,
|
|
797
|
+
Outdate = 2,
|
|
798
|
+
Banned = 3,
|
|
799
|
+
Reject = 4
|
|
800
|
+
}
|
|
801
|
+
interface LinkModel extends BaseModel {
|
|
802
|
+
name: string;
|
|
803
|
+
url: string;
|
|
804
|
+
avatar: string;
|
|
805
|
+
description?: string;
|
|
806
|
+
type: LinkType;
|
|
807
|
+
state: LinkState;
|
|
808
|
+
hide: boolean;
|
|
809
|
+
email: string;
|
|
810
|
+
}
|
|
811
|
+
//#endregion
|
|
812
|
+
//#region models/project.d.ts
|
|
813
|
+
interface ProjectModel extends BaseModel {
|
|
814
|
+
name: string;
|
|
815
|
+
previewUrl?: string;
|
|
816
|
+
docUrl?: string;
|
|
817
|
+
projectUrl?: string;
|
|
818
|
+
images?: string[];
|
|
819
|
+
description: string;
|
|
820
|
+
avatar?: string;
|
|
821
|
+
text: string;
|
|
822
|
+
}
|
|
823
|
+
//#endregion
|
|
824
|
+
//#region models/reader.d.ts
|
|
825
|
+
interface ReaderModel {
|
|
826
|
+
email: string;
|
|
827
|
+
name: string;
|
|
828
|
+
handle: string;
|
|
829
|
+
image: string;
|
|
830
|
+
role?: 'reader' | 'owner';
|
|
831
|
+
}
|
|
832
|
+
//#endregion
|
|
833
|
+
//#region models/recently.d.ts
|
|
834
|
+
declare enum RecentlyRefTypes {
|
|
835
|
+
Post = "Post",
|
|
836
|
+
Note = "Note",
|
|
837
|
+
Page = "Page"
|
|
838
|
+
}
|
|
839
|
+
type RecentlyRefType = {
|
|
840
|
+
title: string;
|
|
841
|
+
url: string;
|
|
842
|
+
};
|
|
843
|
+
declare enum RecentlyTypeEnum {
|
|
844
|
+
Text = "text",
|
|
845
|
+
Book = "book",
|
|
846
|
+
Media = "media",
|
|
847
|
+
Music = "music",
|
|
848
|
+
Github = "github",
|
|
849
|
+
Link = "link",
|
|
850
|
+
Academic = "academic",
|
|
851
|
+
Code = "code"
|
|
852
|
+
}
|
|
853
|
+
interface BookMetadata {
|
|
854
|
+
url: string;
|
|
855
|
+
title: string;
|
|
856
|
+
author: string;
|
|
857
|
+
cover?: string;
|
|
858
|
+
rating?: number;
|
|
859
|
+
isbn?: string;
|
|
860
|
+
}
|
|
861
|
+
interface MediaMetadata {
|
|
862
|
+
url: string;
|
|
863
|
+
title: string;
|
|
864
|
+
originalTitle?: string;
|
|
865
|
+
cover?: string;
|
|
866
|
+
rating?: number;
|
|
867
|
+
description?: string;
|
|
868
|
+
genre?: string;
|
|
869
|
+
}
|
|
870
|
+
interface MusicMetadata {
|
|
871
|
+
url: string;
|
|
872
|
+
title: string;
|
|
873
|
+
artist: string;
|
|
874
|
+
album?: string;
|
|
875
|
+
cover?: string;
|
|
876
|
+
source?: string;
|
|
877
|
+
}
|
|
878
|
+
interface GithubMetadata {
|
|
879
|
+
url: string;
|
|
880
|
+
owner: string;
|
|
881
|
+
repo: string;
|
|
882
|
+
description?: string;
|
|
883
|
+
stars?: number;
|
|
884
|
+
language?: string;
|
|
885
|
+
languageColor?: string;
|
|
886
|
+
}
|
|
887
|
+
interface LinkMetadata {
|
|
888
|
+
url: string;
|
|
889
|
+
title?: string;
|
|
890
|
+
description?: string;
|
|
891
|
+
image?: string;
|
|
892
|
+
}
|
|
893
|
+
interface AcademicMetadata {
|
|
894
|
+
url: string;
|
|
895
|
+
title: string;
|
|
896
|
+
authors?: string[];
|
|
897
|
+
arxivId?: string;
|
|
898
|
+
}
|
|
899
|
+
interface CodeMetadata {
|
|
900
|
+
url: string;
|
|
901
|
+
title: string;
|
|
902
|
+
difficulty?: string;
|
|
903
|
+
tags?: string[];
|
|
904
|
+
platform?: string;
|
|
905
|
+
}
|
|
906
|
+
type RecentlyMetadata = BookMetadata | MediaMetadata | MusicMetadata | GithubMetadata | LinkMetadata | AcademicMetadata | CodeMetadata;
|
|
907
|
+
interface RecentlyModel extends BaseCommentIndexModel {
|
|
908
|
+
content: string;
|
|
909
|
+
type: RecentlyTypeEnum;
|
|
910
|
+
metadata?: RecentlyMetadata;
|
|
911
|
+
ref?: RecentlyRefType & {
|
|
912
|
+
[key: string]: any;
|
|
913
|
+
};
|
|
914
|
+
refId?: string;
|
|
915
|
+
refType?: RecentlyRefTypes;
|
|
916
|
+
up: number;
|
|
917
|
+
down: number;
|
|
918
|
+
modified?: string;
|
|
919
|
+
}
|
|
920
|
+
//#endregion
|
|
921
|
+
//#region models/snippet.d.ts
|
|
922
|
+
declare enum SnippetType {
|
|
923
|
+
JSON = "json",
|
|
924
|
+
Function = "function",
|
|
925
|
+
Text = "text",
|
|
926
|
+
YAML = "yaml"
|
|
927
|
+
}
|
|
928
|
+
interface SnippetModel<T = unknown> extends BaseModel {
|
|
929
|
+
type: SnippetType;
|
|
930
|
+
private: boolean;
|
|
931
|
+
raw: string;
|
|
932
|
+
name: string;
|
|
933
|
+
reference: string;
|
|
934
|
+
comment?: string;
|
|
935
|
+
metatype?: string;
|
|
936
|
+
schema?: string;
|
|
937
|
+
data: T;
|
|
938
|
+
}
|
|
939
|
+
//#endregion
|
|
940
|
+
//#region ../../apps/core/src/modules/subscribe/subscribe.constant.d.ts
|
|
941
|
+
declare const SubscribePostCreateBit = 1;
|
|
942
|
+
declare const SubscribeNoteCreateBit: number;
|
|
943
|
+
declare const SubscribeSayCreateBit: number;
|
|
944
|
+
declare const SubscribeRecentCreateBit: number;
|
|
945
|
+
declare const SubscribeAllBit: number;
|
|
946
|
+
declare const SubscribeTypeToBitMap: {
|
|
947
|
+
post_c: number;
|
|
948
|
+
note_c: number;
|
|
949
|
+
say_c: number;
|
|
950
|
+
recently_c: number;
|
|
951
|
+
all: number;
|
|
952
|
+
};
|
|
953
|
+
//#endregion
|
|
954
|
+
//#region models/subscribe.d.ts
|
|
955
|
+
type SubscribeType = keyof typeof SubscribeTypeToBitMap;
|
|
956
|
+
//#endregion
|
|
957
|
+
//#region controllers/activity.d.ts
|
|
958
|
+
declare module '@mix-space-lts/api-client' {
|
|
959
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
960
|
+
activity: ActivityController<ResponseWrapper>;
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
/**
|
|
964
|
+
* @support core >= 4.3.0
|
|
965
|
+
*/
|
|
966
|
+
declare class ActivityController<ResponseWrapper> implements IController {
|
|
967
|
+
private client;
|
|
968
|
+
base: string;
|
|
969
|
+
name: string;
|
|
970
|
+
constructor(client: HTTPClient);
|
|
971
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
972
|
+
likeIt(type: 'Post' | 'Note', id: string): RequestProxyResult<never, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
973
|
+
[key: string]: any;
|
|
974
|
+
data: never;
|
|
975
|
+
} : ResponseWrapper extends {
|
|
976
|
+
data: never;
|
|
977
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
978
|
+
data: never;
|
|
979
|
+
}>;
|
|
980
|
+
/**
|
|
981
|
+
*
|
|
982
|
+
* @support core >= 5.0.0
|
|
983
|
+
*/
|
|
984
|
+
getPresence(roomName: string): RequestProxyResult<{
|
|
985
|
+
data: Record<string, ActivityPresence>;
|
|
986
|
+
readers: Record<string, AuthUser>;
|
|
987
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
988
|
+
[key: string]: any;
|
|
989
|
+
data: {
|
|
990
|
+
data: Record<string, ActivityPresence>;
|
|
991
|
+
readers: Record<string, AuthUser>;
|
|
992
|
+
};
|
|
993
|
+
} : ResponseWrapper extends {
|
|
994
|
+
data: {
|
|
995
|
+
data: Record<string, ActivityPresence>;
|
|
996
|
+
readers: Record<string, AuthUser>;
|
|
997
|
+
};
|
|
998
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
999
|
+
data: {
|
|
1000
|
+
data: Record<string, ActivityPresence>;
|
|
1001
|
+
readers: Record<string, AuthUser>;
|
|
1002
|
+
};
|
|
1003
|
+
}>;
|
|
1004
|
+
/**
|
|
1005
|
+
*
|
|
1006
|
+
* @support core >= 5.0.0
|
|
1007
|
+
*/
|
|
1008
|
+
updatePresence({
|
|
1009
|
+
identity,
|
|
1010
|
+
position,
|
|
1011
|
+
roomName,
|
|
1012
|
+
sid,
|
|
1013
|
+
ts,
|
|
1014
|
+
displayName,
|
|
1015
|
+
readerId
|
|
1016
|
+
}: {
|
|
1017
|
+
roomName: string;
|
|
1018
|
+
position: number;
|
|
1019
|
+
identity: string;
|
|
1020
|
+
sid: string;
|
|
1021
|
+
displayName?: string;
|
|
1022
|
+
ts?: number;
|
|
1023
|
+
readerId?: string;
|
|
1024
|
+
}): RequestProxyResult<unknown, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1025
|
+
[key: string]: any;
|
|
1026
|
+
data: unknown;
|
|
1027
|
+
} : ResponseWrapper extends {
|
|
1028
|
+
data: unknown;
|
|
1029
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1030
|
+
data: unknown;
|
|
1031
|
+
}>;
|
|
1032
|
+
getRoomsInfo(): Promise<RoomsData & {
|
|
1033
|
+
$raw: ResponseWrapper extends {
|
|
1034
|
+
data: infer T;
|
|
1035
|
+
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
1036
|
+
[i: string]: any;
|
|
1037
|
+
data: (ResponseWrapper extends unknown ? {
|
|
1038
|
+
[key: string]: any;
|
|
1039
|
+
data: RoomsData;
|
|
1040
|
+
} : ResponseWrapper extends {
|
|
1041
|
+
data: RoomsData;
|
|
1042
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1043
|
+
data: RoomsData;
|
|
1044
|
+
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
1045
|
+
[key: string]: any;
|
|
1046
|
+
data: RoomsData;
|
|
1047
|
+
} : ResponseWrapper extends {
|
|
1048
|
+
data: RoomsData;
|
|
1049
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1050
|
+
data: RoomsData;
|
|
1051
|
+
}) ? T_1 extends unknown ? {
|
|
1052
|
+
rooms: string[];
|
|
1053
|
+
room_count: {
|
|
1054
|
+
[key: string]: number;
|
|
1055
|
+
};
|
|
1056
|
+
objects: {
|
|
1057
|
+
posts: RoomOmittedPost[];
|
|
1058
|
+
notes: RoomOmittedNote[];
|
|
1059
|
+
pages: RoomOmittedPage[];
|
|
1060
|
+
};
|
|
1061
|
+
} : T_1 : never : never;
|
|
1062
|
+
} : ResponseWrapper;
|
|
1063
|
+
$request: {
|
|
1064
|
+
path: string;
|
|
1065
|
+
method: string;
|
|
1066
|
+
[k: string]: string;
|
|
1067
|
+
};
|
|
1068
|
+
$serialized: RoomsData;
|
|
1069
|
+
}>;
|
|
1070
|
+
getRecentActivities(): Promise<RecentActivities & {
|
|
1071
|
+
$raw: ResponseWrapper extends {
|
|
1072
|
+
data: infer T;
|
|
1073
|
+
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
1074
|
+
[i: string]: any;
|
|
1075
|
+
data: (ResponseWrapper extends unknown ? {
|
|
1076
|
+
[key: string]: any;
|
|
1077
|
+
data: RecentActivities;
|
|
1078
|
+
} : ResponseWrapper extends {
|
|
1079
|
+
data: RecentActivities;
|
|
1080
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1081
|
+
data: RecentActivities;
|
|
1082
|
+
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
1083
|
+
[key: string]: any;
|
|
1084
|
+
data: RecentActivities;
|
|
1085
|
+
} : ResponseWrapper extends {
|
|
1086
|
+
data: RecentActivities;
|
|
1087
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1088
|
+
data: RecentActivities;
|
|
1089
|
+
}) ? T_1 extends unknown ? {
|
|
1090
|
+
like: RecentLike[];
|
|
1091
|
+
comment: RecentComment[];
|
|
1092
|
+
recent: RecentRecent[];
|
|
1093
|
+
post: RecentPost[];
|
|
1094
|
+
note: RecentNote[];
|
|
1095
|
+
} : T_1 : never : never;
|
|
1096
|
+
} : ResponseWrapper;
|
|
1097
|
+
$request: {
|
|
1098
|
+
path: string;
|
|
1099
|
+
method: string;
|
|
1100
|
+
[k: string]: string;
|
|
1101
|
+
};
|
|
1102
|
+
$serialized: RecentActivities;
|
|
1103
|
+
}>;
|
|
1104
|
+
getLastYearPublication(): Promise<LastYearPublication>;
|
|
1105
|
+
}
|
|
1106
|
+
//#endregion
|
|
1107
|
+
//#region interfaces/options.d.ts
|
|
1108
|
+
type SortOrder = 'asc' | 'desc';
|
|
1109
|
+
//#endregion
|
|
1110
|
+
//#region controllers/aggregate.d.ts
|
|
1111
|
+
declare module '@mix-space-lts/api-client' {
|
|
1112
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1113
|
+
aggregate: AggregateController<ResponseWrapper>;
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
declare class AggregateController<ResponseWrapper> implements IController {
|
|
1117
|
+
private client;
|
|
1118
|
+
base: string;
|
|
1119
|
+
name: string;
|
|
1120
|
+
constructor(client: HTTPClient);
|
|
1121
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
1122
|
+
/**
|
|
1123
|
+
* 获取聚合数据
|
|
1124
|
+
*/
|
|
1125
|
+
getAggregateData<Theme>(theme?: string): RequestProxyResult<AggregateRootWithTheme<Theme>, ResponseWrapper>;
|
|
1126
|
+
/**
|
|
1127
|
+
* 获取最新发布的内容
|
|
1128
|
+
*/
|
|
1129
|
+
getTop(size?: number): RequestProxyResult<AggregateTop, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1130
|
+
[key: string]: any;
|
|
1131
|
+
data: AggregateTop;
|
|
1132
|
+
} : ResponseWrapper extends {
|
|
1133
|
+
data: AggregateTop;
|
|
1134
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1135
|
+
data: AggregateTop;
|
|
1136
|
+
}>;
|
|
1137
|
+
getTimeline(options?: {
|
|
1138
|
+
sort?: SortOrder;
|
|
1139
|
+
type?: TimelineType;
|
|
1140
|
+
year?: number;
|
|
1141
|
+
}): RequestProxyResult<{
|
|
1142
|
+
data: TimelineData;
|
|
1143
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1144
|
+
[key: string]: any;
|
|
1145
|
+
data: {
|
|
1146
|
+
data: TimelineData;
|
|
1147
|
+
};
|
|
1148
|
+
} : ResponseWrapper extends {
|
|
1149
|
+
data: {
|
|
1150
|
+
data: TimelineData;
|
|
1151
|
+
};
|
|
1152
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1153
|
+
data: {
|
|
1154
|
+
data: TimelineData;
|
|
1155
|
+
};
|
|
1156
|
+
}>;
|
|
1157
|
+
getLatest(options: {
|
|
1158
|
+
limit?: number;
|
|
1159
|
+
types?: TimelineType[];
|
|
1160
|
+
combined: true;
|
|
1161
|
+
}): RequestProxyResult<LatestCombinedItem[], ResponseWrapper>;
|
|
1162
|
+
getLatest(options?: {
|
|
1163
|
+
limit?: number;
|
|
1164
|
+
types?: TimelineType[];
|
|
1165
|
+
combined?: false;
|
|
1166
|
+
}): RequestProxyResult<LatestData, ResponseWrapper>;
|
|
1167
|
+
/**
|
|
1168
|
+
* 获取聚合数据统计
|
|
1169
|
+
*/
|
|
1170
|
+
getStat(): RequestProxyResult<AggregateStat, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1171
|
+
[key: string]: any;
|
|
1172
|
+
data: AggregateStat;
|
|
1173
|
+
} : ResponseWrapper extends {
|
|
1174
|
+
data: AggregateStat;
|
|
1175
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1176
|
+
data: AggregateStat;
|
|
1177
|
+
}>;
|
|
1178
|
+
}
|
|
1179
|
+
//#endregion
|
|
1180
|
+
//#region controllers/ai.d.ts
|
|
1181
|
+
declare module '@mix-space-lts/api-client' {
|
|
1182
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1183
|
+
ai: AIController<ResponseWrapper>;
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
/**
|
|
1187
|
+
* @support core >= 5.6.0
|
|
1188
|
+
*/
|
|
1189
|
+
declare class AIController<ResponseWrapper> implements IController {
|
|
1190
|
+
private client;
|
|
1191
|
+
base: string;
|
|
1192
|
+
name: string;
|
|
1193
|
+
constructor(client: HTTPClient);
|
|
1194
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
1195
|
+
getSummary({
|
|
1196
|
+
articleId,
|
|
1197
|
+
lang,
|
|
1198
|
+
onlyDb
|
|
1199
|
+
}: {
|
|
1200
|
+
articleId: string;
|
|
1201
|
+
lang?: string;
|
|
1202
|
+
onlyDb?: boolean;
|
|
1203
|
+
}): Promise<AISummaryModel & {
|
|
1204
|
+
$raw: ResponseWrapper extends {
|
|
1205
|
+
data: infer T;
|
|
1206
|
+
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
1207
|
+
[i: string]: any;
|
|
1208
|
+
data: (ResponseWrapper extends unknown ? {
|
|
1209
|
+
[key: string]: any;
|
|
1210
|
+
data: AISummaryModel;
|
|
1211
|
+
} : ResponseWrapper extends {
|
|
1212
|
+
data: AISummaryModel;
|
|
1213
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1214
|
+
data: AISummaryModel;
|
|
1215
|
+
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
1216
|
+
[key: string]: any;
|
|
1217
|
+
data: AISummaryModel;
|
|
1218
|
+
} : ResponseWrapper extends {
|
|
1219
|
+
data: AISummaryModel;
|
|
1220
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1221
|
+
data: AISummaryModel;
|
|
1222
|
+
}) ? T_1 extends unknown ? {
|
|
1223
|
+
id: string;
|
|
1224
|
+
created: string;
|
|
1225
|
+
summary: string;
|
|
1226
|
+
hash: string;
|
|
1227
|
+
ref_id: string;
|
|
1228
|
+
lang: string;
|
|
1229
|
+
} : T_1 : never : never;
|
|
1230
|
+
} : ResponseWrapper;
|
|
1231
|
+
$request: {
|
|
1232
|
+
path: string;
|
|
1233
|
+
method: string;
|
|
1234
|
+
[k: string]: string;
|
|
1235
|
+
};
|
|
1236
|
+
$serialized: AISummaryModel;
|
|
1237
|
+
}>;
|
|
1238
|
+
generateSummary(articleId: string, lang?: string, token?: string): Promise<AISummaryModel & {
|
|
1239
|
+
$raw: ResponseWrapper extends {
|
|
1240
|
+
data: infer T;
|
|
1241
|
+
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
1242
|
+
[i: string]: any;
|
|
1243
|
+
data: (ResponseWrapper extends unknown ? {
|
|
1244
|
+
[key: string]: any;
|
|
1245
|
+
data: AISummaryModel;
|
|
1246
|
+
} : ResponseWrapper extends {
|
|
1247
|
+
data: AISummaryModel;
|
|
1248
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1249
|
+
data: AISummaryModel;
|
|
1250
|
+
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
1251
|
+
[key: string]: any;
|
|
1252
|
+
data: AISummaryModel;
|
|
1253
|
+
} : ResponseWrapper extends {
|
|
1254
|
+
data: AISummaryModel;
|
|
1255
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1256
|
+
data: AISummaryModel;
|
|
1257
|
+
}) ? T_1 extends unknown ? {
|
|
1258
|
+
id: string;
|
|
1259
|
+
created: string;
|
|
1260
|
+
summary: string;
|
|
1261
|
+
hash: string;
|
|
1262
|
+
ref_id: string;
|
|
1263
|
+
lang: string;
|
|
1264
|
+
} : T_1 : never : never;
|
|
1265
|
+
} : ResponseWrapper;
|
|
1266
|
+
$request: {
|
|
1267
|
+
path: string;
|
|
1268
|
+
method: string;
|
|
1269
|
+
[k: string]: string;
|
|
1270
|
+
};
|
|
1271
|
+
$serialized: AISummaryModel;
|
|
1272
|
+
}>;
|
|
1273
|
+
/**
|
|
1274
|
+
* Core >= 8.3.0
|
|
1275
|
+
* @param articleId
|
|
1276
|
+
*/
|
|
1277
|
+
getDeepReading(articleId: string): Promise<AIDeepReadingModel & {
|
|
1278
|
+
$raw: ResponseWrapper extends {
|
|
1279
|
+
data: infer T;
|
|
1280
|
+
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
1281
|
+
[i: string]: any;
|
|
1282
|
+
data: (ResponseWrapper extends unknown ? {
|
|
1283
|
+
[key: string]: any;
|
|
1284
|
+
data: AIDeepReadingModel;
|
|
1285
|
+
} : ResponseWrapper extends {
|
|
1286
|
+
data: AIDeepReadingModel;
|
|
1287
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1288
|
+
data: AIDeepReadingModel;
|
|
1289
|
+
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
1290
|
+
[key: string]: any;
|
|
1291
|
+
data: AIDeepReadingModel;
|
|
1292
|
+
} : ResponseWrapper extends {
|
|
1293
|
+
data: AIDeepReadingModel;
|
|
1294
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1295
|
+
data: AIDeepReadingModel;
|
|
1296
|
+
}) ? T_1 extends unknown ? {
|
|
1297
|
+
id: string;
|
|
1298
|
+
hash: string;
|
|
1299
|
+
ref_id: string;
|
|
1300
|
+
key_points: string[];
|
|
1301
|
+
critical_analysis: string;
|
|
1302
|
+
content: string;
|
|
1303
|
+
} : T_1 : never : never;
|
|
1304
|
+
} : ResponseWrapper;
|
|
1305
|
+
$request: {
|
|
1306
|
+
path: string;
|
|
1307
|
+
method: string;
|
|
1308
|
+
[k: string]: string;
|
|
1309
|
+
};
|
|
1310
|
+
$serialized: AIDeepReadingModel;
|
|
1311
|
+
}>;
|
|
1312
|
+
/**
|
|
1313
|
+
* Get translation for an article
|
|
1314
|
+
* @support core >= 9.4.0
|
|
1315
|
+
*/
|
|
1316
|
+
getTranslation({
|
|
1317
|
+
articleId,
|
|
1318
|
+
lang
|
|
1319
|
+
}: {
|
|
1320
|
+
articleId: string;
|
|
1321
|
+
lang: string;
|
|
1322
|
+
}): Promise<AITranslationModel & {
|
|
1323
|
+
$raw: ResponseWrapper extends {
|
|
1324
|
+
data: infer T;
|
|
1325
|
+
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
1326
|
+
[i: string]: any;
|
|
1327
|
+
data: (ResponseWrapper extends unknown ? {
|
|
1328
|
+
[key: string]: any;
|
|
1329
|
+
data: AITranslationModel;
|
|
1330
|
+
} : ResponseWrapper extends {
|
|
1331
|
+
data: AITranslationModel;
|
|
1332
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1333
|
+
data: AITranslationModel;
|
|
1334
|
+
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
1335
|
+
[key: string]: any;
|
|
1336
|
+
data: AITranslationModel;
|
|
1337
|
+
} : ResponseWrapper extends {
|
|
1338
|
+
data: AITranslationModel;
|
|
1339
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1340
|
+
data: AITranslationModel;
|
|
1341
|
+
}) ? T_1 extends unknown ? {
|
|
1342
|
+
id: string;
|
|
1343
|
+
created: string;
|
|
1344
|
+
hash: string;
|
|
1345
|
+
ref_id: string;
|
|
1346
|
+
ref_type: string;
|
|
1347
|
+
lang: string;
|
|
1348
|
+
source_lang: string;
|
|
1349
|
+
title: string;
|
|
1350
|
+
text: string;
|
|
1351
|
+
subtitle?: string | undefined;
|
|
1352
|
+
summary?: string | undefined;
|
|
1353
|
+
tags?: string[] | undefined;
|
|
1354
|
+
ai_model?: string | undefined;
|
|
1355
|
+
ai_provider?: string | undefined;
|
|
1356
|
+
} : T_1 : never : never;
|
|
1357
|
+
} : ResponseWrapper;
|
|
1358
|
+
$request: {
|
|
1359
|
+
path: string;
|
|
1360
|
+
method: string;
|
|
1361
|
+
[k: string]: string;
|
|
1362
|
+
};
|
|
1363
|
+
$serialized: AITranslationModel;
|
|
1364
|
+
}>;
|
|
1365
|
+
/**
|
|
1366
|
+
* Get available translation languages for an article
|
|
1367
|
+
* @support core >= 9.4.0
|
|
1368
|
+
*/
|
|
1369
|
+
getAvailableLanguages(articleId: string): Promise<string[] & {
|
|
1370
|
+
$raw: ResponseWrapper extends {
|
|
1371
|
+
data: infer T;
|
|
1372
|
+
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
1373
|
+
[i: string]: any;
|
|
1374
|
+
data: (ResponseWrapper extends unknown ? {
|
|
1375
|
+
[key: string]: any;
|
|
1376
|
+
data: string[];
|
|
1377
|
+
} : ResponseWrapper extends {
|
|
1378
|
+
data: string[];
|
|
1379
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1380
|
+
data: string[];
|
|
1381
|
+
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
1382
|
+
[key: string]: any;
|
|
1383
|
+
data: string[];
|
|
1384
|
+
} : ResponseWrapper extends {
|
|
1385
|
+
data: string[];
|
|
1386
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1387
|
+
data: string[];
|
|
1388
|
+
}) ? T_1 extends unknown ? {
|
|
1389
|
+
length: number;
|
|
1390
|
+
to_string: () => string;
|
|
1391
|
+
to_locale_string: {
|
|
1392
|
+
(): string;
|
|
1393
|
+
(locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string;
|
|
1394
|
+
};
|
|
1395
|
+
pop: () => string | undefined;
|
|
1396
|
+
push: (...items: string[]) => number;
|
|
1397
|
+
concat: {
|
|
1398
|
+
(...items: ConcatArray<string>[]): string[];
|
|
1399
|
+
(...items: (string | ConcatArray<string>)[]): string[];
|
|
1400
|
+
};
|
|
1401
|
+
join: (separator?: string) => string;
|
|
1402
|
+
reverse: () => string[];
|
|
1403
|
+
shift: () => string | undefined;
|
|
1404
|
+
slice: (start?: number, end?: number) => string[];
|
|
1405
|
+
sort: (compareFn?: ((a: string, b: string) => number) | undefined) => string[];
|
|
1406
|
+
splice: {
|
|
1407
|
+
(start: number, deleteCount?: number): string[];
|
|
1408
|
+
(start: number, deleteCount: number, ...items: string[]): string[];
|
|
1409
|
+
};
|
|
1410
|
+
unshift: (...items: string[]) => number;
|
|
1411
|
+
index_of: (searchElement: string, fromIndex?: number) => number;
|
|
1412
|
+
last_index_of: (searchElement: string, fromIndex?: number) => number;
|
|
1413
|
+
every: {
|
|
1414
|
+
<S extends string>(predicate: (value: string, index: number, array: string[]) => value is S, thisArg?: any): this is S[];
|
|
1415
|
+
(predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): boolean;
|
|
1416
|
+
};
|
|
1417
|
+
some: (predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any) => boolean;
|
|
1418
|
+
for_each: (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void;
|
|
1419
|
+
map: <U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[];
|
|
1420
|
+
filter: {
|
|
1421
|
+
<S extends string>(predicate: (value: string, index: number, array: string[]) => value is S, thisArg?: any): S[];
|
|
1422
|
+
(predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): string[];
|
|
1423
|
+
};
|
|
1424
|
+
reduce: {
|
|
1425
|
+
(callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string;
|
|
1426
|
+
(callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string;
|
|
1427
|
+
<U>(callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U;
|
|
1428
|
+
};
|
|
1429
|
+
reduce_right: {
|
|
1430
|
+
(callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string;
|
|
1431
|
+
(callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string;
|
|
1432
|
+
<U>(callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U;
|
|
1433
|
+
};
|
|
1434
|
+
find: {
|
|
1435
|
+
<S extends string>(predicate: (value: string, index: number, obj: string[]) => value is S, thisArg?: any): S | undefined;
|
|
1436
|
+
(predicate: (value: string, index: number, obj: string[]) => unknown, thisArg?: any): string | undefined;
|
|
1437
|
+
};
|
|
1438
|
+
find_index: (predicate: (value: string, index: number, obj: string[]) => unknown, thisArg?: any) => number;
|
|
1439
|
+
fill: (value: string, start?: number, end?: number) => string[];
|
|
1440
|
+
copy_within: (target: number, start: number, end?: number) => string[];
|
|
1441
|
+
entries: () => ArrayIterator<[number, string]>;
|
|
1442
|
+
keys: () => ArrayIterator<number>;
|
|
1443
|
+
values: () => ArrayIterator<string>;
|
|
1444
|
+
includes: (searchElement: string, fromIndex?: number) => boolean;
|
|
1445
|
+
flat_map: <U, This = undefined>(callback: (this: This, value: string, index: number, array: string[]) => U | readonly U[], thisArg?: This | undefined) => U[];
|
|
1446
|
+
flat: <A, D extends number = 1>(this: A, depth?: D | undefined) => FlatArray<A, D>[];
|
|
1447
|
+
at: (index: number) => string | undefined;
|
|
1448
|
+
find_last: {
|
|
1449
|
+
<S extends string>(predicate: (value: string, index: number, array: string[]) => value is S, thisArg?: any): S | undefined;
|
|
1450
|
+
(predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): string | undefined;
|
|
1451
|
+
};
|
|
1452
|
+
find_last_index: (predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any) => number;
|
|
1453
|
+
to_reversed: () => string[];
|
|
1454
|
+
to_sorted: (compareFn?: ((a: string, b: string) => number) | undefined) => string[];
|
|
1455
|
+
to_spliced: {
|
|
1456
|
+
(start: number, deleteCount: number, ...items: string[]): string[];
|
|
1457
|
+
(start: number, deleteCount?: number): string[];
|
|
1458
|
+
};
|
|
1459
|
+
with: (index: number, value: string) => string[];
|
|
1460
|
+
} : T_1 : never : never;
|
|
1461
|
+
} : ResponseWrapper;
|
|
1462
|
+
$request: {
|
|
1463
|
+
path: string;
|
|
1464
|
+
method: string;
|
|
1465
|
+
[k: string]: string;
|
|
1466
|
+
};
|
|
1467
|
+
$serialized: string[];
|
|
1468
|
+
}>;
|
|
1469
|
+
/**
|
|
1470
|
+
* Get URL for streaming summary generation (SSE)
|
|
1471
|
+
*
|
|
1472
|
+
* @see AISummaryStreamEvent for event types
|
|
1473
|
+
* @support core >= 9.4.0
|
|
1474
|
+
*/
|
|
1475
|
+
getSummaryGenerateUrl({
|
|
1476
|
+
articleId,
|
|
1477
|
+
lang
|
|
1478
|
+
}: {
|
|
1479
|
+
articleId: string;
|
|
1480
|
+
lang?: string;
|
|
1481
|
+
}): string;
|
|
1482
|
+
/**
|
|
1483
|
+
* Stream summary generation using fetch
|
|
1484
|
+
*
|
|
1485
|
+
* @see AISummaryStreamEvent for event types
|
|
1486
|
+
* @support core >= 9.4.0
|
|
1487
|
+
*/
|
|
1488
|
+
streamSummaryGenerate({
|
|
1489
|
+
articleId,
|
|
1490
|
+
lang
|
|
1491
|
+
}: {
|
|
1492
|
+
articleId: string;
|
|
1493
|
+
lang?: string;
|
|
1494
|
+
}, fetchOptions?: RequestInit): Promise<Response>;
|
|
1495
|
+
/**
|
|
1496
|
+
* Get URL for streaming translation generation (SSE)
|
|
1497
|
+
*
|
|
1498
|
+
* @see AITranslationStreamEvent for event types
|
|
1499
|
+
* @support core >= 9.4.0
|
|
1500
|
+
*/
|
|
1501
|
+
getTranslationGenerateUrl({
|
|
1502
|
+
articleId,
|
|
1503
|
+
lang
|
|
1504
|
+
}: {
|
|
1505
|
+
articleId: string;
|
|
1506
|
+
lang: string;
|
|
1507
|
+
}): string;
|
|
1508
|
+
/**
|
|
1509
|
+
* Stream translation generation using fetch
|
|
1510
|
+
*
|
|
1511
|
+
* @see AITranslationStreamEvent for event types
|
|
1512
|
+
* @support core >= 9.4.0
|
|
1513
|
+
*/
|
|
1514
|
+
streamTranslationGenerate({
|
|
1515
|
+
articleId,
|
|
1516
|
+
lang
|
|
1517
|
+
}: {
|
|
1518
|
+
articleId: string;
|
|
1519
|
+
lang: string;
|
|
1520
|
+
}, fetchOptions?: RequestInit): Promise<Response>;
|
|
1521
|
+
}
|
|
1522
|
+
//#endregion
|
|
1523
|
+
//#region controllers/category.d.ts
|
|
1524
|
+
declare module '@mix-space-lts/api-client' {
|
|
1525
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1526
|
+
category: CategoryController<ResponseWrapper>;
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
declare class CategoryController<ResponseWrapper> implements IController {
|
|
1530
|
+
private client;
|
|
1531
|
+
name: string;
|
|
1532
|
+
base: string;
|
|
1533
|
+
constructor(client: HTTPClient);
|
|
1534
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
1535
|
+
getAllCategories(): RequestProxyResult<{
|
|
1536
|
+
data: CategoryModel[];
|
|
1537
|
+
}, ResponseWrapper>;
|
|
1538
|
+
getAllTags(): RequestProxyResult<{
|
|
1539
|
+
data: TagModel[];
|
|
1540
|
+
}, ResponseWrapper>;
|
|
1541
|
+
getCategoryDetail(id: string): Promise<ResponseProxyExtraRaw<CategoryWithChildrenModel>>;
|
|
1542
|
+
getCategoryDetail(ids: string[]): Promise<ResponseProxyExtraRaw<Map<string, CategoryWithChildrenModel>>>;
|
|
1543
|
+
getCategoryByIdOrSlug(idOrSlug: string): Promise<CategoryModel & {
|
|
1544
|
+
children: Pick<PostModel, "id" | "title" | "slug" | "modified" | "created">[];
|
|
1545
|
+
} & {
|
|
1546
|
+
$raw: ResponseWrapper extends {
|
|
1547
|
+
data: infer T;
|
|
1548
|
+
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
1549
|
+
[i: string]: any;
|
|
1550
|
+
data: (ResponseWrapper extends unknown ? {
|
|
1551
|
+
[key: string]: any;
|
|
1552
|
+
data: CategoryWithChildrenModel;
|
|
1553
|
+
} : ResponseWrapper extends {
|
|
1554
|
+
data: CategoryWithChildrenModel;
|
|
1555
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1556
|
+
data: CategoryWithChildrenModel;
|
|
1557
|
+
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
1558
|
+
[key: string]: any;
|
|
1559
|
+
data: CategoryWithChildrenModel;
|
|
1560
|
+
} : ResponseWrapper extends {
|
|
1561
|
+
data: CategoryWithChildrenModel;
|
|
1562
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1563
|
+
data: CategoryWithChildrenModel;
|
|
1564
|
+
}) ? T_1 extends unknown ? {
|
|
1565
|
+
type: CategoryType;
|
|
1566
|
+
count: number;
|
|
1567
|
+
slug: string;
|
|
1568
|
+
name: string;
|
|
1569
|
+
created: string;
|
|
1570
|
+
id: string;
|
|
1571
|
+
children: Pick<PostModel, "id" | "created" | "title" | "slug" | "modified">[];
|
|
1572
|
+
} : T_1 : never : never;
|
|
1573
|
+
} : ResponseWrapper;
|
|
1574
|
+
$request: {
|
|
1575
|
+
path: string;
|
|
1576
|
+
method: string;
|
|
1577
|
+
[k: string]: string;
|
|
1578
|
+
};
|
|
1579
|
+
$serialized: CategoryWithChildrenModel;
|
|
1580
|
+
}>;
|
|
1581
|
+
getTagByName(name: string): Promise<{
|
|
1582
|
+
tag: string;
|
|
1583
|
+
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1584
|
+
} & {
|
|
1585
|
+
$raw: ResponseWrapper extends {
|
|
1586
|
+
data: infer T;
|
|
1587
|
+
} ? ResponseWrapper : ResponseWrapper extends unknown ? {
|
|
1588
|
+
[i: string]: any;
|
|
1589
|
+
data: (ResponseWrapper extends unknown ? {
|
|
1590
|
+
[key: string]: any;
|
|
1591
|
+
data: {
|
|
1592
|
+
tag: string;
|
|
1593
|
+
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1594
|
+
};
|
|
1595
|
+
} : ResponseWrapper extends {
|
|
1596
|
+
data: {
|
|
1597
|
+
tag: string;
|
|
1598
|
+
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1599
|
+
};
|
|
1600
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1601
|
+
data: {
|
|
1602
|
+
tag: string;
|
|
1603
|
+
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1604
|
+
};
|
|
1605
|
+
}) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
|
|
1606
|
+
[key: string]: any;
|
|
1607
|
+
data: {
|
|
1608
|
+
tag: string;
|
|
1609
|
+
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1610
|
+
};
|
|
1611
|
+
} : ResponseWrapper extends {
|
|
1612
|
+
data: {
|
|
1613
|
+
tag: string;
|
|
1614
|
+
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1615
|
+
};
|
|
1616
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1617
|
+
data: {
|
|
1618
|
+
tag: string;
|
|
1619
|
+
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1620
|
+
};
|
|
1621
|
+
}) ? T_1 extends unknown ? {
|
|
1622
|
+
tag: string;
|
|
1623
|
+
data: Pick<PostModel, "category" | "id" | "created" | "title" | "slug">[];
|
|
1624
|
+
} : T_1 : never : never;
|
|
1625
|
+
} : ResponseWrapper;
|
|
1626
|
+
$request: {
|
|
1627
|
+
path: string;
|
|
1628
|
+
method: string;
|
|
1629
|
+
[k: string]: string;
|
|
1630
|
+
};
|
|
1631
|
+
$serialized: {
|
|
1632
|
+
tag: string;
|
|
1633
|
+
data: Pick<PostModel, "id" | "title" | "slug" | "category" | "created">[];
|
|
1634
|
+
};
|
|
1635
|
+
}>;
|
|
1636
|
+
}
|
|
1637
|
+
//#endregion
|
|
1638
|
+
//#region interfaces/params.d.ts
|
|
1639
|
+
interface PaginationParams {
|
|
1640
|
+
size?: number;
|
|
1641
|
+
page?: number;
|
|
1642
|
+
}
|
|
1643
|
+
//#endregion
|
|
1644
|
+
//#region dtos/comment.d.ts
|
|
1645
|
+
interface AnonymousCommentDto {
|
|
1646
|
+
author: string;
|
|
1647
|
+
text: string;
|
|
1648
|
+
mail: string;
|
|
1649
|
+
url?: string;
|
|
1650
|
+
avatar?: string;
|
|
1651
|
+
isWhispers?: boolean;
|
|
1652
|
+
}
|
|
1653
|
+
interface ReaderCommentDto {
|
|
1654
|
+
text: string;
|
|
1655
|
+
isWhispers?: boolean;
|
|
1656
|
+
}
|
|
1657
|
+
type CommentDto = AnonymousCommentDto | ReaderCommentDto;
|
|
1658
|
+
//#endregion
|
|
1659
|
+
//#region controllers/comment.d.ts
|
|
1660
|
+
declare module '@mix-space-lts/api-client' {
|
|
1661
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1662
|
+
comment: CommentController<ResponseWrapper>;
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
declare class CommentController<ResponseWrapper> implements IController {
|
|
1666
|
+
private readonly client;
|
|
1667
|
+
base: string;
|
|
1668
|
+
name: string;
|
|
1669
|
+
constructor(client: HTTPClient);
|
|
1670
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
1671
|
+
/**
|
|
1672
|
+
* 根据 comment id 获取评论,包括子评论
|
|
1673
|
+
*/
|
|
1674
|
+
getById(id: string): RequestProxyResult<CommentModel & {
|
|
1675
|
+
ref: string;
|
|
1676
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1677
|
+
[key: string]: any;
|
|
1678
|
+
data: CommentModel & {
|
|
1679
|
+
ref: string;
|
|
1680
|
+
};
|
|
1681
|
+
} : ResponseWrapper extends {
|
|
1682
|
+
data: CommentModel & {
|
|
1683
|
+
ref: string;
|
|
1684
|
+
};
|
|
1685
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1686
|
+
data: CommentModel & {
|
|
1687
|
+
ref: string;
|
|
1688
|
+
};
|
|
1689
|
+
}>;
|
|
1690
|
+
/**
|
|
1691
|
+
* 获取文章的评论列表
|
|
1692
|
+
* @param refId 文章 Id
|
|
1693
|
+
*/
|
|
1694
|
+
getByRefId(refId: string, pagination?: PaginationParams): RequestProxyResult<PaginateResult<CommentThreadItem & {
|
|
1695
|
+
ref: string;
|
|
1696
|
+
}> & {
|
|
1697
|
+
readers: Record<string, ReaderModel>;
|
|
1698
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1699
|
+
[key: string]: any;
|
|
1700
|
+
data: PaginateResult<CommentThreadItem & {
|
|
1701
|
+
ref: string;
|
|
1702
|
+
}> & {
|
|
1703
|
+
readers: Record<string, ReaderModel>;
|
|
1704
|
+
};
|
|
1705
|
+
} : ResponseWrapper extends {
|
|
1706
|
+
data: PaginateResult<CommentThreadItem & {
|
|
1707
|
+
ref: string;
|
|
1708
|
+
}> & {
|
|
1709
|
+
readers: Record<string, ReaderModel>;
|
|
1710
|
+
};
|
|
1711
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1712
|
+
data: PaginateResult<CommentThreadItem & {
|
|
1713
|
+
ref: string;
|
|
1714
|
+
}> & {
|
|
1715
|
+
readers: Record<string, ReaderModel>;
|
|
1716
|
+
};
|
|
1717
|
+
}>;
|
|
1718
|
+
getThreadReplies(rootCommentId: string, params?: PaginationParams & {
|
|
1719
|
+
cursor?: string;
|
|
1720
|
+
}): RequestProxyResult<CommentThreadReplies, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1721
|
+
[key: string]: any;
|
|
1722
|
+
data: CommentThreadReplies;
|
|
1723
|
+
} : ResponseWrapper extends {
|
|
1724
|
+
data: CommentThreadReplies;
|
|
1725
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1726
|
+
data: CommentThreadReplies;
|
|
1727
|
+
}>;
|
|
1728
|
+
/**
|
|
1729
|
+
* 评论
|
|
1730
|
+
*/
|
|
1731
|
+
guestComment(refId: string, data: AnonymousCommentDto): RequestProxyResult<CommentModel, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1732
|
+
[key: string]: any;
|
|
1733
|
+
data: CommentModel;
|
|
1734
|
+
} : ResponseWrapper extends {
|
|
1735
|
+
data: CommentModel;
|
|
1736
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1737
|
+
data: CommentModel;
|
|
1738
|
+
}>;
|
|
1739
|
+
/**
|
|
1740
|
+
* 回复评论
|
|
1741
|
+
*/
|
|
1742
|
+
guestReply(commentId: string, data: AnonymousCommentDto): RequestProxyResult<CommentModel, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1743
|
+
[key: string]: any;
|
|
1744
|
+
data: CommentModel;
|
|
1745
|
+
} : ResponseWrapper extends {
|
|
1746
|
+
data: CommentModel;
|
|
1747
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1748
|
+
data: CommentModel;
|
|
1749
|
+
}>;
|
|
1750
|
+
readerComment(refId: string, data: ReaderCommentDto): RequestProxyResult<CommentModel, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1751
|
+
[key: string]: any;
|
|
1752
|
+
data: CommentModel;
|
|
1753
|
+
} : ResponseWrapper extends {
|
|
1754
|
+
data: CommentModel;
|
|
1755
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1756
|
+
data: CommentModel;
|
|
1757
|
+
}>;
|
|
1758
|
+
readerReply(commentId: string, data: ReaderCommentDto): RequestProxyResult<CommentModel, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1759
|
+
[key: string]: any;
|
|
1760
|
+
data: CommentModel;
|
|
1761
|
+
} : ResponseWrapper extends {
|
|
1762
|
+
data: CommentModel;
|
|
1763
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1764
|
+
data: CommentModel;
|
|
1765
|
+
}>;
|
|
1766
|
+
}
|
|
1767
|
+
//#endregion
|
|
1768
|
+
//#region controllers/base.d.ts
|
|
1769
|
+
type SortOptions = {
|
|
1770
|
+
sortBy?: string;
|
|
1771
|
+
sortOrder?: 1 | -1 | 'asc' | 'desc';
|
|
1772
|
+
};
|
|
1773
|
+
declare abstract class BaseCrudController<T, ResponseWrapper> {
|
|
1774
|
+
protected client: HTTPClient;
|
|
1775
|
+
base: string;
|
|
1776
|
+
constructor(client: HTTPClient);
|
|
1777
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
1778
|
+
getById(id: string): RequestProxyResult<T, ResponseWrapper>;
|
|
1779
|
+
getAll(): RequestProxyResult<{
|
|
1780
|
+
data: T[];
|
|
1781
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1782
|
+
[key: string]: any;
|
|
1783
|
+
data: {
|
|
1784
|
+
data: T[];
|
|
1785
|
+
};
|
|
1786
|
+
} : ResponseWrapper extends {
|
|
1787
|
+
data: {
|
|
1788
|
+
data: T[];
|
|
1789
|
+
};
|
|
1790
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1791
|
+
data: {
|
|
1792
|
+
data: T[];
|
|
1793
|
+
};
|
|
1794
|
+
}>;
|
|
1795
|
+
/**
|
|
1796
|
+
* 带分页的查询
|
|
1797
|
+
* @param page
|
|
1798
|
+
* @param perPage
|
|
1799
|
+
*/
|
|
1800
|
+
getAllPaginated(page?: number, perPage?: number, sortOption?: SortOptions): RequestProxyResult<PaginateResult<T>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1801
|
+
[key: string]: any;
|
|
1802
|
+
data: PaginateResult<T>;
|
|
1803
|
+
} : ResponseWrapper extends {
|
|
1804
|
+
data: PaginateResult<T>;
|
|
1805
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1806
|
+
data: PaginateResult<T>;
|
|
1807
|
+
}>;
|
|
1808
|
+
}
|
|
1809
|
+
//#endregion
|
|
1810
|
+
//#region controllers/link.d.ts
|
|
1811
|
+
declare module '@mix-space-lts/api-client' {
|
|
1812
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1813
|
+
link: LinkController<ResponseWrapper>;
|
|
1814
|
+
friend: LinkController<ResponseWrapper>;
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1817
|
+
declare class LinkController<ResponseWrapper> extends BaseCrudController<LinkModel, ResponseWrapper> {
|
|
1818
|
+
protected readonly client: HTTPClient;
|
|
1819
|
+
constructor(client: HTTPClient);
|
|
1820
|
+
canApplyLink(): Promise<boolean>;
|
|
1821
|
+
applyLink(data: Pick<LinkModel, 'avatar' | 'name' | 'description' | 'url' | 'email'> & {
|
|
1822
|
+
author: string;
|
|
1823
|
+
}): Promise<never>;
|
|
1824
|
+
name: string[];
|
|
1825
|
+
base: string;
|
|
1826
|
+
}
|
|
1827
|
+
//#endregion
|
|
1828
|
+
//#region controllers/note.d.ts
|
|
1829
|
+
declare module '@mix-space-lts/api-client' {
|
|
1830
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1831
|
+
note: NoteController<ResponseWrapper>;
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
type NoteListOptions = {
|
|
1835
|
+
select?: SelectFields<keyof NoteModel>;
|
|
1836
|
+
year?: number;
|
|
1837
|
+
sortBy?: 'weather' | 'mood' | 'title' | 'created' | 'modified';
|
|
1838
|
+
sortOrder?: 1 | -1;
|
|
1839
|
+
lang?: string;
|
|
1840
|
+
withSummary?: boolean;
|
|
1841
|
+
};
|
|
1842
|
+
type NoteByNidOptions = {
|
|
1843
|
+
password?: string;
|
|
1844
|
+
single?: boolean;
|
|
1845
|
+
lang?: string;
|
|
1846
|
+
prefer?: 'lexical';
|
|
1847
|
+
};
|
|
1848
|
+
type NoteBySlugDateOptions = NoteByNidOptions;
|
|
1849
|
+
type NoteMiddleListOptions = {
|
|
1850
|
+
lang?: string;
|
|
1851
|
+
};
|
|
1852
|
+
type NoteTopicListOptions = SortOptions & {
|
|
1853
|
+
lang?: string;
|
|
1854
|
+
};
|
|
1855
|
+
type NoteTimelineItem = Pick<NoteModel, 'id' | 'title' | 'nid' | 'slug' | 'created' | 'isPublished'> & {
|
|
1856
|
+
isTranslated?: boolean;
|
|
1857
|
+
translationMeta?: TranslationMeta;
|
|
1858
|
+
};
|
|
1859
|
+
type NoteTopicListItem = NoteModel & {
|
|
1860
|
+
isTranslated?: boolean;
|
|
1861
|
+
translationMeta?: TranslationMeta;
|
|
1862
|
+
};
|
|
1863
|
+
declare class NoteController<ResponseWrapper> implements IController {
|
|
1864
|
+
private client;
|
|
1865
|
+
base: string;
|
|
1866
|
+
name: string;
|
|
1867
|
+
constructor(client: HTTPClient);
|
|
1868
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
1869
|
+
/**
|
|
1870
|
+
* 最新日记
|
|
1871
|
+
*/
|
|
1872
|
+
getLatest(): RequestProxyResult<NoteWrappedWithLikedPayload, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1873
|
+
[key: string]: any;
|
|
1874
|
+
data: NoteWrappedWithLikedPayload;
|
|
1875
|
+
} : ResponseWrapper extends {
|
|
1876
|
+
data: NoteWrappedWithLikedPayload;
|
|
1877
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1878
|
+
data: NoteWrappedWithLikedPayload;
|
|
1879
|
+
}>;
|
|
1880
|
+
/**
|
|
1881
|
+
* 获取一篇日记,根据 Id 查询需要鉴权
|
|
1882
|
+
* @param id id | nid
|
|
1883
|
+
* @param password 访问密码
|
|
1884
|
+
*/
|
|
1885
|
+
getNoteById(id: string): Promise<RequestProxyResult<NoteModel, ResponseWrapper>>;
|
|
1886
|
+
getNoteById(id: number): Promise<NoteWrappedPayload>;
|
|
1887
|
+
getNoteById(id: number, password: string): Promise<NoteWrappedPayload>;
|
|
1888
|
+
getNoteById(id: number, password: undefined, singleResult: true): Promise<RequestProxyResult<NoteModel, ResponseWrapper>>;
|
|
1889
|
+
getNoteById(id: number, password: string, singleResult: true): Promise<RequestProxyResult<NoteModel, ResponseWrapper>>;
|
|
1890
|
+
/**
|
|
1891
|
+
* 根据 nid 获取日记,支持翻译参数
|
|
1892
|
+
* @param nid 日记编号
|
|
1893
|
+
* @param options 可选参数:password, single, lang
|
|
1894
|
+
*/
|
|
1895
|
+
getNoteByNid(nid: number, options?: NoteByNidOptions): RequestProxyResult<NoteWrappedWithLikedAndTranslationPayload, ResponseWrapper>;
|
|
1896
|
+
getNoteBySlugDate(year: number, month: number, day: number, slug: string, options?: NoteBySlugDateOptions): RequestProxyResult<NoteWrappedWithLikedAndTranslationPayload, ResponseWrapper>;
|
|
1897
|
+
/**
|
|
1898
|
+
* 日记列表分页
|
|
1899
|
+
*/
|
|
1900
|
+
getList(page?: number, perPage?: number, options?: NoteListOptions): RequestProxyResult<PaginateResult<NoteModel>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1901
|
+
[key: string]: any;
|
|
1902
|
+
data: PaginateResult<NoteModel>;
|
|
1903
|
+
} : ResponseWrapper extends {
|
|
1904
|
+
data: PaginateResult<NoteModel>;
|
|
1905
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1906
|
+
data: PaginateResult<NoteModel>;
|
|
1907
|
+
}>;
|
|
1908
|
+
/**
|
|
1909
|
+
* 获取当前日记的上下各 n / 2 篇日记
|
|
1910
|
+
* @param id 当前日记 ID
|
|
1911
|
+
* @param size 返回数量,默认 5
|
|
1912
|
+
* @param options 可选参数,包含 lang 用于获取翻译版本
|
|
1913
|
+
*/
|
|
1914
|
+
getMiddleList(id: string, size?: number, options?: NoteMiddleListOptions): RequestProxyResult<{
|
|
1915
|
+
data: NoteTimelineItem[];
|
|
1916
|
+
size: number;
|
|
1917
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1918
|
+
[key: string]: any;
|
|
1919
|
+
data: {
|
|
1920
|
+
data: NoteTimelineItem[];
|
|
1921
|
+
size: number;
|
|
1922
|
+
};
|
|
1923
|
+
} : ResponseWrapper extends {
|
|
1924
|
+
data: {
|
|
1925
|
+
data: NoteTimelineItem[];
|
|
1926
|
+
size: number;
|
|
1927
|
+
};
|
|
1928
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1929
|
+
data: {
|
|
1930
|
+
data: NoteTimelineItem[];
|
|
1931
|
+
size: number;
|
|
1932
|
+
};
|
|
1933
|
+
}>;
|
|
1934
|
+
/**
|
|
1935
|
+
* 获取专栏内的所有日记
|
|
1936
|
+
* @param topicId 专栏 ID
|
|
1937
|
+
* @param page 页码,默认 1
|
|
1938
|
+
* @param size 每页数量,默认 10
|
|
1939
|
+
* @param options 可选参数,包含排序选项和 lang 用于获取翻译版本
|
|
1940
|
+
*/
|
|
1941
|
+
getNoteByTopicId(topicId: string, page?: number, size?: number, options?: NoteTopicListOptions): RequestProxyResult<PaginateResult<NoteTopicListItem>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1942
|
+
[key: string]: any;
|
|
1943
|
+
data: PaginateResult<NoteTopicListItem>;
|
|
1944
|
+
} : ResponseWrapper extends {
|
|
1945
|
+
data: PaginateResult<NoteTopicListItem>;
|
|
1946
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1947
|
+
data: PaginateResult<NoteTopicListItem>;
|
|
1948
|
+
}>;
|
|
1949
|
+
}
|
|
1950
|
+
//#endregion
|
|
1951
|
+
//#region controllers/owner.d.ts
|
|
1952
|
+
declare module '@mix-space-lts/api-client' {
|
|
1953
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
1954
|
+
owner: UserController<ResponseWrapper>;
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
declare class UserController<ResponseWrapper> implements IController {
|
|
1958
|
+
private readonly client;
|
|
1959
|
+
constructor(client: HTTPClient);
|
|
1960
|
+
base: string;
|
|
1961
|
+
name: string[];
|
|
1962
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
1963
|
+
private get authProxy();
|
|
1964
|
+
private normalizeToken;
|
|
1965
|
+
/**
|
|
1966
|
+
* @deprecated Use `getOwnerInfo()` instead.
|
|
1967
|
+
*/
|
|
1968
|
+
getMasterInfo(): RequestProxyResult<UserModel, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1969
|
+
[key: string]: any;
|
|
1970
|
+
data: UserModel;
|
|
1971
|
+
} : ResponseWrapper extends {
|
|
1972
|
+
data: UserModel;
|
|
1973
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1974
|
+
data: UserModel;
|
|
1975
|
+
}>;
|
|
1976
|
+
getOwnerInfo(): RequestProxyResult<UserModel, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1977
|
+
[key: string]: any;
|
|
1978
|
+
data: UserModel;
|
|
1979
|
+
} : ResponseWrapper extends {
|
|
1980
|
+
data: UserModel;
|
|
1981
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1982
|
+
data: UserModel;
|
|
1983
|
+
}>;
|
|
1984
|
+
login(username: string, password: string, options?: {
|
|
1985
|
+
callbackURL?: string;
|
|
1986
|
+
rememberMe?: boolean;
|
|
1987
|
+
}): RequestProxyResult<BetterAuthSignInResult, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1988
|
+
[key: string]: any;
|
|
1989
|
+
data: BetterAuthSignInResult;
|
|
1990
|
+
} : ResponseWrapper extends {
|
|
1991
|
+
data: BetterAuthSignInResult;
|
|
1992
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
1993
|
+
data: BetterAuthSignInResult;
|
|
1994
|
+
}>;
|
|
1995
|
+
logout(): RequestProxyResult<{
|
|
1996
|
+
success: boolean;
|
|
1997
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
1998
|
+
[key: string]: any;
|
|
1999
|
+
data: {
|
|
2000
|
+
success: boolean;
|
|
2001
|
+
};
|
|
2002
|
+
} : ResponseWrapper extends {
|
|
2003
|
+
data: {
|
|
2004
|
+
success: boolean;
|
|
2005
|
+
};
|
|
2006
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2007
|
+
data: {
|
|
2008
|
+
success: boolean;
|
|
2009
|
+
};
|
|
2010
|
+
}>;
|
|
2011
|
+
/**
|
|
2012
|
+
* Better Auth raw session (`/auth/get-session`).
|
|
2013
|
+
*/
|
|
2014
|
+
getAuthSession(options?: {
|
|
2015
|
+
disableCookieCache?: boolean;
|
|
2016
|
+
disableRefresh?: boolean;
|
|
2017
|
+
}): RequestProxyResult<BetterAuthSessionResult | null, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2018
|
+
[key: string]: any;
|
|
2019
|
+
data: BetterAuthSessionResult | null;
|
|
2020
|
+
} : ResponseWrapper extends {
|
|
2021
|
+
data: BetterAuthSessionResult | null;
|
|
2022
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2023
|
+
data: BetterAuthSessionResult | null;
|
|
2024
|
+
}>;
|
|
2025
|
+
/**
|
|
2026
|
+
* Core session summary (`/auth/session`).
|
|
2027
|
+
*/
|
|
2028
|
+
getSession(): RequestProxyResult<OwnerSessionResult | null, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2029
|
+
[key: string]: any;
|
|
2030
|
+
data: OwnerSessionResult | null;
|
|
2031
|
+
} : ResponseWrapper extends {
|
|
2032
|
+
data: OwnerSessionResult | null;
|
|
2033
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2034
|
+
data: OwnerSessionResult | null;
|
|
2035
|
+
}>;
|
|
2036
|
+
getProviders(): RequestProxyResult<string[], ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2037
|
+
[key: string]: any;
|
|
2038
|
+
data: string[];
|
|
2039
|
+
} : ResponseWrapper extends {
|
|
2040
|
+
data: string[];
|
|
2041
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2042
|
+
data: string[];
|
|
2043
|
+
}>;
|
|
2044
|
+
getAllowLoginMethods(): RequestProxyResult<OwnerAllowLoginResult, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2045
|
+
[key: string]: any;
|
|
2046
|
+
data: OwnerAllowLoginResult;
|
|
2047
|
+
} : ResponseWrapper extends {
|
|
2048
|
+
data: OwnerAllowLoginResult;
|
|
2049
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2050
|
+
data: OwnerAllowLoginResult;
|
|
2051
|
+
}>;
|
|
2052
|
+
listSessions(): RequestProxyResult<BetterAuthSession[], ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2053
|
+
[key: string]: any;
|
|
2054
|
+
data: BetterAuthSession[];
|
|
2055
|
+
} : ResponseWrapper extends {
|
|
2056
|
+
data: BetterAuthSession[];
|
|
2057
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2058
|
+
data: BetterAuthSession[];
|
|
2059
|
+
}>;
|
|
2060
|
+
revokeSession(token: string): RequestProxyResult<{
|
|
2061
|
+
status: boolean;
|
|
2062
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2063
|
+
[key: string]: any;
|
|
2064
|
+
data: {
|
|
2065
|
+
status: boolean;
|
|
2066
|
+
};
|
|
2067
|
+
} : ResponseWrapper extends {
|
|
2068
|
+
data: {
|
|
2069
|
+
status: boolean;
|
|
2070
|
+
};
|
|
2071
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2072
|
+
data: {
|
|
2073
|
+
status: boolean;
|
|
2074
|
+
};
|
|
2075
|
+
}>;
|
|
2076
|
+
revokeSessions(): RequestProxyResult<{
|
|
2077
|
+
status: boolean;
|
|
2078
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2079
|
+
[key: string]: any;
|
|
2080
|
+
data: {
|
|
2081
|
+
status: boolean;
|
|
2082
|
+
};
|
|
2083
|
+
} : ResponseWrapper extends {
|
|
2084
|
+
data: {
|
|
2085
|
+
status: boolean;
|
|
2086
|
+
};
|
|
2087
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2088
|
+
data: {
|
|
2089
|
+
status: boolean;
|
|
2090
|
+
};
|
|
2091
|
+
}>;
|
|
2092
|
+
revokeOtherSessions(): RequestProxyResult<{
|
|
2093
|
+
status: boolean;
|
|
2094
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2095
|
+
[key: string]: any;
|
|
2096
|
+
data: {
|
|
2097
|
+
status: boolean;
|
|
2098
|
+
};
|
|
2099
|
+
} : ResponseWrapper extends {
|
|
2100
|
+
data: {
|
|
2101
|
+
status: boolean;
|
|
2102
|
+
};
|
|
2103
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2104
|
+
data: {
|
|
2105
|
+
status: boolean;
|
|
2106
|
+
};
|
|
2107
|
+
}>;
|
|
2108
|
+
checkTokenValid(token?: string): RequestProxyResult<CheckLoggedResult, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2109
|
+
[key: string]: any;
|
|
2110
|
+
data: CheckLoggedResult;
|
|
2111
|
+
} : ResponseWrapper extends {
|
|
2112
|
+
data: CheckLoggedResult;
|
|
2113
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2114
|
+
data: CheckLoggedResult;
|
|
2115
|
+
}>;
|
|
2116
|
+
}
|
|
2117
|
+
//#endregion
|
|
2118
|
+
//#region controllers/page.d.ts
|
|
2119
|
+
declare module '@mix-space-lts/api-client' {
|
|
2120
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
2121
|
+
page: PageController<ResponseWrapper>;
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
type PageListOptions = {
|
|
2125
|
+
select?: SelectFields<keyof PageModel>;
|
|
2126
|
+
sortBy?: 'order' | 'subtitle' | 'title' | 'created' | 'modified';
|
|
2127
|
+
sortOrder?: 1 | -1;
|
|
2128
|
+
};
|
|
2129
|
+
declare class PageController<ResponseWrapper> implements IController {
|
|
2130
|
+
private readonly client;
|
|
2131
|
+
constructor(client: HTTPClient);
|
|
2132
|
+
base: string;
|
|
2133
|
+
name: string;
|
|
2134
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
2135
|
+
/**
|
|
2136
|
+
* 页面列表
|
|
2137
|
+
*/
|
|
2138
|
+
getList(page?: number, perPage?: number, options?: PageListOptions): RequestProxyResult<PaginateResult<PageModel>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2139
|
+
[key: string]: any;
|
|
2140
|
+
data: PaginateResult<PageModel>;
|
|
2141
|
+
} : ResponseWrapper extends {
|
|
2142
|
+
data: PaginateResult<PageModel>;
|
|
2143
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2144
|
+
data: PaginateResult<PageModel>;
|
|
2145
|
+
}>;
|
|
2146
|
+
/**
|
|
2147
|
+
* 页面详情
|
|
2148
|
+
*/
|
|
2149
|
+
getById(id: string): RequestProxyResult<PageModel, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2150
|
+
[key: string]: any;
|
|
2151
|
+
data: PageModel;
|
|
2152
|
+
} : ResponseWrapper extends {
|
|
2153
|
+
data: PageModel;
|
|
2154
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2155
|
+
data: PageModel;
|
|
2156
|
+
}>;
|
|
2157
|
+
/**
|
|
2158
|
+
* 根据路径获取页面
|
|
2159
|
+
* @param slug 路径
|
|
2160
|
+
* @returns
|
|
2161
|
+
*/
|
|
2162
|
+
getBySlug(slug: string, options?: {
|
|
2163
|
+
prefer?: 'lexical';
|
|
2164
|
+
}): RequestProxyResult<PageModel, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2165
|
+
[key: string]: any;
|
|
2166
|
+
data: PageModel;
|
|
2167
|
+
} : ResponseWrapper extends {
|
|
2168
|
+
data: PageModel;
|
|
2169
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2170
|
+
data: PageModel;
|
|
2171
|
+
}>;
|
|
2172
|
+
}
|
|
2173
|
+
//#endregion
|
|
2174
|
+
//#region controllers/post.d.ts
|
|
2175
|
+
declare module '@mix-space-lts/api-client' {
|
|
2176
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
2177
|
+
post: PostController<ResponseWrapper>;
|
|
2178
|
+
}
|
|
2179
|
+
}
|
|
2180
|
+
type PostListOptions = {
|
|
2181
|
+
select?: SelectFields<keyof PostModel>;
|
|
2182
|
+
year?: number;
|
|
2183
|
+
sortBy?: 'categoryId' | 'title' | 'created' | 'modified';
|
|
2184
|
+
sortOrder?: 1 | -1;
|
|
2185
|
+
truncate?: number; /** 语言代码,用于获取翻译版本 */
|
|
2186
|
+
lang?: string;
|
|
2187
|
+
};
|
|
2188
|
+
/** 文章列表项,可能包含翻译信息 */
|
|
2189
|
+
type PostListItem = PostModel & {
|
|
2190
|
+
isTranslated?: boolean;
|
|
2191
|
+
translationMeta?: TranslationMeta;
|
|
2192
|
+
};
|
|
2193
|
+
declare class PostController<ResponseWrapper> implements IController {
|
|
2194
|
+
private client;
|
|
2195
|
+
constructor(client: HTTPClient);
|
|
2196
|
+
base: string;
|
|
2197
|
+
name: string;
|
|
2198
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
2199
|
+
/**
|
|
2200
|
+
* 获取文章列表分页
|
|
2201
|
+
* @param page
|
|
2202
|
+
* @param perPage
|
|
2203
|
+
* @param options 可选参数,包含 lang 用于获取翻译版本
|
|
2204
|
+
* @returns 当传入 lang 时,返回的文章可能包含 isTranslated 和 translationMeta 字段
|
|
2205
|
+
*/
|
|
2206
|
+
getList(page?: number, perPage?: number, options?: PostListOptions): RequestProxyResult<PaginateResult<PostListItem>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2207
|
+
[key: string]: any;
|
|
2208
|
+
data: PaginateResult<PostListItem>;
|
|
2209
|
+
} : ResponseWrapper extends {
|
|
2210
|
+
data: PaginateResult<PostListItem>;
|
|
2211
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2212
|
+
data: PaginateResult<PostListItem>;
|
|
2213
|
+
}>;
|
|
2214
|
+
/**
|
|
2215
|
+
* 根据分类和路径查找文章
|
|
2216
|
+
* @param categoryName
|
|
2217
|
+
* @param slug
|
|
2218
|
+
* @param options 可选参数,包含 lang 用于获取翻译版本
|
|
2219
|
+
*/
|
|
2220
|
+
getPost(categoryName: string, slug: string, options?: {
|
|
2221
|
+
lang?: string;
|
|
2222
|
+
prefer?: 'lexical';
|
|
2223
|
+
}): RequestProxyResult<ModelWithLiked<ModelWithTranslation<PostModel>>, ResponseWrapper>;
|
|
2224
|
+
/**
|
|
2225
|
+
* 根据 ID 查找文章
|
|
2226
|
+
* @param id
|
|
2227
|
+
*/
|
|
2228
|
+
getPost(id: string): RequestProxyResult<PostModel, ResponseWrapper>;
|
|
2229
|
+
/**
|
|
2230
|
+
* 获取最新的文章
|
|
2231
|
+
*/
|
|
2232
|
+
getLatest(): RequestProxyResult<ModelWithLiked<PostModel>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2233
|
+
[key: string]: any;
|
|
2234
|
+
data: ModelWithLiked<PostModel>;
|
|
2235
|
+
} : ResponseWrapper extends {
|
|
2236
|
+
data: ModelWithLiked<PostModel>;
|
|
2237
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2238
|
+
data: ModelWithLiked<PostModel>;
|
|
2239
|
+
}>;
|
|
2240
|
+
getFullUrl(slug: string): RequestProxyResult<{
|
|
2241
|
+
path: string;
|
|
2242
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2243
|
+
[key: string]: any;
|
|
2244
|
+
data: {
|
|
2245
|
+
path: string;
|
|
2246
|
+
};
|
|
2247
|
+
} : ResponseWrapper extends {
|
|
2248
|
+
data: {
|
|
2249
|
+
path: string;
|
|
2250
|
+
};
|
|
2251
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2252
|
+
data: {
|
|
2253
|
+
path: string;
|
|
2254
|
+
};
|
|
2255
|
+
}>;
|
|
2256
|
+
}
|
|
2257
|
+
//#endregion
|
|
2258
|
+
//#region controllers/project.d.ts
|
|
2259
|
+
declare module '@mix-space-lts/api-client' {
|
|
2260
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
2261
|
+
project: ProjectController<ResponseWrapper>;
|
|
2262
|
+
}
|
|
2263
|
+
}
|
|
2264
|
+
declare class ProjectController<ResponseWrapper> extends BaseCrudController<ProjectModel, ResponseWrapper> {
|
|
2265
|
+
protected readonly client: HTTPClient;
|
|
2266
|
+
constructor(client: HTTPClient);
|
|
2267
|
+
base: string;
|
|
2268
|
+
name: string;
|
|
2269
|
+
}
|
|
2270
|
+
//#endregion
|
|
2271
|
+
//#region controllers/recently.d.ts
|
|
2272
|
+
declare module '@mix-space-lts/api-client' {
|
|
2273
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
2274
|
+
recently: RecentlyController<ResponseWrapper>;
|
|
2275
|
+
shorthand: RecentlyController<ResponseWrapper>;
|
|
2276
|
+
}
|
|
2277
|
+
}
|
|
2278
|
+
declare enum RecentlyAttitudeResultEnum {
|
|
2279
|
+
Inc = 1,
|
|
2280
|
+
Dec = -1
|
|
2281
|
+
}
|
|
2282
|
+
declare enum RecentlyAttitudeEnum {
|
|
2283
|
+
Up = 0,
|
|
2284
|
+
Down = 1
|
|
2285
|
+
}
|
|
2286
|
+
declare class RecentlyController<ResponseWrapper> implements IController {
|
|
2287
|
+
private readonly client;
|
|
2288
|
+
base: string;
|
|
2289
|
+
name: string[];
|
|
2290
|
+
constructor(client: HTTPClient);
|
|
2291
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
2292
|
+
/**
|
|
2293
|
+
* 获取最新一条
|
|
2294
|
+
*/
|
|
2295
|
+
getLatestOne(): RequestProxyResult<RecentlyModel & {
|
|
2296
|
+
comments: number;
|
|
2297
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2298
|
+
[key: string]: any;
|
|
2299
|
+
data: RecentlyModel & {
|
|
2300
|
+
comments: number;
|
|
2301
|
+
};
|
|
2302
|
+
} : ResponseWrapper extends {
|
|
2303
|
+
data: RecentlyModel & {
|
|
2304
|
+
comments: number;
|
|
2305
|
+
};
|
|
2306
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2307
|
+
data: RecentlyModel & {
|
|
2308
|
+
comments: number;
|
|
2309
|
+
};
|
|
2310
|
+
}>;
|
|
2311
|
+
getAll(): RequestProxyResult<{
|
|
2312
|
+
data: RecentlyModel[] & {
|
|
2313
|
+
comments: number;
|
|
2314
|
+
};
|
|
2315
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2316
|
+
[key: string]: any;
|
|
2317
|
+
data: {
|
|
2318
|
+
data: RecentlyModel[] & {
|
|
2319
|
+
comments: number;
|
|
2320
|
+
};
|
|
2321
|
+
};
|
|
2322
|
+
} : ResponseWrapper extends {
|
|
2323
|
+
data: {
|
|
2324
|
+
data: RecentlyModel[] & {
|
|
2325
|
+
comments: number;
|
|
2326
|
+
};
|
|
2327
|
+
};
|
|
2328
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2329
|
+
data: {
|
|
2330
|
+
data: RecentlyModel[] & {
|
|
2331
|
+
comments: number;
|
|
2332
|
+
};
|
|
2333
|
+
};
|
|
2334
|
+
}>;
|
|
2335
|
+
getList({
|
|
2336
|
+
before,
|
|
2337
|
+
after,
|
|
2338
|
+
size
|
|
2339
|
+
}?: {
|
|
2340
|
+
before?: string | undefined;
|
|
2341
|
+
after?: string | undefined;
|
|
2342
|
+
size?: number | number;
|
|
2343
|
+
}): RequestProxyResult<{
|
|
2344
|
+
data: RecentlyModel[] & {
|
|
2345
|
+
comments: number;
|
|
2346
|
+
};
|
|
2347
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2348
|
+
[key: string]: any;
|
|
2349
|
+
data: {
|
|
2350
|
+
data: RecentlyModel[] & {
|
|
2351
|
+
comments: number;
|
|
2352
|
+
};
|
|
2353
|
+
};
|
|
2354
|
+
} : ResponseWrapper extends {
|
|
2355
|
+
data: {
|
|
2356
|
+
data: RecentlyModel[] & {
|
|
2357
|
+
comments: number;
|
|
2358
|
+
};
|
|
2359
|
+
};
|
|
2360
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2361
|
+
data: {
|
|
2362
|
+
data: RecentlyModel[] & {
|
|
2363
|
+
comments: number;
|
|
2364
|
+
};
|
|
2365
|
+
};
|
|
2366
|
+
}>;
|
|
2367
|
+
getById(id: string): RequestProxyResult<RecentlyModel & {
|
|
2368
|
+
comments: number;
|
|
2369
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2370
|
+
[key: string]: any;
|
|
2371
|
+
data: RecentlyModel & {
|
|
2372
|
+
comments: number;
|
|
2373
|
+
};
|
|
2374
|
+
} : ResponseWrapper extends {
|
|
2375
|
+
data: RecentlyModel & {
|
|
2376
|
+
comments: number;
|
|
2377
|
+
};
|
|
2378
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2379
|
+
data: RecentlyModel & {
|
|
2380
|
+
comments: number;
|
|
2381
|
+
};
|
|
2382
|
+
}>;
|
|
2383
|
+
/** 表态:点赞,点踩 */
|
|
2384
|
+
attitude(id: string, attitude: RecentlyAttitudeEnum): RequestProxyResult<{
|
|
2385
|
+
code: RecentlyAttitudeResultEnum;
|
|
2386
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2387
|
+
[key: string]: any;
|
|
2388
|
+
data: {
|
|
2389
|
+
code: RecentlyAttitudeResultEnum;
|
|
2390
|
+
};
|
|
2391
|
+
} : ResponseWrapper extends {
|
|
2392
|
+
data: {
|
|
2393
|
+
code: RecentlyAttitudeResultEnum;
|
|
2394
|
+
};
|
|
2395
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2396
|
+
data: {
|
|
2397
|
+
code: RecentlyAttitudeResultEnum;
|
|
2398
|
+
};
|
|
2399
|
+
}>;
|
|
2400
|
+
}
|
|
2401
|
+
//#endregion
|
|
2402
|
+
//#region controllers/say.d.ts
|
|
2403
|
+
declare module '@mix-space-lts/api-client' {
|
|
2404
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
2405
|
+
say: SayController<ResponseWrapper>;
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
declare class SayController<ResponseWrapper> extends BaseCrudController<SayModel, ResponseWrapper> implements IController {
|
|
2409
|
+
protected client: HTTPClient;
|
|
2410
|
+
base: string;
|
|
2411
|
+
name: string;
|
|
2412
|
+
constructor(client: HTTPClient);
|
|
2413
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
2414
|
+
/**
|
|
2415
|
+
* 获取随机一条
|
|
2416
|
+
*/
|
|
2417
|
+
getRandom(): RequestProxyResult<{
|
|
2418
|
+
data: SayModel | null;
|
|
2419
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2420
|
+
[key: string]: any;
|
|
2421
|
+
data: {
|
|
2422
|
+
data: SayModel | null;
|
|
2423
|
+
};
|
|
2424
|
+
} : ResponseWrapper extends {
|
|
2425
|
+
data: {
|
|
2426
|
+
data: SayModel | null;
|
|
2427
|
+
};
|
|
2428
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2429
|
+
data: {
|
|
2430
|
+
data: SayModel | null;
|
|
2431
|
+
};
|
|
2432
|
+
}>;
|
|
2433
|
+
}
|
|
2434
|
+
//#endregion
|
|
2435
|
+
//#region controllers/search.d.ts
|
|
2436
|
+
declare module '@mix-space-lts/api-client' {
|
|
2437
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
2438
|
+
search: SearchController<ResponseWrapper>;
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2441
|
+
type SearchOption = {
|
|
2442
|
+
orderBy?: string;
|
|
2443
|
+
order?: number;
|
|
2444
|
+
rawAlgolia?: boolean;
|
|
2445
|
+
};
|
|
2446
|
+
declare class SearchController<ResponseWrapper> implements IController {
|
|
2447
|
+
private readonly client;
|
|
2448
|
+
base: string;
|
|
2449
|
+
name: string;
|
|
2450
|
+
constructor(client: HTTPClient);
|
|
2451
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
2452
|
+
search(type: 'note', keyword: string, options?: Omit<SearchOption, 'rawAlgolia'>): Promise<RequestProxyResult<PaginateResult<Pick<NoteModel, 'modified' | 'id' | 'title' | 'created' | 'nid'>>, ResponseWrapper>>;
|
|
2453
|
+
search(type: 'post', keyword: string, options?: Omit<SearchOption, 'rawAlgolia'>): Promise<RequestProxyResult<PaginateResult<Pick<PostModel, 'modified' | 'id' | 'title' | 'created' | 'slug' | 'category'>>, ResponseWrapper>>;
|
|
2454
|
+
/**
|
|
2455
|
+
* 从 algolya 搜索
|
|
2456
|
+
* https://www.algolia.com/doc/api-reference/api-methods/search/
|
|
2457
|
+
* @param keyword
|
|
2458
|
+
* @param options
|
|
2459
|
+
* @returns
|
|
2460
|
+
*/
|
|
2461
|
+
searchByAlgolia(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & {
|
|
2462
|
+
type: "post";
|
|
2463
|
+
}) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
|
|
2464
|
+
type: "note";
|
|
2465
|
+
}) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & {
|
|
2466
|
+
type: "page";
|
|
2467
|
+
})> & {
|
|
2468
|
+
/**
|
|
2469
|
+
* @see: algoliasearch <https://www.algolia.com/doc/api-reference/api-methods/search/>
|
|
2470
|
+
*/
|
|
2471
|
+
raw?: any;
|
|
2472
|
+
}, ResponseWrapper>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2473
|
+
[key: string]: any;
|
|
2474
|
+
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & {
|
|
2475
|
+
type: "post";
|
|
2476
|
+
}) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
|
|
2477
|
+
type: "note";
|
|
2478
|
+
}) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & {
|
|
2479
|
+
type: "page";
|
|
2480
|
+
})> & {
|
|
2481
|
+
/**
|
|
2482
|
+
* @see: algoliasearch <https://www.algolia.com/doc/api-reference/api-methods/search/>
|
|
2483
|
+
*/
|
|
2484
|
+
raw?: any;
|
|
2485
|
+
}, ResponseWrapper>;
|
|
2486
|
+
} : ResponseWrapper extends {
|
|
2487
|
+
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & {
|
|
2488
|
+
type: "post";
|
|
2489
|
+
}) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
|
|
2490
|
+
type: "note";
|
|
2491
|
+
}) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & {
|
|
2492
|
+
type: "page";
|
|
2493
|
+
})> & {
|
|
2494
|
+
/**
|
|
2495
|
+
* @see: algoliasearch <https://www.algolia.com/doc/api-reference/api-methods/search/>
|
|
2496
|
+
*/
|
|
2497
|
+
raw?: any;
|
|
2498
|
+
}, ResponseWrapper>;
|
|
2499
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2500
|
+
data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & {
|
|
2501
|
+
type: "post";
|
|
2502
|
+
}) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
|
|
2503
|
+
type: "note";
|
|
2504
|
+
}) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & {
|
|
2505
|
+
type: "page";
|
|
2506
|
+
})> & {
|
|
2507
|
+
/**
|
|
2508
|
+
* @see: algoliasearch <https://www.algolia.com/doc/api-reference/api-methods/search/>
|
|
2509
|
+
*/
|
|
2510
|
+
raw?: any;
|
|
2511
|
+
}, ResponseWrapper>;
|
|
2512
|
+
}>;
|
|
2513
|
+
}
|
|
2514
|
+
//#endregion
|
|
2515
|
+
//#region controllers/severless.d.ts
|
|
2516
|
+
declare module '@mix-space-lts/api-client' {
|
|
2517
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
2518
|
+
serverless: ServerlessController<ResponseWrapper>;
|
|
2519
|
+
}
|
|
2520
|
+
}
|
|
2521
|
+
declare class ServerlessController<ResponseWrapper> implements IController {
|
|
2522
|
+
protected client: HTTPClient;
|
|
2523
|
+
base: string;
|
|
2524
|
+
name: string;
|
|
2525
|
+
constructor(client: HTTPClient);
|
|
2526
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
2527
|
+
getByReferenceAndName<T = unknown>(reference: string, name: string): RequestProxyResult<T, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2528
|
+
[key: string]: any;
|
|
2529
|
+
data: T;
|
|
2530
|
+
} : ResponseWrapper extends {
|
|
2531
|
+
data: T;
|
|
2532
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2533
|
+
data: T;
|
|
2534
|
+
}>;
|
|
2535
|
+
}
|
|
2536
|
+
//#endregion
|
|
2537
|
+
//#region controllers/snippet.d.ts
|
|
2538
|
+
declare module '@mix-space-lts/api-client' {
|
|
2539
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
2540
|
+
snippet: SnippetController<ResponseWrapper>;
|
|
2541
|
+
}
|
|
2542
|
+
}
|
|
2543
|
+
declare class SnippetController<ResponseWrapper> implements IController {
|
|
2544
|
+
protected client: HTTPClient;
|
|
2545
|
+
base: string;
|
|
2546
|
+
name: string;
|
|
2547
|
+
constructor(client: HTTPClient);
|
|
2548
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
2549
|
+
getByReferenceAndName<T = unknown>(reference: string, name: string): RequestProxyResult<T, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2550
|
+
[key: string]: any;
|
|
2551
|
+
data: T;
|
|
2552
|
+
} : ResponseWrapper extends {
|
|
2553
|
+
data: T;
|
|
2554
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2555
|
+
data: T;
|
|
2556
|
+
}>;
|
|
2557
|
+
}
|
|
2558
|
+
//#endregion
|
|
2559
|
+
//#region controllers/subscribe.d.ts
|
|
2560
|
+
declare module '@mix-space-lts/api-client' {
|
|
2561
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
2562
|
+
subscribe: SubscribeController<ResponseWrapper>;
|
|
2563
|
+
}
|
|
2564
|
+
}
|
|
2565
|
+
declare class SubscribeController<ResponseWrapper> implements IController {
|
|
2566
|
+
protected client: HTTPClient;
|
|
2567
|
+
base: string;
|
|
2568
|
+
name: string;
|
|
2569
|
+
constructor(client: HTTPClient);
|
|
2570
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
2571
|
+
/**
|
|
2572
|
+
* 检查开启状态
|
|
2573
|
+
*/
|
|
2574
|
+
check(): RequestProxyResult<{
|
|
2575
|
+
enable: boolean;
|
|
2576
|
+
bitMap: Record<SubscribeType, number>;
|
|
2577
|
+
allowBits: number[];
|
|
2578
|
+
allowTypes: SubscribeType[];
|
|
2579
|
+
}, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2580
|
+
[key: string]: any;
|
|
2581
|
+
data: {
|
|
2582
|
+
enable: boolean;
|
|
2583
|
+
bitMap: Record<SubscribeType, number>;
|
|
2584
|
+
allowBits: number[];
|
|
2585
|
+
allowTypes: SubscribeType[];
|
|
2586
|
+
};
|
|
2587
|
+
} : ResponseWrapper extends {
|
|
2588
|
+
data: {
|
|
2589
|
+
enable: boolean;
|
|
2590
|
+
bitMap: Record<SubscribeType, number>;
|
|
2591
|
+
allowBits: number[];
|
|
2592
|
+
allowTypes: SubscribeType[];
|
|
2593
|
+
};
|
|
2594
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2595
|
+
data: {
|
|
2596
|
+
enable: boolean;
|
|
2597
|
+
bitMap: Record<SubscribeType, number>;
|
|
2598
|
+
allowBits: number[];
|
|
2599
|
+
allowTypes: SubscribeType[];
|
|
2600
|
+
};
|
|
2601
|
+
}>;
|
|
2602
|
+
subscribe(email: string, types: SubscribeType[]): RequestProxyResult<never, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2603
|
+
[key: string]: any;
|
|
2604
|
+
data: never;
|
|
2605
|
+
} : ResponseWrapper extends {
|
|
2606
|
+
data: never;
|
|
2607
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2608
|
+
data: never;
|
|
2609
|
+
}>;
|
|
2610
|
+
unsubscribe(email: string, cancelToken: string): RequestProxyResult<string, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2611
|
+
[key: string]: any;
|
|
2612
|
+
data: string;
|
|
2613
|
+
} : ResponseWrapper extends {
|
|
2614
|
+
data: string;
|
|
2615
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2616
|
+
data: string;
|
|
2617
|
+
}>;
|
|
2618
|
+
}
|
|
2619
|
+
//#endregion
|
|
2620
|
+
//#region controllers/topic.d.ts
|
|
2621
|
+
declare module '@mix-space-lts/api-client' {
|
|
2622
|
+
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
2623
|
+
topic: TopicController<ResponseWrapper>;
|
|
2624
|
+
}
|
|
2625
|
+
}
|
|
2626
|
+
declare class TopicController<ResponseWrapper> extends BaseCrudController<TopicModel, ResponseWrapper> implements IController {
|
|
2627
|
+
protected client: HTTPClient;
|
|
2628
|
+
base: string;
|
|
2629
|
+
name: string;
|
|
2630
|
+
constructor(client: HTTPClient);
|
|
2631
|
+
get proxy(): IRequestHandler<ResponseWrapper>;
|
|
2632
|
+
getTopicBySlug(slug: string): RequestProxyResult<TopicModel, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
2633
|
+
[key: string]: any;
|
|
2634
|
+
data: TopicModel;
|
|
2635
|
+
} : ResponseWrapper extends {
|
|
2636
|
+
data: TopicModel;
|
|
2637
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
2638
|
+
data: TopicModel;
|
|
2639
|
+
}>;
|
|
2640
|
+
}
|
|
2641
|
+
//#endregion
|
|
2642
|
+
//#region controllers/index.d.ts
|
|
2643
|
+
declare const allControllers: (typeof AckController | typeof ActivityController | typeof AggregateController | typeof AIController | typeof CategoryController | typeof CommentController | typeof LinkController | typeof NoteController | typeof PageController | typeof PostController | typeof ProjectController | typeof RecentlyController | typeof SayController | typeof SearchController | typeof ServerlessController | typeof SnippetController | typeof SubscribeController | typeof TopicController | typeof UserController)[];
|
|
2644
|
+
declare const allControllerNames: readonly ["ai", "ack", "activity", "aggregate", "category", "comment", "link", "note", "page", "post", "project", "topic", "recently", "say", "search", "snippet", "serverless", "subscribe", "owner", "friend", "shorthand"];
|
|
2645
|
+
//#endregion
|
|
2646
|
+
//#region utils/camelcase-keys.d.ts
|
|
2647
|
+
/**
|
|
2648
|
+
* A simple camelCase function that only handles strings, but not handling symbol, date, or other complex case.
|
|
2649
|
+
* If you need to handle more complex cases, please use camelcase-keys package.
|
|
2650
|
+
*/
|
|
2651
|
+
declare const camelcaseKeys: <T = any>(obj: any) => T;
|
|
2652
|
+
//#endregion
|
|
2653
|
+
export { AIController, AIDeepReadingModel, AISummaryModel, AISummaryStreamEvent, AITranslationModel, AITranslationStreamEvent, AcademicMetadata, AckController, ActivityController, ActivityPresence, AdminExtraModel, AggregateAIConfig, AggregateController, AggregateRoot, AggregateRootWithTheme, AggregateStat, AggregateTop, AggregateTopNote, AggregateTopPost, AlgoliaSearchOptionsModel, AnonymousCommentDto, AuthUser, BackupOptionsModel, BaiduSearchOptionsModel, BaseCommentIndexModel, BaseModel, BetterAuthSession, BetterAuthSessionResult, BetterAuthSignInResult, BetterAuthUser, BetterAuthUserRole, BingSearchOptionsModel, BookMetadata, CategoryController, CategoryEntries, CategoryModel, CategoryType, CategoryWithChildrenModel, CheckLoggedResult, CodeMetadata, CollectionRefTypes, CommentController, CommentDto, CommentModel, CommentOptionsModel, CommentRef, CommentReplyWindow, CommentState, CommentThreadItem, CommentThreadReplies, Coordinate, Count, EnumPageType, GithubMetadata, type HTTPClient, IConfig, IConfigKeys, type IRequestAdapter, Image, LastYearPublication, LatestCombinedItem, LatestData, LatestNoteItem, LatestPostItem, LinkController, LinkMetadata, LinkModel, LinkState, LinkType, MailOptionsModel, MediaMetadata, ModelWithLiked, ModelWithTranslation, MusicMetadata, NoteController, type NoteMiddleListOptions, NoteModel, type NoteTimelineItem, type NoteTopicListItem, type NoteTopicListOptions, NoteWrappedPayload, NoteWrappedWithLikedAndTranslationPayload, NoteWrappedWithLikedPayload, OwnerAllowLoginResult, OwnerSessionResult, PageController, PageModel, Pager, PaginateResult, PostController, type PostListItem, type PostListOptions, PostModel, ProjectController, ProjectModel, ReaderCommentDto, ReaderModel, RecentActivities, RecentComment, RecentLike, RecentNote, RecentPost, RecentRecent, RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, RecentlyController, RecentlyMetadata, RecentlyModel, RecentlyRefType, RecentlyRefTypes, RecentlyTypeEnum, RequestError, RoomOmittedNote, RoomOmittedPage, RoomOmittedPost, RoomsData, SayController, SayModel, SearchController, SeoOptionModel, ServerlessController, SnippetController, SnippetModel, SnippetType, SubscribeAllBit, SubscribeController, SubscribeNoteCreateBit, SubscribePostCreateBit, SubscribeRecentCreateBit, SubscribeSayCreateBit, SubscribeType, SubscribeTypeToBitMap, TLogin, TagModel, TextBaseModel, TextBaseModelLexical, TextBaseModelMarkdown, ThirdPartyServiceIntegrationModel, TimelineData, TimelineType, TopicController, TopicModel, TranslationMeta, Url, UrlOptionModel, UserController, UserModel, allControllerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
|