@happyvertical/smrt-video 0.37.2 → 0.37.4
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/chunks/owned-asset-utils-Da0Tlhhl.js +101 -0
- package/dist/chunks/owned-asset-utils-Da0Tlhhl.js.map +1 -0
- package/dist/chunks/performer-DlDaK50F.js +144 -0
- package/dist/chunks/performer-DlDaK50F.js.map +1 -0
- package/dist/chunks/scene-CCQdUj6S.js +172 -0
- package/dist/chunks/scene-CCQdUj6S.js.map +1 -0
- package/dist/index.js +1087 -1827
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +2 -2
- package/dist/smrt-knowledge.json +8 -8
- package/package.json +16 -16
package/dist/index.js
CHANGED
|
@@ -1,1904 +1,1164 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { a as listLegacyOwnedAssetIds, i as listCanonicalOwnedAssetIds, n as assertValidVideoAssetSortOrder, o as mergeOwnedAssetIds, r as legacyVideoAssetMetaTypes, s as resolveOwnedAssets, t as assertValidVideoAssetRole } from "./chunks/owned-asset-utils-Da0Tlhhl.js";
|
|
2
|
+
import { t as Performer } from "./chunks/performer-DlDaK50F.js";
|
|
3
|
+
import { t as Scene } from "./chunks/scene-CCQdUj6S.js";
|
|
4
|
+
import { ObjectRegistry, SmrtCollection, SmrtJunction, SmrtObject, crossPackageRef, field, foreignKey, smrt } from "@happyvertical/smrt-core";
|
|
5
|
+
import { TenantScoped, queryGlobal, tenantId } from "@happyvertical/smrt-tenancy";
|
|
6
|
+
import { Asset, persistMediaBundleInspection } from "@happyvertical/smrt-assets";
|
|
5
7
|
import { Content } from "@happyvertical/smrt-content";
|
|
6
8
|
import { createLogger } from "@happyvertical/logger";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"video_composition_id"
|
|
18
|
-
];
|
|
19
|
-
function getQueryRows(result) {
|
|
20
|
-
if (Array.isArray(result)) {
|
|
21
|
-
return result;
|
|
22
|
-
}
|
|
23
|
-
if (typeof result === "object" && result !== null && "rows" in result && Array.isArray(result.rows)) {
|
|
24
|
-
return result.rows;
|
|
25
|
-
}
|
|
26
|
-
return [];
|
|
27
|
-
}
|
|
28
|
-
function isMissingSchemaError(error, target) {
|
|
29
|
-
const message = error instanceof Error ? error.message.toLowerCase() : String(error).toLowerCase();
|
|
30
|
-
const isMissing = message.includes("no such table") || message.includes("no such column") || message.includes("does not exist") || message.includes("unknown column");
|
|
31
|
-
if (!isMissing) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
return !target || message.includes(target.toLowerCase());
|
|
35
|
-
}
|
|
36
|
-
function buildPlaceholders(count) {
|
|
37
|
-
return Array.from({ length: count }, () => "?").join(", ");
|
|
38
|
-
}
|
|
39
|
-
function uniqueAssetIds(assetIds) {
|
|
40
|
-
const seen = /* @__PURE__ */ new Set();
|
|
41
|
-
const result = [];
|
|
42
|
-
for (const assetId of assetIds) {
|
|
43
|
-
if (!assetId || seen.has(assetId)) {
|
|
44
|
-
continue;
|
|
45
|
-
}
|
|
46
|
-
seen.add(assetId);
|
|
47
|
-
result.push(assetId);
|
|
48
|
-
}
|
|
49
|
-
return result;
|
|
50
|
-
}
|
|
51
|
-
function mergeOwnedAssetIds(...groups) {
|
|
52
|
-
const seen = /* @__PURE__ */ new Set();
|
|
53
|
-
const merged = [];
|
|
54
|
-
for (const group of groups) {
|
|
55
|
-
for (const assetId of group) {
|
|
56
|
-
if (!assetId || seen.has(assetId)) {
|
|
57
|
-
continue;
|
|
58
|
-
}
|
|
59
|
-
seen.add(assetId);
|
|
60
|
-
merged.push(assetId);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return merged;
|
|
64
|
-
}
|
|
65
|
-
function assertValidVideoAssetRole(role) {
|
|
66
|
-
if (!VIDEO_ASSET_ROLE_PATTERN.test(role)) {
|
|
67
|
-
throw new Error(
|
|
68
|
-
`Invalid asset role "${role}"; must start with a letter or underscore and contain only letters, digits, underscores, and hyphens`
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
function assertValidVideoAssetSortOrder(sortOrder) {
|
|
73
|
-
if (!Number.isInteger(sortOrder) || sortOrder < 0 || sortOrder > 2147483647) {
|
|
74
|
-
throw new Error(
|
|
75
|
-
`Invalid sortOrder "${sortOrder}"; must be a non-negative integer`
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
async function resolveOwnedAssets(db, tenantId2, assetIds) {
|
|
80
|
-
const orderedIds = uniqueAssetIds(assetIds);
|
|
81
|
-
if (orderedIds.length === 0) {
|
|
82
|
-
return [];
|
|
83
|
-
}
|
|
84
|
-
const assets = await AssetCollection.create({ db });
|
|
85
|
-
let resolved;
|
|
86
|
-
try {
|
|
87
|
-
resolved = tenantId2 ? await withSystemContext(async () => assets.listByIds(orderedIds)) : await assets.listByIds(orderedIds);
|
|
88
|
-
} catch (error) {
|
|
89
|
-
if (isMissingSchemaError(error, "assets")) {
|
|
90
|
-
return [];
|
|
91
|
-
}
|
|
92
|
-
throw error;
|
|
93
|
-
}
|
|
94
|
-
const visibleAssets = tenantId2 ? resolved.filter(
|
|
95
|
-
(asset) => asset.tenantId === tenantId2 || asset.tenantId === null
|
|
96
|
-
) : resolved;
|
|
97
|
-
const assetsById = new Map(
|
|
98
|
-
visibleAssets.filter((asset) => asset.id).map((asset) => [asset.id, asset])
|
|
99
|
-
);
|
|
100
|
-
return orderedIds.map((assetId) => assetsById.get(assetId)).filter(Boolean);
|
|
101
|
-
}
|
|
102
|
-
async function listCanonicalOwnedAssetIds(options) {
|
|
103
|
-
try {
|
|
104
|
-
return uniqueAssetIds(
|
|
105
|
-
(await options.loadLinks()).map((link) => link.assetId)
|
|
106
|
-
);
|
|
107
|
-
} catch (error) {
|
|
108
|
-
if (isMissingSchemaError(error, options.tableName)) {
|
|
109
|
-
return [];
|
|
110
|
-
}
|
|
111
|
-
throw error;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
async function listLegacyOwnedAssetIds(options) {
|
|
115
|
-
const { db, ownerColumn, ownerId, role, metaTypes } = options;
|
|
116
|
-
if (!ownerId || metaTypes.length === 0) {
|
|
117
|
-
return [];
|
|
118
|
-
}
|
|
119
|
-
if (!VIDEO_ASSET_OWNER_COLUMNS.includes(ownerColumn)) {
|
|
120
|
-
throw new Error(`Unsupported video asset owner column "${ownerColumn}"`);
|
|
121
|
-
}
|
|
122
|
-
const params = [ownerId, ...metaTypes];
|
|
123
|
-
const clauses = [
|
|
124
|
-
`${ownerColumn} = ?`,
|
|
125
|
-
`_meta_type IN (${buildPlaceholders(metaTypes.length)})`
|
|
126
|
-
];
|
|
127
|
-
if (role) {
|
|
128
|
-
clauses.push("role = ?");
|
|
129
|
-
params.push(role);
|
|
130
|
-
}
|
|
131
|
-
try {
|
|
132
|
-
const result = await db.query(
|
|
133
|
-
`SELECT id
|
|
134
|
-
FROM assets
|
|
135
|
-
WHERE ${clauses.join(" AND ")}
|
|
136
|
-
ORDER BY created_at ASC, id ASC`,
|
|
137
|
-
...params
|
|
138
|
-
);
|
|
139
|
-
return uniqueAssetIds(
|
|
140
|
-
getQueryRows(result).map((row) => String(row?.id || ""))
|
|
141
|
-
);
|
|
142
|
-
} catch (error) {
|
|
143
|
-
if (isMissingSchemaError(error)) {
|
|
144
|
-
return [];
|
|
145
|
-
}
|
|
146
|
-
throw error;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
function legacyVideoAssetMetaTypes(className) {
|
|
150
|
-
return [className, `@happyvertical/smrt-video:${className}`];
|
|
151
|
-
}
|
|
152
|
-
var __defProp$j = Object.defineProperty;
|
|
153
|
-
var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
|
|
154
|
-
var __decorateClass$k = (decorators, target, key, kind) => {
|
|
155
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$k(target, key) : target;
|
|
156
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
157
|
-
if (decorator = decorators[i])
|
|
158
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
159
|
-
if (kind && result) __defProp$j(target, key, result);
|
|
160
|
-
return result;
|
|
9
|
+
//#region \0rolldown/runtime.js
|
|
10
|
+
var __defProp$19 = Object.defineProperty;
|
|
11
|
+
var __exportAll = (all, no_symbols) => {
|
|
12
|
+
let target = {};
|
|
13
|
+
for (var name in all) __defProp$19(target, name, {
|
|
14
|
+
get: all[name],
|
|
15
|
+
enumerable: true
|
|
16
|
+
});
|
|
17
|
+
if (!no_symbols) __defProp$19(target, Symbol.toStringTag, { value: "Module" });
|
|
18
|
+
return target;
|
|
161
19
|
};
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
/** Reference images for IP-Adapter (multiple angles/expressions) */
|
|
175
|
-
referenceAssetIds = [];
|
|
176
|
-
seedImageAssetId = null;
|
|
177
|
-
voiceProfileId = null;
|
|
178
|
-
/** Performer status */
|
|
179
|
-
status = "pending";
|
|
180
|
-
profileId = null;
|
|
181
|
-
constructor(options = {}) {
|
|
182
|
-
super(options);
|
|
183
|
-
if (options.name !== void 0) this.name = options.name;
|
|
184
|
-
if (options.description !== void 0)
|
|
185
|
-
this.description = options.description;
|
|
186
|
-
if (options.dna !== void 0) this.dna = options.dna;
|
|
187
|
-
if (options.referenceAssetIds !== void 0)
|
|
188
|
-
this.referenceAssetIds = options.referenceAssetIds;
|
|
189
|
-
if (options.seedImageAssetId !== void 0)
|
|
190
|
-
this.seedImageAssetId = options.seedImageAssetId;
|
|
191
|
-
if (options.voiceProfileId !== void 0)
|
|
192
|
-
this.voiceProfileId = options.voiceProfileId;
|
|
193
|
-
if (options.status !== void 0) this.status = options.status;
|
|
194
|
-
if (options.profileId !== void 0) this.profileId = options.profileId;
|
|
195
|
-
if (options.tenantId !== void 0) this.tenantId = options.tenantId;
|
|
196
|
-
}
|
|
197
|
-
async getPerformerAssetCollection() {
|
|
198
|
-
const { PerformerOwnedAssetCollection: PerformerOwnedAssetCollection2 } = await Promise.resolve().then(() => performerAssets);
|
|
199
|
-
return PerformerOwnedAssetCollection2.create({ db: this.db });
|
|
200
|
-
}
|
|
201
|
-
getLegacyFieldAssetIds(role) {
|
|
202
|
-
if (role === "reference") {
|
|
203
|
-
return this.referenceAssetIds;
|
|
204
|
-
}
|
|
205
|
-
if (role === "seed") {
|
|
206
|
-
return this.seedImageAssetId ? [this.seedImageAssetId] : [];
|
|
207
|
-
}
|
|
208
|
-
return [...this.referenceAssetIds, this.seedImageAssetId].filter(
|
|
209
|
-
(assetId) => Boolean(assetId)
|
|
210
|
-
);
|
|
211
|
-
}
|
|
212
|
-
setLegacyFieldAssetId(role, assetId) {
|
|
213
|
-
if (role === "seed") {
|
|
214
|
-
if (this.seedImageAssetId === assetId) {
|
|
215
|
-
return false;
|
|
216
|
-
}
|
|
217
|
-
this.seedImageAssetId = assetId;
|
|
218
|
-
return true;
|
|
219
|
-
}
|
|
220
|
-
if (this.referenceAssetIds.includes(assetId)) {
|
|
221
|
-
return false;
|
|
222
|
-
}
|
|
223
|
-
this.referenceAssetIds = [...this.referenceAssetIds, assetId];
|
|
224
|
-
return true;
|
|
225
|
-
}
|
|
226
|
-
clearLegacyFieldAssetId(assetId, role) {
|
|
227
|
-
let changed = false;
|
|
228
|
-
if ((!role || role === "seed") && this.seedImageAssetId === assetId) {
|
|
229
|
-
this.seedImageAssetId = null;
|
|
230
|
-
changed = true;
|
|
231
|
-
}
|
|
232
|
-
if (!role || role === "reference") {
|
|
233
|
-
const remaining = this.referenceAssetIds.filter(
|
|
234
|
-
(referenceAssetId) => referenceAssetId !== assetId
|
|
235
|
-
);
|
|
236
|
-
if (remaining.length !== this.referenceAssetIds.length) {
|
|
237
|
-
this.referenceAssetIds = remaining;
|
|
238
|
-
changed = true;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
return changed;
|
|
242
|
-
}
|
|
243
|
-
async getAssets(role) {
|
|
244
|
-
const canonicalAssetIds = this.id ? await listCanonicalOwnedAssetIds({
|
|
245
|
-
tableName: "performer_assets",
|
|
246
|
-
loadLinks: async () => (await this.getPerformerAssetCollection()).byLeft(
|
|
247
|
-
this.id,
|
|
248
|
-
role ? { role } : {}
|
|
249
|
-
)
|
|
250
|
-
}) : [];
|
|
251
|
-
const legacyFieldAssetIds = this.getLegacyFieldAssetIds(role);
|
|
252
|
-
const legacyOwnedAssetIds = this.id ? await listLegacyOwnedAssetIds({
|
|
253
|
-
db: this.db,
|
|
254
|
-
ownerColumn: "performer_id",
|
|
255
|
-
ownerId: this.id,
|
|
256
|
-
role,
|
|
257
|
-
metaTypes: legacyVideoAssetMetaTypes("PerformerAsset")
|
|
258
|
-
}) : [];
|
|
259
|
-
return resolveOwnedAssets(
|
|
260
|
-
this.db,
|
|
261
|
-
this.tenantId,
|
|
262
|
-
mergeOwnedAssetIds(
|
|
263
|
-
canonicalAssetIds,
|
|
264
|
-
legacyFieldAssetIds,
|
|
265
|
-
legacyOwnedAssetIds
|
|
266
|
-
)
|
|
267
|
-
);
|
|
268
|
-
}
|
|
269
|
-
async getAssetByRole(role) {
|
|
270
|
-
const assets = await this.getAssets(role);
|
|
271
|
-
return assets[0] || null;
|
|
272
|
-
}
|
|
273
|
-
async addAsset(asset, role = "reference", sortOrder = 0) {
|
|
274
|
-
if (!this.id || !asset.id) {
|
|
275
|
-
throw new Error("Cannot associate unsaved performer or asset");
|
|
276
|
-
}
|
|
277
|
-
assertValidVideoAssetRole(role);
|
|
278
|
-
assertValidVideoAssetSortOrder(sortOrder);
|
|
279
|
-
const performerAssets2 = await this.getPerformerAssetCollection();
|
|
280
|
-
await performerAssets2.attach(this.id, asset.id, {
|
|
281
|
-
role,
|
|
282
|
-
sortOrder,
|
|
283
|
-
tenantId: this.tenantId
|
|
284
|
-
});
|
|
285
|
-
if (this.setLegacyFieldAssetId(role, asset.id)) {
|
|
286
|
-
await this.save();
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
async removeAsset(assetId, role) {
|
|
290
|
-
if (!this.id) {
|
|
291
|
-
return;
|
|
292
|
-
}
|
|
293
|
-
const performerAssets2 = await this.getPerformerAssetCollection();
|
|
294
|
-
await performerAssets2.detach(this.id, assetId, role ? { role } : {});
|
|
295
|
-
if (this.clearLegacyFieldAssetId(assetId, role)) {
|
|
296
|
-
await this.save();
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
/** Check if the performer has reference images */
|
|
300
|
-
get hasReferences() {
|
|
301
|
-
return this.referenceAssetIds.length > 0;
|
|
302
|
-
}
|
|
303
|
-
/** Check if the performer has a face embedding */
|
|
304
|
-
get hasFaceEmbedding() {
|
|
305
|
-
return Array.isArray(this.dna.faceEmbedding) && this.dna.faceEmbedding.length > 0;
|
|
306
|
-
}
|
|
307
|
-
/** Check if the performer is ready for generation */
|
|
308
|
-
get isReady() {
|
|
309
|
-
return this.status === "ready" && this.hasReferences;
|
|
310
|
-
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/__smrt-register__.ts
|
|
22
|
+
ObjectRegistry.registerPackageManifest(new URL("./manifest.json", "" + import.meta.url));
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/character.ts
|
|
25
|
+
var __defProp$18 = Object.defineProperty;
|
|
26
|
+
var __getOwnPropDesc$18 = Object.getOwnPropertyDescriptor;
|
|
27
|
+
var __decorateClass$18 = (decorators, target, key, kind) => {
|
|
28
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$18(target, key) : target;
|
|
29
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
30
|
+
if (kind && result) __defProp$18(target, key, result);
|
|
31
|
+
return result;
|
|
311
32
|
};
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
33
|
+
var Character = class extends SmrtObject {
|
|
34
|
+
tenantId = null;
|
|
35
|
+
/** Human-readable name for the character */
|
|
36
|
+
name = "";
|
|
37
|
+
/** Description of the character persona */
|
|
38
|
+
description = null;
|
|
39
|
+
imageAssetId = null;
|
|
40
|
+
baseMotionAssetId = null;
|
|
41
|
+
voiceProfileId = null;
|
|
42
|
+
/** Branding configuration for video overlays */
|
|
43
|
+
brandingKit = {};
|
|
44
|
+
/** Character status */
|
|
45
|
+
status = "pending";
|
|
46
|
+
performerId = null;
|
|
47
|
+
defaultSceneId = null;
|
|
48
|
+
/** Scene-specific configurations */
|
|
49
|
+
sceneConfigs = [];
|
|
50
|
+
profileId = null;
|
|
51
|
+
constructor(options = {}) {
|
|
52
|
+
super(options);
|
|
53
|
+
if (options.name !== void 0) this.name = options.name;
|
|
54
|
+
if (options.description !== void 0) this.description = options.description;
|
|
55
|
+
if (options.imageAssetId !== void 0) this.imageAssetId = options.imageAssetId;
|
|
56
|
+
if (options.baseMotionAssetId !== void 0) this.baseMotionAssetId = options.baseMotionAssetId;
|
|
57
|
+
if (options.voiceProfileId !== void 0) this.voiceProfileId = options.voiceProfileId;
|
|
58
|
+
if (options.brandingKit !== void 0) this.brandingKit = options.brandingKit;
|
|
59
|
+
if (options.status !== void 0) this.status = options.status;
|
|
60
|
+
if (options.performerId !== void 0) this.performerId = options.performerId;
|
|
61
|
+
if (options.defaultSceneId !== void 0) this.defaultSceneId = options.defaultSceneId;
|
|
62
|
+
if (options.sceneConfigs !== void 0) this.sceneConfigs = options.sceneConfigs;
|
|
63
|
+
if (options.profileId !== void 0) this.profileId = options.profileId;
|
|
64
|
+
if (options.tenantId !== void 0) this.tenantId = options.tenantId;
|
|
65
|
+
}
|
|
66
|
+
async getCharacterAssetCollection() {
|
|
67
|
+
const { CharacterOwnedAssetCollection } = await Promise.resolve().then(() => character_assets_exports);
|
|
68
|
+
return CharacterOwnedAssetCollection.create({ db: this.db });
|
|
69
|
+
}
|
|
70
|
+
getLegacyFieldAssetIds(role) {
|
|
71
|
+
if (role === "seed-image") return this.imageAssetId ? [this.imageAssetId] : [];
|
|
72
|
+
if (role === "base-motion") return this.baseMotionAssetId ? [this.baseMotionAssetId] : [];
|
|
73
|
+
if (role === "logo") return this.brandingKit.logoAssetId ? [this.brandingKit.logoAssetId] : [];
|
|
74
|
+
return [
|
|
75
|
+
this.imageAssetId,
|
|
76
|
+
this.baseMotionAssetId,
|
|
77
|
+
this.brandingKit.logoAssetId || null
|
|
78
|
+
].filter((assetId) => Boolean(assetId));
|
|
79
|
+
}
|
|
80
|
+
setLegacyFieldAssetId(role, assetId) {
|
|
81
|
+
if (role === "seed-image") {
|
|
82
|
+
if (this.imageAssetId === assetId) return false;
|
|
83
|
+
this.imageAssetId = assetId;
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
if (role === "base-motion") {
|
|
87
|
+
if (this.baseMotionAssetId === assetId) return false;
|
|
88
|
+
this.baseMotionAssetId = assetId;
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
if ((this.brandingKit.logoAssetId || null) === assetId) return false;
|
|
92
|
+
this.brandingKit = {
|
|
93
|
+
...this.brandingKit,
|
|
94
|
+
logoAssetId: assetId
|
|
95
|
+
};
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
clearLegacyFieldAssetId(assetId, role) {
|
|
99
|
+
let changed = false;
|
|
100
|
+
if ((!role || role === "seed-image") && this.imageAssetId === assetId) {
|
|
101
|
+
this.imageAssetId = null;
|
|
102
|
+
changed = true;
|
|
103
|
+
}
|
|
104
|
+
if ((!role || role === "base-motion") && this.baseMotionAssetId === assetId) {
|
|
105
|
+
this.baseMotionAssetId = null;
|
|
106
|
+
changed = true;
|
|
107
|
+
}
|
|
108
|
+
if ((!role || role === "logo") && this.brandingKit.logoAssetId === assetId) {
|
|
109
|
+
this.brandingKit = {
|
|
110
|
+
...this.brandingKit,
|
|
111
|
+
logoAssetId: null
|
|
112
|
+
};
|
|
113
|
+
changed = true;
|
|
114
|
+
}
|
|
115
|
+
return changed;
|
|
116
|
+
}
|
|
117
|
+
async getAssets(role) {
|
|
118
|
+
const canonicalAssetIds = this.id ? await listCanonicalOwnedAssetIds({
|
|
119
|
+
tableName: "character_assets",
|
|
120
|
+
loadLinks: async () => (await this.getCharacterAssetCollection()).byLeft(this.id, role ? { role } : {})
|
|
121
|
+
}) : [];
|
|
122
|
+
const legacyFieldAssetIds = this.getLegacyFieldAssetIds(role);
|
|
123
|
+
const legacyOwnedAssetIds = this.id ? await listLegacyOwnedAssetIds({
|
|
124
|
+
db: this.db,
|
|
125
|
+
ownerColumn: "character_id",
|
|
126
|
+
ownerId: this.id,
|
|
127
|
+
role,
|
|
128
|
+
metaTypes: legacyVideoAssetMetaTypes("CharacterAsset")
|
|
129
|
+
}) : [];
|
|
130
|
+
return resolveOwnedAssets(this.db, this.tenantId, mergeOwnedAssetIds(canonicalAssetIds, legacyFieldAssetIds, legacyOwnedAssetIds));
|
|
131
|
+
}
|
|
132
|
+
async getAssetByRole(role) {
|
|
133
|
+
return (await this.getAssets(role))[0] || null;
|
|
134
|
+
}
|
|
135
|
+
async addAsset(asset, role = "seed-image", sortOrder = 0) {
|
|
136
|
+
if (!this.id || !asset.id) throw new Error("Cannot associate unsaved character or asset");
|
|
137
|
+
assertValidVideoAssetRole(role);
|
|
138
|
+
assertValidVideoAssetSortOrder(sortOrder);
|
|
139
|
+
await (await this.getCharacterAssetCollection()).attach(this.id, asset.id, {
|
|
140
|
+
role,
|
|
141
|
+
sortOrder,
|
|
142
|
+
tenantId: this.tenantId
|
|
143
|
+
});
|
|
144
|
+
if (this.setLegacyFieldAssetId(role, asset.id)) await this.save();
|
|
145
|
+
}
|
|
146
|
+
async removeAsset(assetId, role) {
|
|
147
|
+
if (!this.id) return;
|
|
148
|
+
await (await this.getCharacterAssetCollection()).detach(this.id, assetId, role ? { role } : {});
|
|
149
|
+
if (this.clearLegacyFieldAssetId(assetId, role)) await this.save();
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Check if the character has a pre-baked base motion video
|
|
153
|
+
* @deprecated Use getAssetByRole('base-motion') instead
|
|
154
|
+
*/
|
|
155
|
+
get hasBaseMotion() {
|
|
156
|
+
return this.baseMotionAssetId !== null;
|
|
157
|
+
}
|
|
158
|
+
/** Check if the character is complete and ready for video generation */
|
|
159
|
+
get isComplete() {
|
|
160
|
+
return this.imageAssetId !== null && this.voiceProfileId !== null && this.status === "ready";
|
|
161
|
+
}
|
|
346
162
|
};
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
return this.sourceAssetId ? [this.sourceAssetId] : [];
|
|
393
|
-
}
|
|
394
|
-
if (role === "env-map") {
|
|
395
|
-
return this.lightingProfile?.envMapAssetId ? [this.lightingProfile.envMapAssetId] : [];
|
|
396
|
-
}
|
|
397
|
-
if (role === "viewpoint-extract") {
|
|
398
|
-
return this.viewpoints.map((viewpoint) => viewpoint.extractedAssetId || null).filter((assetId) => Boolean(assetId));
|
|
399
|
-
}
|
|
400
|
-
return [
|
|
401
|
-
this.sourceAssetId,
|
|
402
|
-
this.lightingProfile?.envMapAssetId || null,
|
|
403
|
-
...this.viewpoints.map((viewpoint) => viewpoint.extractedAssetId || null)
|
|
404
|
-
].filter((assetId) => Boolean(assetId));
|
|
405
|
-
}
|
|
406
|
-
setLegacyFieldAssetId(role, assetId) {
|
|
407
|
-
if (role === "source") {
|
|
408
|
-
if (this.sourceAssetId === assetId) {
|
|
409
|
-
return false;
|
|
410
|
-
}
|
|
411
|
-
this.sourceAssetId = assetId;
|
|
412
|
-
return true;
|
|
413
|
-
}
|
|
414
|
-
if (role === "env-map") {
|
|
415
|
-
if ((this.lightingProfile?.envMapAssetId || null) === assetId) {
|
|
416
|
-
return false;
|
|
417
|
-
}
|
|
418
|
-
this.lightingProfile = {
|
|
419
|
-
...this.lightingProfile || {},
|
|
420
|
-
envMapAssetId: assetId
|
|
421
|
-
};
|
|
422
|
-
return true;
|
|
423
|
-
}
|
|
424
|
-
return false;
|
|
425
|
-
}
|
|
426
|
-
clearLegacyFieldAssetId(assetId, role) {
|
|
427
|
-
let changed = false;
|
|
428
|
-
if ((!role || role === "source") && this.sourceAssetId === assetId) {
|
|
429
|
-
this.sourceAssetId = null;
|
|
430
|
-
changed = true;
|
|
431
|
-
}
|
|
432
|
-
if ((!role || role === "env-map") && this.lightingProfile?.envMapAssetId === assetId) {
|
|
433
|
-
this.lightingProfile = {
|
|
434
|
-
...this.lightingProfile || {},
|
|
435
|
-
envMapAssetId: void 0
|
|
436
|
-
};
|
|
437
|
-
changed = true;
|
|
438
|
-
}
|
|
439
|
-
if (!role || role === "viewpoint-extract") {
|
|
440
|
-
let viewpointChanged = false;
|
|
441
|
-
const nextViewpoints = this.viewpoints.map((viewpoint) => {
|
|
442
|
-
if (viewpoint.extractedAssetId !== assetId) {
|
|
443
|
-
return viewpoint;
|
|
444
|
-
}
|
|
445
|
-
viewpointChanged = true;
|
|
446
|
-
return {
|
|
447
|
-
...viewpoint,
|
|
448
|
-
extractedAssetId: void 0
|
|
449
|
-
};
|
|
450
|
-
});
|
|
451
|
-
if (viewpointChanged) {
|
|
452
|
-
this.viewpoints = nextViewpoints;
|
|
453
|
-
changed = true;
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
return changed;
|
|
457
|
-
}
|
|
458
|
-
async getAssets(role) {
|
|
459
|
-
const canonicalAssetIds = this.id ? await listCanonicalOwnedAssetIds({
|
|
460
|
-
tableName: "scene_assets",
|
|
461
|
-
loadLinks: async () => (await this.getSceneAssetCollection()).byLeft(
|
|
462
|
-
this.id,
|
|
463
|
-
role ? { role } : {}
|
|
464
|
-
)
|
|
465
|
-
}) : [];
|
|
466
|
-
const legacyFieldAssetIds = this.getLegacyFieldAssetIds(role);
|
|
467
|
-
const legacyOwnedAssetIds = this.id ? await listLegacyOwnedAssetIds({
|
|
468
|
-
db: this.db,
|
|
469
|
-
ownerColumn: "scene_id",
|
|
470
|
-
ownerId: this.id,
|
|
471
|
-
role,
|
|
472
|
-
metaTypes: legacyVideoAssetMetaTypes("SceneAsset")
|
|
473
|
-
}) : [];
|
|
474
|
-
return resolveOwnedAssets(
|
|
475
|
-
this.db,
|
|
476
|
-
this.tenantId,
|
|
477
|
-
mergeOwnedAssetIds(
|
|
478
|
-
canonicalAssetIds,
|
|
479
|
-
legacyFieldAssetIds,
|
|
480
|
-
legacyOwnedAssetIds
|
|
481
|
-
)
|
|
482
|
-
);
|
|
483
|
-
}
|
|
484
|
-
async getAssetByRole(role) {
|
|
485
|
-
const assets = await this.getAssets(role);
|
|
486
|
-
return assets[0] || null;
|
|
487
|
-
}
|
|
488
|
-
async addAsset(asset, role = "source", sortOrder = 0) {
|
|
489
|
-
if (!this.id || !asset.id) {
|
|
490
|
-
throw new Error("Cannot associate unsaved scene or asset");
|
|
491
|
-
}
|
|
492
|
-
assertValidVideoAssetRole(role);
|
|
493
|
-
assertValidVideoAssetSortOrder(sortOrder);
|
|
494
|
-
const sceneAssets2 = await this.getSceneAssetCollection();
|
|
495
|
-
await sceneAssets2.attach(this.id, asset.id, {
|
|
496
|
-
role,
|
|
497
|
-
sortOrder,
|
|
498
|
-
tenantId: this.tenantId
|
|
499
|
-
});
|
|
500
|
-
if (this.setLegacyFieldAssetId(role, asset.id)) {
|
|
501
|
-
await this.save();
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
async removeAsset(assetId, role) {
|
|
505
|
-
if (!this.id) {
|
|
506
|
-
return;
|
|
507
|
-
}
|
|
508
|
-
const sceneAssets2 = await this.getSceneAssetCollection();
|
|
509
|
-
await sceneAssets2.detach(this.id, assetId, role ? { role } : {});
|
|
510
|
-
if (this.clearLegacyFieldAssetId(assetId, role)) {
|
|
511
|
-
await this.save();
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
/** Check if this is a 360° panorama */
|
|
515
|
-
get isPanorama() {
|
|
516
|
-
return this.sourceType === "panorama_360" || this.sourceType === "panorama_180";
|
|
517
|
-
}
|
|
518
|
-
/** Check if the scene has viewpoints extracted */
|
|
519
|
-
get hasViewpoints() {
|
|
520
|
-
return this.viewpoints.length > 0;
|
|
521
|
-
}
|
|
522
|
-
/** Check if the scene is ready for compositing */
|
|
523
|
-
get isReady() {
|
|
524
|
-
return this.status === "ready" && this.sourceAssetId !== null;
|
|
525
|
-
}
|
|
163
|
+
__decorateClass$18([tenantId({ nullable: true })], Character.prototype, "tenantId", 2);
|
|
164
|
+
__decorateClass$18([crossPackageRef("@happyvertical/smrt-assets:Asset")], Character.prototype, "imageAssetId", 2);
|
|
165
|
+
__decorateClass$18([crossPackageRef("@happyvertical/smrt-assets:Asset")], Character.prototype, "baseMotionAssetId", 2);
|
|
166
|
+
__decorateClass$18([crossPackageRef("@happyvertical/smrt-voice:VoiceProfile")], Character.prototype, "voiceProfileId", 2);
|
|
167
|
+
__decorateClass$18([foreignKey(() => Performer)], Character.prototype, "performerId", 2);
|
|
168
|
+
__decorateClass$18([foreignKey(() => Scene)], Character.prototype, "defaultSceneId", 2);
|
|
169
|
+
__decorateClass$18([crossPackageRef("@happyvertical/smrt-profiles:Profile")], Character.prototype, "profileId", 2);
|
|
170
|
+
Character = __decorateClass$18([TenantScoped({ mode: "optional" }), smrt({
|
|
171
|
+
tableStrategy: "sti",
|
|
172
|
+
api: { include: [
|
|
173
|
+
"list",
|
|
174
|
+
"get",
|
|
175
|
+
"create",
|
|
176
|
+
"update",
|
|
177
|
+
"delete"
|
|
178
|
+
] },
|
|
179
|
+
mcp: { include: ["list", "get"] },
|
|
180
|
+
cli: true
|
|
181
|
+
})], Character);
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region src/characters.ts
|
|
184
|
+
var CharacterCollection = class extends SmrtCollection {
|
|
185
|
+
static _itemClass = Character;
|
|
186
|
+
/** Find all characters belonging to a specific tenant */
|
|
187
|
+
async findByTenant(tenantId) {
|
|
188
|
+
return await this.list({ where: { tenantId } });
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Find all global characters (no tenant association).
|
|
192
|
+
*
|
|
193
|
+
* Routes through the shared tenant-global helper so it does not throw under
|
|
194
|
+
* an active tenant context (an explicit `tenant_id IS NULL` filter would be
|
|
195
|
+
* flagged as an isolation violation). (#1600)
|
|
196
|
+
*/
|
|
197
|
+
async findGlobal() {
|
|
198
|
+
return queryGlobal(this);
|
|
199
|
+
}
|
|
200
|
+
/** Find characters by performer */
|
|
201
|
+
async findByPerformer(performerId) {
|
|
202
|
+
return await this.list({ where: { performerId } });
|
|
203
|
+
}
|
|
204
|
+
/** Find characters that are ready for video generation */
|
|
205
|
+
async findReady() {
|
|
206
|
+
return await this.list({ where: { status: "ready" } });
|
|
207
|
+
}
|
|
526
208
|
};
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
tableStrategy: "sti",
|
|
537
|
-
api: {
|
|
538
|
-
include: ["list", "get", "create", "update", "delete"]
|
|
539
|
-
},
|
|
540
|
-
mcp: {
|
|
541
|
-
include: ["list", "get"]
|
|
542
|
-
},
|
|
543
|
-
cli: true
|
|
544
|
-
})
|
|
545
|
-
], Scene);
|
|
546
|
-
var __defProp$h = Object.defineProperty;
|
|
547
|
-
var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
|
|
548
|
-
var __decorateClass$i = (decorators, target, key, kind) => {
|
|
549
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$i(target, key) : target;
|
|
550
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
551
|
-
if (decorator = decorators[i])
|
|
552
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
553
|
-
if (kind && result) __defProp$h(target, key, result);
|
|
554
|
-
return result;
|
|
209
|
+
//#endregion
|
|
210
|
+
//#region src/composite-job.ts
|
|
211
|
+
var __defProp$17 = Object.defineProperty;
|
|
212
|
+
var __getOwnPropDesc$17 = Object.getOwnPropertyDescriptor;
|
|
213
|
+
var __decorateClass$17 = (decorators, target, key, kind) => {
|
|
214
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$17(target, key) : target;
|
|
215
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
216
|
+
if (kind && result) __defProp$17(target, key, result);
|
|
217
|
+
return result;
|
|
555
218
|
};
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
}
|
|
601
|
-
getLegacyFieldAssetIds(role) {
|
|
602
|
-
if (role === "seed-image") {
|
|
603
|
-
return this.imageAssetId ? [this.imageAssetId] : [];
|
|
604
|
-
}
|
|
605
|
-
if (role === "base-motion") {
|
|
606
|
-
return this.baseMotionAssetId ? [this.baseMotionAssetId] : [];
|
|
607
|
-
}
|
|
608
|
-
if (role === "logo") {
|
|
609
|
-
return this.brandingKit.logoAssetId ? [this.brandingKit.logoAssetId] : [];
|
|
610
|
-
}
|
|
611
|
-
return [
|
|
612
|
-
this.imageAssetId,
|
|
613
|
-
this.baseMotionAssetId,
|
|
614
|
-
this.brandingKit.logoAssetId || null
|
|
615
|
-
].filter((assetId) => Boolean(assetId));
|
|
616
|
-
}
|
|
617
|
-
setLegacyFieldAssetId(role, assetId) {
|
|
618
|
-
if (role === "seed-image") {
|
|
619
|
-
if (this.imageAssetId === assetId) {
|
|
620
|
-
return false;
|
|
621
|
-
}
|
|
622
|
-
this.imageAssetId = assetId;
|
|
623
|
-
return true;
|
|
624
|
-
}
|
|
625
|
-
if (role === "base-motion") {
|
|
626
|
-
if (this.baseMotionAssetId === assetId) {
|
|
627
|
-
return false;
|
|
628
|
-
}
|
|
629
|
-
this.baseMotionAssetId = assetId;
|
|
630
|
-
return true;
|
|
631
|
-
}
|
|
632
|
-
if ((this.brandingKit.logoAssetId || null) === assetId) {
|
|
633
|
-
return false;
|
|
634
|
-
}
|
|
635
|
-
this.brandingKit = {
|
|
636
|
-
...this.brandingKit,
|
|
637
|
-
logoAssetId: assetId
|
|
638
|
-
};
|
|
639
|
-
return true;
|
|
640
|
-
}
|
|
641
|
-
clearLegacyFieldAssetId(assetId, role) {
|
|
642
|
-
let changed = false;
|
|
643
|
-
if ((!role || role === "seed-image") && this.imageAssetId === assetId) {
|
|
644
|
-
this.imageAssetId = null;
|
|
645
|
-
changed = true;
|
|
646
|
-
}
|
|
647
|
-
if ((!role || role === "base-motion") && this.baseMotionAssetId === assetId) {
|
|
648
|
-
this.baseMotionAssetId = null;
|
|
649
|
-
changed = true;
|
|
650
|
-
}
|
|
651
|
-
if ((!role || role === "logo") && this.brandingKit.logoAssetId === assetId) {
|
|
652
|
-
this.brandingKit = {
|
|
653
|
-
...this.brandingKit,
|
|
654
|
-
logoAssetId: null
|
|
655
|
-
};
|
|
656
|
-
changed = true;
|
|
657
|
-
}
|
|
658
|
-
return changed;
|
|
659
|
-
}
|
|
660
|
-
async getAssets(role) {
|
|
661
|
-
const canonicalAssetIds = this.id ? await listCanonicalOwnedAssetIds({
|
|
662
|
-
tableName: "character_assets",
|
|
663
|
-
loadLinks: async () => (await this.getCharacterAssetCollection()).byLeft(
|
|
664
|
-
this.id,
|
|
665
|
-
role ? { role } : {}
|
|
666
|
-
)
|
|
667
|
-
}) : [];
|
|
668
|
-
const legacyFieldAssetIds = this.getLegacyFieldAssetIds(role);
|
|
669
|
-
const legacyOwnedAssetIds = this.id ? await listLegacyOwnedAssetIds({
|
|
670
|
-
db: this.db,
|
|
671
|
-
ownerColumn: "character_id",
|
|
672
|
-
ownerId: this.id,
|
|
673
|
-
role,
|
|
674
|
-
metaTypes: legacyVideoAssetMetaTypes("CharacterAsset")
|
|
675
|
-
}) : [];
|
|
676
|
-
return resolveOwnedAssets(
|
|
677
|
-
this.db,
|
|
678
|
-
this.tenantId,
|
|
679
|
-
mergeOwnedAssetIds(
|
|
680
|
-
canonicalAssetIds,
|
|
681
|
-
legacyFieldAssetIds,
|
|
682
|
-
legacyOwnedAssetIds
|
|
683
|
-
)
|
|
684
|
-
);
|
|
685
|
-
}
|
|
686
|
-
async getAssetByRole(role) {
|
|
687
|
-
const assets = await this.getAssets(role);
|
|
688
|
-
return assets[0] || null;
|
|
689
|
-
}
|
|
690
|
-
async addAsset(asset, role = "seed-image", sortOrder = 0) {
|
|
691
|
-
if (!this.id || !asset.id) {
|
|
692
|
-
throw new Error("Cannot associate unsaved character or asset");
|
|
693
|
-
}
|
|
694
|
-
assertValidVideoAssetRole(role);
|
|
695
|
-
assertValidVideoAssetSortOrder(sortOrder);
|
|
696
|
-
const characterAssets2 = await this.getCharacterAssetCollection();
|
|
697
|
-
await characterAssets2.attach(this.id, asset.id, {
|
|
698
|
-
role,
|
|
699
|
-
sortOrder,
|
|
700
|
-
tenantId: this.tenantId
|
|
701
|
-
});
|
|
702
|
-
if (this.setLegacyFieldAssetId(role, asset.id)) {
|
|
703
|
-
await this.save();
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
async removeAsset(assetId, role) {
|
|
707
|
-
if (!this.id) {
|
|
708
|
-
return;
|
|
709
|
-
}
|
|
710
|
-
const characterAssets2 = await this.getCharacterAssetCollection();
|
|
711
|
-
await characterAssets2.detach(this.id, assetId, role ? { role } : {});
|
|
712
|
-
if (this.clearLegacyFieldAssetId(assetId, role)) {
|
|
713
|
-
await this.save();
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
/**
|
|
717
|
-
* Check if the character has a pre-baked base motion video
|
|
718
|
-
* @deprecated Use getAssetByRole('base-motion') instead
|
|
719
|
-
*/
|
|
720
|
-
get hasBaseMotion() {
|
|
721
|
-
return this.baseMotionAssetId !== null;
|
|
722
|
-
}
|
|
723
|
-
/** Check if the character is complete and ready for video generation */
|
|
724
|
-
get isComplete() {
|
|
725
|
-
return this.imageAssetId !== null && this.voiceProfileId !== null && this.status === "ready";
|
|
726
|
-
}
|
|
219
|
+
var CompositeJob = class extends SmrtObject {
|
|
220
|
+
tenantId = null;
|
|
221
|
+
characterVideoAssetId = null;
|
|
222
|
+
sceneId = null;
|
|
223
|
+
/** Viewpoint ID (for 360° scenes) */
|
|
224
|
+
viewpointId = null;
|
|
225
|
+
/** Anchor point ID for placement */
|
|
226
|
+
anchorPointId = null;
|
|
227
|
+
/** Character scale */
|
|
228
|
+
scale = 1;
|
|
229
|
+
/** Character position (normalized 0-1) */
|
|
230
|
+
position = {
|
|
231
|
+
x: .5,
|
|
232
|
+
y: .5
|
|
233
|
+
};
|
|
234
|
+
/** Job status */
|
|
235
|
+
status = "pending";
|
|
236
|
+
/** Progress percentage (0-100) */
|
|
237
|
+
progress = 0;
|
|
238
|
+
outputAssetId = null;
|
|
239
|
+
/** Error message if failed */
|
|
240
|
+
errorMessage = null;
|
|
241
|
+
constructor(options = {}) {
|
|
242
|
+
super(options);
|
|
243
|
+
if (options.characterVideoAssetId !== void 0) this.characterVideoAssetId = options.characterVideoAssetId;
|
|
244
|
+
if (options.sceneId !== void 0) this.sceneId = options.sceneId;
|
|
245
|
+
if (options.viewpointId !== void 0) this.viewpointId = options.viewpointId;
|
|
246
|
+
if (options.anchorPointId !== void 0) this.anchorPointId = options.anchorPointId;
|
|
247
|
+
if (options.scale !== void 0) this.scale = options.scale;
|
|
248
|
+
if (options.position !== void 0) this.position = options.position;
|
|
249
|
+
if (options.status !== void 0) this.status = options.status;
|
|
250
|
+
if (options.progress !== void 0) this.progress = options.progress;
|
|
251
|
+
if (options.outputAssetId !== void 0) this.outputAssetId = options.outputAssetId;
|
|
252
|
+
if (options.errorMessage !== void 0) this.errorMessage = options.errorMessage;
|
|
253
|
+
if (options.tenantId !== void 0) this.tenantId = options.tenantId;
|
|
254
|
+
}
|
|
255
|
+
/** Check if the job is complete */
|
|
256
|
+
get isComplete() {
|
|
257
|
+
return this.status === "complete" && this.outputAssetId !== null;
|
|
258
|
+
}
|
|
259
|
+
/** Check if the job is in progress */
|
|
260
|
+
get isProcessing() {
|
|
261
|
+
return this.status !== "pending" && this.status !== "complete" && this.status !== "failed";
|
|
262
|
+
}
|
|
727
263
|
};
|
|
728
|
-
__decorateClass$
|
|
729
|
-
|
|
730
|
-
],
|
|
731
|
-
__decorateClass$
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
]
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
],
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
tableStrategy: "sti",
|
|
753
|
-
api: {
|
|
754
|
-
include: ["list", "get", "create", "update", "delete"]
|
|
755
|
-
},
|
|
756
|
-
mcp: {
|
|
757
|
-
include: ["list", "get"]
|
|
758
|
-
},
|
|
759
|
-
cli: true
|
|
760
|
-
})
|
|
761
|
-
], Character);
|
|
762
|
-
class CharacterCollection extends SmrtCollection {
|
|
763
|
-
static _itemClass = Character;
|
|
764
|
-
/** Find all characters belonging to a specific tenant */
|
|
765
|
-
async findByTenant(tenantId2) {
|
|
766
|
-
return await this.list({ where: { tenantId: tenantId2 } });
|
|
767
|
-
}
|
|
768
|
-
/**
|
|
769
|
-
* Find all global characters (no tenant association).
|
|
770
|
-
*
|
|
771
|
-
* Routes through the shared tenant-global helper so it does not throw under
|
|
772
|
-
* an active tenant context (an explicit `tenant_id IS NULL` filter would be
|
|
773
|
-
* flagged as an isolation violation). (#1600)
|
|
774
|
-
*/
|
|
775
|
-
async findGlobal() {
|
|
776
|
-
return queryGlobal(this);
|
|
777
|
-
}
|
|
778
|
-
/** Find characters by performer */
|
|
779
|
-
async findByPerformer(performerId) {
|
|
780
|
-
return await this.list({ where: { performerId } });
|
|
781
|
-
}
|
|
782
|
-
/** Find characters that are ready for video generation */
|
|
783
|
-
async findReady() {
|
|
784
|
-
return await this.list({ where: { status: "ready" } });
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
var __defProp$g = Object.defineProperty;
|
|
788
|
-
var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
|
|
789
|
-
var __decorateClass$h = (decorators, target, key, kind) => {
|
|
790
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target;
|
|
791
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
792
|
-
if (decorator = decorators[i])
|
|
793
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
794
|
-
if (kind && result) __defProp$g(target, key, result);
|
|
795
|
-
return result;
|
|
264
|
+
__decorateClass$17([tenantId({ nullable: true })], CompositeJob.prototype, "tenantId", 2);
|
|
265
|
+
__decorateClass$17([crossPackageRef("@happyvertical/smrt-assets:Asset")], CompositeJob.prototype, "characterVideoAssetId", 2);
|
|
266
|
+
__decorateClass$17([foreignKey(() => Scene)], CompositeJob.prototype, "sceneId", 2);
|
|
267
|
+
__decorateClass$17([crossPackageRef("@happyvertical/smrt-assets:Asset")], CompositeJob.prototype, "outputAssetId", 2);
|
|
268
|
+
CompositeJob = __decorateClass$17([TenantScoped({ mode: "optional" }), smrt({
|
|
269
|
+
tableStrategy: "sti",
|
|
270
|
+
api: { include: [
|
|
271
|
+
"list",
|
|
272
|
+
"get",
|
|
273
|
+
"create",
|
|
274
|
+
"update"
|
|
275
|
+
] },
|
|
276
|
+
mcp: { include: ["list", "get"] },
|
|
277
|
+
cli: true
|
|
278
|
+
})], CompositeJob);
|
|
279
|
+
//#endregion
|
|
280
|
+
//#region src/video-composition.ts
|
|
281
|
+
var __defProp$16 = Object.defineProperty;
|
|
282
|
+
var __getOwnPropDesc$16 = Object.getOwnPropertyDescriptor;
|
|
283
|
+
var __decorateClass$16 = (decorators, target, key, kind) => {
|
|
284
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$16(target, key) : target;
|
|
285
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
286
|
+
if (kind && result) __defProp$16(target, key, result);
|
|
287
|
+
return result;
|
|
796
288
|
};
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
289
|
+
var VideoComposition = class extends Content {
|
|
290
|
+
/** Frames per second — everything downstream is in frames */
|
|
291
|
+
fps = 30;
|
|
292
|
+
/** Render width in pixels */
|
|
293
|
+
width = 1920;
|
|
294
|
+
/** Render height in pixels */
|
|
295
|
+
height = 1080;
|
|
296
|
+
/** Computed total: sum of sequences minus transition overlaps */
|
|
297
|
+
durationInFrames = 0;
|
|
298
|
+
/** Render status */
|
|
299
|
+
renderStatus = "draft";
|
|
300
|
+
/** Render progress (0-100) */
|
|
301
|
+
renderProgress = 0;
|
|
302
|
+
constructor(options = {}) {
|
|
303
|
+
super({
|
|
304
|
+
...options,
|
|
305
|
+
type: "video-composition"
|
|
306
|
+
});
|
|
307
|
+
if (options.fps !== void 0) this.fps = options.fps;
|
|
308
|
+
if (options.width !== void 0) this.width = options.width;
|
|
309
|
+
if (options.height !== void 0) this.height = options.height;
|
|
310
|
+
if (options.durationInFrames !== void 0) this.durationInFrames = options.durationInFrames;
|
|
311
|
+
if (options.renderStatus !== void 0) this.renderStatus = options.renderStatus;
|
|
312
|
+
if (options.renderProgress !== void 0) this.renderProgress = options.renderProgress;
|
|
313
|
+
}
|
|
314
|
+
/** Duration in seconds */
|
|
315
|
+
get durationInSeconds() {
|
|
316
|
+
if (this.fps === 0) return 0;
|
|
317
|
+
return this.durationInFrames / this.fps;
|
|
318
|
+
}
|
|
319
|
+
/** Check if the composition is ready for publishing */
|
|
320
|
+
get isReady() {
|
|
321
|
+
return this.renderStatus === "ready";
|
|
322
|
+
}
|
|
323
|
+
/** Check if the composition is currently rendering */
|
|
324
|
+
get isRendering() {
|
|
325
|
+
return this.renderStatus === "rendering";
|
|
326
|
+
}
|
|
327
|
+
async getAssets(relationship) {
|
|
328
|
+
const canonicalAssets = await super.getAssets(relationship);
|
|
329
|
+
if (!this.id) return canonicalAssets;
|
|
330
|
+
const role = relationship;
|
|
331
|
+
const legacyAssets = await resolveOwnedAssets(this.db, this.tenantId, await listLegacyOwnedAssetIds({
|
|
332
|
+
db: this.db,
|
|
333
|
+
ownerColumn: "video_composition_id",
|
|
334
|
+
ownerId: this.id,
|
|
335
|
+
role,
|
|
336
|
+
metaTypes: legacyVideoAssetMetaTypes("VideoCompositionAsset")
|
|
337
|
+
}));
|
|
338
|
+
return [...canonicalAssets, ...legacyAssets.filter((asset) => asset.id && !canonicalAssets.some((canonicalAsset) => canonicalAsset.id === asset.id))];
|
|
339
|
+
}
|
|
340
|
+
async getAssetByRole(role) {
|
|
341
|
+
return (await this.getAssets(role))[0] || null;
|
|
342
|
+
}
|
|
843
343
|
};
|
|
844
|
-
__decorateClass$
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
]
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
],
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
], CompositeJob);
|
|
869
|
-
var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
|
|
870
|
-
var __decorateClass$g = (decorators, target, key, kind) => {
|
|
871
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
|
|
872
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
873
|
-
if (decorator = decorators[i])
|
|
874
|
-
result = decorator(result) || result;
|
|
875
|
-
return result;
|
|
344
|
+
VideoComposition = __decorateClass$16([TenantScoped({ mode: "optional" }), smrt({
|
|
345
|
+
tableStrategy: "sti",
|
|
346
|
+
api: { include: [
|
|
347
|
+
"list",
|
|
348
|
+
"get",
|
|
349
|
+
"create",
|
|
350
|
+
"update",
|
|
351
|
+
"delete"
|
|
352
|
+
] },
|
|
353
|
+
mcp: { include: ["list", "get"] },
|
|
354
|
+
cli: true
|
|
355
|
+
})], VideoComposition);
|
|
356
|
+
//#endregion
|
|
357
|
+
//#region src/video-compositions.ts
|
|
358
|
+
var VideoCompositionCollection = class extends SmrtCollection {
|
|
359
|
+
static _itemClass = VideoComposition;
|
|
360
|
+
/** Find compositions by render status */
|
|
361
|
+
async findByRenderStatus(renderStatus) {
|
|
362
|
+
return await this.list({ where: { renderStatus } });
|
|
363
|
+
}
|
|
364
|
+
/** Find compositions that are ready for publishing */
|
|
365
|
+
async findReady() {
|
|
366
|
+
return await this.list({ where: { renderStatus: "ready" } });
|
|
367
|
+
}
|
|
876
368
|
};
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
/** Render status */
|
|
887
|
-
renderStatus = "draft";
|
|
888
|
-
/** Render progress (0-100) */
|
|
889
|
-
renderProgress = 0;
|
|
890
|
-
constructor(options = {}) {
|
|
891
|
-
super({
|
|
892
|
-
...options,
|
|
893
|
-
type: "video-composition"
|
|
894
|
-
});
|
|
895
|
-
if (options.fps !== void 0) this.fps = options.fps;
|
|
896
|
-
if (options.width !== void 0) this.width = options.width;
|
|
897
|
-
if (options.height !== void 0) this.height = options.height;
|
|
898
|
-
if (options.durationInFrames !== void 0)
|
|
899
|
-
this.durationInFrames = options.durationInFrames;
|
|
900
|
-
if (options.renderStatus !== void 0)
|
|
901
|
-
this.renderStatus = options.renderStatus;
|
|
902
|
-
if (options.renderProgress !== void 0)
|
|
903
|
-
this.renderProgress = options.renderProgress;
|
|
904
|
-
}
|
|
905
|
-
/** Duration in seconds */
|
|
906
|
-
get durationInSeconds() {
|
|
907
|
-
if (this.fps === 0) return 0;
|
|
908
|
-
return this.durationInFrames / this.fps;
|
|
909
|
-
}
|
|
910
|
-
/** Check if the composition is ready for publishing */
|
|
911
|
-
get isReady() {
|
|
912
|
-
return this.renderStatus === "ready";
|
|
913
|
-
}
|
|
914
|
-
/** Check if the composition is currently rendering */
|
|
915
|
-
get isRendering() {
|
|
916
|
-
return this.renderStatus === "rendering";
|
|
917
|
-
}
|
|
918
|
-
async getAssets(relationship) {
|
|
919
|
-
const canonicalAssets = await super.getAssets(relationship);
|
|
920
|
-
if (!this.id) {
|
|
921
|
-
return canonicalAssets;
|
|
922
|
-
}
|
|
923
|
-
const role = relationship;
|
|
924
|
-
const legacyAssets = await resolveOwnedAssets(
|
|
925
|
-
this.db,
|
|
926
|
-
this.tenantId,
|
|
927
|
-
await listLegacyOwnedAssetIds({
|
|
928
|
-
db: this.db,
|
|
929
|
-
ownerColumn: "video_composition_id",
|
|
930
|
-
ownerId: this.id,
|
|
931
|
-
role,
|
|
932
|
-
metaTypes: legacyVideoAssetMetaTypes("VideoCompositionAsset")
|
|
933
|
-
})
|
|
934
|
-
);
|
|
935
|
-
return [
|
|
936
|
-
...canonicalAssets,
|
|
937
|
-
...legacyAssets.filter(
|
|
938
|
-
(asset) => asset.id && !canonicalAssets.some(
|
|
939
|
-
(canonicalAsset) => canonicalAsset.id === asset.id
|
|
940
|
-
)
|
|
941
|
-
)
|
|
942
|
-
];
|
|
943
|
-
}
|
|
944
|
-
async getAssetByRole(role) {
|
|
945
|
-
const assets = await this.getAssets(role);
|
|
946
|
-
return assets[0] || null;
|
|
947
|
-
}
|
|
369
|
+
//#endregion
|
|
370
|
+
//#region src/video-sequence.ts
|
|
371
|
+
var __defProp$15 = Object.defineProperty;
|
|
372
|
+
var __getOwnPropDesc$15 = Object.getOwnPropertyDescriptor;
|
|
373
|
+
var __decorateClass$15 = (decorators, target, key, kind) => {
|
|
374
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$15(target, key) : target;
|
|
375
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
376
|
+
if (kind && result) __defProp$15(target, key, result);
|
|
377
|
+
return result;
|
|
948
378
|
};
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
379
|
+
var VideoSequence = class extends Content {
|
|
380
|
+
compositionId = null;
|
|
381
|
+
/** Order within composition */
|
|
382
|
+
position = 0;
|
|
383
|
+
/** Computed duration: sum of shot frames */
|
|
384
|
+
durationInFrames = 0;
|
|
385
|
+
/** Transition type to the next sequence */
|
|
386
|
+
transitionType = "none";
|
|
387
|
+
/** Overlap frames with next sequence for transition */
|
|
388
|
+
transitionDurationFrames = 0;
|
|
389
|
+
constructor(options = {}) {
|
|
390
|
+
super({
|
|
391
|
+
...options,
|
|
392
|
+
type: "video-sequence"
|
|
393
|
+
});
|
|
394
|
+
if (options.compositionId !== void 0) this.compositionId = options.compositionId;
|
|
395
|
+
if (options.position !== void 0) this.position = options.position;
|
|
396
|
+
if (options.durationInFrames !== void 0) this.durationInFrames = options.durationInFrames;
|
|
397
|
+
if (options.transitionType !== void 0) this.transitionType = options.transitionType;
|
|
398
|
+
if (options.transitionDurationFrames !== void 0) this.transitionDurationFrames = options.transitionDurationFrames;
|
|
399
|
+
}
|
|
400
|
+
async getAssets(relationship) {
|
|
401
|
+
const canonicalAssets = await super.getAssets(relationship);
|
|
402
|
+
if (!this.id) return canonicalAssets;
|
|
403
|
+
const role = relationship;
|
|
404
|
+
const legacyAssets = await resolveOwnedAssets(this.db, this.tenantId, await listLegacyOwnedAssetIds({
|
|
405
|
+
db: this.db,
|
|
406
|
+
ownerColumn: "video_sequence_id",
|
|
407
|
+
ownerId: this.id,
|
|
408
|
+
role,
|
|
409
|
+
metaTypes: legacyVideoAssetMetaTypes("VideoSequenceAsset")
|
|
410
|
+
}));
|
|
411
|
+
return [...canonicalAssets, ...legacyAssets.filter((asset) => asset.id && !canonicalAssets.some((canonicalAsset) => canonicalAsset.id === asset.id))];
|
|
412
|
+
}
|
|
413
|
+
async getAssetByRole(role) {
|
|
414
|
+
return (await this.getAssets(role))[0] || null;
|
|
415
|
+
}
|
|
986
416
|
};
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
return canonicalAssets;
|
|
1016
|
-
}
|
|
1017
|
-
const role = relationship;
|
|
1018
|
-
const legacyAssets = await resolveOwnedAssets(
|
|
1019
|
-
this.db,
|
|
1020
|
-
this.tenantId,
|
|
1021
|
-
await listLegacyOwnedAssetIds({
|
|
1022
|
-
db: this.db,
|
|
1023
|
-
ownerColumn: "video_sequence_id",
|
|
1024
|
-
ownerId: this.id,
|
|
1025
|
-
role,
|
|
1026
|
-
metaTypes: legacyVideoAssetMetaTypes("VideoSequenceAsset")
|
|
1027
|
-
})
|
|
1028
|
-
);
|
|
1029
|
-
return [
|
|
1030
|
-
...canonicalAssets,
|
|
1031
|
-
...legacyAssets.filter(
|
|
1032
|
-
(asset) => asset.id && !canonicalAssets.some(
|
|
1033
|
-
(canonicalAsset) => canonicalAsset.id === asset.id
|
|
1034
|
-
)
|
|
1035
|
-
)
|
|
1036
|
-
];
|
|
1037
|
-
}
|
|
1038
|
-
async getAssetByRole(role) {
|
|
1039
|
-
const assets = await this.getAssets(role);
|
|
1040
|
-
return assets[0] || null;
|
|
1041
|
-
}
|
|
417
|
+
__decorateClass$15([foreignKey("VideoComposition")], VideoSequence.prototype, "compositionId", 2);
|
|
418
|
+
VideoSequence = __decorateClass$15([TenantScoped({ mode: "optional" }), smrt({
|
|
419
|
+
tableStrategy: "sti",
|
|
420
|
+
api: { include: [
|
|
421
|
+
"list",
|
|
422
|
+
"get",
|
|
423
|
+
"create",
|
|
424
|
+
"update",
|
|
425
|
+
"delete"
|
|
426
|
+
] },
|
|
427
|
+
mcp: { include: ["list", "get"] },
|
|
428
|
+
cli: true
|
|
429
|
+
})], VideoSequence);
|
|
430
|
+
//#endregion
|
|
431
|
+
//#region src/video-sequences.ts
|
|
432
|
+
var VideoSequenceCollection = class extends SmrtCollection {
|
|
433
|
+
static _itemClass = VideoSequence;
|
|
434
|
+
/** Find sequences belonging to a composition, ordered by position */
|
|
435
|
+
async findByComposition(compositionId) {
|
|
436
|
+
return await this.list({
|
|
437
|
+
where: { compositionId },
|
|
438
|
+
orderBy: "position ASC"
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
/** Find standalone sequences (not in any composition) */
|
|
442
|
+
async findStandalone() {
|
|
443
|
+
return await this.list({ where: { compositionId: null } });
|
|
444
|
+
}
|
|
1042
445
|
};
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
},
|
|
1053
|
-
mcp: {
|
|
1054
|
-
include: ["list", "get"]
|
|
1055
|
-
},
|
|
1056
|
-
cli: true
|
|
1057
|
-
})
|
|
1058
|
-
], VideoSequence);
|
|
1059
|
-
class VideoSequenceCollection extends SmrtCollection {
|
|
1060
|
-
static _itemClass = VideoSequence;
|
|
1061
|
-
/** Find sequences belonging to a composition, ordered by position */
|
|
1062
|
-
async findByComposition(compositionId) {
|
|
1063
|
-
return await this.list({
|
|
1064
|
-
where: { compositionId },
|
|
1065
|
-
orderBy: "position ASC"
|
|
1066
|
-
});
|
|
1067
|
-
}
|
|
1068
|
-
/** Find standalone sequences (not in any composition) */
|
|
1069
|
-
async findStandalone() {
|
|
1070
|
-
return await this.list({
|
|
1071
|
-
where: { compositionId: null }
|
|
1072
|
-
});
|
|
1073
|
-
}
|
|
1074
|
-
}
|
|
1075
|
-
var __defProp$e = Object.defineProperty;
|
|
1076
|
-
var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
|
|
1077
|
-
var __decorateClass$e = (decorators, target, key, kind) => {
|
|
1078
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
|
|
1079
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1080
|
-
if (decorator = decorators[i])
|
|
1081
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1082
|
-
if (kind && result) __defProp$e(target, key, result);
|
|
1083
|
-
return result;
|
|
446
|
+
//#endregion
|
|
447
|
+
//#region src/video-shot.ts
|
|
448
|
+
var __defProp$14 = Object.defineProperty;
|
|
449
|
+
var __getOwnPropDesc$14 = Object.getOwnPropertyDescriptor;
|
|
450
|
+
var __decorateClass$14 = (decorators, target, key, kind) => {
|
|
451
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$14(target, key) : target;
|
|
452
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
453
|
+
if (kind && result) __defProp$14(target, key, result);
|
|
454
|
+
return result;
|
|
1084
455
|
};
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
await listLegacyOwnedAssetIds({
|
|
1189
|
-
db: this.db,
|
|
1190
|
-
ownerColumn: "video_shot_id",
|
|
1191
|
-
ownerId: this.id,
|
|
1192
|
-
role,
|
|
1193
|
-
metaTypes: legacyVideoAssetMetaTypes("VideoShotAsset")
|
|
1194
|
-
})
|
|
1195
|
-
);
|
|
1196
|
-
return [
|
|
1197
|
-
...canonicalAssets,
|
|
1198
|
-
...legacyAssets.filter(
|
|
1199
|
-
(asset) => asset.id && !canonicalAssets.some(
|
|
1200
|
-
(canonicalAsset) => canonicalAsset.id === asset.id
|
|
1201
|
-
)
|
|
1202
|
-
)
|
|
1203
|
-
];
|
|
1204
|
-
}
|
|
1205
|
-
async getAssetByRole(role) {
|
|
1206
|
-
const assets = await this.getAssets(role);
|
|
1207
|
-
return assets[0] || null;
|
|
1208
|
-
}
|
|
1209
|
-
/** Update script text and recalculate word count */
|
|
1210
|
-
setScript(text) {
|
|
1211
|
-
this.scriptText = text;
|
|
1212
|
-
this.scriptWordCount = text.split(/\s+/).filter(Boolean).length;
|
|
1213
|
-
}
|
|
456
|
+
var VideoShot = class extends Content {
|
|
457
|
+
sequenceId = null;
|
|
458
|
+
sceneId = null;
|
|
459
|
+
/** Order within sequence */
|
|
460
|
+
position = 0;
|
|
461
|
+
/** Actual frame count of generated clip */
|
|
462
|
+
durationInFrames = 0;
|
|
463
|
+
/** Frames to skip at start (overlap handling) */
|
|
464
|
+
trimBeforeFrames = 0;
|
|
465
|
+
/** Frames to skip at end */
|
|
466
|
+
trimAfterFrames = 0;
|
|
467
|
+
/** Script text to be spoken */
|
|
468
|
+
scriptText = "";
|
|
469
|
+
/** Word count in the script */
|
|
470
|
+
scriptWordCount = 0;
|
|
471
|
+
/** Target duration in seconds */
|
|
472
|
+
targetDuration = 30;
|
|
473
|
+
/** Video generation status */
|
|
474
|
+
shotStatus = "draft";
|
|
475
|
+
/** Generation progress (0-100) */
|
|
476
|
+
progress = 0;
|
|
477
|
+
/** Error message if status is 'failed' */
|
|
478
|
+
errorMessage = null;
|
|
479
|
+
/** Detailed status message for progress tracking */
|
|
480
|
+
statusMessage = null;
|
|
481
|
+
/** Video metadata (duration, resolution, etc.) */
|
|
482
|
+
videoMetadata = {};
|
|
483
|
+
constructor(options = {}) {
|
|
484
|
+
super({
|
|
485
|
+
...options,
|
|
486
|
+
type: "video-shot"
|
|
487
|
+
});
|
|
488
|
+
if (options.sequenceId !== void 0) this.sequenceId = options.sequenceId;
|
|
489
|
+
if (options.sceneId !== void 0) this.sceneId = options.sceneId;
|
|
490
|
+
if (options.position !== void 0) this.position = options.position;
|
|
491
|
+
if (options.durationInFrames !== void 0) this.durationInFrames = options.durationInFrames;
|
|
492
|
+
if (options.trimBeforeFrames !== void 0) this.trimBeforeFrames = options.trimBeforeFrames;
|
|
493
|
+
if (options.trimAfterFrames !== void 0) this.trimAfterFrames = options.trimAfterFrames;
|
|
494
|
+
if (options.scriptText !== void 0) {
|
|
495
|
+
this.scriptText = options.scriptText;
|
|
496
|
+
this.scriptWordCount = this.scriptText.split(/\s+/).filter(Boolean).length;
|
|
497
|
+
}
|
|
498
|
+
if (options.scriptWordCount !== void 0) this.scriptWordCount = options.scriptWordCount;
|
|
499
|
+
if (options.targetDuration !== void 0) this.targetDuration = options.targetDuration;
|
|
500
|
+
if (options.shotStatus !== void 0) this.shotStatus = options.shotStatus;
|
|
501
|
+
if (options.progress !== void 0) this.progress = options.progress;
|
|
502
|
+
if (options.errorMessage !== void 0) this.errorMessage = options.errorMessage;
|
|
503
|
+
if (options.statusMessage !== void 0) this.statusMessage = options.statusMessage;
|
|
504
|
+
if (options.videoMetadata !== void 0) this.videoMetadata = options.videoMetadata;
|
|
505
|
+
}
|
|
506
|
+
/** Estimate speech duration based on word count (2.7 words/sec) */
|
|
507
|
+
get estimatedDuration() {
|
|
508
|
+
return this.scriptWordCount / 2.7;
|
|
509
|
+
}
|
|
510
|
+
/** Check if the script length matches target duration (+/- 15%) */
|
|
511
|
+
get isScriptLengthValid() {
|
|
512
|
+
const estimated = this.estimatedDuration;
|
|
513
|
+
const tolerance = this.targetDuration * .15;
|
|
514
|
+
return estimated >= this.targetDuration - tolerance && estimated <= this.targetDuration + tolerance;
|
|
515
|
+
}
|
|
516
|
+
/** Get the recommended word count for target duration */
|
|
517
|
+
get recommendedWordCount() {
|
|
518
|
+
const target = Math.round(this.targetDuration * 2.7);
|
|
519
|
+
const tolerance = Math.round(target * .15);
|
|
520
|
+
return {
|
|
521
|
+
min: target - tolerance,
|
|
522
|
+
max: target + tolerance,
|
|
523
|
+
target
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
/** Effective frame count after trimming */
|
|
527
|
+
get effectiveFrames() {
|
|
528
|
+
return Math.max(0, this.durationInFrames - this.trimBeforeFrames - this.trimAfterFrames);
|
|
529
|
+
}
|
|
530
|
+
/** Check if video generation is in progress */
|
|
531
|
+
get isGenerating() {
|
|
532
|
+
return this.shotStatus === "queued" || this.shotStatus === "processing";
|
|
533
|
+
}
|
|
534
|
+
/** Check if video is ready for publishing */
|
|
535
|
+
get isReady() {
|
|
536
|
+
return this.shotStatus === "ready";
|
|
537
|
+
}
|
|
538
|
+
async getAssets(relationship) {
|
|
539
|
+
const canonicalAssets = await super.getAssets(relationship);
|
|
540
|
+
if (!this.id) return canonicalAssets;
|
|
541
|
+
const role = relationship;
|
|
542
|
+
const legacyAssets = await resolveOwnedAssets(this.db, this.tenantId, await listLegacyOwnedAssetIds({
|
|
543
|
+
db: this.db,
|
|
544
|
+
ownerColumn: "video_shot_id",
|
|
545
|
+
ownerId: this.id,
|
|
546
|
+
role,
|
|
547
|
+
metaTypes: legacyVideoAssetMetaTypes("VideoShotAsset")
|
|
548
|
+
}));
|
|
549
|
+
return [...canonicalAssets, ...legacyAssets.filter((asset) => asset.id && !canonicalAssets.some((canonicalAsset) => canonicalAsset.id === asset.id))];
|
|
550
|
+
}
|
|
551
|
+
async getAssetByRole(role) {
|
|
552
|
+
return (await this.getAssets(role))[0] || null;
|
|
553
|
+
}
|
|
554
|
+
/** Update script text and recalculate word count */
|
|
555
|
+
setScript(text) {
|
|
556
|
+
this.scriptText = text;
|
|
557
|
+
this.scriptWordCount = text.split(/\s+/).filter(Boolean).length;
|
|
558
|
+
}
|
|
1214
559
|
};
|
|
1215
|
-
__decorateClass$
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
var
|
|
1235
|
-
var
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1239
|
-
if (decorator = decorators[i])
|
|
1240
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1241
|
-
if (kind && result) __defProp$d(target, key, result);
|
|
1242
|
-
return result;
|
|
560
|
+
__decorateClass$14([foreignKey(() => VideoSequence)], VideoShot.prototype, "sequenceId", 2);
|
|
561
|
+
__decorateClass$14([foreignKey(() => Scene)], VideoShot.prototype, "sceneId", 2);
|
|
562
|
+
VideoShot = __decorateClass$14([TenantScoped({ mode: "optional" }), smrt({
|
|
563
|
+
tableStrategy: "sti",
|
|
564
|
+
api: { include: [
|
|
565
|
+
"list",
|
|
566
|
+
"get",
|
|
567
|
+
"create",
|
|
568
|
+
"update",
|
|
569
|
+
"delete"
|
|
570
|
+
] },
|
|
571
|
+
mcp: { include: ["list", "get"] },
|
|
572
|
+
cli: true
|
|
573
|
+
})], VideoShot);
|
|
574
|
+
//#endregion
|
|
575
|
+
//#region src/video-shot-character.ts
|
|
576
|
+
var __defProp$13 = Object.defineProperty;
|
|
577
|
+
var __getOwnPropDesc$13 = Object.getOwnPropertyDescriptor;
|
|
578
|
+
var __decorateClass$13 = (decorators, target, key, kind) => {
|
|
579
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$13(target, key) : target;
|
|
580
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
581
|
+
if (kind && result) __defProp$13(target, key, result);
|
|
582
|
+
return result;
|
|
1243
583
|
};
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
584
|
+
var VideoShotCharacter = class extends SmrtObject {
|
|
585
|
+
tenantId = null;
|
|
586
|
+
videoShotId = "";
|
|
587
|
+
characterId = "";
|
|
588
|
+
/** Role of the character in this shot */
|
|
589
|
+
role = "primary";
|
|
590
|
+
/** Order/layer position within the shot */
|
|
591
|
+
position = 0;
|
|
592
|
+
constructor(options) {
|
|
593
|
+
super(options);
|
|
594
|
+
this.videoShotId = options.videoShotId;
|
|
595
|
+
this.characterId = options.characterId;
|
|
596
|
+
if (options.role !== void 0) this.role = options.role;
|
|
597
|
+
if (options.position !== void 0) this.position = options.position;
|
|
598
|
+
if (options.tenantId !== void 0) this.tenantId = options.tenantId;
|
|
599
|
+
}
|
|
1260
600
|
};
|
|
1261
|
-
__decorateClass$
|
|
1262
|
-
|
|
1263
|
-
], VideoShotCharacter.prototype, "
|
|
1264
|
-
__decorateClass$
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
});
|
|
1291
|
-
}
|
|
1292
|
-
/** Find all shot links for a character */
|
|
1293
|
-
async findByCharacter(characterId) {
|
|
1294
|
-
return await this.list({
|
|
1295
|
-
where: { characterId }
|
|
1296
|
-
});
|
|
1297
|
-
}
|
|
1298
|
-
}
|
|
1299
|
-
class VideoShotCollection extends SmrtCollection {
|
|
1300
|
-
static _itemClass = VideoShot;
|
|
1301
|
-
/** Find shots belonging to a specific sequence, ordered by position */
|
|
1302
|
-
async findBySequence(sequenceId) {
|
|
1303
|
-
return await this.list({
|
|
1304
|
-
where: { sequenceId },
|
|
1305
|
-
orderBy: "position ASC"
|
|
1306
|
-
});
|
|
1307
|
-
}
|
|
1308
|
-
/** Find shots by status */
|
|
1309
|
-
async findByStatus(shotStatus) {
|
|
1310
|
-
return await this.list({ where: { shotStatus } });
|
|
1311
|
-
}
|
|
1312
|
-
/** Find standalone shots (not in any sequence) */
|
|
1313
|
-
async findStandalone() {
|
|
1314
|
-
return await this.list({ where: { sequenceId: null } });
|
|
1315
|
-
}
|
|
1316
|
-
}
|
|
1317
|
-
var __defProp$c = Object.defineProperty;
|
|
1318
|
-
var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
|
|
1319
|
-
var __decorateClass$c = (decorators, target, key, kind) => {
|
|
1320
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target;
|
|
1321
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1322
|
-
if (decorator = decorators[i])
|
|
1323
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1324
|
-
if (kind && result) __defProp$c(target, key, result);
|
|
1325
|
-
return result;
|
|
601
|
+
__decorateClass$13([tenantId({ nullable: true })], VideoShotCharacter.prototype, "tenantId", 2);
|
|
602
|
+
__decorateClass$13([foreignKey(() => VideoShot, { required: true })], VideoShotCharacter.prototype, "videoShotId", 2);
|
|
603
|
+
__decorateClass$13([foreignKey(() => Character, { required: true })], VideoShotCharacter.prototype, "characterId", 2);
|
|
604
|
+
VideoShotCharacter = __decorateClass$13([TenantScoped({ mode: "optional" }), smrt({
|
|
605
|
+
tableStrategy: "sti",
|
|
606
|
+
api: { include: [
|
|
607
|
+
"list",
|
|
608
|
+
"get",
|
|
609
|
+
"create",
|
|
610
|
+
"delete"
|
|
611
|
+
] },
|
|
612
|
+
mcp: { include: ["list", "get"] },
|
|
613
|
+
cli: true
|
|
614
|
+
})], VideoShotCharacter);
|
|
615
|
+
//#endregion
|
|
616
|
+
//#region src/video-shot-characters.ts
|
|
617
|
+
var VideoShotCharacterCollection = class extends SmrtCollection {
|
|
618
|
+
static _itemClass = VideoShotCharacter;
|
|
619
|
+
/** Find all character links for a shot, ordered by position */
|
|
620
|
+
async findByShot(videoShotId) {
|
|
621
|
+
return await this.list({
|
|
622
|
+
where: { videoShotId },
|
|
623
|
+
orderBy: "position ASC"
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
/** Find all shot links for a character */
|
|
627
|
+
async findByCharacter(characterId) {
|
|
628
|
+
return await this.list({ where: { characterId } });
|
|
629
|
+
}
|
|
1326
630
|
};
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
workflowType = "custom";
|
|
1347
|
-
/**
|
|
1348
|
-
* ComfyUI API format JSON
|
|
1349
|
-
* This is the workflow definition that will be sent to ComfyUI
|
|
1350
|
-
*/
|
|
1351
|
-
workflowJson = null;
|
|
1352
|
-
/**
|
|
1353
|
-
* Node ID mappings for dynamic parameter injection
|
|
1354
|
-
* Maps semantic names to ComfyUI node IDs
|
|
1355
|
-
*/
|
|
1356
|
-
nodeMapping = {};
|
|
1357
|
-
/**
|
|
1358
|
-
* Estimated processing time in seconds
|
|
1359
|
-
* Used for progress estimation
|
|
1360
|
-
*/
|
|
1361
|
-
estimatedTime = 300;
|
|
1362
|
-
/**
|
|
1363
|
-
* Whether this workflow is active/usable
|
|
1364
|
-
*/
|
|
1365
|
-
isActive = true;
|
|
1366
|
-
/**
|
|
1367
|
-
* ComfyUI models required by this workflow
|
|
1368
|
-
* Used for validation before queuing
|
|
1369
|
-
*/
|
|
1370
|
-
requiredModels = [];
|
|
1371
|
-
constructor(options = {}) {
|
|
1372
|
-
super(options);
|
|
1373
|
-
if (options.name !== void 0) this.name = options.name;
|
|
1374
|
-
if (options.description !== void 0)
|
|
1375
|
-
this.description = options.description;
|
|
1376
|
-
if (options.workflowType !== void 0)
|
|
1377
|
-
this.workflowType = options.workflowType;
|
|
1378
|
-
if (options.workflowJson !== void 0)
|
|
1379
|
-
this.workflowJson = options.workflowJson;
|
|
1380
|
-
if (options.nodeMapping !== void 0)
|
|
1381
|
-
this.nodeMapping = options.nodeMapping;
|
|
1382
|
-
if (options.estimatedTime !== void 0)
|
|
1383
|
-
this.estimatedTime = options.estimatedTime;
|
|
1384
|
-
if (options.isActive !== void 0) this.isActive = options.isActive;
|
|
1385
|
-
if (options.requiredModels !== void 0)
|
|
1386
|
-
this.requiredModels = options.requiredModels;
|
|
1387
|
-
if (options.tenantId !== void 0) this.tenantId = options.tenantId;
|
|
1388
|
-
}
|
|
1389
|
-
/**
|
|
1390
|
-
* Check if the workflow has all required node mappings
|
|
1391
|
-
*/
|
|
1392
|
-
get hasRequiredMappings() {
|
|
1393
|
-
const required = ["outputVideo"];
|
|
1394
|
-
return required.every((key) => this.nodeMapping[key] !== void 0);
|
|
1395
|
-
}
|
|
1396
|
-
/**
|
|
1397
|
-
* Get a copy of the workflow JSON with injected parameters
|
|
1398
|
-
*
|
|
1399
|
-
* Parameter injection follows ComfyUI node structure conventions:
|
|
1400
|
-
* - seedImage, audioFile, baseVideo → node.inputs.image (file path)
|
|
1401
|
-
* - prompt → node.inputs.text (string)
|
|
1402
|
-
* - Other parameters → node.inputs[paramKey]
|
|
1403
|
-
*
|
|
1404
|
-
* @param params - Key-value pairs of parameters to inject
|
|
1405
|
-
* @returns Modified workflow JSON or null if no workflowJson set
|
|
1406
|
-
*/
|
|
1407
|
-
injectParameters(params) {
|
|
1408
|
-
if (!this.workflowJson) return null;
|
|
1409
|
-
const workflow = JSON.parse(JSON.stringify(this.workflowJson));
|
|
1410
|
-
const warnings = [];
|
|
1411
|
-
for (const [paramKey, nodeId] of Object.entries(this.nodeMapping)) {
|
|
1412
|
-
if (nodeId && params[paramKey] !== void 0) {
|
|
1413
|
-
if (!workflow[nodeId]) {
|
|
1414
|
-
warnings.push(
|
|
1415
|
-
`Node mapping '${paramKey}' references node '${nodeId}' which does not exist in workflow`
|
|
1416
|
-
);
|
|
1417
|
-
continue;
|
|
1418
|
-
}
|
|
1419
|
-
workflow[nodeId].inputs = workflow[nodeId].inputs || {};
|
|
1420
|
-
if (paramKey === "seedImage" || paramKey === "audioFile" || paramKey === "baseVideo") {
|
|
1421
|
-
workflow[nodeId].inputs.image = params[paramKey];
|
|
1422
|
-
} else if (paramKey === "prompt") {
|
|
1423
|
-
workflow[nodeId].inputs.text = params[paramKey];
|
|
1424
|
-
} else {
|
|
1425
|
-
workflow[nodeId].inputs[paramKey] = params[paramKey];
|
|
1426
|
-
}
|
|
1427
|
-
}
|
|
1428
|
-
}
|
|
1429
|
-
if (warnings.length > 0 && process.env.NODE_ENV !== "production") {
|
|
1430
|
-
logger.warn(
|
|
1431
|
-
`[VideoWorkflow] Parameter injection warnings:
|
|
1432
|
-
${warnings.join("\n")}`
|
|
1433
|
-
);
|
|
1434
|
-
}
|
|
1435
|
-
return workflow;
|
|
1436
|
-
}
|
|
631
|
+
//#endregion
|
|
632
|
+
//#region src/video-shots.ts
|
|
633
|
+
var VideoShotCollection = class extends SmrtCollection {
|
|
634
|
+
static _itemClass = VideoShot;
|
|
635
|
+
/** Find shots belonging to a specific sequence, ordered by position */
|
|
636
|
+
async findBySequence(sequenceId) {
|
|
637
|
+
return await this.list({
|
|
638
|
+
where: { sequenceId },
|
|
639
|
+
orderBy: "position ASC"
|
|
640
|
+
});
|
|
641
|
+
}
|
|
642
|
+
/** Find shots by status */
|
|
643
|
+
async findByStatus(shotStatus) {
|
|
644
|
+
return await this.list({ where: { shotStatus } });
|
|
645
|
+
}
|
|
646
|
+
/** Find standalone shots (not in any sequence) */
|
|
647
|
+
async findStandalone() {
|
|
648
|
+
return await this.list({ where: { sequenceId: null } });
|
|
649
|
+
}
|
|
1437
650
|
};
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
},
|
|
1448
|
-
mcp: {
|
|
1449
|
-
include: ["list", "get"]
|
|
1450
|
-
},
|
|
1451
|
-
cli: true
|
|
1452
|
-
})
|
|
1453
|
-
], VideoWorkflow);
|
|
1454
|
-
var __defProp$b = Object.defineProperty;
|
|
1455
|
-
var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
|
|
1456
|
-
var __decorateClass$b = (decorators, target, key, kind) => {
|
|
1457
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
|
|
1458
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1459
|
-
if (decorator = decorators[i])
|
|
1460
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1461
|
-
if (kind && result) __defProp$b(target, key, result);
|
|
1462
|
-
return result;
|
|
651
|
+
//#endregion
|
|
652
|
+
//#region src/video-workflow.ts
|
|
653
|
+
var __defProp$12 = Object.defineProperty;
|
|
654
|
+
var __getOwnPropDesc$12 = Object.getOwnPropertyDescriptor;
|
|
655
|
+
var __decorateClass$12 = (decorators, target, key, kind) => {
|
|
656
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$12(target, key) : target;
|
|
657
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
658
|
+
if (kind && result) __defProp$12(target, key, result);
|
|
659
|
+
return result;
|
|
1463
660
|
};
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
661
|
+
var logger = createLogger({ level: "info" });
|
|
662
|
+
var VideoWorkflow = class extends SmrtObject {
|
|
663
|
+
tenantId = null;
|
|
664
|
+
/**
|
|
665
|
+
* Human-readable name for the workflow
|
|
666
|
+
*/
|
|
667
|
+
name = "";
|
|
668
|
+
/**
|
|
669
|
+
* Description of what this workflow does
|
|
670
|
+
*/
|
|
671
|
+
description = null;
|
|
672
|
+
/**
|
|
673
|
+
* Workflow type classification
|
|
674
|
+
* - prebake: Pre-generate base motion from seed image
|
|
675
|
+
* - broadcast: Full video generation pipeline
|
|
676
|
+
* - lipsync: Lip-sync only (requires base video + audio)
|
|
677
|
+
* - postprod: Post-production overlays and effects
|
|
678
|
+
* - custom: User-defined workflow
|
|
679
|
+
*/
|
|
680
|
+
workflowType = "custom";
|
|
681
|
+
/**
|
|
682
|
+
* ComfyUI API format JSON
|
|
683
|
+
* This is the workflow definition that will be sent to ComfyUI
|
|
684
|
+
*/
|
|
685
|
+
workflowJson = null;
|
|
686
|
+
/**
|
|
687
|
+
* Node ID mappings for dynamic parameter injection
|
|
688
|
+
* Maps semantic names to ComfyUI node IDs
|
|
689
|
+
*/
|
|
690
|
+
nodeMapping = {};
|
|
691
|
+
/**
|
|
692
|
+
* Estimated processing time in seconds
|
|
693
|
+
* Used for progress estimation
|
|
694
|
+
*/
|
|
695
|
+
estimatedTime = 300;
|
|
696
|
+
/**
|
|
697
|
+
* Whether this workflow is active/usable
|
|
698
|
+
*/
|
|
699
|
+
isActive = true;
|
|
700
|
+
/**
|
|
701
|
+
* ComfyUI models required by this workflow
|
|
702
|
+
* Used for validation before queuing
|
|
703
|
+
*/
|
|
704
|
+
requiredModels = [];
|
|
705
|
+
constructor(options = {}) {
|
|
706
|
+
super(options);
|
|
707
|
+
if (options.name !== void 0) this.name = options.name;
|
|
708
|
+
if (options.description !== void 0) this.description = options.description;
|
|
709
|
+
if (options.workflowType !== void 0) this.workflowType = options.workflowType;
|
|
710
|
+
if (options.workflowJson !== void 0) this.workflowJson = options.workflowJson;
|
|
711
|
+
if (options.nodeMapping !== void 0) this.nodeMapping = options.nodeMapping;
|
|
712
|
+
if (options.estimatedTime !== void 0) this.estimatedTime = options.estimatedTime;
|
|
713
|
+
if (options.isActive !== void 0) this.isActive = options.isActive;
|
|
714
|
+
if (options.requiredModels !== void 0) this.requiredModels = options.requiredModels;
|
|
715
|
+
if (options.tenantId !== void 0) this.tenantId = options.tenantId;
|
|
716
|
+
}
|
|
717
|
+
/**
|
|
718
|
+
* Check if the workflow has all required node mappings
|
|
719
|
+
*/
|
|
720
|
+
get hasRequiredMappings() {
|
|
721
|
+
return ["outputVideo"].every((key) => this.nodeMapping[key] !== void 0);
|
|
722
|
+
}
|
|
723
|
+
/**
|
|
724
|
+
* Get a copy of the workflow JSON with injected parameters
|
|
725
|
+
*
|
|
726
|
+
* Parameter injection follows ComfyUI node structure conventions:
|
|
727
|
+
* - seedImage, audioFile, baseVideo → node.inputs.image (file path)
|
|
728
|
+
* - prompt → node.inputs.text (string)
|
|
729
|
+
* - Other parameters → node.inputs[paramKey]
|
|
730
|
+
*
|
|
731
|
+
* @param params - Key-value pairs of parameters to inject
|
|
732
|
+
* @returns Modified workflow JSON or null if no workflowJson set
|
|
733
|
+
*/
|
|
734
|
+
injectParameters(params) {
|
|
735
|
+
if (!this.workflowJson) return null;
|
|
736
|
+
const workflow = JSON.parse(JSON.stringify(this.workflowJson));
|
|
737
|
+
const warnings = [];
|
|
738
|
+
for (const [paramKey, nodeId] of Object.entries(this.nodeMapping)) if (nodeId && params[paramKey] !== void 0) {
|
|
739
|
+
if (!workflow[nodeId]) {
|
|
740
|
+
warnings.push(`Node mapping '${paramKey}' references node '${nodeId}' which does not exist in workflow`);
|
|
741
|
+
continue;
|
|
742
|
+
}
|
|
743
|
+
workflow[nodeId].inputs = workflow[nodeId].inputs || {};
|
|
744
|
+
if (paramKey === "seedImage" || paramKey === "audioFile" || paramKey === "baseVideo") workflow[nodeId].inputs.image = params[paramKey];
|
|
745
|
+
else if (paramKey === "prompt") workflow[nodeId].inputs.text = params[paramKey];
|
|
746
|
+
else workflow[nodeId].inputs[paramKey] = params[paramKey];
|
|
747
|
+
}
|
|
748
|
+
if (warnings.length > 0 && process.env.NODE_ENV !== "production") logger.warn(`[VideoWorkflow] Parameter injection warnings:
|
|
749
|
+
${warnings.join("\n")}`);
|
|
750
|
+
return workflow;
|
|
751
|
+
}
|
|
1473
752
|
};
|
|
1474
|
-
__decorateClass$
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
],
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
753
|
+
__decorateClass$12([tenantId({ nullable: true })], VideoWorkflow.prototype, "tenantId", 2);
|
|
754
|
+
VideoWorkflow = __decorateClass$12([TenantScoped({ mode: "optional" }), smrt({
|
|
755
|
+
tableStrategy: "sti",
|
|
756
|
+
api: { include: [
|
|
757
|
+
"list",
|
|
758
|
+
"get",
|
|
759
|
+
"create",
|
|
760
|
+
"update"
|
|
761
|
+
] },
|
|
762
|
+
mcp: { include: ["list", "get"] },
|
|
763
|
+
cli: true
|
|
764
|
+
})], VideoWorkflow);
|
|
765
|
+
//#endregion
|
|
766
|
+
//#region src/character-asset.ts
|
|
767
|
+
var __defProp$11 = Object.defineProperty;
|
|
768
|
+
var __getOwnPropDesc$11 = Object.getOwnPropertyDescriptor;
|
|
769
|
+
var __decorateClass$11 = (decorators, target, key, kind) => {
|
|
770
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$11(target, key) : target;
|
|
771
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
772
|
+
if (kind && result) __defProp$11(target, key, result);
|
|
773
|
+
return result;
|
|
1493
774
|
};
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
if (options.characterId) this.characterId = options.characterId;
|
|
1503
|
-
if (options.assetId) this.assetId = options.assetId;
|
|
1504
|
-
if (options.role !== void 0) this.role = options.role;
|
|
1505
|
-
if (options.sortOrder !== void 0) this.sortOrder = options.sortOrder;
|
|
1506
|
-
if (options.tenantId !== void 0) this.tenantId = options.tenantId;
|
|
1507
|
-
}
|
|
775
|
+
var CharacterAsset = class extends Asset {
|
|
776
|
+
characterId = null;
|
|
777
|
+
role = "seed-image";
|
|
778
|
+
constructor(options = {}) {
|
|
779
|
+
super(options);
|
|
780
|
+
if (options.characterId !== void 0) this.characterId = options.characterId;
|
|
781
|
+
if (options.role !== void 0) this.role = options.role;
|
|
782
|
+
}
|
|
1508
783
|
};
|
|
1509
|
-
__decorateClass$
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
]
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
],
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
784
|
+
__decorateClass$11([foreignKey(() => Character)], CharacterAsset.prototype, "characterId", 2);
|
|
785
|
+
CharacterAsset = __decorateClass$11([smrt({
|
|
786
|
+
api: { include: [
|
|
787
|
+
"list",
|
|
788
|
+
"get",
|
|
789
|
+
"create",
|
|
790
|
+
"update",
|
|
791
|
+
"delete"
|
|
792
|
+
] },
|
|
793
|
+
mcp: { include: ["list", "get"] },
|
|
794
|
+
cli: true
|
|
795
|
+
})], CharacterAsset);
|
|
796
|
+
//#endregion
|
|
797
|
+
//#region src/character-owned-asset.ts
|
|
798
|
+
var __defProp$10 = Object.defineProperty;
|
|
799
|
+
var __getOwnPropDesc$10 = Object.getOwnPropertyDescriptor;
|
|
800
|
+
var __decorateClass$10 = (decorators, target, key, kind) => {
|
|
801
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$10(target, key) : target;
|
|
802
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
803
|
+
if (kind && result) __defProp$10(target, key, result);
|
|
804
|
+
return result;
|
|
805
|
+
};
|
|
806
|
+
var CharacterOwnedAsset = class extends SmrtObject {
|
|
807
|
+
tenantId = null;
|
|
808
|
+
characterId = "";
|
|
809
|
+
assetId = "";
|
|
810
|
+
role = "seed-image";
|
|
811
|
+
sortOrder = 0;
|
|
812
|
+
constructor(options = {}) {
|
|
813
|
+
super(options);
|
|
814
|
+
if (options.characterId) this.characterId = options.characterId;
|
|
815
|
+
if (options.assetId) this.assetId = options.assetId;
|
|
816
|
+
if (options.role !== void 0) this.role = options.role;
|
|
817
|
+
if (options.sortOrder !== void 0) this.sortOrder = options.sortOrder;
|
|
818
|
+
if (options.tenantId !== void 0) this.tenantId = options.tenantId;
|
|
819
|
+
}
|
|
820
|
+
};
|
|
821
|
+
__decorateClass$10([tenantId({ nullable: true })], CharacterOwnedAsset.prototype, "tenantId", 2);
|
|
822
|
+
__decorateClass$10([foreignKey(() => Character, { required: true })], CharacterOwnedAsset.prototype, "characterId", 2);
|
|
823
|
+
__decorateClass$10([crossPackageRef("@happyvertical/smrt-assets:Asset", { required: true })], CharacterOwnedAsset.prototype, "assetId", 2);
|
|
824
|
+
__decorateClass$10([field({ required: true })], CharacterOwnedAsset.prototype, "role", 2);
|
|
825
|
+
__decorateClass$10([field()], CharacterOwnedAsset.prototype, "sortOrder", 2);
|
|
826
|
+
CharacterOwnedAsset = __decorateClass$10([TenantScoped({ mode: "optional" }), smrt({
|
|
827
|
+
name: "CharacterOwnedAsset",
|
|
828
|
+
tableName: "character_assets",
|
|
829
|
+
conflictColumns: [
|
|
830
|
+
"character_id",
|
|
831
|
+
"asset_id",
|
|
832
|
+
"role"
|
|
833
|
+
],
|
|
834
|
+
api: false,
|
|
835
|
+
mcp: false,
|
|
836
|
+
cli: false
|
|
837
|
+
})], CharacterOwnedAsset);
|
|
838
|
+
//#endregion
|
|
839
|
+
//#region src/character-assets.ts
|
|
840
|
+
var character_assets_exports = /* @__PURE__ */ __exportAll({ CharacterOwnedAssetCollection: () => CharacterOwnedAssetCollection });
|
|
1535
841
|
var __defProp$9 = Object.defineProperty;
|
|
1536
842
|
var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
|
|
1537
|
-
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$9(obj, key, {
|
|
843
|
+
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$9(obj, key, {
|
|
844
|
+
enumerable: true,
|
|
845
|
+
configurable: true,
|
|
846
|
+
writable: true,
|
|
847
|
+
value
|
|
848
|
+
}) : obj[key] = value;
|
|
1538
849
|
var __decorateClass$9 = (decorators, target, key, kind) => {
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
return result;
|
|
850
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
|
|
851
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
852
|
+
if (kind && result) __defProp$9(target, key, result);
|
|
853
|
+
return result;
|
|
1544
854
|
};
|
|
1545
|
-
var __publicField$2 = (obj, key, value) => __defNormalProp$2(obj, key + "", value);
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
855
|
+
var __publicField$2 = (obj, key, value) => __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
856
|
+
var CharacterOwnedAssetCollection = class extends SmrtJunction {
|
|
857
|
+
leftField = "characterId";
|
|
858
|
+
rightField = "assetId";
|
|
1549
859
|
};
|
|
1550
860
|
__publicField$2(CharacterOwnedAssetCollection, "_itemClass", CharacterOwnedAsset);
|
|
1551
|
-
CharacterOwnedAssetCollection = __decorateClass$9([
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
const characterAssets = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1559
|
-
__proto__: null,
|
|
1560
|
-
get CharacterOwnedAssetCollection() {
|
|
1561
|
-
return CharacterOwnedAssetCollection;
|
|
1562
|
-
}
|
|
1563
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
861
|
+
CharacterOwnedAssetCollection = __decorateClass$9([smrt({
|
|
862
|
+
api: false,
|
|
863
|
+
mcp: false,
|
|
864
|
+
cli: false
|
|
865
|
+
})], CharacterOwnedAssetCollection);
|
|
866
|
+
//#endregion
|
|
867
|
+
//#region src/performer-asset.ts
|
|
1564
868
|
var __defProp$8 = Object.defineProperty;
|
|
1565
869
|
var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
|
|
1566
870
|
var __decorateClass$8 = (decorators, target, key, kind) => {
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
if (kind && result) __defProp$8(target, key, result);
|
|
1572
|
-
return result;
|
|
871
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
|
|
872
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
873
|
+
if (kind && result) __defProp$8(target, key, result);
|
|
874
|
+
return result;
|
|
1573
875
|
};
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
}
|
|
876
|
+
var PerformerAsset = class extends Asset {
|
|
877
|
+
performerId = null;
|
|
878
|
+
role = "reference";
|
|
879
|
+
constructor(options = {}) {
|
|
880
|
+
super(options);
|
|
881
|
+
if (options.performerId !== void 0) this.performerId = options.performerId;
|
|
882
|
+
if (options.role !== void 0) this.role = options.role;
|
|
883
|
+
}
|
|
1583
884
|
};
|
|
1584
|
-
__decorateClass$8([
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
],
|
|
885
|
+
__decorateClass$8([foreignKey(() => Performer)], PerformerAsset.prototype, "performerId", 2);
|
|
886
|
+
PerformerAsset = __decorateClass$8([smrt({
|
|
887
|
+
api: { include: [
|
|
888
|
+
"list",
|
|
889
|
+
"get",
|
|
890
|
+
"create",
|
|
891
|
+
"update",
|
|
892
|
+
"delete"
|
|
893
|
+
] },
|
|
894
|
+
mcp: { include: ["list", "get"] },
|
|
895
|
+
cli: true
|
|
896
|
+
})], PerformerAsset);
|
|
897
|
+
//#endregion
|
|
898
|
+
//#region src/performer-owned-asset.ts
|
|
1594
899
|
var __defProp$7 = Object.defineProperty;
|
|
1595
900
|
var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
|
|
1596
901
|
var __decorateClass$7 = (decorators, target, key, kind) => {
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
if (kind && result) __defProp$7(target, key, result);
|
|
1602
|
-
return result;
|
|
902
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
|
|
903
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
904
|
+
if (kind && result) __defProp$7(target, key, result);
|
|
905
|
+
return result;
|
|
1603
906
|
};
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
907
|
+
var PerformerOwnedAsset = class extends SmrtObject {
|
|
908
|
+
tenantId = null;
|
|
909
|
+
performerId = "";
|
|
910
|
+
assetId = "";
|
|
911
|
+
role = "reference";
|
|
912
|
+
sortOrder = 0;
|
|
913
|
+
constructor(options = {}) {
|
|
914
|
+
super(options);
|
|
915
|
+
if (options.performerId) this.performerId = options.performerId;
|
|
916
|
+
if (options.assetId) this.assetId = options.assetId;
|
|
917
|
+
if (options.role !== void 0) this.role = options.role;
|
|
918
|
+
if (options.sortOrder !== void 0) this.sortOrder = options.sortOrder;
|
|
919
|
+
if (options.tenantId !== void 0) this.tenantId = options.tenantId;
|
|
920
|
+
}
|
|
1618
921
|
};
|
|
1619
|
-
__decorateClass$7([
|
|
1620
|
-
|
|
1621
|
-
], PerformerOwnedAsset.prototype, "
|
|
1622
|
-
__decorateClass$7([
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
conflictColumns: ["performer_id", "asset_id", "role"],
|
|
1640
|
-
api: false,
|
|
1641
|
-
mcp: false,
|
|
1642
|
-
cli: false
|
|
1643
|
-
})
|
|
1644
|
-
], PerformerOwnedAsset);
|
|
922
|
+
__decorateClass$7([tenantId({ nullable: true })], PerformerOwnedAsset.prototype, "tenantId", 2);
|
|
923
|
+
__decorateClass$7([foreignKey(() => Performer, { required: true })], PerformerOwnedAsset.prototype, "performerId", 2);
|
|
924
|
+
__decorateClass$7([crossPackageRef("@happyvertical/smrt-assets:Asset", { required: true })], PerformerOwnedAsset.prototype, "assetId", 2);
|
|
925
|
+
__decorateClass$7([field({ required: true })], PerformerOwnedAsset.prototype, "role", 2);
|
|
926
|
+
__decorateClass$7([field()], PerformerOwnedAsset.prototype, "sortOrder", 2);
|
|
927
|
+
PerformerOwnedAsset = __decorateClass$7([TenantScoped({ mode: "optional" }), smrt({
|
|
928
|
+
name: "PerformerOwnedAsset",
|
|
929
|
+
tableName: "performer_assets",
|
|
930
|
+
conflictColumns: [
|
|
931
|
+
"performer_id",
|
|
932
|
+
"asset_id",
|
|
933
|
+
"role"
|
|
934
|
+
],
|
|
935
|
+
api: false,
|
|
936
|
+
mcp: false,
|
|
937
|
+
cli: false
|
|
938
|
+
})], PerformerOwnedAsset);
|
|
939
|
+
//#endregion
|
|
940
|
+
//#region src/performer-assets.ts
|
|
941
|
+
var performer_assets_exports = /* @__PURE__ */ __exportAll({ PerformerOwnedAssetCollection: () => PerformerOwnedAssetCollection });
|
|
1645
942
|
var __defProp$6 = Object.defineProperty;
|
|
1646
943
|
var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
|
|
1647
|
-
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$6(obj, key, {
|
|
944
|
+
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$6(obj, key, {
|
|
945
|
+
enumerable: true,
|
|
946
|
+
configurable: true,
|
|
947
|
+
writable: true,
|
|
948
|
+
value
|
|
949
|
+
}) : obj[key] = value;
|
|
1648
950
|
var __decorateClass$6 = (decorators, target, key, kind) => {
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
return result;
|
|
951
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
|
|
952
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
953
|
+
if (kind && result) __defProp$6(target, key, result);
|
|
954
|
+
return result;
|
|
1654
955
|
};
|
|
1655
|
-
var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, key + "", value);
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
956
|
+
var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
957
|
+
var PerformerOwnedAssetCollection = class extends SmrtJunction {
|
|
958
|
+
leftField = "performerId";
|
|
959
|
+
rightField = "assetId";
|
|
1659
960
|
};
|
|
1660
961
|
__publicField$1(PerformerOwnedAssetCollection, "_itemClass", PerformerOwnedAsset);
|
|
1661
|
-
PerformerOwnedAssetCollection = __decorateClass$6([
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
const performerAssets = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1669
|
-
__proto__: null,
|
|
1670
|
-
get PerformerOwnedAssetCollection() {
|
|
1671
|
-
return PerformerOwnedAssetCollection;
|
|
1672
|
-
}
|
|
1673
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
962
|
+
PerformerOwnedAssetCollection = __decorateClass$6([smrt({
|
|
963
|
+
api: false,
|
|
964
|
+
mcp: false,
|
|
965
|
+
cli: false
|
|
966
|
+
})], PerformerOwnedAssetCollection);
|
|
967
|
+
//#endregion
|
|
968
|
+
//#region src/scene-asset.ts
|
|
1674
969
|
var __defProp$5 = Object.defineProperty;
|
|
1675
970
|
var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
|
|
1676
971
|
var __decorateClass$5 = (decorators, target, key, kind) => {
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
if (kind && result) __defProp$5(target, key, result);
|
|
1682
|
-
return result;
|
|
972
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
|
|
973
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
974
|
+
if (kind && result) __defProp$5(target, key, result);
|
|
975
|
+
return result;
|
|
1683
976
|
};
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
977
|
+
var SceneAsset = class extends Asset {
|
|
978
|
+
sceneId = null;
|
|
979
|
+
role = "source";
|
|
980
|
+
constructor(options = {}) {
|
|
981
|
+
super(options);
|
|
982
|
+
if (options.sceneId !== void 0) this.sceneId = options.sceneId;
|
|
983
|
+
if (options.role !== void 0) this.role = options.role;
|
|
984
|
+
}
|
|
1692
985
|
};
|
|
1693
|
-
__decorateClass$5([
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
],
|
|
986
|
+
__decorateClass$5([foreignKey(() => Scene)], SceneAsset.prototype, "sceneId", 2);
|
|
987
|
+
SceneAsset = __decorateClass$5([smrt({
|
|
988
|
+
api: { include: [
|
|
989
|
+
"list",
|
|
990
|
+
"get",
|
|
991
|
+
"create",
|
|
992
|
+
"update",
|
|
993
|
+
"delete"
|
|
994
|
+
] },
|
|
995
|
+
mcp: { include: ["list", "get"] },
|
|
996
|
+
cli: true
|
|
997
|
+
})], SceneAsset);
|
|
998
|
+
//#endregion
|
|
999
|
+
//#region src/scene-owned-asset.ts
|
|
1703
1000
|
var __defProp$4 = Object.defineProperty;
|
|
1704
1001
|
var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
|
|
1705
1002
|
var __decorateClass$4 = (decorators, target, key, kind) => {
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
if (kind && result) __defProp$4(target, key, result);
|
|
1711
|
-
return result;
|
|
1003
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
|
|
1004
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1005
|
+
if (kind && result) __defProp$4(target, key, result);
|
|
1006
|
+
return result;
|
|
1712
1007
|
};
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1008
|
+
var SceneOwnedAsset = class extends SmrtObject {
|
|
1009
|
+
tenantId = null;
|
|
1010
|
+
sceneId = "";
|
|
1011
|
+
assetId = "";
|
|
1012
|
+
role = "source";
|
|
1013
|
+
sortOrder = 0;
|
|
1014
|
+
constructor(options = {}) {
|
|
1015
|
+
super(options);
|
|
1016
|
+
if (options.sceneId) this.sceneId = options.sceneId;
|
|
1017
|
+
if (options.assetId) this.assetId = options.assetId;
|
|
1018
|
+
if (options.role !== void 0) this.role = options.role;
|
|
1019
|
+
if (options.sortOrder !== void 0) this.sortOrder = options.sortOrder;
|
|
1020
|
+
if (options.tenantId !== void 0) this.tenantId = options.tenantId;
|
|
1021
|
+
}
|
|
1727
1022
|
};
|
|
1728
|
-
__decorateClass$4([
|
|
1729
|
-
|
|
1730
|
-
], SceneOwnedAsset.prototype, "
|
|
1731
|
-
__decorateClass$4([
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
conflictColumns: ["scene_id", "asset_id", "role"],
|
|
1749
|
-
api: false,
|
|
1750
|
-
mcp: false,
|
|
1751
|
-
cli: false
|
|
1752
|
-
})
|
|
1753
|
-
], SceneOwnedAsset);
|
|
1023
|
+
__decorateClass$4([tenantId({ nullable: true })], SceneOwnedAsset.prototype, "tenantId", 2);
|
|
1024
|
+
__decorateClass$4([foreignKey(() => Scene, { required: true })], SceneOwnedAsset.prototype, "sceneId", 2);
|
|
1025
|
+
__decorateClass$4([crossPackageRef("@happyvertical/smrt-assets:Asset", { required: true })], SceneOwnedAsset.prototype, "assetId", 2);
|
|
1026
|
+
__decorateClass$4([field({ required: true })], SceneOwnedAsset.prototype, "role", 2);
|
|
1027
|
+
__decorateClass$4([field()], SceneOwnedAsset.prototype, "sortOrder", 2);
|
|
1028
|
+
SceneOwnedAsset = __decorateClass$4([TenantScoped({ mode: "optional" }), smrt({
|
|
1029
|
+
name: "SceneOwnedAsset",
|
|
1030
|
+
tableName: "scene_assets",
|
|
1031
|
+
conflictColumns: [
|
|
1032
|
+
"scene_id",
|
|
1033
|
+
"asset_id",
|
|
1034
|
+
"role"
|
|
1035
|
+
],
|
|
1036
|
+
api: false,
|
|
1037
|
+
mcp: false,
|
|
1038
|
+
cli: false
|
|
1039
|
+
})], SceneOwnedAsset);
|
|
1040
|
+
//#endregion
|
|
1041
|
+
//#region src/scene-assets.ts
|
|
1042
|
+
var scene_assets_exports = /* @__PURE__ */ __exportAll({ SceneOwnedAssetCollection: () => SceneOwnedAssetCollection });
|
|
1754
1043
|
var __defProp$3 = Object.defineProperty;
|
|
1755
1044
|
var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
|
|
1756
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp$3(obj, key, {
|
|
1045
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp$3(obj, key, {
|
|
1046
|
+
enumerable: true,
|
|
1047
|
+
configurable: true,
|
|
1048
|
+
writable: true,
|
|
1049
|
+
value
|
|
1050
|
+
}) : obj[key] = value;
|
|
1757
1051
|
var __decorateClass$3 = (decorators, target, key, kind) => {
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
return result;
|
|
1052
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
|
|
1053
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1054
|
+
if (kind && result) __defProp$3(target, key, result);
|
|
1055
|
+
return result;
|
|
1763
1056
|
};
|
|
1764
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1057
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1058
|
+
var SceneOwnedAssetCollection = class extends SmrtJunction {
|
|
1059
|
+
leftField = "sceneId";
|
|
1060
|
+
rightField = "assetId";
|
|
1768
1061
|
};
|
|
1769
1062
|
__publicField(SceneOwnedAssetCollection, "_itemClass", SceneOwnedAsset);
|
|
1770
|
-
SceneOwnedAssetCollection = __decorateClass$3([
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
const sceneAssets = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1778
|
-
__proto__: null,
|
|
1779
|
-
get SceneOwnedAssetCollection() {
|
|
1780
|
-
return SceneOwnedAssetCollection;
|
|
1781
|
-
}
|
|
1782
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
1063
|
+
SceneOwnedAssetCollection = __decorateClass$3([smrt({
|
|
1064
|
+
api: false,
|
|
1065
|
+
mcp: false,
|
|
1066
|
+
cli: false
|
|
1067
|
+
})], SceneOwnedAssetCollection);
|
|
1068
|
+
//#endregion
|
|
1069
|
+
//#region src/video-composition-asset.ts
|
|
1783
1070
|
var __defProp$2 = Object.defineProperty;
|
|
1784
1071
|
var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
|
|
1785
1072
|
var __decorateClass$2 = (decorators, target, key, kind) => {
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
if (kind && result) __defProp$2(target, key, result);
|
|
1791
|
-
return result;
|
|
1073
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
|
|
1074
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1075
|
+
if (kind && result) __defProp$2(target, key, result);
|
|
1076
|
+
return result;
|
|
1792
1077
|
};
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
}
|
|
1078
|
+
var VideoCompositionAsset = class extends Asset {
|
|
1079
|
+
videoCompositionId = null;
|
|
1080
|
+
role = "video";
|
|
1081
|
+
constructor(options = {}) {
|
|
1082
|
+
super(options);
|
|
1083
|
+
if (options.videoCompositionId !== void 0) this.videoCompositionId = options.videoCompositionId;
|
|
1084
|
+
if (options.role !== void 0) this.role = options.role;
|
|
1085
|
+
}
|
|
1802
1086
|
};
|
|
1803
|
-
__decorateClass$2([
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
],
|
|
1087
|
+
__decorateClass$2([foreignKey(() => VideoComposition)], VideoCompositionAsset.prototype, "videoCompositionId", 2);
|
|
1088
|
+
VideoCompositionAsset = __decorateClass$2([smrt({
|
|
1089
|
+
api: { include: [
|
|
1090
|
+
"list",
|
|
1091
|
+
"get",
|
|
1092
|
+
"create",
|
|
1093
|
+
"update",
|
|
1094
|
+
"delete"
|
|
1095
|
+
] },
|
|
1096
|
+
mcp: { include: ["list", "get"] },
|
|
1097
|
+
cli: true
|
|
1098
|
+
})], VideoCompositionAsset);
|
|
1099
|
+
//#endregion
|
|
1100
|
+
//#region src/video-sequence-asset.ts
|
|
1813
1101
|
var __defProp$1 = Object.defineProperty;
|
|
1814
1102
|
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
1815
1103
|
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
if (kind && result) __defProp$1(target, key, result);
|
|
1821
|
-
return result;
|
|
1104
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
|
|
1105
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1106
|
+
if (kind && result) __defProp$1(target, key, result);
|
|
1107
|
+
return result;
|
|
1822
1108
|
};
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
}
|
|
1109
|
+
var VideoSequenceAsset = class extends Asset {
|
|
1110
|
+
videoSequenceId = null;
|
|
1111
|
+
role = "video";
|
|
1112
|
+
constructor(options = {}) {
|
|
1113
|
+
super(options);
|
|
1114
|
+
if (options.videoSequenceId !== void 0) this.videoSequenceId = options.videoSequenceId;
|
|
1115
|
+
if (options.role !== void 0) this.role = options.role;
|
|
1116
|
+
}
|
|
1832
1117
|
};
|
|
1833
|
-
__decorateClass$1([
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
],
|
|
1118
|
+
__decorateClass$1([foreignKey(() => VideoSequence)], VideoSequenceAsset.prototype, "videoSequenceId", 2);
|
|
1119
|
+
VideoSequenceAsset = __decorateClass$1([smrt({
|
|
1120
|
+
api: { include: [
|
|
1121
|
+
"list",
|
|
1122
|
+
"get",
|
|
1123
|
+
"create",
|
|
1124
|
+
"update",
|
|
1125
|
+
"delete"
|
|
1126
|
+
] },
|
|
1127
|
+
mcp: { include: ["list", "get"] },
|
|
1128
|
+
cli: true
|
|
1129
|
+
})], VideoSequenceAsset);
|
|
1130
|
+
//#endregion
|
|
1131
|
+
//#region src/video-shot-asset.ts
|
|
1843
1132
|
var __defProp = Object.defineProperty;
|
|
1844
1133
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
1845
1134
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
if (kind && result) __defProp(target, key, result);
|
|
1851
|
-
return result;
|
|
1852
|
-
};
|
|
1853
|
-
let VideoShotAsset = class extends Asset {
|
|
1854
|
-
videoShotId = null;
|
|
1855
|
-
role = "video";
|
|
1856
|
-
constructor(options = {}) {
|
|
1857
|
-
super(options);
|
|
1858
|
-
if (options.videoShotId !== void 0)
|
|
1859
|
-
this.videoShotId = options.videoShotId;
|
|
1860
|
-
if (options.role !== void 0) this.role = options.role;
|
|
1861
|
-
}
|
|
1135
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
1136
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1137
|
+
if (kind && result) __defProp(target, key, result);
|
|
1138
|
+
return result;
|
|
1862
1139
|
};
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
})
|
|
1872
|
-
], VideoShotAsset);
|
|
1873
|
-
export {
|
|
1874
|
-
Character,
|
|
1875
|
-
CharacterAsset,
|
|
1876
|
-
CharacterCollection,
|
|
1877
|
-
CharacterOwnedAsset,
|
|
1878
|
-
CharacterOwnedAssetCollection,
|
|
1879
|
-
CompositeJob,
|
|
1880
|
-
Performer,
|
|
1881
|
-
PerformerAsset,
|
|
1882
|
-
PerformerOwnedAsset,
|
|
1883
|
-
PerformerOwnedAssetCollection,
|
|
1884
|
-
Character as PersonalityProfile,
|
|
1885
|
-
Scene,
|
|
1886
|
-
SceneAsset,
|
|
1887
|
-
SceneOwnedAsset,
|
|
1888
|
-
SceneOwnedAssetCollection,
|
|
1889
|
-
VideoComposition,
|
|
1890
|
-
VideoCompositionAsset,
|
|
1891
|
-
VideoCompositionCollection,
|
|
1892
|
-
VideoShot as VideoContent,
|
|
1893
|
-
VideoSequence,
|
|
1894
|
-
VideoSequenceAsset,
|
|
1895
|
-
VideoSequenceCollection,
|
|
1896
|
-
VideoShot,
|
|
1897
|
-
VideoShotAsset,
|
|
1898
|
-
VideoShotCharacter,
|
|
1899
|
-
VideoShotCharacterCollection,
|
|
1900
|
-
VideoShotCollection,
|
|
1901
|
-
VideoWorkflow,
|
|
1902
|
-
persistMediaBundleInspection
|
|
1140
|
+
var VideoShotAsset = class extends Asset {
|
|
1141
|
+
videoShotId = null;
|
|
1142
|
+
role = "video";
|
|
1143
|
+
constructor(options = {}) {
|
|
1144
|
+
super(options);
|
|
1145
|
+
if (options.videoShotId !== void 0) this.videoShotId = options.videoShotId;
|
|
1146
|
+
if (options.role !== void 0) this.role = options.role;
|
|
1147
|
+
}
|
|
1903
1148
|
};
|
|
1904
|
-
|
|
1149
|
+
__decorateClass([foreignKey(() => VideoShot)], VideoShotAsset.prototype, "videoShotId", 2);
|
|
1150
|
+
VideoShotAsset = __decorateClass([smrt({
|
|
1151
|
+
api: { include: [
|
|
1152
|
+
"list",
|
|
1153
|
+
"get",
|
|
1154
|
+
"create",
|
|
1155
|
+
"update",
|
|
1156
|
+
"delete"
|
|
1157
|
+
] },
|
|
1158
|
+
mcp: { include: ["list", "get"] },
|
|
1159
|
+
cli: true
|
|
1160
|
+
})], VideoShotAsset);
|
|
1161
|
+
//#endregion
|
|
1162
|
+
export { Character, Character as PersonalityProfile, CharacterAsset, CharacterCollection, CharacterOwnedAsset, CharacterOwnedAssetCollection, CompositeJob, Performer, PerformerAsset, PerformerOwnedAsset, PerformerOwnedAssetCollection, Scene, SceneAsset, SceneOwnedAsset, SceneOwnedAssetCollection, VideoComposition, VideoCompositionAsset, VideoCompositionCollection, VideoShot as VideoContent, VideoShot, VideoSequence, VideoSequenceAsset, VideoSequenceCollection, VideoShotAsset, VideoShotCharacter, VideoShotCharacterCollection, VideoShotCollection, VideoWorkflow, performer_assets_exports as n, persistMediaBundleInspection, scene_assets_exports as t };
|
|
1163
|
+
|
|
1164
|
+
//# sourceMappingURL=index.js.map
|