diff --git a/src/alphalib/types/robots/_instructions-primitives.ts b/src/alphalib/types/robots/_instructions-primitives.ts index c338d3b9..f2a44b6e 100644 --- a/src/alphalib/types/robots/_instructions-primitives.ts +++ b/src/alphalib/types/robots/_instructions-primitives.ts @@ -323,7 +323,9 @@ export function interpolateRecursive( def, ) as InterpolatableSchema case z.ZodFirstPartyTypeKind.ZodNullable: - return interpolateRecursive(def.innerType).nullable() as InterpolatableSchema + return interpolateRecursive(def.innerType) + .nullable() + .describe(def.description) as InterpolatableSchema case z.ZodFirstPartyTypeKind.ZodObject: { const replacement = z.object( Object.fromEntries( @@ -354,7 +356,7 @@ export function interpolateRecursive( case z.ZodFirstPartyTypeKind.ZodString: return z.union([interpolationSchemaPartial, schema], def) as InterpolatableSchema case z.ZodFirstPartyTypeKind.ZodTuple: { - const tuple = z.tuple(def.items.map(interpolateRecursive)) + const tuple = z.tuple(def.items.map(interpolateRecursive), def) return z.union([ interpolationSchemaFull, @@ -362,10 +364,10 @@ export function interpolateRecursive( ]) as InterpolatableSchema } case z.ZodFirstPartyTypeKind.ZodUnion: - return z.union([ - interpolationSchemaFull, - ...(def.options.map(interpolateRecursive) as z.ZodUnionOptions), - ]) as InterpolatableSchema + return z.union( + [interpolationSchemaFull, ...(def.options.map(interpolateRecursive) as z.ZodUnionOptions)], + def, + ) as InterpolatableSchema default: return schema as InterpolatableSchema } @@ -438,14 +440,14 @@ You can also set this to \`false\` to skip metadata extraction and speed up tran `Setting the queue to 'batch', manually downgrades the priority of jobs for this step to avoid consuming Priority job slots for jobs that don't need zero queue waiting times`, ), - force_accept: z.boolean().default(false).describe(` - Force a Robot to accept a file type it would have ignored. + force_accept: z.boolean().default(false) + .describe(`Force a Robot to accept a file type it would have ignored. -By default Robots ignore files they are not familiar with. -[🤖/video/encode](https://transloadit.com/docs/robots/video-encode/), for +By default, Robots ignore files they are not familiar with. +[🤖/video/encode](/docs/robots/video-encode/), for example, will happily ignore input images. -With the force_accept parameter set to true you can force Robots to accept all files thrown at them. +With the \`force_accept\` parameter set to \`true\`, you can force Robots to accept all files thrown at them. This will typically lead to errors and should only be used for debugging or combatting edge cases. `), }) @@ -1167,9 +1169,9 @@ Go back to your Google credentials project and enable the "Google Cloud Storage Now you can set up the \`storage.objects.create\` and \`storage.objects.delete\` permissions. The latter is optional and only required if you intend to overwrite existing paths. -To do this from the Google Cloud console, navigate to "IAM & Admin" and select "Roles". From here, select "+CREATE ROLE", enter a name, set the role launch stage as general availability and set the permissions stated above. +To do this from the Google Cloud console, navigate to "IAM & Admin" and select "Roles". From here, click "Create Role", enter a name, set the role launch stage to _General availability,_ and set the permissions stated above. -Next, relocate to your storage browser and select the ellipsis on your bucket to edit bucket permissions. From here, select "ADD MEMBER", enter your service account as a new member and select your newly created role. +Next, go to Storage browser and select the ellipsis on your bucket to edit bucket permissions. From here, select "Add Member", enter your service account as a new member, and select your newly created role. Then, create your associated [Template Credentials](/c/template-credentials/) in your Transloadit account and use the name of your Template Credentials as this parameter's value. `), @@ -1348,10 +1350,10 @@ export const filterCondition = z.union([ export const videoEncodeSpecificInstructionsSchema = robotFFmpegVideo .extend({ resize_strategy: resize_strategy.describe(` -See the [available resize strategies](/docs/robots/image-resize/#resize-strategies). +See the [available resize strategies](/docs/topics/resize-strategies/). `), zoom: z.boolean().default(true).describe(` -If this is set to \`false\`, smaller videos will not be stretched to the desired width and height. For details about the impact of zooming for your preferred resize strategy, see the list of available [resize strategies](/docs/robots/image-resize/#resize-strategies). +If this is set to \`false\`, smaller videos will not be stretched to the desired width and height. For details about the impact of zooming for your preferred resize strategy, see the list of available [resize strategies](/docs/topics/resize-strategies/). `), crop: unsafeCoordinatesSchema.optional().describe(` Specify an object containing coordinates for the top left and bottom right corners of the rectangle to be cropped from the original video(s). Values can be integers for absolute pixel values or strings for percentage based values. @@ -1359,19 +1361,21 @@ Specify an object containing coordinates for the top left and bottom right corne For example: \`\`\`json - { "x1": 80, "y1": 100, "x2": "60%", "y2": "80%" } - \`\`\` This will crop the area from \`(80, 100)\` to \`(600, 800)\` from a 1000×1000 pixels video, 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. -You can also use a JSON string of such an object with coordinates in similar fashion: \`"{ "x1": , "y1": , "x2": , "y2": }"\` +You can also use a JSON string of such an object with coordinates in similar fashion: + +\`\`\`json +"{\\"x1\\": , \\"y1\\": , \\"x2\\": , \\"y2\\": }" +\`\`\` `), background: color_with_alpha.default('#00000000').describe(` The background color of the resulting video the \`"rrggbbaa"\` format (red, green, blue, alpha) when used with the \`"pad"\` resize strategy. The default color is black. @@ -1400,7 +1404,7 @@ Splits the video into multiple chunks so that each chunk can be encoded in paral Allows you to specify the duration of each chunk when \`turbo\` is set to \`true\`. This means you can take advantage of that feature while using fewer Priority Job Slots. For instance, the longer each chunk is, the fewer Encoding Jobs will need to be used. `), watermark_url: z.string().default('').describe(` -A URL indicating a PNG image to be overlaid above this image. You can also [supply the watermark via another Assembly Step](/docs/robots/video-encode/#watermark-parameters-video-encode). +A URL indicating a PNG image to be overlaid above this image. You can also [supply the watermark via another Assembly Step](/docs/topics/use-parameter/#supplying-the-watermark-via-an-assembly-step). `), watermark_position: z.union([positionSchema, z.array(positionSchema)]).default('center') .describe(` diff --git a/src/alphalib/types/robots/document-split.ts b/src/alphalib/types/robots/document-split.ts index d1551dcb..41d9b9bc 100644 --- a/src/alphalib/types/robots/document-split.ts +++ b/src/alphalib/types/robots/document-split.ts @@ -38,8 +38,9 @@ export const robotDocumentSplitInstructionsSchema = robotBase pages: z .union([z.string(), z.array(z.string())]) .describe( - 'The pages to select from the input PDF and to be included in the output PDF. Each entry can be a single page number (e.g. 5), or a range (e.g. `5-10`). Page numbers start at 1.', - ), + 'The pages to select from the input PDF and to be included in the output PDF. Each entry can be a single page number (e.g. 5), or a range (e.g. `5-10`). Page numbers start at 1. By default all pages are extracted.', + ) + .optional(), }) .strict() diff --git a/src/alphalib/types/robots/document-thumbs.ts b/src/alphalib/types/robots/document-thumbs.ts index 7667ba88..d0e22266 100644 --- a/src/alphalib/types/robots/document-thumbs.ts +++ b/src/alphalib/types/robots/document-thumbs.ts @@ -81,7 +81,7 @@ Height of the new image, in pixels. If not specified, will default to the height `), resize_strategy: z.enum(['crop', 'fillcrop', 'fit', 'min_fit', 'pad', 'stretch']).default('pad') .describe(` -One of the [available resize strategies](/docs/robots/image-resize/#resize-strategies). +One of the [available resize strategies](/docs/topics/resize-strategies/). `), // TODO: Determine the allowed colors background: z.string().default('#FFFFFF').describe(` diff --git a/src/alphalib/types/robots/file-preview.ts b/src/alphalib/types/robots/file-preview.ts index 681a5910..0a6bde5a 100644 --- a/src/alphalib/types/robots/file-preview.ts +++ b/src/alphalib/types/robots/file-preview.ts @@ -75,7 +75,7 @@ Height of the thumbnail, in pixels. resize_strategy: resize_strategy.describe(` To achieve the desired dimensions of the preview thumbnail, the Robot might have to resize the generated image. This happens, for example, when the dimensions of a frame extracted from a video do not match the chosen \`width\` and \`height\` parameters. -See the list of available [resize strategies](/docs/robots/image-resize/#resize-strategies) for more details. +See the list of available [resize strategies](/docs/topics/resize-strategies/) for more details. `), background: color_with_alpha.default('#ffffffff').describe(` The hexadecimal code of the color used to fill the background (only used for the pad resize strategy). The format is \`#rrggbb[aa]\` (red, green, blue, alpha). Use \`#00000000\` for a transparent padding. diff --git a/src/alphalib/types/robots/google-store.ts b/src/alphalib/types/robots/google-store.ts index dd2e3c4a..900ef36c 100644 --- a/src/alphalib/types/robots/google-store.ts +++ b/src/alphalib/types/robots/google-store.ts @@ -59,9 +59,9 @@ Go back to your Google credentials project and enable the "Google Cloud Storage Now you can set up the \`storage.objects.create\` and \`storage.objects.delete\` permissions. The latter is optional and only required if you intend to overwrite existing paths. -To do this from the Google Cloud console, navigate to "IAM & Admin" and select "Roles". From here, select "+CREATE ROLE", enter a name, set the role launch stage as general availability and set the permissions stated above. +To do this from the Google Cloud console, navigate to "IAM & Admin" and select "Roles". From here, click "Create Role", enter a name, set the role launch stage to _General availability,_ and set the permissions stated above. -Next, relocate to your storage browser and select the ellipsis on your bucket to edit bucket permissions. From here, select "ADD MEMBER", enter your service account as a new member and select your newly created role. +Next, go to Storage browser and select the ellipsis on your bucket to edit bucket permissions. From here, select "Add Member", enter your service account as a new member, and select your newly created role. Then, create your associated [Template Credentials](/c/template-credentials/) in your Transloadit account and use the name of your Template Credentials as this parameter's value. `), diff --git a/src/alphalib/types/robots/image-resize.ts b/src/alphalib/types/robots/image-resize.ts index d52bb182..46d17b2d 100644 --- a/src/alphalib/types/robots/image-resize.ts +++ b/src/alphalib/types/robots/image-resize.ts @@ -105,10 +105,10 @@ In this example, the background color is determined by the [Assembly Variable](h ), ]) .default('fit').describe(` -See the list of available [resize strategies](/docs/robots/image-resize/#resize-strategies). +See the list of available [resize strategies](/docs/topics/resize-strategies/). `), zoom: z.boolean().default(true).describe(` -If this is set to \`false\`, smaller images will not be stretched to the desired width and height. For details about the impact of zooming for your preferred resize strategy, see the list of available [resize strategies](/docs/robots/image-resize/#resize-strategies). +If this is set to \`false\`, smaller images will not be stretched to the desired width and height. For details about the impact of zooming for your preferred resize strategy, see the list of available [resize strategies](/docs/topics/resize-strategies/). `), crop: unsafeCoordinatesSchema.optional().describe(` Specify an object containing coordinates for the top left and bottom right corners of the rectangle to be cropped from the original image(s). The coordinate system is rooted in the top left corner of the image. Values can be integers for absolute pixel values or strings for percentage based values. @@ -129,7 +129,7 @@ This will crop the area from \`(80, 100)\` to \`(600, 800)\` from a 1000×1000 p You can also use a JSON string of such an object with coordinates in similar fashion: \`\`\`json -"{"x1": , "y1": , "x2": , "y2": }" +"{\\"x1\\": , \\"y1\\": , \\"x2\\": , \\"y2\\": }" \`\`\` To crop around human faces, see [🤖/image/facedetect](/docs/robots/image-facedetect/). @@ -265,7 +265,7 @@ Increases or decreases the saturation of the image by using a multiplier. For ex Changes the hue by rotating the color of the image. The value \`100\` would produce no change whereas \`0\` and \`200\` will negate the colors in the image. `), watermark_url: z.string().optional().describe(` -A URL indicating a PNG image to be overlaid above this image. Please note that you can also [supply the watermark via another Assembly Step](/docs/robots/image-resize/#image-resize-supply-watermark-via-assembly-step). With watermarking you can add an image onto another image. This is usually used for logos. +A URL indicating a PNG image to be overlaid above this image. Please note that you can also [supply the watermark via another Assembly Step](/docs/topics/use-parameter/#supplying-the-watermark-via-an-assembly-step). With watermarking you can add an image onto another image. This is usually used for logos. `), watermark_position: z.union([positionSchema, z.array(positionSchema)]).default('center') .describe(` diff --git a/src/alphalib/types/robots/tus-store.ts b/src/alphalib/types/robots/tus-store.ts index ce579655..aa92a0c2 100644 --- a/src/alphalib/types/robots/tus-store.ts +++ b/src/alphalib/types/robots/tus-store.ts @@ -59,7 +59,7 @@ To change the \`title\` or \`description\` per video, we recommend to [inject va The URL of the Tus-compatible server, which you're uploading files to. `), credentials: z.string().optional().describe(` -Create Template Credentials for this Robot in your [Transloadit account]({{site.base_url}}/c/template-credentials/) and use the name of the Template Credentials as this parameter's value. For this Robot, use the HTTP template, which allows request headers to be passed along to the destination server. +Create Template Credentials for this Robot in your [Transloadit account](/c/template-credentials/) and use the name of the Template Credentials as this parameter's value. For this Robot, use the HTTP template, which allows request headers to be passed along to the destination server. `), headers: z.record(z.string()).default({}).describe('Headers to pass along to destination') .describe(` diff --git a/src/alphalib/types/robots/video-merge.ts b/src/alphalib/types/robots/video-merge.ts index 121b4a12..2a6b6b61 100644 --- a/src/alphalib/types/robots/video-merge.ts +++ b/src/alphalib/types/robots/video-merge.ts @@ -44,7 +44,7 @@ export const robotVideoMergeInstructionsSchema = robotBase .extend({ robot: z.literal('/video/merge'), resize_strategy: resize_strategy.describe(` -If the given width/height parameters are bigger than the input image's dimensions, then the \`resize_strategy\` determines how the image will be resized to match the provided width/height. See the [available resize strategies](/docs/robots/image-resize/#resize-strategies). +If the given width/height parameters are bigger than the input image's dimensions, then the \`resize_strategy\` determines how the image will be resized to match the provided width/height. See the [available resize strategies](/docs/topics/resize-strategies/). `), background: color_with_alpha.default('#00000000').describe(` The background color of the resulting video the \`"rrggbbaa"\` format (red, green, blue, alpha) when used with the \`"pad"\` resize strategy. The default color is black. diff --git a/src/alphalib/types/robots/video-thumbs.ts b/src/alphalib/types/robots/video-thumbs.ts index 3c10ca5b..362e899b 100644 --- a/src/alphalib/types/robots/video-thumbs.ts +++ b/src/alphalib/types/robots/video-thumbs.ts @@ -80,7 +80,7 @@ The width of the thumbnail, in pixels. Defaults to the original width of the vid The height of the thumbnail, in pixels. Defaults to the original height of the video. `), resize_strategy: resize_strategy.describe(` -One of the [available resize strategies](/docs/robots/image-resize/#resize-strategies). +One of the [available resize strategies](/docs/topics/resize-strategies/). `), background: color_with_alpha.default('#00000000').describe(` The background color of the resulting thumbnails in the \`"rrggbbaa"\` format (red, green, blue, alpha) when used with the \`"pad"\` resize strategy. The default color is black.