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

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/index.js CHANGED
@@ -4206,7 +4206,7 @@ import standard from "figlet/importable-fonts/Standard.js";
4206
4206
  // package.json
4207
4207
  var package_default = {
4208
4208
  name: "@guren/server",
4209
- version: "1.0.0-rc.15",
4209
+ version: "1.0.0-rc.17",
4210
4210
  type: "module",
4211
4211
  license: "MIT",
4212
4212
  repository: {
@@ -4311,8 +4311,8 @@ var package_default = {
4311
4311
  test: "bun test"
4312
4312
  },
4313
4313
  dependencies: {
4314
- "@guren/inertia-client": "^1.0.0-rc.14",
4315
- "@guren/orm": "^1.0.0-rc.14",
4314
+ "@guren/inertia-client": "^1.0.0-rc.16",
4315
+ "@guren/orm": "^1.0.0-rc.17",
4316
4316
  "@modelcontextprotocol/sdk": "^1.27.1",
4317
4317
  chalk: "^5.3.0",
4318
4318
  consola: "^3.4.2",
@@ -8571,10 +8571,16 @@ var Mail = class {
8571
8571
  this.transportName = transport;
8572
8572
  return this;
8573
8573
  }
8574
- /**
8575
- * Build the final message.
8576
- */
8574
+ hasRunBuild = false;
8575
+ runBuildOnce() {
8576
+ if (this.hasRunBuild) {
8577
+ return;
8578
+ }
8579
+ this.hasRunBuild = true;
8580
+ this.build?.();
8581
+ }
8577
8582
  buildMessage() {
8583
+ this.runBuildOnce();
8578
8584
  if (!this.message.to || this.message.to.length === 0) {
8579
8585
  throw new Error("Email must have at least one recipient");
8580
8586
  }
@@ -254,6 +254,14 @@ declare class Mail {
254
254
  /**
255
255
  * Build the final message.
256
256
  */
257
+ /**
258
+ * Mailable subclasses define their content in build() (subject, body, ...).
259
+ * It runs automatically before sending, so `new WelcomeMail(manager).to(x).send()`
260
+ * works without a manual build() call.
261
+ */
262
+ protected build?(): this;
263
+ private hasRunBuild;
264
+ private runBuildOnce;
257
265
  buildMessage(): MailMessage;
258
266
  /**
259
267
  * Send the email immediately.
@@ -618,10 +618,16 @@ var Mail = class {
618
618
  this.transportName = transport;
619
619
  return this;
620
620
  }
621
- /**
622
- * Build the final message.
623
- */
621
+ hasRunBuild = false;
622
+ runBuildOnce() {
623
+ if (this.hasRunBuild) {
624
+ return;
625
+ }
626
+ this.hasRunBuild = true;
627
+ this.build?.();
628
+ }
624
629
  buildMessage() {
630
+ this.runBuildOnce();
625
631
  if (!this.message.to || this.message.to.length === 0) {
626
632
  throw new Error("Email must have at least one recipient");
627
633
  }
@@ -640,7 +640,7 @@ import standard from "figlet/importable-fonts/Standard.js";
640
640
  // package.json
641
641
  var package_default = {
642
642
  name: "@guren/server",
643
- version: "1.0.0-rc.15",
643
+ version: "1.0.0-rc.17",
644
644
  type: "module",
645
645
  license: "MIT",
646
646
  repository: {
@@ -745,8 +745,8 @@ var package_default = {
745
745
  test: "bun test"
746
746
  },
747
747
  dependencies: {
748
- "@guren/inertia-client": "^1.0.0-rc.14",
749
- "@guren/orm": "^1.0.0-rc.14",
748
+ "@guren/inertia-client": "^1.0.0-rc.16",
749
+ "@guren/orm": "^1.0.0-rc.17",
750
750
  "@modelcontextprotocol/sdk": "^1.27.1",
751
751
  chalk: "^5.3.0",
752
752
  consola: "^3.4.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guren/server",
3
- "version": "1.0.0-rc.15",
3
+ "version": "1.0.0-rc.17",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -105,8 +105,8 @@
105
105
  "test": "bun test"
106
106
  },
107
107
  "dependencies": {
108
- "@guren/inertia-client": "^1.0.0-rc.14",
109
- "@guren/orm": "^1.0.0-rc.14",
108
+ "@guren/inertia-client": "^1.0.0-rc.16",
109
+ "@guren/orm": "^1.0.0-rc.17",
110
110
  "@modelcontextprotocol/sdk": "^1.27.1",
111
111
  "chalk": "^5.3.0",
112
112
  "consola": "^3.4.2",