@lark-apaas/fullstack-cli 1.1.28-alpha.2 → 1.1.28-alpha.3
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 +8 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7198,13 +7198,18 @@ async function getDefaultBucketId(appId) {
|
|
|
7198
7198
|
async function preUploadStaticAttachment(appId, bucketId) {
|
|
7199
7199
|
const client = getHttpClient();
|
|
7200
7200
|
const url = `/v1/app/${appId}/storage/bucket/${bucketId}/preUploadStatic`;
|
|
7201
|
+
console.error(`[api-client] preUploadStatic request: POST ${url}, appId=${appId}, bucketId=${bucketId}`);
|
|
7201
7202
|
const response = await client.post(url, {});
|
|
7202
7203
|
if (!response.ok || response.status !== 200) {
|
|
7204
|
+
const body = await response.text().catch(() => "(unable to read body)");
|
|
7205
|
+
console.error(`[api-client] preUploadStatic HTTP error: ${response.status} ${response.statusText}, body: ${body}`);
|
|
7203
7206
|
throw new Error(
|
|
7204
7207
|
`preUploadStatic \u8BF7\u6C42\u5931\u8D25: ${response.status} ${response.statusText}`
|
|
7205
7208
|
);
|
|
7206
7209
|
}
|
|
7207
|
-
|
|
7210
|
+
const data = await response.json();
|
|
7211
|
+
console.error(`[api-client] preUploadStatic response: ${JSON.stringify(data)}`);
|
|
7212
|
+
return data;
|
|
7208
7213
|
}
|
|
7209
7214
|
async function uploadStaticAttachmentCallback(appId, bucketId, body) {
|
|
7210
7215
|
const client = getHttpClient();
|
|
@@ -7337,7 +7342,7 @@ async function uploadStatic(options) {
|
|
|
7337
7342
|
async function fetchPreUpload(appId, bucketId) {
|
|
7338
7343
|
const response = await preUploadStaticAttachment(appId, bucketId);
|
|
7339
7344
|
if (response.status_code !== "0") {
|
|
7340
|
-
throw new Error(`preUploadStatic \u8FD4\u56DE\u5F02\u5E38,
|
|
7345
|
+
throw new Error(`preUploadStatic \u8FD4\u56DE\u5F02\u5E38, \u5B8C\u6574\u54CD\u5E94: ${JSON.stringify(response)}`);
|
|
7341
7346
|
}
|
|
7342
7347
|
const { uploadPrefix, uploadID, uploadCredential } = response.data || {};
|
|
7343
7348
|
if (!uploadPrefix || !uploadID) {
|
|
@@ -7383,7 +7388,7 @@ async function preUploadStatic(options) {
|
|
|
7383
7388
|
console.error(`${LOG_PREFIX2} \u8C03\u7528 preUploadStatic...`);
|
|
7384
7389
|
const response = await preUploadStaticAttachment(appId, bucketId);
|
|
7385
7390
|
if (response.status_code !== "0") {
|
|
7386
|
-
console.error(`${LOG_PREFIX2} preUploadStatic \u8FD4\u56DE\u5F02\u5E38,
|
|
7391
|
+
console.error(`${LOG_PREFIX2} preUploadStatic \u8FD4\u56DE\u5F02\u5E38, \u5B8C\u6574\u54CD\u5E94: ${JSON.stringify(response)}`);
|
|
7387
7392
|
return;
|
|
7388
7393
|
}
|
|
7389
7394
|
const { downloadUrlPrefix, uploadPrefix, uploadID, uploadCredential } = response.data || {};
|