Skip to content

Commit 961dd55

Browse files
Afstklaclaudecoderabbitai[bot]
authored andcommitted
trustpilot fixes (PipedreamHQ#18152)
* trustpilot fixes * more fixes * update versions * more version updates * fixes * Bump all Trustpilot actions to version 0.1.0 Major improvements and API updates across all actions: - Enhanced private API support with proper authentication - Improved parameter handling and validation - Better error handling and response structures - Added new conversation flow for product reviews - Fixed endpoint URLs to match latest API documentation - Streamlined request/response processing 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * up version and clean up sources * merge * fix business ID * delete temp action * Update components/trustpilot/sources/new-product-reviews/new-product-reviews.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update components/trustpilot/sources/new-product-reviews/new-product-reviews.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update components/trustpilot/sources/new-product-reviews/new-product-reviews.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update components/trustpilot/sources/new-service-reviews/new-service-reviews.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * comments * Pagination * fixes * comments * missed some `$`'s * unduplicated * more fixes * final comments * more comments * . --------- Co-authored-by: Claude <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent fc90f7b commit 961dd55

File tree

30 files changed

+1116
-1321
lines changed

30 files changed

+1116
-1321
lines changed

components/etrusted/etrusted.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/financial_data/financial_data.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/intelliflo_office/intelliflo_office.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/kordiam/kordiam.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/lightspeed_ecom_c_series/lightspeed_ecom_c_series.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/microsoft_authenticator/microsoft_authenticator.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/rundeck/rundeck.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/thoughtspot/thoughtspot.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/ticketsauce/ticketsauce.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/trustpilot/actions/fetch-product-review-by-id/fetch-product-review-by-id.mjs

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
import trustpilot from "../../trustpilot.app.mjs";
2+
import { makeRequest } from "../../common/api-client.mjs";
3+
import { ENDPOINTS } from "../../common/constants.mjs";
4+
import {
5+
buildUrl,
6+
parseProductReview,
7+
validateReviewId,
8+
} from "../../common/utils.mjs";
29

310
export default {
411
key: "trustpilot-fetch-product-review-by-id",
512
name: "Fetch Product Review by ID",
613
description: "Retrieves detailed information about a specific product review on Trustpilot. Use this action to get comprehensive data about a single product review, including customer feedback, star rating, review text, and metadata. Perfect for analyzing individual customer experiences, responding to specific feedback, or integrating review data into your customer service workflows. [See the documentation](https://developers.trustpilot.com/product-reviews-api#get-private-product-review)",
7-
version: "0.0.3",
14+
version: "0.1.0",
815
type: "action",
916
props: {
1017
trustpilot,
@@ -18,11 +25,28 @@ export default {
1825
async run({ $ }) {
1926
const { reviewId } = this;
2027

28+
// Validate required parameters
29+
if (!reviewId) {
30+
throw new Error("Review ID is required");
31+
}
32+
if (!validateReviewId(reviewId)) {
33+
throw new Error("Invalid review ID format");
34+
}
35+
2136
try {
22-
const review = await this.trustpilot.getProductReviewById({
37+
// Build the endpoint URL
38+
const endpoint = buildUrl(ENDPOINTS.PRIVATE_PRODUCT_REVIEW_BY_ID, {
2339
reviewId,
2440
});
2541

42+
// Make the API request
43+
const response = await makeRequest($, this.trustpilot, {
44+
endpoint,
45+
});
46+
47+
// Parse the product review with the correct parser
48+
const review = parseProductReview(response);
49+
2650
$.export("$summary", `Successfully fetched product review ${reviewId}`);
2751

2852
return {

0 commit comments

Comments
 (0)