@contractspec/example.video-api-showcase 2.1.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.
@@ -0,0 +1,35 @@
1
+ $ contractspec-bun-build prebuild
2
+ $ bun run prebuild && bun run build:bundle && bun run build:types
3
+ $ contractspec-bun-build prebuild
4
+ $ contractspec-bun-build transpile
5
+ [contractspec-bun-build] transpile target=bun root=src entries=6
6
+ Bundled 6 modules in 17ms
7
+
8
+ ./build-api-video.js 1.31 KB (entry point)
9
+ ./index.js 7.41 KB (entry point)
10
+ docs/index.js 2.94 KB (entry point)
11
+ docs/video-api-showcase.docblock.js 2.94 KB (entry point)
12
+ ./example.js 0.98 KB (entry point)
13
+ ./sample-specs.js 2.22 KB (entry point)
14
+
15
+ [contractspec-bun-build] transpile target=node root=src entries=6
16
+ Bundled 6 modules in 29ms
17
+
18
+ ./build-api-video.js 1.31 KB (entry point)
19
+ ./index.js 7.40 KB (entry point)
20
+ docs/index.js 2.93 KB (entry point)
21
+ docs/video-api-showcase.docblock.js 2.93 KB (entry point)
22
+ ./example.js 0.97 KB (entry point)
23
+ ./sample-specs.js 2.21 KB (entry point)
24
+
25
+ [contractspec-bun-build] transpile target=browser root=src entries=6
26
+ Bundled 6 modules in 22ms
27
+
28
+ ./build-api-video.js 1.31 KB (entry point)
29
+ ./index.js 7.40 KB (entry point)
30
+ docs/index.js 2.93 KB (entry point)
31
+ docs/video-api-showcase.docblock.js 2.93 KB (entry point)
32
+ ./example.js 0.97 KB (entry point)
33
+ ./sample-specs.js 2.21 KB (entry point)
34
+
35
+ $ contractspec-bun-build types
@@ -0,0 +1 @@
1
+ $ contractspec-bun-build prebuild
package/CHANGELOG.md ADDED
@@ -0,0 +1,14 @@
1
+ # @contractspec/example.video-api-showcase
2
+
3
+ ## 2.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ac88935: chore: add examples
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [57e2819]
12
+ - @contractspec/lib.contracts-spec@2.1.1
13
+ - @contractspec/lib.contracts-integrations@2.1.1
14
+ - @contractspec/lib.video-gen@1.42.1
@@ -0,0 +1,41 @@
1
+ // src/build-api-video.ts
2
+ import { VIDEO_FORMATS } from "@contractspec/lib.video-gen/design/layouts";
3
+ import { resolveRenderConfig } from "@contractspec/lib.video-gen/renderers/config";
4
+ var DEFAULT_FPS = 30;
5
+ var DEFAULT_DURATION_FRAMES = 450;
6
+ function buildApiVideo(spec, options) {
7
+ const fps = options?.fps ?? DEFAULT_FPS;
8
+ const durationInFrames = options?.durationInFrames ?? DEFAULT_DURATION_FRAMES;
9
+ return {
10
+ id: `api-video-${spec.specName.toLowerCase()}-${Date.now().toString(36)}`,
11
+ scenes: [
12
+ {
13
+ id: "scene-api-overview",
14
+ compositionId: "ApiOverview",
15
+ props: {
16
+ specName: spec.specName,
17
+ method: spec.method,
18
+ endpoint: spec.endpoint,
19
+ specCode: spec.specCode,
20
+ generatedOutputs: spec.generatedOutputs,
21
+ tagline: options?.tagline ?? "One spec. Every surface."
22
+ },
23
+ durationInFrames
24
+ }
25
+ ],
26
+ totalDurationInFrames: durationInFrames,
27
+ fps,
28
+ format: VIDEO_FORMATS.landscape
29
+ };
30
+ }
31
+ function buildRenderConfig(outputPath, preset = "standard") {
32
+ return resolveRenderConfig({ outputPath }, preset);
33
+ }
34
+ function buildApiVideoSuite(specs, options) {
35
+ return specs.map((spec) => buildApiVideo(spec, options));
36
+ }
37
+ export {
38
+ buildRenderConfig,
39
+ buildApiVideoSuite,
40
+ buildApiVideo
41
+ };
@@ -0,0 +1,66 @@
1
+ // src/docs/video-api-showcase.docblock.ts
2
+ import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
3
+ var blocks = [
4
+ {
5
+ id: "docs.examples.video-api-showcase",
6
+ title: "Video API Showcase (example)",
7
+ summary: "Spec-driven example: build API overview videos directly from contract spec metadata using manual VideoProject construction.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/examples/video-api-showcase",
11
+ tags: ["video", "api", "spec-driven", "example"],
12
+ body: `## What this example shows
13
+
14
+ - Manually constructing a \`VideoProject\` from contract spec metadata (name, method, endpoint, code, outputs).
15
+ - Using the \`ApiOverview\` composition to visualize how a spec generates multiple API surfaces.
16
+ - Configuring render settings with quality presets (\`draft\`, \`standard\`, \`high\`).
17
+ - Building video scenes with explicit composition IDs and props.
18
+
19
+ ## Key concepts
20
+
21
+ - **Spec-to-Video**: Contract spec metadata (name, method, endpoint, code snippet) becomes the input props for the \`ApiOverview\` composition.
22
+ - **Manual project construction**: Instead of using \`VideoGenerator\`, this example builds the \`VideoProject\` directly -- useful when you know exactly which composition and props to use.
23
+ - **Render configuration**: Shows how to use \`resolveRenderConfig()\` with quality presets for different output needs.
24
+
25
+ ## Notes
26
+
27
+ - This approach is ideal when the video structure is known ahead of time (e.g., always an API overview).
28
+ - For dynamic scene planning from content briefs, use \`VideoGenerator\` instead (see the video-marketing-clip example).
29
+ `
30
+ },
31
+ {
32
+ id: "docs.examples.video-api-showcase.usage",
33
+ title: "Video API Showcase -- Usage",
34
+ summary: "How to generate API overview videos from contract spec definitions.",
35
+ kind: "usage",
36
+ visibility: "public",
37
+ route: "/docs/examples/video-api-showcase/usage",
38
+ tags: ["video", "api", "usage"],
39
+ body: `## Usage
40
+
41
+ \`\`\`ts
42
+ import { buildApiVideo } from "@contractspec/example.video-api-showcase/build-api-video";
43
+ import { createUserSpec, listTransactionsSpec } from "@contractspec/example.video-api-showcase/sample-specs";
44
+
45
+ // Build a video project for a single API spec
46
+ const project = buildApiVideo(createUserSpec);
47
+
48
+ console.log(project.scenes[0].compositionId); // "ApiOverview"
49
+ console.log(project.format); // { type: "landscape", width: 1920, height: 1080 }
50
+
51
+ // Build with custom duration and tagline
52
+ const custom = buildApiVideo(listTransactionsSpec, {
53
+ durationInFrames: 600,
54
+ tagline: "From spec to production in seconds.",
55
+ });
56
+ \`\`\`
57
+
58
+ ## Guardrails
59
+
60
+ - The \`specCode\` field should be a concise snippet (10-20 lines) for readability in the video.
61
+ - Generated outputs list should contain 3-8 items for optimal visual layout.
62
+ - Tagline should be short (under 40 characters) to fit within the composition frame.
63
+ `
64
+ }
65
+ ];
66
+ registerDocBlocks(blocks);
@@ -0,0 +1,66 @@
1
+ // src/docs/video-api-showcase.docblock.ts
2
+ import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
3
+ var blocks = [
4
+ {
5
+ id: "docs.examples.video-api-showcase",
6
+ title: "Video API Showcase (example)",
7
+ summary: "Spec-driven example: build API overview videos directly from contract spec metadata using manual VideoProject construction.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/examples/video-api-showcase",
11
+ tags: ["video", "api", "spec-driven", "example"],
12
+ body: `## What this example shows
13
+
14
+ - Manually constructing a \`VideoProject\` from contract spec metadata (name, method, endpoint, code, outputs).
15
+ - Using the \`ApiOverview\` composition to visualize how a spec generates multiple API surfaces.
16
+ - Configuring render settings with quality presets (\`draft\`, \`standard\`, \`high\`).
17
+ - Building video scenes with explicit composition IDs and props.
18
+
19
+ ## Key concepts
20
+
21
+ - **Spec-to-Video**: Contract spec metadata (name, method, endpoint, code snippet) becomes the input props for the \`ApiOverview\` composition.
22
+ - **Manual project construction**: Instead of using \`VideoGenerator\`, this example builds the \`VideoProject\` directly -- useful when you know exactly which composition and props to use.
23
+ - **Render configuration**: Shows how to use \`resolveRenderConfig()\` with quality presets for different output needs.
24
+
25
+ ## Notes
26
+
27
+ - This approach is ideal when the video structure is known ahead of time (e.g., always an API overview).
28
+ - For dynamic scene planning from content briefs, use \`VideoGenerator\` instead (see the video-marketing-clip example).
29
+ `
30
+ },
31
+ {
32
+ id: "docs.examples.video-api-showcase.usage",
33
+ title: "Video API Showcase -- Usage",
34
+ summary: "How to generate API overview videos from contract spec definitions.",
35
+ kind: "usage",
36
+ visibility: "public",
37
+ route: "/docs/examples/video-api-showcase/usage",
38
+ tags: ["video", "api", "usage"],
39
+ body: `## Usage
40
+
41
+ \`\`\`ts
42
+ import { buildApiVideo } from "@contractspec/example.video-api-showcase/build-api-video";
43
+ import { createUserSpec, listTransactionsSpec } from "@contractspec/example.video-api-showcase/sample-specs";
44
+
45
+ // Build a video project for a single API spec
46
+ const project = buildApiVideo(createUserSpec);
47
+
48
+ console.log(project.scenes[0].compositionId); // "ApiOverview"
49
+ console.log(project.format); // { type: "landscape", width: 1920, height: 1080 }
50
+
51
+ // Build with custom duration and tagline
52
+ const custom = buildApiVideo(listTransactionsSpec, {
53
+ durationInFrames: 600,
54
+ tagline: "From spec to production in seconds.",
55
+ });
56
+ \`\`\`
57
+
58
+ ## Guardrails
59
+
60
+ - The \`specCode\` field should be a concise snippet (10-20 lines) for readability in the video.
61
+ - Generated outputs list should contain 3-8 items for optimal visual layout.
62
+ - Tagline should be short (under 40 characters) to fit within the composition frame.
63
+ `
64
+ }
65
+ ];
66
+ registerDocBlocks(blocks);
@@ -0,0 +1,33 @@
1
+ // src/example.ts
2
+ import { defineExample } from "@contractspec/lib.contracts-spec";
3
+ var example = defineExample({
4
+ meta: {
5
+ key: "video-api-showcase",
6
+ version: "1.0.0",
7
+ title: "Video API Showcase",
8
+ description: "Generate API documentation videos from contract spec definitions using the ApiOverview composition.",
9
+ kind: "script",
10
+ visibility: "public",
11
+ stability: "experimental",
12
+ owners: ["@platform.core"],
13
+ tags: ["video", "api", "documentation", "spec-driven"]
14
+ },
15
+ docs: {
16
+ rootDocId: "docs.examples.video-api-showcase",
17
+ usageDocId: "docs.examples.video-api-showcase.usage"
18
+ },
19
+ entrypoints: {
20
+ packageName: "@contractspec/example.video-api-showcase",
21
+ docs: "./docs"
22
+ },
23
+ surfaces: {
24
+ templates: true,
25
+ sandbox: { enabled: true, modes: ["markdown"] },
26
+ studio: { enabled: true, installable: true },
27
+ mcp: { enabled: true }
28
+ }
29
+ });
30
+ var example_default = example;
31
+ export {
32
+ example_default as default
33
+ };
@@ -0,0 +1,241 @@
1
+ // src/build-api-video.ts
2
+ import { VIDEO_FORMATS } from "@contractspec/lib.video-gen/design/layouts";
3
+ import { resolveRenderConfig } from "@contractspec/lib.video-gen/renderers/config";
4
+ var DEFAULT_FPS = 30;
5
+ var DEFAULT_DURATION_FRAMES = 450;
6
+ function buildApiVideo(spec, options) {
7
+ const fps = options?.fps ?? DEFAULT_FPS;
8
+ const durationInFrames = options?.durationInFrames ?? DEFAULT_DURATION_FRAMES;
9
+ return {
10
+ id: `api-video-${spec.specName.toLowerCase()}-${Date.now().toString(36)}`,
11
+ scenes: [
12
+ {
13
+ id: "scene-api-overview",
14
+ compositionId: "ApiOverview",
15
+ props: {
16
+ specName: spec.specName,
17
+ method: spec.method,
18
+ endpoint: spec.endpoint,
19
+ specCode: spec.specCode,
20
+ generatedOutputs: spec.generatedOutputs,
21
+ tagline: options?.tagline ?? "One spec. Every surface."
22
+ },
23
+ durationInFrames
24
+ }
25
+ ],
26
+ totalDurationInFrames: durationInFrames,
27
+ fps,
28
+ format: VIDEO_FORMATS.landscape
29
+ };
30
+ }
31
+ function buildRenderConfig(outputPath, preset = "standard") {
32
+ return resolveRenderConfig({ outputPath }, preset);
33
+ }
34
+ function buildApiVideoSuite(specs, options) {
35
+ return specs.map((spec) => buildApiVideo(spec, options));
36
+ }
37
+
38
+ // src/docs/video-api-showcase.docblock.ts
39
+ import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
40
+ var blocks = [
41
+ {
42
+ id: "docs.examples.video-api-showcase",
43
+ title: "Video API Showcase (example)",
44
+ summary: "Spec-driven example: build API overview videos directly from contract spec metadata using manual VideoProject construction.",
45
+ kind: "reference",
46
+ visibility: "public",
47
+ route: "/docs/examples/video-api-showcase",
48
+ tags: ["video", "api", "spec-driven", "example"],
49
+ body: `## What this example shows
50
+
51
+ - Manually constructing a \`VideoProject\` from contract spec metadata (name, method, endpoint, code, outputs).
52
+ - Using the \`ApiOverview\` composition to visualize how a spec generates multiple API surfaces.
53
+ - Configuring render settings with quality presets (\`draft\`, \`standard\`, \`high\`).
54
+ - Building video scenes with explicit composition IDs and props.
55
+
56
+ ## Key concepts
57
+
58
+ - **Spec-to-Video**: Contract spec metadata (name, method, endpoint, code snippet) becomes the input props for the \`ApiOverview\` composition.
59
+ - **Manual project construction**: Instead of using \`VideoGenerator\`, this example builds the \`VideoProject\` directly -- useful when you know exactly which composition and props to use.
60
+ - **Render configuration**: Shows how to use \`resolveRenderConfig()\` with quality presets for different output needs.
61
+
62
+ ## Notes
63
+
64
+ - This approach is ideal when the video structure is known ahead of time (e.g., always an API overview).
65
+ - For dynamic scene planning from content briefs, use \`VideoGenerator\` instead (see the video-marketing-clip example).
66
+ `
67
+ },
68
+ {
69
+ id: "docs.examples.video-api-showcase.usage",
70
+ title: "Video API Showcase -- Usage",
71
+ summary: "How to generate API overview videos from contract spec definitions.",
72
+ kind: "usage",
73
+ visibility: "public",
74
+ route: "/docs/examples/video-api-showcase/usage",
75
+ tags: ["video", "api", "usage"],
76
+ body: `## Usage
77
+
78
+ \`\`\`ts
79
+ import { buildApiVideo } from "@contractspec/example.video-api-showcase/build-api-video";
80
+ import { createUserSpec, listTransactionsSpec } from "@contractspec/example.video-api-showcase/sample-specs";
81
+
82
+ // Build a video project for a single API spec
83
+ const project = buildApiVideo(createUserSpec);
84
+
85
+ console.log(project.scenes[0].compositionId); // "ApiOverview"
86
+ console.log(project.format); // { type: "landscape", width: 1920, height: 1080 }
87
+
88
+ // Build with custom duration and tagline
89
+ const custom = buildApiVideo(listTransactionsSpec, {
90
+ durationInFrames: 600,
91
+ tagline: "From spec to production in seconds.",
92
+ });
93
+ \`\`\`
94
+
95
+ ## Guardrails
96
+
97
+ - The \`specCode\` field should be a concise snippet (10-20 lines) for readability in the video.
98
+ - Generated outputs list should contain 3-8 items for optimal visual layout.
99
+ - Tagline should be short (under 40 characters) to fit within the composition frame.
100
+ `
101
+ }
102
+ ];
103
+ registerDocBlocks(blocks);
104
+ // src/example.ts
105
+ import { defineExample } from "@contractspec/lib.contracts-spec";
106
+ var example = defineExample({
107
+ meta: {
108
+ key: "video-api-showcase",
109
+ version: "1.0.0",
110
+ title: "Video API Showcase",
111
+ description: "Generate API documentation videos from contract spec definitions using the ApiOverview composition.",
112
+ kind: "script",
113
+ visibility: "public",
114
+ stability: "experimental",
115
+ owners: ["@platform.core"],
116
+ tags: ["video", "api", "documentation", "spec-driven"]
117
+ },
118
+ docs: {
119
+ rootDocId: "docs.examples.video-api-showcase",
120
+ usageDocId: "docs.examples.video-api-showcase.usage"
121
+ },
122
+ entrypoints: {
123
+ packageName: "@contractspec/example.video-api-showcase",
124
+ docs: "./docs"
125
+ },
126
+ surfaces: {
127
+ templates: true,
128
+ sandbox: { enabled: true, modes: ["markdown"] },
129
+ studio: { enabled: true, installable: true },
130
+ mcp: { enabled: true }
131
+ }
132
+ });
133
+ var example_default = example;
134
+
135
+ // src/sample-specs.ts
136
+ var createUserSpec = {
137
+ specName: "CreateUser",
138
+ method: "POST",
139
+ endpoint: "/api/users",
140
+ specCode: `export const createUser = defineCommand({
141
+ meta: {
142
+ name: "CreateUser",
143
+ version: "1.0.0",
144
+ stability: "Stable",
145
+ },
146
+ io: {
147
+ input: z.object({
148
+ email: z.string().email(),
149
+ name: z.string(),
150
+ role: z.enum(["admin", "user"]),
151
+ }),
152
+ output: z.object({
153
+ id: z.string().uuid(),
154
+ email: z.string(),
155
+ createdAt: z.date(),
156
+ }),
157
+ },
158
+ });`,
159
+ generatedOutputs: [
160
+ "REST Endpoint",
161
+ "GraphQL Mutation",
162
+ "Prisma Model",
163
+ "TypeScript SDK",
164
+ "MCP Tool",
165
+ "OpenAPI Spec"
166
+ ]
167
+ };
168
+ var listTransactionsSpec = {
169
+ specName: "ListTransactions",
170
+ method: "GET",
171
+ endpoint: "/api/transactions",
172
+ specCode: `export const listTransactions = defineQuery({
173
+ meta: {
174
+ name: "ListTransactions",
175
+ version: "1.0.0",
176
+ stability: "Stable",
177
+ },
178
+ io: {
179
+ input: z.object({
180
+ accountId: z.string().uuid(),
181
+ from: z.date().optional(),
182
+ to: z.date().optional(),
183
+ limit: z.number().default(50),
184
+ }),
185
+ output: z.object({
186
+ transactions: z.array(transactionSchema),
187
+ total: z.number(),
188
+ hasMore: z.boolean(),
189
+ }),
190
+ },
191
+ });`,
192
+ generatedOutputs: [
193
+ "REST Endpoint",
194
+ "GraphQL Query",
195
+ "Prisma Query",
196
+ "TypeScript SDK",
197
+ "OpenAPI Spec"
198
+ ]
199
+ };
200
+ var sendNotificationSpec = {
201
+ specName: "SendNotification",
202
+ method: "POST",
203
+ endpoint: "/api/notifications",
204
+ specCode: `export const sendNotification = defineCommand({
205
+ meta: {
206
+ name: "SendNotification",
207
+ version: "1.0.0",
208
+ stability: "Beta",
209
+ },
210
+ io: {
211
+ input: z.object({
212
+ userId: z.string().uuid(),
213
+ channel: z.enum(["push", "email", "sms"]),
214
+ title: z.string(),
215
+ body: z.string(),
216
+ }),
217
+ output: z.object({
218
+ notificationId: z.string().uuid(),
219
+ deliveredAt: z.date().nullable(),
220
+ status: z.enum(["sent", "failed", "queued"]),
221
+ }),
222
+ },
223
+ });`,
224
+ generatedOutputs: [
225
+ "REST Endpoint",
226
+ "GraphQL Mutation",
227
+ "TypeScript SDK",
228
+ "MCP Tool",
229
+ "OpenAPI Spec",
230
+ "Event Schema"
231
+ ]
232
+ };
233
+ export {
234
+ sendNotificationSpec,
235
+ listTransactionsSpec,
236
+ example_default as example,
237
+ createUserSpec,
238
+ buildRenderConfig,
239
+ buildApiVideoSuite,
240
+ buildApiVideo
241
+ };
@@ -0,0 +1,103 @@
1
+ // src/sample-specs.ts
2
+ var createUserSpec = {
3
+ specName: "CreateUser",
4
+ method: "POST",
5
+ endpoint: "/api/users",
6
+ specCode: `export const createUser = defineCommand({
7
+ meta: {
8
+ name: "CreateUser",
9
+ version: "1.0.0",
10
+ stability: "Stable",
11
+ },
12
+ io: {
13
+ input: z.object({
14
+ email: z.string().email(),
15
+ name: z.string(),
16
+ role: z.enum(["admin", "user"]),
17
+ }),
18
+ output: z.object({
19
+ id: z.string().uuid(),
20
+ email: z.string(),
21
+ createdAt: z.date(),
22
+ }),
23
+ },
24
+ });`,
25
+ generatedOutputs: [
26
+ "REST Endpoint",
27
+ "GraphQL Mutation",
28
+ "Prisma Model",
29
+ "TypeScript SDK",
30
+ "MCP Tool",
31
+ "OpenAPI Spec"
32
+ ]
33
+ };
34
+ var listTransactionsSpec = {
35
+ specName: "ListTransactions",
36
+ method: "GET",
37
+ endpoint: "/api/transactions",
38
+ specCode: `export const listTransactions = defineQuery({
39
+ meta: {
40
+ name: "ListTransactions",
41
+ version: "1.0.0",
42
+ stability: "Stable",
43
+ },
44
+ io: {
45
+ input: z.object({
46
+ accountId: z.string().uuid(),
47
+ from: z.date().optional(),
48
+ to: z.date().optional(),
49
+ limit: z.number().default(50),
50
+ }),
51
+ output: z.object({
52
+ transactions: z.array(transactionSchema),
53
+ total: z.number(),
54
+ hasMore: z.boolean(),
55
+ }),
56
+ },
57
+ });`,
58
+ generatedOutputs: [
59
+ "REST Endpoint",
60
+ "GraphQL Query",
61
+ "Prisma Query",
62
+ "TypeScript SDK",
63
+ "OpenAPI Spec"
64
+ ]
65
+ };
66
+ var sendNotificationSpec = {
67
+ specName: "SendNotification",
68
+ method: "POST",
69
+ endpoint: "/api/notifications",
70
+ specCode: `export const sendNotification = defineCommand({
71
+ meta: {
72
+ name: "SendNotification",
73
+ version: "1.0.0",
74
+ stability: "Beta",
75
+ },
76
+ io: {
77
+ input: z.object({
78
+ userId: z.string().uuid(),
79
+ channel: z.enum(["push", "email", "sms"]),
80
+ title: z.string(),
81
+ body: z.string(),
82
+ }),
83
+ output: z.object({
84
+ notificationId: z.string().uuid(),
85
+ deliveredAt: z.date().nullable(),
86
+ status: z.enum(["sent", "failed", "queued"]),
87
+ }),
88
+ },
89
+ });`,
90
+ generatedOutputs: [
91
+ "REST Endpoint",
92
+ "GraphQL Mutation",
93
+ "TypeScript SDK",
94
+ "MCP Tool",
95
+ "OpenAPI Spec",
96
+ "Event Schema"
97
+ ]
98
+ };
99
+ export {
100
+ sendNotificationSpec,
101
+ listTransactionsSpec,
102
+ createUserSpec
103
+ };
@@ -0,0 +1,53 @@
1
+ import type { VideoProject } from '@contractspec/lib.contracts-integrations/integrations/providers/video';
2
+ import type { QualityPreset } from '@contractspec/lib.video-gen/renderers/config';
3
+ import type { RenderConfig } from '@contractspec/lib.contracts-integrations/integrations/providers/video';
4
+ import type { ApiSpecDefinition } from './sample-specs';
5
+ /** Options for building an API showcase video. */
6
+ export interface BuildApiVideoOptions {
7
+ /** Duration in frames. Default: 450 (15s at 30fps). */
8
+ durationInFrames?: number;
9
+ /** Tagline shown at the end. */
10
+ tagline?: string;
11
+ /** FPS. Default: 30. */
12
+ fps?: number;
13
+ }
14
+ /**
15
+ * Build a VideoProject from a contract spec definition.
16
+ *
17
+ * This demonstrates manual project construction using the ApiOverview
18
+ * composition -- useful when you know the exact video structure.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * import { buildApiVideo } from "@contractspec/example.video-api-showcase/build-api-video";
23
+ * import { createUserSpec } from "@contractspec/example.video-api-showcase/sample-specs";
24
+ *
25
+ * const project = buildApiVideo(createUserSpec);
26
+ * // project.scenes[0].compositionId === "ApiOverview"
27
+ * ```
28
+ */
29
+ export declare function buildApiVideo(spec: ApiSpecDefinition, options?: BuildApiVideoOptions): VideoProject;
30
+ /**
31
+ * Build a render configuration for the API video.
32
+ *
33
+ * Demonstrates using quality presets to configure rendering.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * const config = buildRenderConfig("out/api-overview.mp4", "high");
38
+ * // config.crf === 12, config.codec === "h264"
39
+ * ```
40
+ */
41
+ export declare function buildRenderConfig(outputPath: string, preset?: QualityPreset): RenderConfig;
42
+ /**
43
+ * Build video projects for multiple specs at once.
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * import { createUserSpec, listTransactionsSpec } from "./sample-specs";
48
+ *
49
+ * const projects = buildApiVideoSuite([createUserSpec, listTransactionsSpec]);
50
+ * // projects.length === 2
51
+ * ```
52
+ */
53
+ export declare function buildApiVideoSuite(specs: ApiSpecDefinition[], options?: BuildApiVideoOptions): VideoProject[];