Skip to content

Commit 9ba4464

Browse files
authored
Hubspot - Search CRM (#15417)
* add configuration error * pnpm-lock.yaml * improve error message * update versions & prop description * typo * pnpm-lock.yaml * pnpm-lock.yaml
1 parent 99fa451 commit 9ba4464

File tree

13 files changed

+27
-17
lines changed

13 files changed

+27
-17
lines changed

components/adobe_document_generation_api/adobe_document_generation_api.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/browserbase/browserbase.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/buysellads/buysellads.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

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

Lines changed: 14 additions & 2 deletions
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.12",
19+
version: "0.0.13",
1920
type: "action",
2021
props: {
2122
hubspot,
@@ -88,7 +89,7 @@ export default {
8889
props.searchValue = {
8990
type: "string",
9091
label: "Search Value",
91-
description: "Search for objects where the specified search field/property matches the search value",
92+
description: "Search for objects where the specified search field/property contains an exact match of the search value",
9293
};
9394
const defaultProperties = this.getDefaultProperties();
9495
if (defaultProperties?.length) {
@@ -203,6 +204,17 @@ 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(
213+
`Property \`${searchProperty}\` is not a searchable property of object type \`${objectType}\`. ` +
214+
`\n\nAvailable searchable properties are: \`${schema.searchableProperties.join("`, `")}\``,
215+
);
216+
}
217+
206218
const properties = creationProps
207219
? typeof creationProps === "string"
208220
? 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.2",
3+
"version": "0.13.3",
44
"description": "Pipedream Hubspot Components",
55
"main": "hubspot.app.mjs",
66
"keywords": [

components/humanlayer/humanlayer.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/instant/instant.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/klipy/klipy.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/lightpanda/lightpanda.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/planhat/planhat.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

0 commit comments

Comments
 (0)