@mastra/deployer 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/dist/server/index.cjs +13 -12
- package/dist/server/index.js +13 -12
- package/package.json +3 -3
package/dist/server/index.cjs
CHANGED
|
@@ -1840,18 +1840,6 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
1840
1840
|
});
|
|
1841
1841
|
return acc;
|
|
1842
1842
|
}, {});
|
|
1843
|
-
app.use(
|
|
1844
|
-
"*",
|
|
1845
|
-
timeout.timeout(server?.timeout ?? 1e3 * 30),
|
|
1846
|
-
cors.cors({
|
|
1847
|
-
origin: "*",
|
|
1848
|
-
allowMethods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
|
|
1849
|
-
allowHeaders: ["Content-Type", "Authorization", "x-mastra-client-type"],
|
|
1850
|
-
exposeHeaders: ["Content-Length", "X-Requested-With"],
|
|
1851
|
-
credentials: false,
|
|
1852
|
-
maxAge: 3600
|
|
1853
|
-
})
|
|
1854
|
-
);
|
|
1855
1843
|
if (options.apiReqLogs) {
|
|
1856
1844
|
app.use(logger.logger());
|
|
1857
1845
|
}
|
|
@@ -1862,6 +1850,19 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
1862
1850
|
app.use(m2.path, m2.handler);
|
|
1863
1851
|
}
|
|
1864
1852
|
}
|
|
1853
|
+
if (server?.cors === false) {
|
|
1854
|
+
app.use("*", timeout.timeout(server?.timeout ?? 1e3 * 30));
|
|
1855
|
+
} else {
|
|
1856
|
+
const corsConfig = {
|
|
1857
|
+
origin: server?.cors?.origin ?? "*",
|
|
1858
|
+
allowMethods: server?.cors?.allowMethods ?? ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
|
|
1859
|
+
credentials: server?.cors?.credentials ?? false,
|
|
1860
|
+
maxAge: server?.cors?.maxAge ?? 3600,
|
|
1861
|
+
allowHeaders: ["Content-Type", "Authorization", "x-mastra-client-type", ...server?.cors?.allowHeaders ?? []],
|
|
1862
|
+
exposeHeaders: ["Content-Length", "X-Requested-With", ...server?.cors?.exposeHeaders ?? []]
|
|
1863
|
+
};
|
|
1864
|
+
app.use("*", timeout.timeout(server?.timeout ?? 1e3 * 30), cors.cors(corsConfig));
|
|
1865
|
+
}
|
|
1865
1866
|
app.use("*", async (c2, next) => {
|
|
1866
1867
|
c2.set("mastra", mastra);
|
|
1867
1868
|
c2.set("tools", tools);
|
package/dist/server/index.js
CHANGED
|
@@ -1834,18 +1834,6 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
1834
1834
|
});
|
|
1835
1835
|
return acc;
|
|
1836
1836
|
}, {});
|
|
1837
|
-
app.use(
|
|
1838
|
-
"*",
|
|
1839
|
-
timeout(server?.timeout ?? 1e3 * 30),
|
|
1840
|
-
cors({
|
|
1841
|
-
origin: "*",
|
|
1842
|
-
allowMethods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
|
|
1843
|
-
allowHeaders: ["Content-Type", "Authorization", "x-mastra-client-type"],
|
|
1844
|
-
exposeHeaders: ["Content-Length", "X-Requested-With"],
|
|
1845
|
-
credentials: false,
|
|
1846
|
-
maxAge: 3600
|
|
1847
|
-
})
|
|
1848
|
-
);
|
|
1849
1837
|
if (options.apiReqLogs) {
|
|
1850
1838
|
app.use(logger());
|
|
1851
1839
|
}
|
|
@@ -1856,6 +1844,19 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
1856
1844
|
app.use(m2.path, m2.handler);
|
|
1857
1845
|
}
|
|
1858
1846
|
}
|
|
1847
|
+
if (server?.cors === false) {
|
|
1848
|
+
app.use("*", timeout(server?.timeout ?? 1e3 * 30));
|
|
1849
|
+
} else {
|
|
1850
|
+
const corsConfig = {
|
|
1851
|
+
origin: server?.cors?.origin ?? "*",
|
|
1852
|
+
allowMethods: server?.cors?.allowMethods ?? ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
|
|
1853
|
+
credentials: server?.cors?.credentials ?? false,
|
|
1854
|
+
maxAge: server?.cors?.maxAge ?? 3600,
|
|
1855
|
+
allowHeaders: ["Content-Type", "Authorization", "x-mastra-client-type", ...server?.cors?.allowHeaders ?? []],
|
|
1856
|
+
exposeHeaders: ["Content-Length", "X-Requested-With", ...server?.cors?.exposeHeaders ?? []]
|
|
1857
|
+
};
|
|
1858
|
+
app.use("*", timeout(server?.timeout ?? 1e3 * 30), cors(corsConfig));
|
|
1859
|
+
}
|
|
1859
1860
|
app.use("*", async (c2, next) => {
|
|
1860
1861
|
c2.set("mastra", mastra);
|
|
1861
1862
|
c2.set("tools", tools);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/deployer",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
"rollup-plugin-node-externals": "^8.0.0",
|
|
106
106
|
"typescript-paths": "^1.5.1",
|
|
107
107
|
"zod": "^3.24.2",
|
|
108
|
-
"@mastra/
|
|
109
|
-
"@mastra/
|
|
108
|
+
"@mastra/core": "^0.8.1",
|
|
109
|
+
"@mastra/server": "^1.0.1"
|
|
110
110
|
},
|
|
111
111
|
"devDependencies": {
|
|
112
112
|
"@hono/node-server": "^1.13.8",
|