@eightyfourthousand/client-graphql 2026.4.0 → 2026.4.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/index.d.ts +4 -0
- package/index.js +7 -0
- package/index.js.map +1 -0
- package/lib/client-ssr.d.ts +16 -0
- package/lib/client-ssr.js +39 -0
- package/lib/client-ssr.js.map +1 -0
- package/lib/client.d.ts +15 -0
- package/lib/client.js +46 -0
- package/lib/client.js.map +1 -0
- package/lib/config.d.ts +8 -0
- package/lib/config.js +19 -0
- package/lib/config.js.map +1 -0
- package/lib/functions/get-bibliography-entry.d.ts +9 -0
- package/lib/functions/get-bibliography-entry.js +27 -0
- package/lib/functions/get-bibliography-entry.js.map +1 -0
- package/lib/functions/get-glossary-instance.d.ts +9 -0
- package/lib/functions/get-glossary-instance.js +36 -0
- package/lib/functions/get-glossary-instance.js.map +1 -0
- package/lib/functions/get-passage.d.ts +10 -0
- package/lib/functions/get-passage.js +68 -0
- package/lib/functions/get-passage.js.map +1 -0
- package/lib/functions/get-term-passages.d.ts +20 -0
- package/lib/functions/get-term-passages.js +32 -0
- package/lib/functions/get-term-passages.js.map +1 -0
- package/lib/functions/get-translation-blocks-around.d.ts +15 -0
- package/lib/functions/get-translation-blocks-around.js +86 -0
- package/lib/functions/get-translation-blocks-around.js.map +1 -0
- package/lib/functions/get-translation-blocks.d.ts +25 -0
- package/lib/functions/get-translation-blocks.js +96 -0
- package/lib/functions/get-translation-blocks.js.map +1 -0
- package/lib/functions/get-translation-imprint.d.ts +10 -0
- package/lib/functions/get-translation-imprint.js +68 -0
- package/lib/functions/get-translation-imprint.js.map +1 -0
- package/lib/functions/get-translation-metadata.d.ts +16 -0
- package/lib/functions/get-translation-metadata.js +72 -0
- package/lib/functions/get-translation-metadata.js.map +1 -0
- package/lib/functions/get-translation-titles.d.ts +9 -0
- package/lib/functions/get-translation-titles.js +34 -0
- package/lib/functions/get-translation-titles.js.map +1 -0
- package/lib/functions/get-translation-toc.d.ts +9 -0
- package/{src/lib/functions/get-translation-toc.ts → lib/functions/get-translation-toc.js} +18 -48
- package/lib/functions/get-translation-toc.js.map +1 -0
- package/lib/functions/get-translation-uuids.d.ts +16 -0
- package/lib/functions/get-translation-uuids.js +40 -0
- package/lib/functions/get-translation-uuids.js.map +1 -0
- package/lib/functions/get-translations-metadata.d.ts +9 -0
- package/lib/functions/get-translations-metadata.js +51 -0
- package/lib/functions/get-translations-metadata.js.map +1 -0
- package/lib/functions/get-work-bibliography.d.ts +9 -0
- package/lib/functions/get-work-bibliography.js +33 -0
- package/lib/functions/get-work-bibliography.js.map +1 -0
- package/lib/functions/get-work-folios.d.ts +12 -0
- package/lib/functions/get-work-folios.js +32 -0
- package/lib/functions/get-work-folios.js.map +1 -0
- package/lib/functions/get-work-glossary-terms-around.d.ts +13 -0
- package/lib/functions/get-work-glossary-terms-around.js +95 -0
- package/lib/functions/get-work-glossary-terms-around.js.map +1 -0
- package/lib/functions/get-work-glossary-terms.d.ts +24 -0
- package/lib/functions/get-work-glossary-terms.js +104 -0
- package/lib/functions/get-work-glossary-terms.js.map +1 -0
- package/lib/functions/has-permission.d.ts +9 -0
- package/lib/functions/has-permission.js +15 -0
- package/lib/functions/has-permission.js.map +1 -0
- package/{src/lib/functions/index.ts → lib/functions/index.d.ts} +3 -12
- package/lib/functions/index.js +20 -0
- package/lib/functions/index.js.map +1 -0
- package/lib/functions/replace.d.ts +27 -0
- package/lib/functions/replace.js +49 -0
- package/lib/functions/replace.js.map +1 -0
- package/lib/functions/save-passages.d.ts +16 -0
- package/lib/functions/save-passages.js +35 -0
- package/lib/functions/save-passages.js.map +1 -0
- package/lib/generated/graphql.d.ts +1062 -0
- package/lib/generated/graphql.js +357 -0
- package/lib/generated/graphql.js.map +1 -0
- package/lib/mappers/alignment.d.ts +19 -0
- package/lib/mappers/alignment.js +19 -0
- package/lib/mappers/alignment.js.map +1 -0
- package/lib/mappers/annotation.d.ts +19 -0
- package/lib/mappers/annotation.js +74 -0
- package/lib/mappers/annotation.js.map +1 -0
- package/lib/mappers/imprint.d.ts +37 -0
- package/lib/mappers/imprint.js +44 -0
- package/lib/mappers/imprint.js.map +1 -0
- package/lib/mappers/index.js +8 -0
- package/lib/mappers/index.js.map +1 -0
- package/lib/mappers/passage.d.ts +41 -0
- package/lib/mappers/passage.js +39 -0
- package/lib/mappers/passage.js.map +1 -0
- package/lib/mappers/title.d.ts +18 -0
- package/lib/mappers/title.js +18 -0
- package/lib/mappers/title.js.map +1 -0
- package/lib/mappers/toc.d.ts +25 -0
- package/lib/mappers/toc.js +25 -0
- package/lib/mappers/toc.js.map +1 -0
- package/lib/mappers/work.d.ts +22 -0
- package/lib/mappers/work.js +22 -0
- package/lib/mappers/work.js.map +1 -0
- package/package.json +25 -3
- package/ssr.d.ts +4 -0
- package/ssr.js +7 -0
- package/ssr.js.map +1 -0
- package/README.md +0 -9
- package/codegen.ts +0 -34
- package/project.json +0 -21
- package/src/index.ts +0 -75
- package/src/lib/client-ssr.ts +0 -44
- package/src/lib/client.ts +0 -58
- package/src/lib/config.ts +0 -21
- package/src/lib/functions/get-bibliography-entry.ts +0 -40
- package/src/lib/functions/get-glossary-instance.ts +0 -49
- package/src/lib/functions/get-passage.ts +0 -81
- package/src/lib/functions/get-term-passages.ts +0 -53
- package/src/lib/functions/get-translation-blocks-around.ts +0 -129
- package/src/lib/functions/get-translation-blocks.ts +0 -158
- package/src/lib/functions/get-translation-imprint.ts +0 -114
- package/src/lib/functions/get-translation-metadata.ts +0 -99
- package/src/lib/functions/get-translation-titles.ts +0 -55
- package/src/lib/functions/get-translation-uuids.ts +0 -63
- package/src/lib/functions/get-translations-metadata.ts +0 -81
- package/src/lib/functions/get-work-bibliography.ts +0 -47
- package/src/lib/functions/get-work-folios.ts +0 -52
- package/src/lib/functions/get-work-glossary-terms-around.ts +0 -127
- package/src/lib/functions/get-work-glossary-terms.ts +0 -154
- package/src/lib/functions/has-permission.ts +0 -38
- package/src/lib/functions/replace.ts +0 -91
- package/src/lib/functions/save-passages.ts +0 -76
- package/src/lib/generated/graphql.ts +0 -1297
- package/src/lib/graphql/fragments/alignment.graphql +0 -7
- package/src/lib/graphql/fragments/annotation.graphql +0 -7
- package/src/lib/graphql/fragments/imprint.graphql +0 -34
- package/src/lib/graphql/fragments/passage.graphql +0 -29
- package/src/lib/graphql/fragments/title.graphql +0 -6
- package/src/lib/graphql/fragments/toc.graphql +0 -40
- package/src/lib/graphql/fragments/work.graphql +0 -10
- package/src/lib/graphql/queries/passages.graphql +0 -116
- package/src/lib/graphql/queries/work.graphql +0 -38
- package/src/lib/graphql/queries/works.graphql +0 -23
- package/src/lib/mappers/alignment.ts +0 -34
- package/src/lib/mappers/annotation.ts +0 -204
- package/src/lib/mappers/imprint.ts +0 -79
- package/src/lib/mappers/passage.ts +0 -80
- package/src/lib/mappers/title.ts +0 -35
- package/src/lib/mappers/toc.ts +0 -49
- package/src/lib/mappers/work.ts +0 -38
- package/src/ssr.ts +0 -66
- package/tsconfig.json +0 -17
- package/tsconfig.lib.json +0 -14
- /package/{src/lib/mappers/index.ts → lib/mappers/index.d.ts} +0 -0
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import type { Passage, PassagesPage, BodyItemType } from '@eightyfourthousand/data-access';
|
|
2
|
-
import { annotationsFromGraphQL, type GraphQLAnnotation } from './annotation';
|
|
3
|
-
import { alignmentsFromGraphQL, type GraphQLAlignment } from './alignment';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* GraphQL Passage type
|
|
7
|
-
*/
|
|
8
|
-
export type GraphQLPassage = {
|
|
9
|
-
uuid: string;
|
|
10
|
-
workUuid: string;
|
|
11
|
-
content: string;
|
|
12
|
-
label: string;
|
|
13
|
-
sort: number;
|
|
14
|
-
type: string;
|
|
15
|
-
xmlId?: string | null;
|
|
16
|
-
annotations?: GraphQLAnnotation[];
|
|
17
|
-
alignments?: GraphQLAlignment[];
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* GraphQL PageInfo type
|
|
22
|
-
*/
|
|
23
|
-
export type GraphQLPageInfo = {
|
|
24
|
-
nextCursor?: string | null;
|
|
25
|
-
prevCursor?: string | null;
|
|
26
|
-
hasMoreAfter: boolean;
|
|
27
|
-
hasMoreBefore: boolean;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* GraphQL PassageConnection type
|
|
32
|
-
*/
|
|
33
|
-
export type GraphQLPassageConnection = {
|
|
34
|
-
nodes: GraphQLPassage[];
|
|
35
|
-
pageInfo: GraphQLPageInfo;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Convert a GraphQL passage to the internal Passage type
|
|
40
|
-
*/
|
|
41
|
-
export function passageFromGraphQL(
|
|
42
|
-
gqlPassage: GraphQLPassage,
|
|
43
|
-
workUuid?: string,
|
|
44
|
-
): Passage {
|
|
45
|
-
const annotations = gqlPassage.annotations
|
|
46
|
-
? annotationsFromGraphQL(gqlPassage.annotations, gqlPassage.uuid)
|
|
47
|
-
: [];
|
|
48
|
-
|
|
49
|
-
const alignments = gqlPassage.alignments
|
|
50
|
-
? alignmentsFromGraphQL(gqlPassage.alignments)
|
|
51
|
-
: [];
|
|
52
|
-
|
|
53
|
-
return {
|
|
54
|
-
uuid: gqlPassage.uuid,
|
|
55
|
-
content: gqlPassage.content,
|
|
56
|
-
label: gqlPassage.label,
|
|
57
|
-
sort: gqlPassage.sort,
|
|
58
|
-
type: gqlPassage.type as BodyItemType,
|
|
59
|
-
xmlId: gqlPassage.xmlId ?? undefined,
|
|
60
|
-
workUuid: gqlPassage.workUuid ?? workUuid ?? '',
|
|
61
|
-
annotations,
|
|
62
|
-
alignments,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Convert a GraphQL PassageConnection to internal PassagesPage type
|
|
68
|
-
*/
|
|
69
|
-
export function passagesPageFromGraphQL(
|
|
70
|
-
connection: GraphQLPassageConnection,
|
|
71
|
-
workUuid: string,
|
|
72
|
-
): PassagesPage {
|
|
73
|
-
return {
|
|
74
|
-
passages: connection.nodes.map((p) => passageFromGraphQL(p, workUuid)),
|
|
75
|
-
nextCursor: connection.pageInfo.nextCursor ?? undefined,
|
|
76
|
-
prevCursor: connection.pageInfo.prevCursor ?? undefined,
|
|
77
|
-
hasMoreAfter: connection.pageInfo.hasMoreAfter,
|
|
78
|
-
hasMoreBefore: connection.pageInfo.hasMoreBefore,
|
|
79
|
-
};
|
|
80
|
-
}
|
package/src/lib/mappers/title.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
Title,
|
|
3
|
-
Titles,
|
|
4
|
-
TitleType,
|
|
5
|
-
ExtendedTranslationLanguage,
|
|
6
|
-
} from '@eightyfourthousand/data-access';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* GraphQL Title type
|
|
10
|
-
*/
|
|
11
|
-
export type GraphQLTitle = {
|
|
12
|
-
uuid: string;
|
|
13
|
-
content: string;
|
|
14
|
-
language: string;
|
|
15
|
-
type: string;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Convert a GraphQL title to the internal Title type
|
|
20
|
-
*/
|
|
21
|
-
export function titleFromGraphQL(gqlTitle: GraphQLTitle): Title {
|
|
22
|
-
return {
|
|
23
|
-
uuid: gqlTitle.uuid,
|
|
24
|
-
title: gqlTitle.content,
|
|
25
|
-
language: gqlTitle.language as ExtendedTranslationLanguage,
|
|
26
|
-
type: gqlTitle.type as TitleType,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Convert an array of GraphQL titles to internal Title types
|
|
32
|
-
*/
|
|
33
|
-
export function titlesFromGraphQL(gqlTitles: GraphQLTitle[]): Titles {
|
|
34
|
-
return gqlTitles.map(titleFromGraphQL);
|
|
35
|
-
}
|
package/src/lib/mappers/toc.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { Toc, TocEntry, TranslationSection } from '@eightyfourthousand/data-access';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* GraphQL TocEntry type
|
|
5
|
-
*/
|
|
6
|
-
export type GraphQLTocEntry = {
|
|
7
|
-
uuid: string;
|
|
8
|
-
content: string;
|
|
9
|
-
label?: string | null;
|
|
10
|
-
sort: number;
|
|
11
|
-
level: number;
|
|
12
|
-
section: string;
|
|
13
|
-
children?: GraphQLTocEntry[] | null;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* GraphQL Toc type
|
|
18
|
-
*/
|
|
19
|
-
export type GraphQLToc = {
|
|
20
|
-
frontMatter: GraphQLTocEntry[];
|
|
21
|
-
body: GraphQLTocEntry[];
|
|
22
|
-
backMatter: GraphQLTocEntry[];
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Convert a GraphQL TocEntry to the internal TocEntry type
|
|
27
|
-
*/
|
|
28
|
-
function tocEntryFromGraphQL(gqlEntry: GraphQLTocEntry): TocEntry {
|
|
29
|
-
return {
|
|
30
|
-
uuid: gqlEntry.uuid,
|
|
31
|
-
content: gqlEntry.content,
|
|
32
|
-
label: gqlEntry.label || undefined,
|
|
33
|
-
sort: gqlEntry.sort,
|
|
34
|
-
level: gqlEntry.level,
|
|
35
|
-
section: gqlEntry.section as TranslationSection,
|
|
36
|
-
children: (gqlEntry.children || []).map(tocEntryFromGraphQL),
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Convert a GraphQL Toc to the internal Toc type
|
|
42
|
-
*/
|
|
43
|
-
export function tocFromGraphQL(gqlToc: GraphQLToc): Toc {
|
|
44
|
-
return {
|
|
45
|
-
frontMatter: gqlToc.frontMatter.map(tocEntryFromGraphQL),
|
|
46
|
-
body: gqlToc.body.map(tocEntryFromGraphQL),
|
|
47
|
-
backMatter: gqlToc.backMatter.map(tocEntryFromGraphQL),
|
|
48
|
-
};
|
|
49
|
-
}
|
package/src/lib/mappers/work.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { Work, TohokuCatalogEntry, SemVer } from '@eightyfourthousand/data-access';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* GraphQL Work type
|
|
5
|
-
*/
|
|
6
|
-
export type GraphQLWork = {
|
|
7
|
-
uuid: string;
|
|
8
|
-
title: string;
|
|
9
|
-
toh: string[];
|
|
10
|
-
publicationDate: string;
|
|
11
|
-
publicationVersion: string;
|
|
12
|
-
pages: number;
|
|
13
|
-
restriction: boolean;
|
|
14
|
-
section: string;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Convert a GraphQL work to the internal Work type
|
|
19
|
-
*/
|
|
20
|
-
export function workFromGraphQL(gqlWork: GraphQLWork): Work {
|
|
21
|
-
return {
|
|
22
|
-
uuid: gqlWork.uuid,
|
|
23
|
-
title: gqlWork.title,
|
|
24
|
-
toh: gqlWork.toh as TohokuCatalogEntry[],
|
|
25
|
-
publicationDate: new Date(gqlWork.publicationDate),
|
|
26
|
-
publicationVersion: gqlWork.publicationVersion as SemVer,
|
|
27
|
-
pages: gqlWork.pages,
|
|
28
|
-
restriction: gqlWork.restriction,
|
|
29
|
-
section: gqlWork.section,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Convert an array of GraphQL works to internal Work types
|
|
35
|
-
*/
|
|
36
|
-
export function worksFromGraphQL(gqlWorks: GraphQLWork[]): Work[] {
|
|
37
|
-
return gqlWorks.map(workFromGraphQL);
|
|
38
|
-
}
|
package/src/ssr.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// SSR Client
|
|
2
|
-
export {
|
|
3
|
-
createServerGraphQLClient,
|
|
4
|
-
createBuildGraphQLClient,
|
|
5
|
-
} from './lib/client-ssr';
|
|
6
|
-
|
|
7
|
-
// Functions (same as browser)
|
|
8
|
-
export {
|
|
9
|
-
getPassage,
|
|
10
|
-
getTranslationBlocks,
|
|
11
|
-
getTranslationBlocksAround,
|
|
12
|
-
getTranslationTitles,
|
|
13
|
-
getTranslationMetadataByUuid,
|
|
14
|
-
getTranslationMetadataByToh,
|
|
15
|
-
getTranslationsMetadata,
|
|
16
|
-
getTranslationUuids,
|
|
17
|
-
getTranslationToc,
|
|
18
|
-
getTranslationImprint,
|
|
19
|
-
getGlossaryInstance,
|
|
20
|
-
getWorkGlossaryTerms,
|
|
21
|
-
getWorkGlossaryTermsAround,
|
|
22
|
-
type GlossaryTermsPage,
|
|
23
|
-
getBibliographyEntry,
|
|
24
|
-
getWorkBibliography,
|
|
25
|
-
getWorkFolios,
|
|
26
|
-
type TranslationBlocksPage,
|
|
27
|
-
} from './lib/functions';
|
|
28
|
-
|
|
29
|
-
// Re-export types from @eightyfourthousand/data-access for convenience
|
|
30
|
-
export type {
|
|
31
|
-
Passage,
|
|
32
|
-
Passages,
|
|
33
|
-
PassagesPage,
|
|
34
|
-
PaginationDirection,
|
|
35
|
-
BodyItemType,
|
|
36
|
-
Annotation,
|
|
37
|
-
Annotations,
|
|
38
|
-
Alignment,
|
|
39
|
-
Work,
|
|
40
|
-
Title,
|
|
41
|
-
Titles,
|
|
42
|
-
TitleType,
|
|
43
|
-
Toc,
|
|
44
|
-
TocEntry,
|
|
45
|
-
Imprint,
|
|
46
|
-
GlossaryTermInstance,
|
|
47
|
-
GlossaryLandingItem,
|
|
48
|
-
GlossaryPageItem,
|
|
49
|
-
BibliographyEntry,
|
|
50
|
-
BibliographyEntryItem,
|
|
51
|
-
BibliographyEntries,
|
|
52
|
-
Folio,
|
|
53
|
-
} from '@eightyfourthousand/data-access';
|
|
54
|
-
|
|
55
|
-
// Re-export constants for passage filters
|
|
56
|
-
export {
|
|
57
|
-
BODY_ITEM_TYPES,
|
|
58
|
-
FRONT_MATTER,
|
|
59
|
-
FRONT_MATTER_FILTER,
|
|
60
|
-
BODY_MATTER,
|
|
61
|
-
BODY_MATTER_FILTER,
|
|
62
|
-
BACK_MATTER,
|
|
63
|
-
BACK_MATTER_FILTER,
|
|
64
|
-
COMPARE_MODE,
|
|
65
|
-
COMPARE_MODE_FILTER,
|
|
66
|
-
} from '@eightyfourthousand/data-access';
|
package/tsconfig.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"jsx": "react-jsx",
|
|
4
|
-
"allowJs": false,
|
|
5
|
-
"esModuleInterop": false,
|
|
6
|
-
"allowSyntheticDefaultImports": true,
|
|
7
|
-
"strict": true
|
|
8
|
-
},
|
|
9
|
-
"files": [],
|
|
10
|
-
"include": [],
|
|
11
|
-
"references": [
|
|
12
|
-
{
|
|
13
|
-
"path": "./tsconfig.lib.json"
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
|
-
"extends": "../../tsconfig.base.json"
|
|
17
|
-
}
|
package/tsconfig.lib.json
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "../../dist/out-tsc",
|
|
5
|
-
"declaration": true,
|
|
6
|
-
"types": ["node"]
|
|
7
|
-
},
|
|
8
|
-
"exclude": [
|
|
9
|
-
"jest.config.ts",
|
|
10
|
-
"src/**/*.spec.ts",
|
|
11
|
-
"src/**/*.test.ts"
|
|
12
|
-
],
|
|
13
|
-
"include": ["src/**/*.ts"]
|
|
14
|
-
}
|
|
File without changes
|