1#![allow(clippy::all, unused_imports)]
6
7use serde::{Deserialize, Serialize};
8use std::collections::BTreeMap;
9
10#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
12pub enum Access {
13 #[default]
14 #[serde(rename = "read")]
15 Read,
16 #[serde(rename = "write")]
17 Write,
18 #[serde(rename = "prose")]
19 Prose,
20 #[serde(rename = "destructive")]
21 Destructive,
22 #[serde(other)]
24 Unknown,
25}
26
27#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
28#[serde(default)]
29pub struct AccountStatus {
30 pub server: Option<String>,
31 pub ssl: Option<bool>,
32 pub email: Option<String>,
33 #[serde(rename = "loggedIn")]
34 pub logged_in: bool,
35 #[serde(rename = "tokenValid")]
37 pub token_valid: Option<bool>,
38}
39
40#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
41#[serde(default)]
42pub struct Activity {
43 pub days: Vec<DayWords>,
44 pub devices: Vec<DeviceWords>,
46}
47
48#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
49#[serde(default)]
50pub struct Appearance {
51 #[serde(rename = "entryId")]
52 pub entry_id: i32,
53 pub name: String,
54 pub r#type: EntryKind,
55 #[serde(rename = "sceneCount")]
56 pub scene_count: i32,
57}
58
59#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
60#[serde(default)]
61pub struct ArchivedScene {
62 pub id: i32,
63 pub name: String,
64}
65
66#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
67#[serde(default)]
68pub struct ArchivedScenes {
69 pub scenes: Vec<ArchivedScene>,
70}
71
72#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
73#[serde(default)]
74pub struct Backup {
75 pub date: String,
77}
78
79#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
80#[serde(default)]
81pub struct Backups {
82 pub backups: Vec<Backup>,
83}
84
85#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
87pub enum Cadence {
88 #[default]
89 #[serde(rename = "day")]
90 Day,
91 #[serde(rename = "week")]
92 Week,
93 #[serde(other)]
95 Unknown,
96}
97
98#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
99#[serde(default)]
100pub struct CalendarDto {
101 pub preset: CalendarPresetDto,
102 #[serde(rename = "epochName")]
104 #[serde(skip_serializing_if = "Option::is_none", default)]
105 pub epoch_name: Option<String>,
106 #[serde(rename = "coarsestUnit")]
108 #[serde(skip_serializing_if = "Option::is_none", default)]
109 pub coarsest_unit: Option<String>,
110}
111
112#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
114pub enum CalendarPresetDto {
115 #[default]
116 #[serde(rename = "story")]
117 Story,
118 #[serde(rename = "gregorian")]
119 Gregorian,
120 #[serde(other)]
122 Unknown,
123}
124
125#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
126#[serde(default)]
127pub struct ChapterWords {
128 pub id: i32,
129 pub name: String,
130 pub words: i32,
131}
132
133#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
134#[serde(default)]
135pub struct DayWords {
136 pub date: String,
138 pub words: i32,
139}
140
141#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
142#[serde(default)]
143pub struct DeviceWords {
144 pub device: String,
145 pub words: i32,
146}
147
148#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
149#[serde(default)]
150pub struct DraftApplied {
151 #[serde(rename = "sceneId")]
152 pub scene_id: i32,
153 #[serde(rename = "previousDraftId")]
155 pub previous_draft_id: Option<i32>,
156 #[serde(rename = "wordCount")]
157 pub word_count: i32,
158}
159
160#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
161#[serde(default)]
162pub struct DraftInfo {
163 pub id: i32,
164 pub name: String,
165 pub created: String,
167}
168
169#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
170#[serde(default)]
171pub struct DraftText {
172 pub id: i32,
173 #[serde(rename = "sceneId")]
174 pub scene_id: i32,
175 pub name: String,
176 pub created: String,
178 pub markdown: String,
179}
180
181#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
182#[serde(default)]
183pub struct Drafts {
184 pub drafts: Vec<DraftInfo>,
185}
186
187#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
189pub enum EntityKind {
190 #[default]
191 #[serde(rename = "scene")]
192 Scene,
193 #[serde(rename = "note")]
194 Note,
195 #[serde(rename = "entry")]
196 Entry,
197 #[serde(rename = "timeline")]
198 Timeline,
199 #[serde(other)]
201 Unknown,
202}
203
204#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
205#[serde(default)]
206pub struct Entries {
207 pub entries: Vec<EntrySummary>,
208}
209
210#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
211#[serde(default)]
212pub struct Entry {
213 pub id: i32,
214 pub name: String,
215 pub r#type: EntryKind,
216 pub text: String,
217 pub tags: Vec<String>,
218 pub aliases: Vec<String>,
219 #[serde(rename = "hasImage")]
220 pub has_image: bool,
221 #[serde(skip_serializing_if = "Option::is_none", default)]
223 pub images: Option<Vec<i32>>,
224 #[serde(rename = "referencedBy")]
226 pub referenced_by: Vec<i32>,
227}
228
229#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
230#[serde(default)]
231pub struct EntryCount {
232 pub r#type: EntryKind,
233 pub count: i32,
234}
235
236#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
237#[serde(default)]
238pub struct EntryImageSummary {
239 pub id: i32,
240 pub name: String,
241 pub extension: String,
243}
244
245#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
246#[serde(default)]
247pub struct EntryImages {
248 pub images: Vec<EntryImageSummary>,
249}
250
251#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
253pub enum EntryKind {
254 #[default]
255 #[serde(rename = "person")]
256 Person,
257 #[serde(rename = "place")]
258 Place,
259 #[serde(rename = "thing")]
260 Thing,
261 #[serde(rename = "event")]
262 Event,
263 #[serde(rename = "idea")]
264 Idea,
265 #[serde(other)]
267 Unknown,
268}
269
270#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
271#[serde(default)]
272pub struct EntrySummary {
273 pub id: i32,
274 pub name: String,
275 pub r#type: EntryKind,
276 #[serde(skip_serializing_if = "Option::is_none", default)]
278 pub aliases: Option<Vec<String>>,
279}
280
281#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
282#[serde(default)]
283pub struct EvenSpacingDto {
284 pub unit: String,
286 #[serde(skip_serializing_if = "Option::is_none", default)]
287 pub step: Option<i64>,
288 pub origin: BTreeMap<String, i64>,
290}
291
292#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
293#[serde(default)]
294pub struct ExportFormat {
295 pub id: String,
296 #[serde(rename = "fileExtension")]
297 pub file_extension: String,
298 #[serde(rename = "mimeType")]
299 pub mime_type: String,
300}
301
302#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
303#[serde(default)]
304pub struct ExportFormats {
305 pub formats: Vec<ExportFormat>,
306}
307
308#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
309#[serde(default)]
310pub struct ExportedFile {
311 #[serde(rename = "fileName")]
312 pub file_name: String,
313 #[serde(rename = "mimeType")]
314 pub mime_type: String,
315 #[serde(with = "crate::base64::bytes")]
316 pub content: Vec<u8>,
317}
318
319#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
320#[serde(default)]
321pub struct Idea {
322 pub id: String,
323 pub title: Option<String>,
324 pub content: String,
325 pub tags: Vec<String>,
326 pub created: String,
328 pub updated: String,
330 pub promoted: Option<String>,
332 pub archived: Option<String>,
334}
335
336#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
337#[serde(default)]
338pub struct Ideas {
339 pub ideas: Vec<Idea>,
340}
341
342#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
343#[serde(default)]
344pub struct ImageContent {
345 pub id: i32,
346 pub name: String,
347 pub extension: String,
348 #[serde(with = "crate::base64::bytes")]
349 pub content: Vec<u8>,
350}
351
352#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
353#[serde(default)]
354pub struct ImageDeleted {
355 pub id: i32,
356 pub name: String,
357 pub extension: String,
358 #[serde(rename = "removedFrom")]
360 pub removed_from: Vec<ImageUser>,
361}
362
363#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
364#[serde(default)]
365pub struct ImageSummary {
366 pub id: i32,
367 pub name: String,
368 pub extension: String,
370 #[serde(rename = "inUse")]
372 pub in_use: bool,
373}
374
375#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
376#[serde(default)]
377pub struct ImageUser {
378 pub kind: ImageUserKind,
379 #[serde(skip_serializing_if = "Option::is_none", default)]
381 pub id: Option<i32>,
382}
383
384#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
386pub enum ImageUserKind {
387 #[default]
388 #[serde(rename = "scene")]
389 Scene,
390 #[serde(rename = "note")]
391 Note,
392 #[serde(rename = "timeline")]
393 Timeline,
394 #[serde(rename = "entry")]
395 Entry,
396 #[serde(rename = "draft")]
397 Draft,
398 #[serde(rename = "image")]
399 Image,
400 #[serde(rename = "cover")]
401 Cover,
402 #[serde(other)]
404 Unknown,
405}
406
407#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
408#[serde(default)]
409pub struct Images {
410 pub images: Vec<ImageSummary>,
411}
412
413#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
415pub enum ImportFileFormat {
416 #[default]
417 #[serde(rename = "markdown")]
418 Markdown,
419 #[serde(rename = "rtf")]
420 Rtf,
421 #[serde(other)]
423 Unknown,
424}
425
426#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
428pub enum MarkdownSplit {
429 #[default]
430 #[serde(rename = "auto")]
431 Auto,
432 #[serde(rename = "h1")]
433 H1,
434 #[serde(rename = "h2")]
435 H2,
436 #[serde(rename = "pattern")]
437 Pattern,
438 #[serde(other)]
440 Unknown,
441}
442
443#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
444#[serde(default)]
445pub struct Note {
446 pub id: i32,
447 pub created: String,
449 pub tags: Vec<String>,
450 pub content: String,
451}
452
453#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
454#[serde(default)]
455pub struct Notes {
456 pub notes: Vec<Note>,
457}
458
459#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
460#[serde(default)]
461pub struct OperationDescriptor {
462 pub name: String,
463 pub description: String,
464 pub access: Access,
465 pub scope: OperationScope,
466 pub input: BTreeMap<String, serde_json::Value>,
467 pub output: BTreeMap<String, serde_json::Value>,
468}
469
470#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
471#[serde(default)]
472pub struct OperationList {
473 pub operations: Vec<OperationDescriptor>,
474}
475
476#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
478pub enum OperationScope {
479 #[default]
480 #[serde(rename = "content")]
481 Content,
482 #[serde(rename = "account")]
483 Account,
484 #[serde(rename = "plugins")]
485 Plugins,
486 #[serde(other)]
488 Unknown,
489}
490
491#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
492#[serde(default)]
493pub struct PagedScene {
494 pub id: i32,
495 pub name: String,
496 pub path: Vec<String>,
498 pub markdown: String,
499 #[serde(rename = "wordCount")]
500 pub word_count: i32,
501 pub meta: SceneMeta,
502}
503
504#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
505#[serde(default)]
506pub struct PluginList {
507 pub plugins: Vec<PluginSummary>,
508}
509
510#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
511#[serde(default)]
512pub struct PluginSummary {
513 pub id: String,
514 #[serde(skip_serializing_if = "Option::is_none", default)]
516 pub name: Option<String>,
517 #[serde(skip_serializing_if = "Option::is_none", default)]
518 pub version: Option<String>,
519 #[serde(skip_serializing_if = "Option::is_none", default)]
520 pub description: Option<String>,
521 pub enabled: bool,
522 #[serde(skip_serializing_if = "Option::is_none", default)]
524 pub operations: Option<Vec<String>>,
525 #[serde(skip_serializing_if = "Option::is_none", default)]
527 pub http: Option<Vec<String>>,
528 #[serde(rename = "userHostSetting")]
530 #[serde(skip_serializing_if = "Option::is_none", default)]
531 pub user_host_setting: Option<String>,
532}
533
534#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
535#[serde(default)]
536pub struct ProjectImported {
537 pub name: String,
538 pub scenes: i32,
539}
540
541#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
542#[serde(default)]
543pub struct ProjectInfo {
544 pub name: String,
545 #[serde(rename = "projectId")]
546 pub project_id: String,
547 pub created: Option<String>,
549 #[serde(rename = "lastAccessed")]
551 pub last_accessed: Option<String>,
552 #[serde(rename = "authorName")]
553 pub author_name: Option<String>,
554 pub language: Option<String>,
555 pub tags: Vec<String>,
556 #[serde(rename = "wordCountGoal")]
557 pub word_count_goal: Option<WordGoal>,
558 #[serde(rename = "wordCount")]
559 pub word_count: Option<i32>,
560 #[serde(rename = "sceneCount")]
561 pub scene_count: Option<i32>,
562 #[serde(rename = "lastEdited")]
564 pub last_edited: Option<String>,
565}
566
567#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
568#[serde(default)]
569pub struct ProjectList {
570 pub projects: Vec<ProjectSummary>,
571}
572
573#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
574#[serde(default)]
575pub struct ProjectName {
576 pub name: String,
577}
578
579#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
580#[serde(default)]
581pub struct ProjectStats {
582 #[serde(rename = "totalWords")]
583 pub total_words: i32,
584 #[serde(rename = "sceneCount")]
585 pub scene_count: i32,
586 pub chapters: Vec<ChapterWords>,
588 #[serde(rename = "longestScene")]
589 pub longest_scene: Option<SceneWords>,
590 #[serde(rename = "shortestSceneWords")]
591 pub shortest_scene_words: i32,
592 #[serde(rename = "medianSceneWords")]
593 pub median_scene_words: i32,
594 #[serde(rename = "noteCount")]
595 pub note_count: i32,
596 #[serde(rename = "timelineEventCount")]
597 pub timeline_event_count: i32,
598 #[serde(rename = "entryCounts")]
599 pub entry_counts: Vec<EntryCount>,
600 #[serde(rename = "topAppearances")]
602 pub top_appearances: Vec<Appearance>,
603 #[serde(rename = "wordCountGoal")]
604 pub word_count_goal: Option<WordGoal>,
605 #[serde(rename = "lastEdited")]
607 pub last_edited: Option<String>,
608 #[serde(rename = "lastEditedScene")]
609 pub last_edited_scene: Option<SceneRef>,
610}
611
612#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
613#[serde(default)]
614pub struct ProjectSummary {
615 pub name: String,
616 #[serde(rename = "projectId")]
617 pub project_id: String,
618 #[serde(rename = "wordCount")]
620 pub word_count: Option<i32>,
621 pub created: Option<String>,
623 #[serde(rename = "lastAccessed")]
625 pub last_accessed: Option<String>,
626 #[serde(rename = "lastEdited")]
628 pub last_edited: Option<String>,
629}
630
631#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
632#[serde(default)]
633pub struct ProjectSyncStatus {
634 pub name: String,
635 pub linked: bool,
637 #[serde(rename = "lastSync")]
639 pub last_sync: Option<String>,
640 #[serde(rename = "pendingChanges")]
641 pub pending_changes: i32,
642}
643
644#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
646pub enum RtfSplit {
647 #[default]
648 #[serde(rename = "formatting")]
649 Formatting,
650 #[serde(rename = "pattern")]
651 Pattern,
652 #[serde(rename = "single")]
653 Single,
654 #[serde(other)]
656 Unknown,
657}
658
659#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
660#[serde(default)]
661pub struct SceneItemRef {
662 pub id: i32,
663 pub name: String,
664 pub kind: SceneKind,
665}
666
667#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
669pub enum SceneKind {
670 #[default]
671 #[serde(rename = "scene")]
672 Scene,
673 #[serde(rename = "group")]
674 Group,
675 #[serde(other)]
677 Unknown,
678}
679
680#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
681#[serde(default)]
682pub struct SceneMeta {
683 pub outline: String,
684 pub notes: String,
685 pub tags: Vec<String>,
686 #[serde(rename = "currentDraft")]
687 pub current_draft: String,
688 pub created: Option<String>,
690 #[serde(rename = "lastEdited")]
692 pub last_edited: Option<String>,
693 pub references: Vec<i32>,
695 #[serde(rename = "dismissedReferences")]
697 pub dismissed_references: Vec<i32>,
698}
699
700#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
701#[serde(default)]
702pub struct SceneNode {
703 pub id: i32,
704 pub name: String,
705 pub kind: SceneKind,
706 #[serde(rename = "wordCount")]
707 pub word_count: i32,
708 pub children: Vec<SceneNode>,
709}
710
711#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
712#[serde(default)]
713pub struct ScenePage {
714 pub scenes: Vec<PagedScene>,
715 pub next: Option<i32>,
717}
718
719#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
720#[serde(default)]
721pub struct SceneRef {
722 pub id: i32,
723 pub name: String,
724}
725
726#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
727#[serde(default)]
728pub struct SceneText {
729 pub id: i32,
730 pub name: String,
731 pub archived: bool,
732 pub markdown: String,
733 #[serde(rename = "wordCount")]
734 pub word_count: i32,
735 pub meta: SceneMeta,
736}
737
738#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
739#[serde(default)]
740pub struct SceneTree {
741 pub nodes: Vec<SceneNode>,
742}
743
744#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
745#[serde(default)]
746pub struct SceneWordCount {
747 #[serde(rename = "wordCount")]
748 pub word_count: i32,
749}
750
751#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
752#[serde(default)]
753pub struct SceneWords {
754 pub id: i32,
755 pub name: String,
756 pub words: i32,
757}
758
759#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
760#[serde(default)]
761pub struct SceneWriteResult {
762 #[serde(rename = "draftId")]
764 pub draft_id: Option<i32>,
765 #[serde(rename = "previousDraftId")]
767 pub previous_draft_id: Option<i32>,
768 #[serde(rename = "wordCount")]
769 pub word_count: i32,
770}
771
772#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
774pub enum SearchFilter {
775 #[default]
776 #[serde(rename = "all")]
777 All,
778 #[serde(rename = "scenes")]
779 Scenes,
780 #[serde(rename = "notes")]
781 Notes,
782 #[serde(rename = "encyclopedia")]
783 Encyclopedia,
784 #[serde(rename = "timeline")]
785 Timeline,
786 #[serde(other)]
788 Unknown,
789}
790
791#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
792#[serde(default)]
793pub struct SearchHit {
794 pub kind: EntityKind,
795 pub id: i32,
796 pub title: String,
797 pub snippet: String,
798 #[serde(rename = "matchStart")]
800 pub match_start: i32,
801 #[serde(rename = "matchEnd")]
802 pub match_end: i32,
803}
804
805#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
806#[serde(default)]
807pub struct SearchResults {
808 pub results: Vec<SearchHit>,
809}
810
811#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
812#[serde(default)]
813pub struct Session {
814 pub device: String,
815 #[serde(rename = "startedAt")]
817 pub started_at: String,
818 #[serde(rename = "endedAt")]
820 pub ended_at: String,
821 pub words: i32,
822}
823
824#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
825#[serde(default)]
826pub struct Sessions {
827 pub sessions: Vec<Session>,
828}
829
830#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
831#[serde(default)]
832pub struct SyncStatus {
833 pub projects: Vec<ProjectSyncStatus>,
834}
835
836#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
837#[serde(default)]
838pub struct TagCount {
839 pub tag: String,
840 pub count: i32,
841}
842
843#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
844#[serde(default)]
845pub struct TaggedEntities {
846 pub entities: Vec<TaggedEntity>,
847}
848
849#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
850#[serde(default)]
851pub struct TaggedEntity {
852 pub kind: EntityKind,
853 pub id: i32,
854}
855
856#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
857#[serde(default)]
858pub struct Tags {
859 pub tags: Vec<TagCount>,
860}
861
862#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
863#[serde(default)]
864pub struct Timeline {
865 pub events: Vec<TimelineEntry>,
866}
867
868#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
869#[serde(default)]
870pub struct TimelineDefDeleted {
871 pub timeline: String,
873 #[serde(rename = "deletedEvents")]
875 pub deleted_events: i32,
876}
877
878#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
879#[serde(default)]
880pub struct TimelineDefDto {
881 pub id: String,
883 pub name: String,
884 pub mode: TimelineModeDto,
885 pub calendar: Option<CalendarDto>,
887 #[serde(rename = "laneOrder")]
889 pub lane_order: Vec<String>,
890}
891
892#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
893#[serde(default)]
894pub struct TimelineEntry {
895 pub id: i32,
896 pub order: i32,
898 pub date: Option<String>,
900 pub content: String,
902 pub tags: Vec<String>,
904 #[serde(skip_serializing_if = "Option::is_none", default)]
906 pub kind: Option<TimelineKindDto>,
907 #[serde(skip_serializing_if = "Option::is_none", default)]
909 pub subject: Option<i32>,
910 #[serde(skip_serializing_if = "Option::is_none", default)]
912 pub title: Option<String>,
913 #[serde(skip_serializing_if = "Option::is_none", default)]
915 pub label: Option<String>,
916 #[serde(rename = "displayTitle")]
918 #[serde(skip_serializing_if = "Option::is_none", default)]
919 pub display_title: Option<String>,
920 #[serde(skip_serializing_if = "Option::is_none", default)]
922 pub lane: Option<String>,
923 #[serde(skip_serializing_if = "Option::is_none", default)]
925 pub milestone: Option<bool>,
926 #[serde(skip_serializing_if = "Option::is_none", default)]
928 pub start: Option<BTreeMap<String, i64>>,
929 #[serde(skip_serializing_if = "Option::is_none", default)]
931 pub end: Option<BTreeMap<String, i64>>,
932 #[serde(skip_serializing_if = "Option::is_none", default)]
934 pub references: Option<Vec<i32>>,
935 #[serde(rename = "cachedTitle")]
937 #[serde(skip_serializing_if = "Option::is_none", default)]
938 pub cached_title: Option<String>,
939 #[serde(skip_serializing_if = "Option::is_none", default)]
941 pub timeline: Option<String>,
942}
943
944#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
946pub enum TimelineKindDto {
947 #[default]
948 #[serde(rename = "event")]
949 Event,
950 #[serde(rename = "entry")]
951 Entry,
952 #[serde(rename = "scene")]
953 Scene,
954 #[serde(other)]
956 Unknown,
957}
958
959#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
961pub enum TimelineModeDto {
962 #[default]
963 #[serde(rename = "manual")]
964 Manual,
965 #[serde(rename = "dated")]
966 Dated,
967 #[serde(other)]
969 Unknown,
970}
971
972#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
973#[serde(default)]
974pub struct TimelineSettings {
975 pub timelines: Vec<TimelineDefDto>,
977 #[serde(skip_serializing_if = "Option::is_none", default)]
979 pub orphaned: Option<i32>,
980}
981
982#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
983#[serde(default)]
984pub struct WordGoal {
985 pub cadence: Cadence,
986 pub count: i32,
987}
988
989#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
991pub enum WriteMode {
992 #[default]
993 #[serde(rename = "draft")]
994 Draft,
995 #[serde(rename = "live")]
996 Live,
997 #[serde(other)]
999 Unknown,
1000}
1001
1002#[derive(Debug, Clone, Default, PartialEq, Serialize)]
1004pub struct SearchOptions {
1005 #[serde(skip_serializing_if = "Option::is_none")]
1006 pub filter: Option<SearchFilter>,
1007}
1008
1009pub fn search(project: &str, query: &str, options: SearchOptions) -> crate::Result<SearchResults> {
1013 #[derive(Serialize)]
1014 struct Input<'a> {
1015 project: &'a str,
1016 query: &'a str,
1017 #[serde(flatten)]
1018 options: SearchOptions,
1019 }
1020 crate::call("search", &Input { project, query, options })
1021}
1022
1023pub mod account {
1025 use super::*;
1026
1027 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
1029 pub struct AccountStatusOptions {
1030 #[serde(skip_serializing_if = "Option::is_none")]
1032 pub check: Option<bool>,
1033 }
1034
1035 pub fn status(options: AccountStatusOptions) -> crate::Result<AccountStatus> {
1039 #[derive(Serialize)]
1040 struct Input {
1041 #[serde(flatten)]
1042 options: AccountStatusOptions,
1043 }
1044 crate::call("account.status", &Input { options })
1045 }
1046
1047}
1048
1049pub mod backup {
1051 use super::*;
1052
1053 pub fn create(project: &str) -> crate::Result<Backup> {
1057 #[derive(Serialize)]
1058 struct Input<'a> {
1059 project: &'a str,
1060 }
1061 crate::call("backup.create", &Input { project })
1062 }
1063
1064 pub fn list(project: &str) -> crate::Result<Backups> {
1068 #[derive(Serialize)]
1069 struct Input<'a> {
1070 project: &'a str,
1071 }
1072 crate::call("backup.list", &Input { project })
1073 }
1074
1075}
1076
1077pub mod draft {
1079 use super::*;
1080
1081 pub fn apply(project: &str, id: i32) -> crate::Result<DraftApplied> {
1085 #[derive(Serialize)]
1086 struct Input<'a> {
1087 project: &'a str,
1088 id: i32,
1089 }
1090 crate::call("draft.apply", &Input { project, id })
1091 }
1092
1093 pub fn create(project: &str, scene_id: i32, name: &str) -> crate::Result<DraftInfo> {
1097 #[derive(Serialize)]
1098 struct Input<'a> {
1099 project: &'a str,
1100 #[serde(rename = "sceneId")]
1101 scene_id: i32,
1102 name: &'a str,
1103 }
1104 crate::call("draft.create", &Input { project, scene_id, name })
1105 }
1106
1107 pub fn delete(project: &str, id: i32) -> crate::Result<DraftInfo> {
1111 #[derive(Serialize)]
1112 struct Input<'a> {
1113 project: &'a str,
1114 id: i32,
1115 }
1116 crate::call("draft.delete", &Input { project, id })
1117 }
1118
1119 pub fn list(project: &str, scene_id: i32) -> crate::Result<Drafts> {
1123 #[derive(Serialize)]
1124 struct Input<'a> {
1125 project: &'a str,
1126 #[serde(rename = "sceneId")]
1127 scene_id: i32,
1128 }
1129 crate::call("draft.list", &Input { project, scene_id })
1130 }
1131
1132 pub fn read(project: &str, id: i32) -> crate::Result<DraftText> {
1136 #[derive(Serialize)]
1137 struct Input<'a> {
1138 project: &'a str,
1139 id: i32,
1140 }
1141 crate::call("draft.read", &Input { project, id })
1142 }
1143
1144}
1145
1146pub mod entry {
1148 use super::*;
1149
1150 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
1152 pub struct EntryCreateOptions {
1153 #[serde(skip_serializing_if = "Option::is_none")]
1154 pub tags: Option<Vec<String>>,
1155 #[serde(skip_serializing_if = "Option::is_none")]
1157 pub aliases: Option<Vec<String>>,
1158 }
1159
1160 pub fn create(project: &str, name: &str, r#type: EntryKind, text: &str, options: EntryCreateOptions) -> crate::Result<Entry> {
1164 #[derive(Serialize)]
1165 struct Input<'a> {
1166 project: &'a str,
1167 name: &'a str,
1168 r#type: EntryKind,
1169 text: &'a str,
1170 #[serde(flatten)]
1171 options: EntryCreateOptions,
1172 }
1173 crate::call("entry.create", &Input { project, name, r#type, text, options })
1174 }
1175
1176 pub fn delete(project: &str, id: i32) -> crate::Result<EntrySummary> {
1180 #[derive(Serialize)]
1181 struct Input<'a> {
1182 project: &'a str,
1183 id: i32,
1184 }
1185 crate::call("entry.delete", &Input { project, id })
1186 }
1187
1188 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
1190 pub struct EntryListOptions {
1191 #[serde(skip_serializing_if = "Option::is_none")]
1192 pub r#type: Option<EntryKind>,
1193 #[serde(skip_serializing_if = "Option::is_none")]
1194 pub tag: Option<String>,
1195 }
1196
1197 pub fn list(project: &str, options: EntryListOptions) -> crate::Result<Entries> {
1201 #[derive(Serialize)]
1202 struct Input<'a> {
1203 project: &'a str,
1204 #[serde(flatten)]
1205 options: EntryListOptions,
1206 }
1207 crate::call("entry.list", &Input { project, options })
1208 }
1209
1210 pub fn read(project: &str, id: i32) -> crate::Result<Entry> {
1214 #[derive(Serialize)]
1215 struct Input<'a> {
1216 project: &'a str,
1217 id: i32,
1218 }
1219 crate::call("entry.read", &Input { project, id })
1220 }
1221
1222 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
1224 pub struct EntryUpdateOptions {
1225 #[serde(skip_serializing_if = "Option::is_none")]
1226 pub name: Option<String>,
1227 #[serde(skip_serializing_if = "Option::is_none")]
1228 pub tags: Option<Vec<String>>,
1229 #[serde(skip_serializing_if = "Option::is_none")]
1230 pub aliases: Option<Vec<String>>,
1231 }
1232
1233 pub fn update(project: &str, id: i32, text: &str, options: EntryUpdateOptions) -> crate::Result<Entry> {
1237 #[derive(Serialize)]
1238 struct Input<'a> {
1239 project: &'a str,
1240 id: i32,
1241 text: &'a str,
1242 #[serde(flatten)]
1243 options: EntryUpdateOptions,
1244 }
1245 crate::call("entry.update", &Input { project, id, text, options })
1246 }
1247
1248 pub mod images {
1250 use super::*;
1251
1252 pub fn add(project: &str, id: i32, image_id: i32) -> crate::Result<EntryImages> {
1256 #[derive(Serialize)]
1257 struct Input<'a> {
1258 project: &'a str,
1259 id: i32,
1260 #[serde(rename = "imageId")]
1261 image_id: i32,
1262 }
1263 crate::call("entry.images.add", &Input { project, id, image_id })
1264 }
1265
1266 pub fn import(project: &str, id: i32, extension: &str, content: &[u8]) -> crate::Result<EntryImages> {
1270 #[derive(Serialize)]
1271 struct Input<'a> {
1272 project: &'a str,
1273 id: i32,
1274 extension: &'a str,
1275 #[serde(serialize_with = "crate::base64::serialize")]
1276 content: &'a [u8],
1277 }
1278 crate::call("entry.images.import", &Input { project, id, extension, content })
1279 }
1280
1281 pub fn list(project: &str, id: i32) -> crate::Result<EntryImages> {
1285 #[derive(Serialize)]
1286 struct Input<'a> {
1287 project: &'a str,
1288 id: i32,
1289 }
1290 crate::call("entry.images.list", &Input { project, id })
1291 }
1292
1293 pub fn primary(project: &str, id: i32, image_id: i32) -> crate::Result<EntryImages> {
1297 #[derive(Serialize)]
1298 struct Input<'a> {
1299 project: &'a str,
1300 id: i32,
1301 #[serde(rename = "imageId")]
1302 image_id: i32,
1303 }
1304 crate::call("entry.images.primary", &Input { project, id, image_id })
1305 }
1306
1307 pub fn remove(project: &str, id: i32, image_id: i32) -> crate::Result<EntryImages> {
1311 #[derive(Serialize)]
1312 struct Input<'a> {
1313 project: &'a str,
1314 id: i32,
1315 #[serde(rename = "imageId")]
1316 image_id: i32,
1317 }
1318 crate::call("entry.images.remove", &Input { project, id, image_id })
1319 }
1320
1321 }
1322
1323}
1324
1325pub mod export {
1327 use super::*;
1328
1329 pub fn formats() -> crate::Result<ExportFormats> {
1333 #[derive(Serialize)]
1334 struct Input {
1335 }
1336 crate::call("export.formats", &Input { })
1337 }
1338
1339}
1340
1341pub mod idea {
1343 use super::*;
1344
1345 pub fn archive(id: &str) -> crate::Result<Idea> {
1349 #[derive(Serialize)]
1350 struct Input<'a> {
1351 id: &'a str,
1352 }
1353 crate::call("idea.archive", &Input { id })
1354 }
1355
1356 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
1358 pub struct IdeaCreateOptions {
1359 #[serde(skip_serializing_if = "Option::is_none")]
1360 pub title: Option<String>,
1361 #[serde(skip_serializing_if = "Option::is_none")]
1362 pub tags: Option<Vec<String>>,
1363 }
1364
1365 pub fn create(content: &str, options: IdeaCreateOptions) -> crate::Result<Idea> {
1369 #[derive(Serialize)]
1370 struct Input<'a> {
1371 content: &'a str,
1372 #[serde(flatten)]
1373 options: IdeaCreateOptions,
1374 }
1375 crate::call("idea.create", &Input { content, options })
1376 }
1377
1378 pub fn delete(id: &str) -> crate::Result<Idea> {
1382 #[derive(Serialize)]
1383 struct Input<'a> {
1384 id: &'a str,
1385 }
1386 crate::call("idea.delete", &Input { id })
1387 }
1388
1389 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
1391 pub struct IdeaListOptions {
1392 #[serde(skip_serializing_if = "Option::is_none")]
1394 pub archived: Option<bool>,
1395 }
1396
1397 pub fn list(options: IdeaListOptions) -> crate::Result<Ideas> {
1401 #[derive(Serialize)]
1402 struct Input {
1403 #[serde(flatten)]
1404 options: IdeaListOptions,
1405 }
1406 crate::call("idea.list", &Input { options })
1407 }
1408
1409 pub fn unarchive(id: &str) -> crate::Result<Idea> {
1413 #[derive(Serialize)]
1414 struct Input<'a> {
1415 id: &'a str,
1416 }
1417 crate::call("idea.unarchive", &Input { id })
1418 }
1419
1420 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
1422 pub struct IdeaUpdateOptions {
1423 #[serde(skip_serializing_if = "Option::is_none")]
1425 pub title: Option<String>,
1426 #[serde(skip_serializing_if = "Option::is_none")]
1427 pub tags: Option<Vec<String>>,
1428 }
1429
1430 pub fn update(id: &str, content: &str, options: IdeaUpdateOptions) -> crate::Result<Idea> {
1434 #[derive(Serialize)]
1435 struct Input<'a> {
1436 id: &'a str,
1437 content: &'a str,
1438 #[serde(flatten)]
1439 options: IdeaUpdateOptions,
1440 }
1441 crate::call("idea.update", &Input { id, content, options })
1442 }
1443
1444}
1445
1446pub mod image {
1448 use super::*;
1449
1450 pub fn add(project: &str, name: &str, extension: &str, content: &[u8]) -> crate::Result<ImageSummary> {
1454 #[derive(Serialize)]
1455 struct Input<'a> {
1456 project: &'a str,
1457 name: &'a str,
1458 extension: &'a str,
1459 #[serde(serialize_with = "crate::base64::serialize")]
1460 content: &'a [u8],
1461 }
1462 crate::call("image.add", &Input { project, name, extension, content })
1463 }
1464
1465 pub fn delete(project: &str, id: i32) -> crate::Result<ImageDeleted> {
1469 #[derive(Serialize)]
1470 struct Input<'a> {
1471 project: &'a str,
1472 id: i32,
1473 }
1474 crate::call("image.delete", &Input { project, id })
1475 }
1476
1477 pub fn get(project: &str, id: i32) -> crate::Result<ImageContent> {
1481 #[derive(Serialize)]
1482 struct Input<'a> {
1483 project: &'a str,
1484 id: i32,
1485 }
1486 crate::call("image.get", &Input { project, id })
1487 }
1488
1489 pub fn list(project: &str) -> crate::Result<Images> {
1493 #[derive(Serialize)]
1494 struct Input<'a> {
1495 project: &'a str,
1496 }
1497 crate::call("image.list", &Input { project })
1498 }
1499
1500 pub fn rename(project: &str, id: i32, name: &str) -> crate::Result<ImageSummary> {
1504 #[derive(Serialize)]
1505 struct Input<'a> {
1506 project: &'a str,
1507 id: i32,
1508 name: &'a str,
1509 }
1510 crate::call("image.rename", &Input { project, id, name })
1511 }
1512
1513 pub fn replace(project: &str, id: i32, extension: &str, content: &[u8]) -> crate::Result<ImageSummary> {
1517 #[derive(Serialize)]
1518 struct Input<'a> {
1519 project: &'a str,
1520 id: i32,
1521 extension: &'a str,
1522 #[serde(serialize_with = "crate::base64::serialize")]
1523 content: &'a [u8],
1524 }
1525 crate::call("image.replace", &Input { project, id, extension, content })
1526 }
1527
1528}
1529
1530pub mod note {
1532 use super::*;
1533
1534 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
1536 pub struct NoteCreateOptions {
1537 #[serde(skip_serializing_if = "Option::is_none")]
1538 pub tags: Option<Vec<String>>,
1539 }
1540
1541 pub fn create(project: &str, content: &str, options: NoteCreateOptions) -> crate::Result<Note> {
1545 #[derive(Serialize)]
1546 struct Input<'a> {
1547 project: &'a str,
1548 content: &'a str,
1549 #[serde(flatten)]
1550 options: NoteCreateOptions,
1551 }
1552 crate::call("note.create", &Input { project, content, options })
1553 }
1554
1555 pub fn delete(project: &str, id: i32) -> crate::Result<Note> {
1559 #[derive(Serialize)]
1560 struct Input<'a> {
1561 project: &'a str,
1562 id: i32,
1563 }
1564 crate::call("note.delete", &Input { project, id })
1565 }
1566
1567 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
1569 pub struct NoteListOptions {
1570 #[serde(skip_serializing_if = "Option::is_none")]
1571 pub tag: Option<String>,
1572 }
1573
1574 pub fn list(project: &str, options: NoteListOptions) -> crate::Result<Notes> {
1578 #[derive(Serialize)]
1579 struct Input<'a> {
1580 project: &'a str,
1581 #[serde(flatten)]
1582 options: NoteListOptions,
1583 }
1584 crate::call("note.list", &Input { project, options })
1585 }
1586
1587 pub fn read(project: &str, id: i32) -> crate::Result<Note> {
1591 #[derive(Serialize)]
1592 struct Input<'a> {
1593 project: &'a str,
1594 id: i32,
1595 }
1596 crate::call("note.read", &Input { project, id })
1597 }
1598
1599 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
1601 pub struct NoteUpdateOptions {
1602 #[serde(skip_serializing_if = "Option::is_none")]
1604 pub tags: Option<Vec<String>>,
1605 }
1606
1607 pub fn update(project: &str, id: i32, content: &str, options: NoteUpdateOptions) -> crate::Result<Note> {
1611 #[derive(Serialize)]
1612 struct Input<'a> {
1613 project: &'a str,
1614 id: i32,
1615 content: &'a str,
1616 #[serde(flatten)]
1617 options: NoteUpdateOptions,
1618 }
1619 crate::call("note.update", &Input { project, id, content, options })
1620 }
1621
1622}
1623
1624pub mod ops {
1626 use super::*;
1627
1628 pub fn list() -> crate::Result<OperationList> {
1632 #[derive(Serialize)]
1633 struct Input {
1634 }
1635 crate::call("ops.list", &Input { })
1636 }
1637
1638}
1639
1640pub mod plugin {
1642 use super::*;
1643
1644 pub fn list() -> crate::Result<PluginList> {
1648 #[derive(Serialize)]
1649 struct Input {
1650 }
1651 crate::call("plugin.list", &Input { })
1652 }
1653
1654}
1655
1656pub mod project {
1658 use super::*;
1659
1660 pub fn create(name: &str) -> crate::Result<ProjectName> {
1664 #[derive(Serialize)]
1665 struct Input<'a> {
1666 name: &'a str,
1667 }
1668 crate::call("project.create", &Input { name })
1669 }
1670
1671 pub fn delete(project: &str) -> crate::Result<ProjectName> {
1675 #[derive(Serialize)]
1676 struct Input<'a> {
1677 project: &'a str,
1678 }
1679 crate::call("project.delete", &Input { project })
1680 }
1681
1682 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
1684 pub struct ProjectExportOptions {
1685 #[serde(rename = "sceneIds")]
1687 #[serde(skip_serializing_if = "Option::is_none")]
1688 pub scene_ids: Option<Vec<i32>>,
1689 #[serde(rename = "treatTopLevelAsChapters")]
1690 #[serde(skip_serializing_if = "Option::is_none")]
1691 pub treat_top_level_as_chapters: Option<bool>,
1692 }
1693
1694 pub fn export(project: &str, format: &str, options: ProjectExportOptions) -> crate::Result<ExportedFile> {
1698 #[derive(Serialize)]
1699 struct Input<'a> {
1700 project: &'a str,
1701 format: &'a str,
1702 #[serde(flatten)]
1703 options: ProjectExportOptions,
1704 }
1705 crate::call("project.export", &Input { project, format, options })
1706 }
1707
1708 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
1710 pub struct ProjectImportOptions {
1711 #[serde(skip_serializing_if = "Option::is_none")]
1713 pub name: Option<String>,
1714 #[serde(rename = "markdownSplit")]
1715 #[serde(skip_serializing_if = "Option::is_none")]
1716 pub markdown_split: Option<MarkdownSplit>,
1717 #[serde(rename = "rtfSplit")]
1718 #[serde(skip_serializing_if = "Option::is_none")]
1719 pub rtf_split: Option<RtfSplit>,
1720 #[serde(rename = "chapterPattern")]
1722 #[serde(skip_serializing_if = "Option::is_none")]
1723 pub chapter_pattern: Option<String>,
1724 #[serde(rename = "chapterGroups")]
1726 #[serde(skip_serializing_if = "Option::is_none")]
1727 pub chapter_groups: Option<bool>,
1728 }
1729
1730 pub fn import(format: ImportFileFormat, content: &[u8], options: ProjectImportOptions) -> crate::Result<ProjectImported> {
1734 #[derive(Serialize)]
1735 struct Input<'a> {
1736 format: ImportFileFormat,
1737 #[serde(serialize_with = "crate::base64::serialize")]
1738 content: &'a [u8],
1739 #[serde(flatten)]
1740 options: ProjectImportOptions,
1741 }
1742 crate::call("project.import", &Input { format, content, options })
1743 }
1744
1745 pub fn info(project: &str) -> crate::Result<ProjectInfo> {
1749 #[derive(Serialize)]
1750 struct Input<'a> {
1751 project: &'a str,
1752 }
1753 crate::call("project.info", &Input { project })
1754 }
1755
1756 pub fn list() -> crate::Result<ProjectList> {
1760 #[derive(Serialize)]
1761 struct Input {
1762 }
1763 crate::call("project.list", &Input { })
1764 }
1765
1766 pub fn rename(project: &str, name: &str) -> crate::Result<ProjectName> {
1770 #[derive(Serialize)]
1771 struct Input<'a> {
1772 project: &'a str,
1773 name: &'a str,
1774 }
1775 crate::call("project.rename", &Input { project, name })
1776 }
1777
1778}
1779
1780pub mod scene {
1782 use super::*;
1783
1784 pub fn append(project: &str, id: i32, markdown: &str) -> crate::Result<SceneWordCount> {
1788 #[derive(Serialize)]
1789 struct Input<'a> {
1790 project: &'a str,
1791 id: i32,
1792 markdown: &'a str,
1793 }
1794 crate::call("scene.append", &Input { project, id, markdown })
1795 }
1796
1797 pub fn archive(project: &str, id: i32) -> crate::Result<SceneItemRef> {
1801 #[derive(Serialize)]
1802 struct Input<'a> {
1803 project: &'a str,
1804 id: i32,
1805 }
1806 crate::call("scene.archive", &Input { project, id })
1807 }
1808
1809 pub fn archived(project: &str) -> crate::Result<ArchivedScenes> {
1813 #[derive(Serialize)]
1814 struct Input<'a> {
1815 project: &'a str,
1816 }
1817 crate::call("scene.archived", &Input { project })
1818 }
1819
1820 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
1822 pub struct SceneCreateOptions {
1823 #[serde(skip_serializing_if = "Option::is_none")]
1824 pub kind: Option<SceneKind>,
1825 #[serde(rename = "parentId")]
1827 #[serde(skip_serializing_if = "Option::is_none")]
1828 pub parent_id: Option<i32>,
1829 #[serde(skip_serializing_if = "Option::is_none")]
1831 pub index: Option<i32>,
1832 }
1833
1834 pub fn create(project: &str, name: &str, options: SceneCreateOptions) -> crate::Result<SceneItemRef> {
1838 #[derive(Serialize)]
1839 struct Input<'a> {
1840 project: &'a str,
1841 name: &'a str,
1842 #[serde(flatten)]
1843 options: SceneCreateOptions,
1844 }
1845 crate::call("scene.create", &Input { project, name, options })
1846 }
1847
1848 pub fn delete(project: &str, id: i32) -> crate::Result<SceneItemRef> {
1852 #[derive(Serialize)]
1853 struct Input<'a> {
1854 project: &'a str,
1855 id: i32,
1856 }
1857 crate::call("scene.delete", &Input { project, id })
1858 }
1859
1860 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
1862 pub struct SceneMoveOptions {
1863 #[serde(rename = "parentId")]
1865 #[serde(skip_serializing_if = "Option::is_none")]
1866 pub parent_id: Option<i32>,
1867 }
1868
1869 pub fn r#move(project: &str, id: i32, index: i32, options: SceneMoveOptions) -> crate::Result<SceneItemRef> {
1873 #[derive(Serialize)]
1874 struct Input<'a> {
1875 project: &'a str,
1876 id: i32,
1877 index: i32,
1878 #[serde(flatten)]
1879 options: SceneMoveOptions,
1880 }
1881 crate::call("scene.move", &Input { project, id, index, options })
1882 }
1883
1884 pub fn read(project: &str, id: i32) -> crate::Result<SceneText> {
1888 #[derive(Serialize)]
1889 struct Input<'a> {
1890 project: &'a str,
1891 id: i32,
1892 }
1893 crate::call("scene.read", &Input { project, id })
1894 }
1895
1896 pub fn rename(project: &str, id: i32, name: &str) -> crate::Result<SceneItemRef> {
1900 #[derive(Serialize)]
1901 struct Input<'a> {
1902 project: &'a str,
1903 id: i32,
1904 name: &'a str,
1905 }
1906 crate::call("scene.rename", &Input { project, id, name })
1907 }
1908
1909 pub fn tree(project: &str) -> crate::Result<SceneTree> {
1913 #[derive(Serialize)]
1914 struct Input<'a> {
1915 project: &'a str,
1916 }
1917 crate::call("scene.tree", &Input { project })
1918 }
1919
1920 pub fn unarchive(project: &str, id: i32) -> crate::Result<SceneItemRef> {
1924 #[derive(Serialize)]
1925 struct Input<'a> {
1926 project: &'a str,
1927 id: i32,
1928 }
1929 crate::call("scene.unarchive", &Input { project, id })
1930 }
1931
1932 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
1934 pub struct SceneWriteOptions {
1935 #[serde(rename = "draftName")]
1937 #[serde(skip_serializing_if = "Option::is_none")]
1938 pub draft_name: Option<String>,
1939 }
1940
1941 pub fn write(project: &str, id: i32, mode: WriteMode, markdown: &str, options: SceneWriteOptions) -> crate::Result<SceneWriteResult> {
1945 #[derive(Serialize)]
1946 struct Input<'a> {
1947 project: &'a str,
1948 id: i32,
1949 mode: WriteMode,
1950 markdown: &'a str,
1951 #[serde(flatten)]
1952 options: SceneWriteOptions,
1953 }
1954 crate::call("scene.write", &Input { project, id, mode, markdown, options })
1955 }
1956
1957 pub mod meta {
1959 use super::*;
1960
1961 pub fn read(project: &str, id: i32) -> crate::Result<SceneMeta> {
1965 #[derive(Serialize)]
1966 struct Input<'a> {
1967 project: &'a str,
1968 id: i32,
1969 }
1970 crate::call("scene.meta.read", &Input { project, id })
1971 }
1972
1973 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
1975 pub struct SceneMetaWriteOptions {
1976 #[serde(skip_serializing_if = "Option::is_none")]
1977 pub outline: Option<String>,
1978 #[serde(skip_serializing_if = "Option::is_none")]
1979 pub notes: Option<String>,
1980 #[serde(skip_serializing_if = "Option::is_none")]
1981 pub tags: Option<Vec<String>>,
1982 }
1983
1984 pub fn write(project: &str, id: i32, options: SceneMetaWriteOptions) -> crate::Result<SceneMeta> {
1988 #[derive(Serialize)]
1989 struct Input<'a> {
1990 project: &'a str,
1991 id: i32,
1992 #[serde(flatten)]
1993 options: SceneMetaWriteOptions,
1994 }
1995 crate::call("scene.meta.write", &Input { project, id, options })
1996 }
1997
1998 }
1999
2000 pub mod read {
2002 use super::*;
2003
2004 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
2006 pub struct SceneReadManyOptions {
2007 #[serde(skip_serializing_if = "Option::is_none")]
2009 pub group: Option<i32>,
2010 #[serde(skip_serializing_if = "Option::is_none")]
2011 pub ids: Option<Vec<i32>>,
2012 #[serde(skip_serializing_if = "Option::is_none")]
2014 pub after: Option<i32>,
2015 #[serde(rename = "maxWords")]
2016 #[serde(skip_serializing_if = "Option::is_none")]
2017 pub max_words: Option<i32>,
2018 }
2019
2020 pub fn many(project: &str, options: SceneReadManyOptions) -> crate::Result<ScenePage> {
2024 #[derive(Serialize)]
2025 struct Input<'a> {
2026 project: &'a str,
2027 #[serde(flatten)]
2028 options: SceneReadManyOptions,
2029 }
2030 crate::call("scene.read.many", &Input { project, options })
2031 }
2032
2033 }
2034
2035 pub mod references {
2037 use super::*;
2038
2039 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
2041 pub struct SceneReferencesSetOptions {
2042 #[serde(skip_serializing_if = "Option::is_none")]
2043 pub confirm: Option<Vec<i32>>,
2044 #[serde(skip_serializing_if = "Option::is_none")]
2045 pub dismiss: Option<Vec<i32>>,
2046 #[serde(skip_serializing_if = "Option::is_none")]
2047 pub clear: Option<Vec<i32>>,
2048 }
2049
2050 pub fn set(project: &str, id: i32, options: SceneReferencesSetOptions) -> crate::Result<SceneMeta> {
2054 #[derive(Serialize)]
2055 struct Input<'a> {
2056 project: &'a str,
2057 id: i32,
2058 #[serde(flatten)]
2059 options: SceneReferencesSetOptions,
2060 }
2061 crate::call("scene.references.set", &Input { project, id, options })
2062 }
2063
2064 }
2065
2066}
2067
2068pub mod stats {
2070 use super::*;
2071
2072 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
2074 pub struct StatsActivityOptions {
2075 #[serde(skip_serializing_if = "Option::is_none")]
2077 pub from: Option<String>,
2078 #[serde(skip_serializing_if = "Option::is_none")]
2080 pub to: Option<String>,
2081 }
2082
2083 pub fn activity(project: &str, options: StatsActivityOptions) -> crate::Result<Activity> {
2087 #[derive(Serialize)]
2088 struct Input<'a> {
2089 project: &'a str,
2090 #[serde(flatten)]
2091 options: StatsActivityOptions,
2092 }
2093 crate::call("stats.activity", &Input { project, options })
2094 }
2095
2096 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
2098 pub struct StatsProjectOptions {
2099 #[serde(skip_serializing_if = "Option::is_none")]
2101 pub recalculate: Option<bool>,
2102 }
2103
2104 pub fn project(project: &str, options: StatsProjectOptions) -> crate::Result<ProjectStats> {
2108 #[derive(Serialize)]
2109 struct Input<'a> {
2110 project: &'a str,
2111 #[serde(flatten)]
2112 options: StatsProjectOptions,
2113 }
2114 crate::call("stats.project", &Input { project, options })
2115 }
2116
2117 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
2119 pub struct StatsSessionsOptions {
2120 #[serde(skip_serializing_if = "Option::is_none")]
2122 pub from: Option<String>,
2123 #[serde(skip_serializing_if = "Option::is_none")]
2125 pub to: Option<String>,
2126 }
2127
2128 pub fn sessions(project: &str, options: StatsSessionsOptions) -> crate::Result<Sessions> {
2132 #[derive(Serialize)]
2133 struct Input<'a> {
2134 project: &'a str,
2135 #[serde(flatten)]
2136 options: StatsSessionsOptions,
2137 }
2138 crate::call("stats.sessions", &Input { project, options })
2139 }
2140
2141}
2142
2143pub mod sync {
2145 use super::*;
2146
2147 pub fn status() -> crate::Result<SyncStatus> {
2151 #[derive(Serialize)]
2152 struct Input {
2153 }
2154 crate::call("sync.status", &Input { })
2155 }
2156
2157}
2158
2159pub mod tag {
2161 use super::*;
2162
2163 pub fn find(project: &str, tag: &str) -> crate::Result<TaggedEntities> {
2167 #[derive(Serialize)]
2168 struct Input<'a> {
2169 project: &'a str,
2170 tag: &'a str,
2171 }
2172 crate::call("tag.find", &Input { project, tag })
2173 }
2174
2175 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
2177 pub struct TagListOptions {
2178 #[serde(skip_serializing_if = "Option::is_none")]
2179 pub kind: Option<EntityKind>,
2180 #[serde(skip_serializing_if = "Option::is_none")]
2181 pub limit: Option<i32>,
2182 }
2183
2184 pub fn list(project: &str, options: TagListOptions) -> crate::Result<Tags> {
2188 #[derive(Serialize)]
2189 struct Input<'a> {
2190 project: &'a str,
2191 #[serde(flatten)]
2192 options: TagListOptions,
2193 }
2194 crate::call("tag.list", &Input { project, options })
2195 }
2196
2197}
2198
2199pub mod timeline {
2201 use super::*;
2202
2203 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
2205 pub struct TimelineCreateOptions {
2206 #[serde(skip_serializing_if = "Option::is_none")]
2208 pub date: Option<String>,
2209 #[serde(skip_serializing_if = "Option::is_none")]
2210 pub tags: Option<Vec<String>>,
2211 #[serde(skip_serializing_if = "Option::is_none")]
2213 pub index: Option<i32>,
2214 #[serde(skip_serializing_if = "Option::is_none")]
2216 pub title: Option<String>,
2217 #[serde(skip_serializing_if = "Option::is_none")]
2219 pub label: Option<String>,
2220 #[serde(skip_serializing_if = "Option::is_none")]
2222 pub lane: Option<String>,
2223 #[serde(skip_serializing_if = "Option::is_none")]
2225 pub milestone: Option<bool>,
2226 #[serde(skip_serializing_if = "Option::is_none")]
2228 pub start: Option<BTreeMap<String, i64>>,
2229 #[serde(skip_serializing_if = "Option::is_none")]
2231 pub end: Option<BTreeMap<String, i64>>,
2232 #[serde(skip_serializing_if = "Option::is_none")]
2234 pub references: Option<Vec<i32>>,
2235 #[serde(skip_serializing_if = "Option::is_none")]
2237 pub timeline: Option<String>,
2238 }
2239
2240 pub fn create(project: &str, content: &str, options: TimelineCreateOptions) -> crate::Result<TimelineEntry> {
2244 #[derive(Serialize)]
2245 struct Input<'a> {
2246 project: &'a str,
2247 content: &'a str,
2248 #[serde(flatten)]
2249 options: TimelineCreateOptions,
2250 }
2251 crate::call("timeline.create", &Input { project, content, options })
2252 }
2253
2254 pub fn delete(project: &str, id: i32) -> crate::Result<TimelineEntry> {
2258 #[derive(Serialize)]
2259 struct Input<'a> {
2260 project: &'a str,
2261 id: i32,
2262 }
2263 crate::call("timeline.delete", &Input { project, id })
2264 }
2265
2266 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
2268 pub struct TimelineListOptions {
2269 #[serde(skip_serializing_if = "Option::is_none")]
2271 pub timeline: Option<String>,
2272 #[serde(skip_serializing_if = "Option::is_none")]
2274 pub orphaned: Option<bool>,
2275 }
2276
2277 pub fn list(project: &str, options: TimelineListOptions) -> crate::Result<Timeline> {
2281 #[derive(Serialize)]
2282 struct Input<'a> {
2283 project: &'a str,
2284 #[serde(flatten)]
2285 options: TimelineListOptions,
2286 }
2287 crate::call("timeline.list", &Input { project, options })
2288 }
2289
2290 pub fn r#move(project: &str, id: i32, index: i32) -> crate::Result<TimelineEntry> {
2294 #[derive(Serialize)]
2295 struct Input<'a> {
2296 project: &'a str,
2297 id: i32,
2298 index: i32,
2299 }
2300 crate::call("timeline.move", &Input { project, id, index })
2301 }
2302
2303 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
2305 pub struct TimelinePlaceOptions {
2306 #[serde(skip_serializing_if = "Option::is_none")]
2308 pub start: Option<BTreeMap<String, i64>>,
2309 #[serde(skip_serializing_if = "Option::is_none")]
2311 pub end: Option<BTreeMap<String, i64>>,
2312 #[serde(skip_serializing_if = "Option::is_none")]
2314 pub lane: Option<String>,
2315 #[serde(skip_serializing_if = "Option::is_none")]
2317 pub milestone: Option<bool>,
2318 #[serde(skip_serializing_if = "Option::is_none")]
2320 pub timeline: Option<String>,
2321 }
2322
2323 pub fn place(project: &str, kind: TimelineKindDto, subject: i32, options: TimelinePlaceOptions) -> crate::Result<TimelineEntry> {
2327 #[derive(Serialize)]
2328 struct Input<'a> {
2329 project: &'a str,
2330 kind: TimelineKindDto,
2331 subject: i32,
2332 #[serde(flatten)]
2333 options: TimelinePlaceOptions,
2334 }
2335 crate::call("timeline.place", &Input { project, kind, subject, options })
2336 }
2337
2338 pub fn read(project: &str, id: i32) -> crate::Result<TimelineEntry> {
2342 #[derive(Serialize)]
2343 struct Input<'a> {
2344 project: &'a str,
2345 id: i32,
2346 }
2347 crate::call("timeline.read", &Input { project, id })
2348 }
2349
2350 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
2352 pub struct TimelineSetOptions {
2353 #[serde(skip_serializing_if = "Option::is_none")]
2355 pub title: Option<String>,
2356 #[serde(skip_serializing_if = "Option::is_none")]
2358 pub label: Option<String>,
2359 #[serde(skip_serializing_if = "Option::is_none")]
2361 pub lane: Option<String>,
2362 #[serde(skip_serializing_if = "Option::is_none")]
2364 pub milestone: Option<bool>,
2365 #[serde(skip_serializing_if = "Option::is_none")]
2367 pub start: Option<BTreeMap<String, i64>>,
2368 #[serde(skip_serializing_if = "Option::is_none")]
2370 pub end: Option<BTreeMap<String, i64>>,
2371 #[serde(skip_serializing_if = "Option::is_none")]
2373 pub clear: Option<Vec<String>>,
2374 #[serde(skip_serializing_if = "Option::is_none")]
2376 pub timeline: Option<String>,
2377 }
2378
2379 pub fn set(project: &str, id: i32, options: TimelineSetOptions) -> crate::Result<TimelineEntry> {
2383 #[derive(Serialize)]
2384 struct Input<'a> {
2385 project: &'a str,
2386 id: i32,
2387 #[serde(flatten)]
2388 options: TimelineSetOptions,
2389 }
2390 crate::call("timeline.set", &Input { project, id, options })
2391 }
2392
2393 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
2395 pub struct TimelineUpdateOptions {
2396 #[serde(skip_serializing_if = "Option::is_none")]
2398 pub date: Option<String>,
2399 #[serde(skip_serializing_if = "Option::is_none")]
2400 pub tags: Option<Vec<String>>,
2401 #[serde(skip_serializing_if = "Option::is_none")]
2402 pub title: Option<String>,
2403 #[serde(skip_serializing_if = "Option::is_none")]
2405 pub label: Option<String>,
2406 #[serde(skip_serializing_if = "Option::is_none")]
2407 pub lane: Option<String>,
2408 #[serde(skip_serializing_if = "Option::is_none")]
2409 pub milestone: Option<bool>,
2410 #[serde(skip_serializing_if = "Option::is_none")]
2412 pub start: Option<BTreeMap<String, i64>>,
2413 #[serde(skip_serializing_if = "Option::is_none")]
2415 pub end: Option<BTreeMap<String, i64>>,
2416 #[serde(skip_serializing_if = "Option::is_none")]
2418 pub references: Option<Vec<i32>>,
2419 }
2420
2421 pub fn update(project: &str, id: i32, content: &str, options: TimelineUpdateOptions) -> crate::Result<TimelineEntry> {
2425 #[derive(Serialize)]
2426 struct Input<'a> {
2427 project: &'a str,
2428 id: i32,
2429 content: &'a str,
2430 #[serde(flatten)]
2431 options: TimelineUpdateOptions,
2432 }
2433 crate::call("timeline.update", &Input { project, id, content, options })
2434 }
2435
2436 pub mod def {
2438 use super::*;
2439
2440 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
2442 pub struct TimelineDefCreateOptions {
2443 #[serde(skip_serializing_if = "Option::is_none")]
2445 pub mode: Option<TimelineModeDto>,
2446 #[serde(skip_serializing_if = "Option::is_none")]
2448 pub calendar: Option<CalendarDto>,
2449 #[serde(rename = "laneOrder")]
2451 #[serde(skip_serializing_if = "Option::is_none")]
2452 pub lane_order: Option<Vec<String>>,
2453 }
2454
2455 pub fn create(project: &str, name: &str, options: TimelineDefCreateOptions) -> crate::Result<TimelineDefDto> {
2459 #[derive(Serialize)]
2460 struct Input<'a> {
2461 project: &'a str,
2462 name: &'a str,
2463 #[serde(flatten)]
2464 options: TimelineDefCreateOptions,
2465 }
2466 crate::call("timeline.def.create", &Input { project, name, options })
2467 }
2468
2469 pub fn delete(project: &str, timeline: &str) -> crate::Result<TimelineDefDeleted> {
2473 #[derive(Serialize)]
2474 struct Input<'a> {
2475 project: &'a str,
2476 timeline: &'a str,
2477 }
2478 crate::call("timeline.def.delete", &Input { project, timeline })
2479 }
2480
2481 }
2482
2483 pub mod settings {
2485 use super::*;
2486
2487 pub fn read(project: &str) -> crate::Result<TimelineSettings> {
2491 #[derive(Serialize)]
2492 struct Input<'a> {
2493 project: &'a str,
2494 }
2495 crate::call("timeline.settings.read", &Input { project })
2496 }
2497
2498 #[derive(Debug, Clone, Default, PartialEq, Serialize)]
2500 pub struct TimelineSettingsWriteOptions {
2501 #[serde(skip_serializing_if = "Option::is_none")]
2503 pub name: Option<String>,
2504 #[serde(skip_serializing_if = "Option::is_none")]
2506 pub mode: Option<TimelineModeDto>,
2507 #[serde(skip_serializing_if = "Option::is_none")]
2508 pub calendar: Option<CalendarDto>,
2509 #[serde(rename = "laneOrder")]
2511 #[serde(skip_serializing_if = "Option::is_none")]
2512 pub lane_order: Option<Vec<String>>,
2513 #[serde(skip_serializing_if = "Option::is_none")]
2515 pub spacing: Option<EvenSpacingDto>,
2516 #[serde(skip_serializing_if = "Option::is_none")]
2518 pub timeline: Option<String>,
2519 }
2520
2521 pub fn write(project: &str, options: TimelineSettingsWriteOptions) -> crate::Result<TimelineSettings> {
2525 #[derive(Serialize)]
2526 struct Input<'a> {
2527 project: &'a str,
2528 #[serde(flatten)]
2529 options: TimelineSettingsWriteOptions,
2530 }
2531 crate::call("timeline.settings.write", &Input { project, options })
2532 }
2533
2534 }
2535
2536}