@mono-labs/dev 0.1.278 → 0.1.282
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/aws-event-synthesis/index.d.ts +1 -0
- package/dist/aws-event-synthesis/index.d.ts.map +1 -1
- package/dist/aws-event-synthesis/index.js +5 -0
- package/dist/local-server/index.d.ts.map +1 -1
- package/dist/local-server/index.js +0 -2
- package/package.json +1 -1
- package/src/aws-event-synthesis/index.ts +7 -0
- package/src/local-server/index.ts +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/aws-event-synthesis/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAIvC,oEAAoE;AACpE,wBAAgB,cAAc,CAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GACpD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOxB;AAED,mGAAmG;AACnG,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAI1D;AAED,yEAAyE;AACzE,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAOpC;AAED,iDAAiD;AACjD,wBAAgB,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAOnF;AAID,kCAAkC;AAClC,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,2CAA2C;AAC3C,wBAAgB,uBAAuB,CAAC,YAAY,CAAC,EAAE,MAAM,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E,QAAQ,EACb,MAAM,EAAE;IACP,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CAClB,GACC,IAAI,CAqBN"}
|
|
@@ -80,6 +80,11 @@ function sendLambdaResult(res, result) {
|
|
|
80
80
|
res.setHeader(key, value);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
+
if (result.cookies) {
|
|
84
|
+
for (const cookie of result.cookies) {
|
|
85
|
+
res.append('set-cookie', cookie);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
83
88
|
if (result.isBase64Encoded && result.body) {
|
|
84
89
|
const buffer = Buffer.from(result.body, 'base64');
|
|
85
90
|
res.status(statusCode).send(buffer);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/local-server/index.ts"],"names":[],"mappings":"AAEA,OAAO,OAAO,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/local-server/index.ts"],"names":[],"mappings":"AAEA,OAAO,OAAO,MAAM,SAAS,CAAC;AAY9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EACX,iBAAiB,EACjB,UAAU,EACV,uBAAuB,EACvB,gBAAgB,EAChB,iBAAiB,EACjB,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEhF,qBAAa,WAAW;IACvB,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC;IAC9B,OAAO,CAAC,UAAU,CAAc;IAChC,OAAO,CAAC,MAAM,CAAoB;gBAEtB,MAAM,CAAC,EAAE,iBAAiB;IActC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,IAAI;IACtD,MAAM,CACL,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,uBAAuB,GAC9B,IAAI;IACP,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,GAAG,IAAI;IAmC1E,YAAY,CAEX,MAAM,CAAC,EAAE,mBAAmB,GAC1B,UAAU,CAAC,OAAO,mBAAmB,CAAC;IAUzC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI;CAS7C"}
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.LocalServer = void 0;
|
|
7
7
|
const node_http_1 = __importDefault(require("node:http"));
|
|
8
8
|
const express_1 = __importDefault(require("express"));
|
|
9
|
-
const cors_1 = __importDefault(require("cors"));
|
|
10
9
|
const ws_1 = require("ws");
|
|
11
10
|
const aws_event_synthesis_1 = require("../aws-event-synthesis");
|
|
12
11
|
const event_synthesizer_1 = require("./event-synthesizer");
|
|
@@ -19,7 +18,6 @@ class LocalServer {
|
|
|
19
18
|
this.config = config ?? {};
|
|
20
19
|
this.app = (0, express_1.default)();
|
|
21
20
|
this.app.use(express_1.default.json());
|
|
22
|
-
this.app.use((0, cors_1.default)());
|
|
23
21
|
this.app.get('/', (_req, res) => {
|
|
24
22
|
res.send('Hello from Express HTTP Server');
|
|
25
23
|
});
|
package/package.json
CHANGED
|
@@ -80,6 +80,7 @@ export function sendLambdaResult(
|
|
|
80
80
|
headers?: Record<string, any>
|
|
81
81
|
body?: string
|
|
82
82
|
isBase64Encoded?: boolean
|
|
83
|
+
cookies?: string[]
|
|
83
84
|
}
|
|
84
85
|
): void {
|
|
85
86
|
const statusCode = result.statusCode ?? 200
|
|
@@ -90,6 +91,12 @@ export function sendLambdaResult(
|
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
|
|
94
|
+
if (result.cookies) {
|
|
95
|
+
for (const cookie of result.cookies) {
|
|
96
|
+
res.append('set-cookie', cookie)
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
93
100
|
if (result.isBase64Encoded && result.body) {
|
|
94
101
|
const buffer = Buffer.from(result.body, 'base64')
|
|
95
102
|
res.status(statusCode).send(buffer)
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import http from 'node:http';
|
|
2
2
|
|
|
3
3
|
import express from 'express';
|
|
4
|
-
import cors from 'cors';
|
|
5
4
|
import { WebSocketServer } from 'ws';
|
|
6
5
|
|
|
7
6
|
import {
|
|
@@ -35,8 +34,6 @@ export class LocalServer {
|
|
|
35
34
|
this.app = express();
|
|
36
35
|
|
|
37
36
|
this.app.use(express.json());
|
|
38
|
-
this.app.use(cors());
|
|
39
|
-
|
|
40
37
|
this.app.get('/', (_req, res) => {
|
|
41
38
|
res.send('Hello from Express HTTP Server');
|
|
42
39
|
});
|