@lensjs/core 1.0.7 → 1.0.10

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 (100) hide show
  1. package/dist/abstracts/adapter.cjs +70 -5
  2. package/dist/abstracts/adapter.js +37 -5
  3. package/dist/abstracts/store.cjs +26 -6
  4. package/dist/abstracts/store.js +3 -4
  5. package/dist/context/container.cjs +57 -6
  6. package/dist/context/container.js +34 -4
  7. package/dist/context/context.cjs +71 -7
  8. package/dist/context/context.js +42 -6
  9. package/dist/core/api_controller.cjs +148 -7
  10. package/dist/core/api_controller.js +121 -7
  11. package/dist/core/lens.cjs +404 -12
  12. package/dist/core/lens.js +370 -12
  13. package/dist/core/watcher.cjs +26 -6
  14. package/dist/core/watcher.js +3 -4
  15. package/dist/{index-D0Vszdac.d.ts → index-DiLfwsvc.d.cts} +2 -11
  16. package/dist/{index-D0Vszdac.d.cts → index-DiLfwsvc.d.ts} +2 -11
  17. package/dist/index.cjs +611 -55
  18. package/dist/index.d.cts +2 -4
  19. package/dist/index.d.ts +2 -4
  20. package/dist/index.js +556 -42
  21. package/dist/stores/better_sqlite.cjs +149 -7
  22. package/dist/stores/better_sqlite.js +116 -7
  23. package/dist/stores/index.cjs +153 -8
  24. package/dist/stores/index.js +116 -8
  25. package/dist/types/index.cjs +33 -6
  26. package/dist/types/index.js +6 -4
  27. package/dist/ui/assets/QueriesContainer-CAAsjjW5.js +2 -0
  28. package/dist/ui/assets/{QueryDetailsContainer-BkaktbOw.js → QueryDetailsContainer-E7P-IO7f.js} +19 -19
  29. package/dist/ui/assets/QueryTable-BcrtUssT.js +1 -0
  30. package/dist/ui/assets/RequestDetails-C2DZBu5H.js +1 -0
  31. package/dist/ui/assets/RequestDetailsContainer-DuDo-IqS.js +2 -0
  32. package/dist/ui/assets/{RequestsContainer-zoWMoB7o.js → RequestsContainer-DK3hQVz9.js} +2 -2
  33. package/dist/ui/assets/RequetsTable-DgP8p60b.js +1 -0
  34. package/dist/ui/assets/{StatusCode-DH20lQ6a.js → StatusCode-FQEjz7gK.js} +1 -1
  35. package/dist/ui/assets/TabbedDataViewer-cBDdPwIz.js +1 -0
  36. package/dist/ui/assets/{Table-HwlddLhp.js → Table-DYaXk80S.js} +2 -2
  37. package/dist/ui/assets/index-BS8XxorB.js +114 -0
  38. package/dist/ui/assets/index-CpP2Ap5X.js +1 -0
  39. package/dist/ui/assets/index-DzNHqeKh.css +1 -0
  40. package/dist/ui/assets/{useLensApi-Bmk2bGb0.js → useLensApi-DG6atd6d.js} +1 -1
  41. package/dist/ui/assets/{useLoadMore-CvIajdjM.js → useLoadMore-CJltToLI.js} +1 -1
  42. package/dist/ui/assets/{useQueries-DuyhGJyf.js → useQueries-C8mDDDc6.js} +1 -1
  43. package/dist/ui/index.html +2 -2
  44. package/dist/utils/event_emitter.cjs +42 -10
  45. package/dist/utils/event_emitter.d.cts +1 -11
  46. package/dist/utils/event_emitter.d.ts +1 -11
  47. package/dist/utils/event_emitter.js +6 -9
  48. package/dist/utils/index.cjs +163 -31
  49. package/dist/utils/index.d.cts +1 -2
  50. package/dist/utils/index.d.ts +1 -2
  51. package/dist/utils/index.js +109 -20
  52. package/dist/watchers/index.cjs +105 -10
  53. package/dist/watchers/index.js +79 -12
  54. package/dist/watchers/query_watcher.cjs +78 -8
  55. package/dist/watchers/query_watcher.js +55 -8
  56. package/dist/watchers/request_watcher.cjs +90 -8
  57. package/dist/watchers/request_watcher.js +67 -8
  58. package/package.json +18 -18
  59. package/README.md +0 -1
  60. package/dist/chunk-2HRVJRKV.cjs +0 -10
  61. package/dist/chunk-3R5QARPT.cjs +0 -14
  62. package/dist/chunk-4HLDYZJA.js +0 -34
  63. package/dist/chunk-5PYQWLAZ.js +0 -129
  64. package/dist/chunk-75ZPJI57.cjs +0 -9
  65. package/dist/chunk-7EKM5HB5.cjs +0 -1
  66. package/dist/chunk-AUDSBNLF.cjs +0 -122
  67. package/dist/chunk-BFFOUTTE.cjs +0 -32
  68. package/dist/chunk-BL4Z6JFH.cjs +0 -34
  69. package/dist/chunk-CQ2Z4TCR.js +0 -7
  70. package/dist/chunk-EHOWCXZV.cjs +0 -7
  71. package/dist/chunk-EJ5BW35V.js +0 -159
  72. package/dist/chunk-EKG3FVLV.cjs +0 -7
  73. package/dist/chunk-FCMQ3WE3.cjs +0 -129
  74. package/dist/chunk-FKMBNWX4.js +0 -7
  75. package/dist/chunk-FLOVBBFU.js +0 -10
  76. package/dist/chunk-GI7SJDNQ.cjs +0 -38
  77. package/dist/chunk-IPMTMCFP.js +0 -122
  78. package/dist/chunk-JZ2JLQXL.cjs +0 -87
  79. package/dist/chunk-MLKGABMK.js +0 -9
  80. package/dist/chunk-QRZUNYF6.cjs +0 -16
  81. package/dist/chunk-RMZ4UAQ2.js +0 -14
  82. package/dist/chunk-SJXZARBJ.cjs +0 -22
  83. package/dist/chunk-TJDE6AZM.js +0 -87
  84. package/dist/chunk-TPUVRGYT.js +0 -32
  85. package/dist/chunk-UF5HFNMI.js +0 -22
  86. package/dist/chunk-VD5IMUWL.js +0 -0
  87. package/dist/chunk-WU6IZUEV.cjs +0 -159
  88. package/dist/chunk-XXYRWHSQ.js +0 -0
  89. package/dist/chunk-XYXPHWEI.js +0 -16
  90. package/dist/chunk-XZFXXD3A.cjs +0 -1
  91. package/dist/chunk-YC6T4XWI.js +0 -38
  92. package/dist/ui/assets/QueriesContainer-DHnHEGG1.js +0 -2
  93. package/dist/ui/assets/QueryTable-DegVNDkJ.js +0 -1
  94. package/dist/ui/assets/RequestDetails-zrL0n6gL.js +0 -1
  95. package/dist/ui/assets/RequestDetailsContainer-CsHWDxn7.js +0 -2
  96. package/dist/ui/assets/RequetsTable-1K9hhs0W.js +0 -1
  97. package/dist/ui/assets/TabbedDataViewer-DDVxzZiW.js +0 -1
  98. package/dist/ui/assets/date-CZdBf-JH.js +0 -1
  99. package/dist/ui/assets/index-C-9tn0L6.js +0 -114
  100. package/dist/ui/assets/index-DaNx3ROH.css +0 -1
package/dist/core/lens.js CHANGED
@@ -1,15 +1,373 @@
1
- import {
2
- Lens
3
- } from "../chunk-5PYQWLAZ.js";
4
- import "../chunk-VD5IMUWL.js";
5
- import "../chunk-IPMTMCFP.js";
6
- import "../chunk-EJ5BW35V.js";
7
- import "../chunk-FKMBNWX4.js";
8
- import "../chunk-TJDE6AZM.js";
9
- import "../chunk-FLOVBBFU.js";
10
- import "../chunk-XYXPHWEI.js";
11
- import "../chunk-YC6T4XWI.js";
12
- import "../chunk-MLKGABMK.js";
1
+ // src/context/container.ts
2
+ var Container = class {
3
+ static bindings = /* @__PURE__ */ new Map();
4
+ static singletons = /* @__PURE__ */ new Map();
5
+ static instances = /* @__PURE__ */ new Map();
6
+ static bind(key, factory) {
7
+ this.bindings.set(key, factory);
8
+ }
9
+ static singleton(key, factory) {
10
+ this.singletons.set(key, factory);
11
+ }
12
+ static make(key) {
13
+ if (this.instances.has(key)) {
14
+ return this.instances.get(key);
15
+ }
16
+ if (this.singletons.has(key)) {
17
+ const instance = this.singletons.get(key)();
18
+ this.instances.set(key, instance);
19
+ return instance;
20
+ }
21
+ if (this.bindings.has(key)) {
22
+ return this.bindings.get(key)();
23
+ }
24
+ throw new Error(`Service "${key}" is not bound in the container`);
25
+ }
26
+ static has(key) {
27
+ return this.bindings.has(key) || this.singletons.has(key) || this.instances.has(key);
28
+ }
29
+ static clear() {
30
+ this.bindings.clear();
31
+ this.singletons.clear();
32
+ this.instances.clear();
33
+ }
34
+ };
35
+
36
+ // src/context/context.ts
37
+ var getStore = () => {
38
+ return Container.make("store");
39
+ };
40
+ var getUiConfig = () => {
41
+ return Container.make("uiConfig");
42
+ };
43
+
44
+ // src/core/api_controller.ts
45
+ var ApiController = class {
46
+ static async getRequests({ qs }) {
47
+ return this.paginatedResponse(
48
+ await getStore().getAllRequests(this.extractPaginationParams(qs))
49
+ );
50
+ }
51
+ static async getRequest({
52
+ params
53
+ }) {
54
+ const request = await getStore().find("request" /* REQUEST */, params.id);
55
+ if (!request) {
56
+ return this.notFoundResponse();
57
+ }
58
+ return this.resourceResponse(request);
59
+ }
60
+ static async getQueries({
61
+ qs
62
+ }) {
63
+ const queries = await getStore().getAllQueries(
64
+ this.extractPaginationParams(qs)
65
+ );
66
+ return this.paginatedResponse(queries);
67
+ }
68
+ static async getQuery({
69
+ params
70
+ }) {
71
+ const query = await getStore().find("query" /* QUERY */, params.id);
72
+ if (!query) {
73
+ return this.notFoundResponse();
74
+ }
75
+ return this.resourceResponse(query);
76
+ }
77
+ static async truncate() {
78
+ await getStore().truncate();
79
+ return this.baseResponse({}, 200, "All entries cleared");
80
+ }
81
+ static fetchUiConfig() {
82
+ return getUiConfig();
83
+ }
84
+ static extractPaginationParams(qs) {
85
+ if (!qs || Object.keys(qs).length === 0) {
86
+ return { page: 1, perPage: 100 };
87
+ }
88
+ let page = Number(qs.page);
89
+ let perPage = Number(qs.perPage);
90
+ if (!Number.isInteger(perPage) || perPage > 100 || perPage < 5) {
91
+ perPage = 100;
92
+ }
93
+ if (!Number.isInteger(page) || page < 1) {
94
+ page = 1;
95
+ }
96
+ return { page, perPage };
97
+ }
98
+ static resourceResponse(data) {
99
+ return this.baseResponse(data, 200, "Data fetched successfully");
100
+ }
101
+ static notFoundResponse(message = "Could not find the requested resource") {
102
+ return this.baseResponse(null, 404, message);
103
+ }
104
+ static paginatedResponse(data) {
105
+ return this.baseResponse(data, 200, "Data fetched successfully");
106
+ }
107
+ static baseResponse(data, status, message) {
108
+ if (!data) {
109
+ return { status, message, data: null };
110
+ }
111
+ if ("meta" in data) {
112
+ return {
113
+ status,
114
+ message,
115
+ data: data.data,
116
+ meta: data.meta
117
+ };
118
+ }
119
+ return { status, message, data };
120
+ }
121
+ };
122
+
123
+ // src/core/lens.ts
124
+ import * as path2 from "path";
125
+
126
+ // src/abstracts/store.ts
127
+ var Store = class {
128
+ };
129
+
130
+ // src/stores/better_sqlite.ts
131
+ import { randomUUID } from "crypto";
132
+ import Database from "libsql";
133
+ import { sqlDateTime } from "@lensjs/date";
134
+ var TABLE_NAME = "lens_entries";
135
+ var BetterSqliteStore = class extends Store {
136
+ connection;
137
+ async initialize() {
138
+ this.connection = new Database("lens.db");
139
+ this.setupSchema();
140
+ console.log("Connected to Lens (SQLite) database.");
141
+ }
142
+ async truncate() {
143
+ this.connection.prepare(`DELETE FROM ${TABLE_NAME};`).run();
144
+ }
145
+ async save(entry) {
146
+ this.connection.prepare(
147
+ `INSERT INTO ${TABLE_NAME} (id, data, type, created_at, lens_entry_id, minimal_data) values($id, $data, $type, $created_at, $lens_entry_id, $minimalData)`
148
+ ).run({
149
+ id: entry.id ?? randomUUID(),
150
+ data: JSON.stringify(entry.data),
151
+ type: entry.type,
152
+ created_at: entry.timestamp ?? sqlDateTime(),
153
+ lens_entry_id: entry.requestId || null,
154
+ minimalData: JSON.stringify(entry.minimal_data ?? {})
155
+ });
156
+ }
157
+ async getAllQueries(pagination) {
158
+ return await this.paginate("query" /* QUERY */, pagination);
159
+ }
160
+ async getAllRequests(pagination) {
161
+ return await this.paginate("request" /* REQUEST */, pagination, false);
162
+ }
163
+ async allByRequestId(requestId, type) {
164
+ const rows = this.connection.prepare(
165
+ `${this.getSelectedColumns()} FROM ${TABLE_NAME} WHERE type = $type AND lens_entry_id = $requestId ORDER BY created_at DESC`
166
+ ).all({ type, requestId });
167
+ return this.mapRows(rows);
168
+ }
169
+ async paginate(type, { page, perPage }, includeFullData = true) {
170
+ const offset = (page - 1) * perPage;
171
+ const query = `${this.getSelectedColumns(
172
+ includeFullData
173
+ )} FROM ${TABLE_NAME} WHERE type = ? ORDER BY created_at DESC LIMIT ? OFFSET ?`;
174
+ const count = await this.count(type);
175
+ const rows = this.connection.prepare(query).all(type, perPage, offset);
176
+ const mappedRows = this.mapRows(rows, includeFullData);
177
+ return {
178
+ meta: {
179
+ total: count,
180
+ lastPage: Math.ceil(count / perPage),
181
+ currentPage: page
182
+ },
183
+ data: mappedRows
184
+ };
185
+ }
186
+ async count(type) {
187
+ const result = this.connection.prepare(`SELECT count(*) as count FROM ${TABLE_NAME} WHERE type = ?`).get(type);
188
+ return Number(result.count);
189
+ }
190
+ async find(type, id) {
191
+ const row = this.connection.prepare(
192
+ `${this.getSelectedColumns()} FROM ${TABLE_NAME} WHERE id = ? AND type = ? LIMIT 1`
193
+ ).get(id, type);
194
+ if (!row) {
195
+ return null;
196
+ }
197
+ return this.mapRow(row, true);
198
+ }
199
+ setupSchema() {
200
+ const createTable = `
201
+ CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
202
+ id TEXT PRIMARY KEY,
203
+ minimal_data TEXT,
204
+ data TEXT NOT NULL,
205
+ type TEXT NOT NULL,
206
+ created_at TEXT NOT NULL,
207
+ updated_at TEXT,
208
+ lens_entry_id TEXT NULL
209
+ );
210
+ `;
211
+ const createIndex = `
212
+ CREATE INDEX IF NOT EXISTS lens_entries_id_type_index
213
+ ON ${TABLE_NAME} (id, type);
214
+ `;
215
+ this.connection.exec(createTable);
216
+ this.connection.exec(createIndex);
217
+ }
218
+ mapRow(row, includeFullData = true) {
219
+ let data = includeFullData ? JSON.parse(row.data) : {};
220
+ if (!includeFullData) {
221
+ data = JSON.parse(row.minimal_data);
222
+ }
223
+ return {
224
+ id: row.id,
225
+ type: row.type,
226
+ created_at: row.created_at,
227
+ lens_entry_id: row.lens_entry_id,
228
+ data
229
+ };
230
+ }
231
+ mapRows(rows, includeFullData = true) {
232
+ let mappedRows = [];
233
+ for (const row of rows) {
234
+ mappedRows.push(this.mapRow(row, includeFullData));
235
+ }
236
+ return mappedRows;
237
+ }
238
+ getSelectedColumns(includeFullData = true) {
239
+ return `SELECT id, minimal_data, type, created_at, lens_entry_id ${includeFullData ? ",data" : ""}`;
240
+ }
241
+ };
242
+
243
+ // src/utils/index.ts
244
+ import { DateTime } from "luxon";
245
+ import { format } from "sql-formatter";
246
+ import { randomUUID as randomUUID2 } from "crypto";
247
+ import { fileURLToPath } from "url";
248
+ import * as path from "path";
249
+ function getMeta(metaUrl) {
250
+ const isESM = typeof __dirname === "undefined";
251
+ if (isESM) {
252
+ if (!metaUrl) {
253
+ throw new Error("In ESM, you must pass import.meta.url to getMeta()");
254
+ }
255
+ const __filename2 = fileURLToPath(metaUrl);
256
+ const __dirname2 = path.dirname(__filename2);
257
+ return { __filename: __filename2, __dirname: __dirname2 };
258
+ } else {
259
+ return { __filename, __dirname };
260
+ }
261
+ }
262
+
263
+ // src/core/lens.ts
264
+ var Lens = class {
265
+ static watchers = /* @__PURE__ */ new Map();
266
+ static store;
267
+ static adapter;
268
+ static watch(watcher) {
269
+ this.watchers.set(watcher.name, watcher);
270
+ return this;
271
+ }
272
+ static setWatchers(watchers) {
273
+ this.watchers = new Map(watchers.map((watcher) => [watcher.name, watcher]));
274
+ return this;
275
+ }
276
+ static async start(config = {
277
+ basePath: "lens",
278
+ appName: "Lens",
279
+ enabled: true
280
+ }) {
281
+ if (!config.enabled) {
282
+ return;
283
+ }
284
+ await this.bindContainerDeps(config);
285
+ let adapter = this.getAdapter();
286
+ adapter.setWatchers(Array.from(this.watchers.values())).setup();
287
+ const { apiRoutes } = this.getRoutes({
288
+ basePath: config.basePath
289
+ });
290
+ adapter.registerRoutes(apiRoutes);
291
+ const { __dirname: __dirname2 } = getMeta(import.meta.url);
292
+ const uiPath = path2.resolve(this.normalizeDirName(__dirname2), "ui");
293
+ adapter.serveUI(uiPath, config.basePath, getUiConfig());
294
+ }
295
+ static setStore(store) {
296
+ this.store = store;
297
+ return this;
298
+ }
299
+ static async getStore() {
300
+ return this.store ?? await this.getDefaultStore();
301
+ }
302
+ static setAdapter(adapter) {
303
+ this.adapter = adapter;
304
+ return this;
305
+ }
306
+ static getAdapter() {
307
+ if (!this.adapter) {
308
+ throw new Error("No adapter has been set");
309
+ }
310
+ return this.adapter;
311
+ }
312
+ static async bindContainerDeps(config) {
313
+ const dbStore = await this.getStore();
314
+ Container.singleton("store", () => dbStore);
315
+ Container.singleton("uiConfig", () => {
316
+ return {
317
+ appName: config.appName,
318
+ path: `/${config.basePath}`,
319
+ api: {
320
+ requests: `/${config.basePath}/api/requests`,
321
+ queries: `/${config.basePath}/api/queries`,
322
+ truncate: `/${config.basePath}/api/truncate`
323
+ }
324
+ };
325
+ });
326
+ }
327
+ static getRoutes({ basePath }) {
328
+ const apiRoutes = [
329
+ {
330
+ method: "GET",
331
+ path: `/lens-config`,
332
+ handler: () => ApiController.fetchUiConfig()
333
+ },
334
+ {
335
+ method: "GET",
336
+ path: `${basePath}/api/requests`,
337
+ handler: async (data) => await ApiController.getRequests(data)
338
+ },
339
+ {
340
+ method: "GET",
341
+ path: `${basePath}/api/requests/:id`,
342
+ handler: async (data) => await ApiController.getRequest(data)
343
+ },
344
+ {
345
+ method: "GET",
346
+ path: `${basePath}/api/queries`,
347
+ handler: async (data) => await ApiController.getQueries(data)
348
+ },
349
+ {
350
+ method: "GET",
351
+ path: `${basePath}/api/queries/:id`,
352
+ handler: async (data) => await ApiController.getQuery(data)
353
+ },
354
+ {
355
+ method: "DELETE",
356
+ path: `${basePath}/api/truncate`,
357
+ handler: async () => await ApiController.truncate()
358
+ }
359
+ ];
360
+ return { apiRoutes };
361
+ }
362
+ static async getDefaultStore() {
363
+ const store = new BetterSqliteStore();
364
+ await store.initialize();
365
+ return store;
366
+ }
367
+ static normalizeDirName(path3) {
368
+ return path3.replace(/(\/packages\/)[^/]+(?=\/dist)/, "$1core");
369
+ }
370
+ };
13
371
  export {
14
372
  Lens as default
15
373
  };
@@ -1,7 +1,27 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
2
19
 
3
- var _chunkEKG3FVLVcjs = require('../chunk-EKG3FVLV.cjs');
4
- require('../chunk-75ZPJI57.cjs');
5
-
6
-
7
- exports.default = _chunkEKG3FVLVcjs.Watcher;
20
+ // src/core/watcher.ts
21
+ var watcher_exports = {};
22
+ __export(watcher_exports, {
23
+ default: () => Watcher
24
+ });
25
+ module.exports = __toCommonJS(watcher_exports);
26
+ var Watcher = class {
27
+ };
@@ -1,7 +1,6 @@
1
- import {
2
- Watcher
3
- } from "../chunk-CQ2Z4TCR.js";
4
- import "../chunk-MLKGABMK.js";
1
+ // src/core/watcher.ts
2
+ var Watcher = class {
3
+ };
5
4
  export {
6
5
  Watcher as default
7
6
  };
@@ -1,4 +1,3 @@
1
- import { DateTime } from 'luxon';
2
1
  import { SqlLanguage } from 'sql-formatter';
3
2
 
4
3
  declare const generateRandomUuid: () => `${string}-${string}-${string}-${string}-${string}`;
@@ -12,10 +11,6 @@ type Bindings = any[] | Record<string, any>;
12
11
  */
13
12
  declare function interpolateQuery(query: string, bindings: Bindings): string;
14
13
  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
14
  declare function getMeta(metaUrl?: string): {
20
15
  __filename: string;
21
16
  __dirname: string;
@@ -29,21 +24,17 @@ declare function prepareIgnoredPaths(path: string, ignoredPaths: RegExp[]): {
29
24
  declare function shouldIgnoreCurrentPath(path: string, ignoredPaths: RegExp[], onlyPaths: RegExp[]): boolean;
30
25
  declare function prettyHrTime(hrtime: [number, number], verbose?: boolean): string;
31
26
 
32
- declare const index_convertToUTC: typeof convertToUTC;
33
27
  declare const index_formatSqlQuery: typeof formatSqlQuery;
34
28
  declare const index_generateRandomUuid: typeof generateRandomUuid;
35
29
  declare const index_getMeta: typeof getMeta;
36
30
  declare const index_interpolateQuery: typeof interpolateQuery;
37
31
  declare const index_isStaticFile: typeof isStaticFile;
38
- declare const index_now: typeof now;
39
- declare const index_nowISO: typeof nowISO;
40
32
  declare const index_prepareIgnoredPaths: typeof prepareIgnoredPaths;
41
33
  declare const index_prettyHrTime: typeof prettyHrTime;
42
34
  declare const index_shouldIgnoreCurrentPath: typeof shouldIgnoreCurrentPath;
43
- declare const index_sqlDateTime: typeof sqlDateTime;
44
35
  declare const index_stripBeforeAssetsPath: typeof stripBeforeAssetsPath;
45
36
  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 };
37
+ export { index_formatSqlQuery as formatSqlQuery, index_generateRandomUuid as generateRandomUuid, index_getMeta as getMeta, index_interpolateQuery as interpolateQuery, index_isStaticFile as isStaticFile, index_prepareIgnoredPaths as prepareIgnoredPaths, index_prettyHrTime as prettyHrTime, index_shouldIgnoreCurrentPath as shouldIgnoreCurrentPath, index_stripBeforeAssetsPath as stripBeforeAssetsPath };
47
38
  }
48
39
 
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 };
40
+ export { interpolateQuery as a, getMeta as b, isStaticFile as c, shouldIgnoreCurrentPath as d, prettyHrTime as e, formatSqlQuery as f, generateRandomUuid as g, index as i, prepareIgnoredPaths as p, stripBeforeAssetsPath as s };
@@ -1,4 +1,3 @@
1
- import { DateTime } from 'luxon';
2
1
  import { SqlLanguage } from 'sql-formatter';
3
2
 
4
3
  declare const generateRandomUuid: () => `${string}-${string}-${string}-${string}-${string}`;
@@ -12,10 +11,6 @@ type Bindings = any[] | Record<string, any>;
12
11
  */
13
12
  declare function interpolateQuery(query: string, bindings: Bindings): string;
14
13
  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
14
  declare function getMeta(metaUrl?: string): {
20
15
  __filename: string;
21
16
  __dirname: string;
@@ -29,21 +24,17 @@ declare function prepareIgnoredPaths(path: string, ignoredPaths: RegExp[]): {
29
24
  declare function shouldIgnoreCurrentPath(path: string, ignoredPaths: RegExp[], onlyPaths: RegExp[]): boolean;
30
25
  declare function prettyHrTime(hrtime: [number, number], verbose?: boolean): string;
31
26
 
32
- declare const index_convertToUTC: typeof convertToUTC;
33
27
  declare const index_formatSqlQuery: typeof formatSqlQuery;
34
28
  declare const index_generateRandomUuid: typeof generateRandomUuid;
35
29
  declare const index_getMeta: typeof getMeta;
36
30
  declare const index_interpolateQuery: typeof interpolateQuery;
37
31
  declare const index_isStaticFile: typeof isStaticFile;
38
- declare const index_now: typeof now;
39
- declare const index_nowISO: typeof nowISO;
40
32
  declare const index_prepareIgnoredPaths: typeof prepareIgnoredPaths;
41
33
  declare const index_prettyHrTime: typeof prettyHrTime;
42
34
  declare const index_shouldIgnoreCurrentPath: typeof shouldIgnoreCurrentPath;
43
- declare const index_sqlDateTime: typeof sqlDateTime;
44
35
  declare const index_stripBeforeAssetsPath: typeof stripBeforeAssetsPath;
45
36
  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 };
37
+ export { index_formatSqlQuery as formatSqlQuery, index_generateRandomUuid as generateRandomUuid, index_getMeta as getMeta, index_interpolateQuery as interpolateQuery, index_isStaticFile as isStaticFile, index_prepareIgnoredPaths as prepareIgnoredPaths, index_prettyHrTime as prettyHrTime, index_shouldIgnoreCurrentPath as shouldIgnoreCurrentPath, index_stripBeforeAssetsPath as stripBeforeAssetsPath };
47
38
  }
48
39
 
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 };
40
+ export { interpolateQuery as a, getMeta as b, isStaticFile as c, shouldIgnoreCurrentPath as d, prettyHrTime as e, formatSqlQuery as f, generateRandomUuid as g, index as i, prepareIgnoredPaths as p, stripBeforeAssetsPath as s };