@lark-apaas/client-toolkit 1.2.37 → 1.2.38
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { splitWorkspaceUrl } from "../utils/url.js";
|
|
2
2
|
import { createClient } from "@data-loom/js";
|
|
3
3
|
import { getAppId } from "../utils/getAppId.js";
|
|
4
|
-
import {
|
|
4
|
+
import { getAppPublished } from "../utils/getInitialInfo.js";
|
|
5
5
|
const createDataLoomClient = (url, pat)=>{
|
|
6
6
|
const { baseUrl, workspace } = url ? splitWorkspaceUrl(url) : {
|
|
7
7
|
baseUrl: '',
|
|
@@ -27,7 +27,7 @@ let pendingPromise = null;
|
|
|
27
27
|
function getDataloom() {
|
|
28
28
|
if (dataloom) return Promise.resolve(dataloom);
|
|
29
29
|
if (pendingPromise) return pendingPromise;
|
|
30
|
-
pendingPromise =
|
|
30
|
+
pendingPromise = getAppPublished().then((info)=>{
|
|
31
31
|
const DATALOOM_CLIENT_URL = info?.app_runtime_extra?.url;
|
|
32
32
|
const DATALOOM_PAT = info?.app_runtime_extra?.token;
|
|
33
33
|
dataloom = createDataLoomClient(DATALOOM_CLIENT_URL, DATALOOM_PAT);
|
|
@@ -13,6 +13,13 @@ interface AppRuntimePublished {
|
|
|
13
13
|
interface BucketConfig {
|
|
14
14
|
default_bucket_id?: string;
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* 从API获取已发布的应用信息(仅全栈沙箱模式下使用)
|
|
18
|
+
*/
|
|
19
|
+
export declare function getAppPublished(): Promise<{
|
|
20
|
+
app_info?: AppRuntimePublished;
|
|
21
|
+
app_runtime_extra?: AppRuntimeExtra;
|
|
22
|
+
} | undefined>;
|
|
16
23
|
declare let initialInfo: {
|
|
17
24
|
app_info?: AppRuntimePublished;
|
|
18
25
|
app_runtime_extra?: AppRuntimeExtra;
|