From 3a3f448b03be57c42c17d9e31ed0a7e95800da37 Mon Sep 17 00:00:00 2001 From: "Sean S. LeBlanc" Date: Thu, 5 Oct 2023 09:40:33 -0400 Subject: [PATCH 1/6] fix: remove disallowed `user-agent` request header --- lib/request.js | 3 --- test/request.js | 8 -------- test/services.feeds.js | 7 ------- test/services.replace.js | 7 ------- test/services.upload.js | 7 ------- 5 files changed, 32 deletions(-) diff --git a/lib/request.js b/lib/request.js index 1de6454..fc6fbe4 100644 --- a/lib/request.js +++ b/lib/request.js @@ -20,9 +20,6 @@ function Request(method, url) { // keep track of all request params for oauth signing this.params = {}; - - // superagent no longer sets a default user agent header - this.set('user-agent', 'flickr-sdk/' + version); } Request.prototype = Object.create(request.Request.prototype); diff --git a/test/request.js b/test/request.js index 5fd7fb1..5b47ecd 100644 --- a/test/request.js +++ b/test/request.js @@ -13,14 +13,6 @@ describe('lib/request', function () { assert(subject('GET', 'http://www.example.com') instanceof Request); }); - it('has a default user agent', function () { - const req = subject('GET', 'http://www.example.com'); - - assert.strictEqual(req.get('user-agent'), - 'flickr-sdk/' + process.env.npm_package_version - ); - }); - it('supports request(url, callback)', function () { var end = sinon.stub(subject.Request.prototype, 'end').returnsThis(); var spy = sinon.spy(); diff --git a/test/services.feeds.js b/test/services.feeds.js index 83e435d..7d5b60a 100644 --- a/test/services.feeds.js +++ b/test/services.feeds.js @@ -18,13 +18,6 @@ describe('services/feeds', function () { assert(subject._('photos_public') instanceof Request); }); - it('adds default request headers', function () { - const req = subject._('photos_public'); - - assert.strictEqual(req.get('user-agent'), - 'flickr-sdk/' + process.env.npm_package_version); - }); - it('uses the correct path', function () { var req = subject._('photos_public'); var url = parse(req.url); diff --git a/test/services.replace.js b/test/services.replace.js index a1cfb16..2a5b7b5 100644 --- a/test/services.replace.js +++ b/test/services.replace.js @@ -34,13 +34,6 @@ describe('services/replace', function () { }); }); - it('adds default request headers', function () { - const req = new Subject(auth, 41234567890); - - assert.strictEqual(req.get('user-agent'), - 'flickr-sdk/' + process.env.npm_package_version); - }); - it('uses the correct method', function () { var req = new Subject(auth, 41234567890); diff --git a/test/services.upload.js b/test/services.upload.js index 4d1f2eb..8624f30 100644 --- a/test/services.upload.js +++ b/test/services.upload.js @@ -28,13 +28,6 @@ describe('services/upload', function () { }); }); - it('adds default request headers', function () { - const req = new Subject(auth, 41234567890); - - assert.strictEqual(req.get('user-agent'), - 'flickr-sdk/' + process.env.npm_package_version); - }); - it('uses the correct method', function () { var req = new Subject(auth); From 3fa44d768f41544fa9e63aacf094793437f1c116 Mon Sep 17 00:00:00 2001 From: "Sean S. LeBlanc" Date: Thu, 5 Oct 2023 09:51:29 -0400 Subject: [PATCH 2/6] fix: correct `tsc` script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 824d0d0..e4535c8 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "build-types": "node script/build-types > flickr-sdk.d.ts && npm run tsc", "build-client": "browserify -s Flickr $npm_package_main > flickr-sdk.js", "build": "npm run build-rest && npm run build-docs && npm run build-types && npm run build-client", - "tsc": "npx tsc", + "tsc": "npx -p typescript@5.x -c tsc", "lint": "eslint .", "test": "mocha", "coverage": "nyc mocha", From 7ec671eff0d3b2f5e060e7686b9067fc6459f585 Mon Sep 17 00:00:00 2001 From: "Sean S. LeBlanc" Date: Thu, 5 Oct 2023 09:57:26 -0400 Subject: [PATCH 3/6] downgrade TS to v4 might fix the CI/CD error --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e4535c8..ec5e869 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "build-types": "node script/build-types > flickr-sdk.d.ts && npm run tsc", "build-client": "browserify -s Flickr $npm_package_main > flickr-sdk.js", "build": "npm run build-rest && npm run build-docs && npm run build-types && npm run build-client", - "tsc": "npx -p typescript@5.x -c tsc", + "tsc": "npx -p typescript@4.x -c tsc", "lint": "eslint .", "test": "mocha", "coverage": "nyc mocha", From 74748775a10074bdc26c09e8f2c56ee47e3b3aa6 Mon Sep 17 00:00:00 2001 From: Jeremy Ruppel Date: Mon, 9 Oct 2023 13:40:49 -0400 Subject: [PATCH 4/6] Remove unused var --- lib/request.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/request.js b/lib/request.js index fc6fbe4..fa929f1 100644 --- a/lib/request.js +++ b/lib/request.js @@ -5,7 +5,6 @@ var request = require('superagent'); var parse = require('querystring').parse; -var version = require('../package.json').version; /** * Subclass superagent's Request class so that we can add From a1ad226a276fee72cf528e4df92f5027a26c5e2f Mon Sep 17 00:00:00 2001 From: Jeremy Ruppel Date: Mon, 9 Oct 2023 13:41:17 -0400 Subject: [PATCH 5/6] Remove build-tests from git hook --- hook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook.sh b/hook.sh index bcc9fc4..cd4620e 100755 --- a/hook.sh +++ b/hook.sh @@ -5,7 +5,7 @@ set -ex node package.json npm run build-rest npm run build-docs -npm run build-tests +# npm run build-tests npm run build-client npm run tsc npm run lint From f094d1e393fd1accf7dff46a3fb536b1d8b4c816 Mon Sep 17 00:00:00 2001 From: Jeremy Ruppel Date: Mon, 9 Oct 2023 13:41:21 -0400 Subject: [PATCH 6/6] 6.3.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ec5e869..a63bbf7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flickr-sdk", - "version": "6.2.1", + "version": "6.3.0", "description": "Almost certainly the best Flickr API client in the world for node and the browser", "keywords": [ "flickr",