artalk 2.8.7 → 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 +604 -1111
  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 +320 -866
  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 +146 -85
  41. package/dist/main.d.ts +146 -85
  42. package/package.json +49 -15
  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.ts CHANGED
@@ -1,3 +1,6 @@
1
+ import { Marked } from 'marked';
2
+ import { MarkedOptions } from 'marked';
3
+
1
4
  /**
2
5
  * 通用操作按钮
3
6
  */
@@ -92,10 +95,10 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
92
95
  })` Internal Server Error
93
96
  */
94
97
  loginByEmail: (data: HandlerRequestAuthEmailLogin, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserLogin, HandlerMap & {
95
- msg?: string | undefined;
98
+ msg?: string;
96
99
  }>>;
97
100
  /**
98
- * @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)
99
102
  *
100
103
  * @tags Auth
101
104
  * @name RegisterByEmail
@@ -112,7 +115,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
112
115
  })` Internal Server Error
113
116
  */
114
117
  registerByEmail: (data: HandlerRequestAuthEmailRegister, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserLogin, HandlerMap & {
115
- msg?: string | undefined;
118
+ msg?: string;
116
119
  }>>;
117
120
  /**
118
121
  * @description Send email including verify code to user
@@ -135,9 +138,9 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
135
138
  })` Internal Server Error
136
139
  */
137
140
  sendVerifyEmail: (data: HandlerRequestAuthEmailSend, params?: RequestParams) => Promise<HttpResponse<HandlerMap & {
138
- msg?: string | undefined;
141
+ msg?: string;
139
142
  }, HandlerMap & {
140
- msg?: string | undefined;
143
+ msg?: string;
141
144
  }>>;
142
145
  /**
143
146
  * @description Get all users with same email, if there are more than one user with same email, need merge
@@ -158,7 +161,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
158
161
  })` Internal Server Error
159
162
  */
160
163
  checkDataMerge: (params?: RequestParams) => Promise<HttpResponse<HandlerResponseAuthDataMergeCheck, HandlerMap & {
161
- msg?: string | undefined;
164
+ msg?: string;
162
165
  }>>;
163
166
  /**
164
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.
@@ -179,7 +182,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
179
182
  })` Internal Server Error
180
183
  */
181
184
  applyDataMerge: (data: HandlerRequestAuthDataMergeApply, params?: RequestParams) => Promise<HttpResponse<HandlerResponseAuthDataMergeApply, HandlerMap & {
182
- msg?: string | undefined;
185
+ msg?: string;
183
186
  }>>;
184
187
  };
185
188
  cache: {
@@ -205,9 +208,9 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
205
208
  })` Forbidden
206
209
  */
207
210
  flushCache: (params?: RequestParams) => Promise<HttpResponse<HandlerMap & {
208
- msg?: string | undefined;
211
+ msg?: string;
209
212
  }, HandlerMap & {
210
- msg?: string | undefined;
213
+ msg?: string;
211
214
  }>>;
212
215
  /**
213
216
  * @description Cache warming helps you to pre-load the cache to improve the performance of the first request
@@ -231,9 +234,9 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
231
234
  })` Forbidden
232
235
  */
233
236
  warmUpCache: (params?: RequestParams) => Promise<HttpResponse<HandlerMap & {
234
- msg?: string | undefined;
237
+ msg?: string;
235
238
  }, HandlerMap & {
236
- msg?: string | undefined;
239
+ msg?: string;
237
240
  }>>;
238
241
  };
239
242
  captcha: {
@@ -251,7 +254,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
251
254
  })` Internal Server Error
252
255
  */
253
256
  getCaptcha: (params?: RequestParams) => Promise<HttpResponse<HandlerResponseCaptchaGet, HandlerMap & {
254
- msg?: string | undefined;
257
+ msg?: string;
255
258
  }>>;
256
259
  /**
257
260
  * @description Get the status of the user's captcha verification
@@ -277,7 +280,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
277
280
  })` Forbidden
278
281
  */
279
282
  verifyCaptcha: (data: HandlerParamsCaptchaVerify, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
280
- img_data?: string | undefined;
283
+ img_data?: string;
281
284
  }>>;
282
285
  };
283
286
  comments: {
@@ -309,19 +312,19 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
309
312
  /** The comment page_key */
310
313
  page_key: string;
311
314
  /** The scope of comments */
312
- scope?: 'page' | 'user' | 'site';
315
+ scope?: "page" | "user" | "site";
313
316
  /** Search keywords */
314
317
  search?: string;
315
318
  /** The site name of your content scope */
316
319
  site_name?: string;
317
320
  /** Sort by condition */
318
- sort_by?: 'date_asc' | 'date_desc' | 'vote';
321
+ sort_by?: "date_asc" | "date_desc" | "vote";
319
322
  /** Message center show type */
320
- type?: 'all' | 'mentions' | 'mine' | 'pending';
323
+ type?: "all" | "mentions" | "mine" | "pending";
321
324
  /** Only show comments by admin */
322
325
  view_only_admin?: boolean;
323
326
  }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseCommentList, HandlerMap & {
324
- msg?: string | undefined;
327
+ msg?: string;
325
328
  }>>;
326
329
  /**
327
330
  * @description Create a new comment
@@ -342,7 +345,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
342
345
  })` Internal Server Error
343
346
  */
344
347
  createComment: (comment: HandlerParamsCommentCreate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseCommentCreate, HandlerMap & {
345
- msg?: string | undefined;
348
+ msg?: string;
346
349
  }>>;
347
350
  /**
348
351
  * @description Get the detail of a comment by comment id
@@ -362,7 +365,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
362
365
  })` Internal Server Error
363
366
  */
364
367
  getComment: (id: number, params?: RequestParams) => Promise<HttpResponse<HandlerResponseCommentGet, HandlerMap & {
365
- msg?: string | undefined;
368
+ msg?: string;
366
369
  }>>;
367
370
  /**
368
371
  * @description Update a specific comment
@@ -391,7 +394,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
391
394
  })` Internal Server Error
392
395
  */
393
396
  updateComment: (id: number, comment: HandlerParamsCommentUpdate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseCommentUpdate, HandlerMap & {
394
- msg?: string | undefined;
397
+ msg?: string;
395
398
  }>>;
396
399
  /**
397
400
  * @description Delete a specific comment
@@ -416,7 +419,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
416
419
  })` Internal Server Error
417
420
  */
418
421
  deleteComment: (id: number, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
419
- msg?: string | undefined;
422
+ msg?: string;
420
423
  }>>;
421
424
  };
422
425
  conf: {
@@ -444,7 +447,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
444
447
  })` Not Found
445
448
  */
446
449
  getSocialLoginProviders: (params?: RequestParams) => Promise<HttpResponse<HandlerResponseConfAuthProviders, HandlerMap & {
447
- msg?: string | undefined;
450
+ msg?: string;
448
451
  }>>;
449
452
  /**
450
453
  * @description Get Domain Info
@@ -484,7 +487,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
484
487
  /** The user name */
485
488
  name: string;
486
489
  }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseNotifyList, HandlerMap & {
487
- msg?: string | undefined;
490
+ msg?: string;
488
491
  }>>;
489
492
  /**
490
493
  * @description Mark all notifies as read for user
@@ -504,7 +507,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
504
507
  })` Internal Server Error
505
508
  */
506
509
  markAllNotifyRead: (options: HandlerParamsNotifyReadAll, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
507
- msg?: string | undefined;
510
+ msg?: string;
508
511
  }>>;
509
512
  /**
510
513
  * @description Mark specific notification as read for user
@@ -528,7 +531,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
528
531
  })` Internal Server Error
529
532
  */
530
533
  markNotifyRead: (commentId: number, notifyKey: string, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
531
- msg?: string | undefined;
534
+ msg?: string;
532
535
  }>>;
533
536
  };
534
537
  pages: {
@@ -551,10 +554,12 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
551
554
  limit?: number;
552
555
  /** The offset for pagination */
553
556
  offset?: number;
557
+ /** Search keywords */
558
+ search?: string;
554
559
  /** The site name of your content scope */
555
560
  site_name?: string;
556
561
  }, params?: RequestParams) => Promise<HttpResponse<HandlerResponsePageList, HandlerMap & {
557
- msg?: string | undefined;
562
+ msg?: string;
558
563
  }>>;
559
564
  /**
560
565
  * @description Fetch the data of all pages
@@ -575,7 +580,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
575
580
  })` Internal Server Error
576
581
  */
577
582
  fetchAllPages: (options: HandlerParamsPageFetchAll, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
578
- msg?: string | undefined;
583
+ msg?: string;
579
584
  }>>;
580
585
  /**
581
586
  * @description Get the status of the task of fetching all pages
@@ -625,7 +630,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
625
630
  })` Internal Server Error
626
631
  */
627
632
  updatePage: (id: number, page: HandlerParamsPageUpdate, params?: RequestParams) => Promise<HttpResponse<HandlerResponsePageUpdate, HandlerMap & {
628
- msg?: string | undefined;
633
+ msg?: string;
629
634
  }>>;
630
635
  /**
631
636
  * @description Delete a specific page
@@ -650,7 +655,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
650
655
  })` Internal Server Error
651
656
  */
652
657
  deletePage: (id: number, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
653
- msg?: string | undefined;
658
+ msg?: string;
654
659
  }>>;
655
660
  /**
656
661
  * @description Fetch the data of a specific page
@@ -671,7 +676,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
671
676
  })` Internal Server Error
672
677
  */
673
678
  fetchPage: (id: number, params?: RequestParams) => Promise<HttpResponse<HandlerResponsePageFetch, HandlerMap & {
674
- msg?: string | undefined;
679
+ msg?: string;
675
680
  }>>;
676
681
  };
677
682
  sendEmail: {
@@ -691,7 +696,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
691
696
  * @response `500` `HandlerMap` Internal Server Error
692
697
  */
693
698
  sendEmail: (email: HandlerParamsEmailSend, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap | (HandlerMap & {
694
- msg?: string | undefined;
699
+ msg?: string;
695
700
  })>>;
696
701
  };
697
702
  settings: {
@@ -714,7 +719,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
714
719
  })` Internal Server Error
715
720
  */
716
721
  getSettings: (params?: RequestParams) => Promise<HttpResponse<HandlerResponseSettingGet, HandlerMap & {
717
- msg?: string | undefined;
722
+ msg?: string;
718
723
  }>>;
719
724
  /**
720
725
  * @description Apply settings and restart the server
@@ -735,7 +740,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
735
740
  })` Internal Server Error
736
741
  */
737
742
  applySettings: (settings: HandlerParamsSettingApply, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
738
- msg?: string | undefined;
743
+ msg?: string;
739
744
  }>>;
740
745
  /**
741
746
  * @description Get config templates in different languages for rendering the settings page in the frontend
@@ -784,7 +789,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
784
789
  })` Internal Server Error
785
790
  */
786
791
  createSite: (site: HandlerParamsSiteCreate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseSiteCreate, HandlerMap & {
787
- msg?: string | undefined;
792
+ msg?: string;
788
793
  }>>;
789
794
  /**
790
795
  * @description Update a specific site
@@ -820,7 +825,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
820
825
  })` Internal Server Error
821
826
  */
822
827
  deleteSite: (id: number, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
823
- msg?: string | undefined;
828
+ msg?: string;
824
829
  }>>;
825
830
  };
826
831
  stats: {
@@ -849,7 +854,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
849
854
 
850
855
  })` Internal Server Error
851
856
  */
852
- 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?: {
853
858
  /** The limit for pagination */
854
859
  limit?: number;
855
860
  /** multiple page keys separated by commas */
@@ -857,7 +862,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
857
862
  /** The site name of your content scope */
858
863
  site_name?: string;
859
864
  }, params?: RequestParams) => Promise<HttpResponse<CommonJSONResult, HandlerMap & {
860
- msg?: string | undefined;
865
+ msg?: string;
861
866
  }>>;
862
867
  };
863
868
  transfer: {
@@ -876,7 +881,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
876
881
  })` Internal Server Error
877
882
  */
878
883
  exportArtrans: (params?: RequestParams) => Promise<HttpResponse<HandlerResponseTransferExport, HandlerMap & {
879
- msg?: string | undefined;
884
+ msg?: string;
880
885
  }>>;
881
886
  /**
882
887
  * @description Import data to Artalk
@@ -913,9 +918,9 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
913
918
  */
914
919
  file: File;
915
920
  }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseTransferUpload & {
916
- filename?: string | undefined;
921
+ filename?: string;
917
922
  }, HandlerMap & {
918
- msg?: string | undefined;
923
+ msg?: string;
919
924
  }>>;
920
925
  };
921
926
  upload: {
@@ -948,7 +953,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
948
953
  */
949
954
  file: File;
950
955
  }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUpload, HandlerMap & {
951
- msg?: string | undefined;
956
+ msg?: string;
952
957
  }>>;
953
958
  };
954
959
  user: {
@@ -972,7 +977,28 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
972
977
  /** The username */
973
978
  name?: string;
974
979
  }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserInfo, HandlerMap & {
975
- 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;
976
1002
  }>>;
977
1003
  /**
978
1004
  * @description Login user by name or email
@@ -1001,11 +1027,11 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
1001
1027
  */
1002
1028
  login: (user: HandlerParamsUserLogin, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserLogin, (HandlerMap & {
1003
1029
  data?: {
1004
- need_name_select?: string[] | undefined;
1005
- } | undefined;
1006
- msg?: string | undefined;
1030
+ need_name_select?: string[];
1031
+ };
1032
+ msg?: string;
1007
1033
  }) | (HandlerMap & {
1008
- msg?: string | undefined;
1034
+ msg?: string;
1009
1035
  })>>;
1010
1036
  /**
1011
1037
  * @description Get user login status by header Authorization
@@ -1048,7 +1074,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
1048
1074
  })` Internal Server Error
1049
1075
  */
1050
1076
  createUser: (user: HandlerParamsUserCreate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserCreate, HandlerMap & {
1051
- msg?: string | undefined;
1077
+ msg?: string;
1052
1078
  }>>;
1053
1079
  /**
1054
1080
  * @description Update a specific user
@@ -1077,7 +1103,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
1077
1103
  })` Internal Server Error
1078
1104
  */
1079
1105
  updateUser: (id: number, user: HandlerParamsUserUpdate, params?: RequestParams) => Promise<HttpResponse<HandlerResponseUserUpdate, HandlerMap & {
1080
- msg?: string | undefined;
1106
+ msg?: string;
1081
1107
  }>>;
1082
1108
  /**
1083
1109
  * @description Delete a specific user
@@ -1102,7 +1128,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
1102
1128
  })` Internal Server Error
1103
1129
  */
1104
1130
  deleteUser: (id: number, params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
1105
- msg?: string | undefined;
1131
+ msg?: string;
1106
1132
  }>>;
1107
1133
  /**
1108
1134
  * @description Get a list of users by some conditions
@@ -1118,13 +1144,15 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
1118
1144
 
1119
1145
  })` Forbidden
1120
1146
  */
1121
- getUsers: (type?: 'all' | 'admin' | 'in_conf', query?: {
1147
+ getUsers: (type?: "all" | "admin" | "in_conf", query?: {
1122
1148
  /** The limit for pagination */
1123
1149
  limit?: number;
1124
1150
  /** The offset for pagination */
1125
1151
  offset?: number;
1152
+ /** Search keywords */
1153
+ search?: string;
1126
1154
  }, params?: RequestParams) => Promise<HttpResponse<HandlerResponseAdminUserList, HandlerMap & {
1127
- msg?: string | undefined;
1155
+ msg?: string;
1128
1156
  }>>;
1129
1157
  };
1130
1158
  version: {
@@ -1155,7 +1183,7 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
1155
1183
  })` Forbidden
1156
1184
  */
1157
1185
  syncVotes: (params?: RequestParams) => Promise<HttpResponse<HandlerMap, HandlerMap & {
1158
- msg?: string | undefined;
1186
+ msg?: string;
1159
1187
  }>>;
1160
1188
  /**
1161
1189
  * @description Vote for a specific comment or page
@@ -1178,8 +1206,8 @@ declare class Api_2<SecurityDataType extends unknown> extends HttpClient<Securit
1178
1206
 
1179
1207
  })` Internal Server Error
1180
1208
  */
1181
- vote: (type: 'comment_up' | 'comment_down' | 'page_up' | 'page_down', targetId: number, vote: HandlerParamsVote, params?: RequestParams) => Promise<HttpResponse<HandlerResponseVote, HandlerMap & {
1182
- 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;
1183
1211
  }>>;
1184
1212
  };
1185
1213
  }
@@ -1207,6 +1235,7 @@ declare interface ApiHandlerPayload {
1207
1235
 
1208
1236
  declare interface ApiHandlers {
1209
1237
  add: <T extends PayloadKey>(action: T, handler: (data: ApiHandlerPayload[T]) => Promise<void>) => void;
1238
+ remove: (action: PayloadKey) => void;
1210
1239
  get: () => ApiHandler[];
1211
1240
  }
1212
1241
 
@@ -1262,7 +1291,7 @@ declare class Artalk {
1262
1291
  /** Init Artalk */
1263
1292
  static init(conf: Partial<ArtalkConfig>): Artalk;
1264
1293
  /** Use plugin, the plugin will be used when Artalk.init */
1265
- static use(plugin: ArtalkPlugin): void;
1294
+ static use<T = any>(plugin: ArtalkPlugin<T>, options?: T): void;
1266
1295
  /** Load count widget */
1267
1296
  static loadCountWidget(c: Partial<ArtalkConfig>): void;
1268
1297
  /** @deprecated Please use `getEl()` instead */
@@ -1365,9 +1394,15 @@ export declare interface ArtalkConfig {
1365
1394
  /** Replacer for marked */
1366
1395
  markedReplacers?: ((raw: string) => string)[];
1367
1396
  /** Marked options */
1368
- markedOptions?: any;
1397
+ markedOptions?: MarkedOptions;
1369
1398
  /** 列表请求参数修改器 */
1370
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;
1371
1406
  remoteConfModifier?: (conf: Partial<ArtalkConfig>) => void;
1372
1407
  listUnreadHighlight?: boolean;
1373
1408
  scrollRelativeTo?: () => HTMLElement;
@@ -1375,7 +1410,7 @@ export declare interface ArtalkConfig {
1375
1410
  beforeSubmit?: (editor: EditorApi, next: () => void) => void;
1376
1411
  }
1377
1412
 
1378
- export declare type ArtalkPlugin = (ctx: ContextApi) => void;
1413
+ export declare type ArtalkPlugin<T = any> = (ctx: ContextApi, options?: T) => void;
1379
1414
 
1380
1415
  declare namespace ArtalkType {
1381
1416
  export {
@@ -1406,7 +1441,8 @@ declare namespace ArtalkType {
1406
1441
  ListFetchedArgs,
1407
1442
  EventPayloadMap,
1408
1443
  ArtalkPlugin,
1409
- SidebarShowPayload
1444
+ SidebarShowPayload,
1445
+ Layer
1410
1446
  }
1411
1447
  }
1412
1448
  export { ArtalkType }
@@ -1631,6 +1667,7 @@ declare interface CommentOptions {
1631
1667
  heightLimit: ArtalkConfig['heightLimit'];
1632
1668
  avatarURLBuilder: ArtalkConfig['avatarURLBuilder'];
1633
1669
  scrollRelativeTo: ArtalkConfig['scrollRelativeTo'];
1670
+ dateFormatter: ArtalkConfig['dateFormatter'];
1634
1671
  getApi: () => Api;
1635
1672
  replyComment: ContextApi['replyComment'];
1636
1673
  editComment: ContextApi['editComment'];
@@ -1684,7 +1721,7 @@ export declare interface ContextApi extends EventManagerFuncs<EventPayloadMap> {
1684
1721
  /** 配置对象 */
1685
1722
  conf: ArtalkConfig;
1686
1723
  /** marked 依赖对象 */
1687
- getMarked(): any | undefined;
1724
+ getMarked(): Marked | undefined;
1688
1725
  /** 获取 API 以供 HTTP 请求 */
1689
1726
  getApi(): Api;
1690
1727
  /** Get API handlers */
@@ -1774,7 +1811,7 @@ declare class Editor extends Component implements EditorApi {
1774
1811
  getState(): EditorState;
1775
1812
  constructor(ctx: ContextApi);
1776
1813
  getHeaderInputEls(): {
1777
- nick: HTMLInputElement;
1814
+ name: HTMLInputElement;
1778
1815
  email: HTMLInputElement;
1779
1816
  link: HTMLInputElement;
1780
1817
  };
@@ -1888,16 +1925,13 @@ declare interface EditorEventPayloadMap {
1888
1925
  /**
1889
1926
  * Editor 插件
1890
1927
  */
1891
- declare interface EditorPlug {
1928
+ declare class EditorPlug {
1929
+ protected kit: PlugKit;
1892
1930
  $btn?: HTMLElement;
1893
1931
  $panel?: HTMLElement;
1894
1932
  contentTransformer?(rawContent: string): string;
1895
1933
  editorStateEffectWhen?: EditorState;
1896
1934
  editorStateEffect?(comment: CommentData): () => void;
1897
- }
1898
-
1899
- declare class EditorPlug {
1900
- protected kit: PlugKit;
1901
1935
  constructor(kit: PlugKit);
1902
1936
  /** Use plug btn will add a btn on the bottom of editor */
1903
1937
  useBtn(html?: string): HTMLElement;
@@ -1917,7 +1951,7 @@ export declare type EditorState = 'reply' | 'edit' | 'normal';
1917
1951
 
1918
1952
  declare interface EditorUI extends Record<keyof typeof Sel, HTMLElement> {
1919
1953
  $el: HTMLElement;
1920
- $nick: HTMLInputElement;
1954
+ $name: HTMLInputElement;
1921
1955
  $email: HTMLInputElement;
1922
1956
  $link: HTMLInputElement;
1923
1957
  $textarea: HTMLTextAreaElement;
@@ -1996,10 +2030,14 @@ declare const en: {
1996
2030
  cancel: string;
1997
2031
  msgCenter: string;
1998
2032
  ctrlCenter: string;
2033
+ userProfile: string;
1999
2034
  noAccountPrompt: string;
2000
2035
  haveAccountPrompt: string;
2001
2036
  forgetPassword: string;
2002
2037
  resetPassword: string;
2038
+ changePassword: string;
2039
+ confirmPassword: string;
2040
+ passwordMismatch: string;
2003
2041
  verificationCode: string;
2004
2042
  verifySend: string;
2005
2043
  verifyResend: string;
@@ -2008,7 +2046,7 @@ declare const en: {
2008
2046
  password: string;
2009
2047
  username: string;
2010
2048
  nextStep: string;
2011
- skipNotVerify: string;
2049
+ skipVerify: string;
2012
2050
  logoutConfirm: string;
2013
2051
  accountMergeNotice: string;
2014
2052
  accountMergeSelectOne: string;
@@ -2403,6 +2441,13 @@ declare interface HandlerRequestAuthEmailSend {
2403
2441
  email: string;
2404
2442
  }
2405
2443
 
2444
+ declare interface HandlerRequestUserInfoUpdate {
2445
+ code?: string;
2446
+ email: string;
2447
+ link?: string;
2448
+ name: string;
2449
+ }
2450
+
2406
2451
  declare interface HandlerResponseAdminUserList {
2407
2452
  count: number;
2408
2453
  users: EntityCookedUserForAdmin[];
@@ -2562,6 +2607,7 @@ declare interface HandlerResponsePageUpdate {
2562
2607
  }
2563
2608
 
2564
2609
  declare interface HandlerResponseSettingGet {
2610
+ envs: string[];
2565
2611
  yaml: string;
2566
2612
  }
2567
2613
 
@@ -2628,6 +2674,10 @@ declare interface HandlerResponseUserInfo {
2628
2674
  user: EntityCookedUser;
2629
2675
  }
2630
2676
 
2677
+ declare interface HandlerResponseUserInfoUpdate {
2678
+ user: EntityCookedUser;
2679
+ }
2680
+
2631
2681
  declare interface HandlerResponseUserLogin {
2632
2682
  token: string;
2633
2683
  user: EntityCookedUser;
@@ -2690,7 +2740,17 @@ export declare type I18nKeys = keyof I18n;
2690
2740
 
2691
2741
  export declare const init: typeof Artalk.init;
2692
2742
 
2693
- 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 {
2694
2754
  private $el;
2695
2755
  private opts;
2696
2756
  private allowMaskClose;
@@ -2701,15 +2761,15 @@ declare class Layer {
2701
2761
  getAllowMaskClose(): boolean;
2702
2762
  getEl(): HTMLElement;
2703
2763
  show(): void;
2704
- hide(): Promise<void>;
2705
- destroy(): Promise<void>;
2764
+ hide(): void;
2765
+ destroy(): void;
2706
2766
  }
2707
2767
 
2708
2768
  declare class LayerManager {
2709
2769
  private wrap;
2710
2770
  constructor(ctx: ContextApi);
2711
2771
  getEl(): HTMLElement;
2712
- create(name: string, el?: HTMLElement): Layer;
2772
+ create(name: string, el?: HTMLElement): Layer_2;
2713
2773
  }
2714
2774
 
2715
2775
  declare interface LayerOptions {
@@ -2795,20 +2855,21 @@ declare namespace ListNest {
2795
2855
  export declare const loadCountWidget: typeof Artalk.loadCountWidget;
2796
2856
 
2797
2857
  /**
2798
- * 本地持久化用户数据
2799
- * @note 始终保持一层结构,不支持多层结构
2858
+ * Local User Data (in localStorage)
2859
+ *
2860
+ * @note Keep flat for easy handling
2800
2861
  */
2801
2862
  export declare interface LocalUser {
2802
- /** 昵称 */
2803
- nick: string;
2804
- /** 邮箱 */
2863
+ /** Username (aka. Nickname) */
2864
+ name: string;
2865
+ /** Email */
2805
2866
  email: string;
2806
- /** 链接 */
2867
+ /** Link (aka. Website) */
2807
2868
  link: string;
2808
- /** TOKEN */
2869
+ /** Token (for authorization) */
2809
2870
  token: string;
2810
- /** 是否为管理员 */
2811
- isAdmin: boolean;
2871
+ /** Admin flag */
2872
+ is_admin: boolean;
2812
2873
  }
2813
2874
 
2814
2875
  declare function makeNestCommentNodeList(srcData: CommentData[], sortBy?: SortByType, nestMax?: number): CommentNode_2[];
@@ -2962,7 +3023,7 @@ declare type ResponseFormat = keyof Omit<Body, 'body' | 'bodyUsed'>;
2962
3023
 
2963
3024
  declare const Sel: {
2964
3025
  $header: string;
2965
- $nick: string;
3026
+ $name: string;
2966
3027
  $email: string;
2967
3028
  $link: string;
2968
3029
  $textareaWrap: string;
@@ -2993,14 +3054,14 @@ declare const services: {
2993
3054
  };
2994
3055
 
2995
3056
  declare class SidebarLayer extends Component {
2996
- layer?: Layer;
3057
+ layer?: Layer_2;
2997
3058
  $header: HTMLElement;
2998
3059
  $closeBtn: HTMLElement;
2999
3060
  $iframeWrap: HTMLElement;
3000
3061
  $iframe?: HTMLIFrameElement;
3001
3062
  constructor(ctx: ContextApi);
3002
- /** Refresh iFrame on show */
3003
- private refreshOnShow;
3063
+ /** Refresh iFrame when show */
3064
+ private refreshWhenShow;
3004
3065
  /** Animation timer */
3005
3066
  private animTimer?;
3006
3067
  /** 显示 */
@@ -3063,7 +3124,7 @@ declare class User {
3063
3124
  /**
3064
3125
  * Logout
3065
3126
  *
3066
- * @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)
3067
3128
  */
3068
3129
  logout(): void;
3069
3130
  /** Check if user has filled basic data */