Skip to content

Commit

Permalink
Sync alphalib
Browse files Browse the repository at this point in the history
  • Loading branch information
kvz committed Dec 19, 2024
1 parent 30bcf0e commit 8a51ebc
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 25 deletions.
8 changes: 4 additions & 4 deletions src/alphalib/types/assemblyStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const assemblyStatusMetaSchema = z
z.object({
text: z.string(),
boundingPolygon: z.array(z.object({ x: z.number(), y: z.number() })),
})
}),
)
.optional(),
descriptions: z.array(z.string()).optional(),
Expand Down Expand Up @@ -117,7 +117,7 @@ const assemblyStatusMetaSchema = z
confidence: z.number().optional(),
width: z.number(),
height: z.number(),
})
}),
)
.nullable()
.optional(),
Expand Down Expand Up @@ -278,7 +278,7 @@ export const assemblyStatusSchema = z
offset: z.number(),
finished: z.boolean(),
upload_url: z.string(),
})
}),
)
.optional(),
update_stream_url: z.string().optional(),
Expand All @@ -289,7 +289,7 @@ export const assemblyStatusSchema = z
z.object({
level: z.literal('notice').or(z.literal('warning')),
msg: z.string(),
})
}),
),
websocket_url: z.string(),
uploads: assemblyStatusUploadsSchema,
Expand Down
2 changes: 1 addition & 1 deletion src/alphalib/types/robots/file-decompress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ For security reasons, archives that contain symlinks to outside the archived dir
ignore_errors: z
.union([z.boolean(), z.array(z.enum(['meta']))])
.transform((ignoreErrors): 'meta'[] =>
ignoreErrors === true ? ['meta'] : ignoreErrors === false ? [] : ignoreErrors
ignoreErrors === true ? ['meta'] : ignoreErrors === false ? [] : ignoreErrors,
)
.default([]).describe(`
A possible array member is only \`"meta"\`.
Expand Down
4 changes: 2 additions & 2 deletions src/alphalib/types/robots/file-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const robotFileFilterInstructionsSchema = z
use: useParamSchema,
accepts: z
.array(
z.union([z.string(), z.tuple([z.string(), z.string(), z.union([z.string(), z.number()])])])
z.union([z.string(), z.tuple([z.string(), z.string(), z.union([z.string(), z.number()])])]),
)
.default([]).describe(`
Files that match at least one requirement will be accepted, or declined otherwise. If the array is empty, all files will be accepted. Example:
Expand All @@ -55,7 +55,7 @@ If the \`condition_type\` parameter is set to \`"and"\`, then all requirements m
`),
declines: z
.array(
z.union([z.string(), z.tuple([z.string(), z.string(), z.union([z.string(), z.number()])])])
z.union([z.string(), z.tuple([z.string(), z.string(), z.union([z.string(), z.number()])])]),
)
.default([]).describe(`
Files that match at least one requirement will be declined, or accepted otherwise. Example:
Expand Down
4 changes: 2 additions & 2 deletions src/alphalib/types/robots/file-preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ Specifies whether the generated animated image should loop forever (\`true\`) or
export const robotFilePreviewInstructionsSchema =
robotFilePreviewInstructionsInterpolatedSchema.extend({
width: robotFilePreviewInstructionsInterpolatedSchema.shape.width.or(
interpolationSchemaToYieldNumber
interpolationSchemaToYieldNumber,
),
height: robotFilePreviewInstructionsInterpolatedSchema.shape.height.or(
interpolationSchemaToYieldNumber
interpolationSchemaToYieldNumber,
),
})

Expand Down
16 changes: 8 additions & 8 deletions src/alphalib/types/robots/image-resize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ Specifies gaussian blur, using a value with the form \`{radius}x{sigma}\`. The r
y: complexHeightSchema,
width: complexWidthSchema,
height: complexHeightSchema,
})
}),
)
.nullable()
.default(null).describe(`
Expand Down Expand Up @@ -264,7 +264,7 @@ Changes the hue by rotating the color of the image. The value \`100\` would prod
valign: z.enum(['bottom', 'center', 'top']).default('center'),
x_offset: z.number().int().default(0),
y_offset: z.number().int().default(0),
})
}),
)
.default([]).describe(`
An array of objects each containing text rules. The following text parameters are intended to be used as properties for your array of text overlays. Here is an example:
Expand Down Expand Up @@ -324,16 +324,16 @@ If your converted image is unsharp, please try increasing density.
export const robotImageResizeInstructionsSchema =
robotImageResizeInstructionsInterpolatedSchema.extend({
width: robotImageResizeInstructionsInterpolatedSchema.shape.width.or(
interpolationSchemaToYieldNumber
interpolationSchemaToYieldNumber,
),
height: robotImageResizeInstructionsInterpolatedSchema.shape.height.or(
interpolationSchemaToYieldNumber
interpolationSchemaToYieldNumber,
),
background: robotImageResizeInstructionsInterpolatedSchema.shape.background.or(
interpolationSchemaToYieldString
interpolationSchemaToYieldString,
),
resize_strategy: robotImageResizeInstructionsInterpolatedSchema.shape.resize_strategy.or(
interpolationSchemaToYieldString
interpolationSchemaToYieldString,
),
blur_regions: robotImageResizeInstructionsInterpolatedSchema.shape.blur_regions.or(
z.array(
Expand All @@ -342,8 +342,8 @@ export const robotImageResizeInstructionsSchema =
y: complexHeightSchema.or(interpolationSchemaToYieldNumber),
width: complexWidthSchema.or(interpolationSchemaToYieldNumber),
height: complexHeightSchema.or(interpolationSchemaToYieldNumber),
})
)
}),
),
),
})

Expand Down
8 changes: 4 additions & 4 deletions src/alphalib/types/robots/video-encode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,16 +230,16 @@ The name used for the final segment. Available variables are \`\${segment_prefix
export const robotVideoEncodeInstructionsSchema =
robotVideoEncodeInstructionsInterpolatedSchema.extend({
width: robotVideoEncodeInstructionsInterpolatedSchema.shape.width.or(
interpolationSchemaToYieldNumber
interpolationSchemaToYieldNumber,
),
height: robotVideoEncodeInstructionsInterpolatedSchema.shape.height.or(
interpolationSchemaToYieldNumber
interpolationSchemaToYieldNumber,
),
background: robotVideoEncodeInstructionsInterpolatedSchema.shape.background.or(
interpolationSchemaToYieldString
interpolationSchemaToYieldString,
),
resize_strategy: robotVideoEncodeInstructionsInterpolatedSchema.shape.resize_strategy.or(
interpolationSchemaToYieldString
interpolationSchemaToYieldString,
),
})

Expand Down
8 changes: 4 additions & 4 deletions src/alphalib/types/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,25 @@ export const assemblyInstructionsSchema = z.object({
.boolean()
.optional()
.describe(
'Set this to false to disallow Overruling Templates at Runtime. If you set this to false then template_id and steps will be mutually exclusive and you may only supply one of those parameters. Recommended when deploying Transloadit in untrusted environments. This makes sense to set as part of a Template, rather than on the Assembly itself when creating it.'
'Set this to false to disallow Overruling Templates at Runtime. If you set this to false then template_id and steps will be mutually exclusive and you may only supply one of those parameters. Recommended when deploying Transloadit in untrusted environments. This makes sense to set as part of a Template, rather than on the Assembly itself when creating it.',
),
notify_url: z
.string()
.optional()
.describe(
'Transloadit can send a Pingback to your server when the Assembly is completed. We’ll send the Assembly status in a form url-encoded JSON string inside of a transloadit field in a multipart POST request to the URL supplied here.'
'Transloadit can send a Pingback to your server when the Assembly is completed. We’ll send the Assembly status in a form url-encoded JSON string inside of a transloadit field in a multipart POST request to the URL supplied here.',
),
fields: z
.record(z.union([z.number(), z.string()]))
.optional()
.describe(
'An object of string to string pairs (name -> value) that can be used as Assembly Variables, just like additional form fields can.'
'An object of string to string pairs (name -> value) that can be used as Assembly Variables, just like additional form fields can.',
),
quite: z
.boolean()
.optional()
.describe(
'Set this to true to reduce the response from an Assembly POST request to only the necessary fields. This prevents any potentially confidential information being leaked to the end user who is making the Assembly request. A successful Assembly will only include the ok and assembly_id fields. An erroneous Assembly will only include the error, http_code, message and assembly_id fields. The full Assembly Status will then still be sent to the notify_url if one was specified.'
'Set this to true to reduce the response from an Assembly POST request to only the necessary fields. This prevents any potentially confidential information being leaked to the end user who is making the Assembly request. A successful Assembly will only include the ok and assembly_id fields. An erroneous Assembly will only include the error, http_code, message and assembly_id fields. The full Assembly Status will then still be sent to the notify_url if one was specified.',
),
steps: stepsSchema.optional(),
template_id: z.string().optional().describe('The Template ID to use'),
Expand Down

0 comments on commit 8a51ebc

Please sign in to comment.