@rootintf/protocol-2phw 2.3.7-api.2 → 3.1.2-api.4

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.
@@ -1 +0,0 @@
1
- export {};
@@ -1,48 +0,0 @@
1
- export function definitions_2PhW(data: any, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }?: {
2
- instancePath?: string;
3
- rootData?: any;
4
- dynamicAnchors?: {};
5
- }): boolean;
6
- export namespace definitions_2PhW {
7
- namespace evaluated {
8
- let dynamicProps: boolean;
9
- let dynamicItems: boolean;
10
- }
11
- }
12
- export function schema_MsgWarp(data: any, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }?: {
13
- instancePath?: string;
14
- rootData?: any;
15
- dynamicAnchors?: {};
16
- }): boolean;
17
- export namespace schema_MsgWarp {
18
- export namespace evaluated_1 {
19
- export let props: {
20
- warp: boolean;
21
- "2PhW": boolean;
22
- };
23
- let dynamicProps_1: boolean;
24
- export { dynamicProps_1 as dynamicProps };
25
- let dynamicItems_1: boolean;
26
- export { dynamicItems_1 as dynamicItems };
27
- }
28
- export { evaluated_1 as evaluated };
29
- }
30
- export function schema_MsgEngage(data: any, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }?: {
31
- instancePath?: string;
32
- rootData?: any;
33
- dynamicAnchors?: {};
34
- }): boolean;
35
- export namespace schema_MsgEngage {
36
- export namespace evaluated_2 {
37
- let props_1: {
38
- engage: boolean;
39
- "2PhW": boolean;
40
- };
41
- export { props_1 as props };
42
- let dynamicProps_2: boolean;
43
- export { dynamicProps_2 as dynamicProps };
44
- let dynamicItems_2: boolean;
45
- export { dynamicItems_2 as dynamicItems };
46
- }
47
- export { evaluated_2 as evaluated };
48
- }
@@ -1,61 +0,0 @@
1
- {
2
- "$id" : "https://root-interface.se/protocols/2PhW",
3
- "$schema": "https://json-schema.org/draft/2019-09/schema",
4
- "schemas": {
5
- "https://root-interface.se/protocols/2PhW/definitions" : {
6
- "$id" : "https://root-interface.se/protocols/2PhW/definitions",
7
- "$schema" : "https://json-schema.org/draft/2019-09/schema",
8
- "definitions" : {
9
- "2PhW" : {
10
- "const": "2"
11
- },
12
- "warp_id" : {
13
- "type" : "string"
14
- }
15
- }
16
- },
17
- "https://root-interface.se/protocols/2PhW/MsgWarp" : {
18
- "$id" : "https://root-interface.se/protocols/2PhW/MsgWarp",
19
- "$schema": "https://json-schema.org/draft/2019-09/schema",
20
- "type" : "object",
21
- "required" : ["warp"],
22
- "properties" : {
23
- "warp" : {
24
- "type" : "object",
25
- "required" : ["id", "user", "hyperport", "ttl_msec"],
26
- "properties": {
27
- "id" : { "$ref": "definitions#/definitions/warp_id" },
28
- "ttl_msec" : {
29
- "type" : "integer"
30
- },
31
- "instantaneous" : {
32
- "type" : "boolean"
33
- }
34
- }
35
- },
36
- "2PhW" : { "$ref": "definitions#/definitions/2PhW" }
37
- }
38
- },
39
- "https://root-interface.se/protocols/2PhW/MsgEngage" : {
40
- "$id" : "https://root-interface.se/protocols/2PhW/MsgEngage",
41
- "$schema": "https://json-schema.org/draft/2019-09/schema",
42
- "type" : "object",
43
- "required" : ["engage"],
44
- "properties" : {
45
- "engage" : {
46
- "type" : "object",
47
- "required" : [ "ok", "rtt_msec" ],
48
- "properties": {
49
- "ok" : {
50
- "type" : "boolean"
51
- },
52
- "rtt_msec" : {
53
- "type" : "integer"
54
- }
55
- }
56
- },
57
- "2PhW" : { "$ref": "definitions#/definitions/2PhW" }
58
- }
59
- }
60
- }
61
- }
@@ -1,12 +0,0 @@
1
- {
2
- "$id" : "https://root-interface.se/protocols/2PhW/schema_MsgOptions",
3
- "$schema": "https://json-schema.org/draft/2019-09/schema",
4
- "type" : "object",
5
- "required" : ["options"],
6
- "properties" : {
7
- "options" : {
8
- "type" : "object"
9
- },
10
- "2PhW" : { "$ref": "definitions_2PhW#/definitions/2PhW" }
11
- }
12
- }
@@ -1,17 +0,0 @@
1
- {
2
- "$id" : "https://root-interface.se/protocols/2PhW/schema_Options_delay",
3
- "$schema": "https://json-schema.org/draft/2019-09/schema",
4
- "type" : "object",
5
- "required" : ["ttl_msec_incr"],
6
- "properties" : {
7
- "ttl_msec_incr" : {
8
- "type" : "array",
9
- "items": {
10
- "type" : "integer"
11
- }
12
- },
13
- "reason" : {
14
- "type" : "string"
15
- }
16
- }
17
- }
@@ -1,40 +0,0 @@
1
-
2
- // https://ajv.js.org/standalone.html
3
- // https://ajv.js.org/guide/schema-language.html
4
-
5
- const fs = require("fs")
6
- const path = require("path")
7
- const Ajv2019 = require("ajv/dist/2019");
8
- const standaloneCode = require("ajv/dist/standalone").default
9
-
10
- // For ESM, the export name needs to be a valid export name, it can not be `export const #/definitions/Foo = ...;` so we
11
- // need to provide a mapping between a valid name and the $id field. Below will generate
12
- // `export const Foo = ...;export const Bar = ...;`
13
- // This mapping would not have been needed if the `$ids` was just `Bar` and `Foo` instead of `#/definitions/Foo`
14
- // and `#/definitions/Bar` respectfully
15
- const ajv = new Ajv2019({
16
- // schemas: [
17
- // json_definitions_2PhW_,
18
- // json_schema_msgWarp_,
19
- // json_schema_msgEngage_,
20
- // json_schema_msgOptions_,
21
- // json_schema_options_delay_
22
- // ],
23
- code: {source: true, esm: true}
24
- });
25
-
26
- var schema_2PhW_= require('../schema/schema_2PhW.json');
27
- Object.values(schema_2PhW_.schemas).forEach(schema => {
28
- ajv.addSchema(schema);
29
- });
30
-
31
- let moduleCode = standaloneCode(ajv, {
32
- "definitions_2PhW": "https://root-interface.se/protocols/2PhW/definitions",
33
- "schema_MsgWarp": "https://root-interface.se/protocols/2PhW/MsgWarp",
34
- "schema_MsgEngage": "https://root-interface.se/protocols/2PhW/MsgEngage",
35
- // "schema_MsgOptions": "https://root-interface.se/protocols/2PhW/schema_MsgOptions",
36
- // "schema_Options_delay": "https://root-interface.se/protocols/2PhW/schema_Options_delay",
37
- })
38
-
39
- // Now you can write the module code to file
40
- fs.writeFileSync(path.join(__dirname, "./validate-esm.mjs"), moduleCode)
@@ -1 +0,0 @@
1
- "use strict";export const definitions_2PhW = validate18;const schema21 = {"$id":"https://root-interface.se/protocols/2PhW/definitions","$schema":"https://json-schema.org/draft/2019-09/schema","definitions":{"2PhW":{"const":"2"},"warp_id":{"type":"string"}}};function validate18(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://root-interface.se/protocols/2PhW/definitions" */;validate18.errors = null;return true;}validate18.evaluated = {"dynamicProps":false,"dynamicItems":false};export const schema_MsgWarp = validate19;const schema22 = {"$id":"https://root-interface.se/protocols/2PhW/MsgWarp","$schema":"https://json-schema.org/draft/2019-09/schema","type":"object","required":["warp"],"properties":{"warp":{"type":"object","required":["id","user","hyperport","ttl_msec"],"properties":{"id":{"$ref":"definitions#/definitions/warp_id"},"ttl_msec":{"type":"integer"},"instantaneous":{"type":"boolean"}}},"2PhW":{"$ref":"definitions#/definitions/2PhW"}}};const schema23 = {"type":"string"};const schema24 = {"const":"2"};function validate19(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://root-interface.se/protocols/2PhW/MsgWarp" */;let vErrors = null;let errors = 0;const evaluated0 = validate19.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((data.warp === undefined) && (missing0 = "warp")){validate19.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {if(data.warp !== undefined){let data0 = data.warp;const _errs1 = errors;if(errors === _errs1){if(data0 && typeof data0 == "object" && !Array.isArray(data0)){let missing1;if(((((data0.id === undefined) && (missing1 = "id")) || ((data0.user === undefined) && (missing1 = "user"))) || ((data0.hyperport === undefined) && (missing1 = "hyperport"))) || ((data0.ttl_msec === undefined) && (missing1 = "ttl_msec"))){validate19.errors = [{instancePath:instancePath+"/warp",schemaPath:"#/properties/warp/required",keyword:"required",params:{missingProperty: missing1},message:"must have required property '"+missing1+"'"}];return false;}else {if(data0.id !== undefined){const _errs3 = errors;if(typeof data0.id !== "string"){validate19.errors = [{instancePath:instancePath+"/warp/id",schemaPath:"definitions#/definitions/warp_id/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid1 = _errs3 === errors;}else {var valid1 = true;}if(valid1){if(data0.ttl_msec !== undefined){let data2 = data0.ttl_msec;const _errs6 = errors;if(!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))){validate19.errors = [{instancePath:instancePath+"/warp/ttl_msec",schemaPath:"#/properties/warp/properties/ttl_msec/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}var valid1 = _errs6 === errors;}else {var valid1 = true;}if(valid1){if(data0.instantaneous !== undefined){const _errs8 = errors;if(typeof data0.instantaneous !== "boolean"){validate19.errors = [{instancePath:instancePath+"/warp/instantaneous",schemaPath:"#/properties/warp/properties/instantaneous/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid1 = _errs8 === errors;}else {var valid1 = true;}}}}}else {validate19.errors = [{instancePath:instancePath+"/warp",schemaPath:"#/properties/warp/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs1 === errors;}else {var valid0 = true;}if(valid0){if(data["2PhW"] !== undefined){const _errs10 = errors;if("2" !== data["2PhW"]){validate19.errors = [{instancePath:instancePath+"/2PhW",schemaPath:"definitions#/definitions/2PhW/const",keyword:"const",params:{allowedValue: "2"},message:"must be equal to constant"}];return false;}var valid0 = _errs10 === errors;}else {var valid0 = true;}}}}else {validate19.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate19.errors = vErrors;return errors === 0;}validate19.evaluated = {"props":{"warp":true,"2PhW":true},"dynamicProps":false,"dynamicItems":false};export const schema_MsgEngage = validate20;const schema25 = {"$id":"https://root-interface.se/protocols/2PhW/MsgEngage","$schema":"https://json-schema.org/draft/2019-09/schema","type":"object","required":["engage"],"properties":{"engage":{"type":"object","required":["ok","rtt_msec"],"properties":{"ok":{"type":"boolean"},"rtt_msec":{"type":"integer"}}},"2PhW":{"$ref":"definitions#/definitions/2PhW"}}};function validate20(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://root-interface.se/protocols/2PhW/MsgEngage" */;let vErrors = null;let errors = 0;const evaluated0 = validate20.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((data.engage === undefined) && (missing0 = "engage")){validate20.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {if(data.engage !== undefined){let data0 = data.engage;const _errs1 = errors;if(errors === _errs1){if(data0 && typeof data0 == "object" && !Array.isArray(data0)){let missing1;if(((data0.ok === undefined) && (missing1 = "ok")) || ((data0.rtt_msec === undefined) && (missing1 = "rtt_msec"))){validate20.errors = [{instancePath:instancePath+"/engage",schemaPath:"#/properties/engage/required",keyword:"required",params:{missingProperty: missing1},message:"must have required property '"+missing1+"'"}];return false;}else {if(data0.ok !== undefined){const _errs3 = errors;if(typeof data0.ok !== "boolean"){validate20.errors = [{instancePath:instancePath+"/engage/ok",schemaPath:"#/properties/engage/properties/ok/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid1 = _errs3 === errors;}else {var valid1 = true;}if(valid1){if(data0.rtt_msec !== undefined){let data2 = data0.rtt_msec;const _errs5 = errors;if(!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))){validate20.errors = [{instancePath:instancePath+"/engage/rtt_msec",schemaPath:"#/properties/engage/properties/rtt_msec/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}var valid1 = _errs5 === errors;}else {var valid1 = true;}}}}else {validate20.errors = [{instancePath:instancePath+"/engage",schemaPath:"#/properties/engage/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs1 === errors;}else {var valid0 = true;}if(valid0){if(data["2PhW"] !== undefined){const _errs7 = errors;if("2" !== data["2PhW"]){validate20.errors = [{instancePath:instancePath+"/2PhW",schemaPath:"definitions#/definitions/2PhW/const",keyword:"const",params:{allowedValue: "2"},message:"must be equal to constant"}];return false;}var valid0 = _errs7 === errors;}else {var valid0 = true;}}}}else {validate20.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate20.errors = vErrors;return errors === 0;}validate20.evaluated = {"props":{"engage":true,"2PhW":true},"dynamicProps":false,"dynamicItems":false};