artalk 2.8.6 → 2.9.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.
Files changed (44) hide show
  1. package/dist/Artalk.cjs +2 -2
  2. package/dist/Artalk.cjs.map +1 -1
  3. package/dist/Artalk.css +1 -1
  4. package/dist/Artalk.iife.js +2 -2
  5. package/dist/Artalk.iife.js.map +1 -1
  6. package/dist/Artalk.js +2 -2
  7. package/dist/Artalk.js.map +1 -1
  8. package/dist/Artalk.mjs +953 -1421
  9. package/dist/Artalk.mjs.map +1 -1
  10. package/dist/ArtalkLite.cjs +2 -2
  11. package/dist/ArtalkLite.cjs.map +1 -1
  12. package/dist/ArtalkLite.css +1 -1
  13. package/dist/ArtalkLite.iife.js +2 -2
  14. package/dist/ArtalkLite.iife.js.map +1 -1
  15. package/dist/ArtalkLite.js +2 -2
  16. package/dist/ArtalkLite.js.map +1 -1
  17. package/dist/ArtalkLite.mjs +641 -1148
  18. package/dist/ArtalkLite.mjs.map +1 -1
  19. package/dist/i18n/fr.cjs +1 -0
  20. package/dist/i18n/fr.js +1 -0
  21. package/dist/i18n/fr.mjs +123 -0
  22. package/dist/i18n/{jp.cjs → ja.cjs} +1 -1
  23. package/dist/i18n/ja.d.cts +3 -0
  24. package/dist/i18n/ja.d.ts +3 -0
  25. package/dist/i18n/{jp.js → ja.js} +1 -1
  26. package/dist/i18n/{jp.mjs → ja.mjs} +12 -9
  27. package/dist/i18n/ko.cjs +1 -0
  28. package/dist/i18n/ko.d.cts +3 -0
  29. package/dist/i18n/ko.d.ts +3 -0
  30. package/dist/i18n/ko.js +1 -0
  31. package/dist/i18n/ko.mjs +123 -0
  32. package/dist/i18n/ru.cjs +1 -0
  33. package/dist/i18n/ru.d.cts +3 -0
  34. package/dist/i18n/ru.d.ts +3 -0
  35. package/dist/i18n/ru.js +1 -0
  36. package/dist/i18n/ru.mjs +123 -0
  37. package/dist/i18n/zh-TW.cjs +1 -1
  38. package/dist/i18n/zh-TW.js +1 -1
  39. package/dist/i18n/zh-TW.mjs +6 -3
  40. package/dist/main.d.cts +157 -94
  41. package/dist/main.d.ts +157 -94
  42. package/package.json +56 -24
  43. /package/dist/i18n/{jp.d.cts → fr.d.cts} +0 -0
  44. /package/dist/i18n/{jp.d.ts → fr.d.ts} +0 -0
package/dist/main.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { marked } from 'marked';
1
+ import { Marked } from 'marked';
2
2
  import { MarkedOptions } from 'marked';
3
3
 
4
4
  /**
@@ -9,7 +9,7 @@ declare class ActionBtn {
9
9
  $el: HTMLElement;
10
10
  isLoading: boolean;
11
11
  msgRecTimer?: number;
12
- msgRecTimerFunc?: Function;
12
+ msgRecTimerFunc?: () => void;
13
13
  get isMessaging(): boolean;
14
14
  isConfirming: boolean;
15
15
  confirmRecTimer?: number;
@@ -20,7 +20,7 @@ declare class ActionBtn {
20
20
  /** 获取按钮文字(动态/静态) */
21
21
  private getText;
22
22
  /** 设置点击事件 */
23
- setClick(func: Function): void;
23
+ setClick(func: () => void): void;
24
24
  /** 文字刷新(动态/静态) */
25
25
  updateText(text?: (() => string) | string): void;
26
26
  /** 设置加载状态 */
@@ -32,7 +32,7 @@ declare class ActionBtn {
32
32
  /** 成功消息 */
33
33
  setSuccess(text: string): void;
34
34
  /** 设置消息 */
35
- setMsg(text: string, className?: string, duringTime?: number, after?: Function): void;
35
+ setMsg(text: string, className?: string, duringTime?: number, after?: () => void): void;
36
36
  /** 设置消息复原操作定时器 */
37
37
  private setMsgRecTimer;
38
38
  /** 立刻触发器复原定时器 */
@@ -95,10 +95,10 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
95
95
  })` Internal Server Error
96
96
  */
97
97
  loginByEmail: (data: HandlerRequestAuthEmailLogin, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserLogin, HandlerMap & {
98
- msg?: string | undefined;
98
+ msg?: string;
99
99
  }>>;
100
100
  /**
101
- * @description Register by email and verify code (if user exists, will update user, like forget password. Need send email verify code first)
101
+ * @description Register by email and verify code (if user exists, will update user, like forget or change password. Need send email verify code first)
102
102
  *
103
103
  * @tags Auth
104
104
  * @name RegisterByEmail
@@ -115,7 +115,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
115
115
  })` Internal Server Error
116
116
  */
117
117
  registerByEmail: (data: HandlerRequestAuthEmailRegister, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserLogin, HandlerMap & {
118
- msg?: string | undefined;
118
+ msg?: string;
119
119
  }>>;
120
120
  /**
121
121
  * @description Send email including verify code to user
@@ -138,9 +138,9 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
138
138
  })` Internal Server Error
139
139
  */
140
140
  sendVerifyEmail: (data: HandlerRequestAuthEmailSend, params?: RequestParams) => Promise<HttpResponse<HandlerMap & {
141
- msg?: string | undefined;
141
+ msg?: string;
142
142
  }, HandlerMap & {
143
- msg?: string | undefined;
143
+ msg?: string;
144
144
  }>>;
145
145
  /**
146
146
  * @description Get all users with same email, if there are more than one user with same email, need merge
@@ -161,7 +161,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
161
161
  })` Internal Server Error
162
162
  */
163
163
  checkDataMerge: (params?: RequestParams) => Promise<HttpResponse<HandlerResponseAuthDataMergeCheck, HandlerMap & {
164
- msg?: string | undefined;
164
+ msg?: string;
165
165
  }>>;
166
166
  /**
167
167
  * @description This function is to solve the problem of multiple users with the same email address, should be called after user login and then check, and perform data merge.
@@ -182,7 +182,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
182
182
  })` Internal Server Error
183
183
  */
184
184
  applyDataMerge: (data: HandlerRequestAuthDataMergeApply, params?: RequestParams) => Promise<HttpResponse<HandlerResponseAuthDataMergeApply, HandlerMap & {
185
- msg?: string | undefined;
185
+ msg?: string;
186
186
  }>>;
187
187
  };
188
188
  cache: {
@@ -208,9 +208,9 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
208
208
  })` Forbidden
209
209
  */
210
210
  flushCache: (params?: RequestParams) => Promise<HttpResponse<HandlerMap & {
211
- msg?: string | undefined;
211
+ msg?: string;
212
212
  }, HandlerMap & {
213
- msg?: string | undefined;
213
+ msg?: string;
214
214
  }>>;
215
215
  /**
216
216
  * @description Cache warming helps you to pre-load the cache to improve the performance of the first request
@@ -234,9 +234,9 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
234
234
  })` Forbidden
235
235
  */
236
236
  warmUpCache: (params?: RequestParams) => Promise<HttpResponse<HandlerMap & {
237
- msg?: string | undefined;
237
+ msg?: string;
238
238
  }, HandlerMap & {
239
- msg?: string | undefined;
239
+ msg?: string;
240
240
  }>>;
241
241
  };
242
242
  captcha: {
@@ -254,7 +254,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
254
254
  })` Internal Server Error
255
255
  */
256
256
  getCaptcha: (params?: RequestParams) => Promise<HttpResponse<HandlerResponseCaptchaGet, HandlerMap & {
257
- msg?: string | undefined;
257
+ msg?: string;
258
258
  }>>;
259
259
  /**
260
260
  * @description Get the status of the user's captcha verification
@@ -280,7 +280,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
280
280
  })` Forbidden
281
281
  */
282
282
  verifyCaptcha: (data: HandlerParamsCaptchaVerify, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
283
- img_data?: string | undefined;
283
+ img_data?: string;
284
284
  }>>;
285
285
  };
286
286
  comments: {
@@ -312,19 +312,19 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
312
312
  /** The comment page_key */
313
313
  page_key: string;
314
314
  /** The scope of comments */
315
- scope?: 'page' | 'user' | 'site';
315
+ scope?: "page" | "user" | "site";
316
316
  /** Search keywords */
317
317
  search?: string;
318
318
  /** The site name of your content scope */
319
319
  site_name?: string;
320
320
  /** Sort by condition */
321
- sort_by?: 'date_asc' | 'date_desc' | 'vote';
321
+ sort_by?: "date_asc" | "date_desc" | "vote";
322
322
  /** Message center show type */
323
- type?: 'all' | 'mentions' | 'mine' | 'pending';
323
+ type?: "all" | "mentions" | "mine" | "pending";
324
324
  /** Only show comments by admin */
325
325
  view_only_admin?: boolean;
326
326
  }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseCommentList, HandlerMap & {
327
- msg?: string | undefined;
327
+ msg?: string;
328
328
  }>>;
329
329
  /**
330
330
  * @description Create a new comment
@@ -345,7 +345,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
345
345
  })` Internal Server Error
346
346
  */
347
347
  createComment: (comment: HandlerParamsCommentCreate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseCommentCreate, HandlerMap & {
348
- msg?: string | undefined;
348
+ msg?: string;
349
349
  }>>;
350
350
  /**
351
351
  * @description Get the detail of a comment by comment id
@@ -365,7 +365,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
365
365
  })` Internal Server Error
366
366
  */
367
367
  getComment: (id: number, params?: RequestParams) => Promise<HttpResponse<HandlerResponseCommentGet, HandlerMap & {
368
- msg?: string | undefined;
368
+ msg?: string;
369
369
  }>>;
370
370
  /**
371
371
  * @description Update a specific comment
@@ -394,7 +394,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
394
394
  })` Internal Server Error
395
395
  */
396
396
  updateComment: (id: number, comment: HandlerParamsCommentUpdate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseCommentUpdate, HandlerMap & {
397
- msg?: string | undefined;
397
+ msg?: string;
398
398
  }>>;
399
399
  /**
400
400
  * @description Delete a specific comment
@@ -419,7 +419,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
419
419
  })` Internal Server Error
420
420
  */
421
421
  deleteComment: (id: number, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
422
- msg?: string | undefined;
422
+ msg?: string;
423
423
  }>>;
424
424
  };
425
425
  conf: {
@@ -447,7 +447,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
447
447
  })` Not Found
448
448
  */
449
449
  getSocialLoginProviders: (params?: RequestParams) => Promise<HttpResponse<HandlerResponseConfAuthProviders, HandlerMap & {
450
- msg?: string | undefined;
450
+ msg?: string;
451
451
  }>>;
452
452
  /**
453
453
  * @description Get Domain Info
@@ -487,7 +487,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
487
487
  /** The user name */
488
488
  name: string;
489
489
  }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseNotifyList, HandlerMap & {
490
- msg?: string | undefined;
490
+ msg?: string;
491
491
  }>>;
492
492
  /**
493
493
  * @description Mark all notifies as read for user
@@ -507,7 +507,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
507
507
  })` Internal Server Error
508
508
  */
509
509
  markAllNotifyRead: (options: HandlerParamsNotifyReadAll, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
510
- msg?: string | undefined;
510
+ msg?: string;
511
511
  }>>;
512
512
  /**
513
513
  * @description Mark specific notification as read for user
@@ -531,7 +531,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
531
531
  })` Internal Server Error
532
532
  */
533
533
  markNotifyRead: (commentId: number, notifyKey: string, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
534
- msg?: string | undefined;
534
+ msg?: string;
535
535
  }>>;
536
536
  };
537
537
  pages: {
@@ -554,10 +554,12 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
554
554
  limit?: number;
555
555
  /** The offset for pagination */
556
556
  offset?: number;
557
+ /** Search keywords */
558
+ search?: string;
557
559
  /** The site name of your content scope */
558
560
  site_name?: string;
559
561
  }, params?: RequestParams) => Promise<HttpResponse<HandlerResponsePageList, HandlerMap & {
560
- msg?: string | undefined;
562
+ msg?: string;
561
563
  }>>;
562
564
  /**
563
565
  * @description Fetch the data of all pages
@@ -578,7 +580,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
578
580
  })` Internal Server Error
579
581
  */
580
582
  fetchAllPages: (options: HandlerParamsPageFetchAll, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
581
- msg?: string | undefined;
583
+ msg?: string;
582
584
  }>>;
583
585
  /**
584
586
  * @description Get the status of the task of fetching all pages
@@ -628,7 +630,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
628
630
  })` Internal Server Error
629
631
  */
630
632
  updatePage: (id: number, page: HandlerParamsPageUpdate, params?: RequestParams) => Promise<HttpResponse<HandlerResponsePageUpdate, HandlerMap & {
631
- msg?: string | undefined;
633
+ msg?: string;
632
634
  }>>;
633
635
  /**
634
636
  * @description Delete a specific page
@@ -653,7 +655,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
653
655
  })` Internal Server Error
654
656
  */
655
657
  deletePage: (id: number, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
656
- msg?: string | undefined;
658
+ msg?: string;
657
659
  }>>;
658
660
  /**
659
661
  * @description Fetch the data of a specific page
@@ -674,7 +676,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
674
676
  })` Internal Server Error
675
677
  */
676
678
  fetchPage: (id: number, params?: RequestParams) => Promise<HttpResponse<HandlerResponsePageFetch, HandlerMap & {
677
- msg?: string | undefined;
679
+ msg?: string;
678
680
  }>>;
679
681
  };
680
682
  sendEmail: {
@@ -694,7 +696,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
694
696
  * @response `500` `HandlerMap` Internal Server Error
695
697
  */
696
698
  sendEmail: (email: HandlerParamsEmailSend, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap | (HandlerMap & {
697
- msg?: string | undefined;
699
+ msg?: string;
698
700
  })>>;
699
701
  };
700
702
  settings: {
@@ -717,7 +719,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
717
719
  })` Internal Server Error
718
720
  */
719
721
  getSettings: (params?: RequestParams) => Promise<HttpResponse<HandlerResponseSettingGet, HandlerMap & {
720
- msg?: string | undefined;
722
+ msg?: string;
721
723
  }>>;
722
724
  /**
723
725
  * @description Apply settings and restart the server
@@ -738,7 +740,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
738
740
  })` Internal Server Error
739
741
  */
740
742
  applySettings: (settings: HandlerParamsSettingApply, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
741
- msg?: string | undefined;
743
+ msg?: string;
742
744
  }>>;
743
745
  /**
744
746
  * @description Get config templates in different languages for rendering the settings page in the frontend
@@ -787,7 +789,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
787
789
  })` Internal Server Error
788
790
  */
789
791
  createSite: (site: HandlerParamsSiteCreate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseSiteCreate, HandlerMap & {
790
- msg?: string | undefined;
792
+ msg?: string;
791
793
  }>>;
792
794
  /**
793
795
  * @description Update a specific site
@@ -823,7 +825,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
823
825
  })` Internal Server Error
824
826
  */
825
827
  deleteSite: (id: number, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
826
- msg?: string | undefined;
828
+ msg?: string;
827
829
  }>>;
828
830
  };
829
831
  stats: {
@@ -852,7 +854,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
852
854
 
853
855
  })` Internal Server Error
854
856
  */
855
- getStats: (type: 'latest_comments' | 'latest_pages' | 'pv_most_pages' | 'comment_most_pages' | 'page_pv' | 'site_pv' | 'page_comment' | 'site_comment' | 'rand_comments' | 'rand_pages', query?: {
857
+ getStats: (type: "latest_comments" | "latest_pages" | "pv_most_pages" | "comment_most_pages" | "page_pv" | "site_pv" | "page_comment" | "site_comment" | "rand_comments" | "rand_pages", query?: {
856
858
  /** The limit for pagination */
857
859
  limit?: number;
858
860
  /** multiple page keys separated by commas */
@@ -860,7 +862,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
860
862
  /** The site name of your content scope */
861
863
  site_name?: string;
862
864
  }, params?: RequestParams) => Promise<HttpResponse<CommonJSONResult, HandlerMap & {
863
- msg?: string | undefined;
865
+ msg?: string;
864
866
  }>>;
865
867
  };
866
868
  transfer: {
@@ -879,7 +881,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
879
881
  })` Internal Server Error
880
882
  */
881
883
  exportArtrans: (params?: RequestParams) => Promise<HttpResponse<HandlerResponseTransferExport, HandlerMap & {
882
- msg?: string | undefined;
884
+ msg?: string;
883
885
  }>>;
884
886
  /**
885
887
  * @description Import data to Artalk
@@ -916,9 +918,9 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
916
918
  */
917
919
  file: File;
918
920
  }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseTransferUpload & {
919
- filename?: string | undefined;
921
+ filename?: string;
920
922
  }, HandlerMap & {
921
- msg?: string | undefined;
923
+ msg?: string;
922
924
  }>>;
923
925
  };
924
926
  upload: {
@@ -951,7 +953,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
951
953
  */
952
954
  file: File;
953
955
  }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUpload, HandlerMap & {
954
- msg?: string | undefined;
956
+ msg?: string;
955
957
  }>>;
956
958
  };
957
959
  user: {
@@ -975,7 +977,28 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
975
977
  /** The username */
976
978
  name?: string;
977
979
  }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserInfo, HandlerMap & {
978
- msg?: string | undefined;
980
+ msg?: string;
981
+ }>>;
982
+ /**
983
+ * @description Update user profile when user is logged in
984
+ *
985
+ * @tags Auth
986
+ * @name UpdateProfile
987
+ * @summary Update user profile
988
+ * @request POST:/user
989
+ * @secure
990
+ * @response `200` `HandlerResponseUserInfoUpdate` OK
991
+ * @response `400` `(HandlerMap & {
992
+ msg?: string,
993
+
994
+ })` Bad Request
995
+ * @response `500` `(HandlerMap & {
996
+ msg?: string,
997
+
998
+ })` Internal Server Error
999
+ */
1000
+ updateProfile: (data: HandlerRequestUserInfoUpdate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserInfoUpdate, HandlerMap & {
1001
+ msg?: string;
979
1002
  }>>;
980
1003
  /**
981
1004
  * @description Login user by name or email
@@ -1004,11 +1027,11 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
1004
1027
  */
1005
1028
  login: (user: HandlerParamsUserLogin, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserLogin, (HandlerMap & {
1006
1029
  data?: {
1007
- need_name_select?: string[] | undefined;
1008
- } | undefined;
1009
- msg?: string | undefined;
1030
+ need_name_select?: string[];
1031
+ };
1032
+ msg?: string;
1010
1033
  }) | (HandlerMap & {
1011
- msg?: string | undefined;
1034
+ msg?: string;
1012
1035
  })>>;
1013
1036
  /**
1014
1037
  * @description Get user login status by header Authorization
@@ -1051,7 +1074,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
1051
1074
  })` Internal Server Error
1052
1075
  */
1053
1076
  createUser: (user: HandlerParamsUserCreate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserCreate, HandlerMap & {
1054
- msg?: string | undefined;
1077
+ msg?: string;
1055
1078
  }>>;
1056
1079
  /**
1057
1080
  * @description Update a specific user
@@ -1080,7 +1103,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
1080
1103
  })` Internal Server Error
1081
1104
  */
1082
1105
  updateUser: (id: number, user: HandlerParamsUserUpdate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserUpdate, HandlerMap & {
1083
- msg?: string | undefined;
1106
+ msg?: string;
1084
1107
  }>>;
1085
1108
  /**
1086
1109
  * @description Delete a specific user
@@ -1105,7 +1128,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
1105
1128
  })` Internal Server Error
1106
1129
  */
1107
1130
  deleteUser: (id: number, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
1108
- msg?: string | undefined;
1131
+ msg?: string;
1109
1132
  }>>;
1110
1133
  /**
1111
1134
  * @description Get a list of users by some conditions
@@ -1121,13 +1144,15 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
1121
1144
 
1122
1145
  })` Forbidden
1123
1146
  */
1124
- getUsers: (type?: 'all' | 'admin' | 'in_conf', query?: {
1147
+ getUsers: (type?: "all" | "admin" | "in_conf", query?: {
1125
1148
  /** The limit for pagination */
1126
1149
  limit?: number;
1127
1150
  /** The offset for pagination */
1128
1151
  offset?: number;
1152
+ /** Search keywords */
1153
+ search?: string;
1129
1154
  }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseAdminUserList, HandlerMap & {
1130
- msg?: string | undefined;
1155
+ msg?: string;
1131
1156
  }>>;
1132
1157
  };
1133
1158
  version: {
@@ -1158,7 +1183,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
1158
1183
  })` Forbidden
1159
1184
  */
1160
1185
  syncVotes: (params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
1161
- msg?: string | undefined;
1186
+ msg?: string;
1162
1187
  }>>;
1163
1188
  /**
1164
1189
  * @description Vote for a specific comment or page
@@ -1181,8 +1206,8 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
1181
1206
 
1182
1207
  })` Internal Server Error
1183
1208
  */
1184
- vote: (type: 'comment_up' | 'comment_down' | 'page_up' | 'page_down', targetId: number, vote: HandlerParamsVote, params?: RequestParams) => Promise<HttpResponse<HandlerResponseVote, HandlerMap & {
1185
- msg?: string | undefined;
1209
+ vote: (type: "comment_up" | "comment_down" | "page_up" | "page_down", targetId: number, vote: HandlerParamsVote, params?: RequestParams) => Promise<HttpResponse<HandlerResponseVote, HandlerMap & {
1210
+ msg?: string;
1186
1211
  }>>;
1187
1212
  };
1188
1213
  }
@@ -1204,12 +1229,13 @@ declare interface ApiHandlerPayload {
1204
1229
  img_data?: string;
1205
1230
  iframe?: string;
1206
1231
  };
1207
- need_login: {};
1208
- need_auth_login: {};
1232
+ need_login: object;
1233
+ need_auth_login: object;
1209
1234
  }
1210
1235
 
1211
1236
  declare interface ApiHandlers {
1212
1237
  add: <T extends PayloadKey>(action: T, handler: (data: ApiHandlerPayload[T]) => Promise<void>) => void;
1238
+ remove: (action: PayloadKey) => void;
1213
1239
  get: () => ApiHandler[];
1214
1240
  }
1215
1241
 
@@ -1265,7 +1291,7 @@ declare class Artalk {
1265
1291
  /** Init Artalk */
1266
1292
  static init(conf: Partial<ArtalkConfig>): Artalk;
1267
1293
  /** Use plugin, the plugin will be used when Artalk.init */
1268
- static use(plugin: ArtalkPlugin): void;
1294
+ static use<T = any>(plugin: ArtalkPlugin<T>, options?: T): void;
1269
1295
  /** Load count widget */
1270
1296
  static loadCountWidget(c: Partial<ArtalkConfig>): void;
1271
1297
  /** @deprecated Please use `getEl()` instead */
@@ -1333,6 +1359,8 @@ export declare interface ArtalkConfig {
1333
1359
  countEl: string;
1334
1360
  /** PV 数绑定元素 Selector */
1335
1361
  pvEl: string;
1362
+ /** 统计组件 PageKey 属性名 */
1363
+ statPageKeyAttr: string;
1336
1364
  /** 夜间模式 */
1337
1365
  darkMode: boolean | 'auto';
1338
1366
  /** 请求超时(单位:秒) */
@@ -1369,6 +1397,12 @@ export declare interface ArtalkConfig {
1369
1397
  markedOptions?: MarkedOptions;
1370
1398
  /** 列表请求参数修改器 */
1371
1399
  listFetchParamsModifier?: (params: any) => void;
1400
+ /**
1401
+ * Date formatter for custom date format
1402
+ * @param date - Date object
1403
+ * @returns Formatted date string
1404
+ */
1405
+ dateFormatter?: (date: Date) => string;
1372
1406
  remoteConfModifier?: (conf: Partial<ArtalkConfig>) => void;
1373
1407
  listUnreadHighlight?: boolean;
1374
1408
  scrollRelativeTo?: () => HTMLElement;
@@ -1376,7 +1410,7 @@ export declare interface ArtalkConfig {
1376
1410
  beforeSubmit?: (editor: EditorApi, next: () => void) => void;
1377
1411
  }
1378
1412
 
1379
- export declare type ArtalkPlugin = (ctx: ContextApi) => void;
1413
+ export declare type ArtalkPlugin<T = any> = (ctx: ContextApi, options?: T) => void;
1380
1414
 
1381
1415
  declare namespace ArtalkType {
1382
1416
  export {
@@ -1407,7 +1441,8 @@ declare namespace ArtalkType {
1407
1441
  ListFetchedArgs,
1408
1442
  EventPayloadMap,
1409
1443
  ArtalkPlugin,
1410
- SidebarShowPayload
1444
+ SidebarShowPayload,
1445
+ Layer
1411
1446
  }
1412
1447
  }
1413
1448
  export { ArtalkType }
@@ -1620,7 +1655,7 @@ declare type CommentNode_2 = {
1620
1655
 
1621
1656
  declare interface CommentOptions {
1622
1657
  onAfterRender?: () => void;
1623
- onDelete?: Function;
1658
+ onDelete?: (c: CommentNode) => void;
1624
1659
  /** The comment being replied to (linked comment) */
1625
1660
  replyTo?: CommentData;
1626
1661
  flatMode: boolean;
@@ -1632,6 +1667,7 @@ declare interface CommentOptions {
1632
1667
  heightLimit: ArtalkConfig['heightLimit'];
1633
1668
  avatarURLBuilder: ArtalkConfig['avatarURLBuilder'];
1634
1669
  scrollRelativeTo: ArtalkConfig['scrollRelativeTo'];
1670
+ dateFormatter: ArtalkConfig['dateFormatter'];
1635
1671
  getApi: () => Api;
1636
1672
  replyComment: ContextApi['replyComment'];
1637
1673
  editComment: ContextApi['editComment'];
@@ -1685,7 +1721,7 @@ export declare interface ContextApi extends EventManagerFuncs<EventPayloadMap> {
1685
1721
  /** 配置对象 */
1686
1722
  conf: ArtalkConfig;
1687
1723
  /** marked 依赖对象 */
1688
- getMarked(): TMarked | undefined;
1724
+ getMarked(): Marked | undefined;
1689
1725
  /** 获取 API 以供 HTTP 请求 */
1690
1726
  getApi(): Api;
1691
1727
  /** Get API handlers */
@@ -1775,7 +1811,7 @@ declare class Editor extends Component implements EditorApi {
1775
1811
  getState(): EditorState;
1776
1812
  constructor(ctx: ContextApi);
1777
1813
  getHeaderInputEls(): {
1778
- nick: HTMLInputElement;
1814
+ name: HTMLInputElement;
1779
1815
  email: HTMLInputElement;
1780
1816
  link: HTMLInputElement;
1781
1817
  };
@@ -1889,16 +1925,13 @@ declare interface EditorEventPayloadMap {
1889
1925
  /**
1890
1926
  * Editor 插件
1891
1927
  */
1892
- declare interface EditorPlug {
1928
+ declare class EditorPlug {
1929
+ protected kit: PlugKit;
1893
1930
  $btn?: HTMLElement;
1894
1931
  $panel?: HTMLElement;
1895
1932
  contentTransformer?(rawContent: string): string;
1896
1933
  editorStateEffectWhen?: EditorState;
1897
1934
  editorStateEffect?(comment: CommentData): () => void;
1898
- }
1899
-
1900
- declare class EditorPlug {
1901
- protected kit: PlugKit;
1902
1935
  constructor(kit: PlugKit);
1903
1936
  /** Use plug btn will add a btn on the bottom of editor */
1904
1937
  useBtn(html?: string): HTMLElement;
@@ -1918,7 +1951,7 @@ export declare type EditorState = 'reply' | 'edit' | 'normal';
1918
1951
 
1919
1952
  declare interface EditorUI extends Record<keyof typeof Sel, HTMLElement> {
1920
1953
  $el: HTMLElement;
1921
- $nick: HTMLInputElement;
1954
+ $name: HTMLInputElement;
1922
1955
  $email: HTMLInputElement;
1923
1956
  $link: HTMLInputElement;
1924
1957
  $textarea: HTMLTextAreaElement;
@@ -1997,10 +2030,14 @@ declare const en: {
1997
2030
  cancel: string;
1998
2031
  msgCenter: string;
1999
2032
  ctrlCenter: string;
2033
+ userProfile: string;
2000
2034
  noAccountPrompt: string;
2001
2035
  haveAccountPrompt: string;
2002
2036
  forgetPassword: string;
2003
2037
  resetPassword: string;
2038
+ changePassword: string;
2039
+ confirmPassword: string;
2040
+ passwordMismatch: string;
2004
2041
  verificationCode: string;
2005
2042
  verifySend: string;
2006
2043
  verifyResend: string;
@@ -2009,7 +2046,7 @@ declare const en: {
2009
2046
  password: string;
2010
2047
  username: string;
2011
2048
  nextStep: string;
2012
- skipNotVerify: string;
2049
+ skipVerify: string;
2013
2050
  logoutConfirm: string;
2014
2051
  accountMergeNotice: string;
2015
2052
  accountMergeSelectOne: string;
@@ -2071,6 +2108,7 @@ declare interface EntityCookedNotify {
2071
2108
 
2072
2109
  declare interface EntityCookedPage {
2073
2110
  admin_only: boolean;
2111
+ date: string;
2074
2112
  id: number;
2075
2113
  key: string;
2076
2114
  pv: number;
@@ -2311,7 +2349,7 @@ declare interface HandlerParamsSiteUpdate {
2311
2349
  }
2312
2350
 
2313
2351
  declare interface HandlerParamsTransferImport {
2314
- /** Automatically answer yes for all questions. */
2352
+ /** Automatically answer yes for all questions */
2315
2353
  assumeyes?: boolean;
2316
2354
  /** The JSON data */
2317
2355
  json_data?: string;
@@ -2321,6 +2359,8 @@ declare interface HandlerParamsTransferImport {
2321
2359
  target_site_name?: string;
2322
2360
  /** The target site url */
2323
2361
  target_site_url?: string;
2362
+ /** Keep domain */
2363
+ url_keep_domain?: boolean;
2324
2364
  /** Enable URL resolver */
2325
2365
  url_resolver?: boolean;
2326
2366
  }
@@ -2401,6 +2441,13 @@ declare interface HandlerRequestAuthEmailSend {
2401
2441
  email: string;
2402
2442
  }
2403
2443
 
2444
+ declare interface HandlerRequestUserInfoUpdate {
2445
+ code?: string;
2446
+ email: string;
2447
+ link?: string;
2448
+ name: string;
2449
+ }
2450
+
2404
2451
  declare interface HandlerResponseAdminUserList {
2405
2452
  count: number;
2406
2453
  users: EntityCookedUserForAdmin[];
@@ -2515,6 +2562,7 @@ declare interface HandlerResponseNotifyList {
2515
2562
 
2516
2563
  declare interface HandlerResponsePageFetch {
2517
2564
  admin_only: boolean;
2565
+ date: string;
2518
2566
  id: number;
2519
2567
  key: string;
2520
2568
  pv: number;
@@ -2547,6 +2595,7 @@ declare interface HandlerResponsePagePV {
2547
2595
 
2548
2596
  declare interface HandlerResponsePageUpdate {
2549
2597
  admin_only: boolean;
2598
+ date: string;
2550
2599
  id: number;
2551
2600
  key: string;
2552
2601
  pv: number;
@@ -2558,6 +2607,7 @@ declare interface HandlerResponsePageUpdate {
2558
2607
  }
2559
2608
 
2560
2609
  declare interface HandlerResponseSettingGet {
2610
+ envs: string[];
2561
2611
  yaml: string;
2562
2612
  }
2563
2613
 
@@ -2624,6 +2674,10 @@ declare interface HandlerResponseUserInfo {
2624
2674
  user: EntityCookedUser;
2625
2675
  }
2626
2676
 
2677
+ declare interface HandlerResponseUserInfoUpdate {
2678
+ user: EntityCookedUser;
2679
+ }
2680
+
2627
2681
  declare interface HandlerResponseUserLogin {
2628
2682
  token: string;
2629
2683
  user: EntityCookedUser;
@@ -2686,7 +2740,17 @@ export declare type I18nKeys = keyof I18n;
2686
2740
 
2687
2741
  export declare const init: typeof Artalk.init;
2688
2742
 
2689
- declare class Layer {
2743
+ export declare interface Layer {
2744
+ show: () => void;
2745
+ hide: () => void;
2746
+ destroy: () => void;
2747
+ setOnAfterHide(func: () => void): void;
2748
+ setAllowMaskClose(allow: boolean): void;
2749
+ getAllowMaskClose(): boolean;
2750
+ getEl: () => HTMLElement;
2751
+ }
2752
+
2753
+ declare class Layer_2 implements Layer {
2690
2754
  private $el;
2691
2755
  private opts;
2692
2756
  private allowMaskClose;
@@ -2697,15 +2761,15 @@ declare class Layer {
2697
2761
  getAllowMaskClose(): boolean;
2698
2762
  getEl(): HTMLElement;
2699
2763
  show(): void;
2700
- hide(): Promise<void>;
2701
- destroy(): Promise<void>;
2764
+ hide(): void;
2765
+ destroy(): void;
2702
2766
  }
2703
2767
 
2704
2768
  declare class LayerManager {
2705
2769
  private wrap;
2706
2770
  constructor(ctx: ContextApi);
2707
2771
  getEl(): HTMLElement;
2708
- create(name: string, el?: HTMLElement): Layer;
2772
+ create(name: string, el?: HTMLElement): Layer_2;
2709
2773
  }
2710
2774
 
2711
2775
  declare interface LayerOptions {
@@ -2791,20 +2855,21 @@ declare namespace ListNest {
2791
2855
  export declare const loadCountWidget: typeof Artalk.loadCountWidget;
2792
2856
 
2793
2857
  /**
2794
- * 本地持久化用户数据
2795
- * @note 始终保持一层结构,不支持多层结构
2858
+ * Local User Data (in localStorage)
2859
+ *
2860
+ * @note Keep flat for easy handling
2796
2861
  */
2797
2862
  export declare interface LocalUser {
2798
- /** 昵称 */
2799
- nick: string;
2800
- /** 邮箱 */
2863
+ /** Username (aka. Nickname) */
2864
+ name: string;
2865
+ /** Email */
2801
2866
  email: string;
2802
- /** 链接 */
2867
+ /** Link (aka. Website) */
2803
2868
  link: string;
2804
- /** TOKEN */
2869
+ /** Token (for authorization) */
2805
2870
  token: string;
2806
- /** 是否为管理员 */
2807
- isAdmin: boolean;
2871
+ /** Admin flag */
2872
+ is_admin: boolean;
2808
2873
  }
2809
2874
 
2810
2875
  declare function makeNestCommentNodeList(srcData: CommentData[], sortBy?: SortByType, nestMax?: number): CommentNode_2[];
@@ -2958,7 +3023,7 @@ declare type ResponseFormat = keyof Omit<Body, 'body' | 'bodyUsed'>;
2958
3023
 
2959
3024
  declare const Sel: {
2960
3025
  $header: string;
2961
- $nick: string;
3026
+ $name: string;
2962
3027
  $email: string;
2963
3028
  $link: string;
2964
3029
  $textareaWrap: string;
@@ -2989,14 +3054,14 @@ declare const services: {
2989
3054
  };
2990
3055
 
2991
3056
  declare class SidebarLayer extends Component {
2992
- layer?: Layer;
3057
+ layer?: Layer_2;
2993
3058
  $header: HTMLElement;
2994
3059
  $closeBtn: HTMLElement;
2995
3060
  $iframeWrap: HTMLElement;
2996
3061
  $iframe?: HTMLIFrameElement;
2997
3062
  constructor(ctx: ContextApi);
2998
- /** Refresh iFrame on show */
2999
- private refreshOnShow;
3063
+ /** Refresh iFrame when show */
3064
+ private refreshWhenShow;
3000
3065
  /** Animation timer */
3001
3066
  private animTimer?;
3002
3067
  /** 显示 */
@@ -3037,8 +3102,6 @@ declare type TKeysOnlyReturn<T extends TObjectWithFuncs, V> = {
3037
3102
  [K in keyof T]: ReturnType<T[K]> extends V ? K : never;
3038
3103
  }[keyof T];
3039
3104
 
3040
- declare type TMarked = typeof marked;
3041
-
3042
3105
  declare type TObjectWithFuncs = {
3043
3106
  [k: string]: (...args: any) => any;
3044
3107
  };
@@ -3061,7 +3124,7 @@ declare class User {
3061
3124
  /**
3062
3125
  * Logout
3063
3126
  *
3064
- * @description Logout will clear login status, but not clear user data (nick, email, link)
3127
+ * @description Logout will clear login status, but not clear user data (name, email, link)
3065
3128
  */
3066
3129
  logout(): void;
3067
3130
  /** Check if user has filled basic data */