@blinkdotnew/sdk 2.5.1 → 2.6.0

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.d.mts CHANGED
@@ -310,8 +310,8 @@ interface TableOperations<T = any> {
310
310
  declare class BlinkError extends Error {
311
311
  code?: string | undefined;
312
312
  status?: number | undefined;
313
- details?: any;
314
- constructor(message: string, code?: string | undefined, status?: number | undefined, details?: any);
313
+ details?: any | undefined;
314
+ constructor(message: string, code?: string | undefined, status?: number | undefined, details?: any | undefined);
315
315
  }
316
316
  interface StorageUploadOptions {
317
317
  /**
@@ -798,6 +798,32 @@ interface SendEmailRequest {
798
798
  subject: string;
799
799
  html?: string;
800
800
  text?: string;
801
+ /**
802
+ * Pick which sender this email goes out from.
803
+ *
804
+ * Two accepted shapes — the server disambiguates by whether the value
805
+ * contains an `@` character:
806
+ * - **Full address** (any string containing `@`, e.g.
807
+ * `"support@mail.acme.com"`) — sends from that specific verified
808
+ * sender. The address must be set up in Settings → Email beforehand;
809
+ * unverified addresses are rejected by the server with HTTP 403. On
810
+ * the SDK side this surfaces as a `BlinkNotificationsError` whose
811
+ * `.status === 403` and `.details?.code === 'UNVERIFIED_SENDER'` —
812
+ * the SDK-level `.code` is always `'NOTIFICATIONS_ERROR'`, so branch
813
+ * on `.status` + `.details` (not `.code`) to detect this case.
814
+ * - **Display name** (any string without `@`, e.g. `"Acme Support"`) —
815
+ * keeps the project's default sender address but overrides the
816
+ * visible name in the recipient's inbox. Useful for tagging different
817
+ * message types ("Acme Receipts", "Acme Updates") without verifying
818
+ * more senders.
819
+ *
820
+ * A display name MUST NOT contain `@`. If it does, the server interprets
821
+ * it as a sending address and rejects with 403 `UNVERIFIED_SENDER`.
822
+ *
823
+ * Omit to use the project's default sender (the one flagged "Default"
824
+ * in Settings → Email — same one auth emails like password reset and
825
+ * magic links use).
826
+ */
801
827
  from?: string;
802
828
  replyTo?: string;
803
829
  cc?: string | string[];
@@ -1007,17 +1033,17 @@ declare class HttpClient {
1007
1033
  * Stream AI text generation - uses Vercel AI SDK's pipeUIMessageStreamToResponse (Data Stream Protocol)
1008
1034
  */
1009
1035
  streamAiText(prompt: string, options: {
1010
- model?: string | undefined;
1011
- messages?: {
1036
+ model?: string;
1037
+ messages?: Array<{
1012
1038
  role: string;
1013
1039
  content: string | any[];
1014
- }[] | undefined;
1015
- search?: boolean | undefined;
1016
- maxSteps?: number | undefined;
1017
- experimental_continueSteps?: boolean | undefined;
1018
- maxTokens?: number | undefined;
1019
- temperature?: number | undefined;
1020
- signal?: AbortSignal | undefined;
1040
+ }>;
1041
+ search?: boolean;
1042
+ maxSteps?: number;
1043
+ experimental_continueSteps?: boolean;
1044
+ maxTokens?: number;
1045
+ temperature?: number;
1046
+ signal?: AbortSignal;
1021
1047
  } | undefined, onChunk: (chunk: string) => void): Promise<any>;
1022
1048
  aiObject(prompt: string, options?: {
1023
1049
  model?: string;
@@ -1031,11 +1057,11 @@ declare class HttpClient {
1031
1057
  * Stream AI object generation - uses Vercel AI SDK's pipeTextStreamToResponse
1032
1058
  */
1033
1059
  streamAiObject(prompt: string, options: {
1034
- model?: string | undefined;
1035
- output?: "object" | "array" | "enum" | undefined;
1060
+ model?: string;
1061
+ output?: "object" | "array" | "enum";
1036
1062
  schema?: any;
1037
- enum?: string[] | undefined;
1038
- signal?: AbortSignal | undefined;
1063
+ enum?: string[];
1064
+ signal?: AbortSignal;
1039
1065
  } | undefined, onPartial: (partial: any) => void): Promise<any>;
1040
1066
  aiImage(prompt: string, options?: {
1041
1067
  model?: string;
package/dist/index.d.ts CHANGED
@@ -310,8 +310,8 @@ interface TableOperations<T = any> {
310
310
  declare class BlinkError extends Error {
311
311
  code?: string | undefined;
312
312
  status?: number | undefined;
313
- details?: any;
314
- constructor(message: string, code?: string | undefined, status?: number | undefined, details?: any);
313
+ details?: any | undefined;
314
+ constructor(message: string, code?: string | undefined, status?: number | undefined, details?: any | undefined);
315
315
  }
316
316
  interface StorageUploadOptions {
317
317
  /**
@@ -798,6 +798,32 @@ interface SendEmailRequest {
798
798
  subject: string;
799
799
  html?: string;
800
800
  text?: string;
801
+ /**
802
+ * Pick which sender this email goes out from.
803
+ *
804
+ * Two accepted shapes — the server disambiguates by whether the value
805
+ * contains an `@` character:
806
+ * - **Full address** (any string containing `@`, e.g.
807
+ * `"support@mail.acme.com"`) — sends from that specific verified
808
+ * sender. The address must be set up in Settings → Email beforehand;
809
+ * unverified addresses are rejected by the server with HTTP 403. On
810
+ * the SDK side this surfaces as a `BlinkNotificationsError` whose
811
+ * `.status === 403` and `.details?.code === 'UNVERIFIED_SENDER'` —
812
+ * the SDK-level `.code` is always `'NOTIFICATIONS_ERROR'`, so branch
813
+ * on `.status` + `.details` (not `.code`) to detect this case.
814
+ * - **Display name** (any string without `@`, e.g. `"Acme Support"`) —
815
+ * keeps the project's default sender address but overrides the
816
+ * visible name in the recipient's inbox. Useful for tagging different
817
+ * message types ("Acme Receipts", "Acme Updates") without verifying
818
+ * more senders.
819
+ *
820
+ * A display name MUST NOT contain `@`. If it does, the server interprets
821
+ * it as a sending address and rejects with 403 `UNVERIFIED_SENDER`.
822
+ *
823
+ * Omit to use the project's default sender (the one flagged "Default"
824
+ * in Settings → Email — same one auth emails like password reset and
825
+ * magic links use).
826
+ */
801
827
  from?: string;
802
828
  replyTo?: string;
803
829
  cc?: string | string[];
@@ -1007,17 +1033,17 @@ declare class HttpClient {
1007
1033
  * Stream AI text generation - uses Vercel AI SDK's pipeUIMessageStreamToResponse (Data Stream Protocol)
1008
1034
  */
1009
1035
  streamAiText(prompt: string, options: {
1010
- model?: string | undefined;
1011
- messages?: {
1036
+ model?: string;
1037
+ messages?: Array<{
1012
1038
  role: string;
1013
1039
  content: string | any[];
1014
- }[] | undefined;
1015
- search?: boolean | undefined;
1016
- maxSteps?: number | undefined;
1017
- experimental_continueSteps?: boolean | undefined;
1018
- maxTokens?: number | undefined;
1019
- temperature?: number | undefined;
1020
- signal?: AbortSignal | undefined;
1040
+ }>;
1041
+ search?: boolean;
1042
+ maxSteps?: number;
1043
+ experimental_continueSteps?: boolean;
1044
+ maxTokens?: number;
1045
+ temperature?: number;
1046
+ signal?: AbortSignal;
1021
1047
  } | undefined, onChunk: (chunk: string) => void): Promise<any>;
1022
1048
  aiObject(prompt: string, options?: {
1023
1049
  model?: string;
@@ -1031,11 +1057,11 @@ declare class HttpClient {
1031
1057
  * Stream AI object generation - uses Vercel AI SDK's pipeTextStreamToResponse
1032
1058
  */
1033
1059
  streamAiObject(prompt: string, options: {
1034
- model?: string | undefined;
1035
- output?: "object" | "array" | "enum" | undefined;
1060
+ model?: string;
1061
+ output?: "object" | "array" | "enum";
1036
1062
  schema?: any;
1037
- enum?: string[] | undefined;
1038
- signal?: AbortSignal | undefined;
1063
+ enum?: string[];
1064
+ signal?: AbortSignal;
1039
1065
  } | undefined, onPartial: (partial: any) => void): Promise<any>;
1040
1066
  aiImage(prompt: string, options?: {
1041
1067
  model?: string;