HEX
Server: nginx/1.18.0
System: Linux test-ipsremont 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
User: ips (1000)
PHP: 8.0.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/quadcode.com/node_modules/pipedrive/dist/api/SearchResultsApi.js
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
var _NumberBoolean = _interopRequireDefault(require("../model/NumberBoolean"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } /**
 * Pipedrive API v1
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 *
 */
/**
* SearchResults service.
* @module api/SearchResultsApi
* @version 1.0.0
*/
var SearchResultsApi = /*#__PURE__*/function () {
  /**
  * Constructs a new SearchResultsApi. 
  * @alias module:api/SearchResultsApi
  * @class
  * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
  * default to {@link module:ApiClient#instance} if unspecified.
  */
  function SearchResultsApi(apiClient) {
    (0, _classCallCheck2["default"])(this, SearchResultsApi);
    this.apiClient = apiClient || _ApiClient["default"].instance;
  }

  /**
   * Perform a search
   * This endpoint is deprecated. Please use <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> instead. <br> Performs a search across the account and returns SearchResults.
   * @param {String} term Search term to look for, minimum 2 characters.
   * @param {Object} opts Optional parameters
   * @param {module:model/String} opts.itemType Search for items of exact type. If omitted, all types of items are searched.
   * @param {Number} opts.start Pagination start (default to 0)
   * @param {Number} opts.limit Items shown per page
   * @param {module:model/NumberBoolean} opts.exactMatch When enabled, only full exact matches against the given term are returned. The minimum 2 character limit for the term is discarded when exact_match is enabled. It will only work if search term is 30 characters or less.
   * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response
   */
  (0, _createClass2["default"])(SearchResultsApi, [{
    key: "searchWithHttpInfo",
    value: function searchWithHttpInfo(term, opts) {
      opts = opts || {};
      var postBody = null;
      // verify the required parameter 'term' is set
      if (term === undefined || term === null) {
        throw new Error("Missing the required parameter 'term' when calling search");
      }
      var pathParams = {};
      var queryParams = {
        'term': term,
        'item_type': opts['itemType'],
        'start': opts['start'],
        'limit': opts['limit'],
        'exact_match': opts['exactMatch']
      };
      var headerParams = {};
      var formParams = {};
      var formParamArray = [];
      var contentTypes = [];
      var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
      var isJSON = contentTypes.includes('application/json');
      if (isJSON) {
        postBody = _objectSpread(_objectSpread({}, postBody), opts);
      } else if (isURLEncoded) {
        for (var key in opts) {
          if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
            formParams[key] = opts[key];
          }
        }
      }
      var authNames = ['api_key', 'oauth2'];
      var accepts = ['application/json'];
      var returnType = Object;
      return this.apiClient.callApi('/searchResults', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Perform a search
     * This endpoint is deprecated. Please use <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> instead. <br> Performs a search across the account and returns SearchResults.
     * @param {String} term Search term to look for, minimum 2 characters.
     * @param {Object} opts Optional parameters
     * @param {module:model/String} opts.itemType Search for items of exact type. If omitted, all types of items are searched.
     * @param {Number} opts.start Pagination start (default to 0)
     * @param {Number} opts.limit Items shown per page
     * @param {module:model/NumberBoolean} opts.exactMatch When enabled, only full exact matches against the given term are returned. The minimum 2 character limit for the term is discarded when exact_match is enabled. It will only work if search term is 30 characters or less.
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object}
     */
  }, {
    key: "search",
    value: function search(term, opts) {
      return this.searchWithHttpInfo(term, opts).then(function (response_and_data) {
        return response_and_data;
      });
    }

    /**
     * Perform a search using a specific field value
     * This endpoint is deprecated. Please use <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItemByField\">/v1/itemSearch/field</a> instead. <br>  Performs a search from a specific field's values. Results can be either the distinct values of the field (useful for searching autocomplete field values), or actual items IDs (deals, persons, organizations or products).
     * @param {String} term Search term to look for, minimum 2 characters.
     * @param {module:model/String} fieldType Type of the field to perform the search from.
     * @param {String} fieldKey Key of the field to search from. Field key can be obtained by fetching the list of fields using any of fields API GET methods (dealFields, personFields, ..).
     * @param {Object} opts Optional parameters
     * @param {module:model/NumberBoolean} opts.exactMatch When enabled, only full exact matches against the given term are returned. By default, term can be present anywhere in the resulting field values to be considered a match. The minimum 2 character limit for the term is discarded when exact_match is enabled.
     * @param {String} opts.returnFieldKey Name of the field in search results from which the search was performed. When omitted, 'value' will be used. You may want to set this parameter to match the field_key.
     * @param {module:model/NumberBoolean} opts.returnItemIds Whether to return matching items IDs in search results. When omitted or set to 0, only distinct values of the searched field are returned. When enabled, the return_field_key parameter is ignored and the results include the searched field as its own key.
     * @param {Number} opts.start Pagination start (default to 0)
     * @param {Number} opts.limit Items shown per page
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response
     */
  }, {
    key: "searchByFieldWithHttpInfo",
    value: function searchByFieldWithHttpInfo(term, fieldType, fieldKey, opts) {
      opts = opts || {};
      var postBody = null;
      // verify the required parameter 'term' is set
      if (term === undefined || term === null) {
        throw new Error("Missing the required parameter 'term' when calling searchByField");
      }
      // verify the required parameter 'fieldType' is set
      if (fieldType === undefined || fieldType === null) {
        throw new Error("Missing the required parameter 'fieldType' when calling searchByField");
      }
      // verify the required parameter 'fieldKey' is set
      if (fieldKey === undefined || fieldKey === null) {
        throw new Error("Missing the required parameter 'fieldKey' when calling searchByField");
      }
      var pathParams = {};
      var queryParams = {
        'term': term,
        'exact_match': opts['exactMatch'],
        'field_type': fieldType,
        'field_key': fieldKey,
        'return_field_key': opts['returnFieldKey'],
        'return_item_ids': opts['returnItemIds'],
        'start': opts['start'],
        'limit': opts['limit']
      };
      var headerParams = {};
      var formParams = {};
      var formParamArray = [];
      var contentTypes = [];
      var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
      var isJSON = contentTypes.includes('application/json');
      if (isJSON) {
        postBody = _objectSpread(_objectSpread({}, postBody), opts);
      } else if (isURLEncoded) {
        for (var key in opts) {
          if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
            formParams[key] = opts[key];
          }
        }
      }
      var authNames = ['api_key', 'oauth2'];
      var accepts = ['application/json'];
      var returnType = Object;
      return this.apiClient.callApi('/searchResults/field', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Perform a search using a specific field value
     * This endpoint is deprecated. Please use <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItemByField\">/v1/itemSearch/field</a> instead. <br>  Performs a search from a specific field's values. Results can be either the distinct values of the field (useful for searching autocomplete field values), or actual items IDs (deals, persons, organizations or products).
     * @param {String} term Search term to look for, minimum 2 characters.
     * @param {module:model/String} fieldType Type of the field to perform the search from.
     * @param {String} fieldKey Key of the field to search from. Field key can be obtained by fetching the list of fields using any of fields API GET methods (dealFields, personFields, ..).
     * @param {Object} opts Optional parameters
     * @param {module:model/NumberBoolean} opts.exactMatch When enabled, only full exact matches against the given term are returned. By default, term can be present anywhere in the resulting field values to be considered a match. The minimum 2 character limit for the term is discarded when exact_match is enabled.
     * @param {String} opts.returnFieldKey Name of the field in search results from which the search was performed. When omitted, 'value' will be used. You may want to set this parameter to match the field_key.
     * @param {module:model/NumberBoolean} opts.returnItemIds Whether to return matching items IDs in search results. When omitted or set to 0, only distinct values of the searched field are returned. When enabled, the return_field_key parameter is ignored and the results include the searched field as its own key.
     * @param {Number} opts.start Pagination start (default to 0)
     * @param {Number} opts.limit Items shown per page
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object}
     */
  }, {
    key: "searchByField",
    value: function searchByField(term, fieldType, fieldKey, opts) {
      return this.searchByFieldWithHttpInfo(term, fieldType, fieldKey, opts).then(function (response_and_data) {
        return response_and_data;
      });
    }
  }]);
  return SearchResultsApi;
}();
exports["default"] = SearchResultsApi;