From b8bb28f3d82d002e3cdb4d46a8d78c8f52f532a1 Mon Sep 17 00:00:00 2001 From: Assaf Shomer Houzz <47712834+assafshomerivy@users.noreply.github.com> Date: Sun, 1 Dec 2024 13:43:47 +0200 Subject: [PATCH] feat: ACC-508/Support for adding extra url params (#2) * Support for adding extra url params * Add Houzz sub-version and update urls to houzz * fix version --- index.js | 15 +++++++++++++++ package-lock.json | 4 ++-- package.json | 10 +++++----- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index 25ad381..7b821df 100644 --- a/index.js +++ b/index.js @@ -2340,6 +2340,21 @@ module.request = function(context, verb, options, entity, callback) { if (options.url === QuickBooks.RECONNECT_URL || options.url == QuickBooks.DISCONNECT_URL || options.url === QuickBooks.REVOKE_URL || options.url === QuickBooks.USER_INFO_URL) { url = options.url } + + var urlParams = (entity || {})['addUrlParams']; + + if (urlParams) { + const urlObj = new URL(url); + const sp = urlObj.searchParams; + + _.forEach(urlParams, (value, key) => { + sp.append(key, value); + }); + + url = urlObj.toString(); + delete entity.addUrlParams; + } + var opts = { url: url, qs: options.qs || {}, diff --git a/package-lock.json b/package-lock.json index 23cf58a..ce8be32 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "node-quickbooks", - "version": "2.0.45", + "version": "2.0.45-HZ-1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "node-quickbooks", - "version": "2.0.45", + "version": "2.0.45-HZ-1", "license": "ISC", "dependencies": { "bluebird": "3.3.4", diff --git a/package.json b/package.json index 8fd6bbf..b5d59d9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "node-quickbooks", - "version": "2.0.45", - "description": "node.js client for Intuit's IPP QuickBooks V3 API.", + "version": "2.0.45-HZ-1", + "description": "Houzz fork of node.js client for Intuit's IPP QuickBooks V3 API.", "main": "index.js", "scripts": { "test": "mocha" @@ -37,10 +37,10 @@ }, "repository": { "type": "git", - "url": "https://github.com/mcohen01/node-quickbooks.git" + "url": "https://github.com/Houzz/node-quickbooks.git" }, "bugs": { - "url": "https://github.com/mcohen01/node-quickbooks/issues" + "url": "https://github.com/Houzz/node-quickbooks.git/issues" }, - "homepage": "https://github.com/mcohen01/node-quickbooks" + "homepage": "https://github.com/Houzz/node-quickbooks" }