Undocumented changes to file object
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- node.js, typescript
- Área
- api
Línea de trabajo
Comienza con los puntos de entrada de @slack/web-api y @slack/types para files.upload, files.uploadV2 y files.info, comparando sus objetos de archivo documentados con las respuestas notificadas. Determina si los campos faltantes o vacíos requieren un cambio en el SDK o una aclaración de la documentación; se considera terminado cuando la discrepancia y el comportamiento esperado estén claramente resueltos.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Packages:
Select all that apply:
-
@slack/web-api -
@slack/rtm-api -
@slack/webhooks -
@slack/oauth -
@slack/socket-mode -
@slack/types - I don't know
Reproducible in:
The Slack SDK version
@slack/[email protected]
@slack/[email protected]
Node.js runtime version
v18.11.0
OS info
ProductName: macOS
ProductVersion: 12.5
BuildVersion: 21G72
Darwin Kernel Version 21.6.0: Sat Jun 18 17:07:22 PDT 2022; root:xnu-8020.140.41~1/RELEASE_ARM64_T6000
Steps to reproduce:
const fileUploadResp = await slackClient.files.upload({
channels: channelId,
file: readFileStream(pathToFile),
filename: file.name || 'unknown_filename',
filetype: file.filetype,
initial_comment: `Uploaded by <@${message.authorId}>`,
thread_ts: threadTs,
})
const uploadedFile = fileUploadResp.file
console.log(uploadedFile)
const fileUploadV2Resp = await slackClient.files.uploadV2({
channel_id: channelId,
file_uploads: files.map(file => ({
file: readFileStream(filePathsByFileId[file.id]),
filename: file.name || 'unknown_filename',
})),
initial_comment: `Uploaded by <@${message.authorId}>`,
thread_ts: threadTs,
})
const fileUploads = fileUploadV2Resp.files[0].files
console.log(fileUploads[0])
Expected result:
An example of a file object returned by the to-be-deprecated files.upload method. This matches the object shown here in the docs: https://api.slack.com/types/file
{
id: 'F07P0LRQQ6N',
created: 1727277704,
timestamp: 1727277704,
name: 'Screen Shot 2024-06-04 at 4.44.34 PM.png',
title: 'Screen Shot 2024-06-04 at 4.44.34 PM',
mimetype: 'image/png',
filetype: 'png',
pretty_type: 'PNG',
user: 'U04JUMFCGE6',
user_team: 'TU7B08JCV',
editable: false,
size: 997126,
mode: 'hosted',
is_external: false,
external_type: '',
is_public: false,
public_url_shared: false,
display_as_bot: false,
username: '',
url_private: 'https://files.slack.com/files-pri/TU7B08JCV-F07P0LRQQ6N/screen_shot_2024-06-04_at_4.44.34_pm.png',
url_private_download: 'https://files.slack.com/files-pri/TU7B08JCV-F07P0LRQQ6N/download/screen_shot_2024-06-04_at_4.44.34_pm.png',
media_display_type: 'unknown',
thumb_64: 'https://files.slack.com/files-tmb/TU7B08JCV-F07P0LRQQ6N-f6d08ddef0/screen_shot_2024-06-04_at_4.44.34_pm_64.png',
thumb_80: 'https://files.slack.com/files-tmb/TU7B08JCV-F07P0LRQQ6N-f6d08ddef0/screen_shot_2024-06-04_at_4.44.34_pm_80.png',
thumb_360: 'https://files.slack.com/files-tmb/TU7B08JCV-F07P0LRQQ6N-f6d08ddef0/screen_shot_2024-06-04_at_4.44.34_pm_360.png',
thumb_360_w: 360,
thumb_360_h: 184,
thumb_480: 'https://files.slack.com/files-tmb/TU7B08JCV-F07P0LRQQ6N-f6d08ddef0/screen_shot_2024-06-04_at_4.44.34_pm_480.png',
thumb_480_w: 480,
thumb_480_h: 245,
thumb_160: 'https://files.slack.com/files-tmb/TU7B08JCV-F07P0LRQQ6N-f6d08ddef0/screen_shot_2024-06-04_at_4.44.34_pm_160.png',
thumb_720: 'https://files.slack.com/files-tmb/TU7B08JCV-F07P0LRQQ6N-f6d08ddef0/screen_shot_2024-06-04_at_4.44.34_pm_720.png',
thumb_720_w: 720,
thumb_720_h: 368,
thumb_800: 'https://files.slack.com/files-tmb/TU7B08JCV-F07P0LRQQ6N-f6d08ddef0/screen_shot_2024-06-04_at_4.44.34_pm_800.png',
thumb_800_w: 800,
thumb_800_h: 408,
thumb_960: 'https://files.slack.com/files-tmb/TU7B08JCV-F07P0LRQQ6N-f6d08ddef0/screen_shot_2024-06-04_at_4.44.34_pm_960.png',
thumb_960_w: 960,
thumb_960_h: 490,
thumb_1024: 'https://files.slack.com/files-tmb/TU7B08JCV-F07P0LRQQ6N-f6d08ddef0/screen_shot_2024-06-04_at_4.44.34_pm_1024.png',
thumb_1024_w: 1024,
thumb_1024_h: 523,
original_w: 2668,
original_h: 1362,
thumb_tiny: 'AwAYADDR79TSjnvSY5pQMUAL+NFFFABR3opO9AC4ooooAKKKKAENH8VDdqP4qAP/2Q==',
permalink: 'https://wranglesoft.slack.com/files/U04JUMFCGE6/F07P0LRQQ6N/screen_shot_2024-06-04_at_4.44.34_pm.png',
permalink_public: 'https://slack-files.com/TU7B08JCV-F07P0LRQQ6N-819dd60ac2',
comments_count: 0,
is_starred: false,
shares: { private: { D04KJCKG3G8: [Array] } },
channels: [],
groups: [],
ims: [ 'D04KJCKG3G8' ],
has_more_shares: false,
has_rich_preview: false,
file_access: 'visible'
}
Actual result:
This is an example of a file object returned by the new, recommended files.uploadV2 method. You can see that many fields are either missing or empty when compared to the file type shown in the api docs. Most notably, for our purposes, are mimetype, shares, channels, and groups. The new, reduced file object is consistent between the initial return from files.uploadV2 and subsequent calls to files.info after a successful upload.
{
id: 'F07P0GNNNKU',
created: 1727276530,
timestamp: 1727276530,
name: 'Screen Shot 2024-06-04 at 4.44.34 PM.png',
title: 'Screen Shot 2024-06-04 at 4.44.34 PM.png',
mimetype: '',
filetype: '',
pretty_type: '',
user: 'U04JUMFCGE6',
user_team: 'TU7B08JCV',
editable: false,
size: 997126,
mode: 'hosted',
is_external: false,
external_type: '',
is_public: false,
public_url_shared: false,
display_as_bot: false,
username: '',
url_private: 'https://files.slack.com/files-pri/TU7B08JCV-F07P0GNNNKU/screen_shot_2024-06-04_at_4.44.34_pm.png',
url_private_download: 'https://files.slack.com/files-pri/TU7B08JCV-F07P0GNNNKU/download/screen_shot_2024-06-04_at_4.44.34_pm.png',
media_display_type: 'unknown',
permalink: 'https://wranglesoft.slack.com/files/U04JUMFCGE6/F07P0GNNNKU/screen_shot_2024-06-04_at_4.44.34_pm.png',
permalink_public: 'https://slack-files.com/TU7B08JCV-F07P0GNNNKU-119478101c',
favorites: [],
is_starred: false,
shares: {},
channels: [],
groups: [],
ims: [],
has_more_shares: false,
has_rich_preview: false,
file_access: 'visible',
comments_count: 0
}
Requirements
For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. 🙇
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
- Lenguaje dominante
- TypeScript
- Estrellas
- 3.4k
- Forks
- 693
- Merge medio
- 1 d 1 h
- PR fusionados (30 d)
- 67
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de slackapi/node-slack-sdk
-
Support assistant.search.* APIsAbiertoauto-triage-skip enhancement pkg:web-api
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
slackapi/node-slack-sdk#2607 · 2 comentarios · 2 reacciones ·
Los mantenedores suelen responder en 1 día
-
`SlackListsItem FieldMessage.message` type does not match API response shapePosiblemente ocupada @AjTheSpidey la tomó hace 202 días. Abiertoarea:typescript auto-triage-skip bug pkg:web-api
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
slackapi/node-slack-sdk#2598 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Missing TypeScript response type for files.uploadV2Posiblemente ocupada @Yshuro la tomó hace 6 días. Abiertoarea:typescript auto-triage-skip bug pkg:web-api
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
slackapi/node-slack-sdk#2459 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Docs/types: document `broadcast_delete` on chat.delete (undo reply_broadcast)Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoarea:typescript enhancement pkg:web-api semver:patch
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
slackapi/node-slack-sdk#2815 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
auto-triage-stale
Dificultad 3/5 1-2 días Aptitud para principiantes 75/100
slackapi/node-slack-sdk#2791 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de slackapi/node-slack-sdk
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
agilepathway/label-checker#1015 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
tech-debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
bug P3
Dificultad 1/5 Menos de una hora Aptitud para principiantes 89/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
react-component/image#541 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día