@ndla/types-backend 0.2.39 → 0.2.41

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.
@@ -1,4 +1,4 @@
1
- export type Availability = ("everyone" | "teacher");
1
+ export type Availability = ("decoder" | "encoder" | "everyone" | "teacher");
2
2
  export interface IArticleContentV2 {
3
3
  content: string;
4
4
  language: string;
@@ -1,4 +1,3 @@
1
- export type Either = (ILeft | IRight);
2
1
  export interface IAuthor {
3
2
  type: string;
4
3
  name: string;
@@ -140,10 +139,6 @@ export interface IGlossExample {
140
139
  [key: string]: string;
141
140
  };
142
141
  }
143
- export interface ILeft {
144
- value: "Could not find TSType[A] in scope and could not generate it";
145
- type: "Left";
146
- }
147
142
  export interface ILicense {
148
143
  license: string;
149
144
  description?: string;
@@ -167,10 +162,6 @@ export interface INewConceptMetaImage {
167
162
  id: string;
168
163
  alt: string;
169
164
  }
170
- export interface IRight {
171
- value: "Could not find TSType[B] in scope and could not generate it";
172
- type: "Right";
173
- }
174
165
  export interface IStatus {
175
166
  current: string;
176
167
  other: string[];
@@ -191,14 +182,14 @@ export interface IUpdatedConcept {
191
182
  language: string;
192
183
  title?: string;
193
184
  content?: string;
194
- metaImage: Either;
185
+ metaImage?: (null | INewConceptMetaImage);
195
186
  copyright?: IDraftCopyright;
196
187
  tags?: string[];
197
188
  subjectIds?: string[];
198
189
  articleIds?: number[];
199
190
  status?: string;
200
191
  visualElement?: string;
201
- responsibleId: Either;
192
+ responsibleId?: (null | string);
202
193
  conceptType?: string;
203
194
  glossData?: IGlossData;
204
195
  }
@@ -1,5 +1,4 @@
1
- export type Availability = ("everyone" | "teacher");
2
- export type Either = (ILeft | IRight);
1
+ export type Availability = ("decoder" | "encoder" | "everyone" | "teacher");
3
2
  export interface IArticle {
4
3
  id: number;
5
4
  oldNdlaUrl?: string;
@@ -113,10 +112,6 @@ export interface IGrepCodesSearchResult {
113
112
  pageSize: number;
114
113
  results: string[];
115
114
  }
116
- export interface ILeft {
117
- value: "Could not find TSType[A] in scope and could not generate it";
118
- type: "Left";
119
- }
120
115
  export interface ILicense {
121
116
  license: string;
122
117
  description?: string;
@@ -171,10 +166,6 @@ export interface IRevisionMeta {
171
166
  note: string;
172
167
  status: string;
173
168
  }
174
- export interface IRight {
175
- value: "Could not find TSType[B] in scope and could not generate it";
176
- type: "Right";
177
- }
178
169
  export interface ISearchResult {
179
170
  totalCount: number;
180
171
  page: number;
@@ -203,7 +194,7 @@ export interface IUpdatedArticle {
203
194
  tags?: string[];
204
195
  introduction?: string;
205
196
  metaDescription?: string;
206
- metaImage: Either;
197
+ metaImage?: (null | INewArticleMetaImage);
207
198
  visualElement?: string;
208
199
  copyright?: IDraftCopyright;
209
200
  requiredLibraries?: IRequiredLibrary[];
@@ -216,7 +207,7 @@ export interface IUpdatedArticle {
216
207
  availability?: string;
217
208
  relatedContent?: (IRelatedContentLink | number)[];
218
209
  revisionMeta?: IRevisionMeta[];
219
- responsibleId: Either;
210
+ responsibleId?: (null | string);
220
211
  slug?: string;
221
212
  comments?: IUpdatedComment[];
222
213
  prioritized?: boolean;
@@ -1,4 +1,3 @@
1
- export type Either = (ILeft | IRight);
2
1
  export interface IAuthor {
3
2
  type: string;
4
3
  name: string;
@@ -101,10 +100,6 @@ export interface IImageTitle {
101
100
  title: string;
102
101
  language: string;
103
102
  }
104
- export interface ILeft {
105
- value: "Could not find TSType[A] in scope and could not generate it";
106
- type: "Left";
107
- }
108
103
  export interface ILicense {
109
104
  license: string;
110
105
  description?: string;
@@ -119,10 +114,6 @@ export interface INewImageMetaInformationV2 {
119
114
  language: string;
120
115
  modelReleased?: string;
121
116
  }
122
- export interface IRight {
123
- value: "Could not find TSType[B] in scope and could not generate it";
124
- type: "Right";
125
- }
126
117
  export interface ISearchParams {
127
118
  query?: string;
128
119
  license?: string;
@@ -161,7 +152,7 @@ export interface ITagsSearchResult {
161
152
  export interface IUpdateImageMetaInformation {
162
153
  language: string;
163
154
  title?: string;
164
- alttext: Either;
155
+ alttext?: (null | string);
165
156
  copyright?: ICopyright;
166
157
  tags?: string[];
167
158
  caption?: string;
@@ -1,7 +1,38 @@
1
+ export type ArenaGroup = "ADMIN";
2
+ export interface IArenaUser {
3
+ id: number;
4
+ displayName: string;
5
+ username: string;
6
+ location: string;
7
+ groups: ArenaGroup[];
8
+ }
1
9
  export interface IBreadcrumb {
2
10
  id: string;
3
11
  name: string;
4
12
  }
13
+ export interface ICategory {
14
+ id: number;
15
+ title: string;
16
+ description: string;
17
+ topicCount: number;
18
+ postCount: number;
19
+ isFollowing: boolean;
20
+ visible: boolean;
21
+ rank: number;
22
+ }
23
+ export interface ICategoryWithTopics {
24
+ id: number;
25
+ title: string;
26
+ description: string;
27
+ topicCount: number;
28
+ postCount: number;
29
+ topicPage: number;
30
+ topicPageSize: number;
31
+ topics: ITopic[];
32
+ isFollowing: boolean;
33
+ visible: boolean;
34
+ rank: number;
35
+ }
5
36
  export interface IConfigMeta {
6
37
  key: string;
7
38
  value: (boolean | string[]);
@@ -12,6 +43,14 @@ export interface IConfigMetaRestricted {
12
43
  key: string;
13
44
  value: (boolean | string[]);
14
45
  }
46
+ export interface IFlag {
47
+ id: number;
48
+ reason: string;
49
+ created: string;
50
+ resolved?: string;
51
+ isResolved: boolean;
52
+ flagger: IArenaUser;
53
+ }
15
54
  export interface IFolder {
16
55
  id: string;
17
56
  name: string;
@@ -46,6 +85,15 @@ export interface IMyNDLAUser {
46
85
  groups: IMyNDLAGroup[];
47
86
  arenaEnabled: boolean;
48
87
  shareName: boolean;
88
+ arenaGroups: ArenaGroup[];
89
+ }
90
+ export interface INewCategory {
91
+ title: string;
92
+ description: string;
93
+ visible: boolean;
94
+ }
95
+ export interface INewFlag {
96
+ reason: string;
49
97
  }
50
98
  export interface INewFolder {
51
99
  name: string;
@@ -53,15 +101,63 @@ export interface INewFolder {
53
101
  status?: string;
54
102
  description?: string;
55
103
  }
104
+ export interface INewPost {
105
+ content: string;
106
+ }
107
+ export interface INewPostNotification {
108
+ id: number;
109
+ topicId: number;
110
+ isRead: boolean;
111
+ topicTitle: string;
112
+ post: IPost;
113
+ notificationTime: string;
114
+ }
56
115
  export interface INewResource {
57
116
  resourceType: string;
58
117
  path: string;
59
118
  tags?: string[];
60
119
  resourceId: string;
61
120
  }
121
+ export interface INewTopic {
122
+ title: string;
123
+ initialPost: INewPost;
124
+ }
62
125
  export interface IOwner {
63
126
  name: string;
64
127
  }
128
+ export interface IPaginatedArenaUsers {
129
+ totalCount: number;
130
+ page: number;
131
+ pageSize: number;
132
+ items: IArenaUser[];
133
+ }
134
+ export interface IPaginatedNewPostNotifications {
135
+ totalCount: number;
136
+ page: number;
137
+ pageSize: number;
138
+ items: INewPostNotification[];
139
+ }
140
+ export interface IPaginatedPosts {
141
+ totalCount: number;
142
+ page: number;
143
+ pageSize: number;
144
+ items: IPost[];
145
+ }
146
+ export interface IPaginatedTopics {
147
+ totalCount: number;
148
+ page: number;
149
+ pageSize: number;
150
+ items: ITopic[];
151
+ }
152
+ export interface IPost {
153
+ id: number;
154
+ content: string;
155
+ created: string;
156
+ updated: string;
157
+ owner: IArenaUser;
158
+ flags?: IFlag[];
159
+ topicId: number;
160
+ }
65
161
  export interface IResource {
66
162
  id: string;
67
163
  resourceType: string;
@@ -71,11 +167,36 @@ export interface IResource {
71
167
  resourceId: string;
72
168
  rank?: number;
73
169
  }
170
+ export interface ITopic {
171
+ id: number;
172
+ title: string;
173
+ postCount: number;
174
+ created: string;
175
+ updated: string;
176
+ categoryId: number;
177
+ isFollowing: boolean;
178
+ }
179
+ export interface ITopicWithPosts {
180
+ id: number;
181
+ title: string;
182
+ postCount: number;
183
+ posts: IPaginatedPosts;
184
+ created: string;
185
+ updated: string;
186
+ categoryId: number;
187
+ isFollowing: boolean;
188
+ }
74
189
  export interface IUpdatedFolder {
75
190
  name?: string;
76
191
  status?: string;
77
192
  description?: string;
78
193
  }
194
+ export interface IUpdatedMyNDLAUser {
195
+ favoriteSubjects?: string[];
196
+ arenaEnabled?: boolean;
197
+ shareName?: boolean;
198
+ arenaGroups?: ArenaGroup[];
199
+ }
79
200
  export interface IUpdatedResource {
80
201
  tags?: string[];
81
202
  resourceId?: string;
package/package.json CHANGED
@@ -27,5 +27,5 @@
27
27
  "devDependencies": {
28
28
  "typescript": "^5.0.2"
29
29
  },
30
- "version": "0.2.39"
30
+ "version": "0.2.41"
31
31
  }