@shotstack/schemas 1.7.0 → 1.8.2

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.
Files changed (53) hide show
  1. package/README.md +89 -89
  2. package/dist/api.bundled.json +49 -833
  3. package/dist/json-schema/asset.json +115 -856
  4. package/dist/json-schema/audio-asset.json +31 -1
  5. package/dist/json-schema/blueprint.json +380 -0
  6. package/dist/json-schema/caption-detailer.json +275 -0
  7. package/dist/json-schema/clip.json +256 -949
  8. package/dist/json-schema/edit.json +247 -940
  9. package/dist/json-schema/index.cjs +5 -0
  10. package/dist/json-schema/index.d.ts +5 -0
  11. package/dist/json-schema/index.js +5 -0
  12. package/dist/json-schema/offset.json +31 -1
  13. package/dist/json-schema/rich-caption-asset.json +221 -140
  14. package/dist/json-schema/rich-text-content.json +370 -0
  15. package/dist/json-schema/rich-text-effects.json +400 -0
  16. package/dist/json-schema/rotate-transformation.json +31 -1
  17. package/dist/json-schema/schemas.json +264 -1044
  18. package/dist/json-schema/skew-transformation.json +31 -1
  19. package/dist/json-schema/svg-asset.json +6 -857
  20. package/dist/json-schema/template.json +541 -0
  21. package/dist/json-schema/text-to-speech-asset.json +31 -1
  22. package/dist/json-schema/timeline.json +256 -949
  23. package/dist/json-schema/track.json +256 -949
  24. package/dist/json-schema/transformation.json +52 -22
  25. package/dist/json-schema/transition.json +50 -2
  26. package/dist/json-schema/tween.json +31 -1
  27. package/dist/json-schema/video-asset.json +56 -26
  28. package/dist/schema.d.ts +43 -660
  29. package/dist/zod/zod.gen.cjs +914 -1640
  30. package/dist/zod/zod.gen.d.ts +306 -8714
  31. package/dist/zod/zod.gen.js +911 -1636
  32. package/dist/zod/zod.gen.ts +1593 -1880
  33. package/package.json +79 -79
  34. package/dist/json-schema/svg-arrow-shape.json +0 -49
  35. package/dist/json-schema/svg-circle-shape.json +0 -28
  36. package/dist/json-schema/svg-cross-shape.json +0 -42
  37. package/dist/json-schema/svg-ellipse-shape.json +0 -35
  38. package/dist/json-schema/svg-fill.json +0 -169
  39. package/dist/json-schema/svg-gradient-stop.json +0 -25
  40. package/dist/json-schema/svg-heart-shape.json +0 -28
  41. package/dist/json-schema/svg-line-shape.json +0 -35
  42. package/dist/json-schema/svg-linear-gradient-fill.json +0 -80
  43. package/dist/json-schema/svg-path-shape.json +0 -26
  44. package/dist/json-schema/svg-polygon-shape.json +0 -35
  45. package/dist/json-schema/svg-radial-gradient-fill.json +0 -66
  46. package/dist/json-schema/svg-rectangle-shape.json +0 -49
  47. package/dist/json-schema/svg-ring-shape.json +0 -35
  48. package/dist/json-schema/svg-shadow.json +0 -79
  49. package/dist/json-schema/svg-shape.json +0 -404
  50. package/dist/json-schema/svg-solid-fill.json +0 -40
  51. package/dist/json-schema/svg-star-shape.json +0 -42
  52. package/dist/json-schema/svg-stroke.json +0 -115
  53. package/dist/json-schema/svg-transform.json +0 -93
package/README.md CHANGED
@@ -1,89 +1,89 @@
1
- # @shotstack/schemas
2
-
3
- Centralized OpenAPI schemas and TypeScript types for the Shotstack API.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install @shotstack/schemas zod
9
- ```
10
-
11
- ## Usage
12
-
13
- ### TypeScript Types
14
-
15
- ```typescript
16
- import type { components } from '@shotstack/schemas';
17
-
18
- type Edit = components['schemas']['Edit'];
19
- type Timeline = components['schemas']['Timeline'];
20
- type Clip = components['schemas']['Clip'];
21
- type Output = components['schemas']['Output'];
22
- ```
23
-
24
- ### Zod Schemas
25
-
26
- ```typescript
27
- import { z } from 'zod';
28
- import { richTextAssetSchema, editSchema, timelineSchema } from '@shotstack/schemas/zod';
29
-
30
- const result = richTextAssetSchema.safeParse(inputData);
31
- if (result.success) {
32
- console.log(result.data);
33
- }
34
- ```
35
-
36
- ### Extending Schemas
37
-
38
- ```typescript
39
- import { z } from 'zod';
40
- import { richTextAssetSchema } from '@shotstack/schemas/zod';
41
-
42
- const ExtendedAsset = richTextAssetSchema.extend({
43
- customFonts: z.array(z.object({
44
- src: z.string().url(),
45
- family: z.string(),
46
- })).optional(),
47
- border: z.object({
48
- width: z.number().min(0),
49
- color: z.string(),
50
- }).optional(),
51
- });
52
-
53
- type ExtendedAssetType = z.infer<typeof ExtendedAsset>;
54
- ```
55
-
56
- ### Custom Validation
57
-
58
- ```typescript
59
- import { richTextAnimationSchema } from '@shotstack/schemas/zod';
60
-
61
- const AnimationWithDirection = richTextAnimationSchema.refine(
62
- (data) => {
63
- if (data.preset === 'slideIn' && !data.direction) {
64
- return false;
65
- }
66
- return true;
67
- },
68
- { message: 'direction is required for slideIn preset' }
69
- );
70
- ```
71
-
72
- ## Available Schemas
73
-
74
- - Edit, Timeline, Track, Clip, Output
75
- - Assets: VideoAsset, ImageAsset, AudioAsset, HtmlAsset, TextAsset, TitleAsset, LumaAsset, CaptionAsset, ShapeAsset, RichTextAsset
76
- - Destinations: ShotstackDestination, S3Destination, MuxDestination, VimeoDestination, GoogleDriveDestination, GoogleCloudStorageDestination
77
- - Transforms, Transitions, Fonts, MergeFields, and more
78
-
79
- ## Development
80
-
81
- ```bash
82
- pnpm install
83
- pnpm run build
84
- pnpm run test
85
- ```
86
-
87
- ## License
88
-
89
- MIT
1
+ # @shotstack/schemas
2
+
3
+ Centralized OpenAPI schemas and TypeScript types for the Shotstack API.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @shotstack/schemas zod
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ### TypeScript Types
14
+
15
+ ```typescript
16
+ import type { components } from '@shotstack/schemas';
17
+
18
+ type Edit = components['schemas']['Edit'];
19
+ type Timeline = components['schemas']['Timeline'];
20
+ type Clip = components['schemas']['Clip'];
21
+ type Output = components['schemas']['Output'];
22
+ ```
23
+
24
+ ### Zod Schemas
25
+
26
+ ```typescript
27
+ import { z } from 'zod';
28
+ import { richTextAssetSchema, editSchema, timelineSchema } from '@shotstack/schemas/zod';
29
+
30
+ const result = richTextAssetSchema.safeParse(inputData);
31
+ if (result.success) {
32
+ console.log(result.data);
33
+ }
34
+ ```
35
+
36
+ ### Extending Schemas
37
+
38
+ ```typescript
39
+ import { z } from 'zod';
40
+ import { richTextAssetSchema } from '@shotstack/schemas/zod';
41
+
42
+ const ExtendedAsset = richTextAssetSchema.extend({
43
+ customFonts: z.array(z.object({
44
+ src: z.string().url(),
45
+ family: z.string(),
46
+ })).optional(),
47
+ border: z.object({
48
+ width: z.number().min(0),
49
+ color: z.string(),
50
+ }).optional(),
51
+ });
52
+
53
+ type ExtendedAssetType = z.infer<typeof ExtendedAsset>;
54
+ ```
55
+
56
+ ### Custom Validation
57
+
58
+ ```typescript
59
+ import { richTextAnimationSchema } from '@shotstack/schemas/zod';
60
+
61
+ const AnimationWithDirection = richTextAnimationSchema.refine(
62
+ (data) => {
63
+ if (data.preset === 'slideIn' && !data.direction) {
64
+ return false;
65
+ }
66
+ return true;
67
+ },
68
+ { message: 'direction is required for slideIn preset' }
69
+ );
70
+ ```
71
+
72
+ ## Available Schemas
73
+
74
+ - Edit, Timeline, Track, Clip, Output
75
+ - Assets: VideoAsset, ImageAsset, AudioAsset, HtmlAsset, TextAsset, TitleAsset, LumaAsset, CaptionAsset, ShapeAsset, RichTextAsset
76
+ - Destinations: ShotstackDestination, S3Destination, MuxDestination, VimeoDestination, GoogleDriveDestination, GoogleCloudStorageDestination
77
+ - Transforms, Transitions, Fonts, MergeFields, and more
78
+
79
+ ## Development
80
+
81
+ ```bash
82
+ pnpm install
83
+ pnpm run build
84
+ pnpm run test
85
+ ```
86
+
87
+ ## License
88
+
89
+ MIT