cocoda-sdk 3.6.4 → 3.7.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.
@@ -90,9 +90,8 @@ class BaseProvider {
90
90
  return data;
91
91
  }, (error) => {
92
92
  const count = error.config?._retryCount ?? 0;
93
- const method = error.config.method;
94
93
  const statusCode = error.response?.status;
95
- if (this._retryConfig.methods.includes(method) && this._retryConfig.statusCodes.includes(statusCode) && count < this._retryConfig.count) {
94
+ if (this._retryConfig.methods.includes(error.config?.method) && this._retryConfig.statusCodes.includes(statusCode) && count < this._retryConfig.count) {
96
95
  error.config._retryCount = count + 1;
97
96
  if (error.config.data) {
98
97
  error.config.data = JSON.parse(error.config.data);
@@ -394,9 +393,6 @@ class BaseProvider {
394
393
  concept._getAncestors = (config) => {
395
394
  return this.getAncestors({ ...config, concept });
396
395
  };
397
- concept._getDetails = async (config) => {
398
- return (await this.getConcepts({ ...config, concepts: [concept] }))[0];
399
- };
400
396
  for (let type of ["broader", "narrower", "ancestors"]) {
401
397
  if (Array.isArray(concept[type]) && concept[type].length && !concept[type].includes(null)) {
402
398
  concept[type] = this.adjustConcepts(concept[type]);
@@ -430,12 +426,6 @@ class BaseProvider {
430
426
  scheme._getTop = (config) => {
431
427
  return scheme._registry.getTop({ ...config, scheme });
432
428
  };
433
- scheme._getTypes = (config) => {
434
- return scheme._registry.getTypes({ ...config, scheme });
435
- };
436
- scheme._suggest = ({ search, ...config }) => {
437
- return scheme._registry.suggest({ ...config, search, scheme });
438
- };
439
429
  }
440
430
  return scheme;
441
431
  }
@@ -456,12 +446,6 @@ class BaseProvider {
456
446
  }
457
447
  }
458
448
  mapping._registry = this;
459
- if (!mapping.identifier) {
460
- let identifier = jskos.addMappingIdentifiers(mapping)?.identifier;
461
- if (identifier) {
462
- mapping.identifier = identifier;
463
- }
464
- }
465
449
  return mapping;
466
450
  }
467
451
  adjustMappings(mappings) {
@@ -174,7 +174,6 @@ class MappingsApiProvider extends BaseProvider {
174
174
  throw new errors.InvalidOrMissingParameterError({ parameter: "mapping" });
175
175
  }
176
176
  mapping = jskos.minifyMapping(mapping);
177
- mapping = jskos.addMappingIdentifiers(mapping);
178
177
  return this.axios({
179
178
  ...config,
180
179
  method: "post",
@@ -198,7 +197,6 @@ class MappingsApiProvider extends BaseProvider {
198
197
  throw new errors.InvalidOrMissingParameterError({ parameter: "mapping" });
199
198
  }
200
199
  mapping = jskos.minifyMapping(mapping);
201
- mapping = jskos.addMappingIdentifiers(mapping);
202
200
  const uri = mapping.uri;
203
201
  if (!uri || !uri.startsWith(this._api.mappings)) {
204
202
  throw new errors.InvalidOrMissingParameterError({ parameter: "mapping", message: "URI doesn't seem to be part of this registry." });
@@ -89,7 +89,6 @@ class OccurrencesApiProvider extends BaseProvider {
89
89
  }
90
90
  mapping.type = [jskos.defaultMappingType.uri];
91
91
  mapping._occurrence = occurrence;
92
- mapping = jskos.addMappingIdentifiers(mapping);
93
92
  mappings.push(mapping);
94
93
  }
95
94
  mappings._url = occurrences._url;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cocoda-sdk",
3
- "version": "3.6.4",
3
+ "version": "3.7.0",
4
4
  "description": "SDK for Cocoda",
5
5
  "main": "dist/cjs/index.cjs",
6
6
  "module": "dist/esm/index.js",
@@ -52,7 +52,7 @@
52
52
  "homepage": "https://github.com/gbv/cocoda-sdk#readme",
53
53
  "devDependencies": {
54
54
  "axios-mock-adapter": "^2.1.0",
55
- "c8": "^10.1.3",
55
+ "c8": "^11.0.0",
56
56
  "clean-jsdoc-theme": "^4.3.0",
57
57
  "esbuild": "~0.27.0",
58
58
  "esbuild-plugin-ifdef": "^1.0.1",
@@ -68,10 +68,10 @@
68
68
  "yesno": "^0.4.0"
69
69
  },
70
70
  "dependencies": {
71
- "axios": "^1.7.9",
71
+ "axios": "^1.18.0",
72
72
  "flexsearch": "~0.8.0",
73
73
  "jskos-tools": "^1.0.43",
74
74
  "localforage": "^1.10.0",
75
- "uuid": "^13.0.0"
75
+ "uuid": "^14.0.0"
76
76
  }
77
77
  }