@lensjs/core 1.0.1 → 1.0.2

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 (197) hide show
  1. package/dist/abstracts/adapter.cjs +8 -0
  2. package/dist/abstracts/adapter.d.cts +19 -0
  3. package/dist/abstracts/adapter.d.ts +19 -0
  4. package/dist/abstracts/adapter.js +8 -0
  5. package/dist/abstracts/store.cjs +7 -0
  6. package/dist/abstracts/store.d.cts +23 -0
  7. package/dist/abstracts/store.d.ts +23 -0
  8. package/dist/abstracts/store.js +7 -0
  9. package/dist/chunk-2HRVJRKV.cjs +10 -0
  10. package/dist/chunk-3R5QARPT.cjs +14 -0
  11. package/{src/watchers/request_watcher.ts → dist/chunk-4HLDYZJA.js} +18 -11
  12. package/dist/chunk-5PYQWLAZ.js +129 -0
  13. package/dist/chunk-75ZPJI57.cjs +9 -0
  14. package/dist/chunk-7EKM5HB5.cjs +1 -0
  15. package/dist/chunk-AUDSBNLF.cjs +122 -0
  16. package/dist/chunk-BFFOUTTE.cjs +32 -0
  17. package/dist/chunk-BL4Z6JFH.cjs +34 -0
  18. package/dist/chunk-CQ2Z4TCR.js +7 -0
  19. package/dist/chunk-EHOWCXZV.cjs +7 -0
  20. package/{src/utils/index.ts → dist/chunk-EJ5BW35V.js} +69 -86
  21. package/dist/chunk-EKG3FVLV.cjs +7 -0
  22. package/dist/chunk-FCMQ3WE3.cjs +129 -0
  23. package/dist/chunk-FKMBNWX4.js +7 -0
  24. package/dist/chunk-FLOVBBFU.js +10 -0
  25. package/dist/chunk-GI7SJDNQ.cjs +38 -0
  26. package/dist/chunk-IPMTMCFP.js +122 -0
  27. package/dist/chunk-JZ2JLQXL.cjs +87 -0
  28. package/dist/chunk-MLKGABMK.js +9 -0
  29. package/dist/chunk-QRZUNYF6.cjs +16 -0
  30. package/dist/chunk-RMZ4UAQ2.js +14 -0
  31. package/dist/chunk-SJXZARBJ.cjs +22 -0
  32. package/dist/chunk-TJDE6AZM.js +87 -0
  33. package/dist/chunk-TPUVRGYT.js +32 -0
  34. package/dist/chunk-UF5HFNMI.js +22 -0
  35. package/dist/chunk-VD5IMUWL.js +0 -0
  36. package/dist/chunk-WU6IZUEV.cjs +159 -0
  37. package/dist/chunk-XXYRWHSQ.js +0 -0
  38. package/dist/chunk-XYXPHWEI.js +16 -0
  39. package/dist/chunk-XZFXXD3A.cjs +1 -0
  40. package/dist/chunk-YC6T4XWI.js +38 -0
  41. package/dist/context/container.cjs +7 -0
  42. package/dist/context/container.d.cts +28 -0
  43. package/dist/context/container.d.ts +28 -0
  44. package/dist/context/container.js +7 -0
  45. package/dist/context/context.cjs +10 -0
  46. package/dist/context/context.d.cts +15 -0
  47. package/dist/context/context.d.ts +15 -0
  48. package/dist/context/context.js +10 -0
  49. package/dist/core/api_controller.cjs +10 -0
  50. package/dist/core/api_controller.d.cts +25 -0
  51. package/dist/core/api_controller.d.ts +25 -0
  52. package/dist/core/api_controller.js +10 -0
  53. package/dist/core/lens.cjs +15 -0
  54. package/dist/core/lens.d.cts +24 -0
  55. package/dist/core/lens.d.ts +24 -0
  56. package/dist/core/lens.js +15 -0
  57. package/dist/core/watcher.cjs +7 -0
  58. package/dist/core/watcher.d.cts +9 -0
  59. package/dist/core/watcher.d.ts +9 -0
  60. package/dist/core/watcher.js +7 -0
  61. package/dist/index-D0Vszdac.d.cts +49 -0
  62. package/dist/index-D0Vszdac.d.ts +49 -0
  63. package/dist/index.cjs +55 -0
  64. package/dist/index.d.cts +16 -0
  65. package/dist/index.d.ts +16 -0
  66. package/dist/index.js +55 -0
  67. package/dist/stores/better_sqlite.cjs +10 -0
  68. package/dist/stores/better_sqlite.d.cts +51 -0
  69. package/dist/stores/better_sqlite.d.ts +51 -0
  70. package/dist/stores/better_sqlite.js +10 -0
  71. package/dist/stores/index.cjs +11 -0
  72. package/dist/stores/index.d.cts +5 -0
  73. package/dist/stores/index.d.ts +5 -0
  74. package/dist/stores/index.js +11 -0
  75. package/dist/types/index.cjs +7 -0
  76. package/dist/types/index.d.cts +91 -0
  77. package/dist/types/index.d.ts +91 -0
  78. package/dist/types/index.js +7 -0
  79. package/dist/ui/assets/QueriesContainer-Bxr99HkT.js +2 -0
  80. package/dist/ui/assets/QueryDetailsContainer-BcbxQyxT.js +48 -0
  81. package/dist/ui/assets/QueryTable-Dx1MyXwe.js +1 -0
  82. package/dist/ui/assets/RequestDetails-B9rQn1tY.js +1 -0
  83. package/dist/ui/assets/RequestDetailsContainer-C0sOvaO2.js +2 -0
  84. package/dist/ui/assets/RequestsContainer-DYNNLt6S.js +2 -0
  85. package/dist/ui/assets/RequetsTable-BN-1fud-.js +1 -0
  86. package/dist/ui/assets/StatusCode-ByIHR7Pe.js +1 -0
  87. package/dist/ui/assets/TabbedDataViewer-CoLeLuBm.js +1 -0
  88. package/dist/ui/assets/Table-CXg4Wfwf.js +6 -0
  89. package/dist/ui/assets/date-BXZFS9Wq.js +1 -0
  90. package/dist/ui/assets/index-BPTSPdZM.css +1 -0
  91. package/dist/ui/assets/index-C3XpMOuU.js +114 -0
  92. package/dist/ui/assets/useLensApi-BlL4RwJa.js +1 -0
  93. package/dist/ui/assets/useLoadMore-BqF649Mm.js +1 -0
  94. package/dist/ui/assets/useQueries-Iwl8o-Xk.js +1 -0
  95. package/dist/ui/favicon.ico +0 -0
  96. package/dist/ui/index.html +14 -0
  97. package/dist/utils/event_emitter.cjs +11 -0
  98. package/dist/utils/event_emitter.d.cts +16 -0
  99. package/dist/utils/event_emitter.d.ts +16 -0
  100. package/dist/utils/event_emitter.js +11 -0
  101. package/dist/utils/index.cjs +31 -0
  102. package/dist/utils/index.d.cts +3 -0
  103. package/dist/utils/index.d.ts +3 -0
  104. package/dist/utils/index.js +31 -0
  105. package/dist/watchers/index.cjs +16 -0
  106. package/dist/watchers/index.d.cts +5 -0
  107. package/dist/watchers/index.d.ts +5 -0
  108. package/dist/watchers/index.js +16 -0
  109. package/dist/watchers/query_watcher.cjs +11 -0
  110. package/dist/watchers/query_watcher.d.cts +10 -0
  111. package/dist/watchers/query_watcher.d.ts +10 -0
  112. package/dist/watchers/query_watcher.js +11 -0
  113. package/dist/watchers/request_watcher.cjs +11 -0
  114. package/dist/watchers/request_watcher.d.cts +10 -0
  115. package/dist/watchers/request_watcher.d.ts +10 -0
  116. package/dist/watchers/request_watcher.js +11 -0
  117. package/package.json +4 -1
  118. package/copy-front-build.cjs +0 -16
  119. package/src/abstracts/adapter.ts +0 -41
  120. package/src/abstracts/store.ts +0 -36
  121. package/src/context/container.ts +0 -67
  122. package/src/context/context.ts +0 -9
  123. package/src/core/api_controller.ts +0 -116
  124. package/src/core/lens.ts +0 -147
  125. package/src/core/watcher.ts +0 -6
  126. package/src/index.ts +0 -11
  127. package/src/stores/better_sqlite.ts +0 -176
  128. package/src/stores/index.ts +0 -1
  129. package/src/types/index.ts +0 -103
  130. package/src/ui/README.md +0 -69
  131. package/src/ui/bun.lock +0 -750
  132. package/src/ui/eslint.config.js +0 -27
  133. package/src/ui/index.html +0 -13
  134. package/src/ui/package-lock.json +0 -2953
  135. package/src/ui/package.json +0 -40
  136. package/src/ui/src/App.tsx +0 -40
  137. package/src/ui/src/components/DetailPanel.tsx +0 -70
  138. package/src/ui/src/components/JsonViewer.tsx +0 -232
  139. package/src/ui/src/components/LoadMore.tsx +0 -25
  140. package/src/ui/src/components/MethodBadge.tsx +0 -19
  141. package/src/ui/src/components/Modal.tsx +0 -48
  142. package/src/ui/src/components/StatusCode.tsx +0 -20
  143. package/src/ui/src/components/Table.tsx +0 -127
  144. package/src/ui/src/components/layout/DeleteButton.tsx +0 -60
  145. package/src/ui/src/components/layout/Footer.tsx +0 -12
  146. package/src/ui/src/components/layout/Header.tsx +0 -40
  147. package/src/ui/src/components/layout/Layout.tsx +0 -49
  148. package/src/ui/src/components/layout/LoadingScreen.tsx +0 -14
  149. package/src/ui/src/components/layout/Sidebar.tsx +0 -67
  150. package/src/ui/src/components/queryFormatters/MongoViewer.tsx +0 -92
  151. package/src/ui/src/components/queryFormatters/QueryViewer.tsx +0 -18
  152. package/src/ui/src/components/queryFormatters/SqlViewer.tsx +0 -105
  153. package/src/ui/src/components/table/NoData.tsx +0 -26
  154. package/src/ui/src/components/tabs/TabbedDataViewer.tsx +0 -77
  155. package/src/ui/src/containers/queries/QueriesContainer.tsx +0 -21
  156. package/src/ui/src/containers/queries/QueryDetailsContainer.tsx +0 -15
  157. package/src/ui/src/containers/requests/RequestDetailsContainer.tsx +0 -16
  158. package/src/ui/src/containers/requests/RequestsContainer.tsx +0 -22
  159. package/src/ui/src/hooks/useLensApi.ts +0 -92
  160. package/src/ui/src/hooks/useLoadMore.ts +0 -48
  161. package/src/ui/src/hooks/useQueries.ts +0 -58
  162. package/src/ui/src/hooks/useRequests.ts +0 -79
  163. package/src/ui/src/hooks/useTanstackApi.ts +0 -126
  164. package/src/ui/src/index.css +0 -78
  165. package/src/ui/src/interfaces/index.ts +0 -10
  166. package/src/ui/src/main.tsx +0 -33
  167. package/src/ui/src/router/Router.ts +0 -11
  168. package/src/ui/src/router/routes/Loading.tsx +0 -5
  169. package/src/ui/src/router/routes/index.tsx +0 -85
  170. package/src/ui/src/types/index.ts +0 -95
  171. package/src/ui/src/utils/api.ts +0 -7
  172. package/src/ui/src/utils/context.ts +0 -24
  173. package/src/ui/src/utils/date.ts +0 -36
  174. package/src/ui/src/views/queries/QueryDetails.tsx +0 -58
  175. package/src/ui/src/views/queries/QueryTable.tsx +0 -21
  176. package/src/ui/src/views/queries/columns.tsx +0 -83
  177. package/src/ui/src/views/requests/BasicRequestDetails.tsx +0 -82
  178. package/src/ui/src/views/requests/RequestDetails.tsx +0 -70
  179. package/src/ui/src/views/requests/RequetsTable.tsx +0 -19
  180. package/src/ui/src/views/requests/columns.tsx +0 -62
  181. package/src/ui/src/vite-env.d.ts +0 -1
  182. package/src/ui/tsconfig.app.json +0 -27
  183. package/src/ui/tsconfig.json +0 -7
  184. package/src/ui/tsconfig.node.json +0 -25
  185. package/src/ui/vite.config.ts +0 -9
  186. package/src/utils/event_emitter.ts +0 -13
  187. package/src/watchers/index.ts +0 -2
  188. package/src/watchers/query_watcher.ts +0 -15
  189. package/tests/core/lens.test.ts +0 -89
  190. package/tests/stores/better_sqlite.test.ts +0 -168
  191. package/tests/utils/index.test.ts +0 -182
  192. package/tests/watchers/query_watcher.test.ts +0 -35
  193. package/tests/watchers/request_watcher.test.ts +0 -59
  194. package/tsconfig.json +0 -3
  195. package/tsup.config.ts +0 -15
  196. package/vitest.config.ts +0 -9
  197. /package/{src/ui/public/favicon.ico → dist/ui/assets/favicon-D0UnoCWN.ico} +0 -0
@@ -0,0 +1,7 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkEKG3FVLVcjs = require('../chunk-EKG3FVLV.cjs');
4
+ require('../chunk-75ZPJI57.cjs');
5
+
6
+
7
+ exports.default = _chunkEKG3FVLVcjs.Watcher;
@@ -0,0 +1,9 @@
1
+ import { WatcherTypeEnum } from '../types/index.cjs';
2
+ import 'sql-formatter';
3
+
4
+ declare abstract class Watcher {
5
+ abstract name: WatcherTypeEnum;
6
+ abstract log(data: any): Promise<void>;
7
+ }
8
+
9
+ export { Watcher as default };
@@ -0,0 +1,9 @@
1
+ import { WatcherTypeEnum } from '../types/index.js';
2
+ import 'sql-formatter';
3
+
4
+ declare abstract class Watcher {
5
+ abstract name: WatcherTypeEnum;
6
+ abstract log(data: any): Promise<void>;
7
+ }
8
+
9
+ export { Watcher as default };
@@ -0,0 +1,7 @@
1
+ import {
2
+ Watcher
3
+ } from "../chunk-CQ2Z4TCR.js";
4
+ import "../chunk-MLKGABMK.js";
5
+ export {
6
+ Watcher as default
7
+ };
@@ -0,0 +1,49 @@
1
+ import { DateTime } from 'luxon';
2
+ import { SqlLanguage } from 'sql-formatter';
3
+
4
+ declare const generateRandomUuid: () => `${string}-${string}-${string}-${string}-${string}`;
5
+ type Bindings = any[] | Record<string, any>;
6
+ /**
7
+ * Interpolates SQL query placeholders with actual values.
8
+ * Supports:
9
+ * - ? (array-based)
10
+ * - $1, $name (numeric or named)
11
+ * - :name (named)
12
+ */
13
+ declare function interpolateQuery(query: string, bindings: Bindings): string;
14
+ declare const formatSqlQuery: (query: string, language: SqlLanguage) => string;
15
+ declare function now(): DateTime<true> | DateTime<false>;
16
+ declare function nowISO(): string;
17
+ declare function sqlDateTime(dateTime?: DateTime | null): string | null;
18
+ declare function convertToUTC(dateTime: string): string;
19
+ declare function getMeta(metaUrl?: string): {
20
+ __filename: string;
21
+ __dirname: string;
22
+ };
23
+ declare function isStaticFile(params: string[]): boolean;
24
+ declare function stripBeforeAssetsPath(url: string): string;
25
+ declare function prepareIgnoredPaths(path: string, ignoredPaths: RegExp[]): {
26
+ ignoredPaths: RegExp[];
27
+ normalizedPath: string;
28
+ };
29
+ declare function shouldIgnoreCurrentPath(path: string, ignoredPaths: RegExp[], onlyPaths: RegExp[]): boolean;
30
+ declare function prettyHrTime(hrtime: [number, number], verbose?: boolean): string;
31
+
32
+ declare const index_convertToUTC: typeof convertToUTC;
33
+ declare const index_formatSqlQuery: typeof formatSqlQuery;
34
+ declare const index_generateRandomUuid: typeof generateRandomUuid;
35
+ declare const index_getMeta: typeof getMeta;
36
+ declare const index_interpolateQuery: typeof interpolateQuery;
37
+ declare const index_isStaticFile: typeof isStaticFile;
38
+ declare const index_now: typeof now;
39
+ declare const index_nowISO: typeof nowISO;
40
+ declare const index_prepareIgnoredPaths: typeof prepareIgnoredPaths;
41
+ declare const index_prettyHrTime: typeof prettyHrTime;
42
+ declare const index_shouldIgnoreCurrentPath: typeof shouldIgnoreCurrentPath;
43
+ declare const index_sqlDateTime: typeof sqlDateTime;
44
+ declare const index_stripBeforeAssetsPath: typeof stripBeforeAssetsPath;
45
+ declare namespace index {
46
+ export { index_convertToUTC as convertToUTC, index_formatSqlQuery as formatSqlQuery, index_generateRandomUuid as generateRandomUuid, index_getMeta as getMeta, index_interpolateQuery as interpolateQuery, index_isStaticFile as isStaticFile, index_now as now, index_nowISO as nowISO, index_prepareIgnoredPaths as prepareIgnoredPaths, index_prettyHrTime as prettyHrTime, index_shouldIgnoreCurrentPath as shouldIgnoreCurrentPath, index_sqlDateTime as sqlDateTime, index_stripBeforeAssetsPath as stripBeforeAssetsPath };
47
+ }
48
+
49
+ export { interpolateQuery as a, nowISO as b, convertToUTC as c, getMeta as d, isStaticFile as e, formatSqlQuery as f, generateRandomUuid as g, stripBeforeAssetsPath as h, index as i, shouldIgnoreCurrentPath as j, prettyHrTime as k, now as n, prepareIgnoredPaths as p, sqlDateTime as s };
@@ -0,0 +1,49 @@
1
+ import { DateTime } from 'luxon';
2
+ import { SqlLanguage } from 'sql-formatter';
3
+
4
+ declare const generateRandomUuid: () => `${string}-${string}-${string}-${string}-${string}`;
5
+ type Bindings = any[] | Record<string, any>;
6
+ /**
7
+ * Interpolates SQL query placeholders with actual values.
8
+ * Supports:
9
+ * - ? (array-based)
10
+ * - $1, $name (numeric or named)
11
+ * - :name (named)
12
+ */
13
+ declare function interpolateQuery(query: string, bindings: Bindings): string;
14
+ declare const formatSqlQuery: (query: string, language: SqlLanguage) => string;
15
+ declare function now(): DateTime<true> | DateTime<false>;
16
+ declare function nowISO(): string;
17
+ declare function sqlDateTime(dateTime?: DateTime | null): string | null;
18
+ declare function convertToUTC(dateTime: string): string;
19
+ declare function getMeta(metaUrl?: string): {
20
+ __filename: string;
21
+ __dirname: string;
22
+ };
23
+ declare function isStaticFile(params: string[]): boolean;
24
+ declare function stripBeforeAssetsPath(url: string): string;
25
+ declare function prepareIgnoredPaths(path: string, ignoredPaths: RegExp[]): {
26
+ ignoredPaths: RegExp[];
27
+ normalizedPath: string;
28
+ };
29
+ declare function shouldIgnoreCurrentPath(path: string, ignoredPaths: RegExp[], onlyPaths: RegExp[]): boolean;
30
+ declare function prettyHrTime(hrtime: [number, number], verbose?: boolean): string;
31
+
32
+ declare const index_convertToUTC: typeof convertToUTC;
33
+ declare const index_formatSqlQuery: typeof formatSqlQuery;
34
+ declare const index_generateRandomUuid: typeof generateRandomUuid;
35
+ declare const index_getMeta: typeof getMeta;
36
+ declare const index_interpolateQuery: typeof interpolateQuery;
37
+ declare const index_isStaticFile: typeof isStaticFile;
38
+ declare const index_now: typeof now;
39
+ declare const index_nowISO: typeof nowISO;
40
+ declare const index_prepareIgnoredPaths: typeof prepareIgnoredPaths;
41
+ declare const index_prettyHrTime: typeof prettyHrTime;
42
+ declare const index_shouldIgnoreCurrentPath: typeof shouldIgnoreCurrentPath;
43
+ declare const index_sqlDateTime: typeof sqlDateTime;
44
+ declare const index_stripBeforeAssetsPath: typeof stripBeforeAssetsPath;
45
+ declare namespace index {
46
+ export { index_convertToUTC as convertToUTC, index_formatSqlQuery as formatSqlQuery, index_generateRandomUuid as generateRandomUuid, index_getMeta as getMeta, index_interpolateQuery as interpolateQuery, index_isStaticFile as isStaticFile, index_now as now, index_nowISO as nowISO, index_prepareIgnoredPaths as prepareIgnoredPaths, index_prettyHrTime as prettyHrTime, index_shouldIgnoreCurrentPath as shouldIgnoreCurrentPath, index_sqlDateTime as sqlDateTime, index_stripBeforeAssetsPath as stripBeforeAssetsPath };
47
+ }
48
+
49
+ export { interpolateQuery as a, nowISO as b, convertToUTC as c, getMeta as d, isStaticFile as e, formatSqlQuery as f, generateRandomUuid as g, stripBeforeAssetsPath as h, index as i, shouldIgnoreCurrentPath as j, prettyHrTime as k, now as n, prepareIgnoredPaths as p, sqlDateTime as s };
package/dist/index.cjs ADDED
@@ -0,0 +1,55 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+ var _chunk3R5QARPTcjs = require('./chunk-3R5QARPT.cjs');
6
+ require('./chunk-7EKM5HB5.cjs');
7
+
8
+
9
+ var _chunkSJXZARBJcjs = require('./chunk-SJXZARBJ.cjs');
10
+
11
+
12
+ var _chunkBL4Z6JFHcjs = require('./chunk-BL4Z6JFH.cjs');
13
+
14
+
15
+ var _chunkBFFOUTTEcjs = require('./chunk-BFFOUTTE.cjs');
16
+
17
+
18
+ var _chunkFCMQ3WE3cjs = require('./chunk-FCMQ3WE3.cjs');
19
+ require('./chunk-XZFXXD3A.cjs');
20
+
21
+
22
+ var _chunkAUDSBNLFcjs = require('./chunk-AUDSBNLF.cjs');
23
+
24
+
25
+ var _chunkWU6IZUEVcjs = require('./chunk-WU6IZUEV.cjs');
26
+
27
+
28
+ var _chunkEHOWCXZVcjs = require('./chunk-EHOWCXZV.cjs');
29
+ require('./chunk-JZ2JLQXL.cjs');
30
+
31
+
32
+ var _chunk2HRVJRKVcjs = require('./chunk-2HRVJRKV.cjs');
33
+
34
+
35
+ var _chunkQRZUNYF6cjs = require('./chunk-QRZUNYF6.cjs');
36
+ require('./chunk-GI7SJDNQ.cjs');
37
+
38
+
39
+ var _chunkEKG3FVLVcjs = require('./chunk-EKG3FVLV.cjs');
40
+ require('./chunk-75ZPJI57.cjs');
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+ exports.BetterSqliteStore = _chunkAUDSBNLFcjs.BetterSqliteStore; exports.Lens = _chunkFCMQ3WE3cjs.Lens; exports.LensAdapter = _chunkBFFOUTTEcjs.Adapter; exports.LensStore = _chunkEHOWCXZVcjs.Store; exports.LensWatcher = _chunkEKG3FVLVcjs.Watcher; exports.QueryWatcher = _chunkSJXZARBJcjs.QueryWatcher; exports.RequestWatcher = _chunkBL4Z6JFHcjs.RequestWatcher; exports.WatcherTypeEnum = _chunk2HRVJRKVcjs.WatcherTypeEnum; exports.createEmittery = _chunk3R5QARPTcjs.createEmittery; exports.getLensStore = _chunkQRZUNYF6cjs.getStore; exports.lensEmitter = _chunk3R5QARPTcjs.lensEmitter; exports.lensResource = _chunk3R5QARPTcjs.lensResource; exports.lensUtils = _chunkWU6IZUEVcjs.utils_exports;
@@ -0,0 +1,16 @@
1
+ export { default as Lens } from './core/lens.cjs';
2
+ export { default as BetterSqliteStore } from './stores/better_sqlite.cjs';
3
+ export { default as QueryWatcher } from './watchers/query_watcher.cjs';
4
+ export { default as RequestWatcher } from './watchers/request_watcher.cjs';
5
+ export { ApiResponse, Entry, HttpMethod, LensConfig, LensEntry, PaginationParams, Paginator, QueryEntry, QueryType, RequestEntry, RouteDefinition, RouteDefinitionHandler, RouteHttpMethod, SqlQueryType, UserEntry, WatcherTypeEnum } from './types/index.cjs';
6
+ export { default as LensAdapter } from './abstracts/adapter.cjs';
7
+ export { default as LensStore } from './abstracts/store.cjs';
8
+ export { default as LensWatcher } from './core/watcher.cjs';
9
+ export { getStore as getLensStore } from './context/context.cjs';
10
+ export { i as lensUtils } from './index-D0Vszdac.cjs';
11
+ export { createEmittery, lensEmitter, lensResource } from './utils/event_emitter.cjs';
12
+ import 'libsql';
13
+ import 'sql-formatter';
14
+ import 'luxon';
15
+ import 'emittery';
16
+ import 'node:async_hooks';
@@ -0,0 +1,16 @@
1
+ export { default as Lens } from './core/lens.js';
2
+ export { default as BetterSqliteStore } from './stores/better_sqlite.js';
3
+ export { default as QueryWatcher } from './watchers/query_watcher.js';
4
+ export { default as RequestWatcher } from './watchers/request_watcher.js';
5
+ export { ApiResponse, Entry, HttpMethod, LensConfig, LensEntry, PaginationParams, Paginator, QueryEntry, QueryType, RequestEntry, RouteDefinition, RouteDefinitionHandler, RouteHttpMethod, SqlQueryType, UserEntry, WatcherTypeEnum } from './types/index.js';
6
+ export { default as LensAdapter } from './abstracts/adapter.js';
7
+ export { default as LensStore } from './abstracts/store.js';
8
+ export { default as LensWatcher } from './core/watcher.js';
9
+ export { getStore as getLensStore } from './context/context.js';
10
+ export { i as lensUtils } from './index-D0Vszdac.js';
11
+ export { createEmittery, lensEmitter, lensResource } from './utils/event_emitter.js';
12
+ import 'libsql';
13
+ import 'sql-formatter';
14
+ import 'luxon';
15
+ import 'emittery';
16
+ import 'node:async_hooks';
package/dist/index.js ADDED
@@ -0,0 +1,55 @@
1
+ import {
2
+ createEmittery,
3
+ lensEmitter,
4
+ lensResource
5
+ } from "./chunk-RMZ4UAQ2.js";
6
+ import "./chunk-XXYRWHSQ.js";
7
+ import {
8
+ QueryWatcher
9
+ } from "./chunk-UF5HFNMI.js";
10
+ import {
11
+ RequestWatcher
12
+ } from "./chunk-4HLDYZJA.js";
13
+ import {
14
+ Adapter
15
+ } from "./chunk-TPUVRGYT.js";
16
+ import {
17
+ Lens
18
+ } from "./chunk-5PYQWLAZ.js";
19
+ import "./chunk-VD5IMUWL.js";
20
+ import {
21
+ BetterSqliteStore
22
+ } from "./chunk-IPMTMCFP.js";
23
+ import {
24
+ utils_exports
25
+ } from "./chunk-EJ5BW35V.js";
26
+ import {
27
+ Store
28
+ } from "./chunk-FKMBNWX4.js";
29
+ import "./chunk-TJDE6AZM.js";
30
+ import {
31
+ WatcherTypeEnum
32
+ } from "./chunk-FLOVBBFU.js";
33
+ import {
34
+ getStore
35
+ } from "./chunk-XYXPHWEI.js";
36
+ import "./chunk-YC6T4XWI.js";
37
+ import {
38
+ Watcher
39
+ } from "./chunk-CQ2Z4TCR.js";
40
+ import "./chunk-MLKGABMK.js";
41
+ export {
42
+ BetterSqliteStore,
43
+ Lens,
44
+ Adapter as LensAdapter,
45
+ Store as LensStore,
46
+ Watcher as LensWatcher,
47
+ QueryWatcher,
48
+ RequestWatcher,
49
+ WatcherTypeEnum,
50
+ createEmittery,
51
+ getStore as getLensStore,
52
+ lensEmitter,
53
+ lensResource,
54
+ utils_exports as lensUtils
55
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkAUDSBNLFcjs = require('../chunk-AUDSBNLF.cjs');
4
+ require('../chunk-WU6IZUEV.cjs');
5
+ require('../chunk-EHOWCXZV.cjs');
6
+ require('../chunk-2HRVJRKV.cjs');
7
+ require('../chunk-75ZPJI57.cjs');
8
+
9
+
10
+ exports.default = _chunkAUDSBNLFcjs.BetterSqliteStore;
@@ -0,0 +1,51 @@
1
+ import Store from '../abstracts/store.cjs';
2
+ import { WatcherTypeEnum, LensEntry, PaginationParams } from '../types/index.cjs';
3
+ import Database from 'libsql';
4
+ import 'sql-formatter';
5
+
6
+ declare class BetterSqliteStore extends Store {
7
+ protected connection: Database.Database;
8
+ initialize(): Promise<void>;
9
+ truncate(): Promise<void>;
10
+ save(entry: {
11
+ id?: string;
12
+ data: Record<string, any>;
13
+ minimal_data?: Record<string, any>;
14
+ type: WatcherTypeEnum;
15
+ timestamp?: string;
16
+ requestId?: string;
17
+ }): Promise<void>;
18
+ getAllQueries<T extends LensEntry[]>(pagination: PaginationParams): Promise<{
19
+ meta: {
20
+ total: number;
21
+ lastPage: number;
22
+ currentPage: number;
23
+ };
24
+ data: T;
25
+ }>;
26
+ getAllRequests<T extends Omit<LensEntry, "data">[]>(pagination: PaginationParams): Promise<{
27
+ meta: {
28
+ total: number;
29
+ lastPage: number;
30
+ currentPage: number;
31
+ };
32
+ data: T;
33
+ }>;
34
+ allByRequestId(requestId: string, type: WatcherTypeEnum): Promise<LensEntry[]>;
35
+ paginate<T>(type: WatcherTypeEnum, { page, perPage }: PaginationParams, includeFullData?: boolean): Promise<{
36
+ meta: {
37
+ total: number;
38
+ lastPage: number;
39
+ currentPage: number;
40
+ };
41
+ data: T;
42
+ }>;
43
+ count(type: WatcherTypeEnum): Promise<number>;
44
+ find(type: WatcherTypeEnum, id: string): Promise<LensEntry | null>;
45
+ private setupSchema;
46
+ protected mapRow(row: any, includeFullData?: boolean): LensEntry;
47
+ protected mapRows(rows: any[], includeFullData?: boolean): LensEntry[];
48
+ protected getSelectedColumns(includeFullData?: boolean): string;
49
+ }
50
+
51
+ export { BetterSqliteStore as default };
@@ -0,0 +1,51 @@
1
+ import Store from '../abstracts/store.js';
2
+ import { WatcherTypeEnum, LensEntry, PaginationParams } from '../types/index.js';
3
+ import Database from 'libsql';
4
+ import 'sql-formatter';
5
+
6
+ declare class BetterSqliteStore extends Store {
7
+ protected connection: Database.Database;
8
+ initialize(): Promise<void>;
9
+ truncate(): Promise<void>;
10
+ save(entry: {
11
+ id?: string;
12
+ data: Record<string, any>;
13
+ minimal_data?: Record<string, any>;
14
+ type: WatcherTypeEnum;
15
+ timestamp?: string;
16
+ requestId?: string;
17
+ }): Promise<void>;
18
+ getAllQueries<T extends LensEntry[]>(pagination: PaginationParams): Promise<{
19
+ meta: {
20
+ total: number;
21
+ lastPage: number;
22
+ currentPage: number;
23
+ };
24
+ data: T;
25
+ }>;
26
+ getAllRequests<T extends Omit<LensEntry, "data">[]>(pagination: PaginationParams): Promise<{
27
+ meta: {
28
+ total: number;
29
+ lastPage: number;
30
+ currentPage: number;
31
+ };
32
+ data: T;
33
+ }>;
34
+ allByRequestId(requestId: string, type: WatcherTypeEnum): Promise<LensEntry[]>;
35
+ paginate<T>(type: WatcherTypeEnum, { page, perPage }: PaginationParams, includeFullData?: boolean): Promise<{
36
+ meta: {
37
+ total: number;
38
+ lastPage: number;
39
+ currentPage: number;
40
+ };
41
+ data: T;
42
+ }>;
43
+ count(type: WatcherTypeEnum): Promise<number>;
44
+ find(type: WatcherTypeEnum, id: string): Promise<LensEntry | null>;
45
+ private setupSchema;
46
+ protected mapRow(row: any, includeFullData?: boolean): LensEntry;
47
+ protected mapRows(rows: any[], includeFullData?: boolean): LensEntry[];
48
+ protected getSelectedColumns(includeFullData?: boolean): string;
49
+ }
50
+
51
+ export { BetterSqliteStore as default };
@@ -0,0 +1,10 @@
1
+ import {
2
+ BetterSqliteStore
3
+ } from "../chunk-IPMTMCFP.js";
4
+ import "../chunk-EJ5BW35V.js";
5
+ import "../chunk-FKMBNWX4.js";
6
+ import "../chunk-FLOVBBFU.js";
7
+ import "../chunk-MLKGABMK.js";
8
+ export {
9
+ BetterSqliteStore as default
10
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-XZFXXD3A.cjs');
2
+
3
+
4
+ var _chunkAUDSBNLFcjs = require('../chunk-AUDSBNLF.cjs');
5
+ require('../chunk-WU6IZUEV.cjs');
6
+ require('../chunk-EHOWCXZV.cjs');
7
+ require('../chunk-2HRVJRKV.cjs');
8
+ require('../chunk-75ZPJI57.cjs');
9
+
10
+
11
+ exports.BetterSqliteStore = _chunkAUDSBNLFcjs.BetterSqliteStore;
@@ -0,0 +1,5 @@
1
+ export { default as BetterSqliteStore } from './better_sqlite.cjs';
2
+ import '../abstracts/store.cjs';
3
+ import '../types/index.cjs';
4
+ import 'sql-formatter';
5
+ import 'libsql';
@@ -0,0 +1,5 @@
1
+ export { default as BetterSqliteStore } from './better_sqlite.js';
2
+ import '../abstracts/store.js';
3
+ import '../types/index.js';
4
+ import 'sql-formatter';
5
+ import 'libsql';
@@ -0,0 +1,11 @@
1
+ import "../chunk-VD5IMUWL.js";
2
+ import {
3
+ BetterSqliteStore
4
+ } from "../chunk-IPMTMCFP.js";
5
+ import "../chunk-EJ5BW35V.js";
6
+ import "../chunk-FKMBNWX4.js";
7
+ import "../chunk-FLOVBBFU.js";
8
+ import "../chunk-MLKGABMK.js";
9
+ export {
10
+ BetterSqliteStore
11
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunk2HRVJRKVcjs = require('../chunk-2HRVJRKV.cjs');
4
+ require('../chunk-75ZPJI57.cjs');
5
+
6
+
7
+ exports.WatcherTypeEnum = _chunk2HRVJRKVcjs.WatcherTypeEnum;
@@ -0,0 +1,91 @@
1
+ import { SqlLanguage } from 'sql-formatter';
2
+
3
+ type QueryType = Required<SqlLanguage | "mongodb">;
4
+ type SqlQueryType = Exclude<QueryType, "mongodb">;
5
+ type QueryEntry = {
6
+ data: {
7
+ query: string;
8
+ duration: string;
9
+ createdAt: string;
10
+ type: QueryType;
11
+ };
12
+ requestId?: string;
13
+ };
14
+ type UserEntry = {
15
+ id: number | string;
16
+ name: string;
17
+ email: string;
18
+ };
19
+ type RequestEntry = {
20
+ request: {
21
+ id: string;
22
+ method: HttpMethod;
23
+ duration: string;
24
+ path: string;
25
+ headers: Record<string, any>;
26
+ body: Record<string, any>;
27
+ status: number;
28
+ ip: string;
29
+ createdAt: string;
30
+ };
31
+ response: {
32
+ json: Record<string, any>;
33
+ headers: Record<string, string>;
34
+ };
35
+ user?: UserEntry | null;
36
+ };
37
+ type Entry = {
38
+ type: "query";
39
+ data: QueryEntry;
40
+ } | {
41
+ type: "request";
42
+ data: RequestEntry;
43
+ };
44
+ declare enum WatcherTypeEnum {
45
+ REQUEST = "request",
46
+ QUERY = "query"
47
+ }
48
+ type LensConfig = {
49
+ basePath: string;
50
+ appName: string;
51
+ enabled: boolean;
52
+ };
53
+ type LensEntry = {
54
+ id: string;
55
+ minimal_data?: Record<string, any>;
56
+ data: Record<string, any>;
57
+ type: WatcherTypeEnum;
58
+ created_at: string;
59
+ lens_entry_id: string | null;
60
+ };
61
+ type RouteDefinitionHandler = {
62
+ params: Record<string, any>;
63
+ qs?: Record<string, any>;
64
+ };
65
+ type RouteDefinition = {
66
+ method: "GET" | "POST" | "DELETE";
67
+ path: string;
68
+ handler: (data: RouteDefinitionHandler) => any;
69
+ };
70
+ type PaginationParams = {
71
+ page: number;
72
+ perPage: number;
73
+ };
74
+ type Paginator<T> = {
75
+ meta: {
76
+ total: number;
77
+ lastPage: number;
78
+ currentPage: number;
79
+ };
80
+ data: T;
81
+ };
82
+ type ApiResponse<T> = {
83
+ status: number;
84
+ message: string;
85
+ data: T | null;
86
+ meta?: Paginator<T>["meta"];
87
+ };
88
+ type HttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
89
+ type RouteHttpMethod = "get" | "post" | "put" | "delete" | "patch";
90
+
91
+ export { type ApiResponse, type Entry, type HttpMethod, type LensConfig, type LensEntry, type PaginationParams, type Paginator, type QueryEntry, type QueryType, type RequestEntry, type RouteDefinition, type RouteDefinitionHandler, type RouteHttpMethod, type SqlQueryType, type UserEntry, WatcherTypeEnum };
@@ -0,0 +1,91 @@
1
+ import { SqlLanguage } from 'sql-formatter';
2
+
3
+ type QueryType = Required<SqlLanguage | "mongodb">;
4
+ type SqlQueryType = Exclude<QueryType, "mongodb">;
5
+ type QueryEntry = {
6
+ data: {
7
+ query: string;
8
+ duration: string;
9
+ createdAt: string;
10
+ type: QueryType;
11
+ };
12
+ requestId?: string;
13
+ };
14
+ type UserEntry = {
15
+ id: number | string;
16
+ name: string;
17
+ email: string;
18
+ };
19
+ type RequestEntry = {
20
+ request: {
21
+ id: string;
22
+ method: HttpMethod;
23
+ duration: string;
24
+ path: string;
25
+ headers: Record<string, any>;
26
+ body: Record<string, any>;
27
+ status: number;
28
+ ip: string;
29
+ createdAt: string;
30
+ };
31
+ response: {
32
+ json: Record<string, any>;
33
+ headers: Record<string, string>;
34
+ };
35
+ user?: UserEntry | null;
36
+ };
37
+ type Entry = {
38
+ type: "query";
39
+ data: QueryEntry;
40
+ } | {
41
+ type: "request";
42
+ data: RequestEntry;
43
+ };
44
+ declare enum WatcherTypeEnum {
45
+ REQUEST = "request",
46
+ QUERY = "query"
47
+ }
48
+ type LensConfig = {
49
+ basePath: string;
50
+ appName: string;
51
+ enabled: boolean;
52
+ };
53
+ type LensEntry = {
54
+ id: string;
55
+ minimal_data?: Record<string, any>;
56
+ data: Record<string, any>;
57
+ type: WatcherTypeEnum;
58
+ created_at: string;
59
+ lens_entry_id: string | null;
60
+ };
61
+ type RouteDefinitionHandler = {
62
+ params: Record<string, any>;
63
+ qs?: Record<string, any>;
64
+ };
65
+ type RouteDefinition = {
66
+ method: "GET" | "POST" | "DELETE";
67
+ path: string;
68
+ handler: (data: RouteDefinitionHandler) => any;
69
+ };
70
+ type PaginationParams = {
71
+ page: number;
72
+ perPage: number;
73
+ };
74
+ type Paginator<T> = {
75
+ meta: {
76
+ total: number;
77
+ lastPage: number;
78
+ currentPage: number;
79
+ };
80
+ data: T;
81
+ };
82
+ type ApiResponse<T> = {
83
+ status: number;
84
+ message: string;
85
+ data: T | null;
86
+ meta?: Paginator<T>["meta"];
87
+ };
88
+ type HttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
89
+ type RouteHttpMethod = "get" | "post" | "put" | "delete" | "patch";
90
+
91
+ export { type ApiResponse, type Entry, type HttpMethod, type LensConfig, type LensEntry, type PaginationParams, type Paginator, type QueryEntry, type QueryType, type RequestEntry, type RouteDefinition, type RouteDefinitionHandler, type RouteHttpMethod, type SqlQueryType, type UserEntry, WatcherTypeEnum };
@@ -0,0 +1,7 @@
1
+ import {
2
+ WatcherTypeEnum
3
+ } from "../chunk-FLOVBBFU.js";
4
+ import "../chunk-MLKGABMK.js";
5
+ export {
6
+ WatcherTypeEnum
7
+ };
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./QueryTable-Dx1MyXwe.js","./index-C3XpMOuU.js","./index-BPTSPdZM.css","./Table-CXg4Wfwf.js","./date-BXZFS9Wq.js"])))=>i.map(i=>d[i]);
2
+ import{r as t,j as s,_ as a}from"./index-C3XpMOuU.js";import{u as i}from"./useQueries-Iwl8o-Xk.js";import{u}from"./useLoadMore-BqF649Mm.js";import"./useLensApi-BlL4RwJa.js";const m=t.lazy(()=>a(()=>import("./QueryTable-Dx1MyXwe.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),l=()=>{const{loadMoreRequests:o,fetchQueries:r}=i(),e=u({paginatedPage:o});return t.useEffect(()=>{r()},[]),console.log("data",e.data),s.jsx(m,{hasMoreObject:e})};export{l as default};