@eightyfourthousand/client-graphql 2026.4.3 → 2026.5.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 +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/lib/functions/get-glossary-instance.js +1 -0
- package/lib/functions/get-glossary-instance.js.map +1 -1
- package/lib/functions/index.d.ts +1 -0
- package/lib/functions/index.js +1 -0
- package/lib/functions/index.js.map +1 -1
- package/lib/functions/replace.d.ts +2 -1
- package/lib/functions/replace.js +4 -1
- package/lib/functions/replace.js.map +1 -1
- package/lib/functions/save-passages.d.ts +2 -0
- package/lib/functions/save-passages.js +4 -0
- package/lib/functions/save-passages.js.map +1 -1
- package/lib/functions/search-work-glossary-terms.d.ts +16 -0
- package/lib/functions/search-work-glossary-terms.js +36 -0
- package/lib/functions/search-work-glossary-terms.js.map +1 -0
- package/lib/generated/graphql.d.ts +13 -0
- package/lib/generated/graphql.js.map +1 -1
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { createGraphQLClient, resetGraphQLClient, setAccessTokenProvider, } from './lib/client';
|
|
2
|
-
export { getPassage, getTranslationBlocks, getTranslationBlocksAround, getTranslationTitles, getTranslationMetadataByUuid, getTranslationMetadataByToh, getTranslationsMetadata, getTranslationUuids, getTranslationToc, getTranslationImprint, getGlossaryInstance, getWorkGlossaryTerms, getWorkGlossaryTermsAround, type GlossaryTermsPage, getTermPassages, type GlossaryPassagesPage, getBibliographyEntry, getWorkBibliography, getWorkFolios, hasPermission, replace, savePassages, type TranslationBlocksPage, type Permission, type ReplaceType, type ReplacedPassage, } from './lib/functions';
|
|
2
|
+
export { getPassage, getTranslationBlocks, getTranslationBlocksAround, getTranslationTitles, getTranslationMetadataByUuid, getTranslationMetadataByToh, getTranslationsMetadata, getTranslationUuids, getTranslationToc, getTranslationImprint, getGlossaryInstance, getWorkGlossaryTerms, getWorkGlossaryTermsAround, searchWorkGlossaryTerms, type GlossaryTermSearchResult, type GlossaryTermsPage, getTermPassages, type GlossaryPassagesPage, getBibliographyEntry, getWorkBibliography, getWorkFolios, hasPermission, replace, savePassages, type TranslationBlocksPage, type Permission, type ReplaceType, type ReplacedPassage, } from './lib/functions';
|
|
3
3
|
export type { Passage, Passages, PassagesPage, PaginationDirection, BodyItemType, Annotation, Annotations, Alignment, Work, Title, Titles, TitleType, Toc, TocEntry, Imprint, GlossaryTermInstance, GlossaryLandingItem, GlossaryPageItem, BibliographyEntry, BibliographyEntryItem, BibliographyEntries, Folio, } from '@eightyfourthousand/data-access';
|
|
4
4
|
export { BODY_ITEM_TYPES, FRONT_MATTER, FRONT_MATTER_FILTER, BODY_MATTER, BODY_MATTER_FILTER, BACK_MATTER, BACK_MATTER_FILTER, COMPARE_MODE, COMPARE_MODE_FILTER, } from '@eightyfourthousand/data-access';
|
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Client
|
|
2
2
|
export { createGraphQLClient, resetGraphQLClient, setAccessTokenProvider, } from './lib/client';
|
|
3
3
|
// Functions
|
|
4
|
-
export { getPassage, getTranslationBlocks, getTranslationBlocksAround, getTranslationTitles, getTranslationMetadataByUuid, getTranslationMetadataByToh, getTranslationsMetadata, getTranslationUuids, getTranslationToc, getTranslationImprint, getGlossaryInstance, getWorkGlossaryTerms, getWorkGlossaryTermsAround, getTermPassages, getBibliographyEntry, getWorkBibliography, getWorkFolios, hasPermission, replace, savePassages, } from './lib/functions';
|
|
4
|
+
export { getPassage, getTranslationBlocks, getTranslationBlocksAround, getTranslationTitles, getTranslationMetadataByUuid, getTranslationMetadataByToh, getTranslationsMetadata, getTranslationUuids, getTranslationToc, getTranslationImprint, getGlossaryInstance, getWorkGlossaryTerms, getWorkGlossaryTermsAround, searchWorkGlossaryTerms, getTermPassages, getBibliographyEntry, getWorkBibliography, getWorkFolios, hasPermission, replace, savePassages, } from './lib/functions';
|
|
5
5
|
// Re-export constants for passage filters
|
|
6
6
|
export { BODY_ITEM_TYPES, FRONT_MATTER, FRONT_MATTER_FILTER, BODY_MATTER, BODY_MATTER_FILTER, BACK_MATTER, BACK_MATTER_FILTER, COMPARE_MODE, COMPARE_MODE_FILTER, } from '@eightyfourthousand/data-access';
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../libs/client-graphql/src/index.ts"],"names":[],"mappings":"AAAA,SAAS;AACT,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,cAAc,CAAC;AAEtB,YAAY;AACZ,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,0BAA0B,EAC1B,oBAAoB,EACpB,4BAA4B,EAC5B,2BAA2B,EAC3B,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,0BAA0B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../libs/client-graphql/src/index.ts"],"names":[],"mappings":"AAAA,SAAS;AACT,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,cAAc,CAAC;AAEtB,YAAY;AACZ,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,0BAA0B,EAC1B,oBAAoB,EACpB,4BAA4B,EAC5B,2BAA2B,EAC3B,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,0BAA0B,EAC1B,uBAAuB,EAGvB,eAAe,EAEf,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,OAAO,EACP,YAAY,GAKb,MAAM,iBAAiB,CAAC;AA4BzB,0CAA0C;AAC1C,OAAO,EACL,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,GACpB,MAAM,iCAAiC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-glossary-instance.js","sourceRoot":"","sources":["../../../../../libs/client-graphql/src/lib/functions/get-glossary-instance.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAGtC,MAAM,qBAAqB,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"get-glossary-instance.js","sourceRoot":"","sources":["../../../../../libs/client-graphql/src/lib/functions/get-glossary-instance.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAGtC,MAAM,qBAAqB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;CAkBhC,CAAC;AAMF;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,EACxC,MAAM,EACN,IAAI,GAIL;IACC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CACnC,qBAAqB,EACrB,EAAE,IAAI,EAAE,CACT,CAAC;QAEF,OAAO,QAAQ,CAAC,gBAAgB,CAAC;IACnC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAC;QAC1D,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/lib/functions/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { getTranslationImprint } from './get-translation-imprint';
|
|
|
10
10
|
export { getGlossaryInstance } from './get-glossary-instance';
|
|
11
11
|
export { getWorkGlossaryTerms, type GlossaryTermsPage, } from './get-work-glossary-terms';
|
|
12
12
|
export { getWorkGlossaryTermsAround } from './get-work-glossary-terms-around';
|
|
13
|
+
export { searchWorkGlossaryTerms, type GlossaryTermSearchResult, } from './search-work-glossary-terms';
|
|
13
14
|
export { getTermPassages, type GlossaryPassagesPage } from './get-term-passages';
|
|
14
15
|
export { getBibliographyEntry } from './get-bibliography-entry';
|
|
15
16
|
export { getWorkBibliography } from './get-work-bibliography';
|
package/lib/functions/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export { getTranslationImprint } from './get-translation-imprint';
|
|
|
10
10
|
export { getGlossaryInstance } from './get-glossary-instance';
|
|
11
11
|
export { getWorkGlossaryTerms, } from './get-work-glossary-terms';
|
|
12
12
|
export { getWorkGlossaryTermsAround } from './get-work-glossary-terms-around';
|
|
13
|
+
export { searchWorkGlossaryTerms, } from './search-work-glossary-terms';
|
|
13
14
|
export { getTermPassages } from './get-term-passages';
|
|
14
15
|
export { getBibliographyEntry } from './get-bibliography-entry';
|
|
15
16
|
export { getWorkBibliography } from './get-work-bibliography';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/client-graphql/src/lib/functions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EACL,oBAAoB,GAErB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EACL,4BAA4B,EAC5B,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EACL,oBAAoB,GAErB,MAAM,2BAA2B,CAAC;AACnC,OAAO,E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AAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAmB,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,OAAO,EAA0C,MAAM,WAAW,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -5,7 +5,7 @@ export interface ReplacedPassage {
|
|
|
5
5
|
json?: TranslationEditorContentItem | null;
|
|
6
6
|
uuid: string;
|
|
7
7
|
}
|
|
8
|
-
export declare const replace: ({ client, cursorPassageUuid, cursorStart, occurrenceIndex, replaceText, searchText, targetUuids, type, }: {
|
|
8
|
+
export declare const replace: ({ client, cursorPassageUuid, cursorStart, occurrenceIndex, replaceText, searchText, targetUuids, type, useRegex, }: {
|
|
9
9
|
client: GraphQLClient;
|
|
10
10
|
occurrenceIndex?: number;
|
|
11
11
|
replaceText: string;
|
|
@@ -14,6 +14,7 @@ export declare const replace: ({ client, cursorPassageUuid, cursorStart, occurre
|
|
|
14
14
|
cursorStart?: number;
|
|
15
15
|
targetUuids: string[];
|
|
16
16
|
type?: ReplaceType;
|
|
17
|
+
useRegex?: boolean;
|
|
17
18
|
}) => Promise<{
|
|
18
19
|
deletedAnnotationCount: number;
|
|
19
20
|
error?: string;
|
package/lib/functions/replace.js
CHANGED
|
@@ -8,6 +8,7 @@ const REPLACE_MUTATION = gql `
|
|
|
8
8
|
$occurrenceIndex: Int
|
|
9
9
|
$cursorPassageUuid: ID
|
|
10
10
|
$cursorStart: Int
|
|
11
|
+
$useRegex: Boolean
|
|
11
12
|
) {
|
|
12
13
|
replace(
|
|
13
14
|
searchText: $searchText
|
|
@@ -17,6 +18,7 @@ const REPLACE_MUTATION = gql `
|
|
|
17
18
|
occurrenceIndex: $occurrenceIndex
|
|
18
19
|
cursorPassageUuid: $cursorPassageUuid
|
|
19
20
|
cursorStart: $cursorStart
|
|
21
|
+
useRegex: $useRegex
|
|
20
22
|
) {
|
|
21
23
|
success
|
|
22
24
|
updatedCount
|
|
@@ -33,7 +35,7 @@ const REPLACE_MUTATION = gql `
|
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
`;
|
|
36
|
-
export const replace = async ({ client, cursorPassageUuid, cursorStart, occurrenceIndex, replaceText, searchText, targetUuids, type = 'PASSAGE', }) => {
|
|
38
|
+
export const replace = async ({ client, cursorPassageUuid, cursorStart, occurrenceIndex, replaceText, searchText, targetUuids, type = 'PASSAGE', useRegex, }) => {
|
|
37
39
|
const response = await client.request(REPLACE_MUTATION, {
|
|
38
40
|
searchText,
|
|
39
41
|
replaceText,
|
|
@@ -42,6 +44,7 @@ export const replace = async ({ client, cursorPassageUuid, cursorStart, occurren
|
|
|
42
44
|
occurrenceIndex,
|
|
43
45
|
cursorPassageUuid,
|
|
44
46
|
cursorStart,
|
|
47
|
+
useRegex,
|
|
45
48
|
});
|
|
46
49
|
return response.replace;
|
|
47
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replace.js","sourceRoot":"","sources":["../../../../../libs/client-graphql/src/lib/functions/replace.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAwBtC,MAAM,gBAAgB,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"replace.js","sourceRoot":"","sources":["../../../../../libs/client-graphql/src/lib/functions/replace.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAwBtC,MAAM,gBAAgB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmC3B,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAAE,EAC5B,MAAM,EACN,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,WAAW,EACX,UAAU,EACV,WAAW,EACX,IAAI,GAAG,SAAS,EAChB,QAAQ,GAWT,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAkB,gBAAgB,EAAE;QACvE,UAAU;QACV,WAAW;QACX,WAAW;QACX,IAAI;QACJ,eAAe;QACf,iBAAiB;QACjB,WAAW;QACX,QAAQ;KACT,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC,OAAO,CAAC;AAC1B,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { GraphQLClient } from 'graphql-request';
|
|
2
2
|
import type { Passage } from '@eightyfourthousand/data-access';
|
|
3
|
+
import type { ReplacedPassage } from './replace';
|
|
3
4
|
/**
|
|
4
5
|
* Save one or more passages via GraphQL mutation.
|
|
5
6
|
* Requires editor.edit permission.
|
|
@@ -12,5 +13,6 @@ export declare const savePassages: ({ client, passages, deletedUuids, }: {
|
|
|
12
13
|
success: boolean;
|
|
13
14
|
savedCount: number;
|
|
14
15
|
deletedCount?: number;
|
|
16
|
+
passages: ReplacedPassage[];
|
|
15
17
|
error?: string;
|
|
16
18
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"save-passages.js","sourceRoot":"","sources":["../../../../../libs/client-graphql/src/lib/functions/save-passages.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"save-passages.js","sourceRoot":"","sources":["../../../../../libs/client-graphql/src/lib/functions/save-passages.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAItC,MAAM,sBAAsB,GAAG,GAAG,CAAA;;;;;;;;;;;;;CAajC,CAAC;AAuBF;;GAEG;AACH,MAAM,cAAc,GAAG,CAAC,OAAgB,EAAgB,EAAE,CAAC,CAAC;IAC1D,IAAI,EAAE,OAAO,CAAC,IAAI;IAClB,QAAQ,EAAE,OAAO,CAAC,QAAQ;IAC1B,OAAO,EAAE,OAAO,CAAC,OAAO;IACxB,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,IAAI,EAAE,OAAO,CAAC,IAAI;IAClB,IAAI,EAAE,OAAO,CAAC,IAAI;IAClB,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,WAAW,EAAE,OAAO,CAAC,WAAW;CACjC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAAE,EACjC,MAAM,EACN,QAAQ,EACR,YAAY,GAKb,EAME,EAAE;IACH,MAAM,aAAa,GAAG,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAEnD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CACnC,sBAAsB,EACtB,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,CAC1C,CAAC;IAEF,OAAO,QAAQ,CAAC,YAAY,CAAC;AAC/B,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { GraphQLClient } from 'graphql-request';
|
|
2
|
+
export type GlossaryTermSearchResult = {
|
|
3
|
+
uuid: string;
|
|
4
|
+
authority: string;
|
|
5
|
+
termNumber: number;
|
|
6
|
+
names: {
|
|
7
|
+
english: string | null;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare function searchWorkGlossaryTerms({ client, uuid, query, limit, withAttestations, }: {
|
|
11
|
+
client: GraphQLClient;
|
|
12
|
+
uuid: string;
|
|
13
|
+
query: string;
|
|
14
|
+
limit?: number;
|
|
15
|
+
withAttestations?: boolean;
|
|
16
|
+
}): Promise<GlossaryTermSearchResult[]>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { gql } from 'graphql-request';
|
|
2
|
+
const SEARCH_WORK_GLOSSARY_TERMS = gql `
|
|
3
|
+
query SearchWorkGlossaryTerms(
|
|
4
|
+
$uuid: ID!
|
|
5
|
+
$query: String!
|
|
6
|
+
$limit: Int
|
|
7
|
+
$withAttestations: Boolean
|
|
8
|
+
) {
|
|
9
|
+
work(uuid: $uuid) {
|
|
10
|
+
uuid
|
|
11
|
+
searchGlossaryTerms(
|
|
12
|
+
query: $query
|
|
13
|
+
limit: $limit
|
|
14
|
+
withAttestations: $withAttestations
|
|
15
|
+
) {
|
|
16
|
+
uuid
|
|
17
|
+
authority
|
|
18
|
+
termNumber
|
|
19
|
+
names {
|
|
20
|
+
english
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
export async function searchWorkGlossaryTerms({ client, uuid, query, limit = 20, withAttestations = false, }) {
|
|
27
|
+
try {
|
|
28
|
+
const response = await client.request(SEARCH_WORK_GLOSSARY_TERMS, { uuid, query, limit, withAttestations });
|
|
29
|
+
return response.work?.searchGlossaryTerms ?? [];
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
console.error(`Failed to search work glossary terms: ${error}`);
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=search-work-glossary-terms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-work-glossary-terms.js","sourceRoot":"","sources":["../../../../../libs/client-graphql/src/lib/functions/search-work-glossary-terms.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,MAAM,0BAA0B,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;CAuBrC,CAAC;AAiBF,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,EAC5C,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,GAAG,EAAE,EACV,gBAAgB,GAAG,KAAK,GAOzB;IACC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CACnC,0BAA0B,EAC1B,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,CACzC,CAAC;QAEF,OAAO,QAAQ,CAAC,IAAI,EAAE,mBAAmB,IAAI,EAAE,CAAC;IAClD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,yCAAyC,KAAK,EAAE,CAAC,CAAC;QAChE,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -180,6 +180,8 @@ export type GlossaryTermInstancePassagesArgs = {
|
|
|
180
180
|
/** Names for a glossary term instance in different languages */
|
|
181
181
|
export type GlossaryTermNames = {
|
|
182
182
|
__typename?: 'GlossaryTermNames';
|
|
183
|
+
/** Alternative names to the main English name (e.g. synonyms, variant translations) */
|
|
184
|
+
alternatives?: Maybe<Scalars['String']['output']>;
|
|
183
185
|
/** Chinese name */
|
|
184
186
|
chinese?: Maybe<Scalars['String']['output']>;
|
|
185
187
|
/** English name/translation */
|
|
@@ -616,6 +618,11 @@ export type Work = {
|
|
|
616
618
|
publicationVersion: Scalars['String']['output'];
|
|
617
619
|
/** Whether access to this work is restricted */
|
|
618
620
|
restriction: Scalars['Boolean']['output'];
|
|
621
|
+
/**
|
|
622
|
+
* Search glossary term instances for this work by English term (ILIKE prefix
|
|
623
|
+
* match, also searching alternatives). Results are ordered by term_number.
|
|
624
|
+
*/
|
|
625
|
+
searchGlossaryTerms: Array<GlossaryTermInstance>;
|
|
619
626
|
/** Section of the canon this work belongs to */
|
|
620
627
|
section: Scalars['String']['output'];
|
|
621
628
|
/** Title of the work */
|
|
@@ -657,6 +664,12 @@ export type WorkPassagesArgs = {
|
|
|
657
664
|
filter?: InputMaybe<PassageFilter>;
|
|
658
665
|
limit?: InputMaybe<Scalars['Int']['input']>;
|
|
659
666
|
};
|
|
667
|
+
/** A published translation work from the 84000 canon */
|
|
668
|
+
export type WorkSearchGlossaryTermsArgs = {
|
|
669
|
+
limit?: InputMaybe<Scalars['Int']['input']>;
|
|
670
|
+
query: Scalars['String']['input'];
|
|
671
|
+
withAttestations?: InputMaybe<Scalars['Boolean']['input']>;
|
|
672
|
+
};
|
|
660
673
|
/** Connection type for paginated works */
|
|
661
674
|
export type WorkConnection = {
|
|
662
675
|
__typename?: 'WorkConnection';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql.js","sourceRoot":"","sources":["../../../../../libs/client-graphql/src/lib/generated/graphql.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"graphql.js","sourceRoot":"","sources":["../../../../../libs/client-graphql/src/lib/generated/graphql.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,aAAa,CAAC;AAs7B9B,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAA;;;;;;KAMtC,CAAC;AACN,MAAM,CAAC,MAAM,iCAAiC,GAAG,GAAG,CAAA;;;;;;;KAO/C,CAAC;AACN,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;KAsBtC,CAAC;AACN,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAA;;;;;;;;;;KAUtC,CAAC;AACN,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAA;;;;;;;;KAQzC,CAAC;AACN,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAA;;;;;;;;KAQxC,CAAC;AACN,MAAM,CAAC,MAAM,iCAAiC,GAAG,GAAG,CAAA;;;;;;;;;;KAU/C,CAAC;AACN,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAA;;;;;;;;;;KAUxC,CAAC;AACN,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAA;;;;;;;KAOpC,CAAC;AACN,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAA;;;;;;;;;KASvC,CAAC;AACN,MAAM,CAAC,MAAM,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A4C,EAAE,MAA8B;YAC7H,OAAO,WAAW,CAAC,CAAC,qBAAqB,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAmB,EAAE,QAAQ,EAAE,mBAAmB,EAAE,SAAS,EAAE,cAAc,EAAE,EAAE,GAAG,cAAc,EAAE,GAAG,qBAAqB,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;QAC5O,CAAC;QACD,YAAY,CAAC,SAAsC,EAAE,cAA4C,EAAE,MAA8B;YAC/H,OAAO,WAAW,CAAC,CAAC,qBAAqB,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAoB,EAAE,QAAQ,EAAE,oBAAoB,EAAE,SAAS,EAAE,cAAc,EAAE,EAAE,GAAG,cAAc,EAAE,GAAG,qBAAqB,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;QAC/O,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eightyfourthousand/client-graphql",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.5.1",
|
|
4
4
|
"description": "GraphQL client helpers and typed query functions for 84000 applications.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"repository": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@eightyfourthousand/data-access": "^2026.
|
|
20
|
+
"@eightyfourthousand/data-access": "^2026.5.1",
|
|
21
21
|
"graphql-request": "^7.1.2",
|
|
22
22
|
"graphql-tag": "^2.12.6"
|
|
23
23
|
},
|