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
description: 'Read, write, and create presentations',
11
+
hideFromToolbar: true,
30
12
authMode: AuthMode.OAuth,
31
13
longDescription:
32
14
'Integrate Google Slides into the workflow. Can read, write, create presentations, replace text, add slides, add images, get thumbnails, get page details, delete objects, duplicate objects, reorder slides, create tables, create shapes, and insert text.',
@@ -484,45 +506,26 @@ function resolveInternalFileUrl(file: RawFileInput): string {
484
506
if(file.url&&isInternalFileUrl(file.url)){
485
507
returnfile.url
486
508
}
487
-
488
509
if(file.path&&isInternalFileUrl(file.path)){
489
510
returnfile.path
490
511
}
491
-
492
512
return''
493
513
}
494
514
495
515
/**
496
-
* Converts a single raw file object to UserFile format
497
-
* @param file - Raw file object (must be a single file, not an array)
498
-
* @param requestId - Request ID for logging
499
-
* @param logger - Logger instance
500
-
* @returns UserFile object
501
-
* @throws Error if file is an array or has no storage key
516
+
* Core conversion logic from RawFileInput to UserFile
502
517
*/
503
-
exportfunctionprocessSingleFileToUserFile(
504
-
file: RawFileInput,
505
-
requestId: string,
506
-
logger: Logger
507
-
): UserFile{
508
-
if(Array.isArray(file)){
509
-
consterrorMsg=`Expected a single file but received an array with ${file.length} file(s). Use a file input that accepts multiple files, or select a specific file from the array (e.g., {{block.files[0]}}).`
logger.warn(`[${requestId}] File has no storage key: ${file.name||'unknown'}`)
525
-
thrownewError(`File has no storage key: ${file.name||'unknown'}`)
528
+
returnnull
526
529
}
527
530
528
531
constuserFile: UserFile={
@@ -541,12 +544,32 @@ export function processSingleFileToUserFile(
541
544
}
542
545
543
546
/**
544
-
* Converts raw file objects (from file-upload or variable references) to UserFile format
545
-
* Accepts either a single file or an array of files and normalizes to array output
546
-
* @param files - Single file or array of raw file objects
547
-
* @param requestId - Request ID for logging
548
-
* @param logger - Logger instance
549
-
* @returns Array of UserFile objects
547
+
* Converts a single raw file object to UserFile format
548
+
* @throws Error if file is an array or has no storage key
549
+
*/
550
+
exportfunctionprocessSingleFileToUserFile(
551
+
file: RawFileInput,
552
+
requestId: string,
553
+
logger: Logger
554
+
): UserFile{
555
+
if(Array.isArray(file)){
556
+
consterrorMsg=`Expected a single file but received an array with ${file.length} file(s). Use a file input that accepts multiple files, or select a specific file from the array (e.g., {{block.files[0]}}).`
0 commit comments