Skip to content

Commit b8069ce

Browse files
committed
Merge branch 'master' into airtable-usability-improvements-241217
2 parents 0af5a6a + 5797912 commit b8069ce

File tree

171 files changed

+4269
-542
lines changed

Some content is hidden

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

171 files changed

+4269
-542
lines changed
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
import { defineApp } from "@pipedream/types";
2-
3-
export default defineApp({
1+
export default {
42
type: "app",
5-
app: "uptimerobot",
3+
app: "bluesky",
64
propDefinitions: {},
75
methods: {
86
// this.$auth contains connected account data
97
authKeys() {
108
console.log(Object.keys(this.$auth));
119
},
1210
},
13-
});
11+
};

components/bluesky/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/bluesky",
3+
"version": "0.0.1",
4+
"description": "Pipedream Bluesky Components",
5+
"main": "bluesky.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"bluesky"
9+
],
10+
"homepage": "https://pipedream.com/apps/bluesky",
11+
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12+
"publishConfig": {
13+
"access": "public"
14+
}
15+
}

components/breathe/breathe.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: "breathe",
4+
propDefinitions: {},
5+
methods: {
6+
// this.$auth contains connected account data
7+
authKeys() {
8+
console.log(Object.keys(this.$auth));
9+
},
10+
},
11+
};

components/breathe/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/breathe",
3+
"version": "0.0.1",
4+
"description": "Pipedream Breathe Components",
5+
"main": "breathe.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"breathe"
9+
],
10+
"homepage": "https://pipedream.com/apps/breathe",
11+
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12+
"publishConfig": {
13+
"access": "public"
14+
}
15+
}

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+
}
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
import contentstack from "../../contentstack.app.mjs";
2+
import {
3+
parseArray, parseEntry,
4+
} from "../../common/utils.mjs";
5+
6+
const createDocLink = "https://www.contentstack.com/docs/developers/apis/content-management-api#create-an-entry";
7+
const updateDocLink = "https://www.contentstack.com/docs/developers/apis/content-management-api#update-an-entry";
8+
9+
export default {
10+
props: {
11+
contentstack,
12+
contentType: {
13+
propDefinition: [
14+
contentstack,
15+
"contentType",
16+
],
17+
reloadProps: true,
18+
},
19+
},
20+
async additionalProps() {
21+
if (!this.contentType) {
22+
return {};
23+
}
24+
try {
25+
return await this.buildFieldProps(this.contentType);
26+
} catch {
27+
return {
28+
entryObj: {
29+
type: "object",
30+
label: "Entry",
31+
description: `Enter the entry object as JSON. [See the documentation](${this.isUpdate()
32+
? updateDocLink
33+
: createDocLink}) for more information.`,
34+
},
35+
};
36+
}
37+
},
38+
methods: {
39+
getType(field) {
40+
if (field.data_type === "boolean") {
41+
return "boolean";
42+
}
43+
if (field.data_type === "json") {
44+
return "object";
45+
}
46+
return field.multiple
47+
? "string[]"
48+
: "string";
49+
},
50+
isUpdate() {
51+
return false;
52+
},
53+
async getOptions(field) {
54+
if (field.data_type === "reference") {
55+
const referenceContentType = field.reference_to[0];
56+
const { entries } = await this.contentstack.listEntries({
57+
contentType: referenceContentType,
58+
});
59+
return entries?.map(({
60+
uid: value, title: label,
61+
}) => ({
62+
value,
63+
label: label ?? value,
64+
})) || [];
65+
}
66+
if (field.data_type === "file") {
67+
const { assets } = await this.contentstack.listAssets();
68+
return assets?.map(({
69+
uid: value, title: label,
70+
}) => ({
71+
value,
72+
label: label ?? value,
73+
})) || [];
74+
}
75+
return undefined;
76+
},
77+
async buildFieldProps(contentType) {
78+
const props = {};
79+
const { content_type: { schema } } = await this.contentstack.getContentType({
80+
contentType,
81+
});
82+
for (const field of schema) {
83+
props[field.uid] = {
84+
type: this.getType(field),
85+
label: field.display_name ?? field.uid,
86+
description: `Value of field ${field.display_name}. Field type: \`${field.data_type}\``,
87+
optional: this.isUpdate()
88+
? true
89+
: !field.mandatory,
90+
options: await this.getOptions(field),
91+
};
92+
}
93+
return props;
94+
},
95+
async buildEntry() {
96+
if (this.entryObj) {
97+
return parseEntry(this.entryObj);
98+
}
99+
const { content_type: { schema } } = await this.contentstack.getContentType({
100+
contentType: this.contentType,
101+
});
102+
const entry = {};
103+
for (const field of schema) {
104+
if (!this[field.uid]) {
105+
continue;
106+
}
107+
if (field.data_type === "reference") {
108+
if (field.multiple) {
109+
const referenceField = parseArray(this[field.uid]);
110+
entry[field.uid] = referenceField?.map((value) => ({
111+
uid: value,
112+
_content_type_uid: field.reference_to[0],
113+
}));
114+
} else {
115+
entry[field.uid] = {
116+
uid: this[field.uid],
117+
_content_type_uid: field.reference_to[0],
118+
};
119+
}
120+
continue;
121+
}
122+
entry[field.uid] = this[field.uid];
123+
}
124+
return parseEntry(entry);
125+
},
126+
},
127+
};
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import common from "../common/entries.mjs";
2+
3+
export default {
4+
...common,
5+
key: "contentstack-create-entry",
6+
name: "Create Entry",
7+
description: "Creates a new entry in Contentstack. [See the documentation](https://www.contentstack.com/docs/developers/apis/content-management-api#create-an-entry).",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
...common.props,
12+
locale: {
13+
propDefinition: [
14+
common.props.contentstack,
15+
"locale",
16+
],
17+
},
18+
},
19+
async run({ $ }) {
20+
const response = await this.contentstack.createEntry({
21+
$,
22+
contentType: this.contentType,
23+
params: {
24+
locale: this.locale,
25+
},
26+
data: {
27+
entry: await this.buildEntry(),
28+
},
29+
});
30+
$.export("$summary", `Created entry "${response.entry.title}" with UID ${response.entry.uid}`);
31+
return response;
32+
},
33+
};

0 commit comments

Comments
 (0)