Skip to content

Commit 73a7b59

Browse files
Merge branch 'master' into issue-16061
2 parents 68fbd6a + 72c8447 commit 73a7b59

File tree

32 files changed

+960
-43
lines changed

32 files changed

+960
-43
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: "brosix",
3+
app: "apiverve",
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/apiverve/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/apiverve",
3+
"version": "0.0.1",
4+
"description": "Pipedream APIVerve Components",
5+
"main": "apiverve.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"apiverve"
9+
],
10+
"homepage": "https://pipedream.com/apps/apiverve",
11+
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12+
"publishConfig": {
13+
"access": "public"
14+
}
15+
}
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: "bloomerang",
4+
propDefinitions: {},
5+
methods: {
6+
// this.$auth contains connected account data
7+
authKeys() {
8+
console.log(Object.keys(this.$auth));
9+
},
10+
},
11+
};

components/bloomerang/package.json

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

components/brosix/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import app from "../../brosix.app.mjs";
2+
3+
export default {
4+
key: "brosix-send-message",
5+
name: "Send Message",
6+
description: "Send a message with Brosix. [See the documentation](https://help.brosix.com/notifications-api/)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
msg: {
12+
propDefinition: [
13+
app,
14+
"msg",
15+
],
16+
},
17+
},
18+
async run({ $ }) {
19+
const response = await this.app.sendMessage({
20+
$,
21+
params: {
22+
msg: this.msg,
23+
},
24+
});
25+
$.export("$summary", "Successfully sent the message");
26+
return response;
27+
},
28+
};

components/brosix/brosix.app.mjs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { axios } from "@pipedream/platform";
2+
3+
export default {
4+
type: "app",
5+
app: "brosix",
6+
propDefinitions: {
7+
msg: {
8+
type: "string",
9+
label: "Message",
10+
description: "The message that will be sent",
11+
},
12+
},
13+
methods: {
14+
_baseUrl() {
15+
return "https://box-n2.brosix.com/api/v1";
16+
},
17+
async _makeRequest(opts = {}) {
18+
const {
19+
$ = this,
20+
path,
21+
params,
22+
...otherOpts
23+
} = opts;
24+
return axios($, {
25+
...otherOpts,
26+
url: this._baseUrl() + path,
27+
params: {
28+
"apikey": `${this.$auth.api_key}`,
29+
...params,
30+
},
31+
});
32+
},
33+
34+
async sendMessage(args = {}) {
35+
return this._makeRequest({
36+
path: "/message/send/",
37+
method: "post",
38+
...args,
39+
});
40+
},
41+
},
42+
};

components/brosix/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"name": "@pipedream/brosix",
3-
"version": "0.0.3",
3+
"version": "0.1.0",
44
"description": "Pipedream Brosix Components",
5-
"main": "dist/app/brosix.app.mjs",
5+
"main": "brosix.app.mjs",
66
"keywords": [
77
"pipedream",
88
"brosix"
99
],
10-
"files": [
11-
"dist"
12-
],
1310
"homepage": "https://pipedream.com/apps/brosix",
1411
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
1512
"publishConfig": {
1613
"access": "public"
14+
},
15+
"dependencies": {
16+
"@pipedream/platform": "^3.0.3"
1717
}
1818
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import app from "../../cloudflare_browser_rendering.app.mjs";
2+
3+
export default {
4+
props: {
5+
app,
6+
// eslint-disable-next-line pipedream/props-label, pipedream/props-description
7+
info: {
8+
type: "alert",
9+
alertType: "info",
10+
content: "Please note that either **HTML** or **URL** must be set.",
11+
},
12+
html: {
13+
propDefinition: [
14+
app,
15+
"html",
16+
],
17+
},
18+
url: {
19+
propDefinition: [
20+
app,
21+
"url",
22+
],
23+
},
24+
viewportHeight: {
25+
propDefinition: [
26+
app,
27+
"viewportHeight",
28+
],
29+
},
30+
viewportWidth: {
31+
propDefinition: [
32+
app,
33+
"viewportWidth",
34+
],
35+
},
36+
viewportDeviceScaleFactor: {
37+
propDefinition: [
38+
app,
39+
"viewportDeviceScaleFactor",
40+
],
41+
},
42+
viewportHasTouch: {
43+
propDefinition: [
44+
app,
45+
"viewportHasTouch",
46+
],
47+
},
48+
viewportIsLandscape: {
49+
propDefinition: [
50+
app,
51+
"viewportIsLandscape",
52+
],
53+
},
54+
viewportIsMobile: {
55+
propDefinition: [
56+
app,
57+
"viewportIsMobile",
58+
],
59+
},
60+
userAgent: {
61+
propDefinition: [
62+
app,
63+
"userAgent",
64+
],
65+
},
66+
additionalSettings: {
67+
propDefinition: [
68+
app,
69+
"additionalSettings",
70+
],
71+
},
72+
},
73+
};
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import { ConfigurationError } from "@pipedream/platform";
2+
import common from "../common/base.mjs";
3+
import utils from "../../common/utils.mjs";
4+
5+
export default {
6+
...common,
7+
key: "cloudflare_browser_rendering-get-html-content",
8+
name: "Get HTML Content",
9+
description: "Fetches rendered HTML content from provided URL or HTML. [See the documentation](https://developers.cloudflare.com/api/resources/browser_rendering/subresources/content/)",
10+
version: "0.0.1",
11+
type: "action",
12+
methods: {
13+
getHtmlContent(args = {}) {
14+
return this.app.post({
15+
path: "/content",
16+
...args,
17+
});
18+
},
19+
},
20+
async run({ $ }) {
21+
const {
22+
getHtmlContent,
23+
html,
24+
url,
25+
viewportHeight,
26+
viewportWidth,
27+
viewportDeviceScaleFactor,
28+
viewportHasTouch,
29+
viewportIsLandscape,
30+
viewportIsMobile,
31+
userAgent,
32+
additionalSettings,
33+
} = this;
34+
35+
if (!html && !url) {
36+
throw new ConfigurationError("Either **HTML** or **URL** is required");
37+
}
38+
39+
if ((viewportHeight && !viewportWidth) || (!viewportHeight && viewportWidth)) {
40+
throw new ConfigurationError("Both **Viewport - Height** and **Viewport - Width** are required when either is provided");
41+
}
42+
43+
const response = await getHtmlContent({
44+
$,
45+
data: {
46+
html,
47+
url,
48+
...(viewportHeight && {
49+
viewport: {
50+
height: viewportHeight,
51+
width: viewportWidth,
52+
deviceScaleFactor: viewportDeviceScaleFactor,
53+
hasTouch: viewportHasTouch,
54+
isLandscape: viewportIsLandscape,
55+
isMobile: viewportIsMobile,
56+
},
57+
}),
58+
userAgent,
59+
...utils.parseJson(additionalSettings),
60+
},
61+
});
62+
63+
$.export("$summary", "Successfully fetched HTML content");
64+
return response;
65+
},
66+
};

0 commit comments

Comments
 (0)