@rootintf/protocol-subverseinfo 0.0.4-api-0.1 → 1.0.7-api.1.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/antora-docs/modules/ROOT/pages/development.adoc +11 -0
- package/dist/subverseinfo.cjs.js +235 -179
- package/dist/subverseinfo.es.mjs +234 -179
- package/package.json +40 -40
- package/schema/definitions_SubverseInfo.json +22 -11
- package/schema/schema_SubverseInfo_expanse.json +7 -6
- package/schema/{schema_SubverseInfo_discovery.json → schema_SubverseInfo_query.json} +5 -4
- package/schema/schema_expanse_instances.json +3 -7
- package/src/ajv-gen-validate.cjs +6 -6
- package/src/subverseinfo.mjs +21 -12
- package/src/validate-esm.mjs +1 -1
- package/tests/subverseinfo.spec.mjs +162 -92
|
@@ -12,26 +12,53 @@ Object.defineProperty(globalThis, 'crypto', {
|
|
|
12
12
|
|
|
13
13
|
// import { JSON_Msg, JSON_Msg_msg } from '@rootintf/json-msg';
|
|
14
14
|
import {
|
|
15
|
-
|
|
16
|
-
JSON_MsgSubverseInfo_expanse,
|
|
15
|
+
JSON_MsgSubverseInfo_query,
|
|
16
|
+
JSON_MsgSubverseInfo_expanse,
|
|
17
|
+
l as l_
|
|
17
18
|
} from '../src/subverseinfo.mjs';
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
import { LOGR, l_LL } from '@knev/bitlogr';
|
|
21
|
+
|
|
22
|
+
const kstr_VERSION = "1.0"
|
|
23
|
+
|
|
24
|
+
const LOGR_= LOGR.get_instance();
|
|
25
|
+
LOGR_.toggled= {
|
|
26
|
+
VALIDATION : true
|
|
27
|
+
}
|
|
20
28
|
|
|
21
29
|
//-------------------------------------------------------------------------------------------------
|
|
22
30
|
|
|
23
|
-
const
|
|
24
|
-
"
|
|
31
|
+
const json_MsgSubverseInfo_query = {
|
|
32
|
+
"id": "611aeb54-9d2c-4dd9-9a39-e5d95627cc82",
|
|
33
|
+
"referer": [
|
|
34
|
+
"subverse-protocol-map",
|
|
35
|
+
"c8961cab-1aeb-4d9e-9cf2-ce94e6b3ef7f"
|
|
36
|
+
],
|
|
37
|
+
"dt": "2025-03-05T07:52:01.209Z",
|
|
38
|
+
"query": {
|
|
25
39
|
"name": "discovery-expanse",
|
|
26
40
|
"graphql": "query { expanse { name map logo(width: 200, height: 200) { link } platforms { name archs agents } protocols { name attr } } }",
|
|
27
41
|
"ttl_msec": 5000
|
|
28
42
|
},
|
|
29
|
-
|
|
30
|
-
|
|
43
|
+
"subverse_info": kstr_VERSION
|
|
44
|
+
}
|
|
31
45
|
|
|
32
|
-
describe("
|
|
33
|
-
it("
|
|
34
|
-
expect(
|
|
46
|
+
describe("Validate query;", function () {
|
|
47
|
+
it("raw", function () {
|
|
48
|
+
expect(JSON_MsgSubverseInfo_query.validate(json_MsgSubverseInfo_query)).toBe(true);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("merge", function () {
|
|
52
|
+
const json = JSON_MsgSubverseInfo_query.merge({
|
|
53
|
+
"query": {
|
|
54
|
+
"name": "discovery-expanse",
|
|
55
|
+
"graphql": "query { expanse { name map logo(width: 200, height: 200) { link } platforms { name archs agents } protocols { name attr } } }",
|
|
56
|
+
"ttl_msec": 5000
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
json.referer = [ "karr_referer", "" ];
|
|
60
|
+
|
|
61
|
+
expect(JSON_MsgSubverseInfo_query.validate(json)).toBe(true);
|
|
35
62
|
});
|
|
36
63
|
});
|
|
37
64
|
|
|
@@ -50,90 +77,132 @@ describe("Validation", function () {
|
|
|
50
77
|
|
|
51
78
|
//-------------------------------------------------------------------------------------------------
|
|
52
79
|
|
|
53
|
-
const json_msgAnnouncement_expanse = {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
80
|
+
// const json_msgAnnouncement_expanse = {
|
|
81
|
+
// "id": "53C2A451-D3E7-4657-932D-22EBF4A823D8",
|
|
82
|
+
// "_msg": { "id": "15169a65-94fe-449a-9164-a2e2bdd78c56", "discovery": { "graphql": "query { subverse { name logo(width: 200, height: 200) protocols integrations } }", "ttl_msec": 5000 }, "referer": ["subverse-protocol-map", "4b1ad967-8154-416f-a744-989db452bd76"], "dt": "2023-04-28T10:13:11.642Z" },
|
|
83
|
+
// "referer": ["tx-sl", "D41EDF64-6BF9-40D0-B30C-CC6A798B67F2"],
|
|
84
|
+
// "dt": "2023-04-28T10:13:11Z",
|
|
85
|
+
// "announcement": {
|
|
86
|
+
// // "expanse": {
|
|
87
|
+
// // "integrations": [
|
|
88
|
+
// // { "pkg": "tx-sl", "ppa": "https://root-interface.se/depot", "sha2-384": "c3f3e373de97e8d7f5d9c47096c128fcdcb07fbbb4581d6ab7d32913fe301edec0abb48a0bcf585f167c473b45a24634", "sha3-224": "", "version": "0.2.9" }
|
|
89
|
+
// // ],
|
|
90
|
+
// // "logo": "http://root-interface.se/depot/tx-sl/img-SL_DLbackground.png",
|
|
91
|
+
// // "name": "Second Life",
|
|
92
|
+
// // "protocols": ["QuerySubverse", "2PhW", "Discovery"]
|
|
93
|
+
// // }
|
|
94
|
+
// },
|
|
95
|
+
// "_v" : kstr_VERSION
|
|
96
|
+
// }
|
|
97
|
+
|
|
70
98
|
|
|
71
|
-
let json_SubverseInfo_expanse_OpenSim= JSON_MsgSubverseInfo_expanse.create_with_msg_merge(null, {
|
|
72
|
-
expanse : {
|
|
73
|
-
subverse: {
|
|
74
|
-
name : "OpenSimulator",
|
|
75
|
-
uri : "http://opensimulator.org",
|
|
76
|
-
favicon : "https://upload.wikimedia.org/wikipedia/commons/5/50/Opensimulator_logo200x160.png",
|
|
77
|
-
map_url : "http://opensimulator.org/wiki/Grid_List"
|
|
78
|
-
},
|
|
79
|
-
protocols: [
|
|
80
|
-
{ name: "Second Life protocol", attr: "0r" }
|
|
81
|
-
]
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
json_SubverseInfo_expanse_OpenSim.referer = [ "karr_referer", "" ];
|
|
85
99
|
// console.log('json_msgAnnouncement_OpenSim', json_msgAnnouncement_OpenSim)
|
|
86
100
|
|
|
87
|
-
describe("
|
|
88
|
-
it("
|
|
89
|
-
|
|
101
|
+
describe("Validate expanse;", function () {
|
|
102
|
+
it("create_with_msg_merge- minimum", function () {
|
|
103
|
+
let json= JSON_MsgSubverseInfo_expanse.create_with_msg_merge(null, {
|
|
104
|
+
expanse : {
|
|
105
|
+
subverse: {
|
|
106
|
+
name : "OpenSimulator",
|
|
107
|
+
uri : "http://opensimulator.org",
|
|
108
|
+
},
|
|
109
|
+
protocols: [
|
|
110
|
+
{
|
|
111
|
+
id: "secondlife://",
|
|
112
|
+
attr: "0r"
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
json.referer = [ "karr_referer", "" ];
|
|
118
|
+
|
|
119
|
+
expect(JSON_MsgSubverseInfo_expanse.validate(json)).toBe(true);
|
|
90
120
|
});
|
|
91
|
-
});
|
|
92
121
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
122
|
+
it("create_with_msg_merge- maximum", function () {
|
|
123
|
+
let json= JSON_MsgSubverseInfo_expanse.create_with_msg_merge(null, {
|
|
124
|
+
expanse : {
|
|
125
|
+
subverse: {
|
|
126
|
+
name : "OpenSimulator",
|
|
127
|
+
uri : "http://opensimulator.org",
|
|
128
|
+
favicon : "https://upload.wikimedia.org/wikipedia/commons/5/50/Opensimulator_logo200x160.png",
|
|
129
|
+
"hyperport" : {},
|
|
130
|
+
"map-uri" : "http://opensimulator.org/wiki/Grid_List",
|
|
131
|
+
instances : [
|
|
132
|
+
{
|
|
133
|
+
name : "",
|
|
134
|
+
uri : "",
|
|
135
|
+
favicon : "",
|
|
136
|
+
"hyperport" : {},
|
|
137
|
+
info : {
|
|
138
|
+
"key" : "value"
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
info : {
|
|
143
|
+
"key" : "value"
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
protocols: [
|
|
147
|
+
{
|
|
148
|
+
id: "secondlife://",
|
|
149
|
+
name : "Second Life protocol",
|
|
150
|
+
attr: "0r"
|
|
151
|
+
}
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
json.referer = [ "karr_referer", "" ];
|
|
156
|
+
|
|
157
|
+
expect(JSON_MsgSubverseInfo_expanse.validate(json)).toBe(true);
|
|
158
|
+
});
|
|
130
159
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
160
|
+
it("raw DCL", function () {
|
|
161
|
+
const json = {
|
|
162
|
+
"id": "02f5e7b0-140c-496d-a3b5-4fd4023a5e94",
|
|
163
|
+
"referer": [
|
|
164
|
+
"subverse-protocol-map",
|
|
165
|
+
"c8961cab-1aeb-4d9e-9cf2-ce94e6b3ef7f"
|
|
166
|
+
],
|
|
167
|
+
"dt": "2025-03-05T07:52:01.212Z",
|
|
168
|
+
"expanse": {
|
|
169
|
+
"subverse": {
|
|
170
|
+
"name": "Decentraland",
|
|
171
|
+
"uri": "https://genesis.city",
|
|
172
|
+
"favicon": "https://cryptologos.cc/logos/decentraland-mana-logo.png",
|
|
173
|
+
"map-uri": "https://genesis.city"
|
|
174
|
+
},
|
|
175
|
+
"protocols": [
|
|
176
|
+
{
|
|
177
|
+
"id" : "",
|
|
178
|
+
"name": "Ethereum",
|
|
179
|
+
"attr": "0rw"
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
},
|
|
183
|
+
"_msg": {
|
|
184
|
+
"id": "611aeb54-9d2c-4dd9-9a39-e5d95627cc82",
|
|
185
|
+
"referer": [
|
|
186
|
+
"subverse-protocol-map",
|
|
187
|
+
"c8961cab-1aeb-4d9e-9cf2-ce94e6b3ef7f"
|
|
188
|
+
],
|
|
189
|
+
"dt": "2025-03-05T07:52:01.209Z",
|
|
190
|
+
"query": {
|
|
191
|
+
"name": "discovery-expanse",
|
|
192
|
+
"graphql": "query { expanse { name map logo(width: 200, height: 200) { link } platforms { name archs agents } protocols { name attr } } }",
|
|
193
|
+
"ttl_msec": 5000
|
|
194
|
+
},
|
|
195
|
+
"subverse_info": kstr_VERSION
|
|
196
|
+
},
|
|
197
|
+
"subverse_info": kstr_VERSION
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
expect(JSON_MsgSubverseInfo_expanse.validate(json)).toBe(true);
|
|
134
201
|
});
|
|
202
|
+
|
|
135
203
|
});
|
|
136
204
|
|
|
205
|
+
|
|
137
206
|
/*
|
|
138
207
|
describe("Validation", function () {
|
|
139
208
|
it("JSON_MsgDiscovery.validate(json_msgDiscovery)", function () {
|
|
@@ -333,14 +402,14 @@ const json_instance_ = {
|
|
|
333
402
|
"expanse" : {
|
|
334
403
|
instances : [
|
|
335
404
|
{
|
|
336
|
-
name : "",
|
|
337
405
|
uri : "",
|
|
406
|
+
name : "",
|
|
338
407
|
favicon : "",
|
|
339
408
|
info : {}
|
|
340
409
|
},
|
|
341
410
|
{
|
|
342
|
-
name : "",
|
|
343
411
|
uri : "",
|
|
412
|
+
name : "",
|
|
344
413
|
},
|
|
345
414
|
],
|
|
346
415
|
subverse : {
|
|
@@ -365,13 +434,14 @@ describe("Validation", function () {
|
|
|
365
434
|
});
|
|
366
435
|
});
|
|
367
436
|
|
|
368
|
-
describe("Validation", function () {
|
|
369
|
-
it("JSON_instances.validate(json_instance_)", function () {
|
|
370
|
-
expect(JSON_instances.validate(json_instance_)).toBe(true);
|
|
371
|
-
});
|
|
372
|
-
});
|
|
373
437
|
*/
|
|
374
438
|
|
|
439
|
+
// describe("Validation", function () {
|
|
440
|
+
// it("JSON_MsgSubverseInfo_expanse.validate(json_instance_)", function () {
|
|
441
|
+
// expect(JSON_MsgSubverseInfo_expanse.validate(json_instance_)).toBe(true);
|
|
442
|
+
// });
|
|
443
|
+
// });
|
|
444
|
+
|
|
375
445
|
//-------------------------------------------------------------------------------------------------
|
|
376
446
|
|
|
377
447
|
|