@lark-apaas/fullstack-cli 1.1.28-alpha.24 → 1.1.28-alpha.25
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.js +26 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1414,15 +1414,14 @@ async function fetchSyncedTables(appId, workspace) {
|
|
|
1414
1414
|
DEFAULT_TIMEOUT_MS2
|
|
1415
1415
|
);
|
|
1416
1416
|
});
|
|
1417
|
-
const dbBranch = process.env.FORCE_DB_BRANCH || "main";
|
|
1418
1417
|
const start = Date.now();
|
|
1419
1418
|
console.log(
|
|
1420
|
-
`[fetchSyncedTables] \u2192 GET listTableView (dbBranch
|
|
1419
|
+
`[fetchSyncedTables] \u2192 GET listTableView (dbBranch=main) appId=${appId ? "set" : "unset"} workspace=${workspace ? "set" : "unset"}`
|
|
1421
1420
|
);
|
|
1422
1421
|
const response = await Promise.race([
|
|
1423
1422
|
client.get(
|
|
1424
1423
|
`/api/v1/dataloom/inner/app/${appId}/workspaces/${workspace}/listTableView`,
|
|
1425
|
-
{ params: { dbBranch }, headers: { "x-supaas-bizsource": "miaoda" } }
|
|
1424
|
+
{ params: { dbBranch: "main" }, headers: { "x-supaas-bizsource": "miaoda" } }
|
|
1426
1425
|
),
|
|
1427
1426
|
timeoutPromise
|
|
1428
1427
|
]);
|
|
@@ -7351,6 +7350,7 @@ function camelToKebab(str) {
|
|
|
7351
7350
|
|
|
7352
7351
|
// src/commands/build/upload-static.handler.ts
|
|
7353
7352
|
import * as fs25 from "fs";
|
|
7353
|
+
import * as os2 from "os";
|
|
7354
7354
|
import * as path21 from "path";
|
|
7355
7355
|
import { execFileSync } from "child_process";
|
|
7356
7356
|
function readCredentialsFromEnv() {
|
|
@@ -7409,16 +7409,25 @@ async function uploadStatic(options) {
|
|
|
7409
7409
|
({ AccessKeyID: accessKeyID, SecretAccessKey: secretAccessKey, SessionToken: sessionToken } = uploadCredential);
|
|
7410
7410
|
}
|
|
7411
7411
|
console.error(`${LOG_PREFIX} \u4E0A\u4F20\u76EE\u6807: ${uploadPrefix}`);
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
7415
|
-
|
|
7416
|
-
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
7412
|
+
const confPath = path21.join(os2.tmpdir(), `.tosutilconfig-static-${process.pid}`);
|
|
7413
|
+
fs25.writeFileSync(confPath, "");
|
|
7414
|
+
try {
|
|
7415
|
+
console.error(`${LOG_PREFIX} \u914D\u7F6E tosutil...`);
|
|
7416
|
+
configureTosutil(resolvedTosutil, confPath, {
|
|
7417
|
+
endpoint,
|
|
7418
|
+
region,
|
|
7419
|
+
accessKeyID,
|
|
7420
|
+
secretAccessKey,
|
|
7421
|
+
sessionToken
|
|
7422
|
+
});
|
|
7423
|
+
console.error(`${LOG_PREFIX} \u4E0A\u4F20 ${resolvedStaticDir} -> ${uploadPrefix}`);
|
|
7424
|
+
uploadToTos(resolvedTosutil, confPath, resolvedStaticDir, uploadPrefix);
|
|
7425
|
+
} finally {
|
|
7426
|
+
try {
|
|
7427
|
+
fs25.unlinkSync(confPath);
|
|
7428
|
+
} catch {
|
|
7429
|
+
}
|
|
7430
|
+
}
|
|
7422
7431
|
console.error(`${LOG_PREFIX} tosutil \u4E0A\u4F20\u5B8C\u6210`);
|
|
7423
7432
|
console.error(`${LOG_PREFIX} \u8C03\u7528 callbackStatic (uploadID: ${uploadID})...`);
|
|
7424
7433
|
const callbackResp = await uploadStaticAttachmentCallback(appId, bucketId, { uploadID });
|
|
@@ -7459,18 +7468,18 @@ async function fetchPreUpload(appId, bucketId) {
|
|
|
7459
7468
|
}
|
|
7460
7469
|
return response;
|
|
7461
7470
|
}
|
|
7462
|
-
function configureTosutil(tosutilPath, config) {
|
|
7471
|
+
function configureTosutil(tosutilPath, confPath, config) {
|
|
7463
7472
|
const { endpoint, region, accessKeyID, secretAccessKey, sessionToken } = config;
|
|
7464
7473
|
execFileSync(
|
|
7465
7474
|
tosutilPath,
|
|
7466
|
-
["config", "-e", endpoint, "-i", accessKeyID, "-k", secretAccessKey, "-t", sessionToken, "-re", region],
|
|
7475
|
+
["config", "-conf", confPath, "-e", endpoint, "-i", accessKeyID, "-k", secretAccessKey, "-t", sessionToken, "-re", region],
|
|
7467
7476
|
{ stdio: "pipe" }
|
|
7468
7477
|
);
|
|
7469
7478
|
}
|
|
7470
|
-
function uploadToTos(tosutilPath, sourceDir, destUrl) {
|
|
7479
|
+
function uploadToTos(tosutilPath, confPath, sourceDir, destUrl) {
|
|
7471
7480
|
execFileSync(
|
|
7472
7481
|
tosutilPath,
|
|
7473
|
-
["cp", sourceDir, destUrl, "-r", "-flat", "-j", "5", "-p", "3", "-ps", "10485760", "-f"],
|
|
7482
|
+
["cp", "-conf", confPath, sourceDir, destUrl, "-r", "-flat", "-j", "5", "-p", "3", "-ps", "10485760", "-f"],
|
|
7474
7483
|
{ stdio: "inherit" }
|
|
7475
7484
|
);
|
|
7476
7485
|
}
|