@xyo-network/payload 2.42.16 → 2.42.18
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/cjs/SchemaNameValidator.d.ts +68 -0
- package/dist/cjs/SchemaNameValidator.d.ts.map +1 -0
- package/dist/cjs/SchemaNameValidator.js +127 -0
- package/dist/cjs/SchemaNameValidator.js.map +1 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/docs.json +1216 -904
- package/dist/esm/SchemaNameValidator.d.ts +68 -0
- package/dist/esm/SchemaNameValidator.d.ts.map +1 -0
- package/dist/esm/SchemaNameValidator.js +114 -0
- package/dist/esm/SchemaNameValidator.js.map +1 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/package.json +8 -7
- package/src/SchemaNameValidator.ts +120 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates a XYO schema structure and existence
|
|
3
|
+
*/
|
|
4
|
+
export declare class XyoSchemaNameValidator {
|
|
5
|
+
schema?: string;
|
|
6
|
+
private _parts?;
|
|
7
|
+
private _rootDomain?;
|
|
8
|
+
constructor(schema?: string);
|
|
9
|
+
/**
|
|
10
|
+
* Checks whether the schema is all lowercase
|
|
11
|
+
*
|
|
12
|
+
* @returns boolean
|
|
13
|
+
*/
|
|
14
|
+
get isLowercase(): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Levels in the schema
|
|
17
|
+
*
|
|
18
|
+
* @returns number
|
|
19
|
+
*/
|
|
20
|
+
get levels(): number | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* The schema converted into a string array split on '.'
|
|
23
|
+
*
|
|
24
|
+
* @returns string[]
|
|
25
|
+
*/
|
|
26
|
+
get parts(): string[] | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* The rootDomain is the first two levels of the schema, in reverse order
|
|
29
|
+
* This can be used to determine who 'owns' that schema, based on domain
|
|
30
|
+
* registration
|
|
31
|
+
*
|
|
32
|
+
* @returns string
|
|
33
|
+
*/
|
|
34
|
+
get rootDomain(): string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Run all static validations
|
|
37
|
+
* @returns Error[]
|
|
38
|
+
*/
|
|
39
|
+
all(): Error[];
|
|
40
|
+
/**
|
|
41
|
+
* Run all the validations
|
|
42
|
+
* @param checkExistence - boolean
|
|
43
|
+
* @returns Error[]
|
|
44
|
+
*/
|
|
45
|
+
allDynamic(): Promise<Error[]>;
|
|
46
|
+
/**
|
|
47
|
+
* Determines how many levels of the schema's reverse domain
|
|
48
|
+
* pass DNS resolution
|
|
49
|
+
*
|
|
50
|
+
* @returns number (0 if none exist)
|
|
51
|
+
*/
|
|
52
|
+
domainExistenceDepth(): Promise<number>;
|
|
53
|
+
/**
|
|
54
|
+
* Checks if the root domain validates via DNS resolution
|
|
55
|
+
*
|
|
56
|
+
* @returns boolean
|
|
57
|
+
*/
|
|
58
|
+
rootDomainExists(): Promise<boolean>;
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
* Get a domain for the schema at a certain level
|
|
62
|
+
*
|
|
63
|
+
* @param level - Zero based level to check
|
|
64
|
+
* @returns string
|
|
65
|
+
*/
|
|
66
|
+
private domainLevel;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=SchemaNameValidator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaNameValidator.d.ts","sourceRoot":"","sources":["../../src/SchemaNameValidator.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,qBAAa,sBAAsB;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,MAAM,CAAC,CAAU;IACzB,OAAO,CAAC,WAAW,CAAC,CAAQ;gBAChB,MAAM,CAAC,EAAE,MAAM;IAI3B;;;;OAIG;IACH,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED;;;;OAIG;IACH,IAAI,MAAM,IAAI,MAAM,GAAG,SAAS,CAE/B;IAED;;;;OAIG;IACH,IAAI,KAAK,yBAGR;IAED;;;;;;OAMG;IACH,IAAI,UAAU,IAAI,MAAM,GAAG,SAAS,CAGnC;IAED;;;OAGG;IAEI,GAAG;IAQV;;;;OAIG;IAEU,UAAU;IAOvB;;;;;OAKG;IACU,oBAAoB;IAYjC;;;;OAIG;IACU,gBAAgB;IAI7B;;;;;;OAMG;IACH,OAAO,CAAC,WAAW;CAMpB"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { domainExists } from '@xyo-network/dns';
|
|
2
|
+
/**
|
|
3
|
+
* Validates a XYO schema structure and existence
|
|
4
|
+
*/
|
|
5
|
+
export class XyoSchemaNameValidator {
|
|
6
|
+
schema;
|
|
7
|
+
_parts;
|
|
8
|
+
_rootDomain;
|
|
9
|
+
constructor(schema) {
|
|
10
|
+
this.schema = schema;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Checks whether the schema is all lowercase
|
|
14
|
+
*
|
|
15
|
+
* @returns boolean
|
|
16
|
+
*/
|
|
17
|
+
get isLowercase() {
|
|
18
|
+
return this.schema === this.schema?.toLowerCase();
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Levels in the schema
|
|
22
|
+
*
|
|
23
|
+
* @returns number
|
|
24
|
+
*/
|
|
25
|
+
get levels() {
|
|
26
|
+
return this.parts?.length;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The schema converted into a string array split on '.'
|
|
30
|
+
*
|
|
31
|
+
* @returns string[]
|
|
32
|
+
*/
|
|
33
|
+
get parts() {
|
|
34
|
+
this._parts = this._parts ?? this.schema?.split('.');
|
|
35
|
+
return this._parts;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The rootDomain is the first two levels of the schema, in reverse order
|
|
39
|
+
* This can be used to determine who 'owns' that schema, based on domain
|
|
40
|
+
* registration
|
|
41
|
+
*
|
|
42
|
+
* @returns string
|
|
43
|
+
*/
|
|
44
|
+
get rootDomain() {
|
|
45
|
+
this._rootDomain = this._rootDomain ?? this.domainLevel(1);
|
|
46
|
+
return this._rootDomain;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Run all static validations
|
|
50
|
+
* @returns Error[]
|
|
51
|
+
*/
|
|
52
|
+
all() {
|
|
53
|
+
const errors = [];
|
|
54
|
+
if ((this.schema?.length ?? 0) === 0)
|
|
55
|
+
errors.push(Error('schema missing'));
|
|
56
|
+
else if ((this.levels ?? 0) < 3)
|
|
57
|
+
errors.push(Error(`schema levels < 3 [${this.levels}, ${this.schema}]`));
|
|
58
|
+
else if (!this.isLowercase)
|
|
59
|
+
errors.push(Error(`schema not lowercase [${this.schema}]`));
|
|
60
|
+
return errors;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Run all the validations
|
|
64
|
+
* @param checkExistence - boolean
|
|
65
|
+
* @returns Error[]
|
|
66
|
+
*/
|
|
67
|
+
async allDynamic() {
|
|
68
|
+
const errors = [];
|
|
69
|
+
if ((this.schema?.length ?? 0) === 0)
|
|
70
|
+
errors.push(Error('schema missing'));
|
|
71
|
+
else if (!(await this.rootDomainExists()))
|
|
72
|
+
errors.push(Error(`schema root domain must exist [${this.rootDomain}]`));
|
|
73
|
+
return errors;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Determines how many levels of the schema's reverse domain
|
|
77
|
+
* pass DNS resolution
|
|
78
|
+
*
|
|
79
|
+
* @returns number (0 if none exist)
|
|
80
|
+
*/
|
|
81
|
+
async domainExistenceDepth() {
|
|
82
|
+
const levels = this.levels ?? 0;
|
|
83
|
+
let level = 0;
|
|
84
|
+
while (level < levels) {
|
|
85
|
+
if (!(await domainExists(this.domainLevel(level)))) {
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
level += 1;
|
|
89
|
+
}
|
|
90
|
+
return level;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Checks if the root domain validates via DNS resolution
|
|
94
|
+
*
|
|
95
|
+
* @returns boolean
|
|
96
|
+
*/
|
|
97
|
+
async rootDomainExists() {
|
|
98
|
+
return await domainExists(this.rootDomain);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
*
|
|
102
|
+
* Get a domain for the schema at a certain level
|
|
103
|
+
*
|
|
104
|
+
* @param level - Zero based level to check
|
|
105
|
+
* @returns string
|
|
106
|
+
*/
|
|
107
|
+
domainLevel(level) {
|
|
108
|
+
return this.parts
|
|
109
|
+
?.slice(0, level + 1)
|
|
110
|
+
.reverse()
|
|
111
|
+
.join('.');
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=SchemaNameValidator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaNameValidator.js","sourceRoot":"","sources":["../../src/SchemaNameValidator.ts"],"names":[],"mappings":"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"}
|
package/dist/esm/index.d.ts
CHANGED
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,8BAA8B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,mBAAmB,CAAA;AACjC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,8BAA8B,CAAA"}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,8BAA8B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,mBAAmB,CAAA;AACjC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,8BAA8B,CAAA"}
|
package/package.json
CHANGED
|
@@ -10,14 +10,15 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xyo-network/
|
|
14
|
-
"@xyo-network/
|
|
15
|
-
"@xyo-network/payload-
|
|
16
|
-
"@xyo-network/payload-
|
|
17
|
-
"@xyo-network/payload-
|
|
13
|
+
"@xyo-network/dns": "^2.42.17",
|
|
14
|
+
"@xyo-network/huri": "^2.42.17",
|
|
15
|
+
"@xyo-network/payload-builder": "^2.42.17",
|
|
16
|
+
"@xyo-network/payload-model": "^2.42.17",
|
|
17
|
+
"@xyo-network/payload-validator": "^2.42.17",
|
|
18
|
+
"@xyo-network/payload-wrapper": "^2.42.17"
|
|
18
19
|
},
|
|
19
20
|
"devDependencies": {
|
|
20
|
-
"@xylabs/ts-scripts-yarn3": "^2.
|
|
21
|
+
"@xylabs/ts-scripts-yarn3": "^2.11.16",
|
|
21
22
|
"axios": "~1.2.1",
|
|
22
23
|
"pako": "^2.1.0"
|
|
23
24
|
},
|
|
@@ -58,5 +59,5 @@
|
|
|
58
59
|
},
|
|
59
60
|
"sideEffects": false,
|
|
60
61
|
"types": "dist/esm/index.d.ts",
|
|
61
|
-
"version": "2.42.
|
|
62
|
+
"version": "2.42.18"
|
|
62
63
|
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { domainExists } from '@xyo-network/dns'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Validates a XYO schema structure and existence
|
|
5
|
+
*/
|
|
6
|
+
export class XyoSchemaNameValidator {
|
|
7
|
+
public schema?: string
|
|
8
|
+
private _parts?: string[]
|
|
9
|
+
private _rootDomain?: string
|
|
10
|
+
constructor(schema?: string) {
|
|
11
|
+
this.schema = schema
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Checks whether the schema is all lowercase
|
|
16
|
+
*
|
|
17
|
+
* @returns boolean
|
|
18
|
+
*/
|
|
19
|
+
get isLowercase(): boolean {
|
|
20
|
+
return this.schema === this.schema?.toLowerCase()
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Levels in the schema
|
|
25
|
+
*
|
|
26
|
+
* @returns number
|
|
27
|
+
*/
|
|
28
|
+
get levels(): number | undefined {
|
|
29
|
+
return this.parts?.length
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The schema converted into a string array split on '.'
|
|
34
|
+
*
|
|
35
|
+
* @returns string[]
|
|
36
|
+
*/
|
|
37
|
+
get parts() {
|
|
38
|
+
this._parts = this._parts ?? this.schema?.split('.')
|
|
39
|
+
return this._parts
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The rootDomain is the first two levels of the schema, in reverse order
|
|
44
|
+
* This can be used to determine who 'owns' that schema, based on domain
|
|
45
|
+
* registration
|
|
46
|
+
*
|
|
47
|
+
* @returns string
|
|
48
|
+
*/
|
|
49
|
+
get rootDomain(): string | undefined {
|
|
50
|
+
this._rootDomain = this._rootDomain ?? this.domainLevel(1)
|
|
51
|
+
return this._rootDomain
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Run all static validations
|
|
56
|
+
* @returns Error[]
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
public all() {
|
|
60
|
+
const errors: Error[] = []
|
|
61
|
+
if ((this.schema?.length ?? 0) === 0) errors.push(Error('schema missing'))
|
|
62
|
+
else if ((this.levels ?? 0) < 3) errors.push(Error(`schema levels < 3 [${this.levels}, ${this.schema}]`))
|
|
63
|
+
else if (!this.isLowercase) errors.push(Error(`schema not lowercase [${this.schema}]`))
|
|
64
|
+
return errors
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Run all the validations
|
|
69
|
+
* @param checkExistence - boolean
|
|
70
|
+
* @returns Error[]
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
public async allDynamic() {
|
|
74
|
+
const errors: Error[] = []
|
|
75
|
+
if ((this.schema?.length ?? 0) === 0) errors.push(Error('schema missing'))
|
|
76
|
+
else if (!(await this.rootDomainExists())) errors.push(Error(`schema root domain must exist [${this.rootDomain}]`))
|
|
77
|
+
return errors
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Determines how many levels of the schema's reverse domain
|
|
82
|
+
* pass DNS resolution
|
|
83
|
+
*
|
|
84
|
+
* @returns number (0 if none exist)
|
|
85
|
+
*/
|
|
86
|
+
public async domainExistenceDepth() {
|
|
87
|
+
const levels = this.levels ?? 0
|
|
88
|
+
let level = 0
|
|
89
|
+
while (level < levels) {
|
|
90
|
+
if (!(await domainExists(this.domainLevel(level)))) {
|
|
91
|
+
break
|
|
92
|
+
}
|
|
93
|
+
level += 1
|
|
94
|
+
}
|
|
95
|
+
return level
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Checks if the root domain validates via DNS resolution
|
|
100
|
+
*
|
|
101
|
+
* @returns boolean
|
|
102
|
+
*/
|
|
103
|
+
public async rootDomainExists() {
|
|
104
|
+
return await domainExists(this.rootDomain)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
*
|
|
109
|
+
* Get a domain for the schema at a certain level
|
|
110
|
+
*
|
|
111
|
+
* @param level - Zero based level to check
|
|
112
|
+
* @returns string
|
|
113
|
+
*/
|
|
114
|
+
private domainLevel(level: number): string | undefined {
|
|
115
|
+
return this.parts
|
|
116
|
+
?.slice(0, level + 1)
|
|
117
|
+
.reverse()
|
|
118
|
+
.join('.')
|
|
119
|
+
}
|
|
120
|
+
}
|
package/src/index.ts
CHANGED