@ndla/types-taxonomy 1.0.7 → 1.0.9

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,33 +186,29 @@ 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
- /**
205
- * Node resource connection id
206
- */
207
- id: string;
208
200
  /**
209
201
  * Primary connection
210
202
  */
211
- primary: boolean;
203
+ primary?: boolean;
212
204
  /**
213
205
  * Order in which the resource will be sorted for this node.
214
206
  */
215
- rank: number;
207
+ rank?: number;
216
208
  /**
217
209
  * Relevance id
218
210
  */
219
- relevanceId: string;
211
+ relevanceId?: string;
220
212
  }
221
213
  export interface Relevance {
222
214
  /**
@@ -333,7 +325,7 @@ export interface SubjectTopic {
333
325
  /**
334
326
  * Relevance id
335
327
  */
336
- relevanceId: string;
328
+ relevanceId?: string;
337
329
  }
338
330
  export interface SubjectTopicPOST {
339
331
  /**
@@ -347,33 +339,29 @@ export interface SubjectTopicPOST {
347
339
  /**
348
340
  * Backwards compatibility: Always true, ignored on insert/update.
349
341
  */
350
- primary: boolean;
342
+ primary?: boolean;
351
343
  /**
352
344
  * Order in which the topic should be sorted for the topic
353
345
  */
354
- rank: number;
346
+ rank?: number;
355
347
  /**
356
348
  * Relevance id
357
349
  */
358
- relevanceId: string;
350
+ relevanceId?: string;
359
351
  }
360
352
  export interface SubjectTopicPUT {
361
- /**
362
- * connection id
363
- */
364
- id: string;
365
353
  /**
366
354
  * 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
355
  */
368
- primary: boolean;
356
+ primary?: boolean;
369
357
  /**
370
358
  * Order in which the topic should be sorted for the subject
371
359
  */
372
- rank: number;
360
+ rank?: number;
373
361
  /**
374
362
  * Relevance id
375
363
  */
376
- relevanceId: string;
364
+ relevanceId?: string;
377
365
  }
378
366
  export interface TopicResource {
379
367
  /**
@@ -399,7 +387,7 @@ export interface TopicResource {
399
387
  /**
400
388
  * Relevance id
401
389
  */
402
- relevanceId: string;
390
+ relevanceId?: string;
403
391
  }
404
392
  export interface TopicResourcePOST {
405
393
  /**
@@ -413,33 +401,29 @@ export interface TopicResourcePOST {
413
401
  /**
414
402
  * Primary connection
415
403
  */
416
- primary: boolean;
404
+ primary?: boolean;
417
405
  /**
418
406
  * Order in which resource is sorted for the topic
419
407
  */
420
- rank: number;
408
+ rank?: number;
421
409
  /**
422
410
  * Relevance id
423
411
  */
424
- relevanceId: string;
412
+ relevanceId?: string;
425
413
  }
426
414
  export interface TopicResourcePUT {
427
- /**
428
- * Topic resource connection id
429
- */
430
- id: string;
431
415
  /**
432
416
  * Primary connection
433
417
  */
434
- primary: boolean;
418
+ primary?: boolean;
435
419
  /**
436
420
  * Order in which the resource will be sorted for this topic.
437
421
  */
438
- rank: number;
422
+ rank?: number;
439
423
  /**
440
424
  * Relevance id
441
425
  */
442
- relevanceId: string;
426
+ relevanceId?: string;
443
427
  }
444
428
  export interface TopicSubtopic {
445
429
  /**
@@ -465,7 +449,7 @@ export interface TopicSubtopic {
465
449
  /**
466
450
  * Relevance id
467
451
  */
468
- relevanceId: string;
452
+ relevanceId?: string;
469
453
  }
470
454
  export interface TopicSubtopicPOST {
471
455
  /**
@@ -477,35 +461,31 @@ export interface TopicSubtopicPOST {
477
461
  */
478
462
  subtopicid: string;
479
463
  /**
480
- * Backwards compatibility: Always true. Ignored on insert/update
464
+ * Is this connection primary
481
465
  */
482
- primary: boolean;
466
+ primary?: boolean;
483
467
  /**
484
468
  * Order in which to sort the subtopic for the topic
485
469
  */
486
- rank: number;
470
+ rank?: number;
487
471
  /**
488
472
  * Relevance id
489
473
  */
490
- relevanceId: string;
474
+ relevanceId?: string;
491
475
  }
492
476
  export interface TopicSubtopicPUT {
493
477
  /**
494
- * Connection id
478
+ * Is this connection primary
495
479
  */
496
- id: string;
497
- /**
498
- * Backwards compatibility: Always true. Ignored on insert/update
499
- */
500
- primary: boolean;
480
+ primary?: boolean;
501
481
  /**
502
482
  * Order in which subtopic is sorted for the topic
503
483
  */
504
- rank: number;
484
+ rank?: number;
505
485
  /**
506
486
  * Relevance id
507
487
  */
508
- relevanceId: string;
488
+ relevanceId?: string;
509
489
  }
510
490
  export interface TranslationPUT {
511
491
  /**
@@ -590,8 +570,8 @@ export interface TaxonomyContext {
590
570
  contextId: string;
591
571
  id: string;
592
572
  subject: Record<string, string>;
593
- parentTopicIds: string[];
594
573
  subjectId: string;
574
+ parentTopicIds: string[];
595
575
  isPrimaryConnection: boolean;
596
576
  }
597
577
  export interface Connection {
@@ -620,7 +600,7 @@ export interface Node {
620
600
  path: string;
621
601
  paths: string[];
622
602
  metadata: Metadata;
623
- relevanceId: string;
603
+ relevanceId?: string;
624
604
  translations: Translation[];
625
605
  supportedLanguages: string[];
626
606
  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.9"
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,34 +198,30 @@ 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 {
217
- /**
218
- * Node resource connection id
219
- */
220
- id: string;
221
213
  /**
222
214
  * Primary connection
223
215
  */
224
- primary: boolean;
216
+ primary?: boolean;
225
217
  /**
226
218
  * Order in which the resource will be sorted for this node.
227
219
  */
228
- rank: number;
220
+ rank?: number;
229
221
  /**
230
222
  * Relevance id
231
223
  */
232
- relevanceId: string;
224
+ relevanceId?: string;
233
225
  }
234
226
 
235
227
  export interface Relevance {
@@ -354,7 +346,7 @@ export interface SubjectTopic {
354
346
  /**
355
347
  * Relevance id
356
348
  */
357
- relevanceId: string;
349
+ relevanceId?: string;
358
350
  }
359
351
 
360
352
  export interface SubjectTopicPOST {
@@ -369,34 +361,30 @@ export interface SubjectTopicPOST {
369
361
  /**
370
362
  * Backwards compatibility: Always true, ignored on insert/update.
371
363
  */
372
- primary: boolean;
364
+ primary?: boolean;
373
365
  /**
374
366
  * Order in which the topic should be sorted for the topic
375
367
  */
376
- rank: number;
368
+ rank?: number;
377
369
  /**
378
370
  * Relevance id
379
371
  */
380
- relevanceId: string;
372
+ relevanceId?: string;
381
373
  }
382
374
 
383
375
  export interface SubjectTopicPUT {
384
- /**
385
- * connection id
386
- */
387
- id: string;
388
376
  /**
389
377
  * 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
378
  */
391
- primary: boolean;
379
+ primary?: boolean;
392
380
  /**
393
381
  * Order in which the topic should be sorted for the subject
394
382
  */
395
- rank: number;
383
+ rank?: number;
396
384
  /**
397
385
  * Relevance id
398
386
  */
399
- relevanceId: string;
387
+ relevanceId?: string;
400
388
  }
401
389
 
402
390
  export interface TopicResource {
@@ -423,7 +411,7 @@ export interface TopicResource {
423
411
  /**
424
412
  * Relevance id
425
413
  */
426
- relevanceId: string;
414
+ relevanceId?: string;
427
415
  }
428
416
 
429
417
  export interface TopicResourcePOST {
@@ -438,34 +426,30 @@ export interface TopicResourcePOST {
438
426
  /**
439
427
  * Primary connection
440
428
  */
441
- primary: boolean;
429
+ primary?: boolean;
442
430
  /**
443
431
  * Order in which resource is sorted for the topic
444
432
  */
445
- rank: number;
433
+ rank?: number;
446
434
  /**
447
435
  * Relevance id
448
436
  */
449
- relevanceId: string;
437
+ relevanceId?: string;
450
438
  }
451
439
 
452
440
  export interface TopicResourcePUT {
453
- /**
454
- * Topic resource connection id
455
- */
456
- id: string;
457
441
  /**
458
442
  * Primary connection
459
443
  */
460
- primary: boolean;
444
+ primary?: boolean;
461
445
  /**
462
446
  * Order in which the resource will be sorted for this topic.
463
447
  */
464
- rank: number;
448
+ rank?: number;
465
449
  /**
466
450
  * Relevance id
467
451
  */
468
- relevanceId: string;
452
+ relevanceId?: string;
469
453
  }
470
454
 
471
455
  export interface TopicSubtopic {
@@ -492,7 +476,7 @@ export interface TopicSubtopic {
492
476
  /**
493
477
  * Relevance id
494
478
  */
495
- relevanceId: string;
479
+ relevanceId?: string;
496
480
  }
497
481
 
498
482
  export interface TopicSubtopicPOST {
@@ -505,36 +489,32 @@ export interface TopicSubtopicPOST {
505
489
  */
506
490
  subtopicid: string;
507
491
  /**
508
- * Backwards compatibility: Always true. Ignored on insert/update
492
+ * Is this connection primary
509
493
  */
510
- primary: boolean;
494
+ primary?: boolean;
511
495
  /**
512
496
  * Order in which to sort the subtopic for the topic
513
497
  */
514
- rank: number;
498
+ rank?: number;
515
499
  /**
516
500
  * Relevance id
517
501
  */
518
- relevanceId: string;
502
+ relevanceId?: string;
519
503
  }
520
504
 
521
505
  export interface TopicSubtopicPUT {
522
506
  /**
523
- * Connection id
507
+ * Is this connection primary
524
508
  */
525
- id: string;
526
- /**
527
- * Backwards compatibility: Always true. Ignored on insert/update
528
- */
529
- primary: boolean;
509
+ primary?: boolean;
530
510
  /**
531
511
  * Order in which subtopic is sorted for the topic
532
512
  */
533
- rank: number;
513
+ rank?: number;
534
514
  /**
535
515
  * Relevance id
536
516
  */
537
- relevanceId: string;
517
+ relevanceId?: string;
538
518
  }
539
519
 
540
520
  export interface TranslationPUT {
@@ -623,8 +603,8 @@ export interface TaxonomyContext {
623
603
  contextId: string;
624
604
  id: string;
625
605
  subject: Record<string, string>;
626
- parentTopicIds: string[];
627
606
  subjectId: string;
607
+ parentTopicIds: string[];
628
608
  isPrimaryConnection: boolean;
629
609
  }
630
610
 
@@ -657,7 +637,7 @@ export interface Node {
657
637
  path: string;
658
638
  paths: string[];
659
639
  metadata: Metadata;
660
- relevanceId: string;
640
+ relevanceId?: string;
661
641
  translations: Translation[];
662
642
  supportedLanguages: string[];
663
643
  breadcrumbs: string[];