Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
28 changes: 28 additions & 0 deletions components/trestle/actions/phone-validation/phone-validation.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import app from "../../trestle.app.mjs";

export default {
key: "trestle-phone-validation",
name: "Phone Validation",
description: "Validates phone numbers and provides phone metadata. [See the documentation](https://trestle-api.redoc.ly/Current/tag/Phone-Validation-API#operation/getPhoneValidation)",
version: "0.0.1",
type: "action",
props: {
app,
phone: {
propDefinition: [
app,
"phone",
],
},
},
async run({ $ }) {
const response = await this.app.phoneValidation({
$,
params: {
phone: this.phone,
},
});
$.export("$summary", "Successfully executed phone validation");
return response;
},
};
28 changes: 28 additions & 0 deletions components/trestle/actions/phone-valitadion/phone-valitadion.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import app from "../../trestle.app.mjs";

export default {
key: "trestle-phone-valitadion",
name: "Phone Valitadion",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Typo in the word validation. Should update the file and folder name as well.

Suggested change
key: "trestle-phone-valitadion",
name: "Phone Valitadion",
key: "trestle-phone-validation",
name: "Phone Validation",

description: "Validates phone numbers and provides phone metadata. [See the documentation](https://trestle-api.redoc.ly/Current/tag/Phone-Validation-API#operation/getPhoneValidation)",
version: "0.0.1",
type: "action",
props: {
app,
phone: {
propDefinition: [
app,
"phone",
],
},
},
async run({ $ }) {
const response = await this.app.phoneValidation({
$,
params: {
phone: this.phone,
},
});
$.export("$summary", "Successfully executed phone validation");
return response;
},
};
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 spelling errors in component name and file path.

There's a consistent spelling error: "valitadion" should be "validation". This affects both the file/directory names and the component key, which could cause confusion for users.

Recommendations:

  1. Rename the directory from phone-valitadion to phone-validation
  2. Rename the file from phone-valitadion.mjs to phone-validation.mjs
  3. Update the component key:
-  key: "trestle-phone-valitadion",
+  key: "trestle-phone-validation",
-  name: "Phone Valitadion",
+  name: "Phone Validation",
📝 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
import app from "../../trestle.app.mjs";
export default {
key: "trestle-phone-valitadion",
name: "Phone Valitadion",
description: "Validates phone numbers and provides phone metadata. [See the documentation](https://trestle-api.redoc.ly/Current/tag/Phone-Validation-API#operation/getPhoneValidation)",
version: "0.0.1",
type: "action",
props: {
app,
phone: {
propDefinition: [
app,
"phone",
],
},
},
async run({ $ }) {
const response = await this.app.phoneValidation({
$,
params: {
phone: this.phone,
},
});
$.export("$summary", "Successfully executed phone validation");
return response;
},
};
import app from "../../trestle.app.mjs";
export default {
key: "trestle-phone-validation",
name: "Phone Validation",
description: "Validates phone numbers and provides phone metadata. [See the documentation](https://trestle-api.redoc.ly/Current/tag/Phone-Validation-API#operation/getPhoneValidation)",
version: "0.0.1",
type: "action",
props: {
app,
phone: {
propDefinition: [
app,
"phone",
],
},
},
async run({ $ }) {
const response = await this.app.phoneValidation({
$,
params: {
phone: this.phone,
},
});
$.export("$summary", "Successfully executed phone validation");
return response;
},
};

86 changes: 86 additions & 0 deletions components/trestle/actions/real-contact/real-contact.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import app from "../../trestle.app.mjs";

export default {
key: "trestle-real-contact",
name: "Real Contact",
description: "Verifies and grades phone numbers, emails, and addresses. [See the documentation](https://trestle-api.redoc.ly/Current/tag/Real-Contact-API#operation/realContact)",
version: "0.0.1",
type: "action",
props: {
app,
phone: {
propDefinition: [
app,
"phone",
],
},
name: {
propDefinition: [
app,
"name",
],
},
email: {
propDefinition: [
app,
"email",
],
},
ipAddress: {
propDefinition: [
app,
"ipAddress",
],
},
street: {
propDefinition: [
app,
"street",
],
},
city: {
propDefinition: [
app,
"city",
],
},
stateCode: {
propDefinition: [
app,
"stateCode",
],
},
postalCode: {
propDefinition: [
app,
"postalCode",
],
},
countryCode: {
propDefinition: [
app,
"countryCode",
],
},
},
async run({ $ }) {
const response = await this.app.realContact({
$,
params: {
phone: this.phone,
name: this.name,
email: this.email,
ip_address: this.ipAddress,
address: {
street_line_1: this.street,
city: this.city,
state_code: this.stateCode,
postal_code: this.postalCode,
country_code: this.countryCode,
},
},
});
$.export("$summary", "Successfully executed contact lookup");
return response;
},
};
28 changes: 28 additions & 0 deletions components/trestle/actions/reverse-phone/reverse-phone.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import app from "../../trestle.app.mjs";

export default {
key: "trestle-reverse-phone",
name: "Reverse Phone",
description: "Offers comprehensive verification and enrichment of phone numbers. [See the documentation](https://trestle-api.redoc.ly/Current/tag/Reverse-Phone-API#operation/getPhone)",
version: "0.0.1",
type: "action",
props: {
app,
phone: {
propDefinition: [
app,
"phone",
],
},
},
async run({ $ }) {
const response = await this.app.reversePhone({
$,
params: {
phone: this.phone,
},
});
$.export("$summary", "Successfully executed reverse phone lookup");
return response;
},
};
Loading
Loading