@natlibfi/melinda-commons 12.0.4-alpha.1 → 12.0.4-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/error.js +1 -1
- package/dist/error.js.map +1 -1
- package/dist/error.spec.js +1 -1
- package/dist/error.spec.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/subRecordPicker.js +27 -0
- package/dist/subRecordPicker.js.map +1 -1
- package/dist/subRecordPicker.spec.js +1 -1
- package/dist/subRecordPicker.spec.js.map +1 -1
- package/dist/utils.js +1 -1
- package/dist/utils.js.map +1 -1
- package/dist/utils.spec.js +1 -1
- package/dist/utils.spec.js.map +1 -1
- package/package.json +1 -1
- package/src/error.js +1 -1
- package/src/error.spec.js +1 -1
- package/src/index.js +1 -1
- package/src/subRecordPicker.js +28 -0
- package/src/subRecordPicker.spec.js +1 -1
- package/src/utils.js +1 -1
- package/src/utils.spec.js +1 -1
- package/.drone.yml +0 -93
package/README.md
CHANGED
|
@@ -5,6 +5,6 @@ Shared modules for Melinda's software
|
|
|
5
5
|
|
|
6
6
|
## License and copyright
|
|
7
7
|
|
|
8
|
-
Copyright (c) 2018-
|
|
8
|
+
Copyright (c) 2018-2022 **University Of Helsinki (The National Library Of Finland)**
|
|
9
9
|
|
|
10
10
|
This project's source code is licensed under the terms of **GNU Lesser General Public License Version 3** or any later version.
|
package/dist/error.js
CHANGED
|
@@ -11,7 +11,7 @@ exports.default = void 0;
|
|
|
11
11
|
*
|
|
12
12
|
* Shared modules for Melinda's software
|
|
13
13
|
*
|
|
14
|
-
* Copyright (C) 2018-
|
|
14
|
+
* Copyright (C) 2018-2022 University Of Helsinki (The National Library Of Finland)
|
|
15
15
|
*
|
|
16
16
|
* This file is part of melinda-commons-js
|
|
17
17
|
*
|
package/dist/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","names":["Error","constructor","status","payload","params"],"sources":["../src/error.js"],"sourcesContent":["/**\n*\n* @licstart The following is the entire license notice for the JavaScript code in this file.\n*\n* Shared modules for Melinda's software\n*\n* Copyright (C) 2018-
|
|
1
|
+
{"version":3,"file":"error.js","names":["Error","constructor","status","payload","params"],"sources":["../src/error.js"],"sourcesContent":["/**\n*\n* @licstart The following is the entire license notice for the JavaScript code in this file.\n*\n* Shared modules for Melinda's software\n*\n* Copyright (C) 2018-2022 University Of Helsinki (The National Library Of Finland)\n*\n* This file is part of melinda-commons-js\n*\n* melinda-commons-js program is free software: you can redistribute it and/or modify\n* it under the terms of the GNU Lesser General Public License as\n* published by the Free Software Foundation, either version 3 of the\n* License, or (at your option) any later version.\n*\n* melinda-commons-js is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n* GNU Lesser General Public License for more details.\n*\n* You should have received a copy of the GNU Lesser General Public License\n* along with this program. If not, see <http://www.gnu.org/licenses/>.\n*\n* @licend The above is the entire license notice\n* for the JavaScript code in this file.\n*\n*/\n\nexport default class extends Error {\n constructor(status, payload, ...params) {\n super(params);\n this.status = status; // eslint-disable-line functional/no-this-expression\n this.payload = payload; // eslint-disable-line functional/no-this-expression\n }\n}\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEe,uBAAcA,KAAd,CAAoB;EACjCC,WAAW,CAACC,MAAD,EAASC,OAAT,EAA6B;IAAA,kCAARC,MAAQ;MAARA,MAAQ;IAAA;;IACtC,MAAMA,MAAN;IACA,KAAKF,MAAL,GAAcA,MAAd,CAFsC,CAEhB;;IACtB,KAAKC,OAAL,GAAeA,OAAf,CAHsC,CAGd;EACzB;;AALgC"}
|
package/dist/error.spec.js
CHANGED
|
@@ -12,7 +12,7 @@ var _error = _interopRequireDefault(require("./error"));
|
|
|
12
12
|
*
|
|
13
13
|
* Shared modules for Melinda's software
|
|
14
14
|
*
|
|
15
|
-
* Copyright (C) 2018-
|
|
15
|
+
* Copyright (C) 2018-2022 University Of Helsinki (The National Library Of Finland)
|
|
16
16
|
*
|
|
17
17
|
* This file is part of melinda-commons-js
|
|
18
18
|
*
|
package/dist/error.spec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.spec.js","names":["describe","it","error","CommonsError","expect","to","be","an","instanceOf","Error","status","equal","payload"],"sources":["../src/error.spec.js"],"sourcesContent":["/**\n*\n* @licstart The following is the entire license notice for the JavaScript code in this file.\n*\n* Shared modules for Melinda's software\n*\n* Copyright (C) 2018-
|
|
1
|
+
{"version":3,"file":"error.spec.js","names":["describe","it","error","CommonsError","expect","to","be","an","instanceOf","Error","status","equal","payload"],"sources":["../src/error.spec.js"],"sourcesContent":["/**\n*\n* @licstart The following is the entire license notice for the JavaScript code in this file.\n*\n* Shared modules for Melinda's software\n*\n* Copyright (C) 2018-2022 University Of Helsinki (The National Library Of Finland)\n*\n* This file is part of melinda-commons-js\n*\n* melinda-commons-js program is free software: you can redistribute it and/or modify\n* it under the terms of the GNU Lesser General Public License as\n* published by the Free Software Foundation, either version 3 of the\n* License, or (at your option) any later version.\n*\n* melinda-commons-js is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n* GNU Lesser General Public License for more details.\n*\n* You should have received a copy of the GNU Lesser General Public License\n* along with this program. If not, see <http://www.gnu.org/licenses/>.\n*\n* @licend The above is the entire license notice\n* for the JavaScript code in this file.\n*\n*/\n\nimport {expect} from 'chai';\nimport CommonsError from './error';\n\ndescribe('error', () => {\n it('Should construct the expected instance', () => {\n const error = new CommonsError(200, 'foobar');\n\n expect(error).to.be.an.instanceOf(Error);\n expect(error.status).to.equal(200);\n expect(error.payload).to.equal('foobar');\n });\n});\n"],"mappings":";;;;AA4BA;;AACA;;AA7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKAA,QAAQ,CAAC,OAAD,EAAU,MAAM;EACtBC,EAAE,CAAC,wCAAD,EAA2C,MAAM;IACjD,MAAMC,KAAK,GAAG,IAAIC,cAAJ,CAAiB,GAAjB,EAAsB,QAAtB,CAAd;IAEA,IAAAC,YAAA,EAAOF,KAAP,EAAcG,EAAd,CAAiBC,EAAjB,CAAoBC,EAApB,CAAuBC,UAAvB,CAAkCC,KAAlC;IACA,IAAAL,YAAA,EAAOF,KAAK,CAACQ,MAAb,EAAqBL,EAArB,CAAwBM,KAAxB,CAA8B,GAA9B;IACA,IAAAP,YAAA,EAAOF,KAAK,CAACU,OAAb,EAAsBP,EAAtB,CAAyBM,KAAzB,CAA+B,QAA/B;EACD,CANC,CAAF;AAOD,CARO,CAAR"}
|
package/dist/index.js
CHANGED
|
@@ -48,7 +48,7 @@ var _error = _interopRequireDefault(require("./error"));
|
|
|
48
48
|
*
|
|
49
49
|
* Shared modules for Melinda's software
|
|
50
50
|
*
|
|
51
|
-
* Copyright (C) 2018-
|
|
51
|
+
* Copyright (C) 2018-2022 University Of Helsinki (The National Library Of Finland)
|
|
52
52
|
*
|
|
53
53
|
* This file is part of melinda-commons-js
|
|
54
54
|
*
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["MarcRecord","setValidationOptions","subfieldValues"],"sources":["../src/index.js"],"sourcesContent":["/**\n*\n* @licstart The following is the entire license notice for the JavaScript code in this file.\n*\n* Shared modules for Melinda's software\n*\n* Copyright (C) 2018-
|
|
1
|
+
{"version":3,"file":"index.js","names":["MarcRecord","setValidationOptions","subfieldValues"],"sources":["../src/index.js"],"sourcesContent":["/**\n*\n* @licstart The following is the entire license notice for the JavaScript code in this file.\n*\n* Shared modules for Melinda's software\n*\n* Copyright (C) 2018-2022 University Of Helsinki (The National Library Of Finland)\n*\n* This file is part of melinda-commons-js\n*\n* melinda-commons-js program is free software: you can redistribute it and/or modify\n* it under the terms of the GNU Lesser General Public License as\n* published by the Free Software Foundation, either version 3 of the\n* License, or (at your option) any later version.\n*\n* melinda-commons-js is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n* GNU Lesser General Public License for more details.\n*\n* You should have received a copy of the GNU Lesser General Public License\n* along with this program. If not, see <http://www.gnu.org/licenses/>.\n*\n* @licend The above is the entire license notice\n* for the JavaScript code in this file.\n*\n*/\n\nimport {MarcRecord} from '@natlibfi/marc-record';\n\n// Aleph creates partial subfields...\nMarcRecord.setValidationOptions({subfieldValues: false});\n\nimport {createSubrecordPicker} from './subRecordPicker';\n\nexport * from './utils';\n\nexport {default as Error} from './error';\nexport {createSubrecordPicker};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA4BA;;AAKA;;AAEA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AAEA;;AArCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACAA,sBAAA,CAAWC,oBAAX,CAAgC;EAACC,cAAc,EAAE;AAAjB,CAAhC"}
|
package/dist/subRecordPicker.js
CHANGED
|
@@ -15,6 +15,33 @@ var _debug = _interopRequireDefault(require("debug"));
|
|
|
15
15
|
|
|
16
16
|
var _error = require("./error");
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @licstart The following is the entire license notice for the JavaScript code in this file.
|
|
21
|
+
*
|
|
22
|
+
* Shared modules for Melinda's software
|
|
23
|
+
*
|
|
24
|
+
* Copyright (C) 2018-2022 University Of Helsinki (The National Library Of Finland)
|
|
25
|
+
*
|
|
26
|
+
* This file is part of melinda-commons-js
|
|
27
|
+
*
|
|
28
|
+
* melinda-commons-js program is free software: you can redistribute it and/or modify
|
|
29
|
+
* it under the terms of the GNU Lesser General Public License as
|
|
30
|
+
* published by the Free Software Foundation, either version 3 of the
|
|
31
|
+
* License, or (at your option) any later version.
|
|
32
|
+
*
|
|
33
|
+
* melinda-commons-js is distributed in the hope that it will be useful,
|
|
34
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
35
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
36
|
+
* GNU Lesser General Public License for more details.
|
|
37
|
+
*
|
|
38
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
39
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
40
|
+
*
|
|
41
|
+
* @licend The above is the entire license notice
|
|
42
|
+
* for the JavaScript code in this file.
|
|
43
|
+
*
|
|
44
|
+
*/
|
|
18
45
|
function createSubrecordPicker(sruUrl) {
|
|
19
46
|
let retrieveAll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
20
47
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subRecordPicker.js","names":["createSubrecordPicker","sruUrl","retrieveAll","undefined","ApiError","debug","createDebugLogger","sruClient","createSruClient","url","recordSchema","readSomeSubrecords","readAllSubrecords","recordId","offset","Promise","resolve","reject","promises","searchRetrieve","startRecord","on","xmlString","push","MARCXML","from","subfieldValues","nextRecordOffset","records","all","error","err"],"sources":["../src/subRecordPicker.js"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"subRecordPicker.js","names":["createSubrecordPicker","sruUrl","retrieveAll","undefined","ApiError","debug","createDebugLogger","sruClient","createSruClient","url","recordSchema","readSomeSubrecords","readAllSubrecords","recordId","offset","Promise","resolve","reject","promises","searchRetrieve","startRecord","on","xmlString","push","MARCXML","from","subfieldValues","nextRecordOffset","records","all","error","err"],"sources":["../src/subRecordPicker.js"],"sourcesContent":["/**\n*\n* @licstart The following is the entire license notice for the JavaScript code in this file.\n*\n* Shared modules for Melinda's software\n*\n* Copyright (C) 2018-2022 University Of Helsinki (The National Library Of Finland)\n*\n* This file is part of melinda-commons-js\n*\n* melinda-commons-js program is free software: you can redistribute it and/or modify\n* it under the terms of the GNU Lesser General Public License as\n* published by the Free Software Foundation, either version 3 of the\n* License, or (at your option) any later version.\n*\n* melinda-commons-js is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n* GNU Lesser General Public License for more details.\n*\n* You should have received a copy of the GNU Lesser General Public License\n* along with this program. If not, see <http://www.gnu.org/licenses/>.\n*\n* @licend The above is the entire license notice\n* for the JavaScript code in this file.\n*\n*/\n\nimport createSruClient from '@natlibfi/sru-client';\nimport {MARCXML} from '@natlibfi/marc-record-serializers';\nimport createDebugLogger from 'debug';\nimport {Error as ApiError} from './error';\n\nexport function createSubrecordPicker(sruUrl, retrieveAll = false) {\n if (sruUrl === undefined) { // eslint-disable-line functional/no-conditional-statement\n throw new ApiError(400, 'Invalid sru url');\n }\n\n const debug = createDebugLogger('@natlibfi/melinda-commons:subRecordPicker');\n debug(`SRU client url: ${sruUrl}`);\n const sruClient = createSruClient({url: sruUrl, recordSchema: 'marcxml', retrieveAll});\n\n return {readSomeSubrecords, readAllSubrecords};\n\n function readSomeSubrecords(recordId, offset = 1) {\n debug(`Picking subrecords for ${recordId}`);\n return new Promise((resolve, reject) => {\n const promises = [];\n sruClient.searchRetrieve(`melinda.partsofhost=${recordId}`, {startRecord: offset})\n .on('record', xmlString => {\n promises.push(MARCXML.from(xmlString, {subfieldValues: false})); // eslint-disable-line functional/immutable-data\n })\n .on('end', async nextRecordOffset => {\n try {\n const records = await Promise.all(promises);\n resolve({nextRecordOffset, records});\n } catch (error) {\n reject(error);\n }\n })\n .on('error', err => reject(err));\n });\n }\n\n function readAllSubrecords(recordId) {\n debug(`Picking subrecords for ${recordId}`);\n return new Promise((resolve, reject) => {\n const promises = [];\n sruClient.searchRetrieve(`melinda.partsofhost=${recordId}`)\n .on('record', xmlString => {\n promises.push(MARCXML.from(xmlString, {subfieldValues: false})); // eslint-disable-line functional/immutable-data\n })\n .on('end', async () => {\n try {\n const records = await Promise.all(promises);\n resolve({records});\n } catch (error) {\n reject(error);\n }\n })\n .on('error', err => reject(err));\n });\n }\n}\n"],"mappings":";;;;;;;;;AA4BA;;AACA;;AACA;;AACA;;AA/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOO,SAASA,qBAAT,CAA+BC,MAA/B,EAA4D;EAAA,IAArBC,WAAqB,uEAAP,KAAO;;EACjE,IAAID,MAAM,KAAKE,SAAf,EAA0B;IAAE;IAC1B,MAAM,IAAIC,YAAJ,CAAa,GAAb,EAAkB,iBAAlB,CAAN;EACD;;EAED,MAAMC,KAAK,GAAG,IAAAC,cAAA,EAAkB,2CAAlB,CAAd;EACAD,KAAK,2BAAoBJ,MAApB,EAAL;EACA,MAAMM,SAAS,GAAG,IAAAC,kBAAA,EAAgB;IAACC,GAAG,EAAER,MAAN;IAAcS,YAAY,EAAE,SAA5B;IAAuCR;EAAvC,CAAhB,CAAlB;EAEA,OAAO;IAACS,kBAAD;IAAqBC;EAArB,CAAP;;EAEA,SAASD,kBAAT,CAA4BE,QAA5B,EAAkD;IAAA,IAAZC,MAAY,uEAAH,CAAG;IAChDT,KAAK,kCAA2BQ,QAA3B,EAAL;IACA,OAAO,IAAIE,OAAJ,CAAY,CAACC,OAAD,EAAUC,MAAV,KAAqB;MACtC,MAAMC,QAAQ,GAAG,EAAjB;MACAX,SAAS,CAACY,c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,CAAN;QACD;MACF,CAXH,EAYGT,EAZH,CAYM,OAZN,EAYeU,GAAG,IAAId,MAAM,CAACc,GAAD,CAZ5B;IAaD,CAfM,CAAP;EAgBD;AACF"}
|
|
@@ -16,7 +16,7 @@ var _fixugenHttpClient = _interopRequireDefault(require("@natlibfi/fixugen-http-
|
|
|
16
16
|
*
|
|
17
17
|
* Shared modules for Melinda's software
|
|
18
18
|
*
|
|
19
|
-
* Copyright (C) 2018-
|
|
19
|
+
* Copyright (C) 2018-2022 University Of Helsinki (The National Library Of Finland)
|
|
20
20
|
*
|
|
21
21
|
* This file is part of melinda-commons-js
|
|
22
22
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subRecordPicker.spec.js","names":["describe","sruUrl","retrieveAll","it","client","createSubrecordPicker","expect","to","respondTo","throw","generateTests","callback","path","__dirname","getFixture","method","recordId","expectedRecords","components","reader","READERS","JSON","records","format","eql","map","r","toObject"],"sources":["../src/subRecordPicker.spec.js"],"sourcesContent":["/**\n*\n* @licstart The following is the entire license notice for the JavaScript code in this file.\n*\n* Shared modules for Melinda's software\n*\n* Copyright (C) 2018-
|
|
1
|
+
{"version":3,"file":"subRecordPicker.spec.js","names":["describe","sruUrl","retrieveAll","it","client","createSubrecordPicker","expect","to","respondTo","throw","generateTests","callback","path","__dirname","getFixture","method","recordId","expectedRecords","components","reader","READERS","JSON","records","format","eql","map","r","toObject"],"sources":["../src/subRecordPicker.spec.js"],"sourcesContent":["/**\n*\n* @licstart The following is the entire license notice for the JavaScript code in this file.\n*\n* Shared modules for Melinda's software\n*\n* Copyright (C) 2018-2022 University Of Helsinki (The National Library Of Finland)\n*\n* This file is part of melinda-commons-js\n*\n* melinda-commons-js program is free software: you can redistribute it and/or modify\n* it under the terms of the GNU Lesser General Public License as\n* published by the Free Software Foundation, either version 3 of the\n* License, or (at your option) any later version.\n*\n* melinda-commons-js is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n* GNU Lesser General Public License for more details.\n*\n* You should have received a copy of the GNU Lesser General Public License\n* along with this program. If not, see <http://www.gnu.org/licenses/>.\n*\n* @licend The above is the entire license notice\n* for the JavaScript code in this file.\n*\n*/\n\nimport {expect} from 'chai';\nimport {createSubrecordPicker} from './subRecordPicker';\nimport {READERS} from '@natlibfi/fixura';\nimport generateTests from '@natlibfi/fixugen-http-client';\n\ndescribe('subRecordPicker', () => {\n const sruUrl = 'https://sru';\n const retrieveAll = false;\n\n describe('createSubrecordPicker', () => {\n it('Client should have methods', () => {\n const client = createSubrecordPicker(sruUrl, retrieveAll);\n expect(client).to.respondTo('readAllSubrecords');\n expect(client).to.respondTo('readSomeSubrecords');\n });\n\n it('Create client should work with just one parametter', () => {\n const client = createSubrecordPicker(sruUrl);\n expect(client).to.respondTo('readAllSubrecords');\n expect(client).to.respondTo('readSomeSubrecords');\n });\n\n it('Create client should have at least one parametter', () => {\n expect(createSubrecordPicker).to.throw();\n });\n });\n\n generateTests({\n callback,\n path: [__dirname, '..', 'test-fixtures', 'subRecordPicker']\n });\n\n async function callback({getFixture, method, sruUrl, retrieveAll, recordId}) {\n const client = createSubrecordPicker(sruUrl, retrieveAll);\n const expectedRecords = getFixture({components: ['expected-records.json'], reader: READERS.JSON});\n const {records} = await client[method](recordId);\n\n expect(format()).to.eql(expectedRecords);\n\n function format() {\n return records.map(r => r.toObject());\n }\n }\n});\n"],"mappings":";;;;AA4BA;;AACA;;AACA;;AACA;;AA/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOAA,QAAQ,CAAC,iBAAD,EAAoB,MAAM;EAChC,MAAMC,MAAM,GAAG,aAAf;EACA,MAAMC,WAAW,GAAG,KAApB;EAEAF,QAAQ,CAAC,uBAAD,EAA0B,MAAM;IACtCG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AEA,IAAAV,YAAA,EAAOiB,MAAM,EAAb,EAAiBhB,EAAjB,CAAoBiB,GAApB,CAAwBP,eAAxB;;IAEA,SAASM,MAAT,GAAkB;MAChB,OAAOD,OAAO,CAACG,GAAR,CAAYC,CAAC,IAAIA,CAAC,CAACC,QAAF,EAAjB,CAAP;IACD;EACF;AACF,CAtCO,CAAR"}
|
package/dist/utils.js
CHANGED
|
@@ -18,7 +18,7 @@ exports.toAlephId = toAlephId;
|
|
|
18
18
|
*
|
|
19
19
|
* Shared modules for Melinda's software
|
|
20
20
|
*
|
|
21
|
-
* Copyright (C) 2018-
|
|
21
|
+
* Copyright (C) 2018-2022 University Of Helsinki (The National Library Of Finland)
|
|
22
22
|
*
|
|
23
23
|
* This file is part of melinda-commons-js
|
|
24
24
|
*
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["generateAuthorizationHeader","username","password","encoded","Buffer","from","toString","isDeletedRecord","record","includes","leader","checkDel","checkSta","get","some","check","subfields","code","value","values","parseBoolean","undefined","Number","isNaN","length","Boolean","getRecordTitle","TRIM_PATTERN","field","find","f","sf","replace","RegExp","getRecordStandardIdentifiers","filter","map","subfield","clone","o","JSON","parse","stringify","toAlephId","id","padStart","fromAlephId"],"sources":["../src/utils.js"],"sourcesContent":["/**\n*\n* @licstart The following is the entire license notice for the JavaScript code in this file.\n*\n* Shared modules for Melinda's software\n*\n* Copyright (C) 2018-
|
|
1
|
+
{"version":3,"file":"utils.js","names":["generateAuthorizationHeader","username","password","encoded","Buffer","from","toString","isDeletedRecord","record","includes","leader","checkDel","checkSta","get","some","check","subfields","code","value","values","parseBoolean","undefined","Number","isNaN","length","Boolean","getRecordTitle","TRIM_PATTERN","field","find","f","sf","replace","RegExp","getRecordStandardIdentifiers","filter","map","subfield","clone","o","JSON","parse","stringify","toAlephId","id","padStart","fromAlephId"],"sources":["../src/utils.js"],"sourcesContent":["/**\n*\n* @licstart The following is the entire license notice for the JavaScript code in this file.\n*\n* Shared modules for Melinda's software\n*\n* Copyright (C) 2018-2022 University Of Helsinki (The National Library Of Finland)\n*\n* This file is part of melinda-commons-js\n*\n* melinda-commons-js program is free software: you can redistribute it and/or modify\n* it under the terms of the GNU Lesser General Public License as\n* published by the Free Software Foundation, either version 3 of the\n* License, or (at your option) any later version.\n*\n* melinda-commons-js is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n* GNU Lesser General Public License for more details.\n*\n* You should have received a copy of the GNU Lesser General Public License\n* along with this program. If not, see <http://www.gnu.org/licenses/>.\n*\n* @licend The above is the entire license notice\n* for the JavaScript code in this file.\n*\n*/\n\nexport function generateAuthorizationHeader(username, password = '') {\n const encoded = Buffer.from(`${username}:${password}`).toString('base64');\n return `Basic ${encoded}`;\n}\n\nexport function isDeletedRecord(record) {\n if (['d', 's', 'x'].includes(record.leader[5])) {\n return true;\n }\n\n return checkDel() || checkSta();\n\n function checkDel() {\n return record.get(/^DEL$/u).some(check);\n\n function check({subfields}) {\n return subfields.some(({code, value}) => code === 'a' && value === 'Y');\n }\n }\n\n function checkSta() {\n return record.get(/^STA$/u).some(check);\n\n function check({subfields}) {\n const values = ['DELETED', 'DELETED-SPLIT', 'DELETED-DEPRECATED'];\n return subfields.some(({code, value}) => code === 'a' && values.includes(value));\n }\n }\n}\n\nexport function parseBoolean(value) {\n if (value === undefined) {\n return false;\n }\n\n if (Number.isNaN(Number(value))) {\n return value.length > 0 && value !== 'false';\n }\n\n return Boolean(Number(value));\n}\n\nexport function getRecordTitle(record) {\n const TRIM_PATTERN = '[?!.,(){}:;/ ]*';\n const field = record\n .get(/^245$/u)\n .find(f => f.subfields.some(sf => sf.code === 'a'));\n\n if (field) {\n return field.subfields.find(sf => sf.code === 'a').value\n .replace(new RegExp(`^${TRIM_PATTERN}`, 'u'), '')\n .replace(new RegExp(`${TRIM_PATTERN}$`, 'u'), '');\n }\n\n return '';\n}\n\nexport function getRecordStandardIdentifiers(record) {\n return record.get(/^(?<def>020|022|024)$/u)\n .filter(f => f.subfields.some(sf => ['a', 'z'].includes(sf.code)))\n .map(field => {\n const subfield = field.subfields.find(sf => ['a', 'z'].includes(sf.code));\n return subfield.value;\n });\n}\n\nexport function clone(o) {\n return JSON.parse(JSON.stringify(o));\n}\n\nexport function toAlephId(id) {\n return id.padStart(9, '0');\n}\n\nexport function fromAlephId(id) {\n return id.replace(/^0+/u, '');\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEO,SAASA,2BAAT,CAAqCC,QAArC,EAA8D;EAAA,IAAfC,QAAe,uEAAJ,EAAI;EACnE,MAAMC,OAAO,GAAGC,MAAM,CAACC,IAAP,WAAeJ,QAAf,cAA2BC,QAA3B,GAAuCI,QAAvC,CAAgD,QAAhD,CAAhB;EACA,uBAAgBH,OAAhB;AACD;;AAEM,SAASI,eAAT,CAAyBC,MAAzB,EAAiC;EACtC,IAAI,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,EAAgBC,QAAhB,CAAyBD,MAAM,CAACE,MAAP,CAAc,CAAd,CAAzB,CAAJ,EAAgD;IAC9C,OAAO,IAAP;EACD;;EAED,OAAOC,QAAQ,MAAMC,QAAQ,EAA7B;;EAEA,SAASD,QAAT,GAAoB;IAClB,OAAOH,MAAM,CAACK,GAAP,CAAW,QAAX,EAAqBC,IAArB,CAA0BC,KAA1B,CAAP;;IAEA,SAASA,KAAT,OAA4B;MAAA,IAAb;QAACC;MAAD,CAAa;MAC1B,OAAOA,SAAS,CAACF,IAAV,CAAe;QAAA,IAAC;UAACG,IAAD;UAAOC;QAAP,CAAD;QAAA,OAAmBD,IAAI,KAAK,GAAT,IAAgBC,KAAK,KAAK,GAA7C;MAA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,GAA/B,CADJ,EACyC,EADzC,EAEJK,OAFI,CAEI,IAAIC,MAAJ,WAAcN,YAAd,QAA+B,GAA/B,CAFJ,EAEyC,EAFzC,CAAP;EAGD;;EAED,OAAO,EAAP;AACD;;AAEM,SAASO,4BAAT,CAAsC1B,MAAtC,EAA8C;EACnD,OAAOA,MAAM,CAACK,GAAP,CAAW,wBAAX,EACJsB,MADI,CACGL,CAAC,IAAIA,CAAC,CAACd,SAAF,CAAYF,IAAZ,CAAiBiB,EAAE,IAAI,CAAC,GAAD,EAAM,GAAN,EAAWtB,QAAX,CAAoBsB,EAAE,CAACd,IAAvB,CAAvB,CADR,EAEJmB,GAFI,CAEAR,KAAK,IAAI;IACZ,MAAMS,QAAQ,GAAGT,KAAK,CAACZ,SAAN,CAAgBa,IAAhB,CAAqBE,EAAE,IAAI,CAAC,GAAD,EAAM,GAAN,EAAWtB,QAAX,CAAoBsB,EAAE,CAACd,IAAvB,CAA3B,CAAjB;IACA,OAAOoB,QAAQ,CAACnB,KAAhB;EACD,CALI,CAAP;AAMD;;AAEM,SAASoB,KAAT,CAAeC,CAAf,EAAkB;EACvB,OAAOC,IAAI,CAACC,KAAL,CAAWD,IAAI,CAACE,SAAL,CAAeH,CAAf,CAAX,CAAP;AACD;;AAEM,SAASI,SAAT,CAAmBC,EAAnB,EAAuB;EAC5B,OAAOA,EAAE,CAACC,QAAH,CAAY,CAAZ,EAAe,GAAf,CAAP;AACD;;AAEM,SAASC,WAAT,CAAqBF,EAArB,EAAyB;EAC9B,OAAOA,EAAE,CAACZ,OAAH,CAAW,MAAX,EAAmB,EAAnB,CAAP;AACD"}
|
package/dist/utils.spec.js
CHANGED
|
@@ -18,7 +18,7 @@ var _utils = require("./utils");
|
|
|
18
18
|
*
|
|
19
19
|
* Shared modules for Melinda's software
|
|
20
20
|
*
|
|
21
|
-
* Copyright (C) 2018-
|
|
21
|
+
* Copyright (C) 2018-2022 University Of Helsinki (The National Library Of Finland)
|
|
22
22
|
*
|
|
23
23
|
* This file is part of melinda-commons-js
|
|
24
24
|
*
|
package/dist/utils.spec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.spec.js","names":["MarcRecord","setValidationOptions","subfieldValues","FIXTURES_PATH","path","join","__dirname","describe","it","value","generateAuthorizationHeader","expect","to","equal","data","fs","readFileSync","record","JSON","parse","isDeletedRecord","parseBoolean","undefined","forEach","descr","index","title","recordData","getRecordTitle","identifiers","getRecordStandardIdentifiers","eql","obj","cloned","clone","not"],"sources":["../src/utils.spec.js"],"sourcesContent":["/**\n*\n* @licstart The following is the entire license notice for the JavaScript code in this file.\n*\n* Shared modules for Melinda's software\n*\n* Copyright (C) 2018-2021 University Of Helsinki (The National Library Of Finland)\n*\n* This file is part of melinda-commons-js\n*\n* melinda-commons-js program is free software: you can redistribute it and/or modify\n* it under the terms of the GNU Lesser General Public License as\n* published by the Free Software Foundation, either version 3 of the\n* License, or (at your option) any later version.\n*\n* melinda-commons-js is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n* GNU Lesser General Public License for more details.\n*\n* You should have received a copy of the GNU Lesser General Public License\n* along with this program. If not, see <http://www.gnu.org/licenses/>.\n*\n* @licend The above is the entire license notice\n* for the JavaScript code in this file.\n*\n*/\n\nimport fs from 'fs';\nimport path from 'path';\nimport {expect} from 'chai';\nimport {MarcRecord} from '@natlibfi/marc-record';\nimport {\n generateAuthorizationHeader, isDeletedRecord, parseBoolean, clone,\n getRecordTitle, getRecordStandardIdentifiers\n} from './utils';\n\nMarcRecord.setValidationOptions({subfieldValues: false});\n\nconst FIXTURES_PATH = path.join(__dirname, '../test-fixtures/utils');\n\ndescribe('utils', () => {\n describe('generateAuthorizationHeader', () => {\n it('Should create a proper Authorization header', () => {\n const value = generateAuthorizationHeader('foo', 'bar');\n expect(value).to.equal('Basic Zm9vOmJhcg==');\n });\n });\n\n describe('isDeletedRecord', () => {\n it('Should find the record deleted (Leader)', () => {\n const data = fs.readFileSync(path.join(FIXTURES_PATH, 'isDeletedRecord/record1.json'), 'utf8');\n const record = new MarcRecord(JSON.parse(data));\n expect(isDeletedRecord(record)).to.equal(true);\n });\n\n it('Should find the record deleted (DEL)', () => {\n const data = fs.readFileSync(path.join(FIXTURES_PATH, 'isDeletedRecord/record2.json'), 'utf8');\n const record = new MarcRecord(JSON.parse(data));\n expect(isDeletedRecord(record)).to.equal(true);\n });\n\n it('Should find the record deleted (STA)', () => {\n const data = fs.readFileSync(path.join(FIXTURES_PATH, 'isDeletedRecord/record3.json'), 'utf8');\n const record = new MarcRecord(JSON.parse(data));\n expect(isDeletedRecord(record)).to.equal(true);\n });\n\n it('Should find the record not deleted', () => {\n const data = fs.readFileSync(path.join(FIXTURES_PATH, 'isDeletedRecord/record4.json'), 'utf8');\n const record = new MarcRecord(JSON.parse(data));\n expect(isDeletedRecord(record)).to.equal(false);\n });\n\n it('Should find the record deleted (Split)', () => {\n const data = fs.readFileSync(path.join(FIXTURES_PATH, 'isDeletedRecord/record5.json'), 'utf8');\n const record = new MarcRecord(JSON.parse(data));\n expect(isDeletedRecord(record)).to.equal(true);\n });\n\n it('Should find the record deleted (Deprecated)', () => {\n const data = fs.readFileSync(path.join(FIXTURES_PATH, 'isDeletedRecord/record6.json'), 'utf8');\n const record = new MarcRecord(JSON.parse(data));\n expect(isDeletedRecord(record)).to.equal(true);\n });\n\n it('Should find the record deleted (Split (Aleph))', () => {\n const data = fs.readFileSync(path.join(FIXTURES_PATH, 'isDeletedRecord/record7.json'), 'utf8');\n const record = new MarcRecord(JSON.parse(data));\n expect(isDeletedRecord(record)).to.equal(true);\n });\n\n it('Should find the record deleted (Deprecated (Aleph))', () => {\n const data = fs.readFileSync(path.join(FIXTURES_PATH, 'isDeletedRecord/record8.json'), 'utf8');\n const record = new MarcRecord(JSON.parse(data));\n expect(isDeletedRecord(record)).to.equal(true);\n });\n });\n\n describe('parseBoolean', () => {\n it('Should parse undefined as false', () => {\n expect(parseBoolean(undefined)).to.equal(false);\n });\n\n it('Should parse zero-length string as false', () => {\n expect(parseBoolean('')).to.equal(false);\n });\n\n it('Should parse numericish value as true', () => {\n expect(parseBoolean('1')).to.equal(true);\n });\n\n it('Should parse numericush value as false', () => {\n expect(parseBoolean('0')).to.equal(false);\n });\n\n it('Should parse literal \\'false\\' value as false', () => {\n expect(parseBoolean('false')).to.equal(false);\n });\n\n it('Should parse non-numericish value as true', () => {\n expect(parseBoolean('foo')).to.equal(true);\n });\n });\n\n describe('getRecordTitle', () => {\n [\n 'Should find a title',\n 'Should not find a title'\n ].forEach((descr, index) => {\n it(descr, () => {\n const title = fs.readFileSync(path.join(FIXTURES_PATH, `getRecordTitle/title${index}.txt`), 'utf8');\n const recordData = fs.readFileSync(path.join(FIXTURES_PATH, `getRecordTitle/record${index}.json`), 'utf8');\n const record = new MarcRecord(JSON.parse(recordData));\n\n expect(getRecordTitle(record)).to.equal(title);\n });\n });\n });\n\n describe('getRecordStandardIdentifiers', () => {\n [\n 'Should find identifiers',\n 'Should not find an identifier'\n ].forEach((descr, index) => {\n it(descr, () => {\n const identifiers = JSON.parse(fs.readFileSync(path.join(FIXTURES_PATH, `getRecordStandardIdentifiers/identifiers${index}.json`), 'utf8'));\n const recordData = fs.readFileSync(path.join(FIXTURES_PATH, `getRecordStandardIdentifiers/record${index}.json`), 'utf8');\n const record = new MarcRecord(JSON.parse(recordData));\n\n expect(getRecordStandardIdentifiers(record)).to.eql(identifiers);\n });\n });\n });\n\n describe('clone', () => {\n it('Should clone an object', (index = '1') => {\n const obj = JSON.parse(fs.readFileSync(path.join(FIXTURES_PATH, `clone/${index}/obj.json`), 'utf8'));\n const cloned = clone(obj);\n\n expect(obj).to.not.equal(cloned);\n expect(cloned).to.eql(obj);\n });\n });\n});\n"],"mappings":";;;;AA4BA;;AACA;;AACA;;AACA;;AACA;;AAhCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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EAAE,CAAC,wBAAD,EAA2B,YAAiB;MAAA,IAAhBiB,KAAgB,uEAAR,GAAQ;MAC5C,MAAMO,GAAG,GAAGd,IAAI,CAACC,KAAL,CAAWJ,WAAA,CAAGC,YAAH,CAAgBZ,aAAA,CAAKC,IAAL,CAAUF,aAAV,kBAAkCsB,KAAlC,eAAhB,EAAqE,MAArE,CAAX,CAAZ;MACA,MAAMQ,MAAM,GAAG,IAAAC,YAAA,EAAMF,GAAN,CAAf;MAEA,IAAArB,YAAA,EAAOqB,GAAP,EAAYpB,EAAZ,CAAeuB,GAAf,CAAmBtB,KAAnB,CAAyBoB,MAAzB;MACA,IAAAtB,YAAA,EAAOsB,MAAP,EAAerB,EAAf,CAAkBmB,GAAlB,CAAsBC,GAAtB;IACD,CANC,CAAF;EAOD,CARO,CAAR;AASD,CA3HO,CAAR"}
|
|
1
|
+
{"version":3,"file":"utils.spec.js","names":["MarcRecord","setValidationOptions","subfieldValues","FIXTURES_PATH","path","join","__dirname","describe","it","value","generateAuthorizationHeader","expect","to","equal","data","fs","readFileSync","record","JSON","parse","isDeletedRecord","parseBoolean","undefined","forEach","descr","index","title","recordData","getRecordTitle","identifiers","getRecordStandardIdentifiers","eql","obj","cloned","clone","not"],"sources":["../src/utils.spec.js"],"sourcesContent":["/**\n*\n* @licstart The following is the entire license notice for the JavaScript code in this file.\n*\n* Shared modules for Melinda's software\n*\n* Copyright (C) 2018-2022 University Of Helsinki (The National Library Of Finland)\n*\n* This file is part of melinda-commons-js\n*\n* melinda-commons-js program is free software: you can redistribute it and/or modify\n* it under the terms of the GNU Lesser General Public License as\n* published by the Free Software Foundation, either version 3 of the\n* License, or (at your option) any later version.\n*\n* melinda-commons-js is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n* GNU Lesser General Public License for more details.\n*\n* You should have received a copy of the GNU Lesser General Public License\n* along with this program. If not, see <http://www.gnu.org/licenses/>.\n*\n* @licend The above is the entire license notice\n* for the JavaScript code in this file.\n*\n*/\n\nimport fs from 'fs';\nimport path from 'path';\nimport {expect} from 'chai';\nimport {MarcRecord} from '@natlibfi/marc-record';\nimport {\n generateAuthorizationHeader, isDeletedRecord, parseBoolean, clone,\n getRecordTitle, getRecordStandardIdentifiers\n} from './utils';\n\nMarcRecord.setValidationOptions({subfieldValues: false});\n\nconst FIXTURES_PATH = path.join(__dirname, '../test-fixtures/utils');\n\ndescribe('utils', () => {\n describe('generateAuthorizationHeader', () => {\n it('Should create a proper Authorization header', () => {\n const value = generateAuthorizationHeader('foo', 'bar');\n expect(value).to.equal('Basic Zm9vOmJhcg==');\n });\n });\n\n describe('isDeletedRecord', () => {\n it('Should find the record deleted (Leader)', () => {\n const data = fs.readFileSync(path.join(FIXTURES_PATH, 'isDeletedRecord/record1.json'), 'utf8');\n const record = new MarcRecord(JSON.parse(data));\n expect(isDeletedRecord(record)).to.equal(true);\n });\n\n it('Should find the record deleted (DEL)', () => {\n const data = fs.readFileSync(path.join(FIXTURES_PATH, 'isDeletedRecord/record2.json'), 'utf8');\n const record = new MarcRecord(JSON.parse(data));\n expect(isDeletedRecord(record)).to.equal(true);\n });\n\n it('Should find the record deleted (STA)', () => {\n const data = fs.readFileSync(path.join(FIXTURES_PATH, 'isDeletedRecord/record3.json'), 'utf8');\n const record = new MarcRecord(JSON.parse(data));\n expect(isDeletedRecord(record)).to.equal(true);\n });\n\n it('Should find the record not deleted', () => {\n const data = fs.readFileSync(path.join(FIXTURES_PATH, 'isDeletedRecord/record4.json'), 'utf8');\n const record = new MarcRecord(JSON.parse(data));\n expect(isDeletedRecord(record)).to.equal(false);\n });\n\n it('Should find the record deleted (Split)', () => {\n const data = fs.readFileSync(path.join(FIXTURES_PATH, 'isDeletedRecord/record5.json'), 'utf8');\n const record = new MarcRecord(JSON.parse(data));\n expect(isDeletedRecord(record)).to.equal(true);\n });\n\n it('Should find the record deleted (Deprecated)', () => {\n const data = fs.readFileSync(path.join(FIXTURES_PATH, 'isDeletedRecord/record6.json'), 'utf8');\n const record = new MarcRecord(JSON.parse(data));\n expect(isDeletedRecord(record)).to.equal(true);\n });\n\n it('Should find the record deleted (Split (Aleph))', () => {\n const data = fs.readFileSync(path.join(FIXTURES_PATH, 'isDeletedRecord/record7.json'), 'utf8');\n const record = new MarcRecord(JSON.parse(data));\n expect(isDeletedRecord(record)).to.equal(true);\n });\n\n it('Should find the record deleted (Deprecated (Aleph))', () => {\n const data = fs.readFileSync(path.join(FIXTURES_PATH, 'isDeletedRecord/record8.json'), 'utf8');\n const record = new MarcRecord(JSON.parse(data));\n expect(isDeletedRecord(record)).to.equal(true);\n });\n });\n\n describe('parseBoolean', () => {\n it('Should parse undefined as false', () => {\n expect(parseBoolean(undefined)).to.equal(false);\n });\n\n it('Should parse zero-length string as false', () => {\n expect(parseBoolean('')).to.equal(false);\n });\n\n it('Should parse numericish value as true', () => {\n expect(parseBoolean('1')).to.equal(true);\n });\n\n it('Should parse numericush value as false', () => {\n expect(parseBoolean('0')).to.equal(false);\n });\n\n it('Should parse literal \\'false\\' value as false', () => {\n expect(parseBoolean('false')).to.equal(false);\n });\n\n it('Should parse non-numericish value as true', () => {\n expect(parseBoolean('foo')).to.equal(true);\n });\n });\n\n describe('getRecordTitle', () => {\n [\n 'Should find a title',\n 'Should not find a title'\n ].forEach((descr, index) => {\n it(descr, () => {\n const title = fs.readFileSync(path.join(FIXTURES_PATH, `getRecordTitle/title${index}.txt`), 'utf8');\n const recordData = fs.readFileSync(path.join(FIXTURES_PATH, `getRecordTitle/record${index}.json`), 'utf8');\n const record = new MarcRecord(JSON.parse(recordData));\n\n expect(getRecordTitle(record)).to.equal(title);\n });\n });\n });\n\n describe('getRecordStandardIdentifiers', () => {\n [\n 'Should find identifiers',\n 'Should not find an identifier'\n ].forEach((descr, index) => {\n it(descr, () => {\n const identifiers = JSON.parse(fs.readFileSync(path.join(FIXTURES_PATH, `getRecordStandardIdentifiers/identifiers${index}.json`), 'utf8'));\n const recordData = fs.readFileSync(path.join(FIXTURES_PATH, `getRecordStandardIdentifiers/record${index}.json`), 'utf8');\n const record = new MarcRecord(JSON.parse(recordData));\n\n expect(getRecordStandardIdentifiers(record)).to.eql(identifiers);\n });\n });\n });\n\n describe('clone', () => {\n it('Should clone an object', (index = '1') => {\n const obj = JSON.parse(fs.readFileSync(path.join(FIXTURES_PATH, `clone/${index}/obj.json`), 'utf8'));\n const cloned = clone(obj);\n\n expect(obj).to.not.equal(cloned);\n expect(cloned).to.eql(obj);\n });\n });\n});\n"],"mappings":";;;;AA4BA;;AACA;;AACA;;AACA;;AACA;;AAhCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAWAA,sBAAA,CAAWC,oBAAX,CAAgC;EAACC,cAAc,EAAE;AAAjB,CAAhC;;AAEA,MAAMC,aAAa,GAAGC,aAAA,CAAKC,IAAL,CAAUC,SAAV,EAAqB,wBAArB,CAAtB;;AAEAC,QAAQ,CAAC,OAAD,EAAU,MAAM;EACtBA,QAAQ,CAAC,6BAAD,EAAgC,MAAM;IAC5CC,EAAE,CAAC,6CAAD,EAAgD,MAAM;MACtD,MAAMC,KAAK,GAAG,IAAAC,kCAAA,EAA4B,KAA5B,EAAmC,KAAnC,CAAd;MACA,IAAAC,YAAA,EAAOF,KAAP,EAAcG,EAAd,CAAiBC,KAAjB,CAAuB,oBAAvB;IACD,CAHC,CAAF;EAID,CALO,CAAR;EAOAN,QAAQ,CAAC,iBAAD,EAAoB,MAAM;IAChCC,EAAE,CAAC,yCAAD,EAA4C,MAAM;MAClD,MAAMM,IAAI,GAAGC,WAAA,CAAGC,YAAH,CAAgBZ,aAAA,CAAKC,IAAL,CAAUF,aAAV,EAAyB,8BAAzB,CAAhB,EAA0E,MAA1E,CAAb;;MACA,MAAMc,MAAM,GAAG,IAAIjB,sBAAJ,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AX,CAApB;;QACA,MAAME,UAAU,GAAGZ,WAAA,CAAGC,YAAH,CAAgBZ,aAAA,CAAKC,IAAL,CAAUF,aAAV,+CAA+DsB,KAA/D,WAAhB,EAA8F,MAA9F,CAAnB;;QACA,MAAMR,MAAM,GAAG,IAAIjB,sBAAJ,CAAekB,IAAI,CAACC,KAAL,CAAWQ,UAAX,CAAf,CAAf;QAEA,IAAAhB,YAAA,EAAO,IAAAmB,mCAAA,EAA6Bb,MAA7B,CAAP,EAA6CL,EAA7C,CAAgDmB,GAAhD,CAAoDF,WAApD;MACD,CANC,CAAF;IAOD,CAXD;EAYD,CAbO,CAAR;EAeAtB,QAAQ,CAAC,OAAD,EAAU,MAAM;IACtBC,EAAE,CAAC,wBAAD,EAA2B,YAAiB;MAAA,IAAhBiB,KAAgB,uEAAR,GAAQ;MAC5C,MAAMO,GAAG,GAAGd,IAAI,CAACC,KAAL,CAAWJ,WAAA,CAAGC,YAAH,CAAgBZ,aAAA,CAAKC,IAAL,CAAUF,aAAV,kBAAkCsB,KAAlC,eAAhB,EAAqE,MAArE,CAAX,CAAZ;MACA,MAAMQ,MAAM,GAAG,IAAAC,YAAA,EAAMF,GAAN,CAAf;MAEA,IAAArB,YAAA,EAAOqB,GAAP,EAAYpB,EAAZ,CAAeuB,GAAf,CAAmBtB,KAAnB,CAAyBoB,MAAzB;MACA,IAAAtB,YAAA,EAAOsB,MAAP,EAAerB,EAAf,CAAkBmB,GAAlB,CAAsBC,GAAtB;IACD,CANC,CAAF;EAOD,CARO,CAAR;AASD,CA3HO,CAAR"}
|
package/package.json
CHANGED
package/src/error.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Shared modules for Melinda's software
|
|
6
6
|
*
|
|
7
|
-
* Copyright (C) 2018-
|
|
7
|
+
* Copyright (C) 2018-2022 University Of Helsinki (The National Library Of Finland)
|
|
8
8
|
*
|
|
9
9
|
* This file is part of melinda-commons-js
|
|
10
10
|
*
|
package/src/error.spec.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Shared modules for Melinda's software
|
|
6
6
|
*
|
|
7
|
-
* Copyright (C) 2018-
|
|
7
|
+
* Copyright (C) 2018-2022 University Of Helsinki (The National Library Of Finland)
|
|
8
8
|
*
|
|
9
9
|
* This file is part of melinda-commons-js
|
|
10
10
|
*
|
package/src/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Shared modules for Melinda's software
|
|
6
6
|
*
|
|
7
|
-
* Copyright (C) 2018-
|
|
7
|
+
* Copyright (C) 2018-2022 University Of Helsinki (The National Library Of Finland)
|
|
8
8
|
*
|
|
9
9
|
* This file is part of melinda-commons-js
|
|
10
10
|
*
|
package/src/subRecordPicker.js
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @licstart The following is the entire license notice for the JavaScript code in this file.
|
|
4
|
+
*
|
|
5
|
+
* Shared modules for Melinda's software
|
|
6
|
+
*
|
|
7
|
+
* Copyright (C) 2018-2022 University Of Helsinki (The National Library Of Finland)
|
|
8
|
+
*
|
|
9
|
+
* This file is part of melinda-commons-js
|
|
10
|
+
*
|
|
11
|
+
* melinda-commons-js program is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU Lesser General Public License as
|
|
13
|
+
* published by the Free Software Foundation, either version 3 of the
|
|
14
|
+
* License, or (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* melinda-commons-js is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU Lesser General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*
|
|
24
|
+
* @licend The above is the entire license notice
|
|
25
|
+
* for the JavaScript code in this file.
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
|
|
1
29
|
import createSruClient from '@natlibfi/sru-client';
|
|
2
30
|
import {MARCXML} from '@natlibfi/marc-record-serializers';
|
|
3
31
|
import createDebugLogger from 'debug';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Shared modules for Melinda's software
|
|
6
6
|
*
|
|
7
|
-
* Copyright (C) 2018-
|
|
7
|
+
* Copyright (C) 2018-2022 University Of Helsinki (The National Library Of Finland)
|
|
8
8
|
*
|
|
9
9
|
* This file is part of melinda-commons-js
|
|
10
10
|
*
|
package/src/utils.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Shared modules for Melinda's software
|
|
6
6
|
*
|
|
7
|
-
* Copyright (C) 2018-
|
|
7
|
+
* Copyright (C) 2018-2022 University Of Helsinki (The National Library Of Finland)
|
|
8
8
|
*
|
|
9
9
|
* This file is part of melinda-commons-js
|
|
10
10
|
*
|
package/src/utils.spec.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Shared modules for Melinda's software
|
|
6
6
|
*
|
|
7
|
-
* Copyright (C) 2018-
|
|
7
|
+
* Copyright (C) 2018-2022 University Of Helsinki (The National Library Of Finland)
|
|
8
8
|
*
|
|
9
9
|
* This file is part of melinda-commons-js
|
|
10
10
|
*
|
package/.drone.yml
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
kind: pipeline
|
|
3
|
-
type: docker
|
|
4
|
-
name: Default
|
|
5
|
-
|
|
6
|
-
trigger:
|
|
7
|
-
event:
|
|
8
|
-
- push
|
|
9
|
-
- tag
|
|
10
|
-
|
|
11
|
-
steps:
|
|
12
|
-
|
|
13
|
-
- name: audit
|
|
14
|
-
image: node:14
|
|
15
|
-
commands:
|
|
16
|
-
- npm audit --package-lock-only --production --audit-level=moderate
|
|
17
|
-
|
|
18
|
-
- name: install
|
|
19
|
-
image: node:14
|
|
20
|
-
environment:
|
|
21
|
-
NPM_CONFIG_IGNORE_SCRIPTS: true
|
|
22
|
-
commands:
|
|
23
|
-
- npm -v
|
|
24
|
-
- npm i --no-optional
|
|
25
|
-
|
|
26
|
-
- name: test
|
|
27
|
-
image: node:14
|
|
28
|
-
commands:
|
|
29
|
-
- npm test
|
|
30
|
-
|
|
31
|
-
- name: check-coverage
|
|
32
|
-
image: node:14
|
|
33
|
-
commands:
|
|
34
|
-
- npm run coverage
|
|
35
|
-
|
|
36
|
-
- name: build
|
|
37
|
-
image: node:14
|
|
38
|
-
commands:
|
|
39
|
-
- npm run build
|
|
40
|
-
- npm i --production --no-optional
|
|
41
|
-
|
|
42
|
-
- name: static-security-scan
|
|
43
|
-
image: quay.io/natlibfi/njsscan
|
|
44
|
-
commands:
|
|
45
|
-
- njsscan dist
|
|
46
|
-
|
|
47
|
-
- name: npm
|
|
48
|
-
image: plugins/npm
|
|
49
|
-
settings:
|
|
50
|
-
registry: 'https://registry.npmjs.org/'
|
|
51
|
-
token:
|
|
52
|
-
from_secret: npm_token
|
|
53
|
-
when:
|
|
54
|
-
event: tag
|
|
55
|
-
---
|
|
56
|
-
kind: pipeline
|
|
57
|
-
type: docker
|
|
58
|
-
name: Update dependencies
|
|
59
|
-
|
|
60
|
-
trigger:
|
|
61
|
-
event:
|
|
62
|
-
- custom
|
|
63
|
-
branch:
|
|
64
|
-
- master
|
|
65
|
-
|
|
66
|
-
steps:
|
|
67
|
-
|
|
68
|
-
- name: publish
|
|
69
|
-
image: quay.io/natlibfi/drone-npm-git-publish
|
|
70
|
-
settings:
|
|
71
|
-
git_user_name: natlibfi-melinda-automation
|
|
72
|
-
git_user_email: 65649125+natlibfi-melinda-automation@users.noreply.github.com
|
|
73
|
-
git_ssh_key:
|
|
74
|
-
from_secret: ssh_key
|
|
75
|
-
git_gpg_key:
|
|
76
|
-
from_secret: gpg_key
|
|
77
|
-
---
|
|
78
|
-
kind: secret
|
|
79
|
-
name: npm_token
|
|
80
|
-
data: WPsq04T2v5bbdCGirHSM9ZcWVAR3aSJytpWj3HmnX3OLvakka8+TpRPykFlDZLjHBu5neoVR8RJ92fb2FpAQlQ==
|
|
81
|
-
---
|
|
82
|
-
kind: secret
|
|
83
|
-
name: ssh_key
|
|
84
|
-
data: LlaW3vsx2/hiJSZ+xB73usO5Rrcrpq279+Fz75KLhwEv1hriU3bkhHxJzJd8Xanx7hr1HZPhIJBuBdajiqFz0dHpZA946lgkbTL8L7PMahcY1PQBcq5e6b4TfoBeSKtq7hWmI1LRk7AVvAPozuxsfvMiXwZ85Odf6qq5cwsRVKOvW2OP54pL8iKVg97LE010fZmPq/1Itm4bXxIJh07LfEUFCardmjNK9x38LfDy0rtfEIHu1kKPRQEP3QFPqnIlet17mLqShgNeoP7XNwKEQFBk/2MnqVC53vrA3EBGasL9Q74Co5d3wDEGH2WCFNQdBJgAbELG86zZHmwXClrMUxmUjIZj9h57lxuthfGgpsHfZbUFv4y5yXKxss94txplqdU8oCqgbrPF6P4VlRBbgHOyEGrNR9rtHxT0n8ScUBsHA/PP+3onMdcKePQJgI5H47cXSMPyj3R0V8vMiyMDSx+3DlVG5Y90UzU7/qhsN1lsogNRfxV5CD5w8Yj9uk2/nyno5p6Pm2U4ywsjNjDuc1vzClGLepME0qzl50h4GNe0PecbcNDvdgicYkGcNrxqfmK8xMe0dUzDy0qytFZk5Sx/cQ0Nl8ZMawO3xzVcIBhFBlJt+7XPBOGAEW9AVocCAhrAzMeToLbmWPN9AtDyxAtHuGLTeU28A4rCS6GZFOiwbvFtiidgWwGyGP5Pgy7CuazFnTFJWusjmWAMnyfQUpKAM4vntdri6kzjmQCtK5y4enA9p1LdsKzIIwClwQBbz6GUYOUjwFKnGlWOAW/ADQVrXEMjRrU9NmYU8ru8vZ+xDYazYcQEV9BM3wY+G/92AWnyBvTfnm94UlKZAHMxBPQFjQIP5Fl3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