-
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.
Automated commit: Latest generated changes from schedule action (#56)
Co-authored-by: github-actions <[email protected]>
- Loading branch information
1 parent
62a98d3
commit 4f819a1
Showing
6 changed files
with
256 additions
and
1 deletion.
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,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
44
src/connectors/servicenow/functions/create_incident_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 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); | ||
}); |
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,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", | ||
], | ||
}, | ||
}); |
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,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); | ||
}); |
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,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; |