@giveitsmaller/contracts 0.1.2 → 0.2.3

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 (31) hide show
  1. package/asyncapi/events.yaml +2012 -0
  2. package/dist/asyncapi/OperationType.d.ts +4 -0
  3. package/dist/asyncapi/OperationType.js +4 -0
  4. package/dist/openapi/models/JobType.d.ts +8 -1
  5. package/dist/openapi/models/JobType.js +8 -1
  6. package/dist/openapi/models/MultipartCompleteRequest.d.ts +1 -1
  7. package/dist/openapi/models/MultipartCompleteRequest.js +3 -3
  8. package/dist/openapi/models/MultipartCompleteResponse.d.ts +50 -0
  9. package/dist/openapi/models/MultipartCompleteResponse.js +53 -0
  10. package/dist/openapi/models/MultipartCompleteSuccessEnvelope.d.ts +46 -0
  11. package/dist/openapi/models/MultipartCompleteSuccessEnvelope.js +54 -0
  12. package/dist/openapi/models/MultipartInitiateResponse.d.ts +1 -1
  13. package/dist/openapi/models/MultipartInitiateResponse.js +3 -3
  14. package/dist/openapi/models/OperationInputModel.d.ts +3 -1
  15. package/dist/openapi/models/OperationInputModel.js +3 -1
  16. package/dist/openapi/models/OperationType.d.ts +24 -2
  17. package/dist/openapi/models/OperationType.js +24 -2
  18. package/dist/openapi/models/index.d.ts +2 -0
  19. package/dist/openapi/models/index.js +2 -0
  20. package/dist/operations/index.d.ts +1 -0
  21. package/dist/operations/index.js +1 -0
  22. package/dist/operations/watermark.d.ts +28 -0
  23. package/dist/operations/watermark.js +19 -0
  24. package/openapi/api.yaml +2533 -0
  25. package/operations/schemas/archive.yaml +22 -0
  26. package/operations/schemas/compress.yaml +280 -0
  27. package/operations/schemas/convert.yaml +104 -0
  28. package/operations/schemas/merge.yaml +211 -0
  29. package/operations/schemas/thumbnail.yaml +120 -0
  30. package/operations/schemas/watermark.yaml +87 -0
  31. package/package.json +14 -3
@@ -0,0 +1,120 @@
1
+ schema_version: "1.0.0"
2
+
3
+ operation:
4
+ type: thumbnail
5
+ description: "Generate a preview image from the source file"
6
+ default: false
7
+ input_model: single
8
+
9
+ mime_groups:
10
+ image:
11
+ mimes:
12
+ - image/jpeg
13
+ - image/png
14
+ - image/gif
15
+ - image/webp
16
+ - image/tiff
17
+ - image/bmp
18
+ - image/avif
19
+ - image/heic
20
+ options:
21
+ width:
22
+ type: integer
23
+ min: 1
24
+ max: 4096
25
+ required: true
26
+ description: "Thumbnail width in pixels"
27
+ height:
28
+ type: integer
29
+ min: 1
30
+ max: 4096
31
+ required: true
32
+ description: "Thumbnail height in pixels"
33
+ fit:
34
+ type: enum
35
+ values: [max, crop, scale]
36
+ default: crop
37
+ description: "Resize mode"
38
+ format:
39
+ type: enum
40
+ values: [jpg, png, webp]
41
+ default: jpg
42
+ description: "Output format for the thumbnail"
43
+
44
+ video:
45
+ mimes:
46
+ - video/mp4
47
+ - video/webm
48
+ - video/ogg
49
+ options:
50
+ timestamp:
51
+ type: string
52
+ default: "00:00:01"
53
+ description: "Frame to extract (HH:MM:SS or seconds)"
54
+ width:
55
+ type: integer
56
+ min: 1
57
+ max: 4096
58
+ required: true
59
+ description: "Thumbnail width in pixels"
60
+ height:
61
+ type: integer
62
+ min: 1
63
+ max: 4096
64
+ required: true
65
+ description: "Thumbnail height in pixels"
66
+ fit:
67
+ type: enum
68
+ values: [max, crop, scale]
69
+ default: crop
70
+ description: "Resize mode"
71
+ format:
72
+ type: enum
73
+ values: [jpg, png, webp]
74
+ default: jpg
75
+ description: "Output format for the thumbnail"
76
+
77
+ document:
78
+ mimes:
79
+ - application/pdf
80
+ - application/epub+zip
81
+ - application/vnd.openxmlformats-officedocument.wordprocessingml.document
82
+ - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
83
+ - application/vnd.openxmlformats-officedocument.presentationml.presentation
84
+ - application/vnd.oasis.opendocument.text
85
+ - application/vnd.oasis.opendocument.spreadsheet
86
+ - application/vnd.oasis.opendocument.presentation
87
+ options:
88
+ source:
89
+ type: enum
90
+ values: [page, cover]
91
+ default: page
92
+ description: "page = render a specific page/slide, cover = extract cover image (EPUB only, ignored for other formats)"
93
+ page:
94
+ type: integer
95
+ min: 1
96
+ default: 1
97
+ depends_on: { source: page }
98
+ description: "Page/sheet/slide number to render"
99
+ width:
100
+ type: integer
101
+ min: 1
102
+ max: 4096
103
+ required: true
104
+ description: "Thumbnail width in pixels"
105
+ height:
106
+ type: integer
107
+ min: 1
108
+ max: 4096
109
+ required: true
110
+ description: "Thumbnail height in pixels"
111
+ fit:
112
+ type: enum
113
+ values: [max, crop, scale]
114
+ default: crop
115
+ description: "Resize mode"
116
+ format:
117
+ type: enum
118
+ values: [jpg, png, webp]
119
+ default: jpg
120
+ description: "Output format for the thumbnail"
@@ -0,0 +1,87 @@
1
+ schema_version: "1.1.0"
2
+
3
+ operation:
4
+ type: watermark
5
+ description: "Apply a branding or protection overlay (image or text) to the source image. Source capped at 25 megapixels."
6
+ default: false
7
+ input_model: single
8
+
9
+ mime_groups:
10
+ image:
11
+ mimes:
12
+ - image/jpeg
13
+ - image/png
14
+ - image/webp
15
+ options:
16
+ watermark_type:
17
+ type: enum
18
+ values: [image, text]
19
+ default: image
20
+ description: "Overlay type. image = PNG/JPEG overlay fetched from S3, text = rendered text overlay using bundled Liberation Sans"
21
+
22
+ position:
23
+ type: enum
24
+ values: [center, top-left, top-right, bottom-left, bottom-right]
25
+ default: center
26
+ description: "Where the watermark is placed on the source image"
27
+
28
+ opacity:
29
+ type: float
30
+ min: 0.0
31
+ max: 1.0
32
+ default: 0.5
33
+ description: "Overlay opacity (0 = fully transparent, 1 = fully opaque). Clamped to range."
34
+
35
+ watermark_bucket:
36
+ type: string
37
+ required: true
38
+ depends_on: { watermark_type: image }
39
+ description: "S3 bucket containing the overlay image. Required when watermark_type is image."
40
+
41
+ watermark_key:
42
+ type: string
43
+ required: true
44
+ depends_on: { watermark_type: image }
45
+ description: "S3 key of the overlay image. Fetched in parallel with the source. Required when watermark_type is image."
46
+
47
+ text:
48
+ type: string
49
+ required: true
50
+ depends_on: { watermark_type: text }
51
+ description: "Watermark text. Must be non-empty. Rendered with bundled Liberation Sans (SIL OFL). Required when watermark_type is text."
52
+
53
+ font_size:
54
+ type: float
55
+ min: 8.0
56
+ max: 512.0
57
+ default: 48.0
58
+ depends_on: { watermark_type: text }
59
+ description: "Font size in pixels. Clamped to range. A single text overlay is capped at 4 megapixels before rendering fails."
60
+
61
+ color:
62
+ type: string
63
+ default: "#FFFFFF80"
64
+ depends_on: { watermark_type: text }
65
+ description: "Text colour as hex RGB (#RRGGBB) or RGBA (#RRGGBBAA). Default is white with 50% alpha."
66
+
67
+ watermark_mode:
68
+ type: enum
69
+ values: [single, tiled]
70
+ default: single
71
+ depends_on: { watermark_type: text }
72
+ description: "Text rendering mode. single = one label at position, tiled = repeated across the source. Distinct from watermark_type — both keys are read independently."
73
+
74
+ rotation:
75
+ type: float
76
+ min: -360.0
77
+ max: 360.0
78
+ default: -45.0
79
+ depends_on: { watermark_type: text }
80
+ description: "Rotation angle in degrees. Clamped to range. Tiled canvas is capped at 25 megapixels pre-rotation with a 5000 px maximum side length."
81
+
82
+ tile_spacing:
83
+ type: integer
84
+ min: 0
85
+ max: 1000
86
+ depends_on: { watermark_type: text, watermark_mode: tiled }
87
+ description: "Spacing between tiled text labels in pixels. Defaults to font_size if omitted. Only applies when watermark_mode is tiled."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giveitsmaller/contracts",
3
- "version": "0.1.2",
3
+ "version": "0.2.3",
4
4
  "description": "Generated contract types for GISL (Give It Smaller)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -22,10 +22,21 @@
22
22
  "./operations": {
23
23
  "types": "./dist/operations/index.d.ts",
24
24
  "default": "./dist/operations/index.js"
25
- }
25
+ },
26
+ "./openapi/api.yaml": "./openapi/api.yaml",
27
+ "./asyncapi/events.yaml": "./asyncapi/events.yaml",
28
+ "./operations/schemas/archive.yaml": "./operations/schemas/archive.yaml",
29
+ "./operations/schemas/compress.yaml": "./operations/schemas/compress.yaml",
30
+ "./operations/schemas/convert.yaml": "./operations/schemas/convert.yaml",
31
+ "./operations/schemas/merge.yaml": "./operations/schemas/merge.yaml",
32
+ "./operations/schemas/thumbnail.yaml": "./operations/schemas/thumbnail.yaml",
33
+ "./operations/schemas/watermark.yaml": "./operations/schemas/watermark.yaml"
26
34
  },
27
35
  "files": [
28
- "dist/"
36
+ "dist/",
37
+ "openapi/api.yaml",
38
+ "asyncapi/events.yaml",
39
+ "operations/schemas/"
29
40
  ],
30
41
  "scripts": {
31
42
  "build": "tsc",