@pie-qti/transform-core 0.1.1
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/.turbo/turbo-build.log +1 -0
- package/CHANGELOG.md +10 -0
- package/VALIDATION.md +217 -0
- package/dist/engine/index.d.ts +2 -0
- package/dist/engine/index.d.ts.map +1 -0
- package/dist/engine/index.js +2 -0
- package/dist/engine/index.js.map +1 -0
- package/dist/engine/transform-engine.d.ts +58 -0
- package/dist/engine/transform-engine.d.ts.map +1 -0
- package/dist/engine/transform-engine.js +173 -0
- package/dist/engine/transform-engine.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/registry/index.d.ts +2 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +2 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry/plugin-registry.d.ts +54 -0
- package/dist/registry/plugin-registry.d.ts.map +1 -0
- package/dist/registry/plugin-registry.js +86 -0
- package/dist/registry/plugin-registry.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +40 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +61 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/validator.d.ts +60 -0
- package/dist/utils/validator.d.ts.map +1 -0
- package/dist/utils/validator.js +161 -0
- package/dist/utils/validator.js.map +1 -0
- package/package.json +38 -0
- package/src/engine/index.ts +1 -0
- package/src/engine/transform-engine.ts +257 -0
- package/src/index.ts +18 -0
- package/src/registry/index.ts +1 -0
- package/src/registry/plugin-registry.ts +116 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/logger.ts +79 -0
- package/src/utils/validator.ts +193 -0
- package/tests/plugin-registry.test.ts +154 -0
- package/tests/transform-engine.test.ts +168 -0
- package/tests/validator.test.ts +234 -0
- package/tsconfig.json +13 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Registry
|
|
3
|
+
*
|
|
4
|
+
* Central registry for managing transformation plugins
|
|
5
|
+
*/
|
|
6
|
+
export class PluginRegistry {
|
|
7
|
+
plugins = new Map();
|
|
8
|
+
/**
|
|
9
|
+
* Register a plugin
|
|
10
|
+
*/
|
|
11
|
+
register(plugin) {
|
|
12
|
+
if (this.plugins.has(plugin.id)) {
|
|
13
|
+
throw new Error(`Plugin with id '${plugin.id}' is already registered`);
|
|
14
|
+
}
|
|
15
|
+
this.plugins.set(plugin.id, plugin);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Unregister a plugin
|
|
19
|
+
*/
|
|
20
|
+
unregister(pluginId) {
|
|
21
|
+
return this.plugins.delete(pluginId);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get a plugin by ID
|
|
25
|
+
*/
|
|
26
|
+
get(pluginId) {
|
|
27
|
+
return this.plugins.get(pluginId);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Check if a plugin is registered
|
|
31
|
+
*/
|
|
32
|
+
has(pluginId) {
|
|
33
|
+
return this.plugins.has(pluginId);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Get all registered plugins
|
|
37
|
+
*/
|
|
38
|
+
getAll() {
|
|
39
|
+
return Array.from(this.plugins.values());
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Find plugin that can handle transformation from source to target format
|
|
43
|
+
*/
|
|
44
|
+
findPlugin(sourceFormat, targetFormat) {
|
|
45
|
+
return Array.from(this.plugins.values()).find((plugin) => plugin.sourceFormat === sourceFormat &&
|
|
46
|
+
plugin.targetFormat === targetFormat);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Find plugins that can handle the given input
|
|
50
|
+
*/
|
|
51
|
+
async findCompatiblePlugins(input) {
|
|
52
|
+
const compatible = [];
|
|
53
|
+
for (const plugin of this.plugins.values()) {
|
|
54
|
+
const canHandle = await plugin.canHandle(input);
|
|
55
|
+
if (canHandle) {
|
|
56
|
+
compatible.push(plugin);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return compatible;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Get plugins by source format
|
|
63
|
+
*/
|
|
64
|
+
getBySourceFormat(format) {
|
|
65
|
+
return Array.from(this.plugins.values()).filter((plugin) => plugin.sourceFormat === format);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Get plugins by target format
|
|
69
|
+
*/
|
|
70
|
+
getByTargetFormat(format) {
|
|
71
|
+
return Array.from(this.plugins.values()).filter((plugin) => plugin.targetFormat === format);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Clear all registered plugins
|
|
75
|
+
*/
|
|
76
|
+
clear() {
|
|
77
|
+
this.plugins.clear();
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Get count of registered plugins
|
|
81
|
+
*/
|
|
82
|
+
get size() {
|
|
83
|
+
return this.plugins.size;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=plugin-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-registry.js","sourceRoot":"","sources":["../../src/registry/plugin-registry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,MAAM,OAAO,cAAc;IACjB,OAAO,GAAG,IAAI,GAAG,EAA2B,CAAC;IAErD;;OAEG;IACH,QAAQ,CAAC,MAAuB;QAC9B,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,mBAAmB,MAAM,CAAC,EAAE,yBAAyB,CAAC,CAAC;QACzE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iBAAiB,CAAC,MAAuB;QACvC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAC7C,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,KAAK,MAAM,CAC3C,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,iBAAiB,CAAC,MAAuB;QACvC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAC7C,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,KAAK,MAAM,CAC3C,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logger Utilities
|
|
3
|
+
*/
|
|
4
|
+
import type { TransformLogger } from '@pie-qti/transform-types';
|
|
5
|
+
/**
|
|
6
|
+
* Simple console logger
|
|
7
|
+
*/
|
|
8
|
+
export declare class ConsoleLogger implements TransformLogger {
|
|
9
|
+
debug(message: string, itemId?: string): void;
|
|
10
|
+
info(message: string, itemId?: string): void;
|
|
11
|
+
warn(message: string, itemId?: string): void;
|
|
12
|
+
error(message: string, itemId?: string): void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Silent logger (no output)
|
|
16
|
+
*/
|
|
17
|
+
export declare class SilentLogger implements TransformLogger {
|
|
18
|
+
debug(): void;
|
|
19
|
+
info(): void;
|
|
20
|
+
warn(): void;
|
|
21
|
+
error(): void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Memory logger (stores messages in memory)
|
|
25
|
+
*/
|
|
26
|
+
export declare class MemoryLogger implements TransformLogger {
|
|
27
|
+
messages: Array<{
|
|
28
|
+
level: 'debug' | 'info' | 'warn' | 'error';
|
|
29
|
+
message: string;
|
|
30
|
+
itemId?: string;
|
|
31
|
+
timestamp: Date;
|
|
32
|
+
}>;
|
|
33
|
+
debug(message: string, itemId?: string): void;
|
|
34
|
+
info(message: string, itemId?: string): void;
|
|
35
|
+
warn(message: string, itemId?: string): void;
|
|
36
|
+
error(message: string, itemId?: string): void;
|
|
37
|
+
clear(): void;
|
|
38
|
+
getMessages(level?: 'debug' | 'info' | 'warn' | 'error'): typeof this.messages;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE;;GAEG;AACH,qBAAa,aAAc,YAAW,eAAe;IACnD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAK7C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAK5C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAK5C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;CAI9C;AAED;;GAEG;AACH,qBAAa,YAAa,YAAW,eAAe;IAClD,KAAK,IAAI,IAAI;IACb,IAAI,IAAI,IAAI;IACZ,IAAI,IAAI,IAAI;IACZ,KAAK,IAAI,IAAI;CACd;AAED;;GAEG;AACH,qBAAa,YAAa,YAAW,eAAe;IAC3C,QAAQ,EAAE,KAAK,CAAC;QACrB,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;QAC3C,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,IAAI,CAAC;KACjB,CAAC,CAAM;IAER,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAI7C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAI5C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAI5C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAI7C,KAAK,IAAI,IAAI;IAIb,WAAW,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,IAAI,CAAC,QAAQ;CAM/E"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logger Utilities
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Simple console logger
|
|
6
|
+
*/
|
|
7
|
+
export class ConsoleLogger {
|
|
8
|
+
debug(message, itemId) {
|
|
9
|
+
const prefix = itemId ? `[${itemId}]` : '';
|
|
10
|
+
console.debug(`[DEBUG] ${prefix} ${message}`);
|
|
11
|
+
}
|
|
12
|
+
info(message, itemId) {
|
|
13
|
+
const prefix = itemId ? `[${itemId}]` : '';
|
|
14
|
+
console.info(`[INFO] ${prefix} ${message}`);
|
|
15
|
+
}
|
|
16
|
+
warn(message, itemId) {
|
|
17
|
+
const prefix = itemId ? `[${itemId}]` : '';
|
|
18
|
+
console.warn(`[WARN] ${prefix} ${message}`);
|
|
19
|
+
}
|
|
20
|
+
error(message, itemId) {
|
|
21
|
+
const prefix = itemId ? `[${itemId}]` : '';
|
|
22
|
+
console.error(`[ERROR] ${prefix} ${message}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Silent logger (no output)
|
|
27
|
+
*/
|
|
28
|
+
export class SilentLogger {
|
|
29
|
+
debug() { }
|
|
30
|
+
info() { }
|
|
31
|
+
warn() { }
|
|
32
|
+
error() { }
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Memory logger (stores messages in memory)
|
|
36
|
+
*/
|
|
37
|
+
export class MemoryLogger {
|
|
38
|
+
messages = [];
|
|
39
|
+
debug(message, itemId) {
|
|
40
|
+
this.messages.push({ level: 'debug', message, itemId, timestamp: new Date() });
|
|
41
|
+
}
|
|
42
|
+
info(message, itemId) {
|
|
43
|
+
this.messages.push({ level: 'info', message, itemId, timestamp: new Date() });
|
|
44
|
+
}
|
|
45
|
+
warn(message, itemId) {
|
|
46
|
+
this.messages.push({ level: 'warn', message, itemId, timestamp: new Date() });
|
|
47
|
+
}
|
|
48
|
+
error(message, itemId) {
|
|
49
|
+
this.messages.push({ level: 'error', message, itemId, timestamp: new Date() });
|
|
50
|
+
}
|
|
51
|
+
clear() {
|
|
52
|
+
this.messages = [];
|
|
53
|
+
}
|
|
54
|
+
getMessages(level) {
|
|
55
|
+
if (level) {
|
|
56
|
+
return this.messages.filter((msg) => msg.level === level);
|
|
57
|
+
}
|
|
58
|
+
return this.messages;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;GAEG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,MAAM,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC;IACjF,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,MAAe;QACnC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC;IAChF,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,MAAe;QACnC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC;IAChF,CAAC;IAED,KAAK,CAAC,OAAe,EAAE,MAAe;QACpC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC;IACjF,CAAC;IAED,KAAK;QACH,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;IACrB,CAAC;IAED,WAAW,CAAC,KAA2C;QACrD,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;QAC5D,CAAC;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation utilities for PIE items and QTI content
|
|
3
|
+
*/
|
|
4
|
+
import type { ValidationResult as BaseValidationResult, PieItem } from '@pie-qti/transform-types';
|
|
5
|
+
/**
|
|
6
|
+
* Detailed validation error with path information
|
|
7
|
+
*/
|
|
8
|
+
export interface ValidationError {
|
|
9
|
+
path: string;
|
|
10
|
+
message: string;
|
|
11
|
+
value?: any;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Extended validation result with detailed error information
|
|
15
|
+
*/
|
|
16
|
+
export interface DetailedValidationResult extends BaseValidationResult {
|
|
17
|
+
detailedErrors?: ValidationError[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* PIE Item Validator
|
|
21
|
+
* Validates PIE items against JSON schemas
|
|
22
|
+
*/
|
|
23
|
+
export declare class PieItemValidator {
|
|
24
|
+
private ajv;
|
|
25
|
+
private schemas;
|
|
26
|
+
constructor();
|
|
27
|
+
/**
|
|
28
|
+
* Register a PIE element schema
|
|
29
|
+
* @param elementType - Element type (e.g., '@pie-element/multiple-choice')
|
|
30
|
+
* @param schema - JSON Schema object
|
|
31
|
+
*/
|
|
32
|
+
registerSchema(elementType: string, schema: object): void;
|
|
33
|
+
/**
|
|
34
|
+
* Load a schema from the schemas package
|
|
35
|
+
* @param elementType - Element type (e.g., '@pie-element/multiple-choice')
|
|
36
|
+
*/
|
|
37
|
+
loadSchemaForElement(elementType: string): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Load a schema from a file path (for custom schemas)
|
|
40
|
+
* @param elementType - Element type
|
|
41
|
+
* @param schemaPath - Path to pie-schema.json
|
|
42
|
+
*/
|
|
43
|
+
loadSchemaFromFile(elementType: string, schemaPath: string): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Validate a PIE item
|
|
46
|
+
* @param item - PIE item to validate
|
|
47
|
+
* @returns Validation result
|
|
48
|
+
*/
|
|
49
|
+
validate(item: PieItem): DetailedValidationResult;
|
|
50
|
+
/**
|
|
51
|
+
* Validate multiple items
|
|
52
|
+
*/
|
|
53
|
+
validateMany(items: PieItem[]): DetailedValidationResult[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Basic structural validation for PIE items
|
|
57
|
+
* Used when schemas are not available
|
|
58
|
+
*/
|
|
59
|
+
export declare function validatePieItemStructure(item: any): DetailedValidationResult;
|
|
60
|
+
//# sourceMappingURL=validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/utils/validator.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAGlG;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,GAAG,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,oBAAoB;IACpE,cAAc,CAAC,EAAE,eAAe,EAAE,CAAC;CACpC;AAED;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,GAAG,CAAM;IACjB,OAAO,CAAC,OAAO,CAAsB;;IAWrC;;;;OAIG;IACH,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAKzD;;;OAGG;IACG,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAY9D;;;;OAIG;IACG,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAWhF;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,wBAAwB;IAyDjD;;OAEG;IACH,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,wBAAwB,EAAE;CAG3D;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,GAAG,GAAG,wBAAwB,CAmC5E"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation utilities for PIE items and QTI content
|
|
3
|
+
*/
|
|
4
|
+
import { loadSchema } from '@pie-qti/element-schemas';
|
|
5
|
+
import Ajv from 'ajv';
|
|
6
|
+
/**
|
|
7
|
+
* PIE Item Validator
|
|
8
|
+
* Validates PIE items against JSON schemas
|
|
9
|
+
*/
|
|
10
|
+
export class PieItemValidator {
|
|
11
|
+
ajv;
|
|
12
|
+
schemas;
|
|
13
|
+
constructor() {
|
|
14
|
+
this.ajv = new Ajv({
|
|
15
|
+
allErrors: true,
|
|
16
|
+
verbose: true,
|
|
17
|
+
strict: false // PIE schemas may not be strict
|
|
18
|
+
});
|
|
19
|
+
this.schemas = new Map();
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Register a PIE element schema
|
|
23
|
+
* @param elementType - Element type (e.g., '@pie-element/multiple-choice')
|
|
24
|
+
* @param schema - JSON Schema object
|
|
25
|
+
*/
|
|
26
|
+
registerSchema(elementType, schema) {
|
|
27
|
+
this.schemas.set(elementType, schema);
|
|
28
|
+
this.ajv.addSchema(schema, elementType);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Load a schema from the schemas package
|
|
32
|
+
* @param elementType - Element type (e.g., '@pie-element/multiple-choice')
|
|
33
|
+
*/
|
|
34
|
+
async loadSchemaForElement(elementType) {
|
|
35
|
+
try {
|
|
36
|
+
// Extract element name from full element type
|
|
37
|
+
// e.g., '@pie-element/multiple-choice' -> 'multiple-choice'
|
|
38
|
+
const elementName = elementType.replace('@pie-element/', '');
|
|
39
|
+
const schema = await loadSchema(elementName);
|
|
40
|
+
this.registerSchema(elementType, schema);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
throw new Error(`Failed to load schema for ${elementType}: ${error.message}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Load a schema from a file path (for custom schemas)
|
|
48
|
+
* @param elementType - Element type
|
|
49
|
+
* @param schemaPath - Path to pie-schema.json
|
|
50
|
+
*/
|
|
51
|
+
async loadSchemaFromFile(elementType, schemaPath) {
|
|
52
|
+
try {
|
|
53
|
+
const fs = await import('node:fs/promises');
|
|
54
|
+
const schemaContent = await fs.readFile(schemaPath, 'utf-8');
|
|
55
|
+
const schema = JSON.parse(schemaContent);
|
|
56
|
+
this.registerSchema(elementType, schema);
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
throw new Error(`Failed to load schema from ${schemaPath}: ${error.message}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Validate a PIE item
|
|
64
|
+
* @param item - PIE item to validate
|
|
65
|
+
* @returns Validation result
|
|
66
|
+
*/
|
|
67
|
+
validate(item) {
|
|
68
|
+
const errors = [];
|
|
69
|
+
// Validate basic structure
|
|
70
|
+
if (!item.id) {
|
|
71
|
+
errors.push({ path: 'id', message: 'Item ID is required' });
|
|
72
|
+
}
|
|
73
|
+
if (!item.uuid) {
|
|
74
|
+
errors.push({ path: 'uuid', message: 'Item UUID is required' });
|
|
75
|
+
}
|
|
76
|
+
if (!item.config) {
|
|
77
|
+
errors.push({ path: 'config', message: 'Item config is required' });
|
|
78
|
+
return {
|
|
79
|
+
valid: false,
|
|
80
|
+
errors: errors.map(e => `${e.path}: ${e.message}`),
|
|
81
|
+
detailedErrors: errors
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
// Validate models against their schemas
|
|
85
|
+
if (item.config.models) {
|
|
86
|
+
for (let i = 0; i < item.config.models.length; i++) {
|
|
87
|
+
const model = item.config.models[i];
|
|
88
|
+
if (!model.element) {
|
|
89
|
+
errors.push({
|
|
90
|
+
path: `config.models[${i}].element`,
|
|
91
|
+
message: 'Model element type is required'
|
|
92
|
+
});
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
// Check if we have a schema for this element type
|
|
96
|
+
const schema = this.schemas.get(model.element);
|
|
97
|
+
if (schema) {
|
|
98
|
+
const validate = this.ajv.compile(schema);
|
|
99
|
+
const valid = validate(model);
|
|
100
|
+
if (!valid && validate.errors) {
|
|
101
|
+
for (const error of validate.errors) {
|
|
102
|
+
errors.push({
|
|
103
|
+
path: `config.models[${i}]${error.instancePath}`,
|
|
104
|
+
message: error.message || 'Validation error',
|
|
105
|
+
value: error.data,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
valid: errors.length === 0,
|
|
114
|
+
errors: errors.length > 0 ? errors.map(e => `${e.path}: ${e.message}`) : undefined,
|
|
115
|
+
detailedErrors: errors.length > 0 ? errors : undefined,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Validate multiple items
|
|
120
|
+
*/
|
|
121
|
+
validateMany(items) {
|
|
122
|
+
return items.map(item => this.validate(item));
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Basic structural validation for PIE items
|
|
127
|
+
* Used when schemas are not available
|
|
128
|
+
*/
|
|
129
|
+
export function validatePieItemStructure(item) {
|
|
130
|
+
const errors = [];
|
|
131
|
+
if (typeof item !== 'object' || item === null) {
|
|
132
|
+
errors.push({ path: '', message: 'Item must be an object' });
|
|
133
|
+
return {
|
|
134
|
+
valid: false,
|
|
135
|
+
errors: ['Item must be an object'],
|
|
136
|
+
detailedErrors: errors
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
// Check required fields
|
|
140
|
+
const requiredFields = ['id', 'uuid', 'config'];
|
|
141
|
+
for (const field of requiredFields) {
|
|
142
|
+
if (!(field in item)) {
|
|
143
|
+
errors.push({ path: field, message: `${field} is required` });
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
// Check config structure
|
|
147
|
+
if (item.config) {
|
|
148
|
+
if (!Array.isArray(item.config.models)) {
|
|
149
|
+
errors.push({ path: 'config.models', message: 'config.models must be an array' });
|
|
150
|
+
}
|
|
151
|
+
if (typeof item.config.elements !== 'object') {
|
|
152
|
+
errors.push({ path: 'config.elements', message: 'config.elements must be an object' });
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
valid: errors.length === 0,
|
|
157
|
+
errors: errors.length > 0 ? errors.map(e => `${e.path}: ${e.message}`) : undefined,
|
|
158
|
+
detailedErrors: errors.length > 0 ? errors : undefined,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../src/utils/validator.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAoB,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAExE,OAAO,GAAG,MAAM,KAAK,CAAC;AAkBtB;;;GAGG;AACH,MAAM,OAAO,gBAAgB;IACnB,GAAG,CAAM;IACT,OAAO,CAAsB;IAErC;QACE,IAAI,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC;YACjB,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,KAAK,CAAC,gCAAgC;SAC/C,CAAC,CAAC;QACH,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACH,cAAc,CAAC,WAAmB,EAAE,MAAc;QAChD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QACtC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,oBAAoB,CAAC,WAAmB;QAC5C,IAAI,CAAC;YACH,8CAA8C;YAC9C,4DAA4D;YAC5D,MAAM,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAgB,CAAC;YAC5E,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,WAAW,CAAC,CAAC;YAC7C,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,MAAM,C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B,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,KAAK,cAAc,EAAE,CAAC,CAAC;QAChE,CAAC;IACH,CAAC;IAED,yBAAyB;IACzB,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YACvC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,gCAAgC,EAAE,CAAC,CAAC;QACpF,CAAC;QACD,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAC7C,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,mCAAmC,EAAE,CAAC,CAAC;QACzF,CAAC;IACH,CAAC;IAED,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;QAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS;QAClF,cAAc,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;KACvD,CAAC;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pie-qti/transform-core",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Core transformation engine and plugin system for PIE Transform",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc",
|
|
17
|
+
"clean": "rm -rf dist",
|
|
18
|
+
"test": "bun test tests",
|
|
19
|
+
"typecheck": "tsc --noEmit"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"pie",
|
|
23
|
+
"qti",
|
|
24
|
+
"assessment",
|
|
25
|
+
"transformation",
|
|
26
|
+
"plugin"
|
|
27
|
+
],
|
|
28
|
+
"author": "Renaissance Learning",
|
|
29
|
+
"license": "ISC",
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@pie-qti/element-schemas": "workspace:*",
|
|
32
|
+
"@pie-qti/transform-types": "workspace:*",
|
|
33
|
+
"ajv": "^8.17.1"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"typescript": "^5.9.3"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './transform-engine';
|