You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Controls the image compression for JPG and PNG images. Please also take a look at [🤖/image/optimize](/docs/transcoding/image-manipulation/image-optimize/).
Copy file name to clipboardExpand all lines: src/alphalib/types/robots/file-filter.ts
+40-1Lines changed: 40 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,46 @@ export const robotFileFilterInstructionsSchema = z
40
40
.boolean()
41
41
.optional()
42
42
.describe(`Whether the results of this Step should be present in the Assembly Status JSON`),
43
-
robot: z.literal('/file/filter'),
43
+
robot: z.literal('/file/filter').describe(`
44
+
Think of this <dfn>Robot</dfn> as an \`if/else\` condition for building advanced file conversion workflows. With it, you can filter and direct certain uploaded files depending on their metadata.
45
+
46
+
The <dfn>Robot</dfn> has two modes of operation:
47
+
48
+
- Constructing conditions out of arrays with 3 members each. For example, \`["\${file.size}", "<=", "720"]\`
49
+
- Writing conditions in JavaScript. For example, \`\${file.size <= 720}\`. See also [Dynamic Evaluation](/docs/topics/dynamic-evaluation/).
50
+
51
+
Passing JavaScript allows you to implement logic as complex as you wish, however it’s slower than combining arrays of conditions, and will be charged for per invocation via [🤖/script/run]({{robot_links["/script/run"]}}).
52
+
53
+
### Conditions as arrays
54
+
55
+
The \`accepts\` and \`declines\` parameters can each be set to an array of arrays with three members:
56
+
57
+
1. A value or job variable, such as \`\${file.mime}\`
58
+
2. One of the following operators: \`==\`, \`===\`, \`<\`, \`>\`, \`<=\`, \`>=\`, \`!=\`, \`!==\`, \`regex\`, \`!regex\`
59
+
3. A value or job variable, such as \`50\` or \`"foo"\`
**Warning:** If you would like to match against a \`null\` value or a value that is not present (like an audio file does not have a \`video_codec\` property in its metadata), match against \`""\` (an empty string) instead. We’ll support proper matching against \`null\` in the future, but we cannot easily do so right now without breaking backwards compatibility. [{.alert .alert-warning}]
69
+
70
+
### Conditions as JavaScript
71
+
72
+
The \`accepts\` and \`declines\` parameters can each be set to strings of JavaScript, which return a boolean value.
As indicated, we charge for this via [🤖/script/run]({{robot_links["/script/run"]}}). See also [Dynamic Evaluation](/docs/topics/dynamic-evaluation/) for more details on allowed syntax and behavior.
Copy file name to clipboardExpand all lines: src/alphalib/types/robots/file-virusscan.ts
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,13 @@ export const robotFileVirusscanInstructionsSchema = z
44
44
.boolean()
45
45
.optional()
46
46
.describe(`Whether the results of this Step should be present in the Assembly Status JSON`),
47
-
robot: z.literal('/file/virusscan'),
47
+
robot: z.literal('/file/virusscan').describe(`
48
+
This <dfn>Robot</dfn> is built on top of [ClamAV](https://www.clamav.net/), the best open source antivirus engine available. We update its signatures on a daily basis.
49
+
50
+
By default, this <dfn>Robot</dfn> excludes all malicious files from further processing without any additional notification. This behavior can be changed by setting \`error_on_decline\` to \`true\`, which will stop <dfn>Assemblies</dfn> as soon as malicious files are found. Such <dfn>Assemblies</dfn> will then be marked with an error.
51
+
52
+
We allow the use of industry standard [EICAR files](https://www.eicar.org/download-anti-malware-testfile/) for integration testing without needing to use potentially dangerous live virus samples.
Copy file name to clipboardExpand all lines: src/alphalib/types/robots/http-import.ts
+12-1Lines changed: 12 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,18 @@ export const robotHttpImportInstructionsSchema = z
38
38
.boolean()
39
39
.optional()
40
40
.describe(`Whether the results of this Step should be present in the Assembly Status JSON`),
41
-
robot: z.literal('/http/import'),
41
+
robot: z.literal('/http/import').describe(`
42
+
The result of this <dfn>Robot</dfn> will carry a field \`import_url\` in their metadata, which references the URL from which they were imported. Further conversion results that use this file will also carry this \`import_url\` field. This allows you to to match conversion results with the original import URL that you used.
43
+
44
+
This <dfn>Robot</dfn> knows to interpret links to files on these services:
45
+
46
+
- Dropbox
47
+
- Google Drive
48
+
- Google Docs
49
+
- OneDrive
50
+
51
+
Instead of downloading the HTML page previewing the file, the actual file itself will be imported.
Either the hexadecimal code or [name](https://www.imagemagick.org/script/color.php#color_names) of the color used to fill the background (only used for the pad resize strategy).
164
+
Either the hexadecimal code or [name](https://www.imagemagick.org/script/color.php#color_names) of the color used to fill the background (used for the \`pad\` resize strategy).
165
165
166
-
By default, the background of transparent images is changed to white. For details about how to preserve transparency across all image types, see [this demo](/demos/image-manipulation/properly-preserve-transparency-across-all-image-types/).
166
+
**Note:** By default, the background of transparent images is changed to white. To preserve transparency, set \`"background"\` to \`"none"\`.
Use this parameter when dealing with animated GIF files to specify which frame of the GIF is used for the operation. Specify \`1\` to use the first frame, \`2\` to use the second, and so on. \`null\` means all frames.
Copy file name to clipboardExpand all lines: src/alphalib/types/robots/s3-import.ts
+37-1Lines changed: 37 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,43 @@ export const robotS3ImportInstructionsSchema = z
49
49
.boolean()
50
50
.optional()
51
51
.describe(`Whether the results of this Step should be present in the Assembly Status JSON`),
52
-
robot: z.literal('/s3/import'),
52
+
robot: z.literal('/s3/import').describe(`
53
+
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/).
54
+
55
+
The URL to the result file in your S3 bucket will be returned in the <dfn>Assembly Status JSON</dfn>.
56
+
57
+
**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. [{.alert .alert-warning}]
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.
64
+
65
+
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).
The \`Sid\` value is just an identifier for you to recognize the rule later. You can name it anything you like.
82
+
83
+
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.
84
+
85
+
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.
86
+
87
+
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.
88
+
`),
53
89
ignore_errors,
54
90
credentials: credentials.describe(`
55
91
Please create your associated <dfn>Template Credentials</dfn> in your Transloadit account and use the name of your <dfn>Template Credentials</dfn> as this parameter's value. They will contain the values for your S3 bucket, Key, Secret and Bucket region.
0 commit comments