-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new PagerDuty "Create a status update" connector, Salesforce Read…
… Record connector now returns shapeless object (#61) Co-authored-by: github-actions <[email protected]>
- Loading branch information
1 parent
7b20fd5
commit 958fbc8
Showing
5 changed files
with
119 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"], | ||
}, | ||
}); |
44 changes: 44 additions & 0 deletions
44
src/connectors/pagerduty/functions/send_status_update_test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters