diff --git a/src/connectors/atlassian.bitbucket/functions/create_issue.ts b/src/connectors/atlassian.bitbucket/functions/create_issue.ts new file mode 100644 index 0000000..f1fa4a8 --- /dev/null +++ b/src/connectors/atlassian.bitbucket/functions/create_issue.ts @@ -0,0 +1,87 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import { DefineConnector } from "../../../deps.ts"; +import { Schema } from "../../../deps.ts"; + +export default DefineConnector({ + callback_id: "A05Q8KLHEHJ#/functions/create_issue", + title: "Create an issue", + description: "Create a bitbucket cloud issue", + input_parameters: { + properties: { + workspace: { + type: Schema.types.string, + description: "Enter bitbucket workspace", + title: "Bitbucket workspace", + }, + repo_slug: { + type: Schema.types.string, + description: "Enter repository name", + title: "Repository", + }, + title: { + type: Schema.types.string, + description: "Title of the issue", + title: "Title", + }, + description: { + type: Schema.types.string, + description: "Description of the issue", + title: "Description", + }, + kind: { + type: Schema.types.string, + description: "Issue kind", + title: "Kind", + enum: ["bug", "enhancement", "proposal", "task"], + }, + priority: { + type: Schema.types.string, + description: "Priority of the issue", + title: "Priority", + enum: ["trivial", "minior", "major", "critical", "blocker"], + }, + assignee_uuid: { + type: Schema.types.string, + description: "Select an option...", + title: "Assignee", + }, + bitbucket_access_token: { + type: Schema.slack.types.oauth2, + title: "bitbucket access token", + }, + }, + required: [ + "workspace", + "repo_slug", + "title", + "description", + "assignee_uuid", + "bitbucket_access_token", + ], + }, + output_parameters: { + properties: { + issue_id: { + type: Schema.types.string, + description: "Id of the issue", + title: "Issue ID", + }, + title: { + type: Schema.types.string, + description: "Title of the issue", + title: "Title", + }, + kind: { + type: Schema.types.string, + description: "Kind of the issue", + title: "Kind", + }, + priority: { + type: Schema.types.string, + description: "Priority of the issue", + title: "Priority", + }, + }, + required: [], + }, +}); diff --git a/src/connectors/atlassian.bitbucket/functions/create_issue_test.ts b/src/connectors/atlassian.bitbucket/functions/create_issue_test.ts new file mode 100644 index 0000000..e86b28d --- /dev/null +++ b/src/connectors/atlassian.bitbucket/functions/create_issue_test.ts @@ -0,0 +1,51 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import { assertEquals, assertExists } from "../../../dev_deps.ts"; +import { DefineWorkflow } from "../../../dev_deps.ts"; +import CreateIssue from "./create_issue.ts"; + +Deno.test("CreateIssue can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateIssue_slack_function", + title: "Test CreateIssue", + description: "This is a generated test to test CreateIssue", + }); + testWorkflow.addStep(CreateIssue, { + workspace: "test", + repo_slug: "test", + title: "test", + description: "test", + assignee_uuid: "test", + bitbucket_access_token: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05Q8KLHEHJ#/functions/create_issue"); + assertEquals(actual.inputs, { + workspace: "test", + repo_slug: "test", + title: "test", + description: "test", + assignee_uuid: "test", + bitbucket_access_token: "test", + }); +}); + +Deno.test("All outputs of Slack function CreateIssue should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateIssue_slack_function", + title: "Test CreateIssue", + description: "This is a generated test to test CreateIssue", + }); + const step = testWorkflow.addStep(CreateIssue, { + workspace: "test", + repo_slug: "test", + title: "test", + description: "test", + assignee_uuid: "test", + bitbucket_access_token: "test", + }); + assertExists(step.outputs.issue_id); + assertExists(step.outputs.title); + assertExists(step.outputs.kind); + assertExists(step.outputs.priority); +}); diff --git a/src/connectors/atlassian.bitbucket/functions/merge_pull_request.ts b/src/connectors/atlassian.bitbucket/functions/merge_pull_request.ts new file mode 100644 index 0000000..e17f528 --- /dev/null +++ b/src/connectors/atlassian.bitbucket/functions/merge_pull_request.ts @@ -0,0 +1,66 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import { DefineConnector } from "../../../deps.ts"; +import { Schema } from "../../../deps.ts"; + +export default DefineConnector({ + callback_id: "A05Q8KLHEHJ#/functions/merge_pull_request", + title: "Merge pull request", + input_parameters: { + properties: { + workspace: { + type: Schema.types.string, + description: "Enter Bitbucket workspace", + title: "Bitbucket workspace", + }, + repo_slug: { + type: Schema.types.string, + description: "Enter repository name", + title: "Repository", + }, + pull_request_id: { + type: Schema.types.string, + description: "Enter a pull request ID", + title: "Pull request ID", + }, + message: { + type: Schema.types.string, + description: "Enter a message", + title: "Message", + }, + close_source_branch: { + type: Schema.types.boolean, + description: "Enter Close Source Branch", + title: "Close Source Branch", + }, + merge_strategy: { + type: Schema.types.string, + description: "Enter merge strategy", + title: "Merge strategy", + enum: ["merge_commit", "squash", "fast_forward"], + }, + bitbucket_access_token: { + type: Schema.slack.types.oauth2, + title: "bitbucket access token", + }, + }, + required: [ + "workspace", + "repo_slug", + "pull_request_id", + "bitbucket_access_token", + ], + }, + output_parameters: { + properties: { + response: { type: Schema.types.string, title: "Response code" }, + workspace: { type: Schema.types.string, title: "Bitbucket workspace ID" }, + repo_slug: { type: Schema.types.string, title: "Repository ID" }, + pull_request_id: { + type: Schema.types.string, + description: "ID of the pull request to be merged", + title: "Pull request ID", + }, + }, + required: [], + }, +}); diff --git a/src/connectors/atlassian.bitbucket/functions/merge_pull_request_test.ts b/src/connectors/atlassian.bitbucket/functions/merge_pull_request_test.ts new file mode 100644 index 0000000..f6287da --- /dev/null +++ b/src/connectors/atlassian.bitbucket/functions/merge_pull_request_test.ts @@ -0,0 +1,45 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import { assertEquals, assertExists } from "../../../dev_deps.ts"; +import { DefineWorkflow } from "../../../dev_deps.ts"; +import MergePullRequest from "./merge_pull_request.ts"; + +Deno.test("MergePullRequest can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_MergePullRequest_slack_function", + title: "Test MergePullRequest", + description: "This is a generated test to test MergePullRequest", + }); + testWorkflow.addStep(MergePullRequest, { + workspace: "test", + repo_slug: "test", + pull_request_id: "test", + bitbucket_access_token: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05Q8KLHEHJ#/functions/merge_pull_request"); + assertEquals(actual.inputs, { + workspace: "test", + repo_slug: "test", + pull_request_id: "test", + bitbucket_access_token: "test", + }); +}); + +Deno.test("All outputs of Slack function MergePullRequest should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_MergePullRequest_slack_function", + title: "Test MergePullRequest", + description: "This is a generated test to test MergePullRequest", + }); + const step = testWorkflow.addStep(MergePullRequest, { + workspace: "test", + repo_slug: "test", + pull_request_id: "test", + bitbucket_access_token: "test", + }); + assertExists(step.outputs.response); + assertExists(step.outputs.workspace); + assertExists(step.outputs.repo_slug); + assertExists(step.outputs.pull_request_id); +}); diff --git a/src/connectors/atlassian.bitbucket/mod.ts b/src/connectors/atlassian.bitbucket/mod.ts new file mode 100644 index 0000000..5b74cc1 --- /dev/null +++ b/src/connectors/atlassian.bitbucket/mod.ts @@ -0,0 +1,18 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import CreateIssue from "./functions/create_issue.ts"; +import MergePullRequest from "./functions/merge_pull_request.ts"; + +const AtlassianBitbucket = { + functions: { + /** + * @see The {@link https://api.slack.com/reference/connectors/atlassian.bitbucket/create_issue CreateIssue} documentation. + */ + CreateIssue, + /** + * @see The {@link https://api.slack.com/reference/connectors/atlassian.bitbucket/merge_pull_request MergePullRequest} documentation. + */ + MergePullRequest, + }, +} as const; + +export default AtlassianBitbucket; diff --git a/src/connectors/google.mail/functions/send_email.ts b/src/connectors/google.mail/functions/send_email.ts new file mode 100644 index 0000000..ec54940 --- /dev/null +++ b/src/connectors/google.mail/functions/send_email.ts @@ -0,0 +1,53 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import { DefineConnector } from "../../../deps.ts"; +import { Schema } from "../../../deps.ts"; + +export default DefineConnector({ + callback_id: "A05Q7MZ8WH1#/functions/send_email", + title: "Send an email", + input_parameters: { + properties: { + subject: { + type: Schema.types.string, + description: "Enter text", + title: "Subject", + }, + email_body: { + type: Schema.slack.types.rich_text, + description: "Enter text", + title: "Email body", + }, + recipients: { + type: Schema.types.array, + description: "Search all people...", + title: "Recipients", + items: { type: Schema.slack.types.user_id }, + }, + additional_recipients: { + type: Schema.types.array, + description: "Enter email addresses", + title: "Additional Recipients", + items: { type: Schema.types.string }, + }, + cc_recipients: { + type: Schema.types.array, + description: "Enter email addresses", + title: "CC Recipients", + items: { type: Schema.types.string }, + }, + bcc_recipients: { + type: Schema.types.array, + description: "Enter email addresses", + title: "BCC Recipients", + items: { type: Schema.types.string }, + }, + google_access_token: { + type: Schema.slack.types.oauth2, + description: "Google access token", + title: "Google access token", + }, + }, + required: ["subject", "email_body", "google_access_token"], + }, + output_parameters: { properties: {}, required: [] }, +}); diff --git a/src/connectors/google.mail/functions/send_email_test.ts b/src/connectors/google.mail/functions/send_email_test.ts new file mode 100644 index 0000000..10e42d0 --- /dev/null +++ b/src/connectors/google.mail/functions/send_email_test.ts @@ -0,0 +1,25 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import { assertEquals } from "../../../dev_deps.ts"; +import { DefineWorkflow } from "../../../dev_deps.ts"; +import SendEmail from "./send_email.ts"; + +Deno.test("SendEmail can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_SendEmail_slack_function", + title: "Test SendEmail", + description: "This is a generated test to test SendEmail", + }); + testWorkflow.addStep(SendEmail, { + subject: "test", + email_body: "test", + google_access_token: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05Q7MZ8WH1#/functions/send_email"); + assertEquals(actual.inputs, { + subject: "test", + email_body: "test", + google_access_token: "test", + }); +}); diff --git a/src/connectors/google.mail/mod.ts b/src/connectors/google.mail/mod.ts new file mode 100644 index 0000000..f64d710 --- /dev/null +++ b/src/connectors/google.mail/mod.ts @@ -0,0 +1,13 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import SendEmail from "./functions/send_email.ts"; + +const GoogleMail = { + functions: { + /** + * @see The {@link https://api.slack.com/reference/connectors/google.mail/send_email SendEmail} documentation. + */ + SendEmail, + }, +} as const; + +export default GoogleMail; diff --git a/src/connectors/google.sheets/functions/update_spreadsheet_row.ts b/src/connectors/google.sheets/functions/update_spreadsheet_row.ts index 9233f22..7482172 100644 --- a/src/connectors/google.sheets/functions/update_spreadsheet_row.ts +++ b/src/connectors/google.sheets/functions/update_spreadsheet_row.ts @@ -28,11 +28,7 @@ export default DefineConnector({ description: "Add a value", title: "Cell value to find", }, - updated_values: { - type: Schema.types.object, - description: "updated_values", - title: "Updated Values", - }, + updated_values: { type: Schema.types.object, title: "Updated Values" }, google_access_token: { type: Schema.slack.types.oauth2, description: "Which account should we use to write to the spreadsheet?", diff --git a/src/connectors/jira.cloud/functions/edit_issue.ts b/src/connectors/jira.cloud/functions/edit_issue.ts index 738c918..640d7fa 100644 --- a/src/connectors/jira.cloud/functions/edit_issue.ts +++ b/src/connectors/jira.cloud/functions/edit_issue.ts @@ -4,7 +4,7 @@ import { Schema } from "../../../deps.ts"; export default DefineConnector({ callback_id: "A04T6GE3LEB#/functions/edit_issue", - title: "Edit an Issue", + title: "Edit an issue", description: "Edit a JIRA Cloud issue", input_parameters: { properties: { @@ -31,12 +31,12 @@ export default DefineConnector({ }, summary: { type: Schema.types.string, - description: "Summary of the bug or issue ...", + description: "Summary of the bug or issue...", title: "Summary", }, description: { type: Schema.types.string, - description: "Description of the bug or issue ...", + description: "Description of the bug or issue...", title: "Description", }, }, diff --git a/src/connectors/microsoft.onedrive/functions/copy_file.ts b/src/connectors/microsoft.onedrive/functions/copy_file.ts new file mode 100644 index 0000000..d654df7 --- /dev/null +++ b/src/connectors/microsoft.onedrive/functions/copy_file.ts @@ -0,0 +1,36 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import { DefineConnector } from "../../../deps.ts"; +import { Schema } from "../../../deps.ts"; + +export default DefineConnector({ + callback_id: "A05QGK4DF8A#/functions/copy_file", + title: "Copy a file", + input_parameters: { + properties: { + onedrive_access_token: { + type: Schema.slack.types.oauth2, + description: "Microsoft credential to use", + title: "Microsoft access token", + }, + file_id: { + type: Schema.types.string, + description: "Select file", + title: "File ID", + }, + new_file_name: { + type: Schema.types.string, + description: "Enter text", + title: "New file name", + }, + }, + required: ["onedrive_access_token", "file_id", "new_file_name"], + }, + output_parameters: { + properties: { + response: { type: Schema.types.string, title: "Response" }, + new_file_name: { type: Schema.types.string, title: "New file name" }, + file_url: { type: Schema.types.string, title: "File URL" }, + }, + required: ["response"], + }, +}); diff --git a/src/connectors/microsoft.onedrive/functions/copy_file_test.ts b/src/connectors/microsoft.onedrive/functions/copy_file_test.ts new file mode 100644 index 0000000..13c395f --- /dev/null +++ b/src/connectors/microsoft.onedrive/functions/copy_file_test.ts @@ -0,0 +1,41 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import { assertEquals, assertExists } from "../../../dev_deps.ts"; +import { DefineWorkflow } from "../../../dev_deps.ts"; +import CopyFile from "./copy_file.ts"; + +Deno.test("CopyFile can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CopyFile_slack_function", + title: "Test CopyFile", + description: "This is a generated test to test CopyFile", + }); + testWorkflow.addStep(CopyFile, { + onedrive_access_token: "test", + file_id: "test", + new_file_name: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05QGK4DF8A#/functions/copy_file"); + assertEquals(actual.inputs, { + onedrive_access_token: "test", + file_id: "test", + new_file_name: "test", + }); +}); + +Deno.test("All outputs of Slack function CopyFile should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CopyFile_slack_function", + title: "Test CopyFile", + description: "This is a generated test to test CopyFile", + }); + const step = testWorkflow.addStep(CopyFile, { + onedrive_access_token: "test", + file_id: "test", + new_file_name: "test", + }); + assertExists(step.outputs.response); + assertExists(step.outputs.new_file_name); + assertExists(step.outputs.file_url); +}); diff --git a/src/connectors/microsoft.onedrive/functions/create_file.ts b/src/connectors/microsoft.onedrive/functions/create_file.ts new file mode 100644 index 0000000..28ff469 --- /dev/null +++ b/src/connectors/microsoft.onedrive/functions/create_file.ts @@ -0,0 +1,41 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import { DefineConnector } from "../../../deps.ts"; +import { Schema } from "../../../deps.ts"; + +export default DefineConnector({ + callback_id: "A05QGK4DF8A#/functions/create_file", + title: "Create a file", + description: "Creates a file in users OneDrive root directory", + input_parameters: { + properties: { + onedrive_access_token: { + type: Schema.slack.types.oauth2, + description: "Microsoft credential to use", + title: "Microsoft access token", + }, + file_name: { + type: Schema.types.string, + description: "Enter text", + title: "File name", + }, + file_type: { + type: Schema.types.string, + description: "Select file type", + title: "File type", + enum: ["pptx", "docx", "xlsx"], + }, + }, + required: ["onedrive_access_token", "file_name", "file_type"], + }, + output_parameters: { + properties: { + file_url: { type: Schema.types.string, title: "File URL" }, + file_name: { + type: Schema.types.string, + description: "File name", + title: "File name", + }, + }, + required: [], + }, +}); diff --git a/src/connectors/microsoft.onedrive/functions/create_file_test.ts b/src/connectors/microsoft.onedrive/functions/create_file_test.ts new file mode 100644 index 0000000..0fa43ff --- /dev/null +++ b/src/connectors/microsoft.onedrive/functions/create_file_test.ts @@ -0,0 +1,40 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import { assertEquals, assertExists } from "../../../dev_deps.ts"; +import { DefineWorkflow } from "../../../dev_deps.ts"; +import CreateFile from "./create_file.ts"; + +Deno.test("CreateFile can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateFile_slack_function", + title: "Test CreateFile", + description: "This is a generated test to test CreateFile", + }); + testWorkflow.addStep(CreateFile, { + onedrive_access_token: "test", + file_name: "test", + file_type: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05QGK4DF8A#/functions/create_file"); + assertEquals(actual.inputs, { + onedrive_access_token: "test", + file_name: "test", + file_type: "test", + }); +}); + +Deno.test("All outputs of Slack function CreateFile should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateFile_slack_function", + title: "Test CreateFile", + description: "This is a generated test to test CreateFile", + }); + const step = testWorkflow.addStep(CreateFile, { + onedrive_access_token: "test", + file_name: "test", + file_type: "test", + }); + assertExists(step.outputs.file_url); + assertExists(step.outputs.file_name); +}); diff --git a/src/connectors/microsoft.onedrive/mod.ts b/src/connectors/microsoft.onedrive/mod.ts new file mode 100644 index 0000000..d5545f6 --- /dev/null +++ b/src/connectors/microsoft.onedrive/mod.ts @@ -0,0 +1,18 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import CopyFile from "./functions/copy_file.ts"; +import CreateFile from "./functions/create_file.ts"; + +const MicrosoftOnedrive = { + functions: { + /** + * @see The {@link https://api.slack.com/reference/connectors/microsoft.onedrive/copy_file CopyFile} documentation. + */ + CopyFile, + /** + * @see The {@link https://api.slack.com/reference/connectors/microsoft.onedrive/create_file CreateFile} documentation. + */ + CreateFile, + }, +} as const; + +export default MicrosoftOnedrive; diff --git a/src/connectors/microsoft.outlook.calendar/functions/create_event.ts b/src/connectors/microsoft.outlook.calendar/functions/create_event.ts new file mode 100644 index 0000000..73b77c4 --- /dev/null +++ b/src/connectors/microsoft.outlook.calendar/functions/create_event.ts @@ -0,0 +1,44 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import { DefineConnector } from "../../../deps.ts"; +import { Schema } from "../../../deps.ts"; + +export default DefineConnector({ + callback_id: "A05QGEFR3SP#/functions/create_event", + title: "Create a calendar event", + input_parameters: { + properties: { + outlook_access_token: { + type: Schema.slack.types.oauth2, + description: "Outlook credential to use", + title: "Outlook access token", + }, + event_title: { type: Schema.types.string, title: "Title" }, + start_time: { type: Schema.slack.types.timestamp, title: "Start time" }, + end_time: { type: Schema.slack.types.timestamp, title: "End time" }, + timezone: { + type: Schema.types.string, + description: "Select a timezone", + title: "Timezone", + }, + attendees: { + type: Schema.types.array, + description: "Search all people...", + title: "Attendees", + items: { type: Schema.slack.types.user_id }, + }, + }, + required: [ + "event_title", + "start_time", + "end_time", + "timezone", + "attendees", + ], + }, + output_parameters: { + properties: { + event_url: { type: Schema.types.string, title: "Event URL" }, + }, + required: [], + }, +}); diff --git a/src/connectors/microsoft.outlook.calendar/functions/create_event_test.ts b/src/connectors/microsoft.outlook.calendar/functions/create_event_test.ts new file mode 100644 index 0000000..eacc847 --- /dev/null +++ b/src/connectors/microsoft.outlook.calendar/functions/create_event_test.ts @@ -0,0 +1,45 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import { assertEquals, assertExists } from "../../../dev_deps.ts"; +import { DefineWorkflow } from "../../../dev_deps.ts"; +import CreateEvent from "./create_event.ts"; + +Deno.test("CreateEvent can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateEvent_slack_function", + title: "Test CreateEvent", + description: "This is a generated test to test CreateEvent", + }); + testWorkflow.addStep(CreateEvent, { + event_title: "test", + start_time: "test", + end_time: "test", + timezone: "test", + attendees: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05QGEFR3SP#/functions/create_event"); + assertEquals(actual.inputs, { + event_title: "test", + start_time: "test", + end_time: "test", + timezone: "test", + attendees: "test", + }); +}); + +Deno.test("All outputs of Slack function CreateEvent should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateEvent_slack_function", + title: "Test CreateEvent", + description: "This is a generated test to test CreateEvent", + }); + const step = testWorkflow.addStep(CreateEvent, { + event_title: "test", + start_time: "test", + end_time: "test", + timezone: "test", + attendees: "test", + }); + assertExists(step.outputs.event_url); +}); diff --git a/src/connectors/microsoft.outlook.calendar/mod.ts b/src/connectors/microsoft.outlook.calendar/mod.ts new file mode 100644 index 0000000..df08e1f --- /dev/null +++ b/src/connectors/microsoft.outlook.calendar/mod.ts @@ -0,0 +1,13 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import CreateEvent from "./functions/create_event.ts"; + +const MicrosoftOutlookCalendar = { + functions: { + /** + * @see The {@link https://api.slack.com/reference/connectors/microsoft.outlook.calendar/create_event CreateEvent} documentation. + */ + CreateEvent, + }, +} as const; + +export default MicrosoftOutlookCalendar; diff --git a/src/connectors/microsoft.outlook.email/functions/send_email.ts b/src/connectors/microsoft.outlook.email/functions/send_email.ts new file mode 100644 index 0000000..60e6fd8 --- /dev/null +++ b/src/connectors/microsoft.outlook.email/functions/send_email.ts @@ -0,0 +1,53 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import { DefineConnector } from "../../../deps.ts"; +import { Schema } from "../../../deps.ts"; + +export default DefineConnector({ + callback_id: "A05Q22Z3N8P#/functions/send_email", + title: "Send an email", + input_parameters: { + properties: { + subject: { + type: Schema.types.string, + description: "Enter text", + title: "Subject", + }, + email_body: { + type: Schema.types.string, + description: "Enter text", + title: "Email body", + }, + recipients: { + type: Schema.types.array, + description: "Search all people...", + title: "Recipients", + items: { type: Schema.slack.types.user_id }, + }, + additional_recipients: { + type: Schema.types.array, + description: "Enter email ids", + title: "Additional Recipients", + items: { type: Schema.types.string }, + }, + cc_recipients: { + type: Schema.types.array, + description: "Enter email ids", + title: "CC Recipients", + items: { type: Schema.types.string }, + }, + bcc_recipients: { + type: Schema.types.array, + description: "Enter email ids", + title: "BCC Recipients", + items: { type: Schema.types.string }, + }, + outlook_email_access_token: { + type: Schema.slack.types.oauth2, + description: "Outlook Email Access Token", + title: "Outlook Email Access Token", + }, + }, + required: ["subject", "email_body", "outlook_email_access_token"], + }, + output_parameters: { properties: {}, required: [] }, +}); diff --git a/src/connectors/microsoft.outlook.email/functions/send_email_test.ts b/src/connectors/microsoft.outlook.email/functions/send_email_test.ts new file mode 100644 index 0000000..e6851c3 --- /dev/null +++ b/src/connectors/microsoft.outlook.email/functions/send_email_test.ts @@ -0,0 +1,25 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import { assertEquals } from "../../../dev_deps.ts"; +import { DefineWorkflow } from "../../../dev_deps.ts"; +import SendEmail from "./send_email.ts"; + +Deno.test("SendEmail can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_SendEmail_slack_function", + title: "Test SendEmail", + description: "This is a generated test to test SendEmail", + }); + testWorkflow.addStep(SendEmail, { + subject: "test", + email_body: "test", + outlook_email_access_token: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05Q22Z3N8P#/functions/send_email"); + assertEquals(actual.inputs, { + subject: "test", + email_body: "test", + outlook_email_access_token: "test", + }); +}); diff --git a/src/connectors/microsoft.outlook.email/mod.ts b/src/connectors/microsoft.outlook.email/mod.ts new file mode 100644 index 0000000..4116cc9 --- /dev/null +++ b/src/connectors/microsoft.outlook.email/mod.ts @@ -0,0 +1,13 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import SendEmail from "./functions/send_email.ts"; + +const MicrosoftOutlookEmail = { + functions: { + /** + * @see The {@link https://api.slack.com/reference/connectors/microsoft.outlook.email/send_email SendEmail} documentation. + */ + SendEmail, + }, +} as const; + +export default MicrosoftOutlookEmail; diff --git a/src/connectors/microsoft.teams/functions/create_meeting.ts b/src/connectors/microsoft.teams/functions/create_meeting.ts new file mode 100644 index 0000000..08dfd8f --- /dev/null +++ b/src/connectors/microsoft.teams/functions/create_meeting.ts @@ -0,0 +1,48 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import { DefineConnector } from "../../../deps.ts"; +import { Schema } from "../../../deps.ts"; + +export default DefineConnector({ + callback_id: "A05Q9UPHBDL#/functions/create_meeting", + title: "Create a meeting", + description: "Creates an online meeting in Microsoft Teams", + input_parameters: { + properties: { + teams_access_token: { + type: Schema.slack.types.oauth2, + description: "Microsoft credential to use", + title: "Microsoft access token", + }, + subject: { + type: Schema.types.string, + description: "Enter text", + title: "Subject", + }, + start_time: { type: Schema.slack.types.timestamp, title: "Start time" }, + end_time: { type: Schema.slack.types.timestamp, title: "End time" }, + timezone: { + type: Schema.types.string, + description: "Select a timezone", + title: "Timezone", + }, + }, + required: [ + "teams_access_token", + "subject", + "start_time", + "end_time", + "timezone", + ], + }, + output_parameters: { + properties: { + meeting_url: { type: Schema.types.string, title: "Meeting URL" }, + meeting_id: { + type: Schema.types.string, + description: "Meeting ID", + title: "Meeting ID", + }, + }, + required: [], + }, +}); diff --git a/src/connectors/microsoft.teams/functions/create_meeting_test.ts b/src/connectors/microsoft.teams/functions/create_meeting_test.ts new file mode 100644 index 0000000..18d4751 --- /dev/null +++ b/src/connectors/microsoft.teams/functions/create_meeting_test.ts @@ -0,0 +1,46 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import { assertEquals, assertExists } from "../../../dev_deps.ts"; +import { DefineWorkflow } from "../../../dev_deps.ts"; +import CreateMeeting from "./create_meeting.ts"; + +Deno.test("CreateMeeting can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateMeeting_slack_function", + title: "Test CreateMeeting", + description: "This is a generated test to test CreateMeeting", + }); + testWorkflow.addStep(CreateMeeting, { + teams_access_token: "test", + subject: "test", + start_time: "test", + end_time: "test", + timezone: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05Q9UPHBDL#/functions/create_meeting"); + assertEquals(actual.inputs, { + teams_access_token: "test", + subject: "test", + start_time: "test", + end_time: "test", + timezone: "test", + }); +}); + +Deno.test("All outputs of Slack function CreateMeeting should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateMeeting_slack_function", + title: "Test CreateMeeting", + description: "This is a generated test to test CreateMeeting", + }); + const step = testWorkflow.addStep(CreateMeeting, { + teams_access_token: "test", + subject: "test", + start_time: "test", + end_time: "test", + timezone: "test", + }); + assertExists(step.outputs.meeting_url); + assertExists(step.outputs.meeting_id); +}); diff --git a/src/connectors/microsoft.teams/mod.ts b/src/connectors/microsoft.teams/mod.ts new file mode 100644 index 0000000..42a23ef --- /dev/null +++ b/src/connectors/microsoft.teams/mod.ts @@ -0,0 +1,13 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import CreateMeeting from "./functions/create_meeting.ts"; + +const MicrosoftTeams = { + functions: { + /** + * @see The {@link https://api.slack.com/reference/connectors/microsoft.teams/create_meeting CreateMeeting} documentation. + */ + CreateMeeting, + }, +} as const; + +export default MicrosoftTeams; diff --git a/src/connectors/miro/functions/copy_board.ts b/src/connectors/miro/functions/copy_board.ts new file mode 100644 index 0000000..ce91e3f --- /dev/null +++ b/src/connectors/miro/functions/copy_board.ts @@ -0,0 +1,54 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import { DefineConnector } from "../../../deps.ts"; +import { Schema } from "../../../deps.ts"; + +export default DefineConnector({ + callback_id: "A05NR1RGCBZ#/functions/copy_board", + title: "Copy board", + input_parameters: { + properties: { + board_id: { + type: Schema.types.string, + description: "Select the board", + title: "Board to copy", + }, + name: { + type: Schema.types.string, + description: "Enter the board name...", + title: "Name", + }, + description: { + type: Schema.types.string, + description: "Enter the description of the board...", + title: "Description", + }, + miro_access_token: { + type: Schema.slack.types.oauth2, + description: "Miro access token", + title: "Miro access token", + }, + team_access: { + type: Schema.types.string, + description: "Team-level access to the board", + title: "Team level access", + enum: ["private", "view", "comment", "edit"], + }, + }, + required: ["board_id", "name", "description", "miro_access_token"], + }, + output_parameters: { + properties: { + board_id: { + type: Schema.types.string, + description: "Board ID", + title: "Board ID", + }, + link: { + type: Schema.types.string, + description: "Board URL", + title: "Board URL", + }, + }, + required: [], + }, +}); diff --git a/src/connectors/miro/functions/copy_board_test.ts b/src/connectors/miro/functions/copy_board_test.ts new file mode 100644 index 0000000..d526456 --- /dev/null +++ b/src/connectors/miro/functions/copy_board_test.ts @@ -0,0 +1,43 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import { assertEquals, assertExists } from "../../../dev_deps.ts"; +import { DefineWorkflow } from "../../../dev_deps.ts"; +import CopyBoard from "./copy_board.ts"; + +Deno.test("CopyBoard can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CopyBoard_slack_function", + title: "Test CopyBoard", + description: "This is a generated test to test CopyBoard", + }); + testWorkflow.addStep(CopyBoard, { + board_id: "test", + name: "test", + description: "test", + miro_access_token: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05NR1RGCBZ#/functions/copy_board"); + assertEquals(actual.inputs, { + board_id: "test", + name: "test", + description: "test", + miro_access_token: "test", + }); +}); + +Deno.test("All outputs of Slack function CopyBoard should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CopyBoard_slack_function", + title: "Test CopyBoard", + description: "This is a generated test to test CopyBoard", + }); + const step = testWorkflow.addStep(CopyBoard, { + board_id: "test", + name: "test", + description: "test", + miro_access_token: "test", + }); + assertExists(step.outputs.board_id); + assertExists(step.outputs.link); +}); diff --git a/src/connectors/miro/functions/create_board.ts b/src/connectors/miro/functions/create_board.ts new file mode 100644 index 0000000..06a17a0 --- /dev/null +++ b/src/connectors/miro/functions/create_board.ts @@ -0,0 +1,49 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import { DefineConnector } from "../../../deps.ts"; +import { Schema } from "../../../deps.ts"; + +export default DefineConnector({ + callback_id: "A05NR1RGCBZ#/functions/create_board", + title: "Create board", + input_parameters: { + properties: { + name: { + type: Schema.types.string, + description: "Enter the board name...", + title: "Board name", + }, + description: { + type: Schema.types.string, + description: "Enter the description of the board...", + title: "Description", + }, + miro_access_token: { + type: Schema.slack.types.oauth2, + description: "Miro access token", + title: "Miro access token", + }, + team_access: { + type: Schema.types.string, + description: "Anyone in the team...", + title: "Team level access", + enum: ["private", "view", "comment", "edit"], + }, + }, + required: ["name", "description", "miro_access_token"], + }, + output_parameters: { + properties: { + board_id: { + type: Schema.types.string, + description: "Board ID", + title: "Board ID", + }, + link: { + type: Schema.types.string, + description: "Board URL", + title: "Board URL", + }, + }, + required: [], + }, +}); diff --git a/src/connectors/miro/functions/create_board_test.ts b/src/connectors/miro/functions/create_board_test.ts new file mode 100644 index 0000000..276086b --- /dev/null +++ b/src/connectors/miro/functions/create_board_test.ts @@ -0,0 +1,40 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import { assertEquals, assertExists } from "../../../dev_deps.ts"; +import { DefineWorkflow } from "../../../dev_deps.ts"; +import CreateBoard from "./create_board.ts"; + +Deno.test("CreateBoard can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateBoard_slack_function", + title: "Test CreateBoard", + description: "This is a generated test to test CreateBoard", + }); + testWorkflow.addStep(CreateBoard, { + name: "test", + description: "test", + miro_access_token: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05NR1RGCBZ#/functions/create_board"); + assertEquals(actual.inputs, { + name: "test", + description: "test", + miro_access_token: "test", + }); +}); + +Deno.test("All outputs of Slack function CreateBoard should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateBoard_slack_function", + title: "Test CreateBoard", + description: "This is a generated test to test CreateBoard", + }); + const step = testWorkflow.addStep(CreateBoard, { + name: "test", + description: "test", + miro_access_token: "test", + }); + assertExists(step.outputs.board_id); + assertExists(step.outputs.link); +}); diff --git a/src/connectors/miro/mod.ts b/src/connectors/miro/mod.ts new file mode 100644 index 0000000..594b4bf --- /dev/null +++ b/src/connectors/miro/mod.ts @@ -0,0 +1,18 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import CopyBoard from "./functions/copy_board.ts"; +import CreateBoard from "./functions/create_board.ts"; + +const Miro = { + functions: { + /** + * @see The {@link https://api.slack.com/reference/connectors/miro/copy_board CopyBoard} documentation. + */ + CopyBoard, + /** + * @see The {@link https://api.slack.com/reference/connectors/miro/create_board CreateBoard} documentation. + */ + CreateBoard, + }, +} as const; + +export default Miro; diff --git a/src/connectors/mod.ts b/src/connectors/mod.ts index 3724e4c..ce3bc99 100644 --- a/src/connectors/mod.ts +++ b/src/connectors/mod.ts @@ -1,31 +1,47 @@ -/** This file was autogenerated on Mon Sep 11 2023. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +/** This file was autogenerated on Mon Sep 25 2023. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ import Asana from "./asana/mod.ts"; +import AtlassianBitbucket from "./atlassian.bitbucket/mod.ts"; import Calendly from "./calendly/mod.ts"; import Docusign from "./docusign/mod.ts"; import Giphy from "./giphy/mod.ts"; import GithubCloud from "./github.cloud/mod.ts"; import Gitlab from "./gitlab/mod.ts"; +import GoogleMail from "./google.mail/mod.ts"; import GoogleSheets from "./google.sheets/mod.ts"; import JiraCloud from "./jira.cloud/mod.ts"; import Lucid from "./lucid/mod.ts"; +import MicrosoftOnedrive from "./microsoft.onedrive/mod.ts"; +import MicrosoftOutlookCalendar from "./microsoft.outlook.calendar/mod.ts"; +import MicrosoftOutlookEmail from "./microsoft.outlook.email/mod.ts"; +import MicrosoftTeams from "./microsoft.teams/mod.ts"; +import Miro from "./miro/mod.ts"; import Pagerduty from "./pagerduty/mod.ts"; import Salesforce from "./salesforce/mod.ts"; +import Synk from "./synk/mod.ts"; import Webex from "./webex/mod.ts"; import Wrike from "./wrike/mod.ts"; import Zoom from "./zoom/mod.ts"; const Connectors = { Asana, + AtlassianBitbucket, Calendly, Docusign, Giphy, GithubCloud, Gitlab, + GoogleMail, GoogleSheets, JiraCloud, Lucid, + MicrosoftOnedrive, + MicrosoftOutlookCalendar, + MicrosoftOutlookEmail, + MicrosoftTeams, + Miro, Pagerduty, Salesforce, + Synk, Webex, Wrike, Zoom, diff --git a/src/connectors/synk/functions/create_ignore.ts b/src/connectors/synk/functions/create_ignore.ts new file mode 100644 index 0000000..703af43 --- /dev/null +++ b/src/connectors/synk/functions/create_ignore.ts @@ -0,0 +1,78 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import { DefineConnector } from "../../../deps.ts"; +import { Schema } from "../../../deps.ts"; + +export default DefineConnector({ + callback_id: "A05DD2DNMGF#/functions/create_ignore", + title: "Ignore an issue", + description: + "Ignores vulnerabilities or license issues for a given organization and project", + input_parameters: { + properties: { + org_id: { + type: Schema.types.string, + description: "Please select an option", + title: "Organization", + }, + project_id: { + type: Schema.types.string, + description: "Please select an option", + title: "Project", + }, + issue_id: { + type: Schema.types.string, + description: "Enter text", + title: "Issue ID", + }, + reason: { + type: Schema.types.string, + description: "Enter text", + title: "Reason", + }, + reason_type: { + type: Schema.types.string, + description: "Please select an option", + title: "Reason type", + enum: ["not-vulnerable", "wont-fix", "temporary-ignore"], + }, + disregard_if_fixable: { + type: Schema.types.boolean, + description: "Toggle if issue is not fixable...", + title: "Disregard if fixable", + }, + snyk_access_token: { + type: Schema.slack.types.oauth2, + description: "Snyk Credential to use", + title: "Snyk Access Token", + }, + }, + required: [ + "org_id", + "project_id", + "issue_id", + "reason_type", + "disregard_if_fixable", + "snyk_access_token", + ], + }, + output_parameters: { + properties: { + issue_id: { + type: Schema.types.string, + description: "Snyk issue identifier", + title: "Issue ID", + }, + reason_type: { + type: Schema.types.string, + description: "Category for the reason to ignore the issue", + title: "Issue reason type", + }, + reason: { + type: Schema.types.string, + description: "The reason why the issue was ignored", + title: "Issue reason", + }, + }, + required: ["issue_id", "reason_type"], + }, +}); diff --git a/src/connectors/synk/functions/create_ignore_test.ts b/src/connectors/synk/functions/create_ignore_test.ts new file mode 100644 index 0000000..4f8823f --- /dev/null +++ b/src/connectors/synk/functions/create_ignore_test.ts @@ -0,0 +1,50 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import { assertEquals, assertExists } from "../../../dev_deps.ts"; +import { DefineWorkflow } from "../../../dev_deps.ts"; +import CreateIgnore from "./create_ignore.ts"; + +Deno.test("CreateIgnore can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateIgnore_slack_function", + title: "Test CreateIgnore", + description: "This is a generated test to test CreateIgnore", + }); + testWorkflow.addStep(CreateIgnore, { + org_id: "test", + project_id: "test", + issue_id: "test", + reason_type: "test", + disregard_if_fixable: "test", + snyk_access_token: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05DD2DNMGF#/functions/create_ignore"); + assertEquals(actual.inputs, { + org_id: "test", + project_id: "test", + issue_id: "test", + reason_type: "test", + disregard_if_fixable: "test", + snyk_access_token: "test", + }); +}); + +Deno.test("All outputs of Slack function CreateIgnore should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateIgnore_slack_function", + title: "Test CreateIgnore", + description: "This is a generated test to test CreateIgnore", + }); + const step = testWorkflow.addStep(CreateIgnore, { + org_id: "test", + project_id: "test", + issue_id: "test", + reason_type: "test", + disregard_if_fixable: "test", + snyk_access_token: "test", + }); + assertExists(step.outputs.issue_id); + assertExists(step.outputs.reason_type); + assertExists(step.outputs.reason); +}); diff --git a/src/connectors/synk/mod.ts b/src/connectors/synk/mod.ts new file mode 100644 index 0000000..f90fb47 --- /dev/null +++ b/src/connectors/synk/mod.ts @@ -0,0 +1,13 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import CreateIgnore from "./functions/create_ignore.ts"; + +const Synk = { + functions: { + /** + * @see The {@link https://api.slack.com/reference/connectors/synk/create_ignore CreateIgnore} documentation. + */ + CreateIgnore, + }, +} as const; + +export default Synk;