@xyo-network/payload-validator 4.0.3 → 4.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/dist/browser/index.d.ts +21 -0
- package/dist/browser/spec/Validator.spec.d.ts +2 -0
- package/dist/browser/spec/Validator.spec.d.ts.map +1 -0
- package/dist/neutral/Validator.d.ts +19 -0
- package/dist/neutral/Validator.d.ts.map +1 -0
- package/dist/neutral/index.d.ts +21 -0
- package/dist/neutral/index.d.ts.map +1 -0
- package/dist/neutral/spec/Validator.spec.d.ts +2 -0
- package/dist/neutral/spec/Validator.spec.d.ts.map +1 -0
- package/dist/node/Validator.d.ts +19 -0
- package/dist/node/Validator.d.ts.map +1 -0
- package/dist/node/index.d.ts +21 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/spec/Validator.spec.d.ts +2 -0
- package/dist/node/spec/Validator.spec.d.ts.map +1 -0
- package/package.json +11 -11
- package/dist/types/index.d.ts +0 -2
- /package/dist/{types → browser}/Validator.d.ts +0 -0
- /package/dist/{types → browser}/Validator.d.ts.map +0 -0
- /package/dist/{types → browser}/index.d.ts.map +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ValidatorBase, Validator } from '@xylabs/object';
|
|
2
|
+
import { Promisable } from '@xylabs/promise';
|
|
3
|
+
import { Payload } from '@xyo-network/payload-model';
|
|
4
|
+
|
|
5
|
+
type AllValidator = {
|
|
6
|
+
all(): Error[];
|
|
7
|
+
};
|
|
8
|
+
type AllValidatorFactory = (schema: string) => AllValidator;
|
|
9
|
+
declare class PayloadValidator<T extends Payload = Payload> extends ValidatorBase<T> implements Validator<T> {
|
|
10
|
+
protected static schemaNameValidatorFactory: AllValidatorFactory;
|
|
11
|
+
protected payload: Payload;
|
|
12
|
+
private _schemaValidator?;
|
|
13
|
+
constructor(payload: T);
|
|
14
|
+
get schemaValidator(): AllValidator;
|
|
15
|
+
static setSchemaNameValidatorFactory(factory: AllValidatorFactory): void;
|
|
16
|
+
schemaName(): Error[];
|
|
17
|
+
validate(): Promisable<Error[]>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { PayloadValidator };
|
|
21
|
+
export type { AllValidator, AllValidatorFactory };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Validator.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/Validator.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Validator } from '@xylabs/object';
|
|
2
|
+
import { ValidatorBase } from '@xylabs/object';
|
|
3
|
+
import type { Promisable } from '@xylabs/promise';
|
|
4
|
+
import type { Payload } from '@xyo-network/payload-model';
|
|
5
|
+
export type AllValidator = {
|
|
6
|
+
all(): Error[];
|
|
7
|
+
};
|
|
8
|
+
export type AllValidatorFactory = (schema: string) => AllValidator;
|
|
9
|
+
export declare class PayloadValidator<T extends Payload = Payload> extends ValidatorBase<T> implements Validator<T> {
|
|
10
|
+
protected static schemaNameValidatorFactory: AllValidatorFactory;
|
|
11
|
+
protected payload: Payload;
|
|
12
|
+
private _schemaValidator?;
|
|
13
|
+
constructor(payload: T);
|
|
14
|
+
get schemaValidator(): AllValidator;
|
|
15
|
+
static setSchemaNameValidatorFactory(factory: AllValidatorFactory): void;
|
|
16
|
+
schemaName(): Error[];
|
|
17
|
+
validate(): Promisable<Error[]>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=Validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Validator.d.ts","sourceRoot":"","sources":["../../src/Validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAGzD,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,IAAI,KAAK,EAAE,CAAA;CACf,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,YAAY,CAAA;AAIlE,qBAAa,gBAAgB,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,CAAE,SAAQ,aAAa,CAAC,CAAC,CAAE,YAAW,SAAS,CAAC,CAAC,CAAC;IACzG,SAAS,CAAC,MAAM,CAAC,0BAA0B,EAAE,mBAAmB,CAAoC;IACpG,SAAS,CAAC,OAAO,EAAE,OAAO,CAAA;IAE1B,OAAO,CAAC,gBAAgB,CAAC,CAAc;gBAE3B,OAAO,EAAE,CAAC;IAKtB,IAAI,eAAe,iBAMlB;IAED,MAAM,CAAC,6BAA6B,CAAC,OAAO,EAAE,mBAAmB;IAIjE,UAAU,IAAI,KAAK,EAAE;IAUrB,QAAQ,IAAI,UAAU,CAAC,KAAK,EAAE,CAAC;CAKhC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ValidatorBase, Validator } from '@xylabs/object';
|
|
2
|
+
import { Promisable } from '@xylabs/promise';
|
|
3
|
+
import { Payload } from '@xyo-network/payload-model';
|
|
4
|
+
|
|
5
|
+
type AllValidator = {
|
|
6
|
+
all(): Error[];
|
|
7
|
+
};
|
|
8
|
+
type AllValidatorFactory = (schema: string) => AllValidator;
|
|
9
|
+
declare class PayloadValidator<T extends Payload = Payload> extends ValidatorBase<T> implements Validator<T> {
|
|
10
|
+
protected static schemaNameValidatorFactory: AllValidatorFactory;
|
|
11
|
+
protected payload: Payload;
|
|
12
|
+
private _schemaValidator?;
|
|
13
|
+
constructor(payload: T);
|
|
14
|
+
get schemaValidator(): AllValidator;
|
|
15
|
+
static setSchemaNameValidatorFactory(factory: AllValidatorFactory): void;
|
|
16
|
+
schemaName(): Error[];
|
|
17
|
+
validate(): Promisable<Error[]>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { PayloadValidator };
|
|
21
|
+
export type { AllValidator, AllValidatorFactory };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Validator.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/Validator.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Validator } from '@xylabs/object';
|
|
2
|
+
import { ValidatorBase } from '@xylabs/object';
|
|
3
|
+
import type { Promisable } from '@xylabs/promise';
|
|
4
|
+
import type { Payload } from '@xyo-network/payload-model';
|
|
5
|
+
export type AllValidator = {
|
|
6
|
+
all(): Error[];
|
|
7
|
+
};
|
|
8
|
+
export type AllValidatorFactory = (schema: string) => AllValidator;
|
|
9
|
+
export declare class PayloadValidator<T extends Payload = Payload> extends ValidatorBase<T> implements Validator<T> {
|
|
10
|
+
protected static schemaNameValidatorFactory: AllValidatorFactory;
|
|
11
|
+
protected payload: Payload;
|
|
12
|
+
private _schemaValidator?;
|
|
13
|
+
constructor(payload: T);
|
|
14
|
+
get schemaValidator(): AllValidator;
|
|
15
|
+
static setSchemaNameValidatorFactory(factory: AllValidatorFactory): void;
|
|
16
|
+
schemaName(): Error[];
|
|
17
|
+
validate(): Promisable<Error[]>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=Validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Validator.d.ts","sourceRoot":"","sources":["../../src/Validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAGzD,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,IAAI,KAAK,EAAE,CAAA;CACf,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,YAAY,CAAA;AAIlE,qBAAa,gBAAgB,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,CAAE,SAAQ,aAAa,CAAC,CAAC,CAAE,YAAW,SAAS,CAAC,CAAC,CAAC;IACzG,SAAS,CAAC,MAAM,CAAC,0BAA0B,EAAE,mBAAmB,CAAoC;IACpG,SAAS,CAAC,OAAO,EAAE,OAAO,CAAA;IAE1B,OAAO,CAAC,gBAAgB,CAAC,CAAc;gBAE3B,OAAO,EAAE,CAAC;IAKtB,IAAI,eAAe,iBAMlB;IAED,MAAM,CAAC,6BAA6B,CAAC,OAAO,EAAE,mBAAmB;IAIjE,UAAU,IAAI,KAAK,EAAE;IAUrB,QAAQ,IAAI,UAAU,CAAC,KAAK,EAAE,CAAC;CAKhC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ValidatorBase, Validator } from '@xylabs/object';
|
|
2
|
+
import { Promisable } from '@xylabs/promise';
|
|
3
|
+
import { Payload } from '@xyo-network/payload-model';
|
|
4
|
+
|
|
5
|
+
type AllValidator = {
|
|
6
|
+
all(): Error[];
|
|
7
|
+
};
|
|
8
|
+
type AllValidatorFactory = (schema: string) => AllValidator;
|
|
9
|
+
declare class PayloadValidator<T extends Payload = Payload> extends ValidatorBase<T> implements Validator<T> {
|
|
10
|
+
protected static schemaNameValidatorFactory: AllValidatorFactory;
|
|
11
|
+
protected payload: Payload;
|
|
12
|
+
private _schemaValidator?;
|
|
13
|
+
constructor(payload: T);
|
|
14
|
+
get schemaValidator(): AllValidator;
|
|
15
|
+
static setSchemaNameValidatorFactory(factory: AllValidatorFactory): void;
|
|
16
|
+
schemaName(): Error[];
|
|
17
|
+
validate(): Promisable<Error[]>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { PayloadValidator };
|
|
21
|
+
export type { AllValidator, AllValidatorFactory };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Validator.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/Validator.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/payload-validator",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -21,24 +21,24 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
|
-
"types": "./dist/
|
|
24
|
+
"types": "./dist/neutral/index.d.ts",
|
|
25
25
|
"default": "./dist/neutral/index.mjs"
|
|
26
26
|
},
|
|
27
27
|
"./package.json": "./package.json"
|
|
28
28
|
},
|
|
29
29
|
"module": "dist/neutral/index.mjs",
|
|
30
|
-
"types": "dist/
|
|
30
|
+
"types": "dist/neutral/index.d.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@xylabs/object": "^4.13.
|
|
33
|
-
"@xylabs/promise": "^4.13.
|
|
34
|
-
"@xylabs/typeof": "^4.13.
|
|
35
|
-
"@xyo-network/payload-model": "^4.
|
|
36
|
-
"@xyo-network/schema-name-validator": "^4.
|
|
32
|
+
"@xylabs/object": "^4.13.15",
|
|
33
|
+
"@xylabs/promise": "^4.13.15",
|
|
34
|
+
"@xylabs/typeof": "^4.13.15",
|
|
35
|
+
"@xyo-network/payload-model": "^4.1.1",
|
|
36
|
+
"@xyo-network/schema-name-validator": "^4.1.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@xylabs/ts-scripts-yarn3": "^
|
|
40
|
-
"@xylabs/tsconfig": "^
|
|
41
|
-
"@xylabs/vitest-extended": "^4.13.
|
|
39
|
+
"@xylabs/ts-scripts-yarn3": "^7.0.0-rc.23",
|
|
40
|
+
"@xylabs/tsconfig": "^7.0.0-rc.23",
|
|
41
|
+
"@xylabs/vitest-extended": "^4.13.15",
|
|
42
42
|
"typescript": "^5.8.3",
|
|
43
43
|
"vitest": "^3.2.4"
|
|
44
44
|
},
|
package/dist/types/index.d.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|