@ndla/types-backend 0.2.101 → 1.0.1

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.
@@ -9,36 +9,36 @@ export declare enum ArticleSortEnum {
9
9
  ByIdAsc = "id"
10
10
  }
11
11
  export type Availability = ("everyone" | "teacher");
12
- export interface IArticleContentV2 {
12
+ export interface IArticleContentV2DTO {
13
13
  content: string;
14
14
  language: string;
15
15
  }
16
- export interface IArticleDump {
16
+ export interface IArticleDumpDTO {
17
17
  totalCount: number;
18
18
  page: number;
19
19
  pageSize: number;
20
20
  language: string;
21
- results: IArticleV2[];
21
+ results: IArticleV2DTO[];
22
22
  }
23
- export interface IArticleIds {
23
+ export interface IArticleIdsDTO {
24
24
  articleId: number;
25
25
  externalIds: string[];
26
26
  }
27
- export interface IArticleIntroduction {
27
+ export interface IArticleIntroductionDTO {
28
28
  introduction: string;
29
29
  htmlIntroduction: string;
30
30
  language: string;
31
31
  }
32
- export interface IArticleMetaDescription {
32
+ export interface IArticleMetaDescriptionDTO {
33
33
  metaDescription: string;
34
34
  language: string;
35
35
  }
36
- export interface IArticleMetaImage {
36
+ export interface IArticleMetaImageDTO {
37
37
  url: string;
38
38
  alt: string;
39
39
  language: string;
40
40
  }
41
- export interface IArticleSearchParams {
41
+ export interface IArticleSearchParamsDTO {
42
42
  query?: string;
43
43
  language?: string;
44
44
  license?: string;
@@ -51,13 +51,13 @@ export interface IArticleSearchParams {
51
51
  scrollId?: string;
52
52
  grepCodes?: string[];
53
53
  }
54
- export interface IArticleSummaryV2 {
54
+ export interface IArticleSummaryV2DTO {
55
55
  id: number;
56
- title: IArticleTitle;
57
- visualElement?: IVisualElement;
58
- introduction?: IArticleIntroduction;
59
- metaDescription?: IArticleMetaDescription;
60
- metaImage?: IArticleMetaImage;
56
+ title: IArticleTitleDTO;
57
+ visualElement?: IVisualElementDTO;
58
+ introduction?: IArticleIntroductionDTO;
59
+ metaDescription?: IArticleMetaDescriptionDTO;
60
+ metaImage?: IArticleMetaImageDTO;
61
61
  url: string;
62
62
  license: string;
63
63
  articleType: string;
@@ -66,28 +66,28 @@ export interface IArticleSummaryV2 {
66
66
  grepCodes: string[];
67
67
  availability: string;
68
68
  }
69
- export interface IArticleTag {
69
+ export interface IArticleTagDTO {
70
70
  tags: string[];
71
71
  language: string;
72
72
  }
73
- export interface IArticleTitle {
73
+ export interface IArticleTitleDTO {
74
74
  title: string;
75
75
  htmlTitle: string;
76
76
  language: string;
77
77
  }
78
- export interface IArticleV2 {
78
+ export interface IArticleV2DTO {
79
79
  id: number;
80
80
  oldNdlaUrl?: string;
81
81
  revision: number;
82
- title: IArticleTitle;
83
- content: IArticleContentV2;
84
- copyright: ICopyright;
85
- tags: IArticleTag;
86
- requiredLibraries: IRequiredLibrary[];
87
- visualElement?: IVisualElement;
88
- metaImage?: IArticleMetaImage;
89
- introduction?: IArticleIntroduction;
90
- metaDescription: IArticleMetaDescription;
82
+ title: IArticleTitleDTO;
83
+ content: IArticleContentV2DTO;
84
+ copyright: ICopyrightDTO;
85
+ tags: IArticleTagDTO;
86
+ requiredLibraries: IRequiredLibraryDTO[];
87
+ visualElement?: IVisualElementDTO;
88
+ metaImage?: IArticleMetaImageDTO;
89
+ introduction?: IArticleIntroductionDTO;
90
+ metaDescription: IArticleMetaDescriptionDTO;
91
91
  created: string;
92
92
  updated: string;
93
93
  updatedBy: string;
@@ -97,63 +97,53 @@ export interface IArticleV2 {
97
97
  grepCodes: string[];
98
98
  conceptIds: number[];
99
99
  availability: string;
100
- relatedContent: (IRelatedContentLink | number)[];
100
+ relatedContent: (IRelatedContentLinkDTO | number)[];
101
101
  revisionDate?: string;
102
102
  slug?: string;
103
103
  }
104
- export interface IAuthor {
104
+ export interface IAuthorDTO {
105
105
  type: string;
106
106
  name: string;
107
107
  }
108
- export interface ICopyright {
109
- license: ILicense;
108
+ export interface ICopyrightDTO {
109
+ license: ILicenseDTO;
110
110
  origin?: string;
111
- creators: IAuthor[];
112
- processors: IAuthor[];
113
- rightsholders: IAuthor[];
111
+ creators: IAuthorDTO[];
112
+ processors: IAuthorDTO[];
113
+ rightsholders: IAuthorDTO[];
114
114
  validFrom?: string;
115
115
  validTo?: string;
116
116
  processed: boolean;
117
117
  }
118
- export interface ILicense {
118
+ export interface ILicenseDTO {
119
119
  license: string;
120
120
  description?: string;
121
121
  url?: string;
122
122
  }
123
- export interface IRelatedContentLink {
123
+ export interface IRelatedContentLinkDTO {
124
124
  title: string;
125
125
  url: string;
126
126
  }
127
- export interface IRequiredLibrary {
127
+ export interface IRequiredLibraryDTO {
128
128
  mediaType: string;
129
129
  name: string;
130
130
  url: string;
131
131
  }
132
- export interface ISearchResultV2 {
132
+ export interface ISearchResultV2DTO {
133
133
  totalCount: number;
134
134
  page?: number;
135
135
  pageSize: number;
136
136
  language: string;
137
- results: IArticleSummaryV2[];
137
+ results: IArticleSummaryV2DTO[];
138
138
  }
139
- export interface ITagsSearchResult {
139
+ export interface ITagsSearchResultDTO {
140
140
  totalCount: number;
141
141
  page: number;
142
142
  pageSize: number;
143
143
  language: string;
144
144
  results: string[];
145
145
  }
146
- export interface IValidationError {
147
- code: string;
148
- description: string;
149
- messages: IValidationMessage[];
150
- occuredAt: string;
151
- }
152
- export interface IValidationMessage {
153
- field: string;
154
- message: string;
155
- }
156
- export interface IVisualElement {
146
+ export interface IVisualElementDTO {
157
147
  visualElement: string;
158
148
  language: string;
159
149
  }
@@ -8,94 +8,94 @@ export declare enum AudioSortEnum {
8
8
  ByIdDesc = "-id",
9
9
  ByIdAsc = "id"
10
10
  }
11
- export interface IAudio {
11
+ export interface IAudioDTO {
12
12
  url: string;
13
13
  mimeType: string;
14
14
  fileSize: number;
15
15
  language: string;
16
16
  }
17
- export interface IAudioMetaInformation {
17
+ export interface IAudioMetaInformationDTO {
18
18
  id: number;
19
19
  revision: number;
20
- title: ITitle;
21
- audioFile: IAudio;
22
- copyright: ICopyright;
23
- tags: ITag;
20
+ title: ITitleDTO;
21
+ audioFile: IAudioDTO;
22
+ copyright: ICopyrightDTO;
23
+ tags: ITagDTO;
24
24
  supportedLanguages: string[];
25
25
  audioType: string;
26
- podcastMeta?: IPodcastMeta;
27
- series?: ISeries;
28
- manuscript?: IManuscript;
26
+ podcastMeta?: IPodcastMetaDTO;
27
+ series?: ISeriesDTO;
28
+ manuscript?: IManuscriptDTO;
29
29
  created: string;
30
30
  updated: string;
31
31
  }
32
- export interface IAudioSummary {
32
+ export interface IAudioSummaryDTO {
33
33
  id: number;
34
- title: ITitle;
34
+ title: ITitleDTO;
35
35
  audioType: string;
36
36
  url: string;
37
37
  license: string;
38
38
  supportedLanguages: string[];
39
- manuscript?: IManuscript;
40
- podcastMeta?: IPodcastMeta;
41
- series?: ISeriesSummary;
39
+ manuscript?: IManuscriptDTO;
40
+ podcastMeta?: IPodcastMetaDTO;
41
+ series?: ISeriesSummaryDTO;
42
42
  lastUpdated: string;
43
43
  }
44
- export interface IAudioSummarySearchResult {
44
+ export interface IAudioSummarySearchResultDTO {
45
45
  totalCount: number;
46
46
  page?: number;
47
47
  pageSize: number;
48
48
  language: string;
49
- results: IAudioSummary[];
49
+ results: IAudioSummaryDTO[];
50
50
  }
51
- export interface IAuthor {
51
+ export interface IAuthorDTO {
52
52
  type: string;
53
53
  name: string;
54
54
  }
55
- export interface ICopyright {
56
- license: ILicense;
55
+ export interface ICopyrightDTO {
56
+ license: ILicenseDTO;
57
57
  origin?: string;
58
- creators: IAuthor[];
59
- processors: IAuthor[];
60
- rightsholders: IAuthor[];
58
+ creators: IAuthorDTO[];
59
+ processors: IAuthorDTO[];
60
+ rightsholders: IAuthorDTO[];
61
61
  validFrom?: string;
62
62
  validTo?: string;
63
63
  processed: boolean;
64
64
  }
65
- export interface ICoverPhoto {
65
+ export interface ICoverPhotoDTO {
66
66
  id: string;
67
67
  url: string;
68
68
  altText: string;
69
69
  }
70
- export interface IDescription {
70
+ export interface IDescriptionDTO {
71
71
  description: string;
72
72
  language: string;
73
73
  }
74
- export interface ILicense {
74
+ export interface ILicenseDTO {
75
75
  license: string;
76
76
  description?: string;
77
77
  url?: string;
78
78
  }
79
- export interface IManuscript {
79
+ export interface IManuscriptDTO {
80
80
  manuscript: string;
81
81
  language: string;
82
82
  }
83
- export interface INewAudioMetaInformation {
83
+ export interface INewAudioMetaInformationDTO {
84
84
  title: string;
85
85
  language: string;
86
- copyright: ICopyright;
86
+ copyright: ICopyrightDTO;
87
87
  tags: string[];
88
88
  audioType?: string;
89
- podcastMeta?: INewPodcastMeta;
89
+ podcastMeta?: INewPodcastMetaDTO;
90
90
  seriesId?: number;
91
91
  manuscript?: string;
92
92
  }
93
- export interface INewPodcastMeta {
93
+ export interface INewPodcastMetaDTO {
94
94
  introduction: string;
95
95
  coverPhotoId: string;
96
96
  coverPhotoAltText: string;
97
97
  }
98
- export interface INewSeries {
98
+ export interface INewSeriesDTO {
99
99
  title: string;
100
100
  description: string;
101
101
  coverPhotoId: string;
@@ -105,12 +105,12 @@ export interface INewSeries {
105
105
  revision?: number;
106
106
  hasRSS?: boolean;
107
107
  }
108
- export interface IPodcastMeta {
108
+ export interface IPodcastMetaDTO {
109
109
  introduction: string;
110
- coverPhoto: ICoverPhoto;
110
+ coverPhoto: ICoverPhotoDTO;
111
111
  language: string;
112
112
  }
113
- export interface ISearchParams {
113
+ export interface ISearchParamsDTO {
114
114
  query?: string;
115
115
  license?: string;
116
116
  language?: string;
@@ -122,17 +122,17 @@ export interface ISearchParams {
122
122
  filterBySeries?: boolean;
123
123
  fallback?: boolean;
124
124
  }
125
- export interface ISeries {
125
+ export interface ISeriesDTO {
126
126
  id: number;
127
127
  revision: number;
128
- title: ITitle;
129
- description: IDescription;
130
- coverPhoto: ICoverPhoto;
131
- episodes?: IAudioMetaInformation[];
128
+ title: ITitleDTO;
129
+ description: IDescriptionDTO;
130
+ coverPhoto: ICoverPhotoDTO;
131
+ episodes?: IAudioMetaInformationDTO[];
132
132
  supportedLanguages: string[];
133
133
  hasRSS: boolean;
134
134
  }
135
- export interface ISeriesSearchParams {
135
+ export interface ISeriesSearchParamsDTO {
136
136
  query?: string;
137
137
  language?: string;
138
138
  page?: number;
@@ -141,44 +141,44 @@ export interface ISeriesSearchParams {
141
141
  scrollId?: string;
142
142
  fallback?: boolean;
143
143
  }
144
- export interface ISeriesSummary {
144
+ export interface ISeriesSummaryDTO {
145
145
  id: number;
146
- title: ITitle;
147
- description: IDescription;
146
+ title: ITitleDTO;
147
+ description: IDescriptionDTO;
148
148
  supportedLanguages: string[];
149
- episodes?: IAudioSummary[];
150
- coverPhoto: ICoverPhoto;
149
+ episodes?: IAudioSummaryDTO[];
150
+ coverPhoto: ICoverPhotoDTO;
151
151
  }
152
- export interface ISeriesSummarySearchResult {
152
+ export interface ISeriesSummarySearchResultDTO {
153
153
  totalCount: number;
154
154
  page?: number;
155
155
  pageSize: number;
156
156
  language: string;
157
- results: ISeriesSummary[];
157
+ results: ISeriesSummaryDTO[];
158
158
  }
159
- export interface ITag {
159
+ export interface ITagDTO {
160
160
  tags: string[];
161
161
  language: string;
162
162
  }
163
- export interface ITagsSearchResult {
163
+ export interface ITagsSearchResultDTO {
164
164
  totalCount: number;
165
165
  page: number;
166
166
  pageSize: number;
167
167
  language: string;
168
168
  results: string[];
169
169
  }
170
- export interface ITitle {
170
+ export interface ITitleDTO {
171
171
  title: string;
172
172
  language: string;
173
173
  }
174
- export interface IUpdatedAudioMetaInformation {
174
+ export interface IUpdatedAudioMetaInformationDTO {
175
175
  revision: number;
176
176
  title: string;
177
177
  language: string;
178
- copyright: ICopyright;
178
+ copyright: ICopyrightDTO;
179
179
  tags: string[];
180
180
  audioType?: string;
181
- podcastMeta?: INewPodcastMeta;
181
+ podcastMeta?: INewPodcastMetaDTO;
182
182
  seriesId?: number;
183
183
  manuscript?: string;
184
184
  }
@@ -16,47 +16,47 @@ export declare enum ConceptSortEnum {
16
16
  ByConceptTypeAsc = "conceptType",
17
17
  ByConceptTypeDesc = "-conceptType"
18
18
  }
19
- export interface IAuthor {
19
+ export interface IAuthorDTO {
20
20
  type: string;
21
21
  name: string;
22
22
  }
23
- export interface IConcept {
23
+ export interface IConceptContent {
24
+ content: string;
25
+ htmlContent: string;
26
+ language: string;
27
+ }
28
+ export interface IConceptDTO {
24
29
  id: number;
25
30
  revision: number;
26
- title: IConceptTitle;
31
+ title: IConceptTitleDTO;
27
32
  content?: IConceptContent;
28
- copyright?: IDraftCopyright;
33
+ copyright?: IDraftCopyrightDTO;
29
34
  source?: string;
30
- metaImage?: IConceptMetaImage;
31
- tags?: IConceptTags;
35
+ metaImage?: IConceptMetaImageDTO;
36
+ tags?: IConceptTagsDTO;
32
37
  subjectIds?: string[];
33
38
  created: string;
34
39
  updated: string;
35
40
  updatedBy?: string[];
36
41
  supportedLanguages: string[];
37
42
  articleIds: number[];
38
- status: IStatus;
39
- visualElement?: IVisualElement;
40
- responsible?: IConceptResponsible;
43
+ status: IStatusDTO;
44
+ visualElement?: IVisualElementDTO;
45
+ responsible?: IConceptResponsibleDTO;
41
46
  conceptType: string;
42
- glossData?: IGlossData;
43
- editorNotes?: IEditorNote[];
47
+ glossData?: IGlossDataDTO;
48
+ editorNotes?: IEditorNoteDTO[];
44
49
  }
45
- export interface IConceptContent {
46
- content: string;
47
- htmlContent: string;
48
- language: string;
49
- }
50
- export interface IConceptMetaImage {
50
+ export interface IConceptMetaImageDTO {
51
51
  url: string;
52
52
  alt: string;
53
53
  language: string;
54
54
  }
55
- export interface IConceptResponsible {
55
+ export interface IConceptResponsibleDTO {
56
56
  responsibleId: string;
57
57
  lastUpdated: string;
58
58
  }
59
- export interface IConceptSearchParams {
59
+ export interface IConceptSearchParamsDTO {
60
60
  query?: string;
61
61
  language?: string;
62
62
  page?: number;
@@ -73,46 +73,46 @@ export interface IConceptSearchParams {
73
73
  conceptType?: string;
74
74
  aggregatePaths?: string[];
75
75
  }
76
- export interface IConceptSearchResult {
76
+ export interface IConceptSearchResultDTO {
77
77
  totalCount: number;
78
78
  page?: number;
79
79
  pageSize: number;
80
80
  language: string;
81
- results: IConceptSummary[];
82
- aggregations: IMultiSearchTermsAggregation[];
81
+ results: IConceptSummaryDTO[];
82
+ aggregations: IMultiSearchTermsAggregationDTO[];
83
83
  }
84
- export interface IConceptSummary {
84
+ export interface IConceptSummaryDTO {
85
85
  id: number;
86
- title: IConceptTitle;
86
+ title: IConceptTitleDTO;
87
87
  content: IConceptContent;
88
- metaImage: IConceptMetaImage;
89
- tags?: IConceptTags;
88
+ metaImage: IConceptMetaImageDTO;
89
+ tags?: IConceptTagsDTO;
90
90
  subjectIds?: string[];
91
91
  supportedLanguages: string[];
92
92
  lastUpdated: string;
93
93
  created: string;
94
- status: IStatus;
94
+ status: IStatusDTO;
95
95
  updatedBy: string[];
96
96
  license?: string;
97
- copyright?: IDraftCopyright;
98
- visualElement?: IVisualElement;
97
+ copyright?: IDraftCopyrightDTO;
98
+ visualElement?: IVisualElementDTO;
99
99
  articleIds: number[];
100
100
  source?: string;
101
- responsible?: IConceptResponsible;
101
+ responsible?: IConceptResponsibleDTO;
102
102
  conceptType: string;
103
- glossData?: IGlossData;
103
+ glossData?: IGlossDataDTO;
104
104
  subjectName?: string;
105
105
  conceptTypeName: string;
106
106
  }
107
- export interface IConceptTags {
107
+ export interface IConceptTagsDTO {
108
108
  tags: string[];
109
109
  language: string;
110
110
  }
111
- export interface IConceptTitle {
111
+ export interface IConceptTitleDTO {
112
112
  title: string;
113
113
  language: string;
114
114
  }
115
- export interface IDraftConceptSearchParams {
115
+ export interface IDraftConceptSearchParamsDTO {
116
116
  query?: string;
117
117
  language?: string;
118
118
  page?: number;
@@ -131,93 +131,93 @@ export interface IDraftConceptSearchParams {
131
131
  conceptType?: string;
132
132
  aggregatePaths?: string[];
133
133
  }
134
- export interface IDraftCopyright {
135
- license?: ILicense;
134
+ export interface IDraftCopyrightDTO {
135
+ license?: ILicenseDTO;
136
136
  origin?: string;
137
- creators: IAuthor[];
138
- processors: IAuthor[];
139
- rightsholders: IAuthor[];
137
+ creators: IAuthorDTO[];
138
+ processors: IAuthorDTO[];
139
+ rightsholders: IAuthorDTO[];
140
140
  validFrom?: string;
141
141
  validTo?: string;
142
142
  processed: boolean;
143
143
  }
144
- export interface IEditorNote {
144
+ export interface IEditorNoteDTO {
145
145
  note: string;
146
146
  updatedBy: string;
147
- status: IStatus;
147
+ status: IStatusDTO;
148
148
  timestamp: string;
149
149
  }
150
- export interface IGlossData {
150
+ export interface IGlossDataDTO {
151
151
  gloss: string;
152
152
  wordClass: string;
153
153
  originalLanguage: string;
154
154
  transcriptions: {
155
155
  [key: string]: string;
156
156
  };
157
- examples: IGlossExample[][];
157
+ examples: IGlossExampleDTO[][];
158
158
  }
159
- export interface IGlossExample {
159
+ export interface IGlossExampleDTO {
160
160
  example: string;
161
161
  language: string;
162
162
  transcriptions: {
163
163
  [key: string]: string;
164
164
  };
165
165
  }
166
- export interface ILicense {
166
+ export interface ILicenseDTO {
167
167
  license: string;
168
168
  description?: string;
169
169
  url?: string;
170
170
  }
171
- export interface IMultiSearchTermsAggregation {
171
+ export interface IMultiSearchTermsAggregationDTO {
172
172
  field: string;
173
173
  sumOtherDocCount: number;
174
174
  docCountErrorUpperBound: number;
175
- values: ITermValue[];
175
+ values: ITermValueDTO[];
176
176
  }
177
- export interface INewConcept {
177
+ export interface INewConceptDTO {
178
178
  language: string;
179
179
  title: string;
180
180
  content?: string;
181
- copyright?: IDraftCopyright;
182
- metaImage?: INewConceptMetaImage;
181
+ copyright?: IDraftCopyrightDTO;
182
+ metaImage?: INewConceptMetaImageDTO;
183
183
  tags?: string[];
184
184
  subjectIds?: string[];
185
185
  articleIds?: number[];
186
186
  visualElement?: string;
187
187
  responsibleId?: string;
188
188
  conceptType: string;
189
- glossData?: IGlossData;
189
+ glossData?: IGlossDataDTO;
190
190
  }
191
- export interface INewConceptMetaImage {
191
+ export interface INewConceptMetaImageDTO {
192
192
  id: string;
193
193
  alt: string;
194
194
  }
195
- export interface IStatus {
195
+ export interface IStatusDTO {
196
196
  current: string;
197
197
  other: string[];
198
198
  }
199
- export interface ISubjectTags {
199
+ export interface ISubjectTagsDTO {
200
200
  subjectId: string;
201
201
  tags: string[];
202
202
  language: string;
203
203
  }
204
- export interface ITagsSearchResult {
204
+ export interface ITagsSearchResultDTO {
205
205
  totalCount: number;
206
206
  page: number;
207
207
  pageSize: number;
208
208
  language: string;
209
209
  results: string[];
210
210
  }
211
- export interface ITermValue {
211
+ export interface ITermValueDTO {
212
212
  value: string;
213
213
  count: number;
214
214
  }
215
- export interface IUpdatedConcept {
215
+ export interface IUpdatedConceptDTO {
216
216
  language: string;
217
217
  title?: string;
218
218
  content?: string;
219
- metaImage: UpdateOrDeleteNewConceptMetaImage;
220
- copyright?: IDraftCopyright;
219
+ metaImage: UpdateOrDeleteNewConceptMetaImageDTO;
220
+ copyright?: IDraftCopyrightDTO;
221
221
  tags?: string[];
222
222
  subjectIds?: string[];
223
223
  articleIds?: number[];
@@ -225,22 +225,12 @@ export interface IUpdatedConcept {
225
225
  visualElement?: string;
226
226
  responsibleId: UpdateOrDeleteString;
227
227
  conceptType?: string;
228
- glossData?: IGlossData;
229
- }
230
- export interface IValidationError {
231
- code: string;
232
- description: string;
233
- messages: IValidationMessage[];
234
- occuredAt: string;
235
- }
236
- export interface IValidationMessage {
237
- field: string;
238
- message: string;
228
+ glossData?: IGlossDataDTO;
239
229
  }
240
- export interface IVisualElement {
230
+ export interface IVisualElementDTO {
241
231
  visualElement: string;
242
232
  language: string;
243
233
  }
244
234
  export type Sort = ConceptSortEnum;
245
- export type UpdateOrDeleteNewConceptMetaImage = (null | undefined | INewConceptMetaImage);
235
+ export type UpdateOrDeleteNewConceptMetaImageDTO = (null | undefined | INewConceptMetaImageDTO);
246
236
  export type UpdateOrDeleteString = (null | undefined | string);