@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
@@ -1,1297 +0,0 @@
1
- import type { GraphQLClient, RequestOptions } from 'graphql-request';
2
- import gql from 'graphql-tag';
3
- export type Maybe<T> = T | null;
4
- export type InputMaybe<T> = Maybe<T>;
5
- export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
6
- export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
7
- export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
8
- export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
9
- export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
10
- type GraphQLClientRequestHeaders = RequestOptions['requestHeaders'];
11
- /** All built-in and custom scalars, mapped to their actual values */
12
- export type Scalars = {
13
- ID: { input: string; output: string; }
14
- String: { input: string; output: string; }
15
- Boolean: { input: boolean; output: boolean; }
16
- Int: { input: number; output: number; }
17
- Float: { input: number; output: number; }
18
- /** JSON scalar for arbitrary JSON data */
19
- JSON: { input: any; output: any; }
20
- };
21
-
22
- /** An alignment linking a passage to Tibetan source text */
23
- export type Alignment = {
24
- __typename?: 'Alignment';
25
- /** Folio number within the volume */
26
- folioNumber: Scalars['Int']['output'];
27
- /** UUID of the folio containing the Tibetan source */
28
- folioUuid: Scalars['ID']['output'];
29
- /** Tibetan source text content */
30
- tibetan: Scalars['String']['output'];
31
- /** Tohoku catalog reference (e.g., "toh123") */
32
- toh: Scalars['String']['output'];
33
- /** Volume number */
34
- volumeNumber: Scalars['Int']['output'];
35
- };
36
-
37
- /** An annotation marking up a range within a passage */
38
- export type Annotation = {
39
- __typename?: 'Annotation';
40
- /** End offset within the passage content */
41
- end: Scalars['Int']['output'];
42
- /**
43
- * Type-specific metadata. Contents vary by annotation type:
44
- * - heading: { level, class }
45
- * - link: { href, text }
46
- * - internalLink: { linkType, href, label, entity, isPending }
47
- * - span/mantra/inlineTitle: { textStyle, lang }
48
- * - audio: { src, mediaType }
49
- * - image: { src }
50
- * - list: { spacing, nesting, itemStyle }
51
- * - glossaryInstance: { glossary }
52
- * - endNoteLink: { endNote, label }
53
- * - abbreviation/hasAbbreviation: { abbreviation }
54
- * - quote/quoted: { quote }
55
- */
56
- metadata?: Maybe<Scalars['JSON']['output']>;
57
- /** Start offset within the passage content */
58
- start: Scalars['Int']['output'];
59
- /** Tohoku number associated with this annotation, if applicable */
60
- toh?: Maybe<Scalars['String']['output']>;
61
- /** Type of annotation (e.g., heading, span, link, internalLink, glossaryInstance) */
62
- type: Scalars['String']['output'];
63
- /** Unique identifier for the annotation */
64
- uuid: Scalars['ID']['output'];
65
- };
66
-
67
- /** A bibliography section with heading and entries */
68
- export type BibliographyEntry = {
69
- __typename?: 'BibliographyEntry';
70
- /** Bibliography entries in this section */
71
- entries: Array<BibliographyEntryItem>;
72
- /** Section heading */
73
- heading?: Maybe<Scalars['String']['output']>;
74
- };
75
-
76
- /** A single bibliography entry item */
77
- export type BibliographyEntryItem = {
78
- __typename?: 'BibliographyEntryItem';
79
- /** HTML content of the bibliography entry */
80
- html: Scalars['String']['output'];
81
- /** Unique identifier */
82
- uuid: Scalars['ID']['output'];
83
- /** UUID of the work this entry belongs to */
84
- workUuid?: Maybe<Scalars['ID']['output']>;
85
- };
86
-
87
- /** Currently authenticated user */
88
- export type CurrentUser = {
89
- __typename?: 'CurrentUser';
90
- /** User's email address */
91
- email: Scalars['String']['output'];
92
- /** User's unique identifier */
93
- id: Scalars['ID']['output'];
94
- /** User's role */
95
- role: UserRole;
96
- };
97
-
98
- /** A folio page from a Tibetan work */
99
- export type Folio = {
100
- __typename?: 'Folio';
101
- /** Content of the folio */
102
- content: Scalars['String']['output'];
103
- /** Folio number within the volume */
104
- folio: Scalars['Int']['output'];
105
- /** Side of the folio (a or b) */
106
- side: FolioSide;
107
- /** Unique identifier */
108
- uuid: Scalars['ID']['output'];
109
- /** Volume number */
110
- volume: Scalars['Int']['output'];
111
- };
112
-
113
- /** Folio side (recto/verso) */
114
- export type FolioSide =
115
- | 'a'
116
- | 'b';
117
-
118
- /** Paginated passage references for a glossary term */
119
- export type GlossaryPassagesPage = {
120
- __typename?: 'GlossaryPassagesPage';
121
- /** Whether more passages exist beyond this page */
122
- hasMore: Scalars['Boolean']['output'];
123
- /** Passages in this page */
124
- items: Array<Passage>;
125
- /** Cursor for fetching the next page (offset encoded as string), null if no more */
126
- nextCursor?: Maybe<Scalars['String']['output']>;
127
- };
128
-
129
- /** Paginated connection of glossary term instances for a work */
130
- export type GlossaryTermConnection = {
131
- __typename?: 'GlossaryTermConnection';
132
- /** List of glossary term instances in this page */
133
- nodes: Array<GlossaryTermInstance>;
134
- /** Pagination information */
135
- pageInfo: PageInfo;
136
- /** Total number of glossary terms in this work */
137
- totalCount: Scalars['Int']['output'];
138
- };
139
-
140
- /** A glossary term instance within a specific work */
141
- export type GlossaryTermInstance = {
142
- __typename?: 'GlossaryTermInstance';
143
- /** Authority UUID for the term */
144
- authority: Scalars['String']['output'];
145
- /** Definition of the term */
146
- definition?: Maybe<Scalars['String']['output']>;
147
- /** Names in different languages */
148
- names: GlossaryTermNames;
149
- /** Paginated passage references where this term appears */
150
- passages: GlossaryPassagesPage;
151
- /** Absolute position of this term in the work's glossary (1-based) */
152
- termNumber: Scalars['Int']['output'];
153
- /** Unique identifier */
154
- uuid: Scalars['ID']['output'];
155
- };
156
-
157
-
158
- /** A glossary term instance within a specific work */
159
- export type GlossaryTermInstancePassagesArgs = {
160
- after?: InputMaybe<Scalars['String']['input']>;
161
- first?: InputMaybe<Scalars['Int']['input']>;
162
- };
163
-
164
- /** Names for a glossary term instance in different languages */
165
- export type GlossaryTermNames = {
166
- __typename?: 'GlossaryTermNames';
167
- /** Chinese name */
168
- chinese?: Maybe<Scalars['String']['output']>;
169
- /** English name/translation */
170
- english?: Maybe<Scalars['String']['output']>;
171
- /** Pali name */
172
- pali?: Maybe<Scalars['String']['output']>;
173
- /** Sanskrit name */
174
- sanskrit?: Maybe<Scalars['String']['output']>;
175
- /** Tibetan name */
176
- tibetan?: Maybe<Scalars['String']['output']>;
177
- /** Wylie transliteration */
178
- wylie?: Maybe<Scalars['String']['output']>;
179
- };
180
-
181
- /** Health status response */
182
- export type HealthStatus = {
183
- __typename?: 'HealthStatus';
184
- /** Current status of the API (e.g., "ok", "degraded") */
185
- status: Scalars['String']['output'];
186
- /** ISO 8601 timestamp of the health check */
187
- timestamp: Scalars['String']['output'];
188
- };
189
-
190
- /** Publication imprint information for a work */
191
- export type Imprint = {
192
- __typename?: 'Imprint';
193
- /** Whether the authorship is contested */
194
- isAuthorContested: Scalars['Boolean']['output'];
195
- /** License information */
196
- license: License;
197
- /** Long titles by language */
198
- longTitles?: Maybe<TitlesByLanguage>;
199
- /** Main titles by language */
200
- mainTitles?: Maybe<TitlesByLanguage>;
201
- /** Year the translation was published */
202
- publishYear?: Maybe<Scalars['String']['output']>;
203
- /** Publisher statement */
204
- publisherStatement?: Maybe<Scalars['String']['output']>;
205
- /** Whether access to this work is restricted */
206
- restriction?: Maybe<Scalars['Boolean']['output']>;
207
- /** Section of the canon (e.g., "Sutra") */
208
- section?: Maybe<Scalars['String']['output']>;
209
- /** Description of the source text */
210
- sourceDescription?: Maybe<Scalars['String']['output']>;
211
- /** Names of Tibetan authors */
212
- tibetanAuthors?: Maybe<Array<Scalars['String']['output']>>;
213
- /** Names of Tibetan translators */
214
- tibetanTranslators?: Maybe<Scalars['String']['output']>;
215
- /** Tohoku catalog entry number (e.g., "toh1") */
216
- toh: Scalars['String']['output'];
217
- /** Publication version (semantic versioning) */
218
- version?: Maybe<Scalars['String']['output']>;
219
- };
220
-
221
- /** License information for a published work */
222
- export type License = {
223
- __typename?: 'License';
224
- /** Human-readable description of the license terms */
225
- description?: Maybe<Scalars['String']['output']>;
226
- /** URL to the license text */
227
- link?: Maybe<Scalars['String']['output']>;
228
- /** Name of the license (e.g., "CC BY-NC-ND 4.0") */
229
- name?: Maybe<Scalars['String']['output']>;
230
- };
231
-
232
- /** Root Mutation type - extend this in other schema files */
233
- export type Mutation = {
234
- __typename?: 'Mutation';
235
- /** Placeholder for schema validation - not used */
236
- _empty?: Maybe<Scalars['Boolean']['output']>;
237
- /**
238
- * Replace text within one or more targets.
239
- * Requires editor.edit permission.
240
- */
241
- replace: ReplaceResult;
242
- /**
243
- * Save one or more passages.
244
- * Requires editor.edit permission.
245
- */
246
- savePassages: SavePassagesResult;
247
- };
248
-
249
-
250
- /** Root Mutation type - extend this in other schema files */
251
- export type MutationReplaceArgs = {
252
- cursorPassageUuid?: InputMaybe<Scalars['ID']['input']>;
253
- cursorStart?: InputMaybe<Scalars['Int']['input']>;
254
- occurrenceIndex?: InputMaybe<Scalars['Int']['input']>;
255
- replaceText: Scalars['String']['input'];
256
- searchText: Scalars['String']['input'];
257
- targetUuids: Array<Scalars['ID']['input']>;
258
- type?: InputMaybe<ReplaceType>;
259
- };
260
-
261
-
262
- /** Root Mutation type - extend this in other schema files */
263
- export type MutationSavePassagesArgs = {
264
- deletedUuids?: InputMaybe<Array<Scalars['ID']['input']>>;
265
- passages: Array<PassageInput>;
266
- };
267
-
268
- /**
269
- * Pagination information for connections.
270
- * Used consistently across all paginated queries.
271
- */
272
- export type PageInfo = {
273
- __typename?: 'PageInfo';
274
- /** Whether there are more items after the current page */
275
- hasMoreAfter: Scalars['Boolean']['output'];
276
- /** Whether there are more items before the current page */
277
- hasMoreBefore: Scalars['Boolean']['output'];
278
- /** Cursor for fetching the next page */
279
- nextCursor?: Maybe<Scalars['String']['output']>;
280
- /** Cursor for fetching the previous page */
281
- prevCursor?: Maybe<Scalars['String']['output']>;
282
- };
283
-
284
- /** Direction for pagination */
285
- export type PaginationDirection =
286
- /** Fetch passages around the cursor (both before and after) */
287
- | 'AROUND'
288
- /** Fetch passages before the cursor */
289
- | 'BACKWARD'
290
- /** Fetch passages after the cursor (default) */
291
- | 'FORWARD';
292
-
293
- /** A passage of text from a work */
294
- export type Passage = {
295
- __typename?: 'Passage';
296
- /** Alignments linking this passage to Tibetan source text */
297
- alignments: Array<Alignment>;
298
- /** Annotations marking up ranges within this passage */
299
- annotations: Array<Annotation>;
300
- /** Text content of the passage */
301
- content: Scalars['String']['output'];
302
- /**
303
- * TipTap editor JSON representation of this passage.
304
- * Transforms content and annotations into nested JSON structure.
305
- */
306
- json?: Maybe<Scalars['JSON']['output']>;
307
- /** Display label for the passage (e.g., "1.1") */
308
- label?: Maybe<Scalars['String']['output']>;
309
- /**
310
- * Passages that reference this endnote passage via end-note-link annotations.
311
- * Only populated for endnotes type passages; empty for all other types.
312
- */
313
- references: Array<Passage>;
314
- /** Sort order within the work */
315
- sort: Scalars['Int']['output'];
316
- /** Tohoku number associated with this passage, if applicable */
317
- toh?: Maybe<Scalars['String']['output']>;
318
- /** Type of passage content (e.g., translation, introduction, colophon) */
319
- type: Scalars['String']['output'];
320
- /** Unique identifier for the passage */
321
- uuid: Scalars['ID']['output'];
322
- /** UUID of the work this passage belongs to */
323
- workUuid: Scalars['ID']['output'];
324
- /** The Legacy XML ID from the source document */
325
- xmlId?: Maybe<Scalars['String']['output']>;
326
- };
327
-
328
- /** Paginated connection of passages */
329
- export type PassageConnection = {
330
- __typename?: 'PassageConnection';
331
- /**
332
- * Whether there are more passages after the current page
333
- * @deprecated Use pageInfo.hasMoreAfter instead
334
- */
335
- hasMoreAfter: Scalars['Boolean']['output'];
336
- /**
337
- * Whether there are more passages before the current page
338
- * @deprecated Use pageInfo.hasMoreBefore instead
339
- */
340
- hasMoreBefore: Scalars['Boolean']['output'];
341
- /**
342
- * Cursor for fetching the next page
343
- * @deprecated Use pageInfo.nextCursor instead
344
- */
345
- nextCursor?: Maybe<Scalars['String']['output']>;
346
- /** List of passages */
347
- nodes: Array<Passage>;
348
- /** Pagination information */
349
- pageInfo: PageInfo;
350
- /**
351
- * Cursor for fetching the previous page
352
- * @deprecated Use pageInfo.prevCursor instead
353
- */
354
- prevCursor?: Maybe<Scalars['String']['output']>;
355
- };
356
-
357
- /** Filter options for passages */
358
- export type PassageFilter = {
359
- /** Filter by label pattern using ILIKE (e.g., "n.5%") */
360
- label?: InputMaybe<Scalars['String']['input']>;
361
- /**
362
- * Filter by passage type (e.g., translation, introduction, colophon).
363
- * Can be a single type or use LIKE pattern with %.
364
- */
365
- type?: InputMaybe<Scalars['String']['input']>;
366
- /**
367
- * Filter by multiple passage types (OR logic).
368
- * Use this instead of type when filtering by multiple types.
369
- */
370
- types?: InputMaybe<Array<Scalars['String']['input']>>;
371
- };
372
-
373
- /** Input type for saving a passage */
374
- export type PassageInput = {
375
- /** Annotations as JSON array */
376
- annotations: Scalars['JSON']['input'];
377
- /** Text content of the passage */
378
- content: Scalars['String']['input'];
379
- /** Display label for the passage */
380
- label: Scalars['String']['input'];
381
- /** Sort order within the work */
382
- sort: Scalars['Int']['input'];
383
- /** Type of passage content */
384
- type: Scalars['String']['input'];
385
- /** Unique identifier for the passage */
386
- uuid: Scalars['ID']['input'];
387
- /** UUID of the work this passage belongs to */
388
- workUuid: Scalars['ID']['input'];
389
- /** The Legacy XML ID from the source document */
390
- xmlId?: InputMaybe<Scalars['String']['input']>;
391
- };
392
-
393
- /** Permission types that can be checked */
394
- export type Permission =
395
- | 'EDITOR_ADMIN'
396
- | 'EDITOR_EDIT'
397
- | 'EDITOR_READ'
398
- | 'PROJECTS_ADMIN'
399
- | 'PROJECTS_EDIT'
400
- | 'PROJECTS_READ';
401
-
402
- /** Root Query type - extend this in other schema files */
403
- export type Query = {
404
- __typename?: 'Query';
405
- /** Get a single bibliography entry by UUID */
406
- bibliographyEntry?: Maybe<BibliographyEntryItem>;
407
- /** Get a single glossary instance by UUID */
408
- glossaryInstance?: Maybe<GlossaryTermInstance>;
409
- /** Get paginated passage references for a glossary term (per-term, on-demand) */
410
- glossaryTermPassages: GlossaryPassagesPage;
411
- /**
412
- * Check if the current user has a specific permission.
413
- * Returns false if not authenticated.
414
- */
415
- hasPermission: Scalars['Boolean']['output'];
416
- /** Health check query */
417
- health: HealthStatus;
418
- /** Get the currently authenticated user (null if not authenticated) */
419
- me?: Maybe<CurrentUser>;
420
- /**
421
- * Fetch a single passage by UUID or XML ID.
422
- * At least one of uuid or legacy xmlId must be provided. Prefers uuid if both are present.
423
- */
424
- passage?: Maybe<Passage>;
425
- /** Get the current API version */
426
- version: Scalars['String']['output'];
427
- /**
428
- * Get a single work by UUID or Tohoku catalog number.
429
- * When both uuid and toh are provided, toh acts as a composite key
430
- * and will be used as the default for nested resolvers (like imprint).
431
- */
432
- work?: Maybe<Work>;
433
- /** Get paginated published translation works */
434
- works: WorkConnection;
435
- };
436
-
437
-
438
- /** Root Query type - extend this in other schema files */
439
- export type QueryBibliographyEntryArgs = {
440
- uuid: Scalars['ID']['input'];
441
- };
442
-
443
-
444
- /** Root Query type - extend this in other schema files */
445
- export type QueryGlossaryInstanceArgs = {
446
- uuid: Scalars['ID']['input'];
447
- };
448
-
449
-
450
- /** Root Query type - extend this in other schema files */
451
- export type QueryGlossaryTermPassagesArgs = {
452
- after?: InputMaybe<Scalars['String']['input']>;
453
- first?: InputMaybe<Scalars['Int']['input']>;
454
- uuid: Scalars['ID']['input'];
455
- };
456
-
457
-
458
- /** Root Query type - extend this in other schema files */
459
- export type QueryHasPermissionArgs = {
460
- permission: Permission;
461
- };
462
-
463
-
464
- /** Root Query type - extend this in other schema files */
465
- export type QueryPassageArgs = {
466
- uuid?: InputMaybe<Scalars['ID']['input']>;
467
- xmlId?: InputMaybe<Scalars['String']['input']>;
468
- };
469
-
470
-
471
- /** Root Query type - extend this in other schema files */
472
- export type QueryWorkArgs = {
473
- toh?: InputMaybe<Scalars['String']['input']>;
474
- uuid?: InputMaybe<Scalars['ID']['input']>;
475
- };
476
-
477
-
478
- /** Root Query type - extend this in other schema files */
479
- export type QueryWorksArgs = {
480
- cursor?: InputMaybe<Scalars['String']['input']>;
481
- filter?: InputMaybe<WorkFilter>;
482
- limit?: InputMaybe<Scalars['Int']['input']>;
483
- };
484
-
485
- /** Result of a replace mutation */
486
- export type ReplaceResult = {
487
- __typename?: 'ReplaceResult';
488
- /** Number of annotations deleted because the replacement removed them */
489
- deletedAnnotationCount: Scalars['Int']['output'];
490
- /** Error message if the replace failed */
491
- error?: Maybe<Scalars['String']['output']>;
492
- /** Character offset within nextPassageUuid where the next single replace should continue */
493
- nextOccurrenceStart?: Maybe<Scalars['Int']['output']>;
494
- /** Passage UUID after which the next single replace should continue */
495
- nextPassageUuid?: Maybe<Scalars['ID']['output']>;
496
- /** Updated target passages for client-side refresh */
497
- passages: Array<Passage>;
498
- /** Number of occurrences replaced */
499
- replacedOccurrenceCount: Scalars['Int']['output'];
500
- /** Whether the replace was successful */
501
- success: Scalars['Boolean']['output'];
502
- /** Number of annotations whose ranges changed */
503
- updatedAnnotationCount: Scalars['Int']['output'];
504
- /** Number of target records updated */
505
- updatedCount: Scalars['Int']['output'];
506
- };
507
-
508
- /** Supported target types for search-and-replace operations */
509
- export type ReplaceType =
510
- | 'PASSAGE';
511
-
512
- /** Result of saving passages */
513
- export type SavePassagesResult = {
514
- __typename?: 'SavePassagesResult';
515
- /** Number of passages deleted */
516
- deletedCount?: Maybe<Scalars['Int']['output']>;
517
- /** Error message if the save failed */
518
- error?: Maybe<Scalars['String']['output']>;
519
- /** Number of passages saved */
520
- savedCount: Scalars['Int']['output'];
521
- /** Whether the save was successful */
522
- success: Scalars['Boolean']['output'];
523
- };
524
-
525
- /** A title of a work in a specific language */
526
- export type Title = {
527
- __typename?: 'Title';
528
- /** The title text content */
529
- content: Scalars['String']['output'];
530
- /** Language code (e.g., "en", "bo", "Sa-Ltn", "Bo-Ltn") */
531
- language: Scalars['String']['output'];
532
- /** Type of title (e.g., "mainTitle", "longTitle", "otherTitle", "toh", "shortcode") */
533
- type: Scalars['String']['output'];
534
- /** Unique identifier for the title */
535
- uuid: Scalars['ID']['output'];
536
- };
537
-
538
- /** Titles grouped by language */
539
- export type TitlesByLanguage = {
540
- __typename?: 'TitlesByLanguage';
541
- /** English title */
542
- english?: Maybe<Scalars['String']['output']>;
543
- /** Sanskrit title */
544
- sanskrit?: Maybe<Scalars['String']['output']>;
545
- /** Tibetan title */
546
- tibetan?: Maybe<Scalars['String']['output']>;
547
- /** Wylie transliteration of Tibetan title */
548
- wylie?: Maybe<Scalars['String']['output']>;
549
- };
550
-
551
- /** Table of contents for a work, organized by major sections */
552
- export type Toc = {
553
- __typename?: 'Toc';
554
- /** Back matter entries (endnotes, abbreviations) */
555
- backMatter: Array<TocEntry>;
556
- /** Body entries (homage, translation, colophon, etc.) */
557
- body: Array<TocEntry>;
558
- /** Front matter entries (acknowledgment, introduction, summary) */
559
- frontMatter: Array<TocEntry>;
560
- };
561
-
562
- /**
563
- * A hierarchical entry in a work's table of contents.
564
- *
565
- * This is a recursive type - each entry can contain nested children entries.
566
- * Due to GraphQL's explicit nesting requirement, queries must specify the
567
- * desired depth using fragments.
568
- *
569
- * Example query for 3 levels deep:
570
- * fragment TocFields on TocEntry {
571
- * uuid
572
- * content
573
- * label
574
- * level
575
- * }
576
- *
577
- * query {
578
- * work(uuid: "...") {
579
- * toc {
580
- * frontMatter {
581
- * ...TocFields
582
- * children {
583
- * ...TocFields
584
- * children {
585
- * ...TocFields
586
- * }
587
- * }
588
- * }
589
- * }
590
- * }
591
- * }
592
- *
593
- * Maximum query depth is limited to 12 levels.
594
- */
595
- export type TocEntry = {
596
- __typename?: 'TocEntry';
597
- /**
598
- * Child entries nested under this entry.
599
- * Must be explicitly queried to desired depth using fragments.
600
- */
601
- children: Array<TocEntry>;
602
- /** Content of the TOC entry (title/heading) */
603
- content: Scalars['String']['output'];
604
- /** Optional label for the entry */
605
- label?: Maybe<Scalars['String']['output']>;
606
- /** Nesting level (1 for top level, 2+ for nested) */
607
- level: Scalars['Int']['output'];
608
- /** Section type (e.g., "introduction", "translation", "colophon") */
609
- section: Scalars['String']['output'];
610
- /** Sort order within the section */
611
- sort: Scalars['Int']['output'];
612
- /** Unique identifier for the passage */
613
- uuid: Scalars['ID']['output'];
614
- };
615
-
616
- /** User role levels */
617
- export type UserRole =
618
- | 'ADMIN'
619
- | 'EDITOR'
620
- | 'READER'
621
- | 'SCHOLAR'
622
- | 'TRANSLATOR';
623
-
624
- /** A published translation work from the 84000 canon */
625
- export type Work = {
626
- __typename?: 'Work';
627
- /** Bibliography entries for this work, grouped by section */
628
- bibliography: Array<BibliographyEntry>;
629
- /** Folios for this work, filtered by toh and paginated */
630
- folios: Array<Folio>;
631
- /**
632
- * Glossary term instances for this work
633
- * @deprecated Use glossaryTerms for paginated access
634
- */
635
- glossary: Array<GlossaryTermInstance>;
636
- /** Paginated glossary term instances for this work */
637
- glossaryTerms: GlossaryTermConnection;
638
- /**
639
- * Publication imprint information.
640
- * If the work query specified a toh argument, that value will be used.
641
- * Otherwise, imprint for the first toh in the work is returned.
642
- */
643
- imprint?: Maybe<Imprint>;
644
- /** Number of source pages */
645
- pages: Scalars['Int']['output'];
646
- /** Paginated passages from this work */
647
- passages: PassageConnection;
648
- /** Date the work was published */
649
- publicationDate?: Maybe<Scalars['String']['output']>;
650
- /** Semantic version of the publication (e.g., "1.0.0") */
651
- publicationVersion: Scalars['String']['output'];
652
- /** Whether access to this work is restricted */
653
- restriction: Scalars['Boolean']['output'];
654
- /** Section of the canon this work belongs to */
655
- section: Scalars['String']['output'];
656
- /** Title of the work */
657
- title: Scalars['String']['output'];
658
- /** All titles associated with this work, in various languages and types */
659
- titles: Array<Title>;
660
- /**
661
- * Table of contents for the work, organized by major sections.
662
- * Returns a recursive tree structure up to 12 levels deep.
663
- * See the TocEntry type documentation for query examples.
664
- */
665
- toc?: Maybe<Toc>;
666
- /** Tohoku catalog entry numbers (e.g., ["toh1", "toh2"]) */
667
- toh: Array<Scalars['String']['output']>;
668
- /** Unique identifier for the work */
669
- uuid: Scalars['ID']['output'];
670
- };
671
-
672
-
673
- /** A published translation work from the 84000 canon */
674
- export type WorkFoliosArgs = {
675
- page?: InputMaybe<Scalars['Int']['input']>;
676
- size?: InputMaybe<Scalars['Int']['input']>;
677
- toh: Scalars['String']['input'];
678
- };
679
-
680
-
681
- /** A published translation work from the 84000 canon */
682
- export type WorkGlossaryArgs = {
683
- withAttestations?: InputMaybe<Scalars['Boolean']['input']>;
684
- };
685
-
686
-
687
- /** A published translation work from the 84000 canon */
688
- export type WorkGlossaryTermsArgs = {
689
- cursor?: InputMaybe<Scalars['String']['input']>;
690
- direction?: InputMaybe<PaginationDirection>;
691
- limit?: InputMaybe<Scalars['Int']['input']>;
692
- withAttestations?: InputMaybe<Scalars['Boolean']['input']>;
693
- };
694
-
695
-
696
- /** A published translation work from the 84000 canon */
697
- export type WorkPassagesArgs = {
698
- cursor?: InputMaybe<Scalars['String']['input']>;
699
- direction?: InputMaybe<PaginationDirection>;
700
- filter?: InputMaybe<PassageFilter>;
701
- limit?: InputMaybe<Scalars['Int']['input']>;
702
- };
703
-
704
- /** Connection type for paginated works */
705
- export type WorkConnection = {
706
- __typename?: 'WorkConnection';
707
- /** List of works in this page */
708
- items: Array<Work>;
709
- /** Pagination information */
710
- pageInfo: PageInfo;
711
- /** Total count of works matching the query */
712
- totalCount: Scalars['Int']['output'];
713
- };
714
-
715
- /** Filter criteria for works query */
716
- export type WorkFilter = {
717
- /** Maximum number of source pages (exclusive). Only return works with fewer pages than this value. */
718
- maxPages?: InputMaybe<Scalars['Int']['input']>;
719
- };
720
-
721
- export type AlignmentFieldsFragment = { __typename?: 'Alignment', folioUuid: string, toh: string, tibetan: string, folioNumber: number, volumeNumber: number };
722
-
723
- export type AnnotationFieldsFragment = { __typename?: 'Annotation', uuid: string, type: string, start: number, end: number, metadata?: any | null };
724
-
725
- export type LicenseFieldsFragment = { __typename?: 'License', name?: string | null, link?: string | null, description?: string | null };
726
-
727
- export type TitlesByLanguageFieldsFragment = { __typename?: 'TitlesByLanguage', tibetan?: string | null, english?: string | null, wylie?: string | null, sanskrit?: string | null };
728
-
729
- export type ImprintFieldsFragment = { __typename?: 'Imprint', toh: string, section?: string | null, version?: string | null, restriction?: boolean | null, publishYear?: string | null, tibetanAuthors?: Array<string> | null, isAuthorContested: boolean, sourceDescription?: string | null, publisherStatement?: string | null, tibetanTranslators?: string | null, license: (
730
- { __typename?: 'License' }
731
- & LicenseFieldsFragment
732
- ), mainTitles?: (
733
- { __typename?: 'TitlesByLanguage' }
734
- & TitlesByLanguageFieldsFragment
735
- ) | null, longTitles?: (
736
- { __typename?: 'TitlesByLanguage' }
737
- & TitlesByLanguageFieldsFragment
738
- ) | null };
739
-
740
- export type PassageFieldsFragment = { __typename?: 'Passage', uuid: string, workUuid: string, content: string, label?: string | null, sort: number, type: string, xmlId?: string | null };
741
-
742
- export type PassageWithAnnotationsFragment = (
743
- { __typename?: 'Passage', annotations: Array<(
744
- { __typename?: 'Annotation' }
745
- & AnnotationFieldsFragment
746
- )>, alignments: Array<(
747
- { __typename?: 'Alignment' }
748
- & AlignmentFieldsFragment
749
- )> }
750
- & PassageFieldsFragment
751
- );
752
-
753
- export type PassageWithJsonFragment = { __typename?: 'Passage', uuid: string, workUuid: string, label?: string | null, sort: number, type: string, xmlId?: string | null, json?: any | null };
754
-
755
- export type TitleFieldsFragment = { __typename?: 'Title', uuid: string, content: string, language: string, type: string };
756
-
757
- export type TocEntryFieldsFragment = { __typename?: 'TocEntry', uuid: string, content: string, label?: string | null, sort: number, level: number, section: string };
758
-
759
- export type TocEntryNestedFragment = (
760
- { __typename?: 'TocEntry', children: Array<(
761
- { __typename?: 'TocEntry', children: Array<(
762
- { __typename?: 'TocEntry', children: Array<(
763
- { __typename?: 'TocEntry', children: Array<(
764
- { __typename?: 'TocEntry', children: Array<(
765
- { __typename?: 'TocEntry' }
766
- & TocEntryFieldsFragment
767
- )> }
768
- & TocEntryFieldsFragment
769
- )> }
770
- & TocEntryFieldsFragment
771
- )> }
772
- & TocEntryFieldsFragment
773
- )> }
774
- & TocEntryFieldsFragment
775
- )> }
776
- & TocEntryFieldsFragment
777
- );
778
-
779
- export type TocFieldsFragment = { __typename?: 'Toc', frontMatter: Array<(
780
- { __typename?: 'TocEntry' }
781
- & TocEntryNestedFragment
782
- )>, body: Array<(
783
- { __typename?: 'TocEntry' }
784
- & TocEntryNestedFragment
785
- )>, backMatter: Array<(
786
- { __typename?: 'TocEntry' }
787
- & TocEntryNestedFragment
788
- )> };
789
-
790
- export type WorkFieldsFragment = { __typename?: 'Work', uuid: string, title: string, toh: Array<string>, publicationDate?: string | null, publicationVersion: string, pages: number, restriction: boolean, section: string };
791
-
792
- export type GetPassagesQueryVariables = Exact<{
793
- uuid: Scalars['ID']['input'];
794
- cursor?: InputMaybe<Scalars['String']['input']>;
795
- limit?: InputMaybe<Scalars['Int']['input']>;
796
- direction?: InputMaybe<PaginationDirection>;
797
- filter?: InputMaybe<PassageFilter>;
798
- }>;
799
-
800
-
801
- export type GetPassagesQuery = { __typename?: 'Query', work?: { __typename?: 'Work', uuid: string, passages: { __typename?: 'PassageConnection', nodes: Array<(
802
- { __typename?: 'Passage' }
803
- & PassageWithAnnotationsFragment
804
- )>, pageInfo: { __typename?: 'PageInfo', nextCursor?: string | null, prevCursor?: string | null, hasMoreAfter: boolean, hasMoreBefore: boolean } } } | null };
805
-
806
- export type GetPassagesBasicQueryVariables = Exact<{
807
- uuid: Scalars['ID']['input'];
808
- cursor?: InputMaybe<Scalars['String']['input']>;
809
- limit?: InputMaybe<Scalars['Int']['input']>;
810
- direction?: InputMaybe<PaginationDirection>;
811
- filter?: InputMaybe<PassageFilter>;
812
- }>;
813
-
814
-
815
- export type GetPassagesBasicQuery = { __typename?: 'Query', work?: { __typename?: 'Work', uuid: string, passages: { __typename?: 'PassageConnection', nodes: Array<(
816
- { __typename?: 'Passage' }
817
- & PassageFieldsFragment
818
- )>, pageInfo: { __typename?: 'PageInfo', nextCursor?: string | null, prevCursor?: string | null, hasMoreAfter: boolean, hasMoreBefore: boolean } } } | null };
819
-
820
- export type GetPassagesWithJsonQueryVariables = Exact<{
821
- uuid: Scalars['ID']['input'];
822
- cursor?: InputMaybe<Scalars['String']['input']>;
823
- limit?: InputMaybe<Scalars['Int']['input']>;
824
- direction?: InputMaybe<PaginationDirection>;
825
- filter?: InputMaybe<PassageFilter>;
826
- }>;
827
-
828
-
829
- export type GetPassagesWithJsonQuery = { __typename?: 'Query', work?: { __typename?: 'Work', uuid: string, passages: { __typename?: 'PassageConnection', nodes: Array<(
830
- { __typename?: 'Passage' }
831
- & PassageWithJsonFragment
832
- )>, pageInfo: { __typename?: 'PageInfo', nextCursor?: string | null, prevCursor?: string | null, hasMoreAfter: boolean, hasMoreBefore: boolean } } } | null };
833
-
834
- export type GetPassagesAroundWithJsonQueryVariables = Exact<{
835
- uuid: Scalars['ID']['input'];
836
- cursor: Scalars['String']['input'];
837
- limit?: InputMaybe<Scalars['Int']['input']>;
838
- filter?: InputMaybe<PassageFilter>;
839
- }>;
840
-
841
-
842
- export type GetPassagesAroundWithJsonQuery = { __typename?: 'Query', work?: { __typename?: 'Work', uuid: string, passages: { __typename?: 'PassageConnection', nodes: Array<(
843
- { __typename?: 'Passage' }
844
- & PassageWithJsonFragment
845
- )>, pageInfo: { __typename?: 'PageInfo', nextCursor?: string | null, prevCursor?: string | null, hasMoreAfter: boolean, hasMoreBefore: boolean } } } | null };
846
-
847
- export type GetPassageQueryVariables = Exact<{
848
- uuid?: InputMaybe<Scalars['ID']['input']>;
849
- xmlId?: InputMaybe<Scalars['String']['input']>;
850
- }>;
851
-
852
-
853
- export type GetPassageQuery = { __typename?: 'Query', passage?: (
854
- { __typename?: 'Passage' }
855
- & PassageWithAnnotationsFragment
856
- ) | null };
857
-
858
- export type GetWorkByUuidQueryVariables = Exact<{
859
- uuid: Scalars['ID']['input'];
860
- }>;
861
-
862
-
863
- export type GetWorkByUuidQuery = { __typename?: 'Query', work?: (
864
- { __typename?: 'Work' }
865
- & WorkFieldsFragment
866
- ) | null };
867
-
868
- export type GetWorkByTohQueryVariables = Exact<{
869
- toh: Scalars['String']['input'];
870
- }>;
871
-
872
-
873
- export type GetWorkByTohQuery = { __typename?: 'Query', work?: (
874
- { __typename?: 'Work' }
875
- & WorkFieldsFragment
876
- ) | null };
877
-
878
- export type GetWorkWithTitlesQueryVariables = Exact<{
879
- uuid: Scalars['ID']['input'];
880
- }>;
881
-
882
-
883
- export type GetWorkWithTitlesQuery = { __typename?: 'Query', work?: (
884
- { __typename?: 'Work', titles: Array<(
885
- { __typename?: 'Title' }
886
- & TitleFieldsFragment
887
- )> }
888
- & WorkFieldsFragment
889
- ) | null };
890
-
891
- export type GetWorkWithImprintQueryVariables = Exact<{
892
- uuid: Scalars['ID']['input'];
893
- toh?: InputMaybe<Scalars['String']['input']>;
894
- }>;
895
-
896
-
897
- export type GetWorkWithImprintQuery = { __typename?: 'Query', work?: (
898
- { __typename?: 'Work', imprint?: (
899
- { __typename?: 'Imprint' }
900
- & ImprintFieldsFragment
901
- ) | null }
902
- & WorkFieldsFragment
903
- ) | null };
904
-
905
- export type GetWorkWithTocQueryVariables = Exact<{
906
- uuid: Scalars['ID']['input'];
907
- }>;
908
-
909
-
910
- export type GetWorkWithTocQuery = { __typename?: 'Query', work?: (
911
- { __typename?: 'Work', toc?: (
912
- { __typename?: 'Toc' }
913
- & TocFieldsFragment
914
- ) | null }
915
- & WorkFieldsFragment
916
- ) | null };
917
-
918
- export type GetAllWorksQueryVariables = Exact<{
919
- cursor?: InputMaybe<Scalars['String']['input']>;
920
- limit?: InputMaybe<Scalars['Int']['input']>;
921
- }>;
922
-
923
-
924
- export type GetAllWorksQuery = { __typename?: 'Query', works: { __typename?: 'WorkConnection', items: Array<(
925
- { __typename?: 'Work' }
926
- & WorkFieldsFragment
927
- )>, pageInfo: { __typename?: 'PageInfo', nextCursor?: string | null, hasMoreAfter: boolean } } };
928
-
929
- export type GetWorkUuidsQueryVariables = Exact<{
930
- cursor?: InputMaybe<Scalars['String']['input']>;
931
- limit?: InputMaybe<Scalars['Int']['input']>;
932
- }>;
933
-
934
-
935
- export type GetWorkUuidsQuery = { __typename?: 'Query', works: { __typename?: 'WorkConnection', items: Array<{ __typename?: 'Work', uuid: string }>, pageInfo: { __typename?: 'PageInfo', nextCursor?: string | null, hasMoreAfter: boolean } } };
936
-
937
- export const LicenseFieldsFragmentDoc = gql`
938
- fragment LicenseFields on License {
939
- name
940
- link
941
- description
942
- }
943
- `;
944
- export const TitlesByLanguageFieldsFragmentDoc = gql`
945
- fragment TitlesByLanguageFields on TitlesByLanguage {
946
- tibetan
947
- english
948
- wylie
949
- sanskrit
950
- }
951
- `;
952
- export const ImprintFieldsFragmentDoc = gql`
953
- fragment ImprintFields on Imprint {
954
- toh
955
- section
956
- version
957
- restriction
958
- publishYear
959
- tibetanAuthors
960
- isAuthorContested
961
- sourceDescription
962
- publisherStatement
963
- tibetanTranslators
964
- license {
965
- ...LicenseFields
966
- }
967
- mainTitles {
968
- ...TitlesByLanguageFields
969
- }
970
- longTitles {
971
- ...TitlesByLanguageFields
972
- }
973
- }
974
- `;
975
- export const PassageFieldsFragmentDoc = gql`
976
- fragment PassageFields on Passage {
977
- uuid
978
- workUuid
979
- content
980
- label
981
- sort
982
- type
983
- xmlId
984
- }
985
- `;
986
- export const AnnotationFieldsFragmentDoc = gql`
987
- fragment AnnotationFields on Annotation {
988
- uuid
989
- type
990
- start
991
- end
992
- metadata
993
- }
994
- `;
995
- export const AlignmentFieldsFragmentDoc = gql`
996
- fragment AlignmentFields on Alignment {
997
- folioUuid
998
- toh
999
- tibetan
1000
- folioNumber
1001
- volumeNumber
1002
- }
1003
- `;
1004
- export const PassageWithAnnotationsFragmentDoc = gql`
1005
- fragment PassageWithAnnotations on Passage {
1006
- ...PassageFields
1007
- annotations {
1008
- ...AnnotationFields
1009
- }
1010
- alignments {
1011
- ...AlignmentFields
1012
- }
1013
- }
1014
- `;
1015
- export const PassageWithJsonFragmentDoc = gql`
1016
- fragment PassageWithJson on Passage {
1017
- uuid
1018
- workUuid
1019
- label
1020
- sort
1021
- type
1022
- xmlId
1023
- json
1024
- }
1025
- `;
1026
- export const TitleFieldsFragmentDoc = gql`
1027
- fragment TitleFields on Title {
1028
- uuid
1029
- content
1030
- language
1031
- type
1032
- }
1033
- `;
1034
- export const TocEntryFieldsFragmentDoc = gql`
1035
- fragment TocEntryFields on TocEntry {
1036
- uuid
1037
- content
1038
- label
1039
- sort
1040
- level
1041
- section
1042
- }
1043
- `;
1044
- export const TocEntryNestedFragmentDoc = gql`
1045
- fragment TocEntryNested on TocEntry {
1046
- ...TocEntryFields
1047
- children {
1048
- ...TocEntryFields
1049
- children {
1050
- ...TocEntryFields
1051
- children {
1052
- ...TocEntryFields
1053
- children {
1054
- ...TocEntryFields
1055
- children {
1056
- ...TocEntryFields
1057
- }
1058
- }
1059
- }
1060
- }
1061
- }
1062
- }
1063
- `;
1064
- export const TocFieldsFragmentDoc = gql`
1065
- fragment TocFields on Toc {
1066
- frontMatter {
1067
- ...TocEntryNested
1068
- }
1069
- body {
1070
- ...TocEntryNested
1071
- }
1072
- backMatter {
1073
- ...TocEntryNested
1074
- }
1075
- }
1076
- `;
1077
- export const WorkFieldsFragmentDoc = gql`
1078
- fragment WorkFields on Work {
1079
- uuid
1080
- title
1081
- toh
1082
- publicationDate
1083
- publicationVersion
1084
- pages
1085
- restriction
1086
- section
1087
- }
1088
- `;
1089
- export const GetPassagesDocument = gql`
1090
- query GetPassages($uuid: ID!, $cursor: String, $limit: Int, $direction: PaginationDirection, $filter: PassageFilter) {
1091
- work(uuid: $uuid) {
1092
- uuid
1093
- passages(cursor: $cursor, limit: $limit, direction: $direction, filter: $filter) {
1094
- nodes {
1095
- ...PassageWithAnnotations
1096
- }
1097
- pageInfo {
1098
- nextCursor
1099
- prevCursor
1100
- hasMoreAfter
1101
- hasMoreBefore
1102
- }
1103
- }
1104
- }
1105
- }
1106
- ${PassageWithAnnotationsFragmentDoc}
1107
- ${PassageFieldsFragmentDoc}
1108
- ${AnnotationFieldsFragmentDoc}
1109
- ${AlignmentFieldsFragmentDoc}`;
1110
- export const GetPassagesBasicDocument = gql`
1111
- query GetPassagesBasic($uuid: ID!, $cursor: String, $limit: Int, $direction: PaginationDirection, $filter: PassageFilter) {
1112
- work(uuid: $uuid) {
1113
- uuid
1114
- passages(cursor: $cursor, limit: $limit, direction: $direction, filter: $filter) {
1115
- nodes {
1116
- ...PassageFields
1117
- }
1118
- pageInfo {
1119
- nextCursor
1120
- prevCursor
1121
- hasMoreAfter
1122
- hasMoreBefore
1123
- }
1124
- }
1125
- }
1126
- }
1127
- ${PassageFieldsFragmentDoc}`;
1128
- export const GetPassagesWithJsonDocument = gql`
1129
- query GetPassagesWithJson($uuid: ID!, $cursor: String, $limit: Int, $direction: PaginationDirection, $filter: PassageFilter) {
1130
- work(uuid: $uuid) {
1131
- uuid
1132
- passages(cursor: $cursor, limit: $limit, direction: $direction, filter: $filter) {
1133
- nodes {
1134
- ...PassageWithJson
1135
- }
1136
- pageInfo {
1137
- nextCursor
1138
- prevCursor
1139
- hasMoreAfter
1140
- hasMoreBefore
1141
- }
1142
- }
1143
- }
1144
- }
1145
- ${PassageWithJsonFragmentDoc}`;
1146
- export const GetPassagesAroundWithJsonDocument = gql`
1147
- query GetPassagesAroundWithJson($uuid: ID!, $cursor: String!, $limit: Int, $filter: PassageFilter) {
1148
- work(uuid: $uuid) {
1149
- uuid
1150
- passages(cursor: $cursor, limit: $limit, direction: AROUND, filter: $filter) {
1151
- nodes {
1152
- ...PassageWithJson
1153
- }
1154
- pageInfo {
1155
- nextCursor
1156
- prevCursor
1157
- hasMoreAfter
1158
- hasMoreBefore
1159
- }
1160
- }
1161
- }
1162
- }
1163
- ${PassageWithJsonFragmentDoc}`;
1164
- export const GetPassageDocument = gql`
1165
- query GetPassage($uuid: ID, $xmlId: String) {
1166
- passage(uuid: $uuid, xmlId: $xmlId) {
1167
- ...PassageWithAnnotations
1168
- }
1169
- }
1170
- ${PassageWithAnnotationsFragmentDoc}
1171
- ${PassageFieldsFragmentDoc}
1172
- ${AnnotationFieldsFragmentDoc}
1173
- ${AlignmentFieldsFragmentDoc}`;
1174
- export const GetWorkByUuidDocument = gql`
1175
- query GetWorkByUuid($uuid: ID!) {
1176
- work(uuid: $uuid) {
1177
- ...WorkFields
1178
- }
1179
- }
1180
- ${WorkFieldsFragmentDoc}`;
1181
- export const GetWorkByTohDocument = gql`
1182
- query GetWorkByToh($toh: String!) {
1183
- work(toh: $toh) {
1184
- ...WorkFields
1185
- }
1186
- }
1187
- ${WorkFieldsFragmentDoc}`;
1188
- export const GetWorkWithTitlesDocument = gql`
1189
- query GetWorkWithTitles($uuid: ID!) {
1190
- work(uuid: $uuid) {
1191
- ...WorkFields
1192
- titles {
1193
- ...TitleFields
1194
- }
1195
- }
1196
- }
1197
- ${WorkFieldsFragmentDoc}
1198
- ${TitleFieldsFragmentDoc}`;
1199
- export const GetWorkWithImprintDocument = gql`
1200
- query GetWorkWithImprint($uuid: ID!, $toh: String) {
1201
- work(uuid: $uuid, toh: $toh) {
1202
- ...WorkFields
1203
- imprint {
1204
- ...ImprintFields
1205
- }
1206
- }
1207
- }
1208
- ${WorkFieldsFragmentDoc}
1209
- ${ImprintFieldsFragmentDoc}
1210
- ${LicenseFieldsFragmentDoc}
1211
- ${TitlesByLanguageFieldsFragmentDoc}`;
1212
- export const GetWorkWithTocDocument = gql`
1213
- query GetWorkWithToc($uuid: ID!) {
1214
- work(uuid: $uuid) {
1215
- ...WorkFields
1216
- toc {
1217
- ...TocFields
1218
- }
1219
- }
1220
- }
1221
- ${WorkFieldsFragmentDoc}
1222
- ${TocFieldsFragmentDoc}
1223
- ${TocEntryNestedFragmentDoc}
1224
- ${TocEntryFieldsFragmentDoc}`;
1225
- export const GetAllWorksDocument = gql`
1226
- query GetAllWorks($cursor: String, $limit: Int) {
1227
- works(cursor: $cursor, limit: $limit) {
1228
- items {
1229
- ...WorkFields
1230
- }
1231
- pageInfo {
1232
- nextCursor
1233
- hasMoreAfter
1234
- }
1235
- }
1236
- }
1237
- ${WorkFieldsFragmentDoc}`;
1238
- export const GetWorkUuidsDocument = gql`
1239
- query GetWorkUuids($cursor: String, $limit: Int) {
1240
- works(cursor: $cursor, limit: $limit) {
1241
- items {
1242
- uuid
1243
- }
1244
- pageInfo {
1245
- nextCursor
1246
- hasMoreAfter
1247
- }
1248
- }
1249
- }
1250
- `;
1251
-
1252
- export type SdkFunctionWrapper = <T>(action: (requestHeaders?:Record<string, string>) => Promise<T>, operationName: string, operationType?: string, variables?: any) => Promise<T>;
1253
-
1254
-
1255
- const defaultWrapper: SdkFunctionWrapper = (action, _operationName, _operationType, _variables) => action();
1256
-
1257
- export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper = defaultWrapper) {
1258
- return {
1259
- GetPassages(variables: GetPassagesQueryVariables, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit['signal']): Promise<GetPassagesQuery> {
1260
- return withWrapper((wrappedRequestHeaders) => client.request<GetPassagesQuery>({ document: GetPassagesDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), 'GetPassages', 'query', variables);
1261
- },
1262
- GetPassagesBasic(variables: GetPassagesBasicQueryVariables, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit['signal']): Promise<GetPassagesBasicQuery> {
1263
- return withWrapper((wrappedRequestHeaders) => client.request<GetPassagesBasicQuery>({ document: GetPassagesBasicDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), 'GetPassagesBasic', 'query', variables);
1264
- },
1265
- GetPassagesWithJson(variables: GetPassagesWithJsonQueryVariables, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit['signal']): Promise<GetPassagesWithJsonQuery> {
1266
- return withWrapper((wrappedRequestHeaders) => client.request<GetPassagesWithJsonQuery>({ document: GetPassagesWithJsonDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), 'GetPassagesWithJson', 'query', variables);
1267
- },
1268
- GetPassagesAroundWithJson(variables: GetPassagesAroundWithJsonQueryVariables, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit['signal']): Promise<GetPassagesAroundWithJsonQuery> {
1269
- return withWrapper((wrappedRequestHeaders) => client.request<GetPassagesAroundWithJsonQuery>({ document: GetPassagesAroundWithJsonDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), 'GetPassagesAroundWithJson', 'query', variables);
1270
- },
1271
- GetPassage(variables?: GetPassageQueryVariables, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit['signal']): Promise<GetPassageQuery> {
1272
- return withWrapper((wrappedRequestHeaders) => client.request<GetPassageQuery>({ document: GetPassageDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), 'GetPassage', 'query', variables);
1273
- },
1274
- GetWorkByUuid(variables: GetWorkByUuidQueryVariables, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit['signal']): Promise<GetWorkByUuidQuery> {
1275
- return withWrapper((wrappedRequestHeaders) => client.request<GetWorkByUuidQuery>({ document: GetWorkByUuidDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), 'GetWorkByUuid', 'query', variables);
1276
- },
1277
- GetWorkByToh(variables: GetWorkByTohQueryVariables, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit['signal']): Promise<GetWorkByTohQuery> {
1278
- return withWrapper((wrappedRequestHeaders) => client.request<GetWorkByTohQuery>({ document: GetWorkByTohDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), 'GetWorkByToh', 'query', variables);
1279
- },
1280
- GetWorkWithTitles(variables: GetWorkWithTitlesQueryVariables, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit['signal']): Promise<GetWorkWithTitlesQuery> {
1281
- return withWrapper((wrappedRequestHeaders) => client.request<GetWorkWithTitlesQuery>({ document: GetWorkWithTitlesDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), 'GetWorkWithTitles', 'query', variables);
1282
- },
1283
- GetWorkWithImprint(variables: GetWorkWithImprintQueryVariables, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit['signal']): Promise<GetWorkWithImprintQuery> {
1284
- return withWrapper((wrappedRequestHeaders) => client.request<GetWorkWithImprintQuery>({ document: GetWorkWithImprintDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), 'GetWorkWithImprint', 'query', variables);
1285
- },
1286
- GetWorkWithToc(variables: GetWorkWithTocQueryVariables, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit['signal']): Promise<GetWorkWithTocQuery> {
1287
- return withWrapper((wrappedRequestHeaders) => client.request<GetWorkWithTocQuery>({ document: GetWorkWithTocDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), 'GetWorkWithToc', 'query', variables);
1288
- },
1289
- GetAllWorks(variables?: GetAllWorksQueryVariables, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit['signal']): Promise<GetAllWorksQuery> {
1290
- return withWrapper((wrappedRequestHeaders) => client.request<GetAllWorksQuery>({ document: GetAllWorksDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), 'GetAllWorks', 'query', variables);
1291
- },
1292
- GetWorkUuids(variables?: GetWorkUuidsQueryVariables, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit['signal']): Promise<GetWorkUuidsQuery> {
1293
- return withWrapper((wrappedRequestHeaders) => client.request<GetWorkUuidsQuery>({ document: GetWorkUuidsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), 'GetWorkUuids', 'query', variables);
1294
- }
1295
- };
1296
- }
1297
- export type Sdk = ReturnType<typeof getSdk>;