@ndla/types-taxonomy 1.0.34 → 1.0.35

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/mise.toml ADDED
@@ -0,0 +1,2 @@
1
+ [tools]
2
+ node = "22.15"
package/package.json CHANGED
@@ -17,5 +17,6 @@
17
17
  "devDependencies": {
18
18
  "typescript": "^5.0.2"
19
19
  },
20
- "version": "1.0.34"
20
+ "version": "1.0.35",
21
+ "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
21
22
  }
package/taxonomy-api.ts CHANGED
@@ -152,7 +152,7 @@ export interface NodePostPut {
152
152
  /**
153
153
  * The language used at create time. Used to set default translation.
154
154
  */
155
- language?: string;
155
+ language: string;
156
156
  /**
157
157
  * The name of the node. Required on create.
158
158
  */
@@ -263,11 +263,11 @@ export interface NodeSearchBody {
263
263
  /**
264
264
  * Include all contexts
265
265
  */
266
- includeContexts?: boolean;
266
+ includeContexts: boolean;
267
267
  /**
268
268
  * ISO-639-1 language code
269
269
  */
270
- language?: string;
270
+ language: string;
271
271
  /**
272
272
  * Filter by nodeType
273
273
  */
@@ -328,6 +328,7 @@ export interface ResolvedOldUrl {
328
328
 
329
329
  export interface ResolvedUrl {
330
330
  contentUri: string;
331
+ exactMatch: boolean;
331
332
  id: string;
332
333
  name: string;
333
334
  parents: string[];
@@ -433,6 +434,7 @@ export interface SearchResult<T> {
433
434
  export interface SearchableTaxonomyResourceType {
434
435
  id: string;
435
436
  name: Record<string, string>;
437
+ parentId?: string;
436
438
  }
437
439
 
438
440
  export interface SubjectPostPut {
@@ -557,7 +559,7 @@ export interface TaxonomyContext {
557
559
  */
558
560
  parentIds: string[];
559
561
  /**
560
- * List of all parents to this context
562
+ * List of all parents to this context. Empty if node is fetched as child
561
563
  */
562
564
  parents: TaxonomyCrumb[];
563
565
  /**
@@ -815,7 +817,7 @@ export interface Version {
815
817
 
816
818
  export interface VersionPostPut {
817
819
  /**
818
- * If specified, set the id to this value. Must start with urn:subject: and be a valid URI. If omitted, an id will be assigned automatically.
820
+ * If specified, set the id to this value. Must start with urn:version: and be a valid URI. If ommitted, an id will be assigned automatically.
819
821
  */
820
822
  id?: string;
821
823
  /**
@@ -1,787 +0,0 @@
1
- export interface Connection {
2
- connectionId: string;
3
- isPrimary: boolean;
4
- paths: string[];
5
- targetId: string;
6
- type: string;
7
- }
8
- export interface Context {
9
- id: string;
10
- name: string;
11
- path: string;
12
- }
13
- export interface ContextPOST {
14
- id: string;
15
- }
16
- export interface GradeAverage {
17
- averageValue: number;
18
- count: number;
19
- }
20
- export interface Metadata {
21
- customFields: Record<string, string>;
22
- grepCodes: string[];
23
- visible: boolean;
24
- }
25
- export interface Node {
26
- baseName: string;
27
- breadcrumbs: string[];
28
- contentUri?: string;
29
- context?: TaxonomyContext;
30
- /**
31
- * An id unique for this context.
32
- */
33
- contextId?: string;
34
- /**
35
- * A list of all contextids this node has ever had
36
- */
37
- contextids: string[];
38
- contexts: TaxonomyContext[];
39
- /**
40
- * A number representing the average grade of all children nodes recursively.
41
- */
42
- gradeAverage?: GradeAverage;
43
- id: string;
44
- language: string;
45
- metadata: Metadata;
46
- name: string;
47
- /**
48
- * The type of node
49
- */
50
- nodeType: NodeType;
51
- path?: string;
52
- paths: string[];
53
- /**
54
- * Quality evaluation of the article
55
- */
56
- qualityEvaluation?: QualityEvaluation;
57
- relevanceId?: string;
58
- resourceTypes: ResourceTypeWithConnection[];
59
- supportedLanguages: string[];
60
- translations: Translation[];
61
- url?: string;
62
- }
63
- export interface NodeChild extends Node {
64
- connectionId: string;
65
- isPrimary: boolean;
66
- parentId: string;
67
- rank: number;
68
- }
69
- export interface NodeConnection {
70
- /**
71
- * Child id
72
- */
73
- childId: string;
74
- /**
75
- * Connection id
76
- */
77
- id: string;
78
- /**
79
- * Metadata for entity. Read only.
80
- */
81
- metadata: Metadata;
82
- /**
83
- * Parent id
84
- */
85
- parentId: string;
86
- /**
87
- * Is this connection primary
88
- */
89
- primary: boolean;
90
- /**
91
- * Order in which subtopic is sorted for the topic
92
- */
93
- rank: number;
94
- /**
95
- * Relevance id
96
- */
97
- relevanceId?: string;
98
- }
99
- export interface NodeConnectionPOST {
100
- /**
101
- * Child id
102
- */
103
- childId: string;
104
- parentId: string;
105
- /**
106
- * If this connection is primary.
107
- */
108
- primary?: boolean;
109
- /**
110
- * Order in which to sort the child for the parent
111
- */
112
- rank?: number;
113
- /**
114
- * Relevance id
115
- */
116
- relevanceId?: string;
117
- }
118
- export interface NodeConnectionPUT {
119
- /**
120
- * If this connection is primary.
121
- */
122
- primary?: boolean;
123
- /**
124
- * Order in which subtopic is sorted for the topic
125
- */
126
- rank?: number;
127
- /**
128
- * Relevance id
129
- */
130
- relevanceId?: string;
131
- }
132
- export interface NodePostPut {
133
- /**
134
- * ID of content introducing this node. Must be a valid URI, but preferably not a URL.
135
- */
136
- contentUri?: string;
137
- /**
138
- * The node is the root in a context. Default is false. Only used if present.
139
- */
140
- context?: boolean;
141
- /**
142
- * The language used at create time. Used to set default translation.
143
- */
144
- language?: string;
145
- /**
146
- * The name of the node. Required on create.
147
- */
148
- name?: string;
149
- nodeId?: string;
150
- /**
151
- * Type of node.
152
- */
153
- nodeType: NodeType;
154
- /**
155
- * The quality evaluation of the node. Consist of a score from 1 to 5 and a comment.
156
- */
157
- qualityEvaluation?: QualityEvaluation | null;
158
- /**
159
- * The node is a root node. Default is false. Only used if present.
160
- * @deprecated
161
- */
162
- root?: boolean;
163
- /**
164
- * The node is visible. Default is true.
165
- */
166
- visible?: boolean;
167
- }
168
- export interface NodeResource {
169
- /**
170
- * Node resource connection id
171
- */
172
- id: string;
173
- /**
174
- * Metadata for entity. Read only.
175
- */
176
- metadata: Metadata;
177
- /**
178
- * Node id
179
- */
180
- nodeId: string;
181
- /**
182
- * Primary connection
183
- */
184
- primary: boolean;
185
- /**
186
- * Order in which the resource is sorted for the node
187
- */
188
- rank: number;
189
- /**
190
- * Relevance id
191
- */
192
- relevanceId?: string;
193
- /**
194
- * Resource id
195
- */
196
- resourceId: string;
197
- }
198
- export interface NodeResourcePOST {
199
- /**
200
- * Node id
201
- */
202
- nodeId: string;
203
- /**
204
- * Primary connection
205
- */
206
- primary?: boolean;
207
- /**
208
- * Order in which resource is sorted for the node
209
- */
210
- rank?: number;
211
- /**
212
- * Relevance id
213
- */
214
- relevanceId?: string;
215
- /**
216
- * Resource id
217
- */
218
- resourceId: string;
219
- }
220
- export interface NodeResourcePUT {
221
- /**
222
- * Primary connection
223
- */
224
- primary?: boolean;
225
- /**
226
- * Order in which the resource will be sorted for this node.
227
- */
228
- rank?: number;
229
- /**
230
- * Relevance id
231
- */
232
- relevanceId?: string;
233
- }
234
- export interface NodeSearchBody {
235
- /**
236
- * ContentURIs to fetch for query
237
- */
238
- contentUris?: string[];
239
- customFields?: Record<string, string>;
240
- /**
241
- * Filter out programme contexts
242
- */
243
- filterProgrammes: boolean;
244
- /**
245
- * Ids to fetch for query
246
- */
247
- ids?: string[];
248
- /**
249
- * Include all contexts
250
- */
251
- includeContexts?: boolean;
252
- /**
253
- * ISO-639-1 language code
254
- */
255
- language?: string;
256
- /**
257
- * Filter by nodeType
258
- */
259
- nodeType?: NodeType[];
260
- /**
261
- * Which page to fetch
262
- */
263
- page: number;
264
- /**
265
- * How many results to return per page
266
- */
267
- pageSize: number;
268
- /**
269
- * Id to parent id in context.
270
- */
271
- parentId?: string;
272
- /**
273
- * Query to search names
274
- */
275
- query?: string;
276
- /**
277
- * Id to root id in context.
278
- */
279
- rootId?: string;
280
- }
281
- export interface NodeWithParents extends Node {
282
- parents: NodeChild[];
283
- }
284
- export interface QualityEvaluation {
285
- grade: Grade;
286
- note?: string;
287
- }
288
- export interface Relevance {
289
- /**
290
- * Specifies if node is core or supplementary
291
- */
292
- id: string;
293
- /**
294
- * The name of the relevance
295
- */
296
- name: string;
297
- /**
298
- * List of language codes supported by translations
299
- */
300
- supportedLanguages: string[];
301
- translations: Translation[];
302
- }
303
- export interface ResolvedOldUrl {
304
- /**
305
- * URL path for resource
306
- */
307
- path: string;
308
- }
309
- export interface ResolvedUrl {
310
- contentUri: string;
311
- id: string;
312
- name: string;
313
- parents: string[];
314
- path: string;
315
- url: string;
316
- }
317
- export interface ResourcePostPut {
318
- /**
319
- * 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.
320
- */
321
- contentUri: string;
322
- /**
323
- * 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.
324
- */
325
- id?: string;
326
- /**
327
- * The name of the resource
328
- */
329
- name: string;
330
- }
331
- export interface ResourceResourceType {
332
- /**
333
- * Resource to resource type connection id
334
- */
335
- id: string;
336
- /**
337
- * Resource type id
338
- */
339
- resourceId: string;
340
- /**
341
- * Resource type id
342
- */
343
- resourceTypeId: string;
344
- }
345
- export interface ResourceResourceTypePOST {
346
- /**
347
- * Resource id
348
- */
349
- resourceId: string;
350
- /**
351
- * Resource type id
352
- */
353
- resourceTypeId: string;
354
- }
355
- export interface ResourceType {
356
- id: string;
357
- /**
358
- * The name of the resource type
359
- */
360
- name: string;
361
- /**
362
- * Sub resource types
363
- */
364
- subtypes?: ResourceType[];
365
- /**
366
- * List of language codes supported by translations
367
- */
368
- supportedLanguages: string[];
369
- /**
370
- * All translations of this resource type
371
- */
372
- translations: Translation[];
373
- }
374
- export interface ResourceTypePUT {
375
- /**
376
- * If specified, set the id to this value. Must start with urn:resourcetype: and be a valid URI. If omitted, an id will be assigned automatically.
377
- */
378
- id: string;
379
- /**
380
- * The name of the resource type
381
- */
382
- name: string;
383
- /**
384
- * If specified, the new resource type will be a child of the mentioned resource type.
385
- */
386
- parentId: string;
387
- }
388
- export interface ResourceTypeWithConnection {
389
- connectionId: string;
390
- id: string;
391
- name: string;
392
- parentId?: string;
393
- /**
394
- * List of language codes supported by translations
395
- */
396
- supportedLanguages: string[];
397
- translations: Translation[];
398
- }
399
- export interface SearchResult<T> {
400
- page: number;
401
- pageSize: number;
402
- results: T[];
403
- totalCount: number;
404
- }
405
- export interface SearchableTaxonomyResourceType {
406
- id: string;
407
- name: Record<string, string>;
408
- }
409
- export interface SubjectPostPut {
410
- /**
411
- * ID of frontpage connected to this subject. Must be a valid URI, but preferably not a URL.
412
- */
413
- contentUri?: string;
414
- /**
415
- * If specified, set the id to this value. Must start with urn:subject: and be a valid URI. If omitted, an id will be assigned automatically.
416
- */
417
- id?: string;
418
- /**
419
- * The name of the subject
420
- */
421
- name: string;
422
- }
423
- export interface SubjectTopic {
424
- /**
425
- * Connection id
426
- */
427
- id: string;
428
- /**
429
- * primary
430
- */
431
- primary: boolean;
432
- /**
433
- * Order in which the topic is sorted under the subject
434
- */
435
- rank: number;
436
- /**
437
- * Relevance id
438
- */
439
- relevanceId?: string;
440
- /**
441
- * Subject id
442
- */
443
- subjectid: string;
444
- /**
445
- * Topic id
446
- */
447
- topicid: string;
448
- }
449
- export interface SubjectTopicPOST {
450
- /**
451
- * Backwards compatibility: Always true, ignored on insert/update.
452
- */
453
- primary?: boolean;
454
- /**
455
- * Order in which the topic should be sorted for the topic
456
- */
457
- rank?: number;
458
- /**
459
- * Relevance id
460
- */
461
- relevanceId?: string;
462
- /**
463
- * Subject id
464
- */
465
- subjectid: string;
466
- /**
467
- * Topic id
468
- */
469
- topicid: string;
470
- }
471
- export interface SubjectTopicPUT {
472
- /**
473
- * 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.
474
- */
475
- primary?: boolean;
476
- /**
477
- * Order in which the topic should be sorted for the subject
478
- */
479
- rank?: number;
480
- /**
481
- * Relevance id
482
- */
483
- relevanceId?: string;
484
- }
485
- export interface TaxonomyContext {
486
- /**
487
- * A breadcrumb of the names of the context's parents
488
- */
489
- breadcrumbs: Record<string, string[]>;
490
- /**
491
- * The id of the parent connection object
492
- */
493
- connectionId: string;
494
- /**
495
- * Unique id of context based on root + parent connection
496
- */
497
- contextId: string;
498
- /**
499
- * Whether a 'standard'-article, 'topic-article'-article or a 'learningpath'
500
- */
501
- contextType?: string;
502
- /**
503
- * The publicId of the node connected via content-uri
504
- */
505
- id: string;
506
- /**
507
- * Whether the parent connection is marked as active
508
- */
509
- isActive: boolean;
510
- /**
511
- * Whether the parent connection is primary or not
512
- */
513
- isPrimary: boolean;
514
- /**
515
- * Whether the parent connection is visible or not
516
- */
517
- isVisible: boolean;
518
- /**
519
- * List of all parent contextIds
520
- */
521
- parentContextIds: string[];
522
- /**
523
- * List of all parent ids
524
- */
525
- parentIds: string[];
526
- /**
527
- * List of all parents to this context
528
- */
529
- parents: TaxonomyCrumb[];
530
- /**
531
- * The context path
532
- */
533
- path: string;
534
- /**
535
- * The publicId of the node connected via content-uri
536
- */
537
- publicId: string;
538
- /**
539
- * The rank of the parent connection object
540
- */
541
- rank: number;
542
- /**
543
- * Name of the relevance of the parent connection
544
- */
545
- relevance: Record<string, string>;
546
- /**
547
- * Id of the relevance of the parent connection
548
- */
549
- relevanceId: string;
550
- /**
551
- * Resource-types of the node
552
- */
553
- resourceTypes: SearchableTaxonomyResourceType[];
554
- /**
555
- * The name of the root parent of the context
556
- */
557
- root: Record<string, string>;
558
- /**
559
- * The publicId of the root parent of the context
560
- */
561
- rootId: string;
562
- /**
563
- * Pretty-url of this particular context
564
- */
565
- url: string;
566
- }
567
- export interface TaxonomyCrumb {
568
- /**
569
- * Unique id of context based on root + parent connection
570
- */
571
- contextId: string;
572
- /**
573
- * The publicId of the node
574
- */
575
- id: string;
576
- /**
577
- * The name of the node
578
- */
579
- name: Record<string, string>;
580
- /**
581
- * The context path
582
- */
583
- path: string;
584
- /**
585
- * The context url
586
- */
587
- url: string;
588
- }
589
- export interface TopicPostPut {
590
- /**
591
- * ID of article introducing this topic. Must be a valid URI, but preferably not a URL.
592
- */
593
- contentUri: string;
594
- /**
595
- * If specified, set the id to this value. Must start with urn:topic: and be a valid URI. If omitted, an id will be assigned automatically.
596
- */
597
- id?: string;
598
- /**
599
- * The name of the topic
600
- */
601
- name: string;
602
- }
603
- export interface TopicResource {
604
- /**
605
- * Topic resource connection id
606
- */
607
- id: string;
608
- /**
609
- * Primary connection
610
- */
611
- primary: boolean;
612
- /**
613
- * Order in which the resource is sorted for the topic
614
- */
615
- rank: number;
616
- /**
617
- * Relevance id
618
- */
619
- relevanceId?: string;
620
- /**
621
- * Resource id
622
- */
623
- resourceId: string;
624
- /**
625
- * Topic id
626
- */
627
- topicid: string;
628
- }
629
- export interface TopicResourcePOST {
630
- /**
631
- * Primary connection
632
- */
633
- primary?: boolean;
634
- /**
635
- * Order in which resource is sorted for the topic
636
- */
637
- rank?: number;
638
- /**
639
- * Relevance id
640
- */
641
- relevanceId?: string;
642
- /**
643
- * Resource id
644
- */
645
- resourceId: string;
646
- /**
647
- * Topic id
648
- */
649
- topicid: string;
650
- }
651
- export interface TopicResourcePUT {
652
- /**
653
- * Primary connection
654
- */
655
- primary?: boolean;
656
- /**
657
- * Order in which the resource will be sorted for this topic.
658
- */
659
- rank?: number;
660
- /**
661
- * Relevance id
662
- */
663
- relevanceId?: string;
664
- }
665
- export interface TopicSubtopic {
666
- /**
667
- * Connection id
668
- */
669
- id: string;
670
- /**
671
- * Backwards compatibility: Always true. Ignored on insert/update
672
- */
673
- primary: boolean;
674
- /**
675
- * Order in which subtopic is sorted for the topic
676
- */
677
- rank: number;
678
- /**
679
- * Relevance id
680
- */
681
- relevanceId?: string;
682
- /**
683
- * Subtopic id
684
- */
685
- subtopicid: string;
686
- /**
687
- * Topic id
688
- */
689
- topicid: string;
690
- }
691
- export interface TopicSubtopicPOST {
692
- /**
693
- * Is this connection primary
694
- */
695
- primary?: boolean;
696
- /**
697
- * Order in which to sort the subtopic for the topic
698
- */
699
- rank?: number;
700
- /**
701
- * Relevance id
702
- */
703
- relevanceId?: string;
704
- /**
705
- * Subtopic id
706
- */
707
- subtopicid: string;
708
- /**
709
- * Topic id
710
- */
711
- topicid: string;
712
- }
713
- export interface TopicSubtopicPUT {
714
- /**
715
- * Is this connection primary
716
- */
717
- primary?: boolean;
718
- /**
719
- * Order in which subtopic is sorted for the topic
720
- */
721
- rank?: number;
722
- /**
723
- * Relevance id
724
- */
725
- relevanceId?: string;
726
- }
727
- export interface Translation {
728
- /**
729
- * ISO 639-1 language code
730
- */
731
- language: string;
732
- /**
733
- * The translated name of the node
734
- */
735
- name: string;
736
- }
737
- export interface TranslationPUT {
738
- /**
739
- * The translated name of the element. Used wherever translated texts are used.
740
- */
741
- name: string;
742
- }
743
- export interface UrlMapping {
744
- /**
745
- * Node URN for resource in new system
746
- */
747
- nodeId: string;
748
- /**
749
- * Subject URN for resource in new system (optional)
750
- */
751
- subjectId: string;
752
- /**
753
- * URL for resource in old system
754
- */
755
- url: string;
756
- }
757
- export interface Version {
758
- archived?: DateAsString;
759
- created: DateAsString;
760
- hash: string;
761
- id: string;
762
- /**
763
- * Is the version locked
764
- */
765
- locked: boolean;
766
- name: string;
767
- published?: DateAsString;
768
- versionType: VersionType;
769
- }
770
- export interface VersionPostPut {
771
- /**
772
- * If specified, set the id to this value. Must start with urn:subject: and be a valid URI. If omitted, an id will be assigned automatically.
773
- */
774
- id?: string;
775
- /**
776
- * If specified, set the locked property to this value.
777
- */
778
- locked?: boolean;
779
- /**
780
- * If specified, set the name to this value.
781
- */
782
- name: string;
783
- }
784
- export type DateAsString = string;
785
- export type Grade = 1 | 2 | 3 | 4 | 5;
786
- export type NodeType = "NODE" | "SUBJECT" | "TOPIC" | "RESOURCE" | "PROGRAMME";
787
- export type VersionType = "BETA" | "PUBLISHED" | "ARCHIVED";
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=taxonomy-api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"taxonomy-api.js","sourceRoot":"","sources":["../taxonomy-api.ts"],"names":[],"mappings":""}