Skip to content

Commit 1a118b4

Browse files
authored
[Components] brosix #13436 (#16082)
* Added actions * Update brosix.app.mjs
1 parent 9184b99 commit 1a118b4

File tree

6 files changed

+80
-22
lines changed

6 files changed

+80
-22
lines changed

components/brosix/.gitignore

-3
This file was deleted.
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/app/brosix.app.ts

-13
This file was deleted.

components/brosix/brosix.app.mjs

+42
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

+5-5
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
}

pnpm-lock.yaml

+5-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)