Skip to content

Commit 7ba29e7

Browse files
committed
add configuration error
1 parent 427b0bf commit 7ba29e7

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

components/hubspot/actions/search-crm/search-crm.mjs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ import {
1010
DEFAULT_LEAD_PROPERTIES,
1111
} from "../../common/constants.mjs";
1212
import common from "../common/common-create.mjs";
13+
import { ConfigurationError } from "@pipedream/platform";
1314

1415
export default {
1516
key: "hubspot-search-crm",
1617
name: "Search CRM",
1718
description: "Search companies, contacts, deals, feedback submissions, products, tickets, line-items, quotes, leads, or custom objects. [See the documentation](https://developers.hubspot.com/docs/api/crm/search)",
18-
version: "0.0.11",
19+
version: "0.0.12",
1920
type: "action",
2021
props: {
2122
hubspot,
@@ -203,6 +204,14 @@ export default {
203204
...otherProperties
204205
} = this;
205206

207+
const schema = await this.hubspot.getSchema({
208+
objectType,
209+
});
210+
211+
if (!schema.searchableProperties.includes(searchProperty)) {
212+
throw new ConfigurationError(`\`${searchProperty}\` is not a searchable property of object type \`${objectType}\``);
213+
}
214+
206215
const properties = creationProps
207216
? typeof creationProps === "string"
208217
? JSON.parse(creationProps)

components/hubspot/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/hubspot",
3-
"version": "0.13.1",
3+
"version": "0.13.2",
44
"description": "Pipedream Hubspot Components",
55
"main": "hubspot.app.mjs",
66
"keywords": [

0 commit comments

Comments
 (0)