diff --git a/CHANGELOG.md b/CHANGELOG.md index acee4661..2554e632 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,15 @@ The file format of it is based on [Keep a Changelog](http://keepachangelog.com/e For public Changelog covering all changes done to Pipedrive’s API, webhooks and app extensions platforms, see [public Changelog](https://pipedrive.readme.io/docs/changelog) with discussion area in [Developers Community](https://devcommunity.pipedrive.com/c/documentation/changelog/19). ## [Unreleased] +### Fixed +- Fixed several comma-separated query parameters that were still typed as `type: string` — changed to `type: array` with `uniqueItems: true`, `style: form`, `explode: false` (integer items unless noted): + - `ids` on the v1 delete-many endpoints (`DELETE /v1/dealFields`, `DELETE /v1/organizationFields`, `DELETE /v1/personFields`, `DELETE /v1/filters`, `DELETE /v1/productFields`) + - `exclude` on `GET /v1/activities` (`ActivityExclude`); `ActivityTypeIdsParameter` + - `items` on v1 activity/flow endpoints (`Items`, string items) + - `fields`/`include_fields` on `GET /v1/leads/search` (enumerated string items) + - `status` on `GET /api/v2/deals` (`DealStatus`, enumerated string items) + - `ids` on `DELETE /api/v2/deals/{id}/products` + - `fields`/`status`/`include_fields`/`item_types` parameters on `GET /api/v2/deals/search`, `GET /api/v2/itemSearch`, `GET /api/v2/leads/search`, `GET /api/v2/organizations/search`, `GET /api/v2/persons/search`, `GET /api/v2/products/search`, and `GET /api/v2/projects/search` ## [34.0.1] - 2026-10-12 ### Fixed diff --git a/src/versions/v1/api/deal-fields-api.ts b/src/versions/v1/api/deal-fields-api.ts index 612064f5..7b053c55 100644 --- a/src/versions/v1/api/deal-fields-api.ts +++ b/src/versions/v1/api/deal-fields-api.ts @@ -124,11 +124,11 @@ export const DealFieldsApiAxiosParamCreator = function (configuration?: Configur /** * Marks multiple deal fields as deleted. * @summary Delete multiple deal fields in bulk - * @param {string} ids The comma-separated field IDs to delete + * @param {Set} ids The comma-separated field IDs to delete * @throws {RequiredError} */ - deleteDealFields: async (ids: string, ): Promise => { + deleteDealFields: async (ids: Set, ): Promise => { // verify required parameter 'ids' is not null or undefined assertParamExists('deleteDealFields', 'ids', ids) const localVarPath = `/dealFields`; @@ -150,8 +150,8 @@ export const DealFieldsApiAxiosParamCreator = function (configuration?: Configur // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2", ["deal-fields:full", "admin"], configuration) - if (ids !== undefined) { - localVarQueryParameter['ids'] = ids; + if (ids) { + localVarQueryParameter['ids'] = Array.from(ids).join(COLLECTION_FORMATS.csv); } @@ -334,11 +334,11 @@ export const DealFieldsApiFp = function(configuration?: Configuration) { /** * Marks multiple deal fields as deleted. * @summary Delete multiple deal fields in bulk - * @param {string} ids The comma-separated field IDs to delete + * @param {Set} ids The comma-separated field IDs to delete * @throws {RequiredError} */ - async deleteDealFields(ids: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + async deleteDealFields(ids: Set, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDealFields(ids, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -486,10 +486,10 @@ export interface DealFieldsApiDeleteDealFieldRequest { export interface DealFieldsApiDeleteDealFieldsRequest { /** * The comma-separated field IDs to delete - * @type {string} + * @type {Set} * @memberof DealFieldsApiDeleteDealFields */ - readonly ids: string + readonly ids: Set } /** diff --git a/src/versions/v1/api/deals-api.ts b/src/versions/v1/api/deals-api.ts index dd2ef759..6c8d9542 100644 --- a/src/versions/v1/api/deals-api.ts +++ b/src/versions/v1/api/deals-api.ts @@ -852,11 +852,11 @@ export const DealsApiAxiosParamCreator = function (configuration?: Configuration * @param {number} [start] Pagination start * @param {number} [limit] Items shown per page * @param {string} [all_changes] Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. - * @param {string} [items] A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change). + * @param {Set} [items] A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change). * @throws {RequiredError} */ - getDealUpdates: async (id: number, start?: number, limit?: number, all_changes?: string, items?: string, ): Promise => { + getDealUpdates: async (id: number, start?: number, limit?: number, all_changes?: string, items?: Set, ): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('getDealUpdates', 'id', id) const localVarPath = `/deals/{id}/flow` @@ -891,8 +891,8 @@ export const DealsApiAxiosParamCreator = function (configuration?: Configuration localVarQueryParameter['all_changes'] = all_changes; } - if (items !== undefined) { - localVarQueryParameter['items'] = items; + if (items) { + localVarQueryParameter['items'] = Array.from(items).join(COLLECTION_FORMATS.csv); } @@ -1357,11 +1357,11 @@ export const DealsApiFp = function(configuration?: Configuration) { * @param {number} [start] Pagination start * @param {number} [limit] Items shown per page * @param {string} [all_changes] Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. - * @param {string} [items] A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change). + * @param {Set} [items] A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change). * @throws {RequiredError} */ - async getDealUpdates(id: number, start?: number, limit?: number, all_changes?: string, items?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + async getDealUpdates(id: number, start?: number, limit?: number, all_changes?: string, items?: Set, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getDealUpdates(id, start, limit, all_changes, items, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -2130,10 +2130,10 @@ export interface DealsApiGetDealUpdatesRequest { /** * A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change). - * @type {string} + * @type {Set} * @memberof DealsApiGetDealUpdates */ - readonly items?: string + readonly items?: Set } /** diff --git a/src/versions/v1/api/filters-api.ts b/src/versions/v1/api/filters-api.ts index bb116817..ec897e7a 100644 --- a/src/versions/v1/api/filters-api.ts +++ b/src/versions/v1/api/filters-api.ts @@ -131,11 +131,11 @@ export const FiltersApiAxiosParamCreator = function (configuration?: Configurati /** * Marks multiple filters as deleted. * @summary Delete multiple filters in bulk - * @param {string} ids The comma-separated filter IDs to delete + * @param {Set} ids The comma-separated filter IDs to delete * @throws {RequiredError} */ - deleteFilters: async (ids: string, ): Promise => { + deleteFilters: async (ids: Set, ): Promise => { // verify required parameter 'ids' is not null or undefined assertParamExists('deleteFilters', 'ids', ids) const localVarPath = `/filters`; @@ -157,8 +157,8 @@ export const FiltersApiAxiosParamCreator = function (configuration?: Configurati // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:full", "activities:full", "contacts:full"], configuration) - if (ids !== undefined) { - localVarQueryParameter['ids'] = ids; + if (ids) { + localVarQueryParameter['ids'] = Array.from(ids).join(COLLECTION_FORMATS.csv); } @@ -384,11 +384,11 @@ export const FiltersApiFp = function(configuration?: Configuration) { /** * Marks multiple filters as deleted. * @summary Delete multiple filters in bulk - * @param {string} ids The comma-separated filter IDs to delete + * @param {Set} ids The comma-separated filter IDs to delete * @throws {RequiredError} */ - async deleteFilters(ids: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + async deleteFilters(ids: Set, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteFilters(ids, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -563,10 +563,10 @@ export interface FiltersApiDeleteFilterRequest { export interface FiltersApiDeleteFiltersRequest { /** * The comma-separated filter IDs to delete - * @type {string} + * @type {Set} * @memberof FiltersApiDeleteFilters */ - readonly ids: string + readonly ids: Set } /** diff --git a/src/versions/v1/api/leads-api.ts b/src/versions/v1/api/leads-api.ts index a71b40b5..d61aeba2 100644 --- a/src/versions/v1/api/leads-api.ts +++ b/src/versions/v1/api/leads-api.ts @@ -360,17 +360,17 @@ export const LeadsApiAxiosParamCreator = function (configuration?: Configuration * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID. * @summary Search leads * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'custom_fields' | 'notes' | 'title'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. + * @param {Set<'custom_fields' | 'notes' | 'title'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. * @param {number} [person_id] Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000. * @param {number} [organization_id] Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000. - * @param {'lead.was_seen'} [include_fields] Supports including optional fields in the results which are not provided by default + * @param {Set<'lead.was_seen'>} [include_fields] Supports including optional fields in the results which are not provided by default * @param {number} [start] Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. * @param {number} [limit] Items shown per page * @throws {RequiredError} */ - searchLeads: async (term: string, fields?: 'custom_fields' | 'notes' | 'title', exact_match?: boolean, person_id?: number, organization_id?: number, include_fields?: 'lead.was_seen', start?: number, limit?: number, ): Promise => { + searchLeads: async (term: string, fields?: Set<'custom_fields' | 'notes' | 'title'>, exact_match?: boolean, person_id?: number, organization_id?: number, include_fields?: Set<'lead.was_seen'>, start?: number, limit?: number, ): Promise => { // verify required parameter 'term' is not null or undefined assertParamExists('searchLeads', 'term', term) const localVarPath = `/leads/search`; @@ -396,8 +396,8 @@ export const LeadsApiAxiosParamCreator = function (configuration?: Configuration localVarQueryParameter['term'] = term; } - if (fields !== undefined) { - localVarQueryParameter['fields'] = fields; + if (fields) { + localVarQueryParameter['fields'] = Array.from(fields).join(COLLECTION_FORMATS.csv); } if (exact_match !== undefined) { @@ -412,8 +412,8 @@ export const LeadsApiAxiosParamCreator = function (configuration?: Configuration localVarQueryParameter['organization_id'] = organization_id; } - if (include_fields !== undefined) { - localVarQueryParameter['include_fields'] = include_fields; + if (include_fields) { + localVarQueryParameter['include_fields'] = Array.from(include_fields).join(COLLECTION_FORMATS.csv); } if (start !== undefined) { @@ -574,17 +574,17 @@ export const LeadsApiFp = function(configuration?: Configuration) { * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID. * @summary Search leads * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'custom_fields' | 'notes' | 'title'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. + * @param {Set<'custom_fields' | 'notes' | 'title'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. * @param {number} [person_id] Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000. * @param {number} [organization_id] Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000. - * @param {'lead.was_seen'} [include_fields] Supports including optional fields in the results which are not provided by default + * @param {Set<'lead.was_seen'>} [include_fields] Supports including optional fields in the results which are not provided by default * @param {number} [start] Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. * @param {number} [limit] Items shown per page * @throws {RequiredError} */ - async searchLeads(term: string, fields?: 'custom_fields' | 'notes' | 'title', exact_match?: boolean, person_id?: number, organization_id?: number, include_fields?: 'lead.was_seen', start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + async searchLeads(term: string, fields?: Set<'custom_fields' | 'notes' | 'title'>, exact_match?: boolean, person_id?: number, organization_id?: number, include_fields?: Set<'lead.was_seen'>, start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { const localVarAxiosArgs = await localVarAxiosParamCreator.searchLeads(term, fields, exact_match, person_id, organization_id, include_fields, start, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -883,10 +883,10 @@ export interface LeadsApiSearchLeadsRequest { /** * A comma-separated string array. The fields to perform the search from. Defaults to all of them. - * @type {'custom_fields' | 'notes' | 'title'} + * @type {Set<'custom_fields' | 'notes' | 'title'>} * @memberof LeadsApiSearchLeads */ - readonly fields?: 'custom_fields' | 'notes' | 'title' + readonly fields?: Set<'custom_fields' | 'notes' | 'title'> /** * When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. @@ -911,10 +911,10 @@ export interface LeadsApiSearchLeadsRequest { /** * Supports including optional fields in the results which are not provided by default - * @type {'lead.was_seen'} + * @type {Set<'lead.was_seen'>} * @memberof LeadsApiSearchLeads */ - readonly include_fields?: 'lead.was_seen' + readonly include_fields?: Set<'lead.was_seen'> /** * Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. diff --git a/src/versions/v1/api/organization-fields-api.ts b/src/versions/v1/api/organization-fields-api.ts index c41e4984..35b1cfd5 100644 --- a/src/versions/v1/api/organization-fields-api.ts +++ b/src/versions/v1/api/organization-fields-api.ts @@ -124,11 +124,11 @@ export const OrganizationFieldsApiAxiosParamCreator = function (configuration?: /** * Marks multiple fields as deleted. * @summary Delete multiple organization fields in bulk - * @param {string} ids The comma-separated field IDs to delete + * @param {Set} ids The comma-separated field IDs to delete * @throws {RequiredError} */ - deleteOrganizationFields: async (ids: string, ): Promise => { + deleteOrganizationFields: async (ids: Set, ): Promise => { // verify required parameter 'ids' is not null or undefined assertParamExists('deleteOrganizationFields', 'ids', ids) const localVarPath = `/organizationFields`; @@ -150,8 +150,8 @@ export const OrganizationFieldsApiAxiosParamCreator = function (configuration?: // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2", ["contact-fields:full", "admin"], configuration) - if (ids !== undefined) { - localVarQueryParameter['ids'] = ids; + if (ids) { + localVarQueryParameter['ids'] = Array.from(ids).join(COLLECTION_FORMATS.csv); } @@ -334,11 +334,11 @@ export const OrganizationFieldsApiFp = function(configuration?: Configuration) { /** * Marks multiple fields as deleted. * @summary Delete multiple organization fields in bulk - * @param {string} ids The comma-separated field IDs to delete + * @param {Set} ids The comma-separated field IDs to delete * @throws {RequiredError} */ - async deleteOrganizationFields(ids: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + async deleteOrganizationFields(ids: Set, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrganizationFields(ids, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -486,10 +486,10 @@ export interface OrganizationFieldsApiDeleteOrganizationFieldRequest { export interface OrganizationFieldsApiDeleteOrganizationFieldsRequest { /** * The comma-separated field IDs to delete - * @type {string} + * @type {Set} * @memberof OrganizationFieldsApiDeleteOrganizationFields */ - readonly ids: string + readonly ids: Set } /** diff --git a/src/versions/v1/api/organizations-api.ts b/src/versions/v1/api/organizations-api.ts index 51f5026a..12a58f7a 100644 --- a/src/versions/v1/api/organizations-api.ts +++ b/src/versions/v1/api/organizations-api.ts @@ -350,11 +350,11 @@ export const OrganizationsApiAxiosParamCreator = function (configuration?: Confi * @param {number} [start] Pagination start * @param {number} [limit] Items shown per page * @param {string} [all_changes] Whether to show custom field updates or not. 1 = Include custom field changes. If omitted, returns changes without custom field updates. - * @param {string} [items] A comma-separated string for filtering out item specific updates. (Possible values - activity, plannedActivity, note, file, change, deal, follower, participant, mailMessage, mailMessageWithAttachment, invoice, activityFile, document). + * @param {Set} [items] A comma-separated string for filtering out item specific updates. (Possible values - activity, plannedActivity, note, file, change, deal, follower, participant, mailMessage, mailMessageWithAttachment, invoice, activityFile, document). * @throws {RequiredError} */ - getOrganizationUpdates: async (id: number, start?: number, limit?: number, all_changes?: string, items?: string, ): Promise => { + getOrganizationUpdates: async (id: number, start?: number, limit?: number, all_changes?: string, items?: Set, ): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('getOrganizationUpdates', 'id', id) const localVarPath = `/organizations/{id}/flow` @@ -389,8 +389,8 @@ export const OrganizationsApiAxiosParamCreator = function (configuration?: Confi localVarQueryParameter['all_changes'] = all_changes; } - if (items !== undefined) { - localVarQueryParameter['items'] = items; + if (items) { + localVarQueryParameter['items'] = Array.from(items).join(COLLECTION_FORMATS.csv); } @@ -584,11 +584,11 @@ export const OrganizationsApiFp = function(configuration?: Configuration) { * @param {number} [start] Pagination start * @param {number} [limit] Items shown per page * @param {string} [all_changes] Whether to show custom field updates or not. 1 = Include custom field changes. If omitted, returns changes without custom field updates. - * @param {string} [items] A comma-separated string for filtering out item specific updates. (Possible values - activity, plannedActivity, note, file, change, deal, follower, participant, mailMessage, mailMessageWithAttachment, invoice, activityFile, document). + * @param {Set} [items] A comma-separated string for filtering out item specific updates. (Possible values - activity, plannedActivity, note, file, change, deal, follower, participant, mailMessage, mailMessageWithAttachment, invoice, activityFile, document). * @throws {RequiredError} */ - async getOrganizationUpdates(id: number, start?: number, limit?: number, all_changes?: string, items?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + async getOrganizationUpdates(id: number, start?: number, limit?: number, all_changes?: string, items?: Set, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationUpdates(id, start, limit, all_changes, items, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -908,10 +908,10 @@ export interface OrganizationsApiGetOrganizationUpdatesRequest { /** * A comma-separated string for filtering out item specific updates. (Possible values - activity, plannedActivity, note, file, change, deal, follower, participant, mailMessage, mailMessageWithAttachment, invoice, activityFile, document). - * @type {string} + * @type {Set} * @memberof OrganizationsApiGetOrganizationUpdates */ - readonly items?: string + readonly items?: Set } /** diff --git a/src/versions/v1/api/person-fields-api.ts b/src/versions/v1/api/person-fields-api.ts index d556d8c3..3d301997 100644 --- a/src/versions/v1/api/person-fields-api.ts +++ b/src/versions/v1/api/person-fields-api.ts @@ -124,11 +124,11 @@ export const PersonFieldsApiAxiosParamCreator = function (configuration?: Config /** * Marks multiple fields as deleted. * @summary Delete multiple person fields in bulk - * @param {string} ids The comma-separated field IDs to delete + * @param {Set} ids The comma-separated field IDs to delete * @throws {RequiredError} */ - deletePersonFields: async (ids: string, ): Promise => { + deletePersonFields: async (ids: Set, ): Promise => { // verify required parameter 'ids' is not null or undefined assertParamExists('deletePersonFields', 'ids', ids) const localVarPath = `/personFields`; @@ -150,8 +150,8 @@ export const PersonFieldsApiAxiosParamCreator = function (configuration?: Config // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2", ["contact-fields:full", "admin"], configuration) - if (ids !== undefined) { - localVarQueryParameter['ids'] = ids; + if (ids) { + localVarQueryParameter['ids'] = Array.from(ids).join(COLLECTION_FORMATS.csv); } @@ -334,11 +334,11 @@ export const PersonFieldsApiFp = function(configuration?: Configuration) { /** * Marks multiple fields as deleted. * @summary Delete multiple person fields in bulk - * @param {string} ids The comma-separated field IDs to delete + * @param {Set} ids The comma-separated field IDs to delete * @throws {RequiredError} */ - async deletePersonFields(ids: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + async deletePersonFields(ids: Set, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deletePersonFields(ids, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -486,10 +486,10 @@ export interface PersonFieldsApiDeletePersonFieldRequest { export interface PersonFieldsApiDeletePersonFieldsRequest { /** * The comma-separated field IDs to delete - * @type {string} + * @type {Set} * @memberof PersonFieldsApiDeletePersonFields */ - readonly ids: string + readonly ids: Set } /** diff --git a/src/versions/v1/api/persons-api.ts b/src/versions/v1/api/persons-api.ts index d6630d2d..89be0cc0 100644 --- a/src/versions/v1/api/persons-api.ts +++ b/src/versions/v1/api/persons-api.ts @@ -518,11 +518,11 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati * @param {number} [start] Pagination start * @param {number} [limit] Items shown per page * @param {string} [all_changes] Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. - * @param {string} [items] A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change). + * @param {Set} [items] A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change). * @throws {RequiredError} */ - getPersonUpdates: async (id: number, start?: number, limit?: number, all_changes?: string, items?: string, ): Promise => { + getPersonUpdates: async (id: number, start?: number, limit?: number, all_changes?: string, items?: Set, ): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('getPersonUpdates', 'id', id) const localVarPath = `/persons/{id}/flow` @@ -557,8 +557,8 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati localVarQueryParameter['all_changes'] = all_changes; } - if (items !== undefined) { - localVarQueryParameter['items'] = items; + if (items) { + localVarQueryParameter['items'] = Array.from(items).join(COLLECTION_FORMATS.csv); } @@ -792,11 +792,11 @@ export const PersonsApiFp = function(configuration?: Configuration) { * @param {number} [start] Pagination start * @param {number} [limit] Items shown per page * @param {string} [all_changes] Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. - * @param {string} [items] A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change). + * @param {Set} [items] A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change). * @throws {RequiredError} */ - async getPersonUpdates(id: number, start?: number, limit?: number, all_changes?: string, items?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + async getPersonUpdates(id: number, start?: number, limit?: number, all_changes?: string, items?: Set, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonUpdates(id, start, limit, all_changes, items, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1237,10 +1237,10 @@ export interface PersonsApiGetPersonUpdatesRequest { /** * A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change). - * @type {string} + * @type {Set} * @memberof PersonsApiGetPersonUpdates */ - readonly items?: string + readonly items?: Set } /** diff --git a/src/versions/v1/api/product-fields-api.ts b/src/versions/v1/api/product-fields-api.ts index 6f510a80..453bee1a 100644 --- a/src/versions/v1/api/product-fields-api.ts +++ b/src/versions/v1/api/product-fields-api.ts @@ -126,11 +126,11 @@ export const ProductFieldsApiAxiosParamCreator = function (configuration?: Confi /** * Marks multiple fields as deleted. * @summary Delete multiple product fields in bulk - * @param {string} ids The comma-separated field IDs to delete + * @param {Set} ids The comma-separated field IDs to delete * @throws {RequiredError} */ - deleteProductFields: async (ids: string, ): Promise => { + deleteProductFields: async (ids: Set, ): Promise => { // verify required parameter 'ids' is not null or undefined assertParamExists('deleteProductFields', 'ids', ids) const localVarPath = `/productFields`; @@ -152,8 +152,8 @@ export const ProductFieldsApiAxiosParamCreator = function (configuration?: Confi // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2", ["product-fields:full", "products:full"], configuration) - if (ids !== undefined) { - localVarQueryParameter['ids'] = ids; + if (ids) { + localVarQueryParameter['ids'] = Array.from(ids).join(COLLECTION_FORMATS.csv); } @@ -336,11 +336,11 @@ export const ProductFieldsApiFp = function(configuration?: Configuration) { /** * Marks multiple fields as deleted. * @summary Delete multiple product fields in bulk - * @param {string} ids The comma-separated field IDs to delete + * @param {Set} ids The comma-separated field IDs to delete * @throws {RequiredError} */ - async deleteProductFields(ids: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + async deleteProductFields(ids: Set, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProductFields(ids, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -488,10 +488,10 @@ export interface ProductFieldsApiDeleteProductFieldRequest { export interface ProductFieldsApiDeleteProductFieldsRequest { /** * The comma-separated field IDs to delete - * @type {string} + * @type {Set} * @memberof ProductFieldsApiDeleteProductFields */ - readonly ids: string + readonly ids: Set } /** diff --git a/src/versions/v2/api/beta-api.ts b/src/versions/v2/api/beta-api.ts index 9cbeda31..0714c086 100644 --- a/src/versions/v2/api/beta-api.ts +++ b/src/versions/v2/api/beta-api.ts @@ -879,7 +879,7 @@ export const BetaApiAxiosParamCreator = function (configuration?: Configuration) * Searches all projects by title, description, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found projects can be filtered by person ID or organization ID. * @summary Search projects * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'custom_fields' | 'notes' | 'title' | 'description'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. + * @param {Set<'custom_fields' | 'notes' | 'title' | 'description'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. * @param {number} [person_id] Will filter projects by the provided person ID * @param {number} [organization_id] Will filter projects by the provided organization ID @@ -888,7 +888,7 @@ export const BetaApiAxiosParamCreator = function (configuration?: Configuration) * @throws {RequiredError} */ - searchProjects: async (term: string, fields?: 'custom_fields' | 'notes' | 'title' | 'description', exact_match?: boolean, person_id?: number, organization_id?: number, limit?: number, cursor?: string, ): Promise => { + searchProjects: async (term: string, fields?: Set<'custom_fields' | 'notes' | 'title' | 'description'>, exact_match?: boolean, person_id?: number, organization_id?: number, limit?: number, cursor?: string, ): Promise => { // verify required parameter 'term' is not null or undefined assertParamExists('searchProjects', 'term', term) const localVarPath = `/projects/search`; @@ -914,8 +914,8 @@ export const BetaApiAxiosParamCreator = function (configuration?: Configuration) localVarQueryParameter['term'] = term; } - if (fields !== undefined) { - localVarQueryParameter['fields'] = fields; + if (fields) { + localVarQueryParameter['fields'] = Array.from(fields).join(COLLECTION_FORMATS.csv); } if (exact_match !== undefined) { @@ -1399,7 +1399,7 @@ export const BetaApiFp = function(configuration?: Configuration) { * Searches all projects by title, description, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found projects can be filtered by person ID or organization ID. * @summary Search projects * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'custom_fields' | 'notes' | 'title' | 'description'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. + * @param {Set<'custom_fields' | 'notes' | 'title' | 'description'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. * @param {number} [person_id] Will filter projects by the provided person ID * @param {number} [organization_id] Will filter projects by the provided organization ID @@ -1408,7 +1408,7 @@ export const BetaApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ - async searchProjects(term: string, fields?: 'custom_fields' | 'notes' | 'title' | 'description', exact_match?: boolean, person_id?: number, organization_id?: number, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + async searchProjects(term: string, fields?: Set<'custom_fields' | 'notes' | 'title' | 'description'>, exact_match?: boolean, person_id?: number, organization_id?: number, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { const localVarAxiosArgs = await localVarAxiosParamCreator.searchProjects(term, fields, exact_match, person_id, organization_id, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -2040,10 +2040,10 @@ export interface BetaApiSearchProjectsRequest { /** * A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. - * @type {'custom_fields' | 'notes' | 'title' | 'description'} + * @type {Set<'custom_fields' | 'notes' | 'title' | 'description'>} * @memberof BetaApiSearchProjects */ - readonly fields?: 'custom_fields' | 'notes' | 'title' | 'description' + readonly fields?: Set<'custom_fields' | 'notes' | 'title' | 'description'> /** * When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. diff --git a/src/versions/v2/api/deal-products-api.ts b/src/versions/v2/api/deal-products-api.ts index 61bdbe04..08ef08e7 100644 --- a/src/versions/v2/api/deal-products-api.ts +++ b/src/versions/v2/api/deal-products-api.ts @@ -182,11 +182,11 @@ export const DealProductsApiAxiosParamCreator = function (configuration?: Config * Deletes multiple products from a deal. If no product IDs are specified, up to 100 products will be removed from the deal. A maximum of 100 product IDs can be provided per request. * @summary Delete many products from a deal * @param {number} id The ID of the deal - * @param {string} [ids] Comma-separated list of deal product IDs to delete. If not provided, all deal products will be deleted up to 100 items. Maximum 100 IDs allowed. + * @param {Set} [ids] Comma-separated list of deal product IDs to delete. If not provided, all deal products will be deleted up to 100 items. Maximum 100 IDs allowed. * @throws {RequiredError} */ - deleteManyDealProducts: async (id: number, ids?: string, ): Promise => { + deleteManyDealProducts: async (id: number, ids?: Set, ): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('deleteManyDealProducts', 'id', id) const localVarPath = `/deals/{id}/products` @@ -209,8 +209,8 @@ export const DealProductsApiAxiosParamCreator = function (configuration?: Config // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2", ["products:full", "deals:full"], configuration) - if (ids !== undefined) { - localVarQueryParameter['ids'] = ids; + if (ids) { + localVarQueryParameter['ids'] = Array.from(ids).join(COLLECTION_FORMATS.csv); } @@ -449,11 +449,11 @@ export const DealProductsApiFp = function(configuration?: Configuration) { * Deletes multiple products from a deal. If no product IDs are specified, up to 100 products will be removed from the deal. A maximum of 100 product IDs can be provided per request. * @summary Delete many products from a deal * @param {number} id The ID of the deal - * @param {string} [ids] Comma-separated list of deal product IDs to delete. If not provided, all deal products will be deleted up to 100 items. Maximum 100 IDs allowed. + * @param {Set} [ids] Comma-separated list of deal product IDs to delete. If not provided, all deal products will be deleted up to 100 items. Maximum 100 IDs allowed. * @throws {RequiredError} */ - async deleteManyDealProducts(id: number, ids?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + async deleteManyDealProducts(id: number, ids?: Set, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteManyDealProducts(id, ids, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -661,10 +661,10 @@ export interface DealProductsApiDeleteManyDealProductsRequest { /** * Comma-separated list of deal product IDs to delete. If not provided, all deal products will be deleted up to 100 items. Maximum 100 IDs allowed. - * @type {string} + * @type {Set} * @memberof DealProductsApiDeleteManyDealProducts */ - readonly ids?: string + readonly ids?: Set } /** diff --git a/src/versions/v2/api/deals-api.ts b/src/versions/v2/api/deals-api.ts index 035e0006..e03fdb11 100644 --- a/src/versions/v2/api/deals-api.ts +++ b/src/versions/v2/api/deals-api.ts @@ -376,7 +376,7 @@ export const DealsApiAxiosParamCreator = function (configuration?: Configuration * @param {number} [org_id] If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. * @param {number} [pipeline_id] If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. * @param {number} [stage_id] If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. - * @param {'open' | 'won' | 'lost' | 'deleted'} [status] Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. + * @param {Set<'open' | 'won' | 'lost' | 'deleted'>} [status] Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. * @param {string} [updated_since] If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. * @param {string} [updated_until] If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: `id`, `update_time`, `add_time`. @@ -388,7 +388,7 @@ export const DealsApiAxiosParamCreator = function (configuration?: Configuration * @throws {RequiredError} */ - getArchivedDeals: async (filter_id?: number, ids?: Set, owner_id?: number, person_id?: number, org_id?: number, pipeline_id?: number, stage_id?: number, status?: 'open' | 'won' | 'lost' | 'deleted', updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: Set<'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id'>, custom_fields?: Set, limit?: number, cursor?: string, ): Promise => { + getArchivedDeals: async (filter_id?: number, ids?: Set, owner_id?: number, person_id?: number, org_id?: number, pipeline_id?: number, stage_id?: number, status?: Set<'open' | 'won' | 'lost' | 'deleted'>, updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: Set<'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id'>, custom_fields?: Set, limit?: number, cursor?: string, ): Promise => { const localVarPath = `/deals/archived`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -436,8 +436,8 @@ export const DealsApiAxiosParamCreator = function (configuration?: Configuration localVarQueryParameter['stage_id'] = stage_id; } - if (status !== undefined) { - localVarQueryParameter['status'] = status; + if (status) { + localVarQueryParameter['status'] = Array.from(status).join(COLLECTION_FORMATS.csv); } if (updated_since !== undefined) { @@ -701,7 +701,7 @@ export const DealsApiAxiosParamCreator = function (configuration?: Configuration * @param {number} [org_id] If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. * @param {number} [pipeline_id] If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. * @param {number} [stage_id] If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. - * @param {'open' | 'won' | 'lost' | 'deleted'} [status] Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. + * @param {Set<'open' | 'won' | 'lost' | 'deleted'>} [status] Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. * @param {string} [updated_since] If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. * @param {string} [updated_until] If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: `id`, `update_time`, `add_time`. @@ -715,7 +715,7 @@ export const DealsApiAxiosParamCreator = function (configuration?: Configuration * @throws {RequiredError} */ - getDeals: async (filter_id?: number, ids?: Set, owner_id?: number, person_id?: number, org_id?: number, pipeline_id?: number, stage_id?: number, status?: 'open' | 'won' | 'lost' | 'deleted', updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: Set<'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id'>, custom_fields?: Set, include_option_labels?: boolean, include_labels?: boolean, limit?: number, cursor?: string, ): Promise => { + getDeals: async (filter_id?: number, ids?: Set, owner_id?: number, person_id?: number, org_id?: number, pipeline_id?: number, stage_id?: number, status?: Set<'open' | 'won' | 'lost' | 'deleted'>, updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: Set<'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id'>, custom_fields?: Set, include_option_labels?: boolean, include_labels?: boolean, limit?: number, cursor?: string, ): Promise => { const localVarPath = `/deals`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -763,8 +763,8 @@ export const DealsApiAxiosParamCreator = function (configuration?: Configuration localVarQueryParameter['stage_id'] = stage_id; } - if (status !== undefined) { - localVarQueryParameter['status'] = status; + if (status) { + localVarQueryParameter['status'] = Array.from(status).join(COLLECTION_FORMATS.csv); } if (updated_since !== undefined) { @@ -867,18 +867,18 @@ export const DealsApiAxiosParamCreator = function (configuration?: Configuration * Searches all deals by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found deals can be filtered by the person ID and the organization ID. * @summary Search deals * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'custom_fields' | 'notes' | 'title'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. + * @param {Set<'custom_fields' | 'notes' | 'title'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. * @param {number} [person_id] Will filter deals by the provided person ID. The upper limit of found deals associated with the person is 2000. * @param {number} [organization_id] Will filter deals by the provided organization ID. The upper limit of found deals associated with the organization is 2000. - * @param {'open' | 'won' | 'lost'} [status] Will filter deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found deals associated with the status is 2000. - * @param {'deal.cc_email'} [include_fields] Supports including optional fields in the results which are not provided by default + * @param {Set<'open' | 'won' | 'lost'>} [status] Will filter deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found deals associated with the status is 2000. + * @param {Set<'deal.cc_email'>} [include_fields] Supports including optional fields in the results which are not provided by default * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page * @throws {RequiredError} */ - searchDeals: async (term: string, fields?: 'custom_fields' | 'notes' | 'title', exact_match?: boolean, person_id?: number, organization_id?: number, status?: 'open' | 'won' | 'lost', include_fields?: 'deal.cc_email', limit?: number, cursor?: string, ): Promise => { + searchDeals: async (term: string, fields?: Set<'custom_fields' | 'notes' | 'title'>, exact_match?: boolean, person_id?: number, organization_id?: number, status?: Set<'open' | 'won' | 'lost'>, include_fields?: Set<'deal.cc_email'>, limit?: number, cursor?: string, ): Promise => { // verify required parameter 'term' is not null or undefined assertParamExists('searchDeals', 'term', term) const localVarPath = `/deals/search`; @@ -904,8 +904,8 @@ export const DealsApiAxiosParamCreator = function (configuration?: Configuration localVarQueryParameter['term'] = term; } - if (fields !== undefined) { - localVarQueryParameter['fields'] = fields; + if (fields) { + localVarQueryParameter['fields'] = Array.from(fields).join(COLLECTION_FORMATS.csv); } if (exact_match !== undefined) { @@ -920,12 +920,12 @@ export const DealsApiAxiosParamCreator = function (configuration?: Configuration localVarQueryParameter['organization_id'] = organization_id; } - if (status !== undefined) { - localVarQueryParameter['status'] = status; + if (status) { + localVarQueryParameter['status'] = Array.from(status).join(COLLECTION_FORMATS.csv); } - if (include_fields !== undefined) { - localVarQueryParameter['include_fields'] = include_fields; + if (include_fields) { + localVarQueryParameter['include_fields'] = Array.from(include_fields).join(COLLECTION_FORMATS.csv); } if (limit !== undefined) { @@ -1142,7 +1142,7 @@ export const DealsApiFp = function(configuration?: Configuration) { * @param {number} [org_id] If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. * @param {number} [pipeline_id] If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. * @param {number} [stage_id] If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. - * @param {'open' | 'won' | 'lost' | 'deleted'} [status] Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. + * @param {Set<'open' | 'won' | 'lost' | 'deleted'>} [status] Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. * @param {string} [updated_since] If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. * @param {string} [updated_until] If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: `id`, `update_time`, `add_time`. @@ -1154,7 +1154,7 @@ export const DealsApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ - async getArchivedDeals(filter_id?: number, ids?: Set, owner_id?: number, person_id?: number, org_id?: number, pipeline_id?: number, stage_id?: number, status?: 'open' | 'won' | 'lost' | 'deleted', updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: Set<'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id'>, custom_fields?: Set, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + async getArchivedDeals(filter_id?: number, ids?: Set, owner_id?: number, person_id?: number, org_id?: number, pipeline_id?: number, stage_id?: number, status?: Set<'open' | 'won' | 'lost' | 'deleted'>, updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: Set<'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id'>, custom_fields?: Set, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getArchivedDeals(filter_id, ids, owner_id, person_id, org_id, pipeline_id, stage_id, status, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1221,7 +1221,7 @@ export const DealsApiFp = function(configuration?: Configuration) { * @param {number} [org_id] If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. * @param {number} [pipeline_id] If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. * @param {number} [stage_id] If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. - * @param {'open' | 'won' | 'lost' | 'deleted'} [status] Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. + * @param {Set<'open' | 'won' | 'lost' | 'deleted'>} [status] Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. * @param {string} [updated_since] If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. * @param {string} [updated_until] If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: `id`, `update_time`, `add_time`. @@ -1235,7 +1235,7 @@ export const DealsApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ - async getDeals(filter_id?: number, ids?: Set, owner_id?: number, person_id?: number, org_id?: number, pipeline_id?: number, stage_id?: number, status?: 'open' | 'won' | 'lost' | 'deleted', updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: Set<'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id'>, custom_fields?: Set, include_option_labels?: boolean, include_labels?: boolean, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + async getDeals(filter_id?: number, ids?: Set, owner_id?: number, person_id?: number, org_id?: number, pipeline_id?: number, stage_id?: number, status?: Set<'open' | 'won' | 'lost' | 'deleted'>, updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: Set<'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'smart_bcc_email' | 'source_lead_id'>, custom_fields?: Set, include_option_labels?: boolean, include_labels?: boolean, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getDeals(filter_id, ids, owner_id, person_id, org_id, pipeline_id, stage_id, status, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, include_option_labels, include_labels, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1255,18 +1255,18 @@ export const DealsApiFp = function(configuration?: Configuration) { * Searches all deals by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found deals can be filtered by the person ID and the organization ID. * @summary Search deals * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'custom_fields' | 'notes' | 'title'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. + * @param {Set<'custom_fields' | 'notes' | 'title'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. * @param {number} [person_id] Will filter deals by the provided person ID. The upper limit of found deals associated with the person is 2000. * @param {number} [organization_id] Will filter deals by the provided organization ID. The upper limit of found deals associated with the organization is 2000. - * @param {'open' | 'won' | 'lost'} [status] Will filter deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found deals associated with the status is 2000. - * @param {'deal.cc_email'} [include_fields] Supports including optional fields in the results which are not provided by default + * @param {Set<'open' | 'won' | 'lost'>} [status] Will filter deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found deals associated with the status is 2000. + * @param {Set<'deal.cc_email'>} [include_fields] Supports including optional fields in the results which are not provided by default * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page * @throws {RequiredError} */ - async searchDeals(term: string, fields?: 'custom_fields' | 'notes' | 'title', exact_match?: boolean, person_id?: number, organization_id?: number, status?: 'open' | 'won' | 'lost', include_fields?: 'deal.cc_email', limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + async searchDeals(term: string, fields?: Set<'custom_fields' | 'notes' | 'title'>, exact_match?: boolean, person_id?: number, organization_id?: number, status?: Set<'open' | 'won' | 'lost'>, include_fields?: Set<'deal.cc_email'>, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { const localVarAxiosArgs = await localVarAxiosParamCreator.searchDeals(term, fields, exact_match, person_id, organization_id, status, include_fields, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1654,10 +1654,10 @@ export interface DealsApiGetArchivedDealsRequest { /** * Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. - * @type {'open' | 'won' | 'lost' | 'deleted'} + * @type {Set<'open' | 'won' | 'lost' | 'deleted'>} * @memberof DealsApiGetArchivedDeals */ - readonly status?: 'open' | 'won' | 'lost' | 'deleted' + readonly status?: Set<'open' | 'won' | 'lost' | 'deleted'> /** * If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. @@ -1892,10 +1892,10 @@ export interface DealsApiGetDealsRequest { /** * Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. - * @type {'open' | 'won' | 'lost' | 'deleted'} + * @type {Set<'open' | 'won' | 'lost' | 'deleted'>} * @memberof DealsApiGetDeals */ - readonly status?: 'open' | 'won' | 'lost' | 'deleted' + readonly status?: Set<'open' | 'won' | 'lost' | 'deleted'> /** * If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. @@ -2004,10 +2004,10 @@ export interface DealsApiSearchDealsRequest { /** * A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. - * @type {'custom_fields' | 'notes' | 'title'} + * @type {Set<'custom_fields' | 'notes' | 'title'>} * @memberof DealsApiSearchDeals */ - readonly fields?: 'custom_fields' | 'notes' | 'title' + readonly fields?: Set<'custom_fields' | 'notes' | 'title'> /** * When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. @@ -2032,17 +2032,17 @@ export interface DealsApiSearchDealsRequest { /** * Will filter deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found deals associated with the status is 2000. - * @type {'open' | 'won' | 'lost'} + * @type {Set<'open' | 'won' | 'lost'>} * @memberof DealsApiSearchDeals */ - readonly status?: 'open' | 'won' | 'lost' + readonly status?: Set<'open' | 'won' | 'lost'> /** * Supports including optional fields in the results which are not provided by default - * @type {'deal.cc_email'} + * @type {Set<'deal.cc_email'>} * @memberof DealsApiSearchDeals */ - readonly include_fields?: 'deal.cc_email' + readonly include_fields?: Set<'deal.cc_email'> /** * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. diff --git a/src/versions/v2/api/item-search-api.ts b/src/versions/v2/api/item-search-api.ts index d5c410c1..dcabeedb 100644 --- a/src/versions/v2/api/item-search-api.ts +++ b/src/versions/v2/api/item-search-api.ts @@ -35,17 +35,17 @@ export const ItemSearchApiAxiosParamCreator = function (configuration?: Configur * Performs a search from your choice of item types and fields. * @summary Perform a search from multiple item types * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project'} [item_types] A comma-separated string array. The type of items to perform the search from. Defaults to all. - * @param {'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'phone' | 'title' | 'description'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:<br> <table> <tr><th><b>Item type</b></th><th><b>Field</b></th></tr> <tr><td>Deal</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>Person</td><td>`custom_fields`, `email`, `name`, `notes`, `phone`</td></tr> <tr><td>Organization</td><td>`address`, `custom_fields`, `name`, `notes`</td></tr> <tr><td>Product</td><td>`code`, `custom_fields`, `name`</td></tr> <tr><td>Lead</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>File</td><td>`name`</td></tr> <tr><td>Mail attachment</td><td>`name`</td></tr> <tr><td>Project</td><td> `custom_fields`, `notes`, `title`, `description` </td></tr> </table> <br> Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. + * @param {Set<'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project'>} [item_types] A comma-separated string array. The type of items to perform the search from. Defaults to all. + * @param {Set<'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'phone' | 'title' | 'description'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:<br> <table> <tr><th><b>Item type</b></th><th><b>Field</b></th></tr> <tr><td>Deal</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>Person</td><td>`custom_fields`, `email`, `name`, `notes`, `phone`</td></tr> <tr><td>Organization</td><td>`address`, `custom_fields`, `name`, `notes`</td></tr> <tr><td>Product</td><td>`code`, `custom_fields`, `name`</td></tr> <tr><td>Lead</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>File</td><td>`name`</td></tr> <tr><td>Mail attachment</td><td>`name`</td></tr> <tr><td>Project</td><td> `custom_fields`, `notes`, `title`, `description` </td></tr> </table> <br> Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. * @param {boolean} [search_for_related_items] When enabled, the response will include up to 100 newest related leads and 100 newest related deals for each found person and organization and up to 100 newest related persons for each found organization * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. - * @param {'deal.cc_email' | 'person.picture' | 'product.price'} [include_fields] A comma-separated string array. Supports including optional fields in the results which are not provided by default. + * @param {Set<'deal.cc_email' | 'person.picture' | 'product.price'>} [include_fields] A comma-separated string array. Supports including optional fields in the results which are not provided by default. * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 100 is allowed. * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page * @throws {RequiredError} */ - searchItem: async (term: string, item_types?: 'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project', fields?: 'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'phone' | 'title' | 'description', search_for_related_items?: boolean, exact_match?: boolean, include_fields?: 'deal.cc_email' | 'person.picture' | 'product.price', limit?: number, cursor?: string, ): Promise => { + searchItem: async (term: string, item_types?: Set<'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project'>, fields?: Set<'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'phone' | 'title' | 'description'>, search_for_related_items?: boolean, exact_match?: boolean, include_fields?: Set<'deal.cc_email' | 'person.picture' | 'product.price'>, limit?: number, cursor?: string, ): Promise => { // verify required parameter 'term' is not null or undefined assertParamExists('searchItem', 'term', term) const localVarPath = `/itemSearch`; @@ -71,12 +71,12 @@ export const ItemSearchApiAxiosParamCreator = function (configuration?: Configur localVarQueryParameter['term'] = term; } - if (item_types !== undefined) { - localVarQueryParameter['item_types'] = item_types; + if (item_types) { + localVarQueryParameter['item_types'] = Array.from(item_types).join(COLLECTION_FORMATS.csv); } - if (fields !== undefined) { - localVarQueryParameter['fields'] = fields; + if (fields) { + localVarQueryParameter['fields'] = Array.from(fields).join(COLLECTION_FORMATS.csv); } if (search_for_related_items !== undefined) { @@ -87,8 +87,8 @@ export const ItemSearchApiAxiosParamCreator = function (configuration?: Configur localVarQueryParameter['exact_match'] = exact_match; } - if (include_fields !== undefined) { - localVarQueryParameter['include_fields'] = include_fields; + if (include_fields) { + localVarQueryParameter['include_fields'] = Array.from(include_fields).join(COLLECTION_FORMATS.csv); } if (limit !== undefined) { @@ -198,17 +198,17 @@ export const ItemSearchApiFp = function(configuration?: Configuration) { * Performs a search from your choice of item types and fields. * @summary Perform a search from multiple item types * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project'} [item_types] A comma-separated string array. The type of items to perform the search from. Defaults to all. - * @param {'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'phone' | 'title' | 'description'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:<br> <table> <tr><th><b>Item type</b></th><th><b>Field</b></th></tr> <tr><td>Deal</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>Person</td><td>`custom_fields`, `email`, `name`, `notes`, `phone`</td></tr> <tr><td>Organization</td><td>`address`, `custom_fields`, `name`, `notes`</td></tr> <tr><td>Product</td><td>`code`, `custom_fields`, `name`</td></tr> <tr><td>Lead</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>File</td><td>`name`</td></tr> <tr><td>Mail attachment</td><td>`name`</td></tr> <tr><td>Project</td><td> `custom_fields`, `notes`, `title`, `description` </td></tr> </table> <br> Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. + * @param {Set<'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project'>} [item_types] A comma-separated string array. The type of items to perform the search from. Defaults to all. + * @param {Set<'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'phone' | 'title' | 'description'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:<br> <table> <tr><th><b>Item type</b></th><th><b>Field</b></th></tr> <tr><td>Deal</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>Person</td><td>`custom_fields`, `email`, `name`, `notes`, `phone`</td></tr> <tr><td>Organization</td><td>`address`, `custom_fields`, `name`, `notes`</td></tr> <tr><td>Product</td><td>`code`, `custom_fields`, `name`</td></tr> <tr><td>Lead</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>File</td><td>`name`</td></tr> <tr><td>Mail attachment</td><td>`name`</td></tr> <tr><td>Project</td><td> `custom_fields`, `notes`, `title`, `description` </td></tr> </table> <br> Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. * @param {boolean} [search_for_related_items] When enabled, the response will include up to 100 newest related leads and 100 newest related deals for each found person and organization and up to 100 newest related persons for each found organization * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. - * @param {'deal.cc_email' | 'person.picture' | 'product.price'} [include_fields] A comma-separated string array. Supports including optional fields in the results which are not provided by default. + * @param {Set<'deal.cc_email' | 'person.picture' | 'product.price'>} [include_fields] A comma-separated string array. Supports including optional fields in the results which are not provided by default. * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 100 is allowed. * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page * @throws {RequiredError} */ - async searchItem(term: string, item_types?: 'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project', fields?: 'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'phone' | 'title' | 'description', search_for_related_items?: boolean, exact_match?: boolean, include_fields?: 'deal.cc_email' | 'person.picture' | 'product.price', limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + async searchItem(term: string, item_types?: Set<'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project'>, fields?: Set<'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'phone' | 'title' | 'description'>, search_for_related_items?: boolean, exact_match?: boolean, include_fields?: Set<'deal.cc_email' | 'person.picture' | 'product.price'>, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { const localVarAxiosArgs = await localVarAxiosParamCreator.searchItem(term, item_types, fields, search_for_related_items, exact_match, include_fields, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -276,17 +276,17 @@ export interface ItemSearchApiSearchItemRequest { /** * A comma-separated string array. The type of items to perform the search from. Defaults to all. - * @type {'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project'} + * @type {Set<'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project'>} * @memberof ItemSearchApiSearchItem */ - readonly item_types?: 'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project' + readonly item_types?: Set<'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project'> /** * A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:<br> <table> <tr><th><b>Item type</b></th><th><b>Field</b></th></tr> <tr><td>Deal</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>Person</td><td>`custom_fields`, `email`, `name`, `notes`, `phone`</td></tr> <tr><td>Organization</td><td>`address`, `custom_fields`, `name`, `notes`</td></tr> <tr><td>Product</td><td>`code`, `custom_fields`, `name`</td></tr> <tr><td>Lead</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>File</td><td>`name`</td></tr> <tr><td>Mail attachment</td><td>`name`</td></tr> <tr><td>Project</td><td> `custom_fields`, `notes`, `title`, `description` </td></tr> </table> <br> Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. - * @type {'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'phone' | 'title' | 'description'} + * @type {Set<'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'phone' | 'title' | 'description'>} * @memberof ItemSearchApiSearchItem */ - readonly fields?: 'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'phone' | 'title' | 'description' + readonly fields?: Set<'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'phone' | 'title' | 'description'> /** * When enabled, the response will include up to 100 newest related leads and 100 newest related deals for each found person and organization and up to 100 newest related persons for each found organization @@ -304,10 +304,10 @@ export interface ItemSearchApiSearchItemRequest { /** * A comma-separated string array. Supports including optional fields in the results which are not provided by default. - * @type {'deal.cc_email' | 'person.picture' | 'product.price'} + * @type {Set<'deal.cc_email' | 'person.picture' | 'product.price'>} * @memberof ItemSearchApiSearchItem */ - readonly include_fields?: 'deal.cc_email' | 'person.picture' | 'product.price' + readonly include_fields?: Set<'deal.cc_email' | 'person.picture' | 'product.price'> /** * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 100 is allowed. diff --git a/src/versions/v2/api/leads-api.ts b/src/versions/v2/api/leads-api.ts index 0160ea7e..e145855f 100644 --- a/src/versions/v2/api/leads-api.ts +++ b/src/versions/v2/api/leads-api.ts @@ -131,17 +131,17 @@ export const LeadsApiAxiosParamCreator = function (configuration?: Configuration * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID. * @summary Search leads * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'custom_fields' | 'notes' | 'title'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. + * @param {Set<'custom_fields' | 'notes' | 'title'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. * @param {number} [person_id] Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000. * @param {number} [organization_id] Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000. - * @param {'lead.was_seen'} [include_fields] Supports including optional fields in the results which are not provided by default + * @param {Set<'lead.was_seen'>} [include_fields] Supports including optional fields in the results which are not provided by default * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page * @throws {RequiredError} */ - searchLeads: async (term: string, fields?: 'custom_fields' | 'notes' | 'title', exact_match?: boolean, person_id?: number, organization_id?: number, include_fields?: 'lead.was_seen', limit?: number, cursor?: string, ): Promise => { + searchLeads: async (term: string, fields?: Set<'custom_fields' | 'notes' | 'title'>, exact_match?: boolean, person_id?: number, organization_id?: number, include_fields?: Set<'lead.was_seen'>, limit?: number, cursor?: string, ): Promise => { // verify required parameter 'term' is not null or undefined assertParamExists('searchLeads', 'term', term) const localVarPath = `/leads/search`; @@ -167,8 +167,8 @@ export const LeadsApiAxiosParamCreator = function (configuration?: Configuration localVarQueryParameter['term'] = term; } - if (fields !== undefined) { - localVarQueryParameter['fields'] = fields; + if (fields) { + localVarQueryParameter['fields'] = Array.from(fields).join(COLLECTION_FORMATS.csv); } if (exact_match !== undefined) { @@ -183,8 +183,8 @@ export const LeadsApiAxiosParamCreator = function (configuration?: Configuration localVarQueryParameter['organization_id'] = organization_id; } - if (include_fields !== undefined) { - localVarQueryParameter['include_fields'] = include_fields; + if (include_fields) { + localVarQueryParameter['include_fields'] = Array.from(include_fields).join(COLLECTION_FORMATS.csv); } if (limit !== undefined) { @@ -245,17 +245,17 @@ export const LeadsApiFp = function(configuration?: Configuration) { * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID. * @summary Search leads * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'custom_fields' | 'notes' | 'title'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. + * @param {Set<'custom_fields' | 'notes' | 'title'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. * @param {number} [person_id] Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000. * @param {number} [organization_id] Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000. - * @param {'lead.was_seen'} [include_fields] Supports including optional fields in the results which are not provided by default + * @param {Set<'lead.was_seen'>} [include_fields] Supports including optional fields in the results which are not provided by default * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page * @throws {RequiredError} */ - async searchLeads(term: string, fields?: 'custom_fields' | 'notes' | 'title', exact_match?: boolean, person_id?: number, organization_id?: number, include_fields?: 'lead.was_seen', limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + async searchLeads(term: string, fields?: Set<'custom_fields' | 'notes' | 'title'>, exact_match?: boolean, person_id?: number, organization_id?: number, include_fields?: Set<'lead.was_seen'>, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { const localVarAxiosArgs = await localVarAxiosParamCreator.searchLeads(term, fields, exact_match, person_id, organization_id, include_fields, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -359,10 +359,10 @@ export interface LeadsApiSearchLeadsRequest { /** * A comma-separated string array. The fields to perform the search from. Defaults to all of them. - * @type {'custom_fields' | 'notes' | 'title'} + * @type {Set<'custom_fields' | 'notes' | 'title'>} * @memberof LeadsApiSearchLeads */ - readonly fields?: 'custom_fields' | 'notes' | 'title' + readonly fields?: Set<'custom_fields' | 'notes' | 'title'> /** * When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. @@ -387,10 +387,10 @@ export interface LeadsApiSearchLeadsRequest { /** * Supports including optional fields in the results which are not provided by default - * @type {'lead.was_seen'} + * @type {Set<'lead.was_seen'>} * @memberof LeadsApiSearchLeads */ - readonly include_fields?: 'lead.was_seen' + readonly include_fields?: Set<'lead.was_seen'> /** * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. diff --git a/src/versions/v2/api/organizations-api.ts b/src/versions/v2/api/organizations-api.ts index 7d2d2f83..1351a0a9 100644 --- a/src/versions/v2/api/organizations-api.ts +++ b/src/versions/v2/api/organizations-api.ts @@ -490,14 +490,14 @@ export const OrganizationsApiAxiosParamCreator = function (configuration?: Confi * Searches all organizations by name, address, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. * @summary Search organizations * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'address' | 'custom_fields' | 'notes' | 'name'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. + * @param {Set<'address' | 'custom_fields' | 'notes' | 'name'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page * @throws {RequiredError} */ - searchOrganization: async (term: string, fields?: 'address' | 'custom_fields' | 'notes' | 'name', exact_match?: boolean, limit?: number, cursor?: string, ): Promise => { + searchOrganization: async (term: string, fields?: Set<'address' | 'custom_fields' | 'notes' | 'name'>, exact_match?: boolean, limit?: number, cursor?: string, ): Promise => { // verify required parameter 'term' is not null or undefined assertParamExists('searchOrganization', 'term', term) const localVarPath = `/organizations/search`; @@ -523,8 +523,8 @@ export const OrganizationsApiAxiosParamCreator = function (configuration?: Confi localVarQueryParameter['term'] = term; } - if (fields !== undefined) { - localVarQueryParameter['fields'] = fields; + if (fields) { + localVarQueryParameter['fields'] = Array.from(fields).join(COLLECTION_FORMATS.csv); } if (exact_match !== undefined) { @@ -720,14 +720,14 @@ export const OrganizationsApiFp = function(configuration?: Configuration) { * Searches all organizations by name, address, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. * @summary Search organizations * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'address' | 'custom_fields' | 'notes' | 'name'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. + * @param {Set<'address' | 'custom_fields' | 'notes' | 'name'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page * @throws {RequiredError} */ - async searchOrganization(term: string, fields?: 'address' | 'custom_fields' | 'notes' | 'name', exact_match?: boolean, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + async searchOrganization(term: string, fields?: Set<'address' | 'custom_fields' | 'notes' | 'name'>, exact_match?: boolean, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { const localVarAxiosArgs = await localVarAxiosParamCreator.searchOrganization(term, fields, exact_match, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1137,10 +1137,10 @@ export interface OrganizationsApiSearchOrganizationRequest { /** * A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. - * @type {'address' | 'custom_fields' | 'notes' | 'name'} + * @type {Set<'address' | 'custom_fields' | 'notes' | 'name'>} * @memberof OrganizationsApiSearchOrganization */ - readonly fields?: 'address' | 'custom_fields' | 'notes' | 'name' + readonly fields?: Set<'address' | 'custom_fields' | 'notes' | 'name'> /** * When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. diff --git a/src/versions/v2/api/persons-api.ts b/src/versions/v2/api/persons-api.ts index 6beb1548..e968d0b8 100644 --- a/src/versions/v2/api/persons-api.ts +++ b/src/versions/v2/api/persons-api.ts @@ -543,16 +543,16 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati * Searches all persons by name, email, phone, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found persons can be filtered by organization ID. * @summary Search persons * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'custom_fields' | 'email' | 'notes' | 'phone' | 'name'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. + * @param {Set<'custom_fields' | 'email' | 'notes' | 'phone' | 'name'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. * @param {number} [organization_id] Will filter persons by the provided organization ID. The upper limit of found persons associated with the organization is 2000. - * @param {'person.picture'} [include_fields] Supports including optional fields in the results which are not provided by default + * @param {Set<'person.picture'>} [include_fields] Supports including optional fields in the results which are not provided by default * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page * @throws {RequiredError} */ - searchPersons: async (term: string, fields?: 'custom_fields' | 'email' | 'notes' | 'phone' | 'name', exact_match?: boolean, organization_id?: number, include_fields?: 'person.picture', limit?: number, cursor?: string, ): Promise => { + searchPersons: async (term: string, fields?: Set<'custom_fields' | 'email' | 'notes' | 'phone' | 'name'>, exact_match?: boolean, organization_id?: number, include_fields?: Set<'person.picture'>, limit?: number, cursor?: string, ): Promise => { // verify required parameter 'term' is not null or undefined assertParamExists('searchPersons', 'term', term) const localVarPath = `/persons/search`; @@ -578,8 +578,8 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati localVarQueryParameter['term'] = term; } - if (fields !== undefined) { - localVarQueryParameter['fields'] = fields; + if (fields) { + localVarQueryParameter['fields'] = Array.from(fields).join(COLLECTION_FORMATS.csv); } if (exact_match !== undefined) { @@ -590,8 +590,8 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati localVarQueryParameter['organization_id'] = organization_id; } - if (include_fields !== undefined) { - localVarQueryParameter['include_fields'] = include_fields; + if (include_fields) { + localVarQueryParameter['include_fields'] = Array.from(include_fields).join(COLLECTION_FORMATS.csv); } if (limit !== undefined) { @@ -796,16 +796,16 @@ export const PersonsApiFp = function(configuration?: Configuration) { * Searches all persons by name, email, phone, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found persons can be filtered by organization ID. * @summary Search persons * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'custom_fields' | 'email' | 'notes' | 'phone' | 'name'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. + * @param {Set<'custom_fields' | 'email' | 'notes' | 'phone' | 'name'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. * @param {number} [organization_id] Will filter persons by the provided organization ID. The upper limit of found persons associated with the organization is 2000. - * @param {'person.picture'} [include_fields] Supports including optional fields in the results which are not provided by default + * @param {Set<'person.picture'>} [include_fields] Supports including optional fields in the results which are not provided by default * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page * @throws {RequiredError} */ - async searchPersons(term: string, fields?: 'custom_fields' | 'email' | 'notes' | 'phone' | 'name', exact_match?: boolean, organization_id?: number, include_fields?: 'person.picture', limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + async searchPersons(term: string, fields?: Set<'custom_fields' | 'email' | 'notes' | 'phone' | 'name'>, exact_match?: boolean, organization_id?: number, include_fields?: Set<'person.picture'>, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { const localVarAxiosArgs = await localVarAxiosParamCreator.searchPersons(term, fields, exact_match, organization_id, include_fields, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1253,10 +1253,10 @@ export interface PersonsApiSearchPersonsRequest { /** * A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. - * @type {'custom_fields' | 'email' | 'notes' | 'phone' | 'name'} + * @type {Set<'custom_fields' | 'email' | 'notes' | 'phone' | 'name'>} * @memberof PersonsApiSearchPersons */ - readonly fields?: 'custom_fields' | 'email' | 'notes' | 'phone' | 'name' + readonly fields?: Set<'custom_fields' | 'email' | 'notes' | 'phone' | 'name'> /** * When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. @@ -1274,10 +1274,10 @@ export interface PersonsApiSearchPersonsRequest { /** * Supports including optional fields in the results which are not provided by default - * @type {'person.picture'} + * @type {Set<'person.picture'>} * @memberof PersonsApiSearchPersons */ - readonly include_fields?: 'person.picture' + readonly include_fields?: Set<'person.picture'> /** * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. diff --git a/src/versions/v2/api/products-api.ts b/src/versions/v2/api/products-api.ts index 2ed2d959..fe7b42a2 100644 --- a/src/versions/v2/api/products-api.ts +++ b/src/versions/v2/api/products-api.ts @@ -734,15 +734,15 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat * Searches all products by name, code and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. * @summary Search products * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'code' | 'custom_fields' | 'name'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. + * @param {Set<'code' | 'custom_fields' | 'name'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. - * @param {'product.price'} [include_fields] Supports including optional fields in the results which are not provided by default + * @param {Set<'product.price'>} [include_fields] Supports including optional fields in the results which are not provided by default * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page * @throws {RequiredError} */ - searchProducts: async (term: string, fields?: 'code' | 'custom_fields' | 'name', exact_match?: boolean, include_fields?: 'product.price', limit?: number, cursor?: string, ): Promise => { + searchProducts: async (term: string, fields?: Set<'code' | 'custom_fields' | 'name'>, exact_match?: boolean, include_fields?: Set<'product.price'>, limit?: number, cursor?: string, ): Promise => { // verify required parameter 'term' is not null or undefined assertParamExists('searchProducts', 'term', term) const localVarPath = `/products/search`; @@ -768,16 +768,16 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat localVarQueryParameter['term'] = term; } - if (fields !== undefined) { - localVarQueryParameter['fields'] = fields; + if (fields) { + localVarQueryParameter['fields'] = Array.from(fields).join(COLLECTION_FORMATS.csv); } if (exact_match !== undefined) { localVarQueryParameter['exact_match'] = exact_match; } - if (include_fields !== undefined) { - localVarQueryParameter['include_fields'] = include_fields; + if (include_fields) { + localVarQueryParameter['include_fields'] = Array.from(include_fields).join(COLLECTION_FORMATS.csv); } if (limit !== undefined) { @@ -1184,15 +1184,15 @@ export const ProductsApiFp = function(configuration?: Configuration) { * Searches all products by name, code and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. * @summary Search products * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'code' | 'custom_fields' | 'name'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. + * @param {Set<'code' | 'custom_fields' | 'name'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. - * @param {'product.price'} [include_fields] Supports including optional fields in the results which are not provided by default + * @param {Set<'product.price'>} [include_fields] Supports including optional fields in the results which are not provided by default * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page * @throws {RequiredError} */ - async searchProducts(term: string, fields?: 'code' | 'custom_fields' | 'name', exact_match?: boolean, include_fields?: 'product.price', limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + async searchProducts(term: string, fields?: Set<'code' | 'custom_fields' | 'name'>, exact_match?: boolean, include_fields?: Set<'product.price'>, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { const localVarAxiosArgs = await localVarAxiosParamCreator.searchProducts(term, fields, exact_match, include_fields, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1785,10 +1785,10 @@ export interface ProductsApiSearchProductsRequest { /** * A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. - * @type {'code' | 'custom_fields' | 'name'} + * @type {Set<'code' | 'custom_fields' | 'name'>} * @memberof ProductsApiSearchProducts */ - readonly fields?: 'code' | 'custom_fields' | 'name' + readonly fields?: Set<'code' | 'custom_fields' | 'name'> /** * When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. @@ -1799,10 +1799,10 @@ export interface ProductsApiSearchProductsRequest { /** * Supports including optional fields in the results which are not provided by default - * @type {'product.price'} + * @type {Set<'product.price'>} * @memberof ProductsApiSearchProducts */ - readonly include_fields?: 'product.price' + readonly include_fields?: Set<'product.price'> /** * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. diff --git a/src/versions/v2/api/projects-api.ts b/src/versions/v2/api/projects-api.ts index f837919a..054ffe2b 100644 --- a/src/versions/v2/api/projects-api.ts +++ b/src/versions/v2/api/projects-api.ts @@ -444,7 +444,7 @@ export const ProjectsApiAxiosParamCreator = function (configuration?: Configurat * Searches all projects by title, description, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found projects can be filtered by person ID or organization ID. * @summary Search projects * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'custom_fields' | 'notes' | 'title' | 'description'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. + * @param {Set<'custom_fields' | 'notes' | 'title' | 'description'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. * @param {number} [person_id] Will filter projects by the provided person ID * @param {number} [organization_id] Will filter projects by the provided organization ID @@ -453,7 +453,7 @@ export const ProjectsApiAxiosParamCreator = function (configuration?: Configurat * @throws {RequiredError} */ - searchProjects: async (term: string, fields?: 'custom_fields' | 'notes' | 'title' | 'description', exact_match?: boolean, person_id?: number, organization_id?: number, limit?: number, cursor?: string, ): Promise => { + searchProjects: async (term: string, fields?: Set<'custom_fields' | 'notes' | 'title' | 'description'>, exact_match?: boolean, person_id?: number, organization_id?: number, limit?: number, cursor?: string, ): Promise => { // verify required parameter 'term' is not null or undefined assertParamExists('searchProjects', 'term', term) const localVarPath = `/projects/search`; @@ -479,8 +479,8 @@ export const ProjectsApiAxiosParamCreator = function (configuration?: Configurat localVarQueryParameter['term'] = term; } - if (fields !== undefined) { - localVarQueryParameter['fields'] = fields; + if (fields) { + localVarQueryParameter['fields'] = Array.from(fields).join(COLLECTION_FORMATS.csv); } if (exact_match !== undefined) { @@ -675,7 +675,7 @@ export const ProjectsApiFp = function(configuration?: Configuration) { * Searches all projects by title, description, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found projects can be filtered by person ID or organization ID. * @summary Search projects * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'custom_fields' | 'notes' | 'title' | 'description'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. + * @param {Set<'custom_fields' | 'notes' | 'title' | 'description'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. * @param {number} [person_id] Will filter projects by the provided person ID * @param {number} [organization_id] Will filter projects by the provided organization ID @@ -684,7 +684,7 @@ export const ProjectsApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ - async searchProjects(term: string, fields?: 'custom_fields' | 'notes' | 'title' | 'description', exact_match?: boolean, person_id?: number, organization_id?: number, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + async searchProjects(term: string, fields?: Set<'custom_fields' | 'notes' | 'title' | 'description'>, exact_match?: boolean, person_id?: number, organization_id?: number, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { const localVarAxiosArgs = await localVarAxiosParamCreator.searchProjects(term, fields, exact_match, person_id, organization_id, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1031,10 +1031,10 @@ export interface ProjectsApiSearchProjectsRequest { /** * A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. - * @type {'custom_fields' | 'notes' | 'title' | 'description'} + * @type {Set<'custom_fields' | 'notes' | 'title' | 'description'>} * @memberof ProjectsApiSearchProjects */ - readonly fields?: 'custom_fields' | 'notes' | 'title' | 'description' + readonly fields?: Set<'custom_fields' | 'notes' | 'title' | 'description'> /** * When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive.