@base44-preview/sdk 0.8.59-pr.370.cee7e9f → 0.8.59-pr.371.d7ccde1

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.ts CHANGED
@@ -6,7 +6,7 @@ export type { Base44Client, CreateClientAnalyticsConfig, CreateClientConfig, Cre
6
6
  export * from "./types.js";
7
7
  export type { DeleteManyResult, DeleteResult, EntitiesModule, EntityAggregateResult, EntityAggregateSpec, EntityDateBucket, EntityDistinctOptions, EntityFilterOperators, EntityFilterQuery, EntityFilterValue, EntityHandler, EntityListOptions, EntityPage, EntityRecord, EntityTypeRegistry, EntityUpsertOptions, EntityUpsertResult, ImportResult, RealtimeEventType, RealtimeEvent, RealtimeCallback, SortField, UpdateManyResult, } from "./modules/entities.types.js";
8
8
  export type { AuthModule, LoginResponse, RegisterParams, VerifyOtpParams, ChangePasswordParams, ResetPasswordParams, User, } from "./modules/auth.types.js";
9
- export type { IntegrationsModule, IntegrationEndpointFunction, CoreIntegrations, InvokeLLMParams, GenerateImageParams, GenerateImageResult, UploadFileParams, UploadFileResult, EmailAttachment, SendEmailParams, SendEmailResult, ExtractDataFromUploadedFileParams, ExtractDataFromUploadedFileResult, UploadPrivateFileParams, UploadPrivateFileResult, CreateFileSignedUrlParams, CreateFileSignedUrlResult, } from "./modules/integrations.types.js";
9
+ export type { IntegrationsModule, IntegrationEndpointFunction, CoreIntegrations, InvokeLLMParams, GenerateImageParams, GenerateImageResult, UploadFileParams, UploadFileResult, SendEmailParams, SendEmailResult, ExtractDataFromUploadedFileParams, ExtractDataFromUploadedFileResult, UploadPrivateFileParams, UploadPrivateFileResult, CreateFileSignedUrlParams, CreateFileSignedUrlResult, } from "./modules/integrations.types.js";
10
10
  export type { FunctionsModule, FunctionName, FunctionNameRegistry, } from "./modules/functions.types.js";
11
11
  export type { AgentsModule, AgentName, AgentNameRegistry, AgentConversation, AgentMessage, AgentMessageReasoning, AgentMessageToolCall, AgentMessageUsage, AgentMessageCustomContext, AgentMessageMetadata, CreateConversationParams, } from "./modules/agents.types.js";
12
12
  export type { AiGatewayModule, AiGatewayConnection, AiGatewayConnectionOptions, } from "./modules/ai-gateway.types.js";
@@ -86,21 +86,6 @@ export interface UploadFileResult {
86
86
  /** URL of the uploaded file. */
87
87
  file_url: string;
88
88
  }
89
- /**
90
- * A file to attach to an email.
91
- */
92
- export interface EmailAttachment {
93
- /**
94
- * File name the recipient sees, including the extension. Supported extensions: `csv`, `docx`, `gif`, `ics`, `jpeg`, `jpg`, `md`, `pdf`, `png`, `txt`, `webp`, and `xlsx`.
95
- */
96
- filename: string;
97
- /**
98
- * A file your app already uploaded, such as the `file_url` returned by `UploadFile()` or the `file_uri` returned by `UploadPrivateFile()`. Files uploaded by other apps are rejected.
99
- */
100
- file_url?: string;
101
- /** Base64-encoded file contents, for a file your code generated. */
102
- content?: string;
103
- }
104
89
  /**
105
90
  * Parameters for the SendEmail function.
106
91
  */
@@ -109,18 +94,10 @@ export interface SendEmailParams {
109
94
  to: string;
110
95
  /** Email subject line. */
111
96
  subject: string;
112
- /** HTML email body. The same as `html`, so set one or the other, not both. */
113
- body?: string;
114
- /** HTML email body. The same as `body`, so set one or the other, not both. */
115
- html?: string;
116
- /**
117
- * Plain-text email body. On its own, it sends a plain-text email. Set it together with `body` or `html` to send both versions in one email, and the recipient's mail client shows whichever it prefers. Make sure both versions say the same thing.
118
- */
119
- text?: string;
120
- /** The name of the sender. If omitted, the app's name is used. */
97
+ /** Plain text email body content. */
98
+ body: string;
99
+ /** The name of the sender. If omitted, the app's name will be used. */
121
100
  from_name?: string;
122
- /** Files to attach. You can attach up to 5 files, up to 5 MB each and 10 MB in total. Set `filename` and exactly one of `file_url` or `content` on each file. */
123
- attachments?: EmailAttachment[];
124
101
  }
125
102
  export type SendEmailResult = any;
126
103
  /**
@@ -259,35 +236,10 @@ export interface CoreIntegrations {
259
236
  */
260
237
  UploadFile(params: UploadFileParams): Promise<UploadFileResult>;
261
238
  /**
262
- * Send an email from your app.
263
- *
264
- * You can always email registered users of your app. To email anyone else, the app needs a paid plan and a connected custom domain.
239
+ * Send emails to registered users of your app.
265
240
  *
266
- * @param params - Parameters for sending email. Set at least one of `body`, `html`, or `text`.
241
+ * @param params - Parameters for sending email
267
242
  * @returns Promise resolving when the email is sent.
268
- *
269
- * @example
270
- * ```typescript
271
- * // Send an HTML email with a plain-text version
272
- * await base44.integrations.Core.SendEmail({
273
- * to: "user@example.com",
274
- * subject: "Your order has shipped",
275
- * html: "<p>Your order <strong>#1234</strong> is on its way.</p>",
276
- * text: "Your order #1234 is on its way.",
277
- * });
278
- * ```
279
- *
280
- * @example
281
- * ```typescript
282
- * // Attach a file your app uploaded
283
- * const { file_url } = await base44.integrations.Core.UploadFile({ file });
284
- * await base44.integrations.Core.SendEmail({
285
- * to: "user@example.com",
286
- * subject: "Your invoice",
287
- * html: "<p>Your invoice is attached.</p>",
288
- * attachments: [{ filename: "invoice.pdf", file_url }],
289
- * });
290
- * ```
291
243
  */
292
244
  SendEmail(params: SendEmailParams): Promise<SendEmailResult>;
293
245
  /**
@@ -361,7 +361,7 @@ export interface PayPalCheckoutOnClick {
361
361
  /** Whether the checkout is a one-time payment or a subscription. */
362
362
  intent: "capture" | "subscription";
363
363
  /**
364
- * Creates the checkout when the buyer clicks, usually by calling the backend function that calls {@linkcode ServiceRolePaymentsModule.createCheckout | createCheckout()}. Resolve with its result. Reject to stop, for example when a required form field is empty: PayPal's window closes and `onError` receives the error.
364
+ * Creates the checkout when the buyer clicks, usually by calling the backend function that calls [`createCheckout()`](#createcheckout). Resolve with its result. It must be an embedded PayPal checkout with the same `currency` and `intent` you set here, or `onError` receives an error. Reject to stop, for example when a required form field is empty. PayPal's window then closes and `onError` receives the error.
365
365
  */
366
366
  createCheckout: () => Promise<MountableCheckout>;
367
367
  }
@@ -371,7 +371,7 @@ export interface PayPalCheckoutOnClick {
371
371
  export interface CheckoutMount {
372
372
  /** Removes the checkout from the page. Call it when the component that holds it unmounts. For Stripe, mounting another checkout destroys this one for you. */
373
373
  destroy: () => void;
374
- /** PayPal: greys out the button and ignores clicks, for example until a required form is filled in. After a payment completes the button stays off, so `setDisabled(false)` can't start a second payment. Stripe ignores it. */
374
+ /** Grays out PayPal's button and ignores clicks, for example until a required form is filled in. After a payment completes the button stays off, so `setDisabled(false)` can't start a second payment. Stripe ignores it. */
375
375
  setDisabled: (disabled: boolean) => void;
376
376
  }
377
377
  /**
@@ -425,7 +425,7 @@ export interface PaymentsModule {
425
425
  /**
426
426
  * Renders an embedded checkout inside an element on the page.
427
427
  *
428
- * Pass the result of a {@linkcode ServiceRolePaymentsModule.createCheckout | createCheckout()} call made with `presentation: 'embedded'`. Because only the service role can create checkouts, create it in a backend function and return the result to the page.
428
+ * Pass the result of a {@linkcode ServiceRolePaymentsModule.createCheckout | createCheckout()} call made with `presentation: 'embedded'`. Because only the service role can create checkouts, create it in a backend function and return the result to the page. For PayPal, you can instead pass a {@linkcode PayPalCheckoutOnClick} to show the button before any checkout exists. The SDK creates the checkout only when the buyer clicks the button, so visitors who don't buy don't leave unused checkouts behind.
429
429
  *
430
430
  * The SDK loads the provider's library and renders the checkout for you:
431
431
  * - PayPal: Renders a PayPal button. When the buyer approves the payment, the SDK calls {@linkcode completeCheckout | completeCheckout()} and then `onComplete`.
@@ -433,8 +433,6 @@ export interface PaymentsModule {
433
433
  *
434
434
  * To make the checkout appear faster, load the library ahead of time with [`preloadCheckout()`](#preloadcheckout) when the page opens.
435
435
  *
436
- * For PayPal, pass a {@linkcode PayPalCheckoutOnClick} instead of a created checkout to show PayPal's button right away and create the checkout only when the buyer clicks it. The buyer clicks once, and page views create no orders.
437
- *
438
436
  * Requires a browser environment and can't be used in the backend. Rejects when the checkout isn't embedded, when an on-click PayPal checkout is mounted before the app's PayPal can take payments, when the payments config can't be fetched or has no valid script URL for the provider, when the provider's library fails to load, or when PayPal isn't available for the checkout's currency.
439
437
  *
440
438
  * The checkout's callbacks run in the buyer's browser, where they can be faked. Grant access to what the buyer paid for only after your backend confirms the purchase, for example with [`listPurchases()`](#service-role-methods) in a backend function.
@@ -465,7 +463,7 @@ export interface PaymentsModule {
465
463
  *
466
464
  * @example
467
465
  * ```typescript
468
- * // PayPal: show the button on page load and create the checkout on click
466
+ * // Create a PayPal checkout on click
469
467
  * const mount = await base44.payments.mountCheckout(
470
468
  * document.getElementById('paypal')!,
471
469
  * {
@@ -478,7 +476,7 @@ export interface PaymentsModule {
478
476
  * { onComplete: ({ checkout_id }) => confirmPurchase(checkout_id) }
479
477
  * );
480
478
  *
481
- * // Grey out the button until the shipping form is valid
479
+ * // Gray out the button until the shipping form is valid
482
480
  * mount.setDisabled(!formIsValid);
483
481
  * ```
484
482
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/sdk",
3
- "version": "0.8.59-pr.370.cee7e9f",
3
+ "version": "0.8.59-pr.371.d7ccde1",
4
4
  "description": "JavaScript SDK for Base44 API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",