·
4 commits
to main
since this release
What's Changed
๐พ Enhancements
๐ฟ Expand for a slackLists API method example
const list = await app.client.slackLists.create({
name: 'Test List - SlackLists API',
description_blocks: [
{
type: 'rich_text',
elements: [
{
type: 'rich_text_section',
elements: [
{
type: 'text',
text: 'List to keep track of tasks!',
},
],
},
],
},
],
schema: [
{
key: 'task_name',
name: 'Task Name',
type: 'text',
is_primary_column: true,
},
{
key: 'due_date',
name: 'Due Date',
type: 'date',
},
{
key: 'status',
name: 'Status',
type: 'select',
options: {
choices: [
{ value: 'not_started', label: 'Not Started', color: 'red' },
{ value: 'in_progress', label: 'In Progress', color: 'yellow' },
{ value: 'completed', label: 'Completed', color: 'green' },
],
},
},
{
key: 'assignee',
name: 'Assignee',
type: 'user',
},
],
});
console.log('List created:', list);
const listId = list.list_id;
// extract column IDs from the response (map key -> id)
const keyToId = {};
if (list.list_metadata?.schema) {
for (const col of list.list_metadata.schema) {
keyToId[col.key] = col.id;
}
}
const taskNameColId = keyToId['task_name'];
console.log('Column IDs:', keyToId);
const response = await app.client.slackLists.access.set({
list_id: listId,
access_level: 'write',
user_ids: ['U09G4FG3TRN'],
});
console.log('Access set:', response);
const createItemResponse = await app.client.slackLists.items.create({
list_id: listId,
initial_fields: [
{
column_id: taskNameColId,
rich_text: [
{
type: 'rich_text',
elements: [
{
type: 'rich_text_section',
elements: [
{
type: 'text',
text: 'CLI app unlink command',
},
],
},
],
},
],
},
],
});
console.log('Item created:', createItemResponse);
const itemId = createItemResponse.id;
if (itemId) {
await app.client.slackLists.items.info({
list_id: listId,
id: itemId,
include_is_subscribed: true,
});
console.log('Item info retrieved');
await app.client.slackLists.items.update({
list_id: listId,
cells: [
{
row_id: itemId,
column_id: taskNameColId,
checkbox: true,
},
],
});
console.log('Item updated');
}
const listItemsResponse = await app.client.slackLists.items.list({
list_id: listId,
limit: 50,
});
console.log('Items listed:', listItemsResponse);
const downloadStartResponse = await app.client.slackLists.download.start({
list_id: listId,
include_archived: false,
});
console.log('Download started:', downloadStartResponse);
const jobId = downloadStartResponse.job_id;
if (jobId) {
await app.client.slackLists.download.get({
list_id: listId,
job_id: jobId,
});
console.log('Download status retrieved');
}
if (itemId) {
await app.client.slackLists.items.delete({
list_id: listId,
id: itemId,
});
console.log('Item deleted');
}
await app.client.slackLists.items.deleteMultiple({
list_id: listId,
ids: ['item1', 'item2'],
});
console.log('Multiple items deleted');
await app.client.slackLists.access.delete({
list_id: listId,
user_ids: ['U09G4FG3TRN'],
});
console.log('Access removed');๐ Documentation
- docs(maintainers): update release steps with recent examples by @mwbrooks in #2442
- docs: fixes broken links in docs sidebar by @lukegalbraithrussell in #2444
- docs(web-api): note the chat stream buffer size default by @zimeg in #2418
๐งฐ Maintenance
- chore(web-api): release @slack/[email protected] by @srtaalej in #2445
New Contributors
Full Changelog: https://github.com/slackapi/node-slack-sdk/compare/@slack/[email protected]...@slack/[email protected]
Milestone: https://github.com/slackapi/node-slack-sdk/milestone/159
npm Release: https://www.npmjs.com/package/@slack/web-api/v/7.13.0