mediawiki/services/citoid (main)

sourcepatches
From 529c81780cd4862e4029480d1c85100dfc0e185d Mon Sep 17 00:00:00 2001
From: libraryupgrader <tools.libraryupgrader@tools.wmflabs.org>
Date: Wed, 16 Jun 2021 11:24:46 +0000
Subject: [PATCH] build: Updating glob-parent to 5.1.2

* https://npmjs.com/advisories/1751 (CVE-2020-28469)

Change-Id: Ic5096663c5c4653d997f25042f730c1c9679e6c9
---
 package-lock.json | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package-lock.json b/package-lock.json
index a1b8fe9..06522d0 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -2480,9 +2480,9 @@
 			}
 		},
 		"glob-parent": {
-			"version": "5.1.1",
-			"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz",
-			"integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==",
+			"version": "5.1.2",
+			"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
+			"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
 			"dev": true,
 			"requires": {
 				"is-glob": "^4.0.1"
-- 
2.20.1

$ date
Wed Jun 16 11:23:49 UTC 2021

$ git clone file:///srv/git/mediawiki-services-citoid.git repo --depth=1 -b master
Cloning into 'repo'...

$ git config user.name libraryupgrader

$ git config user.email tools.libraryupgrader@tools.wmflabs.org

$ git submodule update --init

$ grr init
Installed commit-msg hook.

$ git show-ref refs/heads/master
ea68e28ecde37a7fbcdd8ecfbd33b8d8358c4234 refs/heads/master

Attempting to npm audit fix
$ npm audit fix --only=dev

> core-js@3.11.0 postinstall /src/repo/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

added 268 packages from 618 contributors in 9.749s

22 packages are looking for funding
  run `npm fund` for details

fixed 2 of 12 vulnerabilities in 615 scanned packages
  1 package update for 1 vulnerability involved breaking changes
  (use `npm audit fix --force` to install breaking changes; or refer to `npm audit` for steps to fix these manually)

$ npm audit fix --only=dev
up to date in 2.416s

22 packages are looking for funding
  run `npm fund` for details

fixed 0 of 10 vulnerabilities in 615 scanned packages
  1 package update for 1 vulnerability involved breaking changes
  (use `npm audit fix --force` to install breaking changes; or refer to `npm audit` for steps to fix these manually)

$ npm audit fix --only=dev
up to date in 2.392s

22 packages are looking for funding
  run `npm fund` for details

fixed 0 of 10 vulnerabilities in 615 scanned packages
  1 package update for 1 vulnerability involved breaking changes
  (use `npm audit fix --force` to install breaking changes; or refer to `npm audit` for steps to fix these manually)

$ package-lock-lint package-lock.json
0 issues found in: package-lock.json

Verifying that tests still pass
$ npm ci
npm WARN prepare removing existing node_modules/ before installation

> dtrace-provider@0.8.8 install /src/repo/node_modules/dtrace-provider
> node-gyp rebuild || node suppress-error.js

make: Entering directory '/src/repo/node_modules/dtrace-provider/build'
  TOUCH Release/obj.target/DTraceProviderStub.stamp
make: Leaving directory '/src/repo/node_modules/dtrace-provider/build'

> unix-dgram@2.0.4 install /src/repo/node_modules/unix-dgram
> node-gyp rebuild

make: Entering directory '/src/repo/node_modules/unix-dgram/build'
  CXX(target) Release/obj.target/unix_dgram/src/unix_dgram.o
In file included from ../../nan/nan.h:56,
                 from ../src/unix_dgram.cc:5:
/cache/node-gyp/10.24.0/include/node/node.h:573:43: warning: cast between incompatible function types from ‘void (*)(v8::Local<v8::Object>)’ to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
       (node::addon_register_func) (regfunc),                          \
                                           ^
/cache/node-gyp/10.24.0/include/node/node.h:607:3: note: in expansion of macro ‘NODE_MODULE_X’
   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
   ^~~~~~~~~~~~~
../src/unix_dgram.cc:404:1: note: in expansion of macro ‘NODE_MODULE’
 NODE_MODULE(unix_dgram, Initialize)
 ^~~~~~~~~~~
In file included from /cache/node-gyp/10.24.0/include/node/node.h:63,
                 from ../../nan/nan.h:56,
                 from ../src/unix_dgram.cc:5:
/cache/node-gyp/10.24.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’:
/cache/node-gyp/10.24.0/include/node/node_object_wrap.h:84:78:   required from here
/cache/node-gyp/10.24.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
                reinterpret_cast<Callback>(callback), type);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/cache/node-gyp/10.24.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
../../nan/nan_object_wrap.h:65:61:   required from here
/cache/node-gyp/10.24.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
  SOLINK_MODULE(target) Release/obj.target/unix_dgram.node
  COPY Release/unix_dgram.node
make: Leaving directory '/src/repo/node_modules/unix-dgram/build'

> heapdump@0.3.15 install /src/repo/node_modules/heapdump
> node-gyp rebuild

make: Entering directory '/src/repo/node_modules/heapdump/build'
  CXX(target) Release/obj.target/addon/src/heapdump.o
In file included from ../src/heapdump.cc:15:
/cache/node-gyp/10.24.0/include/node/node.h:573:43: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
       (node::addon_register_func) (regfunc),                          \
                                           ^
/cache/node-gyp/10.24.0/include/node/node.h:607:3: note: in expansion of macro ‘NODE_MODULE_X’
   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
   ^~~~~~~~~~~~~
../src/heapdump.cc:136:1: note: in expansion of macro ‘NODE_MODULE’
 NODE_MODULE(addon, Initialize)
 ^~~~~~~~~~~
In file included from /cache/node-gyp/10.24.0/include/node/node.h:63,
                 from ../src/heapdump.cc:15:
/cache/node-gyp/10.24.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’:
/cache/node-gyp/10.24.0/include/node/node_object_wrap.h:84:78:   required from here
/cache/node-gyp/10.24.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
                reinterpret_cast<Callback>(callback), type);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/cache/node-gyp/10.24.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
../../nan/nan_object_wrap.h:65:61:   required from here
/cache/node-gyp/10.24.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
  SOLINK_MODULE(target) Release/obj.target/addon.node
  COPY Release/addon.node
make: Leaving directory '/src/repo/node_modules/heapdump/build'

> gc-stats@1.4.0 install /src/repo/node_modules/gc-stats
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
[gc-stats] Success: "/src/repo/node_modules/gc-stats/build/gcstats/v1.4.0/Release/node-v64-linux-x64/gcstats.node" is installed via remote

> core-js@3.11.0 postinstall /src/repo/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

added 546 packages in 16.8s

$ npm test

> citoid@1.0.0 test /src/repo
> npm run lint && mocha ./test/features/unit/*


> citoid@1.0.0 lint /src/repo
> eslint --max-warnings 0 --ext .js --cache .



  cachedTypes
    zotero methods
      ✓ returns false if no base types exist
      ✓ gets base types - no creators
      ✓ gets base types - with creators
    creator types methods
      ✓ gets creator type ids
      ✓ returns empty list if no create type ids exist
      ✓ gets primary creator id from type
      ✓ gets creator name from id
      ✓ gets primary creator id from name
      ✓ determines if creatorType valid for type- true
      ✓ determines if creatorType valid for type- false
    item fields methods
      ✓ determines if id is valid for type- false
      ✓ determines if id is valid for type- true
      ✓ determines if creator field is valid for type- true
      ✓ determines if creator field is valid for type- false
      ✓ get field id from type and base
      ✓ get base id from type and field
      ✓ get item type fields
      ✓ gets field name from id
      ✓ gets id from field name

  lib/Exporter.js functions: 
    validation functions: 
      fixURL: 
        ✓ discards url with no host
        ✓ adds protocol to url when missing
      addIDSToCitation: 
        ✓ cleans script and html out of title
      stripCitation:
        ✓ cleans script and html out of title
        ✓ does not clean doi
      fixDate: 
        ✓ Contains copyright symbol
        ✓ Is in brackets for some unfathomable reason
        ✓ Contains copyright symbol & whitespace
        ✓ Contains c symbol
        ✓ sets year only date to year only date
        ✓ converts American style date to ISO
        ✓ Unable to parse so leaves as written; season
        ✓ Chooses worldcat publication year
        ✓ Multilingual date - Spanish - leaves as written
        ✓ Multilingual date - Russian - leaves as written
        ✓ Normal date
        ✓ Normal date with ordinal indicator
        ✓ Correctly sets normal date with ordinal number
        ✓ Date on the fence: ISO with - notation
        ✓ Date on the fence; ISO with + notation
        ✓ Date on the fence; toString output
        ✓ Date on the fence; ISO with Z notation
        ✓ Year first date
        ✓ Partial ISO date no preceeding 0
        ✓ Full ISO date no preceeding 0
        ✓ Full ISO date no preceeding 0 month or day
        ✓ Partial ISO date proceeding 0
      fixDOI: 
        ✓ Correctly gets DOI from full citation
        ✓ Correctly removes DOI that is not a DOI
        ✓ Correctly gets DOI when only DOI is present
      fixISBN: 
        ✓ Correctly hyphenates single ISBN-10
        ✓ Correctly handles ISBN-13s that have spaces in them
        ✓ Correctly extracts two ISBN-10s
        ✓ Correctly extracts ISBN-13
        ✓ Correctly extracts ISBN-10 and ISBN-13
        ✓ Correctly handles and normalizes hyphenated ISBN
        ✓ Correctly handles ISBNs with and without hyphens
        ✓ Correctly handles ISBN-13s that have spaces in them
        ✓ Correctly handles out comma separated ISBNs
      fixISSN: 
        ✓ Correctly ignores invalid ISSN
        ✓ Correctly adds valid ISSN
        ✓ Correctly adds valid ISSN with X
        ✓ Correctly adds valid ISSN with x
        ✓ Correctly ignores invalid ISSN without hyphen
        ✓ Correctly ignores invalid ISSN
      fixPages: 
        ✓ converts hyphen minus to en dash
      replaceCreators:
        ✓ Correctly adds name with firstName and lastName present
        ✓ Correctly adds names with only lastName or firstName present
        ✓ Adds names with name field
        ✓ Doesn't add names with incorrect field name
    export formats: 
      wikibase: 
        different search term types 
          ✓ url from search, doi from result
          ✓ doi from search, no url
          ✓ qid, no url
          ✓ pmid, no url
          ✓ pmcid, no url
        different item types
          ✓ itemType webpage
          ✓ itemType book
          ✓ itemType journalArticle

  lib/externalAPIs/CrossRefService.js functions: 
    polite config
      ✓ Gets metadata for doi (513ms)
      ✓ Doesn't get metadata for invalid doi (336ms)
    anonymous config
      ✓ Gets metadata for doi (1124ms)
      ✓ Doesn't get metadata for invalid doi (474ms)
    open search function
      ✓ Gets metadata for open search (1367ms)

  lib/Scraper.js functions: 
    matchIDs function: 
      ✓ gets doi from bePress string
      ✓ gets doi from bePress Array
      ✓ gets doi from highwirePress string
      ✓ gets doi from highwirePress Array
      ✓ gets doi from dublinCore string
      ✓ gets doi from dublinCore Array
      ✓ Returns empty metadata from empty object
      ✓ Multiple metadata types
    parsing
      ✓ should scrape meta tag charset content

  Tests for Translator.js : 
    translate function on html: 
      ✓ translates bePress metadata from movie file
      ✓ translates bePress metadata from article file (68ms)
      ✓ translates bePress metadata from song file
      ✓ translates highwirePress metadata from movie file (44ms)
      ✓ translates highwirePress metadata from article file (87ms)
      ✓ translates highwirePress metadata from song file
      ✓ translates coins metadata from movie file
      ✓ translates coins metadata from article file
      ✓ translates coins metadata from song file
      ✓ translates dublinCore metadata from movie file
      ✓ translates dublinCore metadata from article file (60ms)
      ✓ translates dublinCore metadata from song file
      ✓ translates general metadata from movie file
      ✓ translates general metadata from article file
      ✓ translates general metadata from song file
      ✓ translates openGraph metadata from movie file
      ✓ translates openGraph metadata from article file
      ✓ translates openGraph metadata from song file
    translate function on json: 
      ✓ sets right info from journal-article crossRef metadata
      ✓ sets right info from book-section crossRef metadata
      ✓ tests every itemType for crossRef translator on every sample crossRef file (65ms)
    addItemType function: 
      ✓ sets videoRecording itemType
      ✓ sets article itemType
      ✓ sets audioRecording itemType from openGraph
      ✓ sets itemType webpage if no relevant metadata available
    check specific results: 
      ✓ sets right info from webpage for general metadata
      ✓ sets right info from webpage for bepress metadata

  coins metadata
    ✓ Correctly adds pages from spage and epage
    ✓ Correctly fixes en dash in pages fields
    ✓ Correctly adds date
    exports.other.addCreators function
      ✓ Doesn't add empty creators field
      ✓ Doesn't add creators field if missing itemType
      - Doesn't add duplicate author names
      - Doesn't add duplicate author names with nbsp present
      ✓ Correctly adds name with missing firstname
      ✓ Correctly adds name with missing lastname
      ✓ Correctly uses auinit1 and auinitm
      ✓ Correctly uses auinit1 and auinitm
      ✓ Correctly adds corporation names
      ✓ Does split names in au field

  dublinCore translator unit
    ✓ Creator translate function adds lists of strings
    dateParts function
      ✓ Translates full date
      ✓ Translates year and day
      ✓ Translates year only
      ✓ Fails with object
      ✓ Fails with list not nested
      ✓ Works with strings date
      ✓ Does not work with unexpected input

  dublinCore translator unit
    ✓ Creator translate function adds lists of strings
    ✓ Correctly adds an author string with one word
    ✓ Correctly adds an author string with two words
    ✓ Correctly adds an author string with three words

  general translator unit
    ✓ Author function adds lists of strings
    ✓ Correctly adds an author string with one word
    ✓ Correctly adds an author string with two words
    ✓ Correctly adds an author string with three words
    ✓ Does something redonk with Harry Potter author field from worldcat

  worldcat marcXML translator unit
    ✓ Correctly adds an author string with one word
    ✓ Correctly adds an author string with two words
    ✓ Correctly adds an author string with three words
    ✓ Correctly adds an author string with date
    ✓ Format Last name, first name

  openSearch translator unit tests: 
    ✓ title
    ✓ oclc

  translator utilities: 
    makeTranslator function: 
      ✓ strips leading and trailing whitespace
      ✓ correctly adds date with fixDate validate function
      ✓ correctly uses fixLang validate function
    makePagesTranslator function: 
      ✓ Uses spage and epage
      ✓ Uses optional pages arg and converts - to en dash
    makeListTranslator function: 
      ✓ Correctly adds one isbn
      ✓ Correctly uses isbn validate function
      ✓ Correctly uses issn validate function
      ✓ Correctly adds two issn and one eissn
      ✓ Correctly adds two isbn
    makeCreatorsTranslator function: 
      ✓ Name as written
      ✓ Format Last name, first name
      ✓ Adds two different contributor types


  166 passing (5s)
  2 pending


Upgrading n:glob-parent from 5.1.1 -> 5.1.2
$ package-lock-lint package-lock.json
0 issues found in: package-lock.json

$ git add .

$ git commit -F /tmp/tmpsmi3pdi8
[master 529c817] build: Updating glob-parent to 5.1.2
 1 file changed, 3 insertions(+), 3 deletions(-)

$ git format-patch HEAD~1 --stdout
From 529c81780cd4862e4029480d1c85100dfc0e185d Mon Sep 17 00:00:00 2001
From: libraryupgrader <tools.libraryupgrader@tools.wmflabs.org>
Date: Wed, 16 Jun 2021 11:24:46 +0000
Subject: [PATCH] build: Updating glob-parent to 5.1.2

* https://npmjs.com/advisories/1751 (CVE-2020-28469)

Change-Id: Ic5096663c5c4653d997f25042f730c1c9679e6c9
---
 package-lock.json | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package-lock.json b/package-lock.json
index a1b8fe9..06522d0 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -2480,9 +2480,9 @@
 			}
 		},
 		"glob-parent": {
-			"version": "5.1.1",
-			"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz",
-			"integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==",
+			"version": "5.1.2",
+			"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
+			"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
 			"dev": true,
 			"requires": {
 				"is-glob": "^4.0.1"
-- 
2.20.1

npm dependencies

Dependencies
Development dependencies

Logs

Source code is licensed under the AGPL.