@lensjs/express 1.2.1 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter.cjs +7 -2
- package/dist/adapter.d.cts +1 -1
- package/dist/adapter.d.ts +1 -1
- package/dist/adapter.js +3 -2
- package/dist/index.cjs +7 -4
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +6 -4
- package/package.json +24 -4
package/dist/adapter.cjs
CHANGED
|
@@ -30,7 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/adapter.ts
|
|
31
31
|
var adapter_exports = {};
|
|
32
32
|
__export(adapter_exports, {
|
|
33
|
-
|
|
33
|
+
ExpressAdapter: () => ExpressAdapter
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(adapter_exports);
|
|
36
36
|
var import_core = require("@lensjs/core");
|
|
@@ -117,7 +117,8 @@ var ExpressAdapter = class extends import_core.LensAdapter {
|
|
|
117
117
|
type: query.type
|
|
118
118
|
};
|
|
119
119
|
await watcher?.log({
|
|
120
|
-
data: queryPayload
|
|
120
|
+
data: queryPayload,
|
|
121
|
+
requestId: import_core.lensContext.getStore()?.requestId
|
|
121
122
|
});
|
|
122
123
|
}
|
|
123
124
|
});
|
|
@@ -213,3 +214,7 @@ var ExpressAdapter = class extends import_core.LensAdapter {
|
|
|
213
214
|
}
|
|
214
215
|
}
|
|
215
216
|
};
|
|
217
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
218
|
+
0 && (module.exports = {
|
|
219
|
+
ExpressAdapter
|
|
220
|
+
});
|
package/dist/adapter.d.cts
CHANGED
package/dist/adapter.d.ts
CHANGED
package/dist/adapter.js
CHANGED
|
@@ -89,7 +89,8 @@ var ExpressAdapter = class extends LensAdapter {
|
|
|
89
89
|
type: query.type
|
|
90
90
|
};
|
|
91
91
|
await watcher?.log({
|
|
92
|
-
data: queryPayload
|
|
92
|
+
data: queryPayload,
|
|
93
|
+
requestId: lensContext.getStore()?.requestId
|
|
93
94
|
});
|
|
94
95
|
}
|
|
95
96
|
});
|
|
@@ -186,5 +187,5 @@ var ExpressAdapter = class extends LensAdapter {
|
|
|
186
187
|
}
|
|
187
188
|
};
|
|
188
189
|
export {
|
|
189
|
-
ExpressAdapter
|
|
190
|
+
ExpressAdapter
|
|
190
191
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
+
ExpressAdapter: () => ExpressAdapter,
|
|
33
34
|
handleExceptions: () => handleExceptions,
|
|
34
35
|
lens: () => lens
|
|
35
36
|
});
|
|
@@ -121,7 +122,8 @@ var ExpressAdapter = class extends import_core.LensAdapter {
|
|
|
121
122
|
type: query.type
|
|
122
123
|
};
|
|
123
124
|
await watcher?.log({
|
|
124
|
-
data: queryPayload
|
|
125
|
+
data: queryPayload,
|
|
126
|
+
requestId: import_core.lensContext.getStore()?.requestId
|
|
125
127
|
});
|
|
126
128
|
}
|
|
127
129
|
});
|
|
@@ -274,9 +276,9 @@ var lens = async (config) => {
|
|
|
274
276
|
basePath: normalizedPath
|
|
275
277
|
});
|
|
276
278
|
return {
|
|
277
|
-
handleExceptions: (
|
|
278
|
-
app,
|
|
279
|
-
enabled: mergedConfig.exceptionWatcherEnabled,
|
|
279
|
+
handleExceptions: () => handleExceptions({
|
|
280
|
+
app: mergedConfig.app,
|
|
281
|
+
enabled: mergedConfig.exceptionWatcherEnabled && mergedConfig.enabled,
|
|
280
282
|
watcher: watchers.find((w) => w.name === import_core3.WatcherTypeEnum.EXCEPTION)
|
|
281
283
|
})
|
|
282
284
|
};
|
|
@@ -298,6 +300,7 @@ function handleExceptions({
|
|
|
298
300
|
}
|
|
299
301
|
// Annotate the CommonJS export names for ESM import in node:
|
|
300
302
|
0 && (module.exports = {
|
|
303
|
+
ExpressAdapter,
|
|
301
304
|
handleExceptions,
|
|
302
305
|
lens
|
|
303
306
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ExceptionWatcher } from '@lensjs/core';
|
|
2
2
|
import { ExpressAdapterConfig } from './types/index.cjs';
|
|
3
|
+
export { RequiredExpressAdapterConfig } from './types/index.cjs';
|
|
3
4
|
import { Application } from 'express';
|
|
5
|
+
export { ExpressAdapter } from './adapter.cjs';
|
|
4
6
|
import '@lensjs/watchers';
|
|
5
7
|
|
|
6
8
|
declare const lens: (config: ExpressAdapterConfig) => Promise<{
|
|
7
|
-
handleExceptions: (
|
|
9
|
+
handleExceptions: () => void;
|
|
8
10
|
}>;
|
|
9
11
|
declare function handleExceptions({ app, enabled, watcher, }: {
|
|
10
12
|
app: Application;
|
|
@@ -12,4 +14,4 @@ declare function handleExceptions({ app, enabled, watcher, }: {
|
|
|
12
14
|
watcher?: ExceptionWatcher;
|
|
13
15
|
}): void;
|
|
14
16
|
|
|
15
|
-
export { handleExceptions, lens };
|
|
17
|
+
export { ExpressAdapterConfig, handleExceptions, lens };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ExceptionWatcher } from '@lensjs/core';
|
|
2
2
|
import { ExpressAdapterConfig } from './types/index.js';
|
|
3
|
+
export { RequiredExpressAdapterConfig } from './types/index.js';
|
|
3
4
|
import { Application } from 'express';
|
|
5
|
+
export { ExpressAdapter } from './adapter.js';
|
|
4
6
|
import '@lensjs/watchers';
|
|
5
7
|
|
|
6
8
|
declare const lens: (config: ExpressAdapterConfig) => Promise<{
|
|
7
|
-
handleExceptions: (
|
|
9
|
+
handleExceptions: () => void;
|
|
8
10
|
}>;
|
|
9
11
|
declare function handleExceptions({ app, enabled, watcher, }: {
|
|
10
12
|
app: Application;
|
|
@@ -12,4 +14,4 @@ declare function handleExceptions({ app, enabled, watcher, }: {
|
|
|
12
14
|
watcher?: ExceptionWatcher;
|
|
13
15
|
}): void;
|
|
14
16
|
|
|
15
|
-
export { handleExceptions, lens };
|
|
17
|
+
export { ExpressAdapterConfig, handleExceptions, lens };
|
package/dist/index.js
CHANGED
|
@@ -99,7 +99,8 @@ var ExpressAdapter = class extends LensAdapter {
|
|
|
99
99
|
type: query.type
|
|
100
100
|
};
|
|
101
101
|
await watcher?.log({
|
|
102
|
-
data: queryPayload
|
|
102
|
+
data: queryPayload,
|
|
103
|
+
requestId: lensContext.getStore()?.requestId
|
|
103
104
|
});
|
|
104
105
|
}
|
|
105
106
|
});
|
|
@@ -252,9 +253,9 @@ var lens = async (config) => {
|
|
|
252
253
|
basePath: normalizedPath
|
|
253
254
|
});
|
|
254
255
|
return {
|
|
255
|
-
handleExceptions: (
|
|
256
|
-
app,
|
|
257
|
-
enabled: mergedConfig.exceptionWatcherEnabled,
|
|
256
|
+
handleExceptions: () => handleExceptions({
|
|
257
|
+
app: mergedConfig.app,
|
|
258
|
+
enabled: mergedConfig.exceptionWatcherEnabled && mergedConfig.enabled,
|
|
258
259
|
watcher: watchers.find((w) => w.name === WatcherTypeEnum2.EXCEPTION)
|
|
259
260
|
})
|
|
260
261
|
};
|
|
@@ -275,6 +276,7 @@ function handleExceptions({
|
|
|
275
276
|
handleUncaughExceptions(watcher);
|
|
276
277
|
}
|
|
277
278
|
export {
|
|
279
|
+
ExpressAdapter,
|
|
278
280
|
handleExceptions,
|
|
279
281
|
lens
|
|
280
282
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lensjs/express",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Express adapter for LensJs",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -8,6 +8,26 @@
|
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"access": "public"
|
|
10
10
|
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"express",
|
|
13
|
+
"lens",
|
|
14
|
+
"monitoring",
|
|
15
|
+
"debugging",
|
|
16
|
+
"logging",
|
|
17
|
+
"database",
|
|
18
|
+
"queries",
|
|
19
|
+
"requests",
|
|
20
|
+
"cache"
|
|
21
|
+
],
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "https://github.com/lensjs/lens.git",
|
|
25
|
+
"directory": "packages/express"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://lensjs.vercel.app/",
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/lensjs/lens/issues"
|
|
30
|
+
},
|
|
11
31
|
"exports": {
|
|
12
32
|
".": {
|
|
13
33
|
"require": "./dist/index.cjs",
|
|
@@ -19,10 +39,10 @@
|
|
|
19
39
|
],
|
|
20
40
|
"dependencies": {
|
|
21
41
|
"express": "^5.1.0",
|
|
22
|
-
"@lensjs/date": "1.0.12",
|
|
23
42
|
"@lensjs/typescript-config": "1.0.12",
|
|
24
|
-
"@lensjs/
|
|
25
|
-
"@lensjs/
|
|
43
|
+
"@lensjs/core": "2.2.1",
|
|
44
|
+
"@lensjs/date": "1.0.12",
|
|
45
|
+
"@lensjs/watchers": "1.0.17"
|
|
26
46
|
},
|
|
27
47
|
"devDependencies": {
|
|
28
48
|
"@types/express": "^5.0.3",
|