diff --git a/src/connectors/mod.ts b/src/connectors/mod.ts index 275362c..cc89371 100644 --- a/src/connectors/mod.ts +++ b/src/connectors/mod.ts @@ -1,4 +1,4 @@ -/** This file was autogenerated on Mon Oct 21 2024. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +/** This file was autogenerated on Mon Oct 28 2024. 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/send_status_update.ts b/src/connectors/pagerduty/functions/send_status_update.ts new file mode 100644 index 0000000..bac0c7c --- /dev/null +++ b/src/connectors/pagerduty/functions/send_status_update.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: "A04RSGH23L7#/functions/send_status_update", + title: "Create a status update", + description: "You'll choose an incident to get the update", + input_parameters: { + properties: { + incident_id: { + type: Schema.types.string, + description: "Enter incident name", + title: "Incident", + }, + message: { + type: Schema.types.string, + description: "Enter text", + title: "Status update", + }, + subject: { + type: Schema.types.string, + description: "Enter text", + title: "Status update email subject", + }, + html_message: { + type: Schema.types.string, + description: "Enter text", + title: "Status update email", + }, + pagerduty_access_token: { + type: Schema.slack.types.oauth2, + description: "Pagerduty access token", + title: "PagerDuty access token", + }, + }, + required: ["incident_id", "message", "pagerduty_access_token"], + }, + output_parameters: { + properties: { + id: { + type: Schema.types.string, + description: "Status update ID", + title: "Status update ID", + }, + sender: { + type: Schema.types.object, + title: "Created by", + properties: { + id: { type: Schema.types.string, title: "ID" }, + type: { type: Schema.types.string, title: "Type" }, + summary: { type: Schema.types.string, title: "Name" }, + html_url: { type: Schema.types.string, title: "URL" }, + }, + additionalProperties: true, + required: [], + }, + message: { type: Schema.types.string, title: "Status update" }, + subject: { + type: Schema.types.string, + title: "Status update email subject", + }, + html_message: { type: Schema.types.string, title: "Status update email" }, + created_at: { type: Schema.slack.types.timestamp, title: "Created at" }, + }, + required: ["id", "sender", "message", "created_at"], + }, +}); diff --git a/src/connectors/pagerduty/functions/send_status_update_test.ts b/src/connectors/pagerduty/functions/send_status_update_test.ts new file mode 100644 index 0000000..e7e1411 --- /dev/null +++ b/src/connectors/pagerduty/functions/send_status_update_test.ts @@ -0,0 +1,44 @@ +/** 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 SendStatusUpdate from "./send_status_update.ts"; + +Deno.test("SendStatusUpdate can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_SendStatusUpdate_slack_function", + title: "Test SendStatusUpdate", + description: "This is a generated test to test SendStatusUpdate", + }); + testWorkflow.addStep(SendStatusUpdate, { + incident_id: "test", + message: "test", + pagerduty_access_token: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A04RSGH23L7#/functions/send_status_update"); + assertEquals(actual.inputs, { + incident_id: "test", + message: "test", + pagerduty_access_token: "test", + }); +}); + +Deno.test("All outputs of Slack function SendStatusUpdate should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_SendStatusUpdate_slack_function", + title: "Test SendStatusUpdate", + description: "This is a generated test to test SendStatusUpdate", + }); + const step = testWorkflow.addStep(SendStatusUpdate, { + incident_id: "test", + message: "test", + pagerduty_access_token: "test", + }); + assertExists(step.outputs.id); + assertExists(step.outputs.sender); + assertExists(step.outputs.message); + assertExists(step.outputs.subject); + assertExists(step.outputs.html_message); + assertExists(step.outputs.created_at); +}); diff --git a/src/connectors/pagerduty/mod.ts b/src/connectors/pagerduty/mod.ts index 7aebe15..3910dc8 100644 --- a/src/connectors/pagerduty/mod.ts +++ b/src/connectors/pagerduty/mod.ts @@ -3,6 +3,7 @@ import AddANote from "./functions/add_a_note.ts"; 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"; const Pagerduty = { functions: { @@ -22,6 +23,10 @@ const Pagerduty = { * @see The {@link https://api.slack.com/reference/connectors/pagerduty/resolve_incident ResolveIncident} documentation. */ ResolveIncident, + /** + * @see The {@link https://api.slack.com/reference/connectors/pagerduty/send_status_update SendStatusUpdate} documentation. + */ + SendStatusUpdate, }, } as const; diff --git a/src/connectors/salesforce/functions/read_record.ts b/src/connectors/salesforce/functions/read_record.ts index 0aa55c1..b639e84 100644 --- a/src/connectors/salesforce/functions/read_record.ts +++ b/src/connectors/salesforce/functions/read_record.ts @@ -27,19 +27,7 @@ export default DefineConnector({ }, output_parameters: { properties: { - record: { - type: Schema.types.object, - title: "Record", - properties: { - Id: { type: Schema.types.string }, - Name: { type: Schema.types.string }, - CreatedById: { type: Schema.types.string }, - CreatedDate: { type: Schema.types.string }, - Description: { type: Schema.types.string }, - }, - additionalProperties: true, - required: ["Id"], - }, + record: { type: Schema.types.object, title: "Record fields" }, salesforce_object_type: { type: Schema.types.string, title: "Salesforce Object Type",