Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/fraudlabs_pro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/fraudlabs_pro",
"version": "1.0.0",
"version": "1.0.1",
"description": "Pipedream Fraudlabs_pro Components",
"main": "fraudlabs_pro.app.mjs",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import fraudlabsProApp from "../../fraudlabs_pro.app.mjs";

export default {
name: "Status Changed (Instant)",

Check warning on line 4 in components/fraudlabs_pro/sources/status-changed/status-changed.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Source names should start with "New". See https://pipedream.com/docs/components/guidelines/#source-name
description: "Emit new events when the status of an order changes in FraudLabs Pro. [See the documentation](https://www.fraudlabspro.com/developer/webhook)",
version: "0.0.2",
version: "0.0.3",
key: "fraudlabs_pro-status-changed",
type: "source",
dedupe: "unique",
Expand Down Expand Up @@ -74,6 +74,9 @@
return;
}

const orderId = body.user_order_id ?? body.order_id;
const flpStatus = body.fraudlabspro_status ?? body.flp_status;

// Emit the data so it can be used in workflow steps. With `dedupe: "unique"`
// the id must be stable (no Date.now()) and capped at 64 chars; ts prefers
// the API event time and falls back to now only when it is missing.
Expand All @@ -84,10 +87,10 @@
const ts = Number.isFinite(parsedTs)
? parsedTs
: Date.now();
const id = `${body.order_id}-${body.flp_status}-${eventTime ?? JSON.stringify(body)}`.slice(0, 64);
const id = `${orderId}-${flpStatus}-${eventTime ?? JSON.stringify(body)}`.slice(0, 64);

this.$emit(body, {
summary: `New Status: ${body.flp_status} for Order #${body.order_id}`,
summary: `New Status: ${flpStatus} for Order #${orderId}`,
Comment thread
coderabbitai[bot] marked this conversation as resolved.
id,
ts,
});
Expand Down
Loading