transloadit 5.2.0 → 6.0.1
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.
- package/dist/Transloadit.d.ts +1 -1
- package/dist/Transloadit.d.ts.map +1 -1
- package/dist/Transloadit.js +1 -0
- package/dist/Transloadit.js.map +1 -1
- package/dist/alphalib/aiMessages.d.ts +1 -1
- package/dist/alphalib/aiMessages.d.ts.map +1 -1
- package/dist/alphalib/aiMessages.js +1 -1
- package/dist/alphalib/aiMessages.js.map +1 -1
- package/dist/alphalib/types/assemblyStatus.d.ts +682 -682
- package/dist/alphalib/types/assemblyStatus.d.ts.map +1 -1
- package/dist/alphalib/types/assemblyStatus.js +23 -14
- package/dist/alphalib/types/assemblyStatus.js.map +1 -1
- package/dist/alphalib/types/robots/_ai-models.d.ts.map +1 -1
- package/dist/alphalib/types/robots/_ai-models.js +2 -0
- package/dist/alphalib/types/robots/_ai-models.js.map +1 -1
- package/dist/alphalib/types/robots/_google-image-seed.d.ts +8 -0
- package/dist/alphalib/types/robots/_google-image-seed.d.ts.map +1 -0
- package/dist/alphalib/types/robots/_google-image-seed.js +12 -0
- package/dist/alphalib/types/robots/_google-image-seed.js.map +1 -0
- package/dist/alphalib/types/robots/_instructions-primitives.d.ts +2 -0
- package/dist/alphalib/types/robots/_instructions-primitives.d.ts.map +1 -1
- package/dist/alphalib/types/robots/_instructions-primitives.js +11 -14
- package/dist/alphalib/types/robots/_instructions-primitives.js.map +1 -1
- package/dist/alphalib/types/robots/ai-chat.d.ts +1 -1
- package/dist/alphalib/types/robots/ai-chat.d.ts.map +1 -1
- package/dist/alphalib/types/robots/ai-chat.js.map +1 -1
- package/dist/alphalib/types/robots/google-import.d.ts +4 -6
- package/dist/alphalib/types/robots/google-import.d.ts.map +1 -1
- package/dist/alphalib/types/robots/google-import.js +5 -2
- package/dist/alphalib/types/robots/google-import.js.map +1 -1
- package/dist/alphalib/types/robots/google-store.d.ts.map +1 -1
- package/dist/alphalib/types/robots/google-store.js +5 -13
- package/dist/alphalib/types/robots/google-store.js.map +1 -1
- package/dist/alphalib/types/robots/http-import.d.ts.map +1 -1
- package/dist/alphalib/types/robots/http-import.js +4 -0
- package/dist/alphalib/types/robots/http-import.js.map +1 -1
- package/dist/alphalib/types/robots/image-generate.d.ts.map +1 -1
- package/dist/alphalib/types/robots/image-generate.js +6 -1
- package/dist/alphalib/types/robots/image-generate.js.map +1 -1
- package/dist/alphalib/types/robots/image-resize.d.ts +4 -0
- package/dist/alphalib/types/robots/image-resize.d.ts.map +1 -1
- package/dist/alphalib/types/robots/image-resize.js +34 -6
- package/dist/alphalib/types/robots/image-resize.js.map +1 -1
- package/dist/alphalib/types/robots/s3-store.d.ts.map +1 -1
- package/dist/alphalib/types/robots/s3-store.js +21 -17
- package/dist/alphalib/types/robots/s3-store.js.map +1 -1
- package/dist/alphalib/types/robots/video-thumbs.d.ts +6 -0
- package/dist/alphalib/types/robots/video-thumbs.d.ts.map +1 -1
- package/dist/alphalib/types/robots/video-thumbs.js +15 -5
- package/dist/alphalib/types/robots/video-thumbs.js.map +1 -1
- package/dist/alphalib/zodParseWithContext.d.ts +1 -1
- package/dist/alphalib/zodParseWithContext.d.ts.map +1 -1
- package/dist/bearerToken.d.ts +2 -0
- package/dist/bearerToken.d.ts.map +1 -1
- package/dist/bearerToken.js +2 -0
- package/dist/bearerToken.js.map +1 -1
- package/package.json +1 -1
- package/src/Transloadit.ts +2 -1
- package/src/alphalib/aiMessages.ts +1 -1
- package/src/alphalib/types/assemblyStatus.ts +24 -14
- package/src/alphalib/types/robots/_ai-models.ts +2 -0
- package/src/alphalib/types/robots/_google-image-seed.ts +14 -0
- package/src/alphalib/types/robots/_instructions-primitives.ts +13 -15
- package/src/alphalib/types/robots/ai-chat.ts +6 -7
- package/src/alphalib/types/robots/google-import.ts +7 -1
- package/src/alphalib/types/robots/google-store.ts +6 -11
- package/src/alphalib/types/robots/http-import.ts +4 -0
- package/src/alphalib/types/robots/image-generate.ts +8 -1
- package/src/alphalib/types/robots/image-resize.ts +36 -6
- package/src/alphalib/types/robots/s3-store.ts +21 -17
- package/src/alphalib/types/robots/video-thumbs.ts +19 -5
- package/src/alphalib/zodParseWithContext.ts +1 -1
- package/src/bearerToken.ts +5 -0
package/dist/bearerToken.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export type BearerTokenResponse = {
|
|
|
7
7
|
};
|
|
8
8
|
export type MintBearerTokenOptions = {
|
|
9
9
|
allowProcessEnvEndpointFallback?: boolean;
|
|
10
|
+
/** Client identity reported in the Transloadit-Client header. */
|
|
11
|
+
clientName?: string;
|
|
10
12
|
endpoint?: string;
|
|
11
13
|
aud?: BearerTokenAudience | string;
|
|
12
14
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bearerToken.d.ts","sourceRoot":"","sources":["../src/bearerToken.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bearerToken.d.ts","sourceRoot":"","sources":["../src/bearerToken.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAEhE,MAAM,MAAM,mBAAmB,GAAG;IAChC,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,QAAQ,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,+BAA+B,CAAC,EAAE,OAAO,CAAA;IACzC,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,GAAG,CAAC,EAAE,mBAAmB,GAAG,MAAM,CAAA;IAClC;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,qBAAqB,GAC7B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,mBAAmB,CAAA;CAAE,GACpD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAkGhC,wBAAsB,8BAA8B,CAClD,WAAW,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,EACpD,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,qBAAqB,CAAC,CA4FhC"}
|
package/dist/bearerToken.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import packageJson from '../package.json' with { type: 'json' };
|
|
2
3
|
const tokenErrorSchema = z
|
|
3
4
|
.object({
|
|
4
5
|
error: z.string(),
|
|
@@ -102,6 +103,7 @@ export async function mintBearerTokenWithCredentials(credentials, options = {})
|
|
|
102
103
|
Authorization: buildBasicAuthHeaderValue(credentials),
|
|
103
104
|
Accept: 'application/json',
|
|
104
105
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
106
|
+
'Transloadit-Client': options.clientName?.trim() || `node-sdk:${packageJson.version}`,
|
|
105
107
|
},
|
|
106
108
|
body: params.toString(),
|
|
107
109
|
});
|
package/dist/bearerToken.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bearerToken.js","sourceRoot":"","sources":["../src/bearerToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"bearerToken.js","sourceRoot":"","sources":["../src/bearerToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,WAAW,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AA8B/D,MAAM,gB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AI;YACd,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,IAAI,QAAQ;SAC/C,CAAA;QACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IACzC,CAAC;IAED,MAAM,WAAW,GAAG,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;IAC1D,IAAI,WAAW,CAAC,OAAO,EAAE,CAAC;QACxB,OAAO;YACL,EAAE,EAAE,KAAK;YACT,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,OAAO;gBAC7B,CAAC,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,KAAK,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE;gBAC1D,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK;SAC3B,CAAA;IACH,CAAC;IAED,OAAO;QACL,EAAE,EAAE,KAAK;QACT,KAAK,EAAE,yBAAyB,GAAG,CAAC,MAAM,MAAM,OAAO,IAAI,GAAG,CAAC,UAAU,EAAE;KAC5E,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
package/src/Transloadit.ts
CHANGED
|
@@ -900,7 +900,7 @@ export class Transloadit {
|
|
|
900
900
|
* If `scope` is omitted, the token inherits the auth key's scope.
|
|
901
901
|
*/
|
|
902
902
|
async mintBearerToken(
|
|
903
|
-
options: Omit<MintBearerTokenOptions, 'endpoint'> & { endpoint?: string } = {},
|
|
903
|
+
options: Omit<MintBearerTokenOptions, 'clientName' | 'endpoint'> & { endpoint?: string } = {},
|
|
904
904
|
): Promise<BearerTokenResponse> {
|
|
905
905
|
if (this._authToken) {
|
|
906
906
|
throw new Error(
|
|
@@ -912,6 +912,7 @@ export class Transloadit {
|
|
|
912
912
|
{ authKey: this._authKey, authSecret: this._authSecret },
|
|
913
913
|
{
|
|
914
914
|
...options,
|
|
915
|
+
clientName: this._clientName,
|
|
915
916
|
endpoint: options.endpoint ?? this._endpoint,
|
|
916
917
|
},
|
|
917
918
|
)
|
|
@@ -130,6 +130,7 @@ export const assemblyStatusErrCodeSchema = z.enum([
|
|
|
130
130
|
'CLOUDFLARE_STORE_VALIDATION',
|
|
131
131
|
'CLOUDFLARE_STORE_WRONG_REGION',
|
|
132
132
|
'CLOUD_AI_IMAGE_VALIDATION',
|
|
133
|
+
'DAM_STORAGE_UNAVAILABLE',
|
|
133
134
|
'DIGITALOCEAN_IMPORT_ACCESS_DENIED',
|
|
134
135
|
'DIGITALOCEAN_IMPORT_FAILURE',
|
|
135
136
|
'DIGITALOCEAN_IMPORT_NOT_FOUND',
|
|
@@ -190,6 +191,7 @@ export const assemblyStatusErrCodeSchema = z.enum([
|
|
|
190
191
|
'GOOGLE_IMPORT_FAILURE',
|
|
191
192
|
'GOOGLE_IMPORT_NOT_FOUND',
|
|
192
193
|
'GOOGLE_IMPORT_VALIDATION',
|
|
194
|
+
'GOOGLE_STORE_ACCESS_DENIED',
|
|
193
195
|
'GOOGLE_STORE_INVALID_INPUT',
|
|
194
196
|
'GOOGLE_STORE_VALIDATION',
|
|
195
197
|
'HTML_CONVERT_VALIDATION',
|
|
@@ -399,6 +401,9 @@ export const assemblyStatusErrCodeSchema = z.enum([
|
|
|
399
401
|
export type AssemblyStatusErrCode = z.infer<typeof assemblyStatusErrCodeSchema>
|
|
400
402
|
|
|
401
403
|
const metadataTextSchema = z.union([z.string(), z.number().finite()])
|
|
404
|
+
const metadataDateSchema = z.union([metadataTextSchema, z.array(metadataTextSchema)])
|
|
405
|
+
// Readers must survive new server errors; the exported known-code enum remains closed.
|
|
406
|
+
const publicAssemblyErrorCodeSchema = z.string().min(1)
|
|
402
407
|
|
|
403
408
|
const assemblyStatusMetaSchema = z
|
|
404
409
|
.object({
|
|
@@ -406,7 +411,7 @@ const assemblyStatusMetaSchema = z
|
|
|
406
411
|
has_alpha: storedAssetSchema.shape.has_alpha,
|
|
407
412
|
width: z.union([z.number(), z.null()]).optional(),
|
|
408
413
|
height: z.union([z.number(), z.null()]).optional(),
|
|
409
|
-
date_file_modified:
|
|
414
|
+
date_file_modified: metadataDateSchema.nullable().optional(),
|
|
410
415
|
aspect_ratio: z.union([z.number(), z.string(), z.null()]).optional(),
|
|
411
416
|
has_clipping_path: z.boolean().optional(),
|
|
412
417
|
frame_count: z.union([z.number(), z.null()]).optional(),
|
|
@@ -415,14 +420,14 @@ const assemblyStatusMetaSchema = z
|
|
|
415
420
|
average_color: z.string().nullable().optional(),
|
|
416
421
|
svgViewBoxWidth: z.union([z.number(), z.null()]).optional(),
|
|
417
422
|
svgViewBoxHeight: z.union([z.number(), z.null()]).optional(),
|
|
418
|
-
date_recorded:
|
|
419
|
-
date_file_created:
|
|
423
|
+
date_recorded: metadataDateSchema.nullable().optional(),
|
|
424
|
+
date_file_created: metadataDateSchema.nullable().optional(),
|
|
420
425
|
title: z.union([z.string(), z.number()]).nullable().optional(),
|
|
421
426
|
description: metadataTextSchema.nullable().optional(),
|
|
422
427
|
duration: z.union([z.number(), z.null()]).optional(),
|
|
423
428
|
location: z.string().nullable().optional(),
|
|
424
429
|
city: z.string().nullable().optional(),
|
|
425
|
-
state:
|
|
430
|
+
state: metadataTextSchema.nullable().optional(),
|
|
426
431
|
rights: z.union([z.string(), z.number()]).nullable().optional(),
|
|
427
432
|
country: z.string().nullable().optional(),
|
|
428
433
|
country_code: z.string().nullable().optional(),
|
|
@@ -469,7 +474,7 @@ const assemblyStatusMetaSchema = z
|
|
|
469
474
|
xp_title: metadataTextSchema.nullable().optional(),
|
|
470
475
|
xp_comment: z.string().nullable().optional(),
|
|
471
476
|
xp_keywords: metadataTextSchema.nullable().optional(),
|
|
472
|
-
xp_subject:
|
|
477
|
+
xp_subject: metadataTextSchema.nullable().optional(),
|
|
473
478
|
recognized_text: z
|
|
474
479
|
.union([
|
|
475
480
|
z.array(z.string()),
|
|
@@ -560,8 +565,8 @@ const assemblyStatusMetaSchema = z
|
|
|
560
565
|
page_count: z.union([z.number(), z.null()]).optional(),
|
|
561
566
|
page_size: z.string().nullable().optional(),
|
|
562
567
|
producer: z.string().nullable().optional(),
|
|
563
|
-
create_date:
|
|
564
|
-
modify_date:
|
|
568
|
+
create_date: metadataDateSchema.nullable().optional(),
|
|
569
|
+
modify_date: metadataDateSchema.nullable().optional(),
|
|
565
570
|
colortransfer: z.string().nullable().optional(),
|
|
566
571
|
colorprimaries: z.string().nullable().optional(),
|
|
567
572
|
archive_directory: z.string().nullable().optional(),
|
|
@@ -655,7 +660,7 @@ export const assemblyStatusUploadSchema = z
|
|
|
655
660
|
has_alpha: storedAssetSchema.shape.has_alpha,
|
|
656
661
|
name: z.string().nullable(),
|
|
657
662
|
basename: z.string().nullable(),
|
|
658
|
-
ext: z.string(),
|
|
663
|
+
ext: z.string().nullable(),
|
|
659
664
|
size: z.number(),
|
|
660
665
|
mime: z.string().nullable(),
|
|
661
666
|
type: z.string().nullable(),
|
|
@@ -918,7 +923,7 @@ export const assemblyStatusOkSchema: AssemblyStatusVariant<{
|
|
|
918
923
|
.passthrough()
|
|
919
924
|
|
|
920
925
|
const assemblyStatusErrorFields = z.object({
|
|
921
|
-
error:
|
|
926
|
+
error: publicAssemblyErrorCodeSchema,
|
|
922
927
|
ok: z.null().optional(),
|
|
923
928
|
retries: z.number().optional(),
|
|
924
929
|
numRetries: z.number().optional(),
|
|
@@ -996,12 +1001,13 @@ export type AssemblyStatus = z.infer<typeof assemblyStatusSchema>
|
|
|
996
1001
|
*/
|
|
997
1002
|
export function hasError(
|
|
998
1003
|
assembly: AssemblyStatus | undefined | null,
|
|
999
|
-
|
|
1004
|
+
// Keep known-code suggestions while matching future public response codes too.
|
|
1005
|
+
particularErrorCode?: AssemblyStatusErrCode | (string & {}),
|
|
1000
1006
|
): assembly is AssemblyStatusError {
|
|
1001
1007
|
const errorExists =
|
|
1002
1008
|
Boolean(assembly) && assembly != null && typeof assembly === 'object' && 'error' in assembly
|
|
1003
1009
|
|
|
1004
|
-
if (particularErrorCode) {
|
|
1010
|
+
if (particularErrorCode !== undefined) {
|
|
1005
1011
|
return errorExists && assembly.error === particularErrorCode
|
|
1006
1012
|
}
|
|
1007
1013
|
|
|
@@ -1079,7 +1085,7 @@ export function isAssemblyOkStatus(
|
|
|
1079
1085
|
}
|
|
1080
1086
|
|
|
1081
1087
|
/**
|
|
1082
|
-
* Type guard to check if a status string is
|
|
1088
|
+
* Type guard to check if a status string is a known error code.
|
|
1083
1089
|
*/
|
|
1084
1090
|
export function isAssemblyErrorStatus(
|
|
1085
1091
|
status: string | undefined | null,
|
|
@@ -1123,7 +1129,11 @@ export function isAssemblyTerminalOk(assembly: AssemblyStatus | undefined | null
|
|
|
1123
1129
|
* Returns true if the assembly has a terminal error state.
|
|
1124
1130
|
*/
|
|
1125
1131
|
export function isAssemblyTerminalError(assembly: AssemblyStatus | undefined | null): boolean {
|
|
1126
|
-
|
|
1132
|
+
// getError() historically stringifies explicit undefined; classification needs the raw value.
|
|
1133
|
+
return (
|
|
1134
|
+
(hasError(assembly) && publicAssemblyErrorCodeSchema.safeParse(assembly.error).success) ||
|
|
1135
|
+
isAssemblySysError(assembly)
|
|
1136
|
+
)
|
|
1127
1137
|
}
|
|
1128
1138
|
|
|
1129
1139
|
/**
|
|
@@ -1185,7 +1195,7 @@ export const assemblyIndexItemSchema = z
|
|
|
1185
1195
|
bytes_received: assemblyStatusBaseSchema.shape.bytes_received.optional(),
|
|
1186
1196
|
upload_duration: assemblyStatusBaseSchema.shape.upload_duration.optional(),
|
|
1187
1197
|
ok: assemblyStatusOkCodeSchema.nullable().optional(),
|
|
1188
|
-
error:
|
|
1198
|
+
error: publicAssemblyErrorCodeSchema.nullable().optional(),
|
|
1189
1199
|
created: z.string(),
|
|
1190
1200
|
created_ts: z.number().optional(),
|
|
1191
1201
|
template_name: z.string().nullable().optional(),
|
|
@@ -20,6 +20,7 @@ export const MODEL_CAPABILITIES: Readonly<Record<string, { pdf: boolean; image:
|
|
|
20
20
|
'anthropic/claude-fable-5': { pdf: true, image: true },
|
|
21
21
|
'anthropic/claude-fable-5-1': { pdf: true, image: true },
|
|
22
22
|
'anthropic/claude-sonnet-5': { pdf: true, image: true },
|
|
23
|
+
'anthropic/claude-sonnet-5-5': { pdf: true, image: true },
|
|
23
24
|
'openai/gpt-4.1-2025-04-14': { pdf: false, image: true },
|
|
24
25
|
'openai/chatgpt-4o-latest': { pdf: false, image: true },
|
|
25
26
|
'openai/o3-2025-04-16': { pdf: false, image: true },
|
|
@@ -33,6 +34,7 @@ export const MODEL_CAPABILITIES: Readonly<Record<string, { pdf: boolean; image:
|
|
|
33
34
|
'openai/gpt-5.5': { pdf: false, image: true },
|
|
34
35
|
'openai/gpt-5.6-sol': { pdf: false, image: true },
|
|
35
36
|
'openai/gpt-6-astra': { pdf: false, image: true },
|
|
37
|
+
'openai/gpt-6.1-sol': { pdf: false, image: true },
|
|
36
38
|
'openai/gpt-5.4': { pdf: false, image: true },
|
|
37
39
|
'openai/gpt-5.4-mini': { pdf: false, image: true },
|
|
38
40
|
'openai/gpt-5.4-nano': { pdf: false, image: true },
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
/** Google’s signed 32-bit seed ceiling, shared by provider and Robot validation. */
|
|
4
|
+
export const googleImageSeedMaximum = 2_147_483_647
|
|
5
|
+
|
|
6
|
+
/** Validation message for the seed range supported by Google and the cloudai CLI. */
|
|
7
|
+
export const googleImageSeedValidationMessage = `seed must be an integer from 0 to ${googleImageSeedMaximum}`
|
|
8
|
+
|
|
9
|
+
/** Google image seeds must fit int32 and preserve the CLI’s nonnegative seed contract. */
|
|
10
|
+
export const googleImageSeedSchema = z
|
|
11
|
+
.number()
|
|
12
|
+
.int(googleImageSeedValidationMessage)
|
|
13
|
+
.min(0, googleImageSeedValidationMessage)
|
|
14
|
+
.max(googleImageSeedMaximum, googleImageSeedValidationMessage)
|
|
@@ -2048,25 +2048,23 @@ While we recommend to use <dfn>Template Credentials</dfn> at all times, some use
|
|
|
2048
2048
|
})
|
|
2049
2049
|
.strict()
|
|
2050
2050
|
|
|
2051
|
-
|
|
2052
|
-
export
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
.string()
|
|
2056
|
-
.optional()
|
|
2057
|
-
.describe(`
|
|
2058
|
-
Create a new [Google service account](https://cloud.google.com/storage/docs/authentication). Set its role to "Storage Object Creator". Choose "JSON" for the key file format and download it to your computer. You will need to upload this file when creating your <dfn>Template Credentials</dfn>.
|
|
2051
|
+
/** Shared Google credential setup with permissions supplied by the importing or storing Robot. */
|
|
2052
|
+
export function getGoogleCredentialsDescription(permissions: string): string {
|
|
2053
|
+
return `
|
|
2054
|
+
Create a new [Google service account](https://cloud.google.com/storage/docs/authentication). Choose “JSON” for the key file format and download it to your computer. You will need to upload this file when creating your <dfn>Template Credentials</dfn>.
|
|
2059
2055
|
|
|
2060
2056
|
Go back to your Google credentials project and enable the "Google Cloud Storage JSON API" for it. Wait around ten minutes for the action to propagate through the Google network. Grab the project ID from the dropdown menu in the header bar on the Google site. You will also need it later on.
|
|
2061
2057
|
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
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.
|
|
2065
|
-
|
|
2066
|
-
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.
|
|
2058
|
+
${permissions.trim()}
|
|
2067
2059
|
|
|
2068
2060
|
Then, create your associated [Template Credentials](/c/template-credentials/) in your Transloadit account and use the name of your <dfn>Template Credentials</dfn> as this parameter's value.
|
|
2069
|
-
`
|
|
2061
|
+
`
|
|
2062
|
+
}
|
|
2063
|
+
|
|
2064
|
+
export type GoogleBase = z.infer<typeof googleBase>
|
|
2065
|
+
export const googleBase = z
|
|
2066
|
+
.object({
|
|
2067
|
+
credentials: z.string().optional(),
|
|
2070
2068
|
})
|
|
2071
2069
|
.strict()
|
|
2072
2070
|
|
|
@@ -2314,7 +2312,7 @@ For example:
|
|
|
2314
2312
|
}
|
|
2315
2313
|
\`\`\`
|
|
2316
2314
|
|
|
2317
|
-
This will crop the area from \`(80, 100)\` to \`(600, 800)\` from a 1000×1000 pixels video, which is a
|
|
2315
|
+
This will crop the area from \`(80, 100)\` to \`(600, 800)\` from a 1000×1000 pixels video, 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.
|
|
2318
2316
|
|
|
2319
2317
|
You can also use a JSON string of such an object with coordinates in similar fashion:
|
|
2320
2318
|
|
|
@@ -51,13 +51,12 @@ type Part<Type extends MessagePart['type']> = Extract<MessagePart, { type: Type
|
|
|
51
51
|
type ToolOutput = Part<'tool-result'>['output']
|
|
52
52
|
|
|
53
53
|
type ProviderMetadata = NonNullable<z.output<typeof providerMetadataSchema>>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
'providerOptions'
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
54
|
+
// Zod output retains explicit undefined even when the consumer enables exact optional properties.
|
|
55
|
+
type CompatibleProviderOptions<Part extends { providerOptions?: ProviderMetadata | undefined }> =
|
|
56
|
+
Omit<Part, 'providerOptions'> & {
|
|
57
|
+
providerOptions?: ProviderMetadata
|
|
58
|
+
experimental_providerMetadata?: ProviderMetadata
|
|
59
|
+
}
|
|
61
60
|
type MessageProviderOptions = {
|
|
62
61
|
providerOptions?: ProviderMetadata
|
|
63
62
|
experimental_providerMetadata?: ProviderMetadata
|
|
@@ -9,6 +9,7 @@ import { z } from 'zod'
|
|
|
9
9
|
import {
|
|
10
10
|
createStorageImportExample,
|
|
11
11
|
defineRobot,
|
|
12
|
+
getGoogleCredentialsDescription,
|
|
12
13
|
googleBase,
|
|
13
14
|
next_page_token,
|
|
14
15
|
path,
|
|
@@ -37,6 +38,11 @@ export const robotGoogleImportInstructionsSchema = robotBase
|
|
|
37
38
|
.merge(googleBase)
|
|
38
39
|
.extend({
|
|
39
40
|
robot: z.literal('/google/import'),
|
|
41
|
+
credentials: googleBase.shape.credentials.describe(
|
|
42
|
+
getGoogleCredentialsDescription(`
|
|
43
|
+
Grant the service account the “Storage Object Viewer” role on the bucket you want to import from. This provides \`storage.objects.get\` to download objects and \`storage.objects.list\` to list them. Imports do not need permission to create or delete objects. See [Google’s IAM roles for Cloud Storage](https://docs.cloud.google.com/storage/docs/access-control/iam-roles).
|
|
44
|
+
`),
|
|
45
|
+
),
|
|
40
46
|
path: path.describe(`
|
|
41
47
|
The path in your bucket to the specific file or directory. If the path points to a file, only this file will be imported. For example: \`images/avatar.jpg\`.
|
|
42
48
|
|
|
@@ -51,7 +57,7 @@ You can also use an array of path strings here to import multiple paths in the s
|
|
|
51
57
|
recursive: recursive.describe(`
|
|
52
58
|
Setting this to \`true\` will enable importing files from subdirectories and sub-subdirectories (etc.) of the given path.
|
|
53
59
|
|
|
54
|
-
Please use the pagination parameters \`
|
|
60
|
+
Please use the pagination parameters \`next_page_token\` and \`files_per_page\` wisely here.
|
|
55
61
|
`),
|
|
56
62
|
next_page_token: next_page_token.describe(`
|
|
57
63
|
A string token used for pagination. The returned files of one paginated call have the next page token inside of their meta data, which needs to be used for the subsequent paging call.
|
|
@@ -9,6 +9,7 @@ import { z } from 'zod'
|
|
|
9
9
|
import {
|
|
10
10
|
createStorageStoreExample,
|
|
11
11
|
defineRobot,
|
|
12
|
+
getGoogleCredentialsDescription,
|
|
12
13
|
googleBase,
|
|
13
14
|
robotBase,
|
|
14
15
|
robotStoreMeta,
|
|
@@ -39,19 +40,13 @@ The URL to the exported file in your Google bucket will be presented in the Tran
|
|
|
39
40
|
.boolean()
|
|
40
41
|
.optional()
|
|
41
42
|
.describe('Whether the results of this Step should be present in the Assembly Status JSON'),
|
|
42
|
-
credentials: z.string().describe(
|
|
43
|
-
|
|
43
|
+
credentials: z.string().describe(
|
|
44
|
+
getGoogleCredentialsDescription(`
|
|
45
|
+
Grant the service account \`storage.objects.create\` on the bucket you want to export to. The “Storage Object Creator” role provides this permission for new objects, but does not allow overwriting existing objects. Add \`storage.objects.delete\` only if you need to overwrite existing objects. See [Google’s IAM roles for Cloud Storage](https://docs.cloud.google.com/storage/docs/access-control/iam-roles).
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
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.
|
|
48
|
-
|
|
49
|
-
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.
|
|
50
|
-
|
|
51
|
-
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.
|
|
52
|
-
|
|
53
|
-
Then, create your associated [Template Credentials](/c/template-credentials/) in your Transloadit account and use the name of your <dfn>Template Credentials</dfn> as this parameter's value.
|
|
47
|
+
For overwrites, create a custom role in “IAM & Admin” → “Roles” with \`storage.objects.create\` and \`storage.objects.delete\`, then grant it to the service account on your bucket.
|
|
54
48
|
`),
|
|
49
|
+
),
|
|
55
50
|
path: z
|
|
56
51
|
.string()
|
|
57
52
|
.default('${unique_prefix}/${file.url_name}')
|
|
@@ -55,12 +55,16 @@ The URL from which the file to be imported can be retrieved.
|
|
|
55
55
|
HTTPS URLs must present a valid certificate trusted by Transloadit and matching the requested hostname. Self-signed, expired, or hostname-mismatched certificates cause \`${httpImportRobotErrors.HTTP_IMPORT_FAILURE.error}\`.
|
|
56
56
|
|
|
57
57
|
You can also specify an array of URLs or a string of \`|\` delimited URLs to import several files at once. Please also check the \`url_delimiter\` parameter for that.
|
|
58
|
+
|
|
59
|
+
Delimited URL lists are split before variables are interpolated. A delimiter introduced by a variable remains part of that URL. To supply several URLs through a variable, have the entire \`url\` value interpolate to an array of URLs.
|
|
58
60
|
`),
|
|
59
61
|
url_delimiter: z
|
|
60
62
|
.string()
|
|
61
63
|
.default('|')
|
|
62
64
|
.describe(`
|
|
63
65
|
Provides the delimiter that is used to split the URLs in your \`url\` parameter value.
|
|
66
|
+
|
|
67
|
+
The delimiter must be literal. Only delimiters outside interpolation expressions in the original \`url\` value separate imports; variable values are never split.
|
|
64
68
|
`),
|
|
65
69
|
headers: z
|
|
66
70
|
.union([
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
imageGenerateLegacyModelAlias,
|
|
8
8
|
imageGenerateModelIdentifiers,
|
|
9
9
|
} from './_ai-models.ts'
|
|
10
|
+
import { googleImageSeedMaximum } from './_google-image-seed.ts'
|
|
10
11
|
import {
|
|
11
12
|
autoProviderDescription,
|
|
12
13
|
interpolateRobot,
|
|
@@ -101,7 +102,13 @@ Best practice:
|
|
|
101
102
|
.describe(
|
|
102
103
|
'Output format. Defaults depend on model: png for Google and OpenAI models, svg for recraft-v3, jpeg for others. Google models currently return PNG only.',
|
|
103
104
|
),
|
|
104
|
-
seed
|
|
105
|
+
// Provider-specific limits are checked by the Robot so other models retain their seed range.
|
|
106
|
+
seed: z
|
|
107
|
+
.number()
|
|
108
|
+
.optional()
|
|
109
|
+
.describe(
|
|
110
|
+
`${robotParameterDocs.seed.description} For Google models, use an integer from 0 to ${googleImageSeedMaximum}. Each output increments the seed by 1, so the final output’s seed must also fit this range. A seed does not guarantee identical images.`,
|
|
111
|
+
),
|
|
105
112
|
aspect_ratio: z
|
|
106
113
|
.string()
|
|
107
114
|
.optional()
|
|
@@ -29,6 +29,34 @@ import {
|
|
|
29
29
|
|
|
30
30
|
const imageResizeGravitySchema = z.union([positionSchema, z.enum(['attention', 'entropy'])])
|
|
31
31
|
|
|
32
|
+
/** Input MIME types eligible for automatic libvips processing in /image/resize. */
|
|
33
|
+
export const imageResizeDaemonInputMimes: readonly string[] = [
|
|
34
|
+
'image/jpg',
|
|
35
|
+
'image/jpeg',
|
|
36
|
+
'image/jxl',
|
|
37
|
+
'image/png',
|
|
38
|
+
'image/tiff',
|
|
39
|
+
'image/tiff-fx',
|
|
40
|
+
'image/gif',
|
|
41
|
+
'image/webp',
|
|
42
|
+
'image/svg',
|
|
43
|
+
'image/svg+xml',
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
/** Output formats eligible for automatic libvips processing in /image/resize. */
|
|
47
|
+
export const imageResizeDaemonOutputFormats: readonly string[] = [
|
|
48
|
+
'heic',
|
|
49
|
+
'heif',
|
|
50
|
+
'jpeg',
|
|
51
|
+
'jpg',
|
|
52
|
+
'jxl',
|
|
53
|
+
'png',
|
|
54
|
+
'raw',
|
|
55
|
+
'tiff',
|
|
56
|
+
'webp',
|
|
57
|
+
'avif',
|
|
58
|
+
]
|
|
59
|
+
|
|
32
60
|
export const meta: RobotMetaInput = {
|
|
33
61
|
...robotImageProcessingMeta,
|
|
34
62
|
example_code: createProcessingExample('resized', '/image/resize', {
|
|
@@ -171,14 +199,14 @@ Height of the new image, in pixels. If not specified, will default to the height
|
|
|
171
199
|
.union([
|
|
172
200
|
z
|
|
173
201
|
.literal('crop')
|
|
174
|
-
.describe(`Cuts an area out of an image
|
|
202
|
+
.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.
|
|
175
203
|
|
|
176
204
|
To crop around human faces, see [🤖/image/facedetect](https://transloadit.com/docs/robots/image-facedetect/) instead.`),
|
|
177
205
|
z
|
|
178
206
|
.literal('fillcrop')
|
|
179
207
|
.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.
|
|
180
208
|
|
|
181
|
-
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\`
|
|
209
|
+
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"\`.`),
|
|
182
210
|
z
|
|
183
211
|
.literal('fit')
|
|
184
212
|
.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.
|
|
@@ -224,7 +252,7 @@ For example:
|
|
|
224
252
|
}
|
|
225
253
|
\`\`\`
|
|
226
254
|
|
|
227
|
-
This will crop the area from \`(80, 100)\` to \`(600, 800)\` from a 1000×1000 pixels image, which is a
|
|
255
|
+
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.
|
|
228
256
|
|
|
229
257
|
You can also use a JSON string of such an object with coordinates in similar fashion:
|
|
230
258
|
|
|
@@ -235,9 +263,11 @@ You can also use a JSON string of such an object with coordinates in similar fas
|
|
|
235
263
|
To crop around human faces, see [🤖/image/facedetect](/docs/robots/image-facedetect/).
|
|
236
264
|
`),
|
|
237
265
|
gravity: imageResizeGravitySchema.default('center').describe(`
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
266
|
+
Sets crop direction for \`crop\` or \`fillcrop\` without explicit coordinates.
|
|
267
|
+
Content-aware \`attention\` and \`entropy\` need libvips, \`fillcrop\`, \`width\` and \`height\`.
|
|
268
|
+
Effects such as \`sepia\` or \`text\`, and inputs such as HEIC, can use ImageMagick.
|
|
269
|
+
It centers these crops and the Assembly reports a warning.
|
|
270
|
+
Crop in a separate /image/resize Step before effects, or convert unsupported inputs to PNG first.
|
|
241
271
|
`),
|
|
242
272
|
strip: z
|
|
243
273
|
.boolean()
|