@lensjs/core 2.5.0 → 2.6.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.
- package/dist/abstracts/adapter.d.cts +1 -0
- package/dist/abstracts/adapter.d.ts +1 -0
- package/dist/abstracts/store.cjs +3 -0
- package/dist/abstracts/store.d.cts +2 -0
- package/dist/abstracts/store.d.ts +2 -0
- package/dist/abstracts/store.js +3 -0
- package/dist/context/container.d.cts +1 -0
- package/dist/context/container.d.ts +1 -0
- package/dist/context/context.d.cts +1 -0
- package/dist/context/context.d.ts +1 -0
- package/dist/core/api_controller.cjs +19 -1
- package/dist/core/api_controller.d.cts +3 -0
- package/dist/core/api_controller.d.ts +3 -0
- package/dist/core/api_controller.js +19 -1
- package/dist/core/lens.cjs +36 -1
- package/dist/core/lens.d.cts +1 -0
- package/dist/core/lens.d.ts +1 -0
- package/dist/core/lens.js +36 -1
- package/dist/core/watcher.d.cts +1 -0
- package/dist/core/watcher.d.ts +1 -0
- package/dist/index.cjs +60 -3
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +59 -3
- package/dist/mixins/queued_store.d.cts +1 -0
- package/dist/mixins/queued_store.d.ts +1 -0
- package/dist/stores/better_sqlite.cjs +6 -0
- package/dist/stores/better_sqlite.d.cts +9 -0
- package/dist/stores/better_sqlite.d.ts +9 -0
- package/dist/stores/better_sqlite.js +6 -0
- package/dist/stores/index.cjs +6 -0
- package/dist/stores/index.d.cts +1 -0
- package/dist/stores/index.d.ts +1 -0
- package/dist/stores/index.js +6 -0
- package/dist/stores/queued_sqlite.cjs +6 -0
- package/dist/stores/queued_sqlite.d.cts +1 -0
- package/dist/stores/queued_sqlite.d.ts +1 -0
- package/dist/stores/queued_sqlite.js +6 -0
- package/dist/types/index.cjs +1 -0
- package/dist/types/index.d.cts +4 -9
- package/dist/types/index.d.ts +4 -9
- package/dist/types/index.js +1 -0
- package/dist/types/mail.cjs +18 -0
- package/dist/types/mail.d.cts +235 -0
- package/dist/types/mail.d.ts +235 -0
- package/dist/types/mail.js +0 -0
- package/dist/ui/assets/CacheActionBadge-BjZ4pc-P.js +1 -0
- package/dist/ui/assets/CacheEntriesTable-CrVfGRQp.js +1 -0
- package/dist/ui/assets/CacheEntryContainer-C3VFggtA.js +2 -0
- package/dist/ui/assets/{CacheEntryDetails-CBADpZbF.js → CacheEntryDetails-DeBbBbPE.js} +1 -1
- package/dist/ui/assets/CacheEntryDetailsContainer-C91cW6AU.js +2 -0
- package/dist/ui/assets/ExceptionContainer-CfMuOCmH.js +2 -0
- package/dist/ui/assets/{ExceptionDetails-Ck4wRqzO.js → ExceptionDetails-D2OCJVfz.js} +1 -1
- package/dist/ui/assets/ExceptionDetailsContainer-CR-lxRD2.js +2 -0
- package/dist/ui/assets/{ExceptionTable-DB3Qj-dz.js → ExceptionTable-CpkppRjX.js} +1 -1
- package/dist/ui/assets/{JsonViewer-DWH4jnOr.js → JsonViewer-ATo_F1hS.js} +1 -1
- package/dist/ui/assets/{LoadMore-DzhiQWZs.js → LoadMore-BN7PRRRi.js} +1 -1
- package/dist/ui/assets/MailContainer-CT2lVazH.js +2 -0
- package/dist/ui/assets/MailDetails-B653XXBL.js +25 -0
- package/dist/ui/assets/MailDetailsContainer-87DOHjt8.js +2 -0
- package/dist/ui/assets/MailTable-DKB1K8iz.js +1 -0
- package/dist/ui/assets/QueriesContainer-Bk2r-ERW.js +2 -0
- package/dist/ui/assets/{QueryDetailsContainer-DskbLiCu.js → QueryDetailsContainer-SuM5VQhc.js} +7 -7
- package/dist/ui/assets/{QueryTable-D6F5vd_0.js → QueryTable-C2io_PkC.js} +1 -1
- package/dist/ui/assets/RequestDetails-CpThVPU7.js +1 -0
- package/dist/ui/assets/RequestDetailsContainer-BXIDvHw4.js +2 -0
- package/dist/ui/assets/RequestsContainer-CrgOytwQ.js +2 -0
- package/dist/ui/assets/{RequetsTable-BZFI1zdc.js → RequetsTable-DQwdUFOa.js} +1 -1
- package/dist/ui/assets/SearchInput-_Uf26G0_.js +6 -0
- package/dist/ui/assets/StatusCode-BmJMJ27T.js +1 -0
- package/dist/ui/assets/TabbedDataViewer-CSqO-90o.js +2 -0
- package/dist/ui/assets/Table-DHM1Nl4B.js +6 -0
- package/dist/ui/assets/columns-2NwKukUf.js +1 -0
- package/dist/ui/assets/{columns-BrzDipRl.js → columns-B3JsHnVe.js} +1 -1
- package/dist/ui/assets/{columns-BlLxfkXy.js → columns-D2emfeN1.js} +1 -1
- package/dist/ui/assets/{columns-D_gRck3K.js → columns-DbVoTM0z.js} +1 -1
- package/dist/ui/assets/{copy-BtL5cknV.js → copy-DkbKgCsc.js} +1 -1
- package/dist/ui/assets/index-DuJe0XlW.js +129 -0
- package/dist/ui/assets/index-DyMy6gzm.css +1 -0
- package/dist/ui/assets/{useCacheEntries-6yS-HoM5.js → useCacheEntries-ClCDpOYz.js} +1 -1
- package/dist/ui/assets/{useExceptions-CGpZVTaG.js → useExceptions-DeHzgA7U.js} +1 -1
- package/dist/ui/assets/useLensApi-SUqoFD39.js +1 -0
- package/dist/ui/assets/{useLoadMore-99QUZoHk.js → useLoadMore-DdSLuDVd.js} +1 -1
- package/dist/ui/assets/{useQueries-DWLdKE1b.js → useQueries-DeAAkcnt.js} +1 -1
- package/dist/ui/assets/useTanstackApi-DiA8BdmO.js +1 -0
- package/dist/ui/index.html +2 -2
- package/dist/utils/async_context.d.cts +1 -0
- package/dist/utils/async_context.d.ts +1 -0
- package/dist/utils/compose.d.cts +1 -0
- package/dist/utils/compose.d.ts +1 -0
- package/dist/utils/event_emitter.d.cts +2 -0
- package/dist/utils/event_emitter.d.ts +2 -0
- package/dist/utils/exception.d.cts +1 -0
- package/dist/utils/exception.d.ts +1 -0
- package/dist/utils/index.d.cts +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/watchers/cache_watcher.d.cts +1 -0
- package/dist/watchers/cache_watcher.d.ts +1 -0
- package/dist/watchers/exception_watcher.d.cts +1 -0
- package/dist/watchers/exception_watcher.d.ts +1 -0
- package/dist/watchers/index.cjs +21 -0
- package/dist/watchers/index.d.cts +2 -0
- package/dist/watchers/index.d.ts +2 -0
- package/dist/watchers/index.js +20 -0
- package/dist/watchers/mail_watcher.cjs +88 -0
- package/dist/watchers/mail_watcher.d.cts +11 -0
- package/dist/watchers/mail_watcher.d.ts +11 -0
- package/dist/watchers/mail_watcher.js +67 -0
- package/dist/watchers/query_watcher.d.cts +1 -0
- package/dist/watchers/query_watcher.d.ts +1 -0
- package/dist/watchers/request_watcher.d.cts +1 -0
- package/dist/watchers/request_watcher.d.ts +1 -0
- package/package.json +2 -2
- package/dist/ui/assets/CacheActionBadge-DU2ybwlp.js +0 -1
- package/dist/ui/assets/CacheEntriesTable-B5KvEEDm.js +0 -1
- package/dist/ui/assets/CacheEntryContainer-Br3Tvn8k.js +0 -2
- package/dist/ui/assets/CacheEntryDetailsContainer-hj1KrI3J.js +0 -2
- package/dist/ui/assets/ExceptionContainer-5Ov2El_x.js +0 -2
- package/dist/ui/assets/ExceptionDetailsContainer-CwZGYiSC.js +0 -2
- package/dist/ui/assets/QueriesContainer-DL-W0hBH.js +0 -2
- package/dist/ui/assets/RequestDetails-9ePMJXrH.js +0 -1
- package/dist/ui/assets/RequestDetailsContainer-BuhVtYb1.js +0 -2
- package/dist/ui/assets/RequestsContainer-CrLF7ZpJ.js +0 -7
- package/dist/ui/assets/StatusCode-CKfRhO8c.js +0 -1
- package/dist/ui/assets/TabbedDataViewer-DoV369_f.js +0 -2
- package/dist/ui/assets/Table-D3lFs2Tc.js +0 -6
- package/dist/ui/assets/index-CbdHkrK8.js +0 -124
- package/dist/ui/assets/index-DC5vZ53Q.css +0 -1
- package/dist/ui/assets/useLensApi-Bp8UnZ0w.js +0 -1
package/dist/index.js
CHANGED
|
@@ -53,6 +53,7 @@ var WatcherTypeEnum = /* @__PURE__ */ ((WatcherTypeEnum2) => {
|
|
|
53
53
|
WatcherTypeEnum2["QUERY"] = "query";
|
|
54
54
|
WatcherTypeEnum2["CACHE"] = "cache";
|
|
55
55
|
WatcherTypeEnum2["EXCEPTION"] = "exception";
|
|
56
|
+
WatcherTypeEnum2["MAIL"] = "mail";
|
|
56
57
|
return WatcherTypeEnum2;
|
|
57
58
|
})(WatcherTypeEnum || {});
|
|
58
59
|
|
|
@@ -81,11 +82,17 @@ var ApiController = class {
|
|
|
81
82
|
"exception" /* EXCEPTION */,
|
|
82
83
|
false
|
|
83
84
|
);
|
|
85
|
+
const emails = await getStore().allByRequestId(
|
|
86
|
+
request.id,
|
|
87
|
+
"mail" /* MAIL */,
|
|
88
|
+
false
|
|
89
|
+
);
|
|
84
90
|
return this.resourceResponse({
|
|
85
91
|
request,
|
|
86
92
|
queries,
|
|
87
93
|
cacheEntries,
|
|
88
|
-
exceptions
|
|
94
|
+
exceptions,
|
|
95
|
+
emails
|
|
89
96
|
});
|
|
90
97
|
}
|
|
91
98
|
static async getQueries({
|
|
@@ -132,6 +139,18 @@ var ApiController = class {
|
|
|
132
139
|
}
|
|
133
140
|
return this.resourceResponse(exception);
|
|
134
141
|
}
|
|
142
|
+
static async getEmails({ qs }) {
|
|
143
|
+
return this.paginatedResponse(
|
|
144
|
+
await getStore().getAllEmails(this.extractPaginationParams(qs))
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
static async getEmail({ params }) {
|
|
148
|
+
const email = await getStore().find("mail" /* MAIL */, params.id);
|
|
149
|
+
if (!email) {
|
|
150
|
+
return this.notFoundResponse();
|
|
151
|
+
}
|
|
152
|
+
return this.resourceResponse(email);
|
|
153
|
+
}
|
|
135
154
|
static async truncate() {
|
|
136
155
|
await getStore().truncate();
|
|
137
156
|
return this.baseResponse({}, 200, "All entries cleared");
|
|
@@ -189,6 +208,9 @@ var Store = class {
|
|
|
189
208
|
getAllExceptions(_paginationParams) {
|
|
190
209
|
return this.defaultMinimalPaginate();
|
|
191
210
|
}
|
|
211
|
+
getAllEmails(_paginationParams) {
|
|
212
|
+
return this.defaultMinimalPaginate();
|
|
213
|
+
}
|
|
192
214
|
stringifyData(data) {
|
|
193
215
|
if (typeof data === "string") {
|
|
194
216
|
return data;
|
|
@@ -253,6 +275,9 @@ var BetterSqliteStore = class extends Store {
|
|
|
253
275
|
async getAllExceptions(pagination) {
|
|
254
276
|
return await this.paginate("exception" /* EXCEPTION */, pagination, false);
|
|
255
277
|
}
|
|
278
|
+
async getAllEmails(pagination) {
|
|
279
|
+
return await this.paginate("mail" /* MAIL */, pagination, false);
|
|
280
|
+
}
|
|
256
281
|
async allByRequestId(requestId, type, includeFullData = true) {
|
|
257
282
|
const rows = this.connection.prepare(
|
|
258
283
|
`${this.getSelectedColumns(includeFullData)} FROM ${TABLE_NAME} WHERE type = $type AND lens_entry_id = $requestId ORDER BY created_at DESC`
|
|
@@ -698,6 +723,16 @@ var Lens = class {
|
|
|
698
723
|
path: `/${path4}/api/exceptions/:id`,
|
|
699
724
|
handler: async (data) => await ApiController.getException(data)
|
|
700
725
|
},
|
|
726
|
+
{
|
|
727
|
+
method: "GET",
|
|
728
|
+
path: `/${path4}/api/mail`,
|
|
729
|
+
handler: async (data) => await ApiController.getEmails(data)
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
method: "GET",
|
|
733
|
+
path: `/${path4}/api/mail/:id`,
|
|
734
|
+
handler: async (data) => await ApiController.getEmail(data)
|
|
735
|
+
},
|
|
701
736
|
{
|
|
702
737
|
method: "DELETE",
|
|
703
738
|
path: `/${path4}/api/truncate`,
|
|
@@ -718,6 +753,7 @@ var Lens = class {
|
|
|
718
753
|
queries: `/${this.config.path}/api/queries`,
|
|
719
754
|
cache: `/${this.config.path}/api/cache`,
|
|
720
755
|
exceptions: `/${this.config.path}/api/exceptions`,
|
|
756
|
+
mail: `/${this.config.path}/api/mail`,
|
|
721
757
|
truncate: `/${this.config.path}/api/truncate`
|
|
722
758
|
}
|
|
723
759
|
};
|
|
@@ -870,6 +906,25 @@ var ExceptionWatcher = class extends Watcher {
|
|
|
870
906
|
}
|
|
871
907
|
};
|
|
872
908
|
|
|
909
|
+
// src/watchers/mail_watcher.ts
|
|
910
|
+
import { nowISO as nowISO2 } from "@lensjs/date";
|
|
911
|
+
var MailWatcher = class extends Watcher {
|
|
912
|
+
name = "mail" /* MAIL */;
|
|
913
|
+
async log(data) {
|
|
914
|
+
const recipientsCount = (data.to?.length ?? 0) + (data.cc?.length ?? 0) + (data.bcc?.length ?? 0);
|
|
915
|
+
await getStore().save({
|
|
916
|
+
requestId: data.requestId ?? "",
|
|
917
|
+
type: this.name,
|
|
918
|
+
minimal_data: {
|
|
919
|
+
subject: data.subject ?? "",
|
|
920
|
+
recipientsCount,
|
|
921
|
+
createdAt: data.date ?? nowISO2()
|
|
922
|
+
},
|
|
923
|
+
data
|
|
924
|
+
});
|
|
925
|
+
}
|
|
926
|
+
};
|
|
927
|
+
|
|
873
928
|
// src/abstracts/adapter.ts
|
|
874
929
|
var Adapter = class {
|
|
875
930
|
watchers = [];
|
|
@@ -907,7 +962,7 @@ __export(exception_exports, {
|
|
|
907
962
|
import StackUtils from "stack-utils";
|
|
908
963
|
import path3 from "path";
|
|
909
964
|
import { existsSync, readFileSync } from "fs";
|
|
910
|
-
import { nowISO as
|
|
965
|
+
import { nowISO as nowISO3 } from "@lensjs/date";
|
|
911
966
|
var stackUtils = new StackUtils({
|
|
912
967
|
cwd: process.cwd(),
|
|
913
968
|
internals: StackUtils.nodeInternals()
|
|
@@ -976,7 +1031,7 @@ function constructErrorObject(err) {
|
|
|
976
1031
|
return {
|
|
977
1032
|
name: err.name,
|
|
978
1033
|
message: err.message,
|
|
979
|
-
createdAt:
|
|
1034
|
+
createdAt: nowISO3(),
|
|
980
1035
|
fileInfo: {
|
|
981
1036
|
file: fileInfo.file,
|
|
982
1037
|
function: fileInfo.function
|
|
@@ -1038,6 +1093,7 @@ export {
|
|
|
1038
1093
|
Adapter as LensAdapter,
|
|
1039
1094
|
Store as LensStore,
|
|
1040
1095
|
Watcher as LensWatcher,
|
|
1096
|
+
MailWatcher,
|
|
1041
1097
|
QueryWatcher,
|
|
1042
1098
|
QueuedSqliteStore,
|
|
1043
1099
|
RequestWatcher,
|
|
@@ -42,6 +42,9 @@ var Store = class {
|
|
|
42
42
|
getAllExceptions(_paginationParams) {
|
|
43
43
|
return this.defaultMinimalPaginate();
|
|
44
44
|
}
|
|
45
|
+
getAllEmails(_paginationParams) {
|
|
46
|
+
return this.defaultMinimalPaginate();
|
|
47
|
+
}
|
|
45
48
|
stringifyData(data) {
|
|
46
49
|
if (typeof data === "string") {
|
|
47
50
|
return data;
|
|
@@ -106,6 +109,9 @@ var BetterSqliteStore = class extends Store {
|
|
|
106
109
|
async getAllExceptions(pagination) {
|
|
107
110
|
return await this.paginate("exception" /* EXCEPTION */, pagination, false);
|
|
108
111
|
}
|
|
112
|
+
async getAllEmails(pagination) {
|
|
113
|
+
return await this.paginate("mail" /* MAIL */, pagination, false);
|
|
114
|
+
}
|
|
109
115
|
async allByRequestId(requestId, type, includeFullData = true) {
|
|
110
116
|
const rows = this.connection.prepare(
|
|
111
117
|
`${this.getSelectedColumns(includeFullData)} FROM ${TABLE_NAME} WHERE type = $type AND lens_entry_id = $requestId ORDER BY created_at DESC`
|
|
@@ -2,6 +2,7 @@ import Store from '../abstracts/store.cjs';
|
|
|
2
2
|
import { WatcherTypeEnum, LensEntry, PaginationParams } from '../types/index.cjs';
|
|
3
3
|
import Database from 'libsql';
|
|
4
4
|
import 'sql-formatter';
|
|
5
|
+
import '../types/mail.cjs';
|
|
5
6
|
|
|
6
7
|
declare class BetterSqliteStore extends Store {
|
|
7
8
|
protected connection: Database.Database;
|
|
@@ -47,6 +48,14 @@ declare class BetterSqliteStore extends Store {
|
|
|
47
48
|
};
|
|
48
49
|
data: T;
|
|
49
50
|
}>;
|
|
51
|
+
getAllEmails<T extends Omit<LensEntry, "data">[]>(pagination: PaginationParams): Promise<{
|
|
52
|
+
meta: {
|
|
53
|
+
total: number;
|
|
54
|
+
lastPage: number;
|
|
55
|
+
currentPage: number;
|
|
56
|
+
};
|
|
57
|
+
data: T;
|
|
58
|
+
}>;
|
|
50
59
|
allByRequestId(requestId: string, type: WatcherTypeEnum, includeFullData?: boolean): Promise<LensEntry[]>;
|
|
51
60
|
paginate<T>(type: WatcherTypeEnum, { page, perPage }: PaginationParams, includeFullData?: boolean): Promise<{
|
|
52
61
|
meta: {
|
|
@@ -2,6 +2,7 @@ import Store from '../abstracts/store.js';
|
|
|
2
2
|
import { WatcherTypeEnum, LensEntry, PaginationParams } from '../types/index.js';
|
|
3
3
|
import Database from 'libsql';
|
|
4
4
|
import 'sql-formatter';
|
|
5
|
+
import '../types/mail.js';
|
|
5
6
|
|
|
6
7
|
declare class BetterSqliteStore extends Store {
|
|
7
8
|
protected connection: Database.Database;
|
|
@@ -47,6 +48,14 @@ declare class BetterSqliteStore extends Store {
|
|
|
47
48
|
};
|
|
48
49
|
data: T;
|
|
49
50
|
}>;
|
|
51
|
+
getAllEmails<T extends Omit<LensEntry, "data">[]>(pagination: PaginationParams): Promise<{
|
|
52
|
+
meta: {
|
|
53
|
+
total: number;
|
|
54
|
+
lastPage: number;
|
|
55
|
+
currentPage: number;
|
|
56
|
+
};
|
|
57
|
+
data: T;
|
|
58
|
+
}>;
|
|
50
59
|
allByRequestId(requestId: string, type: WatcherTypeEnum, includeFullData?: boolean): Promise<LensEntry[]>;
|
|
51
60
|
paginate<T>(type: WatcherTypeEnum, { page, perPage }: PaginationParams, includeFullData?: boolean): Promise<{
|
|
52
61
|
meta: {
|
|
@@ -6,6 +6,9 @@ var Store = class {
|
|
|
6
6
|
getAllExceptions(_paginationParams) {
|
|
7
7
|
return this.defaultMinimalPaginate();
|
|
8
8
|
}
|
|
9
|
+
getAllEmails(_paginationParams) {
|
|
10
|
+
return this.defaultMinimalPaginate();
|
|
11
|
+
}
|
|
9
12
|
stringifyData(data) {
|
|
10
13
|
if (typeof data === "string") {
|
|
11
14
|
return data;
|
|
@@ -70,6 +73,9 @@ var BetterSqliteStore = class extends Store {
|
|
|
70
73
|
async getAllExceptions(pagination) {
|
|
71
74
|
return await this.paginate("exception" /* EXCEPTION */, pagination, false);
|
|
72
75
|
}
|
|
76
|
+
async getAllEmails(pagination) {
|
|
77
|
+
return await this.paginate("mail" /* MAIL */, pagination, false);
|
|
78
|
+
}
|
|
73
79
|
async allByRequestId(requestId, type, includeFullData = true) {
|
|
74
80
|
const rows = this.connection.prepare(
|
|
75
81
|
`${this.getSelectedColumns(includeFullData)} FROM ${TABLE_NAME} WHERE type = $type AND lens_entry_id = $requestId ORDER BY created_at DESC`
|
package/dist/stores/index.cjs
CHANGED
|
@@ -43,6 +43,9 @@ var Store = class {
|
|
|
43
43
|
getAllExceptions(_paginationParams) {
|
|
44
44
|
return this.defaultMinimalPaginate();
|
|
45
45
|
}
|
|
46
|
+
getAllEmails(_paginationParams) {
|
|
47
|
+
return this.defaultMinimalPaginate();
|
|
48
|
+
}
|
|
46
49
|
stringifyData(data) {
|
|
47
50
|
if (typeof data === "string") {
|
|
48
51
|
return data;
|
|
@@ -107,6 +110,9 @@ var BetterSqliteStore = class extends Store {
|
|
|
107
110
|
async getAllExceptions(pagination) {
|
|
108
111
|
return await this.paginate("exception" /* EXCEPTION */, pagination, false);
|
|
109
112
|
}
|
|
113
|
+
async getAllEmails(pagination) {
|
|
114
|
+
return await this.paginate("mail" /* MAIL */, pagination, false);
|
|
115
|
+
}
|
|
110
116
|
async allByRequestId(requestId, type, includeFullData = true) {
|
|
111
117
|
const rows = this.connection.prepare(
|
|
112
118
|
`${this.getSelectedColumns(includeFullData)} FROM ${TABLE_NAME} WHERE type = $type AND lens_entry_id = $requestId ORDER BY created_at DESC`
|
package/dist/stores/index.d.cts
CHANGED
package/dist/stores/index.d.ts
CHANGED
package/dist/stores/index.js
CHANGED
|
@@ -6,6 +6,9 @@ var Store = class {
|
|
|
6
6
|
getAllExceptions(_paginationParams) {
|
|
7
7
|
return this.defaultMinimalPaginate();
|
|
8
8
|
}
|
|
9
|
+
getAllEmails(_paginationParams) {
|
|
10
|
+
return this.defaultMinimalPaginate();
|
|
11
|
+
}
|
|
9
12
|
stringifyData(data) {
|
|
10
13
|
if (typeof data === "string") {
|
|
11
14
|
return data;
|
|
@@ -70,6 +73,9 @@ var BetterSqliteStore = class extends Store {
|
|
|
70
73
|
async getAllExceptions(pagination) {
|
|
71
74
|
return await this.paginate("exception" /* EXCEPTION */, pagination, false);
|
|
72
75
|
}
|
|
76
|
+
async getAllEmails(pagination) {
|
|
77
|
+
return await this.paginate("mail" /* MAIL */, pagination, false);
|
|
78
|
+
}
|
|
73
79
|
async allByRequestId(requestId, type, includeFullData = true) {
|
|
74
80
|
const rows = this.connection.prepare(
|
|
75
81
|
`${this.getSelectedColumns(includeFullData)} FROM ${TABLE_NAME} WHERE type = $type AND lens_entry_id = $requestId ORDER BY created_at DESC`
|
|
@@ -124,6 +124,9 @@ var Store = class {
|
|
|
124
124
|
getAllExceptions(_paginationParams) {
|
|
125
125
|
return this.defaultMinimalPaginate();
|
|
126
126
|
}
|
|
127
|
+
getAllEmails(_paginationParams) {
|
|
128
|
+
return this.defaultMinimalPaginate();
|
|
129
|
+
}
|
|
127
130
|
stringifyData(data) {
|
|
128
131
|
if (typeof data === "string") {
|
|
129
132
|
return data;
|
|
@@ -188,6 +191,9 @@ var BetterSqliteStore = class extends Store {
|
|
|
188
191
|
async getAllExceptions(pagination) {
|
|
189
192
|
return await this.paginate("exception" /* EXCEPTION */, pagination, false);
|
|
190
193
|
}
|
|
194
|
+
async getAllEmails(pagination) {
|
|
195
|
+
return await this.paginate("mail" /* MAIL */, pagination, false);
|
|
196
|
+
}
|
|
191
197
|
async allByRequestId(requestId, type, includeFullData = true) {
|
|
192
198
|
const rows = this.connection.prepare(
|
|
193
199
|
`${this.getSelectedColumns(includeFullData)} FROM ${TABLE_NAME} WHERE type = $type AND lens_entry_id = $requestId ORDER BY created_at DESC`
|
|
@@ -88,6 +88,9 @@ var Store = class {
|
|
|
88
88
|
getAllExceptions(_paginationParams) {
|
|
89
89
|
return this.defaultMinimalPaginate();
|
|
90
90
|
}
|
|
91
|
+
getAllEmails(_paginationParams) {
|
|
92
|
+
return this.defaultMinimalPaginate();
|
|
93
|
+
}
|
|
91
94
|
stringifyData(data) {
|
|
92
95
|
if (typeof data === "string") {
|
|
93
96
|
return data;
|
|
@@ -152,6 +155,9 @@ var BetterSqliteStore = class extends Store {
|
|
|
152
155
|
async getAllExceptions(pagination) {
|
|
153
156
|
return await this.paginate("exception" /* EXCEPTION */, pagination, false);
|
|
154
157
|
}
|
|
158
|
+
async getAllEmails(pagination) {
|
|
159
|
+
return await this.paginate("mail" /* MAIL */, pagination, false);
|
|
160
|
+
}
|
|
155
161
|
async allByRequestId(requestId, type, includeFullData = true) {
|
|
156
162
|
const rows = this.connection.prepare(
|
|
157
163
|
`${this.getSelectedColumns(includeFullData)} FROM ${TABLE_NAME} WHERE type = $type AND lens_entry_id = $requestId ORDER BY created_at DESC`
|
package/dist/types/index.cjs
CHANGED
|
@@ -28,6 +28,7 @@ var WatcherTypeEnum = /* @__PURE__ */ ((WatcherTypeEnum2) => {
|
|
|
28
28
|
WatcherTypeEnum2["QUERY"] = "query";
|
|
29
29
|
WatcherTypeEnum2["CACHE"] = "cache";
|
|
30
30
|
WatcherTypeEnum2["EXCEPTION"] = "exception";
|
|
31
|
+
WatcherTypeEnum2["MAIL"] = "mail";
|
|
31
32
|
return WatcherTypeEnum2;
|
|
32
33
|
})(WatcherTypeEnum || {});
|
|
33
34
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SqlLanguage } from 'sql-formatter';
|
|
2
|
+
export { MailEntry, MailEnvelope, MailHeader, MailMeta, MailRawSource, Mailbox, MimePart } from './mail.cjs';
|
|
2
3
|
|
|
3
4
|
type QueryType = Required<SqlLanguage | "mongodb">;
|
|
4
5
|
type SqlQueryType = Exclude<QueryType, "mongodb">;
|
|
@@ -79,18 +80,12 @@ type RequestEntry = {
|
|
|
79
80
|
};
|
|
80
81
|
user?: UserEntry | null;
|
|
81
82
|
};
|
|
82
|
-
type Entry = {
|
|
83
|
-
type: "query";
|
|
84
|
-
data: QueryEntry;
|
|
85
|
-
} | {
|
|
86
|
-
type: "request";
|
|
87
|
-
data: RequestEntry;
|
|
88
|
-
};
|
|
89
83
|
declare enum WatcherTypeEnum {
|
|
90
84
|
REQUEST = "request",
|
|
91
85
|
QUERY = "query",
|
|
92
86
|
CACHE = "cache",
|
|
93
|
-
EXCEPTION = "exception"
|
|
87
|
+
EXCEPTION = "exception",
|
|
88
|
+
MAIL = "mail"
|
|
94
89
|
}
|
|
95
90
|
type LensConfig = {
|
|
96
91
|
path: string;
|
|
@@ -149,4 +144,4 @@ interface QueuedStoreConfig {
|
|
|
149
144
|
dbPruneSizeGb?: number;
|
|
150
145
|
}
|
|
151
146
|
|
|
152
|
-
export { type ApiResponse, type CacheAction, type CacheEntry, type Constructor, type
|
|
147
|
+
export { type ApiResponse, type CacheAction, type CacheEntry, type Constructor, type ExceptionEntry, type HttpMethod, type LensConfig, type LensEntry, type PaginationParams, type Paginator, type QueryEntry, type QueryType, type QueuedStoreConfig, type RequestEntry, type RouteDefinition, type RouteDefinitionHandler, type RouteHttpMethod, type SqlQueryType, type UserEntry, WatcherTypeEnum };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SqlLanguage } from 'sql-formatter';
|
|
2
|
+
export { MailEntry, MailEnvelope, MailHeader, MailMeta, MailRawSource, Mailbox, MimePart } from './mail.js';
|
|
2
3
|
|
|
3
4
|
type QueryType = Required<SqlLanguage | "mongodb">;
|
|
4
5
|
type SqlQueryType = Exclude<QueryType, "mongodb">;
|
|
@@ -79,18 +80,12 @@ type RequestEntry = {
|
|
|
79
80
|
};
|
|
80
81
|
user?: UserEntry | null;
|
|
81
82
|
};
|
|
82
|
-
type Entry = {
|
|
83
|
-
type: "query";
|
|
84
|
-
data: QueryEntry;
|
|
85
|
-
} | {
|
|
86
|
-
type: "request";
|
|
87
|
-
data: RequestEntry;
|
|
88
|
-
};
|
|
89
83
|
declare enum WatcherTypeEnum {
|
|
90
84
|
REQUEST = "request",
|
|
91
85
|
QUERY = "query",
|
|
92
86
|
CACHE = "cache",
|
|
93
|
-
EXCEPTION = "exception"
|
|
87
|
+
EXCEPTION = "exception",
|
|
88
|
+
MAIL = "mail"
|
|
94
89
|
}
|
|
95
90
|
type LensConfig = {
|
|
96
91
|
path: string;
|
|
@@ -149,4 +144,4 @@ interface QueuedStoreConfig {
|
|
|
149
144
|
dbPruneSizeGb?: number;
|
|
150
145
|
}
|
|
151
146
|
|
|
152
|
-
export { type ApiResponse, type CacheAction, type CacheEntry, type Constructor, type
|
|
147
|
+
export { type ApiResponse, type CacheAction, type CacheEntry, type Constructor, type ExceptionEntry, type HttpMethod, type LensConfig, type LensEntry, type PaginationParams, type Paginator, type QueryEntry, type QueryType, type QueuedStoreConfig, type RequestEntry, type RouteDefinition, type RouteDefinitionHandler, type RouteHttpMethod, type SqlQueryType, type UserEntry, WatcherTypeEnum };
|
package/dist/types/index.js
CHANGED
|
@@ -4,6 +4,7 @@ var WatcherTypeEnum = /* @__PURE__ */ ((WatcherTypeEnum2) => {
|
|
|
4
4
|
WatcherTypeEnum2["QUERY"] = "query";
|
|
5
5
|
WatcherTypeEnum2["CACHE"] = "cache";
|
|
6
6
|
WatcherTypeEnum2["EXCEPTION"] = "exception";
|
|
7
|
+
WatcherTypeEnum2["MAIL"] = "mail";
|
|
7
8
|
return WatcherTypeEnum2;
|
|
8
9
|
})(WatcherTypeEnum || {});
|
|
9
10
|
export {
|
|
@@ -0,0 +1,18 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/types/mail.ts
|
|
17
|
+
var mail_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(mail_exports);
|