@pie-qti/ims-cp-core 1.0.0-beta.0 → 1.0.0-beta.2
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/dist/index.d.ts +14 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/localized-resources.d.ts +308 -0
- package/dist/localized-resources.js +410 -0
- package/dist/localized-resources.js.map +1 -0
- package/dist/manifest-parser.d.ts +82 -0
- package/dist/manifest-parser.js +213 -0
- package/dist/manifest-parser.js.map +1 -0
- package/dist/package-file-resolver.d.ts +48 -0
- package/dist/package-file-resolver.js +312 -0
- package/dist/package-file-resolver.js.map +1 -0
- package/dist/package-graph.d.ts +134 -0
- package/dist/package-graph.js +791 -0
- package/dist/package-graph.js.map +1 -0
- package/dist/package-path.d.ts +13 -0
- package/dist/package-path.js +90 -0
- package/dist/package-path.js.map +1 -0
- package/dist/passage-reusability.d.ts +99 -0
- package/dist/passage-reusability.js +170 -0
- package/dist/passage-reusability.js.map +1 -0
- package/dist/qti-heuristics.d.ts +119 -0
- package/dist/qti-heuristics.js +150 -0
- package/dist/qti-heuristics.js.map +1 -0
- package/dist/qti3-shared-content.d.ts +114 -0
- package/dist/qti3-shared-content.js +422 -0
- package/dist/qti3-shared-content.js.map +1 -0
- package/dist/security-parsing.d.ts +9 -0
- package/dist/security-parsing.js +74 -0
- package/dist/security-parsing.js.map +1 -0
- package/dist/utils/hash.d.ts +20 -0
- package/dist/utils/hash.js +33 -0
- package/dist/utils/hash.js.map +1 -0
- package/dist/utils/qti-xml.d.ts +103 -0
- package/dist/utils/qti-xml.js +214 -0
- package/dist/utils/qti-xml.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { type ManifestResource, type ParsedManifest } from './manifest-parser.js';
|
|
2
|
+
import { type PackageReferenceResolutionStrategy } from './package-file-resolver.js';
|
|
3
|
+
import type { QtiHeuristicsConfig } from './qti-heuristics.js';
|
|
4
|
+
export type PackageDiagnosticSeverity = 'info' | 'warning' | 'error';
|
|
5
|
+
export interface PackageDiagnostic {
|
|
6
|
+
severity: PackageDiagnosticSeverity;
|
|
7
|
+
code: string;
|
|
8
|
+
message: string;
|
|
9
|
+
resourceId?: string;
|
|
10
|
+
sourcePath?: string;
|
|
11
|
+
reference?: string;
|
|
12
|
+
}
|
|
13
|
+
export type QtiPackageVersion = '2.1' | '2.2' | '3.0' | 'unknown' | 'conflicting';
|
|
14
|
+
export type QtiVersionConfidence = 'high' | 'medium' | 'low' | 'none' | 'conflicting';
|
|
15
|
+
export interface QtiVersionSignal {
|
|
16
|
+
source: 'manifest' | 'qti_xml' | 'schema_location' | 'package_metadata';
|
|
17
|
+
version: Exclude<QtiPackageVersion, 'unknown' | 'conflicting'>;
|
|
18
|
+
confidence: Exclude<QtiVersionConfidence, 'none' | 'conflicting'>;
|
|
19
|
+
evidence: string;
|
|
20
|
+
resourceId?: string;
|
|
21
|
+
sourcePath?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface QtiPackageVersionDiagnostic {
|
|
24
|
+
version: QtiPackageVersion;
|
|
25
|
+
confidence: QtiVersionConfidence;
|
|
26
|
+
signals: QtiVersionSignal[];
|
|
27
|
+
diagnostics: PackageDiagnostic[];
|
|
28
|
+
}
|
|
29
|
+
export interface PackageFileAccess {
|
|
30
|
+
readText(path: string): Promise<string | null | undefined> | string | null | undefined;
|
|
31
|
+
readBuffer?(path: string): Promise<Uint8Array | null | undefined> | Uint8Array | null | undefined;
|
|
32
|
+
exists?(path: string): Promise<boolean> | boolean;
|
|
33
|
+
listFiles?(): Promise<string[]> | string[];
|
|
34
|
+
resolvePreviewUrl?(path: string): Promise<string | null | undefined> | string | null | undefined;
|
|
35
|
+
}
|
|
36
|
+
export type PackageResourceKind = 'item' | 'test' | 'passage' | 'asset' | 'webcontent' | 'other';
|
|
37
|
+
export interface PackageResourceNode {
|
|
38
|
+
identifier: string;
|
|
39
|
+
type: string;
|
|
40
|
+
kind: PackageResourceKind;
|
|
41
|
+
href?: string;
|
|
42
|
+
resolvedHref?: string;
|
|
43
|
+
xmlBase?: string;
|
|
44
|
+
files: string[];
|
|
45
|
+
resolvedFiles: string[];
|
|
46
|
+
dependencies: string[];
|
|
47
|
+
metadata?: ManifestResource['metadata'];
|
|
48
|
+
}
|
|
49
|
+
export interface PackageReference {
|
|
50
|
+
kind: 'manifest-dependency' | 'assessment-item-ref' | 'asset' | 'stylesheet' | 'object' | 'catalog' | 'stimulus';
|
|
51
|
+
rawHref: string;
|
|
52
|
+
resolvedPath?: string;
|
|
53
|
+
sourcePath?: string;
|
|
54
|
+
sourceElement?: string;
|
|
55
|
+
sourceAttribute?: string;
|
|
56
|
+
targetResourceId?: string;
|
|
57
|
+
resolutionStrategy?: PackageReferenceResolutionStrategy;
|
|
58
|
+
heuristic?: boolean;
|
|
59
|
+
renderHref?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface PackageAssetRef {
|
|
62
|
+
rawHref: string;
|
|
63
|
+
resolvedPath: string;
|
|
64
|
+
usage: 'image' | 'stylesheet' | 'audio' | 'video' | 'html' | 'catalog' | 'source-qti' | 'other';
|
|
65
|
+
ownerResourceId?: string;
|
|
66
|
+
ownerResourceIds?: string[];
|
|
67
|
+
sourcePath?: string;
|
|
68
|
+
sourcePaths?: string[];
|
|
69
|
+
sourceElement?: string;
|
|
70
|
+
sourceAttribute?: string;
|
|
71
|
+
resolutionStrategy?: PackageReferenceResolutionStrategy;
|
|
72
|
+
heuristic?: boolean;
|
|
73
|
+
renderHref?: string;
|
|
74
|
+
}
|
|
75
|
+
export interface PackageResourceClosure {
|
|
76
|
+
resourceId: string;
|
|
77
|
+
resourceIds: string[];
|
|
78
|
+
filePaths: string[];
|
|
79
|
+
assetPaths: string[];
|
|
80
|
+
diagnostics: PackageDiagnostic[];
|
|
81
|
+
}
|
|
82
|
+
export interface PackageEntrypoint {
|
|
83
|
+
resourceId: string;
|
|
84
|
+
kind: 'item' | 'test' | 'passage';
|
|
85
|
+
href?: string;
|
|
86
|
+
}
|
|
87
|
+
export type PackageRelationshipKind = 'manifest-dependency' | 'assessment-item-ref' | 'assessment-stimulus-ref' | 'shared-asset';
|
|
88
|
+
export interface PackageRelationshipHint {
|
|
89
|
+
kind: PackageRelationshipKind;
|
|
90
|
+
sourceResourceId?: string;
|
|
91
|
+
sourceResourceIds?: string[];
|
|
92
|
+
targetResourceId?: string;
|
|
93
|
+
targetPath?: string;
|
|
94
|
+
rawHref?: string;
|
|
95
|
+
sourcePath?: string;
|
|
96
|
+
sourceElement?: string;
|
|
97
|
+
sourceAttribute?: string;
|
|
98
|
+
}
|
|
99
|
+
export interface AnalyzedContentPackage {
|
|
100
|
+
packageId: string;
|
|
101
|
+
manifest: ParsedManifest;
|
|
102
|
+
resources: Map<string, PackageResourceNode>;
|
|
103
|
+
entrypoints: PackageEntrypoint[];
|
|
104
|
+
references: Map<string, PackageReference[]>;
|
|
105
|
+
closures: Map<string, PackageResourceClosure>;
|
|
106
|
+
assets: Map<string, PackageAssetRef>;
|
|
107
|
+
qtiVersion: QtiPackageVersionDiagnostic;
|
|
108
|
+
diagnostics: PackageDiagnostic[];
|
|
109
|
+
files: string[];
|
|
110
|
+
}
|
|
111
|
+
export interface SerializedContentPackageEvidence {
|
|
112
|
+
packageId: string;
|
|
113
|
+
manifestIdentifier?: string;
|
|
114
|
+
entrypoints: PackageEntrypoint[];
|
|
115
|
+
resources: PackageResourceNode[];
|
|
116
|
+
references: Array<PackageReference & {
|
|
117
|
+
resourceId: string;
|
|
118
|
+
}>;
|
|
119
|
+
closures: PackageResourceClosure[];
|
|
120
|
+
assets: PackageAssetRef[];
|
|
121
|
+
relationshipHints: PackageRelationshipHint[];
|
|
122
|
+
qtiVersion: QtiPackageVersionDiagnostic;
|
|
123
|
+
diagnostics: PackageDiagnostic[];
|
|
124
|
+
files: string[];
|
|
125
|
+
}
|
|
126
|
+
export interface AnalyzeContentPackageInput {
|
|
127
|
+
packageId?: string;
|
|
128
|
+
manifestXml: string;
|
|
129
|
+
basePath?: string;
|
|
130
|
+
fileAccess?: PackageFileAccess;
|
|
131
|
+
heuristicsConfig?: QtiHeuristicsConfig;
|
|
132
|
+
}
|
|
133
|
+
export declare function analyzeContentPackage({ packageId, manifestXml, basePath, fileAccess, heuristicsConfig, }: AnalyzeContentPackageInput): Promise<AnalyzedContentPackage>;
|
|
134
|
+
export declare function serializeContentPackageEvidence(packageGraph: AnalyzedContentPackage): SerializedContentPackageEvidence;
|