@ndla/types-taxonomy 1.0.1 → 1.0.3
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/build/taxonomy-api.d.ts +76 -5
- package/package.json +1 -1
- package/taxonomy-api.ts +81 -5
package/build/taxonomy-api.d.ts
CHANGED
|
@@ -1,3 +1,78 @@
|
|
|
1
|
+
export interface NodeCommand {
|
|
2
|
+
nodeId?: string;
|
|
3
|
+
/**
|
|
4
|
+
* Type of node. Values are subject, topic. Required on create.
|
|
5
|
+
*/
|
|
6
|
+
nodeType: NodeType;
|
|
7
|
+
/**
|
|
8
|
+
* ID of content introducing this node. Must be a valid URI, but preferably not a URL.
|
|
9
|
+
*/
|
|
10
|
+
contentUri: string;
|
|
11
|
+
/**
|
|
12
|
+
* The name of the node. Required on create.
|
|
13
|
+
*/
|
|
14
|
+
name: string;
|
|
15
|
+
/**
|
|
16
|
+
* The node is a root node. Default is false. Only used if present.
|
|
17
|
+
*/
|
|
18
|
+
root: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface ResourceCommand {
|
|
21
|
+
/**
|
|
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
|
+
*/
|
|
24
|
+
id: string;
|
|
25
|
+
/**
|
|
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
|
+
*/
|
|
28
|
+
contentUri: string;
|
|
29
|
+
/**
|
|
30
|
+
* The name of the resource
|
|
31
|
+
*/
|
|
32
|
+
name: string;
|
|
33
|
+
}
|
|
34
|
+
export interface SubjectCommand {
|
|
35
|
+
/**
|
|
36
|
+
* If specified, set the id to this value. Must start with urn:subject: and be a valid URI. If ommitted, an id will be assigned automatically.
|
|
37
|
+
*/
|
|
38
|
+
id: string;
|
|
39
|
+
/**
|
|
40
|
+
* ID of article introducing this subject. Must be a valid URI, but preferably not a URL.
|
|
41
|
+
*/
|
|
42
|
+
contentUri: string;
|
|
43
|
+
/**
|
|
44
|
+
* The name of the subject
|
|
45
|
+
*/
|
|
46
|
+
name: string;
|
|
47
|
+
}
|
|
48
|
+
export interface TopicCommand {
|
|
49
|
+
/**
|
|
50
|
+
* 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.
|
|
51
|
+
*/
|
|
52
|
+
id: string;
|
|
53
|
+
/**
|
|
54
|
+
* ID of article introducing this topic. Must be a valid URI, but preferably not a URL.
|
|
55
|
+
*/
|
|
56
|
+
contentUri: string;
|
|
57
|
+
/**
|
|
58
|
+
* The name of the topic
|
|
59
|
+
*/
|
|
60
|
+
name: string;
|
|
61
|
+
}
|
|
62
|
+
export interface VersionCommand {
|
|
63
|
+
/**
|
|
64
|
+
* If specified, set the id to this value. Must start with urn:subject: and be a valid URI. If ommitted, an id will be assigned automatically.
|
|
65
|
+
*/
|
|
66
|
+
id: string;
|
|
67
|
+
/**
|
|
68
|
+
* If specified, set the name to this value.
|
|
69
|
+
*/
|
|
70
|
+
name: string;
|
|
71
|
+
/**
|
|
72
|
+
* If specified, set the locked property to this value.
|
|
73
|
+
*/
|
|
74
|
+
locked: boolean;
|
|
75
|
+
}
|
|
1
76
|
export interface Context {
|
|
2
77
|
id: string;
|
|
3
78
|
path: string;
|
|
@@ -520,11 +595,7 @@ export interface Connection {
|
|
|
520
595
|
targetId: string;
|
|
521
596
|
paths: string[];
|
|
522
597
|
type: string;
|
|
523
|
-
/**
|
|
524
|
-
* True if owned by this topic, false if it has its primary connection elsewhere
|
|
525
|
-
*/
|
|
526
598
|
isPrimary: boolean;
|
|
527
|
-
primary: boolean;
|
|
528
599
|
}
|
|
529
600
|
export interface Metadata {
|
|
530
601
|
grepCodes: string[];
|
|
@@ -536,7 +607,7 @@ export interface NodeChild extends Node {
|
|
|
536
607
|
connectionId: string;
|
|
537
608
|
rank: number;
|
|
538
609
|
parent: string;
|
|
539
|
-
|
|
610
|
+
isPrimary: boolean;
|
|
540
611
|
}
|
|
541
612
|
export interface Node {
|
|
542
613
|
id: string;
|
package/package.json
CHANGED
package/taxonomy-api.ts
CHANGED
|
@@ -1,4 +1,84 @@
|
|
|
1
1
|
|
|
2
|
+
export interface NodeCommand {
|
|
3
|
+
nodeId?: string;
|
|
4
|
+
/**
|
|
5
|
+
* Type of node. Values are subject, topic. Required on create.
|
|
6
|
+
*/
|
|
7
|
+
nodeType: NodeType;
|
|
8
|
+
/**
|
|
9
|
+
* ID of content introducing this node. Must be a valid URI, but preferably not a URL.
|
|
10
|
+
*/
|
|
11
|
+
contentUri: string;
|
|
12
|
+
/**
|
|
13
|
+
* The name of the node. Required on create.
|
|
14
|
+
*/
|
|
15
|
+
name: string;
|
|
16
|
+
/**
|
|
17
|
+
* The node is a root node. Default is false. Only used if present.
|
|
18
|
+
*/
|
|
19
|
+
root: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface ResourceCommand {
|
|
23
|
+
/**
|
|
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
|
+
*/
|
|
26
|
+
id: string;
|
|
27
|
+
/**
|
|
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
|
+
*/
|
|
30
|
+
contentUri: string;
|
|
31
|
+
/**
|
|
32
|
+
* The name of the resource
|
|
33
|
+
*/
|
|
34
|
+
name: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface SubjectCommand {
|
|
38
|
+
/**
|
|
39
|
+
* If specified, set the id to this value. Must start with urn:subject: and be a valid URI. If ommitted, an id will be assigned automatically.
|
|
40
|
+
*/
|
|
41
|
+
id: string;
|
|
42
|
+
/**
|
|
43
|
+
* ID of article introducing this subject. Must be a valid URI, but preferably not a URL.
|
|
44
|
+
*/
|
|
45
|
+
contentUri: string;
|
|
46
|
+
/**
|
|
47
|
+
* The name of the subject
|
|
48
|
+
*/
|
|
49
|
+
name: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface TopicCommand {
|
|
53
|
+
/**
|
|
54
|
+
* 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.
|
|
55
|
+
*/
|
|
56
|
+
id: string;
|
|
57
|
+
/**
|
|
58
|
+
* ID of article introducing this topic. Must be a valid URI, but preferably not a URL.
|
|
59
|
+
*/
|
|
60
|
+
contentUri: string;
|
|
61
|
+
/**
|
|
62
|
+
* The name of the topic
|
|
63
|
+
*/
|
|
64
|
+
name: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface VersionCommand {
|
|
68
|
+
/**
|
|
69
|
+
* If specified, set the id to this value. Must start with urn:subject: and be a valid URI. If ommitted, an id will be assigned automatically.
|
|
70
|
+
*/
|
|
71
|
+
id: string;
|
|
72
|
+
/**
|
|
73
|
+
* If specified, set the name to this value.
|
|
74
|
+
*/
|
|
75
|
+
name: string;
|
|
76
|
+
/**
|
|
77
|
+
* If specified, set the locked property to this value.
|
|
78
|
+
*/
|
|
79
|
+
locked: boolean;
|
|
80
|
+
}
|
|
81
|
+
|
|
2
82
|
export interface Context {
|
|
3
83
|
id: string;
|
|
4
84
|
path: string;
|
|
@@ -549,11 +629,7 @@ export interface Connection {
|
|
|
549
629
|
targetId: string;
|
|
550
630
|
paths: string[];
|
|
551
631
|
type: string;
|
|
552
|
-
/**
|
|
553
|
-
* True if owned by this topic, false if it has its primary connection elsewhere
|
|
554
|
-
*/
|
|
555
632
|
isPrimary: boolean;
|
|
556
|
-
primary: boolean;
|
|
557
633
|
}
|
|
558
634
|
|
|
559
635
|
export interface Metadata {
|
|
@@ -567,7 +643,7 @@ export interface NodeChild extends Node {
|
|
|
567
643
|
connectionId: string;
|
|
568
644
|
rank: number;
|
|
569
645
|
parent: string;
|
|
570
|
-
|
|
646
|
+
isPrimary: boolean;
|
|
571
647
|
}
|
|
572
648
|
|
|
573
649
|
export interface Node {
|