Skip to content

Commit 1841eeb

Browse files
committed
Merge remote-tracking branch 'origin/master' into issue-15731
2 parents 0c6c374 + de3be06 commit 1841eeb

File tree

250 files changed

+7127
-1129
lines changed

Some content is hidden

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

250 files changed

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

components/aws/actions/s3-upload-file-tmp/s3-upload-file-tmp.mjs

Lines changed: 51 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import { ConfigurationError } from "@pipedream/platform";
77
export default {
88
...common,
99
key: "aws-s3-upload-file-tmp",
10-
name: "S3 - Upload File - /tmp",
10+
name: "S3 - Upload Files - /tmp",
1111
description: toSingleLineString(`
1212
Accepts a file path or folder path starting from /tmp, then uploads the contents to S3.
1313
[See the docs](https://docs.aws.amazon.com/AmazonS3/latest/userguide/upload-objects.html)
1414
`),
15-
version: "1.0.2",
15+
version: "1.0.3",
1616
type: "action",
1717
props: {
1818
aws: common.props.aws,
@@ -25,15 +25,8 @@ export default {
2525
},
2626
path: {
2727
type: "string",
28-
label: "File Path",
29-
description: "A path starting from `/tmp`, i.e. `/tmp/some_text_file.txt`",
30-
optional: true,
31-
},
32-
folderPath: {
33-
type: "string",
34-
label: "Folder Path",
35-
description: "A path starting from `/tmp`, i.e. `/tmp/some_folder`. If provided, all the files inside this path will be uploaded. This will override the `Filename Key` and `File Path` props.",
36-
optional: true,
28+
label: "File Or Folder Path",
29+
description: "Path starting from `/tmp`. If it's a directory, all files will be uploaded.",
3730
},
3831
customFilename: {
3932
type: common.props.key.type,
@@ -44,58 +37,83 @@ export default {
4437
},
4538
methods: {
4639
...common.methods,
47-
async uploadFolderFiles($) {
40+
getFilesRecursive(dir) {
41+
let results = [];
42+
const items = fs.readdirSync(dir);
43+
for (const item of items) {
44+
const itemPath = join(dir, item);
45+
const stat = fs.statSync(itemPath);
46+
if (stat.isDirectory()) {
47+
results = results.concat(this.getFilesRecursive(itemPath));
48+
} else {
49+
results.push(itemPath);
50+
}
51+
}
52+
return results;
53+
},
54+
async uploadFolderFiles($, folderPath) {
4855
const {
4956
uploadFile,
5057
bucket,
51-
folderPath,
5258
prefix,
5359
} = this;
54-
55-
const files = fs.readdirSync(folderPath);
56-
const promises = [];
57-
for (const filename of files) {
58-
const fileContent = fs.readFileSync(join(folderPath, filename), {
60+
const files = this.getFilesRecursive(folderPath);
61+
const response = await Promise.all(files.map(async (filePath) => {
62+
const fileContent = fs.readFileSync(filePath, {
5963
encoding: "base64",
6064
});
61-
promises.push(uploadFile({
65+
const relativePath = filePath.substring(folderPath.length + 1);
66+
const s3Key = join(prefix, relativePath);
67+
68+
await uploadFile({
6269
Bucket: bucket,
63-
Key: join(prefix, filename),
70+
Key: s3Key,
6471
Body: Buffer.from(fileContent, "base64"),
65-
}));
66-
}
67-
const response = await Promise.all(promises);
72+
});
73+
return {
74+
filePath,
75+
s3Key,
76+
status: "uploaded",
77+
};
78+
}));
6879
$.export("$summary", `Uploaded all files from ${folderPath} to S3`);
6980
return response;
7081
},
71-
async uploadSingleFile($) {
82+
async uploadSingleFile($, filePath) {
7283
const {
7384
uploadFile,
7485
bucket,
75-
path,
7686
prefix,
7787
customFilename,
7888
} = this;
7989

80-
if (!path) {
81-
throw new ConfigurationError("File Path is required");
82-
}
83-
const file = fs.readFileSync(path, {
90+
const file = fs.readFileSync(filePath, {
8491
encoding: "base64",
8592
});
86-
const filename = customFilename || path.split("/").pop();
93+
const filename = customFilename || filePath.split("/").pop();
94+
8795
const response = await uploadFile({
8896
Bucket: bucket,
8997
Key: join(prefix, filename),
9098
Body: Buffer.from(file, "base64"),
9199
});
100+
92101
$.export("$summary", `Uploaded file ${filename} to S3`);
93102
return response;
94103
},
95104
},
96105
async run({ $ }) {
97-
return this.folderPath
98-
? await this.uploadFolderFiles($)
99-
: await this.uploadSingleFile($);
106+
const {
107+
uploadSingleFile,
108+
uploadFolderFiles,
109+
path,
110+
} = this;
111+
if (!fs.existsSync(path)) {
112+
throw new ConfigurationError(`The file or directory path \`${path}\` does not exist. Please verify the path and include the leading /tmp if needed.`);
113+
}
114+
const stat = fs.statSync(path);
115+
return stat.isDirectory()
116+
? await uploadFolderFiles($, path)
117+
: await uploadSingleFile($, path);
100118
},
101119
};

components/aws/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/aws",
3-
"version": "0.7.4",
3+
"version": "0.7.5",
44
"description": "Pipedream Aws Components",
55
"main": "aws.app.mjs",
66
"keywords": [
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: "elastic_email",
3+
app: "botx",
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/botx/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/botx",
3+
"version": "0.0.1",
4+
"description": "Pipedream BotX Components",
5+
"main": "botx.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"botx"
9+
],
10+
"homepage": "https://pipedream.com/apps/botx",
11+
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12+
"publishConfig": {
13+
"access": "public"
14+
}
15+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import brillium from "../../brillium.app.mjs";
2+
3+
export default {
4+
key: "brillium-list-assessments",
5+
name: "List Assessments",
6+
description: "Retrieve all Assessments for a Brillium account. [See the documentation](https://support.brillium.com/en-us/knowledgebase/article/KA-01063)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
brillium,
11+
accountId: {
12+
propDefinition: [
13+
brillium,
14+
"accountId",
15+
],
16+
},
17+
page: {
18+
propDefinition: [
19+
brillium,
20+
"page",
21+
],
22+
},
23+
pageSize: {
24+
propDefinition: [
25+
brillium,
26+
"pageSize",
27+
],
28+
},
29+
},
30+
async run({ $ }) {
31+
try {
32+
const { Assessments: assessments } = await this.brillium.listAssessments({
33+
$,
34+
accountId: this.accountId,
35+
params: {
36+
page: this.page,
37+
pagesize: this.pageSize,
38+
},
39+
});
40+
if (assessments?.length) {
41+
$.export("$summary", `Successfully retrieved ${assessments.length} assessment${assessments.length === 1
42+
? ""
43+
: "s"}`);
44+
}
45+
return assessments;
46+
} catch {
47+
$.export("$summary", "No Assessments found");
48+
}
49+
},
50+
};
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import brillium from "../../brillium.app.mjs";
2+
3+
export default {
4+
key: "brillium-list-questions",
5+
name: "List Questions",
6+
description: "Retrieve all Questions for an Assessment. [See the documentation](https://support.brillium.com/en-us/knowledgebase/article/KA-01071)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
brillium,
11+
accountId: {
12+
propDefinition: [
13+
brillium,
14+
"accountId",
15+
],
16+
},
17+
assessmentId: {
18+
propDefinition: [
19+
brillium,
20+
"assessmentId",
21+
(c) => ({
22+
accountId: c.accountId,
23+
}),
24+
],
25+
},
26+
topicId: {
27+
propDefinition: [
28+
brillium,
29+
"topicId",
30+
(c) => ({
31+
assessmentId: c.assessmentId,
32+
}),
33+
],
34+
optional: true,
35+
},
36+
page: {
37+
propDefinition: [
38+
brillium,
39+
"page",
40+
],
41+
},
42+
pageSize: {
43+
propDefinition: [
44+
brillium,
45+
"pageSize",
46+
],
47+
},
48+
},
49+
async run({ $ }) {
50+
try {
51+
const params = {
52+
page: this.page,
53+
pagesize: this.pageSize,
54+
};
55+
const { Questions: questions } = this.topicId
56+
? await this.brillium.listTopicQuestions({
57+
$,
58+
topicId: this.topicId,
59+
params,
60+
})
61+
: await this.brillium.listQuestions({
62+
$,
63+
assessmentId: this.assessmentId,
64+
params,
65+
});
66+
if (questions?.length) {
67+
$.export("$summary", `Successfully retrieved ${questions.length} question${questions.length === 1
68+
? ""
69+
: "s"}`);
70+
}
71+
return questions;
72+
} catch {
73+
$.export("$summary", "No Questions found");
74+
}
75+
},
76+
};

0 commit comments

Comments
 (0)