@huyooo/ui 0.16.0 → 0.17.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 (52) hide show
  1. package/dist/{AuthkitAppSetting-v80fEiq0.js → AuthkitAppSetting-jfSU-9BO.js} +655 -646
  2. package/dist/{AuthkitGithubBinding-CVhCM6AX.js → AuthkitGithubBinding-Co5Z_cD0.js} +260 -255
  3. package/dist/{Clipboard-R3AURqvU.js → Clipboard-Bo7gdpR6.js} +1 -1
  4. package/dist/{Contact-B3AMSHoN.js → Contact-B09Z0y_t.js} +2 -2
  5. package/dist/{FeedbackModal.vue_vue_type_script_setup_true_lang-CAGBbiZD.js → FeedbackModal.vue_vue_type_script_setup_true_lang-M1NQ-rx-.js} +3 -3
  6. package/dist/{MessageHandle-BMhGWVHD.js → MessageHandle-BG12aX0i.js} +2 -2
  7. package/dist/{MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-ByB_YaVb.js → MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-gsjL6yAe.js} +2 -2
  8. package/dist/{PaySubscriptions-D3g1OhiA.js → PaySubscriptions-BFq89DCI.js} +4 -4
  9. package/dist/{PricingPlans-DXea7rl0.js → PricingPlans-TZT6j_Jq.js} +4 -4
  10. package/dist/{ReferrerReferees-BxmZ1w_L.js → ReferrerReferees-jWOIvXrk.js} +18 -18
  11. package/dist/{Upload.vue_vue_type_script_setup_true_lang-CXr8D4VG.js → Upload.vue_vue_type_script_setup_true_lang-B6NOZjK0.js} +1 -1
  12. package/dist/{UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-6xQNhFk3.js → UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-BVtXbwch.js} +57 -57
  13. package/dist/{WidthContainer-DVZQV6sM.js → WidthContainer-Ct44rKyS.js} +9 -9
  14. package/dist/{apiClients-DT7o0IpO.js → apiClients-DrGX2iJy.js} +81 -78
  15. package/dist/authkit.js +9 -9
  16. package/dist/common/authPanelWidth.d.ts +2 -0
  17. package/dist/common.js +1 -1
  18. package/dist/components/UserMenu/parts/UserBasicInformation.vue.d.ts +2 -2
  19. package/dist/composables/Authkit/readInviteCodeFromLocation.d.ts +2 -0
  20. package/dist/composables/Authkit/useAuthkitAuth.d.ts +1 -1
  21. package/dist/composables/Authkit/useOauth.d.ts +5 -9
  22. package/dist/composables.js +13 -13
  23. package/dist/feedback.js +2 -2
  24. package/dist/main.js +29 -29
  25. package/dist/message.js +3 -3
  26. package/dist/pay.js +4 -4
  27. package/dist/privateCom.js +1 -1
  28. package/dist/referrer.js +1 -1
  29. package/dist/style.css +1 -1
  30. package/dist/types/api/ai.generated.d.ts +764 -94
  31. package/dist/types/api/auth.generated.d.ts +24 -20
  32. package/dist/types/api/billing.generated.d.ts +206 -514
  33. package/dist/types/api/ones.generated.d.ts +4 -0
  34. package/dist/types/api.d.ts +1 -1
  35. package/dist/types/user.d.ts +1 -1
  36. package/dist/upload.js +2 -2
  37. package/dist/{useAuthkitAppsAuthPageInfo-DScDQfj5.js → useAuthkitAppsAuthPageInfo-DWd0bDP-.js} +1 -1
  38. package/dist/{useAuthkitAuth-DpdKRuJm.js → useAuthkitAuth-DmS-H7M2.js} +60 -53
  39. package/dist/{useAuthkitCreateAndUpdate-MzA4qtTh.js → useAuthkitCreateAndUpdate-oo9517Gj.js} +1 -1
  40. package/dist/{useAuthkitUsersProfile-aw_A7IWb.js → useAuthkitUsersProfile-BZDk21c8.js} +2 -2
  41. package/dist/{useBillingStatusOptions-CAsu1hrf.js → useBillingStatusOptions-B7xLU3fs.js} +1 -1
  42. package/dist/{useEnsureAuthenticated-BEKhtQAl.js → useEnsureAuthenticated-BuIbxqsO.js} +2 -2
  43. package/dist/{useLegalLinks-BijRF_ZD.js → useLegalLinks--qFGF7lO.js} +2 -2
  44. package/dist/{useMessageNotifications-CFku0c2R.js → useMessageNotifications-D85_-mDq.js} +1 -1
  45. package/dist/{useRoutePermission-v4_0B-aO.js → useRoutePermission-chEi45Nb.js} +2 -2
  46. package/dist/{useSEO-CbHCw4gq.js → useSEO-C6DLicfe.js} +1 -1
  47. package/dist/{useSubscriptionCheckout-BjPiHSjA.js → useSubscriptionCheckout-BRk5h9aC.js} +3 -3
  48. package/dist/{useTableHandle-TDJa_Czn.js → useTableHandle-BdujaiNX.js} +1 -1
  49. package/dist/{useUploadCos-DOHnz2MP.js → useUploadCos-BRKRzSy3.js} +1 -1
  50. package/dist/user.js +1 -1
  51. package/dist/utils/apiMiddlewares.d.ts +4 -4
  52. package/package.json +2 -1
@@ -538,6 +538,7 @@ export type Api = {
538
538
  size: number;
539
539
  type: string;
540
540
  webkitRelativePath: string;
541
+ subjectUserId?: string;
541
542
  };
542
543
  return: any;
543
544
  };
@@ -625,6 +626,7 @@ export type Api = {
625
626
  bucketId: string;
626
627
  size: number;
627
628
  type: string;
629
+ subjectUserId?: string;
628
630
  };
629
631
  return: any;
630
632
  };
@@ -1636,6 +1638,7 @@ export interface ApiClient {
1636
1638
  size: number;
1637
1639
  type: string;
1638
1640
  webkitRelativePath: string;
1641
+ subjectUserId?: string;
1639
1642
  }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1640
1643
  };
1641
1644
  delete: {
@@ -1699,6 +1702,7 @@ export interface ApiClient {
1699
1702
  bucketId: string;
1700
1703
  size: number;
1701
1704
  type: string;
1705
+ subjectUserId?: string;
1702
1706
  }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1703
1707
  };
1704
1708
  };
@@ -49,7 +49,7 @@ export interface SignUpParams {
49
49
  password: string;
50
50
  userToken: string;
51
51
  emailVerifyId: string;
52
- referrerId?: string;
52
+ inviteCode?: string;
53
53
  }
54
54
  export interface ResetPasswordParams {
55
55
  email: string;
@@ -101,7 +101,7 @@ export interface UserProfileType extends AuditableEntity, UserBaseInfo {
101
101
  google: any;
102
102
  microsoft: any;
103
103
  organizations: string[];
104
- referrerId: string;
104
+ personalInviteCode: string;
105
105
  role: RoleInfo | null;
106
106
  permissions: PermissionInfo[];
107
107
  creatorInfo?: OperatorInfo;
package/dist/upload.js CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as p } from "./Upload.vue_vue_type_script_setup_true_lang-CXr8D4VG.js";
2
- import { u as s } from "./useUploadCos-DOHnz2MP.js";
1
+ import { _ as p } from "./Upload.vue_vue_type_script_setup_true_lang-B6NOZjK0.js";
2
+ import { u as s } from "./useUploadCos-BRKRzSy3.js";
3
3
  export {
4
4
  p as Upload,
5
5
  s as useUploadCos
@@ -1,5 +1,5 @@
1
1
  import { ref as n } from "vue";
2
- import { e as l } from "./apiClients-DT7o0IpO.js";
2
+ import { e as l } from "./apiClients-DrGX2iJy.js";
3
3
  const a = n({
4
4
  id: "",
5
5
  appKey: "",
@@ -1,7 +1,7 @@
1
- import { ref as a, readonly as P } from "vue";
2
- import { f as U, r as A, e as u } from "./apiClients-DT7o0IpO.js";
1
+ import { ref as a, readonly as U } from "vue";
2
+ import { f as A, r as L, e as u } from "./apiClients-DrGX2iJy.js";
3
3
  const i = a("signIn"), m = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Set(), I = /* @__PURE__ */ new Set(), S = /* @__PURE__ */ new Set(), t = a(null), v = "jwtToken";
4
- function k() {
4
+ function y() {
5
5
  try {
6
6
  const e = localStorage.getItem(v);
7
7
  if (e)
@@ -11,15 +11,15 @@ function k() {
11
11
  }
12
12
  return !1;
13
13
  }
14
- function L() {
14
+ function E() {
15
15
  try {
16
- const e = new URL(window.location.href), r = e.searchParams.get("token");
17
- if (!r) return !1;
16
+ const e = new URL(window.location.href), o = e.searchParams.get("token");
17
+ if (!o) return !1;
18
18
  const s = e.searchParams.get("userId"), l = e.searchParams.get("appId"), f = e.searchParams.get("needBindIdentity") === "true";
19
- c(r), ["token", "userId", "appId", "needBindIdentity"].forEach((w) => e.searchParams.delete(w));
19
+ c(o), ["token", "userId", "appId", "needBindIdentity"].forEach((w) => e.searchParams.delete(w));
20
20
  const h = `${e.pathname}${e.search}${e.hash}`;
21
21
  return window.history.replaceState({}, "", h), p({
22
- jwtToken: r,
22
+ jwtToken: o,
23
23
  userId: s,
24
24
  appId: l,
25
25
  needBindIdentity: f
@@ -28,41 +28,41 @@ function L() {
28
28
  return console.warn("Failed to handle OAuth callback:", e), !1;
29
29
  }
30
30
  }
31
- function E() {
32
- return L() ? !0 : k();
33
- }
34
31
  function O() {
35
- return t.value || k() ? t.value : null;
32
+ return E() ? !0 : y();
33
+ }
34
+ function V() {
35
+ return t.value || y() ? t.value : null;
36
36
  }
37
37
  function c(e) {
38
38
  t.value = e;
39
39
  try {
40
40
  localStorage.setItem(v, e);
41
- } catch (r) {
42
- console.warn("Failed to save token to localStorage:", r);
41
+ } catch (o) {
42
+ console.warn("Failed to save token to localStorage:", o);
43
43
  }
44
44
  }
45
- function V(e) {
45
+ function j(e) {
46
46
  c(e.jwtToken), p(e);
47
47
  }
48
- function j() {
48
+ function R() {
49
49
  t.value = null, B();
50
50
  }
51
- U(j);
52
- function R() {
53
- A();
51
+ A(R);
52
+ function b() {
53
+ L();
54
54
  }
55
- function d(e, r) {
56
- return e.add(r), () => {
57
- e.delete(r);
55
+ function d(e, o) {
56
+ return e.add(o), () => {
57
+ e.delete(o);
58
58
  };
59
59
  }
60
60
  function p(e) {
61
- m.forEach((r) => {
62
- r(e);
61
+ m.forEach((o) => {
62
+ o(e);
63
63
  });
64
64
  }
65
- function b() {
65
+ function C() {
66
66
  g.forEach((e) => void e());
67
67
  }
68
68
  function F() {
@@ -83,43 +83,50 @@ function _(e) {
83
83
  function x(e) {
84
84
  return d(S, e);
85
85
  }
86
- function M() {
87
- const e = a(!1), r = a(!1), s = a(!1);
86
+ function N() {
87
+ const e = a(!1), o = a(!1), s = a(!1);
88
88
  async function l(n) {
89
89
  e.value = !0;
90
- const {
91
- data: o
92
- } = await u.auth.signIn.unified.post({
93
- identifier: n.identifier || n.email || "",
94
- password: n.password,
95
- code: n.code,
96
- emailVerifyId: n.emailVerifyId,
97
- method: n.method || "password"
98
- });
99
- e.value = !1, o && (c(o.jwtToken), p(o));
90
+ try {
91
+ const {
92
+ data: r,
93
+ error: P
94
+ } = await u.auth.signIn.unified.post({
95
+ identifier: n.identifier || n.email || "",
96
+ password: n.password,
97
+ code: n.code,
98
+ emailVerifyId: n.emailVerifyId,
99
+ method: n.method || "password"
100
+ });
101
+ if (P || !r)
102
+ return;
103
+ c(r.jwtToken), p(r);
104
+ } finally {
105
+ e.value = !1;
106
+ }
100
107
  }
101
108
  async function f(n) {
102
- r.value = !0;
109
+ o.value = !0;
103
110
  const {
104
- error: o
111
+ error: r
105
112
  } = n.type === "phone" ? await u.auth.signUp.phone.post({
106
113
  phone: n.phone || "",
107
114
  code: n.code || "",
108
115
  password: n.password,
109
- referrerId: n.referrerId
116
+ inviteCode: n.inviteCode
110
117
  }) : await u.auth.signUp.post({
111
118
  email: n.email || "",
112
119
  userToken: n.userToken || "",
113
120
  emailVerifyId: n.emailVerifyId || "",
114
121
  password: n.password || "",
115
- referrerId: n.referrerId
122
+ inviteCode: n.inviteCode
116
123
  });
117
- r.value = !1, o || (i.value = "signIn", b());
124
+ o.value = !1, r || (i.value = "signIn", C());
118
125
  }
119
126
  async function h(n) {
120
127
  s.value = !0;
121
128
  const {
122
- error: o
129
+ error: r
123
130
  } = await u.auth.resetPassword.post({
124
131
  method: n.method || "email",
125
132
  email: n.email,
@@ -129,12 +136,12 @@ function M() {
129
136
  emailVerifyId: n.emailVerifyId,
130
137
  password: n.password
131
138
  });
132
- s.value = !1, o || (i.value = "signIn", F());
139
+ s.value = !1, r || (i.value = "signIn", F());
133
140
  }
134
141
  function w() {
135
142
  i.value = "signUp";
136
143
  }
137
- function y() {
144
+ function k() {
138
145
  i.value = "resetPassword";
139
146
  }
140
147
  function T() {
@@ -146,23 +153,23 @@ function M() {
146
153
  resetPasswordSubmit: h,
147
154
  currentView: i,
148
155
  authSignInLoading: e,
149
- authSignUpLoading: r,
156
+ authSignUpLoading: o,
150
157
  resetPasswordLoading: s,
151
158
  switchSignUp: w,
152
- switchResetPassword: y,
159
+ switchResetPassword: k,
153
160
  switchSignIn: T,
154
161
  onSignIn: $,
155
162
  onSignUp: K,
156
163
  onResetPassword: _,
157
164
  onSignOut: x,
158
- jwtToken: P(t),
159
- getToken: O,
165
+ jwtToken: U(t),
166
+ getToken: V,
160
167
  setToken: c,
161
- completeSignIn: V,
162
- restoreSession: E,
163
- clearAuth: R
168
+ completeSignIn: j,
169
+ restoreSession: O,
170
+ clearAuth: b
164
171
  };
165
172
  }
166
173
  export {
167
- M as u
174
+ N as u
168
175
  };
@@ -1,5 +1,5 @@
1
1
  /* empty css */
2
- import "./apiClients-DT7o0IpO.js";
2
+ import "./apiClients-DrGX2iJy.js";
3
3
  import { Message as u } from "@arco-design/web-vue";
4
4
  import { ref as e } from "vue";
5
5
  function h(o) {
@@ -1,6 +1,6 @@
1
1
  import { ref as o, computed as r } from "vue";
2
- import { e as f } from "./apiClients-DT7o0IpO.js";
3
- import { u as i } from "./useAuthkitAuth-DpdKRuJm.js";
2
+ import { e as f } from "./apiClients-DrGX2iJy.js";
3
+ import { u as i } from "./useAuthkitAuth-DmS-H7M2.js";
4
4
  const t = o(null), l = o(!1), u = o(!1), c = r(() => !!t.value);
5
5
  async function v() {
6
6
  const {
@@ -1,5 +1,5 @@
1
1
  import { createClient as y } from "@vafast/api-client";
2
- import { g as b, i as f, t as k, j as v, k as S, h as u } from "./apiClients-DT7o0IpO.js";
2
+ import { g as b, i as f, t as k, j as v, k as S, h as u } from "./apiClients-DrGX2iJy.js";
3
3
  import { ref as g } from "vue";
4
4
  async function O(t, o) {
5
5
  const {
@@ -1,6 +1,6 @@
1
1
  import { computed as f } from "vue";
2
- import { u as r } from "./useAuthkitAuth-DpdKRuJm.js";
3
- import { u as d } from "./apiClients-DT7o0IpO.js";
2
+ import { u as r } from "./useAuthkitAuth-DmS-H7M2.js";
3
+ import { u as d } from "./apiClients-DrGX2iJy.js";
4
4
  const A = "jwtToken";
5
5
  let e = null, i = !1;
6
6
  async function h(n) {
@@ -1,6 +1,6 @@
1
1
  import { computed as c } from "vue";
2
- import { g as L } from "./apiClients-DT7o0IpO.js";
3
- import { u as m } from "./useAuthkitAppsAuthPageInfo-DScDQfj5.js";
2
+ import { g as L } from "./apiClients-DrGX2iJy.js";
3
+ import { u as m } from "./useAuthkitAppsAuthPageInfo-DWd0bDP-.js";
4
4
  const l = {
5
5
  userServiceAgreement: "用户服务协议",
6
6
  privacyPolicy: "隐私协议",
@@ -1,5 +1,5 @@
1
1
  import { ref as a, computed as L } from "vue";
2
- import { o as c } from "./apiClients-DT7o0IpO.js";
2
+ import { o as c } from "./apiClients-DrGX2iJy.js";
3
3
  function S(f = "system") {
4
4
  const n = a(!0), d = a(""), i = a(!1), g = a(!1), o = a([]), t = a({
5
5
  total: 0,
@@ -1,7 +1,7 @@
1
1
  import { ref as w, computed as b, watch as S } from "vue";
2
2
  import { useRouter as I, useRoute as T } from "vue-router";
3
- import { u as k } from "./useAuthkitAppsAuthPageInfo-DScDQfj5.js";
4
- import { u as M } from "./useAuthkitUsersProfile-aw_A7IWb.js";
3
+ import { u as k } from "./useAuthkitAppsAuthPageInfo-DWd0bDP-.js";
4
+ import { u as M } from "./useAuthkitUsersProfile-BZDk21c8.js";
5
5
  const y = w({
6
6
  key: "",
7
7
  name: ""
@@ -1,5 +1,5 @@
1
1
  /* empty css */
2
- import { g } from "./apiClients-DT7o0IpO.js";
2
+ import { g } from "./apiClients-DrGX2iJy.js";
3
3
  import { Message as f } from "@arco-design/web-vue";
4
4
  import { ref as i, computed as r } from "vue";
5
5
  import { useHead as p, useSeoMeta as m } from "@unhead/vue";
@@ -1,9 +1,9 @@
1
1
  import { ref as y, computed as L } from "vue";
2
- import { d as H } from "./useBillingStatusOptions-CAsu1hrf.js";
3
- import { h as $ } from "./apiClients-DT7o0IpO.js";
2
+ import { d as H } from "./useBillingStatusOptions-B7xLU3fs.js";
3
+ import { h as $ } from "./apiClients-DrGX2iJy.js";
4
4
  /* empty css */
5
5
  import { Message as g } from "@arco-design/web-vue";
6
- import { u as J } from "./useEnsureAuthenticated-BEKhtQAl.js";
6
+ import { u as J } from "./useEnsureAuthenticated-BuIbxqsO.js";
7
7
  function M(e) {
8
8
  var i;
9
9
  const r = (i = e == null ? void 0 : e.metadata) == null ? void 0 : i.originalPrice;
@@ -1,5 +1,5 @@
1
1
  /* empty css */
2
- import "./apiClients-DT7o0IpO.js";
2
+ import "./apiClients-DrGX2iJy.js";
3
3
  import { Message as O } from "@arco-design/web-vue";
4
4
  import { ref as t } from "vue";
5
5
  function A(r) {
@@ -1,5 +1,5 @@
1
1
  import { c as Ft, g as Ut } from "./_commonjsHelpers-DaMA6jEr.js";
2
- import { o as mt } from "./apiClients-DT7o0IpO.js";
2
+ import { o as mt } from "./apiClients-DrGX2iJy.js";
3
3
  var Pt = { exports: {} };
4
4
  (function(je, ot) {
5
5
  (function(se, E) {
package/dist/user.js CHANGED
@@ -1,4 +1,4 @@
1
- import { U as a, a as n, b as r, c as t, d as U, _ as u, e as i, f as M, g as o, h as m, i as I, j as c, k as d, l as b, m as f } from "./UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-6xQNhFk3.js";
1
+ import { U as a, a as n, b as r, c as t, d as U, _ as u, e as i, f as M, g as o, h as m, i as I, j as c, k as d, l as b, m as f } from "./UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-BVtXbwch.js";
2
2
  export {
3
3
  a as UserAccountMenu,
4
4
  n as UserAvatar,
@@ -14,10 +14,10 @@ export declare const tokenRefreshMiddleware: import('@vafast/api-client').NamedM
14
14
  /**
15
15
  * 错误提示中间件:显示错误消息
16
16
  *
17
- * 双轨制兜底:
18
- * - 401(非 token 过期):清理本地认证 + 打开登录框,不弹 Message。
19
- * 适用于业务层未走 ensureAuthenticated 的边缘场景(token 完全无效、本地丢失等)。
20
- * - 40101 token 过期:交由 tokenRefreshMiddleware 处理,这里不重复弹。
17
+ * 双轨制(按 HTTP 状态 + 业务码,不靠 URL 白名单):
18
+ * - 400 凭证错误(如 40001):登录密码/验证码错误,走下方 Message 提示。
19
+ * - 401 + 40101:token 过期,交由 tokenRefreshMiddleware 刷新。
20
+ * - 401(code=401):会话无效,清理认证 + 打开登录框,不弹 Message。
21
21
  * - 其他错误:弹 Message 提示。
22
22
  */
23
23
  export declare const errorMessageMiddleware: import('@vafast/api-client').NamedMiddleware;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huyooo/ui",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [
@@ -69,6 +69,7 @@
69
69
  "dev": "tsdown --watch",
70
70
  "play": "vite",
71
71
  "build": "vue-tsc -b && vite build",
72
+ "link": "npm run build && npm link",
72
73
  "preview": "vite preview",
73
74
  "pub": "npm version patch --force && npm publish --access public",
74
75
  "lint": "eslint --cache .",