@ndla/types-backend 0.2.101 → 1.0.2

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.
@@ -10,60 +10,60 @@ export declare enum DraftSortEnum {
10
10
  ByIdAsc = "id"
11
11
  }
12
12
  export type Grade = (1 | 2 | 3 | 4 | 5);
13
- export interface IArticle {
13
+ export interface IArticleContentDTO {
14
+ content: string;
15
+ language: string;
16
+ }
17
+ export interface IArticleDTO {
14
18
  id: number;
15
19
  oldNdlaUrl?: string;
16
20
  revision: number;
17
- status: IStatus;
18
- title?: IArticleTitle;
19
- content?: IArticleContent;
20
- copyright?: IDraftCopyright;
21
- tags?: IArticleTag;
22
- requiredLibraries: IRequiredLibrary[];
23
- visualElement?: IVisualElement;
24
- introduction?: IArticleIntroduction;
25
- metaDescription?: IArticleMetaDescription;
26
- metaImage?: IArticleMetaImage;
21
+ status: IStatusDTO;
22
+ title?: IArticleTitleDTO;
23
+ content?: IArticleContentDTO;
24
+ copyright?: IDraftCopyrightDTO;
25
+ tags?: IArticleTagDTO;
26
+ requiredLibraries: IRequiredLibraryDTO[];
27
+ visualElement?: IVisualElementDTO;
28
+ introduction?: IArticleIntroductionDTO;
29
+ metaDescription?: IArticleMetaDescriptionDTO;
30
+ metaImage?: IArticleMetaImageDTO;
27
31
  created: string;
28
32
  updated: string;
29
33
  updatedBy: string;
30
34
  published: string;
31
35
  articleType: string;
32
36
  supportedLanguages: string[];
33
- notes: IEditorNote[];
37
+ notes: IEditorNoteDTO[];
34
38
  editorLabels: string[];
35
39
  grepCodes: string[];
36
40
  conceptIds: number[];
37
41
  availability: string;
38
- relatedContent: (IRelatedContentLink | number)[];
39
- revisions: IRevisionMeta[];
40
- responsible?: IDraftResponsible;
42
+ relatedContent: (IRelatedContentLinkDTO | number)[];
43
+ revisions: IRevisionMetaDTO[];
44
+ responsible?: IDraftResponsibleDTO;
41
45
  slug?: string;
42
- comments: IComment[];
46
+ comments: ICommentDTO[];
43
47
  prioritized: boolean;
44
48
  priority: string;
45
49
  started: boolean;
46
- qualityEvaluation?: IQualityEvaluation;
47
- }
48
- export interface IArticleContent {
49
- content: string;
50
- language: string;
50
+ qualityEvaluation?: IQualityEvaluationDTO;
51
51
  }
52
- export interface IArticleIntroduction {
52
+ export interface IArticleIntroductionDTO {
53
53
  introduction: string;
54
54
  htmlIntroduction: string;
55
55
  language: string;
56
56
  }
57
- export interface IArticleMetaDescription {
57
+ export interface IArticleMetaDescriptionDTO {
58
58
  metaDescription: string;
59
59
  language: string;
60
60
  }
61
- export interface IArticleMetaImage {
61
+ export interface IArticleMetaImageDTO {
62
62
  url: string;
63
63
  alt: string;
64
64
  language: string;
65
65
  }
66
- export interface IArticleSearchParams {
66
+ export interface IArticleSearchParamsDTO {
67
67
  query?: string;
68
68
  language?: string;
69
69
  license?: string;
@@ -76,36 +76,36 @@ export interface IArticleSearchParams {
76
76
  fallback?: boolean;
77
77
  grepCodes?: string[];
78
78
  }
79
- export interface IArticleSummary {
79
+ export interface IArticleSummaryDTO {
80
80
  id: number;
81
- title: IArticleTitle;
82
- visualElement?: IVisualElement;
83
- introduction?: IArticleIntroduction;
81
+ title: IArticleTitleDTO;
82
+ visualElement?: IVisualElementDTO;
83
+ introduction?: IArticleIntroductionDTO;
84
84
  url: string;
85
85
  license: string;
86
86
  articleType: string;
87
87
  supportedLanguages: string[];
88
- tags?: IArticleTag;
88
+ tags?: IArticleTagDTO;
89
89
  notes: string[];
90
90
  users: string[];
91
91
  grepCodes: string[];
92
- status: IStatus;
92
+ status: IStatusDTO;
93
93
  updated: string;
94
94
  }
95
- export interface IArticleTag {
95
+ export interface IArticleTagDTO {
96
96
  tags: string[];
97
97
  language: string;
98
98
  }
99
- export interface IArticleTitle {
99
+ export interface IArticleTitleDTO {
100
100
  title: string;
101
101
  htmlTitle: string;
102
102
  language: string;
103
103
  }
104
- export interface IAuthor {
104
+ export interface IAuthorDTO {
105
105
  type: string;
106
106
  name: string;
107
107
  }
108
- export interface IComment {
108
+ export interface ICommentDTO {
109
109
  id: string;
110
110
  content: string;
111
111
  created: string;
@@ -113,38 +113,38 @@ export interface IComment {
113
113
  isOpen: boolean;
114
114
  solved: boolean;
115
115
  }
116
- export interface IDraftCopyright {
117
- license?: ILicense;
116
+ export interface IDraftCopyrightDTO {
117
+ license?: ILicenseDTO;
118
118
  origin?: string;
119
- creators: IAuthor[];
120
- processors: IAuthor[];
121
- rightsholders: IAuthor[];
119
+ creators: IAuthorDTO[];
120
+ processors: IAuthorDTO[];
121
+ rightsholders: IAuthorDTO[];
122
122
  validFrom?: string;
123
123
  validTo?: string;
124
124
  processed: boolean;
125
125
  }
126
- export interface IDraftResponsible {
126
+ export interface IDraftResponsibleDTO {
127
127
  responsibleId: string;
128
128
  lastUpdated: string;
129
129
  }
130
- export interface IEditorNote {
130
+ export interface IEditorNoteDTO {
131
131
  note: string;
132
132
  user: string;
133
- status: IStatus;
133
+ status: IStatusDTO;
134
134
  timestamp: string;
135
135
  }
136
- export interface IGrepCodesSearchResult {
136
+ export interface IGrepCodesSearchResultDTO {
137
137
  totalCount: number;
138
138
  page: number;
139
139
  pageSize: number;
140
140
  results: string[];
141
141
  }
142
- export interface ILicense {
142
+ export interface ILicenseDTO {
143
143
  license: string;
144
144
  description?: string;
145
145
  url?: string;
146
146
  }
147
- export interface INewArticle {
147
+ export interface INewArticleDTO {
148
148
  language: string;
149
149
  title: string;
150
150
  published?: string;
@@ -152,75 +152,75 @@ export interface INewArticle {
152
152
  tags?: string[];
153
153
  introduction?: string;
154
154
  metaDescription?: string;
155
- metaImage?: INewArticleMetaImage;
155
+ metaImage?: INewArticleMetaImageDTO;
156
156
  visualElement?: string;
157
- copyright?: IDraftCopyright;
158
- requiredLibraries?: IRequiredLibrary[];
157
+ copyright?: IDraftCopyrightDTO;
158
+ requiredLibraries?: IRequiredLibraryDTO[];
159
159
  articleType: string;
160
160
  notes?: string[];
161
161
  editorLabels?: string[];
162
162
  grepCodes?: string[];
163
163
  conceptIds?: number[];
164
164
  availability?: string;
165
- relatedContent?: (IRelatedContentLink | number)[];
166
- revisionMeta?: IRevisionMeta[];
165
+ relatedContent?: (IRelatedContentLinkDTO | number)[];
166
+ revisionMeta?: IRevisionMetaDTO[];
167
167
  responsibleId?: string;
168
168
  slug?: string;
169
- comments?: INewComment[];
169
+ comments?: INewCommentDTO[];
170
170
  prioritized?: boolean;
171
171
  priority?: string;
172
- qualityEvaluation?: IQualityEvaluation;
172
+ qualityEvaluation?: IQualityEvaluationDTO;
173
173
  }
174
- export interface INewArticleMetaImage {
174
+ export interface INewArticleMetaImageDTO {
175
175
  id: string;
176
176
  alt: string;
177
177
  }
178
- export interface INewComment {
178
+ export interface INewCommentDTO {
179
179
  content: string;
180
180
  isOpen?: boolean;
181
181
  }
182
- export interface IQualityEvaluation {
182
+ export interface IQualityEvaluationDTO {
183
183
  grade: Grade;
184
184
  note?: string;
185
185
  }
186
- export interface IRelatedContentLink {
186
+ export interface IRelatedContentLinkDTO {
187
187
  title: string;
188
188
  url: string;
189
189
  }
190
- export interface IRequiredLibrary {
190
+ export interface IRequiredLibraryDTO {
191
191
  mediaType: string;
192
192
  name: string;
193
193
  url: string;
194
194
  }
195
- export interface IRevisionMeta {
195
+ export interface IRevisionMetaDTO {
196
196
  id?: string;
197
197
  revisionDate: string;
198
198
  note: string;
199
199
  status: string;
200
200
  }
201
- export interface ISavedSearch {
201
+ export interface ISavedSearchDTO {
202
202
  searchUrl: string;
203
203
  searchPhrase: string;
204
204
  }
205
- export interface ISearchResult {
205
+ export interface ISearchResultDTO {
206
206
  totalCount: number;
207
207
  page: number;
208
208
  pageSize: number;
209
209
  language: string;
210
- results: IArticleSummary[];
210
+ results: IArticleSummaryDTO[];
211
211
  }
212
- export interface IStatus {
212
+ export interface IStatusDTO {
213
213
  current: string;
214
214
  other: string[];
215
215
  }
216
- export interface ITagsSearchResult {
216
+ export interface ITagsSearchResultDTO {
217
217
  totalCount: number;
218
218
  page: number;
219
219
  pageSize: number;
220
220
  language: string;
221
221
  results: string[];
222
222
  }
223
- export interface IUpdatedArticle {
223
+ export interface IUpdatedArticleDTO {
224
224
  revision: number;
225
225
  language?: string;
226
226
  title?: string;
@@ -230,10 +230,10 @@ export interface IUpdatedArticle {
230
230
  tags?: string[];
231
231
  introduction?: string;
232
232
  metaDescription?: string;
233
- metaImage: UpdateOrDeleteNewArticleMetaImage;
233
+ metaImage: UpdateOrDeleteNewArticleMetaImageDTO;
234
234
  visualElement?: string;
235
- copyright?: IDraftCopyright;
236
- requiredLibraries?: IRequiredLibrary[];
235
+ copyright?: IDraftCopyrightDTO;
236
+ requiredLibraries?: IRequiredLibraryDTO[];
237
237
  articleType?: string;
238
238
  notes?: string[];
239
239
  editorLabels?: string[];
@@ -241,44 +241,44 @@ export interface IUpdatedArticle {
241
241
  conceptIds?: number[];
242
242
  createNewVersion?: boolean;
243
243
  availability?: string;
244
- relatedContent?: (IRelatedContentLink | number)[];
245
- revisionMeta?: IRevisionMeta[];
244
+ relatedContent?: (IRelatedContentLinkDTO | number)[];
245
+ revisionMeta?: IRevisionMetaDTO[];
246
246
  responsibleId: UpdateOrDeleteString;
247
247
  slug?: string;
248
- comments?: IUpdatedComment[];
248
+ comments?: IUpdatedCommentDTO[];
249
249
  prioritized?: boolean;
250
250
  priority?: string;
251
- qualityEvaluation?: IQualityEvaluation;
251
+ qualityEvaluation?: IQualityEvaluationDTO;
252
252
  }
253
- export interface IUpdatedComment {
253
+ export interface IUpdatedCommentDTO {
254
254
  id?: string;
255
255
  content: string;
256
256
  isOpen?: boolean;
257
257
  solved?: boolean;
258
258
  }
259
- export interface IUpdatedUserData {
260
- savedSearches?: ISavedSearch[];
259
+ export interface IUpdatedUserDataDTO {
260
+ savedSearches?: ISavedSearchDTO[];
261
261
  latestEditedArticles?: string[];
262
262
  latestEditedConcepts?: string[];
263
263
  favoriteSubjects?: string[];
264
264
  }
265
- export interface IUploadedFile {
265
+ export interface IUploadedFileDTO {
266
266
  filename: string;
267
267
  mime: string;
268
268
  extension: string;
269
269
  path: string;
270
270
  }
271
- export interface IUserData {
271
+ export interface IUserDataDTO {
272
272
  userId: string;
273
- savedSearches?: ISavedSearch[];
273
+ savedSearches?: ISavedSearchDTO[];
274
274
  latestEditedArticles?: string[];
275
275
  latestEditedConcepts?: string[];
276
276
  favoriteSubjects?: string[];
277
277
  }
278
- export interface IVisualElement {
278
+ export interface IVisualElementDTO {
279
279
  visualElement: string;
280
280
  language: string;
281
281
  }
282
282
  export type Sort = DraftSortEnum;
283
- export type UpdateOrDeleteNewArticleMetaImage = (null | undefined | INewArticleMetaImage);
283
+ export type UpdateOrDeleteNewArticleMetaImageDTO = (null | undefined | INewArticleMetaImageDTO);
284
284
  export type UpdateOrDeleteString = (null | undefined | string);
@@ -1,15 +1,15 @@
1
- export interface IAboutFilmSubject {
1
+ export interface IAboutFilmSubjectDTO {
2
2
  title: string;
3
3
  description: string;
4
- visualElement: IVisualElement;
4
+ visualElement: IVisualElementDTO;
5
5
  language: string;
6
6
  }
7
- export interface IAboutSubject {
7
+ export interface IAboutSubjectDTO {
8
8
  title: string;
9
9
  description: string;
10
- visualElement: IVisualElement;
10
+ visualElement: IVisualElementDTO;
11
11
  }
12
- export interface IBannerImage {
12
+ export interface IBannerImageDTO {
13
13
  mobileUrl?: string;
14
14
  mobileId?: number;
15
15
  desktopUrl: string;
@@ -21,81 +21,81 @@ export interface IErrorBody {
21
21
  occurredAt: string;
22
22
  statusCode: number;
23
23
  }
24
- export interface IFilmFrontPageData {
24
+ export interface IFilmFrontPageDataDTO {
25
25
  name: string;
26
- about: IAboutFilmSubject[];
27
- movieThemes: IMovieTheme[];
26
+ about: IAboutFilmSubjectDTO[];
27
+ movieThemes: IMovieThemeDTO[];
28
28
  slideShow: string[];
29
29
  article?: string;
30
30
  }
31
- export interface IFrontPage {
31
+ export interface IFrontPageDTO {
32
32
  articleId: number;
33
- menu: IMenu[];
33
+ menu: IMenuDTO[];
34
34
  }
35
- export interface IMenu {
35
+ export interface IMenuDTO {
36
36
  articleId: number;
37
- menu: IMenuData[];
37
+ menu: IMenuDataDTO[];
38
38
  hideLevel?: boolean;
39
39
  }
40
- export type IMenuData = IMenu;
41
- export interface IMovieTheme {
42
- name: IMovieThemeName[];
40
+ export type IMenuDataDTO = IMenuDTO;
41
+ export interface IMovieThemeDTO {
42
+ name: IMovieThemeNameDTO[];
43
43
  movies: string[];
44
44
  }
45
- export interface IMovieThemeName {
45
+ export interface IMovieThemeNameDTO {
46
46
  name: string;
47
47
  language: string;
48
48
  }
49
- export interface INewOrUpdateBannerImage {
49
+ export interface INewOrUpdateBannerImageDTO {
50
50
  mobileImageId?: number;
51
51
  desktopImageId: number;
52
52
  }
53
- export interface INewOrUpdatedAboutSubject {
53
+ export interface INewOrUpdatedAboutSubjectDTO {
54
54
  title: string;
55
55
  description: string;
56
56
  language: string;
57
- visualElement: INewOrUpdatedVisualElement;
57
+ visualElement: INewOrUpdatedVisualElementDTO;
58
58
  }
59
- export interface INewOrUpdatedFilmFrontPageData {
59
+ export interface INewOrUpdatedFilmFrontPageDataDTO {
60
60
  name: string;
61
- about: INewOrUpdatedAboutSubject[];
62
- movieThemes: INewOrUpdatedMovieTheme[];
61
+ about: INewOrUpdatedAboutSubjectDTO[];
62
+ movieThemes: INewOrUpdatedMovieThemeDTO[];
63
63
  slideShow: string[];
64
64
  article?: string;
65
65
  }
66
- export interface INewOrUpdatedMetaDescription {
66
+ export interface INewOrUpdatedMetaDescriptionDTO {
67
67
  metaDescription: string;
68
68
  language: string;
69
69
  }
70
- export interface INewOrUpdatedMovieName {
70
+ export interface INewOrUpdatedMovieNameDTO {
71
71
  name: string;
72
72
  language: string;
73
73
  }
74
- export interface INewOrUpdatedMovieTheme {
75
- name: INewOrUpdatedMovieName[];
74
+ export interface INewOrUpdatedMovieThemeDTO {
75
+ name: INewOrUpdatedMovieNameDTO[];
76
76
  movies: string[];
77
77
  }
78
- export interface INewOrUpdatedVisualElement {
78
+ export interface INewOrUpdatedVisualElementDTO {
79
79
  type: string;
80
80
  id: string;
81
81
  alt?: string;
82
82
  }
83
- export interface INewSubjectFrontPageData {
83
+ export interface INewSubjectFrontPageDataDTO {
84
84
  name: string;
85
85
  externalId?: string;
86
- banner: INewOrUpdateBannerImage;
87
- about: INewOrUpdatedAboutSubject[];
88
- metaDescription: INewOrUpdatedMetaDescription[];
86
+ banner: INewOrUpdateBannerImageDTO;
87
+ about: INewOrUpdatedAboutSubjectDTO[];
88
+ metaDescription: INewOrUpdatedMetaDescriptionDTO[];
89
89
  editorsChoices?: string[];
90
90
  connectedTo?: string[];
91
91
  buildsOn?: string[];
92
92
  leadsTo?: string[];
93
93
  }
94
- export interface ISubjectPageData {
94
+ export interface ISubjectPageDataDTO {
95
95
  id: number;
96
96
  name: string;
97
- banner: IBannerImage;
98
- about?: IAboutSubject;
97
+ banner: IBannerImageDTO;
98
+ about?: IAboutSubjectDTO;
99
99
  metaDescription?: string;
100
100
  editorsChoices: string[];
101
101
  supportedLanguages: string[];
@@ -103,18 +103,18 @@ export interface ISubjectPageData {
103
103
  buildsOn: string[];
104
104
  leadsTo: string[];
105
105
  }
106
- export interface IUpdatedSubjectFrontPageData {
106
+ export interface IUpdatedSubjectFrontPageDataDTO {
107
107
  name?: string;
108
108
  externalId?: string;
109
- banner?: INewOrUpdateBannerImage;
110
- about?: INewOrUpdatedAboutSubject[];
111
- metaDescription?: INewOrUpdatedMetaDescription[];
109
+ banner?: INewOrUpdateBannerImageDTO;
110
+ about?: INewOrUpdatedAboutSubjectDTO[];
111
+ metaDescription?: INewOrUpdatedMetaDescriptionDTO[];
112
112
  editorsChoices?: string[];
113
113
  connectedTo?: string[];
114
114
  buildsOn?: string[];
115
115
  leadsTo?: string[];
116
116
  }
117
- export interface IVisualElement {
117
+ export interface IVisualElementDTO {
118
118
  type: string;
119
119
  url: string;
120
120
  alt?: string;