@ndla/types-taxonomy 1.0.35 → 1.0.36

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