@rslsp1/fa-app-tools 1.2.8 → 1.2.9
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.
|
@@ -58,21 +58,31 @@ async function hfUploadProject(zipBase64, name, token) {
|
|
|
58
58
|
if (!preRes.ok) throw new Error(`HF preupload failed: ${preRes.status} ${preRes.statusText}`);
|
|
59
59
|
const preData = await preRes.json();
|
|
60
60
|
const fileInfo = preData.files?.[0];
|
|
61
|
-
|
|
61
|
+
const debugInfo = JSON.stringify({ uploadMode: fileInfo?.uploadMode, hasUploadUrl: !!fileInfo?.uploadUrl, hasVerifyUrl: !!fileInfo?.verifyUrl, headerKeys: Object.keys(fileInfo?.header || {}), verifyHeaderKeys: Object.keys(fileInfo?.verifyHeader || {}) });
|
|
62
|
+
if (!fileInfo?.uploadMode) throw new Error(`HF preupload kein fileInfo: ${JSON.stringify(preData)}`);
|
|
63
|
+
if (fileInfo.uploadMode === "lfs") {
|
|
64
|
+
if (!fileInfo.uploadUrl) throw new Error(`HF preupload: kein uploadUrl \u2014 ${debugInfo}`);
|
|
62
65
|
const uploadRes = await fetch(fileInfo.uploadUrl, {
|
|
63
66
|
method: "PUT",
|
|
64
67
|
headers: { "Content-Type": "application/octet-stream", ...fileInfo.header || {} },
|
|
65
68
|
body: bytes
|
|
66
69
|
});
|
|
67
|
-
if (!uploadRes.ok)
|
|
70
|
+
if (!uploadRes.ok) {
|
|
71
|
+
const uploadErr = await uploadRes.text().catch(() => "");
|
|
72
|
+
throw new Error(`HF LFS upload failed: ${uploadRes.status} \u2014 ${uploadErr.slice(0, 200)}`);
|
|
73
|
+
}
|
|
68
74
|
if (fileInfo.verifyUrl) {
|
|
69
75
|
const verifyRes = await fetch(fileInfo.verifyUrl, {
|
|
70
76
|
method: "POST",
|
|
71
77
|
headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json", ...fileInfo.verifyHeader || {} },
|
|
72
78
|
body: JSON.stringify({ oid, size })
|
|
73
79
|
});
|
|
74
|
-
if (!verifyRes.ok)
|
|
80
|
+
if (!verifyRes.ok) {
|
|
81
|
+
const verifyErr = await verifyRes.text().catch(() => "");
|
|
82
|
+
throw new Error(`HF LFS verify failed: ${verifyRes.status} \u2014 ${verifyErr.slice(0, 200)}`);
|
|
83
|
+
}
|
|
75
84
|
}
|
|
85
|
+
} else if (fileInfo.uploadMode === "regular") {
|
|
76
86
|
}
|
|
77
87
|
const commitRes = await fetch(`${HF_BASE}/api/datasets/${HF_REPO}/commit/main`, {
|
|
78
88
|
method: "POST",
|
package/dist/index.d.mts
CHANGED
|
@@ -448,6 +448,6 @@ declare function buildLoopInstruction(rounds: Array<{
|
|
|
448
448
|
declare function autoLabel(index: number): string;
|
|
449
449
|
declare function buildReferenceImageMediaIds(images: SelectedLabImage[]): string[];
|
|
450
450
|
|
|
451
|
-
declare const LIB_VERSION = "1.2.
|
|
451
|
+
declare const LIB_VERSION = "1.2.9";
|
|
452
452
|
|
|
453
453
|
export { AvatarArchitectApp, type AvatarArchitectAppProps, CollapsibleCard, CompactDropdown, type ExtractedCharacter, FaToolsBadge, type FlowSdk, GLOBAL_STYLES, type Generation, HistoryPanel, InspectPanel, LIB_VERSION, LabBlend, LabCompare, type LabFrame, LabImagePicker, type LabItem, LabLoop, LabRemix, type LabServices, LabsTab, ListView, type MediaItem, MediaLibrary, PillButton, type ProjectMeta, type ProjectSettings, ProjectSyncTab, PromptTab, SectionLabel, type SelectedLabImage, type SelectedTag, SetupPanel, type SyncDiff, TagManagerPanel, type TagOption, type WorkspaceTags, autoLabel, buildBlendInstruction, buildCompareInstruction, buildFallbackPrompt, buildGenerationPrompt, buildImageGenerationOptions, buildLoopInstruction, buildPromptTabPayload, buildReferenceImageMediaIds, buildRemixInstruction, buildScanInstruction, cleanAiResponse, createFlowServices, exportProjectToZip, formatTreeToMarkdown, frameToGeneration, getFormattedTimestamp, groupGenerationsToLabItems, importProjectFromZip, injectXMPMetadata, interpretSdkError, parsePromptFile, parsePromptResponse, useKeyboardNavigation, useOnClickOutside };
|
package/dist/index.d.ts
CHANGED
|
@@ -448,6 +448,6 @@ declare function buildLoopInstruction(rounds: Array<{
|
|
|
448
448
|
declare function autoLabel(index: number): string;
|
|
449
449
|
declare function buildReferenceImageMediaIds(images: SelectedLabImage[]): string[];
|
|
450
450
|
|
|
451
|
-
declare const LIB_VERSION = "1.2.
|
|
451
|
+
declare const LIB_VERSION = "1.2.9";
|
|
452
452
|
|
|
453
453
|
export { AvatarArchitectApp, type AvatarArchitectAppProps, CollapsibleCard, CompactDropdown, type ExtractedCharacter, FaToolsBadge, type FlowSdk, GLOBAL_STYLES, type Generation, HistoryPanel, InspectPanel, LIB_VERSION, LabBlend, LabCompare, type LabFrame, LabImagePicker, type LabItem, LabLoop, LabRemix, type LabServices, LabsTab, ListView, type MediaItem, MediaLibrary, PillButton, type ProjectMeta, type ProjectSettings, ProjectSyncTab, PromptTab, SectionLabel, type SelectedLabImage, type SelectedTag, SetupPanel, type SyncDiff, TagManagerPanel, type TagOption, type WorkspaceTags, autoLabel, buildBlendInstruction, buildCompareInstruction, buildFallbackPrompt, buildGenerationPrompt, buildImageGenerationOptions, buildLoopInstruction, buildPromptTabPayload, buildReferenceImageMediaIds, buildRemixInstruction, buildScanInstruction, cleanAiResponse, createFlowServices, exportProjectToZip, formatTreeToMarkdown, frameToGeneration, getFormattedTimestamp, groupGenerationsToLabItems, importProjectFromZip, injectXMPMetadata, interpretSdkError, parsePromptFile, parsePromptResponse, useKeyboardNavigation, useOnClickOutside };
|
package/dist/index.js
CHANGED
|
@@ -326,21 +326,31 @@ async function hfUploadProject(zipBase64, name, token) {
|
|
|
326
326
|
if (!preRes.ok) throw new Error(`HF preupload failed: ${preRes.status} ${preRes.statusText}`);
|
|
327
327
|
const preData = await preRes.json();
|
|
328
328
|
const fileInfo = preData.files?.[0];
|
|
329
|
-
|
|
329
|
+
const debugInfo = JSON.stringify({ uploadMode: fileInfo?.uploadMode, hasUploadUrl: !!fileInfo?.uploadUrl, hasVerifyUrl: !!fileInfo?.verifyUrl, headerKeys: Object.keys(fileInfo?.header || {}), verifyHeaderKeys: Object.keys(fileInfo?.verifyHeader || {}) });
|
|
330
|
+
if (!fileInfo?.uploadMode) throw new Error(`HF preupload kein fileInfo: ${JSON.stringify(preData)}`);
|
|
331
|
+
if (fileInfo.uploadMode === "lfs") {
|
|
332
|
+
if (!fileInfo.uploadUrl) throw new Error(`HF preupload: kein uploadUrl \u2014 ${debugInfo}`);
|
|
330
333
|
const uploadRes = await fetch(fileInfo.uploadUrl, {
|
|
331
334
|
method: "PUT",
|
|
332
335
|
headers: { "Content-Type": "application/octet-stream", ...fileInfo.header || {} },
|
|
333
336
|
body: bytes
|
|
334
337
|
});
|
|
335
|
-
if (!uploadRes.ok)
|
|
338
|
+
if (!uploadRes.ok) {
|
|
339
|
+
const uploadErr = await uploadRes.text().catch(() => "");
|
|
340
|
+
throw new Error(`HF LFS upload failed: ${uploadRes.status} \u2014 ${uploadErr.slice(0, 200)}`);
|
|
341
|
+
}
|
|
336
342
|
if (fileInfo.verifyUrl) {
|
|
337
343
|
const verifyRes = await fetch(fileInfo.verifyUrl, {
|
|
338
344
|
method: "POST",
|
|
339
345
|
headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json", ...fileInfo.verifyHeader || {} },
|
|
340
346
|
body: JSON.stringify({ oid, size })
|
|
341
347
|
});
|
|
342
|
-
if (!verifyRes.ok)
|
|
348
|
+
if (!verifyRes.ok) {
|
|
349
|
+
const verifyErr = await verifyRes.text().catch(() => "");
|
|
350
|
+
throw new Error(`HF LFS verify failed: ${verifyRes.status} \u2014 ${verifyErr.slice(0, 200)}`);
|
|
351
|
+
}
|
|
343
352
|
}
|
|
353
|
+
} else if (fileInfo.uploadMode === "regular") {
|
|
344
354
|
}
|
|
345
355
|
const commitRes = await fetch(`${HF_BASE}/api/datasets/${HF_REPO}/commit/main`, {
|
|
346
356
|
method: "POST",
|
|
@@ -4595,7 +4605,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
4595
4605
|
}
|
|
4596
4606
|
|
|
4597
4607
|
// src/index.ts
|
|
4598
|
-
var LIB_VERSION = "1.2.
|
|
4608
|
+
var LIB_VERSION = "1.2.9";
|
|
4599
4609
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4600
4610
|
0 && (module.exports = {
|
|
4601
4611
|
AvatarArchitectApp,
|
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
hfDeleteProject,
|
|
8
8
|
hfListProjects,
|
|
9
9
|
hfUploadProject
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-5FBMUNEP.mjs";
|
|
11
11
|
|
|
12
12
|
// src/hooks/useOnClickOutside.ts
|
|
13
13
|
import { useEffect } from "react";
|
|
@@ -1547,7 +1547,7 @@ var ProjectSyncTab = ({
|
|
|
1547
1547
|
{
|
|
1548
1548
|
onClick: async () => {
|
|
1549
1549
|
try {
|
|
1550
|
-
const { hfDownloadProject } = await import("./hfStateService-
|
|
1550
|
+
const { hfDownloadProject } = await import("./hfStateService-PB325HBF.mjs");
|
|
1551
1551
|
const file = await hfDownloadProject(p.path, hfToken);
|
|
1552
1552
|
onHfLoad(file);
|
|
1553
1553
|
} catch (e) {
|
|
@@ -3507,7 +3507,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
3507
3507
|
onClick: async () => {
|
|
3508
3508
|
setIsLoadingFromHF(true);
|
|
3509
3509
|
try {
|
|
3510
|
-
const { hfListProjects: hfListProjects2, hfDownloadProject } = await import("./hfStateService-
|
|
3510
|
+
const { hfListProjects: hfListProjects2, hfDownloadProject } = await import("./hfStateService-PB325HBF.mjs");
|
|
3511
3511
|
const projects = await hfListProjects2(hfToken);
|
|
3512
3512
|
if (projects.length > 0) {
|
|
3513
3513
|
const file = await hfDownloadProject(projects[0].path, hfToken);
|
|
@@ -4165,7 +4165,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
4165
4165
|
}
|
|
4166
4166
|
|
|
4167
4167
|
// src/index.ts
|
|
4168
|
-
var LIB_VERSION = "1.2.
|
|
4168
|
+
var LIB_VERSION = "1.2.9";
|
|
4169
4169
|
export {
|
|
4170
4170
|
AvatarArchitectApp,
|
|
4171
4171
|
CollapsibleCard,
|