@guren/server 1.0.0-rc.13 → 1.0.0-rc.15

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,10 +1,11 @@
1
1
  import * as hono_aws_lambda from 'hono/aws-lambda';
2
2
  export { APIGatewayProxyResult, LambdaEvent } from 'hono/aws-lambda';
3
- import { A as Application } from '../Application-DtWDHXr1.js';
3
+ import { A as Application } from '../Application-CddorcPa.js';
4
4
  import { S as Scheduler } from '../Scheduler-BstvSca7.js';
5
- import { C as ConsoleKernel } from '../ConsoleKernel-CqCVrdZs.js';
5
+ import { C as ConsoleKernel } from '../ConsoleKernel-BlCJEZTR.js';
6
6
  import 'hono';
7
- import '../api-token-JOif2CtG.js';
7
+ import '../api-token-BGOsfuI9.js';
8
+ import '@guren/orm';
8
9
  import 'vite';
9
10
  import '../EventManager-CmIoLt7r.js';
10
11
  import '../CacheManager-BkvHEOZX.js';
@@ -16,7 +17,7 @@ import '../index-9_Jzj5jo.js';
16
17
  import '../app-key-CsBfRC_Q.js';
17
18
  import '../StorageManager-oZTHqaza.js';
18
19
  import '../HealthManager-DUyMIzsZ.js';
19
- import '../Gate-CNkBYf8m.js';
20
+ import '../Gate-CynjZCtS.js';
20
21
 
21
22
  /**
22
23
  * SQS event record from AWS Lambda.
@@ -68,7 +69,7 @@ declare function createLambdaHandler(app: Application): <L extends hono_aws_lamb
68
69
  headers?: undefined;
69
70
  multiValueHeaders: Record<string, string[]>;
70
71
  } : {
71
- headers: Record<string, string>;
72
+ headers: Record<string, string | string[]>;
72
73
  multiValueHeaders?: undefined;
73
74
  })>;
74
75
  /**
@@ -244,6 +244,7 @@ declare class Mail {
244
244
  attach(attachment: MailAttachment): this;
245
245
  /**
246
246
  * Add a custom header.
247
+ * Rejects CR/LF characters to prevent SMTP header injection.
247
248
  */
248
249
  header(key: string, value: string): this;
249
250
  /**
@@ -599,8 +599,12 @@ var Mail = class {
599
599
  }
600
600
  /**
601
601
  * Add a custom header.
602
+ * Rejects CR/LF characters to prevent SMTP header injection.
602
603
  */
603
604
  header(key, value) {
605
+ if (/[\r\n]/.test(key) || /[\r\n]/.test(value)) {
606
+ throw new Error("Mail: header names and values cannot contain newline characters.");
607
+ }
604
608
  if (!this.message.headers) {
605
609
  this.message.headers = {};
606
610
  }
@@ -1,7 +1,8 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- import { S as ServiceProvider } from '../Application-DtWDHXr1.js';
2
+ import { S as ServiceProvider } from '../Application-CddorcPa.js';
3
3
  import 'hono';
4
- import '../api-token-JOif2CtG.js';
4
+ import '../api-token-BGOsfuI9.js';
5
+ import '@guren/orm';
5
6
  import 'vite';
6
7
  import '../EventManager-CmIoLt7r.js';
7
8
  import '../CacheManager-BkvHEOZX.js';
@@ -14,7 +15,7 @@ import '../app-key-CsBfRC_Q.js';
14
15
  import '../StorageManager-oZTHqaza.js';
15
16
  import '../HealthManager-DUyMIzsZ.js';
16
17
  import '../Scheduler-BstvSca7.js';
17
- import '../Gate-CNkBYf8m.js';
18
+ import '../Gate-CynjZCtS.js';
18
19
 
19
20
  /**
20
21
  * CLI functions that the MCP server wraps.
@@ -1,8 +1,9 @@
1
- import { _ as NotificationChannel, X as Notifiable, Y as Notification, q as DatabaseNotification, p as DatabaseChannelOptions, as as SlackMessage, ai as SentNotification } from '../Application-DtWDHXr1.js';
2
- export { Z as NotificationAttachment, $ as NotificationChannelFactory, a0 as NotificationClass, a1 as NotificationMailMessage, N as NotificationManager, a2 as NotificationManagerOptions, aq as SlackAttachment, ar as SlackBlock, aG as createNotificationManager, aP as getNotificationManager, a_ as setNotificationManager } from '../Application-DtWDHXr1.js';
1
+ import { _ as NotificationChannel, X as Notifiable, Y as Notification, q as DatabaseNotification, p as DatabaseChannelOptions, as as SlackMessage, ai as SentNotification } from '../Application-CddorcPa.js';
2
+ export { Z as NotificationAttachment, $ as NotificationChannelFactory, a0 as NotificationClass, a1 as NotificationMailMessage, N as NotificationManager, a2 as NotificationManagerOptions, aq as SlackAttachment, ar as SlackBlock, aG as createNotificationManager, aP as getNotificationManager, a_ as setNotificationManager } from '../Application-CddorcPa.js';
3
3
  import { M as MailManager } from '../MailManager-DpMvYiP9.js';
4
4
  import 'hono';
5
- import '../api-token-JOif2CtG.js';
5
+ import '../api-token-BGOsfuI9.js';
6
+ import '@guren/orm';
6
7
  import 'vite';
7
8
  import '../EventManager-CmIoLt7r.js';
8
9
  import '../CacheManager-BkvHEOZX.js';
@@ -14,7 +15,7 @@ import '../app-key-CsBfRC_Q.js';
14
15
  import '../StorageManager-oZTHqaza.js';
15
16
  import '../HealthManager-DUyMIzsZ.js';
16
17
  import '../Scheduler-BstvSca7.js';
17
- import '../Gate-CNkBYf8m.js';
18
+ import '../Gate-CynjZCtS.js';
18
19
 
19
20
  /**
20
21
  * Mail notification channel.
@@ -1,8 +1,9 @@
1
- import { a5 as QueueDriver, a7 as QueuedJob, F as FailedJob, aw as WorkerOptions } from '../Application-DtWDHXr1.js';
2
- export { R as Job, T as JobClass, U as JobFailureHandler, V as JobHandler, W as JobOptions, a4 as QueueConfig, a6 as QueueDriverFactory, Q as QueueManager, aA as clearJobRegistry, aH as createQueueManager, aO as getJob, aQ as getQueueDriver, aR as getRegisteredJobs, aV as registerJob, a$ as setQueueDriver } from '../Application-DtWDHXr1.js';
1
+ import { a5 as QueueDriver, a7 as QueuedJob, F as FailedJob, aw as WorkerOptions } from '../Application-CddorcPa.js';
2
+ export { R as Job, T as JobClass, U as JobFailureHandler, V as JobHandler, W as JobOptions, a4 as QueueConfig, a6 as QueueDriverFactory, Q as QueueManager, aA as clearJobRegistry, aH as createQueueManager, aO as getJob, aQ as getQueueDriver, aR as getRegisteredJobs, aV as registerJob, a$ as setQueueDriver } from '../Application-CddorcPa.js';
3
3
  import { Redis } from 'ioredis';
4
4
  import 'hono';
5
- import '../api-token-JOif2CtG.js';
5
+ import '../api-token-BGOsfuI9.js';
6
+ import '@guren/orm';
6
7
  import 'vite';
7
8
  import '../EventManager-CmIoLt7r.js';
8
9
  import '../CacheManager-BkvHEOZX.js';
@@ -15,7 +16,7 @@ import '../app-key-CsBfRC_Q.js';
15
16
  import '../StorageManager-oZTHqaza.js';
16
17
  import '../HealthManager-DUyMIzsZ.js';
17
18
  import '../Scheduler-BstvSca7.js';
18
- import '../Gate-CNkBYf8m.js';
19
+ import '../Gate-CynjZCtS.js';
19
20
 
20
21
  /**
21
22
  * In-memory queue driver for development and testing.
@@ -1,7 +1,8 @@
1
- import { A as Application } from '../Application-DtWDHXr1.js';
2
- export { D as DevBannerOptions, G as GUREN_ASCII_ART, a as StartViteDevServerOptions, b as StartedViteDevServer, l as logDevServerBanner, s as startViteDevServer } from '../Application-DtWDHXr1.js';
1
+ import { A as Application } from '../Application-CddorcPa.js';
2
+ export { D as DevBannerOptions, G as GUREN_ASCII_ART, a as StartViteDevServerOptions, b as StartedViteDevServer, l as logDevServerBanner, s as startViteDevServer } from '../Application-CddorcPa.js';
3
3
  import 'hono';
4
- import '../api-token-JOif2CtG.js';
4
+ import '../api-token-BGOsfuI9.js';
5
+ import '@guren/orm';
5
6
  import 'vite';
6
7
  import '../EventManager-CmIoLt7r.js';
7
8
  import '../CacheManager-BkvHEOZX.js';
@@ -14,7 +15,7 @@ import '../app-key-CsBfRC_Q.js';
14
15
  import '../StorageManager-oZTHqaza.js';
15
16
  import '../HealthManager-DUyMIzsZ.js';
16
17
  import '../Scheduler-BstvSca7.js';
17
- import '../Gate-CNkBYf8m.js';
18
+ import '../Gate-CynjZCtS.js';
18
19
 
19
20
  type RootPublicAssetsConfig = boolean | RootPublicAssetsOptions;
20
21
  interface RootPublicAssetsOptions {
@@ -315,6 +315,20 @@ function parseImportMap(value, options = {}) {
315
315
  }
316
316
  }
317
317
 
318
+ // src/encryption/Hash.ts
319
+ import {
320
+ createHash,
321
+ createHmac,
322
+ randomBytes,
323
+ scrypt,
324
+ timingSafeEqual
325
+ } from "crypto";
326
+ import { promisify } from "util";
327
+ var scryptAsync = promisify(scrypt);
328
+ function hash(value, algorithm = "sha256", encoding = "hex") {
329
+ return createHash(algorithm).update(value).digest(encoding);
330
+ }
331
+
318
332
  // src/http/inertia-assets.ts
319
333
  var DEFAULT_STYLES_ENTRY = "/public/assets/app.css";
320
334
  var DEFAULT_DEV_STYLES_ENTRY = "/resources/css/app.css";
@@ -460,6 +474,12 @@ function autoConfigureInertiaAssets(app, options) {
460
474
  const clientEntry = clientManifest?.["resources/js/app.tsx"];
461
475
  const clientEntryFile = getManifestFile(clientEntry);
462
476
  const clientCssFiles = getManifestCss(clientEntry);
477
+ if (clientManifest?.__raw__) {
478
+ setEnvIfUserDidNotProvide(
479
+ "GUREN_INERTIA_VERSION",
480
+ hash(clientManifest.__raw__, "sha1").slice(0, 12)
481
+ );
482
+ }
463
483
  if (clientEntryFile) {
464
484
  setEnvIfUserDidNotProvide("GUREN_INERTIA_ENTRY", `/public/assets/${clientEntryFile.replace(/^\//u, "")}`);
465
485
  }
@@ -513,7 +533,8 @@ function captureInertiaEnvFlags() {
513
533
  GUREN_INERTIA_ENTRY: process.env.GUREN_INERTIA_ENTRY !== void 0,
514
534
  GUREN_INERTIA_STYLES: process.env.GUREN_INERTIA_STYLES !== void 0,
515
535
  GUREN_INERTIA_SSR_ENTRY: process.env.GUREN_INERTIA_SSR_ENTRY !== void 0,
516
- GUREN_INERTIA_SSR_MANIFEST: process.env.GUREN_INERTIA_SSR_MANIFEST !== void 0
536
+ GUREN_INERTIA_SSR_MANIFEST: process.env.GUREN_INERTIA_SSR_MANIFEST !== void 0,
537
+ GUREN_INERTIA_VERSION: process.env.GUREN_INERTIA_VERSION !== void 0
517
538
  };
518
539
  }
519
540
  function resolveDevSsrEntry(options) {
@@ -552,6 +573,10 @@ function loadViteManifest(candidatePaths, label) {
552
573
  value: manifestPath,
553
574
  enumerable: false
554
575
  });
576
+ Object.defineProperty(manifest, "__raw__", {
577
+ value: raw,
578
+ enumerable: false
579
+ });
555
580
  return manifest;
556
581
  } catch (error) {
557
582
  if (error.code !== "ENOENT") {
@@ -615,7 +640,7 @@ import standard from "figlet/importable-fonts/Standard.js";
615
640
  // package.json
616
641
  var package_default = {
617
642
  name: "@guren/server",
618
- version: "1.0.0-rc.13",
643
+ version: "1.0.0-rc.15",
619
644
  type: "module",
620
645
  license: "MIT",
621
646
  repository: {
@@ -720,14 +745,15 @@ var package_default = {
720
745
  test: "bun test"
721
746
  },
722
747
  dependencies: {
723
- "@guren/inertia-client": "^1.0.0-rc.12",
748
+ "@guren/inertia-client": "^1.0.0-rc.14",
749
+ "@guren/orm": "^1.0.0-rc.14",
724
750
  "@modelcontextprotocol/sdk": "^1.27.1",
725
751
  chalk: "^5.3.0",
726
752
  consola: "^3.4.2",
727
753
  figlet: "^1.7.0",
728
- hono: "^4.12.8",
754
+ hono: "^4.12.18",
729
755
  ioredis: "^5.9.1",
730
- nodemailer: "^7.0.12"
756
+ nodemailer: "^8.0.4"
731
757
  },
732
758
  peerDependencies: {
733
759
  "@aws-sdk/client-s3": "^3.0.0",
@@ -749,7 +775,7 @@ var package_default = {
749
775
  devDependencies: {
750
776
  "@types/ioredis": "^5.0.0",
751
777
  "@types/node": "^20.14.10",
752
- "@types/nodemailer": "^7.0.5",
778
+ "@types/nodemailer": "^8.0.1",
753
779
  tsup: "^8.5.0",
754
780
  typescript: "^5.4.0",
755
781
  vite: "^8.0.0"
@@ -22,6 +22,7 @@ declare class LocalDriver implements StorageDriver {
22
22
  constructor(options: LocalDriverOptions);
23
23
  /**
24
24
  * Get the full path for a file.
25
+ * Rejects paths that resolve outside the storage root (e.g. via `../`).
25
26
  */
26
27
  private fullPath;
27
28
  /**
@@ -11,7 +11,7 @@ import {
11
11
  rename
12
12
  } from "fs/promises";
13
13
  import { existsSync } from "fs";
14
- import { join, dirname } from "path";
14
+ import { join, dirname, resolve, sep } from "path";
15
15
  var LocalDriver = class {
16
16
  root;
17
17
  baseUrl;
@@ -23,9 +23,15 @@ var LocalDriver = class {
23
23
  }
24
24
  /**
25
25
  * Get the full path for a file.
26
+ * Rejects paths that resolve outside the storage root (e.g. via `../`).
26
27
  */
27
28
  fullPath(path) {
28
- return join(this.root, path);
29
+ const root = resolve(this.root);
30
+ const candidate = resolve(root, path);
31
+ if (candidate !== root && !candidate.startsWith(root + sep)) {
32
+ throw new Error(`LocalDriver: path escapes the storage root: "${path}"`);
33
+ }
34
+ return candidate;
29
35
  }
30
36
  /**
31
37
  * Ensure the directory exists.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guren/server",
3
- "version": "1.0.0-rc.13",
3
+ "version": "1.0.0-rc.15",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -105,14 +105,15 @@
105
105
  "test": "bun test"
106
106
  },
107
107
  "dependencies": {
108
- "@guren/inertia-client": "^1.0.0-rc.12",
108
+ "@guren/inertia-client": "^1.0.0-rc.14",
109
+ "@guren/orm": "^1.0.0-rc.14",
109
110
  "@modelcontextprotocol/sdk": "^1.27.1",
110
111
  "chalk": "^5.3.0",
111
112
  "consola": "^3.4.2",
112
113
  "figlet": "^1.7.0",
113
- "hono": "^4.12.8",
114
+ "hono": "^4.12.18",
114
115
  "ioredis": "^5.9.1",
115
- "nodemailer": "^7.0.12"
116
+ "nodemailer": "^8.0.4"
116
117
  },
117
118
  "peerDependencies": {
118
119
  "@aws-sdk/client-s3": "^3.0.0",
@@ -134,7 +135,7 @@
134
135
  "devDependencies": {
135
136
  "@types/ioredis": "^5.0.0",
136
137
  "@types/node": "^20.14.10",
137
- "@types/nodemailer": "^7.0.5",
138
+ "@types/nodemailer": "^8.0.1",
138
139
  "tsup": "^8.5.0",
139
140
  "typescript": "^5.4.0",
140
141
  "vite": "^8.0.0"