@mx-space/api-client 1.21.2 → 2.1.0

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/index.d.mts CHANGED
@@ -165,12 +165,23 @@ interface BaseCommentIndexModel extends BaseModel {
165
165
  commentsIndex?: number;
166
166
  allowComment: boolean;
167
167
  }
168
- interface TextBaseModel extends BaseCommentIndexModel {
168
+ interface TextBaseModelMarkdown extends BaseCommentIndexModel {
169
169
  title: string;
170
170
  text: string;
171
+ contentFormat?: 'markdown';
172
+ content?: undefined;
171
173
  images?: Image[];
172
174
  modified: string | null;
173
175
  }
176
+ interface TextBaseModelLexical extends BaseCommentIndexModel {
177
+ title: string;
178
+ text?: string;
179
+ contentFormat: 'lexical';
180
+ content: string;
181
+ images?: Image[];
182
+ modified: string | null;
183
+ }
184
+ type TextBaseModel = TextBaseModelMarkdown | TextBaseModelLexical;
174
185
  type ModelWithLiked<T> = T & {
175
186
  liked: boolean;
176
187
  };
@@ -186,13 +197,11 @@ type ModelWithTranslation<T> = T & {
186
197
  };
187
198
  //#endregion
188
199
  //#region models/post.d.ts
189
- interface PostModel extends TextBaseModel {
200
+ type PostModel = TextBaseModel & {
190
201
  summary?: string | null;
191
202
  copyright: boolean;
192
203
  tags: string[];
193
204
  count: Count;
194
- text: string;
195
- title: string;
196
205
  slug: string;
197
206
  categoryId: string;
198
207
  images: Image[];
@@ -200,7 +209,7 @@ interface PostModel extends TextBaseModel {
200
209
  pin?: string | null;
201
210
  pinOrder?: number;
202
211
  related?: Pick<PostModel, 'id' | 'category' | 'categoryId' | 'created' | 'modified' | 'title' | 'slug' | 'summary'>[];
203
- }
212
+ };
204
213
  //#endregion
205
214
  //#region models/category.d.ts
206
215
  declare enum CategoryType {
@@ -353,7 +362,7 @@ interface TopicModel extends BaseModel {
353
362
  }
354
363
  //#endregion
355
364
  //#region models/note.d.ts
356
- interface NoteModel extends TextBaseModel {
365
+ type NoteModel = TextBaseModel & {
357
366
  isPublished: boolean;
358
367
  count: {
359
368
  read: number;
@@ -369,7 +378,7 @@ interface NoteModel extends TextBaseModel {
369
378
  coordinates?: Coordinate;
370
379
  topic?: TopicModel;
371
380
  topicId?: string;
372
- }
381
+ };
373
382
  interface Coordinate {
374
383
  latitude: number;
375
384
  longitude: number;
@@ -396,14 +405,14 @@ declare enum EnumPageType {
396
405
  'html' = "html",
397
406
  'frame' = "frame"
398
407
  }
399
- interface PageModel extends TextBaseModel {
408
+ type PageModel = TextBaseModel & {
400
409
  created: string;
401
410
  slug: string;
402
411
  subtitle?: string;
403
412
  order?: number;
404
413
  type?: EnumPageType;
405
414
  options?: object;
406
- }
415
+ };
407
416
  //#endregion
408
417
  //#region models/say.d.ts
409
418
  interface SayModel extends BaseModel {
@@ -425,15 +434,25 @@ declare class UrlOptionModel {
425
434
  serverUrl: string;
426
435
  wsUrl: string;
427
436
  }
428
- declare class MailOptionModel {
429
- port: number;
430
- host: string;
437
+ declare class SmtpOptionsModel {
438
+ port?: number;
439
+ host?: string;
440
+ secure?: boolean;
441
+ }
442
+ declare class SmtpConfigModel {
443
+ user?: string;
444
+ pass?: string;
445
+ options?: SmtpOptionsModel;
446
+ }
447
+ declare class ResendConfigModel {
448
+ apiKey?: string;
431
449
  }
432
450
  declare class MailOptionsModel {
433
451
  enable: boolean;
434
- user: string;
435
- pass: string;
436
- options?: MailOptionModel;
452
+ provider?: 'smtp' | 'resend';
453
+ from?: string;
454
+ smtp?: SmtpConfigModel;
455
+ resend?: ResendConfigModel;
437
456
  }
438
457
  declare class CommentOptionsModel {
439
458
  antiSpam: boolean;
@@ -471,6 +490,9 @@ declare class AdminExtraModel {
471
490
  */
472
491
  enableAdminProxy?: boolean;
473
492
  }
493
+ declare class ThirdPartyServiceIntegrationModel {
494
+ githubToken?: string;
495
+ }
474
496
  interface IConfig {
475
497
  seo: SeoOptionModel;
476
498
  url: UrlOptionModel;
@@ -480,6 +502,7 @@ interface IConfig {
480
502
  baiduSearchOptions: BaiduSearchOptionsModel;
481
503
  algoliaSearchOptions: AlgoliaSearchOptionsModel;
482
504
  adminExtra: AdminExtraModel;
505
+ thirdPartyServiceIntegration: ThirdPartyServiceIntegrationModel;
483
506
  }
484
507
  declare type IConfigKeys = keyof IConfig;
485
508
  //#endregion
@@ -504,6 +527,51 @@ type TLogin = {
504
527
  lastLoginTime: null | string;
505
528
  lastLoginIp?: null | string;
506
529
  } & Pick<UserModel, 'name' | 'username' | 'created' | 'url' | 'mail' | 'avatar' | 'id'>;
530
+ type BetterAuthUserRole = 'owner' | 'reader';
531
+ interface BetterAuthUser {
532
+ id: string;
533
+ email?: string | null;
534
+ name?: string | null;
535
+ image?: string | null;
536
+ role?: BetterAuthUserRole;
537
+ handle?: string | null;
538
+ username?: string | null;
539
+ displayUsername?: string | null;
540
+ [key: string]: unknown;
541
+ }
542
+ interface BetterAuthSession {
543
+ id?: string;
544
+ token: string;
545
+ userId: string;
546
+ expiresAt: string;
547
+ createdAt: string;
548
+ updatedAt: string;
549
+ ipAddress?: string | null;
550
+ userAgent?: string | null;
551
+ provider?: string | null;
552
+ [key: string]: unknown;
553
+ }
554
+ interface BetterAuthSignInResult {
555
+ token: string;
556
+ user: BetterAuthUser;
557
+ }
558
+ interface BetterAuthSessionResult {
559
+ session: BetterAuthSession;
560
+ user: BetterAuthUser;
561
+ }
562
+ interface OwnerSessionResult extends BetterAuthUser {
563
+ provider?: string;
564
+ providerAccountId?: string;
565
+ session?: BetterAuthSession;
566
+ }
567
+ type CheckLoggedResult = {
568
+ ok: number;
569
+ isGuest: boolean;
570
+ };
571
+ type OwnerAllowLoginResult = {
572
+ password: boolean;
573
+ passkey: boolean;
574
+ } & Record<string, boolean>;
507
575
  //#endregion
508
576
  //#region models/aggregate.d.ts
509
577
  interface AggregateAIConfig {
@@ -581,6 +649,21 @@ interface AISummaryModel {
581
649
  refId: string;
582
650
  lang: string;
583
651
  }
652
+ interface AITranslationModel {
653
+ id: string;
654
+ created: string;
655
+ hash: string;
656
+ refId: string;
657
+ refType: string;
658
+ lang: string;
659
+ sourceLang: string;
660
+ title: string;
661
+ text: string;
662
+ summary?: string;
663
+ tags?: string[];
664
+ aiModel?: string;
665
+ aiProvider?: string;
666
+ }
584
667
  interface AIDeepReadingModel {
585
668
  id: string;
586
669
  hash: string;
@@ -589,6 +672,32 @@ interface AIDeepReadingModel {
589
672
  criticalAnalysis: string;
590
673
  content: string;
591
674
  }
675
+ /**
676
+ * SSE Stream Event Types
677
+ *
678
+ * Note: All data fields are transmitted as strings over SSE.
679
+ * Objects are JSON.stringify'd before sending.
680
+ */
681
+ type AISummaryStreamEvent = {
682
+ type: 'token';
683
+ data: string;
684
+ } | {
685
+ type: 'done';
686
+ data: undefined;
687
+ } | {
688
+ type: 'error';
689
+ data: string;
690
+ };
691
+ type AITranslationStreamEvent = {
692
+ type: 'token';
693
+ data: string;
694
+ } | {
695
+ type: 'done';
696
+ data: undefined;
697
+ } | {
698
+ type: 'error';
699
+ data: string;
700
+ };
592
701
  //#endregion
593
702
  //#region models/auth.d.ts
594
703
  interface AuthUser {
@@ -723,7 +832,7 @@ interface SnippetModel<T = unknown> extends BaseModel {
723
832
  }
724
833
  //#endregion
725
834
  //#region ../../apps/core/src/modules/subscribe/subscribe.constant.d.ts
726
- declare const SubscribePostCreateBit: number;
835
+ declare const SubscribePostCreateBit = 1;
727
836
  declare const SubscribeNoteCreateBit: number;
728
837
  declare const SubscribeSayCreateBit: number;
729
838
  declare const SubscribeRecentCreateBit: number;
@@ -1084,6 +1193,214 @@ declare class AIController<ResponseWrapper> implements IController {
1084
1193
  };
1085
1194
  $serialized: AIDeepReadingModel;
1086
1195
  }>;
1196
+ /**
1197
+ * Get translation for an article
1198
+ * @support core >= 9.4.0
1199
+ */
1200
+ getTranslation({
1201
+ articleId,
1202
+ lang
1203
+ }: {
1204
+ articleId: string;
1205
+ lang: string;
1206
+ }): Promise<AITranslationModel & {
1207
+ $raw: ResponseWrapper extends {
1208
+ data: infer T;
1209
+ } ? ResponseWrapper : ResponseWrapper extends unknown ? {
1210
+ [i: string]: any;
1211
+ data: (ResponseWrapper extends unknown ? {
1212
+ [key: string]: any;
1213
+ data: AITranslationModel;
1214
+ } : ResponseWrapper extends {
1215
+ data: AITranslationModel;
1216
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1217
+ data: AITranslationModel;
1218
+ }) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
1219
+ [key: string]: any;
1220
+ data: AITranslationModel;
1221
+ } : ResponseWrapper extends {
1222
+ data: AITranslationModel;
1223
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1224
+ data: AITranslationModel;
1225
+ }) ? T_1 extends unknown ? {
1226
+ id: string;
1227
+ created: string;
1228
+ hash: string;
1229
+ ref_id: string;
1230
+ ref_type: string;
1231
+ lang: string;
1232
+ source_lang: string;
1233
+ title: string;
1234
+ text: string;
1235
+ summary?: string | undefined;
1236
+ tags?: string[] | undefined;
1237
+ ai_model?: string | undefined;
1238
+ ai_provider?: string | undefined;
1239
+ } : T_1 : never : never;
1240
+ } : ResponseWrapper;
1241
+ $request: {
1242
+ path: string;
1243
+ method: string;
1244
+ [k: string]: string;
1245
+ };
1246
+ $serialized: AITranslationModel;
1247
+ }>;
1248
+ /**
1249
+ * Get available translation languages for an article
1250
+ * @support core >= 9.4.0
1251
+ */
1252
+ getAvailableLanguages(articleId: string): Promise<string[] & {
1253
+ $raw: ResponseWrapper extends {
1254
+ data: infer T;
1255
+ } ? ResponseWrapper : ResponseWrapper extends unknown ? {
1256
+ [i: string]: any;
1257
+ data: (ResponseWrapper extends unknown ? {
1258
+ [key: string]: any;
1259
+ data: string[];
1260
+ } : ResponseWrapper extends {
1261
+ data: string[];
1262
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1263
+ data: string[];
1264
+ }) extends infer T_1 ? T_1 extends (ResponseWrapper extends unknown ? {
1265
+ [key: string]: any;
1266
+ data: string[];
1267
+ } : ResponseWrapper extends {
1268
+ data: string[];
1269
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1270
+ data: string[];
1271
+ }) ? T_1 extends unknown ? {
1272
+ length: number;
1273
+ to_string: () => string;
1274
+ to_locale_string: {
1275
+ (): string;
1276
+ (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string;
1277
+ };
1278
+ pop: () => string | undefined;
1279
+ push: (...items: string[]) => number;
1280
+ concat: {
1281
+ (...items: ConcatArray<string>[]): string[];
1282
+ (...items: (string | ConcatArray<string>)[]): string[];
1283
+ };
1284
+ join: (separator?: string) => string;
1285
+ reverse: () => string[];
1286
+ shift: () => string | undefined;
1287
+ slice: (start?: number, end?: number) => string[];
1288
+ sort: (compareFn?: ((a: string, b: string) => number) | undefined) => string[];
1289
+ splice: {
1290
+ (start: number, deleteCount?: number): string[];
1291
+ (start: number, deleteCount: number, ...items: string[]): string[];
1292
+ };
1293
+ unshift: (...items: string[]) => number;
1294
+ index_of: (searchElement: string, fromIndex?: number) => number;
1295
+ last_index_of: (searchElement: string, fromIndex?: number) => number;
1296
+ every: {
1297
+ <S extends string>(predicate: (value: string, index: number, array: string[]) => value is S, thisArg?: any): this is S[];
1298
+ (predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): boolean;
1299
+ };
1300
+ some: (predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any) => boolean;
1301
+ for_each: (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void;
1302
+ map: <U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[];
1303
+ filter: {
1304
+ <S extends string>(predicate: (value: string, index: number, array: string[]) => value is S, thisArg?: any): S[];
1305
+ (predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): string[];
1306
+ };
1307
+ reduce: {
1308
+ (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string;
1309
+ (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string;
1310
+ <U>(callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U;
1311
+ };
1312
+ reduce_right: {
1313
+ (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string;
1314
+ (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string;
1315
+ <U>(callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U;
1316
+ };
1317
+ find: {
1318
+ <S extends string>(predicate: (value: string, index: number, obj: string[]) => value is S, thisArg?: any): S | undefined;
1319
+ (predicate: (value: string, index: number, obj: string[]) => unknown, thisArg?: any): string | undefined;
1320
+ };
1321
+ find_index: (predicate: (value: string, index: number, obj: string[]) => unknown, thisArg?: any) => number;
1322
+ fill: (value: string, start?: number, end?: number) => string[];
1323
+ copy_within: (target: number, start: number, end?: number) => string[];
1324
+ entries: () => ArrayIterator<[number, string]>;
1325
+ keys: () => ArrayIterator<number>;
1326
+ values: () => ArrayIterator<string>;
1327
+ includes: (searchElement: string, fromIndex?: number) => boolean;
1328
+ flat_map: <U, This = undefined>(callback: (this: This, value: string, index: number, array: string[]) => U | readonly U[], thisArg?: This | undefined) => U[];
1329
+ flat: <A, D extends number = 1>(this: A, depth?: D | undefined) => FlatArray<A, D>[];
1330
+ at: (index: number) => string | undefined;
1331
+ find_last: {
1332
+ <S extends string>(predicate: (value: string, index: number, array: string[]) => value is S, thisArg?: any): S | undefined;
1333
+ (predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): string | undefined;
1334
+ };
1335
+ find_last_index: (predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any) => number;
1336
+ to_reversed: () => string[];
1337
+ to_sorted: (compareFn?: ((a: string, b: string) => number) | undefined) => string[];
1338
+ to_spliced: {
1339
+ (start: number, deleteCount: number, ...items: string[]): string[];
1340
+ (start: number, deleteCount?: number): string[];
1341
+ };
1342
+ with: (index: number, value: string) => string[];
1343
+ } : T_1 : never : never;
1344
+ } : ResponseWrapper;
1345
+ $request: {
1346
+ path: string;
1347
+ method: string;
1348
+ [k: string]: string;
1349
+ };
1350
+ $serialized: string[];
1351
+ }>;
1352
+ /**
1353
+ * Get URL for streaming summary generation (SSE)
1354
+ *
1355
+ * @see AISummaryStreamEvent for event types
1356
+ * @support core >= 9.4.0
1357
+ */
1358
+ getSummaryGenerateUrl({
1359
+ articleId,
1360
+ lang
1361
+ }: {
1362
+ articleId: string;
1363
+ lang?: string;
1364
+ }): string;
1365
+ /**
1366
+ * Stream summary generation using fetch
1367
+ *
1368
+ * @see AISummaryStreamEvent for event types
1369
+ * @support core >= 9.4.0
1370
+ */
1371
+ streamSummaryGenerate({
1372
+ articleId,
1373
+ lang
1374
+ }: {
1375
+ articleId: string;
1376
+ lang?: string;
1377
+ }, fetchOptions?: RequestInit): Promise<Response>;
1378
+ /**
1379
+ * Get URL for streaming translation generation (SSE)
1380
+ *
1381
+ * @see AITranslationStreamEvent for event types
1382
+ * @support core >= 9.4.0
1383
+ */
1384
+ getTranslationGenerateUrl({
1385
+ articleId,
1386
+ lang
1387
+ }: {
1388
+ articleId: string;
1389
+ lang: string;
1390
+ }): string;
1391
+ /**
1392
+ * Stream translation generation using fetch
1393
+ *
1394
+ * @see AITranslationStreamEvent for event types
1395
+ * @support core >= 9.4.0
1396
+ */
1397
+ streamTranslationGenerate({
1398
+ articleId,
1399
+ lang
1400
+ }: {
1401
+ articleId: string;
1402
+ lang: string;
1403
+ }, fetchOptions?: RequestInit): Promise<Response>;
1087
1404
  }
1088
1405
  //#endregion
1089
1406
  //#region controllers/category.d.ts
@@ -1134,7 +1451,7 @@ declare class CategoryController<ResponseWrapper> implements IController {
1134
1451
  name: string;
1135
1452
  created: string;
1136
1453
  id: string;
1137
- children: Pick<PostModel, "id" | "created" | "title" | "slug" | "modified">[];
1454
+ children: Pick<PostModel, "id" | "title" | "slug" | "modified" | "created">[];
1138
1455
  } : T_1 : never : never;
1139
1456
  } : ResponseWrapper;
1140
1457
  $request: {
@@ -1186,7 +1503,7 @@ declare class CategoryController<ResponseWrapper> implements IController {
1186
1503
  };
1187
1504
  }) ? T_1 extends unknown ? {
1188
1505
  tag: string;
1189
- data: Pick<PostModel, "category" | "id" | "created" | "title" | "slug">[];
1506
+ data: Pick<PostModel, "category" | "id" | "title" | "slug" | "created">[];
1190
1507
  } : T_1 : never : never;
1191
1508
  } : ResponseWrapper;
1192
1509
  $request: {
@@ -1376,6 +1693,7 @@ type NoteByNidOptions = {
1376
1693
  password?: string;
1377
1694
  single?: boolean;
1378
1695
  lang?: string;
1696
+ prefer?: 'lexical';
1379
1697
  };
1380
1698
  type NoteMiddleListOptions = {
1381
1699
  lang?: string;
@@ -1478,6 +1796,173 @@ declare class NoteController<ResponseWrapper> implements IController {
1478
1796
  }>;
1479
1797
  }
1480
1798
  //#endregion
1799
+ //#region controllers/owner.d.ts
1800
+ declare module '@mx-space/api-client' {
1801
+ interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
1802
+ owner: UserController<ResponseWrapper>;
1803
+ }
1804
+ }
1805
+ declare class UserController<ResponseWrapper> implements IController {
1806
+ private readonly client;
1807
+ constructor(client: HTTPClient);
1808
+ base: string;
1809
+ name: string[];
1810
+ get proxy(): IRequestHandler<ResponseWrapper>;
1811
+ private get authProxy();
1812
+ private normalizeToken;
1813
+ /**
1814
+ * @deprecated Use `getOwnerInfo()` instead.
1815
+ */
1816
+ getMasterInfo(): RequestProxyResult<UserModel, ResponseWrapper, ResponseWrapper extends unknown ? {
1817
+ [key: string]: any;
1818
+ data: UserModel;
1819
+ } : ResponseWrapper extends {
1820
+ data: UserModel;
1821
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1822
+ data: UserModel;
1823
+ }>;
1824
+ getOwnerInfo(): RequestProxyResult<UserModel, ResponseWrapper, ResponseWrapper extends unknown ? {
1825
+ [key: string]: any;
1826
+ data: UserModel;
1827
+ } : ResponseWrapper extends {
1828
+ data: UserModel;
1829
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1830
+ data: UserModel;
1831
+ }>;
1832
+ login(username: string, password: string, options?: {
1833
+ callbackURL?: string;
1834
+ rememberMe?: boolean;
1835
+ }): RequestProxyResult<BetterAuthSignInResult, ResponseWrapper, ResponseWrapper extends unknown ? {
1836
+ [key: string]: any;
1837
+ data: BetterAuthSignInResult;
1838
+ } : ResponseWrapper extends {
1839
+ data: BetterAuthSignInResult;
1840
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1841
+ data: BetterAuthSignInResult;
1842
+ }>;
1843
+ logout(): RequestProxyResult<{
1844
+ success: boolean;
1845
+ }, ResponseWrapper, ResponseWrapper extends unknown ? {
1846
+ [key: string]: any;
1847
+ data: {
1848
+ success: boolean;
1849
+ };
1850
+ } : ResponseWrapper extends {
1851
+ data: {
1852
+ success: boolean;
1853
+ };
1854
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1855
+ data: {
1856
+ success: boolean;
1857
+ };
1858
+ }>;
1859
+ /**
1860
+ * Better Auth raw session (`/auth/get-session`).
1861
+ */
1862
+ getAuthSession(options?: {
1863
+ disableCookieCache?: boolean;
1864
+ disableRefresh?: boolean;
1865
+ }): RequestProxyResult<BetterAuthSessionResult | null, ResponseWrapper, ResponseWrapper extends unknown ? {
1866
+ [key: string]: any;
1867
+ data: BetterAuthSessionResult | null;
1868
+ } : ResponseWrapper extends {
1869
+ data: BetterAuthSessionResult | null;
1870
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1871
+ data: BetterAuthSessionResult | null;
1872
+ }>;
1873
+ /**
1874
+ * Core session summary (`/auth/session`).
1875
+ */
1876
+ getSession(): RequestProxyResult<OwnerSessionResult | null, ResponseWrapper, ResponseWrapper extends unknown ? {
1877
+ [key: string]: any;
1878
+ data: OwnerSessionResult | null;
1879
+ } : ResponseWrapper extends {
1880
+ data: OwnerSessionResult | null;
1881
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1882
+ data: OwnerSessionResult | null;
1883
+ }>;
1884
+ getProviders(): RequestProxyResult<string[], ResponseWrapper, ResponseWrapper extends unknown ? {
1885
+ [key: string]: any;
1886
+ data: string[];
1887
+ } : ResponseWrapper extends {
1888
+ data: string[];
1889
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1890
+ data: string[];
1891
+ }>;
1892
+ getAllowLoginMethods(): RequestProxyResult<OwnerAllowLoginResult, ResponseWrapper, ResponseWrapper extends unknown ? {
1893
+ [key: string]: any;
1894
+ data: OwnerAllowLoginResult;
1895
+ } : ResponseWrapper extends {
1896
+ data: OwnerAllowLoginResult;
1897
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1898
+ data: OwnerAllowLoginResult;
1899
+ }>;
1900
+ listSessions(): RequestProxyResult<BetterAuthSession[], ResponseWrapper, ResponseWrapper extends unknown ? {
1901
+ [key: string]: any;
1902
+ data: BetterAuthSession[];
1903
+ } : ResponseWrapper extends {
1904
+ data: BetterAuthSession[];
1905
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1906
+ data: BetterAuthSession[];
1907
+ }>;
1908
+ revokeSession(token: string): RequestProxyResult<{
1909
+ status: boolean;
1910
+ }, ResponseWrapper, ResponseWrapper extends unknown ? {
1911
+ [key: string]: any;
1912
+ data: {
1913
+ status: boolean;
1914
+ };
1915
+ } : ResponseWrapper extends {
1916
+ data: {
1917
+ status: boolean;
1918
+ };
1919
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1920
+ data: {
1921
+ status: boolean;
1922
+ };
1923
+ }>;
1924
+ revokeSessions(): RequestProxyResult<{
1925
+ status: boolean;
1926
+ }, ResponseWrapper, ResponseWrapper extends unknown ? {
1927
+ [key: string]: any;
1928
+ data: {
1929
+ status: boolean;
1930
+ };
1931
+ } : ResponseWrapper extends {
1932
+ data: {
1933
+ status: boolean;
1934
+ };
1935
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1936
+ data: {
1937
+ status: boolean;
1938
+ };
1939
+ }>;
1940
+ revokeOtherSessions(): RequestProxyResult<{
1941
+ status: boolean;
1942
+ }, ResponseWrapper, ResponseWrapper extends unknown ? {
1943
+ [key: string]: any;
1944
+ data: {
1945
+ status: boolean;
1946
+ };
1947
+ } : ResponseWrapper extends {
1948
+ data: {
1949
+ status: boolean;
1950
+ };
1951
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1952
+ data: {
1953
+ status: boolean;
1954
+ };
1955
+ }>;
1956
+ checkTokenValid(token?: string): RequestProxyResult<CheckLoggedResult, ResponseWrapper, ResponseWrapper extends unknown ? {
1957
+ [key: string]: any;
1958
+ data: CheckLoggedResult;
1959
+ } : ResponseWrapper extends {
1960
+ data: CheckLoggedResult;
1961
+ } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1962
+ data: CheckLoggedResult;
1963
+ }>;
1964
+ }
1965
+ //#endregion
1481
1966
  //#region controllers/page.d.ts
1482
1967
  declare module '@mx-space/api-client' {
1483
1968
  interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
@@ -1522,7 +2007,9 @@ declare class PageController<ResponseWrapper> implements IController {
1522
2007
  * @param slug 路径
1523
2008
  * @returns
1524
2009
  */
1525
- getBySlug(slug: string): RequestProxyResult<PageModel, ResponseWrapper, ResponseWrapper extends unknown ? {
2010
+ getBySlug(slug: string, options?: {
2011
+ prefer?: 'lexical';
2012
+ }): RequestProxyResult<PageModel, ResponseWrapper, ResponseWrapper extends unknown ? {
1526
2013
  [key: string]: any;
1527
2014
  data: PageModel;
1528
2015
  } : ResponseWrapper extends {
@@ -1580,6 +2067,7 @@ declare class PostController<ResponseWrapper> implements IController {
1580
2067
  */
1581
2068
  getPost(categoryName: string, slug: string, options?: {
1582
2069
  lang?: string;
2070
+ prefer?: 'lexical';
1583
2071
  }): RequestProxyResult<ModelWithLiked<ModelWithTranslation<PostModel>>, ResponseWrapper>;
1584
2072
  /**
1585
2073
  * 根据 ID 查找文章
@@ -1818,11 +2306,11 @@ declare class SearchController<ResponseWrapper> implements IController {
1818
2306
  * @param options
1819
2307
  * @returns
1820
2308
  */
1821
- searchByAlgolia(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & {
2309
+ searchByAlgolia(keyword: string, options?: SearchOption): RequestProxyResult<RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "title" | "slug" | "modified" | "created"> & {
1822
2310
  type: "post";
1823
- }) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
2311
+ }) | (Pick<NoteModel, "id" | "title" | "modified" | "created" | "nid"> & {
1824
2312
  type: "note";
1825
- }) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & {
2313
+ }) | (Pick<PageModel, "id" | "title" | "slug" | "modified" | "created"> & {
1826
2314
  type: "page";
1827
2315
  })> & {
1828
2316
  /**
@@ -1831,11 +2319,11 @@ declare class SearchController<ResponseWrapper> implements IController {
1831
2319
  raw?: any;
1832
2320
  }, ResponseWrapper>, ResponseWrapper, ResponseWrapper extends unknown ? {
1833
2321
  [key: string]: any;
1834
- data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & {
2322
+ data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "title" | "slug" | "modified" | "created"> & {
1835
2323
  type: "post";
1836
- }) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
2324
+ }) | (Pick<NoteModel, "id" | "title" | "modified" | "created" | "nid"> & {
1837
2325
  type: "note";
1838
- }) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & {
2326
+ }) | (Pick<PageModel, "id" | "title" | "slug" | "modified" | "created"> & {
1839
2327
  type: "page";
1840
2328
  })> & {
1841
2329
  /**
@@ -1844,11 +2332,11 @@ declare class SearchController<ResponseWrapper> implements IController {
1844
2332
  raw?: any;
1845
2333
  }, ResponseWrapper>;
1846
2334
  } : ResponseWrapper extends {
1847
- data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & {
2335
+ data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "title" | "slug" | "modified" | "created"> & {
1848
2336
  type: "post";
1849
- }) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
2337
+ }) | (Pick<NoteModel, "id" | "title" | "modified" | "created" | "nid"> & {
1850
2338
  type: "note";
1851
- }) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & {
2339
+ }) | (Pick<PageModel, "id" | "title" | "slug" | "modified" | "created"> & {
1852
2340
  type: "page";
1853
2341
  })> & {
1854
2342
  /**
@@ -1857,11 +2345,11 @@ declare class SearchController<ResponseWrapper> implements IController {
1857
2345
  raw?: any;
1858
2346
  }, ResponseWrapper>;
1859
2347
  } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
1860
- data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "created" | "title" | "slug" | "modified"> & {
2348
+ data: RequestProxyResult<PaginateResult<(Pick<PostModel, "category" | "id" | "title" | "slug" | "modified" | "created"> & {
1861
2349
  type: "post";
1862
- }) | (Pick<NoteModel, "id" | "created" | "title" | "modified" | "nid"> & {
2350
+ }) | (Pick<NoteModel, "id" | "title" | "modified" | "created" | "nid"> & {
1863
2351
  type: "note";
1864
- }) | (Pick<PageModel, "id" | "created" | "title" | "slug" | "modified"> & {
2352
+ }) | (Pick<PageModel, "id" | "title" | "slug" | "modified" | "created"> & {
1865
2353
  type: "page";
1866
2354
  })> & {
1867
2355
  /**
@@ -1999,76 +2487,9 @@ declare class TopicController<ResponseWrapper> extends BaseCrudController<TopicM
1999
2487
  }>;
2000
2488
  }
2001
2489
  //#endregion
2002
- //#region controllers/user.d.ts
2003
- declare module '@mx-space/api-client' {
2004
- interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
2005
- user: UserController<ResponseWrapper>;
2006
- master: UserController<ResponseWrapper>;
2007
- }
2008
- }
2009
- declare class UserController<ResponseWrapper> implements IController {
2010
- private readonly client;
2011
- constructor(client: HTTPClient);
2012
- base: string;
2013
- name: string[];
2014
- get proxy(): IRequestHandler<ResponseWrapper>;
2015
- getMasterInfo(): RequestProxyResult<UserModel, ResponseWrapper, ResponseWrapper extends unknown ? {
2016
- [key: string]: any;
2017
- data: UserModel;
2018
- } : ResponseWrapper extends {
2019
- data: UserModel;
2020
- } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
2021
- data: UserModel;
2022
- }>;
2023
- login(username: string, password: string): RequestProxyResult<TLogin, ResponseWrapper, ResponseWrapper extends unknown ? {
2024
- [key: string]: any;
2025
- data: TLogin;
2026
- } : ResponseWrapper extends {
2027
- data: TLogin;
2028
- } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
2029
- data: TLogin;
2030
- }>;
2031
- loginWithToken(token?: string): RequestProxyResult<{
2032
- token: string;
2033
- }, ResponseWrapper, ResponseWrapper extends unknown ? {
2034
- [key: string]: any;
2035
- data: {
2036
- token: string;
2037
- };
2038
- } : ResponseWrapper extends {
2039
- data: {
2040
- token: string;
2041
- };
2042
- } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
2043
- data: {
2044
- token: string;
2045
- };
2046
- }>;
2047
- checkTokenValid(token: string): RequestProxyResult<{
2048
- ok: number;
2049
- isGuest: boolean;
2050
- }, ResponseWrapper, ResponseWrapper extends unknown ? {
2051
- [key: string]: any;
2052
- data: {
2053
- ok: number;
2054
- isGuest: boolean;
2055
- };
2056
- } : ResponseWrapper extends {
2057
- data: {
2058
- ok: number;
2059
- isGuest: boolean;
2060
- };
2061
- } ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
2062
- data: {
2063
- ok: number;
2064
- isGuest: boolean;
2065
- };
2066
- }>;
2067
- }
2068
- //#endregion
2069
2490
  //#region controllers/index.d.ts
2070
2491
  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)[];
2071
- declare const allControllerNames: readonly ["ai", "ack", "activity", "aggregate", "category", "comment", "link", "note", "page", "post", "project", "topic", "recently", "say", "search", "snippet", "serverless", "subscribe", "user", "friend", "master", "shorthand"];
2492
+ 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"];
2072
2493
  //#endregion
2073
2494
  //#region utils/camelcase-keys.d.ts
2074
2495
  /**
@@ -2077,4 +2498,4 @@ declare const allControllerNames: readonly ["ai", "ack", "activity", "aggregate"
2077
2498
  */
2078
2499
  declare const camelcaseKeys: <T = any>(obj: any) => T;
2079
2500
  //#endregion
2080
- export { AIController, AIDeepReadingModel, AISummaryModel, AckController, ActivityController, ActivityPresence, AdminExtraModel, AggregateAIConfig, AggregateController, AggregateRoot, AggregateRootWithTheme, AggregateStat, AggregateTop, AggregateTopNote, AggregateTopPost, AlgoliaSearchOptionsModel, AuthUser, BackupOptionsModel, BaiduSearchOptionsModel, BaseCommentIndexModel, BaseModel, BingSearchOptionsModel, CategoryController, CategoryEntries, CategoryModel, CategoryType, CategoryWithChildrenModel, CollectionRefTypes, CommentController, CommentDto, CommentModel, CommentOptionsModel, CommentRef, CommentState, Coordinate, Count, EnumPageType, type HTTPClient, IConfig, IConfigKeys, type IRequestAdapter, Image, LastYearPublication, LinkController, LinkModel, LinkState, LinkType, MailOptionsModel, ModelWithLiked, ModelWithTranslation, NoteController, type NoteMiddleListOptions, NoteModel, type NoteTimelineItem, type NoteTopicListItem, type NoteTopicListOptions, NoteWrappedPayload, NoteWrappedWithLikedAndTranslationPayload, NoteWrappedWithLikedPayload, PageController, PageModel, Pager, PaginateResult, PostController, type PostListItem, type PostListOptions, PostModel, ProjectController, ProjectModel, ReaderModel, RecentActivities, RecentComment, RecentLike, RecentNote, RecentPost, RecentRecent, RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, RecentlyController, RecentlyModel, RecentlyRefType, RecentlyRefTypes, RequestError, RoomOmittedNote, RoomOmittedPage, RoomOmittedPost, RoomsData, SayController, SayModel, SearchController, SeoOptionModel, ServerlessController, SnippetController, SnippetModel, SnippetType, SubscribeAllBit, SubscribeController, SubscribeNoteCreateBit, SubscribePostCreateBit, SubscribeRecentCreateBit, SubscribeSayCreateBit, SubscribeType, SubscribeTypeToBitMap, TLogin, TagModel, TextBaseModel, TimelineData, TimelineType, TopicController, TopicModel, TranslationMeta, Url, UrlOptionModel, UserController, UserModel, allControllerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
2501
+ export { AIController, AIDeepReadingModel, AISummaryModel, AISummaryStreamEvent, AITranslationModel, AITranslationStreamEvent, AckController, ActivityController, ActivityPresence, AdminExtraModel, AggregateAIConfig, AggregateController, AggregateRoot, AggregateRootWithTheme, AggregateStat, AggregateTop, AggregateTopNote, AggregateTopPost, AlgoliaSearchOptionsModel, AuthUser, BackupOptionsModel, BaiduSearchOptionsModel, BaseCommentIndexModel, BaseModel, BetterAuthSession, BetterAuthSessionResult, BetterAuthSignInResult, BetterAuthUser, BetterAuthUserRole, BingSearchOptionsModel, CategoryController, CategoryEntries, CategoryModel, CategoryType, CategoryWithChildrenModel, CheckLoggedResult, CollectionRefTypes, CommentController, CommentDto, CommentModel, CommentOptionsModel, CommentRef, CommentState, Coordinate, Count, EnumPageType, type HTTPClient, IConfig, IConfigKeys, type IRequestAdapter, Image, LastYearPublication, LinkController, LinkModel, LinkState, LinkType, MailOptionsModel, ModelWithLiked, ModelWithTranslation, 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, ReaderModel, RecentActivities, RecentComment, RecentLike, RecentNote, RecentPost, RecentRecent, RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, RecentlyController, RecentlyModel, RecentlyRefType, RecentlyRefTypes, RequestError, RoomOmittedNote, RoomOmittedPage, RoomOmittedPost, RoomsData, SayController, SayModel, SearchController, SeoOptionModel, ServerlessController, SnippetController, SnippetModel, SnippetType, SubscribeAllBit, SubscribeController, SubscribeNoteCreateBit, SubscribePostCreateBit, SubscribeRecentCreateBit, SubscribeSayCreateBit, SubscribeType, SubscribeTypeToBitMap, TLogin, TagModel, TextBaseModel, ThirdPartyServiceIntegrationModel, TimelineData, TimelineType, TopicController, TopicModel, TranslationMeta, Url, UrlOptionModel, UserController, UserModel, allControllerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };