@transloadit/zod 5.0.0 → 6.0.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.
Files changed (73) hide show
  1. package/dist/v3/assemblyStatus.d.ts +682 -682
  2. package/dist/v3/assemblyStatus.d.ts.map +1 -1
  3. package/dist/v3/assemblyStatus.js +23 -14
  4. package/dist/v3/index.d.ts +1 -0
  5. package/dist/v3/index.d.ts.map +1 -1
  6. package/dist/v3/index.js +1 -0
  7. package/dist/v3/robots/_ai-models.d.ts.map +1 -1
  8. package/dist/v3/robots/_ai-models.js +2 -0
  9. package/dist/v3/robots/_google-image-seed.d.ts +8 -0
  10. package/dist/v3/robots/_google-image-seed.d.ts.map +1 -0
  11. package/dist/v3/robots/_google-image-seed.js +11 -0
  12. package/dist/v3/robots/_instructions-primitives.d.ts +2 -0
  13. package/dist/v3/robots/_instructions-primitives.d.ts.map +1 -1
  14. package/dist/v3/robots/_instructions-primitives.js +11 -14
  15. package/dist/v3/robots/ai-chat.d.ts +1 -1
  16. package/dist/v3/robots/ai-chat.d.ts.map +1 -1
  17. package/dist/v3/robots/google-import.d.ts +4 -6
  18. package/dist/v3/robots/google-import.d.ts.map +1 -1
  19. package/dist/v3/robots/google-import.js +5 -2
  20. package/dist/v3/robots/google-store.d.ts.map +1 -1
  21. package/dist/v3/robots/google-store.js +5 -13
  22. package/dist/v3/robots/http-import.d.ts.map +1 -1
  23. package/dist/v3/robots/http-import.js +4 -0
  24. package/dist/v3/robots/image-generate.d.ts.map +1 -1
  25. package/dist/v3/robots/image-generate.js +6 -1
  26. package/dist/v3/robots/image-resize.d.ts +4 -0
  27. package/dist/v3/robots/image-resize.d.ts.map +1 -1
  28. package/dist/v3/robots/image-resize.js +34 -6
  29. package/dist/v3/robots/s3-store.d.ts.map +1 -1
  30. package/dist/v3/robots/s3-store.js +21 -17
  31. package/dist/v3/robots/video-thumbs.d.ts +6 -0
  32. package/dist/v3/robots/video-thumbs.d.ts.map +1 -1
  33. package/dist/v3/robots/video-thumbs.js +15 -5
  34. package/dist/v3/storageResults.d.ts +29 -0
  35. package/dist/v3/storageResults.d.ts.map +1 -0
  36. package/dist/v3/storageResults.js +52 -0
  37. package/dist/v4/assemblyStatus.d.ts +75 -1183
  38. package/dist/v4/assemblyStatus.d.ts.map +1 -1
  39. package/dist/v4/assemblyStatus.js +23 -14
  40. package/dist/v4/index.d.ts +1 -0
  41. package/dist/v4/index.d.ts.map +1 -1
  42. package/dist/v4/index.js +1 -0
  43. package/dist/v4/robots/_ai-models.d.ts.map +1 -1
  44. package/dist/v4/robots/_ai-models.js +2 -0
  45. package/dist/v4/robots/_google-image-seed.d.ts +8 -0
  46. package/dist/v4/robots/_google-image-seed.d.ts.map +1 -0
  47. package/dist/v4/robots/_google-image-seed.js +11 -0
  48. package/dist/v4/robots/_instructions-primitives.d.ts +2 -0
  49. package/dist/v4/robots/_instructions-primitives.d.ts.map +1 -1
  50. package/dist/v4/robots/_instructions-primitives.js +11 -13
  51. package/dist/v4/robots/ai-chat.d.ts +1 -1
  52. package/dist/v4/robots/ai-chat.d.ts.map +1 -1
  53. package/dist/v4/robots/google-import.d.ts +4 -4
  54. package/dist/v4/robots/google-import.d.ts.map +1 -1
  55. package/dist/v4/robots/google-import.js +5 -2
  56. package/dist/v4/robots/google-store.d.ts.map +1 -1
  57. package/dist/v4/robots/google-store.js +5 -13
  58. package/dist/v4/robots/http-import.d.ts.map +1 -1
  59. package/dist/v4/robots/http-import.js +4 -0
  60. package/dist/v4/robots/image-generate.d.ts.map +1 -1
  61. package/dist/v4/robots/image-generate.js +5 -1
  62. package/dist/v4/robots/image-resize.d.ts +4 -0
  63. package/dist/v4/robots/image-resize.d.ts.map +1 -1
  64. package/dist/v4/robots/image-resize.js +34 -6
  65. package/dist/v4/robots/s3-store.d.ts.map +1 -1
  66. package/dist/v4/robots/s3-store.js +21 -17
  67. package/dist/v4/robots/video-thumbs.d.ts +6 -0
  68. package/dist/v4/robots/video-thumbs.d.ts.map +1 -1
  69. package/dist/v4/robots/video-thumbs.js +15 -5
  70. package/dist/v4/storageResults.d.ts +23 -0
  71. package/dist/v4/storageResults.d.ts.map +1 -0
  72. package/dist/v4/storageResults.js +53 -0
  73. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"image-resize.d.ts","sourceRoot":"","sources":["../../../src/v4/robots/image-resize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,+BAA+B,EAC/B,cAAc,EACd,uBAAuB,EACxB,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAyB1B,eAAO,MAAM,IAAI,EAAE,cAiBlB,CAAA;AAED,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsExB,CAAA;AAwBF,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAicpC,CAAA;AAEX,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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e,CAAC,CAAA;AAEnE,MAAM,MAAM,4BAA4B,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAA;AACjE,MAAM,MAAM,iCAAiC,GAAG,YAAY,CAAC,OAAO,CAAC,CAAA;AACrE,MAAM,MAAM,4CAA4C,GAAG,YAAY,CAAC,cAAc,CAAC,CAAA;AACvF,MAAM,MAAM,0CAA0C,GAAG,YAAY,CAAC,qBAAqB,CAAC,CAAA;AAC5F,MAAM,MAAM,+CAA+C,GAAG,YAAY,CAAC,qBAAqB,CAAC,CAAA;AACjG,MAAM,MAAM,0DAA0D,GACpE,YAAY,CAAC,4BAA4B,CAAC,CAAA;AAC5C,MAAM,MAAM,+DAA+D,GACzE,YAAY,CAAC,2BAA2B,CAAC,CAAA"}
@@ -4,6 +4,32 @@ import { imagemagickDensityPattern } from "../imagemagickDensity.js";
4
4
  import { zodInputPreservingTransform } from "../lib/zodInputSemantics.js";
5
5
  import { color_without_alpha_with_named, colorspaceSchema, complexHeightSchema, complexWidthSchema, createProcessingExample, defineRobotWithHiddenFields, httpUrlSchema, imageAdaptiveFilteringSchema, imageQualitySchema, percentageSchema, positionSchema, robotBase, robotImagemagick, robotImageProcessingMeta, robotUse, unsafeCoordinatesSchema, } from "./_instructions-primitives.js";
6
6
  const imageResizeGravitySchema = z.union([positionSchema, z.enum(['attention', 'entropy'])]);
7
+ /** Input MIME types eligible for automatic libvips processing in /image/resize. */
8
+ export const imageResizeDaemonInputMimes = [
9
+ 'image/jpg',
10
+ 'image/jpeg',
11
+ 'image/jxl',
12
+ 'image/png',
13
+ 'image/tiff',
14
+ 'image/tiff-fx',
15
+ 'image/gif',
16
+ 'image/webp',
17
+ 'image/svg',
18
+ 'image/svg+xml',
19
+ ];
20
+ /** Output formats eligible for automatic libvips processing in /image/resize. */
21
+ export const imageResizeDaemonOutputFormats = [
22
+ 'heic',
23
+ 'heif',
24
+ 'jpeg',
25
+ 'jpg',
26
+ 'jxl',
27
+ 'png',
28
+ 'raw',
29
+ 'tiff',
30
+ 'webp',
31
+ 'avif',
32
+ ];
7
33
  export const meta = {
8
34
  ...robotImageProcessingMeta,
9
35
  example_code: createProcessingExample('resized', '/image/resize', {
@@ -141,14 +167,14 @@ Height of the new image, in pixels. If not specified, will default to the height
141
167
  .union([
142
168
  z
143
169
  .literal('crop')
144
- .describe(`Cuts an area out of an image, discarding any overlapping parts. If the source image is smaller than the crop frame, it will be zoomed. This strategy is implied when you specify coordinates in the \`crop\` parameter, and cannot be used without it.
170
+ .describe(`Cuts an area out of an image. Coordinates in the \`crop\` parameter imply this strategy. With coordinates, ImageMagick crops without resizing; libvips enlarges the image if \`x2\` or \`y2\` exceeds its dimensions, even with \`zoom: false\`. Without coordinates, set both \`width\` and \`height\`; this uses \`fillcrop\`, with \`gravity\` selecting which part is kept. With the default \`zoom\` setting, this coordinate-free path scales the image to cover that rectangle before trimming.
145
171
 
146
172
  To crop around human faces, see [🤖/image/facedetect](https://transloadit.com/docs/robots/image-facedetect/) instead.`),
147
173
  z
148
174
  .literal('fillcrop')
149
175
  .describe(`Scales the image to fit into our 100×100 target while preserving aspect ratio, while trimming away any excess surface. This means both sides will become exactly 100 pixels, at the tradeoff of destroying parts of the image.
150
176
 
151
- By default the resulting image is horizontally/vertically centered to fill the target rectangle. Use the \`gravity\` parameter to change where to crop the image, such as \`"bottom\`" or \`"left\`".`),
177
+ By default the resulting image is horizontally/vertically centered to fill the target rectangle. Use the \`gravity\` parameter to change where to crop the image, such as \`"bottom"\` or \`"left"\`.`),
152
178
  z
153
179
  .literal('fit')
154
180
  .describe(`Uses the larger side of the original image as a base for the resize. Aspect ratio is preserved. Either side will become at most 100 pixels.
@@ -192,7 +218,7 @@ For example:
192
218
  }
193
219
  \`\`\`
194
220
 
195
- This will crop the area from \`(80, 100)\` to \`(600, 800)\` from a 1000×1000 pixels image, which is a square whose width is 520px and height is 700px. If \`crop\` is set, the width and height parameters are ignored, and the \`resize_strategy\` is set to \`crop\` automatically.
221
+ This will crop the area from \`(80, 100)\` to \`(600, 800)\` from a 1000×1000 pixels image, which is a rectangle whose width is 520px and height is 700px. If \`crop\` is set, the width and height parameters are ignored, and the \`resize_strategy\` is set to \`crop\` automatically.
196
222
 
197
223
  You can also use a JSON string of such an object with coordinates in similar fashion:
198
224
 
@@ -203,9 +229,11 @@ You can also use a JSON string of such an object with coordinates in similar fas
203
229
  To crop around human faces, see [🤖/image/facedetect](/docs/robots/image-facedetect/).
204
230
  `),
205
231
  gravity: imageResizeGravitySchema.default('center').describe(`
206
- The direction from which the image is to be cropped when \`"resize_strategy"\` is set to \`"crop"\` or \`"fillcrop"\`, but no crop coordinates are defined.
207
-
208
- You can also use \`"entropy"\` or \`"attention"\` for automatic point-of-interest cropping. \`"entropy"\` keeps the region with the highest Shannon entropy, while \`"attention"\` favors areas with luminance frequency, saturation, and skin-tone cues.
232
+ Sets crop direction for \`crop\` or \`fillcrop\` without explicit coordinates.
233
+ Content-aware \`attention\` and \`entropy\` need libvips, \`fillcrop\`, \`width\` and \`height\`.
234
+ Effects such as \`sepia\` or \`text\`, and inputs such as HEIC, can use ImageMagick.
235
+ It centers these crops and the Assembly reports a warning.
236
+ Crop in a separate /image/resize Step before effects, or convert unsupported inputs to PNG first.
209
237
  `),
210
238
  strip: z
211
239
  .boolean()
@@ -1 +1 @@
1
- {"version":3,"file":"s3-store.d.ts","sourceRoot":"","sources":["../../../src/v4/robots/s3-store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,+BAA+B,EAC/B,cAAc,EACd,uBAAuB,EACxB,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAgB1B,eAAO,MAAM,IAAI,EAAE,cAYlB,CAAA;AAED,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAwGhC,CAAA;AAEX,QAAA,MAAM,YAAY;;CAMjB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,+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,QAAA,MAAM,YAAY;;CAMjB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,+BAA+B,CAC3D,OAAO,8BAA8B,CAAC,KAAK,EAC3C,OAAO,YAAY,CAC8D,CAAA;AAEnF,eAAO,MACa,8CAA8C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAChD,4CAA4C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAC5B,4DAA4D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAC3E,CAAA;AAEnB,KAAK,YAAY,GAAG,uBAAuB,CAAC,OAAO,eAAe,CAAC,CAAA;AAEnE,MAAM,MAAM,wBAAwB,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAA;AAC7D,MAAM,MAAM,6BAA6B,GAAG,YAAY,CAAC,OAAO,CAAC,CAAA;AACjE,MAAM,MAAM,wCAAwC,GAAG,YAAY,CAAC,cAAc,CAAC,CAAA;AACnF,MAAM,MAAM,sCAAsC,GAAG,YAAY,CAAC,qBAAqB,CAAC,CAAA;AACxF,MAAM,MAAM,2CAA2C,GAAG,YAAY,CAAC,qBAAqB,CAAC,CAAA;AAC7F,MAAM,MAAM,sDAAsD,GAChE,YAAY,CAAC,4BAA4B,CAAC,CAAA;AAC5C,MAAM,MAAM,2DAA2D,GACrE,YAAY,CAAC,2BAA2B,CAAC,CAAA"}
@@ -21,48 +21,54 @@ export const robotS3StoreInstructionsSchema = robotBase
21
21
  .merge(robotUse)
22
22
  .merge(s3Base)
23
23
  .extend({
24
+ // URL rewriting does not fix bucket addressing, and custom paths need not use file.url_name.
25
+ // Keep the bucket warning separate from the old blanket filename-sanitization claim.
24
26
  robot: z.literal('/s3/store').describe(`
25
27
  If you are new to Amazon S3, see our tutorial on [using your own S3 bucket](/docs/faq/how-to-set-up-an-amazon-s3-bucket/).
26
28
 
27
- The URL to the result file in your S3 bucket will be returned in the <dfn>Assembly Status JSON</dfn>. If your S3 bucket has versioning enabled, the version ID of the file will be returned within \`meta.version_id\`
29
+ The URL to the result file in your S3 bucket will be returned in the <dfn>Assembly Status JSON</dfn>. A returned URL does not make a private object public or grant read access. If your S3 bucket has versioning enabled, the version ID of the file will be returned within \`meta.version_id\`.
28
30
 
29
31
  > [!Warning]
30
- > **Avoid permission errors.** By default, \`acl\` is set to \`"${s3StoreAclSchema.parse(undefined)}"\`. AWS S3 has a bucket setting called \`Block new public ACLs and uploading public objects\`. Set this to <strong>False</strong> in your bucket if you intend to leave \`acl\` as \`"${s3StoreAclSchema.parse(undefined)}"\`. Otherwise, you’ll receive permission errors in your Assemblies despite your S3 credentials being configured correctly.
32
+ > **Configure private buckets explicitly.** The Robot’s default \`acl\` is still \`"${s3StoreAclSchema.parse(undefined)}"\`. For a private bucket, set \`acl: "bucket-default"\` and do not supply ACL or grant headers. This omits the generated ACL header and works with [Bucket owner enforced Object Ownership](https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html), where ACLs are disabled. Keep S3 Block Public Access enabled. Setting \`acl: "private"\` still sends an ACL and is not equivalent to omitting it.
31
33
 
32
34
  > [!Warning]
33
- > **Use DNS-compliant bucket names.** Your bucket name [must be DNS-compliant](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html) and must not contain uppercase letters. Any non-alphanumeric characters in the file names will be replaced with an underscore, and spaces will be replaced with dashes. If your existing S3 bucket contains uppercase letters or is otherwise not DNS-compliant, rewrite the result URLs using the <dfn>Robot</dfn>’s \`url_prefix\` parameter.
35
+ > **Use DNS-compliant bucket names.** Follow AWS’s [bucket naming rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html). The \`url_prefix\` parameter changes returned URLs; it does not change the bucket or its access permissions.
34
36
 
35
37
  <span id="minimum-s3-iam-permissions" aria-hidden="true"></span>
36
38
 
37
39
  ## Limit access
38
40
 
39
- You will also need to add permissions to your bucket so that Transloadit can access it properly. Here is an example IAM policy that you can use. Following the [principle of least privilege](https://en.wikipedia.org/wiki/Principle_of_least_privilege), it contains the **minimum required permissions** to export a file to your S3 bucket using Transloadit. You may require more permissions (especially viewing permissions) depending on your application.
41
+ Use a dedicated AWS identity with access limited to the destination bucket and object prefix. Do not use [AWS root access keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/root-user-best-practices.html). Store its access key ID, secret access key, bucket name and region as \`key\`, \`secret\`, \`bucket\` and \`bucket_region\` in <dfn>Template Credentials</dfn>, then reference their name with \`credentials\`. Trusted backend integrations can instead supply those parameters directly; do not expose AWS secrets in browser instructions.
40
42
 
41
- Please change \`{BUCKET_NAME}\` in the values for \`Sid\` and \`Resource\` accordingly. Also, this policy will grant the minimum required permissions to all your users. We advise you to create a separate Amazon IAM user, and use its User ARN (can be found in the "Summary" tab of a user [here](https://console.aws.amazon.com/iam/home#users)) for the \`Principal\` value. More information about this can be found [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/AccessPolicyLanguage_UseCases_s3_a.html).
43
+ The following is an [identity-based IAM policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html), attached to that dedicated identity, not a bucket policy. It intentionally has no \`Principal\`. Replace \`{BUCKET_NAME}\` and use a Robot \`path\` beginning with \`uploads/\`, or adapt both the policy prefix and the path together.
44
+
45
+ This example covers uploads and failed multipart-upload cleanup with an explicit \`bucket_region\`, \`acl: "bucket-default"\`, no ACL/grant headers, no tags and S3-managed encryption (SSE-S3). Existing bucket policies, organization controls or endpoint policies can still deny access.
42
46
 
43
47
  \`\`\`json
44
48
  {
45
49
  "Version": "2012-10-17",
46
50
  "Statement": [
47
51
  {
48
- "Sid": "AllowTransloaditToStoreFilesIn{BUCKET_NAME}Bucket",
52
+ "Sid": "UploadAndAbortWithinPrefix",
49
53
  "Effect": "Allow",
50
- "Action": ["s3:GetBucketLocation", "s3:ListBucket", "s3:PutObject", "s3:PutObjectAcl"],
51
- "Resource": ["arn:aws:s3:::{BUCKET_NAME}", "arn:aws:s3:::{BUCKET_NAME}/*"]
54
+ "Action": ["s3:PutObject", "s3:AbortMultipartUpload"],
55
+ "Resource": "arn:aws:s3:::{BUCKET_NAME}/uploads/*"
52
56
  }
53
57
  ]
54
58
  }
55
59
  \`\`\`
56
60
 
57
- The \`Sid\` value is just an identifier for you to recognize the rule later. You can name it anything you like.
61
+ The uploader uses either \`PutObject\` or \`CreateMultipartUpload\`, \`UploadPart\` and \`CompleteMultipartUpload\`; failed multipart uploads can trigger \`AbortMultipartUpload\`. AWS maps the successful upload operations to \`s3:PutObject\`. Write access can **overwrite an existing object key**; it is not add-only. Choose unique object paths and consider versioning for recovery.
58
62
 
59
- The policy needs to be separated into two parts, because the \`ListBucket\` action requires permissions on the bucket while the other actions require permissions on the objects in the bucket. When targeting the objects there's a trailing slash and an asterisk in the \`Resource\` parameter, whereas when the policy targets the bucket, the slash and the asterisk are omitted.
63
+ Add permissions only for features you use, following AWS’s [operation permission reference](https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-policy-actions.html):
60
64
 
61
- Please note that if you give the <dfn>Robot</dfn>'s \`acl\` parameter a value of \`"bucket-default"\`, then you do not need the \`"s3:PutObjectAcl"\` permission in your bucket policy.
65
+ - Without an explicit \`bucket_region\`, region discovery can require \`s3:GetBucketLocation\` and fallback \`s3:ListBucket\` on the bucket ARN, \`arn:aws:s3:::{BUCKET_NAME}\`, without an object suffix. Supplying the correct region avoids these discovery requests.
66
+ - ACL or grant headers require \`s3:PutObjectAcl\`; tags require \`s3:PutObjectTagging\` on the allowed object prefix. \`bucket-default\` does not remove ACL/grant headers you supply in \`headers\`.
67
+ - Downloading private results requires separate read authorization. Even a URL generated with \`sign_urls_for\` needs the signing identity to have the appropriate read permissions.
62
68
 
63
- In order to build proper result URLs we need to know the region in which your S3 bucket resides. For this we require the \`GetBucketLocation\` permission. Figuring out your bucket's region this way will also slow down your Assemblies. To make this much faster and to also not require the \`GetBucketLocation\` permission, we have added the \`bucket_region\` parameter to the /s3/store and /s3/import Robots. We recommend using them at all times.
69
+ S3 applies its [bucket encryption configuration](https://docs.aws.amazon.com/AmazonS3/latest/userguide/default-bucket-encryption.html) when no encryption override is sent. You can request SSE-KMS through \`headers\`, using \`x-amz-server-side-encryption: aws:kms\` and \`x-amz-server-side-encryption-aws-kms-key-id\`. When either bucket default encryption or request headers select [SSE-KMS](https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html), the uploading identity needs \`kms:GenerateDataKey\` on the relevant key, plus \`kms:Decrypt\` for multipart uploads. For a customer-managed key, grant these permissions with a compatible KMS key policy; the base S3 policy above does not include them. Do not add blanket \`kms:*\` or \`sts:*\` grants.
64
70
 
65
- Please keep in mind that if you use bucket encryption you may also need to add \`"sts:*"\` and \`"kms:*"\` to the bucket policy. Please read [here](https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) and [here](https://aws.amazon.com/blogs/security/how-to-restrict-amazon-s3-bucket-access-to-a-specific-iam-role/) in case you run into trouble with our example bucket policy.
71
+ Short-lived AWS credentials are a matching set of \`key\`, \`secret\` and \`session_token\`. Have a trusted backend obtain and refresh all three, then supply them together when it creates the Assembly. It can pass them directly in Robot instructions or save and update them together through the [Template Credentials API](/docs/api/template-credentials-post/). Keep all three out of browser instructions; replacing only the session token does not refresh expired access keys. This Robot passes the supplied credentials to S3; it does not assume a role or refresh expired credentials. Keep temporary credentials valid for the upload.
66
72
  `),
67
73
  path: storeFilePath,
68
74
  url_prefix: z
@@ -72,9 +78,7 @@ Please keep in mind that if you use bucket encryption you may also need to add \
72
78
  The URL prefix used for the returned URL, such as \`"http://my.cdn.com/some/path/"\`.
73
79
  `),
74
80
  acl: s3StoreAclSchema.describe(`
75
- The permissions used for this file.
76
-
77
- Please keep in mind that the default value \`"${s3StoreAclSchema.parse(undefined)}"\` can lead to permission errors due to the \`"Block all public access"\` checkbox that is checked by default when creating a new Amazon S3 Bucket in the AWS console.
81
+ The ACL used for this file. The default remains \`"${s3StoreAclSchema.parse(undefined)}"\`, which can conflict with S3 Block Public Access and disabled ACLs. For modern private buckets, explicitly set \`"bucket-default"\` to omit the generated ACL header, and do not supply ACL/grant headers in \`headers\`. \`"private"\` still sends an ACL.
78
82
  `),
79
83
  check_integrity: z
80
84
  .boolean()
@@ -118,7 +122,7 @@ This parameter provides signed URLs in the result JSON (in the \`signed_url\` an
118
122
  session_token: optionalWithV3Semantics(z
119
123
  .string())
120
124
  .describe(`
121
- The session token to use for the S3 store. This is only used if the credentials are from an IAM user with the \`sts:AssumeRole\` permission.
125
+ The session token belonging to the temporary AWS access key ID and secret access key supplied for this upload. The Robot does not assume a role or refresh these credentials; they must remain valid for the upload.
122
126
  `),
123
127
  })
124
128
  .strict();
@@ -2,6 +2,12 @@ import type { RobotDefinition, RobotMetaInput, RobotSchemaVariantTypes } from '.
2
2
  import { z } from 'zod/v4';
3
3
  /** Markup over the AI provider cost for smart thumbnail selection. */
4
4
  export declare const smartThumbnailMarkupPercent = 50;
5
+ /** Dedicated vision model so /ai/chat default upgrades do not change thumbnail analysis costs. */
6
+ export declare const smartThumbnailModel = "openai/gpt-5.4-mini";
7
+ /** Maximum long-side dimension of scoring previews; returned thumbnails keep their output size. */
8
+ export declare const smartThumbnailAnalysisMaxSize = 512;
9
+ /** Frame ranking needs little reasoning compared with general-purpose chat. */
10
+ export declare const smartThumbnailReasoningEffort = "low";
5
11
  /** Candidate-pool size shared by smart thumbnail execution and its documented default example. */
6
12
  export declare function getSmartThumbnailCandidateCount(count: number, maximumCandidates: number): number;
7
13
  export declare const meta: RobotMetaInput;
@@ -1 +1 @@
1
- {"version":3,"file":"video-thumbs.d.ts","sourceRoot":"","sources":["../../../src/v4/robots/video-thumbs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,uBAAuB,EACxB,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAe1B,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C,KAAK,CACtC,CAAA;AAEvD,eAAO,MACa,kDAAkD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBACpD,gDAAgD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAChC,gEAAgE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAC/E,CAAA;AAEnB,KAAK,YAAY,GAAG,uBAAuB,CAAC,OAAO,eAAe,CAAC,CAAA;AAEnE,MAAM,MAAM,4BAA4B,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAA;AACjE,MAAM,MAAM,4CAA4C,GAAG,YAAY,CAAC,cAAc,CAAC,CAAA;AACvF,MAAM,MAAM,0CAA0C,GAAG,YAAY,CAAC,qBAAqB,CAAC,CAAA;AAC5F,MAAM,MAAM,+CAA+C,GAAG,YAAY,CAAC,qBAAqB,CAAC,CAAA;AACjG,MAAM,MAAM,0DAA0D,GACpE,YAAY,CAAC,4BAA4B,CAAC,CAAA;AAC5C,MAAM,MAAM,+DAA+D,GACzE,YAAY,CAAC,2BAA2B,CAAC,CAAA"}
@@ -4,6 +4,12 @@ import { stackVersions } from "../stackVersions.js";
4
4
  import { color_with_alpha, createProcessingExample, defineRobot, percentageSchema, resize_strategy, robotBase, robotFFmpeg, robotUse, robotVideoEncodingMeta, } from "./_instructions-primitives.js";
5
5
  /** Markup over the AI provider cost for smart thumbnail selection. */
6
6
  export const smartThumbnailMarkupPercent = 50;
7
+ /** Dedicated vision model so /ai/chat default upgrades do not change thumbnail analysis costs. */
8
+ export const smartThumbnailModel = 'openai/gpt-5.4-mini';
9
+ /** Maximum long-side dimension of scoring previews; returned thumbnails keep their output size. */
10
+ export const smartThumbnailAnalysisMaxSize = 512;
11
+ /** Frame ranking needs little reasoning compared with general-purpose chat. */
12
+ export const smartThumbnailReasoningEffort = 'low';
7
13
  const thumbnailCountSchema = z.number().int().min(1).max(999).default(8);
8
14
  const smartMaximumCandidatesSchema = z.number().int().min(2).max(100).default(20);
9
15
  const defaultThumbnailCount = thumbnailCountSchema.parse(undefined);
@@ -36,13 +42,15 @@ export const robotVideoThumbsInstructionsSchema = robotBase
36
42
  .merge(robotFFmpeg)
37
43
  .extend({
38
44
  robot: z.literal('/video/thumbs').describe(`
39
- Set \`smart: true\` to select strong preview images with AI instead of taking frames only at regular intervals. The Robot scores candidate frames for clarity, brightness, composition, faces, expressions, action, and visual interest, then returns the best \`count\` frames in chronological order. Smart results include \`file.meta.smart_score\` and \`file.meta.smart_reasons\`. If AI scoring is unavailable, the Assembly continues with the candidate frames in fallback order. No AI credentials are required.
45
+ Set \`smart: true\` to select strong preview images with AI instead of taking frames only at regular intervals. The Robot scores candidate frames for clarity, brightness, composition, faces, expressions, action, and visual interest, then returns the best \`count\` frames in chronological order. Smart results include \`file.meta.smart_score\` and \`file.meta.smart_reasons\`. If AI scoring is unavailable, the Assembly continues with the candidate frames in fallback order and includes a warning. No AI credentials are required.
40
46
 
41
47
  ## AI pricing
42
48
 
43
- Regular \`/video/thumbs\` processing charges still apply. AI frame analysis is billed separately at the underlying provider cost plus a ${smartThumbnailMarkupPercent}% Transloadit markup. The exact AI charge varies with the number of candidate frames, the internally selected model and provider pricing, and the image payload size.
49
+ Regular \`/video/thumbs\` processing charges still apply. AI frame analysis is billed separately at the underlying provider cost plus a ${smartThumbnailMarkupPercent}% Transloadit markup. Smart selection uses the dedicated \`${smartThumbnailModel}\` vision model with \`${smartThumbnailReasoningEffort}\` reasoning, independently of the \`/ai/chat\` default. The exact AI charge varies with the number of candidate frames and provider pricing.
44
50
 
45
- \`smart_max_candidates\` is the main cost and latency control. The Robot analyzes up to three candidates per requested thumbnail, capped by \`smart_max_candidates\`, but never fewer than \`count\`. With the defaults of \`count: ${defaultThumbnailCount}\` and \`smart_max_candidates: ${defaultSmartMaximumCandidates}\`, it analyzes ${getSmartThumbnailCandidateCount(defaultThumbnailCount, defaultSmartMaximumCandidates)} frames and returns the best ${defaultThumbnailCount}. Lower the candidate limit to reduce AI cost and latency; raise it to give the AI more frames to choose from.
51
+ The AI scores preview copies capped at ${smartThumbnailAnalysisMaxSize} pixels on the long side, preserving aspect ratio and without enlarging smaller images. Returned thumbnails keep the requested output dimensions and format; larger outputs do not increase the scoring preview beyond this limit.
52
+
53
+ \`smart_max_candidates\` is the main cost and latency control. The Robot analyzes up to three candidates per requested thumbnail, capped by \`smart_max_candidates\`, but never fewer than \`count\`. With the defaults of \`count: ${defaultThumbnailCount}\` and \`smart_max_candidates: ${defaultSmartMaximumCandidates}\`, it analyzes ${getSmartThumbnailCandidateCount(defaultThumbnailCount, defaultSmartMaximumCandidates)} frames and returns the best ${defaultThumbnailCount}. Lower the candidate limit to reduce AI cost and latency. Raising it can enlarge the pool up to three times \`count\`; higher limits have no effect.
46
54
 
47
55
  > [!Note]
48
56
  > Use \`count\` with smart selection. To consistently extract exact timestamps with \`offsets\`, set \`smart: false\`.
@@ -121,17 +129,19 @@ The AI evaluates frames based on:
121
129
  - Action and motion (avoiding transition frames)
122
130
  - Overall visual interest
123
131
 
124
- Regular \`/video/thumbs\` processing charges still apply. AI frame analysis is billed separately at the underlying provider cost plus a ${smartThumbnailMarkupPercent}% Transloadit markup. You do not need to provide AI credentials.
132
+ Regular \`/video/thumbs\` processing charges still apply. AI frame analysis uses a dedicated low-cost vision model with \`${smartThumbnailReasoningEffort}\` reasoning and preview copies capped at ${smartThumbnailAnalysisMaxSize} pixels on the long side. Returned thumbnails retain their requested dimensions and format. Analysis is billed separately at the underlying provider cost plus a ${smartThumbnailMarkupPercent}% Transloadit markup. You do not need to provide AI credentials.
125
133
 
126
134
  Smart mode generates its own regularly spaced candidate timestamps; use \`smart: false\` with \`offsets\` when you need specified timestamps. Selected smart thumbnails are returned in chronological order, not score order. Inspect \`meta.thumb_offset\`, \`meta.smart_score\`, and \`meta.smart_reasons\` when evaluating the selection.
127
135
 
128
- If AI scoring fails, the Robot selects from the extracted candidates in chronological order and records a fallback reason. If no candidates can be extracted, it attempts standard thumbnail extraction. A completed Assembly does not guarantee a representative or publication-safe poster; check that outputs exist and apply your application’s review policy.
136
+ If AI scoring fails, the Robot selects extracted candidates in chronological order and records a fallback reason. With no candidates, it attempts standard extraction. Both fallbacks add an Assembly warning. A completed Assembly does not guarantee a representative or publication-safe poster; check that outputs exist and apply your application’s review policy.
129
137
  `),
130
138
  smart_max_candidates: smartMaximumCandidatesSchema.describe(`
131
139
  The maximum size of the candidate pool when \`smart\` is \`true\`. The Robot analyzes up to three candidates per requested thumbnail, capped by this value, but it will never analyze fewer candidates than the requested \`count\`.
132
140
 
133
141
  A higher number may yield better results but increases processing time and AI cost. With the defaults of \`count: ${defaultThumbnailCount}\` and \`smart_max_candidates: ${defaultSmartMaximumCandidates}\`, the Robot analyzes ${getSmartThumbnailCandidateCount(defaultThumbnailCount, defaultSmartMaximumCandidates)} frames and returns the best ${defaultThumbnailCount} in chronological order.
134
142
 
143
+ Raising this limit above three times \`count\` does not enlarge the pool. For example, \`count: 1\` analyzes at most three candidates.
144
+
135
145
  This parameter is only used when \`smart\` is \`true\`.
136
146
  `),
137
147
  })
@@ -0,0 +1,23 @@
1
+ import type { StoredAsset } from './storageAsset.ts';
2
+ import { z } from 'zod/v4';
3
+ /** Server-owned Assembly identity and expected Workspace, never untrusted notification fields. */
4
+ export declare const storedAssemblyResultsOptionsSchema: z.ZodObject<{
5
+ assemblyId: z.ZodString;
6
+ workspace: z.ZodString;
7
+ }, z.core.$strip>;
8
+ export type GetStoredAssemblyResultsOptions = z.infer<typeof storedAssemblyResultsOptionsSchema>;
9
+ /** Canonical retained receipt and producing result provenance, for idempotent registration. */
10
+ export interface StoredAssemblyResult {
11
+ assembly_id: string;
12
+ step: string;
13
+ result_id: string;
14
+ original_id?: string | (string | null)[];
15
+ asset: StoredAsset;
16
+ }
17
+ /**
18
+ * Pure extraction from a fetched/verified Assembly bound to an authorized app upload. Validates
19
+ * every retained result atomically; temporary outputs are ignored, partial receipts are rejected.
20
+ * This does not authenticate notifications or check application permissions.
21
+ */
22
+ export declare function extractStoredAssemblyResults(input: unknown, options: GetStoredAssemblyResultsOptions): StoredAssemblyResult[];
23
+ //# sourceMappingURL=storageResults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storageResults.d.ts","sourceRoot":"","sources":["../../src/v4/storageResults.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAEpD,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAO1B,kGAAkG;AAClG,eAAO,MAAM,kCAAkC;;;iBAG7C,CAAA;AAEF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAEhG,+FAA+F;AAC/F,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAA;IACxC,KAAK,EAAE,WAAW,CAAA;CACnB;AAaD;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,+BAA+B,GACvC,oBAAoB,EAAE,CA6BxB"}
@@ -0,0 +1,53 @@
1
+ import { optionalWithV3Semantics } from "./lib/sdkZodOptional.js";
2
+ import { z } from 'zod/v4';
3
+ import { storedAssetSchema } from "./storageAsset.js";
4
+ // SDK-owned extraction is outside alphalib-sync's explicit node-sdk syncIncludes. Co-location
5
+ // reuses canonical schemas and their Types/Zod generation without adding a runtime package.
6
+ /** Server-owned Assembly identity and expected Workspace, never untrusted notification fields. */
7
+ export const storedAssemblyResultsOptionsSchema = z.object({
8
+ assemblyId: z.string().regex(/^[A-Za-z0-9_-]+$/),
9
+ workspace: z.string().min(1),
10
+ });
11
+ const resultSchema = storedAssetSchema.extend({
12
+ id: z.string().min(1),
13
+ original_id: optionalWithV3Semantics(z.union([z.string(), z.array(z.string().nullable())])),
14
+ });
15
+ const assemblySchema = z.object({
16
+ assembly_id: z.string(),
17
+ ok: optionalWithV3Semantics(z.string().nullable()),
18
+ error: optionalWithV3Semantics(z.string()),
19
+ results: optionalWithV3Semantics(z.record(z.string(), z.array(z.record(z.string(), z.unknown())))),
20
+ });
21
+ /**
22
+ * Pure extraction from a fetched/verified Assembly bound to an authorized app upload. Validates
23
+ * every retained result atomically; temporary outputs are ignored, partial receipts are rejected.
24
+ * This does not authenticate notifications or check application permissions.
25
+ */
26
+ export function extractStoredAssemblyResults(input, options) {
27
+ const { assemblyId, workspace } = storedAssemblyResultsOptionsSchema.parse(options);
28
+ const assembly = assemblySchema.parse(input);
29
+ if (assembly.assembly_id !== assemblyId)
30
+ throw new Error('The response did not match the requested Assembly');
31
+ if (assembly.error !== undefined || assembly.ok !== 'ASSEMBLY_COMPLETED')
32
+ throw new Error(`The Storage Assembly is not complete (${assembly.error ?? assembly.ok})`);
33
+ if (assembly.results === undefined)
34
+ throw new Error('The completed Assembly did not contain results');
35
+ const results = [];
36
+ for (const [step, files] of Object.entries(assembly.results)) {
37
+ for (const file of files) {
38
+ if (file.asset_id === undefined &&
39
+ file.version_id === undefined &&
40
+ file.workspace === undefined)
41
+ continue;
42
+ const parsed = resultSchema.safeParse(file);
43
+ if (!parsed.success || parsed.data.workspace !== workspace) {
44
+ throw new Error('The Assembly returned an invalid or cross-Workspace Storage result', {
45
+ cause: { assemblyId, step },
46
+ });
47
+ }
48
+ const { id, original_id, ...asset } = parsed.data;
49
+ results.push({ assembly_id: assemblyId, step, result_id: id, original_id, asset });
50
+ }
51
+ }
52
+ return results;
53
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transloadit/zod",
3
- "version": "5.0.0",
3
+ "version": "6.0.0",
4
4
  "description": "Transloadit Zod schemas",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -41,7 +41,7 @@
41
41
  "sync": "yarn sync:v3 && yarn sync:v4",
42
42
  "lint:ts": "yarn sync && ../../node_modules/.bin/tsc --build tsconfig.build.json",
43
43
  "test:types": "yarn sync && ../../node_modules/.bin/tsc --noEmit --project tsconfig.test.json",
44
- "test:unit": "yarn sync && node test/scripts-config.test.ts && node test/patch-ai-chat-schema.test.ts && node test/exports-sync.test.ts && node test/runtime-parity.test.ts",
44
+ "test:unit": "yarn sync && node test/scripts-config.test.ts && node test/patch-ai-chat-schema.test.ts && node test/exports-sync.test.ts && node test/runtime-parity.test.ts && node test/storage-results.test.ts",
45
45
  "build": "yarn sync && ../../node_modules/.bin/tsc --build tsconfig.build.json",
46
46
  "prepack": "yarn build",
47
47
  "check": "yarn sync && ../../node_modules/.bin/tsc --build tsconfig.build.json && ../../node_modules/.bin/tsc --noEmit --project tsconfig.test.json && yarn test:unit"
@@ -50,7 +50,7 @@
50
50
  "zod": "^4.4.3"
51
51
  },
52
52
  "devDependencies": {
53
- "@transloadit/types": "^5.0.0",
53
+ "@transloadit/types": "^6.0.0",
54
54
  "@types/node": "^25.8.0"
55
55
  }
56
56
  }