@ndla/types-taxonomy 1.0.24 → 1.0.26

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.
@@ -13,6 +13,10 @@ export interface Context {
13
13
  export interface ContextPOST {
14
14
  id: string;
15
15
  }
16
+ export interface GradeAverage {
17
+ averageValue: number;
18
+ count: number;
19
+ }
16
20
  export interface Metadata {
17
21
  customFields: Record<string, string>;
18
22
  grepCodes: string[];
@@ -27,6 +31,10 @@ export interface Node {
27
31
  */
28
32
  contextId?: string;
29
33
  contexts: TaxonomyContext[];
34
+ /**
35
+ * A number representing the average grade of all children nodes recursively.
36
+ */
37
+ gradeAverage?: GradeAverage;
30
38
  id: string;
31
39
  language: string;
32
40
  metadata: Metadata;
@@ -37,6 +45,10 @@ export interface Node {
37
45
  nodeType: NodeType;
38
46
  path: string;
39
47
  paths: string[];
48
+ /**
49
+ * Quality evaluation of the article
50
+ */
51
+ qualityEvaluation?: QualityEvaluation;
40
52
  relevanceId?: string;
41
53
  resourceTypes: ResourceTypeWithConnection[];
42
54
  supportedLanguages: string[];
@@ -138,6 +150,10 @@ export interface NodePostPut {
138
150
  * Type of node.
139
151
  */
140
152
  nodeType: NodeType;
153
+ /**
154
+ * The quality evaluation of the node. Consist of a score from 1 to 5 and a comment.
155
+ */
156
+ qualityEvaluation?: QualityEvaluation | null;
141
157
  /**
142
158
  * The node is a root node. Default is false. Only used if present.
143
159
  * @deprecated
@@ -256,6 +272,10 @@ export interface NodeSearchBody {
256
272
  export interface NodeWithParents extends Node {
257
273
  parents: NodeChild[];
258
274
  }
275
+ export interface QualityEvaluation {
276
+ grade: Grade;
277
+ note?: string;
278
+ }
259
279
  export interface Relevance {
260
280
  /**
261
281
  * Specifies if node is core or supplementary
@@ -494,6 +514,10 @@ export interface TaxonomyContext {
494
514
  * Whether the parent connection is visible or not
495
515
  */
496
516
  isVisible: boolean;
517
+ /**
518
+ * List of all parent contextIds
519
+ */
520
+ parentContextIds: string[];
497
521
  /**
498
522
  * List of all parent ids
499
523
  */
@@ -731,5 +755,6 @@ export interface VersionPostPut {
731
755
  name: string;
732
756
  }
733
757
  export type DateAsString = string;
758
+ export type Grade = 1 | 2 | 3 | 4 | 5;
734
759
  export type NodeType = "NODE" | "SUBJECT" | "TOPIC" | "RESOURCE" | "PROGRAMME";
735
760
  export type VersionType = "BETA" | "PUBLISHED" | "ARCHIVED";
package/package.json CHANGED
@@ -17,5 +17,5 @@
17
17
  "devDependencies": {
18
18
  "typescript": "^5.0.2"
19
19
  },
20
- "version": "1.0.24"
20
+ "version": "1.0.26"
21
21
  }
package/taxonomy-api.ts CHANGED
@@ -17,6 +17,11 @@ export interface ContextPOST {
17
17
  id: string;
18
18
  }
19
19
 
20
+ export interface GradeAverage {
21
+ averageValue: number;
22
+ count: number;
23
+ }
24
+
20
25
  export interface Metadata {
21
26
  customFields: Record<string, string>;
22
27
  grepCodes: string[];
@@ -32,6 +37,10 @@ export interface Node {
32
37
  */
33
38
  contextId?: string;
34
39
  contexts: TaxonomyContext[];
40
+ /**
41
+ * A number representing the average grade of all children nodes recursively.
42
+ */
43
+ gradeAverage?: GradeAverage;
35
44
  id: string;
36
45
  language: string;
37
46
  metadata: Metadata;
@@ -42,6 +51,10 @@ export interface Node {
42
51
  nodeType: NodeType;
43
52
  path: string;
44
53
  paths: string[];
54
+ /**
55
+ * Quality evaluation of the article
56
+ */
57
+ qualityEvaluation?: QualityEvaluation;
45
58
  relevanceId?: string;
46
59
  resourceTypes: ResourceTypeWithConnection[];
47
60
  supportedLanguages: string[];
@@ -148,6 +161,10 @@ export interface NodePostPut {
148
161
  * Type of node.
149
162
  */
150
163
  nodeType: NodeType;
164
+ /**
165
+ * The quality evaluation of the node. Consist of a score from 1 to 5 and a comment.
166
+ */
167
+ qualityEvaluation?: QualityEvaluation | null;
151
168
  /**
152
169
  * The node is a root node. Default is false. Only used if present.
153
170
  * @deprecated
@@ -272,6 +289,11 @@ export interface NodeWithParents extends Node {
272
289
  parents: NodeChild[];
273
290
  }
274
291
 
292
+ export interface QualityEvaluation {
293
+ grade: Grade;
294
+ note?: string;
295
+ }
296
+
275
297
  export interface Relevance {
276
298
  /**
277
299
  * Specifies if node is core or supplementary
@@ -526,6 +548,10 @@ export interface TaxonomyContext {
526
548
  * Whether the parent connection is visible or not
527
549
  */
528
550
  isVisible: boolean;
551
+ /**
552
+ * List of all parent contextIds
553
+ */
554
+ parentContextIds: string[];
529
555
  /**
530
556
  * List of all parent ids
531
557
  */
@@ -777,6 +803,8 @@ export interface VersionPostPut {
777
803
 
778
804
  export type DateAsString = string;
779
805
 
806
+ export type Grade = 1 | 2 | 3 | 4 | 5;
807
+
780
808
  export type NodeType = "NODE" | "SUBJECT" | "TOPIC" | "RESOURCE" | "PROGRAMME";
781
809
 
782
810
  export type VersionType = "BETA" | "PUBLISHED" | "ARCHIVED";