@rootintf/protocol-2phw 0.6.11 → 0.7.5-api-0.7
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 +1 -1
- package/dist/twoPhW.cjs.js +756 -736
- package/dist/twoPhW.es.mjs +756 -734
- package/jasmine.json +6 -6
- package/package.json +42 -42
- package/rollup.config.mjs +23 -23
- package/schema/schema_Msg2PhW.json +11 -11
- package/schema/schema_MsgEngage.json +11 -11
- package/schema/schema_MsgOptions.json +10 -10
- package/schema/schema_MsgWarp.json +19 -15
- package/schema/schema_Options_delay.json +16 -10
- package/src/ajv-gen-validate.cjs +23 -23
- package/src/twoPhW.mjs +582 -566
- package/src/validate-esm.mjs +1 -1
- package/tests/twoPhW-new.spec.mjs +173 -159
- package/tests/twoPhW.test.mjs +175 -175
package/jasmine.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
{
|
|
2
|
-
"spec_dir": "tests",
|
|
3
|
-
"spec_files": [
|
|
4
|
-
"**/*[sS]pec.?(m)js",
|
|
5
|
-
"!**/*nospec.js"
|
|
6
|
-
]
|
|
1
|
+
{
|
|
2
|
+
"spec_dir": "tests",
|
|
3
|
+
"spec_files": [
|
|
4
|
+
"**/*[sS]pec.?(m)js",
|
|
5
|
+
"!**/*nospec.js"
|
|
6
|
+
]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@rootintf/protocol-2phw",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "dist/twoPhW.cjs.js",
|
|
6
|
-
"browser": "dist/twoPhW.es.mjs",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "node src/ajv-gen-validate.cjs && rollup --config",
|
|
9
|
-
"script": "node --experimental-json-modules tests/twoPhW.test.mjs",
|
|
10
|
-
"test": "jasmine --config=jasmine.json",
|
|
11
|
-
"clean": "del dist && del src/validate-esm.mjs && echo OK"
|
|
12
|
-
},
|
|
13
|
-
"repository": {
|
|
14
|
-
"type": "git",
|
|
15
|
-
"url": "git+https://gitlab.com/interface-x/npm-protocol-2PhW.git"
|
|
16
|
-
},
|
|
17
|
-
"keywords": [
|
|
18
|
-
"metaverse",
|
|
19
|
-
"warp",
|
|
20
|
-
"protocol"
|
|
21
|
-
],
|
|
22
|
-
"author": "K.Nevelsteen, PhD",
|
|
23
|
-
"license": "ISC",
|
|
24
|
-
"bugs": {
|
|
25
|
-
"url": "https://gitlab.com/interface-x/npm-protocol-2PhW.git/-/issues"
|
|
26
|
-
},
|
|
27
|
-
"homepage": "https://gitlab.com/interface-x/npm-protocol-2PhW.git#readme",
|
|
28
|
-
"dependencies": {
|
|
29
|
-
"@knev/bitlogr": "^0.2.4",
|
|
30
|
-
"@rootintf/json-msg": "^0.2.1"
|
|
31
|
-
},
|
|
32
|
-
"devDependencies": {
|
|
33
|
-
"@rollup/plugin-commonjs": "^
|
|
34
|
-
"@rollup/plugin-json": "^
|
|
35
|
-
"@rollup/plugin-node-resolve": "^
|
|
36
|
-
"ajv-cli": "^5.0.0",
|
|
37
|
-
"del-cli": "^
|
|
38
|
-
"jasmine": "^
|
|
39
|
-
"rollup": "^
|
|
40
|
-
"uuid": "^
|
|
41
|
-
}
|
|
42
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@rootintf/protocol-2phw",
|
|
3
|
+
"version": "0.7.5-api-0.7",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/twoPhW.cjs.js",
|
|
6
|
+
"browser": "dist/twoPhW.es.mjs",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "node src/ajv-gen-validate.cjs && rollup --config",
|
|
9
|
+
"script": "node --experimental-json-modules tests/twoPhW.test.mjs",
|
|
10
|
+
"test": "jasmine --config=jasmine.json",
|
|
11
|
+
"clean": "del-cli dist && del-cli src/validate-esm.mjs && echo OK"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://gitlab.com/interface-x/npm-protocol-2PhW.git"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"metaverse",
|
|
19
|
+
"warp",
|
|
20
|
+
"protocol"
|
|
21
|
+
],
|
|
22
|
+
"author": "K.Nevelsteen, PhD",
|
|
23
|
+
"license": "ISC",
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://gitlab.com/interface-x/npm-protocol-2PhW.git/-/issues"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://gitlab.com/interface-x/npm-protocol-2PhW.git#readme",
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@knev/bitlogr": "^0.2.4",
|
|
30
|
+
"@rootintf/json-msg": "^0.2.1"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@rollup/plugin-commonjs": "^28.0.3",
|
|
34
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
35
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
36
|
+
"ajv-cli": "^5.0.0",
|
|
37
|
+
"del-cli": "^6.0.0",
|
|
38
|
+
"jasmine": "^5.6.0",
|
|
39
|
+
"rollup": "^4.35.0",
|
|
40
|
+
"uuid": "^11.1.0"
|
|
41
|
+
}
|
|
42
|
+
}
|
package/rollup.config.mjs
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
import resolve from '@rollup/plugin-node-resolve';
|
|
3
|
-
import commonjs from '@rollup/plugin-commonjs';
|
|
4
|
-
import json from '@rollup/plugin-json';
|
|
5
|
-
|
|
6
|
-
export default [
|
|
7
|
-
{
|
|
8
|
-
input: 'src/twoPhW.mjs',
|
|
9
|
-
output: {
|
|
10
|
-
file: 'dist/twoPhW.es.mjs',
|
|
11
|
-
format: 'es'
|
|
12
|
-
},
|
|
13
|
-
plugins: [resolve(), commonjs(), json()]
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
input: 'src/twoPhW.mjs',
|
|
17
|
-
output: {
|
|
18
|
-
file: 'dist/twoPhW.cjs.js',
|
|
19
|
-
format: 'cjs'
|
|
20
|
-
},
|
|
21
|
-
plugins: [resolve(), commonjs(), json()]
|
|
22
|
-
}
|
|
23
|
-
|
|
1
|
+
|
|
2
|
+
import resolve from '@rollup/plugin-node-resolve';
|
|
3
|
+
import commonjs from '@rollup/plugin-commonjs';
|
|
4
|
+
import json from '@rollup/plugin-json';
|
|
5
|
+
|
|
6
|
+
export default [
|
|
7
|
+
{
|
|
8
|
+
input: 'src/twoPhW.mjs',
|
|
9
|
+
output: {
|
|
10
|
+
file: 'dist/twoPhW.es.mjs',
|
|
11
|
+
format: 'es'
|
|
12
|
+
},
|
|
13
|
+
plugins: [resolve(), commonjs(), json()]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
input: 'src/twoPhW.mjs',
|
|
17
|
+
output: {
|
|
18
|
+
file: 'dist/twoPhW.cjs.js',
|
|
19
|
+
format: 'cjs'
|
|
20
|
+
},
|
|
21
|
+
plugins: [resolve(), commonjs(), json()]
|
|
22
|
+
}
|
|
23
|
+
|
|
24
24
|
];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$id": "validate_Msg2PhW",
|
|
3
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
-
"type" : "object",
|
|
5
|
-
"required" : ["2PhW"],
|
|
6
|
-
"properties" : {
|
|
7
|
-
"2PhW" : {
|
|
8
|
-
"type" : "string",
|
|
9
|
-
"pattern": "0\\.
|
|
10
|
-
}
|
|
11
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$id": "validate_Msg2PhW",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"type" : "object",
|
|
5
|
+
"required" : ["2PhW"],
|
|
6
|
+
"properties" : {
|
|
7
|
+
"2PhW" : {
|
|
8
|
+
"type" : "string",
|
|
9
|
+
"pattern": "0\\.7"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$id": "validate_MsgEngage",
|
|
3
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
-
"type" : "object",
|
|
5
|
-
"required" : ["engage"],
|
|
6
|
-
"properties" : {
|
|
7
|
-
"engage" : {
|
|
8
|
-
"type" : "object",
|
|
9
|
-
"required" : ["user", "hyperport"]
|
|
10
|
-
}
|
|
11
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$id": "validate_MsgEngage",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"type" : "object",
|
|
5
|
+
"required" : ["engage"],
|
|
6
|
+
"properties" : {
|
|
7
|
+
"engage" : {
|
|
8
|
+
"type" : "object",
|
|
9
|
+
"required" : ["user", "hyperport"]
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
12
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$id": "validate_MsgOptions",
|
|
3
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
-
"type" : "object",
|
|
5
|
-
"required" : ["options"],
|
|
6
|
-
"properties" : {
|
|
7
|
-
"options" : {
|
|
8
|
-
"type" : "object"
|
|
9
|
-
}
|
|
10
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$id": "validate_MsgOptions",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"type" : "object",
|
|
5
|
+
"required" : ["options"],
|
|
6
|
+
"properties" : {
|
|
7
|
+
"options" : {
|
|
8
|
+
"type" : "object"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
11
|
}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$id": "validate_MsgWarp",
|
|
3
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
-
"type" : "object",
|
|
5
|
-
"required" : ["warp"],
|
|
6
|
-
"properties" : {
|
|
7
|
-
"warp" : {
|
|
8
|
-
"type" : "object",
|
|
9
|
-
"required" : ["user", "hyperport"],
|
|
10
|
-
"properties": {
|
|
11
|
-
"ttl_msec" : {
|
|
12
|
-
"type" : "integer"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
{
|
|
2
|
+
"$id": "validate_MsgWarp",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"type" : "object",
|
|
5
|
+
"required" : ["warp"],
|
|
6
|
+
"properties" : {
|
|
7
|
+
"warp" : {
|
|
8
|
+
"type" : "object",
|
|
9
|
+
"required" : ["user", "hyperport"],
|
|
10
|
+
"properties": {
|
|
11
|
+
"ttl_msec" : {
|
|
12
|
+
"type" : "integer"
|
|
13
|
+
},
|
|
14
|
+
"instantaneous" : {
|
|
15
|
+
"type" : "boolean"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
16
20
|
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$id": "validate_Options_delay",
|
|
3
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
-
"type" : "object",
|
|
5
|
-
"required" : ["ttl_msec_incr"],
|
|
6
|
-
"properties" : {
|
|
7
|
-
"
|
|
8
|
-
"type" : "array"
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
{
|
|
2
|
+
"$id": "validate_Options_delay",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/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
|
+
}
|
|
11
17
|
}
|
package/src/ajv-gen-validate.cjs
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
var schema_json_msg2PhW= require('../schema/schema_Msg2PhW.json');
|
|
3
|
-
var schema_json_msgOptions_= require('../schema/schema_MsgOptions.json');
|
|
4
|
-
var schema_json_options_delay_= require('../schema/schema_Options_delay.json');
|
|
5
|
-
var schema_json_msgWarp_= require('../schema/schema_MsgWarp.json');
|
|
6
|
-
var schema_json_msgEngage_= require('../schema/schema_MsgEngage.json');
|
|
7
|
-
|
|
8
|
-
// https://ajv.js.org/standalone.html
|
|
9
|
-
|
|
10
|
-
const fs = require("fs")
|
|
11
|
-
const path = require("path")
|
|
12
|
-
const Ajv = require("ajv")
|
|
13
|
-
const standaloneCode = require("ajv/dist/standalone").default
|
|
14
|
-
|
|
15
|
-
// For ESM, the export name needs to be a valid export name, it can not be `export const #/definitions/Foo = ...;` so we
|
|
16
|
-
// need to provide a mapping between a valid name and the $id field. Below will generate
|
|
17
|
-
// `export const Foo = ...;export const Bar = ...;`
|
|
18
|
-
// This mapping would not have been needed if the `$ids` was just `Bar` and `Foo` instead of `#/definitions/Foo`
|
|
19
|
-
// and `#/definitions/Bar` respectfully
|
|
20
|
-
const ajv = new Ajv({schemas: [schema_json_msg2PhW, schema_json_msgOptions_, schema_json_options_delay_, schema_json_msgWarp_, schema_json_msgEngage_], code: {source: true, esm: true}})
|
|
21
|
-
let moduleCode = standaloneCode(ajv)
|
|
22
|
-
|
|
23
|
-
// Now you can write the module code to file
|
|
1
|
+
|
|
2
|
+
var schema_json_msg2PhW= require('../schema/schema_Msg2PhW.json');
|
|
3
|
+
var schema_json_msgOptions_= require('../schema/schema_MsgOptions.json');
|
|
4
|
+
var schema_json_options_delay_= require('../schema/schema_Options_delay.json');
|
|
5
|
+
var schema_json_msgWarp_= require('../schema/schema_MsgWarp.json');
|
|
6
|
+
var schema_json_msgEngage_= require('../schema/schema_MsgEngage.json');
|
|
7
|
+
|
|
8
|
+
// https://ajv.js.org/standalone.html
|
|
9
|
+
|
|
10
|
+
const fs = require("fs")
|
|
11
|
+
const path = require("path")
|
|
12
|
+
const Ajv = require("ajv")
|
|
13
|
+
const standaloneCode = require("ajv/dist/standalone").default
|
|
14
|
+
|
|
15
|
+
// For ESM, the export name needs to be a valid export name, it can not be `export const #/definitions/Foo = ...;` so we
|
|
16
|
+
// need to provide a mapping between a valid name and the $id field. Below will generate
|
|
17
|
+
// `export const Foo = ...;export const Bar = ...;`
|
|
18
|
+
// This mapping would not have been needed if the `$ids` was just `Bar` and `Foo` instead of `#/definitions/Foo`
|
|
19
|
+
// and `#/definitions/Bar` respectfully
|
|
20
|
+
const ajv = new Ajv({schemas: [schema_json_msg2PhW, schema_json_msgOptions_, schema_json_options_delay_, schema_json_msgWarp_, schema_json_msgEngage_], code: {source: true, esm: true}})
|
|
21
|
+
let moduleCode = standaloneCode(ajv)
|
|
22
|
+
|
|
23
|
+
// Now you can write the module code to file
|
|
24
24
|
fs.writeFileSync(path.join(__dirname, "./validate-esm.mjs"), moduleCode)
|