@ndla/types-backend 0.1.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.
@@ -0,0 +1,194 @@
1
+ export interface IAuthor {
2
+ type: string;
3
+ name: string;
4
+ }
5
+ export interface IBreadcrumb {
6
+ id: string;
7
+ name: string;
8
+ }
9
+ export interface IConfigMeta {
10
+ key: string;
11
+ value: string;
12
+ updatedAt: string;
13
+ updatedBy: string;
14
+ }
15
+ export interface IConfigMetaRestricted {
16
+ key: string;
17
+ value: string;
18
+ }
19
+ export interface ICopyright {
20
+ license: ILicense;
21
+ contributors: IAuthor[];
22
+ }
23
+ export interface ICoverPhoto {
24
+ url: string;
25
+ metaUrl: string;
26
+ }
27
+ export interface IDescription {
28
+ description: string;
29
+ language: string;
30
+ }
31
+ export interface IEmbedUrlV2 {
32
+ url: string;
33
+ embedType: string;
34
+ }
35
+ export interface IError {
36
+ code: string;
37
+ description: string;
38
+ occuredAt: string;
39
+ }
40
+ export interface IFolder {
41
+ id: string;
42
+ name: string;
43
+ status: string;
44
+ parentId?: string;
45
+ breadcrumbs: IBreadcrumb[];
46
+ subfolders: IFolderData[];
47
+ resources: IResource[];
48
+ rank?: number;
49
+ created: string;
50
+ updated: string;
51
+ shared?: string;
52
+ }
53
+ export type IFolderData = IFolder;
54
+ export interface IIntroduction {
55
+ introduction: string;
56
+ language: string;
57
+ }
58
+ export interface ILearningPathStatus {
59
+ status: string;
60
+ }
61
+ export interface ILearningPathSummaryV2 {
62
+ id: number;
63
+ revision?: number;
64
+ title: ITitle;
65
+ description: IDescription;
66
+ introduction: IIntroduction;
67
+ metaUrl: string;
68
+ coverPhotoUrl?: string;
69
+ duration?: number;
70
+ status: string;
71
+ lastUpdated: string;
72
+ tags: ILearningPathTags;
73
+ copyright: ICopyright;
74
+ supportedLanguages: string[];
75
+ isBasedOn?: number;
76
+ message?: string;
77
+ }
78
+ export interface ILearningPathTags {
79
+ tags: string[];
80
+ language: string;
81
+ }
82
+ export interface ILearningPathTagsSummary {
83
+ language: string;
84
+ supportedLanguages: string[];
85
+ tags: string[];
86
+ }
87
+ export interface ILearningPathV2 {
88
+ id: number;
89
+ revision: number;
90
+ isBasedOn?: number;
91
+ title: ITitle;
92
+ description: IDescription;
93
+ metaUrl: string;
94
+ learningsteps: ILearningStepV2[];
95
+ learningstepUrl: string;
96
+ coverPhoto?: ICoverPhoto;
97
+ duration?: number;
98
+ status: string;
99
+ verificationStatus: string;
100
+ lastUpdated: string;
101
+ tags: ILearningPathTags;
102
+ copyright: ICopyright;
103
+ canEdit: boolean;
104
+ supportedLanguages: string[];
105
+ ownerId?: string;
106
+ message?: IMessage;
107
+ }
108
+ export interface ILearningStepContainerSummary {
109
+ language: string;
110
+ learningsteps: ILearningStepSummaryV2[];
111
+ supportedLanguages: string[];
112
+ }
113
+ export interface ILearningStepSeqNo {
114
+ seqNo: number;
115
+ }
116
+ export interface ILearningStepStatus {
117
+ status: string;
118
+ }
119
+ export interface ILearningStepSummaryV2 {
120
+ id: number;
121
+ seqNo: number;
122
+ title: ITitle;
123
+ type: string;
124
+ metaUrl: string;
125
+ }
126
+ export interface ILearningStepV2 {
127
+ id: number;
128
+ revision: number;
129
+ seqNo: number;
130
+ title: ITitle;
131
+ description?: IDescription;
132
+ embedUrl?: IEmbedUrlV2;
133
+ showTitle: boolean;
134
+ type: string;
135
+ license?: ILicense;
136
+ metaUrl: string;
137
+ canEdit: boolean;
138
+ status: string;
139
+ supportedLanguages: string[];
140
+ }
141
+ export interface ILicense {
142
+ license: string;
143
+ description?: string;
144
+ url?: string;
145
+ }
146
+ export interface IMessage {
147
+ message: string;
148
+ date: string;
149
+ }
150
+ export interface IMyNDLAUser {
151
+ id: number;
152
+ favoriteSubjects: string[];
153
+ role: string;
154
+ organization: string;
155
+ }
156
+ export interface INewFolder {
157
+ name: string;
158
+ parentId?: string;
159
+ status?: string;
160
+ }
161
+ export interface INewResource {
162
+ resourceType: string;
163
+ path: string;
164
+ tags?: string[];
165
+ resourceId: string;
166
+ }
167
+ export interface IResource {
168
+ id: string;
169
+ resourceType: string;
170
+ path: string;
171
+ created: string;
172
+ tags: string[];
173
+ resourceId: string;
174
+ rank?: number;
175
+ }
176
+ export interface ISearchResultV2 {
177
+ totalCount: number;
178
+ page?: number;
179
+ pageSize: number;
180
+ language: string;
181
+ results: ILearningPathSummaryV2[];
182
+ }
183
+ export interface ITitle {
184
+ title: string;
185
+ language: string;
186
+ }
187
+ export interface IUpdatedFolder {
188
+ name?: string;
189
+ status?: string;
190
+ }
191
+ export interface IUpdatedResource {
192
+ tags?: string[];
193
+ resourceId?: string;
194
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // DO NOT EDIT: generated file by scala-tsi
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=learningpath-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"learningpath-api.js","sourceRoot":"","sources":["../learningpath-api.ts"],"names":[],"mappings":";AAAA,2CAA2C"}
@@ -0,0 +1,200 @@
1
+ export interface IApiTaxonomyContext {
2
+ id: string;
3
+ subject: string;
4
+ subjectId: string;
5
+ relevance: string;
6
+ path: string;
7
+ breadcrumbs: string[];
8
+ filters: ITaxonomyContextFilter[];
9
+ learningResourceType: string;
10
+ resourceTypes: ITaxonomyResourceType[];
11
+ language: string;
12
+ isPrimaryConnection: boolean;
13
+ }
14
+ export interface IArticleIntroduction {
15
+ introduction: string;
16
+ language: string;
17
+ }
18
+ export interface IArticleResult {
19
+ id: number;
20
+ title: ITitle;
21
+ introduction?: IArticleIntroduction;
22
+ articleType: string;
23
+ supportedLanguages: string[];
24
+ }
25
+ export interface IArticleResults {
26
+ type: string;
27
+ language: string;
28
+ totalCount: number;
29
+ page: number;
30
+ pageSize: number;
31
+ results: IArticleResult[];
32
+ }
33
+ export interface IAudioResult {
34
+ id: number;
35
+ title: ITitle;
36
+ url: string;
37
+ supportedLanguages: string[];
38
+ }
39
+ export interface IAudioResults {
40
+ type: string;
41
+ language: string;
42
+ totalCount: number;
43
+ page: number;
44
+ pageSize: number;
45
+ results: IAudioResult[];
46
+ }
47
+ export interface IDraftResponsible {
48
+ responsibleId: string;
49
+ lastUpdated: string;
50
+ }
51
+ export interface IGroupSearchResult {
52
+ totalCount: number;
53
+ page?: number;
54
+ pageSize: number;
55
+ language: string;
56
+ results: IMultiSearchSummary[];
57
+ suggestions: IMultiSearchSuggestion[];
58
+ aggregations: IMultiSearchTermsAggregation[];
59
+ resourceType: string;
60
+ }
61
+ export interface IHighlightedField {
62
+ field: string;
63
+ matches: string[];
64
+ }
65
+ export interface IImageAltText {
66
+ altText: string;
67
+ language: string;
68
+ }
69
+ export interface IImageResult {
70
+ id: number;
71
+ title: ITitle;
72
+ altText: IImageAltText;
73
+ previewUrl: string;
74
+ metaUrl: string;
75
+ supportedLanguages: string[];
76
+ }
77
+ export interface IImageResults {
78
+ type: string;
79
+ language: string;
80
+ totalCount: number;
81
+ page: number;
82
+ pageSize: number;
83
+ results: IImageResult[];
84
+ }
85
+ export interface ILearningPathIntroduction {
86
+ introduction: string;
87
+ language: string;
88
+ }
89
+ export interface ILearningpathResult {
90
+ id: number;
91
+ title: ITitle;
92
+ introduction: ILearningPathIntroduction;
93
+ supportedLanguages: string[];
94
+ }
95
+ export interface ILearningpathResults {
96
+ type: string;
97
+ language: string;
98
+ totalCount: number;
99
+ page: number;
100
+ pageSize: number;
101
+ results: ILearningpathResult[];
102
+ }
103
+ export interface IMetaDescription {
104
+ metaDescription: string;
105
+ language: string;
106
+ }
107
+ export interface IMetaImage {
108
+ url: string;
109
+ alt: string;
110
+ language: string;
111
+ }
112
+ export interface IMultiSearchResult {
113
+ totalCount: number;
114
+ page?: number;
115
+ pageSize: number;
116
+ language: string;
117
+ results: IMultiSearchSummary[];
118
+ suggestions: IMultiSearchSuggestion[];
119
+ aggregations: IMultiSearchTermsAggregation[];
120
+ }
121
+ export interface IMultiSearchSuggestion {
122
+ name: string;
123
+ suggestions: ISearchSuggestion[];
124
+ }
125
+ export interface IMultiSearchSummary {
126
+ id: number;
127
+ title: ITitle;
128
+ metaDescription: IMetaDescription;
129
+ metaImage?: IMetaImage;
130
+ url: string;
131
+ contexts: IApiTaxonomyContext[];
132
+ supportedLanguages: string[];
133
+ learningResourceType: string;
134
+ status?: IStatus;
135
+ traits: string[];
136
+ score: number;
137
+ highlights: IHighlightedField[];
138
+ paths: string[];
139
+ lastUpdated: string;
140
+ license?: string;
141
+ revisions: IRevisionMeta[];
142
+ responsible?: IDraftResponsible;
143
+ }
144
+ export interface IMultiSearchTermsAggregation {
145
+ field: string;
146
+ sumOtherDocCount: number;
147
+ docCountErrorUpperBound: number;
148
+ values: ITermValue[];
149
+ }
150
+ export interface IRevisionMeta {
151
+ revisionDate: string;
152
+ note: string;
153
+ status: string;
154
+ }
155
+ export interface ISearchError {
156
+ type: string;
157
+ errorMsg: string;
158
+ }
159
+ export interface ISearchSuggestion {
160
+ text: string;
161
+ offset: number;
162
+ length: number;
163
+ options: ISuggestOption[];
164
+ }
165
+ export interface IStatus {
166
+ current: string;
167
+ other: string[];
168
+ }
169
+ export interface ISuggestOption {
170
+ text: string;
171
+ score: number;
172
+ }
173
+ export interface ITaxonomyContextFilter {
174
+ id: string;
175
+ name: string;
176
+ relevance: string;
177
+ }
178
+ export interface ITaxonomyResourceType {
179
+ id: string;
180
+ name: string;
181
+ language: string;
182
+ }
183
+ export interface ITermValue {
184
+ value: string;
185
+ count: number;
186
+ }
187
+ export interface ITitle {
188
+ title: string;
189
+ language: string;
190
+ }
191
+ export interface IValidationError {
192
+ code: string;
193
+ description: string;
194
+ messages: IValidationMessage[];
195
+ occuredAt: string;
196
+ }
197
+ export interface IValidationMessage {
198
+ field: string;
199
+ message: string;
200
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // DO NOT EDIT: generated file by scala-tsi
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=search-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-api.js","sourceRoot":"","sources":["../search-api.ts"],"names":[],"mappings":";AAAA,2CAA2C"}
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@ndla/types-backend",
3
+ "description": "Typescript type definitions for NDLA backend",
4
+ "license": "GPL-3.0",
5
+ "scripts": {
6
+ "build": "tsc",
7
+ "do-publish": "tsc"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/NDLANO/backend.git",
12
+ "directory": "typescript"
13
+ },
14
+ "author": "ndla@knowit.no",
15
+ "files": [
16
+ "lib",
17
+ "src",
18
+ "es",
19
+ "types",
20
+ "build"
21
+ ],
22
+ "devDependencies": {
23
+ "typescript": "^5.0.2"
24
+ },
25
+ "version": "0.1.1"
26
+ }