@shotstack/schemas 1.7.1 → 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 (36) hide show
  1. package/README.md +89 -89
  2. package/dist/api.bundled.json +49 -833
  3. package/dist/json-schema/asset.json +84 -855
  4. package/dist/json-schema/clip.json +84 -855
  5. package/dist/json-schema/edit.json +84 -855
  6. package/dist/json-schema/rich-caption-asset.json +221 -140
  7. package/dist/json-schema/schemas.json +93 -951
  8. package/dist/json-schema/svg-asset.json +6 -857
  9. package/dist/json-schema/timeline.json +84 -855
  10. package/dist/json-schema/track.json +84 -855
  11. package/dist/schema.d.ts +43 -660
  12. package/dist/zod/zod.gen.cjs +914 -1640
  13. package/dist/zod/zod.gen.d.ts +306 -8714
  14. package/dist/zod/zod.gen.js +911 -1636
  15. package/dist/zod/zod.gen.ts +1593 -1880
  16. package/package.json +79 -79
  17. package/dist/json-schema/svg-arrow-shape.json +0 -49
  18. package/dist/json-schema/svg-circle-shape.json +0 -28
  19. package/dist/json-schema/svg-cross-shape.json +0 -42
  20. package/dist/json-schema/svg-ellipse-shape.json +0 -35
  21. package/dist/json-schema/svg-fill.json +0 -169
  22. package/dist/json-schema/svg-gradient-stop.json +0 -25
  23. package/dist/json-schema/svg-heart-shape.json +0 -28
  24. package/dist/json-schema/svg-line-shape.json +0 -35
  25. package/dist/json-schema/svg-linear-gradient-fill.json +0 -80
  26. package/dist/json-schema/svg-path-shape.json +0 -26
  27. package/dist/json-schema/svg-polygon-shape.json +0 -35
  28. package/dist/json-schema/svg-radial-gradient-fill.json +0 -66
  29. package/dist/json-schema/svg-rectangle-shape.json +0 -49
  30. package/dist/json-schema/svg-ring-shape.json +0 -35
  31. package/dist/json-schema/svg-shadow.json +0 -79
  32. package/dist/json-schema/svg-shape.json +0 -404
  33. package/dist/json-schema/svg-solid-fill.json +0 -40
  34. package/dist/json-schema/svg-star-shape.json +0 -42
  35. package/dist/json-schema/svg-stroke.json +0 -115
  36. 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