@huyooo/ui 1.0.7 → 2.0.1

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 (75) hide show
  1. package/dist/AuthkitAppSetting-DCQH9IpU.js +2678 -0
  2. package/dist/{Contact-BWuVR9ho.js → Contact-C7ROEqe-.js} +9 -9
  3. package/dist/{CustomTable-BzGfaAVH.js → CustomTable-GgvDEidl.js} +1 -1
  4. package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-C1hPqnNT.js +1531 -0
  5. package/dist/{LegalDocViewer-DM8FYBpf.js → LegalDocViewer-D_QUh0uf.js} +747 -748
  6. package/dist/MessageHandle-DKoySsCG.js +1233 -0
  7. package/dist/{MessageList-Ce-_LNTk.js → MessageList-HSiKkUoD.js} +4 -4
  8. package/dist/PaySubscriptions-NcATVJGm.js +1331 -0
  9. package/dist/{PricingPlans-CV97ck9p.js → PricingPlans-CZn6eJby.js} +99 -105
  10. package/dist/{ReferrerReferees-DgygiIiE.js → ReferrerReferees-BoOQIssE.js} +47 -46
  11. package/dist/Upload.vue_vue_type_script_setup_true_lang-CkS2S9Xc.js +83 -0
  12. package/dist/{UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-0Td42Nb3.js → UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-BrNx6JWe.js} +64 -65
  13. package/dist/WidthContainer-BJLdZfzF.js +717 -0
  14. package/dist/api/billingSubscriptionApi.d.ts +4 -1
  15. package/dist/apiClients-CR-hEwog.js +245 -0
  16. package/dist/authkit.js +10 -10
  17. package/dist/common/globalConfig.d.ts +36 -18
  18. package/dist/common.js +2 -2
  19. package/dist/components/Authkit/Auth/AuthkitOauthCallback.vue.d.ts +2 -2
  20. package/dist/components/Authkit/AuthkitProvider.vue.d.ts +0 -5
  21. package/dist/components/Feedback/FeedbackDetails.vue.d.ts +11 -0
  22. package/dist/components/Upload/Upload.vue.d.ts +7 -6
  23. package/dist/composables/Authkit/useAuthkitAuth.d.ts +3 -0
  24. package/dist/composables/Billing/usePaymentReturn.d.ts +1 -0
  25. package/dist/composables/uploadFeedbackAttachment.d.ts +8 -1
  26. package/dist/composables/useMessageList.d.ts +2 -1
  27. package/dist/composables.d.ts +2 -2
  28. package/dist/composables.js +46 -46
  29. package/dist/feedback.js +2 -2
  30. package/dist/{fetchAuthPageAboutUs-dzTSwRsB.js → fetchAuthPageAboutUs-BnKWq_TL.js} +4 -4
  31. package/dist/{index-BkLvw1PU.js → index-BhVwozr0.js} +1 -1
  32. package/dist/legalDocs/resolveAppId.d.ts +1 -1
  33. package/dist/main.d.ts +4 -3
  34. package/dist/main.js +464 -469
  35. package/dist/message.js +53 -52
  36. package/dist/pay.js +4 -4
  37. package/dist/privateCom.js +1 -1
  38. package/dist/referrer.js +1 -1
  39. package/dist/{useUploadCos-C8BqFPkx.js → runtime-DMCyhVcI.js} +2305 -2185
  40. package/dist/runtime.d.ts +22 -0
  41. package/dist/style.css +1 -1
  42. package/dist/types/api/auth.generated.d.ts +0 -10
  43. package/dist/upload/browserCosTransport.d.ts +22 -0
  44. package/dist/upload/browserUploadService.d.ts +21 -0
  45. package/dist/upload.d.ts +2 -1
  46. package/dist/upload.js +5 -4
  47. package/dist/{useAuthkitAppsAuthPageInfo-CNudJd04.js → useAuthkitAppsAuthPageInfo-Byu0yvrx.js} +18 -21
  48. package/dist/useAuthkitAuth-M2vTpEcb.js +272 -0
  49. package/dist/{useAuthkitCreateAndUpdate-BsINsI-E.js → useAuthkitCreateAndUpdate-D2_Bdazi.js} +1 -1
  50. package/dist/useAuthkitUsersProfile-DdUAENic.js +39 -0
  51. package/dist/useBillingStatusOptions-Jq6Wqfxb.js +61 -0
  52. package/dist/{useEnsureAuthenticated-DNkCCy_Y.js → useEnsureAuthenticated-Hel8hWLJ.js} +2 -2
  53. package/dist/{useLegalDocs-DQP_Yq6B.js → useLegalDocs-BOjqYRyQ.js} +25 -25
  54. package/dist/useMessageNotifications-AznFeFMD.js +80 -0
  55. package/dist/{useRoutePermission-CEiya9AM.js → useRoutePermission-BmUXTwQc.js} +2 -2
  56. package/dist/{useSEO-CDWxbk8B.js → useSEO-Chz4Zxuu.js} +89 -86
  57. package/dist/useSubscriptionCheckout-3ivcOcgC.js +353 -0
  58. package/dist/user.js +1 -1
  59. package/dist/utils/apiClients.d.ts +20 -12
  60. package/dist/utils/apiMiddlewares.d.ts +9 -23
  61. package/package.json +1 -1
  62. package/dist/AuthkitAppSetting-BN8-xgNq.js +0 -2674
  63. package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-DrL_XBqf.js +0 -1481
  64. package/dist/MessageHandle-mEkCsv9e.js +0 -1173
  65. package/dist/PaySubscriptions-CXkEjqr2.js +0 -1326
  66. package/dist/Upload.vue_vue_type_script_setup_true_lang-VGh2V4o0.js +0 -76
  67. package/dist/WidthContainer-CFMQRsCy.js +0 -721
  68. package/dist/apiClients-BcXOLuYu.js +0 -272
  69. package/dist/composables/Upload/useUploadCos.d.ts +0 -12
  70. package/dist/useAuthkitAuth-3m0yW6uP.js +0 -267
  71. package/dist/useAuthkitUsersProfile-DJlMsftY.js +0 -40
  72. package/dist/useBillingStatusOptions-CfHQOFNw.js +0 -71
  73. package/dist/useMessageNotifications-CAphguOm.js +0 -75
  74. package/dist/useSubscriptionCheckout-d_M_rKRa.js +0 -368
  75. package/dist/utils/billingFetch.d.ts +0 -1
@@ -1,3 +1,6 @@
1
1
  export declare const billingSubscriptionApi: {
2
- productOptions: <T = unknown>() => Promise<T[]>;
2
+ productOptions<T = unknown>(): Promise<{
3
+ data: T[] | null | undefined;
4
+ error: import('@vafast/api-client').ApiError | null;
5
+ }>;
3
6
  };
@@ -0,0 +1,245 @@
1
+ import { eden as f, defineMiddleware as p, createClient as U } from "@vafast/api-client";
2
+ /* empty css */
3
+ import { Message as b } from "@arco-design/web-vue";
4
+ import { ref as v, computed as A } from "vue";
5
+ function g(e, r = 3) {
6
+ const o = e.indexOf("@");
7
+ if (o > 1) {
8
+ const n = e.slice(0, r), u = e.slice(o);
9
+ return n + "***" + u;
10
+ }
11
+ return e;
12
+ }
13
+ function E(e) {
14
+ const r = e.trim();
15
+ return r.length < 7 ? r : `${r.slice(0, 3)}****${r.slice(-4)}`;
16
+ }
17
+ const j = {
18
+ normal: "正常",
19
+ pending: "待完善",
20
+ forbidden: "已禁用",
21
+ deleted: "已注销"
22
+ };
23
+ function ee(e) {
24
+ return e ? j[e] ?? e : "-";
25
+ }
26
+ function re(e) {
27
+ var o, n, u, h, w, m, a, i, t;
28
+ const r = [];
29
+ if ((o = e.email) != null && o.trim() && r.push(g(e.email.trim())), (n = e.phone) != null && n.trim() && r.push(E(e.phone.trim())), e.wechat) {
30
+ const s = (u = e.wechat.nickname) == null ? void 0 : u.trim();
31
+ r.push(s ? `微信(${s})` : "微信");
32
+ }
33
+ return (w = (h = e.github) == null ? void 0 : h.login) != null && w.trim() && r.push(`GitHub(${e.github.login.trim()})`), (a = (m = e.google) == null ? void 0 : m.email) != null && a.trim() && r.push(g(e.google.email.trim())), (t = (i = e.microsoft) == null ? void 0 : i.email) != null && t.trim() && r.push(g(e.microsoft.email.trim())), r.length > 0 ? r.join(" / ") : "-";
34
+ }
35
+ const k = /* @__PURE__ */ new Set();
36
+ function te(e) {
37
+ return k.add(e), () => {
38
+ k.delete(e);
39
+ };
40
+ }
41
+ function $() {
42
+ try {
43
+ localStorage.removeItem("jwtToken"), localStorage.removeItem("refreshToken");
44
+ } catch (e) {
45
+ console.warn("Failed to clear localStorage:", e);
46
+ }
47
+ k.forEach((e) => e());
48
+ }
49
+ function ne(e) {
50
+ try {
51
+ localStorage.setItem("jwtToken", e.jwtToken), localStorage.setItem("refreshToken", e.refreshToken);
52
+ } catch (r) {
53
+ console.warn("Failed to set localStorage:", r);
54
+ }
55
+ }
56
+ function O() {
57
+ try {
58
+ return localStorage.getItem("refreshToken");
59
+ } catch (e) {
60
+ return console.warn("Failed to get refreshToken from localStorage:", e), null;
61
+ }
62
+ }
63
+ function x(e) {
64
+ try {
65
+ localStorage.setItem("jwtToken", e);
66
+ } catch (r) {
67
+ console.warn("Failed to update jwtToken in localStorage:", r);
68
+ }
69
+ }
70
+ function z(e) {
71
+ return f(e);
72
+ }
73
+ function H(e) {
74
+ return f(e);
75
+ }
76
+ function L(e) {
77
+ return f(e);
78
+ }
79
+ function D(e) {
80
+ return f(e);
81
+ }
82
+ function F(e) {
83
+ return f(e);
84
+ }
85
+ function N(e) {
86
+ return f(e);
87
+ }
88
+ const S = v(!1), y = v("signIn");
89
+ function _(e) {
90
+ e != null && e.view && (y.value = e.view), S.value = !0;
91
+ }
92
+ function B() {
93
+ S.value = !1, y.value = "signIn";
94
+ }
95
+ function q() {
96
+ return {
97
+ open: _,
98
+ close: B,
99
+ isOpen: A(() => S.value),
100
+ view: A(() => y.value)
101
+ };
102
+ }
103
+ const T = 40101, I = 401;
104
+ function J(e) {
105
+ var r;
106
+ return e.status === I || ((r = e.error) == null ? void 0 : r.code) === I;
107
+ }
108
+ function G(e) {
109
+ var r;
110
+ return J(e) && ((r = e.error) == null ? void 0 : r.code) !== T;
111
+ }
112
+ function K() {
113
+ const {
114
+ open: e
115
+ } = q();
116
+ e();
117
+ }
118
+ function M() {
119
+ $(), K();
120
+ }
121
+ async function V(e) {
122
+ const r = O();
123
+ if (!r)
124
+ throw new Error("No refresh token available");
125
+ try {
126
+ const n = await (await fetch(`${e.authPrefixUrl}/auth/refresh`, {
127
+ method: "POST",
128
+ headers: {
129
+ "Content-Type": "application/json",
130
+ "app-id": e.appId
131
+ },
132
+ body: JSON.stringify({
133
+ refreshToken: r
134
+ })
135
+ })).json();
136
+ if (n.jwtToken)
137
+ return x(n.jwtToken), n.refreshToken && localStorage.setItem("refreshToken", n.refreshToken), n.jwtToken;
138
+ throw new Error(n.message || "Token refresh failed");
139
+ } catch (o) {
140
+ throw console.error("Token refresh failed:", o), o;
141
+ }
142
+ }
143
+ function C(e) {
144
+ let r = !1, o = [];
145
+ function n(a, i = null) {
146
+ o.forEach(({
147
+ resolve: t,
148
+ reject: s
149
+ }) => {
150
+ a ? s(a) : i && t(i);
151
+ }), o = [];
152
+ }
153
+ const u = p(async (a, i) => (a.headers.has("app-id") || a.headers.set("app-id", e.appId), i()), {
154
+ name: "app-id"
155
+ }), h = p(async (a, i) => {
156
+ const t = e.getAccessToken();
157
+ return t && a.headers.set("authorization", `Bearer ${t}`), i();
158
+ }, {
159
+ name: "token"
160
+ }), w = p(async (a, i) => {
161
+ var s;
162
+ const t = await i();
163
+ if (((s = t.error) == null ? void 0 : s.code) !== T)
164
+ return t;
165
+ if (r)
166
+ return new Promise((c, P) => {
167
+ o.push({
168
+ resolve: async (R) => {
169
+ a.headers.set("authorization", `Bearer ${R}`), c(await i());
170
+ },
171
+ reject: () => P(t)
172
+ });
173
+ });
174
+ r = !0;
175
+ try {
176
+ const c = await V(e);
177
+ return n(null, c), a.headers.set("authorization", `Bearer ${c}`), await i();
178
+ } catch (c) {
179
+ return n(c, null), M(), t;
180
+ } finally {
181
+ r = !1;
182
+ }
183
+ }, {
184
+ name: "token-refresh"
185
+ }), m = p(async (a, i) => {
186
+ const t = await i();
187
+ return G(t) ? (M(), t) : (t.error && t.error.code !== T && b.error(t.error.message || "请求失败"), t);
188
+ }, {
189
+ name: "error-message"
190
+ });
191
+ return {
192
+ appIdMiddleware: u,
193
+ tokenMiddleware: h,
194
+ tokenRefreshMiddleware: w,
195
+ errorMessageMiddleware: m
196
+ };
197
+ }
198
+ function oe(e, r) {
199
+ const {
200
+ tokenRefreshMiddleware: o,
201
+ errorMessageMiddleware: n
202
+ } = C(r);
203
+ return e.use(o).use(n);
204
+ }
205
+ function l(e, r) {
206
+ return U({
207
+ baseURL: e,
208
+ timeout: 3e4
209
+ }).use(r.appIdMiddleware).use(r.tokenMiddleware).use(r.tokenRefreshMiddleware).use(r.errorMessageMiddleware);
210
+ }
211
+ function W(e) {
212
+ const r = C(e);
213
+ return {
214
+ auth: H(l(e.authPrefixUrl, r)),
215
+ billing: L(l(e.billingPrefixUrl, r)),
216
+ ones: F(l(e.onesPrefixUrl, r)),
217
+ log: D(l(e.logPrefixUrl, r)),
218
+ ai: z(l(e.aiPrefixUrl, r)),
219
+ webhook: N(l(e.webhookPrefixUrl, r))
220
+ };
221
+ }
222
+ let d = null;
223
+ function ie(e) {
224
+ if (d)
225
+ throw new Error("Huyooo UI Runtime 已初始化,不能重复创建");
226
+ return d = W(e), d;
227
+ }
228
+ function ae() {
229
+ if (!d)
230
+ throw new Error("请先在应用入口调用 app.use(createHuyoooUI(config))");
231
+ return d;
232
+ }
233
+ export {
234
+ re as b,
235
+ C as c,
236
+ ee as f,
237
+ ae as g,
238
+ g as h,
239
+ ie as i,
240
+ te as o,
241
+ $ as r,
242
+ ne as s,
243
+ q as u,
244
+ oe as w
245
+ };
package/dist/authkit.js CHANGED
@@ -1,13 +1,13 @@
1
- import { A as s, B as i, a as e, _ as u, b as h, O as A, P as o, c as r, d as k, e as n, f as d, S as g, g as l, u as p, h as P } from "./AuthkitAppSetting-BN8-xgNq.js";
2
- import { A as m, a as c, b as S, c as L, d as O, E as U, e as w, _ as x, f as B, O as D, g as E, P as b, h as y, i as C, j as I, R as v, S as V, k as _, l as G, m as R, n as T, o as M, p as j, L as z } from "./LegalDocViewer-DM8FYBpf.js";
3
- import { u as K } from "./useAuthkitAppsAuthPageInfo-CNudJd04.js";
4
- import { u as q } from "./useAuthkitAuth-3m0yW6uP.js";
5
- import { u as J } from "./apiClients-BcXOLuYu.js";
6
- import { u as Q } from "./useEnsureAuthenticated-DNkCCy_Y.js";
7
- import { L as X, a as Z, b as $, i as tt, o as at, r as st, c as it, u as et } from "./useLegalDocs-DQP_Yq6B.js";
8
- import { f as ht } from "./fetchAuthPageAboutUs-dzTSwRsB.js";
9
- import { u as ot } from "./useAuthkitUsersProfile-DJlMsftY.js";
10
- import { u as kt } from "./useAuthkitCreateAndUpdate-BsINsI-E.js";
1
+ import { A as s, B as i, a as e, _ as u, b as h, O as A, P as o, c as r, d as k, e as n, f as d, S as g, g as l, u as p, h as P } from "./AuthkitAppSetting-DCQH9IpU.js";
2
+ import { A as m, a as c, b as S, c as L, d as O, E as U, e as w, _ as x, f as B, O as D, g as E, P as b, h as y, i as C, j as I, R as v, S as V, k as _, l as G, m as R, n as T, o as M, p as j, L as z } from "./LegalDocViewer-D_QUh0uf.js";
3
+ import { u as K } from "./useAuthkitAppsAuthPageInfo-Byu0yvrx.js";
4
+ import { u as q } from "./useAuthkitAuth-M2vTpEcb.js";
5
+ import { u as J } from "./apiClients-CR-hEwog.js";
6
+ import { u as Q } from "./useEnsureAuthenticated-Hel8hWLJ.js";
7
+ import { L as X, a as Z, b as $, i as tt, o as at, r as st, c as it, u as et } from "./useLegalDocs-BOjqYRyQ.js";
8
+ import { f as ht } from "./fetchAuthPageAboutUs-BnKWq_TL.js";
9
+ import { u as ot } from "./useAuthkitUsersProfile-DdUAENic.js";
10
+ import { u as kt } from "./useAuthkitCreateAndUpdate-D2_Bdazi.js";
11
11
  export {
12
12
  s as AuthkitAppSetting,
13
13
  m as AuthkitAuth,
@@ -43,32 +43,31 @@ export interface HuyoooUIConfig {
43
43
  web3formsAccessKey: string;
44
44
  /** 法律文档导航:builtin 走 /AboutUsDetails,delegate 由应用监听事件自行处理 */
45
45
  legalDocsMode: LegalDocsMode;
46
+ /** 动态获取访问令牌 */
47
+ getAccessToken: () => string | null;
46
48
  }
47
- export declare let globalConfig: HuyoooUIConfig;
48
49
  /** 全局 SEO 配置(独立对象) */
49
50
  export declare let globalSEOConfig: GlobalSEOConfig;
50
51
  /** 设置全局 SEO 配置 */
51
52
  export declare function setGlobalSEOConfig(seoConfig: GlobalSEOConfig): void;
52
- /** setGlobalConfig 的入参类型(含 theme) */
53
- export interface SetGlobalConfigOptions {
53
+ export interface HuyoooUIEndpoints {
54
+ auth: string;
55
+ ones: string;
56
+ billing: string;
57
+ log: string;
58
+ ai: string;
59
+ webhook: string;
60
+ }
61
+ /** createHuyoooUI 的应用启动配置 */
62
+ export interface CreateHuyoooUIOptions {
54
63
  /** 应用ID - 必填 */
55
64
  appId: string;
65
+ /** 各领域服务地址,在 Runtime 创建时固定 */
66
+ endpoints: HuyoooUIEndpoints;
67
+ /** 动态获取访问令牌 */
68
+ getAccessToken: () => string | null;
56
69
  /** 应用主题:light / dark / system,全局生效(body.dark + Arco) */
57
70
  theme?: GlobalTheme;
58
- /** 旧版 ones-server API 前缀别名;新代码请使用 onesPrefixUrl */
59
- prefixUrl?: string;
60
- /** ones-server API前缀 - 默认 '/onesRestfulApi' */
61
- onesPrefixUrl?: string;
62
- /** auth-server API前缀 - 默认 '/authRestfulApi' */
63
- authPrefixUrl?: string;
64
- /** billing-server API前缀 - 默认 '/billingRestfulApi' */
65
- billingPrefixUrl?: string;
66
- /** log-server API前缀 - 默认 '/logRestfulApi' */
67
- logPrefixUrl?: string;
68
- /** ai-server API前缀 - 默认 '/aiRestfulApi' */
69
- aiPrefixUrl?: string;
70
- /** webhook-server API前缀 - 默认 '/webhookRestfulApi' */
71
- webhookPrefixUrl?: string;
72
71
  /** OAuth 回调地址(可选,默认当前应用首页) */
73
72
  oauthCallbackUrl?: string;
74
73
  /** 价格页地址(可选,默认当前应用 /Pricing;桌面端可配置为官网价格页) */
@@ -86,4 +85,23 @@ export interface SetGlobalConfigOptions {
86
85
  /** 法律文档导航:builtin 走 /AboutUsDetails,delegate 由应用监听事件自行处理 */
87
86
  legalDocsMode?: LegalDocsMode;
88
87
  }
89
- export declare function setGlobalConfig(newConfig: SetGlobalConfigOptions): void;
88
+ /** 创建 Runtime 私有配置;应用运行期间不可修改。 */
89
+ export declare function createHuyoooRuntimeConfig(options: CreateHuyoooUIOptions): Readonly<{
90
+ appId: string;
91
+ authPrefixUrl: string;
92
+ onesPrefixUrl: string;
93
+ billingPrefixUrl: string;
94
+ logPrefixUrl: string;
95
+ aiPrefixUrl: string;
96
+ webhookPrefixUrl: string;
97
+ oauthCallbackUrl: string;
98
+ pricingUrl: string;
99
+ openPricing: (() => void) | undefined;
100
+ avatarBucketId: string;
101
+ feedbackBucketId: string;
102
+ bucket: string;
103
+ region: string;
104
+ web3formsAccessKey: string;
105
+ legalDocsMode: LegalDocsMode;
106
+ getAccessToken: () => string | null;
107
+ }>;
package/dist/common.js CHANGED
@@ -1,6 +1,6 @@
1
- import { A as s, a as o, C as r, D as t, G as p, H as n, b as l, S as m, W as u } from "./WidthContainer-CFMQRsCy.js";
1
+ import { A as s, a as o, C as r, D as t, G as p, H as n, b as l, S as m, W as u } from "./WidthContainer-BJLdZfzF.js";
2
2
  import { C as d, a as f } from "./CollapseItem-DUzZA6tx.js";
3
- import { C as x, E as b } from "./CustomTable-BzGfaAVH.js";
3
+ import { C as x, E as b } from "./CustomTable-GgvDEidl.js";
4
4
  import { L } from "./Logo-D7fyXyB-.js";
5
5
  import { M as g, a as A } from "./Menu-uCexrsKP.js";
6
6
  export {
@@ -13,12 +13,12 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
13
13
  appId: string;
14
14
  needBindIdentity?: boolean;
15
15
  }) => any;
16
+ error: (message: string) => any;
16
17
  needBindIdentity: (data: {
17
18
  token: string;
18
19
  userId: string;
19
20
  appId: string;
20
21
  }) => any;
21
- error: (message: string) => any;
22
22
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
23
23
  onSuccess?: ((data: {
24
24
  token: string;
@@ -26,11 +26,11 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
26
26
  appId: string;
27
27
  needBindIdentity?: boolean;
28
28
  }) => any) | undefined;
29
+ onError?: ((message: string) => any) | undefined;
29
30
  onNeedBindIdentity?: ((data: {
30
31
  token: string;
31
32
  userId: string;
32
33
  appId: string;
33
34
  }) => any) | undefined;
34
- onError?: ((message: string) => any) | undefined;
35
35
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
36
36
  export default _default;
@@ -1,8 +1,5 @@
1
- import { SetGlobalConfigOptions } from '../../common/globalConfig';
2
- import { LegalDocsMode } from '../../legalDocs/types';
3
1
  import { FormSizeType } from '../../types/auth';
4
2
  type __VLS_Props = {
5
- config?: SetGlobalConfigOptions;
6
3
  handleOAuthCallback?: boolean;
7
4
  restoreSession?: boolean;
8
5
  fetchAppInfo?: boolean;
@@ -11,7 +8,6 @@ type __VLS_Props = {
11
8
  bindIdentityRedirect?: string;
12
9
  closePopupOnBindSuccess?: boolean;
13
10
  restoreRedirectAfterSignIn?: boolean;
14
- legalDocsMode?: LegalDocsMode;
15
11
  };
16
12
  declare function __VLS_template(): {
17
13
  attrs: Partial<{}>;
@@ -37,7 +33,6 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
37
33
  fetchAppInfo: boolean;
38
34
  showAuthModal: boolean;
39
35
  authModalSize: FormSizeType;
40
- legalDocsMode: LegalDocsMode;
41
36
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
42
37
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
43
38
  export default _default;
@@ -9,6 +9,11 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
9
9
  required: true;
10
10
  validator: (value: string) => boolean;
11
11
  };
12
+ appId: {
13
+ type: StringConstructor;
14
+ required: false;
15
+ default: string;
16
+ };
12
17
  }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
13
18
  id: {
14
19
  type: StringConstructor;
@@ -20,7 +25,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
20
25
  required: true;
21
26
  validator: (value: string) => boolean;
22
27
  };
28
+ appId: {
29
+ type: StringConstructor;
30
+ required: false;
31
+ default: string;
32
+ };
23
33
  }>> & Readonly<{}>, {
34
+ appId: string;
24
35
  id: string;
25
36
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
26
37
  scrollableContentRef: HTMLDivElement;
@@ -1,3 +1,4 @@
1
+ import { BrowserUploadResult } from '../../upload/browserUploadService';
1
2
  declare function __VLS_template(): {
2
3
  attrs: Partial<{}>;
3
4
  slots: {
@@ -19,9 +20,9 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
19
20
  required: true;
20
21
  };
21
22
  }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
22
- progress: (...args: any[]) => void;
23
- fail: (...args: any[]) => void;
24
- fileFinish: (...args: any[]) => void;
23
+ progress: (percent: number) => any;
24
+ fail: (error: Error) => any;
25
+ fileFinish: (result: BrowserUploadResult) => any;
25
26
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
26
27
  options: {
27
28
  type: ObjectConstructor;
@@ -33,9 +34,9 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
33
34
  required: true;
34
35
  };
35
36
  }>> & Readonly<{
36
- onProgress?: ((...args: any[]) => any) | undefined;
37
- onFail?: ((...args: any[]) => any) | undefined;
38
- onFileFinish?: ((...args: any[]) => any) | undefined;
37
+ onProgress?: ((percent: number) => any) | undefined;
38
+ onFail?: ((error: Error) => any) | undefined;
39
+ onFileFinish?: ((result: BrowserUploadResult) => any) | undefined;
39
40
  }>, {
40
41
  options: Record<string, any>;
41
42
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -24,6 +24,8 @@ declare function setToken(token: string): void;
24
24
  declare function completeSignIn(data: SignInResult): void;
25
25
  /** 清除 token 并广播 onSignOut(让所有订阅者集中清理依赖 token 的状态) */
26
26
  declare function clearAuth(): void;
27
+ /** 主动注销服务端会话;无论网络结果如何都清理本地认证态。 */
28
+ declare function signOut(): Promise<boolean>;
27
29
  /** 注册登录成功监听,返回 cleanup */
28
30
  declare function onSignIn(listener: SignInListener): Cleanup;
29
31
  /** 注册注册成功监听,返回 cleanup */
@@ -78,5 +80,6 @@ export declare function useAuthkitAuth(): {
78
80
  completeSignIn: typeof completeSignIn;
79
81
  restoreSession: typeof restoreSession;
80
82
  clearAuth: typeof clearAuth;
83
+ signOut: typeof signOut;
81
84
  };
82
85
  export {};
@@ -4,6 +4,7 @@ export interface PaymentVerifyResult {
4
4
  status: string;
5
5
  message?: string;
6
6
  pointsAdded?: number;
7
+ error?: unknown;
7
8
  }
8
9
  /** 按支付场景查询订单/账单是否已支付完成 */
9
10
  export declare function verifyPaymentStatus(scene: PaymentReturnScene, orderId: string): Promise<PaymentVerifyResult>;
@@ -1,3 +1,4 @@
1
+ import { BrowserUploadService } from '../upload/browserUploadService';
1
2
  export type UploadedFeedbackAttachmentKind = 'image' | 'video' | 'file';
2
3
  export type UploadedFeedbackAttachment = {
3
4
  key: string;
@@ -6,4 +7,10 @@ export type UploadedFeedbackAttachment = {
6
7
  mimeType: string;
7
8
  kind: UploadedFeedbackAttachmentKind;
8
9
  };
9
- export declare function uploadFeedbackAttachments(files: File[], bucketId: string): Promise<UploadedFeedbackAttachment[]>;
10
+ export declare function uploadFeedbackAttachments(uploadService: BrowserUploadService, files: File[], bucketId: string): Promise<{
11
+ data: null;
12
+ error: Error;
13
+ } | {
14
+ data: UploadedFeedbackAttachment[];
15
+ error: null;
16
+ }>;
@@ -6,10 +6,11 @@ interface PaginationParams {
6
6
  }
7
7
  /** API 返回结果 */
8
8
  interface FetchResult<T> {
9
- data: {
9
+ data?: {
10
10
  items: T[];
11
11
  count: number;
12
12
  };
13
+ error?: unknown;
13
14
  }
14
15
  /** 获取数据函数类型(兼容 RequestBuilder) */
15
16
  type FetchFunction<T> = (params: {
@@ -7,11 +7,11 @@ export { useAuthkitUsersProfile } from './composables/Authkit/useAuthkitUsersPro
7
7
  export { useAuthkitAppsAuthPageInfo } from './composables/Authkit/useAuthkitAppsAuthPageInfo';
8
8
  export { useAuthkitCreateAndUpdate } from './composables/Authkit/useAuthkitCreateAndUpdate';
9
9
  export { useMessageNotifications } from './composables/useMessageNotifications';
10
- export { globalConfig, setGlobalConfig, globalSEOConfig, setGlobalSEOConfig, setTheme, globalThemeRef, type GlobalTheme, type SetGlobalConfigOptions } from './common/globalConfig';
10
+ export { globalSEOConfig, setGlobalSEOConfig, setTheme, globalThemeRef, type CreateHuyoooUIOptions, type GlobalTheme, type HuyoooUIConfig, } from './common/globalConfig';
11
+ export { createHuyoooUI, getHuyoooRuntime, useHuyoooRuntime, type HuyoooRuntime } from './runtime';
11
12
  export { useCreateAndUpdate as useCommonCreateAndUpdate } from './composables/useCreateAndUpdate';
12
13
  export { useTableHandle } from './composables/useTableHandle';
13
14
  export { useActiveDoc } from './composables/useActiveDoc';
14
- export { useUploadCos } from './composables/Upload/useUploadCos';
15
15
  export { withViewTransition } from './composables/viewTransitions';
16
16
  export { useDownloads } from './composables/useDownloads';
17
17
  export { useAuthMenu, findMenuPath, findActiveMenuPath, getPathOnly } from './composables/Authkit/useAuthMenu';
@@ -1,57 +1,57 @@
1
- import { u as a } from "./useAuthkitAuth-3m0yW6uP.js";
2
- import { g as t, a as u, b as r, s as i, c as n, d as l, u as f } from "./apiClients-BcXOLuYu.js";
3
- import { L as g, a as c, b as m, i as h, o as A, r as d, c as b, u as x } from "./useLegalDocs-DQP_Yq6B.js";
4
- import { f as L } from "./fetchAuthPageAboutUs-dzTSwRsB.js";
5
- import { u as S } from "./useAuthkitUsersProfile-DJlMsftY.js";
6
- import { u as P } from "./useAuthkitAppsAuthPageInfo-CNudJd04.js";
7
- import { u as U } from "./useAuthkitCreateAndUpdate-BsINsI-E.js";
8
- import { u as M } from "./useMessageNotifications-CAphguOm.js";
9
- import { u as v, a as R, b as w, c as G, d as B } from "./useSEO-CDWxbk8B.js";
10
- import { f as _, a as y, g as F, u as H, b as K, c as N, w as V } from "./useRoutePermission-CEiya9AM.js";
11
- import { u as j } from "./useUploadCos-C8BqFPkx.js";
1
+ import { u as a } from "./useAuthkitAuth-M2vTpEcb.js";
2
+ import { u as t } from "./apiClients-CR-hEwog.js";
3
+ import { L as r, a as i, b as n, i as l, o as f, r as p, c as g, u as m } from "./useLegalDocs-BOjqYRyQ.js";
4
+ import { f as h } from "./fetchAuthPageAboutUs-BnKWq_TL.js";
5
+ import { u as d } from "./useAuthkitUsersProfile-DdUAENic.js";
6
+ import { u as b } from "./useAuthkitAppsAuthPageInfo-Byu0yvrx.js";
7
+ import { u as O } from "./useAuthkitCreateAndUpdate-D2_Bdazi.js";
8
+ import { u as D } from "./useMessageNotifications-AznFeFMD.js";
9
+ import { c as P, g as E, a as R, b as U, s as k, d as M, u as T } from "./runtime-DMCyhVcI.js";
10
+ import { u as w, a as y, b as H, c as I, d as B } from "./useSEO-Chz4Zxuu.js";
11
+ import { f as _, a as F, g as K, u as N, b as V, c as Y, w as j } from "./useRoutePermission-BmUXTwQc.js";
12
12
  import { u as z } from "./useUserMenu-ClPBlvaM.js";
13
- import { u as Q, a as W } from "./useSubscriptionCheckout-d_M_rKRa.js";
14
- import { c as Z, u as $, a as ss, b as es } from "./useBillingStatusOptions-CfHQOFNw.js";
13
+ import { u as Q, a as W } from "./useSubscriptionCheckout-3ivcOcgC.js";
14
+ import { c as Z, u as $, a as ee, b as se } from "./useBillingStatusOptions-Jq6Wqfxb.js";
15
15
  export {
16
- g as LEGAL_DOCS,
17
- c as LEGAL_DOC_KEYS,
18
- m as buildBuiltinLegalDocUrl,
16
+ r as LEGAL_DOCS,
17
+ i as LEGAL_DOC_KEYS,
18
+ n as buildBuiltinLegalDocUrl,
19
19
  Z as createBillingStatusOptions,
20
- L as fetchAuthPageAboutUs,
20
+ P as createHuyoooUI,
21
+ h as fetchAuthPageAboutUs,
21
22
  _ as findActiveMenuPath,
22
- y as findMenuPath,
23
- F as getPathOnly,
24
- t as globalConfig,
25
- u as globalSEOConfig,
26
- r as globalThemeRef,
27
- h as isLegalDocConfigured,
28
- A as openLegalDocTarget,
29
- d as resolveLegalAppId,
30
- b as resolveLegalDocTargetFromData,
31
- i as setGlobalConfig,
32
- n as setGlobalSEOConfig,
33
- l as setTheme,
34
- H as useActiveDoc,
35
- K as useAuthMenu,
36
- P as useAuthkitAppsAuthPageInfo,
23
+ F as findMenuPath,
24
+ E as getHuyoooRuntime,
25
+ K as getPathOnly,
26
+ R as globalSEOConfig,
27
+ U as globalThemeRef,
28
+ l as isLegalDocConfigured,
29
+ f as openLegalDocTarget,
30
+ p as resolveLegalAppId,
31
+ g as resolveLegalDocTargetFromData,
32
+ k as setGlobalSEOConfig,
33
+ M as setTheme,
34
+ N as useActiveDoc,
35
+ V as useAuthMenu,
36
+ b as useAuthkitAppsAuthPageInfo,
37
37
  a as useAuthkitAuth,
38
- f as useAuthkitAuthModal,
39
- U as useAuthkitCreateAndUpdate,
40
- S as useAuthkitUsersProfile,
38
+ t as useAuthkitAuthModal,
39
+ O as useAuthkitCreateAndUpdate,
40
+ d as useAuthkitUsersProfile,
41
41
  Q as useBillingPlans,
42
- v as useCommonCreateAndUpdate,
43
- R as useDownloads,
42
+ w as useCommonCreateAndUpdate,
43
+ y as useDownloads,
44
+ T as useHuyoooRuntime,
44
45
  $ as useInvoiceStatusOptions,
45
- x as useLegalDocs,
46
- M as useMessageNotifications,
47
- ss as usePointsRechargeStatusOptions,
48
- es as useRefundStatusOptions,
49
- N as useRoutePermission,
50
- w as useRouteSEO,
51
- G as useSEO,
46
+ m as useLegalDocs,
47
+ D as useMessageNotifications,
48
+ ee as usePointsRechargeStatusOptions,
49
+ se as useRefundStatusOptions,
50
+ Y as useRoutePermission,
51
+ H as useRouteSEO,
52
+ I as useSEO,
52
53
  W as useSubscriptionCheckout,
53
54
  B as useTableHandle,
54
- j as useUploadCos,
55
55
  z as useUserMenu,
56
- V as withViewTransition
56
+ j as withViewTransition
57
57
  };
package/dist/feedback.js CHANGED
@@ -1,5 +1,5 @@
1
- import { B as b, a as s, F as d, b as F, _ as o, c, R as t, V as r } from "./FeedbackModal.vue_vue_type_script_setup_true_lang-DrL_XBqf.js";
2
- import { C as i } from "./index-BkLvw1PU.js";
1
+ import { B as b, a as s, F as d, b as F, _ as o, c, R as t, V as r } from "./FeedbackModal.vue_vue_type_script_setup_true_lang-C1hPqnNT.js";
2
+ import { C as i } from "./index-BhVwozr0.js";
3
3
  import { F as m, a as f, b as n, c as p } from "./FeedbackItem-BP-SiJ2u.js";
4
4
  export {
5
5
  i as Clipboard,