From 23875a08e583dba0fb1721f515a1be9eab23502f Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Tue, 7 Dec 2021 18:12:00 -0800 Subject: [PATCH] Remove the preferences endpoints (#54) * Remove preferences * Update changelog * Clean-up --- CHANGELOG.md | 6 + package-lock.json | 4 +- package.json | 2 +- src/ApiClient.js | 10 +- src/api/EstimatesApi.js | 2 +- src/api/OrdersApi.js | 2 +- src/api/PreferencesApi.js | 183 --------------------- src/api/ProjectsApi.js | 2 +- src/api/TechnologyTypesApi.js | 2 +- src/index.js | 5 +- src/model/Allocation.js | 2 +- src/model/CreateBitcoinEstimateRequest.js | 2 +- src/model/CreateEthereumEstimateRequest.js | 2 +- src/model/CreateFlightEstimateRequest.js | 2 +- src/model/CreateMassEstimateRequest.js | 2 +- src/model/CreateOrderRequest.js | 2 +- src/model/CreateShippingEstimateRequest.js | 2 +- src/model/CreateSuccessResponse.js | 2 +- src/model/CreateVehicleEstimateRequest.js | 2 +- src/model/ErrorResponse.js | 2 +- src/model/Estimate.js | 2 +- src/model/EstimateListResponse.js | 2 +- src/model/EstimateResponse.js | 2 +- src/model/Highlight.js | 2 +- src/model/MetaIndexObject.js | 2 +- src/model/Order.js | 2 +- src/model/OrderListResponse.js | 2 +- src/model/OrderResponse.js | 2 +- src/model/ParentTechnologyType.js | 2 +- src/model/Photo.js | 2 +- src/model/Preference.js | 51 ------ src/model/PreferenceListResponse.js | 56 ------- src/model/PreferenceResponse.js | 48 ------ src/model/Project.js | 2 +- src/model/ProjectListResponse.js | 2 +- src/model/ProjectResponse.js | 2 +- src/model/Sdg.js | 2 +- src/model/Standard.js | 2 +- src/model/TechnologyType.js | 2 +- src/model/TechnologyTypeListResponse.js | 2 +- test/integration/preferences.test.js | 45 ----- 41 files changed, 46 insertions(+), 426 deletions(-) delete mode 100644 src/api/PreferencesApi.js delete mode 100644 src/model/Preference.js delete mode 100644 src/model/PreferenceListResponse.js delete mode 100644 src/model/PreferenceResponse.js delete mode 100644 test/integration/preferences.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ba4d1d..f8057a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.16.0] - 2021-12-07 + +### Removed + +- Removes the `preferences` endpoints (deprecated) + ## [1.15.2] - 2021-11-08 ### Added diff --git a/package-lock.json b/package-lock.json index 9c144a5..09f7a90 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@patch-technology/patch", - "version": "1.15.2", + "version": "1.16.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@patch-technology/patch", - "version": "1.15.2", + "version": "1.16.0", "license": "MIT", "dependencies": { "query-string": "^7.0.1", diff --git a/package.json b/package.json index e9a17ea..a6e9311 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@patch-technology/patch", - "version": "1.15.2", + "version": "1.16.0", "description": "Node.js wrapper for the Patch API", "license": "MIT", "repository": { diff --git a/src/ApiClient.js b/src/ApiClient.js index 964959f..58ac858 100644 --- a/src/ApiClient.js +++ b/src/ApiClient.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import superagent from 'superagent'; @@ -16,7 +16,7 @@ class ApiClient { }; this.defaultHeaders = { - 'User-Agent': 'patch-node/1.15.2' + 'User-Agent': 'patch-node/1.16.0' }; /** @@ -457,13 +457,13 @@ class ApiClient { hostSettings() { return [ { - url: 'https://{defaultHost}', + url: '{defaultUrl}', description: 'No description provided', variables: { - defaultHost: { + defaultUrl: { description: 'No description provided', - default_value: 'api.patch.io', + default_value: 'https://api.patch.io', enum_values: [] } } diff --git a/src/api/EstimatesApi.js b/src/api/EstimatesApi.js index 7254fc3..925af83 100644 --- a/src/api/EstimatesApi.js +++ b/src/api/EstimatesApi.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/api/OrdersApi.js b/src/api/OrdersApi.js index 036f521..134b72c 100644 --- a/src/api/OrdersApi.js +++ b/src/api/OrdersApi.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/api/PreferencesApi.js b/src/api/PreferencesApi.js deleted file mode 100644 index c43ff70..0000000 --- a/src/api/PreferencesApi.js +++ /dev/null @@ -1,183 +0,0 @@ -/** - * Patch API V1 - * The core API used to integrate with Patch's service - * - * Contact: developers@usepatch.com - */ - -import ApiClient from '../ApiClient'; -import CreatePreferenceRequest from '../model/CreatePreferenceRequest'; -import ErrorResponse from '../model/ErrorResponse'; -import PreferenceListResponse from '../model/PreferenceListResponse'; -import PreferenceResponse from '../model/PreferenceResponse'; - -export default class PreferencesApi { - constructor(apiClient) { - this.apiClient = apiClient || ApiClient.instance; - } - - createPreferenceWithHttpInfo(createPreferenceRequest) { - const _createPreferenceRequest = - CreatePreferenceRequest.constructFromObject( - createPreferenceRequest, - new CreatePreferenceRequest() - ); - let postBody = _createPreferenceRequest; - - // verify the required parameter 'createPreferenceRequest' is set - if ( - _createPreferenceRequest === undefined || - _createPreferenceRequest === null - ) { - throw new Error( - "Missing the required parameter 'createPreferenceRequest' when calling createPreference" - ); - } - - let pathParams = {}; - let queryParams = {}; - let headerParams = {}; - let formParams = {}; - - let authNames = ['bearer_auth']; - let contentTypes = ['application/json']; - let accepts = ['application/json']; - let returnType = PreferenceResponse; - - return this.apiClient.callApi( - '/v1/preferences', - 'POST', - pathParams, - queryParams, - headerParams, - formParams, - postBody, - authNames, - contentTypes, - accepts, - returnType - ); - } - - createPreference(createPreferenceRequest) { - return this.createPreferenceWithHttpInfo(createPreferenceRequest); - } - - deletePreferenceWithHttpInfo(id) { - let postBody = null; - - // verify the required parameter 'id' is set - if (id === undefined || id === null) { - throw new Error( - "Missing the required parameter 'id' when calling deletePreference" - ); - } - - let pathParams = { - id: id - }; - let queryParams = {}; - let headerParams = {}; - let formParams = {}; - - let authNames = ['bearer_auth']; - let contentTypes = []; - let accepts = ['application/json']; - let returnType = PreferenceResponse; - - return this.apiClient.callApi( - '/v1/preferences/{id}', - 'DELETE', - pathParams, - queryParams, - headerParams, - formParams, - postBody, - authNames, - contentTypes, - accepts, - returnType - ); - } - - deletePreference(id) { - return this.deletePreferenceWithHttpInfo(id); - } - - retrievePreferenceWithHttpInfo(id) { - let postBody = null; - - // verify the required parameter 'id' is set - if (id === undefined || id === null) { - throw new Error( - "Missing the required parameter 'id' when calling retrievePreference" - ); - } - - let pathParams = { - id: id - }; - let queryParams = {}; - let headerParams = {}; - let formParams = {}; - - let authNames = ['bearer_auth']; - let contentTypes = []; - let accepts = ['application/json']; - let returnType = PreferenceResponse; - - return this.apiClient.callApi( - '/v1/preferences/{id}', - 'GET', - pathParams, - queryParams, - headerParams, - formParams, - postBody, - authNames, - contentTypes, - accepts, - returnType - ); - } - - retrievePreference(id) { - return this.retrievePreferenceWithHttpInfo(id); - } - - retrievePreferencesWithHttpInfo(opts) { - opts = opts || {}; - - let postBody = null; - - let pathParams = {}; - let queryParams = { - page: opts['page'] - }; - let headerParams = {}; - let formParams = {}; - - let authNames = ['bearer_auth']; - let contentTypes = []; - let accepts = ['application/json']; - let returnType = PreferenceListResponse; - - return this.apiClient.callApi( - '/v1/preferences', - 'GET', - pathParams, - queryParams, - headerParams, - formParams, - postBody, - authNames, - contentTypes, - accepts, - returnType - ); - } - - retrievePreferences(opts) { - return this.retrievePreferencesWithHttpInfo(opts); - } -} diff --git a/src/api/ProjectsApi.js b/src/api/ProjectsApi.js index 7c8c1bf..ab4748d 100644 --- a/src/api/ProjectsApi.js +++ b/src/api/ProjectsApi.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/api/TechnologyTypesApi.js b/src/api/TechnologyTypesApi.js index 09713d6..03b0e2c 100644 --- a/src/api/TechnologyTypesApi.js +++ b/src/api/TechnologyTypesApi.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/index.js b/src/index.js index 217ca90..dd248fb 100644 --- a/src/index.js +++ b/src/index.js @@ -2,13 +2,12 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from './ApiClient'; import EstimatesApi from './api/EstimatesApi'; import OrdersApi from './api/OrdersApi'; -import PreferencesApi from './api/PreferencesApi'; import ProjectsApi from './api/ProjectsApi'; import TechnologyTypesApi from './api/TechnologyTypesApi'; @@ -22,8 +21,6 @@ export default function Patch(accessToken) { this.orders = new OrdersApi(this.client); - this.preferences = new PreferencesApi(this.client); - this.projects = new ProjectsApi(this.client); this.technologytypes = new TechnologyTypesApi(this.client); diff --git a/src/model/Allocation.js b/src/model/Allocation.js index 3e9248a..8974752 100644 --- a/src/model/Allocation.js +++ b/src/model/Allocation.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/CreateBitcoinEstimateRequest.js b/src/model/CreateBitcoinEstimateRequest.js index 2d441ff..cf38a67 100644 --- a/src/model/CreateBitcoinEstimateRequest.js +++ b/src/model/CreateBitcoinEstimateRequest.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/CreateEthereumEstimateRequest.js b/src/model/CreateEthereumEstimateRequest.js index 655d0ff..6ba7867 100644 --- a/src/model/CreateEthereumEstimateRequest.js +++ b/src/model/CreateEthereumEstimateRequest.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/CreateFlightEstimateRequest.js b/src/model/CreateFlightEstimateRequest.js index 274777b..2ea7bcf 100644 --- a/src/model/CreateFlightEstimateRequest.js +++ b/src/model/CreateFlightEstimateRequest.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/CreateMassEstimateRequest.js b/src/model/CreateMassEstimateRequest.js index d89654f..490d62f 100644 --- a/src/model/CreateMassEstimateRequest.js +++ b/src/model/CreateMassEstimateRequest.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/CreateOrderRequest.js b/src/model/CreateOrderRequest.js index f37ef76..cdb0f7c 100644 --- a/src/model/CreateOrderRequest.js +++ b/src/model/CreateOrderRequest.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/CreateShippingEstimateRequest.js b/src/model/CreateShippingEstimateRequest.js index f0b2b48..5e33250 100644 --- a/src/model/CreateShippingEstimateRequest.js +++ b/src/model/CreateShippingEstimateRequest.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/CreateSuccessResponse.js b/src/model/CreateSuccessResponse.js index 812642b..34d85bf 100644 --- a/src/model/CreateSuccessResponse.js +++ b/src/model/CreateSuccessResponse.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/CreateVehicleEstimateRequest.js b/src/model/CreateVehicleEstimateRequest.js index 7cc9cd8..afc8ba7 100644 --- a/src/model/CreateVehicleEstimateRequest.js +++ b/src/model/CreateVehicleEstimateRequest.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/ErrorResponse.js b/src/model/ErrorResponse.js index 57fa749..720f7f8 100644 --- a/src/model/ErrorResponse.js +++ b/src/model/ErrorResponse.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/Estimate.js b/src/model/Estimate.js index 9789a9a..3ecc691 100644 --- a/src/model/Estimate.js +++ b/src/model/Estimate.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/EstimateListResponse.js b/src/model/EstimateListResponse.js index 3e4e400..2d6c8e8 100644 --- a/src/model/EstimateListResponse.js +++ b/src/model/EstimateListResponse.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/EstimateResponse.js b/src/model/EstimateResponse.js index e77ba7b..85cc0d7 100644 --- a/src/model/EstimateResponse.js +++ b/src/model/EstimateResponse.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/Highlight.js b/src/model/Highlight.js index a046201..7daa454 100644 --- a/src/model/Highlight.js +++ b/src/model/Highlight.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/MetaIndexObject.js b/src/model/MetaIndexObject.js index ac3aff9..324181d 100644 --- a/src/model/MetaIndexObject.js +++ b/src/model/MetaIndexObject.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/Order.js b/src/model/Order.js index 7662929..b313a2f 100644 --- a/src/model/Order.js +++ b/src/model/Order.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/OrderListResponse.js b/src/model/OrderListResponse.js index 05bd5aa..d95ad75 100644 --- a/src/model/OrderListResponse.js +++ b/src/model/OrderListResponse.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/OrderResponse.js b/src/model/OrderResponse.js index fee9623..3b2696e 100644 --- a/src/model/OrderResponse.js +++ b/src/model/OrderResponse.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/ParentTechnologyType.js b/src/model/ParentTechnologyType.js index 113331d..6030d48 100644 --- a/src/model/ParentTechnologyType.js +++ b/src/model/ParentTechnologyType.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/Photo.js b/src/model/Photo.js index 3d9b724..461db40 100644 --- a/src/model/Photo.js +++ b/src/model/Photo.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/Preference.js b/src/model/Preference.js deleted file mode 100644 index 8d5618a..0000000 --- a/src/model/Preference.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Patch API V1 - * The core API used to integrate with Patch's service - * - * Contact: developers@usepatch.com - */ - -import ApiClient from '../ApiClient'; -import Project from './Project'; - -class Preference { - constructor(id, allocationPercentage, project) { - Preference.initialize(this, id, allocationPercentage, project); - } - - static initialize(obj, id, allocationPercentage, project) { - obj['id'] = id; - obj['allocation_percentage'] = allocationPercentage; - obj['project'] = project; - } - - static constructFromObject(data, obj) { - if (data) { - obj = obj || new Preference(); - - if (data.hasOwnProperty('id')) { - obj['id'] = ApiClient.convertToType(data['id'], 'String'); - } - - if (data.hasOwnProperty('allocation_percentage')) { - obj['allocation_percentage'] = ApiClient.convertToType( - data['allocation_percentage'], - 'Number' - ); - } - - if (data.hasOwnProperty('project')) { - obj['project'] = ApiClient.convertToType(data['project'], Project); - } - } - return obj; - } -} - -Preference.prototype['id'] = undefined; - -Preference.prototype['allocation_percentage'] = undefined; - -Preference.prototype['project'] = undefined; - -export default Preference; diff --git a/src/model/PreferenceListResponse.js b/src/model/PreferenceListResponse.js deleted file mode 100644 index 48fc6d8..0000000 --- a/src/model/PreferenceListResponse.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Patch API V1 - * The core API used to integrate with Patch's service - * - * Contact: developers@usepatch.com - */ - -import ApiClient from '../ApiClient'; -import MetaIndexObject from './MetaIndexObject'; -import Preference from './Preference'; - -class PreferenceListResponse { - constructor(success, error, data, meta) { - PreferenceListResponse.initialize(this, success, error, data, meta); - } - - static initialize(obj, success, error, data, meta) { - obj['success'] = success; - obj['error'] = error; - obj['data'] = data; - obj['meta'] = meta; - } - - static constructFromObject(data, obj) { - if (data) { - obj = obj || new PreferenceListResponse(); - - if (data.hasOwnProperty('success')) { - obj['success'] = ApiClient.convertToType(data['success'], 'Boolean'); - } - - if (data.hasOwnProperty('error')) { - obj['error'] = ApiClient.convertToType(data['error'], Object); - } - - if (data.hasOwnProperty('data')) { - obj['data'] = ApiClient.convertToType(data['data'], [Preference]); - } - - if (data.hasOwnProperty('meta')) { - obj['meta'] = MetaIndexObject.constructFromObject(data['meta']); - } - } - return obj; - } -} - -PreferenceListResponse.prototype['success'] = undefined; - -PreferenceListResponse.prototype['error'] = undefined; - -PreferenceListResponse.prototype['data'] = undefined; - -PreferenceListResponse.prototype['meta'] = undefined; - -export default PreferenceListResponse; diff --git a/src/model/PreferenceResponse.js b/src/model/PreferenceResponse.js deleted file mode 100644 index 1797e30..0000000 --- a/src/model/PreferenceResponse.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Patch API V1 - * The core API used to integrate with Patch's service - * - * Contact: developers@usepatch.com - */ - -import ApiClient from '../ApiClient'; -import Preference from './Preference'; - -class PreferenceResponse { - constructor(success, error, data) { - PreferenceResponse.initialize(this, success, error, data); - } - - static initialize(obj, success, error, data) { - obj['success'] = success; - obj['error'] = error; - obj['data'] = data; - } - - static constructFromObject(data, obj) { - if (data) { - obj = obj || new PreferenceResponse(); - - if (data.hasOwnProperty('success')) { - obj['success'] = ApiClient.convertToType(data['success'], 'Boolean'); - } - - if (data.hasOwnProperty('error')) { - obj['error'] = ApiClient.convertToType(data['error'], Object); - } - - if (data.hasOwnProperty('data')) { - obj['data'] = Preference.constructFromObject(data['data']); - } - } - return obj; - } -} - -PreferenceResponse.prototype['success'] = undefined; - -PreferenceResponse.prototype['error'] = undefined; - -PreferenceResponse.prototype['data'] = undefined; - -export default PreferenceResponse; diff --git a/src/model/Project.js b/src/model/Project.js index 57056d8..5e3c2e4 100644 --- a/src/model/Project.js +++ b/src/model/Project.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/ProjectListResponse.js b/src/model/ProjectListResponse.js index a33dde2..3bb5441 100644 --- a/src/model/ProjectListResponse.js +++ b/src/model/ProjectListResponse.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/ProjectResponse.js b/src/model/ProjectResponse.js index 8b6e12e..f4f210f 100644 --- a/src/model/ProjectResponse.js +++ b/src/model/ProjectResponse.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/Sdg.js b/src/model/Sdg.js index 850dfbe..bf05ca9 100644 --- a/src/model/Sdg.js +++ b/src/model/Sdg.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/Standard.js b/src/model/Standard.js index 883c9e7..3d92fcf 100644 --- a/src/model/Standard.js +++ b/src/model/Standard.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/TechnologyType.js b/src/model/TechnologyType.js index f16ea74..b201c46 100644 --- a/src/model/TechnologyType.js +++ b/src/model/TechnologyType.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/src/model/TechnologyTypeListResponse.js b/src/model/TechnologyTypeListResponse.js index 7938084..5c5c024 100644 --- a/src/model/TechnologyTypeListResponse.js +++ b/src/model/TechnologyTypeListResponse.js @@ -2,7 +2,7 @@ * Patch API V1 * The core API used to integrate with Patch's service * - * Contact: developers@usepatch.com + * Contact: engineering@usepatch.com */ import ApiClient from '../ApiClient'; diff --git a/test/integration/preferences.test.js b/test/integration/preferences.test.js deleted file mode 100644 index 21f8560..0000000 --- a/test/integration/preferences.test.js +++ /dev/null @@ -1,45 +0,0 @@ -import { expect } from 'chai'; -import Patch from '../../dist/index'; -const patch = Patch(process.env.SANDBOX_API_KEY); - -async function getProjectId() { - const retrieveProjectResponse = await patch.projects.retrieveProjects(); - return retrieveProjectResponse.data[0].id; -} - -describe('Preferences Integration', async function () { - it('supports creating, deleting, and listing preferences', async function () { - const projectId = await getProjectId(); - - let preferenceId; - - try { - const createdPreference = await patch.preferences.createPreference({ - project_id: projectId - }); - preferenceId = createdPreference.data.id; - } catch (err) { - if ( - !/Your organization already has a preferred project/.test( - err.error.message - ) - ) { - throw err; - } - const preferencesList = await patch.preferences.retrievePreferences(); - preferenceId = preferencesList.data[0].id; - } - - const preferencesList = await patch.preferences.retrievePreferences(); - expect(preferencesList.data.length).to.be.above(0); - - const preferencesResponse = await patch.preferences.retrievePreference( - preferenceId - ); - expect(preferencesResponse.data.id).to.eq(preferenceId); - - const deletePreferenceResponse = - await patch.preferences.retrievePreferences(preferenceId); - expect(deletePreferenceResponse.data[0].id).to.eq(preferenceId); - }); -});