-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCasePackageSnapshot.ts
More file actions
144 lines (139 loc) · 4.68 KB
/
Copy pathCasePackageSnapshot.ts
File metadata and controls
144 lines (139 loc) · 4.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
export type CaseVersion = '1.0' | '1.1' | 'unknown'
/**
* Version-agnostic snapshot of a CASE CFDocument.
*
* Combines fields from both v1p0 and v1p1 specifications.
*/
export type CaseDocumentSnapshot = {
identifier: string
uri?: string
title?: string
creator?: string
description?: string
/** Entity that publishes / distributes the framework */
publisher?: string
/** v1p1: Framework type classification */
frameworkType?: string
/** Status in adoption lifecycle */
adoptionStatus?: string
/** Explicit CASE version (v1p1 field) */
caseVersion?: string
/** Document language (e.g., "en") */
language?: string
/** Document version string */
version?: string
/** Free-text notes about the framework */
notes?: string
/** URL to the official source document */
officialSourceURL?: string
/** Document-level subject */
subject?: string[]
subjectURI?: Array<{ title?: string; identifier?: string; uri: string }>
/** Lifecycle dates */
statusStartDate?: string
statusEndDate?: string
lastChangeDateTime?: string
/** Link to the CFLicense governing this framework */
licenseURI?: { title?: string; identifier?: string; uri: string }
/** Namespaced extension data (e.g. ext:opencase — CTID, import provenance, layout) */
extensions?: Record<string, unknown>
}
/**
* Version-agnostic snapshot of a CASE CFItem.
*
* Combines fields from both v1p0 and v1p1 specifications.
*/
export type CaseItemSnapshot = {
identifier: string
uri?: string
fullStatement: string
abbreviatedStatement?: string
alternativeLabel?: string
humanCodingScheme?: string
/** Item type (derived from CFItemType string or CFItemTypeURI) */
CFItemType?: string
/**
* v1p0: List enumeration for ordering.
* Used when items need to maintain a specific sequence.
*/
listEnumeration?: string
subject?: string[]
/** Subject URI references linking to CFSubject definitions */
subjectURI?: Array<{ title?: string; identifier: string; uri: string }>
/** CFItemTypeURI reference linking to a CFItemType definition */
CFItemTypeURI?: { title?: string; identifier: string; uri: string }
educationLevel?: string[]
conceptKeywords?: string[]
/** conceptKeywordsURI reference linking to a CFConcept definition */
conceptKeywordsURI?: { title?: string; identifier: string; uri: string }
notes?: string
/** Item language (e.g., "en") */
language?: string
/** Link to the CFLicense governing this item */
licenseURI?: { title?: string; identifier: string; uri: string }
/** Item-level lifecycle dates */
statusStartDate?: string
statusEndDate?: string
lastChangeDateTime?: string
extensions?: Record<string, unknown>
}
/**
* Version-agnostic snapshot of a CASE CFAssociation.
*
* Combines fields from both v1p0 and v1p1 specifications.
*/
export type CaseAssociationSnapshot = {
identifier: string
/** The association's own URI */
uri?: string
associationType?: string
originIdentifier?: string
destinationIdentifier?: string
originUri?: string
destinationUri?: string
/**
* v1p1: Sequence number for ordering associations.
* Lower numbers appear first in ordered contexts.
*/
sequenceNumber?: number
/** Identifier of the CFAssociationGrouping this association belongs to */
CFAssociationGroupingIdentifier?: string
/** Title of the CFAssociationGrouping (for display) */
CFAssociationGroupingTitle?: string
/** v1p1: Notes about this association */
notes?: string
lastChangeDateTime?: string
extensions?: Record<string, unknown>
}
/**
* Version-agnostic snapshot of a CASE CFPackage "graph".
*
* This is intentionally minimal: just enough data to hydrate editor graphs and/or
* map into the domain `Framework` without tying UI code to CASE v1p0/v1p1 nuances.
*
* The normalization process handles:
* - Different identifier fields (sourcedId vs identifier)
* - Different link formats (plain URI vs LinkGenURI object)
* - Different array wrappers (CFItemSet vs CFItems)
* - Different type specifications (CFItemTypeURI vs CFItemType)
*/
/** Snapshot of a CFAssociationGrouping definition */
export type CaseAssociationGroupingSnapshot = {
identifier: string
uri: string
title?: string
description?: string
lastChangeDateTime?: string
}
export type CasePackageSnapshot = {
/** Detected or explicit CASE version */
version: CaseVersion
/** The framework document metadata */
document: CaseDocumentSnapshot
/** All items (competencies, standards, etc.) in the package */
items: CaseItemSnapshot[]
/** All associations (relationships) between items */
associations: CaseAssociationSnapshot[]
/** CFAssociationGrouping definitions from CFDefinitions */
associationGroupings?: CaseAssociationGroupingSnapshot[]
}