@everystack/server 0.2.6 → 0.2.7
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/package.json +1 -1
- package/src/image.ts +2 -2
- package/src/index.ts +3 -14
- package/src/log.ts +16 -0
- package/src/worker.ts +1 -1
package/package.json
CHANGED
package/src/image.ts
CHANGED
|
@@ -14,7 +14,7 @@ import type {
|
|
|
14
14
|
APIGatewayProxyEventV2,
|
|
15
15
|
APIGatewayProxyStructuredResultV2,
|
|
16
16
|
} from 'aws-lambda';
|
|
17
|
-
import { log } from './
|
|
17
|
+
import { log } from './log';
|
|
18
18
|
|
|
19
19
|
export interface S3CacheConfig {
|
|
20
20
|
/** Enable S3 origin cache for processed images. Default: false. */
|
|
@@ -509,7 +509,7 @@ export async function purgeImage(
|
|
|
509
509
|
|
|
510
510
|
let invalidated = false;
|
|
511
511
|
if (options?.kvsArn) {
|
|
512
|
-
const { invalidateKvsPaths } = await import('./kvs
|
|
512
|
+
const { invalidateKvsPaths } = await import('./kvs');
|
|
513
513
|
const mediaPath = (options.pathPrefix ?? '/media/') + key;
|
|
514
514
|
await invalidateKvsPaths(options.kvsArn, [mediaPath]);
|
|
515
515
|
invalidated = true;
|
package/src/index.ts
CHANGED
|
@@ -15,6 +15,8 @@ import type {
|
|
|
15
15
|
APIGatewayProxyStructuredResultV2,
|
|
16
16
|
} from 'aws-lambda';
|
|
17
17
|
|
|
18
|
+
import { log } from './log';
|
|
19
|
+
|
|
18
20
|
// --- Types ---
|
|
19
21
|
|
|
20
22
|
export type Handler = (request: Request) => Promise<Response>;
|
|
@@ -310,17 +312,4 @@ export function createLambdaHandler(
|
|
|
310
312
|
|
|
311
313
|
// --- Structured Logging ---
|
|
312
314
|
|
|
313
|
-
export
|
|
314
|
-
level: string,
|
|
315
|
-
message: string,
|
|
316
|
-
meta?: Record<string, unknown>
|
|
317
|
-
): void {
|
|
318
|
-
console.log(
|
|
319
|
-
JSON.stringify({
|
|
320
|
-
timestamp: new Date().toISOString(),
|
|
321
|
-
level,
|
|
322
|
-
message,
|
|
323
|
-
...meta,
|
|
324
|
-
})
|
|
325
|
-
);
|
|
326
|
-
}
|
|
315
|
+
export { log } from './log';
|
package/src/log.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// --- Structured Logging ---
|
|
2
|
+
|
|
3
|
+
export function log(
|
|
4
|
+
level: string,
|
|
5
|
+
message: string,
|
|
6
|
+
meta?: Record<string, unknown>
|
|
7
|
+
): void {
|
|
8
|
+
console.log(
|
|
9
|
+
JSON.stringify({
|
|
10
|
+
timestamp: new Date().toISOString(),
|
|
11
|
+
level,
|
|
12
|
+
message,
|
|
13
|
+
...meta,
|
|
14
|
+
})
|
|
15
|
+
);
|
|
16
|
+
}
|
package/src/worker.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* The app provides the job handler registry via the init function.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { log } from './
|
|
8
|
+
import { log } from './log';
|
|
9
9
|
|
|
10
10
|
/** Job shape — mirrors @everystack/jobs Job interface (type-compatible, no circular dep). */
|
|
11
11
|
export interface WorkerJob<T = unknown> {
|