@cardanowall/poe-standard 0.0.0
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/LICENSE +202 -0
- package/README.md +213 -0
- package/dist/encoder.cjs +1693 -0
- package/dist/encoder.cjs.map +1 -0
- package/dist/encoder.d.cts +7 -0
- package/dist/encoder.d.ts +7 -0
- package/dist/encoder.js +1690 -0
- package/dist/encoder.js.map +1 -0
- package/dist/error-codes.cjs +175 -0
- package/dist/error-codes.cjs.map +1 -0
- package/dist/error-codes.d.cts +11 -0
- package/dist/error-codes.d.ts +11 -0
- package/dist/error-codes.js +169 -0
- package/dist/error-codes.js.map +1 -0
- package/dist/index.cjs +3530 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +60 -0
- package/dist/index.d.ts +60 -0
- package/dist/index.js +3498 -0
- package/dist/index.js.map +1 -0
- package/dist/schema.cjs +128 -0
- package/dist/schema.cjs.map +1 -0
- package/dist/schema.d.cts +93 -0
- package/dist/schema.d.ts +93 -0
- package/dist/schema.js +109 -0
- package/dist/schema.js.map +1 -0
- package/dist/validator.cjs +3283 -0
- package/dist/validator.cjs.map +1 -0
- package/dist/validator.d.cts +23 -0
- package/dist/validator.d.ts +23 -0
- package/dist/validator.js +3280 -0
- package/dist/validator.js.map +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ErrorCode, Severity } from './error-codes.cjs';
|
|
2
|
+
import { PoeRecord } from './schema.cjs';
|
|
3
|
+
import 'zod';
|
|
4
|
+
|
|
5
|
+
interface ValidationIssue {
|
|
6
|
+
readonly code: ErrorCode;
|
|
7
|
+
readonly path: ReadonlyArray<string | number>;
|
|
8
|
+
readonly message: string;
|
|
9
|
+
readonly severity: Severity;
|
|
10
|
+
}
|
|
11
|
+
type ValidateResult = {
|
|
12
|
+
readonly ok: true;
|
|
13
|
+
readonly record: PoeRecord;
|
|
14
|
+
readonly warnings?: ReadonlyArray<ValidationIssue>;
|
|
15
|
+
readonly info?: ReadonlyArray<ValidationIssue>;
|
|
16
|
+
} | {
|
|
17
|
+
readonly ok: false;
|
|
18
|
+
readonly issues: ReadonlyArray<ValidationIssue>;
|
|
19
|
+
};
|
|
20
|
+
declare function validatePoeRecord(bytes: Uint8Array): ValidateResult;
|
|
21
|
+
declare function validateCidProfile(cid: string): boolean;
|
|
22
|
+
|
|
23
|
+
export { type ValidateResult, type ValidationIssue, validateCidProfile, validatePoeRecord };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ErrorCode, Severity } from './error-codes.js';
|
|
2
|
+
import { PoeRecord } from './schema.js';
|
|
3
|
+
import 'zod';
|
|
4
|
+
|
|
5
|
+
interface ValidationIssue {
|
|
6
|
+
readonly code: ErrorCode;
|
|
7
|
+
readonly path: ReadonlyArray<string | number>;
|
|
8
|
+
readonly message: string;
|
|
9
|
+
readonly severity: Severity;
|
|
10
|
+
}
|
|
11
|
+
type ValidateResult = {
|
|
12
|
+
readonly ok: true;
|
|
13
|
+
readonly record: PoeRecord;
|
|
14
|
+
readonly warnings?: ReadonlyArray<ValidationIssue>;
|
|
15
|
+
readonly info?: ReadonlyArray<ValidationIssue>;
|
|
16
|
+
} | {
|
|
17
|
+
readonly ok: false;
|
|
18
|
+
readonly issues: ReadonlyArray<ValidationIssue>;
|
|
19
|
+
};
|
|
20
|
+
declare function validatePoeRecord(bytes: Uint8Array): ValidateResult;
|
|
21
|
+
declare function validateCidProfile(cid: string): boolean;
|
|
22
|
+
|
|
23
|
+
export { type ValidateResult, type ValidationIssue, validateCidProfile, validatePoeRecord };
|