cocoda-sdk 3.5.0 → 3.6.1
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 +132 -140
- package/dist/cjs/index.cjs +1014 -208
- package/dist/cocoda-sdk.js +10 -10
- package/dist/cocoda-sdk.js.LICENSES.txt +3 -433
- package/dist/cocoda-sdk.js.map +4 -4
- package/dist/esm/index.js +2 -1
- package/dist/esm/lib/CocodaSDK.js +21 -8
- package/dist/esm/providers/base-provider.js +69 -38
- package/dist/esm/providers/concept-api-provider.js +9 -9
- package/dist/esm/providers/contexts/context_jskos.js +240 -0
- package/dist/esm/providers/contexts/context_mod.js +59 -0
- package/dist/esm/providers/index.js +4 -0
- package/dist/esm/providers/label-search-suggestion-provider.js +5 -6
- package/dist/esm/providers/local-mappings-provider.js +8 -9
- package/dist/esm/providers/mappings-api-provider.js +33 -33
- package/dist/esm/providers/mod-api-provider.js +452 -0
- package/dist/esm/providers/mycore-provider.js +1 -2
- package/dist/esm/providers/occurrences-api-provider.js +12 -15
- package/dist/esm/providers/ols-api-provider.js +325 -0
- package/dist/esm/providers/reconciliation-api-provider.js +11 -12
- package/dist/esm/providers/skohub-provider.js +2 -3
- package/dist/esm/providers/skosmos-api-provider.js +37 -57
- package/dist/esm/utils/index.js +21 -0
- package/package.json +6 -3
- package/dist/esm/utils/lodash.js +0 -32
package/README.md
CHANGED
|
@@ -6,29 +6,28 @@
|
|
|
6
6
|
|
|
7
7
|
> SDK for [Cocoda](https://github.com/gbv/cocoda) and [coli-conc](https://coli-conc.gbv.de/) services
|
|
8
8
|
|
|
9
|
-
## Table of Contents
|
|
9
|
+
## Table of Contents
|
|
10
|
+
|
|
10
11
|
- [Install](#install)
|
|
11
12
|
- [Usage](#usage)
|
|
12
13
|
- [Import](#import)
|
|
13
|
-
- [v1 Compatibility](#v1-compatibility)
|
|
14
14
|
- [Configuration](#configuration)
|
|
15
15
|
- [Registries](#registries)
|
|
16
16
|
- [Providers](#providers)
|
|
17
17
|
- [Multiple Instances](#multiple-instances)
|
|
18
18
|
- [Authenticated Requests](#authenticated-requests)
|
|
19
|
-
- [
|
|
20
|
-
- [
|
|
21
|
-
- [
|
|
22
|
-
- [
|
|
23
|
-
- [
|
|
24
|
-
- [
|
|
25
|
-
- [
|
|
26
|
-
- [
|
|
27
|
-
- [
|
|
28
|
-
- [Errors](#errors)
|
|
19
|
+
- [API](#api)
|
|
20
|
+
- [General](#general)
|
|
21
|
+
- [Concept Schemes](#concept-schemes)
|
|
22
|
+
- [Concepts](#concepts)
|
|
23
|
+
- [Concordances](#concordances)
|
|
24
|
+
- [Mappings](#mappings)
|
|
25
|
+
- [Annotations](#annotations)
|
|
26
|
+
- [Occurrences](#occurrences)
|
|
27
|
+
- [Types](#types)
|
|
28
|
+
- [Errors](#errors)
|
|
29
29
|
- [Maintainers](#maintainers)
|
|
30
|
-
- [
|
|
31
|
-
- [Contribute](#contribute)
|
|
30
|
+
- [Contributing](#contributing)
|
|
32
31
|
- [License](#license)
|
|
33
32
|
|
|
34
33
|
## Install
|
|
@@ -36,7 +35,7 @@
|
|
|
36
35
|
npm i cocoda-sdk
|
|
37
36
|
```
|
|
38
37
|
|
|
39
|
-
We
|
|
38
|
+
We also provide a browser bundle <https://cdn.jsdelivr.net/npm/cocoda-sdk@2/dist/cocoda-sdk.js>
|
|
40
39
|
|
|
41
40
|
[](https://www.jsdelivr.com/package/npm/cocoda-sdk)
|
|
42
41
|
|
|
@@ -55,36 +54,12 @@ Since cocoda-sdk is an ES module, we'll use the `import`/`export` syntax in the
|
|
|
55
54
|
cocoda-sdk also exports some other members:
|
|
56
55
|
- `CocodaSDK` - the class that is behind the default instance
|
|
57
56
|
- `errors` - see [Errors](#errors)
|
|
57
|
+
- `providers` - an object with all provider classes
|
|
58
58
|
- All individual provider classes - see [Providers](#providers)
|
|
59
59
|
- Note: You need to append `Provider` to the names, e.g. `LocalMappings` is exported as `LocalMappingsProvider`.
|
|
60
60
|
- `addAllProviders` - a method that adds all avaiable providers to an instance
|
|
61
61
|
- Can be called without parameters to add to the default instance. Useful if you need all providers.
|
|
62
62
|
|
|
63
|
-
### v1 Compatibility
|
|
64
|
-
cocoda-sdk v2 changed how it is exported and therefore it needs to be included differently.
|
|
65
|
-
|
|
66
|
-
```js
|
|
67
|
-
// CommonJS
|
|
68
|
-
// Previously: const cdk = require("cocoda-sdk")
|
|
69
|
-
// Now:
|
|
70
|
-
const { cdk } = require("cocoda-sdk")
|
|
71
|
-
// or: const cdk = require("cocoda-sdk").cdk
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
```js
|
|
75
|
-
// ES6
|
|
76
|
-
// Previously: import * as cdk from "cocoda-sdk"
|
|
77
|
-
// Now:
|
|
78
|
-
import { cdk } from "cocoda-sdk"
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
```js
|
|
82
|
-
// Browser
|
|
83
|
-
// Previously the default instance was globally available under `cdk`.
|
|
84
|
-
// Now the module is available under `CDK` with `cdk` as one of its members. To easily make previous code compatible:
|
|
85
|
-
const { cdk } = CDK
|
|
86
|
-
```
|
|
87
|
-
|
|
88
63
|
### Configuration
|
|
89
64
|
cocoda-sdk can be configured after import:
|
|
90
65
|
|
|
@@ -115,6 +90,15 @@ A registry is an individual source of data, for instance a set of concept scheme
|
|
|
115
90
|
}
|
|
116
91
|
```
|
|
117
92
|
|
|
93
|
+
For most providers the configuration should use the BARTOC vocabulary API type URI instead:
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"api": "http://bartoc.org/api-type/skosmos",
|
|
98
|
+
"endpoint": "https://www.loterre.fr/skosmos/905/"
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
118
102
|
A list of available providers can be found [below](#providers). Most providers need additional properties to work correctly.
|
|
119
103
|
|
|
120
104
|
#### Endpoint Determination
|
|
@@ -142,6 +126,17 @@ const registry = cdk.initializeRegistry({
|
|
|
142
126
|
registry.getMappings()
|
|
143
127
|
```
|
|
144
128
|
|
|
129
|
+
Most Providers can also be initialized with API Type URI from [BARTOC vocabulary API types list](https://bartoc.org/en/node/20002):
|
|
130
|
+
|
|
131
|
+
```js
|
|
132
|
+
const registry = cdk.initializeRegistry({
|
|
133
|
+
api: "http://bartoc.org/api-type/skosmos",
|
|
134
|
+
endpoint: "https://www.loterre.fr/skosmos/905/"
|
|
135
|
+
})
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
It's also possible to directly use Registry classes.
|
|
139
|
+
|
|
145
140
|
#### Using Registries From a Configuration
|
|
146
141
|
|
|
147
142
|
If you initialize cocoda-sdk with a [configuration](#configuration), it will initialize all included registries automatically. Those registries are then accessible via `cdk.config.registries`. Alternatively, you can retrieve registries by URI:
|
|
@@ -157,12 +152,13 @@ Providers allow access to different types of APIs.
|
|
|
157
152
|
|
|
158
153
|
The following providers are offered in cocoda-sdk by default:
|
|
159
154
|
- `Base` - the base provider that all other providers have to inherit from
|
|
160
|
-
- `ConceptApi` - access to concept schemes and concepts via [jskos-server]
|
|
155
|
+
- `ConceptApi` - access to concept schemes and concepts via JSKOS API ([jskos-server] and compatible implementations)
|
|
161
156
|
- `MappingsApi` - access to concordances, mappings, and annotations via [jskos-server]
|
|
162
157
|
|
|
163
158
|
The following providers are also exported, but have to be added via `cdk.addProvider`:
|
|
164
159
|
- `LocalMappings` - access to local mappings via [localForage](https://github.com/localForage/localForage) (only available in browser)
|
|
165
160
|
- `SkosmosApi` - access to concept schemes and concepts via a [Skosmos](https://github.com/NatLibFi/Skosmos) API
|
|
161
|
+
- `OlsApi`- access to ontologies via Ontology Lookup Service (OLS) API Version 2 (experimental)
|
|
166
162
|
- `LocApi` - access to concept schemes and concepts via the [Library of Congress Linked Data Service](https://id.loc.gov/)
|
|
167
163
|
- **This integration is currently experimental and only supports LCSH and LCNAF.**
|
|
168
164
|
- `Skohub` - access to concept schemes and concepts via a [SkoHub Vocabs](https://blog.lobid.org/2019/09/27/presenting-skohub-vocabs.html)
|
|
@@ -174,6 +170,7 @@ The following providers are also exported, but have to be added via `cdk.addProv
|
|
|
174
170
|
- `ReconciliationApi` - access to mapping suggestions via a [Reconciliation Service API](https://reconciliation-api.github.io/specs/draft/)
|
|
175
171
|
- `OccurrencesApi` - access to concept occurrences via [occurrences-api](https://github.com/gbv/occurrences-api) (will be changed to [occurrences-server](https://github.com/gbv/occurrences-server) in the future)
|
|
176
172
|
- `LabelSearchSuggestion` - access to mapping suggestions using other registries' search endpoints (using [jskos-server])
|
|
173
|
+
- `ModApi` - (experimental) access to concept schemes and concepts via a [MOD](https://github.com/FAIR-IMPACT/MOD) API
|
|
177
174
|
|
|
178
175
|
To add a provider, append `Provider` to its name and import it together with `cdk`:
|
|
179
176
|
|
|
@@ -186,14 +183,28 @@ Note that in the browser bundle, all providers listed above are included and do
|
|
|
186
183
|
|
|
187
184
|
Please refer to each provider's documentation for how exactly to configure that provider: [Documentation](https://gbv.github.io/cocoda-sdk/)
|
|
188
185
|
|
|
186
|
+
#### Custom providers
|
|
187
|
+
|
|
189
188
|
It is also possible to add custom providers that inherit from BaseProvider:
|
|
190
189
|
|
|
191
190
|
```js
|
|
192
|
-
import
|
|
191
|
+
import { cdk, BaseProvider } from "cocoda-sdk"
|
|
192
|
+
|
|
193
|
+
export class CustomProvider extends BaseProvider {
|
|
194
|
+
static providerName = "Dummy"
|
|
195
|
+
// static providerType = "..." // Optional URI from https://bartoc.org/api-type/
|
|
196
|
+
|
|
197
|
+
getConcepts() {
|
|
198
|
+
return [
|
|
199
|
+
{ prefLabel: { en: "Hello!" } },
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
193
204
|
cdk.addProvider(CustomProvider)
|
|
194
205
|
```
|
|
195
206
|
|
|
196
|
-
|
|
207
|
+
See [`examples/custom-provider.js`](https://github.com/gbv/cocoda-sdk/blob/main/examples/custom-provider.js) for an extended example.
|
|
197
208
|
|
|
198
209
|
### Multiple Instances
|
|
199
210
|
|
|
@@ -288,156 +299,161 @@ You can find more in-depth examples here:
|
|
|
288
299
|
- The [Vuex store module for authentication in Cocoda](https://github.com/gbv/cocoda/blob/dev/src/store/modules/auth.js).
|
|
289
300
|
- Even if you're not using Vue.js, this can be helpful.
|
|
290
301
|
- Cocoda is using cocoda-sdk extensively, so other parts of the code might also be helpful. It has gotten pretty big and complex though.
|
|
291
|
-
- The [API page of Login Server](https://github.com/gbv/login-server/blob/
|
|
302
|
+
- The [API page of Login Server](https://github.com/gbv/login-server/blob/main/views/api.ejs). This is merely an example on how to use `login-client`.
|
|
292
303
|
|
|
293
|
-
##
|
|
304
|
+
## API
|
|
294
305
|
|
|
295
306
|
A cocoda-sdk instance itself offers only a handful of methods. The actual access to APIs happens through [registries](#registries). The following list of methods assume either an instance of cocoda-sdk (`cdk.someMethod`) or an initialized registry (`registry.someMethod`). Documentation for registry methods is on a per-provider basis. While the API should be the same for a particular methods across providers, the details on how to use it might differ.
|
|
296
307
|
|
|
297
|
-
|
|
298
|
-
Please refer to the [documentation](https://gbv.github.io/cocoda-sdk/CocodaSDK.html).
|
|
308
|
+
Please refer to the [documentation](https://gbv.github.io/cocoda-sdk/CocodaSDK.html) for a list of methods of for cocoda-sdk instances.
|
|
299
309
|
|
|
300
|
-
###
|
|
310
|
+
### General
|
|
301
311
|
|
|
302
|
-
|
|
303
|
-
- [BaseProvider - init](https://gbv.github.io/cocoda-sdk/BaseProvider.html#init)
|
|
312
|
+
- [init](https://gbv.github.io/cocoda-sdk/BaseProvider.html#init)
|
|
304
313
|
|
|
305
|
-
|
|
306
|
-
- [BaseProvider - isAuthorizedFor](https://gbv.github.io/cocoda-sdk/BaseProvider.html#isAuthorizedFor)
|
|
314
|
+
- [isAuthorizedFor](https://gbv.github.io/cocoda-sdk/BaseProvider.html#isAuthorizedFor)
|
|
307
315
|
|
|
308
|
-
|
|
309
|
-
- [BaseProvider
|
|
310
|
-
- [LabelSearchSuggestionProvider
|
|
316
|
+
- `supportsScheme`. Implemented by:
|
|
317
|
+
- [BaseProvider](https://gbv.github.io/cocoda-sdk/BaseProvider.html#supportsScheme)
|
|
318
|
+
- [LabelSearchSuggestionProvider](https://gbv.github.io/cocoda-sdk/LabelSearchSuggestionProvider.html#supportsScheme)
|
|
311
319
|
|
|
312
|
-
|
|
313
|
-
- [BaseProvider
|
|
320
|
+
- `setAuth`
|
|
321
|
+
- Implemented by [BaseProvider](https://gbv.github.io/cocoda-sdk/BaseProvider.html#setAuth)
|
|
314
322
|
|
|
315
|
-
|
|
316
|
-
- [BaseProvider
|
|
323
|
+
- setRetryConfig
|
|
324
|
+
- Implemented by [BaseProvider](https://gbv.github.io/cocoda-sdk/BaseProvider.html#setRetryConfig)
|
|
317
325
|
|
|
318
|
-
|
|
319
|
-
- [BaseProvider - getCancelTokenSource](https://gbv.github.io/cocoda-sdk/BaseProvider.html#getCancelTokenSource)
|
|
326
|
+
- getCancelTokenSource
|
|
320
327
|
|
|
321
|
-
|
|
328
|
+
- Implemented by [BaseProvider](https://gbv.github.io/cocoda-sdk/BaseProvider.html#getCancelTokenSource)
|
|
322
329
|
|
|
323
|
-
|
|
324
|
-
- [ConceptApiProvider - getSchemes](https://gbv.github.io/cocoda-sdk/ConceptApiProvider.html#getSchemes)
|
|
325
|
-
- [SkosmosApiProvider - getSchemes](https://gbv.github.io/cocoda-sdk/SkosmosApiProvider.html#getSchemes)
|
|
330
|
+
### Concept Schemes
|
|
326
331
|
|
|
327
|
-
|
|
328
|
-
- [ConceptApiProvider
|
|
332
|
+
- `getSchemes`
|
|
333
|
+
- [ConceptApiProvider](https://gbv.github.io/cocoda-sdk/ConceptApiProvider.html#getSchemes)
|
|
334
|
+
- [SkosmosApiProvider](https://gbv.github.io/cocoda-sdk/SkosmosApiProvider.html#getSchemes)
|
|
335
|
+
- ...
|
|
329
336
|
|
|
330
|
-
|
|
331
|
-
- [ConceptApiProvider
|
|
337
|
+
- `vocSearch`
|
|
338
|
+
- [ConceptApiProvider](https://gbv.github.io/cocoda-sdk/ConceptApiProvider.html#vocSearch)
|
|
339
|
+
- ...
|
|
332
340
|
|
|
333
|
-
|
|
341
|
+
- `vocSuggest`
|
|
342
|
+
- [ConceptApiProvider](https://gbv.github.io/cocoda-sdk/ConceptApiProvider.html#vocSuggest)
|
|
334
343
|
|
|
335
|
-
|
|
344
|
+
### Concepts
|
|
345
|
+
|
|
346
|
+
#### getTop
|
|
336
347
|
- [ConceptApiProvider - getTop](https://gbv.github.io/cocoda-sdk/ConceptApiProvider.html#getTop)
|
|
348
|
+
- ...
|
|
337
349
|
|
|
338
|
-
####
|
|
350
|
+
#### getConcepts
|
|
339
351
|
- [ConceptApiProvider - getConcepts](https://gbv.github.io/cocoda-sdk/ConceptApiProvider.html#getConcepts)
|
|
340
352
|
- [SkosmosApiProvider - getConcepts](https://gbv.github.io/cocoda-sdk/SkosmosApiProvider.html#getConcepts)
|
|
353
|
+
- ...
|
|
341
354
|
|
|
342
|
-
####
|
|
355
|
+
#### getNarrower
|
|
343
356
|
- [ConceptApiProvider - getNarrower](https://gbv.github.io/cocoda-sdk/ConceptApiProvider.html#getNarrower)
|
|
344
357
|
- [SkosmosApiProvider - getNarrower](https://gbv.github.io/cocoda-sdk/SkosmosApiProvider.html#getNarrower)
|
|
358
|
+
- ...
|
|
345
359
|
|
|
346
|
-
####
|
|
360
|
+
#### getAncestors
|
|
347
361
|
- [ConceptApiProvider - getAncestors](https://gbv.github.io/cocoda-sdk/ConceptApiProvider.html#getAncestors)
|
|
348
362
|
- [SkosmosApiProvider - getAncestors](https://gbv.github.io/cocoda-sdk/SkosmosApiProvider.html#getAncestors)
|
|
363
|
+
- ...
|
|
349
364
|
|
|
350
|
-
####
|
|
365
|
+
#### search
|
|
351
366
|
- [ConceptApiProvider - search](https://gbv.github.io/cocoda-sdk/ConceptApiProvider.html#search)
|
|
352
367
|
- [SkosmosApiProvider - search](https://gbv.github.io/cocoda-sdk/SkosmosApiProvider.html#search)
|
|
368
|
+
- ...
|
|
353
369
|
|
|
354
|
-
####
|
|
370
|
+
#### suggest
|
|
355
371
|
- [ConceptApiProvider - suggest](https://gbv.github.io/cocoda-sdk/ConceptApiProvider.html#suggest)
|
|
356
372
|
- [SkosmosApiProvider - suggest](https://gbv.github.io/cocoda-sdk/SkosmosApiProvider.html#suggest)
|
|
373
|
+
- ...
|
|
357
374
|
|
|
358
|
-
###
|
|
375
|
+
### Concordances
|
|
359
376
|
|
|
360
|
-
####
|
|
377
|
+
#### getConcordances
|
|
361
378
|
- [MappingsApiProvider - getConcordances](https://gbv.github.io/cocoda-sdk/MappingsApiProvider.html#getConcordances)
|
|
379
|
+
- ...
|
|
362
380
|
|
|
363
|
-
####
|
|
381
|
+
#### postConcordance
|
|
364
382
|
- [MappingsApiProvider - postConcordance](https://gbv.github.io/cocoda-sdk/MappingsApiProvider.html#postConcordance)
|
|
383
|
+
- ...
|
|
365
384
|
|
|
366
|
-
####
|
|
385
|
+
#### putConcordance
|
|
367
386
|
- [MappingsApiProvider - putConcordance](https://gbv.github.io/cocoda-sdk/MappingsApiProvider.html#putConcordance)
|
|
387
|
+
- ...
|
|
368
388
|
|
|
369
|
-
####
|
|
389
|
+
#### patchConcordance
|
|
370
390
|
- [MappingsApiProvider - patchConcordance](https://gbv.github.io/cocoda-sdk/MappingsApiProvider.html#patchConcordance)
|
|
391
|
+
- ...
|
|
371
392
|
|
|
372
|
-
####
|
|
393
|
+
#### deleteConcordance
|
|
373
394
|
- [MappingsApiProvider - deleteConcordance](https://gbv.github.io/cocoda-sdk/MappingsApiProvider.html#deleteConcordance)
|
|
395
|
+
- ...
|
|
374
396
|
|
|
375
|
-
###
|
|
397
|
+
### Mappings
|
|
376
398
|
|
|
377
|
-
####
|
|
399
|
+
#### getMappings
|
|
378
400
|
- [MappingsApiProvider - getMappings](https://gbv.github.io/cocoda-sdk/MappingsApiProvider.html#getMappings)
|
|
379
401
|
- [LocalMappingsProvider - getMappings](https://gbv.github.io/cocoda-sdk/LocalMappingsProvider.html#getMappings)
|
|
380
402
|
- [ReconciliationApiProvider - getMappings](https://gbv.github.io/cocoda-sdk/ReconciliationApiProvider.html#getMappings)
|
|
381
403
|
- [LabelSearchSuggestionProvider - getMappings](https://gbv.github.io/cocoda-sdk/LabelSearchSuggestionProvider.html#getMappings)
|
|
382
404
|
- [OccurrencesApiProvider - getMappings](https://gbv.github.io/cocoda-sdk/OccurrencesApiProvider.html#getMappings)
|
|
383
405
|
|
|
384
|
-
####
|
|
406
|
+
#### getMapping
|
|
385
407
|
- [MappingsApiProvider - getMapping](https://gbv.github.io/cocoda-sdk/MappingsApiProvider.html#getMapping)
|
|
386
408
|
- [LocalMappingsProvider - getMapping](https://gbv.github.io/cocoda-sdk/LocalMappingsProvider.html#getMapping)
|
|
387
409
|
|
|
388
|
-
####
|
|
410
|
+
#### postMapping
|
|
389
411
|
- [MappingsApiProvider - postMapping](https://gbv.github.io/cocoda-sdk/MappingsApiProvider.html#postMapping)
|
|
390
412
|
- [LocalMappingsProvider - postMapping](https://gbv.github.io/cocoda-sdk/LocalMappingsProvider.html#postMapping)
|
|
391
413
|
|
|
392
|
-
####
|
|
414
|
+
#### postMappings
|
|
393
415
|
- [BaseProvider - postMappings](https://gbv.github.io/cocoda-sdk/BaseProvider.html#postMappings)
|
|
394
416
|
|
|
395
|
-
####
|
|
417
|
+
#### putMapping
|
|
396
418
|
- [MappingsApiProvider - putMapping](https://gbv.github.io/cocoda-sdk/MappingsApiProvider.html#putMapping)
|
|
397
419
|
- [LocalMappingsProvider - putMapping](https://gbv.github.io/cocoda-sdk/LocalMappingsProvider.html#putMapping)
|
|
398
420
|
|
|
399
|
-
####
|
|
421
|
+
#### patchMapping
|
|
400
422
|
- [MappingsApiProvider - patchMapping](https://gbv.github.io/cocoda-sdk/MappingsApiProvider.html#patchMapping)
|
|
401
423
|
- [LocalMappingsProvider - patchMapping](https://gbv.github.io/cocoda-sdk/LocalMappingsProvider.html#patchMapping)
|
|
402
424
|
|
|
403
|
-
####
|
|
425
|
+
#### deleteMapping
|
|
404
426
|
- [MappingsApiProvider - deleteMapping](https://gbv.github.io/cocoda-sdk/MappingsApiProvider.html#deleteMapping)
|
|
405
427
|
- [LocalMappingsProvider - deleteMapping](https://gbv.github.io/cocoda-sdk/LocalMappingsProvider.html#deleteMapping)
|
|
406
428
|
|
|
407
|
-
####
|
|
429
|
+
#### deleteMappings
|
|
408
430
|
- [BaseProvider - deleteMappings](https://gbv.github.io/cocoda-sdk/BaseProvider.html#deleteMappings)
|
|
409
431
|
|
|
410
|
-
###
|
|
411
|
-
|
|
412
|
-
#### `registry.getAnnotations`
|
|
413
|
-
- [MappingsApiProvider - getAnnotations](https://gbv.github.io/cocoda-sdk/MappingsApiProvider.html#getAnnotations)
|
|
414
|
-
|
|
415
|
-
#### `registry.postAnnotation`
|
|
416
|
-
- [MappingsApiProvider - postAnnotation](https://gbv.github.io/cocoda-sdk/MappingsApiProvider.html#postAnnotation)
|
|
432
|
+
### Annotations
|
|
417
433
|
|
|
418
|
-
|
|
419
|
-
- [
|
|
434
|
+
- [getAnnotations](https://gbv.github.io/cocoda-sdk/MappingsApiProvider.html#getAnnotations)
|
|
435
|
+
- [postAnnotation](https://gbv.github.io/cocoda-sdk/MappingsApiProvider.html#postAnnotation)
|
|
436
|
+
- [putAnnotation](https://gbv.github.io/cocoda-sdk/MappingsApiProvider.html#putAnnotation)
|
|
437
|
+
- [patchAnnotation](https://gbv.github.io/cocoda-sdk/MappingsApiProvider.html#patchAnnotation)
|
|
438
|
+
- [deleteAnnotation](https://gbv.github.io/cocoda-sdk/MappingsApiProvider.html#deleteAnnotation)
|
|
420
439
|
|
|
421
|
-
|
|
422
|
-
- [MappingsApiProvider - patchAnnotation](https://gbv.github.io/cocoda-sdk/MappingsApiProvider.html#patchAnnotation)
|
|
440
|
+
### Occurrences
|
|
423
441
|
|
|
424
|
-
|
|
425
|
-
- [MappingsApiProvider - deleteAnnotation](https://gbv.github.io/cocoda-sdk/MappingsApiProvider.html#deleteAnnotation)
|
|
442
|
+
- [getOccurrences](https://gbv.github.io/cocoda-sdk/OccurrencesApiProvider.html#getOccurrences)
|
|
426
443
|
|
|
427
|
-
###
|
|
444
|
+
### Types
|
|
428
445
|
|
|
429
|
-
|
|
430
|
-
- [OccurrencesApiProvider - getOccurrences](https://gbv.github.io/cocoda-sdk/OccurrencesApiProvider.html#getOccurrences)
|
|
446
|
+
`getTypes({ scheme })` returns a list of [types](https://gbv.github.io/jskos/#resource-and-property-types) for some concept scheme(s). Implemented by:
|
|
431
447
|
|
|
432
|
-
|
|
433
|
-
- [
|
|
434
|
-
- [
|
|
448
|
+
- [ConceptApiProvider](https://gbv.github.io/cocoda-sdk/ConceptApiProvider.html#getTypes)
|
|
449
|
+
- [SkosmosApiProvider](https://gbv.github.io/cocoda-sdk/SkosmosApiProvider.html#getTypes)
|
|
450
|
+
- [OlsApiProvider](https://gbv.github.io/cocoda-sdk/OlsApiProvider.html#getTypes)
|
|
451
|
+
- [LobidApiProvider](https://gbv.github.io/cocoda-sdk/LobidApiProvider.html#getTypes)
|
|
435
452
|
|
|
436
|
-
|
|
437
|
-
cocoda-sdk defines some custom errors
|
|
453
|
+
### Errors
|
|
454
|
+
cocoda-sdk defines some custom errors, grouped in exporteable object `errors`:
|
|
438
455
|
|
|
439
456
|
```js
|
|
440
|
-
const { errors } = require("cocoda-sdk") // CommonJS
|
|
441
457
|
import { errors } from "cocoda-sdk"
|
|
442
458
|
```
|
|
443
459
|
|
|
@@ -454,37 +470,13 @@ The following errors are defined:
|
|
|
454
470
|
For details about the errors, refer to the [documentation](https://gbv.github.io/cocoda-sdk/index.html).
|
|
455
471
|
|
|
456
472
|
## Maintainers
|
|
457
|
-
- [@stefandesu](https://github.com/stefandesu)
|
|
458
473
|
- [@nichtich](https://github.com/nichtich)
|
|
459
474
|
|
|
460
|
-
##
|
|
461
|
-
Please work on the `dev` branch during development (or better yet, develop in a feature branch and merge into `dev` when ready).
|
|
462
|
-
|
|
463
|
-
When a new release is ready (i.e. the features are finished, merged into `dev`, and all tests succeed), run the included release script (replace "patch" with "minor" or "major" if necessary):
|
|
464
|
-
|
|
465
|
-
```bash
|
|
466
|
-
npm run release:patch
|
|
467
|
-
```
|
|
468
|
-
|
|
469
|
-
This will:
|
|
470
|
-
- Run tests and build to make sure everything works
|
|
471
|
-
- Switch to `dev`
|
|
472
|
-
- Make sure `dev` is up-to-date
|
|
473
|
-
- Run `npm version patch` (or "minor"/"major")
|
|
474
|
-
- Push changes to `dev`
|
|
475
|
-
- Switch to `master`
|
|
476
|
-
- Merge changes from `dev`
|
|
477
|
-
- Push `master` with tags
|
|
478
|
-
- Switch back to `dev`
|
|
479
|
-
|
|
480
|
-
After running this, GitHub Actions will automatically publish the new version to npm. It will also create a new GitHub Release draft. Please edit and publish the release manually.
|
|
481
|
-
|
|
482
|
-
## Contribute
|
|
483
|
-
PRs accepted.
|
|
475
|
+
## Contributing
|
|
484
476
|
|
|
485
|
-
|
|
477
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
486
478
|
|
|
487
479
|
## License
|
|
488
|
-
MIT Copyright (c) 2021 Verbundzentrale des GBV (VZG)
|
|
480
|
+
MIT Copyright (c) 2021- Verbundzentrale des GBV (VZG)
|
|
489
481
|
|
|
490
482
|
[jskos-server]: https://github.com/gbv/jskos-server
|