@cloudhal/cloudflare 0.7.0 → 0.7.2

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.
@@ -27,7 +27,11 @@ export interface MailEnv {
27
27
  CLOUDHAL_MAIL_FROM?: string;
28
28
  CLOUDHAL_MAIL_FROM_NAME?: string;
29
29
  }
30
- /** A plain `local@domain` address: no display name, no spaces or line breaks. */
30
+ /**
31
+ * A plain `local@domain` address: no display name, no spaces or line breaks.
32
+ * @deprecated Use `isMailAddress` from `@cloudhal/api`: the same answers in one linear pass (this
33
+ * pattern backtracks quadratically on long `.x` runs).
34
+ */
31
35
  export declare const MAIL_ADDRESS: RegExp;
32
36
  export declare function cloudflareEmailSender(binding: SendEmailBinding, from: {
33
37
  email: string;
package/dist/src/mail.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * `CLOUDHAL_MAIL_FROM` / `CLOUDHAL_MAIL_FROM_NAME`. Plain text only; bodies are never logged (they
5
5
  * carry one-time links).
6
6
  */
7
- import { MailError, } from "@cloudhal/api";
7
+ import { isMailAddress, MailError, } from "@cloudhal/api";
8
8
 
9
9
  /** The part of the binding's structured `send()` this sender uses. */
10
10
 
@@ -25,7 +25,11 @@ import { MailError, } from "@cloudhal/api";
25
25
 
26
26
 
27
27
 
28
- /** A plain `local@domain` address: no display name, no spaces or line breaks. */
28
+ /**
29
+ * A plain `local@domain` address: no display name, no spaces or line breaks.
30
+ * @deprecated Use `isMailAddress` from `@cloudhal/api`: the same answers in one linear pass (this
31
+ * pattern backtracks quadratically on long `.x` runs).
32
+ */
29
33
  export const MAIL_ADDRESS = /^[^\s@<>"]+@[^\s@<>"]+\.[^\s@<>"]+$/;
30
34
 
31
35
  const oneLine = (s ) => s.replace(/[\r\n]+/g, " ").trim();
@@ -61,7 +65,7 @@ export function cloudflareEmailSender(
61
65
  /** The deployment's sender, when the binding and a valid `CLOUDHAL_MAIL_FROM` are both there. */
62
66
  export function adminMail(env ) {
63
67
  const from = env.CLOUDHAL_MAIL_FROM?.trim();
64
- if (!env.EMAIL || !from || !MAIL_ADDRESS.test(from)) return undefined;
68
+ if (!env.EMAIL || !from || !isMailAddress(from)) return undefined;
65
69
  return cloudflareEmailSender(env.EMAIL, {
66
70
  email: from,
67
71
  ...(env.CLOUDHAL_MAIL_FROM_NAME ? { name: env.CLOUDHAL_MAIL_FROM_NAME } : {}),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudhal/cloudflare",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "Cloudhal on Cloudflare: the admin Worker (API, auth, MCP, Studio) over D1 + R2",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://cloudhal.dev",
@@ -48,19 +48,19 @@
48
48
  "README.md"
49
49
  ],
50
50
  "dependencies": {
51
- "@cloudhal/agent-runtime": "0.7.0",
52
- "@cloudhal/analytics": "0.7.0",
53
- "@cloudhal/api": "0.7.0",
54
- "@cloudhal/comments": "0.7.0",
55
- "@cloudhal/core-ts": "0.7.0",
56
- "@cloudhal/mcp-server": "0.7.0",
57
- "@cloudhal/schedules": "0.7.0",
58
- "@cloudhal/storage": "0.7.0",
51
+ "@cloudhal/agent-runtime": "0.7.2",
52
+ "@cloudhal/analytics": "0.7.2",
53
+ "@cloudhal/api": "0.7.2",
54
+ "@cloudhal/comments": "0.7.2",
55
+ "@cloudhal/core-ts": "0.7.2",
56
+ "@cloudhal/mcp-server": "0.7.2",
57
+ "@cloudhal/schedules": "0.7.2",
58
+ "@cloudhal/storage": "0.7.2",
59
59
  "zod": "^4.6.7"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@cloudflare/workers-types": "^5.20261007.1",
63
- "@cloudhal/astro-renderer": "0.7.0",
63
+ "@cloudhal/astro-renderer": "0.7.2",
64
64
  "@types/node": "^26.6.5",
65
65
  "typescript": "7.0.2",
66
66
  "vitest": "5.1.0",