Skip to content

Commit 8c2afca

Browse files
committed
Merge remote-tracking branch 'origin/master' into issue-15008
2 parents b78fd66 + 5ce280f commit 8c2afca

File tree

72 files changed

+1266
-167
lines changed

Some content is hidden

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

72 files changed

+1266
-167
lines changed

components/brevo/actions/add-or-update-contact/add-or-update-contact.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "brevo-add-or-update-contact",
55
name: "Add or Update a contact",
66
description: "Add or Update a contact",
7-
version: "0.0.3",
7+
version: "0.0.4",
88
type: "action",
99
props: {
1010
brevo,
@@ -51,7 +51,7 @@ export default {
5151
return dynamicProps;
5252
},
5353
async run({ $ }) {
54-
let identifier = this.providedIdentifier;
54+
let identifier = this.providedIdentifier || this.email;
5555
const listIds = Object.keys(this.listIds).map((key) => parseInt(this.listIds[key], 10));
5656
let contact = null;
5757
if (identifier) {

components/brevo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/brevo",
3-
"version": "0.1.2",
3+
"version": "0.1.3",
44
"description": "Pipedream Brevo Components",
55
"main": "brevo.app.mjs",
66
"keywords": [
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default {
2+
type: "app",
3+
app: "change_photos",
4+
propDefinitions: {},
5+
methods: {
6+
// this.$auth contains connected account data
7+
authKeys() {
8+
console.log(Object.keys(this.$auth));
9+
},
10+
},
11+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/change_photos",
3+
"version": "0.0.1",
4+
"description": "Pipedream change.photos Components",
5+
"main": "change_photos.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"change_photos"
9+
],
10+
"homepage": "https://pipedream.com/apps/change_photos",
11+
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12+
"publishConfig": {
13+
"access": "public"
14+
}
15+
}

components/kafka/kafka.app.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default {
2+
type: "app",
3+
app: "kafka",
4+
propDefinitions: {},
5+
methods: {
6+
// this.$auth contains connected account data
7+
authKeys() {
8+
console.log(Object.keys(this.$auth));
9+
},
10+
},
11+
};

components/kafka/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/kafka",
3+
"version": "0.0.1",
4+
"description": "Pipedream Kafka Components",
5+
"main": "kafka.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"kafka"
9+
],
10+
"homepage": "https://pipedream.com/apps/kafka",
11+
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12+
"publishConfig": {
13+
"access": "public"
14+
}
15+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import kenjo from "../../kenjo.app.mjs";
2+
import { ConfigurationError } from "@pipedream/platform";
3+
4+
export default {
5+
key: "kenjo-create-attendance-entry",
6+
name: "Create Attendance Entry",
7+
description: "Creates a new attendance entry for an employee in Kenjo. [See the documentation](https://kenjo.readme.io/reference/post_attendances)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
kenjo,
12+
employeeId: {
13+
propDefinition: [
14+
kenjo,
15+
"employeeId",
16+
],
17+
},
18+
date: {
19+
type: "string",
20+
label: "Date",
21+
description: "The date of the entry. Format: `YYYY-MM-DD`",
22+
},
23+
startTime: {
24+
type: "string",
25+
label: "Start Time",
26+
description: "The start time of the entry. Format: `hh:mm:ss`",
27+
},
28+
endTime: {
29+
type: "string",
30+
label: "End Time",
31+
description: "The end time of the entry. Format: `hh:mm:ss`",
32+
optional: true,
33+
},
34+
breakStartTime: {
35+
type: "string",
36+
label: "Break Start Time",
37+
description: "The start time of the break. Format: `hh:mm:ss`",
38+
optional: true,
39+
},
40+
breakEndTime: {
41+
type: "string",
42+
label: "Break End Time",
43+
description: "The end time of the break. Format: `hh:mm:ss`",
44+
optional: true,
45+
},
46+
comment: {
47+
type: "string",
48+
label: "Comment",
49+
description: "Comment to describe the attendance record",
50+
optional: true,
51+
},
52+
},
53+
async run({ $ }) {
54+
if (this.breakEndTime && !this.breakStartTime) {
55+
throw new ConfigurationError("Break Start Time is required if including a break");
56+
}
57+
58+
const response = await this.kenjo.createAttendanceEntry({
59+
$,
60+
data: {
61+
userId: this.employeeId,
62+
date: this.date,
63+
startTime: this.startTime,
64+
endTime: this.endTime,
65+
breaks: this.breakStartTime && [
66+
{
67+
start: this.breakStartTime,
68+
end: this.breakEndTime,
69+
},
70+
],
71+
comment: this.comment,
72+
},
73+
});
74+
$.export("$summary", `Successfully created attendance entry with ID: ${response._id}`);
75+
return response;
76+
},
77+
};
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
import kenjo from "../../kenjo.app.mjs";
2+
3+
export default {
4+
key: "kenjo-create-employee",
5+
name: "Create Employee",
6+
description: "Creates a new employee in Kenjo. [See the documentation](https://kenjo.readme.io/reference/post_employees)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
kenjo,
11+
email: {
12+
type: "string",
13+
label: "Email",
14+
description: "The email address of the employee",
15+
},
16+
firstName: {
17+
type: "string",
18+
label: "First Name",
19+
description: "The first name of the employee",
20+
},
21+
lastName: {
22+
type: "string",
23+
label: "Last Name",
24+
description: "The last name of the employee",
25+
},
26+
companyId: {
27+
propDefinition: [
28+
kenjo,
29+
"companyId",
30+
],
31+
},
32+
weeklyHours: {
33+
type: "integer",
34+
label: "Weekly Hours",
35+
description: "The number of weekly hours that an employee works",
36+
},
37+
officeId: {
38+
propDefinition: [
39+
kenjo,
40+
"officeId",
41+
(c) => ({
42+
companyId: c.companyId,
43+
}),
44+
],
45+
},
46+
departmentId: {
47+
propDefinition: [
48+
kenjo,
49+
"departmentId",
50+
],
51+
},
52+
language: {
53+
type: "string",
54+
label: "Language",
55+
description: "The employee's language",
56+
options: [
57+
"en",
58+
"es",
59+
"de",
60+
],
61+
optional: true,
62+
},
63+
birthdate: {
64+
type: "string",
65+
label: "Birthdate",
66+
description: "The birthdate of the employee. Format `YYYY-MM-DDThh:mm:ss.000Z`",
67+
optional: true,
68+
},
69+
jobTitle: {
70+
type: "string",
71+
label: "Job Title",
72+
description: "The job title of the employee",
73+
optional: true,
74+
},
75+
workPhone: {
76+
type: "string",
77+
label: "Work Phone",
78+
description: "The work phone number of the employee",
79+
optional: true,
80+
},
81+
personalPhone: {
82+
type: "string",
83+
label: "Personal Phone",
84+
description: "The personal phone number of the employee",
85+
optional: true,
86+
},
87+
workDays: {
88+
type: "string[]",
89+
label: "Work Days",
90+
description: "The days of the week that the employee works",
91+
options: [
92+
"monday",
93+
"tuesday",
94+
"wednesday",
95+
"thursday",
96+
"friday",
97+
"saturday",
98+
"sunday",
99+
],
100+
optional: true,
101+
},
102+
trackAttendance: {
103+
type: "boolean",
104+
label: "Track Attendance",
105+
description: "Set to `true` to activate attendance tracking for the employee",
106+
optional: true,
107+
},
108+
street: {
109+
type: "string",
110+
label: "Street",
111+
description: "The street address of the employee",
112+
optional: true,
113+
},
114+
postalCode: {
115+
type: "string",
116+
label: "Postal Code",
117+
description: "The postal code of the employee",
118+
optional: true,
119+
},
120+
city: {
121+
type: "string",
122+
label: "City",
123+
description: "The city of the employee",
124+
optional: true,
125+
},
126+
country: {
127+
type: "string",
128+
label: "Country",
129+
description: "The country code in ISO 3166-1 alpha-2. Example: `ES`",
130+
optional: true,
131+
},
132+
},
133+
async run({ $ }) {
134+
const workSchedule = {
135+
trackAttendance: this.trackAttendance,
136+
};
137+
if (this.workDays?.length) {
138+
for (const day of this.workDays) {
139+
workSchedule[`${day}WorkingDay`] = true;
140+
}
141+
}
142+
143+
const response = await this.kenjo.createEmployee({
144+
$,
145+
data: {
146+
account: {
147+
email: this.email,
148+
language: this.language,
149+
},
150+
personal: {
151+
firstName: this.firstName,
152+
lastName: this.lastName,
153+
birthdate: this.birthdate,
154+
},
155+
work: {
156+
companyId: this.companyId,
157+
officeId: this.officeId,
158+
departmentId: this.departmentId,
159+
weeklyHours: this.weeklyHours,
160+
jobTitle: this.jobTitle,
161+
workPhone: this.workPhone,
162+
},
163+
workSchedule,
164+
address: (this.street || this.postalCode || this.city || this.country) && {
165+
street: this.street,
166+
postalCode: this.postalCode,
167+
city: this.city,
168+
country: this.country,
169+
},
170+
home: this.personalPhone && {
171+
personalPhone: this.personalPhone,
172+
},
173+
},
174+
});
175+
$.export("$summary", `Created employee with ID: ${response.account._id}`);
176+
return response;
177+
},
178+
};

0 commit comments

Comments
 (0)