@sogni-ai/sogni-client 5.63.1 → 5.63.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/CHANGELOG.md +14 -0
- package/README.md +5 -2
- package/dist/Projects/index.js +19 -58
- package/dist/Projects/index.js.map +1 -1
- package/dist/Projects/utils/fileContentType.d.ts +18 -0
- package/dist/Projects/utils/fileContentType.js +63 -0
- package/dist/Projects/utils/fileContentType.js.map +1 -0
- package/dist/lib/AuthManager/TokenAuthManager.js +16 -2
- package/dist/lib/AuthManager/TokenAuthManager.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist-esm/Projects/index.js +9 -48
- package/dist-esm/Projects/index.js.map +1 -1
- package/dist-esm/Projects/utils/fileContentType.js +60 -0
- package/dist-esm/Projects/utils/fileContentType.js.map +1 -0
- package/dist-esm/lib/AuthManager/TokenAuthManager.js +16 -2
- package/dist-esm/lib/AuthManager/TokenAuthManager.js.map +1 -1
- package/dist-esm/version.js +1 -1
- package/package.json +2 -1
- package/src/Projects/index.ts +9 -43
- package/src/Projects/utils/fileContentType.ts +55 -0
- package/src/lib/AuthManager/TokenAuthManager.ts +16 -1
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [5.63.3](https://github.com/Sogni-AI/sogni-client/compare/v5.63.2...v5.63.3) (2026-10-14)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **projects:** declare FLAC, Ogg and WebM reference files by their bytes ([4b03ac8](https://github.com/Sogni-AI/sogni-client/commit/4b03ac80ca792746fdfc69a60833cff9cf054702))
|
|
7
|
+
|
|
8
|
+
## [5.63.2](https://github.com/Sogni-AI/sogni-client/compare/v5.63.1...v5.63.2) (2026-10-12)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **auth:** sign out when a token refresh response has no token pair ([d25bf17](https://github.com/Sogni-AI/sogni-client/commit/d25bf17221b32e63e5213d138f64191eb303c7f2))
|
|
14
|
+
|
|
1
15
|
## [5.63.1](https://github.com/Sogni-AI/sogni-client/compare/v5.63.0...v5.63.1) (2026-10-10)
|
|
2
16
|
|
|
3
17
|
|
package/README.md
CHANGED
|
@@ -1524,8 +1524,11 @@ const workflow = await sogni.workflows.start({
|
|
|
1524
1524
|
}
|
|
1525
1525
|
},
|
|
1526
1526
|
{
|
|
1527
|
+
// animate_photo starts the clip from the keyframe. generate_video's
|
|
1528
|
+
// referenceImageIndices are loose references, which only Seedance,
|
|
1529
|
+
// HappyHorse, Wan 3 and MiniMax H3 reference-to-video accept.
|
|
1527
1530
|
id: 'clip',
|
|
1528
|
-
toolName: '
|
|
1531
|
+
toolName: 'animate_photo',
|
|
1529
1532
|
arguments: {
|
|
1530
1533
|
prompt: 'slow dolly-in, warm stage lights, subtle hand motion',
|
|
1531
1534
|
videoModel: 'ltx23',
|
|
@@ -1535,7 +1538,7 @@ const workflow = await sogni.workflows.start({
|
|
|
1535
1538
|
{
|
|
1536
1539
|
sourceStepId: 'keyframe',
|
|
1537
1540
|
sourceArtifactIndex: 0,
|
|
1538
|
-
targetArgument: '
|
|
1541
|
+
targetArgument: 'sourceImageIndex',
|
|
1539
1542
|
mediaType: 'image',
|
|
1540
1543
|
transform: 'image_index',
|
|
1541
1544
|
required: true
|
package/dist/Projects/index.js
CHANGED
|
@@ -58,6 +58,7 @@ const getUUID_js_1 = __importDefault(require("../lib/getUUID.js"));
|
|
|
58
58
|
const Cache_js_1 = __importDefault(require("../lib/Cache.js"));
|
|
59
59
|
const Job_js_1 = require("./Job.js");
|
|
60
60
|
const index_js_2 = require("./utils/index.js");
|
|
61
|
+
const fileContentType_js_1 = require("./utils/fileContentType.js");
|
|
61
62
|
const validation_js_1 = require("../lib/validation.js");
|
|
62
63
|
const ModelTiersRaw_js_1 = require("./types/ModelTiersRaw.js");
|
|
63
64
|
const ModelOptions_js_1 = require("./types/ModelOptions.js");
|
|
@@ -186,46 +187,6 @@ function deriveLoraCapableModelIds(loras) {
|
|
|
186
187
|
}
|
|
187
188
|
return Array.from(modelIds).sort();
|
|
188
189
|
}
|
|
189
|
-
/**
|
|
190
|
-
* Detect content type from a file object.
|
|
191
|
-
* For File objects in browser, uses the type property.
|
|
192
|
-
* Returns undefined if content type cannot be detected.
|
|
193
|
-
*/
|
|
194
|
-
function getFileContentType(file) {
|
|
195
|
-
if (file instanceof Blob && 'type' in file && file.type) {
|
|
196
|
-
return file.type;
|
|
197
|
-
}
|
|
198
|
-
if (typeof Buffer !== 'undefined' && Buffer.isBuffer(file)) {
|
|
199
|
-
if (file.length >= 12) {
|
|
200
|
-
if (file[0] === 0xff && file[1] === 0xd8 && file[2] === 0xff)
|
|
201
|
-
return 'image/jpeg';
|
|
202
|
-
if (file[0] === 0x89 && file[1] === 0x50 && file[2] === 0x4e && file[3] === 0x47) {
|
|
203
|
-
return 'image/png';
|
|
204
|
-
}
|
|
205
|
-
if (file.toString('ascii', 0, 4) === 'RIFF' && file.toString('ascii', 8, 12) === 'WEBP') {
|
|
206
|
-
return 'image/webp';
|
|
207
|
-
}
|
|
208
|
-
if (file.toString('ascii', 0, 3) === 'GIF')
|
|
209
|
-
return 'image/gif';
|
|
210
|
-
if (file.toString('ascii', 4, 8) === 'ftyp') {
|
|
211
|
-
const brand = file.toString('ascii', 8, 12).toLowerCase();
|
|
212
|
-
if (brand.includes('m4a') || brand.includes('m4b'))
|
|
213
|
-
return 'audio/mp4';
|
|
214
|
-
if (brand.includes('qt'))
|
|
215
|
-
return 'video/quicktime';
|
|
216
|
-
return 'video/mp4';
|
|
217
|
-
}
|
|
218
|
-
if (file.toString('ascii', 0, 4) === 'RIFF' && file.toString('ascii', 8, 12) === 'WAVE') {
|
|
219
|
-
return 'audio/wav';
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
if (file.length >= 3 && file.toString('ascii', 0, 3) === 'ID3')
|
|
223
|
-
return 'audio/mpeg';
|
|
224
|
-
if (file.length >= 2 && file[0] === 0xff && (file[1] & 0xe0) === 0xe0)
|
|
225
|
-
return 'audio/mpeg';
|
|
226
|
-
}
|
|
227
|
-
return undefined;
|
|
228
|
-
}
|
|
229
190
|
/**
|
|
230
191
|
* Convert file to a format compatible with fetch body.
|
|
231
192
|
* Converts Node.js Buffer to Blob for cross-platform compatibility.
|
|
@@ -2066,7 +2027,7 @@ class ProjectsApi extends ApiGroup_js_1.default {
|
|
|
2066
2027
|
if (!keyFrame)
|
|
2067
2028
|
return;
|
|
2068
2029
|
if (data.referenceAudio && data.referenceAudio !== true) {
|
|
2069
|
-
keyFrame.referenceAudioContentType = getFileContentType(data.referenceAudio);
|
|
2030
|
+
keyFrame.referenceAudioContentType = (0, fileContentType_js_1.getFileContentType)(data.referenceAudio, 'audio');
|
|
2070
2031
|
}
|
|
2071
2032
|
}
|
|
2072
2033
|
_processVideoAssets(project, data) {
|
|
@@ -2123,37 +2084,37 @@ class ProjectsApi extends ApiGroup_js_1.default {
|
|
|
2123
2084
|
if (!keyFrame)
|
|
2124
2085
|
return;
|
|
2125
2086
|
if (data.referenceImage && data.referenceImage !== true) {
|
|
2126
|
-
keyFrame.referenceImageContentType = getFileContentType(data.referenceImage);
|
|
2087
|
+
keyFrame.referenceImageContentType = (0, fileContentType_js_1.getFileContentType)(data.referenceImage);
|
|
2127
2088
|
}
|
|
2128
2089
|
if (data.referenceImageEnd && data.referenceImageEnd !== true) {
|
|
2129
|
-
keyFrame.referenceImageEndContentType = getFileContentType(data.referenceImageEnd);
|
|
2090
|
+
keyFrame.referenceImageEndContentType = (0, fileContentType_js_1.getFileContentType)(data.referenceImageEnd);
|
|
2130
2091
|
}
|
|
2131
2092
|
const isMinimaxH3R2v = (0, index_js_2.isMinimaxH3ReferenceModel)(data.modelId);
|
|
2132
2093
|
if (!isMinimaxH3R2v && data.referenceAudio && data.referenceAudio !== true) {
|
|
2133
|
-
keyFrame.referenceAudioContentType = getFileContentType(data.referenceAudio);
|
|
2094
|
+
keyFrame.referenceAudioContentType = (0, fileContentType_js_1.getFileContentType)(data.referenceAudio, 'audio');
|
|
2134
2095
|
}
|
|
2135
2096
|
if (data.referenceAudioIdentity && data.referenceAudioIdentity !== true) {
|
|
2136
|
-
const contentType = getFileContentType(data.referenceAudioIdentity);
|
|
2097
|
+
const contentType = (0, fileContentType_js_1.getFileContentType)(data.referenceAudioIdentity, 'audio');
|
|
2137
2098
|
keyFrame.referenceAudioIdentityContentType = contentType;
|
|
2138
2099
|
(_b = keyFrame.referenceAudioContentType) !== null && _b !== void 0 ? _b : (keyFrame.referenceAudioContentType = contentType);
|
|
2139
2100
|
}
|
|
2140
2101
|
if (!isMinimaxH3R2v && data.referenceVideo && data.referenceVideo !== true) {
|
|
2141
|
-
keyFrame.referenceVideoContentType = getFileContentType(data.referenceVideo);
|
|
2102
|
+
keyFrame.referenceVideoContentType = (0, fileContentType_js_1.getFileContentType)(data.referenceVideo, 'video');
|
|
2142
2103
|
}
|
|
2143
2104
|
if (isMinimaxH3R2v) {
|
|
2144
2105
|
for (const { slot, media } of (0, index_js_2.getMinimaxH3ReferenceAudioSlots)(data)) {
|
|
2145
2106
|
if (typeof media !== 'boolean') {
|
|
2146
|
-
keyFrame[`referenceAudio${slot}ContentType`] = getFileContentType(media);
|
|
2107
|
+
keyFrame[`referenceAudio${slot}ContentType`] = (0, fileContentType_js_1.getFileContentType)(media, 'audio');
|
|
2147
2108
|
}
|
|
2148
2109
|
}
|
|
2149
2110
|
for (const { slot, media } of (0, index_js_2.getMinimaxH3ReferenceVideoSlots)(data)) {
|
|
2150
2111
|
if (typeof media !== 'boolean') {
|
|
2151
|
-
keyFrame[`referenceVideo${slot}ContentType`] = getFileContentType(media);
|
|
2112
|
+
keyFrame[`referenceVideo${slot}ContentType`] = (0, fileContentType_js_1.getFileContentType)(media, 'video');
|
|
2152
2113
|
}
|
|
2153
2114
|
}
|
|
2154
2115
|
}
|
|
2155
2116
|
if (data.referenceMask && data.referenceMask !== true && (0, index_js_2.usesReferenceMask)(data)) {
|
|
2156
|
-
keyFrame.referenceMaskContentType = getFileContentType(data.referenceMask);
|
|
2117
|
+
keyFrame.referenceMaskContentType = (0, fileContentType_js_1.getFileContentType)(data.referenceMask);
|
|
2157
2118
|
}
|
|
2158
2119
|
}
|
|
2159
2120
|
/**
|
|
@@ -2491,7 +2452,7 @@ class ProjectsApi extends ApiGroup_js_1.default {
|
|
|
2491
2452
|
const imageId = (0, getUUID_js_1.default)();
|
|
2492
2453
|
const assertSession = (_a = this._preparingSessions.get(projectId)) !== null && _a !== void 0 ? _a : (0, requestSession_js_1.captureRequestSession)(this.client.auth);
|
|
2493
2454
|
assertSession();
|
|
2494
|
-
const contentType = getFileContentType(file);
|
|
2455
|
+
const contentType = (0, fileContentType_js_1.getFileContentType)(file);
|
|
2495
2456
|
if (yield this.assets.tryBindFile(file, contentType, { projectId, type: 'startingImage' }))
|
|
2496
2457
|
return imageId;
|
|
2497
2458
|
assertSession();
|
|
@@ -2527,7 +2488,7 @@ class ProjectsApi extends ApiGroup_js_1.default {
|
|
|
2527
2488
|
const imageId = (0, getUUID_js_1.default)();
|
|
2528
2489
|
const assertSession = (_a = this._preparingSessions.get(projectId)) !== null && _a !== void 0 ? _a : (0, requestSession_js_1.captureRequestSession)(this.client.auth);
|
|
2529
2490
|
assertSession();
|
|
2530
|
-
const contentType = getFileContentType(file);
|
|
2491
|
+
const contentType = (0, fileContentType_js_1.getFileContentType)(file);
|
|
2531
2492
|
if (yield this.assets.tryBindFile(file, contentType, { projectId, type: 'cnImage' }))
|
|
2532
2493
|
return imageId;
|
|
2533
2494
|
assertSession();
|
|
@@ -2564,7 +2525,7 @@ class ProjectsApi extends ApiGroup_js_1.default {
|
|
|
2564
2525
|
const imageIndex = (index + 1);
|
|
2565
2526
|
const assertSession = (_a = this._preparingSessions.get(projectId)) !== null && _a !== void 0 ? _a : (0, requestSession_js_1.captureRequestSession)(this.client.auth);
|
|
2566
2527
|
assertSession();
|
|
2567
|
-
const contentType = getFileContentType(file);
|
|
2528
|
+
const contentType = (0, fileContentType_js_1.getFileContentType)(file);
|
|
2568
2529
|
if (yield this.assets.tryBindFile(file, contentType, {
|
|
2569
2530
|
projectId,
|
|
2570
2531
|
type: `contextImage${imageIndex}`
|
|
@@ -2610,7 +2571,7 @@ class ProjectsApi extends ApiGroup_js_1.default {
|
|
|
2610
2571
|
const type = `keyframeImage${slot}`;
|
|
2611
2572
|
const assertSession = (_a = this._preparingSessions.get(projectId)) !== null && _a !== void 0 ? _a : (0, requestSession_js_1.captureRequestSession)(this.client.auth);
|
|
2612
2573
|
assertSession();
|
|
2613
|
-
const contentType = getFileContentType(file);
|
|
2574
|
+
const contentType = (0, fileContentType_js_1.getFileContentType)(file);
|
|
2614
2575
|
if (yield this.assets.tryBindFile(file, contentType, { projectId, type }))
|
|
2615
2576
|
return imageId;
|
|
2616
2577
|
assertSession();
|
|
@@ -2648,7 +2609,7 @@ class ProjectsApi extends ApiGroup_js_1.default {
|
|
|
2648
2609
|
const imageId = (0, getUUID_js_1.default)();
|
|
2649
2610
|
const assertSession = (_a = this._preparingSessions.get(projectId)) !== null && _a !== void 0 ? _a : (0, requestSession_js_1.captureRequestSession)(this.client.auth);
|
|
2650
2611
|
assertSession();
|
|
2651
|
-
const contentType = getFileContentType(file);
|
|
2612
|
+
const contentType = (0, fileContentType_js_1.getFileContentType)(file);
|
|
2652
2613
|
if (yield this.assets.tryBindFile(file, contentType, { projectId, type: 'referenceImage' }))
|
|
2653
2614
|
return imageId;
|
|
2654
2615
|
assertSession();
|
|
@@ -2688,7 +2649,7 @@ class ProjectsApi extends ApiGroup_js_1.default {
|
|
|
2688
2649
|
const imageId = (0, getUUID_js_1.default)();
|
|
2689
2650
|
const assertSession = (_a = this._preparingSessions.get(projectId)) !== null && _a !== void 0 ? _a : (0, requestSession_js_1.captureRequestSession)(this.client.auth);
|
|
2690
2651
|
assertSession();
|
|
2691
|
-
const contentType = getFileContentType(file);
|
|
2652
|
+
const contentType = (0, fileContentType_js_1.getFileContentType)(file);
|
|
2692
2653
|
if (yield this.assets.tryBindFile(file, contentType, { projectId, type: 'referenceMask' }))
|
|
2693
2654
|
return imageId;
|
|
2694
2655
|
assertSession();
|
|
@@ -2728,7 +2689,7 @@ class ProjectsApi extends ApiGroup_js_1.default {
|
|
|
2728
2689
|
const imageId = (0, getUUID_js_1.default)();
|
|
2729
2690
|
const assertSession = (_a = this._preparingSessions.get(projectId)) !== null && _a !== void 0 ? _a : (0, requestSession_js_1.captureRequestSession)(this.client.auth);
|
|
2730
2691
|
assertSession();
|
|
2731
|
-
const contentType = getFileContentType(file);
|
|
2692
|
+
const contentType = (0, fileContentType_js_1.getFileContentType)(file);
|
|
2732
2693
|
if (yield this.assets.tryBindFile(file, contentType, { projectId, type: 'referenceImageEnd' }))
|
|
2733
2694
|
return imageId;
|
|
2734
2695
|
assertSession();
|
|
@@ -2769,7 +2730,7 @@ class ProjectsApi extends ApiGroup_js_1.default {
|
|
|
2769
2730
|
var _a;
|
|
2770
2731
|
const assertSession = (_a = this._preparingSessions.get(projectId)) !== null && _a !== void 0 ? _a : (0, requestSession_js_1.captureRequestSession)(this.client.auth);
|
|
2771
2732
|
assertSession();
|
|
2772
|
-
const contentType = getFileContentType(file);
|
|
2733
|
+
const contentType = (0, fileContentType_js_1.getFileContentType)(file, 'audio');
|
|
2773
2734
|
if (yield this.assets.tryBindFile(file, contentType, { projectId, type: 'referenceAudio', id }))
|
|
2774
2735
|
return;
|
|
2775
2736
|
assertSession();
|
|
@@ -2809,7 +2770,7 @@ class ProjectsApi extends ApiGroup_js_1.default {
|
|
|
2809
2770
|
var _a;
|
|
2810
2771
|
const assertSession = (_a = this._preparingSessions.get(projectId)) !== null && _a !== void 0 ? _a : (0, requestSession_js_1.captureRequestSession)(this.client.auth);
|
|
2811
2772
|
assertSession();
|
|
2812
|
-
const contentType = getFileContentType(file);
|
|
2773
|
+
const contentType = (0, fileContentType_js_1.getFileContentType)(file, 'video');
|
|
2813
2774
|
if (yield this.assets.tryBindFile(file, contentType, { projectId, type: 'referenceVideo', id }))
|
|
2814
2775
|
return;
|
|
2815
2776
|
assertSession();
|