Skip to content

Commit 545798b

Browse files
committed
Merge branch 'master' into issue-13763
2 parents f368cbf + 05837bc commit 545798b

File tree

461 files changed

+15701
-8367
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

461 files changed

+15701
-8367
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import app from "../../actitime.app.mjs";
2+
3+
export default {
4+
key: "actitime-create-customer",
5+
name: "Create Customer",
6+
description: "Creates a new customer. [See the documentation](https://online.actitime.com/pipedream/api/v1/swagger).",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
name: {
12+
type: "string",
13+
label: "Name",
14+
description: "The name of the customer.",
15+
},
16+
description: {
17+
type: "string",
18+
label: "Description",
19+
description: "Details about the customer.",
20+
optional: true,
21+
},
22+
},
23+
methods: {
24+
createCustomer(args = {}) {
25+
return this.app.post({
26+
path: "/customers",
27+
...args,
28+
});
29+
},
30+
},
31+
async run({ $ }) {
32+
const {
33+
createCustomer,
34+
name,
35+
description,
36+
} = this;
37+
38+
const response = await createCustomer({
39+
$,
40+
data: {
41+
name,
42+
description,
43+
},
44+
});
45+
46+
$.export("$summary", `Successfully created customer with ID \`${response.id}\`.`);
47+
return response;
48+
},
49+
};
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
import { ConfigurationError } from "@pipedream/platform";
2+
import app from "../../actitime.app.mjs";
3+
4+
export default {
5+
key: "actitime-create-task",
6+
name: "Create Task",
7+
description: "Creates a new task. [See the documentation](https://online.actitime.com/pipedream/api/v1/swagger).",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
app,
12+
projectId: {
13+
propDefinition: [
14+
app,
15+
"projectId",
16+
],
17+
},
18+
name: {
19+
type: "string",
20+
label: "Name",
21+
description: "The name of the task.",
22+
},
23+
description: {
24+
type: "string",
25+
label: "Description",
26+
description: "Details about the task.",
27+
optional: true,
28+
},
29+
typeOfWorkId: {
30+
propDefinition: [
31+
app,
32+
"typeOfWorkId",
33+
],
34+
},
35+
deadline: {
36+
type: "string",
37+
label: "Deadline",
38+
description: "The deadline for the task. Eg. `2024-12-31`.",
39+
optional: true,
40+
},
41+
estimatedTime: {
42+
type: "integer",
43+
label: "Estimated Time",
44+
description: "The estimated time for the task in minutes.",
45+
optional: true,
46+
},
47+
status: {
48+
type: "string",
49+
label: "Status",
50+
description: "The status of the task. This field is mutually exclusive with **Workflow Status ID**.",
51+
optional: true,
52+
options: [
53+
"open",
54+
"completed",
55+
],
56+
},
57+
workflowStatusId: {
58+
description: "The ID of the workflow status. This field is mutually exclusive with **Status**.",
59+
propDefinition: [
60+
app,
61+
"workflowStatusId",
62+
],
63+
},
64+
},
65+
methods: {
66+
createTask(args = {}) {
67+
return this.app.post({
68+
path: "/tasks",
69+
...args,
70+
});
71+
},
72+
},
73+
async run({ $ }) {
74+
const {
75+
createTask,
76+
name,
77+
description,
78+
status,
79+
workflowStatusId,
80+
typeOfWorkId,
81+
deadline,
82+
estimatedTime,
83+
projectId,
84+
} = this;
85+
86+
if (status && workflowStatusId) {
87+
throw new ConfigurationError("The **Status** and **Workflow Status ID** fields are mutually exclusive. Please provide only one of them.");
88+
}
89+
90+
const response = await createTask({
91+
$,
92+
data: {
93+
name,
94+
description,
95+
status,
96+
workflowStatusId,
97+
typeOfWorkId,
98+
deadline,
99+
estimatedTime,
100+
projectId,
101+
},
102+
});
103+
104+
$.export("$summary", `Successfully created task with ID \`${response.id}\`.`);
105+
return response;
106+
},
107+
};
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import app from "../../actitime.app.mjs";
2+
3+
export default {
4+
key: "actitime-modify-leave-time",
5+
name: "Modify Leave Time",
6+
description: "Changes the existing leave time record with a given value in actiTIME. [See the documentation](https://online.actitime.com/pipedream/api/v1/swagger).",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
userId: {
12+
propDefinition: [
13+
app,
14+
"userId",
15+
],
16+
},
17+
date: {
18+
type: "string",
19+
label: "Date",
20+
description: "The date of the leave record. Date in following format: `YYYY-MM-DD` OR `today`.",
21+
},
22+
leaveTypeId: {
23+
propDefinition: [
24+
app,
25+
"leaveTypeId",
26+
],
27+
},
28+
leaveTime: {
29+
type: "integer",
30+
label: "Leave Time",
31+
description: "The leave time in minutes.",
32+
},
33+
},
34+
methods: {
35+
updateLeaveTime({
36+
userId, date, leaveTypeId, ...args
37+
} = {}) {
38+
return this.app.patch({
39+
path: `/leavetime/${userId}/${date}/${leaveTypeId}`,
40+
...args,
41+
});
42+
},
43+
},
44+
async run({ $ }) {
45+
const {
46+
updateLeaveTime,
47+
userId,
48+
date,
49+
leaveTypeId,
50+
leaveTime,
51+
} = this;
52+
53+
const response = await updateLeaveTime({
54+
$,
55+
userId,
56+
date,
57+
leaveTypeId,
58+
data: {
59+
leaveTime,
60+
},
61+
});
62+
63+
$.export("$summary", "Successfully modified leave time record.");
64+
65+
return response;
66+
},
67+
};

0 commit comments

Comments
 (0)