@lark-apaas/client-toolkit 1.2.28-alpha.52 → 1.2.28-alpha.53

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.
@@ -3,6 +3,8 @@ import { IBaseThemeProviderProps } from '../theme';
3
3
  import '../../runtime';
4
4
  interface IBaseAuthProviderProps {
5
5
  enableAuth?: boolean;
6
+ /** 自定义权限点位获取函数,返回 { action, subject }[],传入后 CanPermission / useCanPermission 可用 */
7
+ permissionPointsFetcher?: () => Promise<import('@lark-apaas/auth-sdk').PermissionPointData[]>;
6
8
  }
7
9
  interface IToasterProps {
8
10
  /** 禁用内建 Toaster 组件,默认 false */
@@ -27,7 +27,7 @@ const readCssVarColor = (varName, fallback)=>{
27
27
  };
28
28
  const appFlags = process.env.APP_FLAGS || {};
29
29
  const App = (props)=>{
30
- const { enableAuth, disableToaster = false } = props;
30
+ const { enableAuth, permissionPointsFetcher, disableToaster = false } = props;
31
31
  useAppInfo();
32
32
  useEffect(()=>{
33
33
  if (isMiaodaPreview) fetch(`${location.origin}/ai/api/feida_preview/csrf`).then(()=>{
@@ -54,7 +54,10 @@ const App = (props)=>{
54
54
  enable: enableAuth,
55
55
  permissionApi: {
56
56
  url: permissionApiUrl
57
- }
57
+ },
58
+ ...permissionPointsFetcher ? {
59
+ permissionPointsFetcher
60
+ } : {}
58
61
  },
59
62
  children: [
60
63
  !disableToaster && true !== appFlags.customToaster && /*#__PURE__*/ jsx(Toaster, {}),
@@ -196,6 +199,7 @@ const AppContainer_AppContainer = (props)=>{
196
199
  },
197
200
  children: /*#__PURE__*/ jsx(App, {
198
201
  enableAuth: props.enableAuth,
202
+ permissionPointsFetcher: props.permissionPointsFetcher,
199
203
  disableToaster: props.disableToaster,
200
204
  children: children
201
205
  })
@@ -372,18 +372,7 @@ function initAxiosConfig(axiosInstance) {
372
372
  name: 'toolkit_axios_403_downgrade',
373
373
  categories: {
374
374
  url: String(error.config?.url || ''),
375
- method: String(error.config?.method || ''),
376
- ...'production' !== process.env.NODE_ENV && {
377
- responseData: (()=>{
378
- try {
379
- const data = error.response?.data;
380
- if (!data) return '';
381
- return 'string' == typeof data ? data.slice(0, 512) : JSON.stringify(data).slice(0, 512);
382
- } catch {
383
- return '';
384
- }
385
- })()
386
- }
375
+ method: String(error.config?.method || '')
387
376
  }
388
377
  });
389
378
  return error.response;
@@ -394,19 +383,7 @@ function initAxiosConfig(axiosInstance) {
394
383
  categories: {
395
384
  url: String(error.config?.url || ''),
396
385
  method: String(error.config?.method || ''),
397
- status: String(error.response?.status || ''),
398
- ...'production' !== process.env.NODE_ENV && {
399
- errorMessage: String(error.message || ''),
400
- responseData: (()=>{
401
- try {
402
- const data = error.response?.data;
403
- if (!data) return '';
404
- return 'string' == typeof data ? data.slice(0, 512) : JSON.stringify(data).slice(0, 512);
405
- } catch {
406
- return '';
407
- }
408
- })()
409
- }
386
+ status: String(error.response?.status || '')
410
387
  }
411
388
  });
412
389
  return Promise.reject(error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/client-toolkit",
3
- "version": "1.2.28-alpha.52",
3
+ "version": "1.2.28-alpha.53",
4
4
  "types": "./lib/index.d.ts",
5
5
  "main": "./lib/index.js",
6
6
  "files": [
@@ -100,10 +100,10 @@
100
100
  "@ant-design/cssinjs": "^1.24.0",
101
101
  "@data-loom/js": "0.4.13",
102
102
  "@lark-apaas/aily-web-sdk": "^0.0.7",
103
- "@lark-apaas/auth-sdk": "^0.1.3",
103
+ "@lark-apaas/auth-sdk": "0.1.0-alpha.80",
104
104
  "@lark-apaas/client-capability": "^0.1.6",
105
105
  "@lark-apaas/internal-slardar": "^0.0.3",
106
- "@lark-apaas/miaoda-inspector": "1.0.14-alpha.49",
106
+ "@lark-apaas/miaoda-inspector": "^1.0.22",
107
107
  "@lark-apaas/observable-web": "^1.0.5",
108
108
  "@radix-ui/react-avatar": "^1.1.10",
109
109
  "@radix-ui/react-popover": "^1.1.15",