From f662e53f40160c177f3d919bac10c84b57512d17 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 28 Jan 2025 14:35:12 -0500 Subject: [PATCH] Automated commit: Latest generated changes from schedule action (#72) Co-authored-by: github-actions --- .../functions/create_issue.ts | 4 +- .../functions/update_issue.ts | 44 +++++++ .../functions/update_issue_test.ts | 43 +++++++ src/connectors/atlassian.bitbucket/mod.ts | 5 + .../clickup/functions/update_task.ts | 45 +++++++ .../clickup/functions/update_task_test.ts | 55 ++++++++ src/connectors/clickup/mod.ts | 5 + .../github.cloud/functions/update_issue.ts | 38 ++++++ .../functions/update_issue_test.ts | 42 +++++++ src/connectors/github.cloud/mod.ts | 5 + .../google.calendar/functions/create_event.ts | 1 + .../functions/create_event_test.ts | 1 + .../google.calendar/functions/update_event.ts | 68 ++++++++++ .../functions/update_event_test.ts | 43 +++++++ src/connectors/google.calendar/mod.ts | 5 + .../functions/update_meeting.ts | 43 +++++++ .../functions/update_meeting_test.ts | 37 ++++++ src/connectors/microsoft.teams/mod.ts | 5 + src/connectors/mod.ts | 2 +- .../pagerduty/functions/update_incident.ts | 117 ++++++++++++++++++ .../functions/update_incident_test.ts | 42 +++++++ src/connectors/pagerduty/mod.ts | 5 + .../servicenow/functions/get_incident.ts | 1 + .../servicenow/functions/get_incident_test.ts | 1 + .../servicenow/functions/update_incident.ts | 64 ++++++++++ .../functions/update_incident_test.ts | 40 ++++++ src/connectors/servicenow/mod.ts | 5 + .../zendesk/functions/update_ticket.ts | 43 ++----- 28 files changed, 770 insertions(+), 39 deletions(-) create mode 100644 src/connectors/atlassian.bitbucket/functions/update_issue.ts create mode 100644 src/connectors/atlassian.bitbucket/functions/update_issue_test.ts create mode 100644 src/connectors/clickup/functions/update_task.ts create mode 100644 src/connectors/clickup/functions/update_task_test.ts create mode 100644 src/connectors/github.cloud/functions/update_issue.ts create mode 100644 src/connectors/github.cloud/functions/update_issue_test.ts create mode 100644 src/connectors/google.calendar/functions/update_event.ts create mode 100644 src/connectors/google.calendar/functions/update_event_test.ts create mode 100644 src/connectors/microsoft.teams/functions/update_meeting.ts create mode 100644 src/connectors/microsoft.teams/functions/update_meeting_test.ts create mode 100644 src/connectors/pagerduty/functions/update_incident.ts create mode 100644 src/connectors/pagerduty/functions/update_incident_test.ts create mode 100644 src/connectors/servicenow/functions/update_incident.ts create mode 100644 src/connectors/servicenow/functions/update_incident_test.ts diff --git a/src/connectors/atlassian.bitbucket/functions/create_issue.ts b/src/connectors/atlassian.bitbucket/functions/create_issue.ts index 33daa8d..6e2d1ef 100644 --- a/src/connectors/atlassian.bitbucket/functions/create_issue.ts +++ b/src/connectors/atlassian.bitbucket/functions/create_issue.ts @@ -5,7 +5,7 @@ import { Schema } from "../../../deps.ts"; export default DefineConnector({ callback_id: "A05Q8KLHEHJ#/functions/create_issue", title: "Create an issue", - description: "Create a bitbucket cloud issue", + description: "Create a Bitbucket Cloud issue", input_parameters: { properties: { workspace: { @@ -38,7 +38,7 @@ export default DefineConnector({ type: Schema.types.string, description: "Priority of the issue", title: "Priority", - enum: ["trivial", "minior", "major", "critical", "blocker"], + enum: ["trivial", "minor", "major", "critical", "blocker"], }, assignee_uuid: { type: Schema.types.string, diff --git a/src/connectors/atlassian.bitbucket/functions/update_issue.ts b/src/connectors/atlassian.bitbucket/functions/update_issue.ts new file mode 100644 index 0000000..3d9fc6d --- /dev/null +++ b/src/connectors/atlassian.bitbucket/functions/update_issue.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: "A05Q8KLHEHJ#/functions/update_issue", + title: "Update an issue", + description: "Update 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", + }, + issue_id: { type: Schema.types.string, title: "Issue to update" }, + description: { type: Schema.types.string, title: "Description" }, + title: { type: Schema.types.string, title: "Title" }, + priority: { + type: Schema.types.string, + title: "Priority", + enum: ["trivial", "minor", "major", "critical", "blocker"], + }, + assignee_uuid: { type: Schema.types.string, title: "Assignee" }, + bitbucket_access_token: { + type: Schema.slack.types.oauth2, + title: "bitbucket access token", + }, + }, + required: ["workspace", "repo_slug", "issue_id", "description"], + }, + output_parameters: { + properties: { + issue_id: { type: Schema.types.string, title: "Issue ID" }, + issue_url: { type: Schema.types.string, title: "Issue URL" }, + }, + required: [], + }, +}); diff --git a/src/connectors/atlassian.bitbucket/functions/update_issue_test.ts b/src/connectors/atlassian.bitbucket/functions/update_issue_test.ts new file mode 100644 index 0000000..7459fb9 --- /dev/null +++ b/src/connectors/atlassian.bitbucket/functions/update_issue_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 UpdateIssue from "./update_issue.ts"; + +Deno.test("UpdateIssue can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_UpdateIssue_slack_function", + title: "Test UpdateIssue", + description: "This is a generated test to test UpdateIssue", + }); + testWorkflow.addStep(UpdateIssue, { + workspace: "test", + repo_slug: "test", + issue_id: "test", + description: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05Q8KLHEHJ#/functions/update_issue"); + assertEquals(actual.inputs, { + workspace: "test", + repo_slug: "test", + issue_id: "test", + description: "test", + }); +}); + +Deno.test("All outputs of Slack function UpdateIssue should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_UpdateIssue_slack_function", + title: "Test UpdateIssue", + description: "This is a generated test to test UpdateIssue", + }); + const step = testWorkflow.addStep(UpdateIssue, { + workspace: "test", + repo_slug: "test", + issue_id: "test", + description: "test", + }); + assertExists(step.outputs.issue_id); + assertExists(step.outputs.issue_url); +}); diff --git a/src/connectors/atlassian.bitbucket/mod.ts b/src/connectors/atlassian.bitbucket/mod.ts index 5b74cc1..41fb61d 100644 --- a/src/connectors/atlassian.bitbucket/mod.ts +++ b/src/connectors/atlassian.bitbucket/mod.ts @@ -1,6 +1,7 @@ /** 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"; +import UpdateIssue from "./functions/update_issue.ts"; const AtlassianBitbucket = { functions: { @@ -12,6 +13,10 @@ const AtlassianBitbucket = { * @see The {@link https://api.slack.com/reference/connectors/atlassian.bitbucket/merge_pull_request MergePullRequest} documentation. */ MergePullRequest, + /** + * @see The {@link https://api.slack.com/reference/connectors/atlassian.bitbucket/update_issue UpdateIssue} documentation. + */ + UpdateIssue, }, } as const; diff --git a/src/connectors/clickup/functions/update_task.ts b/src/connectors/clickup/functions/update_task.ts new file mode 100644 index 0000000..c9444dc --- /dev/null +++ b/src/connectors/clickup/functions/update_task.ts @@ -0,0 +1,45 @@ +/** 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: "A05S54578AE#/functions/update_task", + title: "Update a task in a folder", + input_parameters: { + properties: { + team_id: { type: Schema.types.integer, title: "Team" }, + space_id: { type: Schema.types.integer, title: "Space" }, + folder_id: { type: Schema.types.integer, title: "Folder" }, + list_id: { type: Schema.types.integer, title: "List" }, + task_id: { type: Schema.types.string, title: "Task to update" }, + name: { type: Schema.types.string, title: "Task name" }, + description: { type: Schema.types.string, title: "Description" }, + status: { type: Schema.types.string, title: "Status" }, + clickup_access_token: { + type: Schema.slack.types.oauth2, + title: "Clickup Access Token", + }, + }, + required: [ + "team_id", + "space_id", + "folder_id", + "list_id", + "task_id", + "clickup_access_token", + ], + }, + output_parameters: { + properties: { + task_id: { type: Schema.types.string, title: "Task ID" }, + task_name: { type: Schema.types.string, title: "Task name" }, + start_date: { type: Schema.types.string, title: "Start at" }, + due_date: { type: Schema.types.string, title: "Due at" }, + description: { type: Schema.types.string, title: "Description" }, + date_created: { type: Schema.types.string, title: "Created at" }, + url: { type: Schema.types.string, title: "Link to task" }, + status: { type: Schema.types.string, title: "Task status" }, + }, + required: ["task_name", "url", "status"], + }, +}); diff --git a/src/connectors/clickup/functions/update_task_test.ts b/src/connectors/clickup/functions/update_task_test.ts new file mode 100644 index 0000000..9873fec --- /dev/null +++ b/src/connectors/clickup/functions/update_task_test.ts @@ -0,0 +1,55 @@ +/** 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 UpdateTask from "./update_task.ts"; + +Deno.test("UpdateTask can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_UpdateTask_slack_function", + title: "Test UpdateTask", + description: "This is a generated test to test UpdateTask", + }); + testWorkflow.addStep(UpdateTask, { + team_id: "test", + space_id: "test", + folder_id: "test", + list_id: "test", + task_id: "test", + clickup_access_token: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05S54578AE#/functions/update_task"); + assertEquals(actual.inputs, { + team_id: "test", + space_id: "test", + folder_id: "test", + list_id: "test", + task_id: "test", + clickup_access_token: "test", + }); +}); + +Deno.test("All outputs of Slack function UpdateTask should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_UpdateTask_slack_function", + title: "Test UpdateTask", + description: "This is a generated test to test UpdateTask", + }); + const step = testWorkflow.addStep(UpdateTask, { + team_id: "test", + space_id: "test", + folder_id: "test", + list_id: "test", + task_id: "test", + clickup_access_token: "test", + }); + assertExists(step.outputs.task_id); + assertExists(step.outputs.task_name); + assertExists(step.outputs.start_date); + assertExists(step.outputs.due_date); + assertExists(step.outputs.description); + assertExists(step.outputs.date_created); + assertExists(step.outputs.url); + assertExists(step.outputs.status); +}); diff --git a/src/connectors/clickup/mod.ts b/src/connectors/clickup/mod.ts index 4aa5e41..fb987b6 100644 --- a/src/connectors/clickup/mod.ts +++ b/src/connectors/clickup/mod.ts @@ -1,5 +1,6 @@ /** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ import CreateTask from "./functions/create_task.ts"; +import UpdateTask from "./functions/update_task.ts"; const Clickup = { functions: { @@ -7,6 +8,10 @@ const Clickup = { * @see The {@link https://api.slack.com/reference/connectors/clickup/create_task CreateTask} documentation. */ CreateTask, + /** + * @see The {@link https://api.slack.com/reference/connectors/clickup/update_task UpdateTask} documentation. + */ + UpdateTask, }, } as const; diff --git a/src/connectors/github.cloud/functions/update_issue.ts b/src/connectors/github.cloud/functions/update_issue.ts new file mode 100644 index 0000000..30b13cf --- /dev/null +++ b/src/connectors/github.cloud/functions/update_issue.ts @@ -0,0 +1,38 @@ +/** 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: "A050QFW22F5#/functions/update_issue", + title: "Update an issue", + description: "Update a GitHub cloud issue", + input_parameters: { + properties: { + repository: { type: Schema.types.string, title: "Repository" }, + issue_number: { type: Schema.types.string, title: "Issue number" }, + title: { type: Schema.types.string, title: "Issue title" }, + description: { type: Schema.types.string, title: "Description" }, + state: { + type: Schema.types.string, + description: "State", + title: "State", + enum: ["open", "closed"], + }, + github_access_token: { + type: Schema.slack.types.oauth2, + description: "GitHub Credential to use", + title: "Github Access Token", + }, + }, + required: ["repository", "issue_number", "github_access_token"], + }, + output_parameters: { + properties: { + issue_number: { type: Schema.types.string, title: "Issue number" }, + issue_url: { type: Schema.types.string, title: "Issue URL" }, + title: { type: Schema.types.string, title: "Issue title" }, + description: { type: Schema.types.string, title: "Issue Description" }, + }, + required: ["issue_number", "issue_url", "title"], + }, +}); diff --git a/src/connectors/github.cloud/functions/update_issue_test.ts b/src/connectors/github.cloud/functions/update_issue_test.ts new file mode 100644 index 0000000..6e4ae0e --- /dev/null +++ b/src/connectors/github.cloud/functions/update_issue_test.ts @@ -0,0 +1,42 @@ +/** 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 UpdateIssue from "./update_issue.ts"; + +Deno.test("UpdateIssue can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_UpdateIssue_slack_function", + title: "Test UpdateIssue", + description: "This is a generated test to test UpdateIssue", + }); + testWorkflow.addStep(UpdateIssue, { + repository: "test", + issue_number: "test", + github_access_token: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A050QFW22F5#/functions/update_issue"); + assertEquals(actual.inputs, { + repository: "test", + issue_number: "test", + github_access_token: "test", + }); +}); + +Deno.test("All outputs of Slack function UpdateIssue should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_UpdateIssue_slack_function", + title: "Test UpdateIssue", + description: "This is a generated test to test UpdateIssue", + }); + const step = testWorkflow.addStep(UpdateIssue, { + repository: "test", + issue_number: "test", + github_access_token: "test", + }); + assertExists(step.outputs.issue_number); + assertExists(step.outputs.issue_url); + assertExists(step.outputs.title); + assertExists(step.outputs.description); +}); diff --git a/src/connectors/github.cloud/mod.ts b/src/connectors/github.cloud/mod.ts index 79ead1a..4f4144d 100644 --- a/src/connectors/github.cloud/mod.ts +++ b/src/connectors/github.cloud/mod.ts @@ -1,5 +1,6 @@ /** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ import CreateIssue from "./functions/create_issue.ts"; +import UpdateIssue from "./functions/update_issue.ts"; const GithubCloud = { functions: { @@ -7,6 +8,10 @@ const GithubCloud = { * @see The {@link https://api.slack.com/reference/connectors/github.cloud/create_issue CreateIssue} documentation. */ CreateIssue, + /** + * @see The {@link https://api.slack.com/reference/connectors/github.cloud/update_issue UpdateIssue} documentation. + */ + UpdateIssue, }, } as const; diff --git a/src/connectors/google.calendar/functions/create_event.ts b/src/connectors/google.calendar/functions/create_event.ts index c9b9253..f38ee94 100644 --- a/src/connectors/google.calendar/functions/create_event.ts +++ b/src/connectors/google.calendar/functions/create_event.ts @@ -64,6 +64,7 @@ export default DefineConnector({ description: "Calendar event link", title: "Event link", }, + calendar_id: { type: Schema.types.string, title: "Calendar ID" }, }, required: [], }, diff --git a/src/connectors/google.calendar/functions/create_event_test.ts b/src/connectors/google.calendar/functions/create_event_test.ts index 38125bf..b7889ce 100644 --- a/src/connectors/google.calendar/functions/create_event_test.ts +++ b/src/connectors/google.calendar/functions/create_event_test.ts @@ -28,4 +28,5 @@ Deno.test("All outputs of Slack function CreateEvent should exist", () => { }); assertExists(step.outputs.event_id); assertExists(step.outputs.event_link); + assertExists(step.outputs.calendar_id); }); diff --git a/src/connectors/google.calendar/functions/update_event.ts b/src/connectors/google.calendar/functions/update_event.ts new file mode 100644 index 0000000..db00a67 --- /dev/null +++ b/src/connectors/google.calendar/functions/update_event.ts @@ -0,0 +1,68 @@ +/** 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: "A050C90PUF5#/functions/update_event", + title: "Update a calendar event", + input_parameters: { + properties: { + google_access_token: { + type: Schema.slack.types.oauth2, + description: "Google Credential to use", + title: "Google Access Token", + }, + calendar_id: { + type: Schema.types.string, + description: "Select a Google Calendar", + title: "Calendar", + }, + event_id: { + type: Schema.types.string, + description: "Select an event from the chosen calendar", + title: "Event", + }, + start_time: { + type: Schema.slack.types.timestamp, + description: "Start time for event", + title: "Start time", + }, + end_time: { + type: Schema.slack.types.timestamp, + description: "End time for event", + title: "End time", + }, + summary: { + type: Schema.types.string, + description: "Event title", + title: "Event title", + }, + location: { + type: Schema.types.string, + description: "Location of event", + title: "Location", + }, + description: { + type: Schema.types.string, + description: "Description of event", + title: "Description", + }, + }, + required: ["calendar_id", "event_id", "start_time", "end_time"], + }, + output_parameters: { + properties: { + event_summary: { + type: Schema.types.string, + description: "Title of the event", + title: "Event title", + }, + event_url: { + type: Schema.types.string, + description: "URL of the event", + title: "Event URL", + }, + }, + required: [], + }, +}); diff --git a/src/connectors/google.calendar/functions/update_event_test.ts b/src/connectors/google.calendar/functions/update_event_test.ts new file mode 100644 index 0000000..d55d43e --- /dev/null +++ b/src/connectors/google.calendar/functions/update_event_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 UpdateEvent from "./update_event.ts"; + +Deno.test("UpdateEvent can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_UpdateEvent_slack_function", + title: "Test UpdateEvent", + description: "This is a generated test to test UpdateEvent", + }); + testWorkflow.addStep(UpdateEvent, { + calendar_id: "test", + event_id: "test", + start_time: "test", + end_time: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A050C90PUF5#/functions/update_event"); + assertEquals(actual.inputs, { + calendar_id: "test", + event_id: "test", + start_time: "test", + end_time: "test", + }); +}); + +Deno.test("All outputs of Slack function UpdateEvent should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_UpdateEvent_slack_function", + title: "Test UpdateEvent", + description: "This is a generated test to test UpdateEvent", + }); + const step = testWorkflow.addStep(UpdateEvent, { + calendar_id: "test", + event_id: "test", + start_time: "test", + end_time: "test", + }); + assertExists(step.outputs.event_summary); + assertExists(step.outputs.event_url); +}); diff --git a/src/connectors/google.calendar/mod.ts b/src/connectors/google.calendar/mod.ts index f52e67a..ea4dad2 100644 --- a/src/connectors/google.calendar/mod.ts +++ b/src/connectors/google.calendar/mod.ts @@ -1,6 +1,7 @@ /** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ import AddToEvent from "./functions/add_to_event.ts"; import CreateEvent from "./functions/create_event.ts"; +import UpdateEvent from "./functions/update_event.ts"; const GoogleCalendar = { functions: { @@ -12,6 +13,10 @@ const GoogleCalendar = { * @see The {@link https://api.slack.com/reference/connectors/google.calendar/create_event CreateEvent} documentation. */ CreateEvent, + /** + * @see The {@link https://api.slack.com/reference/connectors/google.calendar/update_event UpdateEvent} documentation. + */ + UpdateEvent, }, } as const; diff --git a/src/connectors/microsoft.teams/functions/update_meeting.ts b/src/connectors/microsoft.teams/functions/update_meeting.ts new file mode 100644 index 0000000..e5cd05b --- /dev/null +++ b/src/connectors/microsoft.teams/functions/update_meeting.ts @@ -0,0 +1,43 @@ +/** 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/update_meeting", + title: "Update a meeting", + description: "Updates 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", + }, + meeting_id: { type: Schema.types.string, title: "Meeting ID" }, + 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: "Time zone", + }, + }, + required: ["teams_access_token", "meeting_id"], + }, + 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/update_meeting_test.ts b/src/connectors/microsoft.teams/functions/update_meeting_test.ts new file mode 100644 index 0000000..4276a1e --- /dev/null +++ b/src/connectors/microsoft.teams/functions/update_meeting_test.ts @@ -0,0 +1,37 @@ +/** 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 UpdateMeeting from "./update_meeting.ts"; + +Deno.test("UpdateMeeting can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_UpdateMeeting_slack_function", + title: "Test UpdateMeeting", + description: "This is a generated test to test UpdateMeeting", + }); + testWorkflow.addStep(UpdateMeeting, { + teams_access_token: "test", + meeting_id: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05Q9UPHBDL#/functions/update_meeting"); + assertEquals(actual.inputs, { + teams_access_token: "test", + meeting_id: "test", + }); +}); + +Deno.test("All outputs of Slack function UpdateMeeting should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_UpdateMeeting_slack_function", + title: "Test UpdateMeeting", + description: "This is a generated test to test UpdateMeeting", + }); + const step = testWorkflow.addStep(UpdateMeeting, { + teams_access_token: "test", + meeting_id: "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 index 42a23ef..e587ea2 100644 --- a/src/connectors/microsoft.teams/mod.ts +++ b/src/connectors/microsoft.teams/mod.ts @@ -1,5 +1,6 @@ /** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ import CreateMeeting from "./functions/create_meeting.ts"; +import UpdateMeeting from "./functions/update_meeting.ts"; const MicrosoftTeams = { functions: { @@ -7,6 +8,10 @@ const MicrosoftTeams = { * @see The {@link https://api.slack.com/reference/connectors/microsoft.teams/create_meeting CreateMeeting} documentation. */ CreateMeeting, + /** + * @see The {@link https://api.slack.com/reference/connectors/microsoft.teams/update_meeting UpdateMeeting} documentation. + */ + UpdateMeeting, }, } as const; diff --git a/src/connectors/mod.ts b/src/connectors/mod.ts index eef0c50..7586d7b 100644 --- a/src/connectors/mod.ts +++ b/src/connectors/mod.ts @@ -1,4 +1,4 @@ -/** This file was autogenerated on Tue Dec 10 2024. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +/** This file was autogenerated on Tue Jan 28 2025. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ import AdobeSign from "./adobe.sign/mod.ts"; import Airtable from "./airtable/mod.ts"; import Asana from "./asana/mod.ts"; diff --git a/src/connectors/pagerduty/functions/update_incident.ts b/src/connectors/pagerduty/functions/update_incident.ts new file mode 100644 index 0000000..52d56f7 --- /dev/null +++ b/src/connectors/pagerduty/functions/update_incident.ts @@ -0,0 +1,117 @@ +/** 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: "A04RSGH23L7#/functions/update_incident", + title: "Update an incident", + description: "Update a PagerDuty incident", + input_parameters: { + properties: { + incident_id: { + type: Schema.types.string, + description: "Enter incident name", + title: "Incident", + }, + pagerduty_access_token: { + type: Schema.slack.types.oauth2, + description: "Pagerduty access token", + title: "PagerDuty access token", + }, + incident_title: { + type: Schema.types.string, + description: "Enter incident title", + title: "Incident title", + }, + priority_id: { type: Schema.types.string, title: "Priority" }, + escalation_policy: { + type: Schema.types.string, + description: "PagerDuty Escalation policy", + title: "Escalation policy", + }, + urgency: { + type: Schema.types.string, + title: "Urgency", + enum: ["high", "low"], + }, + status: { + type: Schema.types.string, + title: "Status", + enum: ["acknowledged", "resolved"], + }, + resolution_note: { + type: Schema.types.string, + description: "Enter a resolution note", + title: "Resolution note", + }, + }, + required: ["incident_id", "pagerduty_access_token"], + }, + output_parameters: { + properties: { + incident_id: { + type: Schema.types.string, + description: "Incident ID", + title: "Incident ID", + }, + incident_url: { + type: Schema.types.string, + description: "Incident URL", + title: "Incident URL", + }, + incident_title: { + type: Schema.types.string, + description: "Incident title", + title: "Incident title", + }, + incident_details: { + type: Schema.types.string, + description: "Incident details", + title: "Incident details", + }, + escalation_policy: { + type: Schema.types.object, + description: "Escalation Policy", + title: "Escalation policy", + properties: { + id: { type: Schema.types.string, title: "Escalation policy ID" }, + summary: { + type: Schema.types.string, + title: "Escalation policy summary", + }, + html_url: { + type: Schema.types.string, + title: "Escalation policy URL", + }, + }, + additionalProperties: true, + required: [], + }, + service: { + type: Schema.types.object, + description: "Service", + title: "Service", + properties: { + id: { type: Schema.types.string, title: "Service ID" }, + summary: { type: Schema.types.string, title: "Service summary" }, + html_url: { type: Schema.types.string, title: "Service URL" }, + }, + additionalProperties: true, + required: [], + }, + team: { + type: Schema.types.object, + description: "Team", + title: "Team", + properties: { + id: { type: Schema.types.string, title: "Team ID" }, + summary: { type: Schema.types.string, title: "Team summary" }, + html_url: { type: Schema.types.string, title: "Team URL" }, + }, + additionalProperties: true, + required: [], + }, + }, + required: [], + }, +}); diff --git a/src/connectors/pagerduty/functions/update_incident_test.ts b/src/connectors/pagerduty/functions/update_incident_test.ts new file mode 100644 index 0000000..3d31427 --- /dev/null +++ b/src/connectors/pagerduty/functions/update_incident_test.ts @@ -0,0 +1,42 @@ +/** 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 UpdateIncident from "./update_incident.ts"; + +Deno.test("UpdateIncident can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_UpdateIncident_slack_function", + title: "Test UpdateIncident", + description: "This is a generated test to test UpdateIncident", + }); + testWorkflow.addStep(UpdateIncident, { + incident_id: "test", + pagerduty_access_token: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A04RSGH23L7#/functions/update_incident"); + assertEquals(actual.inputs, { + incident_id: "test", + pagerduty_access_token: "test", + }); +}); + +Deno.test("All outputs of Slack function UpdateIncident should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_UpdateIncident_slack_function", + title: "Test UpdateIncident", + description: "This is a generated test to test UpdateIncident", + }); + const step = testWorkflow.addStep(UpdateIncident, { + incident_id: "test", + pagerduty_access_token: "test", + }); + assertExists(step.outputs.incident_id); + assertExists(step.outputs.incident_url); + assertExists(step.outputs.incident_title); + assertExists(step.outputs.incident_details); + assertExists(step.outputs.escalation_policy); + assertExists(step.outputs.service); + assertExists(step.outputs.team); +}); diff --git a/src/connectors/pagerduty/mod.ts b/src/connectors/pagerduty/mod.ts index 3910dc8..698bb86 100644 --- a/src/connectors/pagerduty/mod.ts +++ b/src/connectors/pagerduty/mod.ts @@ -4,6 +4,7 @@ import CreateIncident from "./functions/create_incident.ts"; import EscalateIncident from "./functions/escalate_incident.ts"; import ResolveIncident from "./functions/resolve_incident.ts"; import SendStatusUpdate from "./functions/send_status_update.ts"; +import UpdateIncident from "./functions/update_incident.ts"; const Pagerduty = { functions: { @@ -27,6 +28,10 @@ const Pagerduty = { * @see The {@link https://api.slack.com/reference/connectors/pagerduty/send_status_update SendStatusUpdate} documentation. */ SendStatusUpdate, + /** + * @see The {@link https://api.slack.com/reference/connectors/pagerduty/update_incident UpdateIncident} documentation. + */ + UpdateIncident, }, } as const; diff --git a/src/connectors/servicenow/functions/get_incident.ts b/src/connectors/servicenow/functions/get_incident.ts index dfdf5e7..c799c13 100644 --- a/src/connectors/servicenow/functions/get_incident.ts +++ b/src/connectors/servicenow/functions/get_incident.ts @@ -52,6 +52,7 @@ export default DefineConnector({ description: "Incident url", title: "Incident url", }, + incident: { type: Schema.types.object, title: "Incident fields" }, timestamp_started: { type: Schema.slack.types.timestamp, description: "Time when step started", diff --git a/src/connectors/servicenow/functions/get_incident_test.ts b/src/connectors/servicenow/functions/get_incident_test.ts index 5e28710..a90c694 100644 --- a/src/connectors/servicenow/functions/get_incident_test.ts +++ b/src/connectors/servicenow/functions/get_incident_test.ts @@ -38,6 +38,7 @@ Deno.test("All outputs of Slack function GetIncident should exist", () => { assertExists(step.outputs.incident_number); assertExists(step.outputs.incident_priority); assertExists(step.outputs.incident_url); + assertExists(step.outputs.incident); assertExists(step.outputs.timestamp_started); assertExists(step.outputs.timestamp_completed); }); diff --git a/src/connectors/servicenow/functions/update_incident.ts b/src/connectors/servicenow/functions/update_incident.ts new file mode 100644 index 0000000..4bbea8e --- /dev/null +++ b/src/connectors/servicenow/functions/update_incident.ts @@ -0,0 +1,64 @@ +/** 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: "A07AYPT9X4P#/functions/update_incident", + title: "Update an incident", + input_parameters: { + properties: { + incident_number: { + type: Schema.types.string, + description: "Search incident", + title: "Incident number", + }, + metadata: { + type: Schema.types.object, + description: "Select an field", + title: "Name", + }, + servicenow_access_token: { + type: Schema.slack.types.oauth2, + description: "Servicenow Credential to use", + title: "Servicenow Access Token", + }, + }, + required: ["incident_number", "servicenow_access_token"], + }, + output_parameters: { + properties: { + incident_id: { + type: Schema.types.string, + description: "Incident ID", + title: "Incident ID", + }, + incident_url: { + type: Schema.types.string, + description: "Incident URL", + title: "Incident URL", + }, + incident_number: { + type: Schema.types.string, + description: "Incident number", + title: "Incident number", + }, + timestamp_started: { + type: Schema.slack.types.timestamp, + description: "Time when step started", + title: "Time when step started", + }, + timestamp_completed: { + type: Schema.slack.types.timestamp, + description: "Time when step completed", + title: "Time when step completed", + }, + }, + required: [ + "incident_id", + "incident_url", + "incident_number", + "timestamp_started", + "timestamp_completed", + ], + }, +}); diff --git a/src/connectors/servicenow/functions/update_incident_test.ts b/src/connectors/servicenow/functions/update_incident_test.ts new file mode 100644 index 0000000..b59c7ad --- /dev/null +++ b/src/connectors/servicenow/functions/update_incident_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 UpdateIncident from "./update_incident.ts"; + +Deno.test("UpdateIncident can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_UpdateIncident_slack_function", + title: "Test UpdateIncident", + description: "This is a generated test to test UpdateIncident", + }); + testWorkflow.addStep(UpdateIncident, { + incident_number: "test", + servicenow_access_token: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A07AYPT9X4P#/functions/update_incident"); + assertEquals(actual.inputs, { + incident_number: "test", + servicenow_access_token: "test", + }); +}); + +Deno.test("All outputs of Slack function UpdateIncident should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_UpdateIncident_slack_function", + title: "Test UpdateIncident", + description: "This is a generated test to test UpdateIncident", + }); + const step = testWorkflow.addStep(UpdateIncident, { + incident_number: "test", + servicenow_access_token: "test", + }); + assertExists(step.outputs.incident_id); + assertExists(step.outputs.incident_url); + assertExists(step.outputs.incident_number); + assertExists(step.outputs.timestamp_started); + assertExists(step.outputs.timestamp_completed); +}); diff --git a/src/connectors/servicenow/mod.ts b/src/connectors/servicenow/mod.ts index 1e2e974..892347a 100644 --- a/src/connectors/servicenow/mod.ts +++ b/src/connectors/servicenow/mod.ts @@ -1,6 +1,7 @@ /** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ import CreateIncident from "./functions/create_incident.ts"; import GetIncident from "./functions/get_incident.ts"; +import UpdateIncident from "./functions/update_incident.ts"; const Servicenow = { functions: { @@ -12,6 +13,10 @@ const Servicenow = { * @see The {@link https://api.slack.com/reference/connectors/servicenow/get_incident GetIncident} documentation. */ GetIncident, + /** + * @see The {@link https://api.slack.com/reference/connectors/servicenow/update_incident UpdateIncident} documentation. + */ + UpdateIncident, }, } as const; diff --git a/src/connectors/zendesk/functions/update_ticket.ts b/src/connectors/zendesk/functions/update_ticket.ts index c403768..039f3ab 100644 --- a/src/connectors/zendesk/functions/update_ticket.ts +++ b/src/connectors/zendesk/functions/update_ticket.ts @@ -7,11 +7,7 @@ export default DefineConnector({ title: "Update a ticket", input_parameters: { properties: { - ticket_id: { - type: Schema.types.integer, - description: "Enter ticket ID", - title: "Ticket ID", - }, + ticket_id: { type: Schema.types.integer, title: "Ticket ID" }, requester_email: { type: Schema.types.string, description: "Enter text", @@ -43,11 +39,7 @@ export default DefineConnector({ title: "Remove email CCs", items: { type: Schema.types.string }, }, - subject: { - type: Schema.types.string, - description: "Enter text", - title: "New ticket subject", - }, + subject: { type: Schema.types.string, title: "New ticket subject" }, type: { type: Schema.types.string, title: "New ticket type", @@ -75,7 +67,6 @@ export default DefineConnector({ }, zendesk_access_token: { type: Schema.slack.types.oauth2, - description: "Zendesk Credential to use", title: "Zendesk Access Token", }, }, @@ -83,36 +74,16 @@ export default DefineConnector({ }, output_parameters: { properties: { - requester_id: { - type: Schema.types.integer, - description: "The ticket's requester ID", - title: "Requester ID", - }, - requester_email: { - type: Schema.types.string, - description: "The ticket's requester email", - title: "Requester email", - }, - ticket_id: { - type: Schema.types.integer, - description: "The ticket ID", - title: "Ticket ID", - }, - ticket_url: { - type: Schema.types.string, - description: "The ticket URL", - title: "Ticket URL", - }, + requester_id: { type: Schema.types.integer, title: "Requester ID" }, + requester_email: { type: Schema.types.string, title: "Requester email" }, + ticket_id: { type: Schema.types.integer, title: "Ticket ID" }, + ticket_url: { type: Schema.types.string, title: "Ticket URL" }, assignee_id: { type: Schema.types.integer, description: "ID for the assigned user", title: "Assignee ID", }, - priority: { - type: Schema.types.string, - description: "Priority of the ticket", - title: "Priority", - }, + priority: { type: Schema.types.string, title: "Priority" }, }, required: ["ticket_id", "ticket_url"], },