@biblioteksentralen/bmdb-search 0.0.0-beta.1 → 0.0.0-beta.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 +12 -0
- package/dist/index.d.cts +75 -4
- package/dist/index.d.ts +75 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -43,6 +43,18 @@ import { createBmdbSearchClient } from "@biblioteksentralen/bmdb-search";
|
|
|
43
43
|
const bmdbSearchClient = createBmdbSearchClient({ clientIdentifier: "client-unique-description" });
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
+
For Next.js it might also have to be exempt from handling in middleware (e.g. internationalization):
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
// middleware.ts
|
|
50
|
+
export const config = {
|
|
51
|
+
matcher: [
|
|
52
|
+
// ...other
|
|
53
|
+
"/((?!|bmdb/api|_next/static).*)",
|
|
54
|
+
],
|
|
55
|
+
};
|
|
56
|
+
```
|
|
57
|
+
|
|
46
58
|
## Usage examples
|
|
47
59
|
|
|
48
60
|
### Search works using client
|
package/dist/index.d.cts
CHANGED
|
@@ -31,14 +31,19 @@ interface paths {
|
|
|
31
31
|
interface components {
|
|
32
32
|
schemas: {
|
|
33
33
|
/** @enum {string} */
|
|
34
|
-
SearchFacetTypeEnumV2: "creator" | "collection" | "subject";
|
|
34
|
+
SearchFacetTypeEnumV2: "work_type" | "expression_type" | "manifestation_medium" | "work_origin" | "origin" | "creator" | "collection" | "subject";
|
|
35
35
|
/** @enum {string} */
|
|
36
36
|
SearchSortingTypeEnumV2: "relevance.desc" | "updateTime.desc";
|
|
37
37
|
WorkFilterSchema: {
|
|
38
38
|
identifier?: string[];
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
work_id?: string[];
|
|
40
|
+
expression_id?: string[];
|
|
41
|
+
manifestation_id?: string[];
|
|
42
|
+
work_type?: string[];
|
|
43
|
+
expression_type?: string[];
|
|
44
|
+
manifestation_medium?: string[];
|
|
45
|
+
work_origin?: string[];
|
|
46
|
+
origin?: string[];
|
|
42
47
|
title?: string[];
|
|
43
48
|
creator?: string[];
|
|
44
49
|
collection?: string[];
|
|
@@ -633,6 +638,66 @@ interface components {
|
|
|
633
638
|
/** @description URI for the corresponding concept in National Library's [Vocabulary of target groups (nortarget)](https://www.nb.no/nbvok/tg/nb/). */
|
|
634
639
|
nortargetUri: string;
|
|
635
640
|
};
|
|
641
|
+
/** @enum {string} */
|
|
642
|
+
LibrarySystem: "bibliofil" | "cicero" | "quria" | "mikromarc";
|
|
643
|
+
Origin: {
|
|
644
|
+
id: string;
|
|
645
|
+
/** @constant */
|
|
646
|
+
name: "promus";
|
|
647
|
+
} | {
|
|
648
|
+
id: string;
|
|
649
|
+
/** @constant */
|
|
650
|
+
name: "ax";
|
|
651
|
+
} | {
|
|
652
|
+
id: string;
|
|
653
|
+
catalogue: string;
|
|
654
|
+
librarySystem: components["schemas"]["LibrarySystem"];
|
|
655
|
+
/** @constant */
|
|
656
|
+
name: "catalogueHarvester";
|
|
657
|
+
} | {
|
|
658
|
+
id: string;
|
|
659
|
+
/** @constant */
|
|
660
|
+
name: "filmoteket";
|
|
661
|
+
} | {
|
|
662
|
+
id: string;
|
|
663
|
+
/** @constant */
|
|
664
|
+
name: "mediastore";
|
|
665
|
+
} | {
|
|
666
|
+
id: string;
|
|
667
|
+
/** @constant */
|
|
668
|
+
name: "nmbf";
|
|
669
|
+
} | {
|
|
670
|
+
id: string;
|
|
671
|
+
/** @constant */
|
|
672
|
+
name: "bokbasen";
|
|
673
|
+
} | {
|
|
674
|
+
id: string;
|
|
675
|
+
/** @constant */
|
|
676
|
+
name: "ingram";
|
|
677
|
+
} | {
|
|
678
|
+
id: string;
|
|
679
|
+
/** @constant */
|
|
680
|
+
name: "gardners";
|
|
681
|
+
} | {
|
|
682
|
+
/** @constant */
|
|
683
|
+
name: "katt";
|
|
684
|
+
} | {
|
|
685
|
+
id: string;
|
|
686
|
+
/** @constant */
|
|
687
|
+
name: "kulturradet";
|
|
688
|
+
} | {
|
|
689
|
+
id: string;
|
|
690
|
+
/** @constant */
|
|
691
|
+
name: "grep";
|
|
692
|
+
} | {
|
|
693
|
+
id: string;
|
|
694
|
+
/** @constant */
|
|
695
|
+
name: "noraf";
|
|
696
|
+
} | {
|
|
697
|
+
id?: string;
|
|
698
|
+
/** @constant */
|
|
699
|
+
name: "script";
|
|
700
|
+
};
|
|
636
701
|
/** @description A Work is defined as "The intellectual or artistic content of a distinct creation" (Library Reference Model)
|
|
637
702
|
*
|
|
638
703
|
* It is the top level and most abstract entity in the WEMI stack (Work, Expression, Manifestation, Item), and serves to cluster all expressions of what one could consider "the same book" (or e.g. same play, film, game, etc.) in different formats and languages.
|
|
@@ -702,6 +767,8 @@ interface components {
|
|
|
702
767
|
/** @description Whether the work has been created or adapted for users with special needs. */
|
|
703
768
|
accessibleContentFeature?: components["schemas"]["AccessibleContentFeature"];
|
|
704
769
|
biographicContent?: string;
|
|
770
|
+
/** @description Original data source */
|
|
771
|
+
origin: components["schemas"]["Origin"];
|
|
705
772
|
};
|
|
706
773
|
NumberOfPlayers: {
|
|
707
774
|
local?: {
|
|
@@ -821,6 +888,8 @@ interface components {
|
|
|
821
888
|
instrumentations?: components["schemas"]["Instrumentation"][];
|
|
822
889
|
/** @description If the expression is a translation and the translation was not carried out directly from the original language(s) of the work, but via one or more intermediate languages, this field contains the intermediate languages. */
|
|
823
890
|
intermediateTranslationLanguages?: components["schemas"]["Language"][];
|
|
891
|
+
/** @description Original data source */
|
|
892
|
+
origin: components["schemas"]["Origin"];
|
|
824
893
|
};
|
|
825
894
|
/** @description A Manifestation is defined as "A set of all carriers that are assumed to share the same characteristics as to intellectual or artistic content and aspects of physical form. That set is defined by both the overall content and the production plan for its carrier or carriers" {@link https://www.iflastandards.info/lrm/lrmer#E4 Library Reference Model }
|
|
826
895
|
*
|
|
@@ -927,6 +996,8 @@ interface components {
|
|
|
927
996
|
work: components["schemas"]["Work"];
|
|
928
997
|
expression: components["schemas"]["Expression"];
|
|
929
998
|
}[];
|
|
999
|
+
/** @description Original data source */
|
|
1000
|
+
origin: components["schemas"]["Origin"];
|
|
930
1001
|
};
|
|
931
1002
|
/** ExpressionWithManifestations */
|
|
932
1003
|
ExpressionWithManifestation: {
|
package/dist/index.d.ts
CHANGED
|
@@ -31,14 +31,19 @@ interface paths {
|
|
|
31
31
|
interface components {
|
|
32
32
|
schemas: {
|
|
33
33
|
/** @enum {string} */
|
|
34
|
-
SearchFacetTypeEnumV2: "creator" | "collection" | "subject";
|
|
34
|
+
SearchFacetTypeEnumV2: "work_type" | "expression_type" | "manifestation_medium" | "work_origin" | "origin" | "creator" | "collection" | "subject";
|
|
35
35
|
/** @enum {string} */
|
|
36
36
|
SearchSortingTypeEnumV2: "relevance.desc" | "updateTime.desc";
|
|
37
37
|
WorkFilterSchema: {
|
|
38
38
|
identifier?: string[];
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
work_id?: string[];
|
|
40
|
+
expression_id?: string[];
|
|
41
|
+
manifestation_id?: string[];
|
|
42
|
+
work_type?: string[];
|
|
43
|
+
expression_type?: string[];
|
|
44
|
+
manifestation_medium?: string[];
|
|
45
|
+
work_origin?: string[];
|
|
46
|
+
origin?: string[];
|
|
42
47
|
title?: string[];
|
|
43
48
|
creator?: string[];
|
|
44
49
|
collection?: string[];
|
|
@@ -633,6 +638,66 @@ interface components {
|
|
|
633
638
|
/** @description URI for the corresponding concept in National Library's [Vocabulary of target groups (nortarget)](https://www.nb.no/nbvok/tg/nb/). */
|
|
634
639
|
nortargetUri: string;
|
|
635
640
|
};
|
|
641
|
+
/** @enum {string} */
|
|
642
|
+
LibrarySystem: "bibliofil" | "cicero" | "quria" | "mikromarc";
|
|
643
|
+
Origin: {
|
|
644
|
+
id: string;
|
|
645
|
+
/** @constant */
|
|
646
|
+
name: "promus";
|
|
647
|
+
} | {
|
|
648
|
+
id: string;
|
|
649
|
+
/** @constant */
|
|
650
|
+
name: "ax";
|
|
651
|
+
} | {
|
|
652
|
+
id: string;
|
|
653
|
+
catalogue: string;
|
|
654
|
+
librarySystem: components["schemas"]["LibrarySystem"];
|
|
655
|
+
/** @constant */
|
|
656
|
+
name: "catalogueHarvester";
|
|
657
|
+
} | {
|
|
658
|
+
id: string;
|
|
659
|
+
/** @constant */
|
|
660
|
+
name: "filmoteket";
|
|
661
|
+
} | {
|
|
662
|
+
id: string;
|
|
663
|
+
/** @constant */
|
|
664
|
+
name: "mediastore";
|
|
665
|
+
} | {
|
|
666
|
+
id: string;
|
|
667
|
+
/** @constant */
|
|
668
|
+
name: "nmbf";
|
|
669
|
+
} | {
|
|
670
|
+
id: string;
|
|
671
|
+
/** @constant */
|
|
672
|
+
name: "bokbasen";
|
|
673
|
+
} | {
|
|
674
|
+
id: string;
|
|
675
|
+
/** @constant */
|
|
676
|
+
name: "ingram";
|
|
677
|
+
} | {
|
|
678
|
+
id: string;
|
|
679
|
+
/** @constant */
|
|
680
|
+
name: "gardners";
|
|
681
|
+
} | {
|
|
682
|
+
/** @constant */
|
|
683
|
+
name: "katt";
|
|
684
|
+
} | {
|
|
685
|
+
id: string;
|
|
686
|
+
/** @constant */
|
|
687
|
+
name: "kulturradet";
|
|
688
|
+
} | {
|
|
689
|
+
id: string;
|
|
690
|
+
/** @constant */
|
|
691
|
+
name: "grep";
|
|
692
|
+
} | {
|
|
693
|
+
id: string;
|
|
694
|
+
/** @constant */
|
|
695
|
+
name: "noraf";
|
|
696
|
+
} | {
|
|
697
|
+
id?: string;
|
|
698
|
+
/** @constant */
|
|
699
|
+
name: "script";
|
|
700
|
+
};
|
|
636
701
|
/** @description A Work is defined as "The intellectual or artistic content of a distinct creation" (Library Reference Model)
|
|
637
702
|
*
|
|
638
703
|
* It is the top level and most abstract entity in the WEMI stack (Work, Expression, Manifestation, Item), and serves to cluster all expressions of what one could consider "the same book" (or e.g. same play, film, game, etc.) in different formats and languages.
|
|
@@ -702,6 +767,8 @@ interface components {
|
|
|
702
767
|
/** @description Whether the work has been created or adapted for users with special needs. */
|
|
703
768
|
accessibleContentFeature?: components["schemas"]["AccessibleContentFeature"];
|
|
704
769
|
biographicContent?: string;
|
|
770
|
+
/** @description Original data source */
|
|
771
|
+
origin: components["schemas"]["Origin"];
|
|
705
772
|
};
|
|
706
773
|
NumberOfPlayers: {
|
|
707
774
|
local?: {
|
|
@@ -821,6 +888,8 @@ interface components {
|
|
|
821
888
|
instrumentations?: components["schemas"]["Instrumentation"][];
|
|
822
889
|
/** @description If the expression is a translation and the translation was not carried out directly from the original language(s) of the work, but via one or more intermediate languages, this field contains the intermediate languages. */
|
|
823
890
|
intermediateTranslationLanguages?: components["schemas"]["Language"][];
|
|
891
|
+
/** @description Original data source */
|
|
892
|
+
origin: components["schemas"]["Origin"];
|
|
824
893
|
};
|
|
825
894
|
/** @description A Manifestation is defined as "A set of all carriers that are assumed to share the same characteristics as to intellectual or artistic content and aspects of physical form. That set is defined by both the overall content and the production plan for its carrier or carriers" {@link https://www.iflastandards.info/lrm/lrmer#E4 Library Reference Model }
|
|
826
895
|
*
|
|
@@ -927,6 +996,8 @@ interface components {
|
|
|
927
996
|
work: components["schemas"]["Work"];
|
|
928
997
|
expression: components["schemas"]["Expression"];
|
|
929
998
|
}[];
|
|
999
|
+
/** @description Original data source */
|
|
1000
|
+
origin: components["schemas"]["Origin"];
|
|
930
1001
|
};
|
|
931
1002
|
/** ExpressionWithManifestations */
|
|
932
1003
|
ExpressionWithManifestation: {
|