@lark-apaas/client-toolkit-lite 1.1.5 → 1.1.6
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.
- package/dist/index.cjs +5 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -13
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -4,7 +4,7 @@ import { QueryClient } from '@tanstack/react-query';
|
|
|
4
4
|
import { NavLinkProps } from 'react-router-dom';
|
|
5
5
|
import { ClassValue } from 'clsx';
|
|
6
6
|
import { AxiosInstance } from 'axios';
|
|
7
|
-
import * as
|
|
7
|
+
import * as _lark_apaas_dataloom from '@lark-apaas/dataloom';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Inject minimal __REACT_DEVTOOLS_GLOBAL_HOOK__ before React loads.
|
|
@@ -261,7 +261,7 @@ declare function getAppInfo(refresh?: boolean): Promise<AppInfoPayload>;
|
|
|
261
261
|
|
|
262
262
|
declare function getCurrentUserProfile(): IUserProfile;
|
|
263
263
|
|
|
264
|
-
declare const createDataLoomClient: (url?: string, pat?: string) =>
|
|
264
|
+
declare const createDataLoomClient: (url?: string, pat?: string) => _lark_apaas_dataloom.DataloomClient;
|
|
265
265
|
/** 获取dataloom实例 */
|
|
266
266
|
declare function getDataloom(): Promise<ReturnType<typeof createDataLoomClient>>;
|
|
267
267
|
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { QueryClient } from '@tanstack/react-query';
|
|
|
4
4
|
import { NavLinkProps } from 'react-router-dom';
|
|
5
5
|
import { ClassValue } from 'clsx';
|
|
6
6
|
import { AxiosInstance } from 'axios';
|
|
7
|
-
import * as
|
|
7
|
+
import * as _lark_apaas_dataloom from '@lark-apaas/dataloom';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Inject minimal __REACT_DEVTOOLS_GLOBAL_HOOK__ before React loads.
|
|
@@ -261,7 +261,7 @@ declare function getAppInfo(refresh?: boolean): Promise<AppInfoPayload>;
|
|
|
261
261
|
|
|
262
262
|
declare function getCurrentUserProfile(): IUserProfile;
|
|
263
263
|
|
|
264
|
-
declare const createDataLoomClient: (url?: string, pat?: string) =>
|
|
264
|
+
declare const createDataLoomClient: (url?: string, pat?: string) => _lark_apaas_dataloom.DataloomClient;
|
|
265
265
|
/** 获取dataloom实例 */
|
|
266
266
|
declare function getDataloom(): Promise<ReturnType<typeof createDataLoomClient>>;
|
|
267
267
|
|
package/dist/index.js
CHANGED
|
@@ -309,26 +309,18 @@ function splitWorkspaceUrl(fullUrl) {
|
|
|
309
309
|
__name(splitWorkspaceUrl, "splitWorkspaceUrl");
|
|
310
310
|
|
|
311
311
|
// src/integrations/dataloom.ts
|
|
312
|
-
import { createClient } from "@
|
|
312
|
+
import { createClient } from "@lark-apaas/dataloom";
|
|
313
313
|
var createDataLoomClient = /* @__PURE__ */ __name((url, pat) => {
|
|
314
|
-
const { baseUrl
|
|
315
|
-
baseUrl: ""
|
|
316
|
-
workspace: ""
|
|
314
|
+
const { baseUrl } = url ? splitWorkspaceUrl(url) : {
|
|
315
|
+
baseUrl: ""
|
|
317
316
|
};
|
|
318
317
|
const appId = getAppId() ?? "";
|
|
319
|
-
return createClient(baseUrl, pat ?? "",
|
|
318
|
+
return createClient(baseUrl, pat ?? "", {
|
|
320
319
|
global: {
|
|
321
320
|
enableDataloomLog: process.env.NODE_ENV !== "production",
|
|
322
321
|
requestRateLimit: process.env.NODE_ENV !== "production" ? 100 : void 0,
|
|
323
322
|
brandName: "miaoda",
|
|
324
|
-
appId
|
|
325
|
-
onError: /* @__PURE__ */ __name((error, dataloomInstance) => {
|
|
326
|
-
if (error?.status === 401) {
|
|
327
|
-
if (error?.code === "k_ident_013001") {
|
|
328
|
-
dataloomInstance.service.session.redirectToLogin();
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
}, "onError")
|
|
323
|
+
appId
|
|
332
324
|
}
|
|
333
325
|
});
|
|
334
326
|
}, "createDataLoomClient");
|