Skip to content

Commit

Permalink
Automated commit: Latest generated changes from schedule action
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamBergamin committed Dec 14, 2023
1 parent 4ea0bb3 commit 3d8468d
Show file tree
Hide file tree
Showing 79 changed files with 3,420 additions and 2 deletions.
69 changes: 69 additions & 0 deletions src/connectors/deel/functions/add_time_off_request.ts
Original file line number Diff line number Diff line change
@@ -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"],
},
});
49 changes: 49 additions & 0 deletions src/connectors/deel/functions/add_time_off_request_test.ts
Original file line number Diff line number Diff line change
@@ -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);
});
142 changes: 142 additions & 0 deletions src/connectors/deel/functions/create_contract.ts
Original file line number Diff line number Diff line change
@@ -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"],
},
});
73 changes: 73 additions & 0 deletions src/connectors/deel/functions/create_contract_test.ts
Original file line number Diff line number Diff line change
@@ -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);
});
18 changes: 18 additions & 0 deletions src/connectors/deel/mod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/** This file was autogenerated. Follow the steps in src/schema/slack/functions/README.md to rebuild **/
import 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;
Loading

0 comments on commit 3d8468d

Please sign in to comment.