@motiadev/core 0.8.1-beta.138 → 0.8.2-beta.140-306759
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/src/server.js +18 -2
- package/package.json +1 -2
package/dist/src/server.js
CHANGED
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createServer = void 0;
|
|
7
7
|
const body_parser_1 = __importDefault(require("body-parser"));
|
|
8
|
-
const cors_1 = __importDefault(require("cors"));
|
|
9
8
|
const express_1 = __importDefault(require("express"));
|
|
10
9
|
const http_1 = __importDefault(require("http"));
|
|
11
10
|
const utils_1 = require("./analytics/utils");
|
|
@@ -191,7 +190,24 @@ const createServer = (lockedData, eventManager, state, config) => {
|
|
|
191
190
|
router.stack = filteredStack;
|
|
192
191
|
};
|
|
193
192
|
allSteps.filter(guards_1.isApiStep).forEach(addRoute);
|
|
194
|
-
app.
|
|
193
|
+
app.options('*', (_req, res) => {
|
|
194
|
+
res.header('Access-Control-Allow-Origin', '*');
|
|
195
|
+
res.header('Access-Control-Allow-Methods', '*');
|
|
196
|
+
res.header('Access-Control-Allow-Headers', '*');
|
|
197
|
+
res.header('Access-Control-Max-Age', '600');
|
|
198
|
+
res.header('Access-Control-Allow-Credentials', 'true');
|
|
199
|
+
res.header('Access-Control-Allow-Private-Network', 'true');
|
|
200
|
+
res.status(204).end();
|
|
201
|
+
});
|
|
202
|
+
app.use((_req, res, next) => {
|
|
203
|
+
res.header('Access-Control-Allow-Origin', '*');
|
|
204
|
+
res.header('Access-Control-Allow-Methods', '*');
|
|
205
|
+
res.header('Access-Control-Allow-Headers', '*');
|
|
206
|
+
res.header('Access-Control-Max-Age', '600');
|
|
207
|
+
res.header('Access-Control-Allow-Credentials', 'true');
|
|
208
|
+
res.header('Access-Control-Allow-Private-Network', 'true');
|
|
209
|
+
next();
|
|
210
|
+
});
|
|
195
211
|
app.use(router);
|
|
196
212
|
(0, state_endpoints_1.stateEndpoints)(app, state);
|
|
197
213
|
(0, api_endpoints_1.apiEndpoints)(lockedData);
|
package/package.json
CHANGED
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
"name": "@motiadev/core",
|
|
3
3
|
"description": "Core functionality for the Motia framework, providing the foundation for building event-driven workflows.",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
|
-
"version": "0.8.
|
|
5
|
+
"version": "0.8.2-beta.140-306759",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@amplitude/analytics-node": "^1.3.8",
|
|
8
8
|
"body-parser": "^1.20.3",
|
|
9
9
|
"colors": "^1.4.0",
|
|
10
|
-
"cors": "^2.8.5",
|
|
11
10
|
"dotenv": "^16.4.7",
|
|
12
11
|
"express": "^4.21.2",
|
|
13
12
|
"node-cron": "^3.0.3",
|