@eightyfourthousand/client-graphql 2026.6.5 → 2026.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.
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/index.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/search-entities.d.ts +16 -0
- package/lib/functions/search-entities.js +34 -0
- package/lib/functions/search-entities.js.map +1 -0
- 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, lookup, type LookupEntityType, type LookupResult, getTranslationBlocks, getTranslationBlocksAround, getTranslationTitles, getTranslationMetadataByUuid, getTranslationMetadataByToh, getTranslationsMetadata, getTranslationUuids, getTranslationToc, getTranslationImprint, getGlossaryInstance, getWorkGlossaryTerms, getWorkGlossaryTermsAround, searchWorkGlossaryTerms, type GlossaryTermSearchResult, type GlossaryTermsPage, getTermPassages, type GlossaryPassagesPage, getBibliographyEntry, getWorkBibliography, getWorkFolios, getWorkFoliosAround, hasPermission, replace, savePassages, type TranslationBlocksPage, type Permission, type ReplaceType, type ReplacedPassage, } from './lib/functions';
|
|
2
|
+
export { getPassage, lookup, type LookupEntityType, type LookupResult, getTranslationBlocks, getTranslationBlocksAround, getTranslationTitles, getTranslationMetadataByUuid, getTranslationMetadataByToh, getTranslationsMetadata, getTranslationUuids, getTranslationToc, getTranslationImprint, getGlossaryInstance, getWorkGlossaryTerms, getWorkGlossaryTermsAround, searchWorkGlossaryTerms, type GlossaryTermSearchResult, searchEntities, type EntitySearchResult, type EntitySearchResultType, type GlossaryTermsPage, getTermPassages, type GlossaryPassagesPage, getBibliographyEntry, getWorkBibliography, getWorkFolios, getWorkFoliosAround, 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, lookup, getTranslationBlocks, getTranslationBlocksAround, getTranslationTitles, getTranslationMetadataByUuid, getTranslationMetadataByToh, getTranslationsMetadata, getTranslationUuids, getTranslationToc, getTranslationImprint, getGlossaryInstance, getWorkGlossaryTerms, getWorkGlossaryTermsAround, searchWorkGlossaryTerms, getTermPassages, getBibliographyEntry, getWorkBibliography, getWorkFolios, getWorkFoliosAround, hasPermission, replace, savePassages, } from './lib/functions';
|
|
4
|
+
export { getPassage, lookup, getTranslationBlocks, getTranslationBlocksAround, getTranslationTitles, getTranslationMetadataByUuid, getTranslationMetadataByToh, getTranslationsMetadata, getTranslationUuids, getTranslationToc, getTranslationImprint, getGlossaryInstance, getWorkGlossaryTerms, getWorkGlossaryTermsAround, searchWorkGlossaryTerms, searchEntities, getTermPassages, getBibliographyEntry, getWorkBibliography, getWorkFolios, getWorkFoliosAround, 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,MAAM,EAGN,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,
|
|
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,MAAM,EAGN,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,EAEvB,cAAc,EAId,eAAe,EAEf,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,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"}
|
package/lib/functions/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export { getGlossaryInstance } from './get-glossary-instance';
|
|
|
12
12
|
export { getWorkGlossaryTerms, type GlossaryTermsPage, } from './get-work-glossary-terms';
|
|
13
13
|
export { getWorkGlossaryTermsAround } from './get-work-glossary-terms-around';
|
|
14
14
|
export { searchWorkGlossaryTerms, type GlossaryTermSearchResult, } from './search-work-glossary-terms';
|
|
15
|
+
export { searchEntities, type EntitySearchResult, type EntitySearchResultType, } from './search-entities';
|
|
15
16
|
export { getTermPassages, type GlossaryPassagesPage, } from './get-term-passages';
|
|
16
17
|
export { getBibliographyEntry } from './get-bibliography-entry';
|
|
17
18
|
export { getWorkBibliography } from './get-work-bibliography';
|
package/lib/functions/index.js
CHANGED
|
@@ -12,6 +12,7 @@ export { getGlossaryInstance } from './get-glossary-instance';
|
|
|
12
12
|
export { getWorkGlossaryTerms, } from './get-work-glossary-terms';
|
|
13
13
|
export { getWorkGlossaryTermsAround } from './get-work-glossary-terms-around';
|
|
14
14
|
export { searchWorkGlossaryTerms, } from './search-work-glossary-terms';
|
|
15
|
+
export { searchEntities, } from './search-entities';
|
|
15
16
|
export { getTermPassages, } from './get-term-passages';
|
|
16
17
|
export { getBibliographyEntry } from './get-bibliography-entry';
|
|
17
18
|
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,EAAE,MAAM,EAA4C,MAAM,UAAU,CAAC;AAC5E,OAAO,EACL,oBAAoB,GAErB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE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AC7E,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,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EACL,uBAAuB,GAExB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,cAAc,GAGf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,eAAe,GAEhB,MAAM,qBAAqB,CAAC;AAC7B,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,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAmB,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,OAAO,EAA0C,MAAM,WAAW,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { GraphQLClient } from 'graphql-request';
|
|
2
|
+
export type EntitySearchResultType = 'work' | 'passage' | 'folio' | 'bibliography' | 'glossary';
|
|
3
|
+
export type EntitySearchResult = {
|
|
4
|
+
uuid: string;
|
|
5
|
+
type: EntitySearchResultType;
|
|
6
|
+
label: string;
|
|
7
|
+
text: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function searchEntities({ client, query, workUuid, toh, types, limit, }: {
|
|
10
|
+
client: GraphQLClient;
|
|
11
|
+
query: string;
|
|
12
|
+
workUuid?: string;
|
|
13
|
+
toh?: string;
|
|
14
|
+
types?: EntitySearchResultType[];
|
|
15
|
+
limit?: number;
|
|
16
|
+
}): Promise<EntitySearchResult[]>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { gql } from 'graphql-request';
|
|
2
|
+
const SEARCH_ENTITIES = gql `
|
|
3
|
+
query SearchEntities(
|
|
4
|
+
$query: String!
|
|
5
|
+
$workUuid: ID
|
|
6
|
+
$toh: String
|
|
7
|
+
$types: [String!]
|
|
8
|
+
$limit: Int
|
|
9
|
+
) {
|
|
10
|
+
search(
|
|
11
|
+
query: $query
|
|
12
|
+
workUuid: $workUuid
|
|
13
|
+
toh: $toh
|
|
14
|
+
types: $types
|
|
15
|
+
limit: $limit
|
|
16
|
+
) {
|
|
17
|
+
uuid
|
|
18
|
+
type
|
|
19
|
+
label
|
|
20
|
+
text
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
export async function searchEntities({ client, query, workUuid, toh, types, limit = 20, }) {
|
|
25
|
+
try {
|
|
26
|
+
const response = await client.request(SEARCH_ENTITIES, { query, workUuid, toh, types, limit });
|
|
27
|
+
return response.search ?? [];
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
console.error(`Failed to search entities: ${error}`);
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=search-entities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-entities.js","sourceRoot":"","sources":["../../../../../libs/client-graphql/src/lib/functions/search-entities.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,MAAM,eAAe,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;CAqB1B,CAAC;AAoBF,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,EACnC,MAAM,EACN,KAAK,EACL,QAAQ,EACR,GAAG,EACH,KAAK,EACL,KAAK,GAAG,EAAE,GAQX;IACC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CACnC,eAAe,EACf,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,CACvC,CAAC;QAEF,OAAO,QAAQ,CAAC,MAAM,IAAI,EAAE,CAAC;IAC/B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,8BAA8B,KAAK,EAAE,CAAC,CAAC;QACrD,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eightyfourthousand/client-graphql",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.7.0",
|
|
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.7.0",
|
|
21
21
|
"graphql-request": "^7.1.2",
|
|
22
22
|
"graphql-tag": "^2.12.6",
|
|
23
23
|
"server-only": "^0.0.1"
|