-
Notifications
You must be signed in to change notification settings - Fork 5.5k
17945 trusted shops #18417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
17945 trusted shops #18417
Conversation
- Introduced new actions for managing reviews, including creating, deleting, and replying to reviews, as well as retrieving review details and statistics. - Added utility functions for parsing objects to enhance parameter handling. - Updated eTrusted app version to 0.1.0 and included a new constants file for configuration limits. - Enhanced prop definitions for better user input handling in actions.
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughAdds a full ETrusted integration: core app implementation with HTTP helpers, pagination, utilities/constants, multiple review-related actions (list, minimal list, get by ID, service rating, totals, create/get veto, save/delete reply), package metadata update, and minor EOF newline fixes. Changes
Sequence Diagram(s)sequenceDiagram
participant Action as Action
participant App as ETrusted App
participant API as ETrusted API
rect rgb(240,248,255)
note over Action,App: Paginated listing flow (async generator)
Action->>App: paginate(fn=getListOfReviews, params, maxResults)
App->>API: GET /reviews?{filters, cursor, LIMIT}
API-->>App: { items[], paging.cursor.after }
App-->>Action: yield items (repeat until no cursor or maxResults reached)
end
sequenceDiagram
participant Action as Action
participant App as ETrusted App
participant API as ETrusted API
rect rgb(245,255,240)
note over Action,App: Create Veto
Action->>App: createVetoForReview(reviewId, data)
App->>API: POST /reviews/veto { reviewId, comment, reason, vetoReporterEmail }
API-->>App: { id, ... }
App-->>Action: response
end
rect rgb(255,250,240)
note over Action,App: Get Veto
Action->>App: getReviewVetoByReviewId(reviewId)
App->>API: GET /reviews/veto/{reviewId}
API-->>App: veto / error
App-->>Action: response / {}
end
sequenceDiagram
participant Action as Action
participant App as ETrusted App
participant API as ETrusted API
rect rgb(250,245,255)
note over Action,App: Save Reply
Action->>App: saveReviewReply(reviewId, { comment, sendNotification? })
App->>API: POST /reviews/{reviewId}/reply
API-->>App: reply
App-->>Action: response
end
rect rgb(255,245,245)
note over Action,App: Delete Reply
Action->>App: deleteReviewReply(reviewId)
App->>API: DELETE /reviews/{reviewId}/reply
API-->>App: 204 / OK
App-->>Action: response
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🧪 Early access (Sonnet 4.5): enabledWe are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience. Note:
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (15)
components/common/constants.mjs (1)
1-1
: Confirm API page-size max; consider a clearer name.Please verify that 500 complies with eTrusted’s max allowed page size, otherwise requests may be rejected or truncated. Consider renaming to
DEFAULT_PAGE_LIMIT
to avoid ambiguity across apps.components/etrusted/common/utils.mjs (2)
2-3
: Don’t treat0
/false
as “unset”.
if (!obj)
coerces0
andfalse
to undefined. Tighten the check to only skipundefined | null | ""
.Apply:
- if (!obj) return undefined; + if (obj === undefined || obj === null || obj === "") return undefined;
4-15
: Optional: sanitize array items.If any array contains empty strings, you’ll emit
param=
with empty tokens after.join(",")
. Either filter here or at call sites.Would you like me to add an opt-in flag to
parseObject
tofilter(Boolean)
arrays?components/etrusted/actions/get-review-veto-by-review-id/get-review-veto-by-review-id.mjs (1)
24-25
: Summary wording: tie to input ID for reliability.Use the provided
reviewId
in the summary (response shape may vary).- $.export("$summary", `Successfully retrieved veto with ID ${response.id}`); + $.export("$summary", `Successfully retrieved veto for review ${this.reviewId}`);components/etrusted/actions/delete-review-reply/delete-review-reply.mjs (1)
6-6
: Fix description to match action behavior.Current text says “Reply to a review.” but this deletes a reply.
- description: "Reply to a review. [See the documentation](https://developers.etrusted.com/reference/deletereviewreply)", + description: "Deletes a reply to a review. [See the documentation](https://developers.etrusted.com/reference/deletereviewreply)",components/etrusted/actions/get-list-of-reviews/get-list-of-reviews.mjs (3)
83-83
: Grammar nit in user-facing description.Minor copy fix.
- description: "A list of additional pieces of information to be retrieved with the review. If this property is not set, none of the of additional information are included in the review.", + description: "A list of additional pieces of information to retrieve with the review. If unset, none of the additional information is included.",
131-145
: Filter empty tokens before joining multi-value params.Prevents sending
channels=,
or similar when users pass blanks.- channels: this.channelId && parseObject(this.channelId).join(","), + channels: this.channelId && parseObject(this.channelId).filter(Boolean).join(","), @@ - rating: this.rating && parseObject(this.rating).join(","), + rating: this.rating && parseObject(this.rating).filter(Boolean).join(","), - status: this.status && parseObject(this.status).join(","), + status: this.status && parseObject(this.status).filter(Boolean).join(","), - type: this.type && parseObject(this.type).join(","), + type: this.type && parseObject(this.type).filter(Boolean).join(","), @@ - additionalInformation: this.additionalInformation && parseObject(this.additionalInformation).join(","), + additionalInformation: this.additionalInformation && parseObject(this.additionalInformation).filter(Boolean).join(","), @@ - sku: this.sku && parseObject(this.sku).join(","), + sku: this.sku && parseObject(this.sku).filter(Boolean).join(","),
127-147
: Remove the unnecessaryawait
— makepaginate
usage consistent
paginate
is declared asasync *paginate
in components/etrusted/etrusted.app.mjs (returns an async iterable).
- components/etrusted/actions/get-list-of-reviews/get-list-of-reviews.mjs — uses
paginate
withoutawait
(correct).- components/etrusted/actions/get-list-of-reviews-with-fewer-properties/get-list-of-reviews-with-fewer-properties.mjs — currently uses
await this.etrusted.paginate(...)
(around line 117); remove theawait
and iterate the async iterable (e.g.,for await (...)
) to match the other action.components/etrusted/package.json (1)
3-17
: Confirm compatibility and add license
@pipedream/platform@3.1.0
is the latest; noengines
field is declared—verify it meets your runtime requirements.- Add a
license
field (e.g."MIT"
) topackage.json
for clarity.components/etrusted/actions/create-veto-for-review/create-veto-for-review.mjs (1)
33-38
: Expose optional channelName to match API payload.Docs show channelName in the request body; add it as an optional prop and pass it through. (developers.etrusted.com)
vetoReporterEmail: { type: "string", label: "Veto Reporter Email", description: "The E-Mail address of the veto reporter.", optional: true, }, + channelName: { + type: "string", + label: "Channel Name", + description: "Optional channel name to include with the veto.", + optional: true, + }, }, async run({ $ }) { const response = await this.etrusted.createVetoForReview({ $, reviewId: this.reviewId, data: { comment: this.comment, reason: this.reason, vetoReporterEmail: this.vetoReporterEmail, + channelName: this.channelName, }, });Also applies to: 45-48
components/etrusted/actions/get-list-of-reviews-with-fewer-properties/get-list-of-reviews-with-fewer-properties.mjs (2)
132-135
: Don’t send client-side maxResults as an API query param.maxResults is handled by paginate; remove it from params to avoid sending unknown query params.
orderBy: this.orderBy, - maxResults: this.maxResults, }, maxResults: this.maxResults,
132-132
: Normalize sku input (array or CSV) consistently.Align with other actions by supporting arrays via parseObject and joining to CSV.
- sku: this.sku, + sku: this.sku && (Array.isArray(parseObject(this.sku)) ? parseObject(this.sku).join(",") : this.sku),components/etrusted/etrusted.app.mjs (3)
220-223
: Let callers override page size when needed.Default to LIMIT only if count isn’t already set. (developers.etrusted.com)
- params.count = LIMIT; + params.count = params.count || LIMIT;
100-104
: Make SKU a multi-select to reflect “list of SKUs”.Prop says “list of product’s SKUs” but type is string. Prefer string[] to avoid per-action inconsistencies.
- sku: { - type: "string", + sku: { + type: "string[]", label: "SKU", - description: "list of product's SKUs. Be aware, that this parameter does only make sense for product reviews.", + description: "One or more product SKUs. This parameter only applies to product reviews.", },
39-44
: Fallback label for review options.Some reviews may lack a title; use id as a fallback to avoid empty option labels.
- options: items.map(({ - id: value, title: label, - }) => ({ - label, - value, - })), + options: items.map(({ id, title }) => ({ + label: title || id, + value: id, + })),
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (13)
components/common/constants.mjs
(1 hunks)components/etrusted/actions/create-veto-for-review/create-veto-for-review.mjs
(1 hunks)components/etrusted/actions/delete-review-reply/delete-review-reply.mjs
(1 hunks)components/etrusted/actions/get-list-of-reviews-with-fewer-properties/get-list-of-reviews-with-fewer-properties.mjs
(1 hunks)components/etrusted/actions/get-list-of-reviews/get-list-of-reviews.mjs
(1 hunks)components/etrusted/actions/get-review-by-id/get-review-by-id.mjs
(1 hunks)components/etrusted/actions/get-review-veto-by-review-id/get-review-veto-by-review-id.mjs
(1 hunks)components/etrusted/actions/get-service-review-rating/get-service-review-rating.mjs
(1 hunks)components/etrusted/actions/get-total-reviews/get-total-reviews.mjs
(1 hunks)components/etrusted/actions/save-review-reply/save-review-reply.mjs
(1 hunks)components/etrusted/common/utils.mjs
(1 hunks)components/etrusted/etrusted.app.mjs
(1 hunks)components/etrusted/package.json
(2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.
Applied to files:
components/etrusted/package.json
🧬 Code graph analysis (11)
components/etrusted/actions/get-list-of-reviews-with-fewer-properties/get-list-of-reviews-with-fewer-properties.mjs (2)
components/etrusted/actions/get-list-of-reviews/get-list-of-reviews.mjs (2)
response
(127-147)reviews
(149-149)components/etrusted/common/utils.mjs (2)
parseObject
(1-24)parseObject
(1-24)
components/etrusted/common/utils.mjs (1)
components/akeneo/akeneo.app.mjs (1)
JSON
(99-110)
components/etrusted/actions/get-review-veto-by-review-id/get-review-veto-by-review-id.mjs (2)
components/etrusted/actions/create-veto-for-review/create-veto-for-review.mjs (1)
response
(41-49)components/etrusted/actions/get-review-by-id/get-review-by-id.mjs (1)
response
(19-22)
components/etrusted/actions/get-review-by-id/get-review-by-id.mjs (4)
components/etrusted/actions/create-veto-for-review/create-veto-for-review.mjs (1)
response
(41-49)components/etrusted/actions/delete-review-reply/delete-review-reply.mjs (1)
response
(19-22)components/etrusted/actions/get-review-veto-by-review-id/get-review-veto-by-review-id.mjs (1)
response
(19-22)components/etrusted/actions/save-review-reply/save-review-reply.mjs (1)
response
(36-43)
components/etrusted/actions/get-total-reviews/get-total-reviews.mjs (2)
components/etrusted/actions/get-list-of-reviews/get-list-of-reviews.mjs (1)
response
(127-147)components/etrusted/common/utils.mjs (2)
parseObject
(1-24)parseObject
(1-24)
components/etrusted/actions/get-list-of-reviews/get-list-of-reviews.mjs (2)
components/etrusted/actions/get-list-of-reviews-with-fewer-properties/get-list-of-reviews-with-fewer-properties.mjs (2)
response
(117-137)reviews
(139-139)components/etrusted/common/utils.mjs (2)
parseObject
(1-24)parseObject
(1-24)
components/etrusted/actions/create-veto-for-review/create-veto-for-review.mjs (3)
components/etrusted/actions/delete-review-reply/delete-review-reply.mjs (1)
response
(19-22)components/etrusted/actions/get-review-veto-by-review-id/get-review-veto-by-review-id.mjs (1)
response
(19-22)components/etrusted/actions/save-review-reply/save-review-reply.mjs (1)
response
(36-43)
components/etrusted/actions/get-service-review-rating/get-service-review-rating.mjs (3)
components/etrusted/actions/delete-review-reply/delete-review-reply.mjs (1)
response
(19-22)components/etrusted/actions/get-review-by-id/get-review-by-id.mjs (1)
response
(19-22)components/etrusted/actions/get-total-reviews/get-total-reviews.mjs (1)
response
(85-99)
components/etrusted/etrusted.app.mjs (1)
components/common/constants.mjs (2)
LIMIT
(1-1)LIMIT
(1-1)
components/etrusted/actions/save-review-reply/save-review-reply.mjs (3)
components/etrusted/actions/create-veto-for-review/create-veto-for-review.mjs (1)
response
(41-49)components/etrusted/actions/delete-review-reply/delete-review-reply.mjs (1)
response
(19-22)components/etrusted/actions/get-review-by-id/get-review-by-id.mjs (1)
response
(19-22)
components/etrusted/actions/delete-review-reply/delete-review-reply.mjs (4)
components/etrusted/actions/create-veto-for-review/create-veto-for-review.mjs (1)
response
(41-49)components/etrusted/actions/get-review-by-id/get-review-by-id.mjs (1)
response
(19-22)components/etrusted/actions/get-review-veto-by-review-id/get-review-veto-by-review-id.mjs (1)
response
(19-22)components/etrusted/actions/save-review-reply/save-review-reply.mjs (1)
response
(36-43)
🔇 Additional comments (13)
components/etrusted/actions/get-review-veto-by-review-id/get-review-veto-by-review-id.mjs (1)
18-22
: LGTM.Action wiring to
getReviewVetoByReviewId
looks correct.components/etrusted/actions/get-review-by-id/get-review-by-id.mjs (1)
18-26
: LGTM.Straightforward call-through with clear summary.
components/etrusted/actions/delete-review-reply/delete-review-reply.mjs (1)
18-25
: LGTM.Correctly calls
deleteReviewReply
and exports a useful summary.components/etrusted/actions/get-list-of-reviews/get-list-of-reviews.mjs (2)
12-19
: PropDefinition vs. explicit type: confirm alignment.You declare
channelId
astype: "string[]"
while inheritingpropDefinition: [etrusted, "channelId"]
. Ensure the base definition supports multi-select to avoid UI/type mismatches.
154-157
: LGTM on summary with pluralization.Good UX touch.
components/etrusted/actions/get-service-review-rating/get-service-review-rating.mjs (1)
18-25
: LGTM.Clear mapping to
getServiceReviewRating
and concise summary.components/etrusted/actions/create-veto-for-review/create-veto-for-review.mjs (1)
40-49
: Endpoint usage LGTM.POST to /reviews/{reviewId}/vetos with the provided payload matches the official docs. (developers.etrusted.com)
components/etrusted/actions/save-review-reply/save-review-reply.mjs (2)
12-22
: Good constraint on selectable reviews.Limiting reviewId options to APPROVED and MODERATION statuses aligns with the API’s reply semantics.
35-43
: Request construction looks solid.Body matches the API’s expected fields; optional sendNotification is handled. (developers.etrusted.com)
components/etrusted/etrusted.app.mjs (4)
151-156
: Correct endpoint for minimal reviews./reviews-minimal is the documented path for the “fewer properties” list. (developers.etrusted.com)
165-171
: Correct endpoint for service review rating./channels/{channelId}/service-reviews/aggregate-rating matches docs. (developers.etrusted.com)
173-181
: Correct endpoint for creating vetos.POST /reviews/{reviewId}/vetos is per docs (note the spelling “vetos”). (developers.etrusted.com)
182-189
: Correct endpoint for retrieving review veto by review ID.GET /reviews/{reviewId}/vetos is per docs. (developers.etrusted.com)
components/etrusted/actions/get-total-reviews/get-total-reviews.mjs
Outdated
Show resolved
Hide resolved
- Updated import path for constants to reflect new file location. - Added a new constants file defining the LIMIT value for configuration.
- Updated parameter assignments in get-list-of-reviews and get-total-reviews actions to use optional chaining for improved safety and readability. - Simplified the logic for parsing channel, rating, status, type, additional information, and SKU parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
components/etrusted/actions/get-list-of-reviews/get-list-of-reviews.mjs
(1 hunks)components/etrusted/actions/get-total-reviews/get-total-reviews.mjs
(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
components/etrusted/actions/get-list-of-reviews/get-list-of-reviews.mjs (3)
components/etrusted/actions/get-total-reviews/get-total-reviews.mjs (1)
response
(85-99)components/etrusted/actions/get-list-of-reviews-with-fewer-properties/get-list-of-reviews-with-fewer-properties.mjs (2)
response
(117-137)reviews
(139-139)components/etrusted/common/utils.mjs (2)
parseObject
(1-24)parseObject
(1-24)
components/etrusted/actions/get-total-reviews/get-total-reviews.mjs (1)
components/etrusted/common/utils.mjs (2)
parseObject
(1-24)parseObject
(1-24)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: pnpm publish
🔇 Additional comments (1)
components/etrusted/actions/get-total-reviews/get-total-reviews.mjs (1)
88-98
: Guard against callingjoin()
on non-arrays in query params.
parseObject(...)
can legitimately return a plain string (e.g. when the user enters a single SKU/channel in the UI). In that case,parseObject(...)? .join(",")
still attempts to invokejoin
on a string and throws at runtime, breaking the action. Please normalize the parsed value before joining so we only calljoin
on arrays and pass strings through untouched.async run({ $ }) { + const toCsv = (value) => { + const parsed = parseObject(value); + if (parsed == null) return undefined; + return Array.isArray(parsed) + ? parsed.join(",") + : parsed; + }; + const response = await this.etrusted.getTotalReviews({ $, params: { - channels: parseObject(this.channelId)?.join(","), + channels: toCsv(this.channelId), submittedAfter: this.submittedAfter, submittedBefore: this.submittedBefore, - rating: parseObject(this.rating)?.join(","), - status: parseObject(this.status)?.join(","), - type: parseObject(this.type)?.join(","), + rating: toCsv(this.rating), + status: toCsv(this.status), + type: toCsv(this.type), hasReply: this.hasReply, ignoreStatements: this.ignoreStatements, query: this.query, - sku: parseObject(this.sku)?.join(","), + sku: toCsv(this.sku), }, });
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
components/etrusted/actions/create-veto-for-review/create-veto-for-review.mjs
(1 hunks)components/etrusted/actions/get-review-veto-by-review-id/get-review-veto-by-review-id.mjs
(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
components/etrusted/actions/get-review-veto-by-review-id/get-review-veto-by-review-id.mjs (3)
components/etrusted/actions/create-veto-for-review/create-veto-for-review.mjs (1)
response
(40-48)components/etrusted/actions/delete-review-reply/delete-review-reply.mjs (1)
response
(19-22)components/etrusted/actions/get-review-by-id/get-review-by-id.mjs (1)
response
(19-22)
components/etrusted/actions/create-veto-for-review/create-veto-for-review.mjs (2)
components/etrusted/actions/get-review-veto-by-review-id/get-review-veto-by-review-id.mjs (1)
response
(20-23)components/etrusted/actions/save-review-reply/save-review-reply.mjs (1)
response
(36-43)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
- GitHub Check: pnpm publish
- GitHub Check: Lint Code Base
🔇 Additional comments (3)
components/etrusted/actions/create-veto-for-review/create-veto-for-review.mjs (3)
1-1
: LGTM!The import statement follows the standard pattern for Pipedream action modules.
3-8
: LGTM!The action metadata is complete and follows Pipedream conventions with appropriate key, name, description with documentation link, version, and type.
39-52
: No changes needed:response.id
is guaranteed by the API response.
components/etrusted/actions/create-veto-for-review/create-veto-for-review.mjs
Show resolved
Hide resolved
components/etrusted/actions/create-veto-for-review/create-veto-for-review.mjs
Show resolved
Hide resolved
components/etrusted/actions/get-review-veto-by-review-id/get-review-veto-by-review-id.mjs
Show resolved
Hide resolved
components/etrusted/actions/get-review-veto-by-review-id/get-review-veto-by-review-id.mjs
Show resolved
Hide resolved
/approve |
Resolves #17945
Summary by CodeRabbit