@bsv/overlay-express 0.6.0 → 0.7.1

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsv/overlay-express",
3
- "version": "0.5.2",
3
+ "version": "0.7.0",
4
4
  "type": "commonjs",
5
5
  "description": "BSV Blockchain Overlay Express",
6
6
  "files": [
@@ -18,7 +18,8 @@
18
18
  "build": "tsc -b && tsconfig-to-dual-package tsconfig.cjs.json",
19
19
  "dev": "tsc -b -w",
20
20
  "prepublish": "npm run build",
21
- "doc": "ts2md --inputFilename=mod.ts --outputFilename=API.md --filenameSubstring=API --firstHeadingLevel=1"
21
+ "doc": "ts2md --inputFilename=mod.ts --outputFilename=API.md --filenameSubstring=API --firstHeadingLevel=1",
22
+ "demo": "rm -r dist && npm run build && npx tsx demo-ui.ts"
22
23
  },
23
24
  "repository": {
24
25
  "type": "git",
@@ -50,7 +51,7 @@
50
51
  "dependencies": {
51
52
  "@bsv/overlay": "^0.4.0",
52
53
  "@bsv/overlay-discovery-services": "^1.3.1",
53
- "@bsv/sdk": "^1.6.1",
54
+ "@bsv/sdk": "^1.6.8",
54
55
  "body-parser": "^1.20.3",
55
56
  "chalk": "^5.3.0",
56
57
  "express": "^4.21.1",
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = `\`
4
+ # General Guide
5
+
6
+ ## Topic Managers
7
+
8
+ A Topic Manager controls addition and removal of transaction outputs to an Overlay Topic. It processes transaction by exposing a /submit endpoint, request should looks something like:
9
+
10
+ ### [POST] /submit
11
+
12
+ #### Request Headers
13
+ \\\`\\\`\\\`json
14
+ {
15
+ "x-topics": "[\"tm_messagebox\"]", // array of topic identifiers as stringified JSON
16
+ "x-includes-off-chain-values": "false" // string "true" or "false"
17
+ }
18
+ \\\`\\\`\\\`
19
+
20
+ #### Request Body
21
+ \\\`\\\`\\\`json
22
+ [1,1,1,1... ], // transaction in atomic BEEF format as Uint8Array
23
+ \\\`\\\`\\\`
24
+
25
+ The engine processes this TaggedBEEF and generates a STEAK (Submitted Transaction Execution AcKnowledgment), which is returned to the client.
26
+
27
+ #### Response Body
28
+ \\\`\\\`\\\`json
29
+ {
30
+ "tm_messagebox": {
31
+ "outputsToAdmit": [0], // which of the outputs in the BEEF to admit
32
+ "coinsToRetain": [], // which of the inputs in the BEEF to mark spent but keep within the Topic
33
+ "coinsRemoved": [], // which of the inputs in the BEEF to remove from the Topic
34
+ },
35
+ ... // per topic
36
+ }
37
+ \\\`\\\`\\\`
38
+
39
+ <br />
40
+
41
+ ## Lookup Services
42
+
43
+ A Lookup Service is a component that enables data retrieval from the Overlay Services ecosystem. It allows clients to search and retrieve transactions that were previously submitted to Topic Managers, using specific criteria or identifiers.
44
+
45
+ ### [POST] /lookup
46
+
47
+ #### Request Body
48
+ \\\`\\\`\\\`json
49
+ {
50
+ "service": "ls_messagebox", // Lookup Service identifier as string,
51
+ "query": "findAll" // query must be a string, JSON queries should be stringified
52
+ }
53
+ \\\`\\\`\\\`
54
+
55
+ #### Response Body
56
+ \\\`\\\`\\\`json
57
+ {
58
+ "type": "output-list",
59
+ "outputs": [{
60
+ "beef": [1, 1, 1...], // number[]
61
+ "outputIndex": 0, // number
62
+ "context"?: [1, 1, 1...], // number[]
63
+ }>]
64
+ }
65
+ \\\`\\\`\\\`
66
+
67
+ <br />
68
+
69
+ ## Summary
70
+
71
+ Usually Topic Managers and Lookup Services are paired, but they can be separated for greater flexibility. Together, they form a complete system for data submission, organization, and retrieval within the Overlay Services framework.
72
+
73
+ <br />
74
+ <br />
75
+ \`
76
+ `;
77
+ //# sourceMappingURL=generalGuide.md.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generalGuide.md.js","sourceRoot":"","sources":["../../../src/generalGuide.md.ts"],"names":[],"mappings":";;AAAA,kBAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyEd,CAAC"}
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const generalGuide_md_js_1 = __importDefault(require("./generalGuide.md.js"));
3
7
  exports.default = (config = {}) => {
4
- const { faviconUrl = 'https://bsvblockchain.org/favicon.ico', backgroundColor = '#282E33', primaryColor = '#B6C2CF', secondaryColor = '#579DFF', fontFamily = 'Arial, sans-serif', headingFontFamily = 'Arial Black, Gadget, sans-serif', additionalStyles = '', sectionBackgroundColor = '#323940', linkColor = '#579DFF', hoverColor = '#3A4147', borderColor = '#B6C2CF', } = config;
8
+ const { host = '', faviconUrl = 'https://bsvblockchain.org/favicon.ico', backgroundColor = '#191919', primaryTextColor = '#f0f0f0', primaryColor = '#3b6efb', secondaryColor = '#001242', fontFamily = 'Helvetica, Arial, sans-serif', headingFontFamily = 'Helvetica, Arial, sans-serif', additionalStyles = '', sectionBackgroundColor = '#323940', linkColor = '#579DFF', hoverColor = '#3A4147', borderColor = '#B6C2CF', secondaryBackgroundColor = '#f8f8f8', secondaryTextColor = '#0e0e0e', defaultContent = generalGuide_md_js_1.default } = config;
5
9
  return `<!DOCTYPE html>
6
10
  <html>
7
11
  <head>
@@ -20,6 +24,9 @@ exports.default = (config = {}) => {
20
24
  --link-color: ${linkColor};
21
25
  --hover-color: ${hoverColor};
22
26
  --border-color: ${borderColor};
27
+ --secondary-background-color: ${secondaryBackgroundColor};
28
+ --secondary-text-color: ${secondaryTextColor};
29
+ --primary-text-color: ${primaryTextColor};
23
30
  }
24
31
 
25
32
  body {
@@ -27,13 +34,24 @@ exports.default = (config = {}) => {
27
34
  background-color: var(--background-color);
28
35
  margin: 0;
29
36
  padding: 0;
30
- color: var(--primary-color);
37
+ color: var(--primary-text-color);
31
38
  }
32
39
 
33
40
  h1, h2, h3 {
34
41
  font-family: var(--heading-font-family);
35
42
  }
36
43
 
44
+ p {
45
+ line-height: 1.5;
46
+ }
47
+
48
+ .welcome {
49
+ background-clip: text;
50
+ color: transparent;
51
+ background-image: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
52
+ cursor: pointer;
53
+ }
54
+
37
55
  a {
38
56
  color: var(--link-color);
39
57
  text-decoration: none;
@@ -50,69 +68,57 @@ exports.default = (config = {}) => {
50
68
  overflow: hidden;
51
69
  }
52
70
 
53
- .column_left, .column_right {
71
+ .column_right {
54
72
  padding: 1.5em;
55
73
  overflow-y: auto;
56
74
  }
57
75
 
58
76
  .column_left {
59
- width: 35%;
60
- background-color: var(--section-background-color);
77
+ padding: 15px 15px 15px 35px;
78
+ overflow-y: auto;
79
+ width: 360px;
80
+ background-color: var(--secondary-background-color);
81
+ color: var(--secondary-text-color);
61
82
  }
62
83
 
63
84
  .column_right {
64
- width: 65%;
65
- border-left: 1px solid var(--border-color);
85
+ width: calc(100% - 360px);
66
86
  }
67
87
 
68
- .docs_heading {
69
- text-align: center;
70
- padding-bottom: 0.5em;
71
- border-bottom: 1px solid var(--border-color);
88
+ #documentation_container {
89
+ padding: 0 8em;
90
+ margin: 0;
72
91
  }
73
92
 
74
93
  /* List styles */
75
94
  .list-item {
76
- display: flex;
77
- align-items: center;
78
- margin: 0.5em 0;
95
+ margin: 0;
79
96
  }
80
97
 
81
98
  .list-item a {
82
- display: flex;
83
- align-items: center;
99
+ display: block;
84
100
  width: 100%;
85
- padding: 0.5em;
101
+ padding: 0.5em 0.75em;
86
102
  background-color: transparent;
87
103
  border-radius: 5px;
88
104
  transition: background-color 0.3s;
89
105
  text-decoration: none;
90
106
  color: inherit;
91
- }
92
-
93
- .list-item a:hover {
94
- background-color: var(--hover-color);
107
+ font-weight: 500;
95
108
  cursor: pointer;
96
109
  }
97
110
 
98
- .list-icon {
99
- width: 40px;
100
- height: 40px;
101
- margin-right: 1em;
102
- }
103
-
104
- .list-text {
105
- display: flex;
106
- flex-direction: column;
107
- }
108
-
109
- .list-title {
110
- font-weight: bold;
111
+ .list-item a:hover, .list-item a.active {
112
+ background: var(--primary-color) linear-gradient(90deg, var(--primary-color), var(--secondary-color));
113
+ color: white;
114
+ cursor: pointer;
115
+ border-radius: 8px 0 0 8px;
111
116
  }
112
-
113
- .list-description {
114
- font-size: 0.9em;
115
- color: var(--secondary-color);
117
+
118
+ ul#manager_list, ul#provider_list, ul#external_list {
119
+ list-style-type: none;
120
+ padding-left: 0;
121
+ margin-top: 0.5em;
116
122
  }
117
123
 
118
124
  /* Detail styles */
@@ -145,41 +151,186 @@ exports.default = (config = {}) => {
145
151
  color: var(--link-color);
146
152
  }
147
153
 
154
+ /* Code highlighting styles */
155
+ pre {
156
+ position: relative;
157
+ padding: 1em;
158
+ border-radius: 5px;
159
+ overflow: auto;
160
+ background-color: #282c34;
161
+ margin: 1em 0;
162
+ }
163
+
164
+ pre[data-language]:before {
165
+ content: attr(data-language);
166
+ position: absolute;
167
+ top: 0;
168
+ right: 0;
169
+ padding: 0.25em 0.5em;
170
+ font-size: 0.75em;
171
+ color: #abb2bf;
172
+ background-color: #3e4451;
173
+ border-radius: 0 0 0 4px;
174
+ text-transform: uppercase;
175
+ }
176
+
177
+ code {
178
+ font-family: Menlo, Monaco, 'Courier New', monospace;
179
+ font-size: 0.9em;
180
+ }
181
+
182
+ /* Inline code */
183
+ p code, li code {
184
+ background-color: #3e4451;
185
+ padding: 0.2em 0.4em;
186
+ border-radius: 3px;
187
+ white-space: nowrap;
188
+ }
189
+
148
190
  /* Responsive design */
149
191
  @media screen and (max-width: 850px) {
150
192
  .main {
151
193
  flex-direction: column;
152
194
  }
153
195
 
196
+ .column_left {
197
+ max-height: 30vh;
198
+ }
199
+
154
200
  .column_left, .column_right {
155
- width: 100%;
201
+ width: 90%;
202
+ margin: 0;
203
+ padding: 0 5%;
156
204
  }
157
205
 
158
- .column_right {
159
- border-left: none;
160
- border-top: 1px solid var(--border-color);
206
+ #documentation_container {
207
+ margin: 0;
208
+ padding: 0;
161
209
  }
162
210
  }
163
211
 
164
212
  ${additionalStyles}
165
213
  </style>
166
214
  <script src="https://cdn.jsdelivr.net/npm/showdown@2.0.3/dist/showdown.min.js"></script>
215
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.7.0/build/styles/atom-one-dark.min.css">
216
+ <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.7.0/build/highlight.min.js"></script>
167
217
  <script>
168
218
  const faviconUrl = '${faviconUrl}';
169
219
 
170
220
  const showdown = window.showdown;
221
+ window.hljs.configure({ languages: ['typescript', 'javascript', 'json', 'html', 'css', 'bash', 'markdown'] });
222
+
171
223
 
172
224
  const Convert = (md) => {
173
- let converter = new showdown.Converter();
174
- return converter.makeHtml(md);
225
+ let converter = new showdown.Converter({
226
+ ghCompatibleHeaderId: true,
227
+ simpleLineBreaks: true,
228
+ ghMentions: true,
229
+ tables: true,
230
+ tasklists: true,
231
+ strikethrough: true,
232
+ parseImgDimensions: true,
233
+ simplifiedAutoLink: true
234
+ });
235
+ // Set to use GitHub flavor markdown
236
+ converter.setFlavor('github');
237
+
238
+ // Set language detection for code blocks
239
+ converter.setOption('ghCodeBlocks', true);
240
+ converter.setOption('omitExtraWLInCodeBlocks', true);
241
+ converter.setOption('literalMidWordUnderscores', true);
242
+ converter.setOption('parseImgDimensions', true);
243
+
244
+ // Add custom extension for adding language-specific class to code blocks
245
+ const codeExtension = () => [
246
+ {
247
+ type: 'output',
248
+ filter: function(text) {
249
+ return text.replace(/<pre><code\s*class="([^"]*)">(.*?)<\\/code><\\/pre>/gs, function(match, language, content) {
250
+ if (language) {
251
+ // Clean up the language identifier
252
+ const lang = language.replace('language-', '').trim();
253
+ return \`<pre data-language="\${lang}"><code class="language-\${lang} hljs">\${content}</code></pre>\`;
254
+ } else {
255
+ return \`<pre><code class="hljs">\${content}</code></pre>\`;
256
+ }
257
+ });
258
+ }
259
+ }
260
+ ];
261
+
262
+ // Add the extension
263
+ converter.addExtension(codeExtension());
264
+ const html = converter.makeHtml(md);
265
+
266
+ return html;
267
+ };
268
+
269
+ window.returnHome = () => {
270
+ if (!window.defaultHtml) {
271
+ let newStuff = Convert(${defaultContent});
272
+ window.defaultHtml = newStuff;
273
+ }
274
+ document.getElementById('documentation_container').innerHTML = window.defaultHtml;
275
+ window.location.hash = '';
276
+ document.querySelectorAll('.list-item a').forEach(item => {
277
+ item.classList.remove('active');
278
+ });
279
+ };
280
+
281
+ // Function to apply syntax highlighting after content is inserted
282
+ const applyHighlighting = () => {
283
+ document.querySelectorAll('pre code').forEach(block => {
284
+ const blockElement = block;
285
+
286
+ // Check for language class
287
+ const classList = Array.from(blockElement.classList);
288
+ const langClass = classList.find(cls => cls.startsWith('language-'));
289
+
290
+ if (langClass) {
291
+ const language = langClass.replace('language-', '');
292
+ // Set language label on the parent pre element
293
+ const preElement = blockElement.parentElement;
294
+ if (preElement) {
295
+ preElement.setAttribute('data-language', language);
296
+ }
297
+ }
298
+
299
+ // Apply highlighting to all code blocks
300
+ try {
301
+ // @ts-ignore - hljs is loaded from CDN
302
+ window.hljs.highlightElement(blockElement);
303
+ } catch (e) {
304
+ console.error('Error highlighting code:', e);
305
+ }
306
+ });
175
307
  };
176
308
 
177
309
  let managersData = {};
178
310
  let providersData = {};
179
311
 
312
+ // Function to update URL hash and highlight selected item
313
+ const updateSelectedItem = (type, id) => {
314
+ // Update URL hash
315
+ window.location.hash = \`\${type}/\${id}\`;
316
+
317
+ // Remove active class from all list items
318
+ document.querySelectorAll('.list-item a').forEach(item => {
319
+ item.classList.remove('active');
320
+ });
321
+
322
+ // Add active class to selected item
323
+ const selector = \`[data-\${type}="\${id}"]\`;
324
+ const selectedItem = document.querySelector(selector);
325
+ if (selectedItem) {
326
+ selectedItem.classList.add('active');
327
+ }
328
+ };
329
+
330
+ // @ts-ignore - Adding custom property to window
180
331
  window.managerDocumentation = async (manager) => {
181
332
  try {
182
- let res = await fetch(\`/getDocumentationForTopicManager?manager=\${manager}\`);
333
+ let res = await fetch(\`${host}/getDocumentationForTopicManager?manager=\${manager}\`);
183
334
  let docs = await res.text();
184
335
  let managerReadme = Convert(docs);
185
336
 
@@ -187,25 +338,19 @@ exports.default = (config = {}) => {
187
338
  let iconURL = managerData.iconURL || faviconUrl;
188
339
 
189
340
  document.getElementById('documentation_container').innerHTML = managerReadme;
190
- document.getElementById('documentation_title').innerHTML = \`
191
- <div class="detail-header">
192
- <img src="\${iconURL}" alt="icon" class="detail-icon">
193
- <div class="detail-text">
194
- <h1 class="detail-title">\${managerData.name}</h1>
195
- <p class="detail-description">\${managerData.shortDescription || ''}</p>
196
- \${managerData.version ? '<p class="detail-version">Version: ' + managerData.version + '</p>' : ''}
197
- \${managerData.informationURL ? '<p class="detail-info"><a href="' + managerData.informationURL + '" target="_blank">More Information</a></p>' : ''}
198
- </div>
199
- </div>
200
- \`;
341
+ applyHighlighting();
342
+
343
+ // Update active item and URL
344
+ updateSelectedItem('manager', manager);
201
345
  } catch (error) {
202
346
  console.error('Error fetching manager documentation:', error);
203
347
  }
204
348
  };
205
349
 
350
+ // @ts-ignore - Adding custom property to window
206
351
  window.topicDocumentation = async (provider) => {
207
352
  try {
208
- let res = await fetch(\`/getDocumentationForLookupServiceProvider?lookupService=\${provider}\`);
353
+ let res = await fetch(\`${host}/getDocumentationForLookupServiceProvider?lookupService=\${provider}\`);
209
354
  let docs = await res.text();
210
355
  let providerReadme = Convert(docs);
211
356
 
@@ -213,81 +358,127 @@ exports.default = (config = {}) => {
213
358
  let iconURL = providerData.iconURL || faviconUrl;
214
359
 
215
360
  document.getElementById('documentation_container').innerHTML = providerReadme;
216
- document.getElementById('documentation_title').innerHTML = \`
217
- <div class="detail-header">
218
- <img src="\${iconURL}" alt="icon" class="detail-icon">
219
- <div class="detail-text">
220
- <h1 class="detail-title">\${providerData.name}</h1>
221
- <p class="detail-description">\${providerData.shortDescription || ''}</p>
222
- \${providerData.version ? '<p class="detail-version">Version: ' + providerData.version + '</p>' : ''}
223
- \${providerData.informationURL ? '<p class="detail-info"><a href="' + providerData.informationURL + '" target="_blank">More Information</a></p>' : ''}
224
- </div>
225
- </div>
226
- \`;
361
+ applyHighlighting();
362
+
363
+ // Update active item and URL
364
+ updateSelectedItem('provider', provider);
227
365
  } catch (error) {
228
366
  console.error('Error fetching provider documentation:', error);
229
367
  }
230
368
  };
231
369
 
370
+ // Function to parse hash and load appropriate content
371
+ const handleUrlHash = () => {
372
+ const hash = window.location.hash.substring(1); // Remove the # character
373
+ if (hash) {
374
+ const [type, id] = hash.split('/');
375
+ if (type && id) {
376
+ if (type === 'manager') {
377
+ // Check if managers data is loaded
378
+ if (Object.keys(managersData).length > 0 && managersData[id]) {
379
+ window.managerDocumentation(id);
380
+ }
381
+ } else if (type === 'provider') {
382
+ // Check if providers data is loaded
383
+ if (Object.keys(providersData).length > 0 && providersData[id]) {
384
+ window.topicDocumentation(id);
385
+ }
386
+ }
387
+ }
388
+ }
389
+ };
390
+
232
391
  document.addEventListener('DOMContentLoaded', () => {
233
- fetch('/listTopicManagers')
392
+ let managersLoaded = false;
393
+ let providersLoaded = false;
394
+
395
+ // Check if both managers and providers are loaded before handling hash
396
+ const checkAllLoaded = () => {
397
+ if (managersLoaded && providersLoaded) {
398
+ handleUrlHash();
399
+ }
400
+ };
401
+
402
+ fetch('${host}/listTopicManagers')
234
403
  .then(res => res.json())
235
404
  .then(managers => {
236
405
  managersData = managers;
237
406
  const managerList = document.getElementById('manager_list');
238
407
  Object.keys(managers).forEach(manager => {
239
408
  let managerData = managers[manager];
240
- let iconURL = managerData.iconURL || faviconUrl;
241
409
  let li = document.createElement('li');
242
410
  li.className = 'list-item';
243
411
  li.innerHTML = \`
244
- <a onclick="window.managerDocumentation('\${manager}')">
245
- <img src="\${iconURL}" alt="icon" class="list-icon">
246
- <div class="list-text">
247
- <span class="list-title">\${managerData.name}</span>
248
- <span class="list-description">\${managerData.shortDescription || ''}</span>
249
- </div>
412
+ <a data-manager="\${manager}" onclick="window.managerDocumentation('\${manager}')">
413
+ \${managerData.name}
250
414
  </a>
251
415
  \`;
252
416
  managerList.appendChild(li);
253
417
  });
418
+ managersLoaded = true;
419
+ checkAllLoaded();
254
420
  })
255
421
  .catch(() => {
256
422
  let message = document.createElement('h4');
257
423
  message.innerText = 'Something went wrong!';
258
424
  manager_list.insertBefore(message, manager_list.children[0]);
425
+ managersLoaded = true;
426
+ checkAllLoaded();
259
427
  });
260
428
 
261
- fetch('/listLookupServiceProviders')
429
+ fetch('${host}/listLookupServiceProviders')
262
430
  .then(res => res.json())
263
431
  .then(providers => {
264
432
  providersData = providers;
265
433
  const providerList = document.getElementById('provider_list');
266
434
  Object.keys(providers).forEach(provider => {
267
435
  let providerData = providers[provider];
268
- let iconURL = providerData.iconURL || faviconUrl;
269
436
  let li = document.createElement('li');
270
437
  li.className = 'list-item';
271
438
  li.innerHTML = \`
272
- <a onclick="window.topicDocumentation('\${provider}')">
273
- <img src="\${iconURL}" alt="icon" class="list-icon">
274
- <div class="list-text">
275
- <span class="list-title">\${providerData.name}</span>
276
- <span class="list-description">\${providerData.shortDescription || ''}</span>
277
- </div>
439
+ <a data-provider="\${provider}" onclick="window.topicDocumentation('\${provider}')">
440
+ \${providerData.name}
278
441
  </a>
279
442
  \`;
280
443
  providerList.appendChild(li);
281
444
  });
445
+ providersLoaded = true;
446
+ checkAllLoaded();
282
447
  })
283
448
  .catch(() => {
284
449
  let message = document.createElement('h4');
285
450
  message.innerText = 'Something went wrong!';
286
451
  provider_list.insertBefore(message, provider_list.children[0]);
452
+ providersLoaded = true;
453
+ checkAllLoaded();
287
454
  });
288
455
 
289
- // Display default message when no manager or provider is selected
290
- document.getElementById('documentation_container').innerHTML = '<p>Please select a manager or service from the left to see details.</p>';
456
+ // Check URL hash to see if we should load specific documentation
457
+ const checkUrlHash = () => {
458
+ const hash = window.location.hash.substring(1); // Remove the # symbol
459
+ if (hash) {
460
+ const parts = hash.split('/');
461
+ if (parts.length === 2) {
462
+ const type = parts[0];
463
+ const id = parts[1];
464
+
465
+ if (type === 'manager' && id && managersData[id]) {
466
+ window.managerDocumentation(id);
467
+ } else if (type === 'provider' && id && providersData[id]) {
468
+ window.topicDocumentation(id);
469
+ }
470
+ }
471
+ } else {
472
+ // Display default message when no manager or provider is selected
473
+ returnHome();
474
+ }
475
+ };
476
+
477
+ // Listen for hash changes
478
+ window.addEventListener('hashchange', checkUrlHash);
479
+
480
+ // Check hash on initial page load
481
+ checkUrlHash();
291
482
  });
292
483
  </script>
293
484
  </head>
@@ -296,22 +487,27 @@ exports.default = (config = {}) => {
296
487
  <div class="main">
297
488
  <div class="column_left">
298
489
  <div class="page_head">
299
- <h1>Welcome to Overlay Services</h1>
300
- <p>Learn more on <a href="https://github.com/bitcoin-sv/overlay-services" target="_blank">GitHub</a></p>
490
+ <h1 class="welcome" onclick="window.returnHome()">Overlay Services</h1>
301
491
  </div>
302
492
  <div class="topic_container">
303
- <h2>Endpoint Documentation:</h2>
304
- <h3>Supported Topic Managers:</h3>
493
+ <h3>Topic Managers</h3>
305
494
  <ul id="manager_list"></ul>
306
495
  </div>
307
496
  <div class="provider_container">
308
- <h3>Supported Lookup Service Providers:</h3>
497
+ <h3>Lookup Services</h3>
309
498
  <ul id="provider_list"></ul>
310
499
  </div>
500
+ <div>
501
+ <h3>External Links</h3>
502
+ <ul id="external_list">
503
+ <li class="list-item"><a href="https://github.com/bsv-blockchain/overlay-services" target="_blank">Overlay Services GitHub</a></li>
504
+ <li class="list-item"><a href="https://bsv.brc.dev/overlays/0088" target="_blank">BRC-88 GASP</a></li>
505
+ <li class="list-item"><a href="https://fast.brc.dev" target="_blank">Quick Start for App Developers</a></li>
506
+ </ul>
507
+ </div>
311
508
  </div>
312
509
  <div class="column_right">
313
- <div id="documentation_title"></div>
314
- <div id="documentation_container" style="margin-left: 1.5em"></div>
510
+ <div id="documentation_container"></div>
315
511
  </div>
316
512
  </div>
317
513
  </body>
@@ -1 +1 @@
1
- {"version":3,"file":"makeUserInterface.js","sourceRoot":"","sources":["../../../src/makeUserInterface.ts"],"names":[],"mappings":";;AAcA,kBAAe,CAAC,SAAmB,EAAE,EAAU,EAAE;IAC/C,MAAM,EACJ,UAAU,GAAG,uCAAuC,EACpD,eAAe,GAAG,SAAS,EAC3B,YAAY,GAAG,SAAS,EACxB,cAAc,GAAG,SAAS,EAC1B,UAAU,GAAG,mBAAmB,EAChC,iBAAiB,GAAG,iCAAiC,EACrD,gBAAgB,GAAG,EAAE,EACrB,sBAAsB,GAAG,SAAS,EAClC,SAAS,GAAG,SAAS,EACrB,UAAU,GAAG,SAAS,EACtB,WAAW,GAAG,SAAS,GACxB,GAAG,MAAM,CAAC;IAEX,OAAO;;;;;;+CAMsC,UAAU;;;4BAG7B,eAAe;yBAClB,YAAY;2BACV,cAAc;uBAClB,UAAU;+BACF,iBAAiB;oCACZ,sBAAsB;sBACpC,SAAS;uBACR,UAAU;wBACT,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA8I7B,gBAAgB;;;;0BAII,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAsJ5B,CAAC;AACT,CAAC,CAAC"}
1
+ {"version":3,"file":"makeUserInterface.js","sourceRoot":"","sources":["../../../src/makeUserInterface.ts"],"names":[],"mappings":";;;;;AAAA,8EAA+C;AAqB/C,kBAAe,CAAC,SAAmB,EAAE,EAAU,EAAE;IAC/C,MAAM,EACJ,IAAI,GAAG,EAAE,EACT,UAAU,GAAG,uCAAuC,EACpD,eAAe,GAAG,SAAS,EAC3B,gBAAgB,GAAG,SAAS,EAC5B,YAAY,GAAG,SAAS,EACxB,cAAc,GAAG,SAAS,EAC1B,UAAU,GAAG,8BAA8B,EAC3C,iBAAiB,GAAG,8BAA8B,EAClD,gBAAgB,GAAG,EAAE,EACrB,sBAAsB,GAAG,SAAS,EAClC,SAAS,GAAG,SAAS,EACrB,UAAU,GAAG,SAAS,EACtB,WAAW,GAAG,SAAS,EACvB,wBAAwB,GAAG,SAAS,EACpC,kBAAkB,GAAG,SAAS,EAC9B,cAAc,GAAG,4BAAY,EAC9B,GAAG,MAAM,CAAC;IAEX,OAAO;;;;;;+CAMsC,UAAU;;;4BAG7B,eAAe;yBAClB,YAAY;2BACV,cAAc;uBAClB,UAAU;+BACF,iBAAiB;oCACZ,sBAAsB;sBACpC,SAAS;uBACR,UAAU;wBACT,WAAW;sCACG,wBAAwB;gCAC9B,kBAAkB;8BACpB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAuLxC,gBAAgB;;;;;;0BAMI,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAqDH,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCA8Db,IAAI;;;;;;;;;;;;;;;;;;;;kCAoBJ,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAiDvB,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;eA2BJ,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAqFX,CAAC;AACT,CAAC,CAAC"}