Skip to content
Open
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
77 changes: 77 additions & 0 deletions components/etermin/actions/create-contact/create-contact.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import app from "../../etermin.app.mjs";

export default {
key: "etermin-create-contact",
name: "Create Contact",
description: "Create a new contact on eTermin. [See the documentation](https://app.swaggerhub.com/apis/etermin.net/eTermin-API/1.0.0#/Contact/post_contact)",
version: "0.0.1",
type: "action",
props: {
app,
updateWhenExistsgdt: {
propDefinition: [
app,
"updateWhenExistsgdt",
],
},
salutation: {
propDefinition: [
app,
"salutation",
],
},
title: {
propDefinition: [
app,
"title",
],
},
lastname: {
propDefinition: [
app,
"lastName",
],
},
firstname: {
propDefinition: [
app,
"firstName",
],
},
company: {
propDefinition: [
app,
"company",
],
},
birthday: {
propDefinition: [
app,
"birthday",
],
},
email: {
propDefinition: [
app,
"email",
],
},
},
async run({ $ }) {
const response = await this.app.createContact({
$,
params: {
updatewhenexistsgdt: this.updateWhenExistsgdt,
salutation: this.salutation,
title: this.title,
lastname: this.lastName,
firstname: this.firstName,
company: this.company,
birthday: this.birthday,
email: this.email,
Comment on lines +64 to +71
Copy link
Contributor

@coderabbitai coderabbitai bot Sep 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Wrong identifiers: last/first name come through as undefined.

Props are lastname/firstname (lowercase), but you reference this.lastName/this.firstName.

Apply this diff:

-        lastname: this.lastName,
-        firstname: this.firstName,
+        lastname: this.lastname,
+        firstname: this.firstname,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
updatewhenexistsgdt: this.updateWhenExistsgdt,
salutation: this.salutation,
title: this.title,
lastname: this.lastName,
firstname: this.firstName,
company: this.company,
birthday: this.birthday,
email: this.email,
updatewhenexistsgdt: this.updateWhenExistsgdt,
salutation: this.salutation,
title: this.title,
lastname: this.lastname,
firstname: this.firstname,
company: this.company,
birthday: this.birthday,
email: this.email,
🤖 Prompt for AI Agents
In components/etermin/actions/create-contact/create-contact.mjs around lines 64
to 71, the code references this.lastName and this.firstName but the incoming
props are named lastname and firstname (lowercase), causing undefined values;
update the object to use this.lastname and this.firstname (and search/replace
any other occurrences in this file to match the prop casing) so the correct
values are passed through.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with coderabbit. The props are firstname and lastname.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michelle0927 Thank you for confirming! You're absolutely right - the props are indeed defined as firstname and lastname (lowercase), so the references in the run method should match that casing to ensure the correct values are passed through to the API.

The fix CodeRabbit suggested will resolve the undefined values issue and ensure the contact creation works as intended.

🐰✨
╭─────╮
│ ^ ^ │
│ ◡ │ confirmed!
╰─────╯


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

Comment on lines +64 to +71
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix broken mappings for last/first name.

Props are lastname/firstname; mapping references this.lastName/this.firstName, causing undefined fields sent to API.

       params: {
         updatewhenexistsgdt: this.updateWhenExistsgdt,
         salutation: this.salutation,
         title: this.title,
-        lastname: this.lastName,
-        firstname: this.firstName,
+        lastname: this.lastname,
+        firstname: this.firstname,
         company: this.company,
         birthday: this.birthday,
         email: this.email,
       },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
updatewhenexistsgdt: this.updateWhenExistsgdt,
salutation: this.salutation,
title: this.title,
lastname: this.lastName,
firstname: this.firstName,
company: this.company,
birthday: this.birthday,
email: this.email,
updatewhenexistsgdt: this.updateWhenExistsgdt,
salutation: this.salutation,
title: this.title,
lastname: this.lastname,
firstname: this.firstname,
company: this.company,
birthday: this.birthday,
email: this.email,
🤖 Prompt for AI Agents
In components/etermin/actions/create-contact/create-contact.mjs around lines
64-71 the mapping uses this.lastName and this.firstName but the component props
are named lastname and firstname; change the mappings to use this.lastname and
this.firstname (and verify casing consistently across the file), so lastname:
this.lastname and firstname: this.firstname are sent to the API.

},
});
$.export("$summary", "Successfully created the new contact");
return response;
},
};
71 changes: 71 additions & 0 deletions components/etermin/actions/create-voucher/create-voucher.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import app from "../../etermin.app.mjs";

export default {
key: "etermin-create-voucher",
name: "Create Voucher",
description: "Create a new voucher on eTermin. [See the documentation](https://app.swaggerhub.com/apis/etermin.net/eTermin-API/1.0.0#/Voucher/post_api_voucher)",
version: "0.0.1",
type: "action",
props: {
app,
id: {
propDefinition: [
app,
"id",
],
},
description: {
propDefinition: [
app,
"description",
],
},
priceInclVat: {
propDefinition: [
app,
"priceInclVat",
],
},
isPercentage: {
propDefinition: [
app,
"isPercentage",
],
},
customerEmail: {
Comment on lines +23 to +35
Copy link
Contributor

@coderabbitai coderabbitai bot Sep 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add missing priceOriginal prop to match payload.

If the API expects priceoriginal, expose a priceOriginal prop wired to the app.

Apply this diff (insert after priceInclVat):

     priceInclVat: {
       propDefinition: [
         app,
         "priceInclVat",
       ],
     },
+    priceOriginal: {
+      propDefinition: [
+        app,
+        "priceOriginal",
+      ],
+    },

Note: You'll also need to add priceOriginal to propDefinitions in etermin.app.mjs (see separate comment).

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
priceInclVat: {
propDefinition: [
app,
"priceInclVat",
],
},
isPercentage: {
propDefinition: [
app,
"isPercentage",
],
},
customerEmail: {
priceInclVat: {
propDefinition: [
app,
"priceInclVat",
],
},
priceOriginal: {
propDefinition: [
app,
"priceOriginal",
],
},
isPercentage: {
propDefinition: [
app,
"isPercentage",
],
},
customerEmail: {
🤖 Prompt for AI Agents
In components/etermin/actions/create-voucher/create-voucher.mjs around lines 23
to 35, the action props are missing a priceOriginal mapping required by the API;
insert a new priceOriginal property immediately after priceInclVat that wires to
the app propDefinition (propDefinition: [app, "priceOriginal"]). Also update
propDefinitions in etermin.app.mjs to include priceOriginal so the app exposes
that prop key to actions.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with coderabbit. Prop priceOriginal is missing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michelle0927 Thank you for confirming! Yes, the priceOriginal prop is missing and needs to be added to match the API payload requirements. The action currently references priceoriginal in the run method but doesn't expose it as a prop for users to configure.

propDefinition: [
app,
"customerEmail",
],
},
validFrom: {
propDefinition: [
app,
"validFrom",
],
},
validUntil: {
propDefinition: [
app,
"validUntil",
],
},
},
async run({ $ }) {
const response = await this.app.createVoucher({
$,
params: {
id: this.id,
description: this.description,
priceinclvat: this.priceInClvat,
priceoriginal: this.priceOriginal,
Comment on lines +60 to +61
Copy link
Contributor

@coderabbitai coderabbitai bot Sep 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Broken payload mapping: typo and missing prop.

  • this.priceInClvat is a typo; should be this.priceInclVat.
  • priceoriginal references this.priceOriginal, but there’s no priceOriginal prop defined here (or in the app).

Apply this diff:

-        priceinclvat: this.priceInClvat,
-        priceoriginal: this.priceOriginal,
+        priceinclvat: this.priceInclVat,
+        // priceoriginal requires a prop; see follow-up comment to add it in app + action
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
priceinclvat: this.priceInClvat,
priceoriginal: this.priceOriginal,
priceinclvat: this.priceInclVat,
// priceoriginal requires a prop; see follow-up comment to add it in app + action
🤖 Prompt for AI Agents
In components/etermin/actions/create-voucher/create-voucher.mjs around lines
60-61, fix the broken payload mapping: correct the typo by mapping priceinclvat
to this.priceInclVat (not this.priceInClvat), and ensure priceoriginal is mapped
from a real source — either add a component prop named priceOriginal and map
priceoriginal: this.priceOriginal, or compute/derive the original price here and
use that value; update the component's props/initialization accordingly so the
referenced property actually exists.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with coderabbit. Need to fix typo in priceInclVat.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if priceOriginal is defined in the app propDefinitions
cat components/etermin/etermin.app.mjs | grep -A5 -B5 "priceOriginal"

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Check what propDefinitions are available in the app file
cat components/etermin/etermin.app.mjs

Length of output: 3097


@michelle0927 Thank you for confirming! You're absolutely right about the typo.

I've checked the app file and confirmed there are two issues that need fixing:

  1. Typo confirmed: this.priceInClvat should be this.priceInclVat
  2. Missing prop: this.priceOriginal doesn't exist in the app's propDefinitions

Looking at the available propDefinitions, I only see these voucher-related props:

  • id, description, priceInclVat, isPercentage, customerEmail, validFrom, validUntil

For the priceoriginal parameter, you have a few options:

Option 1: Add a priceOriginal propDefinition to the app file
Option 2: Remove the priceoriginal parameter if it's not required by the API
Option 3: Compute it from priceInclVat if there's a relationship (e.g., original = inclVat / (1 + vatRate))

Could you clarify what the priceoriginal parameter should represent and how you'd like to handle it? I can help implement whichever approach you prefer.

// Current broken code:
priceinclvat: this.priceInClvat,        // typo
priceoriginal: this.priceOriginal,      // missing prop

// Fix for typo:
priceinclvat: this.priceInclVat,        // ✅
// Still need to decide what to do with priceoriginal

ispercentage: this.isPercentage,
customeremail: this.customerEmail,
validfrom: this.validFrom,
validuntil: this.validUntil,
},
Comment on lines +60 to +66
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

🧩 Analysis chain

Fix typos and remove/define missing fields to prevent runtime errors.

  • this.priceInClvatthis.priceInclVat (typo).
  • this.priceOriginal is not defined in props/app; either add its propDefinition or drop it.
  • Consider normalizing boolean to 0/1 if API expects numeric.
       params: {
         id: this.id,
         description: this.description,
-        priceinclvat: this.priceInClvat,
-        priceoriginal: this.priceOriginal,
-        ispercentage: this.isPercentage,
+        priceinclvat: this.priceInclVat,
+        // priceoriginal: this.priceOriginal, // Uncomment only if you add a prop and API requires it
+        ispercentage: this.isPercentage ? 1 : 0,
         customeremail: this.customerEmail,
         validfrom: this.validFrom,
         validuntil: this.validUntil,
       },

🏁 Script executed:

#!/bin/bash
# Find other typos/mismatches
rg -n -C1 'priceInClvat|priceOriginal|priceoriginal|priceinclvat|ispercentage|customeremail|validfrom|validuntil' components/etermin

Length of output: 799


🌐 Web query:

Does eTermin’s voucher API require `priceoriginal`? If yes, what’s its exact name and type?

💡 Result:

Short answer: No — eTermin’s voucher endpoints do not use a field called priceoriginal. eTermin’s docs/Integrations show voucher fields like "Price (incl. VAT)" / "Price Incl. VAT" when creating vouchers (e.g., in eTermin support articles and the Zapier eTermin "Create Voucher" action). [1][2]

Sources:

  • eTermin support: creating/selling vouchers (shows voucher price/price incl. VAT). [1]
  • Zapier eTermin integration (Create Voucher action lists "Price Incl. VAT"). [2]

Fix typo, remove unused field, and optionally normalize boolean in create-voucher.

  • File: components/etermin/actions/create-voucher/create-voucher.mjs (lines 60–66): change this.priceInClvat → this.priceInclVat; drop priceoriginal (eTermin voucher API does not use priceOriginal); send ispercentage as 0/1 only if the API requires numeric flags.
       params: {
         id: this.id,
         description: this.description,
-        priceinclvat: this.priceInClvat,
-        priceoriginal: this.priceOriginal,
-        ispercentage: this.isPercentage,
+        priceinclvat: this.priceInclVat,
+        // priceoriginal: this.priceOriginal, // remove unless you add a prop and API requires it
+        ispercentage: this.isPercentage ? 1 : 0, // use numeric only if API expects it
         customeremail: this.customerEmail,
         validfrom: this.validFrom,
         validuntil: this.validUntil,
       },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
priceinclvat: this.priceInClvat,
priceoriginal: this.priceOriginal,
ispercentage: this.isPercentage,
customeremail: this.customerEmail,
validfrom: this.validFrom,
validuntil: this.validUntil,
},
priceinclvat: this.priceInclVat,
// priceoriginal: this.priceOriginal, // remove unless you add a prop and API requires it
ispercentage: this.isPercentage ? 1 : 0, // use numeric only if API expects it
customeremail: this.customerEmail,
validfrom: this.validFrom,
validuntil: this.validUntil,
},
🤖 Prompt for AI Agents
In components/etermin/actions/create-voucher/create-voucher.mjs around lines 60
to 66, fix the typo and unused field: rename this.priceInClvat to
this.priceInclVat, remove the priceoriginal property entirely (eTermin API
doesn't use it), and normalize ispercentage to the API-expected numeric flag by
sending (this.isPercentage ? 1 : 0) instead of a raw boolean.

});
Comment on lines +55 to +67
Copy link
Contributor

@coderabbitai coderabbitai bot Sep 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

🧩 Analysis chain

PII in query string; send body as JSON instead.

POSTing customer data via params puts PII in URLs/logs. Prefer data.

Apply this diff:

-    const response = await this.app.createVoucher({
-      $,
-      params: {
+    const response = await this.app.createVoucher({
+      $,
+      data: {
         id: this.id,
         description: this.description,
-        priceinclvat: this.priceInClvat,
-        priceoriginal: this.priceOriginal,
+        priceinclvat: this.priceInclVat,
+        ...(this.priceOriginal != null ? { priceoriginal: this.priceOriginal } : {}),
         ispercentage: this.isPercentage,
         customeremail: this.customerEmail,
         validfrom: this.validFrom,
         validuntil: this.validUntil,
       },
     });

Confirm the eTermin endpoint accepts JSON; if it requires form-encoded, set headers: { "Content-Type": "application/x-www-form-urlencoded" } and send a serialized body.


🏁 Script executed:

#!/bin/bash
# Search for the definition and implementation of createVoucher in the codebase
rg -nP "\bcreateVoucher\b" -n -C3 .

Length of output: 1036


🏁 Script executed:

#!/bin/bash
sed -n '1,260p' components/etermin/etermin.app.mjs

Length of output: 3097


🏁 Script executed:

#!/bin/bash
rg -n "swagger" -i -C3 .
rg -n "openapi" -i -C3 .
rg -n "docs" -i -C3 .

Length of output: 265540


🏁 Script executed:

#!/bin/bash
# Fetch eTermin API spec and inspect /voucher POST request details
curl -s https://api.swaggerhub.com/apis/etermin.net/eTermin-API/1.0.0/swagger.json \
  | jq '.paths["/voucher"].post | {parameters, requestBody}'

Length of output: 47


🏁 Script executed:

#!/bin/bash
set -euo pipefail
echo "Dumping /voucher path from SwaggerHub JSON (if present)..."
curl -sS "https://api.swaggerhub.com/apis/etermin.net/eTermin-API/1.0.0/swagger.json" -o /tmp/etermin_swagger.json || true
jq 'paths | map(tostring) | .[]' /tmp/etermin_swagger.json | head -n 20 || true
echo "--- Searching for 'voucher' in swagger JSON ---"
jq '.. | objects | select(has("paths") or has("components"))' /tmp/etermin_swagger.json | head -n 1 || true
jq '.. | select(type=="object" and (.path? // .) | tostring | test("voucher"; "i") )' /tmp/etermin_swagger.json | jq -c '.' | head -n 10 || true
echo "--- Full /voucher entry (if exists) ---"
jq '.paths["/voucher"]' /tmp/etermin_swagger.json || true
echo "--- All paths containing voucher ---"
jq 'keys[] as $k | select($k | test("voucher"; "i")) | $k' /tmp/etermin_swagger.json.paths || true

Length of output: 456


🏁 Script executed:

#!/bin/bash
sed -n '1,240p' components/etermin/actions/create-voucher/create-voucher.mjs

Length of output: 1503


Move PII out of the query string — send POST body (data) and fix typos

  • File: components/etermin/actions/create-voucher/create-voucher.mjs (run() — lines ~55-67). Replace params with data so customerEmail (PII) is sent in the request body, not the URL. Fix variable typos (this.priceInClvat → this.priceInclVat) and remove/define priceOriginal (currently not a prop).
  • Suggested patch (keeps API field names, moves payload to body, makes priceoriginal optional):
-    const response = await this.app.createVoucher({
-      $,
-      params: {
+    const response = await this.app.createVoucher({
+      $,
+      data: {
         id: this.id,
         description: this.description,
-        priceinclvat: this.priceInClvat,
-        priceoriginal: this.priceOriginal,
+        priceinclvat: this.priceInclVat,
+        ...(this.priceOriginal != null ? { priceoriginal: this.priceOriginal } : {}),
         ispercentage: this.isPercentage,
         customeremail: this.customerEmail,
         validfrom: this.validFrom,
         validuntil: this.validUntil,
       },
     });
  • I could not find a requestBody definition for /voucher in the SwaggerHub JSON (swagger.json returned null for /voucher). Verify the eTermin endpoint accepts JSON; if it requires form-encoded data, set headers: { "Content-Type": "application/x-www-form-urlencoded" } and send a serialized body instead.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const response = await this.app.createVoucher({
$,
params: {
id: this.id,
description: this.description,
priceinclvat: this.priceInClvat,
priceoriginal: this.priceOriginal,
ispercentage: this.isPercentage,
customeremail: this.customerEmail,
validfrom: this.validFrom,
validuntil: this.validUntil,
},
});
const response = await this.app.createVoucher({
$,
data: {
id: this.id,
description: this.description,
priceinclvat: this.priceInclVat,
...(this.priceOriginal != null ? { priceoriginal: this.priceOriginal } : {}),
ispercentage: this.isPercentage,
customeremail: this.customerEmail,
validfrom: this.validFrom,
validuntil: this.validUntil,
},
});

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with coderabbit. Need to send data instead of params.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michelle0927 Thank you for confirming! Yes, sending customer email and other sensitive data via query parameters (params) would expose PII in URLs and logs, which is a security concern. Moving to data will send the payload in the request body as intended for POST requests.

The suggested fix also resolves the typos (priceInClvatpriceInclVat) and handles the undefined priceOriginal property appropriately by making it optional.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

$.export("$summary", "Successfully created the new voucher");
return response;
},
};
6 changes: 6 additions & 0 deletions components/etermin/common/constants.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
UPDATE_OPTIONS: [
1,
2,
],
};
120 changes: 116 additions & 4 deletions components/etermin/etermin.app.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,123 @@
import { axios } from "@pipedream/platform";
import constants from "./common/constants.mjs";

export default {
type: "app",
app: "etermin",
propDefinitions: {},
propDefinitions: {
updateWhenExistsgdt: {
type: "string",
label: "Update When Exists",
description: "Set to 1 to check if the contact is already existing. If so the existing contact gets updated. Needs email or firstname, lastname and birthday",
options: constants.UPDATE_OPTIONS,
},
Comment on lines +8 to +13
Copy link
Contributor

@coderabbitai coderabbitai bot Sep 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

🧩 Analysis chain

Typo in prop key: “updateWhenExistsgdt” likely unintended; also tighten copy

The key name looks misspelled and will leak into action props. Rename to updateWhenExists and adjust description.

Apply:

-    updateWhenExistsgdt: {
+    updateWhenExists: {
       type: "string",
       label: "Update When Exists",
-      description: "Set to 1 to check if the contact is already existing. If so the existing contact gets updated. Needs email or firstname, lastname and birthday",
+      description: "Set to 1 to check if the contact already exists. If found, the existing contact is updated. Requires email, or first name + last name + birthday.",
       options: constants.UPDATE_OPTIONS,
     },

If actions reference the old key, update them accordingly:


🏁 Script executed:

#!/bin/bash
# Find usages of the old key in eTermin actions
rg -nC2 '\bupdateWhenExistsgdt\b' --type=ts --type=js --type=jsx --type=tsx components/etermin

Length of output: 27


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== rg search for 'updateWhenExistsgdt' =="
if command -v rg >/dev/null 2>&1; then
  rg -nC2 'updateWhenExistsgdt' || true
else
  echo "rg not found; falling back to grep"
  grep -R -n --line-number -C2 'updateWhenExistsgdt' . || true
fi

echo "== rg search for 'updateWhenExists' =="
if command -v rg >/dev/null 2>&1; then
  rg -nC2 '\bupdateWhenExists\b' -S || true
else
  grep -R -n --line-number -C2 'updateWhenExists' . || true
fi

echo "== list components/etermin files =="
if [ -d components/etermin ]; then
  find components/etermin -maxdepth 2 -type f -print || true
  if [ -f components/etermin/etermin.app.mjs ]; then
    echo "== head of components/etermin/etermin.app.mjs =="
    sed -n '1,200p' components/etermin/etermin.app.mjs || true
  else
    echo "components/etermin/etermin.app.mjs not found"
  fi
else
  echo "components/etermin directory not found"
fi

Length of output: 4820


Rename prop key to updateWhenExists and update action usages

  • Fix prop definition in components/etermin/etermin.app.mjs — rename key and tighten description (apply diff below).
-    updateWhenExistsgdt: {
+    updateWhenExists: {
      type: "string",
      label: "Update When Exists",
-      description: "Set to 1 to check if the contact is already existing. If so the existing contact gets updated. Needs email or firstname, lastname and birthday",
+      description: "Set to 1 to check if the contact already exists. If found, the existing contact is updated. Requires email, or first name + last name + birthday.",
      options: constants.UPDATE_OPTIONS,
    },
  • Update components/etermin/actions/create-contact/create-contact.mjs: change the propDefinition reference from "updateWhenExistsgdt""updateWhenExists" and replace any use of this.updateWhenExistsgdt with this.updateWhenExists (leave the outgoing API param key updatewhenexistsgdt if that matches the API).
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
updateWhenExistsgdt: {
type: "string",
label: "Update When Exists",
description: "Set to 1 to check if the contact is already existing. If so the existing contact gets updated. Needs email or firstname, lastname and birthday",
options: constants.UPDATE_OPTIONS,
},
updateWhenExists: {
type: "string",
label: "Update When Exists",
description: "Set to 1 to check if the contact already exists. If found, the existing contact is updated. Requires email, or first name + last name + birthday.",
options: constants.UPDATE_OPTIONS,
},
🤖 Prompt for AI Agents
In components/etermin/etermin.app.mjs around lines 8-13 the prop key is
misspelled as "updateWhenExistsgdt"; rename the prop key to "updateWhenExists"
and tighten the description accordingly (keep type, label, options but update
description text). Then in
components/etermin/actions/create-contact/create-contact.mjs update the
propDefinition reference from "updateWhenExistsgdt" to "updateWhenExists" and
replace any usages of this.updateWhenExistsgdt with this.updateWhenExists while
leaving the outgoing API parameter key (e.g., "updatewhenexistsgdt") unchanged
if required by the API.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with coderabbit. Need to fix the prop description.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

@michelle0927 Thanks for confirming! Let me check for all references to the misspelled prop and provide the complete fix.

Based on the search results and the need to fix the prop key, here's the complete fix:

1. Fix the prop definition in components/etermin/etermin.app.mjs:

updateWhenExists: {
  type: "string",
  label: "Update When Exists",
  description: "Set to 1 to check if the contact already exists. If found, the existing contact is updated. Requires email, or first name + last name + birthday.",
  options: constants.UPDATE_OPTIONS,
},

2. Update the action file components/etermin/actions/create-contact/create-contact.mjs:

  • Change the propDefinition reference from "updateWhenExistsgdt" to "updateWhenExists"
  • Update any usage of this.updateWhenExistsgdt to this.updateWhenExists
  • Keep the API parameter key as updatewhenexistsgdt if that's what the eTermin API expects

This ensures consistency across the codebase while maintaining API compatibility.


🏁 Script executed:

#!/bin/bash
# Find all references to the misspelled prop name
echo "=== Searching for 'updateWhenExistsgdt' references ==="
rg -n "updateWhenExistsgdt" components/etermin/

echo -e "\n=== Searching for any variations ==="
rg -n -i "updatewhenexists" components/etermin/

echo -e "\n=== List all eTermin action files ==="
find components/etermin/actions -name "*.mjs" -type f 2>/dev/null || echo "No action files found"

Length of output: 991


Perfect! I can see exactly where the misspelled prop is used. Here's the complete fix for all affected files:

1. Fix in components/etermin/etermin.app.mjs (Line 8):

updateWhenExists: {
  type: "string",
  label: "Update When Exists",
  description: "Set to 1 to check if the contact already exists. If found, the existing contact is updated. Requires email, or first name + last name + birthday.",
  options: constants.UPDATE_OPTIONS,
},

2. Fix in components/etermin/actions/create-contact/create-contact.mjs:

You'll need to update 3 places in this file:

  • Line 11: Change the prop name
updateWhenExists: {
  • Line 14: Update the propDefinition reference
  "updateWhenExists",
  • Line 64: Update the property access (but keep the API parameter key)
updatewhenexistsgdt: this.updateWhenExists,

This maintains API compatibility by keeping the parameter key updatewhenexistsgdt that the eTermin API expects, while fixing the internal prop naming throughout the codebase.

The create-voucher action doesn't use this prop, so no changes are needed there.


🧠 Learnings used
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michelle0927 Thank you for confirming! The fix is already outlined in the previous comment. The misspelled prop key updateWhenExistsgdt should be renamed to updateWhenExists in both:

  1. components/etermin/etermin.app.mjs - Update the prop definition and improve the description
  2. components/etermin/actions/create-contact/create-contact.mjs - Update the propDefinition reference and property access

The API parameter key updatewhenexistsgdt can remain unchanged to maintain compatibility with the eTermin API.


🧠 Learnings used
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".

Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#14229
File: components/americommerce/actions/update-customer/update-customer.mjs:89-94
Timestamp: 2024-10-08T16:42:59.225Z
Learning: When defining boolean properties in AmeriCommerce components (e.g., in `update-customer.mjs`), ensure that the label and description are consistent and clearly indicate the intent, especially when using negations like "No Account", to avoid confusion.

salutation: {
type: "string",
label: "Salutation",
description: "Salutation or greeting prefix",
},
title: {
type: "string",
label: "Title",
description: "Title of the contact",
},
lastName: {
type: "string",
label: "Last Name",
description: "Contact's last name",
},
firstName: {
type: "string",
label: "First Name",
description: "Contact's first name",
},
company: {
type: "string",
label: "Company",
description: "Name of the company associated with the contact",
},
birthday: {
type: "string",
label: "Birthday",
description: "Contact's date of birth in YYYY-MM-DD format",
},
email: {
type: "string",
label: "Email",
description: "Email address of the contact",
},
id: {
type: "string",
label: "ID",
description: "ID of the voucher",
},
Comment on lines +49 to +53
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prop id needs to use async options.

description: {
type: "string",
label: "Description",
description: "Description of the voucher",
},
priceInclVat: {
type: "string",
label: "Price Including VAT",
description: "Price including VAT of the voucher",
},
isPercentage: {
type: "boolean",
label: "Is Percentage",
description: "Indicates if the value of the vaucher is a percentage",
},
Comment on lines +65 to +68
Copy link
Contributor

@coderabbitai coderabbitai bot Sep 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

User-facing typo: “vaucher” → “voucher”

Fix the typo in the description.

Apply:

-      description: "Indicates if the value of the vaucher is a percentage",
+      description: "Indicates if the value of the voucher is a percentage",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
type: "boolean",
label: "Is Percentage",
description: "Indicates if the value of the vaucher is a percentage",
},
type: "boolean",
label: "Is Percentage",
description: "Indicates if the value of the voucher is a percentage",
},
🤖 Prompt for AI Agents
In components/etermin/etermin.app.mjs around lines 65 to 68, the description
string contains a typo "vaucher"; update the description to read "Indicates if
the value of the voucher is a percentage" (replace "vaucher" with "voucher") and
check nearby strings for the same misspelling to correct them as well.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with coderabbit. Need to fix typo.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michelle0927 Thank you for confirming! You're absolutely right - the typo needs to be fixed.

The correction needed is in Line 66 of components/etermin/etermin.app.mjs:

description: "Indicates if the value of the voucher is a percentage",

Simply change "vaucher" to "voucher" in the description string for the isPercentage propDefinition.

customerEmail: {
type: "string",
label: "Customer Email",
description: "Email address of the customer receiving the offer",
},
validFrom: {
type: "string",
label: "Valid From",
description: "Start date of validity in YYYY-MM-DD format",
},
validUntil: {
type: "string",
label: "Valid Until",
description: "End date of validity in YYYY-MM-DD format",
},
},
methods: {
// this.$auth contains connected account data
authKeys() {
console.log(Object.keys(this.$auth));
_baseUrl() {
return "https://www.etermin.net/api";
},
async _makeRequest(opts = {}) {
const {
$ = this,
path,
headers,
...otherOpts
} = opts;
return axios($, {
...otherOpts,
url: this._baseUrl() + path,
headers: {
"publickey": `${this.$auth.public_key}`,
"salt": `${this.$auth.salt}`,
"signature": `${this.$auth.signature}`,
...headers,
},
});
},

async createContact(args = {}) {
return this._makeRequest({
path: "/contact",
method: "post",
...args,
});
},
async createVoucher(args = {}) {
return this._makeRequest({
path: "/voucher",
method: "post",
...args,
});
},
},
};
4 changes: 2 additions & 2 deletions components/etermin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/etermin",
"version": "0.6.0",
"version": "0.7.0",
"description": "Pipedream etermin Components",
"main": "etermin.app.mjs",
"keywords": [
Expand All @@ -13,6 +13,6 @@
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^3.0.0"
"@pipedream/platform": "^3.1.0"
}
}
21 changes: 9 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading