diff --git a/components/jobber/actions/create-client/create-client.mjs b/components/jobber/actions/create-client/create-client.mjs index 0453593a3d29f..38e66d3b4e8f7 100644 --- a/components/jobber/actions/create-client/create-client.mjs +++ b/components/jobber/actions/create-client/create-client.mjs @@ -5,7 +5,7 @@ export default { key: "jobber-create-client", name: "Create Client", description: "Generates a new client within Jobber. [See the documentation](https://developer.getjobber.com/docs)", - version: "0.0.4", + version: "0.0.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/jobber/actions/create-quote/create-quote.mjs b/components/jobber/actions/create-quote/create-quote.mjs index 8a942d7d935ac..d2912dad0117e 100644 --- a/components/jobber/actions/create-quote/create-quote.mjs +++ b/components/jobber/actions/create-quote/create-quote.mjs @@ -4,7 +4,7 @@ export default { key: "jobber-create-quote", name: "Create Quote", description: "Generates a new quote for a client's property in Jobber. [See the documentation](https://developer.getjobber.com/docs/)", - version: "0.0.4", + version: "0.0.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/jobber/actions/create-request/create-request.mjs b/components/jobber/actions/create-request/create-request.mjs index bb801f202c270..7bce779faa387 100644 --- a/components/jobber/actions/create-request/create-request.mjs +++ b/components/jobber/actions/create-request/create-request.mjs @@ -6,7 +6,7 @@ export default { key: "jobber-create-request", name: "Create Service Request", description: "Creates a new service request for a client's first property within Jobber. [See the documentation](https://developer.getjobber.com/docs/)", - version: "0.0.4", + version: "0.0.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/jobber/actions/filter-quotes/filter-quotes.mjs b/components/jobber/actions/filter-quotes/filter-quotes.mjs index 75a52fc3d0a68..22b621a076c9e 100644 --- a/components/jobber/actions/filter-quotes/filter-quotes.mjs +++ b/components/jobber/actions/filter-quotes/filter-quotes.mjs @@ -5,7 +5,7 @@ export default { key: "jobber-filter-quotes", name: "Filter Quotes", description: "Filter quotes by status, quote number, or cost in Jobber. [See the documentation](https://developer.getjobber.com/docs)", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/jobber/actions/list-client-id-options/list-client-id-options.mjs b/components/jobber/actions/list-client-id-options/list-client-id-options.mjs index 3132a3c9ac31a..874b462b2bdb3 100644 --- a/components/jobber/actions/list-client-id-options/list-client-id-options.mjs +++ b/components/jobber/actions/list-client-id-options/list-client-id-options.mjs @@ -4,7 +4,7 @@ export default { key: "jobber-list-client-id-options", name: "List Client ID Options", description: "Retrieves available options for the Client ID field.", - version: "0.0.1", + version: "0.0.2", type: "action", annotations: { destructiveHint: false, diff --git a/components/jobber/actions/list-clients/list-clients.mjs b/components/jobber/actions/list-clients/list-clients.mjs new file mode 100644 index 0000000000000..171d3a7893cb2 --- /dev/null +++ b/components/jobber/actions/list-clients/list-clients.mjs @@ -0,0 +1,58 @@ +import jobber from "../../jobber.app.mjs"; +import constants from "../../common/constants.mjs"; + +export default { + key: "jobber-list-clients", + name: "List Clients", + description: "Retrieve client records from Jobber, optionally filtered by a search term. [See the documentation](https://developer.getjobber.com/docs/)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + jobber, + searchTerm: { + type: "string", + label: "Search Term", + description: "Filter clients by a search term (e.g. name, company, email, or phone number)", + optional: true, + }, + maxResults: { + type: "integer", + label: "Max Results", + description: "The maximum number of clients to return", + default: 100, + optional: true, + }, + }, + async run({ $ }) { + const query = `query ListClients($first: Int, $after: String, $searchTerm: String) { + clients(first: $first, after: $after, searchTerm: $searchTerm) { + nodes { + ${constants.CLIENT_FIELDS} + } + pageInfo { + endCursor + hasNextPage + } + } + }`; + + const args = { + searchTerm: this.searchTerm, + }; + const clients = await this.jobber.getPaginatedResources({ + query, + args, + resourceKey: "clients", + max: this.maxResults, + }); + $.export("$summary", `Successfully retrieved ${clients.length} client${clients.length === 1 + ? "" + : "s"}`); + return clients; + }, +}; diff --git a/components/jobber/actions/search-quotes/search-quotes.mjs b/components/jobber/actions/search-quotes/search-quotes.mjs index 63f3f5cb1b26f..f27ed0b1d7eea 100644 --- a/components/jobber/actions/search-quotes/search-quotes.mjs +++ b/components/jobber/actions/search-quotes/search-quotes.mjs @@ -5,7 +5,7 @@ export default { key: "jobber-search-quotes", name: "Search Quotes", description: "Search for quotes using a search termin Jobber. [See the documentation](https://developer.getjobber.com/docs)", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/jobber/common/constants.mjs b/components/jobber/common/constants.mjs index 1427faa3d0356..5feee21c8d7ba 100644 --- a/components/jobber/common/constants.mjs +++ b/components/jobber/common/constants.mjs @@ -39,6 +39,47 @@ const QUOTE_FIELDS = ` updatedAt `; +const CLIENT_FIELDS = ` + id + name + firstName + lastName + companyName + isCompany + isArchived + isLead + title + balance + jobberWebUri + createdAt + updatedAt + emails { + id + description + primary + address + } + phones { + id + description + primary + number + } + billingAddress { + street + city + province + postalCode + country + } + tags { + nodes { + label + } + } +`; + export default { QUOTE_FIELDS, + CLIENT_FIELDS, }; diff --git a/components/jobber/jobber.app.mjs b/components/jobber/jobber.app.mjs index efe56cd50c07c..cc61181159306 100644 --- a/components/jobber/jobber.app.mjs +++ b/components/jobber/jobber.app.mjs @@ -79,7 +79,7 @@ export default { url: `${this._baseUrl()}${path}`, headers: { "Authorization": `Bearer ${this.$auth.oauth_access_token}`, - "X-JOBBER-GRAPHQL-VERSION": "2025-01-20", + "X-JOBBER-GRAPHQL-VERSION": "2026-05-12", }, }); if (response.errors) { diff --git a/components/jobber/package.json b/components/jobber/package.json index 17712bd7eaaba..5c32887e567bd 100644 --- a/components/jobber/package.json +++ b/components/jobber/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/jobber", - "version": "0.3.0", + "version": "0.4.0", "description": "Pipedream Jobber Components", "main": "jobber.app.mjs", "keywords": [