Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/docs/content/docs/integrations/slack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1580,7 +1580,7 @@ Read a page of Slack List rows and optionally its column schema. Pass nextCursor
| ↳ `user` | array | Slack user IDs |
| ↳ `channel` | array | Slack channel IDs |
| ↳ `attachment` | array | Slack file IDs |
| ↳ `checkbox` | array | Checkbox values in responses; write a scalar boolean |
| ↳ `checkbox` | json | Checkbox boolean or boolean array returned by Slack; write a scalar boolean |
| ↳ `email` | array | Email values |
| ↳ `phone` | array | Phone values |
| ↳ `rating` | array | Rating values |
Expand Down Expand Up @@ -1635,7 +1635,7 @@ Read a Slack List row and its parent List column schema.
| ↳ `user` | array | Slack user IDs |
| ↳ `channel` | array | Slack channel IDs |
| ↳ `attachment` | array | Slack file IDs |
| ↳ `checkbox` | array | Checkbox values in responses; write a scalar boolean |
| ↳ `checkbox` | json | Checkbox boolean or boolean array returned by Slack; write a scalar boolean |
| ↳ `email` | array | Email values |
| ↳ `phone` | array | Phone values |
| ↳ `rating` | array | Rating values |
Expand Down Expand Up @@ -1691,7 +1691,7 @@ Create a Slack List row using real column IDs and typed cell values. Text column
| ↳ `user` | array | Slack user IDs |
| ↳ `channel` | array | Slack channel IDs |
| ↳ `attachment` | array | Slack file IDs |
| ↳ `checkbox` | array | Checkbox values in responses; write a scalar boolean |
| ↳ `checkbox` | json | Checkbox boolean or boolean array returned by Slack; write a scalar boolean |
| ↳ `email` | array | Email values |
| ↳ `phone` | array | Phone values |
| ↳ `rating` | array | Rating values |
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/generated/tool-outputs.ts

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions apps/sim/tools/slack_lists/operations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,37 @@ describe('Slack Lists responses', () => {
)
expect(empty.output.list?.schema).toEqual(schema)
})
it.each([false, true, [false], [true]])(
'preserves checkbox response %j across row operations',
async (checkbox) => {
const row = {
...item,
fields: [{ column_id: 'Col1', key: 'done', value: false, checkbox }],
}
const created = await slackListsItemsCreateTool.transformResponse!(
Response.json({ ok: true, item: row })
)
const page = await slackListsItemsListTool.transformResponse!(
Response.json({ ok: true, items: [row], list })
)
const info = await slackListsItemsInfoTool.transformResponse!(
Response.json({ ok: true, record: row, list })
)
expect(created.output.item.fields).toEqual(row.fields)
expect(page.output.items[0].fields).toEqual(row.fields)
expect(info.output.item.fields).toEqual(row.fields)
}
)
it.each([null, 'false', 0, ['false']])(
'rejects malformed checkbox response %j',
async (checkbox) => {
await expect(
slackListsItemsCreateTool.transformResponse!(
Response.json({ ok: true, item: { ...item, fields: [{ column_id: 'Col1', checkbox }] } })
)
).rejects.toThrow()
}
)
it('reads items.info from record, and items.create from item', async () => {
expect(
(
Expand Down
6 changes: 3 additions & 3 deletions apps/sim/tools/slack_lists/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ export const LIST_ITEM_OUTPUT_PROPERTIES = {
items: { type: 'string' },
},
checkbox: {
type: 'array',
type: 'json',
optional: true,
description: 'Checkbox values in responses; write a scalar boolean',
items: { type: 'boolean' },
description:
'Checkbox boolean or boolean array returned by Slack; write a scalar boolean',
},
email: {
type: 'array',
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/slack_lists/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const listFieldResponseSchema = z
user: z.array(z.string()).optional(),
channel: z.array(z.string()).optional(),
attachment: z.array(z.string()).optional(),
checkbox: z.array(z.boolean()).optional(),
checkbox: z.union([z.boolean(), z.array(z.boolean())]).optional(),
email: z.array(z.string()).optional(),
phone: z.array(z.string()).optional(),
rating: z.array(z.number()).optional(),
Expand Down
Loading