diff --git a/src/connectors/deel/functions/add_time_off_request.ts b/src/connectors/deel/functions/add_time_off_request.ts new file mode 100644 index 0000000..8b36169 --- /dev/null +++ b/src/connectors/deel/functions/add_time_off_request.ts @@ -0,0 +1,69 @@ +/** 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: "A061MGQNY2K#/functions/add_time_off_request", + title: "Add a time off request", + input_parameters: { + properties: { + deel_access_token: { + type: Schema.slack.types.oauth2, + description: "Deel Credentials to use", + title: "Deel Access Token", + }, + contract_id: { + type: Schema.types.string, + description: "Select a contract", + title: "Contract ID", + }, + time_off_type: { + type: Schema.types.string, + description: "Select the time off type", + title: "Time off type", + enum: ["VACATION", "SICK_LEAVE", "OTHER"], + }, + start_date: { + type: Schema.slack.types.date, + description: "Select the start date", + title: "Start date", + }, + end_date: { + type: Schema.slack.types.date, + description: "Select the end date", + title: "End date", + }, + reason: { + type: Schema.types.string, + description: "Enter a text", + title: "Reason", + }, + is_half_start_day: { + type: Schema.types.boolean, + title: "Is the start day a half day?", + }, + is_half_end_day: { + type: Schema.types.boolean, + title: "Is the end day a half day?", + }, + other_timeoff_name: { + type: Schema.types.string, + title: "Custom name for other time off", + }, + }, + required: [ + "deel_access_token", + "contract_id", + "time_off_type", + "start_date", + "end_date", + ], + }, + output_parameters: { + properties: { + request_id: { type: Schema.types.string, title: "Time off request ID" }, + status: { type: Schema.types.string, title: "Request status" }, + }, + required: ["request_id", "status"], + }, +}); diff --git a/src/connectors/deel/functions/add_time_off_request_test.ts b/src/connectors/deel/functions/add_time_off_request_test.ts new file mode 100644 index 0000000..b866f75 --- /dev/null +++ b/src/connectors/deel/functions/add_time_off_request_test.ts @@ -0,0 +1,49 @@ +/** 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 AddTimeOffRequest from "./add_time_off_request.ts"; + +Deno.test("AddTimeOffRequest can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_AddTimeOffRequest_slack_function", + title: "Test AddTimeOffRequest", + description: "This is a generated test to test AddTimeOffRequest", + }); + testWorkflow.addStep(AddTimeOffRequest, { + deel_access_token: "test", + contract_id: "test", + time_off_type: "test", + start_date: "test", + end_date: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals( + actual.function_id, + "A061MGQNY2K#/functions/add_time_off_request", + ); + assertEquals(actual.inputs, { + deel_access_token: "test", + contract_id: "test", + time_off_type: "test", + start_date: "test", + end_date: "test", + }); +}); + +Deno.test("All outputs of Slack function AddTimeOffRequest should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_AddTimeOffRequest_slack_function", + title: "Test AddTimeOffRequest", + description: "This is a generated test to test AddTimeOffRequest", + }); + const step = testWorkflow.addStep(AddTimeOffRequest, { + deel_access_token: "test", + contract_id: "test", + time_off_type: "test", + start_date: "test", + end_date: "test", + }); + assertExists(step.outputs.request_id); + assertExists(step.outputs.status); +}); diff --git a/src/connectors/deel/functions/create_contract.ts b/src/connectors/deel/functions/create_contract.ts new file mode 100644 index 0000000..de682b1 --- /dev/null +++ b/src/connectors/deel/functions/create_contract.ts @@ -0,0 +1,142 @@ +/** 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: "A061MGQNY2K#/functions/create_contract", + title: "Create a new contract", + input_parameters: { + properties: { + deel_access_token: { + type: Schema.slack.types.oauth2, + description: "Deel Credentials to use", + title: "Deel Access Token", + }, + title: { + type: Schema.types.string, + description: "Enter the title of the contract", + title: "Title", + }, + legal_entity_id: { + type: Schema.types.string, + description: "Select the legal entity", + title: "Legal Entity", + }, + team_id: { + type: Schema.types.string, + description: "Select the team", + title: "Team", + }, + job_title: { + type: Schema.types.string, + description: "Enter the job title", + title: "Job title", + }, + documents_required: { + type: Schema.types.boolean, + title: "Are documents required?", + }, + contract_type: { + type: Schema.types.string, + description: "Select contract type", + title: "Contract type", + enum: [ + "pay_as_you_go_time_based", + "payg_tasks", + "payg_milestones", + "ongoing_time_based", + ], + }, + start_date: { + type: Schema.slack.types.date, + description: "Enter Start Date", + title: "Start Date", + }, + amount: { + type: Schema.types.number, + description: "Enter the amount to be paid", + title: "Amount", + }, + currency_code: { + type: Schema.types.string, + description: "Select the currency", + title: "Currency", + }, + frequency: { + type: Schema.types.string, + title: "Scale of the invoice cycle", + enum: [ + "weekly", + "monthly", + "biweekly", + "semimonthly", + "calendar-month", + ], + }, + cycle_end: { + type: Schema.types.number, + description: "Select a date between 1-31", + title: "Date invoice cycle ends", + }, + cycle_end_type: { + type: Schema.types.string, + title: "Select the cycle end type", + enum: ["DAY_OF_WEEK", "DAY_OF_LAST_WEEK", "DAY_OF_MONTH"], + }, + payment_due_type: { + type: Schema.types.string, + title: "Select the payment due type", + enum: ["REGULAR", "WITHIN_MONTH"], + }, + payment_due_days: { + type: Schema.types.number, + description: "Enter payment due days between 0-90", + title: "Payment due days", + }, + scale: { + type: Schema.types.string, + description: "Select the scale at which the amount is paid.", + title: "Scale of the invoice cycle", + enum: [ + "hourly", + "weekly", + "monthly", + "biweekly", + "semimonthly", + "calendar-month", + ], + }, + }, + required: [ + "deel_access_token", + "title", + "legal_entity_id", + "team_id", + "job_title", + "documents_required", + "contract_type", + "start_date", + "currency_code", + "frequency", + "cycle_end", + "cycle_end_type", + "payment_due_type", + "payment_due_days", + ], + }, + output_parameters: { + properties: { + contract_id: { + type: Schema.types.string, + description: "Contract ID", + title: "Contract ID", + }, + contract_url: { + type: Schema.types.string, + description: "Contract URL", + title: "Contract URL", + }, + }, + required: ["contract_id", "contract_url"], + }, +}); diff --git a/src/connectors/deel/functions/create_contract_test.ts b/src/connectors/deel/functions/create_contract_test.ts new file mode 100644 index 0000000..5289c13 --- /dev/null +++ b/src/connectors/deel/functions/create_contract_test.ts @@ -0,0 +1,73 @@ +/** 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 CreateContract from "./create_contract.ts"; + +Deno.test("CreateContract can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateContract_slack_function", + title: "Test CreateContract", + description: "This is a generated test to test CreateContract", + }); + testWorkflow.addStep(CreateContract, { + deel_access_token: "test", + title: "test", + legal_entity_id: "test", + team_id: "test", + job_title: "test", + documents_required: "test", + contract_type: "test", + start_date: "test", + currency_code: "test", + frequency: "test", + cycle_end: "test", + cycle_end_type: "test", + payment_due_type: "test", + payment_due_days: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A061MGQNY2K#/functions/create_contract"); + assertEquals(actual.inputs, { + deel_access_token: "test", + title: "test", + legal_entity_id: "test", + team_id: "test", + job_title: "test", + documents_required: "test", + contract_type: "test", + start_date: "test", + currency_code: "test", + frequency: "test", + cycle_end: "test", + cycle_end_type: "test", + payment_due_type: "test", + payment_due_days: "test", + }); +}); + +Deno.test("All outputs of Slack function CreateContract should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateContract_slack_function", + title: "Test CreateContract", + description: "This is a generated test to test CreateContract", + }); + const step = testWorkflow.addStep(CreateContract, { + deel_access_token: "test", + title: "test", + legal_entity_id: "test", + team_id: "test", + job_title: "test", + documents_required: "test", + contract_type: "test", + start_date: "test", + currency_code: "test", + frequency: "test", + cycle_end: "test", + cycle_end_type: "test", + payment_due_type: "test", + payment_due_days: "test", + }); + assertExists(step.outputs.contract_id); + assertExists(step.outputs.contract_url); +}); diff --git a/src/connectors/deel/mod.ts b/src/connectors/deel/mod.ts new file mode 100644 index 0000000..c457c1c --- /dev/null +++ b/src/connectors/deel/mod.ts @@ -0,0 +1,18 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import AddTimeOffRequest from "./functions/add_time_off_request.ts"; +import CreateContract from "./functions/create_contract.ts"; + +const Deel = { + functions: { + /** + * @see The {@link https://api.slack.com/reference/connectors/deel/add_time_off_request AddTimeOffRequest} documentation. + */ + AddTimeOffRequest, + /** + * @see The {@link https://api.slack.com/reference/connectors/deel/create_contract CreateContract} documentation. + */ + CreateContract, + }, +} as const; + +export default Deel; diff --git a/src/connectors/firehydrant/functions/create_incident.ts b/src/connectors/firehydrant/functions/create_incident.ts new file mode 100644 index 0000000..a1f3973 --- /dev/null +++ b/src/connectors/firehydrant/functions/create_incident.ts @@ -0,0 +1,52 @@ +/** 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: "A05TG2LEXPV#/functions/create_incident", + title: "Create an incident", + input_parameters: { + properties: { + name: { + type: Schema.types.string, + description: "Enter text", + title: "Incident name", + }, + description: { + type: Schema.types.string, + description: "Enter text", + title: "Description", + }, + priority: { + type: Schema.types.string, + description: "Select an option", + title: "Priority", + }, + severity: { + type: Schema.types.string, + description: "Select an option", + title: "Severity", + }, + team_ids: { + type: Schema.types.array, + description: "Select teams to be assigned", + title: "Teams", + items: { type: Schema.types.string }, + }, + }, + required: ["name"], + }, + output_parameters: { + properties: { + incident_id: { type: Schema.types.string, title: "Incident ID" }, + incident_url: { type: Schema.types.string, title: "Incident URL" }, + incident_description: { + type: Schema.types.string, + title: "Incident description", + }, + priority: { type: Schema.types.string, title: "Incident priority" }, + severity: { type: Schema.types.string, title: "Incident severity" }, + }, + required: [], + }, +}); diff --git a/src/connectors/firehydrant/functions/create_incident_test.ts b/src/connectors/firehydrant/functions/create_incident_test.ts new file mode 100644 index 0000000..c338b68 --- /dev/null +++ b/src/connectors/firehydrant/functions/create_incident_test.ts @@ -0,0 +1,31 @@ +/** 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, { name: "test" }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05TG2LEXPV#/functions/create_incident"); + assertEquals(actual.inputs, { name: "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, { name: "test" }); + assertExists(step.outputs.incident_id); + assertExists(step.outputs.incident_url); + assertExists(step.outputs.incident_description); + assertExists(step.outputs.priority); + assertExists(step.outputs.severity); +}); diff --git a/src/connectors/firehydrant/functions/create_task.ts b/src/connectors/firehydrant/functions/create_task.ts new file mode 100644 index 0000000..0c6c3f5 --- /dev/null +++ b/src/connectors/firehydrant/functions/create_task.ts @@ -0,0 +1,51 @@ +/** 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: "A05TG2LEXPV#/functions/create_task", + title: "Create a task", + input_parameters: { + properties: { + incident_id: { + type: Schema.types.string, + description: "Select an incident", + title: "Incident", + }, + title: { + type: Schema.types.string, + description: "Enter text", + title: "Task title", + }, + description: { + type: Schema.types.string, + description: "Enter text", + title: "Description", + }, + state: { + type: Schema.types.string, + description: "Select state", + title: "State", + enum: ["open", "in_progress", "cancelled", "done"], + }, + assignee_id: { + type: Schema.types.string, + description: "Select an option", + title: "Assignee", + }, + }, + required: ["incident_id", "title"], + }, + output_parameters: { + properties: { + task_id: { type: Schema.types.string, title: "Task ID" }, + task_description: { + type: Schema.types.string, + title: "Task description", + }, + title: { type: Schema.types.string, title: "Task title" }, + state: { type: Schema.types.string, title: "State" }, + }, + required: [], + }, +}); diff --git a/src/connectors/firehydrant/functions/create_task_test.ts b/src/connectors/firehydrant/functions/create_task_test.ts new file mode 100644 index 0000000..799c884 --- /dev/null +++ b/src/connectors/firehydrant/functions/create_task_test.ts @@ -0,0 +1,33 @@ +/** 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 CreateTask from "./create_task.ts"; + +Deno.test("CreateTask can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateTask_slack_function", + title: "Test CreateTask", + description: "This is a generated test to test CreateTask", + }); + testWorkflow.addStep(CreateTask, { incident_id: "test", title: "test" }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05TG2LEXPV#/functions/create_task"); + assertEquals(actual.inputs, { incident_id: "test", title: "test" }); +}); + +Deno.test("All outputs of Slack function CreateTask should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateTask_slack_function", + title: "Test CreateTask", + description: "This is a generated test to test CreateTask", + }); + const step = testWorkflow.addStep(CreateTask, { + incident_id: "test", + title: "test", + }); + assertExists(step.outputs.task_id); + assertExists(step.outputs.task_description); + assertExists(step.outputs.title); + assertExists(step.outputs.state); +}); diff --git a/src/connectors/firehydrant/functions/update_incident.ts b/src/connectors/firehydrant/functions/update_incident.ts new file mode 100644 index 0000000..817b9ff --- /dev/null +++ b/src/connectors/firehydrant/functions/update_incident.ts @@ -0,0 +1,51 @@ +/** 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: "A05TG2LEXPV#/functions/update_incident", + title: "Update an incident", + input_parameters: { + properties: { + incident_id: { + type: Schema.types.string, + description: "Select an incident", + title: "Incident", + }, + name: { + type: Schema.types.string, + description: "Enter text", + title: "Incident name", + }, + description: { + type: Schema.types.string, + description: "Enter text", + title: "Description", + }, + priority: { + type: Schema.types.string, + description: "Select an option", + title: "Priority", + }, + severity: { + type: Schema.types.string, + description: "Select an option", + title: "Severity", + }, + }, + required: ["incident_id"], + }, + output_parameters: { + properties: { + incident_id: { type: Schema.types.string, title: "Incident ID" }, + incident_url: { type: Schema.types.string, title: "Incident URL" }, + incident_description: { + type: Schema.types.string, + title: "Incident description", + }, + priority: { type: Schema.types.string, title: "Incident priority" }, + severity: { type: Schema.types.string, title: "Incident severity" }, + }, + required: [], + }, +}); diff --git a/src/connectors/firehydrant/functions/update_incident_test.ts b/src/connectors/firehydrant/functions/update_incident_test.ts new file mode 100644 index 0000000..a950523 --- /dev/null +++ b/src/connectors/firehydrant/functions/update_incident_test.ts @@ -0,0 +1,31 @@ +/** 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" }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05TG2LEXPV#/functions/update_incident"); + assertEquals(actual.inputs, { incident_id: "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" }); + assertExists(step.outputs.incident_id); + assertExists(step.outputs.incident_url); + assertExists(step.outputs.incident_description); + assertExists(step.outputs.priority); + assertExists(step.outputs.severity); +}); diff --git a/src/connectors/firehydrant/functions/update_task.ts b/src/connectors/firehydrant/functions/update_task.ts new file mode 100644 index 0000000..8089a3d --- /dev/null +++ b/src/connectors/firehydrant/functions/update_task.ts @@ -0,0 +1,56 @@ +/** 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: "A05TG2LEXPV#/functions/update_task", + title: "Update a task", + input_parameters: { + properties: { + incident_id: { + type: Schema.types.string, + description: "Select an incident", + title: "Incident", + }, + task_id: { + type: Schema.types.string, + description: "Select a task", + title: "Task", + }, + title: { + type: Schema.types.string, + description: "Enter text", + title: "Task title", + }, + description: { + type: Schema.types.string, + description: "Enter text", + title: "Description", + }, + state: { + type: Schema.types.string, + description: "Select state", + title: "State", + enum: ["open", "in_progress", "cancelled", "done"], + }, + assignee_id: { + type: Schema.types.string, + description: "Select a user", + title: "User", + }, + }, + required: ["incident_id", "task_id"], + }, + output_parameters: { + properties: { + task_id: { type: Schema.types.string, title: "Task ID" }, + task_description: { + type: Schema.types.string, + title: "Task description", + }, + title: { type: Schema.types.string, title: "Task title" }, + state: { type: Schema.types.string, title: "State" }, + }, + required: [], + }, +}); diff --git a/src/connectors/firehydrant/functions/update_task_test.ts b/src/connectors/firehydrant/functions/update_task_test.ts new file mode 100644 index 0000000..1690d86 --- /dev/null +++ b/src/connectors/firehydrant/functions/update_task_test.ts @@ -0,0 +1,33 @@ +/** 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, { incident_id: "test", task_id: "test" }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05TG2LEXPV#/functions/update_task"); + assertEquals(actual.inputs, { incident_id: "test", task_id: "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, { + incident_id: "test", + task_id: "test", + }); + assertExists(step.outputs.task_id); + assertExists(step.outputs.task_description); + assertExists(step.outputs.title); + assertExists(step.outputs.state); +}); diff --git a/src/connectors/firehydrant/mod.ts b/src/connectors/firehydrant/mod.ts new file mode 100644 index 0000000..481e0c4 --- /dev/null +++ b/src/connectors/firehydrant/mod.ts @@ -0,0 +1,28 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import CreateIncident from "./functions/create_incident.ts"; +import CreateTask from "./functions/create_task.ts"; +import UpdateIncident from "./functions/update_incident.ts"; +import UpdateTask from "./functions/update_task.ts"; + +const Firehydrant = { + functions: { + /** + * @see The {@link https://api.slack.com/reference/connectors/firehydrant/create_incident CreateIncident} documentation. + */ + CreateIncident, + /** + * @see The {@link https://api.slack.com/reference/connectors/firehydrant/create_task CreateTask} documentation. + */ + CreateTask, + /** + * @see The {@link https://api.slack.com/reference/connectors/firehydrant/update_incident UpdateIncident} documentation. + */ + UpdateIncident, + /** + * @see The {@link https://api.slack.com/reference/connectors/firehydrant/update_task UpdateTask} documentation. + */ + UpdateTask, + }, +} as const; + +export default Firehydrant; diff --git a/src/connectors/github.enterprise_server/functions/create_issue.ts b/src/connectors/github.enterprise_server/functions/create_issue.ts new file mode 100644 index 0000000..2215b57 --- /dev/null +++ b/src/connectors/github.enterprise_server/functions/create_issue.ts @@ -0,0 +1,59 @@ +/** 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: "A0516LWJMFE#/functions/create_issue", + title: "Create an issue", + description: "Create a GitHub issue", + input_parameters: { + properties: { + repository: { + type: Schema.types.string, + description: "Select a GitHub repository", + title: "Select a repository", + }, + title: { + type: Schema.types.string, + description: "Enter an issue title...", + title: "Issue title", + }, + description: { + type: Schema.types.string, + description: "Enter a description...", + title: "Description", + }, + github_enterprise_server_access_token: { + type: Schema.slack.types.oauth2, + description: "GitHub Credential to use", + title: "GitHub Enterprise Access Token", + }, + }, + required: ["repository", "title", "github_enterprise_server_access_token"], + }, + output_parameters: { + properties: { + issue_number: { + type: Schema.types.string, + description: "Issue number", + title: "Issue number", + }, + issue_url: { + type: Schema.types.string, + description: "Issue URL", + title: "Issue URL", + }, + title: { + type: Schema.types.string, + description: "Issue title", + title: "Issue title", + }, + body: { + type: Schema.types.string, + description: "Issue description", + title: "Description", + }, + }, + required: ["issue_number", "issue_url", "title", "body"], + }, +}); diff --git a/src/connectors/github.enterprise_server/functions/create_issue_test.ts b/src/connectors/github.enterprise_server/functions/create_issue_test.ts new file mode 100644 index 0000000..f8f387c --- /dev/null +++ b/src/connectors/github.enterprise_server/functions/create_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 CreateIssue from "./create_issue.ts"; + +Deno.test("CreateIssue can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateIssue_slack_function", + title: "Test CreateIssue", + description: "This is a generated test to test CreateIssue", + }); + testWorkflow.addStep(CreateIssue, { + repository: "test", + title: "test", + github_enterprise_server_access_token: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A0516LWJMFE#/functions/create_issue"); + assertEquals(actual.inputs, { + repository: "test", + title: "test", + github_enterprise_server_access_token: "test", + }); +}); + +Deno.test("All outputs of Slack function CreateIssue should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateIssue_slack_function", + title: "Test CreateIssue", + description: "This is a generated test to test CreateIssue", + }); + const step = testWorkflow.addStep(CreateIssue, { + repository: "test", + title: "test", + github_enterprise_server_access_token: "test", + }); + assertExists(step.outputs.issue_number); + assertExists(step.outputs.issue_url); + assertExists(step.outputs.title); + assertExists(step.outputs.body); +}); diff --git a/src/connectors/github.enterprise_server/mod.ts b/src/connectors/github.enterprise_server/mod.ts new file mode 100644 index 0000000..822151f --- /dev/null +++ b/src/connectors/github.enterprise_server/mod.ts @@ -0,0 +1,13 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import CreateIssue from "./functions/create_issue.ts"; + +const GithubEnterpriseServer = { + functions: { + /** + * @see The {@link https://api.slack.com/reference/connectors/github.enterprise_server/create_issue CreateIssue} documentation. + */ + CreateIssue, + }, +} as const; + +export default GithubEnterpriseServer; diff --git a/src/connectors/google.meet/functions/start_meeting.ts b/src/connectors/google.meet/functions/start_meeting.ts index 0cca893..a419348 100644 --- a/src/connectors/google.meet/functions/start_meeting.ts +++ b/src/connectors/google.meet/functions/start_meeting.ts @@ -5,7 +5,6 @@ import { Schema } from "../../../deps.ts"; export default DefineConnector({ callback_id: "A05A1NP97K6#/functions/start_meeting", title: "Start a meeting - BETA", - description: "Creates a Google Meet link instantly", input_parameters: { properties: { google_access_token: { diff --git a/src/connectors/greenhouse.onboarding/functions/create_pending_hire.ts b/src/connectors/greenhouse.onboarding/functions/create_pending_hire.ts new file mode 100644 index 0000000..ffbaa91 --- /dev/null +++ b/src/connectors/greenhouse.onboarding/functions/create_pending_hire.ts @@ -0,0 +1,60 @@ +/** 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: "A05RY71E6UE#/functions/create_pending_hire", + title: "Create pending hire", + input_parameters: { + properties: { + first_name: { + type: Schema.types.string, + description: "Enter first name", + title: "First name", + }, + last_name: { + type: Schema.types.string, + description: "Enter last name", + title: "Last name", + }, + email: { + type: Schema.types.string, + description: "Enter email ID", + title: "Email", + }, + work_country_code: { + type: Schema.types.string, + description: "Select a country code", + title: "Work country code", + }, + employment_status: { + type: Schema.types.string, + title: "Employment status", + }, + }, + required: [ + "first_name", + "last_name", + "email", + "work_country_code", + "employment_status", + ], + }, + output_parameters: { + properties: { + id: { type: Schema.types.string, title: "Hire ID" }, + first_name: { type: Schema.types.string, title: "First name" }, + last_name: { type: Schema.types.string, title: "Last name" }, + email: { type: Schema.types.string, title: "Email" }, + work_country_code: { + type: Schema.types.string, + title: "Work country code", + }, + employment_status: { + type: Schema.types.string, + title: "Employment status", + }, + }, + required: [], + }, +}); diff --git a/src/connectors/greenhouse.onboarding/functions/create_pending_hire_test.ts b/src/connectors/greenhouse.onboarding/functions/create_pending_hire_test.ts new file mode 100644 index 0000000..bf3ad77 --- /dev/null +++ b/src/connectors/greenhouse.onboarding/functions/create_pending_hire_test.ts @@ -0,0 +1,53 @@ +/** 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 CreatePendingHire from "./create_pending_hire.ts"; + +Deno.test("CreatePendingHire can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreatePendingHire_slack_function", + title: "Test CreatePendingHire", + description: "This is a generated test to test CreatePendingHire", + }); + testWorkflow.addStep(CreatePendingHire, { + first_name: "test", + last_name: "test", + email: "test", + work_country_code: "test", + employment_status: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals( + actual.function_id, + "A05RY71E6UE#/functions/create_pending_hire", + ); + assertEquals(actual.inputs, { + first_name: "test", + last_name: "test", + email: "test", + work_country_code: "test", + employment_status: "test", + }); +}); + +Deno.test("All outputs of Slack function CreatePendingHire should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreatePendingHire_slack_function", + title: "Test CreatePendingHire", + description: "This is a generated test to test CreatePendingHire", + }); + const step = testWorkflow.addStep(CreatePendingHire, { + first_name: "test", + last_name: "test", + email: "test", + work_country_code: "test", + employment_status: "test", + }); + assertExists(step.outputs.id); + assertExists(step.outputs.first_name); + assertExists(step.outputs.last_name); + assertExists(step.outputs.email); + assertExists(step.outputs.work_country_code); + assertExists(step.outputs.employment_status); +}); diff --git a/src/connectors/greenhouse.onboarding/functions/fetch_employees.ts b/src/connectors/greenhouse.onboarding/functions/fetch_employees.ts new file mode 100644 index 0000000..a03294d --- /dev/null +++ b/src/connectors/greenhouse.onboarding/functions/fetch_employees.ts @@ -0,0 +1,37 @@ +/** 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: "A05RY71E6UE#/functions/fetch_employees", + title: "Fetch employees", + input_parameters: { + properties: { + employment_status: { + type: Schema.types.string, + title: "Employment status", + }, + }, + required: ["employment_status"], + }, + output_parameters: { + properties: { + emails: { + type: Schema.types.array, + title: "Email IDs", + items: { type: Schema.types.string }, + }, + names: { + type: Schema.types.array, + title: "Names", + items: { type: Schema.types.string }, + }, + employee_ids: { + type: Schema.types.array, + title: "Employee IDs", + items: { type: Schema.types.string }, + }, + }, + required: [], + }, +}); diff --git a/src/connectors/greenhouse.onboarding/functions/fetch_employees_test.ts b/src/connectors/greenhouse.onboarding/functions/fetch_employees_test.ts new file mode 100644 index 0000000..b54a889 --- /dev/null +++ b/src/connectors/greenhouse.onboarding/functions/fetch_employees_test.ts @@ -0,0 +1,31 @@ +/** 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 FetchEmployees from "./fetch_employees.ts"; + +Deno.test("FetchEmployees can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_FetchEmployees_slack_function", + title: "Test FetchEmployees", + description: "This is a generated test to test FetchEmployees", + }); + testWorkflow.addStep(FetchEmployees, { employment_status: "test" }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05RY71E6UE#/functions/fetch_employees"); + assertEquals(actual.inputs, { employment_status: "test" }); +}); + +Deno.test("All outputs of Slack function FetchEmployees should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_FetchEmployees_slack_function", + title: "Test FetchEmployees", + description: "This is a generated test to test FetchEmployees", + }); + const step = testWorkflow.addStep(FetchEmployees, { + employment_status: "test", + }); + assertExists(step.outputs.emails); + assertExists(step.outputs.names); + assertExists(step.outputs.employee_ids); +}); diff --git a/src/connectors/greenhouse.onboarding/mod.ts b/src/connectors/greenhouse.onboarding/mod.ts new file mode 100644 index 0000000..07abb8c --- /dev/null +++ b/src/connectors/greenhouse.onboarding/mod.ts @@ -0,0 +1,18 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import CreatePendingHire from "./functions/create_pending_hire.ts"; +import FetchEmployees from "./functions/fetch_employees.ts"; + +const GreenhouseOnboarding = { + functions: { + /** + * @see The {@link https://api.slack.com/reference/connectors/greenhouse.onboarding/create_pending_hire CreatePendingHire} documentation. + */ + CreatePendingHire, + /** + * @see The {@link https://api.slack.com/reference/connectors/greenhouse.onboarding/fetch_employees FetchEmployees} documentation. + */ + FetchEmployees, + }, +} as const; + +export default GreenhouseOnboarding; diff --git a/src/connectors/lever/functions/create_interview.ts b/src/connectors/lever/functions/create_interview.ts new file mode 100644 index 0000000..101b646 --- /dev/null +++ b/src/connectors/lever/functions/create_interview.ts @@ -0,0 +1,87 @@ +/** 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: "A063ZSXC719#/functions/create_interview", + title: "Create an interview", + description: "Create an interview for an opportunity", + input_parameters: { + properties: { + opportunity_id: { + type: Schema.types.string, + description: "Please select an option", + title: "Opportunity", + }, + perform_as: { + type: Schema.types.string, + description: "Please select an option", + title: "Perform this create on behalf of a specified user", + }, + panel_id: { + type: Schema.types.string, + description: "Please select an option", + title: "Panel", + }, + subject: { + type: Schema.types.string, + description: "Enter text", + title: "Interview subject", + }, + location: { + type: Schema.types.string, + description: "Enter text", + title: "Interview location", + }, + date: { + type: Schema.slack.types.timestamp, + description: "Enter text", + title: "Interview date", + }, + duration: { + type: Schema.types.number, + description: "Enter text", + title: "Interview duration in minutes", + }, + interviewers: { + type: Schema.types.array, + description: "Please select options", + title: "Interviewers", + items: { type: Schema.types.string }, + }, + feedback_template_id: { + type: Schema.types.string, + description: "Please select an option", + title: "Feedback template", + }, + note: { + type: Schema.types.string, + description: "Enter text", + title: "Note for panel", + }, + }, + required: [ + "opportunity_id", + "perform_as", + "panel_id", + "date", + "duration", + "interviewers", + ], + }, + output_parameters: { + properties: { + interview_id: { + type: Schema.types.string, + description: "New interview ID", + title: "Interview ID", + }, + interview_url: { + type: Schema.types.string, + description: "interview URL", + title: "Interview URL", + }, + }, + required: ["interview_id"], + }, +}); diff --git a/src/connectors/lever/functions/create_interview_test.ts b/src/connectors/lever/functions/create_interview_test.ts new file mode 100644 index 0000000..e3150cc --- /dev/null +++ b/src/connectors/lever/functions/create_interview_test.ts @@ -0,0 +1,49 @@ +/** 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 CreateInterview from "./create_interview.ts"; + +Deno.test("CreateInterview can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateInterview_slack_function", + title: "Test CreateInterview", + description: "This is a generated test to test CreateInterview", + }); + testWorkflow.addStep(CreateInterview, { + opportunity_id: "test", + perform_as: "test", + panel_id: "test", + date: "test", + duration: "test", + interviewers: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A063ZSXC719#/functions/create_interview"); + assertEquals(actual.inputs, { + opportunity_id: "test", + perform_as: "test", + panel_id: "test", + date: "test", + duration: "test", + interviewers: "test", + }); +}); + +Deno.test("All outputs of Slack function CreateInterview should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateInterview_slack_function", + title: "Test CreateInterview", + description: "This is a generated test to test CreateInterview", + }); + const step = testWorkflow.addStep(CreateInterview, { + opportunity_id: "test", + perform_as: "test", + panel_id: "test", + date: "test", + duration: "test", + interviewers: "test", + }); + assertExists(step.outputs.interview_id); + assertExists(step.outputs.interview_url); +}); diff --git a/src/connectors/lever/functions/create_opportunity.ts b/src/connectors/lever/functions/create_opportunity.ts new file mode 100644 index 0000000..c1c03d5 --- /dev/null +++ b/src/connectors/lever/functions/create_opportunity.ts @@ -0,0 +1,62 @@ +/** 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: "A063ZSXC719#/functions/create_opportunity", + title: "Create an opportunity", + input_parameters: { + properties: { + perform_as: { + type: Schema.types.string, + description: "Please select an option", + title: "Perform this create on behalf of a specified user", + }, + name: { + type: Schema.types.string, + description: "Enter text", + title: "Contact full name", + }, + headline: { + type: Schema.types.string, + description: "Enter text", + title: "Contact headline", + }, + emails: { + type: Schema.types.array, + description: "Enter text", + title: "Contact emails", + items: { type: Schema.types.string }, + }, + origin: { + type: Schema.types.string, + description: "Enter text", + title: "Origin", + enum: [ + "agency", + "private", + "internal", + "referred", + "sourced", + "university", + ], + }, + }, + required: ["perform_as", "name"], + }, + output_parameters: { + properties: { + opportunity_id: { + type: Schema.types.string, + description: "New opportunity ID", + title: "Opportunity ID", + }, + opportunity_url: { + type: Schema.types.string, + description: "New opportunity url", + title: "Opportunity URL", + }, + }, + required: ["opportunity_id"], + }, +}); diff --git a/src/connectors/lever/functions/create_opportunity_test.ts b/src/connectors/lever/functions/create_opportunity_test.ts new file mode 100644 index 0000000..5490591 --- /dev/null +++ b/src/connectors/lever/functions/create_opportunity_test.ts @@ -0,0 +1,31 @@ +/** 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 CreateOpportunity from "./create_opportunity.ts"; + +Deno.test("CreateOpportunity can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateOpportunity_slack_function", + title: "Test CreateOpportunity", + description: "This is a generated test to test CreateOpportunity", + }); + testWorkflow.addStep(CreateOpportunity, { perform_as: "test", name: "test" }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A063ZSXC719#/functions/create_opportunity"); + assertEquals(actual.inputs, { perform_as: "test", name: "test" }); +}); + +Deno.test("All outputs of Slack function CreateOpportunity should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateOpportunity_slack_function", + title: "Test CreateOpportunity", + description: "This is a generated test to test CreateOpportunity", + }); + const step = testWorkflow.addStep(CreateOpportunity, { + perform_as: "test", + name: "test", + }); + assertExists(step.outputs.opportunity_id); + assertExists(step.outputs.opportunity_url); +}); diff --git a/src/connectors/lever/functions/create_panel.ts b/src/connectors/lever/functions/create_panel.ts new file mode 100644 index 0000000..a291eab --- /dev/null +++ b/src/connectors/lever/functions/create_panel.ts @@ -0,0 +1,83 @@ +/** 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: "A063ZSXC719#/functions/create_panel", + title: "Create a panel", + description: "Create a panel for an interview", + input_parameters: { + properties: { + opportunity_id: { + type: Schema.types.string, + description: "Please select an option", + title: "Opportunity", + }, + perform_as: { + type: Schema.types.string, + description: "Please select an option", + title: "Perform this create on behalf of a specified user", + }, + timezone: { + type: Schema.types.string, + description: "Enter text", + title: "Timezone", + }, + note: { + type: Schema.types.string, + description: "Enter text", + title: "Note for panel", + }, + location: { + type: Schema.types.string, + description: "Enter text", + title: "Interview location", + }, + subject: { + type: Schema.types.string, + description: "Enter text", + title: "Interview subject", + }, + duration: { + type: Schema.types.number, + description: "Enter text", + title: "Interview duration in minutes", + }, + date: { + type: Schema.slack.types.timestamp, + description: "Enter text", + title: "Interview date", + }, + interviewers: { + type: Schema.types.array, + description: "Please select options", + title: "Interviewers", + items: { type: Schema.types.string }, + }, + }, + required: [ + "opportunity_id", + "perform_as", + "timezone", + "subject", + "duration", + "date", + "interviewers", + ], + }, + output_parameters: { + properties: { + panel_id: { + type: Schema.types.string, + description: "New panel ID", + title: "Panel ID", + }, + panel_url: { + type: Schema.types.string, + description: "new panel URL", + title: "Panel URL", + }, + }, + required: ["panel_id"], + }, +}); diff --git a/src/connectors/lever/functions/create_panel_test.ts b/src/connectors/lever/functions/create_panel_test.ts new file mode 100644 index 0000000..89f0b76 --- /dev/null +++ b/src/connectors/lever/functions/create_panel_test.ts @@ -0,0 +1,52 @@ +/** 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 CreatePanel from "./create_panel.ts"; + +Deno.test("CreatePanel can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreatePanel_slack_function", + title: "Test CreatePanel", + description: "This is a generated test to test CreatePanel", + }); + testWorkflow.addStep(CreatePanel, { + opportunity_id: "test", + perform_as: "test", + timezone: "test", + subject: "test", + duration: "test", + date: "test", + interviewers: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A063ZSXC719#/functions/create_panel"); + assertEquals(actual.inputs, { + opportunity_id: "test", + perform_as: "test", + timezone: "test", + subject: "test", + duration: "test", + date: "test", + interviewers: "test", + }); +}); + +Deno.test("All outputs of Slack function CreatePanel should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreatePanel_slack_function", + title: "Test CreatePanel", + description: "This is a generated test to test CreatePanel", + }); + const step = testWorkflow.addStep(CreatePanel, { + opportunity_id: "test", + perform_as: "test", + timezone: "test", + subject: "test", + duration: "test", + date: "test", + interviewers: "test", + }); + assertExists(step.outputs.panel_id); + assertExists(step.outputs.panel_url); +}); diff --git a/src/connectors/lever/mod.ts b/src/connectors/lever/mod.ts new file mode 100644 index 0000000..78895b2 --- /dev/null +++ b/src/connectors/lever/mod.ts @@ -0,0 +1,23 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import CreateInterview from "./functions/create_interview.ts"; +import CreateOpportunity from "./functions/create_opportunity.ts"; +import CreatePanel from "./functions/create_panel.ts"; + +const Lever = { + functions: { + /** + * @see The {@link https://api.slack.com/reference/connectors/lever/create_interview CreateInterview} documentation. + */ + CreateInterview, + /** + * @see The {@link https://api.slack.com/reference/connectors/lever/create_opportunity CreateOpportunity} documentation. + */ + CreateOpportunity, + /** + * @see The {@link https://api.slack.com/reference/connectors/lever/create_panel CreatePanel} documentation. + */ + CreatePanel, + }, +} as const; + +export default Lever; diff --git a/src/connectors/linear/functions/add_comment.ts b/src/connectors/linear/functions/add_comment.ts new file mode 100644 index 0000000..039140d --- /dev/null +++ b/src/connectors/linear/functions/add_comment.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: "A05ULH1PNMA#/functions/add_comment", + title: "Add a comment", + input_parameters: { + properties: { + issue_update_id: { + type: Schema.types.string, + description: "Select an issue", + title: "Issue", + }, + comment: { + type: Schema.types.string, + description: "Enter comment", + title: "Comment", + }, + linear_access_token: { + type: Schema.slack.types.oauth2, + title: "Linear access token", + }, + }, + required: ["issue_update_id", "comment", "linear_access_token"], + }, + output_parameters: { + properties: { + issue_id: { + type: Schema.types.string, + description: "Id of the issue", + title: "Issue ID", + }, + comment_id: { type: Schema.types.string, title: "Comment ID" }, + title: { type: Schema.types.string, title: "Title" }, + body: { + type: Schema.types.string, + description: "Body of the comment", + title: "Comment", + }, + comment_url: { type: Schema.types.string, title: "Comment URL" }, + }, + required: [], + }, +}); diff --git a/src/connectors/linear/functions/add_comment_test.ts b/src/connectors/linear/functions/add_comment_test.ts new file mode 100644 index 0000000..2803b02 --- /dev/null +++ b/src/connectors/linear/functions/add_comment_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 AddComment from "./add_comment.ts"; + +Deno.test("AddComment can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_AddComment_slack_function", + title: "Test AddComment", + description: "This is a generated test to test AddComment", + }); + testWorkflow.addStep(AddComment, { + issue_update_id: "test", + comment: "test", + linear_access_token: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05ULH1PNMA#/functions/add_comment"); + assertEquals(actual.inputs, { + issue_update_id: "test", + comment: "test", + linear_access_token: "test", + }); +}); + +Deno.test("All outputs of Slack function AddComment should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_AddComment_slack_function", + title: "Test AddComment", + description: "This is a generated test to test AddComment", + }); + const step = testWorkflow.addStep(AddComment, { + issue_update_id: "test", + comment: "test", + linear_access_token: "test", + }); + assertExists(step.outputs.issue_id); + assertExists(step.outputs.comment_id); + assertExists(step.outputs.title); + assertExists(step.outputs.body); + assertExists(step.outputs.comment_url); +}); diff --git a/src/connectors/linear/functions/create_issue.ts b/src/connectors/linear/functions/create_issue.ts new file mode 100644 index 0000000..73a95ba --- /dev/null +++ b/src/connectors/linear/functions/create_issue.ts @@ -0,0 +1,70 @@ +/** 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: "A05ULH1PNMA#/functions/create_issue", + title: "Create an issue", + input_parameters: { + properties: { + team_id: { + type: Schema.types.string, + description: "Select a team", + title: "Team", + }, + project_id: { + type: Schema.types.string, + description: "Select a project", + title: "Project", + }, + title: { + type: Schema.types.string, + description: "Enter title of the issue", + title: "Title", + }, + description: { + type: Schema.types.string, + description: "Enter description of the issue", + title: "Description", + }, + assignee_id: { + type: Schema.types.string, + description: "Select an assignee", + title: "Assignee", + }, + state_id: { + type: Schema.types.string, + description: "Select issue state", + title: "State", + }, + linear_access_token: { + type: Schema.slack.types.oauth2, + title: "Linear access token", + }, + }, + required: ["team_id", "title", "description", "linear_access_token"], + }, + output_parameters: { + properties: { + issue_id: { + type: Schema.types.string, + description: "Id of the issue", + title: "Issue ID", + }, + title: { + type: Schema.types.string, + description: "Title of the issue", + title: "Title", + }, + description: { + type: Schema.types.string, + description: "Description of the issue", + title: "Description", + }, + assignee_email: { type: Schema.types.string, title: "Assignee email" }, + state: { type: Schema.types.string, title: "State" }, + url: { type: Schema.types.string, title: "URL" }, + }, + required: [], + }, +}); diff --git a/src/connectors/linear/functions/create_issue_test.ts b/src/connectors/linear/functions/create_issue_test.ts new file mode 100644 index 0000000..39203c9 --- /dev/null +++ b/src/connectors/linear/functions/create_issue_test.ts @@ -0,0 +1,47 @@ +/** 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 CreateIssue from "./create_issue.ts"; + +Deno.test("CreateIssue can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateIssue_slack_function", + title: "Test CreateIssue", + description: "This is a generated test to test CreateIssue", + }); + testWorkflow.addStep(CreateIssue, { + team_id: "test", + title: "test", + description: "test", + linear_access_token: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05ULH1PNMA#/functions/create_issue"); + assertEquals(actual.inputs, { + team_id: "test", + title: "test", + description: "test", + linear_access_token: "test", + }); +}); + +Deno.test("All outputs of Slack function CreateIssue should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateIssue_slack_function", + title: "Test CreateIssue", + description: "This is a generated test to test CreateIssue", + }); + const step = testWorkflow.addStep(CreateIssue, { + team_id: "test", + title: "test", + description: "test", + linear_access_token: "test", + }); + assertExists(step.outputs.issue_id); + assertExists(step.outputs.title); + assertExists(step.outputs.description); + assertExists(step.outputs.assignee_email); + assertExists(step.outputs.state); + assertExists(step.outputs.url); +}); diff --git a/src/connectors/linear/functions/create_project.ts b/src/connectors/linear/functions/create_project.ts new file mode 100644 index 0000000..2293a5c --- /dev/null +++ b/src/connectors/linear/functions/create_project.ts @@ -0,0 +1,42 @@ +/** 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: "A05ULH1PNMA#/functions/create_project", + title: "Create a project", + input_parameters: { + properties: { + name: { + type: Schema.types.string, + description: "Enter text", + title: "Project name", + }, + description: { + type: Schema.types.string, + description: "Enter description of the issue", + title: "Description", + }, + team_ids: { + type: Schema.types.array, + description: "Select a team", + title: "Team", + items: { type: Schema.types.string }, + }, + linear_access_token: { + type: Schema.slack.types.oauth2, + title: "Linear access token", + }, + }, + required: ["name", "description", "team_ids", "linear_access_token"], + }, + output_parameters: { + properties: { + project_id: { type: Schema.types.string, title: "Project ID" }, + name: { type: Schema.types.string, title: "Project name" }, + description: { type: Schema.types.string, title: "Description" }, + state: { type: Schema.types.string, title: "State" }, + }, + required: [], + }, +}); diff --git a/src/connectors/linear/functions/create_project_test.ts b/src/connectors/linear/functions/create_project_test.ts new file mode 100644 index 0000000..f9db8e2 --- /dev/null +++ b/src/connectors/linear/functions/create_project_test.ts @@ -0,0 +1,45 @@ +/** 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 CreateProject from "./create_project.ts"; + +Deno.test("CreateProject can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateProject_slack_function", + title: "Test CreateProject", + description: "This is a generated test to test CreateProject", + }); + testWorkflow.addStep(CreateProject, { + name: "test", + description: "test", + team_ids: "test", + linear_access_token: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05ULH1PNMA#/functions/create_project"); + assertEquals(actual.inputs, { + name: "test", + description: "test", + team_ids: "test", + linear_access_token: "test", + }); +}); + +Deno.test("All outputs of Slack function CreateProject should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateProject_slack_function", + title: "Test CreateProject", + description: "This is a generated test to test CreateProject", + }); + const step = testWorkflow.addStep(CreateProject, { + name: "test", + description: "test", + team_ids: "test", + linear_access_token: "test", + }); + assertExists(step.outputs.project_id); + assertExists(step.outputs.name); + assertExists(step.outputs.description); + assertExists(step.outputs.state); +}); diff --git a/src/connectors/linear/functions/update_issue.ts b/src/connectors/linear/functions/update_issue.ts new file mode 100644 index 0000000..c82118a --- /dev/null +++ b/src/connectors/linear/functions/update_issue.ts @@ -0,0 +1,75 @@ +/** 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: "A05ULH1PNMA#/functions/update_issue", + title: "Update an issue", + input_parameters: { + properties: { + issue_update_id: { + type: Schema.types.string, + description: "Select an issue", + title: "Issue", + }, + team_id: { + type: Schema.types.string, + description: "Select a team", + title: "Team", + }, + project_id: { + type: Schema.types.string, + description: "Select a project", + title: "Project", + }, + title: { + type: Schema.types.string, + description: "Enter title of the issue", + title: "Title", + }, + description: { + type: Schema.types.string, + description: "Enter description of the issue", + title: "Description", + }, + assignee_id: { + type: Schema.types.string, + description: "Select an assignee", + title: "Assignee", + }, + state_id: { + type: Schema.types.string, + description: "Select issue state", + title: "State", + }, + linear_access_token: { + type: Schema.slack.types.oauth2, + title: "Linear access token", + }, + }, + required: ["issue_update_id", "linear_access_token"], + }, + output_parameters: { + properties: { + issue_id: { + type: Schema.types.string, + description: "Id of the issue", + title: "Issue ID", + }, + title: { + type: Schema.types.string, + description: "Title of the issue", + title: "Title", + }, + description: { + type: Schema.types.string, + description: "Description of the issue", + title: "Description", + }, + assignee_email: { type: Schema.types.string, title: "Assignee email" }, + state: { type: Schema.types.string, title: "State" }, + url: { type: Schema.types.string, title: "URL" }, + }, + required: [], + }, +}); diff --git a/src/connectors/linear/functions/update_issue_test.ts b/src/connectors/linear/functions/update_issue_test.ts new file mode 100644 index 0000000..1f67a43 --- /dev/null +++ b/src/connectors/linear/functions/update_issue_test.ts @@ -0,0 +1,41 @@ +/** 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, { + issue_update_id: "test", + linear_access_token: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05ULH1PNMA#/functions/update_issue"); + assertEquals(actual.inputs, { + issue_update_id: "test", + linear_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, { + issue_update_id: "test", + linear_access_token: "test", + }); + assertExists(step.outputs.issue_id); + assertExists(step.outputs.title); + assertExists(step.outputs.description); + assertExists(step.outputs.assignee_email); + assertExists(step.outputs.state); + assertExists(step.outputs.url); +}); diff --git a/src/connectors/linear/mod.ts b/src/connectors/linear/mod.ts new file mode 100644 index 0000000..bebf093 --- /dev/null +++ b/src/connectors/linear/mod.ts @@ -0,0 +1,28 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import AddComment from "./functions/add_comment.ts"; +import CreateIssue from "./functions/create_issue.ts"; +import CreateProject from "./functions/create_project.ts"; +import UpdateIssue from "./functions/update_issue.ts"; + +const Linear = { + functions: { + /** + * @see The {@link https://api.slack.com/reference/connectors/linear/add_comment AddComment} documentation. + */ + AddComment, + /** + * @see The {@link https://api.slack.com/reference/connectors/linear/create_issue CreateIssue} documentation. + */ + CreateIssue, + /** + * @see The {@link https://api.slack.com/reference/connectors/linear/create_project CreateProject} documentation. + */ + CreateProject, + /** + * @see The {@link https://api.slack.com/reference/connectors/linear/update_issue UpdateIssue} documentation. + */ + UpdateIssue, + }, +} as const; + +export default Linear; diff --git a/src/connectors/loopio/functions/create_project.ts b/src/connectors/loopio/functions/create_project.ts new file mode 100644 index 0000000..6e0d6f9 --- /dev/null +++ b/src/connectors/loopio/functions/create_project.ts @@ -0,0 +1,70 @@ +/** 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: "A05UAJ4398T#/functions/create_project", + title: "Create a project", + input_parameters: { + properties: { + project_name: { + type: Schema.types.string, + description: "Enter text", + title: "Project name", + }, + company_name: { + type: Schema.types.string, + description: "Enter text", + title: "Client name", + }, + description: { + type: Schema.types.string, + description: "Enter text", + title: "Description", + }, + owner: { + type: Schema.types.string, + description: "Select owner of the project", + title: "Owner", + }, + due_date: { type: Schema.slack.types.timestamp, title: "Due on" }, + project_type: { + type: Schema.types.string, + title: "Project type", + enum: ["RFP", "RFI", "DDQ", "SQ", "PP", "OTHER"], + }, + }, + required: ["project_name", "company_name", "due_date", "project_type"], + }, + output_parameters: { + properties: { + project_id: { type: Schema.types.string, title: "Project ID" }, + project_name: { type: Schema.types.string, title: "Project name" }, + description: { type: Schema.types.string, title: "Description" }, + created_date: { + type: Schema.types.string, + description: "The datetime the project is created on", + title: "Created on", + }, + due_date: { + type: Schema.types.string, + description: "The datetime the project is due on", + title: "Due on", + }, + status: { type: Schema.types.string, title: "Status" }, + company_name: { type: Schema.types.string, title: "Client name" }, + owner: { type: Schema.types.string, title: "Owner" }, + creator: { type: Schema.types.string, title: "Creator" }, + }, + required: [ + "project_id", + "project_name", + "created_date", + "due_date", + "status", + "company_name", + "owner", + "creator", + ], + }, +}); diff --git a/src/connectors/loopio/functions/create_project_test.ts b/src/connectors/loopio/functions/create_project_test.ts new file mode 100644 index 0000000..64b198b --- /dev/null +++ b/src/connectors/loopio/functions/create_project_test.ts @@ -0,0 +1,50 @@ +/** 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 CreateProject from "./create_project.ts"; + +Deno.test("CreateProject can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateProject_slack_function", + title: "Test CreateProject", + description: "This is a generated test to test CreateProject", + }); + testWorkflow.addStep(CreateProject, { + project_name: "test", + company_name: "test", + due_date: "test", + project_type: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05UAJ4398T#/functions/create_project"); + assertEquals(actual.inputs, { + project_name: "test", + company_name: "test", + due_date: "test", + project_type: "test", + }); +}); + +Deno.test("All outputs of Slack function CreateProject should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateProject_slack_function", + title: "Test CreateProject", + description: "This is a generated test to test CreateProject", + }); + const step = testWorkflow.addStep(CreateProject, { + project_name: "test", + company_name: "test", + due_date: "test", + project_type: "test", + }); + assertExists(step.outputs.project_id); + assertExists(step.outputs.project_name); + assertExists(step.outputs.description); + assertExists(step.outputs.created_date); + assertExists(step.outputs.due_date); + assertExists(step.outputs.status); + assertExists(step.outputs.company_name); + assertExists(step.outputs.owner); + assertExists(step.outputs.creator); +}); diff --git a/src/connectors/loopio/mod.ts b/src/connectors/loopio/mod.ts new file mode 100644 index 0000000..e853166 --- /dev/null +++ b/src/connectors/loopio/mod.ts @@ -0,0 +1,13 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import CreateProject from "./functions/create_project.ts"; + +const Loopio = { + functions: { + /** + * @see The {@link https://api.slack.com/reference/connectors/loopio/create_project CreateProject} documentation. + */ + CreateProject, + }, +} as const; + +export default Loopio; diff --git a/src/connectors/mailchimp/functions/add_contact.ts b/src/connectors/mailchimp/functions/add_contact.ts new file mode 100644 index 0000000..747879b --- /dev/null +++ b/src/connectors/mailchimp/functions/add_contact.ts @@ -0,0 +1,51 @@ +/** 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: "A05TPV44YKG#/functions/add_contact", + title: "Add a contact to audience", + input_parameters: { + properties: { + mailchimp_access_token: { + type: Schema.slack.types.oauth2, + title: "Mailchimp access token", + }, + audience: { + type: Schema.types.string, + description: "Select audience", + title: "Audience", + }, + first_name: { + type: Schema.types.string, + description: "Enter text", + title: "First name", + }, + last_name: { + type: Schema.types.string, + description: "Enter text", + title: "Last name", + }, + email: { + type: Schema.types.string, + description: "Enter email", + title: "Email", + }, + }, + required: [ + "mailchimp_access_token", + "audience", + "first_name", + "last_name", + "email", + ], + }, + output_parameters: { + properties: { + id: { type: Schema.types.string, title: "Contact ID" }, + full_name: { type: Schema.types.string, title: "Full name" }, + status: { type: Schema.types.string, title: "Status" }, + }, + required: [], + }, +}); diff --git a/src/connectors/mailchimp/functions/add_contact_test.ts b/src/connectors/mailchimp/functions/add_contact_test.ts new file mode 100644 index 0000000..560bb1e --- /dev/null +++ b/src/connectors/mailchimp/functions/add_contact_test.ts @@ -0,0 +1,47 @@ +/** 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 AddContact from "./add_contact.ts"; + +Deno.test("AddContact can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_AddContact_slack_function", + title: "Test AddContact", + description: "This is a generated test to test AddContact", + }); + testWorkflow.addStep(AddContact, { + mailchimp_access_token: "test", + audience: "test", + first_name: "test", + last_name: "test", + email: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05TPV44YKG#/functions/add_contact"); + assertEquals(actual.inputs, { + mailchimp_access_token: "test", + audience: "test", + first_name: "test", + last_name: "test", + email: "test", + }); +}); + +Deno.test("All outputs of Slack function AddContact should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_AddContact_slack_function", + title: "Test AddContact", + description: "This is a generated test to test AddContact", + }); + const step = testWorkflow.addStep(AddContact, { + mailchimp_access_token: "test", + audience: "test", + first_name: "test", + last_name: "test", + email: "test", + }); + assertExists(step.outputs.id); + assertExists(step.outputs.full_name); + assertExists(step.outputs.status); +}); diff --git a/src/connectors/mailchimp/functions/create_campaign.ts b/src/connectors/mailchimp/functions/create_campaign.ts new file mode 100644 index 0000000..c45c50f --- /dev/null +++ b/src/connectors/mailchimp/functions/create_campaign.ts @@ -0,0 +1,63 @@ +/** 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: "A05TPV44YKG#/functions/create_campaign", + title: "Create an email campaign", + input_parameters: { + properties: { + mailchimp_access_token: { + type: Schema.slack.types.oauth2, + title: "Mailchimp access token", + }, + campaign_title: { + type: Schema.types.string, + description: "Enter text", + title: "Campaign title", + }, + subject_line: { + type: Schema.types.string, + description: "Enter text", + title: "Subject line", + }, + preview_text: { + type: Schema.types.string, + description: "Enter text", + title: "Preview text", + }, + from_name: { + type: Schema.types.string, + description: "Enter text", + title: "Who is sending this mail ?", + }, + reply_to: { + type: Schema.types.string, + description: "Enter email", + title: "Reply to address", + }, + audience_id: { + type: Schema.types.string, + description: "Select audience", + title: "Audience", + }, + }, + required: [ + "mailchimp_access_token", + "campaign_title", + "subject_line", + "preview_text", + "from_name", + "reply_to", + "audience_id", + ], + }, + output_parameters: { + properties: { + id: { type: Schema.types.string, title: "Campaign ID" }, + status: { type: Schema.types.string, title: "Campaign status" }, + url: { type: Schema.types.string, title: "Campaign URL" }, + }, + required: [], + }, +}); diff --git a/src/connectors/mailchimp/functions/create_campaign_test.ts b/src/connectors/mailchimp/functions/create_campaign_test.ts new file mode 100644 index 0000000..4692008 --- /dev/null +++ b/src/connectors/mailchimp/functions/create_campaign_test.ts @@ -0,0 +1,53 @@ +/** 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 CreateCampaign from "./create_campaign.ts"; + +Deno.test("CreateCampaign can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateCampaign_slack_function", + title: "Test CreateCampaign", + description: "This is a generated test to test CreateCampaign", + }); + testWorkflow.addStep(CreateCampaign, { + mailchimp_access_token: "test", + campaign_title: "test", + subject_line: "test", + preview_text: "test", + from_name: "test", + reply_to: "test", + audience_id: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05TPV44YKG#/functions/create_campaign"); + assertEquals(actual.inputs, { + mailchimp_access_token: "test", + campaign_title: "test", + subject_line: "test", + preview_text: "test", + from_name: "test", + reply_to: "test", + audience_id: "test", + }); +}); + +Deno.test("All outputs of Slack function CreateCampaign should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateCampaign_slack_function", + title: "Test CreateCampaign", + description: "This is a generated test to test CreateCampaign", + }); + const step = testWorkflow.addStep(CreateCampaign, { + mailchimp_access_token: "test", + campaign_title: "test", + subject_line: "test", + preview_text: "test", + from_name: "test", + reply_to: "test", + audience_id: "test", + }); + assertExists(step.outputs.id); + assertExists(step.outputs.status); + assertExists(step.outputs.url); +}); diff --git a/src/connectors/mailchimp/functions/get_campaign_report.ts b/src/connectors/mailchimp/functions/get_campaign_report.ts new file mode 100644 index 0000000..bdabf7f --- /dev/null +++ b/src/connectors/mailchimp/functions/get_campaign_report.ts @@ -0,0 +1,56 @@ +/** 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: "A05TPV44YKG#/functions/get_campaign_report", + title: "Get campaign report", + input_parameters: { + properties: { + mailchimp_access_token: { + type: Schema.slack.types.oauth2, + title: "Mailchimp access token", + }, + campaign_id: { + type: Schema.types.string, + description: "Select a campaign", + title: "Campaign", + }, + }, + required: ["mailchimp_access_token", "campaign_id"], + }, + output_parameters: { + properties: { + campaign_type: { type: Schema.types.string, title: "Campaign type" }, + id: { type: Schema.types.string, title: "Campaign ID" }, + status: { type: Schema.types.string, title: "Campaign status" }, + emails_sent: { + type: Schema.types.string, + title: "Number of emails sent", + }, + opens: { type: Schema.types.string, title: "Total number of opens" }, + unique_opens: { + type: Schema.types.string, + title: "Number of unique opens", + }, + open_rate: { + type: Schema.types.string, + description: + "The number of unique opens divided by the total number of successful deliveries.", + title: "Open rate", + }, + clicks: { type: Schema.types.string, title: "Total number of clicks" }, + unique_clicks: { + type: Schema.types.string, + title: "Number of unique clicks", + }, + click_rate: { + type: Schema.types.string, + description: + "The number of unique clicks divided by the total number of successful deliveries.", + title: "Click rate", + }, + }, + required: [], + }, +}); diff --git a/src/connectors/mailchimp/functions/get_campaign_report_test.ts b/src/connectors/mailchimp/functions/get_campaign_report_test.ts new file mode 100644 index 0000000..4f11dc5 --- /dev/null +++ b/src/connectors/mailchimp/functions/get_campaign_report_test.ts @@ -0,0 +1,48 @@ +/** 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 GetCampaignReport from "./get_campaign_report.ts"; + +Deno.test("GetCampaignReport can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_GetCampaignReport_slack_function", + title: "Test GetCampaignReport", + description: "This is a generated test to test GetCampaignReport", + }); + testWorkflow.addStep(GetCampaignReport, { + mailchimp_access_token: "test", + campaign_id: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals( + actual.function_id, + "A05TPV44YKG#/functions/get_campaign_report", + ); + assertEquals(actual.inputs, { + mailchimp_access_token: "test", + campaign_id: "test", + }); +}); + +Deno.test("All outputs of Slack function GetCampaignReport should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_GetCampaignReport_slack_function", + title: "Test GetCampaignReport", + description: "This is a generated test to test GetCampaignReport", + }); + const step = testWorkflow.addStep(GetCampaignReport, { + mailchimp_access_token: "test", + campaign_id: "test", + }); + assertExists(step.outputs.campaign_type); + assertExists(step.outputs.id); + assertExists(step.outputs.status); + assertExists(step.outputs.emails_sent); + assertExists(step.outputs.opens); + assertExists(step.outputs.unique_opens); + assertExists(step.outputs.open_rate); + assertExists(step.outputs.clicks); + assertExists(step.outputs.unique_clicks); + assertExists(step.outputs.click_rate); +}); diff --git a/src/connectors/mailchimp/functions/send_campaign.ts b/src/connectors/mailchimp/functions/send_campaign.ts new file mode 100644 index 0000000..773e82a --- /dev/null +++ b/src/connectors/mailchimp/functions/send_campaign.ts @@ -0,0 +1,26 @@ +/** 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: "A05TPV44YKG#/functions/send_campaign", + title: "Send a Campaign", + input_parameters: { + properties: { + mailchimp_access_token: { + type: Schema.slack.types.oauth2, + title: "Mailchimp access token", + }, + campaign_id: { + type: Schema.types.string, + description: "Select a campaign", + title: "Campaign", + }, + }, + required: ["mailchimp_access_token", "campaign_id"], + }, + output_parameters: { + properties: { response: { type: Schema.types.string, title: "Response" } }, + required: ["response"], + }, +}); diff --git a/src/connectors/mailchimp/functions/send_campaign_test.ts b/src/connectors/mailchimp/functions/send_campaign_test.ts new file mode 100644 index 0000000..8b97bfb --- /dev/null +++ b/src/connectors/mailchimp/functions/send_campaign_test.ts @@ -0,0 +1,36 @@ +/** 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 SendCampaign from "./send_campaign.ts"; + +Deno.test("SendCampaign can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_SendCampaign_slack_function", + title: "Test SendCampaign", + description: "This is a generated test to test SendCampaign", + }); + testWorkflow.addStep(SendCampaign, { + mailchimp_access_token: "test", + campaign_id: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05TPV44YKG#/functions/send_campaign"); + assertEquals(actual.inputs, { + mailchimp_access_token: "test", + campaign_id: "test", + }); +}); + +Deno.test("All outputs of Slack function SendCampaign should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_SendCampaign_slack_function", + title: "Test SendCampaign", + description: "This is a generated test to test SendCampaign", + }); + const step = testWorkflow.addStep(SendCampaign, { + mailchimp_access_token: "test", + campaign_id: "test", + }); + assertExists(step.outputs.response); +}); diff --git a/src/connectors/mailchimp/mod.ts b/src/connectors/mailchimp/mod.ts new file mode 100644 index 0000000..a827ee2 --- /dev/null +++ b/src/connectors/mailchimp/mod.ts @@ -0,0 +1,28 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import AddContact from "./functions/add_contact.ts"; +import CreateCampaign from "./functions/create_campaign.ts"; +import GetCampaignReport from "./functions/get_campaign_report.ts"; +import SendCampaign from "./functions/send_campaign.ts"; + +const Mailchimp = { + functions: { + /** + * @see The {@link https://api.slack.com/reference/connectors/mailchimp/add_contact AddContact} documentation. + */ + AddContact, + /** + * @see The {@link https://api.slack.com/reference/connectors/mailchimp/create_campaign CreateCampaign} documentation. + */ + CreateCampaign, + /** + * @see The {@link https://api.slack.com/reference/connectors/mailchimp/get_campaign_report GetCampaignReport} documentation. + */ + GetCampaignReport, + /** + * @see The {@link https://api.slack.com/reference/connectors/mailchimp/send_campaign SendCampaign} documentation. + */ + SendCampaign, + }, +} as const; + +export default Mailchimp; diff --git a/src/connectors/mod.ts b/src/connectors/mod.ts index 385f484..66140c1 100644 --- a/src/connectors/mod.ts +++ b/src/connectors/mod.ts @@ -1,21 +1,29 @@ -/** This file was autogenerated on Mon Dec 04 2023. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +/** This file was autogenerated on Thu Dec 14 2023. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ import Asana from "./asana/mod.ts"; import AtlassianBitbucket from "./atlassian.bitbucket/mod.ts"; import Calendly from "./calendly/mod.ts"; import Clickup from "./clickup/mod.ts"; +import Deel from "./deel/mod.ts"; import Docusign from "./docusign/mod.ts"; +import Firehydrant from "./firehydrant/mod.ts"; import Giphy from "./giphy/mod.ts"; import GithubCloud from "./github.cloud/mod.ts"; +import GithubEnterpriseServer from "./github.enterprise_server/mod.ts"; import Gitlab from "./gitlab/mod.ts"; import GoogleCalendar from "./google.calendar/mod.ts"; import GoogleMail from "./google.mail/mod.ts"; import GoogleMeet from "./google.meet/mod.ts"; import GoogleSheets from "./google.sheets/mod.ts"; import GoogleTasks from "./google.tasks/mod.ts"; +import GreenhouseOnboarding from "./greenhouse.onboarding/mod.ts"; import Guru from "./guru/mod.ts"; import Intercom from "./intercom/mod.ts"; import JiraCloud from "./jira.cloud/mod.ts"; +import Lever from "./lever/mod.ts"; +import Linear from "./linear/mod.ts"; +import Loopio from "./loopio/mod.ts"; import Lucid from "./lucid/mod.ts"; +import Mailchimp from "./mailchimp/mod.ts"; import MicrosoftOnedrive from "./microsoft.onedrive/mod.ts"; import MicrosoftOutlookCalendar from "./microsoft.outlook.calendar/mod.ts"; import MicrosoftOutlookEmail from "./microsoft.outlook.email/mod.ts"; @@ -23,9 +31,14 @@ import MicrosoftTeams from "./microsoft.teams/mod.ts"; import Miro from "./miro/mod.ts"; import Notion from "./notion/mod.ts"; import Pagerduty from "./pagerduty/mod.ts"; +import Ringcentral from "./ringcentral/mod.ts"; +import Rootly from "./rootly/mod.ts"; import Salesforce from "./salesforce/mod.ts"; +import Smartrecruiters from "./smartrecruiters/mod.ts"; import Smartsheet from "./smartsheet/mod.ts"; import Synk from "./synk/mod.ts"; +import Travisci from "./travisci/mod.ts"; +import Twilio from "./twilio/mod.ts"; import Webex from "./webex/mod.ts"; import Wrike from "./wrike/mod.ts"; import Zoom from "./zoom/mod.ts"; @@ -35,19 +48,27 @@ const Connectors = { AtlassianBitbucket, Calendly, Clickup, + Deel, Docusign, + Firehydrant, Giphy, GithubCloud, + GithubEnterpriseServer, Gitlab, GoogleCalendar, GoogleMail, GoogleMeet, GoogleSheets, GoogleTasks, + GreenhouseOnboarding, Guru, Intercom, JiraCloud, + Lever, + Linear, + Loopio, Lucid, + Mailchimp, MicrosoftOnedrive, MicrosoftOutlookCalendar, MicrosoftOutlookEmail, @@ -55,9 +76,14 @@ const Connectors = { Miro, Notion, Pagerduty, + Ringcentral, + Rootly, Salesforce, + Smartrecruiters, Smartsheet, Synk, + Travisci, + Twilio, Webex, Wrike, Zoom, diff --git a/src/connectors/ringcentral/functions/send_sms.ts b/src/connectors/ringcentral/functions/send_sms.ts new file mode 100644 index 0000000..2b45b4e --- /dev/null +++ b/src/connectors/ringcentral/functions/send_sms.ts @@ -0,0 +1,74 @@ +/** 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: "A05M3UW6YEN#/functions/send_sms", + title: "Send a SMS", + input_parameters: { + properties: { + sender_nb: { + type: Schema.types.string, + description: "Enter number", + title: "Sender's number", + }, + recipient_nb: { + type: Schema.types.string, + description: "Enter number", + title: "Recipient's number", + }, + content: { + type: Schema.types.string, + description: "Message", + title: "Message content", + }, + ringcentral_access_token: { + type: Schema.slack.types.oauth2, + description: "RingCentral Credential to use", + title: "RingCentral access token", + }, + }, + required: [ + "sender_nb", + "recipient_nb", + "content", + "ringcentral_access_token", + ], + }, + output_parameters: { + properties: { + subject: { + type: Schema.types.string, + description: "Contents of the SMS message sent", + title: "SMS content", + }, + id: { + type: Schema.types.string, + description: "Identifier of the sent SMS message", + title: "SMS ID", + }, + message_status: { + type: Schema.types.string, + description: "Status of the SMS message", + title: "SMS status", + }, + delivery_time: { + type: Schema.types.string, + description: "Time when the SMS message was delivered", + title: "SMS delivery time", + }, + delivery_error_code: { + type: Schema.types.string, + description: "Error code if the SMS message was not able to send", + title: "SMS delivery error code", + }, + }, + required: [ + "subject", + "id", + "message_status", + "delivery_time", + "delivery_error_code", + ], + }, +}); diff --git a/src/connectors/ringcentral/functions/send_sms_test.ts b/src/connectors/ringcentral/functions/send_sms_test.ts new file mode 100644 index 0000000..a6cf9b0 --- /dev/null +++ b/src/connectors/ringcentral/functions/send_sms_test.ts @@ -0,0 +1,46 @@ +/** 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 SendSms from "./send_sms.ts"; + +Deno.test("SendSms can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_SendSms_slack_function", + title: "Test SendSms", + description: "This is a generated test to test SendSms", + }); + testWorkflow.addStep(SendSms, { + sender_nb: "test", + recipient_nb: "test", + content: "test", + ringcentral_access_token: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05M3UW6YEN#/functions/send_sms"); + assertEquals(actual.inputs, { + sender_nb: "test", + recipient_nb: "test", + content: "test", + ringcentral_access_token: "test", + }); +}); + +Deno.test("All outputs of Slack function SendSms should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_SendSms_slack_function", + title: "Test SendSms", + description: "This is a generated test to test SendSms", + }); + const step = testWorkflow.addStep(SendSms, { + sender_nb: "test", + recipient_nb: "test", + content: "test", + ringcentral_access_token: "test", + }); + assertExists(step.outputs.subject); + assertExists(step.outputs.id); + assertExists(step.outputs.message_status); + assertExists(step.outputs.delivery_time); + assertExists(step.outputs.delivery_error_code); +}); diff --git a/src/connectors/ringcentral/mod.ts b/src/connectors/ringcentral/mod.ts new file mode 100644 index 0000000..fcd8b53 --- /dev/null +++ b/src/connectors/ringcentral/mod.ts @@ -0,0 +1,13 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import SendSms from "./functions/send_sms.ts"; + +const Ringcentral = { + functions: { + /** + * @see The {@link https://api.slack.com/reference/connectors/ringcentral/send_sms SendSms} documentation. + */ + SendSms, + }, +} as const; + +export default Ringcentral; diff --git a/src/connectors/rootly/functions/create_alert.ts b/src/connectors/rootly/functions/create_alert.ts new file mode 100644 index 0000000..64fa406 --- /dev/null +++ b/src/connectors/rootly/functions/create_alert.ts @@ -0,0 +1,47 @@ +/** 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: "A05TUC2EWBA#/functions/create_alert", + title: "Create an alert", + input_parameters: { + properties: { + source: { + type: Schema.types.string, + description: "Ex: Zendesk", + title: "Source", + }, + summary: { + type: Schema.types.string, + description: "Enter the text", + title: "Summary", + }, + service_ids: { + type: Schema.types.array, + description: "Select service ID's to attach to the alert", + title: "Service IDs", + items: { type: Schema.types.string }, + }, + environment_ids: { + type: Schema.types.array, + description: "Select environment ID's to attach to the alert", + title: "Environment IDs", + items: { type: Schema.types.string }, + }, + started_at: { type: Schema.slack.types.timestamp, title: "Started at" }, + ended_at: { type: Schema.slack.types.timestamp, title: "Ended at" }, + }, + required: ["source", "summary"], + }, + output_parameters: { + properties: { + alert_id: { + type: Schema.types.string, + description: "Alert ID", + title: "Alert ID", + }, + }, + required: [], + }, +}); diff --git a/src/connectors/rootly/functions/create_alert_test.ts b/src/connectors/rootly/functions/create_alert_test.ts new file mode 100644 index 0000000..6e373cc --- /dev/null +++ b/src/connectors/rootly/functions/create_alert_test.ts @@ -0,0 +1,30 @@ +/** 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 CreateAlert from "./create_alert.ts"; + +Deno.test("CreateAlert can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateAlert_slack_function", + title: "Test CreateAlert", + description: "This is a generated test to test CreateAlert", + }); + testWorkflow.addStep(CreateAlert, { source: "test", summary: "test" }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05TUC2EWBA#/functions/create_alert"); + assertEquals(actual.inputs, { source: "test", summary: "test" }); +}); + +Deno.test("All outputs of Slack function CreateAlert should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateAlert_slack_function", + title: "Test CreateAlert", + description: "This is a generated test to test CreateAlert", + }); + const step = testWorkflow.addStep(CreateAlert, { + source: "test", + summary: "test", + }); + assertExists(step.outputs.alert_id); +}); diff --git a/src/connectors/rootly/functions/create_cause.ts b/src/connectors/rootly/functions/create_cause.ts new file mode 100644 index 0000000..f49ff5f --- /dev/null +++ b/src/connectors/rootly/functions/create_cause.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: "A05TUC2EWBA#/functions/create_cause", + title: "Create a cause", + input_parameters: { + properties: { + name: { + type: Schema.types.string, + description: "Enter the text", + title: "Cause name", + }, + description: { + type: Schema.types.string, + description: "Enter the text", + title: "Description", + }, + position: { + type: Schema.types.number, + description: "Enter the number", + title: "Position", + }, + }, + required: ["name"], + }, + output_parameters: { + properties: { + cause_id: { + type: Schema.types.string, + description: "Cause ID", + title: "Cause ID", + }, + }, + required: [], + }, +}); diff --git a/src/connectors/rootly/functions/create_cause_test.ts b/src/connectors/rootly/functions/create_cause_test.ts new file mode 100644 index 0000000..dc7e193 --- /dev/null +++ b/src/connectors/rootly/functions/create_cause_test.ts @@ -0,0 +1,27 @@ +/** 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 CreateCause from "./create_cause.ts"; + +Deno.test("CreateCause can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateCause_slack_function", + title: "Test CreateCause", + description: "This is a generated test to test CreateCause", + }); + testWorkflow.addStep(CreateCause, { name: "test" }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05TUC2EWBA#/functions/create_cause"); + assertEquals(actual.inputs, { name: "test" }); +}); + +Deno.test("All outputs of Slack function CreateCause should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateCause_slack_function", + title: "Test CreateCause", + description: "This is a generated test to test CreateCause", + }); + const step = testWorkflow.addStep(CreateCause, { name: "test" }); + assertExists(step.outputs.cause_id); +}); diff --git a/src/connectors/rootly/functions/update_cause.ts b/src/connectors/rootly/functions/update_cause.ts new file mode 100644 index 0000000..63a1750 --- /dev/null +++ b/src/connectors/rootly/functions/update_cause.ts @@ -0,0 +1,46 @@ +/** 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: "A05TUC2EWBA#/functions/update_cause", + title: "Update a cause", + input_parameters: { + properties: { + cause_id: { + type: Schema.types.string, + description: "Select the cause", + title: "Cause", + }, + name: { + type: Schema.types.string, + description: "Enter the text", + title: "Cause name", + }, + description: { + type: Schema.types.string, + description: "Enter the text", + title: "Description", + }, + position: { + type: Schema.types.number, + description: "Enter the number", + title: "Position", + }, + }, + required: ["cause_id"], + }, + output_parameters: { + properties: { + cause_id: { + type: Schema.types.string, + description: "Cause ID", + title: "Cause ID", + }, + name: { type: Schema.types.string, title: "Cause name" }, + description: { type: Schema.types.string, title: "Description" }, + position: { type: Schema.types.number, title: "Position" }, + }, + required: [], + }, +}); diff --git a/src/connectors/rootly/functions/update_cause_test.ts b/src/connectors/rootly/functions/update_cause_test.ts new file mode 100644 index 0000000..56cd9a0 --- /dev/null +++ b/src/connectors/rootly/functions/update_cause_test.ts @@ -0,0 +1,30 @@ +/** 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 UpdateCause from "./update_cause.ts"; + +Deno.test("UpdateCause can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_UpdateCause_slack_function", + title: "Test UpdateCause", + description: "This is a generated test to test UpdateCause", + }); + testWorkflow.addStep(UpdateCause, { cause_id: "test" }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05TUC2EWBA#/functions/update_cause"); + assertEquals(actual.inputs, { cause_id: "test" }); +}); + +Deno.test("All outputs of Slack function UpdateCause should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_UpdateCause_slack_function", + title: "Test UpdateCause", + description: "This is a generated test to test UpdateCause", + }); + const step = testWorkflow.addStep(UpdateCause, { cause_id: "test" }); + assertExists(step.outputs.cause_id); + assertExists(step.outputs.name); + assertExists(step.outputs.description); + assertExists(step.outputs.position); +}); diff --git a/src/connectors/rootly/mod.ts b/src/connectors/rootly/mod.ts new file mode 100644 index 0000000..37e45ed --- /dev/null +++ b/src/connectors/rootly/mod.ts @@ -0,0 +1,23 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import CreateAlert from "./functions/create_alert.ts"; +import CreateCause from "./functions/create_cause.ts"; +import UpdateCause from "./functions/update_cause.ts"; + +const Rootly = { + functions: { + /** + * @see The {@link https://api.slack.com/reference/connectors/rootly/create_alert CreateAlert} documentation. + */ + CreateAlert, + /** + * @see The {@link https://api.slack.com/reference/connectors/rootly/create_cause CreateCause} documentation. + */ + CreateCause, + /** + * @see The {@link https://api.slack.com/reference/connectors/rootly/update_cause UpdateCause} documentation. + */ + UpdateCause, + }, +} as const; + +export default Rootly; diff --git a/src/connectors/smartrecruiters/functions/create_candidate.ts b/src/connectors/smartrecruiters/functions/create_candidate.ts new file mode 100644 index 0000000..3bfe2d3 --- /dev/null +++ b/src/connectors/smartrecruiters/functions/create_candidate.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: "A05UG19KZ3K#/functions/create_candidate", + title: "Create a candidate", + input_parameters: { + properties: { + first_name: { + type: Schema.types.string, + description: "Enter text", + title: "First name", + }, + last_name: { + type: Schema.types.string, + description: "Enter text", + title: "Last name", + }, + email: { + type: Schema.types.string, + description: "Enter email", + title: "Email", + }, + phone_number: { + type: Schema.types.string, + description: "Enter phone number", + title: "Phone number", + }, + }, + required: ["first_name", "last_name", "email"], + }, + output_parameters: { + properties: { + candidate_id: { type: Schema.types.string, title: "Candidate ID" }, + first_name: { type: Schema.types.string, title: "First name" }, + last_name: { type: Schema.types.string, title: "Last name" }, + email: { type: Schema.types.string, title: "Email" }, + phone_number: { type: Schema.types.string, title: "Phone number" }, + }, + required: ["candidate_id", "first_name", "last_name", "email"], + }, +}); diff --git a/src/connectors/smartrecruiters/functions/create_candidate_and_assign_to_job.ts b/src/connectors/smartrecruiters/functions/create_candidate_and_assign_to_job.ts new file mode 100644 index 0000000..dcef7c4 --- /dev/null +++ b/src/connectors/smartrecruiters/functions/create_candidate_and_assign_to_job.ts @@ -0,0 +1,48 @@ +/** 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: "A05UG19KZ3K#/functions/create_candidate_and_assign_to_job", + title: "Create a candidate and assign to job", + input_parameters: { + properties: { + job_id: { + type: Schema.types.string, + description: "Select a job", + title: "Job", + }, + first_name: { + type: Schema.types.string, + description: "Enter text", + title: "First name", + }, + last_name: { + type: Schema.types.string, + description: "Enter text", + title: "Last name", + }, + email: { + type: Schema.types.string, + description: "Enter email", + title: "Email", + }, + phone_number: { + type: Schema.types.string, + description: "Enter phone number", + title: "Phone number", + }, + }, + required: ["job_id", "first_name", "last_name", "email"], + }, + output_parameters: { + properties: { + candidate_id: { type: Schema.types.string, title: "Candidate ID" }, + first_name: { type: Schema.types.string, title: "First name" }, + last_name: { type: Schema.types.string, title: "Last name" }, + email: { type: Schema.types.string, title: "Email" }, + phone_number: { type: Schema.types.string, title: "Phone number" }, + }, + required: ["candidate_id", "first_name", "last_name", "email"], + }, +}); diff --git a/src/connectors/smartrecruiters/functions/create_candidate_and_assign_to_job_test.ts b/src/connectors/smartrecruiters/functions/create_candidate_and_assign_to_job_test.ts new file mode 100644 index 0000000..633d2e7 --- /dev/null +++ b/src/connectors/smartrecruiters/functions/create_candidate_and_assign_to_job_test.ts @@ -0,0 +1,51 @@ +/** 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 CreateCandidateAndAssignToJob from "./create_candidate_and_assign_to_job.ts"; + +Deno.test("CreateCandidateAndAssignToJob can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateCandidateAndAssignToJob_slack_function", + title: "Test CreateCandidateAndAssignToJob", + description: + "This is a generated test to test CreateCandidateAndAssignToJob", + }); + testWorkflow.addStep(CreateCandidateAndAssignToJob, { + job_id: "test", + first_name: "test", + last_name: "test", + email: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals( + actual.function_id, + "A05UG19KZ3K#/functions/create_candidate_and_assign_to_job", + ); + assertEquals(actual.inputs, { + job_id: "test", + first_name: "test", + last_name: "test", + email: "test", + }); +}); + +Deno.test("All outputs of Slack function CreateCandidateAndAssignToJob should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateCandidateAndAssignToJob_slack_function", + title: "Test CreateCandidateAndAssignToJob", + description: + "This is a generated test to test CreateCandidateAndAssignToJob", + }); + const step = testWorkflow.addStep(CreateCandidateAndAssignToJob, { + job_id: "test", + first_name: "test", + last_name: "test", + email: "test", + }); + assertExists(step.outputs.candidate_id); + assertExists(step.outputs.first_name); + assertExists(step.outputs.last_name); + assertExists(step.outputs.email); + assertExists(step.outputs.phone_number); +}); diff --git a/src/connectors/smartrecruiters/functions/create_candidate_test.ts b/src/connectors/smartrecruiters/functions/create_candidate_test.ts new file mode 100644 index 0000000..eed7a57 --- /dev/null +++ b/src/connectors/smartrecruiters/functions/create_candidate_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 CreateCandidate from "./create_candidate.ts"; + +Deno.test("CreateCandidate can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateCandidate_slack_function", + title: "Test CreateCandidate", + description: "This is a generated test to test CreateCandidate", + }); + testWorkflow.addStep(CreateCandidate, { + first_name: "test", + last_name: "test", + email: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05UG19KZ3K#/functions/create_candidate"); + assertEquals(actual.inputs, { + first_name: "test", + last_name: "test", + email: "test", + }); +}); + +Deno.test("All outputs of Slack function CreateCandidate should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CreateCandidate_slack_function", + title: "Test CreateCandidate", + description: "This is a generated test to test CreateCandidate", + }); + const step = testWorkflow.addStep(CreateCandidate, { + first_name: "test", + last_name: "test", + email: "test", + }); + assertExists(step.outputs.candidate_id); + assertExists(step.outputs.first_name); + assertExists(step.outputs.last_name); + assertExists(step.outputs.email); + assertExists(step.outputs.phone_number); +}); diff --git a/src/connectors/smartrecruiters/functions/give_candidate_review.ts b/src/connectors/smartrecruiters/functions/give_candidate_review.ts new file mode 100644 index 0000000..1867974 --- /dev/null +++ b/src/connectors/smartrecruiters/functions/give_candidate_review.ts @@ -0,0 +1,48 @@ +/** 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: "A05UG19KZ3K#/functions/give_candidate_review", + title: "Provide feedback for a candidate", + input_parameters: { + properties: { + reviewer_id: { + type: Schema.types.string, + description: "Select reviewer", + title: "Reviewer", + }, + job_id: { + type: Schema.types.string, + description: "Select a job", + title: "Job", + }, + candidate_id: { + type: Schema.types.string, + description: "Select a candidate", + title: "Candidate", + }, + rating: { + type: Schema.types.integer, + description: "Enter a number between 1-5", + title: "Rating", + }, + comment: { + type: Schema.types.string, + description: "Enter text", + title: "Comment", + }, + }, + required: ["reviewer_id", "job_id", "candidate_id", "rating"], + }, + output_parameters: { + properties: { + candidate_id: { type: Schema.types.string, title: "Candidate ID" }, + job_id: { type: Schema.types.string, title: "Job ID" }, + rating: { type: Schema.types.integer, title: "Rating" }, + comment: { type: Schema.types.string, title: "Comment" }, + review_id: { type: Schema.types.string, title: "Review ID" }, + }, + required: ["candidate_id", "job_id", "rating", "review_id"], + }, +}); diff --git a/src/connectors/smartrecruiters/functions/give_candidate_review_test.ts b/src/connectors/smartrecruiters/functions/give_candidate_review_test.ts new file mode 100644 index 0000000..41bb83d --- /dev/null +++ b/src/connectors/smartrecruiters/functions/give_candidate_review_test.ts @@ -0,0 +1,49 @@ +/** 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 GiveCandidateReview from "./give_candidate_review.ts"; + +Deno.test("GiveCandidateReview can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_GiveCandidateReview_slack_function", + title: "Test GiveCandidateReview", + description: "This is a generated test to test GiveCandidateReview", + }); + testWorkflow.addStep(GiveCandidateReview, { + reviewer_id: "test", + job_id: "test", + candidate_id: "test", + rating: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals( + actual.function_id, + "A05UG19KZ3K#/functions/give_candidate_review", + ); + assertEquals(actual.inputs, { + reviewer_id: "test", + job_id: "test", + candidate_id: "test", + rating: "test", + }); +}); + +Deno.test("All outputs of Slack function GiveCandidateReview should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_GiveCandidateReview_slack_function", + title: "Test GiveCandidateReview", + description: "This is a generated test to test GiveCandidateReview", + }); + const step = testWorkflow.addStep(GiveCandidateReview, { + reviewer_id: "test", + job_id: "test", + candidate_id: "test", + rating: "test", + }); + assertExists(step.outputs.candidate_id); + assertExists(step.outputs.job_id); + assertExists(step.outputs.rating); + assertExists(step.outputs.comment); + assertExists(step.outputs.review_id); +}); diff --git a/src/connectors/smartrecruiters/mod.ts b/src/connectors/smartrecruiters/mod.ts new file mode 100644 index 0000000..61f22c9 --- /dev/null +++ b/src/connectors/smartrecruiters/mod.ts @@ -0,0 +1,23 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import CreateCandidate from "./functions/create_candidate.ts"; +import CreateCandidateAndAssignToJob from "./functions/create_candidate_and_assign_to_job.ts"; +import GiveCandidateReview from "./functions/give_candidate_review.ts"; + +const Smartrecruiters = { + functions: { + /** + * @see The {@link https://api.slack.com/reference/connectors/smartrecruiters/create_candidate CreateCandidate} documentation. + */ + CreateCandidate, + /** + * @see The {@link https://api.slack.com/reference/connectors/smartrecruiters/create_candidate_and_assign_to_job CreateCandidateAndAssignToJob} documentation. + */ + CreateCandidateAndAssignToJob, + /** + * @see The {@link https://api.slack.com/reference/connectors/smartrecruiters/give_candidate_review GiveCandidateReview} documentation. + */ + GiveCandidateReview, + }, +} as const; + +export default Smartrecruiters; diff --git a/src/connectors/travisci/functions/cancel_build.ts b/src/connectors/travisci/functions/cancel_build.ts new file mode 100644 index 0000000..670ee5e --- /dev/null +++ b/src/connectors/travisci/functions/cancel_build.ts @@ -0,0 +1,33 @@ +/** 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: "A0619K2GN2W#/functions/cancel_build", + title: "Cancel build", + input_parameters: { + properties: { + repo_slug: { type: Schema.types.string, title: "Repository" }, + branch: { + type: Schema.types.string, + description: "Select a branch", + title: "Branch", + }, + build_id: { + type: Schema.types.string, + description: "Select a build ID", + title: "Build ID", + }, + }, + required: ["repo_slug", "branch", "build_id"], + }, + output_parameters: { + properties: { + build_id: { type: Schema.types.string, title: "Build ID" }, + branch: { type: Schema.types.string, title: "Branch" }, + repository: { type: Schema.types.string, title: "Repository" }, + build_url: { type: Schema.types.string, title: "Build URL" }, + }, + required: [], + }, +}); diff --git a/src/connectors/travisci/functions/cancel_build_test.ts b/src/connectors/travisci/functions/cancel_build_test.ts new file mode 100644 index 0000000..32877a8 --- /dev/null +++ b/src/connectors/travisci/functions/cancel_build_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 CancelBuild from "./cancel_build.ts"; + +Deno.test("CancelBuild can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CancelBuild_slack_function", + title: "Test CancelBuild", + description: "This is a generated test to test CancelBuild", + }); + testWorkflow.addStep(CancelBuild, { + repo_slug: "test", + branch: "test", + build_id: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A0619K2GN2W#/functions/cancel_build"); + assertEquals(actual.inputs, { + repo_slug: "test", + branch: "test", + build_id: "test", + }); +}); + +Deno.test("All outputs of Slack function CancelBuild should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_CancelBuild_slack_function", + title: "Test CancelBuild", + description: "This is a generated test to test CancelBuild", + }); + const step = testWorkflow.addStep(CancelBuild, { + repo_slug: "test", + branch: "test", + build_id: "test", + }); + assertExists(step.outputs.build_id); + assertExists(step.outputs.branch); + assertExists(step.outputs.repository); + assertExists(step.outputs.build_url); +}); diff --git a/src/connectors/travisci/functions/restart_build.ts b/src/connectors/travisci/functions/restart_build.ts new file mode 100644 index 0000000..ab9c591 --- /dev/null +++ b/src/connectors/travisci/functions/restart_build.ts @@ -0,0 +1,33 @@ +/** 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: "A0619K2GN2W#/functions/restart_build", + title: "Restart build", + input_parameters: { + properties: { + repo_slug: { type: Schema.types.string, title: "Repository" }, + branch: { + type: Schema.types.string, + description: "Select a branch", + title: "Branch", + }, + build_id: { + type: Schema.types.string, + description: "Select a build ID", + title: "Build ID", + }, + }, + required: ["repo_slug", "branch", "build_id"], + }, + output_parameters: { + properties: { + build_id: { type: Schema.types.string, title: "Build ID" }, + branch: { type: Schema.types.string, title: "Branch" }, + repository: { type: Schema.types.string, title: "Repository" }, + build_url: { type: Schema.types.string, title: "Build URL" }, + }, + required: [], + }, +}); diff --git a/src/connectors/travisci/functions/restart_build_test.ts b/src/connectors/travisci/functions/restart_build_test.ts new file mode 100644 index 0000000..1767363 --- /dev/null +++ b/src/connectors/travisci/functions/restart_build_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 RestartBuild from "./restart_build.ts"; + +Deno.test("RestartBuild can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_RestartBuild_slack_function", + title: "Test RestartBuild", + description: "This is a generated test to test RestartBuild", + }); + testWorkflow.addStep(RestartBuild, { + repo_slug: "test", + branch: "test", + build_id: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A0619K2GN2W#/functions/restart_build"); + assertEquals(actual.inputs, { + repo_slug: "test", + branch: "test", + build_id: "test", + }); +}); + +Deno.test("All outputs of Slack function RestartBuild should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_RestartBuild_slack_function", + title: "Test RestartBuild", + description: "This is a generated test to test RestartBuild", + }); + const step = testWorkflow.addStep(RestartBuild, { + repo_slug: "test", + branch: "test", + build_id: "test", + }); + assertExists(step.outputs.build_id); + assertExists(step.outputs.branch); + assertExists(step.outputs.repository); + assertExists(step.outputs.build_url); +}); diff --git a/src/connectors/travisci/functions/trigger_build.ts b/src/connectors/travisci/functions/trigger_build.ts new file mode 100644 index 0000000..dc0b7a1 --- /dev/null +++ b/src/connectors/travisci/functions/trigger_build.ts @@ -0,0 +1,29 @@ +/** 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: "A0619K2GN2W#/functions/trigger_build", + title: "Trigger build", + input_parameters: { + properties: { + repo_slug: { type: Schema.types.string, title: "Repository" }, + branch: { + type: Schema.types.string, + description: "Select a branch", + title: "Branch", + }, + message: { type: Schema.types.string, title: "Message" }, + }, + required: ["repo_slug", "branch", "message"], + }, + output_parameters: { + properties: { + request_id: { type: Schema.types.string, title: "Request ID" }, + request_message: { type: Schema.types.string, title: "Message" }, + branch: { type: Schema.types.string, title: "Branch" }, + repository: { type: Schema.types.string, title: "Repository" }, + }, + required: [], + }, +}); diff --git a/src/connectors/travisci/functions/trigger_build_test.ts b/src/connectors/travisci/functions/trigger_build_test.ts new file mode 100644 index 0000000..4ca2564 --- /dev/null +++ b/src/connectors/travisci/functions/trigger_build_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 TriggerBuild from "./trigger_build.ts"; + +Deno.test("TriggerBuild can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_TriggerBuild_slack_function", + title: "Test TriggerBuild", + description: "This is a generated test to test TriggerBuild", + }); + testWorkflow.addStep(TriggerBuild, { + repo_slug: "test", + branch: "test", + message: "test", + }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A0619K2GN2W#/functions/trigger_build"); + assertEquals(actual.inputs, { + repo_slug: "test", + branch: "test", + message: "test", + }); +}); + +Deno.test("All outputs of Slack function TriggerBuild should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_TriggerBuild_slack_function", + title: "Test TriggerBuild", + description: "This is a generated test to test TriggerBuild", + }); + const step = testWorkflow.addStep(TriggerBuild, { + repo_slug: "test", + branch: "test", + message: "test", + }); + assertExists(step.outputs.request_id); + assertExists(step.outputs.request_message); + assertExists(step.outputs.branch); + assertExists(step.outputs.repository); +}); diff --git a/src/connectors/travisci/mod.ts b/src/connectors/travisci/mod.ts new file mode 100644 index 0000000..17e07db --- /dev/null +++ b/src/connectors/travisci/mod.ts @@ -0,0 +1,23 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import CancelBuild from "./functions/cancel_build.ts"; +import RestartBuild from "./functions/restart_build.ts"; +import TriggerBuild from "./functions/trigger_build.ts"; + +const Travisci = { + functions: { + /** + * @see The {@link https://api.slack.com/reference/connectors/travisci/cancel_build CancelBuild} documentation. + */ + CancelBuild, + /** + * @see The {@link https://api.slack.com/reference/connectors/travisci/restart_build RestartBuild} documentation. + */ + RestartBuild, + /** + * @see The {@link https://api.slack.com/reference/connectors/travisci/trigger_build TriggerBuild} documentation. + */ + TriggerBuild, + }, +} as const; + +export default Travisci; diff --git a/src/connectors/twilio/functions/send_sms.ts b/src/connectors/twilio/functions/send_sms.ts new file mode 100644 index 0000000..f621e74 --- /dev/null +++ b/src/connectors/twilio/functions/send_sms.ts @@ -0,0 +1,33 @@ +/** 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: "A05PYKVP6SF#/functions/send_sms", + title: "Send SMS", + input_parameters: { + properties: { + recipient: { + type: Schema.types.string, + description: "Enter recipient's number", + title: "Recipient's number", + }, + messsage_text: { + type: Schema.types.string, + description: "Enter Message Text", + title: "Message", + }, + }, + required: ["recipient", "messsage_text"], + }, + output_parameters: { + properties: { + recipient: { + type: Schema.types.string, + description: "Recipient's number", + title: "Recipient's number", + }, + }, + required: ["recipient"], + }, +}); diff --git a/src/connectors/twilio/functions/send_sms_test.ts b/src/connectors/twilio/functions/send_sms_test.ts new file mode 100644 index 0000000..b26bf3a --- /dev/null +++ b/src/connectors/twilio/functions/send_sms_test.ts @@ -0,0 +1,30 @@ +/** 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 SendSms from "./send_sms.ts"; + +Deno.test("SendSms can be used as a Slack function in a workflow step", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_SendSms_slack_function", + title: "Test SendSms", + description: "This is a generated test to test SendSms", + }); + testWorkflow.addStep(SendSms, { recipient: "test", messsage_text: "test" }); + const actual = testWorkflow.steps[0].export(); + + assertEquals(actual.function_id, "A05PYKVP6SF#/functions/send_sms"); + assertEquals(actual.inputs, { recipient: "test", messsage_text: "test" }); +}); + +Deno.test("All outputs of Slack function SendSms should exist", () => { + const testWorkflow = DefineWorkflow({ + callback_id: "test_SendSms_slack_function", + title: "Test SendSms", + description: "This is a generated test to test SendSms", + }); + const step = testWorkflow.addStep(SendSms, { + recipient: "test", + messsage_text: "test", + }); + assertExists(step.outputs.recipient); +}); diff --git a/src/connectors/twilio/mod.ts b/src/connectors/twilio/mod.ts new file mode 100644 index 0000000..7448d42 --- /dev/null +++ b/src/connectors/twilio/mod.ts @@ -0,0 +1,13 @@ +/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/ +import SendSms from "./functions/send_sms.ts"; + +const Twilio = { + functions: { + /** + * @see The {@link https://api.slack.com/reference/connectors/twilio/send_sms SendSms} documentation. + */ + SendSms, + }, +} as const; + +export default Twilio;