diff --git a/src/dev_deps.ts b/src/dev_deps.ts index 16496106..8823642b 100644 --- a/src/dev_deps.ts +++ b/src/dev_deps.ts @@ -4,7 +4,6 @@ export { assertInstanceOf, AssertionError, assertMatch, - assertNotStrictEquals, assertRejects, assertStrictEquals, assertStringIncludes, diff --git a/src/schema/slack/functions/_scripts/src/templates/test_template.ts b/src/schema/slack/functions/_scripts/src/templates/test_template.ts index fbd69bce..831f253f 100644 --- a/src/schema/slack/functions/_scripts/src/templates/test_template.ts +++ b/src/schema/slack/functions/_scripts/src/templates/test_template.ts @@ -33,7 +33,7 @@ const renderFunctionManifestTest = ( ); typescript.push(`const actual = ${functionName}.export();`); typescript.push(""); - typescript.push(`assertNotStrictEquals(actual, expected);`); + typescript.push(`assertEquals(actual, expected);`); return `() => {${typescript.join("\n")}}`; }; @@ -114,7 +114,7 @@ export function SlackTestFunctionTemplate( const typescript: string[] = []; typescript.push(autogeneratedComment()); typescript.push( - `import { assertEquals, assertNotStrictEquals } from "../../../dev_deps.ts";`, + `import { assertEquals } from "../../../dev_deps.ts";`, ); typescript.push( `import { DefineWorkflow } from "../../../workflows/mod.ts";`, @@ -142,7 +142,7 @@ export function SlackTestFunctionTemplate( } typescript[1] = - `import { assertEquals, assertNotStrictEquals, assertExists } from "../../../dev_deps.ts";`; + `import { assertEquals, assertExists } from "../../../dev_deps.ts";`; typescript.push(""); typescript.push( `Deno.test("All outputs of Slack function ${functionName} should exist", ${ diff --git a/src/schema/slack/functions/add_pin.ts b/src/schema/slack/functions/add_pin.ts index 2b48f36c..4e7c714c 100644 --- a/src/schema/slack/functions/add_pin.ts +++ b/src/schema/slack/functions/add_pin.ts @@ -6,7 +6,8 @@ import SlackTypes from "../schema_types.ts"; export default DefineFunction({ callback_id: "slack#/functions/add_pin", source_file: "", - title: "Pin a message", + title: "Pin to channel", + description: "Pin a message to a channel", input_parameters: { properties: { channel_id: { @@ -16,8 +17,8 @@ export default DefineFunction({ }, message: { type: SchemaTypes.string, - description: "Enter a message link or message timestamp", - title: "Message link or message timestamp", + description: "Enter a message URL or message timestamp", + title: "Message URL or message timestamp", }, }, required: ["channel_id", "message"], diff --git a/src/schema/slack/functions/add_pin_test.ts b/src/schema/slack/functions/add_pin_test.ts index 9674c7a1..c08c58d8 100644 --- a/src/schema/slack/functions/add_pin_test.ts +++ b/src/schema/slack/functions/add_pin_test.ts @@ -1,5 +1,5 @@ /** This file was autogenerated. Follow the steps in src/schema/slack/functions/_scripts/README.md to rebuild **/ -import { assertEquals, assertNotStrictEquals } from "../../../dev_deps.ts"; +import { assertEquals } from "../../../dev_deps.ts"; import { DefineWorkflow } from "../../../workflows/mod.ts"; import { ManifestFunctionSchema } from "../../../manifest/manifest_schema.ts"; import SchemaTypes from "../../schema_types.ts"; @@ -10,7 +10,8 @@ Deno.test("AddPin generates valid FunctionManifest", () => { assertEquals(AddPin.definition.callback_id, "slack#/functions/add_pin"); const expected: ManifestFunctionSchema = { source_file: "", - title: "Pin a message", + title: "Pin to channel", + description: "Pin a message to a channel", input_parameters: { properties: { channel_id: { @@ -20,8 +21,8 @@ Deno.test("AddPin generates valid FunctionManifest", () => { }, message: { type: SchemaTypes.string, - description: "Enter a message link or message timestamp", - title: "Message link or message timestamp", + description: "Enter a message URL or message timestamp", + title: "Message URL or message timestamp", }, }, required: ["channel_id", "message"], @@ -30,7 +31,7 @@ Deno.test("AddPin generates valid FunctionManifest", () => { }; const actual = AddPin.export(); - assertNotStrictEquals(actual, expected); + assertEquals(actual, expected); }); Deno.test("AddPin can be used as a Slack function in a workflow step", () => { diff --git a/src/schema/slack/functions/add_user_to_usergroup.ts b/src/schema/slack/functions/add_user_to_usergroup.ts index 5d572852..5218e908 100644 --- a/src/schema/slack/functions/add_user_to_usergroup.ts +++ b/src/schema/slack/functions/add_user_to_usergroup.ts @@ -6,8 +6,8 @@ import SlackTypes from "../schema_types.ts"; export default DefineFunction({ callback_id: "slack#/functions/add_user_to_usergroup", source_file: "", - title: "Add people to a user group", - description: "Additional permissions might be required", + title: "Add to user group", + description: "Add someone to a user group.", input_parameters: { properties: { usergroup_id: { diff --git a/src/schema/slack/functions/add_user_to_usergroup_test.ts b/src/schema/slack/functions/add_user_to_usergroup_test.ts index 6d190a39..d4a2e02c 100644 --- a/src/schema/slack/functions/add_user_to_usergroup_test.ts +++ b/src/schema/slack/functions/add_user_to_usergroup_test.ts @@ -1,9 +1,5 @@ /** This file was autogenerated. Follow the steps in src/schema/slack/functions/_scripts/README.md to rebuild **/ -import { - assertEquals, - assertExists, - assertNotStrictEquals, -} from "../../../dev_deps.ts"; +import { assertEquals, assertExists } from "../../../dev_deps.ts"; import { DefineWorkflow } from "../../../workflows/mod.ts"; import { ManifestFunctionSchema } from "../../../manifest/manifest_schema.ts"; import SchemaTypes from "../../schema_types.ts"; @@ -17,8 +13,8 @@ Deno.test("AddUserToUsergroup generates valid FunctionManifest", () => { ); const expected: ManifestFunctionSchema = { source_file: "", - title: "Add people to a user group", - description: "Additional permissions might be required", + title: "Add to user group", + description: "Add someone to a user group.", input_parameters: { properties: { usergroup_id: { @@ -48,7 +44,7 @@ Deno.test("AddUserToUsergroup generates valid FunctionManifest", () => { }; const actual = AddUserToUsergroup.export(); - assertNotStrictEquals(actual, expected); + assertEquals(actual, expected); }); Deno.test("AddUserToUsergroup can be used as a Slack function in a workflow step", () => { diff --git a/src/schema/slack/functions/archive_channel.ts b/src/schema/slack/functions/archive_channel.ts index 89edbd25..d47dadd3 100644 --- a/src/schema/slack/functions/archive_channel.ts +++ b/src/schema/slack/functions/archive_channel.ts @@ -6,6 +6,7 @@ export default DefineFunction({ callback_id: "slack#/functions/archive_channel", source_file: "", title: "Archive a channel", + description: "Archive a Slack channel", input_parameters: { properties: { channel_id: { diff --git a/src/schema/slack/functions/archive_channel_test.ts b/src/schema/slack/functions/archive_channel_test.ts index 9d4fbc92..5da9663a 100644 --- a/src/schema/slack/functions/archive_channel_test.ts +++ b/src/schema/slack/functions/archive_channel_test.ts @@ -1,9 +1,5 @@ /** This file was autogenerated. Follow the steps in src/schema/slack/functions/_scripts/README.md to rebuild **/ -import { - assertEquals, - assertExists, - assertNotStrictEquals, -} from "../../../dev_deps.ts"; +import { assertEquals, assertExists } from "../../../dev_deps.ts"; import { DefineWorkflow } from "../../../workflows/mod.ts"; import { ManifestFunctionSchema } from "../../../manifest/manifest_schema.ts"; import SlackTypes from "../schema_types.ts"; @@ -17,6 +13,7 @@ Deno.test("ArchiveChannel generates valid FunctionManifest", () => { const expected: ManifestFunctionSchema = { source_file: "", title: "Archive a channel", + description: "Archive a Slack channel", input_parameters: { properties: { channel_id: { @@ -40,7 +37,7 @@ Deno.test("ArchiveChannel generates valid FunctionManifest", () => { }; const actual = ArchiveChannel.export(); - assertNotStrictEquals(actual, expected); + assertEquals(actual, expected); }); Deno.test("ArchiveChannel can be used as a Slack function in a workflow step", () => { diff --git a/src/schema/slack/functions/create_channel.ts b/src/schema/slack/functions/create_channel.ts index 4a9e4b49..b876e81d 100644 --- a/src/schema/slack/functions/create_channel.ts +++ b/src/schema/slack/functions/create_channel.ts @@ -7,6 +7,7 @@ export default DefineFunction({ callback_id: "slack#/functions/create_channel", source_file: "", title: "Create a channel", + description: "Create a Slack channel", input_parameters: { properties: { channel_name: { diff --git a/src/schema/slack/functions/create_channel_test.ts b/src/schema/slack/functions/create_channel_test.ts index c0bc524e..8709f2b1 100644 --- a/src/schema/slack/functions/create_channel_test.ts +++ b/src/schema/slack/functions/create_channel_test.ts @@ -1,9 +1,5 @@ /** This file was autogenerated. Follow the steps in src/schema/slack/functions/_scripts/README.md to rebuild **/ -import { - assertEquals, - assertExists, - assertNotStrictEquals, -} from "../../../dev_deps.ts"; +import { assertEquals, assertExists } from "../../../dev_deps.ts"; import { DefineWorkflow } from "../../../workflows/mod.ts"; import { ManifestFunctionSchema } from "../../../manifest/manifest_schema.ts"; import SchemaTypes from "../../schema_types.ts"; @@ -18,6 +14,7 @@ Deno.test("CreateChannel generates valid FunctionManifest", () => { const expected: ManifestFunctionSchema = { source_file: "", title: "Create a channel", + description: "Create a Slack channel", input_parameters: { properties: { channel_name: { @@ -58,7 +55,7 @@ Deno.test("CreateChannel generates valid FunctionManifest", () => { }; const actual = CreateChannel.export(); - assertNotStrictEquals(actual, expected); + assertEquals(actual, expected); }); Deno.test("CreateChannel can be used as a Slack function in a workflow step", () => { diff --git a/src/schema/slack/functions/create_usergroup.ts b/src/schema/slack/functions/create_usergroup.ts index 70fd7c6b..382fd9b1 100644 --- a/src/schema/slack/functions/create_usergroup.ts +++ b/src/schema/slack/functions/create_usergroup.ts @@ -7,7 +7,7 @@ export default DefineFunction({ callback_id: "slack#/functions/create_usergroup", source_file: "", title: "Create a user group", - description: "Additional permissions might be required", + description: "Create a Slack user group", input_parameters: { properties: { usergroup_handle: { diff --git a/src/schema/slack/functions/create_usergroup_test.ts b/src/schema/slack/functions/create_usergroup_test.ts index cf1ec5a8..b4cb2926 100644 --- a/src/schema/slack/functions/create_usergroup_test.ts +++ b/src/schema/slack/functions/create_usergroup_test.ts @@ -1,9 +1,5 @@ /** This file was autogenerated. Follow the steps in src/schema/slack/functions/_scripts/README.md to rebuild **/ -import { - assertEquals, - assertExists, - assertNotStrictEquals, -} from "../../../dev_deps.ts"; +import { assertEquals, assertExists } from "../../../dev_deps.ts"; import { DefineWorkflow } from "../../../workflows/mod.ts"; import { ManifestFunctionSchema } from "../../../manifest/manifest_schema.ts"; import SchemaTypes from "../../schema_types.ts"; @@ -18,7 +14,7 @@ Deno.test("CreateUsergroup generates valid FunctionManifest", () => { const expected: ManifestFunctionSchema = { source_file: "", title: "Create a user group", - description: "Additional permissions might be required", + description: "Create a Slack user group", input_parameters: { properties: { usergroup_handle: { @@ -47,7 +43,7 @@ Deno.test("CreateUsergroup generates valid FunctionManifest", () => { }; const actual = CreateUsergroup.export(); - assertNotStrictEquals(actual, expected); + assertEquals(actual, expected); }); Deno.test("CreateUsergroup can be used as a Slack function in a workflow step", () => { diff --git a/src/schema/slack/functions/delay.ts b/src/schema/slack/functions/delay.ts index b4581ef1..5f6c63fb 100644 --- a/src/schema/slack/functions/delay.ts +++ b/src/schema/slack/functions/delay.ts @@ -5,8 +5,8 @@ import SchemaTypes from "../../schema_types.ts"; export default DefineFunction({ callback_id: "slack#/functions/delay", source_file: "", - title: "Delay this workflow", - description: "Pauses the workflow at this step", + title: "Delay", + description: "Pause the workflow for a set amount of time", input_parameters: { properties: { minutes_to_delay: { diff --git a/src/schema/slack/functions/delay_test.ts b/src/schema/slack/functions/delay_test.ts index 264c1ef5..e6fd5c50 100644 --- a/src/schema/slack/functions/delay_test.ts +++ b/src/schema/slack/functions/delay_test.ts @@ -1,5 +1,5 @@ /** This file was autogenerated. Follow the steps in src/schema/slack/functions/_scripts/README.md to rebuild **/ -import { assertEquals, assertNotStrictEquals } from "../../../dev_deps.ts"; +import { assertEquals } from "../../../dev_deps.ts"; import { DefineWorkflow } from "../../../workflows/mod.ts"; import { ManifestFunctionSchema } from "../../../manifest/manifest_schema.ts"; import SchemaTypes from "../../schema_types.ts"; @@ -9,8 +9,8 @@ Deno.test("Delay generates valid FunctionManifest", () => { assertEquals(Delay.definition.callback_id, "slack#/functions/delay"); const expected: ManifestFunctionSchema = { source_file: "", - title: "Delay this workflow", - description: "Pauses the workflow at this step", + title: "Delay", + description: "Pause the workflow for a set amount of time", input_parameters: { properties: { minutes_to_delay: { @@ -25,7 +25,7 @@ Deno.test("Delay generates valid FunctionManifest", () => { }; const actual = Delay.export(); - assertNotStrictEquals(actual, expected); + assertEquals(actual, expected); }); Deno.test("Delay can be used as a Slack function in a workflow step", () => { diff --git a/src/schema/slack/functions/invite_user_to_channel.ts b/src/schema/slack/functions/invite_user_to_channel.ts index 5c048940..cde840f3 100644 --- a/src/schema/slack/functions/invite_user_to_channel.ts +++ b/src/schema/slack/functions/invite_user_to_channel.ts @@ -6,9 +6,9 @@ import SlackTypes from "../schema_types.ts"; export default DefineFunction({ callback_id: "slack#/functions/invite_user_to_channel", source_file: "", - title: "Add people to a channel", + title: "Invite to channel", description: - "You or the people using the workflow must have permission to invite others to the channel", + "Invite someone to a channel. This will only work if this workflow created the channel.", input_parameters: { properties: { channel_ids: { diff --git a/src/schema/slack/functions/invite_user_to_channel_test.ts b/src/schema/slack/functions/invite_user_to_channel_test.ts index 86d05de0..6c7a4951 100644 --- a/src/schema/slack/functions/invite_user_to_channel_test.ts +++ b/src/schema/slack/functions/invite_user_to_channel_test.ts @@ -1,9 +1,5 @@ /** This file was autogenerated. Follow the steps in src/schema/slack/functions/_scripts/README.md to rebuild **/ -import { - assertEquals, - assertExists, - assertNotStrictEquals, -} from "../../../dev_deps.ts"; +import { assertEquals, assertExists } from "../../../dev_deps.ts"; import { DefineWorkflow } from "../../../workflows/mod.ts"; import { ManifestFunctionSchema } from "../../../manifest/manifest_schema.ts"; import SchemaTypes from "../../schema_types.ts"; @@ -17,9 +13,9 @@ Deno.test("InviteUserToChannel generates valid FunctionManifest", () => { ); const expected: ManifestFunctionSchema = { source_file: "", - title: "Add people to a channel", + title: "Invite to channel", description: - "You or the people using the workflow must have permission to invite others to the channel", + "Invite someone to a channel. This will only work if this workflow created the channel.", input_parameters: { properties: { channel_ids: { @@ -51,7 +47,7 @@ Deno.test("InviteUserToChannel generates valid FunctionManifest", () => { }; const actual = InviteUserToChannel.export(); - assertNotStrictEquals(actual, expected); + assertEquals(actual, expected); }); Deno.test("InviteUserToChannel can be used as a Slack function in a workflow step", () => { diff --git a/src/schema/slack/functions/mod.ts b/src/schema/slack/functions/mod.ts index ceb864d8..6cd4c1ed 100644 --- a/src/schema/slack/functions/mod.ts +++ b/src/schema/slack/functions/mod.ts @@ -1,4 +1,4 @@ -/** This file was autogenerated on Thu Nov 02 2023. Follow the steps in src/schema/slack/functions/_scripts/README.md to rebuild **/ +/** This file was autogenerated on Thu Sep 07 2023. Follow the steps in src/schema/slack/functions/_scripts/README.md to rebuild **/ import AddPin from "./add_pin.ts"; import AddUserToUsergroup from "./add_user_to_usergroup.ts"; import ArchiveChannel from "./archive_channel.ts"; diff --git a/src/schema/slack/functions/open_form.ts b/src/schema/slack/functions/open_form.ts index 3a119cf0..afd8824f 100644 --- a/src/schema/slack/functions/open_form.ts +++ b/src/schema/slack/functions/open_form.ts @@ -7,8 +7,8 @@ import { InternalSlackTypes } from "../types/custom/mod.ts"; export default DefineFunction({ callback_id: "slack#/functions/open_form", source_file: "", - title: "Collect info in a form", - description: "Uses a form to collect information", + title: "Open a form", + description: "Opens a form for the user", input_parameters: { properties: { title: { @@ -52,28 +52,7 @@ export default DefineFunction({ description: "Context about the form submit action interactive event", title: "interactivity", }, - submit_user: { - type: SlackTypes.user_id, - description: "Person who submitted the form", - title: "Person who submitted the form", - }, - timestamp_started: { - type: SlackTypes.timestamp, - description: "Time when step started", - title: "Time when step started", - }, - timestamp_completed: { - type: SlackTypes.timestamp, - description: "Time when step ended", - title: "Time when step ended", - }, }, - required: [ - "fields", - "interactivity", - "submit_user", - "timestamp_started", - "timestamp_completed", - ], + required: ["fields", "interactivity"], }, }); diff --git a/src/schema/slack/functions/open_form_test.ts b/src/schema/slack/functions/open_form_test.ts index e4ecebe3..2f27b565 100644 --- a/src/schema/slack/functions/open_form_test.ts +++ b/src/schema/slack/functions/open_form_test.ts @@ -1,9 +1,5 @@ /** This file was autogenerated. Follow the steps in src/schema/slack/functions/_scripts/README.md to rebuild **/ -import { - assertEquals, - assertExists, - assertNotStrictEquals, -} from "../../../dev_deps.ts"; +import { assertEquals, assertExists } from "../../../dev_deps.ts"; import { DefineWorkflow } from "../../../workflows/mod.ts"; import { ManifestFunctionSchema } from "../../../manifest/manifest_schema.ts"; import SchemaTypes from "../../schema_types.ts"; @@ -15,8 +11,8 @@ Deno.test("OpenForm generates valid FunctionManifest", () => { assertEquals(OpenForm.definition.callback_id, "slack#/functions/open_form"); const expected: ManifestFunctionSchema = { source_file: "", - title: "Collect info in a form", - description: "Uses a form to collect information", + title: "Open a form", + description: "Opens a form for the user", input_parameters: { properties: { title: { @@ -60,34 +56,13 @@ Deno.test("OpenForm generates valid FunctionManifest", () => { description: "Context about the form submit action interactive event", title: "interactivity", }, - submit_user: { - type: SlackTypes.user_id, - description: "Person who submitted the form", - title: "Person who submitted the form", - }, - timestamp_started: { - type: SlackTypes.timestamp, - description: "Time when step started", - title: "Time when step started", - }, - timestamp_completed: { - type: SlackTypes.timestamp, - description: "Time when step ended", - title: "Time when step ended", - }, }, - required: [ - "fields", - "interactivity", - "submit_user", - "timestamp_started", - "timestamp_completed", - ], + required: ["fields", "interactivity"], }, }; const actual = OpenForm.export(); - assertNotStrictEquals(actual, expected); + assertEquals(actual, expected); }); Deno.test("OpenForm can be used as a Slack function in a workflow step", () => { @@ -124,7 +99,4 @@ Deno.test("All outputs of Slack function OpenForm should exist", () => { }); assertExists(step.outputs.fields); assertExists(step.outputs.interactivity); - assertExists(step.outputs.submit_user); - assertExists(step.outputs.timestamp_started); - assertExists(step.outputs.timestamp_completed); }); diff --git a/src/schema/slack/functions/remove_user_from_usergroup.ts b/src/schema/slack/functions/remove_user_from_usergroup.ts index 8167b466..9891ee0c 100644 --- a/src/schema/slack/functions/remove_user_from_usergroup.ts +++ b/src/schema/slack/functions/remove_user_from_usergroup.ts @@ -6,8 +6,8 @@ import SlackTypes from "../schema_types.ts"; export default DefineFunction({ callback_id: "slack#/functions/remove_user_from_usergroup", source_file: "", - title: "Remove someone from a user group", - description: "Additional permissions might be required", + title: "Remove from a user group", + description: "Remove someone from a user group", input_parameters: { properties: { usergroup_id: { diff --git a/src/schema/slack/functions/remove_user_from_usergroup_test.ts b/src/schema/slack/functions/remove_user_from_usergroup_test.ts index e66c38b6..ffefa4f0 100644 --- a/src/schema/slack/functions/remove_user_from_usergroup_test.ts +++ b/src/schema/slack/functions/remove_user_from_usergroup_test.ts @@ -1,9 +1,5 @@ /** This file was autogenerated. Follow the steps in src/schema/slack/functions/_scripts/README.md to rebuild **/ -import { - assertEquals, - assertExists, - assertNotStrictEquals, -} from "../../../dev_deps.ts"; +import { assertEquals, assertExists } from "../../../dev_deps.ts"; import { DefineWorkflow } from "../../../workflows/mod.ts"; import { ManifestFunctionSchema } from "../../../manifest/manifest_schema.ts"; import SchemaTypes from "../../schema_types.ts"; @@ -17,8 +13,8 @@ Deno.test("RemoveUserFromUsergroup generates valid FunctionManifest", () => { ); const expected: ManifestFunctionSchema = { source_file: "", - title: "Remove someone from a user group", - description: "Additional permissions might be required", + title: "Remove from a user group", + description: "Remove someone from a user group", input_parameters: { properties: { usergroup_id: { @@ -48,7 +44,7 @@ Deno.test("RemoveUserFromUsergroup generates valid FunctionManifest", () => { }; const actual = RemoveUserFromUsergroup.export(); - assertNotStrictEquals(actual, expected); + assertEquals(actual, expected); }); Deno.test("RemoveUserFromUsergroup can be used as a Slack function in a workflow step", () => { diff --git a/src/schema/slack/functions/reply_in_thread.ts b/src/schema/slack/functions/reply_in_thread.ts index b4afefc0..887f6b89 100644 --- a/src/schema/slack/functions/reply_in_thread.ts +++ b/src/schema/slack/functions/reply_in_thread.ts @@ -6,7 +6,8 @@ import SlackTypes from "../schema_types.ts"; export default DefineFunction({ callback_id: "slack#/functions/reply_in_thread", source_file: "", - title: "Reply to a message in thread", + title: "Reply in thread", + description: "Send a message in a thread", input_parameters: { properties: { message_context: { @@ -36,17 +37,6 @@ export default DefineFunction({ additionalProperties: true, required: ["event_type", "event_payload"], }, - interactive_blocks: { - type: SlackTypes.blocks, - description: "Button(s) to send with the message", - title: "Button(s) to send with the message", - }, - files: { - type: SchemaTypes.array, - description: "File(s) to attach to the message", - title: "File(s) to attach to the message", - items: { type: SlackTypes.file_id }, - }, }, required: ["message_context", "message"], }, @@ -62,32 +52,7 @@ export default DefineFunction({ description: "Message link", title: "Message link", }, - action: { - type: SchemaTypes.object, - description: "Button interactivity data", - title: "Button interactivity data", - }, - interactivity: { - type: SlackTypes.interactivity, - description: "Interactivity context", - title: "interactivity", - }, - timestamp_started: { - type: SlackTypes.timestamp, - description: "Time when step started", - title: "Time when step started", - }, - timestamp_completed: { - type: SlackTypes.timestamp, - description: "Time when step ended", - title: "Time when step ended", - }, }, - required: [ - "message_context", - "message_link", - "timestamp_started", - "timestamp_completed", - ], + required: ["message_context", "message_link"], }, }); diff --git a/src/schema/slack/functions/reply_in_thread_test.ts b/src/schema/slack/functions/reply_in_thread_test.ts index ebe70ba8..7997a166 100644 --- a/src/schema/slack/functions/reply_in_thread_test.ts +++ b/src/schema/slack/functions/reply_in_thread_test.ts @@ -1,9 +1,5 @@ /** This file was autogenerated. Follow the steps in src/schema/slack/functions/_scripts/README.md to rebuild **/ -import { - assertEquals, - assertExists, - assertNotStrictEquals, -} from "../../../dev_deps.ts"; +import { assertEquals, assertExists } from "../../../dev_deps.ts"; import { DefineWorkflow } from "../../../workflows/mod.ts"; import { ManifestFunctionSchema } from "../../../manifest/manifest_schema.ts"; import SchemaTypes from "../../schema_types.ts"; @@ -17,7 +13,8 @@ Deno.test("ReplyInThread generates valid FunctionManifest", () => { ); const expected: ManifestFunctionSchema = { source_file: "", - title: "Reply to a message in thread", + title: "Reply in thread", + description: "Send a message in a thread", input_parameters: { properties: { message_context: { @@ -47,17 +44,6 @@ Deno.test("ReplyInThread generates valid FunctionManifest", () => { additionalProperties: true, required: ["event_type", "event_payload"], }, - interactive_blocks: { - type: SlackTypes.blocks, - description: "Button(s) to send with the message", - title: "Button(s) to send with the message", - }, - files: { - type: SchemaTypes.array, - description: "File(s) to attach to the message", - title: "File(s) to attach to the message", - items: { type: SlackTypes.file_id }, - }, }, required: ["message_context", "message"], }, @@ -73,38 +59,13 @@ Deno.test("ReplyInThread generates valid FunctionManifest", () => { description: "Message link", title: "Message link", }, - action: { - type: SchemaTypes.object, - description: "Button interactivity data", - title: "Button interactivity data", - }, - interactivity: { - type: SlackTypes.interactivity, - description: "Interactivity context", - title: "interactivity", - }, - timestamp_started: { - type: SlackTypes.timestamp, - description: "Time when step started", - title: "Time when step started", - }, - timestamp_completed: { - type: SlackTypes.timestamp, - description: "Time when step ended", - title: "Time when step ended", - }, }, - required: [ - "message_context", - "message_link", - "timestamp_started", - "timestamp_completed", - ], + required: ["message_context", "message_link"], }, }; const actual = ReplyInThread.export(); - assertNotStrictEquals(actual, expected); + assertEquals(actual, expected); }); Deno.test("ReplyInThread can be used as a Slack function in a workflow step", () => { @@ -135,8 +96,4 @@ Deno.test("All outputs of Slack function ReplyInThread should exist", () => { }); assertExists(step.outputs.message_context); assertExists(step.outputs.message_link); - assertExists(step.outputs.action); - assertExists(step.outputs.interactivity); - assertExists(step.outputs.timestamp_started); - assertExists(step.outputs.timestamp_completed); }); diff --git a/src/schema/slack/functions/send_dm.ts b/src/schema/slack/functions/send_dm.ts index 585ab818..d2ae2326 100644 --- a/src/schema/slack/functions/send_dm.ts +++ b/src/schema/slack/functions/send_dm.ts @@ -6,7 +6,8 @@ import SlackTypes from "../schema_types.ts"; export default DefineFunction({ callback_id: "slack#/functions/send_dm", source_file: "", - title: "Send a message to a person", + title: "Send a direct message", + description: "Send a direct message to someone", input_parameters: { properties: { user_id: { @@ -24,12 +25,6 @@ export default DefineFunction({ description: "Button(s) to send with the message", title: "Button(s) to send with the message", }, - files: { - type: SchemaTypes.array, - description: "File(s) to attach to the message", - title: "File(s) to attach to the message", - items: { type: SlackTypes.file_id }, - }, }, required: ["user_id", "message"], }, @@ -60,23 +55,7 @@ export default DefineFunction({ description: "Reference to the message sent", title: "Reference to the message sent", }, - timestamp_started: { - type: SlackTypes.timestamp, - description: "Time when step started", - title: "Time when step started", - }, - timestamp_completed: { - type: SlackTypes.timestamp, - description: "Time when step ended", - title: "Time when step ended", - }, }, - required: [ - "message_timestamp", - "message_link", - "message_context", - "timestamp_started", - "timestamp_completed", - ], + required: ["message_timestamp", "message_link", "message_context"], }, }); diff --git a/src/schema/slack/functions/send_dm_test.ts b/src/schema/slack/functions/send_dm_test.ts index eaa536e2..e65a72be 100644 --- a/src/schema/slack/functions/send_dm_test.ts +++ b/src/schema/slack/functions/send_dm_test.ts @@ -1,9 +1,5 @@ /** This file was autogenerated. Follow the steps in src/schema/slack/functions/_scripts/README.md to rebuild **/ -import { - assertEquals, - assertExists, - assertNotStrictEquals, -} from "../../../dev_deps.ts"; +import { assertEquals, assertExists } from "../../../dev_deps.ts"; import { DefineWorkflow } from "../../../workflows/mod.ts"; import { ManifestFunctionSchema } from "../../../manifest/manifest_schema.ts"; import SchemaTypes from "../../schema_types.ts"; @@ -14,7 +10,8 @@ Deno.test("SendDm generates valid FunctionManifest", () => { assertEquals(SendDm.definition.callback_id, "slack#/functions/send_dm"); const expected: ManifestFunctionSchema = { source_file: "", - title: "Send a message to a person", + title: "Send a direct message", + description: "Send a direct message to someone", input_parameters: { properties: { user_id: { @@ -32,12 +29,6 @@ Deno.test("SendDm generates valid FunctionManifest", () => { description: "Button(s) to send with the message", title: "Button(s) to send with the message", }, - files: { - type: SchemaTypes.array, - description: "File(s) to attach to the message", - title: "File(s) to attach to the message", - items: { type: SlackTypes.file_id }, - }, }, required: ["user_id", "message"], }, @@ -68,29 +59,13 @@ Deno.test("SendDm generates valid FunctionManifest", () => { description: "Reference to the message sent", title: "Reference to the message sent", }, - timestamp_started: { - type: SlackTypes.timestamp, - description: "Time when step started", - title: "Time when step started", - }, - timestamp_completed: { - type: SlackTypes.timestamp, - description: "Time when step ended", - title: "Time when step ended", - }, }, - required: [ - "message_timestamp", - "message_link", - "message_context", - "timestamp_started", - "timestamp_completed", - ], + required: ["message_timestamp", "message_link", "message_context"], }, }; const actual = SendDm.export(); - assertNotStrictEquals(actual, expected); + assertEquals(actual, expected); }); Deno.test("SendDm can be used as a Slack function in a workflow step", () => { @@ -121,6 +96,4 @@ Deno.test("All outputs of Slack function SendDm should exist", () => { assertExists(step.outputs.action); assertExists(step.outputs.interactivity); assertExists(step.outputs.message_context); - assertExists(step.outputs.timestamp_started); - assertExists(step.outputs.timestamp_completed); }); diff --git a/src/schema/slack/functions/send_ephemeral_message.ts b/src/schema/slack/functions/send_ephemeral_message.ts index 44d64071..12ffe02e 100644 --- a/src/schema/slack/functions/send_ephemeral_message.ts +++ b/src/schema/slack/functions/send_ephemeral_message.ts @@ -6,9 +6,8 @@ import SlackTypes from "../schema_types.ts"; export default DefineFunction({ callback_id: "slack#/functions/send_ephemeral_message", source_file: "", - title: 'Send an "only visible to you" message', - description: - "Send a temporary message to someone in a channel that only they can see", + title: "Send an ephemeral message", + description: "Send a private message to someone in a channel", input_parameters: { properties: { channel_id: { diff --git a/src/schema/slack/functions/send_ephemeral_message_test.ts b/src/schema/slack/functions/send_ephemeral_message_test.ts index 0ae0f741..a33d46f7 100644 --- a/src/schema/slack/functions/send_ephemeral_message_test.ts +++ b/src/schema/slack/functions/send_ephemeral_message_test.ts @@ -1,9 +1,5 @@ /** This file was autogenerated. Follow the steps in src/schema/slack/functions/_scripts/README.md to rebuild **/ -import { - assertEquals, - assertExists, - assertNotStrictEquals, -} from "../../../dev_deps.ts"; +import { assertEquals, assertExists } from "../../../dev_deps.ts"; import { DefineWorkflow } from "../../../workflows/mod.ts"; import { ManifestFunctionSchema } from "../../../manifest/manifest_schema.ts"; import SchemaTypes from "../../schema_types.ts"; @@ -17,9 +13,8 @@ Deno.test("SendEphemeralMessage generates valid FunctionManifest", () => { ); const expected: ManifestFunctionSchema = { source_file: "", - title: 'Send an "only visible to you" message', - description: - "Send a temporary message to someone in a channel that only they can see", + title: "Send an ephemeral message", + description: "Send a private message to someone in a channel", input_parameters: { properties: { channel_id: { @@ -37,6 +32,7 @@ Deno.test("SendEphemeralMessage generates valid FunctionManifest", () => { description: "Add a message", title: "Add a message", }, + // thread_ts will be removed, maybe, in a future change. ask @shapirone if in doubt thread_ts: { type: SchemaTypes.string, description: @@ -48,6 +44,7 @@ Deno.test("SendEphemeralMessage generates valid FunctionManifest", () => { }, output_parameters: { properties: { + // message_ts will be renamed message_timestamp.. soon. ask @shapirone for more info message_ts: { type: SlackTypes.message_ts, description: "Message time stamp", @@ -59,7 +56,7 @@ Deno.test("SendEphemeralMessage generates valid FunctionManifest", () => { }; const actual = SendEphemeralMessage.export(); - assertNotStrictEquals(actual, expected); + assertEquals(actual, expected); }); Deno.test("SendEphemeralMessage can be used as a Slack function in a workflow step", () => { diff --git a/src/schema/slack/functions/send_message.ts b/src/schema/slack/functions/send_message.ts index 7becb038..6e883511 100644 --- a/src/schema/slack/functions/send_message.ts +++ b/src/schema/slack/functions/send_message.ts @@ -6,7 +6,8 @@ import SlackTypes from "../schema_types.ts"; export default DefineFunction({ callback_id: "slack#/functions/send_message", source_file: "", - title: "Send a message to a channel", + title: "Send a message to channel", + description: "Send a message to channel", input_parameters: { properties: { channel_id: { @@ -36,12 +37,6 @@ export default DefineFunction({ description: "Button(s) to send with the message", title: "Button(s) to send with the message", }, - files: { - type: SchemaTypes.array, - description: "File(s) to attach to the message", - title: "File(s) to attach to the message", - items: { type: SlackTypes.file_id }, - }, }, required: ["channel_id", "message"], }, @@ -72,23 +67,7 @@ export default DefineFunction({ description: "Reference to the message sent", title: "Reference to the message sent", }, - timestamp_started: { - type: SlackTypes.timestamp, - description: "Time when step started", - title: "Time when step started", - }, - timestamp_completed: { - type: SlackTypes.timestamp, - description: "Time when step ended", - title: "Time when step ended", - }, }, - required: [ - "message_timestamp", - "message_link", - "message_context", - "timestamp_started", - "timestamp_completed", - ], + required: ["message_timestamp", "message_link", "message_context"], }, }); diff --git a/src/schema/slack/functions/send_message_test.ts b/src/schema/slack/functions/send_message_test.ts index e4c2943a..968cffc3 100644 --- a/src/schema/slack/functions/send_message_test.ts +++ b/src/schema/slack/functions/send_message_test.ts @@ -1,9 +1,5 @@ /** This file was autogenerated. Follow the steps in src/schema/slack/functions/_scripts/README.md to rebuild **/ -import { - assertEquals, - assertExists, - assertNotStrictEquals, -} from "../../../dev_deps.ts"; +import { assertEquals, assertExists } from "../../../dev_deps.ts"; import { DefineWorkflow } from "../../../workflows/mod.ts"; import { ManifestFunctionSchema } from "../../../manifest/manifest_schema.ts"; import SchemaTypes from "../../schema_types.ts"; @@ -17,7 +13,8 @@ Deno.test("SendMessage generates valid FunctionManifest", () => { ); const expected: ManifestFunctionSchema = { source_file: "", - title: "Send a message to a channel", + title: "Send a message to channel", + description: "Send a message to channel", input_parameters: { properties: { channel_id: { @@ -47,12 +44,6 @@ Deno.test("SendMessage generates valid FunctionManifest", () => { description: "Button(s) to send with the message", title: "Button(s) to send with the message", }, - files: { - type: SchemaTypes.array, - description: "File(s) to attach to the message", - title: "File(s) to attach to the message", - items: { type: SlackTypes.file_id }, - }, }, required: ["channel_id", "message"], }, @@ -83,29 +74,13 @@ Deno.test("SendMessage generates valid FunctionManifest", () => { description: "Reference to the message sent", title: "Reference to the message sent", }, - timestamp_started: { - type: SlackTypes.timestamp, - description: "Time when step started", - title: "Time when step started", - }, - timestamp_completed: { - type: SlackTypes.timestamp, - description: "Time when step ended", - title: "Time when step ended", - }, }, - required: [ - "message_timestamp", - "message_link", - "message_context", - "timestamp_started", - "timestamp_completed", - ], + required: ["message_timestamp", "message_link", "message_context"], }, }; const actual = SendMessage.export(); - assertNotStrictEquals(actual, expected); + assertEquals(actual, expected); }); Deno.test("SendMessage can be used as a Slack function in a workflow step", () => { @@ -136,6 +111,4 @@ Deno.test("All outputs of Slack function SendMessage should exist", () => { assertExists(step.outputs.action); assertExists(step.outputs.interactivity); assertExists(step.outputs.message_context); - assertExists(step.outputs.timestamp_started); - assertExists(step.outputs.timestamp_completed); }); diff --git a/src/schema/slack/functions/update_channel_topic.ts b/src/schema/slack/functions/update_channel_topic.ts index 35c3cb0c..76f05ff2 100644 --- a/src/schema/slack/functions/update_channel_topic.ts +++ b/src/schema/slack/functions/update_channel_topic.ts @@ -6,9 +6,9 @@ import SlackTypes from "../schema_types.ts"; export default DefineFunction({ callback_id: "slack#/functions/update_channel_topic", source_file: "", - title: "Update the channel topic", + title: "Update channel topic", description: - "You or the people using the workflow must be members of the channel", + "Update the topic of a specific channel. This will work only if this workflow created the channel.", input_parameters: { properties: { channel_id: { diff --git a/src/schema/slack/functions/update_channel_topic_test.ts b/src/schema/slack/functions/update_channel_topic_test.ts index 824c833a..3cf4981e 100644 --- a/src/schema/slack/functions/update_channel_topic_test.ts +++ b/src/schema/slack/functions/update_channel_topic_test.ts @@ -1,9 +1,5 @@ /** This file was autogenerated. Follow the steps in src/schema/slack/functions/_scripts/README.md to rebuild **/ -import { - assertEquals, - assertExists, - assertNotStrictEquals, -} from "../../../dev_deps.ts"; +import { assertEquals, assertExists } from "../../../dev_deps.ts"; import { DefineWorkflow } from "../../../workflows/mod.ts"; import { ManifestFunctionSchema } from "../../../manifest/manifest_schema.ts"; import SchemaTypes from "../../schema_types.ts"; @@ -17,9 +13,9 @@ Deno.test("UpdateChannelTopic generates valid FunctionManifest", () => { ); const expected: ManifestFunctionSchema = { source_file: "", - title: "Update the channel topic", + title: "Update channel topic", description: - "You or the people using the workflow must be members of the channel", + "Update the topic of a specific channel. This will work only if this workflow created the channel.", input_parameters: { properties: { channel_id: { @@ -48,7 +44,7 @@ Deno.test("UpdateChannelTopic generates valid FunctionManifest", () => { }; const actual = UpdateChannelTopic.export(); - assertNotStrictEquals(actual, expected); + assertEquals(actual, expected); }); Deno.test("UpdateChannelTopic can be used as a Slack function in a workflow step", () => { diff --git a/src/schema/slack/types/mod.ts b/src/schema/slack/types/mod.ts index b0be5b48..b5a7061c 100644 --- a/src/schema/slack/types/mod.ts +++ b/src/schema/slack/types/mod.ts @@ -8,7 +8,6 @@ const SlackPrimitiveTypes = { oauth2: "slack#/types/credential/oauth2", rich_text: "slack#/types/rich_text", message_ts: "slack#/types/message_ts", - file_id: "slack#/types/file_id", } as const; export type ValidSlackPrimitiveTypes =