@ndla/types-taxonomy 1.0.7 → 1.0.8

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.
package/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # NDLA taxonomy-api types
2
+
3
+ TypeScript definitions for the NDLA taxonomy-api
4
+
5
+ ## Installation
6
+
7
+ ```sh
8
+ yarn add -D @ndla/types-taxonomy
9
+ ```
@@ -1,27 +1,27 @@
1
1
  export interface NodePostPut {
2
2
  nodeId?: string;
3
3
  /**
4
- * Type of node. Values are subject, topic. Required on create.
4
+ * Type of node.
5
5
  */
6
6
  nodeType: NodeType;
7
7
  /**
8
8
  * ID of content introducing this node. Must be a valid URI, but preferably not a URL.
9
9
  */
10
- contentUri: string;
10
+ contentUri?: string;
11
11
  /**
12
12
  * The name of the node. Required on create.
13
13
  */
14
- name: string;
14
+ name?: string;
15
15
  /**
16
16
  * The node is a root node. Default is false. Only used if present.
17
17
  */
18
- root: boolean;
18
+ root?: boolean;
19
19
  }
20
20
  export interface ResourcePostPut {
21
21
  /**
22
22
  * If specified, set the id to this value. Must start with urn:resource: and be a valid URI. If omitted, an id will be assigned automatically.
23
23
  */
24
- id: string;
24
+ id?: string;
25
25
  /**
26
26
  * The ID of this resource in the system where the content is stored. This ID should be of the form 'urn:<system>:<id>', where <system> is a short identifier for the system, and <id> is the id of this content in that system.
27
27
  */
@@ -37,9 +37,9 @@ export interface SubjectPostPut {
37
37
  */
38
38
  id: string;
39
39
  /**
40
- * ID of article introducing this subject. Must be a valid URI, but preferably not a URL.
40
+ * ID of frontpage connected to this subject. Must be a valid URI, but preferably not a URL.
41
41
  */
42
- contentUri: string;
42
+ contentUri?: string;
43
43
  /**
44
44
  * The name of the subject
45
45
  */
@@ -71,7 +71,7 @@ export interface VersionPostPut {
71
71
  /**
72
72
  * If specified, set the locked property to this value.
73
73
  */
74
- locked: boolean;
74
+ locked?: boolean;
75
75
  }
76
76
  export interface Context {
77
77
  id: string;
@@ -95,7 +95,7 @@ export interface NodeConnection {
95
95
  */
96
96
  id: string;
97
97
  /**
98
- * Backwards compatibility: Always true. Ignored on insert/update
98
+ * Is this connection primary
99
99
  */
100
100
  primary: boolean;
101
101
  /**
@@ -105,7 +105,7 @@ export interface NodeConnection {
105
105
  /**
106
106
  * Relevance id
107
107
  */
108
- relevanceId: string;
108
+ relevanceId?: string;
109
109
  /**
110
110
  * Metadata for entity. Read only.
111
111
  */
@@ -118,35 +118,31 @@ export interface NodeConnectionPOST {
118
118
  */
119
119
  childId: string;
120
120
  /**
121
- * Backwards compatibility: Always true. Ignored on insert/update
121
+ * If this connection is primary.
122
122
  */
123
- primary: boolean;
123
+ primary?: boolean;
124
124
  /**
125
125
  * Order in which to sort the child for the parent
126
126
  */
127
- rank: number;
127
+ rank?: number;
128
128
  /**
129
129
  * Relevance id
130
130
  */
131
- relevanceId: string;
131
+ relevanceId?: string;
132
132
  }
133
133
  export interface NodeConnectionPUT {
134
134
  /**
135
- * Connection id
135
+ * If this connection is primary.
136
136
  */
137
- id: string;
138
- /**
139
- * Backwards compatibility: Always true. Ignored on insert/update
140
- */
141
- primary: boolean;
137
+ primary?: boolean;
142
138
  /**
143
139
  * Order in which subtopic is sorted for the topic
144
140
  */
145
- rank: number;
141
+ rank?: number;
146
142
  /**
147
143
  * Relevance id
148
144
  */
149
- relevanceId: string;
145
+ relevanceId?: string;
150
146
  }
151
147
  export interface NodeResource {
152
148
  /**
@@ -172,7 +168,7 @@ export interface NodeResource {
172
168
  /**
173
169
  * Relevance id
174
170
  */
175
- relevanceId: string;
171
+ relevanceId?: string;
176
172
  /**
177
173
  * Metadata for entity. Read only.
178
174
  */
@@ -190,15 +186,15 @@ export interface NodeResourcePOST {
190
186
  /**
191
187
  * Primary connection
192
188
  */
193
- primary: boolean;
189
+ primary?: boolean;
194
190
  /**
195
191
  * Order in which resource is sorted for the node
196
192
  */
197
- rank: number;
193
+ rank?: number;
198
194
  /**
199
195
  * Relevance id
200
196
  */
201
- relevanceId: string;
197
+ relevanceId?: string;
202
198
  }
203
199
  export interface NodeResourcePUT {
204
200
  /**
@@ -208,15 +204,15 @@ export interface NodeResourcePUT {
208
204
  /**
209
205
  * Primary connection
210
206
  */
211
- primary: boolean;
207
+ primary?: boolean;
212
208
  /**
213
209
  * Order in which the resource will be sorted for this node.
214
210
  */
215
- rank: number;
211
+ rank?: number;
216
212
  /**
217
213
  * Relevance id
218
214
  */
219
- relevanceId: string;
215
+ relevanceId?: string;
220
216
  }
221
217
  export interface Relevance {
222
218
  /**
@@ -333,7 +329,7 @@ export interface SubjectTopic {
333
329
  /**
334
330
  * Relevance id
335
331
  */
336
- relevanceId: string;
332
+ relevanceId?: string;
337
333
  }
338
334
  export interface SubjectTopicPOST {
339
335
  /**
@@ -347,33 +343,29 @@ export interface SubjectTopicPOST {
347
343
  /**
348
344
  * Backwards compatibility: Always true, ignored on insert/update.
349
345
  */
350
- primary: boolean;
346
+ primary?: boolean;
351
347
  /**
352
348
  * Order in which the topic should be sorted for the topic
353
349
  */
354
- rank: number;
350
+ rank?: number;
355
351
  /**
356
352
  * Relevance id
357
353
  */
358
- relevanceId: string;
354
+ relevanceId?: string;
359
355
  }
360
356
  export interface SubjectTopicPUT {
361
- /**
362
- * connection id
363
- */
364
- id: string;
365
357
  /**
366
358
  * If true, set this subject as the primary subject for this topic. This will replace any other primary subject for this topic. You must have one primary subject, so it is not allowed to set the currently primary subject to not be primary any more.
367
359
  */
368
- primary: boolean;
360
+ primary?: boolean;
369
361
  /**
370
362
  * Order in which the topic should be sorted for the subject
371
363
  */
372
- rank: number;
364
+ rank?: number;
373
365
  /**
374
366
  * Relevance id
375
367
  */
376
- relevanceId: string;
368
+ relevanceId?: string;
377
369
  }
378
370
  export interface TopicResource {
379
371
  /**
@@ -399,7 +391,7 @@ export interface TopicResource {
399
391
  /**
400
392
  * Relevance id
401
393
  */
402
- relevanceId: string;
394
+ relevanceId?: string;
403
395
  }
404
396
  export interface TopicResourcePOST {
405
397
  /**
@@ -413,33 +405,29 @@ export interface TopicResourcePOST {
413
405
  /**
414
406
  * Primary connection
415
407
  */
416
- primary: boolean;
408
+ primary?: boolean;
417
409
  /**
418
410
  * Order in which resource is sorted for the topic
419
411
  */
420
- rank: number;
412
+ rank?: number;
421
413
  /**
422
414
  * Relevance id
423
415
  */
424
- relevanceId: string;
416
+ relevanceId?: string;
425
417
  }
426
418
  export interface TopicResourcePUT {
427
- /**
428
- * Topic resource connection id
429
- */
430
- id: string;
431
419
  /**
432
420
  * Primary connection
433
421
  */
434
- primary: boolean;
422
+ primary?: boolean;
435
423
  /**
436
424
  * Order in which the resource will be sorted for this topic.
437
425
  */
438
- rank: number;
426
+ rank?: number;
439
427
  /**
440
428
  * Relevance id
441
429
  */
442
- relevanceId: string;
430
+ relevanceId?: string;
443
431
  }
444
432
  export interface TopicSubtopic {
445
433
  /**
@@ -465,7 +453,7 @@ export interface TopicSubtopic {
465
453
  /**
466
454
  * Relevance id
467
455
  */
468
- relevanceId: string;
456
+ relevanceId?: string;
469
457
  }
470
458
  export interface TopicSubtopicPOST {
471
459
  /**
@@ -477,35 +465,31 @@ export interface TopicSubtopicPOST {
477
465
  */
478
466
  subtopicid: string;
479
467
  /**
480
- * Backwards compatibility: Always true. Ignored on insert/update
468
+ * Is this connection primary
481
469
  */
482
- primary: boolean;
470
+ primary?: boolean;
483
471
  /**
484
472
  * Order in which to sort the subtopic for the topic
485
473
  */
486
- rank: number;
474
+ rank?: number;
487
475
  /**
488
476
  * Relevance id
489
477
  */
490
- relevanceId: string;
478
+ relevanceId?: string;
491
479
  }
492
480
  export interface TopicSubtopicPUT {
493
481
  /**
494
- * Connection id
495
- */
496
- id: string;
497
- /**
498
- * Backwards compatibility: Always true. Ignored on insert/update
482
+ * Is this connection primary
499
483
  */
500
- primary: boolean;
484
+ primary?: boolean;
501
485
  /**
502
486
  * Order in which subtopic is sorted for the topic
503
487
  */
504
- rank: number;
488
+ rank?: number;
505
489
  /**
506
490
  * Relevance id
507
491
  */
508
- relevanceId: string;
492
+ relevanceId?: string;
509
493
  }
510
494
  export interface TranslationPUT {
511
495
  /**
@@ -590,8 +574,8 @@ export interface TaxonomyContext {
590
574
  contextId: string;
591
575
  id: string;
592
576
  subject: Record<string, string>;
593
- parentTopicIds: string[];
594
577
  subjectId: string;
578
+ parentTopicIds: string[];
595
579
  isPrimaryConnection: boolean;
596
580
  }
597
581
  export interface Connection {
@@ -620,7 +604,7 @@ export interface Node {
620
604
  path: string;
621
605
  paths: string[];
622
606
  metadata: Metadata;
623
- relevanceId: string;
607
+ relevanceId?: string;
624
608
  translations: Translation[];
625
609
  supportedLanguages: string[];
626
610
  breadcrumbs: string[];
package/package.json CHANGED
@@ -17,5 +17,5 @@
17
17
  "devDependencies": {
18
18
  "typescript": "^5.0.2"
19
19
  },
20
- "version": "1.0.7"
20
+ "version": "1.0.8"
21
21
  }
package/taxonomy-api.ts CHANGED
@@ -2,28 +2,28 @@
2
2
  export interface NodePostPut {
3
3
  nodeId?: string;
4
4
  /**
5
- * Type of node. Values are subject, topic. Required on create.
5
+ * Type of node.
6
6
  */
7
7
  nodeType: NodeType;
8
8
  /**
9
9
  * ID of content introducing this node. Must be a valid URI, but preferably not a URL.
10
10
  */
11
- contentUri: string;
11
+ contentUri?: string;
12
12
  /**
13
13
  * The name of the node. Required on create.
14
14
  */
15
- name: string;
15
+ name?: string;
16
16
  /**
17
17
  * The node is a root node. Default is false. Only used if present.
18
18
  */
19
- root: boolean;
19
+ root?: boolean;
20
20
  }
21
21
 
22
22
  export interface ResourcePostPut {
23
23
  /**
24
24
  * If specified, set the id to this value. Must start with urn:resource: and be a valid URI. If omitted, an id will be assigned automatically.
25
25
  */
26
- id: string;
26
+ id?: string;
27
27
  /**
28
28
  * The ID of this resource in the system where the content is stored. This ID should be of the form 'urn:<system>:<id>', where <system> is a short identifier for the system, and <id> is the id of this content in that system.
29
29
  */
@@ -40,9 +40,9 @@ export interface SubjectPostPut {
40
40
  */
41
41
  id: string;
42
42
  /**
43
- * ID of article introducing this subject. Must be a valid URI, but preferably not a URL.
43
+ * ID of frontpage connected to this subject. Must be a valid URI, but preferably not a URL.
44
44
  */
45
- contentUri: string;
45
+ contentUri?: string;
46
46
  /**
47
47
  * The name of the subject
48
48
  */
@@ -76,7 +76,7 @@ export interface VersionPostPut {
76
76
  /**
77
77
  * If specified, set the locked property to this value.
78
78
  */
79
- locked: boolean;
79
+ locked?: boolean;
80
80
  }
81
81
 
82
82
  export interface Context {
@@ -103,7 +103,7 @@ export interface NodeConnection {
103
103
  */
104
104
  id: string;
105
105
  /**
106
- * Backwards compatibility: Always true. Ignored on insert/update
106
+ * Is this connection primary
107
107
  */
108
108
  primary: boolean;
109
109
  /**
@@ -113,7 +113,7 @@ export interface NodeConnection {
113
113
  /**
114
114
  * Relevance id
115
115
  */
116
- relevanceId: string;
116
+ relevanceId?: string;
117
117
  /**
118
118
  * Metadata for entity. Read only.
119
119
  */
@@ -127,36 +127,32 @@ export interface NodeConnectionPOST {
127
127
  */
128
128
  childId: string;
129
129
  /**
130
- * Backwards compatibility: Always true. Ignored on insert/update
130
+ * If this connection is primary.
131
131
  */
132
- primary: boolean;
132
+ primary?: boolean;
133
133
  /**
134
134
  * Order in which to sort the child for the parent
135
135
  */
136
- rank: number;
136
+ rank?: number;
137
137
  /**
138
138
  * Relevance id
139
139
  */
140
- relevanceId: string;
140
+ relevanceId?: string;
141
141
  }
142
142
 
143
143
  export interface NodeConnectionPUT {
144
144
  /**
145
- * Connection id
145
+ * If this connection is primary.
146
146
  */
147
- id: string;
148
- /**
149
- * Backwards compatibility: Always true. Ignored on insert/update
150
- */
151
- primary: boolean;
147
+ primary?: boolean;
152
148
  /**
153
149
  * Order in which subtopic is sorted for the topic
154
150
  */
155
- rank: number;
151
+ rank?: number;
156
152
  /**
157
153
  * Relevance id
158
154
  */
159
- relevanceId: string;
155
+ relevanceId?: string;
160
156
  }
161
157
 
162
158
  export interface NodeResource {
@@ -183,7 +179,7 @@ export interface NodeResource {
183
179
  /**
184
180
  * Relevance id
185
181
  */
186
- relevanceId: string;
182
+ relevanceId?: string;
187
183
  /**
188
184
  * Metadata for entity. Read only.
189
185
  */
@@ -202,15 +198,15 @@ export interface NodeResourcePOST {
202
198
  /**
203
199
  * Primary connection
204
200
  */
205
- primary: boolean;
201
+ primary?: boolean;
206
202
  /**
207
203
  * Order in which resource is sorted for the node
208
204
  */
209
- rank: number;
205
+ rank?: number;
210
206
  /**
211
207
  * Relevance id
212
208
  */
213
- relevanceId: string;
209
+ relevanceId?: string;
214
210
  }
215
211
 
216
212
  export interface NodeResourcePUT {
@@ -221,15 +217,15 @@ export interface NodeResourcePUT {
221
217
  /**
222
218
  * Primary connection
223
219
  */
224
- primary: boolean;
220
+ primary?: boolean;
225
221
  /**
226
222
  * Order in which the resource will be sorted for this node.
227
223
  */
228
- rank: number;
224
+ rank?: number;
229
225
  /**
230
226
  * Relevance id
231
227
  */
232
- relevanceId: string;
228
+ relevanceId?: string;
233
229
  }
234
230
 
235
231
  export interface Relevance {
@@ -354,7 +350,7 @@ export interface SubjectTopic {
354
350
  /**
355
351
  * Relevance id
356
352
  */
357
- relevanceId: string;
353
+ relevanceId?: string;
358
354
  }
359
355
 
360
356
  export interface SubjectTopicPOST {
@@ -369,34 +365,30 @@ export interface SubjectTopicPOST {
369
365
  /**
370
366
  * Backwards compatibility: Always true, ignored on insert/update.
371
367
  */
372
- primary: boolean;
368
+ primary?: boolean;
373
369
  /**
374
370
  * Order in which the topic should be sorted for the topic
375
371
  */
376
- rank: number;
372
+ rank?: number;
377
373
  /**
378
374
  * Relevance id
379
375
  */
380
- relevanceId: string;
376
+ relevanceId?: string;
381
377
  }
382
378
 
383
379
  export interface SubjectTopicPUT {
384
- /**
385
- * connection id
386
- */
387
- id: string;
388
380
  /**
389
381
  * If true, set this subject as the primary subject for this topic. This will replace any other primary subject for this topic. You must have one primary subject, so it is not allowed to set the currently primary subject to not be primary any more.
390
382
  */
391
- primary: boolean;
383
+ primary?: boolean;
392
384
  /**
393
385
  * Order in which the topic should be sorted for the subject
394
386
  */
395
- rank: number;
387
+ rank?: number;
396
388
  /**
397
389
  * Relevance id
398
390
  */
399
- relevanceId: string;
391
+ relevanceId?: string;
400
392
  }
401
393
 
402
394
  export interface TopicResource {
@@ -423,7 +415,7 @@ export interface TopicResource {
423
415
  /**
424
416
  * Relevance id
425
417
  */
426
- relevanceId: string;
418
+ relevanceId?: string;
427
419
  }
428
420
 
429
421
  export interface TopicResourcePOST {
@@ -438,34 +430,30 @@ export interface TopicResourcePOST {
438
430
  /**
439
431
  * Primary connection
440
432
  */
441
- primary: boolean;
433
+ primary?: boolean;
442
434
  /**
443
435
  * Order in which resource is sorted for the topic
444
436
  */
445
- rank: number;
437
+ rank?: number;
446
438
  /**
447
439
  * Relevance id
448
440
  */
449
- relevanceId: string;
441
+ relevanceId?: string;
450
442
  }
451
443
 
452
444
  export interface TopicResourcePUT {
453
- /**
454
- * Topic resource connection id
455
- */
456
- id: string;
457
445
  /**
458
446
  * Primary connection
459
447
  */
460
- primary: boolean;
448
+ primary?: boolean;
461
449
  /**
462
450
  * Order in which the resource will be sorted for this topic.
463
451
  */
464
- rank: number;
452
+ rank?: number;
465
453
  /**
466
454
  * Relevance id
467
455
  */
468
- relevanceId: string;
456
+ relevanceId?: string;
469
457
  }
470
458
 
471
459
  export interface TopicSubtopic {
@@ -492,7 +480,7 @@ export interface TopicSubtopic {
492
480
  /**
493
481
  * Relevance id
494
482
  */
495
- relevanceId: string;
483
+ relevanceId?: string;
496
484
  }
497
485
 
498
486
  export interface TopicSubtopicPOST {
@@ -505,36 +493,32 @@ export interface TopicSubtopicPOST {
505
493
  */
506
494
  subtopicid: string;
507
495
  /**
508
- * Backwards compatibility: Always true. Ignored on insert/update
496
+ * Is this connection primary
509
497
  */
510
- primary: boolean;
498
+ primary?: boolean;
511
499
  /**
512
500
  * Order in which to sort the subtopic for the topic
513
501
  */
514
- rank: number;
502
+ rank?: number;
515
503
  /**
516
504
  * Relevance id
517
505
  */
518
- relevanceId: string;
506
+ relevanceId?: string;
519
507
  }
520
508
 
521
509
  export interface TopicSubtopicPUT {
522
510
  /**
523
- * Connection id
524
- */
525
- id: string;
526
- /**
527
- * Backwards compatibility: Always true. Ignored on insert/update
511
+ * Is this connection primary
528
512
  */
529
- primary: boolean;
513
+ primary?: boolean;
530
514
  /**
531
515
  * Order in which subtopic is sorted for the topic
532
516
  */
533
- rank: number;
517
+ rank?: number;
534
518
  /**
535
519
  * Relevance id
536
520
  */
537
- relevanceId: string;
521
+ relevanceId?: string;
538
522
  }
539
523
 
540
524
  export interface TranslationPUT {
@@ -623,8 +607,8 @@ export interface TaxonomyContext {
623
607
  contextId: string;
624
608
  id: string;
625
609
  subject: Record<string, string>;
626
- parentTopicIds: string[];
627
610
  subjectId: string;
611
+ parentTopicIds: string[];
628
612
  isPrimaryConnection: boolean;
629
613
  }
630
614
 
@@ -657,7 +641,7 @@ export interface Node {
657
641
  path: string;
658
642
  paths: string[];
659
643
  metadata: Metadata;
660
- relevanceId: string;
644
+ relevanceId?: string;
661
645
  translations: Translation[];
662
646
  supportedLanguages: string[];
663
647
  breadcrumbs: string[];