@base44-preview/sdk 0.8.56-pr.352.b15ea38 → 0.8.56-pr.353.5c12c6c
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
|
@@ -14,7 +14,7 @@ export type { AppLogsModule } from "./modules/app-logs.types.js";
|
|
|
14
14
|
export type { AppModule, AppPublicSettings, AppPublicSettingsResponse, } from "./modules/app.types.js";
|
|
15
15
|
export type { ActorsModule, ActorClient, ActorRef, Connection, ActorSubscription, ActorConnectOptions, ActorNameRegistry, ActorRegistry, } from "./modules/actors.types.js";
|
|
16
16
|
export type { SsoModule, SsoAccessTokenResponse } from "./modules/sso.types.js";
|
|
17
|
-
export type { PaymentsModule, ServiceRolePaymentsModule, PaymentsErrorCode, PaymentsRecurringFrequency, CheckoutBuyer, CheckoutFreeTrial, CheckoutItem, CheckoutItemRecurring, CheckoutPresentation, CheckoutElement, CheckoutMount, MountableCheckout, CreateCheckoutParams, CreateCheckoutResult, CompleteCheckoutResult, EmbeddedCheckout, PayPalEmbeddedCheckout, StripeEmbeddedCheckout, MountCheckoutOptions, ListPurchasesParams, ServiceRoleListPurchasesParams, ListPurchasesResult, Purchase, PurchaseItem, PurchaseStatus, RefundParams, RefundResult, CancelSubscriptionOptions, SubscriptionResult, } from "./modules/payments.types.js";
|
|
17
|
+
export type { PaymentsModule, ServiceRolePaymentsModule, PaymentsErrorCode, PaymentsRecurringFrequency, CheckoutBuyer, CheckoutFreeTrial, CheckoutItem, CheckoutItemRecurring, CheckoutPresentation, CheckoutShipping, CheckoutElement, CheckoutMount, MountableCheckout, CreateCheckoutParams, CreateCheckoutResult, CompleteCheckoutResult, EmbeddedCheckout, PayPalEmbeddedCheckout, StripeEmbeddedCheckout, MountCheckoutOptions, ListPurchasesParams, ServiceRoleListPurchasesParams, ListPurchasesResult, Purchase, PurchaseItem, PurchaseStatus, RefundParams, ShippingAddress, RefundResult, CancelSubscriptionOptions, SubscriptionResult, } from "./modules/payments.types.js";
|
|
18
18
|
export type { BrowserModule, BrowserSession, BrowserSessionOptions, } from "./modules/browser.types.js";
|
|
19
19
|
export { Actor, type Conn } from "./actor.js";
|
|
20
20
|
export type { ConnectorsModule, UserConnectorsModule, ConnectorApiRequest, ConnectorApiResponse, ConnectorApiResponsePhase, } from "./modules/connectors.types.js";
|
|
@@ -81,7 +81,7 @@ export interface ConnectorApiRequest {
|
|
|
81
81
|
export interface ConnectorApiResponse<T = unknown> {
|
|
82
82
|
/** `true` only when the upstream API returned a 2xx status. Proxy and upstream errors are `false`. */
|
|
83
83
|
success: boolean;
|
|
84
|
-
/** How far the call progressed.
|
|
84
|
+
/** How far the call progressed. */
|
|
85
85
|
phase: ConnectorApiResponsePhase;
|
|
86
86
|
/** The upstream HTTP status code, or `null` when no response was received. */
|
|
87
87
|
status: number | null;
|
|
@@ -40,7 +40,7 @@ export interface CheckoutItem {
|
|
|
40
40
|
amount: number;
|
|
41
41
|
/** Number of units, from 1 to 1,000,000. Defaults to `1`. */
|
|
42
42
|
quantity?: number;
|
|
43
|
-
/** Whether the item ships
|
|
43
|
+
/** Whether the item ships. The provider then collects a shipping address, unless you pass one in `shipping.address`. */
|
|
44
44
|
shippable?: boolean;
|
|
45
45
|
/** Billing terms. Set this to sell the item as a subscription. PayPal and Wix Payments allow one recurring item per checkout, and PayPal allows no other items with it. */
|
|
46
46
|
recurring?: CheckoutItemRecurring;
|
|
@@ -58,6 +58,36 @@ export interface CheckoutBuyer {
|
|
|
58
58
|
/** Buyer's phone number. */
|
|
59
59
|
phone?: string;
|
|
60
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* A shipping address. Returned on a purchase whether your app or the provider collected it.
|
|
63
|
+
*/
|
|
64
|
+
export interface ShippingAddress {
|
|
65
|
+
/** Recipient's full name, 1 to 300 characters. */
|
|
66
|
+
name: string;
|
|
67
|
+
/** Street address, 1 to 300 characters. */
|
|
68
|
+
line1: string;
|
|
69
|
+
/** Apartment, suite or building, up to 300 characters. */
|
|
70
|
+
line2?: string | null;
|
|
71
|
+
/** City, up to 120 characters. Some countries address by region and postal code alone. */
|
|
72
|
+
city?: string | null;
|
|
73
|
+
/** State, province or region, up to 300 characters. */
|
|
74
|
+
region?: string | null;
|
|
75
|
+
/** Postal or ZIP code, up to 60 characters. */
|
|
76
|
+
postal_code?: string | null;
|
|
77
|
+
/** Two-letter ISO 3166-1 country code, such as `'US'`. */
|
|
78
|
+
country: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Shipping for a checkout with at least one `shippable` item. Supported for PayPal one-time checkouts only.
|
|
82
|
+
*
|
|
83
|
+
* Compute the fee on your server, never in the browser. When the fee depends on the address, such as by distance or zone, collect the address in your app and pass it in `address`: PayPal shows it to the buyer locked, so the order ships where the fee was computed for. When the fee doesn't depend on the address, pass only `amount` and PayPal asks the buyer for the address.
|
|
84
|
+
*/
|
|
85
|
+
export interface CheckoutShipping {
|
|
86
|
+
/** Address your app collected. Omit it to let the provider ask the buyer. */
|
|
87
|
+
address?: ShippingAddress;
|
|
88
|
+
/** Shipping fee in minor units, shown to the buyer as its own shipping line. Omit it for free shipping. */
|
|
89
|
+
amount?: number;
|
|
90
|
+
}
|
|
61
91
|
/**
|
|
62
92
|
* How the buyer pays.
|
|
63
93
|
*
|
|
@@ -85,6 +115,8 @@ export interface CreateCheckoutParams {
|
|
|
85
115
|
idempotency_key?: string;
|
|
86
116
|
/** How the buyer pays. Defaults to `'redirect'`. PayPal apps must pass `'embedded'`, and Wix Payments supports only `'redirect'`. */
|
|
87
117
|
presentation?: CheckoutPresentation;
|
|
118
|
+
/** Shipping address and fee. Allowed only when at least one item is `shippable`. Supported for PayPal one-time checkouts only; other providers and subscriptions reject it with `invalid_request`. */
|
|
119
|
+
shipping?: CheckoutShipping;
|
|
88
120
|
}
|
|
89
121
|
/**
|
|
90
122
|
* Data that Stripe Embedded Checkout needs to render.
|
|
@@ -184,6 +216,10 @@ export interface Purchase {
|
|
|
184
216
|
metadata?: Record<string, string> | null;
|
|
185
217
|
/** ID of the subscription, for recurring purchases. */
|
|
186
218
|
subscription_id?: string | null;
|
|
219
|
+
/** Where the order ships, whether your app or the provider collected the address. Always `null` unless you call with the service role. Save it on your order record. */
|
|
220
|
+
shipping_address?: ShippingAddress | null;
|
|
221
|
+
/** Shipping fee in minor units, when the checkout charged one. */
|
|
222
|
+
shipping_amount?: number | null;
|
|
187
223
|
/** ID of the payment to pass to [`refund()`](/developers/references/sdk/docs/interfaces/service-role-payments#refund). For a PayPal subscription it's the latest charge, returned only with the service role: read it when you start a refund and reuse it on retries. It's `null` where the provider doesn't name a payment, such as a PayPal subscription whose latest charge is already refunded. */
|
|
188
224
|
payment_id?: string | null;
|
|
189
225
|
}
|