@literary-universe/sdk 0.1.0 → 0.2.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 {
@@ -302,6 +376,230 @@ type AuthorChapterPublishResult {
302
376
  warnings: [AuthorContentWarning!]!
303
377
  }
304
378
 
379
+ enum AuthorStoryVisibility {
380
+ PUBLIC
381
+ PRIVATE
382
+ }
383
+
384
+ input AuthorChapterRenameInput {
385
+ id: ID!
386
+
387
+ """A translation's language renames that edition; the original otherwise."""
388
+ language: Locale
389
+ title: String!
390
+ }
391
+
392
+ type AuthorChapterRemoval {
393
+ id: ID!
394
+ storyId: ID!
395
+ }
396
+
397
+ type AuthorChapterOrder {
398
+ storyId: ID!
399
+ chapterIds: [ID!]!
400
+ }
401
+
402
+ input AuthorChapterRemoveInput {
403
+ id: ID!
404
+ }
405
+
406
+ input AuthorChapterReorderInput {
407
+ storyId: ID!
408
+
409
+ """Every chapter of the story, each once, in the new reading order."""
410
+ chapterIds: [ID!]!
411
+ }
412
+
413
+ """Only the given fields change."""
414
+ input AuthorUniverseUpdateInput {
415
+ title: String
416
+
417
+ """The address segment: lowercase letters, digits and single hyphens."""
418
+ slug: String
419
+ description: String
420
+
421
+ """A genre value, as the genre list names it."""
422
+ genre: String
423
+ rating: String
424
+ license: String
425
+ language: Locale
426
+ }
427
+
428
+ type AuthorEncyclopediaEntryHeader {
429
+ id: ID!
430
+ universeId: ID!
431
+ name: String!
432
+ categoryId: ID!
433
+ categoryTitle: String
434
+
435
+ """
436
+ The language shown: the one asked for when the entry has it, else the original.
437
+ """
438
+ language: Locale!
439
+
440
+ """A draft that readers do not see."""
441
+ wip: Boolean!
442
+ publishedAt: DateTime
443
+ updatedAt: DateTime
444
+
445
+ """Languages the entry has besides its original."""
446
+ translations: [Locale!]!
447
+ }
448
+
449
+ type AuthorEncyclopediaEntryConnection {
450
+ nodes: [AuthorEncyclopediaEntryHeader!]!
451
+ pageInfo: AuthorPageInfo!
452
+ }
453
+
454
+ type AuthorEncyclopediaLink {
455
+ id: ID
456
+ name: String!
457
+ }
458
+
459
+ type AuthorEncyclopediaField {
460
+ id: ID!
461
+ title: String!
462
+
463
+ """
464
+ text, textarea, time, connections, image, canvas…; text and textarea take text.
465
+ """
466
+ type: String!
467
+ private: Boolean!
468
+ text: String
469
+ }
470
+
471
+ type AuthorEncyclopediaEntry {
472
+ id: ID!
473
+ universeId: ID!
474
+ name: String!
475
+ categoryId: ID!
476
+ categoryTitle: String
477
+ language: Locale!
478
+ wip: Boolean!
479
+ publishedAt: DateTime
480
+ updatedAt: DateTime
481
+ translations: [Locale!]!
482
+ pronunciation: String
483
+ tags: [String!]!
484
+ summary: String
485
+ parent: AuthorEncyclopediaLink
486
+ related: [AuthorEncyclopediaLink!]!
487
+ fields: [AuthorEncyclopediaField!]!
488
+ }
489
+
490
+ """A field by its title; a new title adds a text field."""
491
+ input AuthorEncyclopediaTextFieldInput {
492
+ title: String!
493
+ text: String!
494
+ }
495
+
496
+ """A date like 1402-03-01, or HH:MM in a clock field."""
497
+ input AuthorEncyclopediaTimeFieldInput {
498
+ title: String!
499
+ value: String!
500
+ }
501
+
502
+ """Only the given values change. Entries are named by their names."""
503
+ input AuthorEncyclopediaEntryChangesInput {
504
+ name: String
505
+ pronunciation: String
506
+ tags: [String!]
507
+ categoryTitle: String
508
+
509
+ """null removes the parent."""
510
+ parentName: String
511
+ relatedAdd: [String!]
512
+ relatedRemove: [String!]
513
+ summary: String
514
+ fields: [AuthorEncyclopediaTextFieldInput!]
515
+ timeFields: [AuthorEncyclopediaTimeFieldInput!]
516
+ }
517
+
518
+ type AuthorEncyclopediaEntryDeletion {
519
+ id: ID!
520
+ universeId: ID!
521
+ }
522
+
523
+ input AuthorEncyclopediaEntryCreateInput {
524
+ universeId: ID!
525
+ name: String!
526
+
527
+ """A category available in the universe, by title."""
528
+ categoryTitle: String!
529
+ pronunciation: String
530
+ tags: [String!]
531
+ parentName: String
532
+ relatedAdd: [String!]
533
+ summary: String
534
+ fields: [AuthorEncyclopediaTextFieldInput!]
535
+ timeFields: [AuthorEncyclopediaTimeFieldInput!]
536
+ }
537
+
538
+ input AuthorEncyclopediaFieldTranslationInput {
539
+ """The field's title in the original language."""
540
+ title: String!
541
+ translatedTitle: String
542
+ text: String!
543
+ }
544
+
545
+ input AuthorEncyclopediaEntryTranslationInput {
546
+ id: ID!
547
+
548
+ """A language the universe is translated into."""
549
+ language: Locale!
550
+ name: String
551
+ pronunciation: String
552
+ summary: String
553
+ fields: [AuthorEncyclopediaFieldTranslationInput!]
554
+ }
555
+
556
+ type AuthorSeries {
557
+ id: ID!
558
+ universeId: ID!
559
+ title: String!
560
+
561
+ """
562
+ Advances with every save; pass it as expectedVersion to change the series.
563
+ """
564
+ version: Int!
565
+
566
+ """The stories in reading order."""
567
+ storyIds: [ID!]!
568
+ updatedAt: DateTime
569
+ }
570
+
571
+ input AuthorSeriesSaveInput {
572
+ universeId: ID!
573
+
574
+ """Leave out to create a series."""
575
+ seriesId: ID
576
+
577
+ """The version read with the series; 0 for a new one."""
578
+ expectedVersion: Int!
579
+ title: String!
580
+
581
+ """Stories of the universe, not fan fiction, in reading order."""
582
+ storyIds: [ID!]!
583
+ }
584
+
585
+ """Only the given fields change."""
586
+ input AuthorStoryUpdateInput {
587
+ title: String
588
+ description: String
589
+
590
+ """Genre values, as the genre list names them."""
591
+ genres: [String!]
592
+ tags: [String!]
593
+ rating: String
594
+ license: String
595
+ language: Locale
596
+
597
+ """
598
+ Another universe needs edit rights on it; null makes the story standalone.
599
+ """
600
+ universeId: ID
601
+ }
602
+
305
603
  scalar Date
306
604
 
307
605
  scalar DateTime