@rootintf/protocol-subverseinfo 0.1.3-api-0.2 → 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.
@@ -13,25 +13,52 @@ Object.defineProperty(globalThis, 'crypto', {
13
13
  // import { JSON_Msg, JSON_Msg_msg } from '@rootintf/json-msg';
14
14
  import {
15
15
  JSON_MsgSubverseInfo_query,
16
- JSON_MsgSubverseInfo_expanse,
16
+ JSON_MsgSubverseInfo_expanse,
17
+ l as l_
17
18
  } from '../src/subverseinfo.mjs';
18
19
 
19
- const kstr_VERSION = "0.2"
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 json_msgSubverseInfo_query_merge = JSON_MsgSubverseInfo_query.merge({
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",
24
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
- json_msgSubverseInfo_query_merge.referer = [ "karr_referer", "" ];
43
+ "subverse_info": kstr_VERSION
44
+ }
31
45
 
32
- describe("Validation", function () {
33
- it("JSON_MsgSubverseInfo_discovery.validate(json_msgSubverseInfo_query_merge)", function () {
34
- expect(JSON_MsgSubverseInfo_query.validate(json_msgSubverseInfo_query_merge)).toBe(true);
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
 
@@ -68,80 +95,114 @@ describe("Validation", function () {
68
95
  // "_v" : kstr_VERSION
69
96
  // }
70
97
 
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
- instances : [
79
- {
80
- name : "",
81
- uri : "",
82
- favicon : "",
83
- "warp-url" : ""
84
- }
85
- ]
86
- },
87
- protocols: [
88
- { name: "Second Life protocol", attr: "0r" }
89
- ]
90
- }
91
- });
92
- json_SubverseInfo_expanse_OpenSim.referer = [ "karr_referer", "" ];
98
+
93
99
  // console.log('json_msgAnnouncement_OpenSim', json_msgAnnouncement_OpenSim)
94
100
 
95
- describe("Validation", function () {
96
- it("JSON_MsgSubverseInfo_expanse.validate(json_SubverseInfo_expanse_OpenSim)", function () {
97
- expect(JSON_MsgSubverseInfo_expanse.validate(json_SubverseInfo_expanse_OpenSim)).toBe(true);
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);
98
120
  });
99
- });
100
121
 
101
- const json_msgSubverseInfo_expanse_DCL = {
102
- "id": "02f5e7b0-140c-496d-a3b5-4fd4023a5e94",
103
- "referer": [
104
- "subverse-protocol-map",
105
- "c8961cab-1aeb-4d9e-9cf2-ce94e6b3ef7f"
106
- ],
107
- "dt": "2025-03-05T07:52:01.212Z",
108
- "expanse": {
109
- "subverse": {
110
- "name": "Decentraland",
111
- "uri": "https://genesis.city",
112
- "favicon": "https://cryptologos.cc/logos/decentraland-mana-logo.png",
113
- "map-url": "https://genesis.city"
114
- },
115
- "protocols": [
116
- {
117
- "name": "Ethereum",
118
- "attr": "0rw"
119
- }
120
- ]
121
- },
122
- "_msg": {
123
- "id": "611aeb54-9d2c-4dd9-9a39-e5d95627cc82",
124
- "referer": [
125
- "subverse-protocol-map",
126
- "c8961cab-1aeb-4d9e-9cf2-ce94e6b3ef7f"
127
- ],
128
- "dt": "2025-03-05T07:52:01.209Z",
129
- "query": {
130
- "name": "discovery-expanse",
131
- "graphql": "query { expanse { name map logo(width: 200, height: 200) { link } platforms { name archs agents } protocols { name attr } } }",
132
- "ttl_msec": 5000
133
- },
134
- "_v": "0.8"
135
- },
136
- "subverse_info": "0.2"
137
- }
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
+ });
138
159
 
139
- describe("Validation", function () {
140
- it("JSON_MsgSubverseInfo_expanse.validate(json_msgSubverseInfo_expanse_DCL)", function () {
141
- expect(JSON_MsgSubverseInfo_expanse.validate(json_msgSubverseInfo_expanse_DCL)).toBe(true);
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);
142
201
  });
202
+
143
203
  });
144
204
 
205
+
145
206
  /*
146
207
  describe("Validation", function () {
147
208
  it("JSON_MsgDiscovery.validate(json_msgDiscovery)", function () {
@@ -341,14 +402,14 @@ const json_instance_ = {
341
402
  "expanse" : {
342
403
  instances : [
343
404
  {
344
- name : "",
345
405
  uri : "",
406
+ name : "",
346
407
  favicon : "",
347
408
  info : {}
348
409
  },
349
410
  {
350
- name : "",
351
411
  uri : "",
412
+ name : "",
352
413
  },
353
414
  ],
354
415
  subverse : {
@@ -373,13 +434,14 @@ describe("Validation", function () {
373
434
  });
374
435
  });
375
436
 
376
- describe("Validation", function () {
377
- it("JSON_instances.validate(json_instance_)", function () {
378
- expect(JSON_instances.validate(json_instance_)).toBe(true);
379
- });
380
- });
381
437
  */
382
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
+
383
445
  //-------------------------------------------------------------------------------------------------
384
446
 
385
447