Skip to content

[BUG] New file upload API not in type definitions for SDK Client #456

@pigrammer3

Description

@pigrammer3

The deno-slack versions

    "deno-slack-sdk/": "https://deno.land/x/[email protected]/",
    "deno-slack-api/": "https://deno.land/x/[email protected]/"

Deno runtime version

deno 1.46.2 (stable, release, x86_64-pc-windows-msvc)
v8 12.9.202.5-rusty
typescript 5.5.2

OS info

Microsoft Windows [Version 10.0.19045.5737]

Describe the bug

The client parameter for custom functions doesn't have the new getUploadURLExternal and completeUploadExternal functions defined. You can still call the functions, like so:

const fileResponse = await (client.files as any).getUploadURLExternal({
  filename: "output.json",
  length: output.length,
});
await fetch(fileResponse.upload_url, { method: "POST", body: output });
const finalResponse = await (client.files as any).completeUploadExternal({
  files: [{id: fileResponse.file_id}]
});

... but notice the as any there, without that I get an error.

Steps to reproduce

  1. Create a custom function and call it from a workflow & set up a trigger
  2. In the function, attempt to use the new file upload API like so:
const fileResponse = await client.files.getUploadURLExternal({
  filename: "output.json",
  length: output.length,
});
await fetch(fileResponse.upload_url, { method: "POST", body: output });
const finalResponse = await client.files.completeUploadExternal({
  files: [{id: fileResponse.file_id}]
});

Expected result

The file is successfully uploaded.

Actual result

The code fails type checking and you can't deploy it:

DEBUG 2025/04/27 19:50:14.984143 [ERROR] Could not resolve "\\Users\\pigrammer\\project\\functions\\my_function\\mod.ts" [plugin deno-resolver]
DEBUG 2025/04/27 19:50:14.986113 
DEBUG 2025/04/27 19:50:14.991000 The plugin "deno-resolver" didn't set a resolve directory, so esbuild did not search for "\\Users\\pigrammer\\project\\functions\\my_function\\mod.ts" on the file system.
DEBUG 2025/04/27 19:50:15.001708 Error bundling function file "my_function" with esbuild
DEBUG 2025/04/27 19:50:15.030623 
DEBUG 2025/04/27 19:50:15.037074 error: Uncaught (in promise) Error: Build failed with 1 error:
DEBUG 2025/04/27 19:50:15.039172 error: Could not resolve "\\Users\\pigrammer\\project\\functions\\my_function\\mod.ts"
DEBUG 2025/04/27 19:50:15.040752 at failureErrorWithLog (file:///C:/Users/pigrammer/AppData/Local/deno/npm/registry.npmjs.org/esbuild/0.24.2/lib/main.js:1476:15)
DEBUG 2025/04/27 19:50:15.042867 at file:///C:/Users/pigrammer/AppData/Local/deno/npm/registry.npmjs.org/esbuild/0.24.2/lib/main.js:945:25
DEBUG 2025/04/27 19:50:15.045668 at runOnEndCallbacks (file:///C:/Users/pigrammer/AppData/Local/deno/npm/registry.npmjs.org/esbuild/0.24.2/lib/main.js:1316:45)
DEBUG 2025/04/27 19:50:15.047821 at buildResponseToResult (file:///C:/Users/pigrammer/AppData/Local/deno/npm/registry.npmjs.org/esbuild/0.24.2/lib/main.js:943:7)
DEBUG 2025/04/27 19:50:15.050476 at file:///C:/Users/pigrammer/AppData/Local/deno/npm/registry.npmjs.org/esbuild/0.24.2/lib/main.js:970:16
DEBUG 2025/04/27 19:50:15.052671 at responseCallbacks.<computed> (file:///C:/Users/pigrammer/AppData/Local/deno/npm/registry.npmjs.org/esbuild/0.24.2/lib/main.js:622:9)
DEBUG 2025/04/27 19:50:15.054334 at handleIncomingPacket (file:///C:/Users/pigrammer/AppData/Local/deno/npm/registry.npmjs.org/esbuild/0.24.2/lib/main.js:677:12)
DEBUG 2025/04/27 19:50:15.057020 at Readable.readFromStdout (file:///C:/Users/pigrammer/AppData/Local/deno/npm/registry.npmjs.org/esbuild/0.24.2/lib/main.js:600:7)
DEBUG 2025/04/27 19:50:15.058612 at Readable.emit (ext:deno_node/_stream.mjs:1851:9)
DEBUG 2025/04/27 19:50:15.062199 at addChunk (ext:deno_node/_stream.mjs:2873:16)
DEBUG 2025/04/27 19:50:15.127678 finished hook command: deno run -q --config=deno.jsonc --allow-read --allow-write --allow-net --allow-run --allow-env --allow-sys=osRelease https://deno.land/x/[email protected]/build.ts --source="...\pigrammer\project" --output="...\AppData\Local\Temp\slack-cli-package-1416564340" --protocol=message-boundaries --boundary=62416130735443384b53d41d8cd98f00b204e9800998ecf8427e
DEBUG 2025/04/27 19:50:15.135021 Starting root command cleanup routine
ERROR 2025/04/27 19:50:15.141113 error packaging project: Error running 'BuildProject' command: exit status 1 (sdk_hook_invocation_failed)

> Suggestion
   Run `slack.exe doctor` to check that your system dependencies are up-to-date.

(these logs are copied directly with some anonymization on paths)

note that these errors don't appear if I do as any on client.files. slack doctor shows that all my dependencies are up to date.

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions