@eightyfourthousand/client-graphql 2026.4.0 → 2026.4.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.
Files changed (149) hide show
  1. package/index.d.ts +4 -0
  2. package/index.js +7 -0
  3. package/index.js.map +1 -0
  4. package/lib/client-ssr.d.ts +16 -0
  5. package/lib/client-ssr.js +39 -0
  6. package/lib/client-ssr.js.map +1 -0
  7. package/lib/client.d.ts +15 -0
  8. package/lib/client.js +48 -0
  9. package/lib/client.js.map +1 -0
  10. package/lib/config.d.ts +8 -0
  11. package/lib/config.js +19 -0
  12. package/lib/config.js.map +1 -0
  13. package/lib/functions/get-bibliography-entry.d.ts +9 -0
  14. package/lib/functions/get-bibliography-entry.js +24 -0
  15. package/lib/functions/get-bibliography-entry.js.map +1 -0
  16. package/lib/functions/get-glossary-instance.d.ts +9 -0
  17. package/lib/functions/get-glossary-instance.js +33 -0
  18. package/lib/functions/get-glossary-instance.js.map +1 -0
  19. package/lib/functions/get-passage.d.ts +10 -0
  20. package/lib/functions/get-passage.js +65 -0
  21. package/lib/functions/get-passage.js.map +1 -0
  22. package/lib/functions/get-term-passages.d.ts +20 -0
  23. package/lib/functions/get-term-passages.js +29 -0
  24. package/lib/functions/get-term-passages.js.map +1 -0
  25. package/lib/functions/get-translation-blocks-around.d.ts +15 -0
  26. package/lib/functions/get-translation-blocks-around.js +82 -0
  27. package/lib/functions/get-translation-blocks-around.js.map +1 -0
  28. package/lib/functions/get-translation-blocks.d.ts +25 -0
  29. package/lib/functions/get-translation-blocks.js +92 -0
  30. package/lib/functions/get-translation-blocks.js.map +1 -0
  31. package/lib/functions/get-translation-imprint.d.ts +10 -0
  32. package/lib/functions/get-translation-imprint.js +64 -0
  33. package/lib/functions/get-translation-imprint.js.map +1 -0
  34. package/lib/functions/get-translation-metadata.d.ts +16 -0
  35. package/lib/functions/get-translation-metadata.js +67 -0
  36. package/lib/functions/get-translation-metadata.js.map +1 -0
  37. package/lib/functions/get-translation-titles.d.ts +9 -0
  38. package/lib/functions/get-translation-titles.js +31 -0
  39. package/lib/functions/get-translation-titles.js.map +1 -0
  40. package/lib/functions/get-translation-toc.d.ts +9 -0
  41. package/{src/lib/functions/get-translation-toc.ts → lib/functions/get-translation-toc.js} +13 -47
  42. package/lib/functions/get-translation-toc.js.map +1 -0
  43. package/lib/functions/get-translation-uuids.d.ts +16 -0
  44. package/lib/functions/get-translation-uuids.js +37 -0
  45. package/lib/functions/get-translation-uuids.js.map +1 -0
  46. package/lib/functions/get-translations-metadata.d.ts +9 -0
  47. package/lib/functions/get-translations-metadata.js +48 -0
  48. package/lib/functions/get-translations-metadata.js.map +1 -0
  49. package/lib/functions/get-work-bibliography.d.ts +9 -0
  50. package/lib/functions/get-work-bibliography.js +29 -0
  51. package/lib/functions/get-work-bibliography.js.map +1 -0
  52. package/lib/functions/get-work-folios.d.ts +12 -0
  53. package/lib/functions/get-work-folios.js +28 -0
  54. package/lib/functions/get-work-folios.js.map +1 -0
  55. package/lib/functions/get-work-glossary-terms-around.d.ts +13 -0
  56. package/lib/functions/get-work-glossary-terms-around.js +91 -0
  57. package/lib/functions/get-work-glossary-terms-around.js.map +1 -0
  58. package/lib/functions/get-work-glossary-terms.d.ts +24 -0
  59. package/lib/functions/get-work-glossary-terms.js +100 -0
  60. package/lib/functions/get-work-glossary-terms.js.map +1 -0
  61. package/lib/functions/has-permission.d.ts +9 -0
  62. package/lib/functions/has-permission.js +14 -0
  63. package/lib/functions/has-permission.js.map +1 -0
  64. package/{src/lib/functions/index.ts → lib/functions/index.d.ts} +3 -12
  65. package/lib/functions/index.js +20 -0
  66. package/lib/functions/index.js.map +1 -0
  67. package/lib/functions/replace.d.ts +27 -0
  68. package/lib/functions/replace.js +48 -0
  69. package/lib/functions/replace.js.map +1 -0
  70. package/lib/functions/save-passages.d.ts +16 -0
  71. package/lib/functions/save-passages.js +34 -0
  72. package/lib/functions/save-passages.js.map +1 -0
  73. package/lib/generated/graphql.d.ts +1062 -0
  74. package/lib/generated/graphql.js +357 -0
  75. package/lib/generated/graphql.js.map +1 -0
  76. package/lib/mappers/alignment.d.ts +19 -0
  77. package/lib/mappers/alignment.js +19 -0
  78. package/lib/mappers/alignment.js.map +1 -0
  79. package/lib/mappers/annotation.d.ts +19 -0
  80. package/lib/mappers/annotation.js +160 -0
  81. package/lib/mappers/annotation.js.map +1 -0
  82. package/lib/mappers/imprint.d.ts +37 -0
  83. package/lib/mappers/imprint.js +43 -0
  84. package/lib/mappers/imprint.js.map +1 -0
  85. package/lib/mappers/index.js +8 -0
  86. package/lib/mappers/index.js.map +1 -0
  87. package/lib/mappers/passage.d.ts +41 -0
  88. package/lib/mappers/passage.js +37 -0
  89. package/lib/mappers/passage.js.map +1 -0
  90. package/lib/mappers/title.d.ts +18 -0
  91. package/lib/mappers/title.js +18 -0
  92. package/lib/mappers/title.js.map +1 -0
  93. package/lib/mappers/toc.d.ts +25 -0
  94. package/lib/mappers/toc.js +25 -0
  95. package/lib/mappers/toc.js.map +1 -0
  96. package/lib/mappers/work.d.ts +22 -0
  97. package/lib/mappers/work.js +22 -0
  98. package/lib/mappers/work.js.map +1 -0
  99. package/package.json +25 -3
  100. package/ssr.d.ts +4 -0
  101. package/ssr.js +7 -0
  102. package/ssr.js.map +1 -0
  103. package/README.md +0 -9
  104. package/codegen.ts +0 -34
  105. package/project.json +0 -21
  106. package/src/index.ts +0 -75
  107. package/src/lib/client-ssr.ts +0 -44
  108. package/src/lib/client.ts +0 -58
  109. package/src/lib/config.ts +0 -21
  110. package/src/lib/functions/get-bibliography-entry.ts +0 -40
  111. package/src/lib/functions/get-glossary-instance.ts +0 -49
  112. package/src/lib/functions/get-passage.ts +0 -81
  113. package/src/lib/functions/get-term-passages.ts +0 -53
  114. package/src/lib/functions/get-translation-blocks-around.ts +0 -129
  115. package/src/lib/functions/get-translation-blocks.ts +0 -158
  116. package/src/lib/functions/get-translation-imprint.ts +0 -114
  117. package/src/lib/functions/get-translation-metadata.ts +0 -99
  118. package/src/lib/functions/get-translation-titles.ts +0 -55
  119. package/src/lib/functions/get-translation-uuids.ts +0 -63
  120. package/src/lib/functions/get-translations-metadata.ts +0 -81
  121. package/src/lib/functions/get-work-bibliography.ts +0 -47
  122. package/src/lib/functions/get-work-folios.ts +0 -52
  123. package/src/lib/functions/get-work-glossary-terms-around.ts +0 -127
  124. package/src/lib/functions/get-work-glossary-terms.ts +0 -154
  125. package/src/lib/functions/has-permission.ts +0 -38
  126. package/src/lib/functions/replace.ts +0 -91
  127. package/src/lib/functions/save-passages.ts +0 -76
  128. package/src/lib/generated/graphql.ts +0 -1297
  129. package/src/lib/graphql/fragments/alignment.graphql +0 -7
  130. package/src/lib/graphql/fragments/annotation.graphql +0 -7
  131. package/src/lib/graphql/fragments/imprint.graphql +0 -34
  132. package/src/lib/graphql/fragments/passage.graphql +0 -29
  133. package/src/lib/graphql/fragments/title.graphql +0 -6
  134. package/src/lib/graphql/fragments/toc.graphql +0 -40
  135. package/src/lib/graphql/fragments/work.graphql +0 -10
  136. package/src/lib/graphql/queries/passages.graphql +0 -116
  137. package/src/lib/graphql/queries/work.graphql +0 -38
  138. package/src/lib/graphql/queries/works.graphql +0 -23
  139. package/src/lib/mappers/alignment.ts +0 -34
  140. package/src/lib/mappers/annotation.ts +0 -204
  141. package/src/lib/mappers/imprint.ts +0 -79
  142. package/src/lib/mappers/passage.ts +0 -80
  143. package/src/lib/mappers/title.ts +0 -35
  144. package/src/lib/mappers/toc.ts +0 -49
  145. package/src/lib/mappers/work.ts +0 -38
  146. package/src/ssr.ts +0 -66
  147. package/tsconfig.json +0 -17
  148. package/tsconfig.lib.json +0 -14
  149. /package/{src/lib/mappers/index.ts → lib/mappers/index.d.ts} +0 -0
package/index.d.ts ADDED
@@ -0,0 +1,4 @@
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';
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
+ 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 ADDED
@@ -0,0 +1,7 @@
1
+ // Client
2
+ export { createGraphQLClient, resetGraphQLClient, setAccessTokenProvider, } from './lib/client';
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';
5
+ // Re-export constants for passage filters
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
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +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,EAE1B,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"}
@@ -0,0 +1,16 @@
1
+ import 'server-only';
2
+ import { GraphQLClient } from 'graphql-request';
3
+ /**
4
+ * Create a GraphQL client for server-side requests (SSR/RSC).
5
+ * Reads auth cookies from the request and forwards them to the GraphQL API.
6
+ *
7
+ * Must be called within a Server Component or Server Action context.
8
+ */
9
+ export declare function createServerGraphQLClient(): Promise<GraphQLClient>;
10
+ /**
11
+ * Create a GraphQL client for build-time requests (generateStaticParams).
12
+ * Does not use cookies since there's no request context during builds.
13
+ *
14
+ * Use this in generateStaticParams and other build-time contexts.
15
+ */
16
+ export declare function createBuildGraphQLClient(): GraphQLClient;
@@ -0,0 +1,39 @@
1
+ import 'server-only';
2
+ import { GraphQLClient } from 'graphql-request';
3
+ import { cookies } from 'next/headers';
4
+ import { getGraphQLUrl } from './config';
5
+ /**
6
+ * Create a GraphQL client for server-side requests (SSR/RSC).
7
+ * Reads auth cookies from the request and forwards them to the GraphQL API.
8
+ *
9
+ * Must be called within a Server Component or Server Action context.
10
+ */
11
+ export async function createServerGraphQLClient() {
12
+ const url = getGraphQLUrl();
13
+ // Get all cookies from the request
14
+ const cookieStore = await cookies();
15
+ const allCookies = cookieStore.getAll();
16
+ // Build cookie header string with encoded values to ensure HTTP header compatibility
17
+ // Cookie values may contain non-ASCII characters which are invalid in HTTP headers (ByteString)
18
+ const cookieHeader = allCookies
19
+ .map((cookie) => `${cookie.name}=${encodeURIComponent(cookie.value)}`)
20
+ .join('; ');
21
+ const client = new GraphQLClient(url, {
22
+ headers: {
23
+ // Forward cookies for authentication
24
+ ...(cookieHeader ? { cookie: cookieHeader } : {}),
25
+ },
26
+ });
27
+ return client;
28
+ }
29
+ /**
30
+ * Create a GraphQL client for build-time requests (generateStaticParams).
31
+ * Does not use cookies since there's no request context during builds.
32
+ *
33
+ * Use this in generateStaticParams and other build-time contexts.
34
+ */
35
+ export function createBuildGraphQLClient() {
36
+ const url = getGraphQLUrl();
37
+ return new GraphQLClient(url);
38
+ }
39
+ //# sourceMappingURL=client-ssr.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-ssr.js","sourceRoot":"","sources":["../../../../libs/client-graphql/src/lib/client-ssr.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB;IAC7C,MAAM,GAAG,GAAG,aAAa,EAAE,CAAC;IAE5B,mCAAmC;IACnC,MAAM,WAAW,GAAG,MAAM,OAAO,EAAE,CAAC;IACpC,MAAM,UAAU,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC;IAExC,qFAAqF;IACrF,gGAAgG;IAChG,MAAM,YAAY,GAAG,UAAU;SAC5B,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,IAAI,IAAI,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;SACrE,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,GAAG,EAAE;QACpC,OAAO,EAAE;YACP,qCAAqC;YACrC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAClD;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB;IACtC,MAAM,GAAG,GAAG,aAAa,EAAE,CAAC;IAC5B,OAAO,IAAI,aAAa,CAAC,GAAG,CAAC,CAAC;AAChC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { GraphQLClient } from 'graphql-request';
2
+ /**
3
+ * Set the access token provider function.
4
+ * This should be called once at app initialization.
5
+ */
6
+ export declare function setAccessTokenProvider(provider: () => Promise<string | null>): void;
7
+ /**
8
+ * Create a GraphQL client for browser-side requests.
9
+ * Uses Authorization header with dynamic token retrieval for cross-domain requests.
10
+ */
11
+ export declare function createGraphQLClient(): GraphQLClient;
12
+ /**
13
+ * Reset the client instance (useful for testing)
14
+ */
15
+ export declare function resetGraphQLClient(): void;
package/lib/client.js ADDED
@@ -0,0 +1,48 @@
1
+ import { GraphQLClient } from 'graphql-request';
2
+ import { getGraphQLUrl } from './config';
3
+ let clientInstance = null;
4
+ let getAccessToken = null;
5
+ /**
6
+ * Set the access token provider function.
7
+ * This should be called once at app initialization.
8
+ */
9
+ export function setAccessTokenProvider(provider) {
10
+ getAccessToken = provider;
11
+ }
12
+ /**
13
+ * Create a GraphQL client for browser-side requests.
14
+ * Uses Authorization header with dynamic token retrieval for cross-domain requests.
15
+ */
16
+ export function createGraphQLClient() {
17
+ if (clientInstance) {
18
+ return clientInstance;
19
+ }
20
+ const url = getGraphQLUrl();
21
+ clientInstance = new GraphQLClient(url, {
22
+ // Dynamic headers - called on each request
23
+ requestMiddleware: async (request) => {
24
+ const headers = {
25
+ 'Content-Type': 'application/json',
26
+ 'apollo-require-preflight': 'true',
27
+ };
28
+ if (getAccessToken) {
29
+ const token = await getAccessToken();
30
+ if (token) {
31
+ headers['Authorization'] = `Bearer ${token}`;
32
+ }
33
+ }
34
+ return {
35
+ ...request,
36
+ headers,
37
+ };
38
+ },
39
+ });
40
+ return clientInstance;
41
+ }
42
+ /**
43
+ * Reset the client instance (useful for testing)
44
+ */
45
+ export function resetGraphQLClient() {
46
+ clientInstance = null;
47
+ }
48
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../libs/client-graphql/src/lib/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,IAAI,cAAc,GAAyB,IAAI,CAAC;AAChD,IAAI,cAAc,GAA0C,IAAI,CAAC;AAEjE;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CACpC,QAAsC;IAEtC,cAAc,GAAG,QAAQ,CAAC;AAC5B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB;IACjC,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,MAAM,GAAG,GAAG,aAAa,EAAE,CAAC;IAE5B,cAAc,GAAG,IAAI,aAAa,CAAC,GAAG,EAAE;QACtC,2CAA2C;QAC3C,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YACnC,MAAM,OAAO,GAA2B;gBACtC,cAAc,EAAE,kBAAkB;gBAClC,0BAA0B,EAAE,MAAM;aACnC,CAAC;YAEF,IAAI,cAAc,EAAE,CAAC;gBACnB,MAAM,KAAK,GAAG,MAAM,cAAc,EAAE,CAAC;gBACrC,IAAI,KAAK,EAAE,CAAC;oBACV,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,KAAK,EAAE,CAAC;gBAC/C,CAAC;YACH,CAAC;YAED,OAAO;gBACL,GAAG,OAAO;gBACV,OAAO;aACR,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,cAAc,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB;IAChC,cAAc,GAAG,IAAI,CAAC;AACxB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * GraphQL API configuration
3
+ */
4
+ /**
5
+ * Get the GraphQL API URL from environment variables
6
+ * Falls back to localhost for development
7
+ */
8
+ export declare function getGraphQLUrl(): string;
package/lib/config.js ADDED
@@ -0,0 +1,19 @@
1
+ /**
2
+ * GraphQL API configuration
3
+ */
4
+ /**
5
+ * Get the GraphQL API URL from environment variables
6
+ * Falls back to localhost for development
7
+ */
8
+ export function getGraphQLUrl() {
9
+ const url = process.env.NEXT_PUBLIC_GRAPHQL_URL;
10
+ if (!url) {
11
+ // Default to localhost in development
12
+ if (process.env.NODE_ENV === 'development') {
13
+ return 'http://localhost:3001/api/graphql';
14
+ }
15
+ throw new Error('NEXT_PUBLIC_GRAPHQL_URL environment variable is not set');
16
+ }
17
+ return url;
18
+ }
19
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../libs/client-graphql/src/lib/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,MAAM,UAAU,aAAa;IAC3B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;IAEhD,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,sCAAsC;QACtC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE,CAAC;YAC3C,OAAO,mCAAmC,CAAC;QAC7C,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { GraphQLClient } from 'graphql-request';
2
+ import type { BibliographyEntryItem } from '@eightyfourthousand/data-access';
3
+ /**
4
+ * Get a single bibliography entry by UUID.
5
+ */
6
+ export declare function getBibliographyEntry({ client, uuid, }: {
7
+ client: GraphQLClient;
8
+ uuid: string;
9
+ }): Promise<BibliographyEntryItem | null>;
@@ -0,0 +1,24 @@
1
+ import { gql } from 'graphql-request';
2
+ const GET_BIBLIOGRAPHY_ENTRY = gql `
3
+ query GetBibliographyEntry($uuid: ID!) {
4
+ bibliographyEntry(uuid: $uuid) {
5
+ uuid
6
+ html
7
+ workUuid
8
+ }
9
+ }
10
+ `;
11
+ /**
12
+ * Get a single bibliography entry by UUID.
13
+ */
14
+ export async function getBibliographyEntry({ client, uuid, }) {
15
+ try {
16
+ const response = await client.request(GET_BIBLIOGRAPHY_ENTRY, { uuid });
17
+ return response.bibliographyEntry;
18
+ }
19
+ catch (error) {
20
+ console.error('Error fetching bibliography entry:', error);
21
+ return null;
22
+ }
23
+ }
24
+ //# sourceMappingURL=get-bibliography-entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-bibliography-entry.js","sourceRoot":"","sources":["../../../../../libs/client-graphql/src/lib/functions/get-bibliography-entry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAGtC,MAAM,sBAAsB,GAAG,GAAG,CAAA;;;;;;;;CAQjC,CAAC;AAMF;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,EACzC,MAAM,EACN,IAAI,GAIL;IACC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CACnC,sBAAsB,EACtB,EAAE,IAAI,EAAE,CACT,CAAC;QAEF,OAAO,QAAQ,CAAC,iBAAiB,CAAC;IACpC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;QAC3D,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { GraphQLClient } from 'graphql-request';
2
+ import type { GlossaryTermInstance } from '@eightyfourthousand/data-access';
3
+ /**
4
+ * Get a single glossary instance by UUID.
5
+ */
6
+ export declare function getGlossaryInstance({ client, uuid, }: {
7
+ client: GraphQLClient;
8
+ uuid: string;
9
+ }): Promise<GlossaryTermInstance | null>;
@@ -0,0 +1,33 @@
1
+ import { gql } from 'graphql-request';
2
+ const GET_GLOSSARY_INSTANCE = gql `
3
+ query GetGlossaryInstance($uuid: ID!) {
4
+ glossaryInstance(uuid: $uuid) {
5
+ uuid
6
+ authority
7
+ definition
8
+ names {
9
+ english
10
+ tibetan
11
+ sanskrit
12
+ pali
13
+ chinese
14
+ wylie
15
+ alternatives
16
+ }
17
+ }
18
+ }
19
+ `;
20
+ /**
21
+ * Get a single glossary instance by UUID.
22
+ */
23
+ export async function getGlossaryInstance({ client, uuid, }) {
24
+ try {
25
+ const response = await client.request(GET_GLOSSARY_INSTANCE, { uuid });
26
+ return response.glossaryInstance;
27
+ }
28
+ catch (error) {
29
+ console.error('Error fetching glossary instance:', error);
30
+ return null;
31
+ }
32
+ }
33
+ //# sourceMappingURL=get-glossary-instance.js.map
@@ -0,0 +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;;;;;;;;;;;;;;;;;CAiBhC,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"}
@@ -0,0 +1,10 @@
1
+ import type { GraphQLClient } from 'graphql-request';
2
+ import type { Passage } from '@eightyfourthousand/data-access';
3
+ /**
4
+ * Get a single passage by UUID or XML ID.
5
+ */
6
+ export declare function getPassage({ client, uuid, xmlId, }: {
7
+ client: GraphQLClient;
8
+ uuid?: string;
9
+ xmlId?: string;
10
+ }): Promise<Passage | undefined>;
@@ -0,0 +1,65 @@
1
+ import { gql } from 'graphql-request';
2
+ import { passageFromGraphQL } from '../mappers';
3
+ const GET_PASSAGE = gql `
4
+ fragment AnnotationFields on Annotation {
5
+ uuid
6
+ type
7
+ start
8
+ end
9
+ metadata
10
+ }
11
+
12
+ fragment AlignmentFields on Alignment {
13
+ folioUuid
14
+ toh
15
+ tibetan
16
+ folioNumber
17
+ volumeNumber
18
+ }
19
+
20
+ fragment PassageFields on Passage {
21
+ uuid
22
+ workUuid
23
+ content
24
+ label
25
+ sort
26
+ type
27
+ xmlId
28
+ }
29
+
30
+ fragment PassageWithAnnotations on Passage {
31
+ ...PassageFields
32
+ annotations {
33
+ ...AnnotationFields
34
+ }
35
+ alignments {
36
+ ...AlignmentFields
37
+ }
38
+ }
39
+
40
+ query GetPassage($uuid: ID, $xmlId: String) {
41
+ passage(uuid: $uuid, xmlId: $xmlId) {
42
+ ...PassageWithAnnotations
43
+ }
44
+ }
45
+ `;
46
+ /**
47
+ * Get a single passage by UUID or XML ID.
48
+ */
49
+ export async function getPassage({ client, uuid, xmlId, }) {
50
+ try {
51
+ const response = await client.request(GET_PASSAGE, {
52
+ uuid,
53
+ xmlId,
54
+ });
55
+ if (!response.passage) {
56
+ return undefined;
57
+ }
58
+ return passageFromGraphQL(response.passage);
59
+ }
60
+ catch (error) {
61
+ console.error('Error fetching passage:', error);
62
+ return undefined;
63
+ }
64
+ }
65
+ //# sourceMappingURL=get-passage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-passage.js","sourceRoot":"","sources":["../../../../../libs/client-graphql/src/lib/functions/get-passage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,OAAO,EAAE,kBAAkB,EAAuB,MAAM,YAAY,CAAC;AAErE,MAAM,WAAW,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CtB,CAAC;AAMF;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,EAC/B,MAAM,EACN,IAAI,EACJ,KAAK,GAKN;IACC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAqB,WAAW,EAAE;YACrE,IAAI;YACJ,KAAK;SACN,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YACtB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,kBAAkB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;QAChD,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { GraphQLClient } from 'graphql-request';
2
+ export type GlossaryPassagesPage = {
3
+ items: Array<{
4
+ uuid: string;
5
+ type: string;
6
+ label: string;
7
+ sort: number;
8
+ }>;
9
+ nextCursor: string | null;
10
+ hasMore: boolean;
11
+ };
12
+ /**
13
+ * Fetch a page of passage references for a single glossary term instance.
14
+ */
15
+ export declare function getTermPassages({ client, uuid, first, after, }: {
16
+ client: GraphQLClient;
17
+ uuid: string;
18
+ first?: number;
19
+ after?: string;
20
+ }): Promise<GlossaryPassagesPage>;
@@ -0,0 +1,29 @@
1
+ import { gql } from 'graphql-request';
2
+ const GET_TERM_PASSAGES = gql `
3
+ query GetTermPassages($uuid: ID!, $first: Int, $after: String) {
4
+ glossaryTermPassages(uuid: $uuid, first: $first, after: $after) {
5
+ items {
6
+ uuid
7
+ type
8
+ label
9
+ sort
10
+ }
11
+ nextCursor
12
+ hasMore
13
+ }
14
+ }
15
+ `;
16
+ /**
17
+ * Fetch a page of passage references for a single glossary term instance.
18
+ */
19
+ export async function getTermPassages({ client, uuid, first = 10, after, }) {
20
+ try {
21
+ const response = await client.request(GET_TERM_PASSAGES, { uuid, first, after });
22
+ return response.glossaryTermPassages;
23
+ }
24
+ catch (error) {
25
+ console.error('Error fetching term passages:', error);
26
+ return { items: [], nextCursor: null, hasMore: false };
27
+ }
28
+ }
29
+ //# sourceMappingURL=get-term-passages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-term-passages.js","sourceRoot":"","sources":["../../../../../libs/client-graphql/src/lib/functions/get-term-passages.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,MAAM,iBAAiB,GAAG,GAAG,CAAA;;;;;;;;;;;;;CAa5B,CAAC;AAYF;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,EACpC,MAAM,EACN,IAAI,EACJ,KAAK,GAAG,EAAE,EACV,KAAK,GAMN;IACC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CACnC,iBAAiB,EACjB,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CACvB,CAAC;QACF,OAAO,QAAQ,CAAC,oBAAoB,CAAC;IACvC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAC;QACtD,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACzD,CAAC;AACH,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { GraphQLClient } from 'graphql-request';
2
+ import type { BodyItemType } from '@eightyfourthousand/data-access';
3
+ import type { TranslationBlocksPage } from './get-translation-blocks';
4
+ /**
5
+ * Get translation blocks (TipTap JSON) around a specific passage UUID.
6
+ *
7
+ * Returns pre-transformed TipTap editor blocks ready for rendering.
8
+ */
9
+ export declare function getTranslationBlocksAround({ client, uuid, passageUuid, type, maxPassages, }: {
10
+ client: GraphQLClient;
11
+ uuid: string;
12
+ passageUuid: string;
13
+ type?: BodyItemType | string;
14
+ maxPassages?: number;
15
+ }): Promise<TranslationBlocksPage>;
@@ -0,0 +1,82 @@
1
+ import { gql } from 'graphql-request';
2
+ const GET_PASSAGES_AROUND_WITH_JSON = gql `
3
+ fragment PassageWithJson on Passage {
4
+ uuid
5
+ workUuid
6
+ label
7
+ sort
8
+ type
9
+ xmlId
10
+ json
11
+ }
12
+
13
+ query GetPassagesAroundWithJson(
14
+ $uuid: ID!
15
+ $cursor: String!
16
+ $limit: Int
17
+ $filter: PassageFilter
18
+ ) {
19
+ work(uuid: $uuid) {
20
+ uuid
21
+ passages(
22
+ cursor: $cursor
23
+ limit: $limit
24
+ direction: AROUND
25
+ filter: $filter
26
+ ) {
27
+ nodes {
28
+ ...PassageWithJson
29
+ }
30
+ pageInfo {
31
+ nextCursor
32
+ prevCursor
33
+ hasMoreAfter
34
+ hasMoreBefore
35
+ }
36
+ }
37
+ }
38
+ }
39
+ `;
40
+ /**
41
+ * Get translation blocks (TipTap JSON) around a specific passage UUID.
42
+ *
43
+ * Returns pre-transformed TipTap editor blocks ready for rendering.
44
+ */
45
+ export async function getTranslationBlocksAround({ client, uuid, passageUuid, type, maxPassages, }) {
46
+ try {
47
+ const response = await client.request(GET_PASSAGES_AROUND_WITH_JSON, {
48
+ uuid,
49
+ cursor: passageUuid,
50
+ limit: maxPassages,
51
+ filter: type ? { type } : undefined,
52
+ });
53
+ if (!response.work) {
54
+ return {
55
+ blocks: [],
56
+ hasMoreAfter: false,
57
+ hasMoreBefore: false,
58
+ };
59
+ }
60
+ const { passages } = response.work;
61
+ // Extract the JSON blocks, filtering out any null values
62
+ const blocks = passages.nodes
63
+ .map((node) => node.json)
64
+ .filter((json) => json != null);
65
+ return {
66
+ blocks,
67
+ nextCursor: passages.pageInfo.nextCursor ?? undefined,
68
+ prevCursor: passages.pageInfo.prevCursor ?? undefined,
69
+ hasMoreAfter: passages.pageInfo.hasMoreAfter,
70
+ hasMoreBefore: passages.pageInfo.hasMoreBefore,
71
+ };
72
+ }
73
+ catch (error) {
74
+ console.error('Error fetching translation blocks around:', error);
75
+ return {
76
+ blocks: [],
77
+ hasMoreAfter: false,
78
+ hasMoreBefore: false,
79
+ };
80
+ }
81
+ }
82
+ //# sourceMappingURL=get-translation-blocks-around.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-translation-blocks-around.js","sourceRoot":"","sources":["../../../../../libs/client-graphql/src/lib/functions/get-translation-blocks-around.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAItC,MAAM,6BAA6B,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCxC,CAAC;AA2BF;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,EAC/C,MAAM,EACN,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,WAAW,GAOZ;IACC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CACnC,6BAA6B,EAC7B;YACE,IAAI;YACJ,MAAM,EAAE,WAAW;YACnB,KAAK,EAAE,WAAW;YAClB,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS;SACpC,CACF,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACnB,OAAO;gBACL,MAAM,EAAE,EAAE;gBACV,YAAY,EAAE,KAAK;gBACnB,aAAa,EAAE,KAAK;aACrB,CAAC;QACJ,CAAC;QAED,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC;QAEnC,yDAAyD;QACzD,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK;aAC1B,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;aACxB,MAAM,CAAC,CAAC,IAAI,EAAwC,EAAE,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC;QAExE,OAAO;YACL,MAAM;YACN,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,UAAU,IAAI,SAAS;YACrD,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,UAAU,IAAI,SAAS;YACrD,YAAY,EAAE,QAAQ,CAAC,QAAQ,CAAC,YAAY;YAC5C,aAAa,EAAE,QAAQ,CAAC,QAAQ,CAAC,aAAa;SAC/C,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,2CAA2C,EAAE,KAAK,CAAC,CAAC;QAClE,OAAO;YACL,MAAM,EAAE,EAAE;YACV,YAAY,EAAE,KAAK;YACnB,aAAa,EAAE,KAAK;SACrB,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { GraphQLClient } from 'graphql-request';
2
+ import type { BodyItemType, PaginationDirection, TranslationEditorContent } from '@eightyfourthousand/data-access';
3
+ /**
4
+ * Result of fetching translation blocks with pagination info
5
+ */
6
+ export type TranslationBlocksPage = {
7
+ blocks: TranslationEditorContent;
8
+ nextCursor?: string;
9
+ prevCursor?: string;
10
+ hasMoreAfter: boolean;
11
+ hasMoreBefore: boolean;
12
+ };
13
+ /**
14
+ * Get paginated translation blocks (TipTap JSON) for a work.
15
+ *
16
+ * Returns pre-transformed TipTap editor blocks ready for rendering.
17
+ */
18
+ export declare function getTranslationBlocks({ client, uuid, type, cursor, maxPassages, direction, }: {
19
+ client: GraphQLClient;
20
+ uuid: string;
21
+ type?: BodyItemType | string;
22
+ cursor?: string;
23
+ maxPassages?: number;
24
+ direction?: PaginationDirection;
25
+ }): Promise<TranslationBlocksPage>;
@@ -0,0 +1,92 @@
1
+ import { gql } from 'graphql-request';
2
+ const GET_PASSAGES_WITH_JSON = gql `
3
+ fragment PassageWithJson on Passage {
4
+ uuid
5
+ workUuid
6
+ label
7
+ sort
8
+ type
9
+ xmlId
10
+ json
11
+ }
12
+
13
+ query GetPassagesWithJson(
14
+ $uuid: ID!
15
+ $cursor: String
16
+ $limit: Int
17
+ $direction: PaginationDirection
18
+ $filter: PassageFilter
19
+ ) {
20
+ work(uuid: $uuid) {
21
+ uuid
22
+ passages(
23
+ cursor: $cursor
24
+ limit: $limit
25
+ direction: $direction
26
+ filter: $filter
27
+ ) {
28
+ nodes {
29
+ ...PassageWithJson
30
+ }
31
+ pageInfo {
32
+ nextCursor
33
+ prevCursor
34
+ hasMoreAfter
35
+ hasMoreBefore
36
+ }
37
+ }
38
+ }
39
+ }
40
+ `;
41
+ /**
42
+ * Map internal pagination direction to GraphQL enum
43
+ */
44
+ function mapDirection(direction) {
45
+ if (!direction)
46
+ return undefined;
47
+ return direction === 'forward' ? 'FORWARD' : 'BACKWARD';
48
+ }
49
+ /**
50
+ * Get paginated translation blocks (TipTap JSON) for a work.
51
+ *
52
+ * Returns pre-transformed TipTap editor blocks ready for rendering.
53
+ */
54
+ export async function getTranslationBlocks({ client, uuid, type, cursor, maxPassages = 100, direction, }) {
55
+ try {
56
+ const response = await client.request(GET_PASSAGES_WITH_JSON, {
57
+ uuid,
58
+ cursor,
59
+ limit: maxPassages,
60
+ direction: mapDirection(direction),
61
+ filter: type ? { type } : undefined,
62
+ });
63
+ if (!response.work) {
64
+ return {
65
+ blocks: [],
66
+ hasMoreAfter: false,
67
+ hasMoreBefore: false,
68
+ };
69
+ }
70
+ const { passages } = response.work;
71
+ // Extract the JSON blocks, filtering out any null values
72
+ const blocks = passages.nodes
73
+ .map((node) => node.json)
74
+ .filter((json) => json != null);
75
+ return {
76
+ blocks,
77
+ nextCursor: passages.pageInfo.nextCursor ?? undefined,
78
+ prevCursor: passages.pageInfo.prevCursor ?? undefined,
79
+ hasMoreAfter: passages.pageInfo.hasMoreAfter,
80
+ hasMoreBefore: passages.pageInfo.hasMoreBefore,
81
+ };
82
+ }
83
+ catch (error) {
84
+ console.error('Error fetching translation blocks:', error);
85
+ return {
86
+ blocks: [],
87
+ hasMoreAfter: false,
88
+ hasMoreBefore: false,
89
+ };
90
+ }
91
+ }
92
+ //# sourceMappingURL=get-translation-blocks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-translation-blocks.js","sourceRoot":"","sources":["../../../../../libs/client-graphql/src/lib/functions/get-translation-blocks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAQtC,MAAM,sBAAsB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCjC,CAAC;AAsCF;;GAEG;AACH,SAAS,YAAY,CACnB,SAA+B;IAE/B,IAAI,CAAC,SAAS;QAAE,OAAO,SAAS,CAAC;IACjC,OAAO,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC;AAC1D,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,EACzC,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,WAAW,GAAG,GAAG,EACjB,SAAS,GAQV;IACC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CACnC,sBAAsB,EACtB;YACE,IAAI;YACJ,MAAM;YACN,KAAK,EAAE,WAAW;YAClB,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC;YAClC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS;SACpC,CACF,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACnB,OAAO;gBACL,MAAM,EAAE,EAAE;gBACV,YAAY,EAAE,KAAK;gBACnB,aAAa,EAAE,KAAK;aACrB,CAAC;QACJ,CAAC;QAED,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC;QAEnC,yDAAyD;QACzD,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK;aAC1B,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;aACxB,MAAM,CAAC,CAAC,IAAI,EAAwC,EAAE,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC;QAExE,OAAO;YACL,MAAM;YACN,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,UAAU,IAAI,SAAS;YACrD,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,UAAU,IAAI,SAAS;YACrD,YAAY,EAAE,QAAQ,CAAC,QAAQ,CAAC,YAAY;YAC5C,aAAa,EAAE,QAAQ,CAAC,QAAQ,CAAC,aAAa;SAC/C,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;QAC3D,OAAO;YACL,MAAM,EAAE,EAAE;YACV,YAAY,EAAE,KAAK;YACnB,aAAa,EAAE,KAAK;SACrB,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { GraphQLClient } from 'graphql-request';
2
+ import type { Imprint } from '@eightyfourthousand/data-access';
3
+ /**
4
+ * Get the imprint for a translation work.
5
+ */
6
+ export declare function getTranslationImprint({ client, uuid, toh, }: {
7
+ client: GraphQLClient;
8
+ uuid: string;
9
+ toh: string;
10
+ }): Promise<Imprint | undefined>;