Skip to content

Commit

Permalink
Automated commit: Latest generated changes from schedule action (#56)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <[email protected]>
  • Loading branch information
github-actions[bot] and WilliamBergamin authored Aug 12, 2024
1 parent 62a98d3 commit 4f819a1
Show file tree
Hide file tree
Showing 6 changed files with 256 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/connectors/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** This file was autogenerated on Mon Jul 29 2024. Follow the steps in src/schema/slack/functions/README.md to rebuild **/
/** This file was autogenerated on Mon Aug 12 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";
Expand Down Expand Up @@ -48,6 +48,7 @@ import Ramp from "./ramp/mod.ts";
import Ringcentral from "./ringcentral/mod.ts";
import Rootly from "./rootly/mod.ts";
import Salesforce from "./salesforce/mod.ts";
import Servicenow from "./servicenow/mod.ts";
import Smartrecruiters from "./smartrecruiters/mod.ts";
import Smartsheet from "./smartsheet/mod.ts";
import Snyk from "./snyk/mod.ts";
Expand Down Expand Up @@ -111,6 +112,7 @@ const Connectors = {
Ringcentral,
Rootly,
Salesforce,
Servicenow,
Smartrecruiters,
Smartsheet,
Snyk,
Expand Down
71 changes: 71 additions & 0 deletions src/connectors/servicenow/functions/create_incident.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/** 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/create_incident",
title: "Create an incident",
input_parameters: {
properties: {
short_description: {
type: Schema.types.string,
description: "Enter text",
title: "Short description",
},
caller_id: {
type: Schema.types.string,
description: "Select caller ID",
title: "Caller ID",
},
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: ["short_description", "caller_id", "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",
},
incident: { type: Schema.types.object, title: "Incident" },
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",
"incident",
"timestamp_started",
"timestamp_completed",
],
},
});
44 changes: 44 additions & 0 deletions src/connectors/servicenow/functions/create_incident_test.ts
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 CreateIncident from "./create_incident.ts";

Deno.test("CreateIncident can be used as a Slack function in a workflow step", () => {
const testWorkflow = DefineWorkflow({
callback_id: "test_CreateIncident_slack_function",
title: "Test CreateIncident",
description: "This is a generated test to test CreateIncident",
});
testWorkflow.addStep(CreateIncident, {
short_description: "test",
caller_id: "test",
servicenow_access_token: "test",
});
const actual = testWorkflow.steps[0].export();

assertEquals(actual.function_id, "A07AYPT9X4P#/functions/create_incident");
assertEquals(actual.inputs, {
short_description: "test",
caller_id: "test",
servicenow_access_token: "test",
});
});

Deno.test("All outputs of Slack function CreateIncident should exist", () => {
const testWorkflow = DefineWorkflow({
callback_id: "test_CreateIncident_slack_function",
title: "Test CreateIncident",
description: "This is a generated test to test CreateIncident",
});
const step = testWorkflow.addStep(CreateIncident, {
short_description: "test",
caller_id: "test",
servicenow_access_token: "test",
});
assertExists(step.outputs.incident_id);
assertExists(step.outputs.incident_url);
assertExists(step.outputs.incident_number);
assertExists(step.outputs.incident);
assertExists(step.outputs.timestamp_started);
assertExists(step.outputs.timestamp_completed);
});
77 changes: 77 additions & 0 deletions src/connectors/servicenow/functions/get_incident.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/** 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/get_incident",
title: "Get an incident",
input_parameters: {
properties: {
incident_number: {
type: Schema.types.string,
description: "Search incident",
title: "Incident number",
},
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_sys_id: {
type: Schema.types.string,
description: "Incident sys_id",
title: "Incident sys_id",
},
incident_short_description: {
type: Schema.types.string,
description: "Incident short description",
title: "Incident short description",
},
incident_state: {
type: Schema.types.string,
description: "Incident state",
title: "Incident state",
},
incident_number: {
type: Schema.types.string,
description: "Incident number",
title: "Incident number",
},
incident_priority: {
type: Schema.types.string,
description: "Incident priority",
title: "Incident priority",
},
incident_url: {
type: Schema.types.string,
description: "Incident url",
title: "Incident url",
},
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_sys_id",
"incident_short_description",
"incident_state",
"incident_number",
"incident_priority",
"incident_url",
"timestamp_started",
"timestamp_completed",
],
},
});
43 changes: 43 additions & 0 deletions src/connectors/servicenow/functions/get_incident_test.ts
Original file line number Diff line number Diff line change
@@ -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 GetIncident from "./get_incident.ts";

Deno.test("GetIncident can be used as a Slack function in a workflow step", () => {
const testWorkflow = DefineWorkflow({
callback_id: "test_GetIncident_slack_function",
title: "Test GetIncident",
description: "This is a generated test to test GetIncident",
});
testWorkflow.addStep(GetIncident, {
incident_number: "test",
servicenow_access_token: "test",
});
const actual = testWorkflow.steps[0].export();

assertEquals(actual.function_id, "A07AYPT9X4P#/functions/get_incident");
assertEquals(actual.inputs, {
incident_number: "test",
servicenow_access_token: "test",
});
});

Deno.test("All outputs of Slack function GetIncident should exist", () => {
const testWorkflow = DefineWorkflow({
callback_id: "test_GetIncident_slack_function",
title: "Test GetIncident",
description: "This is a generated test to test GetIncident",
});
const step = testWorkflow.addStep(GetIncident, {
incident_number: "test",
servicenow_access_token: "test",
});
assertExists(step.outputs.incident_sys_id);
assertExists(step.outputs.incident_short_description);
assertExists(step.outputs.incident_state);
assertExists(step.outputs.incident_number);
assertExists(step.outputs.incident_priority);
assertExists(step.outputs.incident_url);
assertExists(step.outputs.timestamp_started);
assertExists(step.outputs.timestamp_completed);
});
18 changes: 18 additions & 0 deletions src/connectors/servicenow/mod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/** 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";

const Servicenow = {
functions: {
/**
* @see The {@link https://api.slack.com/reference/connectors/servicenow/create_incident CreateIncident} documentation.
*/
CreateIncident,
/**
* @see The {@link https://api.slack.com/reference/connectors/servicenow/get_incident GetIncident} documentation.
*/
GetIncident,
},
} as const;

export default Servicenow;

0 comments on commit 4f819a1

Please sign in to comment.