Skip to content

Commit

Permalink
Quickfix856 [MRA-763] (#174) (#175)
Browse files Browse the repository at this point in the history
* MRA-763-ish: allow field 856
* Update deps

* 2.2.3-alpha.1
  • Loading branch information
ammsalme authored May 14, 2024
1 parent e3b83e8 commit 11f14d4
Show file tree
Hide file tree
Showing 8 changed files with 324 additions and 238 deletions.
307 changes: 80 additions & 227 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"url": "[email protected]:natlibfi/melinda-marc-record-merge-reducers-js.git"
},
"license": "LGPL-3.0+",
"version": "2.2.2",
"version": "2.2.3-alpha.1",
"main": "./dist/index.js",
"engines": {
"node": ">=18"
Expand All @@ -36,11 +36,11 @@
"watch:test": "cross-env DEBUG=1 NODE_ENV=test nodemon -w src -w test-fixtures --exec 'npm run test:dev'"
},
"dependencies": {
"@natlibfi/marc-record": "^8.1.1",
"@natlibfi/marc-record-merge": "^7.0.2",
"@natlibfi/marc-record-validate": "^8.0.7",
"@natlibfi/marc-record-validators-melinda": "^11.2.0-alpha.1",
"@natlibfi/melinda-commons": "^13.0.12",
"@natlibfi/marc-record": "^8.1.3",
"@natlibfi/marc-record-merge": "^7.0.3",
"@natlibfi/marc-record-validate": "^8.0.8",
"@natlibfi/marc-record-validators-melinda": "^11.2.0",
"@natlibfi/melinda-commons": "^13.0.13",
"debug": "^4.3.4",
"isbn3": "^1.1.48"
},
Expand All @@ -50,9 +50,9 @@
"@babel/node": "^7.23.9",
"@babel/preset-env": "^7.24.5",
"@babel/register": "^7.23.7",
"@natlibfi/eslint-config-melinda-backend": "^3.0.4",
"@natlibfi/fixugen": "^2.0.4",
"@natlibfi/fixura": "^3.0.4",
"@natlibfi/eslint-config-melinda-backend": "^3.0.5",
"@natlibfi/fixugen": "^2.0.5",
"@natlibfi/fixura": "^3.0.5",
"babel-plugin-istanbul": "^6.1.1",
"babel-plugin-rewire": "^1.2.0",
"chai": "^4.4.1",
Expand Down
4 changes: 2 additions & 2 deletions src/reducers/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"recordType": "source",
"comment": "MRA-763: remove many fields from a source prepublication if base record is good enough",
"fieldSpecification": {
"tagPattern": "^((?!CAT|LOW|SID|00[135678]|035|040|042|500|506|540|594|776|884|946|974).)*$",
"tagPattern": "^((?!CAT|LOW|SID|00[135678]|035|040|042|500|506|540|594|776|856|884|946|974).)*$",
"encodingLevel": ["8"]
},
"requireSourceField": {
Expand All @@ -34,7 +34,7 @@
"recordType": "source",
"comment": "MRA-763: remove many fields from a source prepublication if base record is good enough (Koneellisesti tuotettu tietue)",
"fieldSpecification": {
"tagPattern": "^((?!CAT|LOW|SID|00[135678]|035|040|042|500|506|540|594|776|884|946|974).)*$",
"tagPattern": "^((?!CAT|LOW|SID|00[135678]|035|040|042|500|506|540|594|776|856|884|946|974).)*$",
"encodingLevel": ["2", "8"]
},
"requireSourceField": {
Expand Down
89 changes: 89 additions & 0 deletions test-fixtures/reducers/index/856_case_20240513/base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"leader":"04848cam a22010334i 4500",
"fields":[
{"tag":"001","value":"009852932"},
{"tag":"003","value":"FI-MELINDA"},
{"tag":"005","value":"20240419221403.0"},
{"tag":"006","value":"m|||||o||d||||||||"},
{"tag":"007","value":"cr |||||||||||"},
{"tag":"008","value":"161108t20162016fi |||||o|||||||| 0|fin|c"},
{"tag":"020","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"978-952-267-157-8"},{"code":"q","value":"PDF"}]},
{"tag":"035","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"(FI-MELINDA)009852932"}]},
{"tag":"037","ind1":" ","ind2":" ","subfields":[{"code":"b","value":"Rakennustieto"},{"code":"5","value":"FI-Hamk"},{"code":"5","value":"FI-Xamk"}]},
{"tag":"040","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"Fi-Hamk"},{"code":"b","value":"fin"},{"code":"e","value":"rda"},{"code":"d","value":"FI-NL"}]},
{"tag":"041","ind1":"0","ind2":" ","subfields":[{"code":"a","value":"fin"}]},
{"tag":"042","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"finb"}]},
{"tag":"084","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"66"},{"code":"2","value":"ykl"}]},
{"tag":"100","ind1":"1","ind2":" ","subfields":[{"code":"a","value":"Paloniitty, Sauli,"},{"code":"e","value":"kirjoittaja."}]},
{"tag":"245","ind1":"1","ind2":"0","subfields":[{"code":"a","value":"Lämpökuvaus rakentamisessa /"},{"code":"c","value":"Sauli Paloniitty, Juho Paloniitty, Jouni Haimilahti."}]},
{"tag":"264","ind1":" ","ind2":"1","subfields":[{"code":"a","value":"Helsinki :"},{"code":"b","value":"Rakennustieto Oy,"},{"code":"c","value":"[2016]"}]},
{"tag":"264","ind1":" ","ind2":"4","subfields":[{"code":"c","value":"©2016"}]},
{"tag":"300","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"1 verkkoaineisto (144 sivua) :"},{"code":"b","value":"kuvitettu"}]},
{"tag":"336","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"teksti"},{"code":"b","value":"txt"},{"code":"2","value":"rdacontent"}]},
{"tag":"337","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"tietokonekäyttöinen"},{"code":"b","value":"c"},{"code":"2","value":"rdamedia"}]},
{"tag":"338","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"verkkoaineisto"},{"code":"b","value":"cr"},{"code":"2","value":"rdacarrier"}]},
{"tag":"341","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"tekstiin perustuva"}]},
{"tag":"347","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"tekstitiedosto"},{"code":"b","value":"PDF"}]},
{"tag":"505","ind1":"0","ind2":" ","subfields":[{"code":"a","value":"1. Johdanto lämpökuvaukseen -- 2. Lämpökuvauksen perusteet -- 3. Lämpökuvauksen käyttö rakentamisessa -- 4. Lämpökuvaus korjaus- ja uudisrakentamisessa -- 5. Lämpöviihtyvyys -- 6. Lämpökuvauksen suorittaminen -- 7. Lämpökuvaussovellukset -- 8. Lämpökuvauksen oheismittaukset -- 9. Lämpökuvien tulkinta -- 10. Lämpökuvauksen raportointi -- 11. Lämpökuvauksen tilaaminen -- Kirjallisuutta -- Liitteet."}]},
{"tag":"506","ind1":"1","ind2":" ","subfields":[{"code":"a","value":"Käytettävissä lisenssin hankkineissa organisaatioissa."},{"code":"f","value":"Online access with authorization"},{"code":"2","value":"star"}]},
{"tag":"530","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"Julkaistu myös painettuna."}]},
{"tag":"588","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"Nimeke kannesta."}]},
{"tag":"594","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"TARKISTETTU ENNAKKOTIETO / KIRJAVÄLITYS"},{"code":"5","value":"FENNI"}]},
{"tag":"650","ind1":" ","ind2":"7","subfields":[{"code":"a","value":"lämpökuvaus"},{"code":"2","value":"yso/fin"},{"code":"0","value":"http://www.yso.fi/onto/yso/p5376"},{"code":"9","value":"HAMK<KEEP>"}]},
{"tag":"650","ind1":" ","ind2":"7","subfields":[{"code":"a","value":"rakennukset"},{"code":"2","value":"yso/fin"},{"code":"0","value":"http://www.yso.fi/onto/yso/p1786"},{"code":"9","value":"HAMK<KEEP>"}]},
{"tag":"650","ind1":" ","ind2":"7","subfields":[{"code":"a","value":"lämpökamerat"},{"code":"2","value":"yso/fin"},{"code":"0","value":"http://www.yso.fi/onto/yso/p7685"},{"code":"9","value":"HAMK<KEEP>"}]},
{"tag":"650","ind1":" ","ind2":"7","subfields":[{"code":"a","value":"laadunvalvonta"},{"code":"2","value":"yso/fin"},{"code":"0","value":"http://www.yso.fi/onto/yso/p2720"},{"code":"9","value":"HAMK<KEEP>"}]},
{"tag":"650","ind1":" ","ind2":"7","subfields":[{"code":"a","value":"kuntokartoitus"},{"code":"2","value":"yso/fin"},{"code":"0","value":"http://www.yso.fi/onto/yso/p20560"},{"code":"9","value":"HAMK<KEEP>"}]},
{"tag":"650","ind1":" ","ind2":"7","subfields":[{"code":"a","value":"lämpöviihtyvyys"},{"code":"2","value":"yso/fin"},{"code":"0","value":"http://www.yso.fi/onto/yso/p7771"},{"code":"9","value":"HAMK<KEEP>"}]},
{"tag":"650","ind1":" ","ind2":"7","subfields":[{"code":"a","value":"värmefotografering"},{"code":"2","value":"yso/swe"},{"code":"0","value":"http://www.yso.fi/onto/yso/p5376"}]},
{"tag":"650","ind1":" ","ind2":"7","subfields":[{"code":"a","value":"byggnader"},{"code":"2","value":"yso/swe"},{"code":"0","value":"http://www.yso.fi/onto/yso/p1786"}]},
{"tag":"650","ind1":" ","ind2":"7","subfields":[{"code":"a","value":"värmekameror"},{"code":"2","value":"yso/swe"},{"code":"0","value":"http://www.yso.fi/onto/yso/p7685"}]},
{"tag":"650","ind1":" ","ind2":"7","subfields":[{"code":"a","value":"kvalitetskontroll"},{"code":"2","value":"yso/swe"},{"code":"0","value":"http://www.yso.fi/onto/yso/p2720"}]},
{"tag":"650","ind1":" ","ind2":"7","subfields":[{"code":"a","value":"konditionskartläggning"},{"code":"2","value":"yso/swe"},{"code":"0","value":"http://www.yso.fi/onto/yso/p20560"}]},
{"tag":"650","ind1":" ","ind2":"7","subfields":[{"code":"a","value":"värmekomfort"},{"code":"2","value":"yso/swe"},{"code":"0","value":"http://www.yso.fi/onto/yso/p7771"}]},
{"tag":"700","ind1":"1","ind2":" ","subfields":[{"code":"a","value":"Paloniitty, Juho,"},{"code":"e","value":"kirjoittaja."}]},
{"tag":"700","ind1":"1","ind2":" ","subfields":[{"code":"a","value":"Haimilahti, Jouni,"},{"code":"e","value":"kirjoittaja."}]},
{"tag":"710","ind1":"2","ind2":" ","subfields":[{"code":"a","value":"Rakennustieto (yhtiö),"},{"code":"e","value":"kustantaja."},{"code":"0","value":"(FI-ASTERI-N)000014688"}]},
{"tag":"776","ind1":"0","ind2":"8","subfields":[{"code":"i","value":"Painettu:"},{"code":"z","value":"978-952-267-107-3"}]},
{"tag":"884","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"ONIX3 to MARC transformation"},{"code":"g","value":"20240103"},{"code":"k","value":"MELINDA_RECORD_IMPORT_SOURCE_4:c16d362620511b7d0cf4b634325425036c95d3e9378170531a110f232f8949f8"},{"code":"q","value":"FI-NL"},{"code":"5","value":"MELINDA"}]},
{"tag":"974","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"KV"},{"code":"b","value":"TT0033583"},{"code":"5","value":"FENNI"}]},
{"tag":"SID","ind1":" ","ind2":" ","subfields":[{"code":"c","value":"VER2741384"},{"code":"b","value":"FI-KV"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"HAMK1002"},{"code":"b","value":"30"},{"code":"c","value":"20161108"},{"code":"l","value":"FIN01"},{"code":"h","value":"1345"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"HAMK1001"},{"code":"b","value":"30"},{"code":"c","value":"20161112"},{"code":"l","value":"FIN01"},{"code":"h","value":"0936"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"HAMK1001"},{"code":"b","value":"30"},{"code":"c","value":"20161112"},{"code":"l","value":"FIN01"},{"code":"h","value":"0941"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"HAMK1001"},{"code":"b","value":"30"},{"code":"c","value":"20161112"},{"code":"l","value":"FIN01"},{"code":"h","value":"0942"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"TAMK4005"},{"code":"b","value":"30"},{"code":"c","value":"20170524"},{"code":"l","value":"FIN01"},{"code":"h","value":"1416"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"TAMK4005"},{"code":"b","value":"30"},{"code":"c","value":"20170524"},{"code":"l","value":"FIN01"},{"code":"h","value":"1435"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"TAMK4001"},{"code":"b","value":"30"},{"code":"c","value":"20170613"},{"code":"l","value":"FIN01"},{"code":"h","value":"1008"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"L1005"},{"code":"b","value":"30"},{"code":"c","value":"20181005"},{"code":"l","value":"FIN01"},{"code":"h","value":"1011"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"L1005"},{"code":"b","value":"30"},{"code":"c","value":"20181005"},{"code":"l","value":"FIN01"},{"code":"h","value":"1012"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"LOAD-FIX"},{"code":"b","value":"30"},{"code":"c","value":"20190409"},{"code":"l","value":"FIN01"},{"code":"h","value":"1651"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"LOAD-FIX"},{"code":"b","value":"30"},{"code":"c","value":"20190502"},{"code":"l","value":"FIN01"},{"code":"h","value":"1704"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"LOAD-YSO"},{"code":"b","value":"00"},{"code":"c","value":"20190711"},{"code":"l","value":"FIN01"},{"code":"h","value":"2247"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"TAMK4005"},{"code":"b","value":"30"},{"code":"c","value":"20191121"},{"code":"l","value":"FIN01"},{"code":"h","value":"1901"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"HELKANOREP"},{"code":"b","value":"30"},{"code":"c","value":"20200228"},{"code":"l","value":"FIN01"},{"code":"h","value":"1456"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"METRO4016"},{"code":"b","value":"30"},{"code":"c","value":"20200409"},{"code":"l","value":"FIN01"},{"code":"h","value":"1235"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"LOAD-ID"},{"code":"b","value":""},{"code":"c","value":"20200723"},{"code":"l","value":"FIN01"},{"code":"h","value":"2249"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"HAMK1011"},{"code":"b","value":"30"},{"code":"c","value":"20200825"},{"code":"l","value":"FIN01"},{"code":"h","value":"1516"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"LOAD-ELAID"},{"code":"b","value":"00"},{"code":"c","value":"20200905"},{"code":"l","value":"FIN01"},{"code":"h","value":"1109"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"LOAD-ELAID"},{"code":"b","value":"00"},{"code":"c","value":"20200905"},{"code":"l","value":"FIN01"},{"code":"h","value":"1715"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"LOAD-ELAID"},{"code":"b","value":"00"},{"code":"c","value":"20200915"},{"code":"l","value":"FIN01"},{"code":"h","value":"0801"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"LOAD-ELAID"},{"code":"b","value":"00"},{"code":"c","value":"20200915"},{"code":"l","value":"FIN01"},{"code":"h","value":"1228"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"LOAD-ELAID"},{"code":"b","value":"00"},{"code":"c","value":"20200922"},{"code":"l","value":"FIN01"},{"code":"h","value":"0630"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"XAMK4003"},{"code":"b","value":"30"},{"code":"c","value":"20201023"},{"code":"l","value":"FIN01"},{"code":"h","value":"1345"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"LOAD-ELAID"},{"code":"b","value":"00"},{"code":"c","value":"20201113"},{"code":"l","value":"FIN01"},{"code":"h","value":"0642"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"LOAD-ELAID"},{"code":"b","value":"00"},{"code":"c","value":"20201113"},{"code":"l","value":"FIN01"},{"code":"h","value":"0656"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"LOAD-ELAID"},{"code":"b","value":"00"},{"code":"c","value":"20210213"},{"code":"l","value":"FIN01"},{"code":"h","value":"0630"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"METRO4016"},{"code":"b","value":"30"},{"code":"c","value":"20221014"},{"code":"l","value":"FIN01"},{"code":"h","value":"1053"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"LOAD-ELAID"},{"code":"b","value":"00"},{"code":"c","value":"20230303"},{"code":"l","value":"FIN01"},{"code":"h","value":"0630"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"XAMK4003"},{"code":"b","value":"30"},{"code":"c","value":"20230825"},{"code":"l","value":"FIN01"},{"code":"h","value":"0838"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"IMP_ENNAKK"},{"code":"b","value":"30"},{"code":"c","value":"20240103"},{"code":"l","value":"FIN01"},{"code":"h","value":"0255"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"KUSTR-FIX"},{"code":"b","value":"30"},{"code":"c","value":"20240321"},{"code":"l","value":"FIN01"},{"code":"h","value":"1458"}]},
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"LOAD-FIX"},{"code":"b","value":"30"},{"code":"c","value":"20240419"},{"code":"l","value":"FIN01"},{"code":"h","value":"2214"}]},
{"tag":"LOW","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"FIKKA"}]},
{"tag":"LOW","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"HAMK"}]},
{"tag":"LOW","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"JUOLU"}]},
{"tag":"LOW","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"KOAMK"}]},
{"tag":"LOW","ind1":" ","ind2":" ","subfields":[{"code":"a","value":"XAMK"}]}
]
}
Loading

0 comments on commit 11f14d4

Please sign in to comment.