@dudousxd/nestjs-telescope-ui 4.2.0 → 4.3.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.
Files changed (170) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +6 -0
  3. package/dist/react/components/batch-timeline.d.ts +1 -1
  4. package/dist/react/components/batch-timeline.d.ts.map +1 -1
  5. package/dist/react/components/cache-badge.d.ts +1 -1
  6. package/dist/react/components/cache-badge.d.ts.map +1 -1
  7. package/dist/react/components/charts/area-chart-card.d.ts +2 -2
  8. package/dist/react/components/charts/area-chart-card.d.ts.map +1 -1
  9. package/dist/react/components/charts/area-chart-card.js +1 -1
  10. package/dist/react/components/charts/bar-chart-card.d.ts +2 -2
  11. package/dist/react/components/charts/bar-chart-card.d.ts.map +1 -1
  12. package/dist/react/components/charts/bar-chart-card.js +1 -1
  13. package/dist/react/components/charts/breakdown-card.d.ts +1 -2
  14. package/dist/react/components/charts/breakdown-card.d.ts.map +1 -1
  15. package/dist/react/components/charts/chart-card.d.ts +2 -2
  16. package/dist/react/components/charts/chart-card.d.ts.map +1 -1
  17. package/dist/react/components/charts/chart-card.js +1 -1
  18. package/dist/react/components/charts/chart-card.js.map +1 -1
  19. package/dist/react/components/charts/chart-theme.d.ts +1 -1
  20. package/dist/react/components/charts/chart-theme.d.ts.map +1 -1
  21. package/dist/react/components/charts/chart-theme.js +1 -1
  22. package/dist/react/components/charts/chart-theme.js.map +1 -1
  23. package/dist/react/components/charts/distribution-chart-card.d.ts +1 -2
  24. package/dist/react/components/charts/distribution-chart-card.d.ts.map +1 -1
  25. package/dist/react/components/charts/distribution-chart-card.js +1 -1
  26. package/dist/react/components/charts/gauge-card.d.ts +1 -2
  27. package/dist/react/components/charts/gauge-card.d.ts.map +1 -1
  28. package/dist/react/components/charts/stacked-area-chart-card.d.ts +2 -2
  29. package/dist/react/components/charts/stacked-area-chart-card.d.ts.map +1 -1
  30. package/dist/react/components/charts/stacked-area-chart-card.js +1 -1
  31. package/dist/react/components/entries-table.d.ts +1 -1
  32. package/dist/react/components/entries-table.d.ts.map +1 -1
  33. package/dist/react/components/entries-table.js +3 -2
  34. package/dist/react/components/entries-table.js.map +1 -1
  35. package/dist/react/components/entry-detail.d.ts +1 -1
  36. package/dist/react/components/entry-detail.d.ts.map +1 -1
  37. package/dist/react/components/entry-detail.js +11 -11
  38. package/dist/react/components/entry-detail.js.map +1 -1
  39. package/dist/react/components/entry-insights.d.ts +1 -1
  40. package/dist/react/components/entry-insights.d.ts.map +1 -1
  41. package/dist/react/components/entry-insights.js +6 -6
  42. package/dist/react/components/entry-insights.js.map +1 -1
  43. package/dist/react/components/export-json-toolbar.d.ts +1 -1
  44. package/dist/react/components/export-json-toolbar.d.ts.map +1 -1
  45. package/dist/react/components/extensions/panel-actions.d.ts +3 -3
  46. package/dist/react/components/extensions/panel-actions.d.ts.map +1 -1
  47. package/dist/react/components/extensions/panel-column-menu.d.ts +1 -2
  48. package/dist/react/components/extensions/panel-column-menu.d.ts.map +1 -1
  49. package/dist/react/components/extensions/panel-renderer.d.ts +1 -2
  50. package/dist/react/components/extensions/panel-renderer.d.ts.map +1 -1
  51. package/dist/react/components/extensions/panel-renderer.js +3 -3
  52. package/dist/react/components/extensions/panel-renderer.js.map +1 -1
  53. package/dist/react/components/extensions/panel-table-header.d.ts +2 -3
  54. package/dist/react/components/extensions/panel-table-header.d.ts.map +1 -1
  55. package/dist/react/components/extensions/panel-table.d.ts +1 -2
  56. package/dist/react/components/extensions/panel-table.d.ts.map +1 -1
  57. package/dist/react/components/extensions/stat-card.d.ts +1 -2
  58. package/dist/react/components/extensions/stat-card.d.ts.map +1 -1
  59. package/dist/react/components/extensions/stat-card.js +2 -2
  60. package/dist/react/components/extensions/stat-card.js.map +1 -1
  61. package/dist/react/components/extensions/table-columns.js +1 -1
  62. package/dist/react/components/extensions/table-columns.js.map +1 -1
  63. package/dist/react/components/flamegraph-view.d.ts +1 -2
  64. package/dist/react/components/flamegraph-view.d.ts.map +1 -1
  65. package/dist/react/components/flamegraph-view.js +1 -1
  66. package/dist/react/components/flamegraph-view.js.map +1 -1
  67. package/dist/react/components/inertia-badge.d.ts +1 -1
  68. package/dist/react/components/inertia-badge.d.ts.map +1 -1
  69. package/dist/react/components/inertia-body.d.ts +1 -1
  70. package/dist/react/components/inertia-body.d.ts.map +1 -1
  71. package/dist/react/components/inertia-body.js +9 -9
  72. package/dist/react/components/inertia-body.js.map +1 -1
  73. package/dist/react/components/official-event.d.ts +1 -1
  74. package/dist/react/components/official-event.d.ts.map +1 -1
  75. package/dist/react/components/official-event.js +1 -1
  76. package/dist/react/components/official-event.js.map +1 -1
  77. package/dist/react/components/pulse-panel.d.ts +1 -1
  78. package/dist/react/components/pulse-panel.d.ts.map +1 -1
  79. package/dist/react/components/pulse-panel.js +2 -2
  80. package/dist/react/components/pulse-panel.js.map +1 -1
  81. package/dist/react/components/queue-sparkline.d.ts +2 -2
  82. package/dist/react/components/queue-sparkline.d.ts.map +1 -1
  83. package/dist/react/components/queue-sparkline.js +1 -1
  84. package/dist/react/components/queue-sparkline.js.map +1 -1
  85. package/dist/react/components/queues/EnqueueJobForm.d.ts +1 -1
  86. package/dist/react/components/queues/EnqueueJobForm.d.ts.map +1 -1
  87. package/dist/react/components/queues/EnqueueJobForm.js +1 -1
  88. package/dist/react/components/queues/EnqueueJobForm.js.map +1 -1
  89. package/dist/react/components/queues/JobActions.d.ts +3 -3
  90. package/dist/react/components/queues/JobActions.d.ts.map +1 -1
  91. package/dist/react/components/queues/JobDetailDrawer.d.ts +1 -1
  92. package/dist/react/components/queues/JobDetailDrawer.d.ts.map +1 -1
  93. package/dist/react/components/queues/JobDetailDrawer.js +4 -4
  94. package/dist/react/components/queues/JobDetailDrawer.js.map +1 -1
  95. package/dist/react/components/queues/JobTable.d.ts +1 -1
  96. package/dist/react/components/queues/JobTable.d.ts.map +1 -1
  97. package/dist/react/components/queues/QueueList.d.ts +1 -1
  98. package/dist/react/components/queues/QueueList.d.ts.map +1 -1
  99. package/dist/react/components/queues/QueueList.js +2 -2
  100. package/dist/react/components/queues/QueueList.js.map +1 -1
  101. package/dist/react/components/queues/QueueStateTabs.d.ts +1 -1
  102. package/dist/react/components/queues/QueueStateTabs.d.ts.map +1 -1
  103. package/dist/react/components/queues-panel.d.ts +1 -1
  104. package/dist/react/components/queues-panel.d.ts.map +1 -1
  105. package/dist/react/components/request-timeline.d.ts +1 -1
  106. package/dist/react/components/request-timeline.d.ts.map +1 -1
  107. package/dist/react/components/retention-indicator.d.ts +1 -1
  108. package/dist/react/components/retention-indicator.d.ts.map +1 -1
  109. package/dist/react/components/retention-indicator.js +1 -1
  110. package/dist/react/components/retention-indicator.js.map +1 -1
  111. package/dist/react/components/sparkline.d.ts +1 -1
  112. package/dist/react/components/sparkline.d.ts.map +1 -1
  113. package/dist/react/components/stacked-bars.d.ts +1 -1
  114. package/dist/react/components/stacked-bars.d.ts.map +1 -1
  115. package/dist/react/components/tag-autocomplete.d.ts +1 -1
  116. package/dist/react/components/tag-autocomplete.d.ts.map +1 -1
  117. package/dist/react/components/waterfall-view.d.ts +1 -1
  118. package/dist/react/components/waterfall-view.d.ts.map +1 -1
  119. package/dist/react/components/waterfall-view.js +1 -1
  120. package/dist/react/components/waterfall-view.js.map +1 -1
  121. package/dist/react/components/window-select.d.ts +1 -1
  122. package/dist/react/components/window-select.d.ts.map +1 -1
  123. package/dist/react/telescope-context.d.ts +1 -1
  124. package/dist/react/telescope-context.d.ts.map +1 -1
  125. package/dist/react/ui/badge.d.ts +1 -1
  126. package/dist/react/ui/badge.d.ts.map +1 -1
  127. package/dist/react/ui/chart.d.ts +5 -5
  128. package/dist/react/ui/chart.d.ts.map +1 -1
  129. package/dist/react/ui/chart.js +2 -2
  130. package/dist/react/ui/chart.js.map +1 -1
  131. package/dist/react/ui/select.d.ts.map +1 -1
  132. package/dist/react/ui/select.js +1 -1
  133. package/dist/react/ui/select.js.map +1 -1
  134. package/dist/react/ui/table.js +1 -1
  135. package/dist/react/ui/table.js.map +1 -1
  136. package/dist/server/console-shell.d.ts +53 -0
  137. package/dist/server/console-shell.d.ts.map +1 -0
  138. package/dist/server/console-shell.js +130 -0
  139. package/dist/server/console-shell.js.map +1 -0
  140. package/dist/server/index.d.ts +1 -0
  141. package/dist/server/index.d.ts.map +1 -1
  142. package/dist/server/index.js +2 -0
  143. package/dist/server/index.js.map +1 -1
  144. package/dist/server/telescope-ui.controller.d.ts +2 -1
  145. package/dist/server/telescope-ui.controller.d.ts.map +1 -1
  146. package/dist/server/telescope-ui.controller.js +30 -11
  147. package/dist/server/telescope-ui.controller.js.map +1 -1
  148. package/dist/server/telescope-ui.options.d.ts +25 -0
  149. package/dist/server/telescope-ui.options.d.ts.map +1 -1
  150. package/dist/server/telescope-ui.options.js.map +1 -1
  151. package/dist/spa/assets/index-B5IIRiHt.js +228 -0
  152. package/dist/spa/assets/index-C2zgCbqj.css +1 -0
  153. package/dist/spa/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
  154. package/dist/spa/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
  155. package/dist/spa/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
  156. package/dist/spa/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
  157. package/dist/spa/assets/jetbrains-mono-latin-600-normal-BfsvjouI.woff +0 -0
  158. package/dist/spa/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2 +0 -0
  159. package/dist/spa/assets/sora-latin-400-normal-CRt88UEn.woff2 +0 -0
  160. package/dist/spa/assets/sora-latin-400-normal-OW7qkl5a.woff +0 -0
  161. package/dist/spa/assets/sora-latin-500-normal-01eiPEn0.woff2 +0 -0
  162. package/dist/spa/assets/sora-latin-500-normal-w58xtEt9.woff +0 -0
  163. package/dist/spa/assets/sora-latin-600-normal-1_7fyUAY.woff +0 -0
  164. package/dist/spa/assets/sora-latin-600-normal-Cdg4DaK0.woff2 +0 -0
  165. package/dist/spa/assets/sora-latin-700-normal-9waGdLWo.woff2 +0 -0
  166. package/dist/spa/assets/sora-latin-700-normal-BKPfQAnC.woff +0 -0
  167. package/dist/spa/index.html +8 -2
  168. package/package.json +19 -13
  169. package/dist/spa/assets/index-BNCovQ2Z.js +0 -159
  170. package/dist/spa/assets/index-DdEYuSwo.css +0 -1
@@ -13,8 +13,9 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
13
13
  import { existsSync, readFileSync } from 'node:fs';
14
14
  import { basename, extname, join, resolve, sep } from 'node:path';
15
15
  import { fileURLToPath } from 'node:url';
16
- import { ConsolePage, TELESCOPE_CONSOLE_ID, consoleSwitcherConfig, normalizeTelescopePath, } from '@dudousxd/nestjs-telescope';
17
- import { Controller, Get, Header, Inject, NotFoundException, Param, StreamableFile, } from '@nestjs/common';
16
+ import { ConsolePage, TELESCOPE_CONSOLE_ID, consoleSwitcherConfig, normalizeTelescopePath, readAviaryConsoles, } from '@dudousxd/nestjs-telescope';
17
+ import { Controller, Get, Header, Inject, NotFoundException, Param, Req, StreamableFile, } from '@nestjs/common';
18
+ import { resolveConsoleSignOut, resolveConsoleViewer } from './console-shell.js';
18
19
  import { TELESCOPE_UI_OPTIONS } from './telescope-ui.options.js';
19
20
  /** dist/server/telescope-ui.controller.js -> ../spa */
20
21
  function defaultAssetsDir() {
@@ -27,6 +28,8 @@ const CONTENT_TYPES = {
27
28
  '.svg': 'image/svg+xml',
28
29
  '.json': 'application/json; charset=utf-8',
29
30
  '.ico': 'image/x-icon',
31
+ '.woff2': 'font/woff2',
32
+ '.woff': 'font/woff',
30
33
  };
31
34
  /**
32
35
  * The SPA is built once with a fixed Vite `base` of `/telescope/`, so every
@@ -35,8 +38,8 @@ const CONTENT_TYPES = {
35
38
  * time instead of rebuilding the bundle per-path. When the path is the default
36
39
  * `'telescope'` the source and target strings are identical, so this is a no-op.
37
40
  */
38
- function rewriteAssetBase(html, path) {
39
- const injectedBase = `<script>window.__TELESCOPE_BASE__ = ${JSON.stringify(`/${path}`)};</script>${configBlock(path)}`;
41
+ function rewriteAssetBase(html, path, config) {
42
+ const injectedBase = `<script>window.__TELESCOPE_BASE__ = ${JSON.stringify(`/${path}`)};</script>${config}`;
40
43
  const rebased = html.split('/telescope/').join(`/${path}/`);
41
44
  // Expose the runtime base before the bundle so the client can derive API URLs.
42
45
  if (rebased.includes('</head>')) {
@@ -48,21 +51,35 @@ function rewriteAssetBase(html, path) {
48
51
  export const TELESCOPE_DASHBOARD_CONFIG_ID = 'telescope-dashboard-config';
49
52
  /**
50
53
  * The page's JSON config block (`telescope-dashboard-config`, CSP-safe: data, not script). It
51
- * carries `switcher` only when another Aviary console is registered.
54
+ * carries `switcher` only when another Aviary console is registered; `search` (⌘K, answering per
55
+ * console too) whenever this console is in the registry; `viewer` and `signOut` for the sidebar
56
+ * footer when they resolve (see `TelescopeUiModuleOptions.viewer` / `signOut`).
52
57
  */
53
- function configBlock(path) {
54
- const switcher = consoleSwitcherConfig(TELESCOPE_CONSOLE_ID, `/${path}/api/consoles`);
58
+ async function configBlock(path, request, options) {
59
+ const api = `/${path}/api`;
60
+ const switcher = consoleSwitcherConfig(TELESCOPE_CONSOLE_ID, `${api}/consoles`);
61
+ const registry = readAviaryConsoles();
62
+ const registered = registry?.entries.some((entry) => entry.id === TELESCOPE_CONSOLE_ID);
63
+ const viewer = await resolveConsoleViewer(request, options.viewer);
64
+ const signOut = resolveConsoleSignOut(request, options.signOut, registry);
55
65
  const json = JSON.stringify({
56
66
  base: `/${path}`,
57
67
  ...(switcher !== undefined ? { switcher } : {}),
68
+ ...(registered
69
+ ? { search: { endpoint: `${api}/consoles/search`, self: TELESCOPE_CONSOLE_ID } }
70
+ : {}),
71
+ ...(viewer ? { viewer } : {}),
72
+ ...(signOut ? { signOut } : {}),
58
73
  }).replaceAll('<', '\\u003c');
59
74
  return `<script type="application/json" id="${TELESCOPE_DASHBOARD_CONFIG_ID}">${json}</script>`;
60
75
  }
61
76
  // A denied browser navigation gets a page (or a redirect), not JSON.
62
77
  let TelescopeUiController = class TelescopeUiController {
78
+ options;
63
79
  assetsDir;
64
80
  path;
65
81
  constructor(options) {
82
+ this.options = options;
66
83
  this.assetsDir = options.assetsDir ?? defaultAssetsDir();
67
84
  this.path = normalizeTelescopePath(options.path);
68
85
  }
@@ -70,12 +87,13 @@ let TelescopeUiController = class TelescopeUiController {
70
87
  // browser keeps loading a stale bundle across deploys (the classic "one widget
71
88
  // stuck loading / old labels after an upgrade"). The hashed assets below are
72
89
  // immutable and cached forever instead.
73
- index() {
90
+ async index(request) {
74
91
  const indexPath = join(this.assetsDir, 'index.html');
75
92
  if (!existsSync(indexPath)) {
76
93
  throw new NotFoundException('Telescope UI is not built. Run the package build.');
77
94
  }
78
- return rewriteAssetBase(readFileSync(indexPath, 'utf8'), this.path);
95
+ const config = await configBlock(this.path, request, this.options);
96
+ return rewriteAssetBase(readFileSync(indexPath, 'utf8'), this.path, config);
79
97
  }
80
98
  // Asset filenames are content-hashed by the build, so they're safe to cache
81
99
  // forever — a new bundle gets a new filename referenced by the (uncached) index.
@@ -99,9 +117,10 @@ __decorate([
99
117
  Get(),
100
118
  Header('Content-Type', 'text/html; charset=utf-8'),
101
119
  Header('Cache-Control', 'no-store, must-revalidate'),
120
+ __param(0, Req()),
102
121
  __metadata("design:type", Function),
103
- __metadata("design:paramtypes", []),
104
- __metadata("design:returntype", String)
122
+ __metadata("design:paramtypes", [Object]),
123
+ __metadata("design:returntype", Promise)
105
124
  ], TelescopeUiController.prototype, "index", null);
106
125
  __decorate([
107
126
  Get('assets/:file'),
@@ -1 +1 @@
1
- {"version":3,"file":"telescope-ui.controller.js","sourceRoot":"","sources":["../../src/server/telescope-ui.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,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AAI,IAAI,KAAK,IAAI;YAAE,MAAM,IAAI,iBAAiB,EAAE,CAAC;QACjD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAC/C,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAChE,MAAM,IAAI,iBAAiB,EAAE,CAAC;QAChC,CAAC;QACD,MAAM,IAAI,GAAG,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,0BAA0B,CAAC;QACxE,OAAO,IAAI,cAAc,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/D,CAAC;CACF,CAAA;AA3BO;IAHL,GAAG,EAAE;IACL,MAAM,CAAC,cAAc,EAAE,0BAA0B,CAAC;IAClD,MAAM,CAAC,eAAe,EAAE,2BAA2B,CAAC;IACxC,WAAA,GAAG,EAAE,CAAA;;;;kDAOjB;AAMD;IAFC,GAAG,CAAC,cAAc,CAAC;IACnB,MAAM,CAAC,eAAe,EAAE,qCAAqC,CAAC;IACxD,WAAA,KAAK,CAAC,MAAM,CAAC,CAAA;;;oCAAgB,cAAc;kDAajD;AA1CU,qBAAqB;IAFjC,WAAW,EAAE;IACb,UAAU,EAAE;IAKE,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;;GAJ9B,qBAAqB,CA2CjC"}
@@ -1,5 +1,6 @@
1
1
  import type { ConsoleAuthorize } from '@dudousxd/nestjs-telescope';
2
2
  import type { DynamicModule } from '@nestjs/common';
3
+ import type { ConsoleSignOutOption, ConsoleViewerResolver } from './console-shell.js';
3
4
  export declare const TELESCOPE_UI_OPTIONS: unique symbol;
4
5
  export interface TelescopeUiModuleOptions {
5
6
  /** Directory of the built SPA (index.html + assets/). Defaults to the bundled dist/spa. */
@@ -71,5 +72,29 @@ export interface TelescopeUiModuleOptions {
71
72
  * DI resolution path for whatever the {@link decorators} need.
72
73
  */
73
74
  imports?: DynamicModule['imports'];
75
+ /**
76
+ * Who the console's sidebar footer says is signed in: `(request) => ({ label, email?, role? })`,
77
+ * sync or async. `null`/`undefined` or a throw shows no user row.
78
+ *
79
+ * Omitted: `request.user` is read structurally — whatever your guards ({@link decorators})
80
+ * already put there: `fullName` → `name` → `email` for the label, and `role` or the first of
81
+ * `roles` (a string or `{ name }`). Reading it never triggers an authentication. With
82
+ * `forRootAsync` it can come from the factory.
83
+ */
84
+ viewer?: ConsoleViewerResolver;
85
+ /**
86
+ * The sidebar footer's sign-out. One of:
87
+ *
88
+ * - `'/logout'`: a POST form to that path (with `_csrf` when the request exposes
89
+ * `req.csrfToken()`);
90
+ * - `{ href: '/logout' }`: a plain link;
91
+ * - `{ action: '/logout', csrfToken: (request) => token }`: a POST form with your token as `_csrf`;
92
+ * - `false`: none, even when an account console announced one.
93
+ *
94
+ * Omitted: the sign-out an account console announced on the Aviary consoles registry
95
+ * (`account.signOut`), else none. Only same-origin paths (`/x`) are ever sent to the page. With
96
+ * `forRootAsync` it can come from the factory.
97
+ */
98
+ signOut?: ConsoleSignOutOption;
74
99
  }
75
100
  //# sourceMappingURL=telescope-ui.options.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"telescope-ui.options.d.ts","sourceRoot":"","sources":["../../src/server/telescope-ui.options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AAEnE,MAAM,WAAW,wBAAwB;IACvC,2FAA2F;IAC3F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;;;;;;;;;;OAgBG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B;;;;;;;;;;;;;OAaG;IACH,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;IAC9B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;CACpC"}
1
+ {"version":3,"file":"telescope-ui.options.d.ts","sourceRoot":"","sources":["../../src/server/telescope-ui.options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEtF,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AAEnE,MAAM,WAAW,wBAAwB;IACvC,2FAA2F;IAC3F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;;;;;;;;;;OAgBG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B;;;;;;;;;;;;;OAaG;IACH,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;IAC9B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IACnC;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC"}
@@ -1 +1 @@
1
- {"version":3,"file":"telescope-ui.options.js","sourceRoot":"","sources":["../../src/server/telescope-ui.options.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC"}
1
+ {"version":3,"file":"telescope-ui.options.js","sourceRoot":"","sources":["../../src/server/telescope-ui.options.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC"}