@mono-labs/dev 0.1.280 → 0.1.284

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.
@@ -1 +1 @@
1
- {"version":3,"file":"event-synthesizer.d.ts","sourceRoot":"","sources":["../../src/local-server/event-synthesizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAUlE,iEAAiE;AACjE,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,GAAG,sBAAsB,CAqC9E;AAED,sDAAsD;AACtD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,QAAQ,CAoBzD"}
1
+ {"version":3,"file":"event-synthesizer.d.ts","sourceRoot":"","sources":["../../src/local-server/event-synthesizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAUlE,iEAAiE;AACjE,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,GAAG,sBAAsB,CAwC9E;AAED,sDAAsD;AACtD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,QAAQ,CAoBzD"}
@@ -12,12 +12,15 @@ function synthesizeApiGatewayEvent(req) {
12
12
  const { path, queryString } = (0, aws_event_synthesis_1.splitUrl)(req.url);
13
13
  const requestId = (0, aws_event_synthesis_1.generateRequestId)();
14
14
  const now = Date.now();
15
+ const cookieHeader = req.headers['cookie'];
16
+ const cookies = cookieHeader ? cookieHeader.split('; ') : undefined;
15
17
  return {
16
18
  version: '2.0',
17
19
  routeKey: `$default`,
18
20
  rawPath: path,
19
21
  rawQueryString: queryString,
20
22
  headers,
23
+ cookies,
21
24
  queryStringParameters: Object.keys(queryParams).length > 0 ? queryParams : undefined,
22
25
  requestContext: {
23
26
  accountId: 'local',
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/local-server/index.ts"],"names":[],"mappings":"AAEA,OAAO,OAAO,MAAM,SAAS,CAAC;AAa9B,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;IAgBtC,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"}
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mono-labs/dev",
3
- "version": "0.1.280",
3
+ "version": "0.1.284",
4
4
  "type": "commonjs",
5
5
  "description": "Local development server and WebSocket adapter for mono-labs",
6
6
  "main": "dist/index.js",
@@ -18,6 +18,8 @@ export function synthesizeApiGatewayEvent(req: Request): APIGatewayProxyEventV2
18
18
  const { path, queryString } = splitUrl(req.url)
19
19
  const requestId = generateRequestId()
20
20
  const now = Date.now()
21
+ const cookieHeader = req.headers['cookie']
22
+ const cookies = cookieHeader ? cookieHeader.split('; ') : undefined
21
23
 
22
24
  return {
23
25
  version: '2.0',
@@ -25,6 +27,7 @@ export function synthesizeApiGatewayEvent(req: Request): APIGatewayProxyEventV2
25
27
  rawPath: path,
26
28
  rawQueryString: queryString,
27
29
  headers,
30
+ cookies,
28
31
  queryStringParameters: Object.keys(queryParams).length > 0 ? queryParams as Record<string, string> : undefined,
29
32
  requestContext: {
30
33
  accountId: 'local',
@@ -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
  });