Skip to content

Commit 17e5afe

Browse files
Danny/customjs header (#16057)
* adding custom header per app's request * Update customjs.app.mjs * Update package.json * Update package.json
1 parent b6888ec commit 17e5afe

File tree

8 files changed

+18
-14
lines changed

8 files changed

+18
-14
lines changed

components/customjs/actions/convert-html-to-pdf/convert-html-to-pdf.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "customjs-convert-html-to-pdf",
77
name: "Convert HTML to PDF",
88
description: "Converts an HTML string to a PDF document. [See the documentation](https://www.customjs.space/api/docs#_1-html-to-pdf)",
9-
version: "0.0.2",
9+
version: "0.0.3",
1010
type: "action",
1111
props: {
1212
customjs,

components/customjs/actions/convert-html-to-png/convert-html-to-png.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "customjs-convert-html-to-png",
77
name: "Convert HTML to PNG",
88
description: "Converts an HTML string to a PNG image. [See the documentation](https://www.customjs.space/api/docs#_4-html-to-png)",
9-
version: "0.0.1",
9+
version: "0.0.2",
1010
type: "action",
1111
props: {
1212
customjs,

components/customjs/actions/create-screenshot/create-screenshot.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "customjs-create-screenshot",
77
name: "Create Screenshot",
88
description: "Create a screenshot of a website. [See the documentation](https://www.customjs.space/api/docs#_3-create-screenshot)",
9-
version: "0.0.2",
9+
version: "0.0.3",
1010
type: "action",
1111
props: {
1212
customjs,

components/customjs/actions/merge-pdfs/merge-pdfs.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "customjs-merge-pdfs",
77
name: "Merge PDFs",
88
description: "Merges multiple PDF documents into one. [See the documentation](https://www.customjs.space/api/docs#_2-merge-pdfs)",
9-
version: "0.0.2",
9+
version: "0.0.3",
1010
type: "action",
1111
props: {
1212
customjs,

components/customjs/actions/run-puppeteer/run-puppeteer.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "customjs-run-puppeteer",
77
name: "Run Puppeteer",
88
description: "Run Puppeteer. [See the documentation](https://www.customjs.space/api/docs#_5-run-puppeteer)",
9-
version: "0.0.1",
9+
version: "0.0.2",
1010
type: "action",
1111
props: {
1212
customjs,

components/customjs/customjs.app.mjs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,26 @@ export default {
1111
},
1212
},
1313
methods: {
14+
_getBaseHeaders() {
15+
return {
16+
"Content-Type": "application/json",
17+
"customjs-origin": "pipedream",
18+
};
19+
},
1420
_makeRequest(opts = {}) {
1521
const {
1622
$ = this,
17-
headers,
23+
headers = {},
1824
...otherOpts
1925
} = opts;
26+
2027
return axios($, {
2128
...otherOpts,
2229
method: "POST",
2330
url: `https://e.customjs.io/__js1-${this.$auth.api_key}`,
2431
headers: {
32+
...this._getBaseHeaders(),
2533
...headers,
26-
"Content-Type": "application/json",
2734
},
2835
responseType: "arraybuffer",
2936
});

components/customjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/customjs",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"description": "Pipedream CustomJS Components",
55
"main": "customjs.app.mjs",
66
"keywords": [

pnpm-lock.yaml

Lines changed: 3 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)