Skip to content

Commit b9a328b

Browse files
committed
pexels init
1 parent 159d440 commit b9a328b

File tree

120 files changed

+19674
-4
lines changed

Some content is hidden

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

120 files changed

+19674
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import pexels from "../../pexels.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
import fs from "fs";
4+
5+
export default {
6+
key: "pexels-download-photo",
7+
name: "Download Photo",
8+
description: "Download a specific photo by providing its photo ID and optionally choosing the desired size. [See the documentation](https://www.pexels.com/api/documentation/)",
9+
version: "0.0.1",
10+
type: "action",
11+
props: {
12+
pexels,
13+
photoId: {
14+
propDefinition: [
15+
pexels,
16+
"photoId",
17+
],
18+
},
19+
desiredSize: {
20+
propDefinition: [
21+
pexels,
22+
"desiredSize",
23+
],
24+
},
25+
},
26+
async run({ $ }) {
27+
const filePath = await this.pexels.downloadPhoto({
28+
photoId: this.photoId,
29+
desiredSize: this.desiredSize,
30+
});
31+
32+
$.export("$summary", `Successfully downloaded photo with ID ${this.photoId} to ${filePath}`);
33+
return {
34+
filePath,
35+
};
36+
},
37+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import pexels from "../../pexels.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "pexels-get-photo-details",
6+
name: "Get Photo Details",
7+
description: "Retrieve detailed information about a specific photo by providing its photo ID. [See the documentation](https://www.pexels.com/api/documentation/)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
pexels,
12+
photoId: {
13+
propDefinition: [
14+
pexels,
15+
"photoId",
16+
],
17+
},
18+
},
19+
async run({ $ }) {
20+
const response = await this.pexels.getPhoto({
21+
photoId: this.photoId,
22+
});
23+
$.export("$summary", `Successfully retrieved details for photo ID: ${this.photoId}`);
24+
return response;
25+
},
26+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import pexels from "../../pexels.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "pexels-search-photos",
6+
name: "Search Photos",
7+
description: "Search for photos on Pexels using a keyword or phrase. [See the documentation](https://www.pexels.com/api/documentation/)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
pexels,
12+
searchQuery: {
13+
propDefinition: [
14+
pexels,
15+
"searchQuery",
16+
],
17+
},
18+
orientation: {
19+
propDefinition: [
20+
pexels,
21+
"orientation",
22+
],
23+
},
24+
size: {
25+
propDefinition: [
26+
pexels,
27+
"size",
28+
],
29+
},
30+
color: {
31+
propDefinition: [
32+
pexels,
33+
"color",
34+
],
35+
},
36+
},
37+
async run({ $ }) {
38+
const response = await this.pexels.searchPhotos({
39+
query: this.searchQuery,
40+
orientation: this.orientation,
41+
size: this.size,
42+
color: this.color,
43+
});
44+
45+
$.export("$summary", `Successfully retrieved ${response.photos.length} photos for the query "${this.searchQuery}".`);
46+
return response;
47+
},
48+
};

components/pexels/node_modules/@pipedream/platform/.eslintignore

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

components/pexels/node_modules/@pipedream/platform/LICENSE

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

components/pexels/node_modules/@pipedream/platform/README.md

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

0 commit comments

Comments
 (0)