@willwade/aac-processors 0.0.22 → 0.0.23
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/README.md +19 -27
- package/dist/processors/applePanelsProcessor.js +166 -123
- package/dist/processors/astericsGridProcessor.js +121 -105
- package/dist/processors/dotProcessor.js +83 -65
- package/dist/processors/opmlProcessor.js +82 -44
- package/dist/validation/applePanelsValidator.d.ts +10 -0
- package/dist/validation/applePanelsValidator.js +124 -0
- package/dist/validation/astericsValidator.d.ts +16 -0
- package/dist/validation/astericsValidator.js +115 -0
- package/dist/validation/dotValidator.d.ts +10 -0
- package/dist/validation/dotValidator.js +113 -0
- package/dist/validation/excelValidator.d.ts +10 -0
- package/dist/validation/excelValidator.js +89 -0
- package/dist/validation/index.d.ts +14 -1
- package/dist/validation/index.js +104 -1
- package/dist/validation/obfsetValidator.d.ts +10 -0
- package/dist/validation/obfsetValidator.js +103 -0
- package/dist/validation/opmlValidator.d.ts +10 -0
- package/dist/validation/opmlValidator.js +107 -0
- package/dist/validation/validationTypes.d.ts +22 -0
- package/dist/validation/validationTypes.js +38 -1
- package/dist/validation.d.ts +8 -2
- package/dist/validation.js +16 -1
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ValidationError = void 0;
|
|
3
|
+
exports.ValidationFailureError = exports.ValidationError = void 0;
|
|
4
|
+
exports.buildValidationResultFromMessage = buildValidationResultFromMessage;
|
|
4
5
|
/**
|
|
5
6
|
* Custom error class for validation errors
|
|
6
7
|
* Can be marked as a blocker to stop validation immediately
|
|
@@ -13,3 +14,39 @@ class ValidationError extends Error {
|
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
16
|
exports.ValidationError = ValidationError;
|
|
17
|
+
/**
|
|
18
|
+
* Error wrapper that carries a structured ValidationResult so callers
|
|
19
|
+
* can surface actionable details instead of generic exceptions.
|
|
20
|
+
*/
|
|
21
|
+
class ValidationFailureError extends Error {
|
|
22
|
+
constructor(message, validationResult, originalError) {
|
|
23
|
+
super(message);
|
|
24
|
+
this.name = 'ValidationFailureError';
|
|
25
|
+
this.validationResult = validationResult;
|
|
26
|
+
this.originalError = originalError;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.ValidationFailureError = ValidationFailureError;
|
|
30
|
+
/**
|
|
31
|
+
* Build a minimal ValidationResult for situations where we cannot run
|
|
32
|
+
* the full validator (e.g., early parse failure) but still want
|
|
33
|
+
* structured feedback for the caller.
|
|
34
|
+
*/
|
|
35
|
+
function buildValidationResultFromMessage(params) {
|
|
36
|
+
return {
|
|
37
|
+
filename: params.filename,
|
|
38
|
+
filesize: params.filesize,
|
|
39
|
+
format: params.format,
|
|
40
|
+
valid: false,
|
|
41
|
+
errors: 1,
|
|
42
|
+
warnings: 0,
|
|
43
|
+
results: [
|
|
44
|
+
{
|
|
45
|
+
type: params.type || 'parse',
|
|
46
|
+
description: params.description || 'parse',
|
|
47
|
+
valid: false,
|
|
48
|
+
error: params.message,
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
};
|
|
52
|
+
}
|
package/dist/validation.d.ts
CHANGED
|
@@ -4,10 +4,16 @@
|
|
|
4
4
|
* All validation functionality for AAC processors.
|
|
5
5
|
* Provides consistent validation across all supported formats.
|
|
6
6
|
*/
|
|
7
|
-
export { ValidationError, ValidationCheck, ValidationResult, ValidationOptions, ValidationRule, } from './validation/validationTypes';
|
|
7
|
+
export { ValidationError, ValidationCheck, ValidationResult, ValidationOptions, ValidationRule, ValidationFailureError, buildValidationResultFromMessage, } from './validation/validationTypes';
|
|
8
8
|
export { BaseValidator } from './validation/baseValidator';
|
|
9
9
|
export { ObfValidator } from './validation/obfValidator';
|
|
10
10
|
export { GridsetValidator } from './validation/gridsetValidator';
|
|
11
11
|
export { SnapValidator } from './validation/snapValidator';
|
|
12
12
|
export { TouchChatValidator } from './validation/touchChatValidator';
|
|
13
|
-
export {
|
|
13
|
+
export { AstericsGridValidator } from './validation/astericsValidator';
|
|
14
|
+
export { ExcelValidator } from './validation/excelValidator';
|
|
15
|
+
export { OpmlValidator } from './validation/opmlValidator';
|
|
16
|
+
export { DotValidator } from './validation/dotValidator';
|
|
17
|
+
export { ApplePanelsValidator } from './validation/applePanelsValidator';
|
|
18
|
+
export { ObfsetValidator } from './validation/obfsetValidator';
|
|
19
|
+
export { getValidatorForFormat, getValidatorForFile, validateFileOrBuffer, } from './validation/index';
|
package/dist/validation.js
CHANGED
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
* Provides consistent validation across all supported formats.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.getValidatorForFile = exports.getValidatorForFormat = exports.TouchChatValidator = exports.SnapValidator = exports.GridsetValidator = exports.ObfValidator = exports.BaseValidator = exports.ValidationError = void 0;
|
|
9
|
+
exports.validateFileOrBuffer = exports.getValidatorForFile = exports.getValidatorForFormat = exports.ObfsetValidator = exports.ApplePanelsValidator = exports.DotValidator = exports.OpmlValidator = exports.ExcelValidator = exports.AstericsGridValidator = exports.TouchChatValidator = exports.SnapValidator = exports.GridsetValidator = exports.ObfValidator = exports.BaseValidator = exports.buildValidationResultFromMessage = exports.ValidationFailureError = exports.ValidationError = void 0;
|
|
10
10
|
// Validation types and interfaces
|
|
11
11
|
var validationTypes_1 = require("./validation/validationTypes");
|
|
12
12
|
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return validationTypes_1.ValidationError; } });
|
|
13
|
+
Object.defineProperty(exports, "ValidationFailureError", { enumerable: true, get: function () { return validationTypes_1.ValidationFailureError; } });
|
|
14
|
+
Object.defineProperty(exports, "buildValidationResultFromMessage", { enumerable: true, get: function () { return validationTypes_1.buildValidationResultFromMessage; } });
|
|
13
15
|
// Base validator
|
|
14
16
|
var baseValidator_1 = require("./validation/baseValidator");
|
|
15
17
|
Object.defineProperty(exports, "BaseValidator", { enumerable: true, get: function () { return baseValidator_1.BaseValidator; } });
|
|
@@ -22,7 +24,20 @@ var snapValidator_1 = require("./validation/snapValidator");
|
|
|
22
24
|
Object.defineProperty(exports, "SnapValidator", { enumerable: true, get: function () { return snapValidator_1.SnapValidator; } });
|
|
23
25
|
var touchChatValidator_1 = require("./validation/touchChatValidator");
|
|
24
26
|
Object.defineProperty(exports, "TouchChatValidator", { enumerable: true, get: function () { return touchChatValidator_1.TouchChatValidator; } });
|
|
27
|
+
var astericsValidator_1 = require("./validation/astericsValidator");
|
|
28
|
+
Object.defineProperty(exports, "AstericsGridValidator", { enumerable: true, get: function () { return astericsValidator_1.AstericsGridValidator; } });
|
|
29
|
+
var excelValidator_1 = require("./validation/excelValidator");
|
|
30
|
+
Object.defineProperty(exports, "ExcelValidator", { enumerable: true, get: function () { return excelValidator_1.ExcelValidator; } });
|
|
31
|
+
var opmlValidator_1 = require("./validation/opmlValidator");
|
|
32
|
+
Object.defineProperty(exports, "OpmlValidator", { enumerable: true, get: function () { return opmlValidator_1.OpmlValidator; } });
|
|
33
|
+
var dotValidator_1 = require("./validation/dotValidator");
|
|
34
|
+
Object.defineProperty(exports, "DotValidator", { enumerable: true, get: function () { return dotValidator_1.DotValidator; } });
|
|
35
|
+
var applePanelsValidator_1 = require("./validation/applePanelsValidator");
|
|
36
|
+
Object.defineProperty(exports, "ApplePanelsValidator", { enumerable: true, get: function () { return applePanelsValidator_1.ApplePanelsValidator; } });
|
|
37
|
+
var obfsetValidator_1 = require("./validation/obfsetValidator");
|
|
38
|
+
Object.defineProperty(exports, "ObfsetValidator", { enumerable: true, get: function () { return obfsetValidator_1.ObfsetValidator; } });
|
|
25
39
|
// Validator factory functions
|
|
26
40
|
var index_1 = require("./validation/index");
|
|
27
41
|
Object.defineProperty(exports, "getValidatorForFormat", { enumerable: true, get: function () { return index_1.getValidatorForFormat; } });
|
|
28
42
|
Object.defineProperty(exports, "getValidatorForFile", { enumerable: true, get: function () { return index_1.getValidatorForFile; } });
|
|
43
|
+
Object.defineProperty(exports, "validateFileOrBuffer", { enumerable: true, get: function () { return index_1.validateFileOrBuffer; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willwade/aac-processors",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.23",
|
|
4
4
|
"description": "A comprehensive TypeScript library for processing AAC (Augmentative and Alternative Communication) file formats with translation support",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|