@transloadit/node 4.1.3 → 4.1.4

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.
@@ -76,7 +76,7 @@ export declare const templateCredentialsSchema: z.ZodObject<{
76
76
  max_size?: number | undefined;
77
77
  nonce?: string | undefined;
78
78
  };
79
- type: "http" | "google" | "cloudflare" | "ai" | "vimeo" | "azure" | "backblaze" | "companion" | "digitalocean" | "dropbox" | "ftp" | "minio" | "rackspace" | "s3" | "sftp" | "supabase" | "swift" | "tigris" | "wasabi" | "youtube";
79
+ type: "http" | "cloudflare" | "ai" | "vimeo" | "azure" | "backblaze" | "companion" | "digitalocean" | "dropbox" | "ftp" | "google" | "minio" | "rackspace" | "s3" | "sftp" | "supabase" | "swift" | "tigris" | "wasabi" | "youtube";
80
80
  name: string;
81
81
  content: {};
82
82
  }, {
@@ -88,7 +88,7 @@ export declare const templateCredentialsSchema: z.ZodObject<{
88
88
  max_size?: number | undefined;
89
89
  nonce?: string | undefined;
90
90
  };
91
- type: "http" | "google" | "cloudflare" | "ai" | "vimeo" | "azure" | "backblaze" | "companion" | "digitalocean" | "dropbox" | "ftp" | "minio" | "rackspace" | "s3" | "sftp" | "supabase" | "swift" | "tigris" | "wasabi" | "youtube";
91
+ type: "http" | "cloudflare" | "ai" | "vimeo" | "azure" | "backblaze" | "companion" | "digitalocean" | "dropbox" | "ftp" | "google" | "minio" | "rackspace" | "s3" | "sftp" | "supabase" | "swift" | "tigris" | "wasabi" | "youtube";
92
92
  name: string;
93
93
  content: {};
94
94
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transloadit/node",
3
- "version": "4.1.3",
3
+ "version": "4.1.4",
4
4
  "description": "Node.js SDK for Transloadit",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -50,6 +50,7 @@ export const assemblyStatusErrCodeSchema = z.enum([
50
50
  'ASSEMBLY_STEP_NO_ROBOT',
51
51
  'ASSEMBLY_STEP_UNKNOWN_ROBOT',
52
52
  'ASSEMBLY_STEP_UNKNOWN_USE',
53
+ 'AI_CHAT_VALIDATION',
53
54
  'ASSEMBLY_URL_TRANSFORM_MISSING',
54
55
  'AUTH_EXPIRED',
55
56
  'AUTH_KEY_SCOPES_NOT_FOUND',
@@ -141,39 +141,6 @@ export const meta: RobotMetaInput = {
141
141
  stage: 'alpha',
142
142
  }
143
143
 
144
- export const vendorModelSchema = z
145
- .string()
146
- .regex(/^[a-z]+\/[a-z0-9.-]+$/, 'Must be in format "vendor/model"')
147
- .refine(
148
- (val) => {
149
- const [vendor, model] = val.split('/')
150
- if (vendor === 'anthropic') {
151
- return model === 'claude-4-sonnet-20250514' || model === 'claude-4-opus-20250514'
152
- }
153
- if (vendor === 'openai') {
154
- return (
155
- model === 'gpt-4.1-2025-04-14' ||
156
- model === 'chatgpt-4o-latest' ||
157
- model === 'o3-2025-04-16' ||
158
- model === 'gpt-4o-audio-preview'
159
- )
160
- }
161
- if (vendor === 'google') {
162
- return model === 'gemini-2.5-pro'
163
- }
164
- if (vendor === 'moonshot') {
165
- return model === 'kimi-k2'
166
- }
167
- return false
168
- },
169
- {
170
- message:
171
- 'Invalid vendor/model combination. Supported: anthropic/claude-4-sonnet-20250514, anthropic/claude-4-opus-20250514, openai/gpt-4.1-2025-04-14, openai/chatgpt-4o-latest, openai/o3-2025-04-16, openai/gpt-4o-audio-preview, google/gemini-2.5-pro, moonshot/kimi-k2',
172
- },
173
- )
174
-
175
- export type VendorModel = z.infer<typeof vendorModelSchema>
176
-
177
144
  /**
178
145
  * Model capabilities for /ai/chat. This centralizes which models support which input types.
179
146
  * Key format: 'vendor/model'
@@ -181,14 +148,31 @@ export type VendorModel = z.infer<typeof vendorModelSchema>
181
148
  export const MODEL_CAPABILITIES: Record<string, { pdf: boolean; image: boolean }> = {
182
149
  'anthropic/claude-4-sonnet-20250514': { pdf: true, image: true },
183
150
  'anthropic/claude-4-opus-20250514': { pdf: true, image: true },
184
- 'google/gemini-2.5-pro': { pdf: true, image: true },
151
+ 'anthropic/claude-sonnet-4-5': { pdf: true, image: true },
152
+ 'anthropic/claude-opus-4-5': { pdf: true, image: true },
185
153
  'openai/gpt-4.1-2025-04-14': { pdf: false, image: true },
186
154
  'openai/chatgpt-4o-latest': { pdf: false, image: true },
187
155
  'openai/o3-2025-04-16': { pdf: false, image: true },
188
156
  'openai/gpt-4o-audio-preview': { pdf: false, image: false },
157
+ 'openai/gpt-5.2': { pdf: false, image: true },
158
+ 'openai/gpt-5.2-2025-12-11': { pdf: false, image: true },
159
+ 'openai/gpt-5.2-chat-latest': { pdf: false, image: true },
160
+ 'openai/gpt-5.2-pro': { pdf: false, image: true },
161
+ 'google/gemini-2.5-pro': { pdf: true, image: true },
189
162
  'moonshot/kimi-k2': { pdf: false, image: false },
190
163
  }
191
164
 
165
+ const supportedModelsList = Object.keys(MODEL_CAPABILITIES)
166
+
167
+ export const vendorModelSchema = z
168
+ .string()
169
+ .regex(/^[a-z]+\/[a-z0-9.-]+$/, 'Must be in format "vendor/model"')
170
+ .refine((val) => Object.hasOwn(MODEL_CAPABILITIES, val), {
171
+ message: `Invalid vendor/model combination. Supported: ${supportedModelsList.join(', ')}`,
172
+ })
173
+
174
+ export type VendorModel = z.infer<typeof vendorModelSchema>
175
+
192
176
  export const robotAiChatInstructionsSchema = robotBase
193
177
  .merge(robotUse)
194
178
  .extend({
@@ -214,6 +198,10 @@ export const robotAiChatInstructionsSchema = robotBase
214
198
  .union([z.string(), z.array(z.string())])
215
199
  .optional()
216
200
  .describe('Names of template credentials to make available to the robot.'),
201
+ test_credentials: z
202
+ .boolean()
203
+ .optional()
204
+ .describe('Use Transloadit-provided credentials for testing.'),
217
205
  mcp_servers: z
218
206
  .array(
219
207
  z.object({
@@ -67,7 +67,7 @@ Passing JavaScript allows you to implement logic as complex as you wish, however
67
67
  The \`accepts\` and \`declines\` parameters can each be set to an array of arrays with three members:
68
68
 
69
69
  1. A value or job variable, such as \`\${file.mime}\`
70
- 2. One of the following operators: \`==\`, \`===\`, \`<\`, \`>\`, \`<=\`, \`>=\`, \`!=\`, \`!==\`, \`regex\`, \`!regex\`
70
+ 2. One of the following operators: \`==\`, \`===\`, \`<\`, \`>\`, \`<=\`, \`>=\`, \`!=\`, \`!==\`, \`regex\`, \`!regex\`, \`includes\`, \`!includes\`
71
71
  3. A value or job variable, such as \`50\` or \`"foo"\`
72
72
 
73
73
  Examples:
@@ -77,6 +77,8 @@ Examples:
77
77
  - \`[["720", ">=", "\${file.size}"]]\`
78
78
  - \`[["\${file.mime}", "regex", "image"]]\`
79
79
 
80
+ The \`includes\` and \`!includes\` operators work with arrays or strings (strings use substring checks).
81
+
80
82
  > [!Warning]
81
83
  > 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.
82
84