@clipwright/core 0.26.1 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +80 -0
- package/README.md +5 -0
- package/dist/api-failure.d.ts +68 -1
- package/dist/api-failure.js +119 -1
- package/dist/api-failure.js.map +1 -1
- package/dist/contract-dispositions.js +3 -3
- package/dist/contract-dispositions.js.map +1 -1
- package/dist/contracts/v1/workflow-brief.d.ts +402 -0
- package/dist/contracts/v1/workflow-brief.js +40 -0
- package/dist/contracts/v1/workflow-brief.js.map +1 -0
- package/dist/contracts/v1/workflow-catalog.d.ts +1060 -0
- package/dist/contracts/v1/workflow-catalog.js +45 -0
- package/dist/contracts/v1/workflow-catalog.js.map +1 -0
- package/dist/contracts/v1/workflow-dto.d.ts +18 -0
- package/dist/contracts/v1/workflow-dto.js +25 -0
- package/dist/contracts/v1/workflow-dto.js.map +1 -0
- package/dist/contracts/v1/workflow-evidence.d.ts +115 -0
- package/dist/contracts/v1/workflow-evidence.js +33 -0
- package/dist/contracts/v1/workflow-evidence.js.map +1 -0
- package/dist/contracts/v1/workflow-execution.d.ts +235 -0
- package/dist/contracts/v1/workflow-execution.js +33 -0
- package/dist/contracts/v1/workflow-execution.js.map +1 -0
- package/dist/contracts/v1/workflow-plan.d.ts +1057 -0
- package/dist/contracts/v1/workflow-plan.js +26 -0
- package/dist/contracts/v1/workflow-plan.js.map +1 -0
- package/dist/contracts/v1/workflow-primitives.d.ts +62 -0
- package/dist/contracts/v1/workflow-primitives.js +16 -0
- package/dist/contracts/v1/workflow-primitives.js.map +1 -0
- package/dist/edit-billing.d.ts +65 -0
- package/dist/edit-billing.js +30 -0
- package/dist/edit-billing.js.map +1 -0
- package/dist/edit-document.d.ts +335 -0
- package/dist/edit-document.js +110 -0
- package/dist/edit-document.js.map +1 -0
- package/dist/edit-faceless.d.ts +24 -0
- package/dist/edit-faceless.js +39 -0
- package/dist/edit-faceless.js.map +1 -0
- package/dist/edit-operations.d.ts +34 -0
- package/dist/edit-operations.js +13 -0
- package/dist/edit-operations.js.map +1 -0
- package/dist/edit-primitives.d.ts +8 -0
- package/dist/edit-primitives.js +12 -0
- package/dist/edit-primitives.js.map +1 -0
- package/dist/edit-revision.d.ts +162 -0
- package/dist/edit-revision.js +36 -0
- package/dist/edit-revision.js.map +1 -0
- package/dist/edit-rules.d.ts +60 -0
- package/dist/edit-rules.js +44 -0
- package/dist/edit-rules.js.map +1 -0
- package/dist/edit-shots.d.ts +548 -0
- package/dist/edit-shots.js +61 -0
- package/dist/edit-shots.js.map +1 -0
- package/dist/edit-validate.d.ts +57 -0
- package/dist/edit-validate.js +248 -0
- package/dist/edit-validate.js.map +1 -0
- package/dist/edit.d.ts +8 -0
- package/dist/edit.js +10 -0
- package/dist/edit.js.map +1 -0
- package/dist/endpoints.d.ts +5 -0
- package/dist/endpoints.js +35 -19
- package/dist/endpoints.js.map +1 -1
- package/dist/errors.d.ts +125 -1
- package/dist/errors.js +129 -0
- package/dist/errors.js.map +1 -1
- package/dist/faceless-media-record.d.ts +100 -0
- package/dist/faceless-media-record.js +25 -0
- package/dist/faceless-media-record.js.map +1 -0
- package/dist/faceless-public-plan.d.ts +1 -0
- package/dist/faceless-public-plan.js +2 -1
- package/dist/faceless-public-plan.js.map +1 -1
- package/dist/faceless-public.d.ts +254 -0
- package/dist/faceless-public.js +11 -0
- package/dist/faceless-public.js.map +1 -1
- package/dist/idempotency.d.ts +2 -0
- package/dist/idempotency.js +9 -0
- package/dist/idempotency.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/runs.d.ts +52 -0
- package/dist/runs.js +15 -2
- package/dist/runs.js.map +1 -1
- package/dist/uploads.d.ts +4 -2
- package/dist/uploads.js +5 -3
- package/dist/uploads.js.map +1 -1
- package/dist/workflows/catalog.d.ts +4 -0
- package/dist/workflows/catalog.js +57 -0
- package/dist/workflows/catalog.js.map +1 -0
- package/dist/workflows/index.d.ts +9 -0
- package/dist/workflows/index.js +10 -0
- package/dist/workflows/index.js.map +1 -0
- package/dist/workflows/methods/faceless-explainer.d.ts +175 -0
- package/dist/workflows/methods/faceless-explainer.js +20 -0
- package/dist/workflows/methods/faceless-explainer.js.map +1 -0
- package/dist/workflows/methods/kinetic-launch.d.ts +175 -0
- package/dist/workflows/methods/kinetic-launch.js +19 -0
- package/dist/workflows/methods/kinetic-launch.js.map +1 -0
- package/dist/workflows/methods/product-image-story.d.ts +175 -0
- package/dist/workflows/methods/product-image-story.js +20 -0
- package/dist/workflows/methods/product-image-story.js.map +1 -0
- package/dist/workflows/methods/shared.d.ts +190 -0
- package/dist/workflows/methods/shared.js +13 -0
- package/dist/workflows/methods/shared.js.map +1 -0
- package/dist/workflows/methods/ugc-faq-answer.d.ts +175 -0
- package/dist/workflows/methods/ugc-faq-answer.js +19 -0
- package/dist/workflows/methods/ugc-faq-answer.js.map +1 -0
- package/dist/workflows/methods/ugc-product-intro.d.ts +175 -0
- package/dist/workflows/methods/ugc-product-intro.js +19 -0
- package/dist/workflows/methods/ugc-product-intro.js.map +1 -0
- package/dist/workflows/methods/website-proof-demo.d.ts +175 -0
- package/dist/workflows/methods/website-proof-demo.js +19 -0
- package/dist/workflows/methods/website-proof-demo.js.map +1 -0
- package/dist/workflows/validate.d.ts +10 -0
- package/dist/workflows/validate.js +203 -0
- package/dist/workflows/validate.js.map +1 -0
- package/dist/workflows.d.ts +1 -0
- package/dist/workflows.js +2 -0
- package/dist/workflows.js.map +1 -0
- package/package.json +9 -1
- package/dist/__fixtures__/queue-promises.d.ts +0 -8
- package/dist/__fixtures__/queue-promises.js +0 -22
- package/dist/__fixtures__/queue-promises.js.map +0 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { workflowBrief, workflowBriefRead } from './workflow-brief.js';
|
|
3
|
+
import { workflowBeat, workflowBeatRead } from './workflow-catalog.js';
|
|
4
|
+
import { assetBinding, assetBindingRead, claimEvidence, claimEvidenceRead } from './workflow-evidence.js';
|
|
5
|
+
import { workflowDigest, workflowId, workflowIssueRead, workflowMethodPin, workflowMethodPinRead, workflowRevision, workflowText } from './workflow-primitives.js';
|
|
6
|
+
export const workflowPlanDocument = z.strictObject({
|
|
7
|
+
v: z.literal(1), method: workflowMethodPin, brief: workflowBrief, beats: z.array(workflowBeat).max(100),
|
|
8
|
+
claims: z.array(claimEvidence).max(100), assets: z.array(assetBinding).max(30),
|
|
9
|
+
}).refine(document => new Set(document.beats.map(beat => beat.id)).size === document.beats.length, 'Beat IDs must be unique')
|
|
10
|
+
.refine(document => new Set(document.claims.map(claim => claim.id)).size === document.claims.length, 'Claim IDs must be unique')
|
|
11
|
+
.refine(document => new TextEncoder().encode(JSON.stringify(document)).length <= WORKFLOW_DOCUMENT_MAX_BYTES, 'Workflow document exceeds the byte limit');
|
|
12
|
+
export const workflowPlanDocumentRead = z.object({ v: z.number(), method: workflowMethodPinRead, brief: workflowBriefRead,
|
|
13
|
+
beats: z.array(workflowBeatRead), claims: z.array(claimEvidenceRead), assets: z.array(assetBindingRead) });
|
|
14
|
+
export const createWorkflowPlan = z.strictObject({ document: workflowPlanDocument });
|
|
15
|
+
export const saveWorkflowPlan = z.strictObject({ base_version: z.number().int().nonnegative().safe(), document: workflowPlanDocument });
|
|
16
|
+
export const approveWorkflowPlan = z.strictObject({ revision: workflowRevision, content_digest: workflowDigest });
|
|
17
|
+
export const workflowPlanRead = z.object({
|
|
18
|
+
v: z.number(), plan_id: workflowId, account_id: workflowText(200), revision: workflowRevision, content_digest: workflowDigest, document: workflowPlanDocumentRead,
|
|
19
|
+
status: z.string(), issues: z.array(workflowIssueRead), warnings: z.array(z.string()), approved_at: z.string().datetime().nullable(), created_at: z.string().datetime(),
|
|
20
|
+
});
|
|
21
|
+
export const WORKFLOW_DOCUMENT_MAX_BYTES = 256_000;
|
|
22
|
+
export function serializeWorkflowDocument(document) {
|
|
23
|
+
const json = JSON.stringify(document);
|
|
24
|
+
return { json, bytes: new TextEncoder().encode(json).length };
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=workflow-plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-plan.js","sourceRoot":"","sources":["../../../src/contracts/v1/workflow-plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC1G,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAEnK,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,YAAY,CAAC;IAC/C,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,iBAAiB,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACvG,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;CACjF,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ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,CAAC;AAClH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,wBAAwB;IACjK,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC1K,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,OAAO,CAAC;AACnD,MAAM,UAAU,yBAAyB,CAAC,QAA8B;IACpE,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACtC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const WORKFLOW_METHOD_IDS: readonly ['ugc-product-intro', 'ugc-faq-answer', 'faceless-explainer', 'product-image-story', 'website-proof-demo', 'kinetic-launch'];
|
|
3
|
+
export declare const workflowMethodId: z.ZodEnum<{
|
|
4
|
+
"faceless-explainer": "faceless-explainer";
|
|
5
|
+
"kinetic-launch": "kinetic-launch";
|
|
6
|
+
"product-image-story": "product-image-story";
|
|
7
|
+
"ugc-faq-answer": "ugc-faq-answer";
|
|
8
|
+
"ugc-product-intro": "ugc-product-intro";
|
|
9
|
+
"website-proof-demo": "website-proof-demo";
|
|
10
|
+
}>;
|
|
11
|
+
export declare const workflowDigest: z.ZodString;
|
|
12
|
+
export declare const workflowId: z.ZodString;
|
|
13
|
+
export declare const workflowRevision: z.ZodNumber;
|
|
14
|
+
export declare const workflowLocalId: z.ZodString;
|
|
15
|
+
export declare const workflowText: (max: number) => z.ZodString;
|
|
16
|
+
export declare const workflowFormat: z.ZodObject<{
|
|
17
|
+
aspect_ratio: z.ZodEnum<{
|
|
18
|
+
"16:9": "16:9";
|
|
19
|
+
"1:1": "1:1";
|
|
20
|
+
"9:16": "9:16";
|
|
21
|
+
}>;
|
|
22
|
+
resolution: z.ZodEnum<{
|
|
23
|
+
"1080p": "1080p";
|
|
24
|
+
"4k": "4k";
|
|
25
|
+
"720p": "720p";
|
|
26
|
+
}>;
|
|
27
|
+
}, z.core.$strict>;
|
|
28
|
+
export declare const workflowFormatRead: z.ZodObject<{
|
|
29
|
+
aspect_ratio: z.ZodString;
|
|
30
|
+
resolution: z.ZodString;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export declare const workflowMethodPin: z.ZodObject<{
|
|
33
|
+
method_id: z.ZodEnum<{
|
|
34
|
+
"faceless-explainer": "faceless-explainer";
|
|
35
|
+
"kinetic-launch": "kinetic-launch";
|
|
36
|
+
"product-image-story": "product-image-story";
|
|
37
|
+
"ugc-faq-answer": "ugc-faq-answer";
|
|
38
|
+
"ugc-product-intro": "ugc-product-intro";
|
|
39
|
+
"website-proof-demo": "website-proof-demo";
|
|
40
|
+
}>;
|
|
41
|
+
version: z.ZodNumber;
|
|
42
|
+
content_digest: z.ZodString;
|
|
43
|
+
capability_digest: z.ZodString;
|
|
44
|
+
}, z.core.$strict>;
|
|
45
|
+
export declare const workflowMethodPinRead: z.ZodObject<{
|
|
46
|
+
method_id: z.ZodString;
|
|
47
|
+
version: z.ZodNumber;
|
|
48
|
+
content_digest: z.ZodString;
|
|
49
|
+
capability_digest: z.ZodString;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
export type WorkflowMethodPin = z.infer<typeof workflowMethodPin>;
|
|
52
|
+
export declare const workflowIssue: z.ZodObject<{
|
|
53
|
+
kind: z.ZodString;
|
|
54
|
+
path: z.ZodString;
|
|
55
|
+
message: z.ZodString;
|
|
56
|
+
}, z.core.$strict>;
|
|
57
|
+
export type WorkflowIssue = z.infer<typeof workflowIssue>;
|
|
58
|
+
export declare const workflowIssueRead: z.ZodObject<{
|
|
59
|
+
kind: z.ZodString;
|
|
60
|
+
path: z.ZodString;
|
|
61
|
+
message: z.ZodString;
|
|
62
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ASPECT_RATIOS, RESOLUTIONS } from '../../skills.js';
|
|
3
|
+
export const WORKFLOW_METHOD_IDS = ['ugc-product-intro', 'ugc-faq-answer', 'faceless-explainer', 'product-image-story', 'website-proof-demo', 'kinetic-launch'];
|
|
4
|
+
export const workflowMethodId = z.enum(WORKFLOW_METHOD_IDS);
|
|
5
|
+
export const workflowDigest = z.string().regex(/^[a-f0-9]{64}$/);
|
|
6
|
+
export const workflowId = z.string().regex(/^wfp_[a-zA-Z0-9_-]{1,64}$/);
|
|
7
|
+
export const workflowRevision = z.number().int().positive().safe();
|
|
8
|
+
export const workflowLocalId = z.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/);
|
|
9
|
+
export const workflowText = (max) => z.string().min(1).max(max).refine(text => text.trim().length > 0, 'Text must not be blank');
|
|
10
|
+
export const workflowFormat = z.strictObject({ aspect_ratio: z.enum(ASPECT_RATIOS), resolution: z.enum(RESOLUTIONS) });
|
|
11
|
+
export const workflowFormatRead = z.object({ aspect_ratio: z.string(), resolution: z.string() });
|
|
12
|
+
export const workflowMethodPin = z.strictObject({ method_id: workflowMethodId, version: workflowRevision, content_digest: workflowDigest, capability_digest: workflowDigest });
|
|
13
|
+
export const workflowMethodPinRead = z.object({ method_id: z.string(), version: workflowRevision, content_digest: workflowDigest, capability_digest: workflowDigest });
|
|
14
|
+
export const workflowIssue = z.strictObject({ kind: workflowText(80), path: z.string().max(500), message: workflowText(2000) });
|
|
15
|
+
export const workflowIssueRead = z.object({ kind: z.string(), path: z.string(), message: z.string() });
|
|
16
|
+
//# sourceMappingURL=workflow-primitives.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-primitives.js","sourceRoot":"","sources":["../../../src/contracts/v1/workflow-primitives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,mBAAmB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,gBAAgB,CAAU,CAAC;AACzK,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;AAC5D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;AACxE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;AACnE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;AACpF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,C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AE,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** One priced line of a revision: a generated unit, or a kept candidate entering the video. */
|
|
3
|
+
export declare const revisionPriceLine: z.ZodObject<{
|
|
4
|
+
shot_id: z.ZodString;
|
|
5
|
+
unit: z.ZodEnum<{
|
|
6
|
+
clip: "clip";
|
|
7
|
+
clip_with_new_picture: "clip_with_new_picture";
|
|
8
|
+
kept_clip: "kept_clip";
|
|
9
|
+
kept_picture: "kept_picture";
|
|
10
|
+
picture: "picture";
|
|
11
|
+
}>;
|
|
12
|
+
credits: z.ZodNumber;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
export type RevisionPriceLine = z.infer<typeof revisionPriceLine>;
|
|
15
|
+
/** The price of a revision, frozen at admission. `zero_unit` names the rule a revision without generation took. */
|
|
16
|
+
export declare const revisionBilling: z.ZodObject<{
|
|
17
|
+
tariff_id: z.ZodString;
|
|
18
|
+
lines: z.ZodArray<z.ZodObject<{
|
|
19
|
+
shot_id: z.ZodString;
|
|
20
|
+
unit: z.ZodEnum<{
|
|
21
|
+
clip: "clip";
|
|
22
|
+
clip_with_new_picture: "clip_with_new_picture";
|
|
23
|
+
kept_clip: "kept_clip";
|
|
24
|
+
kept_picture: "kept_picture";
|
|
25
|
+
picture: "picture";
|
|
26
|
+
}>;
|
|
27
|
+
credits: z.ZodNumber;
|
|
28
|
+
}, z.core.$strict>>;
|
|
29
|
+
render_credits: z.ZodNumber;
|
|
30
|
+
zero_unit: z.ZodNullable<z.ZodEnum<{
|
|
31
|
+
free: "free";
|
|
32
|
+
priced: "priced";
|
|
33
|
+
}>>;
|
|
34
|
+
total_credits: z.ZodNumber;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
export type RevisionBilling = z.infer<typeof revisionBilling>;
|
|
37
|
+
/** What a revision changes, as the server states it. */
|
|
38
|
+
export declare const editSummaryWire: z.ZodObject<{
|
|
39
|
+
retimed: z.ZodArray<z.ZodString>;
|
|
40
|
+
deleted: z.ZodArray<z.ZodString>;
|
|
41
|
+
added: z.ZodArray<z.ZodString>;
|
|
42
|
+
replaced: z.ZodArray<z.ZodObject<{
|
|
43
|
+
shot_id: z.ZodString;
|
|
44
|
+
from: z.ZodEnum<{
|
|
45
|
+
candidate: "candidate";
|
|
46
|
+
upload: "upload";
|
|
47
|
+
}>;
|
|
48
|
+
}, z.core.$strict>>;
|
|
49
|
+
generated: z.ZodArray<z.ZodObject<{
|
|
50
|
+
shot_id: z.ZodString;
|
|
51
|
+
kind: z.ZodEnum<{
|
|
52
|
+
clip: "clip";
|
|
53
|
+
picture: "picture";
|
|
54
|
+
presenter: "presenter";
|
|
55
|
+
}>;
|
|
56
|
+
mode: z.ZodEnum<{
|
|
57
|
+
animate: "animate";
|
|
58
|
+
edit_picture: "edit_picture";
|
|
59
|
+
new_picture: "new_picture";
|
|
60
|
+
retake: "retake";
|
|
61
|
+
}>;
|
|
62
|
+
}, z.core.$strict>>;
|
|
63
|
+
changed: z.ZodBoolean;
|
|
64
|
+
}, z.core.$strict>;
|
|
65
|
+
export type EditSummaryWire = z.infer<typeof editSummaryWire>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { SHOT_OPERATION_MODES } from "./edit-operations.js";
|
|
3
|
+
import { shotId } from "./edit-primitives.js";
|
|
4
|
+
// A leaf: `runs.ts` imports it, so it reaches neither `edit-document.ts` nor `runs.ts`.
|
|
5
|
+
const credits = z.number().int().nonnegative().safe();
|
|
6
|
+
const shotKind = z.enum(["picture", "clip", "presenter"]);
|
|
7
|
+
/** One priced line of a revision: a generated unit, or a kept candidate entering the video. */
|
|
8
|
+
export const revisionPriceLine = z.strictObject({
|
|
9
|
+
shot_id: shotId,
|
|
10
|
+
unit: z.enum(["picture", "clip", "clip_with_new_picture", "kept_picture", "kept_clip"]),
|
|
11
|
+
credits,
|
|
12
|
+
});
|
|
13
|
+
/** The price of a revision, frozen at admission. `zero_unit` names the rule a revision without generation took. */
|
|
14
|
+
export const revisionBilling = z.strictObject({
|
|
15
|
+
tariff_id: z.string().min(1),
|
|
16
|
+
lines: z.array(revisionPriceLine),
|
|
17
|
+
render_credits: credits,
|
|
18
|
+
zero_unit: z.enum(["priced", "free"]).nullable(),
|
|
19
|
+
total_credits: credits,
|
|
20
|
+
});
|
|
21
|
+
/** What a revision changes, as the server states it. */
|
|
22
|
+
export const editSummaryWire = z.strictObject({
|
|
23
|
+
retimed: z.array(shotId),
|
|
24
|
+
deleted: z.array(shotId),
|
|
25
|
+
added: z.array(shotId),
|
|
26
|
+
replaced: z.array(z.strictObject({ shot_id: shotId, from: z.enum(["candidate", "upload"]) })),
|
|
27
|
+
generated: z.array(z.strictObject({ shot_id: shotId, kind: shotKind, mode: z.enum(SHOT_OPERATION_MODES) })),
|
|
28
|
+
changed: z.boolean(),
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=edit-billing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit-billing.js","sourceRoot":"","sources":["../src/edit-billing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C,wFAAwF;AACxF,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;AACtD,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAwC,CAAC,CAAC;AAEjG,+FAA+F;AAC/F,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAA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C,CAAC"}
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type ShotChange } from "./edit-operations.js";
|
|
3
|
+
import type { PlannedRunShots } from "./edit-shots.js";
|
|
4
|
+
/** Where a shot's media comes from: the source run, a kept candidate, an upload, or a generation to pay for. */
|
|
5
|
+
export declare const editAsset: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
6
|
+
from: z.ZodLiteral<"source">;
|
|
7
|
+
shot_id: z.ZodString;
|
|
8
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
9
|
+
from: z.ZodLiteral<"candidate">;
|
|
10
|
+
run_id: z.ZodString;
|
|
11
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
12
|
+
from: z.ZodLiteral<"upload">;
|
|
13
|
+
upload_id: z.ZodString;
|
|
14
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
15
|
+
from: z.ZodLiteral<"generate">;
|
|
16
|
+
operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
17
|
+
mode: z.ZodLiteral<"retake">;
|
|
18
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
19
|
+
mode: z.ZodLiteral<"new_picture">;
|
|
20
|
+
description: z.ZodString;
|
|
21
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
22
|
+
mode: z.ZodLiteral<"edit_picture">;
|
|
23
|
+
instruction: z.ZodString;
|
|
24
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
25
|
+
mode: z.ZodLiteral<"animate">;
|
|
26
|
+
motion: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$strict>], "mode">;
|
|
28
|
+
}, z.core.$strict>], "from">;
|
|
29
|
+
export type EditAsset = z.infer<typeof editAsset>;
|
|
30
|
+
export declare const editShot: z.ZodObject<{
|
|
31
|
+
id: z.ZodString;
|
|
32
|
+
track: z.ZodEnum<{
|
|
33
|
+
presenter: "presenter";
|
|
34
|
+
visual: "visual";
|
|
35
|
+
}>;
|
|
36
|
+
kind: z.ZodEnum<{
|
|
37
|
+
clip: "clip";
|
|
38
|
+
picture: "picture";
|
|
39
|
+
presenter: "presenter";
|
|
40
|
+
}>;
|
|
41
|
+
start_frame: z.ZodNumber;
|
|
42
|
+
end_frame: z.ZodNumber;
|
|
43
|
+
media_offset_frames: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
asset: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
45
|
+
from: z.ZodLiteral<"source">;
|
|
46
|
+
shot_id: z.ZodString;
|
|
47
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
48
|
+
from: z.ZodLiteral<"candidate">;
|
|
49
|
+
run_id: z.ZodString;
|
|
50
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
51
|
+
from: z.ZodLiteral<"upload">;
|
|
52
|
+
upload_id: z.ZodString;
|
|
53
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
54
|
+
from: z.ZodLiteral<"generate">;
|
|
55
|
+
operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
56
|
+
mode: z.ZodLiteral<"retake">;
|
|
57
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
58
|
+
mode: z.ZodLiteral<"new_picture">;
|
|
59
|
+
description: z.ZodString;
|
|
60
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
61
|
+
mode: z.ZodLiteral<"edit_picture">;
|
|
62
|
+
instruction: z.ZodString;
|
|
63
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
64
|
+
mode: z.ZodLiteral<"animate">;
|
|
65
|
+
motion: z.ZodOptional<z.ZodString>;
|
|
66
|
+
}, z.core.$strict>], "mode">;
|
|
67
|
+
}, z.core.$strict>], "from">;
|
|
68
|
+
}, z.core.$strict>;
|
|
69
|
+
export type EditShot = z.infer<typeof editShot>;
|
|
70
|
+
/** The whole timeline a revision asks for, written against one source run. */
|
|
71
|
+
export declare const editDocument: z.ZodObject<{
|
|
72
|
+
v: z.ZodLiteral<1>;
|
|
73
|
+
source_run_id: z.ZodString;
|
|
74
|
+
timebase: z.ZodObject<{
|
|
75
|
+
fps: z.ZodNumber;
|
|
76
|
+
}, z.core.$strict>;
|
|
77
|
+
duration_frames: z.ZodNumber;
|
|
78
|
+
shots: z.ZodArray<z.ZodObject<{
|
|
79
|
+
id: z.ZodString;
|
|
80
|
+
track: z.ZodEnum<{
|
|
81
|
+
presenter: "presenter";
|
|
82
|
+
visual: "visual";
|
|
83
|
+
}>;
|
|
84
|
+
kind: z.ZodEnum<{
|
|
85
|
+
clip: "clip";
|
|
86
|
+
picture: "picture";
|
|
87
|
+
presenter: "presenter";
|
|
88
|
+
}>;
|
|
89
|
+
start_frame: z.ZodNumber;
|
|
90
|
+
end_frame: z.ZodNumber;
|
|
91
|
+
media_offset_frames: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
asset: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
93
|
+
from: z.ZodLiteral<"source">;
|
|
94
|
+
shot_id: z.ZodString;
|
|
95
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
96
|
+
from: z.ZodLiteral<"candidate">;
|
|
97
|
+
run_id: z.ZodString;
|
|
98
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
99
|
+
from: z.ZodLiteral<"upload">;
|
|
100
|
+
upload_id: z.ZodString;
|
|
101
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
102
|
+
from: z.ZodLiteral<"generate">;
|
|
103
|
+
operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
104
|
+
mode: z.ZodLiteral<"retake">;
|
|
105
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
106
|
+
mode: z.ZodLiteral<"new_picture">;
|
|
107
|
+
description: z.ZodString;
|
|
108
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
109
|
+
mode: z.ZodLiteral<"edit_picture">;
|
|
110
|
+
instruction: z.ZodString;
|
|
111
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
112
|
+
mode: z.ZodLiteral<"animate">;
|
|
113
|
+
motion: z.ZodOptional<z.ZodString>;
|
|
114
|
+
}, z.core.$strict>], "mode">;
|
|
115
|
+
}, z.core.$strict>], "from">;
|
|
116
|
+
}, z.core.$strict>>;
|
|
117
|
+
discarded: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
118
|
+
}, z.core.$strict>;
|
|
119
|
+
export type EditDocument = z.infer<typeof editDocument>;
|
|
120
|
+
/** The most a stored draft's document weighs, in bytes of its JSON; the table's check states the same number. */
|
|
121
|
+
export declare const EDIT_DOCUMENT_MAX_BYTES = 256000;
|
|
122
|
+
/** The JSON a document is stored as and its length in bytes: the one place either is computed. */
|
|
123
|
+
export declare function serializeEditDocument(document: EditDocument): {
|
|
124
|
+
json: string;
|
|
125
|
+
bytes: number;
|
|
126
|
+
};
|
|
127
|
+
/** A save of the draft: the whole document and the version it was written against, 0 when no draft was read. */
|
|
128
|
+
export declare const saveRunEdit: z.ZodObject<{
|
|
129
|
+
base_version: z.ZodNumber;
|
|
130
|
+
document: z.ZodObject<{
|
|
131
|
+
v: z.ZodLiteral<1>;
|
|
132
|
+
source_run_id: z.ZodString;
|
|
133
|
+
timebase: z.ZodObject<{
|
|
134
|
+
fps: z.ZodNumber;
|
|
135
|
+
}, z.core.$strict>;
|
|
136
|
+
duration_frames: z.ZodNumber;
|
|
137
|
+
shots: z.ZodArray<z.ZodObject<{
|
|
138
|
+
id: z.ZodString;
|
|
139
|
+
track: z.ZodEnum<{
|
|
140
|
+
presenter: "presenter";
|
|
141
|
+
visual: "visual";
|
|
142
|
+
}>;
|
|
143
|
+
kind: z.ZodEnum<{
|
|
144
|
+
clip: "clip";
|
|
145
|
+
picture: "picture";
|
|
146
|
+
presenter: "presenter";
|
|
147
|
+
}>;
|
|
148
|
+
start_frame: z.ZodNumber;
|
|
149
|
+
end_frame: z.ZodNumber;
|
|
150
|
+
media_offset_frames: z.ZodOptional<z.ZodNumber>;
|
|
151
|
+
asset: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
152
|
+
from: z.ZodLiteral<"source">;
|
|
153
|
+
shot_id: z.ZodString;
|
|
154
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
155
|
+
from: z.ZodLiteral<"candidate">;
|
|
156
|
+
run_id: z.ZodString;
|
|
157
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
158
|
+
from: z.ZodLiteral<"upload">;
|
|
159
|
+
upload_id: z.ZodString;
|
|
160
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
161
|
+
from: z.ZodLiteral<"generate">;
|
|
162
|
+
operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
163
|
+
mode: z.ZodLiteral<"retake">;
|
|
164
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
165
|
+
mode: z.ZodLiteral<"new_picture">;
|
|
166
|
+
description: z.ZodString;
|
|
167
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
168
|
+
mode: z.ZodLiteral<"edit_picture">;
|
|
169
|
+
instruction: z.ZodString;
|
|
170
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
171
|
+
mode: z.ZodLiteral<"animate">;
|
|
172
|
+
motion: z.ZodOptional<z.ZodString>;
|
|
173
|
+
}, z.core.$strict>], "mode">;
|
|
174
|
+
}, z.core.$strict>], "from">;
|
|
175
|
+
}, z.core.$strict>>;
|
|
176
|
+
discarded: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
177
|
+
}, z.core.$strict>;
|
|
178
|
+
}, z.core.$strict>;
|
|
179
|
+
export type SaveRunEdit = z.infer<typeof saveRunEdit>;
|
|
180
|
+
/** The draft of a run's edit. Version 0 is a run with nothing stored: its document changes nothing. */
|
|
181
|
+
export declare const runEdit: z.ZodObject<{
|
|
182
|
+
run_id: z.ZodString;
|
|
183
|
+
version: z.ZodNumber;
|
|
184
|
+
document: z.ZodObject<{
|
|
185
|
+
v: z.ZodLiteral<1>;
|
|
186
|
+
source_run_id: z.ZodString;
|
|
187
|
+
timebase: z.ZodObject<{
|
|
188
|
+
fps: z.ZodNumber;
|
|
189
|
+
}, z.core.$strict>;
|
|
190
|
+
duration_frames: z.ZodNumber;
|
|
191
|
+
shots: z.ZodArray<z.ZodObject<{
|
|
192
|
+
id: z.ZodString;
|
|
193
|
+
track: z.ZodEnum<{
|
|
194
|
+
presenter: "presenter";
|
|
195
|
+
visual: "visual";
|
|
196
|
+
}>;
|
|
197
|
+
kind: z.ZodEnum<{
|
|
198
|
+
clip: "clip";
|
|
199
|
+
picture: "picture";
|
|
200
|
+
presenter: "presenter";
|
|
201
|
+
}>;
|
|
202
|
+
start_frame: z.ZodNumber;
|
|
203
|
+
end_frame: z.ZodNumber;
|
|
204
|
+
media_offset_frames: z.ZodOptional<z.ZodNumber>;
|
|
205
|
+
asset: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
206
|
+
from: z.ZodLiteral<"source">;
|
|
207
|
+
shot_id: z.ZodString;
|
|
208
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
209
|
+
from: z.ZodLiteral<"candidate">;
|
|
210
|
+
run_id: z.ZodString;
|
|
211
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
212
|
+
from: z.ZodLiteral<"upload">;
|
|
213
|
+
upload_id: z.ZodString;
|
|
214
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
215
|
+
from: z.ZodLiteral<"generate">;
|
|
216
|
+
operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
217
|
+
mode: z.ZodLiteral<"retake">;
|
|
218
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
219
|
+
mode: z.ZodLiteral<"new_picture">;
|
|
220
|
+
description: z.ZodString;
|
|
221
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
222
|
+
mode: z.ZodLiteral<"edit_picture">;
|
|
223
|
+
instruction: z.ZodString;
|
|
224
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
225
|
+
mode: z.ZodLiteral<"animate">;
|
|
226
|
+
motion: z.ZodOptional<z.ZodString>;
|
|
227
|
+
}, z.core.$strict>], "mode">;
|
|
228
|
+
}, z.core.$strict>], "from">;
|
|
229
|
+
}, z.core.$strict>>;
|
|
230
|
+
discarded: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
231
|
+
}, z.core.$strict>;
|
|
232
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
233
|
+
code: z.ZodEnum<{
|
|
234
|
+
action_not_allowed: "action_not_allowed";
|
|
235
|
+
candidate_for_other_shot: "candidate_for_other_shot";
|
|
236
|
+
duplicate_picture_asset: "duplicate_picture_asset";
|
|
237
|
+
duplicate_shot_id: "duplicate_shot_id";
|
|
238
|
+
duration_mismatch: "duration_mismatch";
|
|
239
|
+
first_shot_fixed: "first_shot_fixed";
|
|
240
|
+
footage_exceeded: "footage_exceeded";
|
|
241
|
+
foreign_source_asset: "foreign_source_asset";
|
|
242
|
+
kind_asset_mismatch: "kind_asset_mismatch";
|
|
243
|
+
kind_changed: "kind_changed";
|
|
244
|
+
not_movable: "not_movable";
|
|
245
|
+
not_resizable: "not_resizable";
|
|
246
|
+
overlap: "overlap";
|
|
247
|
+
presenter_out_of_sync: "presenter_out_of_sync";
|
|
248
|
+
presenter_outside_recording: "presenter_outside_recording";
|
|
249
|
+
shot_added_not_allowed: "shot_added_not_allowed";
|
|
250
|
+
source_mismatch: "source_mismatch";
|
|
251
|
+
span_out_of_range: "span_out_of_range";
|
|
252
|
+
timebase_mismatch: "timebase_mismatch";
|
|
253
|
+
too_long: "too_long";
|
|
254
|
+
too_many_generated: "too_many_generated";
|
|
255
|
+
too_short: "too_short";
|
|
256
|
+
tracks_overlap: "tracks_overlap";
|
|
257
|
+
uncovered: "uncovered";
|
|
258
|
+
unknown_asset: "unknown_asset";
|
|
259
|
+
upload_shape_refused: "upload_shape_refused";
|
|
260
|
+
}>;
|
|
261
|
+
shot_id: z.ZodOptional<z.ZodString>;
|
|
262
|
+
from_frame: z.ZodOptional<z.ZodNumber>;
|
|
263
|
+
to_frame: z.ZodOptional<z.ZodNumber>;
|
|
264
|
+
message: z.ZodString;
|
|
265
|
+
}, z.core.$strip>>;
|
|
266
|
+
updated_at: z.ZodNullable<z.ZodString>;
|
|
267
|
+
}, z.core.$strip>;
|
|
268
|
+
export type RunEdit = z.infer<typeof runEdit>;
|
|
269
|
+
/** The document as a client reads it: kind, track, asset source and operation are open, and no limit of a save applies. */
|
|
270
|
+
export declare const editDocumentRead: z.ZodObject<{
|
|
271
|
+
v: z.ZodLiteral<1>;
|
|
272
|
+
source_run_id: z.ZodString;
|
|
273
|
+
timebase: z.ZodObject<{
|
|
274
|
+
fps: z.ZodNumber;
|
|
275
|
+
}, z.core.$loose>;
|
|
276
|
+
duration_frames: z.ZodNumber;
|
|
277
|
+
shots: z.ZodArray<z.ZodObject<{
|
|
278
|
+
id: z.ZodString;
|
|
279
|
+
track: z.ZodString;
|
|
280
|
+
kind: z.ZodString;
|
|
281
|
+
start_frame: z.ZodNumber;
|
|
282
|
+
end_frame: z.ZodNumber;
|
|
283
|
+
media_offset_frames: z.ZodOptional<z.ZodNumber>;
|
|
284
|
+
asset: z.ZodObject<{
|
|
285
|
+
from: z.ZodString;
|
|
286
|
+
}, z.core.$loose>;
|
|
287
|
+
}, z.core.$loose>>;
|
|
288
|
+
discarded: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
289
|
+
}, z.core.$loose>;
|
|
290
|
+
export type EditDocumentRead = z.infer<typeof editDocumentRead>;
|
|
291
|
+
/** The draft as a client reads it: the code of an issue is an open string. */
|
|
292
|
+
export declare const runEditRead: z.ZodObject<{
|
|
293
|
+
run_id: z.ZodString;
|
|
294
|
+
version: z.ZodNumber;
|
|
295
|
+
updated_at: z.ZodNullable<z.ZodString>;
|
|
296
|
+
document: z.ZodObject<{
|
|
297
|
+
v: z.ZodLiteral<1>;
|
|
298
|
+
source_run_id: z.ZodString;
|
|
299
|
+
timebase: z.ZodObject<{
|
|
300
|
+
fps: z.ZodNumber;
|
|
301
|
+
}, z.core.$loose>;
|
|
302
|
+
duration_frames: z.ZodNumber;
|
|
303
|
+
shots: z.ZodArray<z.ZodObject<{
|
|
304
|
+
id: z.ZodString;
|
|
305
|
+
track: z.ZodString;
|
|
306
|
+
kind: z.ZodString;
|
|
307
|
+
start_frame: z.ZodNumber;
|
|
308
|
+
end_frame: z.ZodNumber;
|
|
309
|
+
media_offset_frames: z.ZodOptional<z.ZodNumber>;
|
|
310
|
+
asset: z.ZodObject<{
|
|
311
|
+
from: z.ZodString;
|
|
312
|
+
}, z.core.$loose>;
|
|
313
|
+
}, z.core.$loose>>;
|
|
314
|
+
discarded: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
315
|
+
}, z.core.$loose>;
|
|
316
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
317
|
+
shot_id: z.ZodOptional<z.ZodString>;
|
|
318
|
+
from_frame: z.ZodOptional<z.ZodNumber>;
|
|
319
|
+
to_frame: z.ZodOptional<z.ZodNumber>;
|
|
320
|
+
message: z.ZodString;
|
|
321
|
+
code: z.ZodString;
|
|
322
|
+
}, z.core.$strip>>;
|
|
323
|
+
}, z.core.$strip>;
|
|
324
|
+
export type RunEditRead = z.infer<typeof runEditRead>;
|
|
325
|
+
/** What a client passes to a save: the version it read and the document, as read or as written. */
|
|
326
|
+
export type SaveRunEditArgs = {
|
|
327
|
+
base_version: number;
|
|
328
|
+
document: z.input<typeof editDocumentRead>;
|
|
329
|
+
};
|
|
330
|
+
/** The path of a run's draft. The id is encoded, since it comes from the caller. */
|
|
331
|
+
export declare const runEditPath: (id: string) => string;
|
|
332
|
+
/** The document that changes nothing: every shot of the view on its own source asset. */
|
|
333
|
+
export declare function identityEditDocument(shots: PlannedRunShots): EditDocument;
|
|
334
|
+
/** Replaces only the asset of each named shot with a generation; spans and every other shot stay. */
|
|
335
|
+
export declare function applyShotChanges(document: EditDocument, changes: ShotChange[]): EditDocument;
|