Skip to content

Commit ed7c5ba

Browse files
authored
[Components] bluecart_api #10915 (#19022)
* Added actions * Added actions
1 parent e26745a commit ed7c5ba

File tree

42 files changed

+169
-38
lines changed

Some content is hidden

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

42 files changed

+169
-38
lines changed

components/api2convert/api2convert.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/apiframe/apiframe.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import app from "../../bluecart_api.app.mjs";
2+
3+
export default {
4+
key: "bluecart_api-get-autocomplete",
5+
name: "Get Autocomplete",
6+
description: "Get autocomplete suggestions for the specified search term. [See the documentation](https://docs.trajectdata.com/bluecartapi/walmart-product-data-api/parameters/autocomplete)",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: true,
12+
},
13+
type: "action",
14+
props: {
15+
app,
16+
walmartDomain: {
17+
propDefinition: [
18+
app,
19+
"walmartDomain",
20+
],
21+
},
22+
searchTerm: {
23+
propDefinition: [
24+
app,
25+
"searchTerm",
26+
],
27+
description: "The search term to get autocomplete suggestions for",
28+
},
29+
},
30+
async run({ $ }) {
31+
const response = await this.app.getAutocomplete({
32+
$,
33+
params: {
34+
searchTerm: this.searchTerm,
35+
type: "autocomplete",
36+
},
37+
});
38+
$.export("$summary", "Successfully retrieved " + response.autocomplete_results.length + " suggestions");
39+
return response;
40+
},
41+
};
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import app from "../../bluecart_api.app.mjs";
2+
3+
export default {
4+
key: "bluecart_api-get-categories",
5+
name: "Get Categories",
6+
description: "Get a list of categories related to the provided search term. [See the documentation](https://docs.trajectdata.com/bluecartapi/walmart-product-data-api/parameters/category)",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: true,
12+
},
13+
type: "action",
14+
props: {
15+
app,
16+
searchTerm: {
17+
propDefinition: [
18+
app,
19+
"searchTerm",
20+
],
21+
description: "The term used to search for categories",
22+
},
23+
},
24+
async run({ $ }) {
25+
const response = await this.app.getCategories({
26+
$,
27+
params: {
28+
search_term: this.searchTerm,
29+
},
30+
});
31+
$.export("$summary", "Successfully retrieved " + response.categories.length + " categories");
32+
return response;
33+
},
34+
};
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import app from "../../bluecart_api.app.mjs";
2+
3+
export default {
4+
key: "bluecart_api-get-product",
5+
name: "Get product",
6+
description: "Get product data from Walmart. [See the documentation](https://docs.trajectdata.com/bluecartapi/walmart-product-data-api/parameters/product)",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: true,
12+
},
13+
type: "action",
14+
props: {
15+
app,
16+
walmartDomain: {
17+
propDefinition: [
18+
app,
19+
"walmartDomain",
20+
],
21+
},
22+
url: {
23+
propDefinition: [
24+
app,
25+
"url",
26+
],
27+
},
28+
itemId: {
29+
propDefinition: [
30+
app,
31+
"itemId",
32+
],
33+
},
34+
},
35+
36+
async run({ $ }) {
37+
const response = await this.app.searchItem({
38+
$,
39+
params: {
40+
walmart_domain: this.walmartDomain,
41+
type: "product",
42+
item_id: this.itemId,
43+
url: this.url,
44+
},
45+
});
46+
47+
$.export("$summary", "Successfully retrieved data for the product with id: " + response.product.item_id);
48+
return response;
49+
},
50+
};

components/bluecart_api/bluecart_api.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
DOMAIN_OPTIONS: [
3+
"walmart.com",
4+
"walmart.ca",
5+
],
6+
};

components/bluecart_api/package.json

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

components/brand_dev/brand_dev.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/chroma_cloud/chroma_cloud.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

0 commit comments

Comments
 (0)