Skip to content

Commit 33484ec

Browse files
authored
Merge branch 'master' into issue-15670
2 parents 3d540ea + 88135ca commit 33484ec

File tree

396 files changed

+12931
-4756
lines changed

Some content is hidden

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

396 files changed

+12931
-4756
lines changed

components/airtable_oauth/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/airtable_oauth",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "Pipedream Airtable (OAuth) Components",
55
"main": "airtable_oauth.app.mjs",
66
"keywords": [

components/airtable_oauth/sources/new-or-modified-records-in-view/new-or-modified-records-in-view.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ export default {
66
name: "New or Modified Records in View",
77
description: "Emit new event for each new or modified record in a view",
88
key: "airtable_oauth-new-or-modified-records-in-view",
9-
version: "0.0.8",
9+
version: "0.0.9",
1010
type: "source",
11-
dedupe: "unique",
1211
props: {
1312
...base.props,
1413
tableId: {
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import charthop from "../../charthop.app.mjs";
2+
import { parseObject } from "../../common/utils.mjs";
3+
4+
export default {
5+
key: "charthop-create-employee",
6+
name: "Create Employee",
7+
description: "Adds a new employee to the system. [See the documentation](https://api.charthop.com/swagger#/person/createPerson)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
charthop,
12+
orgId: {
13+
propDefinition: [
14+
charthop,
15+
"orgId",
16+
],
17+
},
18+
name: {
19+
type: "string",
20+
label: "Name",
21+
description: "Name of the employee",
22+
},
23+
additionalProperties: {
24+
type: "object",
25+
label: "Additional Properties",
26+
description: "Additional properties to add to the employee",
27+
optional: true,
28+
},
29+
},
30+
async run({ $ }) {
31+
const additionalProperties = this.additionalProperties
32+
? parseObject(this.additionalProperties)
33+
: {};
34+
35+
const response = await this.charthop.createPerson({
36+
$,
37+
orgId: this.orgId,
38+
data: {
39+
name: this.name,
40+
...additionalProperties,
41+
},
42+
});
43+
44+
$.export("$summary", `Successfully created employee with ID: ${response.id}`);
45+
return response;
46+
},
47+
};
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import charthop from "../../charthop.app.mjs";
2+
3+
export default {
4+
key: "charthop-search-organization",
5+
name: "Search Organization",
6+
description: "Return people, job, group, and field data for a particular org that match a provided search string. [See the documentation](https://api.charthop.com/swagger#/search/searchOrgData)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
charthop,
11+
orgId: {
12+
propDefinition: [
13+
charthop,
14+
"orgId",
15+
],
16+
},
17+
q: {
18+
type: "string",
19+
label: "Query",
20+
description: "The search query",
21+
},
22+
},
23+
async run({ $ }) {
24+
const response = await this.charthop.searchOrganization({
25+
$,
26+
orgId: this.orgId,
27+
params: {
28+
q: this.q,
29+
includeFormer: true,
30+
},
31+
});
32+
33+
$.export("$summary", "Successfully completed search query");
34+
return response;
35+
},
36+
};
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import charthop from "../../charthop.app.mjs";
2+
3+
export default {
4+
key: "charthop-update-employee-details",
5+
name: "Update Employee Details",
6+
description: "Updates an existing employee's details. [See the documentation](https://api.charthop.com/swagger#/user/updateUser)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
charthop,
11+
orgId: {
12+
propDefinition: [
13+
charthop,
14+
"orgId",
15+
],
16+
},
17+
employeeId: {
18+
propDefinition: [
19+
charthop,
20+
"employeeId",
21+
(c) => ({
22+
orgId: c.orgId,
23+
}),
24+
],
25+
reloadProps: true,
26+
},
27+
},
28+
async additionalProps() {
29+
const props = {};
30+
if (!this.employeeId || !this.orgId) {
31+
return props;
32+
}
33+
34+
const employee = await this.charthop.getPerson({
35+
orgId: this.orgId,
36+
personId: this.employeeId,
37+
});
38+
39+
for (const [
40+
key,
41+
value,
42+
] of Object.entries(employee)) {
43+
if (key === "id") {
44+
continue;
45+
}
46+
props[key] = {
47+
type: "string",
48+
label: `${key}`,
49+
default: key === "name"
50+
? (`${value?.first} ${value?.last}`).trim()
51+
: `${value}`,
52+
};
53+
}
54+
55+
return props;
56+
},
57+
async run({ $ }) {
58+
const {
59+
charthop,
60+
orgId,
61+
employeeId,
62+
...fields
63+
} = this;
64+
65+
await charthop.updatePerson({
66+
$,
67+
orgId,
68+
personId: employeeId,
69+
data: {
70+
...fields,
71+
},
72+
});
73+
74+
const response = await charthop.getPerson({
75+
$,
76+
orgId,
77+
personId: employeeId,
78+
});
79+
80+
$.export("$summary", `Successfully updated employee with ID ${employeeId}`);
81+
return response;
82+
},
83+
};

0 commit comments

Comments
 (0)