@teipublisher/pb-components 2.5.1 → 2.6.0
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/CHANGELOG.md +7 -0
- package/Dockerfile +2 -4
- package/dist/pb-components-bundle.js +11 -11
- package/package.json +1 -1
- package/src/authority/{gf.js → anton.js} +7 -5
- package/src/authority/connectors.js +3 -2
package/package.json
CHANGED
|
@@ -3,19 +3,21 @@ import { Registry } from "./registry.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Connector for the corporate archive of Georgfischer AG.
|
|
5
5
|
*/
|
|
6
|
-
export class
|
|
6
|
+
export class Anton extends Registry {
|
|
7
7
|
|
|
8
8
|
constructor(configElem) {
|
|
9
9
|
super(configElem);
|
|
10
|
+
this._url = configElem.getAttribute('url') || `https://archives.georgfischer.com/api`;
|
|
10
11
|
this._api = configElem.getAttribute('api');
|
|
11
12
|
this._limit = configElem.getAttribute('limit') || 999999;
|
|
13
|
+
this._provider = configElem.getAttribute('provider') || configElem.getAttribute('connector')
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
async query(key) {
|
|
15
17
|
const results = [];
|
|
16
18
|
|
|
17
19
|
const register = this.getRegister();
|
|
18
|
-
const url =
|
|
20
|
+
const url = `${this._url}/${register}?search=${encodeURIComponent(key)}&perPage=${this._limit}`;
|
|
19
21
|
const label = this.getLabelField();
|
|
20
22
|
return new Promise((resolve) => {
|
|
21
23
|
fetch(url)
|
|
@@ -38,9 +40,9 @@ export class GF extends Registry {
|
|
|
38
40
|
id: (this._prefix ? `${this._prefix}-${item.id}` : item.id),
|
|
39
41
|
label: item[label],
|
|
40
42
|
details: `${item.id}`,
|
|
41
|
-
link:
|
|
43
|
+
link: `${this._url}/${register}/${item.id}`,
|
|
42
44
|
strings: [item[label]],
|
|
43
|
-
provider:
|
|
45
|
+
provider: this._provider
|
|
44
46
|
};
|
|
45
47
|
results.push(result);
|
|
46
48
|
});
|
|
@@ -87,7 +89,7 @@ export class GF extends Registry {
|
|
|
87
89
|
*/
|
|
88
90
|
async getRecord(key) {
|
|
89
91
|
const id = key.replace(/^.*-([^-]+)$/, '$1');
|
|
90
|
-
const url =
|
|
92
|
+
const url = `${this._url}/${this.getRegister()}/${id}`;
|
|
91
93
|
return fetch(url)
|
|
92
94
|
.then(response => response.json())
|
|
93
95
|
.then(json => {
|
|
@@ -3,7 +3,7 @@ import { GeoNames } from './geonames.js';
|
|
|
3
3
|
import { Airtable } from './airtable.js';
|
|
4
4
|
import { GND } from './gnd.js';
|
|
5
5
|
import { KBGA } from './kbga.js';
|
|
6
|
-
import {
|
|
6
|
+
import { Anton } from './anton.js';
|
|
7
7
|
import { ReconciliationService } from './reconciliation.js';
|
|
8
8
|
import { Custom } from './custom.js';
|
|
9
9
|
|
|
@@ -25,8 +25,9 @@ export function createConnectors(endpoint, root) {
|
|
|
25
25
|
case 'KBGA':
|
|
26
26
|
instance = new KBGA(configElem);
|
|
27
27
|
break;
|
|
28
|
+
case 'Anton':
|
|
28
29
|
case 'GF':
|
|
29
|
-
instance = new
|
|
30
|
+
instance = new Anton(configElem);
|
|
30
31
|
break;
|
|
31
32
|
case 'ReconciliationService':
|
|
32
33
|
instance = new ReconciliationService(configElem);
|