@nodaro/shared 2.24.0 → 2.26.0
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.cjs +50 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +59 -310
- package/dist/index.d.ts +59 -310
- package/dist/index.js +48 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/studio-transient.test.ts +205 -0
- package/src/index.ts +6 -8
- package/src/studio-transient.ts +124 -0
- package/src/studio-production-wire.ts +0 -344
package/dist/index.cjs
CHANGED
|
@@ -14679,6 +14679,53 @@ function entityScalarFields(kind) {
|
|
|
14679
14679
|
return [...ENTITY_SCALAR_FIELDS, ...ENTITY_KIND_SCALAR_FIELDS[kind]];
|
|
14680
14680
|
}
|
|
14681
14681
|
|
|
14682
|
+
// src/studio-transient.ts
|
|
14683
|
+
var STUDIO_TRANSIENT_KEYS = [
|
|
14684
|
+
"trash",
|
|
14685
|
+
"pendingStills",
|
|
14686
|
+
"pendingClips",
|
|
14687
|
+
// The two markers that genuinely DO live at this level: a soundtrack render
|
|
14688
|
+
// and a story-planning run in flight. Same rule as the per-shot pair — they
|
|
14689
|
+
// name jobs on the owner's account and nobody else can land them.
|
|
14690
|
+
"pendingMusic",
|
|
14691
|
+
"pendingDraft",
|
|
14692
|
+
"freecutDraftUrl"
|
|
14693
|
+
];
|
|
14694
|
+
var STUDIO_SHOT_TRANSIENT_KEYS = ["pendingClips", "pendingClip", "pendingStills"];
|
|
14695
|
+
function withoutKeys(source, drop) {
|
|
14696
|
+
const kept = {};
|
|
14697
|
+
for (const [key, value] of Object.entries(source)) {
|
|
14698
|
+
if (drop.includes(key)) continue;
|
|
14699
|
+
kept[key] = value;
|
|
14700
|
+
}
|
|
14701
|
+
return kept;
|
|
14702
|
+
}
|
|
14703
|
+
function stripShots(value) {
|
|
14704
|
+
if (!Array.isArray(value)) return value;
|
|
14705
|
+
let changed = false;
|
|
14706
|
+
const out = value.map((entry) => {
|
|
14707
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry)) return entry;
|
|
14708
|
+
const shot = entry;
|
|
14709
|
+
if (!STUDIO_SHOT_TRANSIENT_KEYS.some((key) => key in shot)) return entry;
|
|
14710
|
+
changed = true;
|
|
14711
|
+
return withoutKeys(shot, STUDIO_SHOT_TRANSIENT_KEYS);
|
|
14712
|
+
});
|
|
14713
|
+
return changed ? out : value;
|
|
14714
|
+
}
|
|
14715
|
+
function stripStudioTransientSettings(settings) {
|
|
14716
|
+
if (!settings || typeof settings !== "object") return settings;
|
|
14717
|
+
const studio = settings.studio;
|
|
14718
|
+
if (!studio || typeof studio !== "object" || Array.isArray(studio)) return settings;
|
|
14719
|
+
const source = studio;
|
|
14720
|
+
const kept = withoutKeys(source, STUDIO_TRANSIENT_KEYS);
|
|
14721
|
+
const shots = stripShots(source.shots);
|
|
14722
|
+
if (source.shots !== void 0) kept.shots = shots;
|
|
14723
|
+
if (Object.keys(kept).length === Object.keys(source).length && shots === source.shots) {
|
|
14724
|
+
return settings;
|
|
14725
|
+
}
|
|
14726
|
+
return { ...settings, studio: kept };
|
|
14727
|
+
}
|
|
14728
|
+
|
|
14682
14729
|
exports.ACCESS_LEVELS = ACCESS_LEVELS;
|
|
14683
14730
|
exports.ACTIVE_SCENE_HELPERS = ACTIVE_SCENE_HELPERS;
|
|
14684
14731
|
exports.ADVANCED_MODE_UNAVAILABLE_REASON = ADVANCED_MODE_UNAVAILABLE_REASON;
|
|
@@ -15042,6 +15089,8 @@ exports.STAGE_PATCH_SCHEMA = STAGE_PATCH_SCHEMA;
|
|
|
15042
15089
|
exports.STATIC_CAPTION_STYLES = STATIC_CAPTION_STYLES;
|
|
15043
15090
|
exports.STRUCTURAL_SECTIONS = STRUCTURAL_SECTIONS;
|
|
15044
15091
|
exports.STRUCTURED_VISION_MODELS = STRUCTURED_VISION_MODELS;
|
|
15092
|
+
exports.STUDIO_SHOT_TRANSIENT_KEYS = STUDIO_SHOT_TRANSIENT_KEYS;
|
|
15093
|
+
exports.STUDIO_TRANSIENT_KEYS = STUDIO_TRANSIENT_KEYS;
|
|
15045
15094
|
exports.SUBMISSION_STATUSES = SUBMISSION_STATUSES;
|
|
15046
15095
|
exports.SUNO_ADD_TRACK_MODELS = SUNO_ADD_TRACK_MODELS;
|
|
15047
15096
|
exports.SUNO_FIELD_HANDLE_FIELDS = SUNO_FIELD_HANDLE_FIELDS;
|
|
@@ -15490,6 +15539,7 @@ exports.spreadJsonArrayIfSingleton = spreadJsonArrayIfSingleton;
|
|
|
15490
15539
|
exports.stringifyPathResults = stringifyPathResults;
|
|
15491
15540
|
exports.stripDerivedAnalysisFields = stripDerivedAnalysisFields;
|
|
15492
15541
|
exports.stripExportContent = stripExportContent;
|
|
15542
|
+
exports.stripStudioTransientSettings = stripStudioTransientSettings;
|
|
15493
15543
|
exports.stripTransientRuntimeData = stripTransientRuntimeData;
|
|
15494
15544
|
exports.sunoCreditType = sunoCreditType;
|
|
15495
15545
|
exports.supportedDefaultDimensions = supportedDefaultDimensions;
|