@literary-universe/sdk 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/schema.graphql CHANGED
@@ -72,6 +72,13 @@ type Query {
72
72
  authorValidateChapterDraft(input: AuthorDraftSaveInput!): AuthorDraftValidation!
73
73
  authorChapterDraftRecovery(id: ID!, recoveryId: ID!): AuthorChapterDraft
74
74
  authorImagePolicy: JSON!
75
+
76
+ """A page of a universe's encyclopedia entries, drafts included."""
77
+ authorEncyclopediaEntries(universeId: ID!, first: Int = 25, after: String): AuthorEncyclopediaEntryConnection!
78
+ authorEncyclopediaEntry(id: ID!, language: Locale): AuthorEncyclopediaEntry
79
+
80
+ """The saved series of a universe."""
81
+ authorSeries(universeId: ID!): [AuthorSeries!]!
75
82
  }
76
83
 
77
84
  enum AuthorWorkState {
@@ -195,6 +202,73 @@ type Mutation {
195
202
  authorPublishChapter(input: AuthorChapterPublishInput!): AuthorChapterPublishResult!
196
203
  authorCreateChapter(input: AuthorChapterCreateInput!): AuthorChapterCreateResult!
197
204
  authorSaveChapterDraft(input: AuthorDraftSaveInput!): AuthorDraftSaveResult!
205
+
206
+ """
207
+ Hide a published story from readers, or show it again. Fails with
208
+ BAD_USER_INPUT for a story that was never published.
209
+ """
210
+ setAuthorStoryVisibility(storyId: ID!, visibility: AuthorStoryVisibility!): AuthorStoryHeader!
211
+
212
+ """
213
+ Rename a chapter, published or not; the change shows to readers at once.
214
+ """
215
+ renameAuthorChapter(input: AuthorChapterRenameInput!): AuthorChapterHeader!
216
+
217
+ """
218
+ Remove a chapter that was never published and renumber the chapters after
219
+ it. Fails with FAILED_PRECONDITION for a chapter published in any language
220
+ or to beta readers, for the only chapter of a story, and for a story whose
221
+ arcs or free preview count chapters.
222
+ """
223
+ removeAuthorChapter(input: AuthorChapterRemoveInput!): AuthorChapterRemoval!
224
+
225
+ """
226
+ Put the chapters of a story in a new order. Fails with FAILED_PRECONDITION
227
+ for a story whose arcs or free preview count chapters.
228
+ """
229
+ reorderAuthorChapters(input: AuthorChapterReorderInput!): AuthorChapterOrder!
230
+
231
+ """
232
+ Change a universe's own title, address, description, genre, rating, license
233
+ or language. Fails with CONFLICT for a taken address.
234
+ """
235
+ updateAuthorUniverse(universeId: ID!, input: AuthorUniverseUpdateInput!): AuthorUniverseHeader!
236
+
237
+ """
238
+ Add a draft entry with its category's template fields. Fails with CONFLICT,
239
+ naming the existing entryId, when the universe has an entry of that name.
240
+ """
241
+ createAuthorEncyclopediaEntry(input: AuthorEncyclopediaEntryCreateInput!): AuthorEncyclopediaEntry!
242
+
243
+ """Change an entry in its original language."""
244
+ updateAuthorEncyclopediaEntry(id: ID!, changes: AuthorEncyclopediaEntryChangesInput!): AuthorEncyclopediaEntry!
245
+
246
+ """
247
+ Write an entry's edition in a language the universe is translated into.
248
+ Fails with FAILED_PRECONDITION for any other language.
249
+ """
250
+ translateAuthorEncyclopediaEntry(input: AuthorEncyclopediaEntryTranslationInput!): AuthorEncyclopediaEntry!
251
+
252
+ """Publish an entry to readers, or take it back to a draft."""
253
+ setAuthorEncyclopediaEntryPublication(id: ID!, published: Boolean!): AuthorEncyclopediaEntry!
254
+
255
+ """
256
+ Delete an entry and its links from other entries. Staff can restore it.
257
+ """
258
+ deleteAuthorEncyclopediaEntry(id: ID!): AuthorEncyclopediaEntryDeletion!
259
+
260
+ """
261
+ Create a series, or replace one, as a line of stories in reading order.
262
+ Fails with VERSION_CONFLICT, and changes nothing, when the series is no
263
+ longer at expectedVersion.
264
+ """
265
+ saveAuthorSeries(input: AuthorSeriesSaveInput!): AuthorSeries!
266
+
267
+ """
268
+ Change a story's details. Fails with FORBIDDEN for a universe the
269
+ credential cannot use, and FAILED_PRECONDITION for a rating under review.
270
+ """
271
+ updateAuthorStory(storyId: ID!, input: AuthorStoryUpdateInput!): AuthorStoryHeader!
198
272
  }
199
273
 
200
274
  type AuthorChapterHeader {
@@ -237,7 +311,14 @@ input AuthorDraftSaveInput {
237
311
  language: Locale
238
312
  expectedVersion: String!
239
313
  operationId: ID!
240
- content: JSON!
314
+
315
+ """Tiptap JSON. Provide exactly one of content and markdown."""
316
+ content: JSON
317
+
318
+ """
319
+ Markdown converted on the server with the editor's own Markdown extension. Provide exactly one of content and markdown. Rejected with MARKDOWN_UNSUPPORTED if the stored draft has nodes, marks or attributes Markdown cannot preserve; use content instead.
320
+ """
321
+ markdown: String
241
322
  }
242
323
 
243
324
  type AuthorContentWarning {
@@ -263,6 +344,7 @@ input AuthorChapterCreateInput {
263
344
  operationId: ID!
264
345
  title: String
265
346
  content: JSON
347
+ markdown: String
266
348
  isAIGenerated: Boolean
267
349
  }
268
350
 
@@ -302,6 +384,230 @@ type AuthorChapterPublishResult {
302
384
  warnings: [AuthorContentWarning!]!
303
385
  }
304
386
 
387
+ enum AuthorStoryVisibility {
388
+ PUBLIC
389
+ PRIVATE
390
+ }
391
+
392
+ input AuthorChapterRenameInput {
393
+ id: ID!
394
+
395
+ """A translation's language renames that edition; the original otherwise."""
396
+ language: Locale
397
+ title: String!
398
+ }
399
+
400
+ type AuthorChapterRemoval {
401
+ id: ID!
402
+ storyId: ID!
403
+ }
404
+
405
+ type AuthorChapterOrder {
406
+ storyId: ID!
407
+ chapterIds: [ID!]!
408
+ }
409
+
410
+ input AuthorChapterRemoveInput {
411
+ id: ID!
412
+ }
413
+
414
+ input AuthorChapterReorderInput {
415
+ storyId: ID!
416
+
417
+ """Every chapter of the story, each once, in the new reading order."""
418
+ chapterIds: [ID!]!
419
+ }
420
+
421
+ """Only the given fields change."""
422
+ input AuthorUniverseUpdateInput {
423
+ title: String
424
+
425
+ """The address segment: lowercase letters, digits and single hyphens."""
426
+ slug: String
427
+ description: String
428
+
429
+ """A genre value, as the genre list names it."""
430
+ genre: String
431
+ rating: String
432
+ license: String
433
+ language: Locale
434
+ }
435
+
436
+ type AuthorEncyclopediaEntryHeader {
437
+ id: ID!
438
+ universeId: ID!
439
+ name: String!
440
+ categoryId: ID!
441
+ categoryTitle: String
442
+
443
+ """
444
+ The language shown: the one asked for when the entry has it, else the original.
445
+ """
446
+ language: Locale!
447
+
448
+ """A draft that readers do not see."""
449
+ wip: Boolean!
450
+ publishedAt: DateTime
451
+ updatedAt: DateTime
452
+
453
+ """Languages the entry has besides its original."""
454
+ translations: [Locale!]!
455
+ }
456
+
457
+ type AuthorEncyclopediaEntryConnection {
458
+ nodes: [AuthorEncyclopediaEntryHeader!]!
459
+ pageInfo: AuthorPageInfo!
460
+ }
461
+
462
+ type AuthorEncyclopediaLink {
463
+ id: ID
464
+ name: String!
465
+ }
466
+
467
+ type AuthorEncyclopediaField {
468
+ id: ID!
469
+ title: String!
470
+
471
+ """
472
+ text, textarea, time, connections, image, canvas…; text and textarea take text.
473
+ """
474
+ type: String!
475
+ private: Boolean!
476
+ text: String
477
+ }
478
+
479
+ type AuthorEncyclopediaEntry {
480
+ id: ID!
481
+ universeId: ID!
482
+ name: String!
483
+ categoryId: ID!
484
+ categoryTitle: String
485
+ language: Locale!
486
+ wip: Boolean!
487
+ publishedAt: DateTime
488
+ updatedAt: DateTime
489
+ translations: [Locale!]!
490
+ pronunciation: String
491
+ tags: [String!]!
492
+ summary: String
493
+ parent: AuthorEncyclopediaLink
494
+ related: [AuthorEncyclopediaLink!]!
495
+ fields: [AuthorEncyclopediaField!]!
496
+ }
497
+
498
+ """A field by its title; a new title adds a text field."""
499
+ input AuthorEncyclopediaTextFieldInput {
500
+ title: String!
501
+ text: String!
502
+ }
503
+
504
+ """A date like 1402-03-01, or HH:MM in a clock field."""
505
+ input AuthorEncyclopediaTimeFieldInput {
506
+ title: String!
507
+ value: String!
508
+ }
509
+
510
+ """Only the given values change. Entries are named by their names."""
511
+ input AuthorEncyclopediaEntryChangesInput {
512
+ name: String
513
+ pronunciation: String
514
+ tags: [String!]
515
+ categoryTitle: String
516
+
517
+ """null removes the parent."""
518
+ parentName: String
519
+ relatedAdd: [String!]
520
+ relatedRemove: [String!]
521
+ summary: String
522
+ fields: [AuthorEncyclopediaTextFieldInput!]
523
+ timeFields: [AuthorEncyclopediaTimeFieldInput!]
524
+ }
525
+
526
+ type AuthorEncyclopediaEntryDeletion {
527
+ id: ID!
528
+ universeId: ID!
529
+ }
530
+
531
+ input AuthorEncyclopediaEntryCreateInput {
532
+ universeId: ID!
533
+ name: String!
534
+
535
+ """A category available in the universe, by title."""
536
+ categoryTitle: String!
537
+ pronunciation: String
538
+ tags: [String!]
539
+ parentName: String
540
+ relatedAdd: [String!]
541
+ summary: String
542
+ fields: [AuthorEncyclopediaTextFieldInput!]
543
+ timeFields: [AuthorEncyclopediaTimeFieldInput!]
544
+ }
545
+
546
+ input AuthorEncyclopediaFieldTranslationInput {
547
+ """The field's title in the original language."""
548
+ title: String!
549
+ translatedTitle: String
550
+ text: String!
551
+ }
552
+
553
+ input AuthorEncyclopediaEntryTranslationInput {
554
+ id: ID!
555
+
556
+ """A language the universe is translated into."""
557
+ language: Locale!
558
+ name: String
559
+ pronunciation: String
560
+ summary: String
561
+ fields: [AuthorEncyclopediaFieldTranslationInput!]
562
+ }
563
+
564
+ type AuthorSeries {
565
+ id: ID!
566
+ universeId: ID!
567
+ title: String!
568
+
569
+ """
570
+ Advances with every save; pass it as expectedVersion to change the series.
571
+ """
572
+ version: Int!
573
+
574
+ """The stories in reading order."""
575
+ storyIds: [ID!]!
576
+ updatedAt: DateTime
577
+ }
578
+
579
+ input AuthorSeriesSaveInput {
580
+ universeId: ID!
581
+
582
+ """Leave out to create a series."""
583
+ seriesId: ID
584
+
585
+ """The version read with the series; 0 for a new one."""
586
+ expectedVersion: Int!
587
+ title: String!
588
+
589
+ """Stories of the universe, not fan fiction, in reading order."""
590
+ storyIds: [ID!]!
591
+ }
592
+
593
+ """Only the given fields change."""
594
+ input AuthorStoryUpdateInput {
595
+ title: String
596
+ description: String
597
+
598
+ """Genre values, as the genre list names them."""
599
+ genres: [String!]
600
+ tags: [String!]
601
+ rating: String
602
+ license: String
603
+ language: Locale
604
+
605
+ """
606
+ Another universe needs edit rights on it; null makes the story standalone.
607
+ """
608
+ universeId: ID
609
+ }
610
+
305
611
  scalar Date
306
612
 
307
613
  scalar DateTime