-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathentities.ts
More file actions
146 lines (134 loc) · 3.32 KB
/
entities.ts
File metadata and controls
146 lines (134 loc) · 3.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
export type TagCategory =
| "fandom"
| "character"
| "relationship"
| "archive warning"
| "additional tags";
export interface Tag {
name: string;
// Not all tags have user-facing IDs Example: additional tags.
// TODO: figure out other types (or whether they can be extracted from somewhere else).
id: string | null;
category: TagCategory;
canonical: boolean;
common: boolean;
// Canonical name will be the same as "name" on canonical tags, and different on tags
// that have been synned to a canonical. It will be null when tags haven't been marked as
// common and cannot be filtered on.
canonicalName: string | null;
}
export interface User {
id: string;
username: string;
pseuds: string;
url: string;
icon: string;
header: string | null;
joined: string;
location: string | null;
email: string | null;
birthday: string | null;
works: number;
series: number;
bookmarks: number;
collections: number;
gifts: number;
bioHtml: string | null;
}
export enum WorkRatings {
NOT_RATED = "Not Rated",
GENERAL_AUDIENCES = "General Audiences",
TEEN_AND_UP_AUDIENCES = "Teen And Up Audiences",
MATURE = "Mature",
EXPLICIT = "Explicit",
}
export enum WorkCategory {
FF = "F/F",
FM = "F/M",
GEN = "Gen",
MM = "M/M",
MULTI = "Multi",
OTHER = "Other",
}
export enum WorkWarningStatus {
NO_WARNINGS_APPLY = "Author indicated no warnings apply",
CHOOSE_NOT_TO_WARN = "Author chose not to warn",
EXTERNAL = "External work",
HAS_WARNING = "Work has one or more warning",
}
export enum WorkWarnings {
GRAPHIC_VIOLENCE = "Graphic Depictions Of Violence",
MAJOR_CHARACTER_DEATH = "Major Character Death",
NO_WARNINGS_APPLY = "No Archive Warnings Apply",
NONCON = "Rape/Non-Con",
UNDERAGE = "Underage",
CHOOSE_NOT_TO_WARN = "Creator Chose Not To Use Archive Warnings",
}
export interface Author {
username: string;
pseud: string;
}
export interface WorkSummary {
id: string;
title: string;
category: WorkCategory[] | null;
// Date in ISO format. See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
// Note that AO3 doesn't publish the actual time of publish, just the date.
publishedAt: string;
updatedAt: string | null;
// TODO: should this be in HTML?
summary: string | null;
rating: WorkRatings;
// Whether this work will display the "this work could have adult content" banner
// upon access.
adult: boolean;
fandoms: string[];
tags: {
warnings: WorkWarnings[];
characters: string[];
relationships: string[];
additional: string[];
};
authors: "Anonymous" | Author[];
language: string;
words: number;
chapters: {
published: number;
total: number | null;
};
complete: boolean;
stats: {
bookmarks: number;
comments: number;
kudos: number;
hits: number;
};
locked: false;
}
export interface LockedWorkSummary {
locked: true;
}
export interface Chapter {
id: string;
workId: string;
index: number;
title: string;
publishedAt: string;
url: string;
}
export interface WorkSeries {
id: string;
title: string;
url: string;
currentWork: {
id: string;
index: number;
prevWorkId: string | null;
nextWorkId: string | null;
};
}
export interface WorkCollection {
displayTitle: string;
collectionName: string;
url: string;
}