@midsummer-ai/sdk 0.1.0-staging.4129 → 0.1.0-staging.4135

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/auth/mail.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as EmailError } from "../index-Bprm0lxl.mjs";
1
+ import { a as EmailError } from "../index-DI_L79Hc.mjs";
2
2
  //#region src/auth/mail.d.ts
3
3
  type SignInMailKind = "code" | "link" | "verify" | "reset" | "invite" | "device" | "approved";
4
4
  /** One sign-in mail: whom to, which kind, the app's name, and its code or its address. */
package/auth/mail.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as processEnv, n as here } from "../here-C2jhTheQ.mjs";
2
- import { l as email, t as EmailError } from "../email-Be9CHaQl.mjs";
2
+ import { l as email, t as EmailError } from "../email-D9XsEaRR.mjs";
3
3
  //#region src/auth/mail.ts
4
4
  /**
5
5
  * The mail sign-in sends: a code, a sign-in link, an email check, a password reset, an invitation, a sign-in from
@@ -1,4 +1,4 @@
1
- import { i as EmailEngine, m as SentMessage, n as CheckedMessage, o as EmailErrorCode, t as BatchResult } from "../index-Bprm0lxl.mjs";
1
+ import { i as EmailEngine, m as SentMessage, n as CheckedMessage, o as EmailErrorCode, t as BatchResult } from "../index-DI_L79Hc.mjs";
2
2
  //#region src/email/client.d.ts
3
3
  declare const MESSAGES_PATH = "/email/messages";
4
4
  type Fetch = (url: string, init: RequestInit) => Promise<Response>;
package/email/client.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { C as serveMessages, S as serveBound, b as boundEmail, x as client, y as MESSAGES_PATH } from "../email-Be9CHaQl.mjs";
1
+ import { C as serveMessages, S as serveBound, b as boundEmail, x as client, y as MESSAGES_PATH } from "../email-D9XsEaRR.mjs";
2
2
  export { MESSAGES_PATH, boundEmail, client, serveBound, serveMessages };
@@ -1,4 +1,4 @@
1
- import { r as Email, x as Inbox } from "../index-Bprm0lxl.mjs";
1
+ import { r as Email, x as Inbox } from "../index-DI_L79Hc.mjs";
2
2
  //#region src/email/contract.d.ts
3
3
  declare const CONTRACT_DOMAIN = "mail.acme.dev";
4
4
  declare const CONTRACT_SUPPRESSED = "suppressed@example.com";
@@ -1,4 +1,4 @@
1
- import { t as EmailError } from "../email-Be9CHaQl.mjs";
1
+ import { t as EmailError } from "../email-D9XsEaRR.mjs";
2
2
  //#region src/email/contract.ts
3
3
  /**
4
4
  * Email's contract: what every engine promises, as cases any test runner can run. The Stand-in runs
package/email/inbox.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { A as ReceivedMail, C as InboxEngine, D as InboxThreadWithMessages, E as InboxThread, F as inbox, I as serveInbox, M as boundInbox, N as checkPage, O as MAX_REPLY, P as checkReply, S as InboxCall, T as InboxReply, b as INBOX_HEADER, j as ThreadCursor, k as MAX_THREADS, w as InboxMessage, x as Inbox, y as BoundInboxAnswer } from "../index-Bprm0lxl.mjs";
1
+ import { A as ReceivedMail, C as InboxEngine, D as InboxThreadWithMessages, E as InboxThread, F as inbox, I as serveInbox, M as boundInbox, N as checkPage, O as MAX_REPLY, P as checkReply, S as InboxCall, T as InboxReply, b as INBOX_HEADER, j as ThreadCursor, k as MAX_THREADS, w as InboxMessage, x as Inbox, y as BoundInboxAnswer } from "../index-DI_L79Hc.mjs";
2
2
  export { BoundInboxAnswer, INBOX_HEADER, Inbox, InboxCall, InboxEngine, InboxMessage, InboxReply, InboxThread, InboxThreadWithMessages, MAX_REPLY, MAX_THREADS, ReceivedMail, ThreadCursor, boundInbox, checkPage, checkReply, inbox, serveInbox };
package/email/inbox.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { _ as inbox, d as INBOX_HEADER, f as MAX_REPLY, g as checkReply, h as checkPage, m as boundInbox, p as MAX_THREADS, v as serveInbox } from "../email-Be9CHaQl.mjs";
1
+ import { _ as inbox, d as INBOX_HEADER, f as MAX_REPLY, g as checkReply, h as checkPage, m as boundInbox, p as MAX_THREADS, v as serveInbox } from "../email-D9XsEaRR.mjs";
2
2
  export { INBOX_HEADER, MAX_REPLY, MAX_THREADS, boundInbox, checkPage, checkReply, inbox, serveInbox };
package/email/index.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { A as ReceivedMail, C as InboxEngine, D as InboxThreadWithMessages, E as InboxThread, F as inbox, T as InboxReply, _ as email, a as EmailError, b as INBOX_HEADER, c as MAX_ATTACHMENT_BYTES, d as MAX_RECIPIENTS, f as OutgoingAttachment, g as checkMessage, h as addressOf, i as EmailEngine, j as ThreadCursor, k as MAX_THREADS, l as MAX_BATCH, m as SentMessage, n as CheckedMessage, o as EmailErrorCode, p as OutgoingMessage, r as Email, s as MAX_ATTACHMENTS, t as BatchResult, u as MAX_MESSAGE_BYTES, v as verifyWebhook, w as InboxMessage, x as Inbox } from "../index-Bprm0lxl.mjs";
1
+ import { A as ReceivedMail, C as InboxEngine, D as InboxThreadWithMessages, E as InboxThread, F as inbox, T as InboxReply, _ as email, a as EmailError, b as INBOX_HEADER, c as MAX_ATTACHMENT_BYTES, d as MAX_RECIPIENTS, f as OutgoingAttachment, g as checkMessage, h as addressOf, i as EmailEngine, j as ThreadCursor, k as MAX_THREADS, l as MAX_BATCH, m as SentMessage, n as CheckedMessage, o as EmailErrorCode, p as OutgoingMessage, r as Email, s as MAX_ATTACHMENTS, t as BatchResult, u as MAX_MESSAGE_BYTES, v as verifyWebhook, w as InboxMessage, x as Inbox } from "../index-DI_L79Hc.mjs";
2
2
  export { BatchResult, CheckedMessage, Email, EmailEngine, EmailError, EmailErrorCode, INBOX_HEADER, type Inbox, type InboxEngine, type InboxMessage, type InboxReply, type InboxThread, type InboxThreadWithMessages, MAX_ATTACHMENTS, MAX_ATTACHMENT_BYTES, MAX_BATCH, MAX_MESSAGE_BYTES, MAX_RECIPIENTS, MAX_THREADS, OutgoingAttachment, OutgoingMessage, type ReceivedMail, SentMessage, type ThreadCursor, addressOf, checkMessage, email, inbox, verifyWebhook };
package/email/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { _ as inbox, a as MAX_MESSAGE_BYTES, c as checkMessage, d as INBOX_HEADER, i as MAX_BATCH, l as email, n as MAX_ATTACHMENTS, o as MAX_RECIPIENTS, p as MAX_THREADS, r as MAX_ATTACHMENT_BYTES, s as addressOf, t as EmailError, u as verifyWebhook } from "../email-Be9CHaQl.mjs";
1
+ import { _ as inbox, a as MAX_MESSAGE_BYTES, c as checkMessage, d as INBOX_HEADER, i as MAX_BATCH, l as email, n as MAX_ATTACHMENTS, o as MAX_RECIPIENTS, p as MAX_THREADS, r as MAX_ATTACHMENT_BYTES, s as addressOf, t as EmailError, u as verifyWebhook } from "../email-D9XsEaRR.mjs";
2
2
  export { EmailError, INBOX_HEADER, MAX_ATTACHMENTS, MAX_ATTACHMENT_BYTES, MAX_BATCH, MAX_MESSAGE_BYTES, MAX_RECIPIENTS, MAX_THREADS, addressOf, checkMessage, email, inbox, verifyWebhook };
package/email/smtp.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { m as SentMessage, n as CheckedMessage } from "../index-Bprm0lxl.mjs";
1
+ import { m as SentMessage, n as CheckedMessage } from "../index-DI_L79Hc.mjs";
2
2
  //#region src/email/smtp.d.ts
3
3
  /** A `send` that hands each message to Email at `origin` (the API's), with the client's key. */
4
4
  declare function relayTo(origin: string, options?: {
package/email/smtp.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { l as email, t as EmailError, x as client } from "../email-Be9CHaQl.mjs";
1
+ import { l as email, t as EmailError, x as client } from "../email-D9XsEaRR.mjs";
2
2
  import { createServer } from "node:net";
3
3
  import { createServer as createServer$1 } from "node:tls";
4
4
  //#region src/email/smtp.ts
@@ -1,4 +1,4 @@
1
- import { C as InboxEngine, i as EmailEngine, n as CheckedMessage, w as InboxMessage } from "../index-Bprm0lxl.mjs";
1
+ import { C as InboxEngine, i as EmailEngine, n as CheckedMessage, w as InboxMessage } from "../index-DI_L79Hc.mjs";
2
2
  //#region src/email/stand-in.d.ts
3
3
  declare function standIn(options: {
4
4
  readonly domains: ReadonlyArray<string>;
@@ -1,4 +1,4 @@
1
- import { s as addressOf, t as EmailError } from "../email-Be9CHaQl.mjs";
1
+ import { s as addressOf, t as EmailError } from "../email-D9XsEaRR.mjs";
2
2
  //#region src/email/stand-in.ts
3
3
  /**
4
4
  * Email's Stand-in: the Capability's behaviour in memory, for `midsummer dev` and tests. It sends
@@ -479,7 +479,7 @@ async function sendEach(engine, messages) {
479
479
  * ahead of the clock by as much, is refused. After a rotation both secrets sign for a day, and either
480
480
  * passing is enough. Deliveries are at least once: drop a repeat by its `webhook-id`.
481
481
  *
482
- * if (!(await verifyWebhook(request.headers, body, process.env.MIDSUMMER_WEBHOOK_SECRET!))) return new Response(null, { status: 401 })
482
+ * if (!(await verifyWebhook(request.headers, body, process.env.APP_WEBHOOK_SECRET!))) return new Response(null, { status: 401 })
483
483
  */
484
484
  function verifyWebhook(headers, body, secret, options = {}) {
485
485
  return verifyEvent(headers, body, secret, options.now ?? Date.now());
package/here-C2jhTheQ.mjs CHANGED
@@ -12,7 +12,7 @@ function processEnv() {
12
12
  * This package's version: `0.0.0-dev` here, and in a published package the version it was published at, which the
13
13
  * release writes in its place as it stages the package (`stampSdk` in `scripts/release/packages.ts`).
14
14
  */
15
- const SDK_VERSION = "0.1.0-staging.4129";
15
+ const SDK_VERSION = "0.1.0-staging.4135";
16
16
  /**
17
17
  * The header that tells Midsummer which client made each of this package's calls: `Midsummer-Client: sdk/<version>
18
18
  * <part>`, `part` the product whose client it is (`database`, `storage`, `queues`, ...), so the platform counts which
@@ -219,7 +219,7 @@ declare function email(given?: EmailEngine): Email;
219
219
  * ahead of the clock by as much, is refused. After a rotation both secrets sign for a day, and either
220
220
  * passing is enough. Deliveries are at least once: drop a repeat by its `webhook-id`.
221
221
  *
222
- * if (!(await verifyWebhook(request.headers, body, process.env.MIDSUMMER_WEBHOOK_SECRET!))) return new Response(null, { status: 401 })
222
+ * if (!(await verifyWebhook(request.headers, body, process.env.APP_WEBHOOK_SECRET!))) return new Response(null, { status: 401 })
223
223
  */
224
224
  declare function verifyWebhook(headers: Headers | Readonly<Record<string, string | undefined>>, body: string, secret: string, options?: {
225
225
  readonly now?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midsummer-ai/sdk",
3
- "version": "0.1.0-staging.4129",
3
+ "version": "0.1.0-staging.4135",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "description": "Midsummer's handles for an app's code: its Database, Storage, Queues, Vector DB, AI, Email and Agents, with stand-ins for tests.",
package/vector/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as here, r as late } from "../here-C2jhTheQ.mjs";
1
+ import { a as processEnv, n as here, r as late } from "../here-C2jhTheQ.mjs";
2
2
  import { C as Vectors, E as vectorErrorCodes, S as TextSearch, T as VectorError, _ as MAX_TOP_K, a as remote, b as NamespaceName, c as Aggregation, d as MAX_BATCH, f as MAX_DIMENSION, g as MAX_TEXT, h as MAX_QUERIES, l as Ids, m as MAX_METADATA_BYTES, n as direct, p as MAX_FULL_TEXT, u as List, v as MAX_VALUE, w as checked, x as Query, y as MultiQuery } from "../wire-DaZNP-qh.mjs";
3
3
  //#region src/vector/index.ts
4
4
  /**
@@ -57,6 +57,7 @@ function namespace(name) {
57
57
  return vectorDb(late(() => {
58
58
  const handle = here()?.vector;
59
59
  if (handle) return remote(handle);
60
+ if (processEnv().MIDSUMMER_DEV === "1") throw new VectorError("forbidden", "midsummer dev has no Vector DB stand-in yet, so namespace() reaches nothing here. Try it on a preview: midsummer ship <team>/<project>. Or reach a real namespace with a Vector key: connect({ key, origin }), the key from midsummer vector key create <team>.");
60
61
  throw new VectorError("forbidden", "This code runs outside a deployment, so no environment binds a Vector DB namespace for it.");
61
62
  })).namespace(name);
62
63
  }