@boelabs/billete-sdk 7.0.0 → 9.0.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/README.md +3 -3
- package/dist/client.d.ts +9 -4
- package/dist/client.js +12 -2
- package/dist/{errors-e_-7ZZmn.d.ts → errors-CTtPcwiO.d.ts} +41 -3
- package/dist/{events-CWajoKsy.d.ts → events-Dry7XWQH.d.ts} +58 -14
- package/dist/{http-Do9Fl8fk.js → http-BMld1QWi.js} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/webhooks.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -63,7 +63,7 @@ Crea una clave secreta en el dashboard (**Desarrolladores → Claves API**) y gu
|
|
|
63
63
|
```ts
|
|
64
64
|
import { createBillete } from "@boelabs/billete-sdk";
|
|
65
65
|
|
|
66
|
-
const billete = createBillete({ apiVersion: "2026-10-
|
|
66
|
+
const billete = createBillete({ apiVersion: "2026-10-24", environment: "test" });
|
|
67
67
|
|
|
68
68
|
const checkout = await billete.checkouts.create({
|
|
69
69
|
plan: "plan_…",
|
|
@@ -91,7 +91,7 @@ solicite expresamente. En carritos, solo ofrece los demás métodos que todos lo
|
|
|
91
91
|
|
|
92
92
|
```ts
|
|
93
93
|
const billete = createBillete({
|
|
94
|
-
apiVersion: "2026-10-
|
|
94
|
+
apiVersion: "2026-10-24",
|
|
95
95
|
environment: "production",
|
|
96
96
|
apiKey: process.env.BILLETE_API_KEY,
|
|
97
97
|
timeoutMs: 30_000,
|
|
@@ -257,7 +257,7 @@ return { token: session.token };
|
|
|
257
257
|
// Navegador
|
|
258
258
|
import { createClient } from "@boelabs/billete-sdk/client";
|
|
259
259
|
|
|
260
|
-
const billete = createClient({ apiVersion: "2026-10-
|
|
260
|
+
const billete = createClient({ apiVersion: "2026-10-24", customerSession: token });
|
|
261
261
|
|
|
262
262
|
const { data: subscriptions } = await billete.customer.subscriptions();
|
|
263
263
|
const tokens = await billete.customer.feature("tokens");
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { $ as FulfillmentHandover, $t as
|
|
1
|
+
import { $ as PortalSessionCreate, A as CustomerSessionCreate, At as PublicPaymentLink, B as FulfillmentTrackingInput, Bt as LatestApiVersion, C as CouponCreate, Ct as PublicCheckout, D as CustomerInput, Dt as PublicFulfillment, E as CustomerCreate, Et as PublicClaimSummary, F as FeatureOperationCreate, Ft as API_VERSION_PATTERN, G as PaymentLinkUpdate, Gt as isApiVersionRetired, H as InvoiceLineInput, Ht as apiVersionStage, I as FeatureUpdate, It as ApiVersion, J as PlanCreate, K as PlanCheckoutCreate, Kt as supportedApiVersions, L as FulfillmentDeliverInput, Lt as ApiVersionLifecycle, M as EventSelector, Mt as PublicPortal, N as FeatureCreate, Nt as API_VERSIONS, O as CustomerMemberCreate, Ot as PublicFulfillmentRefund, P as FeatureOperationCommit, Pt as API_VERSION_HEADER, Q as PlanUpdate, R as FulfillmentHandoverInput, Rt as ApiVersionStage, S as CollectInput, St as PortalFeatures, T as CustomFieldInput, Tt as PublicClaim, U as KEY_PATTERN, Ut as currentApiVersion, V as InvoiceCreate, Vt as apiVersionLifecycle, W as PaymentLinkCreate, Wt as isApiVersion, X as PlanLinkCreate, Y as PlanFeaturesInput, Z as PlanPriceInput, _ as ClientPaymentCode, _t as PaymentInstructions, a as AfterCompletionInput, at as RefundCreate, b as ClientSubscriptionSeats, bt as PaymentNextAction, c as ClaimResolve, ct as SubscriptionChangePreviewInput, d as ClientCheckoutUpdate, dt as VariantInput, et as ProductCheckoutCreate, f as ClientClaimCreate, ft as WebhookEndpointCreate, g as ClientLinkCheckout, gt as FulfillmentOption, h as ClientInvoicePay, ht as CustomerSubscriptionChangeResult, i as TransportOptions, it as ProductUpdate, j as CustomerUpdate, jt as PublicPaymentState, k as CustomerMemberUpdate, kt as PublicInvoice, l as ClaimRespond, lt as SubscriptionCreate, m as ClientFulfillmentProblem, mt as CustomerSubscription, n as BilleteErrorCode, nt as ProductCreate, o as CheckoutCreate, ot as SubscriptionCancel, p as ClientCustomerClaimCreate, pt as WebhookEndpointUpdate, q as PlanCouponCreate, r as RequestOptions, rt as ProductLinkCreate, s as CheckoutItemInput, st as SubscriptionChangeCreate, t as BilleteError, tt as ProductCouponCreate, u as ClientCheckoutPay, ut as SubscriptionUpdate, v as ClientRefundDestination, vt as PaymentMethodField, w as CouponUpdate, wt as PublicCheckoutItem, x as ClientSubscriptionUpdate, xt as PaymentTestScenario, y as ClientSubscriptionCancel, yt as PaymentMethodOption, z as FulfillmentInput, zt as LATEST_API_VERSION } from "./errors-CTtPcwiO.js";
|
|
2
|
+
import { $ as FulfillmentHandover, $t as PAYMENT_FAILURE_CODES, A as Coupon, An as ENVIRONMENTS, At as RISK_LEVELS, B as Event, Bt as SubscriptionChangeResult, C as CheckoutPurpose, Cn as TaxBehavior, Ct as PlanSeats, D as ClaimReason, Dn as isLandlinePhone, Dt as ProductVariant, E as ClaimOutcome, En as findBank, Et as ProductCategory, F as CustomerFeature, Ft as SUBSCRIPTION_STATUSES, G as Feature, Gt as WebhookEndpoint, H as FEATURE_TYPES, Ht as SubscriptionStatus, I as CustomerMember, It as SubmitLabel, J as FeatureReset, Jt as ReceiptSend, K as FeatureOperation, Kt as Weekday, L as CustomerMemberList, Lt as Subscription, M as CustomField, Mn as TokenKind, Mt as ResetFrequency, N as Customer, Nn as tokenEnvironment, Nt as RiskLevel, O as ClaimStatus, On as isMobilePhone, Ot as REFUND_MODES, P as CustomerDetails, Pn as tokenPrefix, Pt as SUBMIT_LABELS, Q as FulfillmentChoice, Qt as ApiErrorType, R as CustomerSession, Rt as SubscriptionChange, S as CheckoutItem, Sn as TAX_BEHAVIORS, St as PlanPrice, T as ClaimMessage, Tn as VENEZUELAN_BANKS, Tt as Product, U as FULFILLMENT_METHODS, Ut as SubscriptionTerms, V as ExchangeRate, Vt as SubscriptionRenewal, W as FULFILLMENT_STATUSES, Wt as USAGE_FEATURE_TYPES, X as FeatureUsageResult, Xt as ApiErrorBody, Y as FeatureType, Yt as API_ERROR_TYPES, Z as Fulfillment, Zt as ApiErrorEnvelope, _ as CLAIM_STATUSES, _n as MOBILE_PREFIXES, _t as PaymentSettlement, a as WEBHOOK_TEST_EVENT, an as AddressInput, at as Invoice, b as CarrierOffice, bn as SUSPENSION_DAYS, bt as Plan, c as AfterCompletion, cn as BillingMonths, ct as LineItem, d as CANCELLATION_FEEDBACK, dn as GRACE_PERIOD_DAYS, dt as PRODUCT_CATEGORIES, en as PaymentFailureCode, et as FulfillmentMethod, f as CARRIERS, fn as GracePeriodDays, ft as Payment, g as CLAIM_REASONS, gn as MAX_QUANTITY, gt as PaymentLink, h as CLAIM_OUTCOMES, hn as ListSort, ht as PaymentFeeDetails, i as SubscribableEventType, in as Address, it as INVOICE_STATUSES, j as CurrencyAvailability, jn as Environment, jt as Refund, k as CollectSettings, kn as nationalPhone, kt as RESET_FREQUENCIES, l as Balance, ln as CURRENCIES, lt as MAX_SEATS, m as CHECKOUT_PURPOSES, mn as ListQuery, mt as PaymentFailure, n as EventDataMap, nn as ApiErrorCode, nt as FulfillmentTracking, o as WebhookEvent, on as BILLING_MONTHS, ot as InvoiceReason, p as CARRIER_TEST_SCENARIOS, pn as List, pt as PaymentAttempt, q as FeatureOperationResult, qt as ReceiptReference, r as EventType, rn as ACCOUNT_NUMBER_LENGTH, rt as INVOICE_REASONS, s as Actor, sn as BankCode, st as InvoiceStatus, t as EVENT_TYPES, tn as API_ERROR_CODES, tt as FulfillmentStatus, u as BalanceAmount, un as Currency, ut as PAYMENT_STATUSES, v as CancellationFeedback, vn as Metadata, vt as PaymentStatus, w as Claim, wn as Timestamp, wt as PortalSession, x as Checkout, xn as SuspensionDays, xt as PlanFeatureValues, y as Carrier, yn as MobilePrefix, yt as Payout, z as Deletion, zt as SubscriptionChangePreview } from "./events-Dry7XWQH.js";
|
|
3
3
|
//#region src/create-client.d.ts
|
|
4
4
|
interface ClientOptions extends TransportOptions {
|
|
5
5
|
/**
|
|
@@ -14,7 +14,7 @@ interface ClientOptions extends TransportOptions {
|
|
|
14
14
|
* and customer data requires a short-lived customer session minted by your server.
|
|
15
15
|
*
|
|
16
16
|
* ```ts
|
|
17
|
-
* const billete = createClient({ apiVersion: "2026-10-
|
|
17
|
+
* const billete = createClient({ apiVersion: "2026-10-24", customerSession: token });
|
|
18
18
|
* const [subscription] = (await billete.customer.subscriptions()).data;
|
|
19
19
|
* if (subscription?.renewal?.status === "overdue") showBanner(subscription.renewal);
|
|
20
20
|
* ```
|
|
@@ -84,6 +84,11 @@ export declare function createClient(options: ClientOptions): {
|
|
|
84
84
|
openClaim: (token: string, input: ClientClaimCreate, options?: RequestOptions) => Promise<PublicFulfillment>;
|
|
85
85
|
/** Something went wrong: the funds stay held while Billete reviews it. */
|
|
86
86
|
reportProblem: (token: string, input: ClientFulfillmentProblem, options?: RequestOptions) => Promise<PublicFulfillment>;
|
|
87
|
+
/**
|
|
88
|
+
* Where Billete sends the customer's refund by Pago Móvil, while it waits for one
|
|
89
|
+
* (`refund.status: "needs_destination"`).
|
|
90
|
+
*/
|
|
91
|
+
setRefundDestination: (token: string, input: ClientRefundDestination, options?: RequestOptions) => Promise<PublicFulfillment>;
|
|
87
92
|
};
|
|
88
93
|
/**
|
|
89
94
|
* A claim about a payment, as its customer follows it. The `token` comes in its page's link
|
|
@@ -134,4 +139,4 @@ export declare function createClient(options: ClientOptions): {
|
|
|
134
139
|
};
|
|
135
140
|
type BilleteClient = ReturnType<typeof createClient>;
|
|
136
141
|
//#endregion
|
|
137
|
-
export { type ACCOUNT_NUMBER_LENGTH, type API_ERROR_CODES, type API_ERROR_TYPES, type API_VERSIONS, type API_VERSION_HEADER, type API_VERSION_PATTERN, type Actor, type Address, type AddressInput, type AfterCompletion, type AfterCompletionInput, type ApiErrorBody, type ApiErrorCode, type ApiErrorEnvelope, type ApiErrorType, type ApiVersion, type ApiVersionLifecycle, type ApiVersionStage, type BILLING_MONTHS, type Balance, type BalanceAmount, type BankCode, type BilleteClient, BilleteError, type BilleteErrorCode, type BillingMonths, type CANCELLATION_FEEDBACK, type CARRIERS, type CARRIER_TEST_SCENARIOS, type CHECKOUT_PURPOSES, type CLAIM_OUTCOMES, type CLAIM_REASONS, type CLAIM_STATUSES, type CURRENCIES, type CancellationFeedback, type Carrier, type CarrierOffice, type Checkout, type CheckoutCreate, type CheckoutItem, type CheckoutItemInput, type CheckoutPurpose, type Claim, type ClaimMessage, type ClaimOutcome, type ClaimReason, type ClaimResolve, type ClaimRespond, type ClaimStatus, type ClientCheckoutPay, type ClientCheckoutUpdate, type ClientClaimCreate, type ClientCustomerClaimCreate, type ClientFulfillmentProblem, type ClientInvoicePay, type ClientLinkCheckout, type ClientOptions, type ClientPaymentCode, type ClientSubscriptionCancel, type ClientSubscriptionSeats, type ClientSubscriptionUpdate, type CollectInput, type CollectSettings, type Coupon, type CouponCreate, type CouponUpdate, type Currency, type CurrencyAvailability, type CustomField, type CustomFieldInput, type Customer, type CustomerCreate, type CustomerDetails, type CustomerFeature, type CustomerInput, type CustomerMember, type CustomerMemberCreate, type CustomerMemberList, type CustomerMemberUpdate, type CustomerSession, type CustomerSessionCreate, type CustomerSubscription, type CustomerSubscriptionChangeResult, type CustomerUpdate, type Deletion, type ENVIRONMENTS, type EVENT_TYPES, type Environment, type Event, type EventDataMap, type EventSelector, type EventType, type ExchangeRate, type FEATURE_TYPES, type FULFILLMENT_METHODS, type FULFILLMENT_STATUSES, type Feature, type FeatureCreate, type FeatureOperation, type FeatureOperationCommit, type FeatureOperationCreate, type FeatureOperationResult, type FeatureReset, type FeatureType, type FeatureUpdate, type FeatureUsageResult, type Fulfillment, type FulfillmentChoice, type FulfillmentDeliverInput, type FulfillmentHandover, type FulfillmentHandoverInput, type FulfillmentInput, type FulfillmentMethod, type FulfillmentOption, type FulfillmentStatus, type FulfillmentTracking, type FulfillmentTrackingInput, type GRACE_PERIOD_DAYS, type GracePeriodDays, type INVOICE_REASONS, type INVOICE_STATUSES, type Invoice, type InvoiceCreate, type InvoiceLineInput, type InvoiceReason, type InvoiceStatus, type KEY_PATTERN, type LATEST_API_VERSION, type LatestApiVersion, type LineItem, type List, type ListQuery, type ListSort, type MAX_QUANTITY, type MAX_SEATS, type MOBILE_PREFIXES, type Metadata, type MobilePrefix, type PAYMENT_FAILURE_CODES, type PAYMENT_STATUSES, type PRODUCT_CATEGORIES, type Payment, type PaymentAttempt, type PaymentFailure, type PaymentFailureCode, type PaymentFeeDetails, type PaymentInstructions, type PaymentLink, type PaymentLinkCreate, type PaymentLinkUpdate, type PaymentMethodField, type PaymentMethodOption, type PaymentNextAction, type PaymentSettlement, type PaymentStatus, type PaymentTestScenario, type Payout, type Plan, type PlanCheckoutCreate, type PlanCouponCreate, type PlanCreate, type PlanFeatureValues, type PlanFeaturesInput, type PlanLinkCreate, type PlanPrice, type PlanPriceInput, type PlanSeats, type PlanUpdate, type PortalFeatures, type PortalSession, type PortalSessionCreate, type Product, type ProductCategory, type ProductCheckoutCreate, type ProductCouponCreate, type ProductCreate, type ProductLinkCreate, type ProductUpdate, type ProductVariant, type PublicCheckout, type PublicCheckoutItem, type PublicClaim, type PublicClaimSummary, type PublicFulfillment, type PublicInvoice, type PublicPaymentLink, type PublicPaymentState, type PublicPortal, type RESET_FREQUENCIES, type RISK_LEVELS, type ReceiptReference, type ReceiptSend, type Refund, type RefundCreate, type RequestOptions, type ResetFrequency, type RiskLevel, type SUBMIT_LABELS, type SUBSCRIPTION_STATUSES, type SubmitLabel, type SubscribableEventType, type Subscription, type SubscriptionCancel, type SubscriptionChange, type SubscriptionChangeCreate, type SubscriptionChangePreview, type SubscriptionChangePreviewInput, type SubscriptionChangeResult, type SubscriptionCreate, type SubscriptionRenewal, type SubscriptionStatus, type SubscriptionTerms, type SubscriptionUpdate, type TAX_BEHAVIORS, type TaxBehavior, type Timestamp, type TokenKind, type USAGE_FEATURE_TYPES, type VENEZUELAN_BANKS, type VariantInput, type WEBHOOK_TEST_EVENT, type WebhookEndpoint, type WebhookEndpointCreate, type WebhookEndpointUpdate, type WebhookEvent, type Weekday, type apiVersionLifecycle, type apiVersionStage, type currentApiVersion, type findBank, type isApiVersion, type isApiVersionRetired, type isLandlinePhone, type isMobilePhone, type nationalPhone, type supportedApiVersions, type tokenEnvironment, type tokenPrefix };
|
|
142
|
+
export { type ACCOUNT_NUMBER_LENGTH, type API_ERROR_CODES, type API_ERROR_TYPES, type API_VERSIONS, type API_VERSION_HEADER, type API_VERSION_PATTERN, type Actor, type Address, type AddressInput, type AfterCompletion, type AfterCompletionInput, type ApiErrorBody, type ApiErrorCode, type ApiErrorEnvelope, type ApiErrorType, type ApiVersion, type ApiVersionLifecycle, type ApiVersionStage, type BILLING_MONTHS, type Balance, type BalanceAmount, type BankCode, type BilleteClient, BilleteError, type BilleteErrorCode, type BillingMonths, type CANCELLATION_FEEDBACK, type CARRIERS, type CARRIER_TEST_SCENARIOS, type CHECKOUT_PURPOSES, type CLAIM_OUTCOMES, type CLAIM_REASONS, type CLAIM_STATUSES, type CURRENCIES, type CancellationFeedback, type Carrier, type CarrierOffice, type Checkout, type CheckoutCreate, type CheckoutItem, type CheckoutItemInput, type CheckoutPurpose, type Claim, type ClaimMessage, type ClaimOutcome, type ClaimReason, type ClaimResolve, type ClaimRespond, type ClaimStatus, type ClientCheckoutPay, type ClientCheckoutUpdate, type ClientClaimCreate, type ClientCustomerClaimCreate, type ClientFulfillmentProblem, type ClientInvoicePay, type ClientLinkCheckout, type ClientOptions, type ClientPaymentCode, type ClientRefundDestination, type ClientSubscriptionCancel, type ClientSubscriptionSeats, type ClientSubscriptionUpdate, type CollectInput, type CollectSettings, type Coupon, type CouponCreate, type CouponUpdate, type Currency, type CurrencyAvailability, type CustomField, type CustomFieldInput, type Customer, type CustomerCreate, type CustomerDetails, type CustomerFeature, type CustomerInput, type CustomerMember, type CustomerMemberCreate, type CustomerMemberList, type CustomerMemberUpdate, type CustomerSession, type CustomerSessionCreate, type CustomerSubscription, type CustomerSubscriptionChangeResult, type CustomerUpdate, type Deletion, type ENVIRONMENTS, type EVENT_TYPES, type Environment, type Event, type EventDataMap, type EventSelector, type EventType, type ExchangeRate, type FEATURE_TYPES, type FULFILLMENT_METHODS, type FULFILLMENT_STATUSES, type Feature, type FeatureCreate, type FeatureOperation, type FeatureOperationCommit, type FeatureOperationCreate, type FeatureOperationResult, type FeatureReset, type FeatureType, type FeatureUpdate, type FeatureUsageResult, type Fulfillment, type FulfillmentChoice, type FulfillmentDeliverInput, type FulfillmentHandover, type FulfillmentHandoverInput, type FulfillmentInput, type FulfillmentMethod, type FulfillmentOption, type FulfillmentStatus, type FulfillmentTracking, type FulfillmentTrackingInput, type GRACE_PERIOD_DAYS, type GracePeriodDays, type INVOICE_REASONS, type INVOICE_STATUSES, type Invoice, type InvoiceCreate, type InvoiceLineInput, type InvoiceReason, type InvoiceStatus, type KEY_PATTERN, type LATEST_API_VERSION, type LatestApiVersion, type LineItem, type List, type ListQuery, type ListSort, type MAX_QUANTITY, type MAX_SEATS, type MOBILE_PREFIXES, type Metadata, type MobilePrefix, type PAYMENT_FAILURE_CODES, type PAYMENT_STATUSES, type PRODUCT_CATEGORIES, type Payment, type PaymentAttempt, type PaymentFailure, type PaymentFailureCode, type PaymentFeeDetails, type PaymentInstructions, type PaymentLink, type PaymentLinkCreate, type PaymentLinkUpdate, type PaymentMethodField, type PaymentMethodOption, type PaymentNextAction, type PaymentSettlement, type PaymentStatus, type PaymentTestScenario, type Payout, type Plan, type PlanCheckoutCreate, type PlanCouponCreate, type PlanCreate, type PlanFeatureValues, type PlanFeaturesInput, type PlanLinkCreate, type PlanPrice, type PlanPriceInput, type PlanSeats, type PlanUpdate, type PortalFeatures, type PortalSession, type PortalSessionCreate, type Product, type ProductCategory, type ProductCheckoutCreate, type ProductCouponCreate, type ProductCreate, type ProductLinkCreate, type ProductUpdate, type ProductVariant, type PublicCheckout, type PublicCheckoutItem, type PublicClaim, type PublicClaimSummary, type PublicFulfillment, type PublicFulfillmentRefund, type PublicInvoice, type PublicPaymentLink, type PublicPaymentState, type PublicPortal, type REFUND_MODES, type RESET_FREQUENCIES, type RISK_LEVELS, type ReceiptReference, type ReceiptSend, type Refund, type RefundCreate, type RequestOptions, type ResetFrequency, type RiskLevel, type SUBMIT_LABELS, type SUBSCRIPTION_STATUSES, type SUSPENSION_DAYS, type SubmitLabel, type SubscribableEventType, type Subscription, type SubscriptionCancel, type SubscriptionChange, type SubscriptionChangeCreate, type SubscriptionChangePreview, type SubscriptionChangePreviewInput, type SubscriptionChangeResult, type SubscriptionCreate, type SubscriptionRenewal, type SubscriptionStatus, type SubscriptionTerms, type SubscriptionUpdate, type SuspensionDays, type TAX_BEHAVIORS, type TaxBehavior, type Timestamp, type TokenKind, type USAGE_FEATURE_TYPES, type VENEZUELAN_BANKS, type VariantInput, type WEBHOOK_TEST_EVENT, type WebhookEndpoint, type WebhookEndpointCreate, type WebhookEndpointUpdate, type WebhookEvent, type Weekday, type apiVersionLifecycle, type apiVersionStage, type currentApiVersion, type findBank, type isApiVersion, type isApiVersionRetired, type isLandlinePhone, type isMobilePhone, type nationalPhone, type supportedApiVersions, type tokenEnvironment, type tokenPrefix };
|
package/dist/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as segment, r as BilleteError, t as createTransport } from "./http-
|
|
1
|
+
import { n as segment, r as BilleteError, t as createTransport } from "./http-BMld1QWi.js";
|
|
2
2
|
//#region src/create-client.ts
|
|
3
3
|
/**
|
|
4
4
|
* Browser client. It never holds a secret key: checkouts and Cobros are addressed by their
|
|
@@ -6,7 +6,7 @@ import { n as segment, r as BilleteError, t as createTransport } from "./http-Do
|
|
|
6
6
|
* and customer data requires a short-lived customer session minted by your server.
|
|
7
7
|
*
|
|
8
8
|
* ```ts
|
|
9
|
-
* const billete = createClient({ apiVersion: "2026-10-
|
|
9
|
+
* const billete = createClient({ apiVersion: "2026-10-24", customerSession: token });
|
|
10
10
|
* const [subscription] = (await billete.customer.subscriptions()).data;
|
|
11
11
|
* if (subscription?.renewal?.status === "overdue") showBanner(subscription.renewal);
|
|
12
12
|
* ```
|
|
@@ -169,6 +169,16 @@ function createClient(options) {
|
|
|
169
169
|
path: `${fulfillmentPath(token)}/problem`,
|
|
170
170
|
body: input,
|
|
171
171
|
options
|
|
172
|
+
}),
|
|
173
|
+
/**
|
|
174
|
+
* Where Billete sends the customer's refund by Pago Móvil, while it waits for one
|
|
175
|
+
* (`refund.status: "needs_destination"`).
|
|
176
|
+
*/
|
|
177
|
+
setRefundDestination: (token, input, options) => http.request({
|
|
178
|
+
method: "PUT",
|
|
179
|
+
path: `${fulfillmentPath(token)}/refund-destination`,
|
|
180
|
+
body: input,
|
|
181
|
+
options
|
|
172
182
|
})
|
|
173
183
|
},
|
|
174
184
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as CheckoutPurpose, Cn as TaxBehavior, Ct as PlanSeats, D as ClaimReason, E as ClaimOutcome, Et as ProductCategory, It as SubmitLabel, J as FeatureReset, Lt as Subscription, M as CustomField, O as ClaimStatus, P as CustomerDetails, Qt as ApiErrorType, S as CheckoutItem, St as PlanPrice, T as ClaimMessage, Xt as ApiErrorBody, Z as Fulfillment, an as AddressInput, b as CarrierOffice, c as AfterCompletion, cn as BillingMonths, ct as LineItem, en as PaymentFailureCode, et as FulfillmentMethod, fn as GracePeriodDays, i as SubscribableEventType, in as Address, jn as Environment, jt as Refund, k as CollectSettings, mt as PaymentFailure, nn as ApiErrorCode, nt as FulfillmentTracking, ot as InvoiceReason, qt as ReceiptReference, st as InvoiceStatus, tt as FulfillmentStatus, un as Currency, v as CancellationFeedback, vn as Metadata, vt as PaymentStatus, wn as Timestamp, xn as SuspensionDays, y as Carrier } from "./events-Dry7XWQH.js";
|
|
2
2
|
//#region ../contracts/src/api-versions.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Billete API versions. Kept free of runtime dependencies: the dashboard, the API, the worker and
|
|
@@ -10,7 +10,7 @@ import { $t as PaymentFailureCode, At as Refund, C as CheckoutPurpose, Ct as Pla
|
|
|
10
10
|
* that is still supported.
|
|
11
11
|
*/
|
|
12
12
|
/** Every version ever published, oldest first. Append only: retired versions stay listed. */
|
|
13
|
-
declare const API_VERSIONS: readonly ["2026-10-07.beta", "2026-10-08", "2026-10-09", "2026-10-10", "2026-10-16", "2026-10-19", "2026-10-20"];
|
|
13
|
+
declare const API_VERSIONS: readonly ["2026-10-07.beta", "2026-10-08", "2026-10-09", "2026-10-10", "2026-10-16", "2026-10-19", "2026-10-20", "2026-10-21", "2026-10-24.beta", "2026-10-24"];
|
|
14
14
|
type ApiVersion = (typeof API_VERSIONS)[number];
|
|
15
15
|
type LatestApiVersion = typeof API_VERSIONS extends readonly [...unknown[], infer Last] ? Last : never;
|
|
16
16
|
/** The version the code speaks: responses are built in its shape. Always the last entry. */
|
|
@@ -299,6 +299,24 @@ interface PublicFulfillment {
|
|
|
299
299
|
cancellationReason: Fulfillment["cancellationReason"];
|
|
300
300
|
/** The latest claim about it, followed on its page (`url`); `null` without one. */
|
|
301
301
|
claim: PublicClaimSummary | null;
|
|
302
|
+
/** Billete returning the purchase's money (`mode: "billete"`); `null` without one. */
|
|
303
|
+
refund: PublicFulfillmentRefund | null;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Billete returning a purchase's money by Pago Móvil. `needs_destination`: it waits for the
|
|
307
|
+
* customer to say where (`setRefundDestination`), also after a transfer to the previous one failed
|
|
308
|
+
* (`problem`). `processing`: Billete is sending it. `paid`: sent, with the bank's reference.
|
|
309
|
+
*/
|
|
310
|
+
interface PublicFulfillmentRefund {
|
|
311
|
+
amount: number;
|
|
312
|
+
currency: Currency;
|
|
313
|
+
status: "needs_destination" | "processing" | "paid";
|
|
314
|
+
/** The destination given, masked: `Banesco · 0414 •••• 567`. */
|
|
315
|
+
destination: string | null;
|
|
316
|
+
/** Why the transfer to the previous destination did not go through. */
|
|
317
|
+
problem: string | null;
|
|
318
|
+
reference: string | null;
|
|
319
|
+
paidAt: Timestamp | null;
|
|
302
320
|
}
|
|
303
321
|
/**
|
|
304
322
|
* The step a provider asks of the payer after starting a charge: leave for its page and come back
|
|
@@ -518,6 +536,7 @@ interface PublicClaim extends PublicClaimSummary {
|
|
|
518
536
|
} | null;
|
|
519
537
|
resolution: {
|
|
520
538
|
outcome: ClaimOutcome;
|
|
539
|
+
by: "business" | "billete";
|
|
521
540
|
note: string;
|
|
522
541
|
refund: Pick<Refund, "amount" | "currency" | "status"> | null;
|
|
523
542
|
resolvedAt: Timestamp;
|
|
@@ -674,6 +693,11 @@ interface PlanCreate {
|
|
|
674
693
|
prices: PlanPriceInput[];
|
|
675
694
|
trialDays?: number;
|
|
676
695
|
gracePeriodDays?: GracePeriodDays;
|
|
696
|
+
/**
|
|
697
|
+
* Days the subscription stays suspended after the grace period, payable to reactivate it, before
|
|
698
|
+
* it expires. Not with `fallbackPlanId`: a plan either falls back or suspends.
|
|
699
|
+
*/
|
|
700
|
+
suspensionDays?: SuspensionDays;
|
|
677
701
|
taxBehavior?: TaxBehavior;
|
|
678
702
|
highlights?: string[];
|
|
679
703
|
features?: PlanFeaturesInput;
|
|
@@ -690,6 +714,11 @@ interface PlanUpdate {
|
|
|
690
714
|
prices?: PlanPriceInput[];
|
|
691
715
|
trialDays?: number;
|
|
692
716
|
gracePeriodDays?: GracePeriodDays;
|
|
717
|
+
/**
|
|
718
|
+
* Days the subscription stays suspended after the grace period, payable to reactivate it, before
|
|
719
|
+
* it expires. Not with `fallbackPlanId`: a plan either falls back or suspends.
|
|
720
|
+
*/
|
|
721
|
+
suspensionDays?: SuspensionDays;
|
|
693
722
|
taxBehavior?: TaxBehavior;
|
|
694
723
|
highlights?: string[];
|
|
695
724
|
/** Replaces the plan feature grants. Takes effect immediately for every subscriber. */
|
|
@@ -1046,6 +1075,15 @@ interface FulfillmentDeliverInput {
|
|
|
1046
1075
|
interface ClientFulfillmentProblem {
|
|
1047
1076
|
comment: string;
|
|
1048
1077
|
}
|
|
1078
|
+
/** Where Billete sends the customer's refund by Pago Móvil. */
|
|
1079
|
+
interface ClientRefundDestination {
|
|
1080
|
+
/** The bank's code, `0102`. */
|
|
1081
|
+
bank: string;
|
|
1082
|
+
/** A Venezuelan mobile phone, `0414 1234567`. */
|
|
1083
|
+
phone: string;
|
|
1084
|
+
/** The cédula or RIF of whoever holds it, `V-12345678`. */
|
|
1085
|
+
holderId: string;
|
|
1086
|
+
}
|
|
1049
1087
|
/** Opens a claim about a payment, from the customer's page of it. */
|
|
1050
1088
|
interface ClientClaimCreate {
|
|
1051
1089
|
reason: ClaimReason;
|
|
@@ -1124,4 +1162,4 @@ declare class BilleteError extends Error {
|
|
|
1124
1162
|
}, status: number, options?: ErrorOptions);
|
|
1125
1163
|
}
|
|
1126
1164
|
//#endregion
|
|
1127
|
-
export {
|
|
1165
|
+
export { PortalSessionCreate as $, CustomerSessionCreate as A, PublicPaymentLink as At, FulfillmentTrackingInput as B, LatestApiVersion as Bt, CouponCreate as C, PublicCheckout as Ct, CustomerInput as D, PublicFulfillment as Dt, CustomerCreate as E, PublicClaimSummary as Et, FeatureOperationCreate as F, API_VERSION_PATTERN as Ft, PaymentLinkUpdate as G, isApiVersionRetired as Gt, InvoiceLineInput as H, apiVersionStage as Ht, FeatureUpdate as I, ApiVersion as It, PlanCreate as J, PlanCheckoutCreate as K, supportedApiVersions as Kt, FulfillmentDeliverInput as L, ApiVersionLifecycle as Lt, EventSelector as M, PublicPortal as Mt, FeatureCreate as N, API_VERSIONS as Nt, CustomerMemberCreate as O, PublicFulfillmentRefund as Ot, FeatureOperationCommit as P, API_VERSION_HEADER as Pt, PlanUpdate as Q, FulfillmentHandoverInput as R, ApiVersionStage as Rt, CollectInput as S, PortalFeatures as St, CustomFieldInput as T, PublicClaim as Tt, KEY_PATTERN as U, currentApiVersion as Ut, InvoiceCreate as V, apiVersionLifecycle as Vt, PaymentLinkCreate as W, isApiVersion as Wt, PlanLinkCreate as X, PlanFeaturesInput as Y, PlanPriceInput as Z, ClientPaymentCode as _, PaymentInstructions as _t, AfterCompletionInput as a, RefundCreate as at, ClientSubscriptionSeats as b, PaymentNextAction as bt, ClaimResolve as c, SubscriptionChangePreviewInput as ct, ClientCheckoutUpdate as d, VariantInput as dt, ProductCheckoutCreate as et, ClientClaimCreate as f, WebhookEndpointCreate as ft, ClientLinkCheckout as g, FulfillmentOption as gt, ClientInvoicePay as h, CustomerSubscriptionChangeResult as ht, TransportOptions as i, ProductUpdate as it, CustomerUpdate as j, PublicPaymentState as jt, CustomerMemberUpdate as k, PublicInvoice as kt, ClaimRespond as l, SubscriptionCreate as lt, ClientFulfillmentProblem as m, CustomerSubscription as mt, BilleteErrorCode as n, ProductCreate as nt, CheckoutCreate as o, SubscriptionCancel as ot, ClientCustomerClaimCreate as p, WebhookEndpointUpdate as pt, PlanCouponCreate as q, RequestOptions as r, ProductLinkCreate as rt, CheckoutItemInput as s, SubscriptionChangeCreate as st, BilleteError as t, ProductCouponCreate as tt, ClientCheckoutPay as u, SubscriptionUpdate as ut, ClientRefundDestination as v, PaymentMethodField as vt, CouponUpdate as w, PublicCheckoutItem as wt, ClientSubscriptionUpdate as x, PaymentTestScenario as xt, ClientSubscriptionCancel as y, PaymentMethodOption as yt, FulfillmentInput as z, LATEST_API_VERSION as zt };
|
|
@@ -33,6 +33,12 @@ declare const MAX_QUANTITY = 999;
|
|
|
33
33
|
*/
|
|
34
34
|
declare const GRACE_PERIOD_DAYS: readonly [0, 1, 3, 7];
|
|
35
35
|
type GracePeriodDays = (typeof GRACE_PERIOD_DAYS)[number];
|
|
36
|
+
/**
|
|
37
|
+
* Days a subscription stays suspended once its grace period ends unpaid: without access, its
|
|
38
|
+
* renewal still payable to reactivate it. `0`, the default, is none: it expires instead.
|
|
39
|
+
*/
|
|
40
|
+
declare const SUSPENSION_DAYS: readonly [0, 7, 14, 30, 60, 90];
|
|
41
|
+
type SuspensionDays = (typeof SUSPENSION_DAYS)[number];
|
|
36
42
|
/** `inclusive`: the price already contains the account tax. `exclusive`: tax is added on top. */
|
|
37
43
|
declare const TAX_BEHAVIORS: readonly ["inclusive", "exclusive"];
|
|
38
44
|
type TaxBehavior = (typeof TAX_BEHAVIORS)[number];
|
|
@@ -424,6 +430,7 @@ declare const API_ERROR_CODES: {
|
|
|
424
430
|
readonly receipt_resend_limit: "Puedes enviar el recibo hasta cinco veces por hora. Inténtalo más tarde.";
|
|
425
431
|
readonly refund_amount_mismatch: "Registra el importe completo de la devolución pendiente.";
|
|
426
432
|
readonly refund_approval_pending: "Este pago ya tiene un reembolso esperando aprobación.";
|
|
433
|
+
readonly refund_destination_not_needed: "Esta compra no tiene una devolución esperando tus datos.";
|
|
427
434
|
readonly refund_exceeds_payment: "El reembolso supera lo que queda por reembolsar del pago.";
|
|
428
435
|
readonly refund_threshold_change_pending: "Ya hay un cambio de la aprobación de reembolsos pendiente: cancélalo antes de pedir otro.";
|
|
429
436
|
readonly renewal_invoice: "El cobro es la renovación de una suscripción y no se puede cerrar a mano.";
|
|
@@ -442,6 +449,8 @@ declare const API_ERROR_CODES: {
|
|
|
442
449
|
readonly subscription_not_canceling: "Esta suscripción no tiene una cancelación programada.";
|
|
443
450
|
readonly subscription_not_found: "No existe la suscripción.";
|
|
444
451
|
readonly subscription_renewal_open: "Paga la renovación o programa el cambio para el próximo periodo.";
|
|
452
|
+
readonly subscription_suspended: "La suscripción está suspendida: paga su renovación para reactivarla o cancélala.";
|
|
453
|
+
readonly suspension_with_fallback: "Un plan con suspensión no tiene plan de respaldo: elige uno de los dos.";
|
|
445
454
|
readonly tax_behavior_mismatch: "Todos los productos deben tratar los impuestos igual.";
|
|
446
455
|
readonly tax_id_prefix: "El RIF no corresponde al tipo de organización.";
|
|
447
456
|
readonly too_many_attempts: "Demasiados intentos de pago para este checkout.";
|
|
@@ -629,6 +638,11 @@ interface Plan extends Resource<"plan">, Deletion {
|
|
|
629
638
|
prices: PlanPrice[];
|
|
630
639
|
trialDays: number;
|
|
631
640
|
gracePeriodDays: GracePeriodDays;
|
|
641
|
+
/**
|
|
642
|
+
* Days an unpaid subscription stays `suspended` once the grace period ends: without access, its
|
|
643
|
+
* renewal payable to reactivate it. `0`: it expires (or falls back to `fallbackPlanId`) instead.
|
|
644
|
+
*/
|
|
645
|
+
suspensionDays: SuspensionDays;
|
|
632
646
|
taxBehavior: TaxBehavior;
|
|
633
647
|
/** Marketing bullet points shown on checkout pages. */
|
|
634
648
|
highlights: string[];
|
|
@@ -732,15 +746,25 @@ interface FeatureOperationResult extends FeatureUsageResult {
|
|
|
732
746
|
created: boolean;
|
|
733
747
|
operation: FeatureOperation | null;
|
|
734
748
|
}
|
|
735
|
-
declare const SUBSCRIPTION_STATUSES: readonly ["trialing", "active", "past_due",
|
|
749
|
+
declare const SUBSCRIPTION_STATUSES: readonly ["trialing", "active", "past_due",
|
|
750
|
+
/** Unpaid after the grace period: no access, its renewal still payable to reactivate it. */
|
|
751
|
+
"suspended", "canceled", "expired"];
|
|
736
752
|
type SubscriptionStatus = (typeof SUBSCRIPTION_STATUSES)[number];
|
|
737
753
|
interface SubscriptionRenewal {
|
|
738
|
-
/**
|
|
739
|
-
|
|
754
|
+
/**
|
|
755
|
+
* `upcoming`: not payable yet. `due`: payable before `dueAt`. `overdue`: in the grace period.
|
|
756
|
+
* `suspended`: access is lost; paying before `suspensionEndsAt` reactivates it.
|
|
757
|
+
*/
|
|
758
|
+
status: "upcoming" | "due" | "overdue" | "suspended";
|
|
740
759
|
opensAt: Timestamp;
|
|
741
760
|
dueAt: Timestamp;
|
|
742
761
|
graceEndsAt: Timestamp;
|
|
743
|
-
/**
|
|
762
|
+
/** When a suspended subscription expires; `null` when its plan does not suspend. */
|
|
763
|
+
suspensionEndsAt: Timestamp | null;
|
|
764
|
+
/**
|
|
765
|
+
* Whole days left until access is lost (`dueAt` or, when overdue, `graceEndsAt`) or, when
|
|
766
|
+
* suspended, until it expires (`suspensionEndsAt`).
|
|
767
|
+
*/
|
|
744
768
|
daysRemaining: number;
|
|
745
769
|
amount: number;
|
|
746
770
|
currency: Currency;
|
|
@@ -1109,9 +1133,10 @@ interface Fulfillment extends Resource<"fulfillment"> {
|
|
|
1109
1133
|
receivedAt: Timestamp | null;
|
|
1110
1134
|
/**
|
|
1111
1135
|
* `customer`: they confirmed it. `timeout`: they said nothing before `confirmBy`. `carrier`: the
|
|
1112
|
-
* carrier delivered it.
|
|
1136
|
+
* carrier delivered it. `billete`: Billete reviewed the problem reported and decided it in the
|
|
1137
|
+
* business's favor.
|
|
1113
1138
|
*/
|
|
1114
|
-
receivedBy: "customer" | "timeout" | "carrier" | null;
|
|
1139
|
+
receivedBy: "customer" | "timeout" | "carrier" | "billete" | null;
|
|
1115
1140
|
problem: {
|
|
1116
1141
|
comment: string;
|
|
1117
1142
|
reportedAt: Timestamp;
|
|
@@ -1119,7 +1144,7 @@ interface Fulfillment extends Resource<"fulfillment"> {
|
|
|
1119
1144
|
canceledAt: Timestamp | null;
|
|
1120
1145
|
/**
|
|
1121
1146
|
* `refunded`: its payment was fully refunded. `not_shipped`: it had no valid tracking number by
|
|
1122
|
-
* `trackingDueAt`;
|
|
1147
|
+
* `trackingDueAt`; Billete refunds its customer (`mode: "billete"`).
|
|
1123
1148
|
*/
|
|
1124
1149
|
cancellationReason: "refunded" | "not_shipped" | null;
|
|
1125
1150
|
updatedAt: Timestamp;
|
|
@@ -1245,13 +1270,19 @@ interface Payment extends Resource<"payment"> {
|
|
|
1245
1270
|
succeededAt: Timestamp | null;
|
|
1246
1271
|
updatedAt: Timestamp;
|
|
1247
1272
|
}
|
|
1273
|
+
declare const REFUND_MODES: readonly ["provider", "manual", "billete"];
|
|
1248
1274
|
interface Refund extends Resource<"refund"> {
|
|
1249
1275
|
paymentId: string;
|
|
1250
1276
|
amount: number;
|
|
1251
1277
|
currency: Currency;
|
|
1252
1278
|
reason: string | null;
|
|
1253
|
-
/**
|
|
1254
|
-
|
|
1279
|
+
/**
|
|
1280
|
+
* `provider`: the method's provider returns the funds. `manual`: the method cannot refund
|
|
1281
|
+
* automatically; the merchant returned the funds. `billete`: Billete returns them by Pago Móvil
|
|
1282
|
+
* to where the customer says, on the delivery's page (a shipment not sent in time, or a problem
|
|
1283
|
+
* Billete decided in the customer's favor); `pending` until it does.
|
|
1284
|
+
*/
|
|
1285
|
+
mode: (typeof REFUND_MODES)[number];
|
|
1255
1286
|
status: "pending" | "succeeded" | "failed";
|
|
1256
1287
|
}
|
|
1257
1288
|
/**
|
|
@@ -1272,10 +1303,13 @@ type ClaimStatus = (typeof CLAIM_STATUSES)[number];
|
|
|
1272
1303
|
/** In whose favor a claim was resolved. */
|
|
1273
1304
|
declare const CLAIM_OUTCOMES: readonly ["customer", "business"];
|
|
1274
1305
|
type ClaimOutcome = (typeof CLAIM_OUTCOMES)[number];
|
|
1275
|
-
/**
|
|
1306
|
+
/**
|
|
1307
|
+
* One message of a claim's conversation between the customer and the business. `billete`: Billete's
|
|
1308
|
+
* team, reviewing a problem with a delivery whose funds it holds.
|
|
1309
|
+
*/
|
|
1276
1310
|
interface ClaimMessage {
|
|
1277
1311
|
id: string;
|
|
1278
|
-
author: "customer" | "business";
|
|
1312
|
+
author: "customer" | "business" | "billete";
|
|
1279
1313
|
body: string;
|
|
1280
1314
|
createdAt: Timestamp;
|
|
1281
1315
|
}
|
|
@@ -1297,7 +1331,9 @@ interface Claim extends Resource<"claim"> {
|
|
|
1297
1331
|
messages: ClaimMessage[];
|
|
1298
1332
|
resolution: {
|
|
1299
1333
|
outcome: ClaimOutcome;
|
|
1300
|
-
/**
|
|
1334
|
+
/** Who decided it: the business, or Billete reviewing a problem with a delivery. */
|
|
1335
|
+
by: "business" | "billete";
|
|
1336
|
+
/** What the customer was told. */
|
|
1301
1337
|
note: string;
|
|
1302
1338
|
/** The refund issued when resolving it in the customer's favor. */
|
|
1303
1339
|
refundId: string | null;
|
|
@@ -1420,6 +1456,10 @@ interface EventDataMap {
|
|
|
1420
1456
|
"refund.created": Refund;
|
|
1421
1457
|
/** The provider could not return the funds; the amount is back in the balance. */
|
|
1422
1458
|
"refund.failed": Refund;
|
|
1459
|
+
"payout.created": Payout;
|
|
1460
|
+
"payout.paid": Payout;
|
|
1461
|
+
"payout.failed": Payout;
|
|
1462
|
+
"payout.canceled": Payout;
|
|
1423
1463
|
"invoice.created": Invoice;
|
|
1424
1464
|
"invoice.paid": Invoice;
|
|
1425
1465
|
"invoice.voided": Invoice;
|
|
@@ -1432,6 +1472,10 @@ interface EventDataMap {
|
|
|
1432
1472
|
"subscription.renewed": Subscription;
|
|
1433
1473
|
/** The period ended unpaid; the customer keeps access until the grace period ends. */
|
|
1434
1474
|
"subscription.past_due": Subscription;
|
|
1475
|
+
/** Grace period over without payment: access is revoked until the renewal is paid. */
|
|
1476
|
+
"subscription.suspended": Subscription;
|
|
1477
|
+
/** A suspended subscription's renewal was paid: access is back, with a new period. */
|
|
1478
|
+
"subscription.reactivated": Subscription;
|
|
1435
1479
|
"subscription.canceled": Subscription;
|
|
1436
1480
|
/** Grace period over without payment; access is revoked. */
|
|
1437
1481
|
"subscription.expired": Subscription;
|
|
@@ -1446,7 +1490,7 @@ type EventType = keyof EventDataMap;
|
|
|
1446
1490
|
declare const WEBHOOK_TEST_EVENT: "webhook_endpoint.test";
|
|
1447
1491
|
/** What a webhook endpoint can subscribe to: everything that happens in a business. */
|
|
1448
1492
|
type SubscribableEventType = Exclude<EventType, typeof WEBHOOK_TEST_EVENT>;
|
|
1449
|
-
declare const EVENT_TYPES: readonly ["product.updated", "product.deleted", "payment_link.deleted", "customer.created", "customer.updated", "customer.member_added", "customer.member_removed", "subscription.change_failed", "checkout.completed", "checkout.expired", "payment.succeeded", "payment.failed", "payment.refunded", "fulfillment.created", "fulfillment.shipped", "fulfillment.ready_for_pickup", "fulfillment.delivered", "fulfillment.received", "fulfillment.problem_reported", "fulfillment.canceled", "claim.created", "claim.updated", "claim.resolved", "claim.withdrawn", "refund.created", "refund.failed", "invoice.created", "invoice.paid", "invoice.voided", "invoice.uncollectible", "subscription.created", "subscription.updated", "subscription.renewal_due", "subscription.renewed", "subscription.past_due", "subscription.canceled", "subscription.expired"];
|
|
1493
|
+
declare const EVENT_TYPES: readonly ["product.updated", "product.deleted", "payment_link.deleted", "customer.created", "customer.updated", "customer.member_added", "customer.member_removed", "subscription.change_failed", "checkout.completed", "checkout.expired", "payment.succeeded", "payment.failed", "payment.refunded", "fulfillment.created", "fulfillment.shipped", "fulfillment.ready_for_pickup", "fulfillment.delivered", "fulfillment.received", "fulfillment.problem_reported", "fulfillment.canceled", "claim.created", "claim.updated", "claim.resolved", "claim.withdrawn", "refund.created", "refund.failed", "payout.created", "payout.paid", "payout.failed", "payout.canceled", "invoice.created", "invoice.paid", "invoice.voided", "invoice.uncollectible", "subscription.created", "subscription.updated", "subscription.renewal_due", "subscription.renewed", "subscription.past_due", "subscription.suspended", "subscription.reactivated", "subscription.canceled", "subscription.expired"];
|
|
1450
1494
|
/** A delivered webhook, discriminated by `type` so `data` narrows automatically. */
|
|
1451
1495
|
type WebhookEvent = { [TType in EventType]: {
|
|
1452
1496
|
id: string;
|
|
@@ -1459,4 +1503,4 @@ type WebhookEvent = { [TType in EventType]: {
|
|
|
1459
1503
|
data: EventDataMap[TType];
|
|
1460
1504
|
}; }[EventType];
|
|
1461
1505
|
//#endregion
|
|
1462
|
-
export { FulfillmentHandover as $,
|
|
1506
|
+
export { FulfillmentHandover as $, PAYMENT_FAILURE_CODES as $t, Coupon as A, ENVIRONMENTS as An, RISK_LEVELS as At, Event as B, SubscriptionChangeResult as Bt, CheckoutPurpose as C, TaxBehavior as Cn, PlanSeats as Ct, ClaimReason as D, isLandlinePhone as Dn, ProductVariant as Dt, ClaimOutcome as E, findBank as En, ProductCategory as Et, CustomerFeature as F, SUBSCRIPTION_STATUSES as Ft, Feature as G, WebhookEndpoint as Gt, FEATURE_TYPES as H, SubscriptionStatus as Ht, CustomerMember as I, SubmitLabel as It, FeatureReset as J, ReceiptSend as Jt, FeatureOperation as K, Weekday as Kt, CustomerMemberList as L, Subscription as Lt, CustomField as M, TokenKind as Mn, ResetFrequency as Mt, Customer as N, tokenEnvironment as Nn, RiskLevel as Nt, ClaimStatus as O, isMobilePhone as On, REFUND_MODES as Ot, CustomerDetails as P, tokenPrefix as Pn, SUBMIT_LABELS as Pt, FulfillmentChoice as Q, ApiErrorType as Qt, CustomerSession as R, SubscriptionChange as Rt, CheckoutItem as S, TAX_BEHAVIORS as Sn, PlanPrice as St, ClaimMessage as T, VENEZUELAN_BANKS as Tn, Product as Tt, FULFILLMENT_METHODS as U, SubscriptionTerms as Ut, ExchangeRate as V, SubscriptionRenewal as Vt, FULFILLMENT_STATUSES as W, USAGE_FEATURE_TYPES as Wt, FeatureUsageResult as X, ApiErrorBody as Xt, FeatureType as Y, API_ERROR_TYPES as Yt, Fulfillment as Z, ApiErrorEnvelope as Zt, CLAIM_STATUSES as _, MOBILE_PREFIXES as _n, PaymentSettlement as _t, WEBHOOK_TEST_EVENT as a, AddressInput as an, Invoice as at, CarrierOffice as b, SUSPENSION_DAYS as bn, Plan as bt, AfterCompletion as c, BillingMonths as cn, LineItem as ct, CANCELLATION_FEEDBACK as d, GRACE_PERIOD_DAYS as dn, PRODUCT_CATEGORIES as dt, PaymentFailureCode as en, FulfillmentMethod as et, CARRIERS as f, GracePeriodDays as fn, Payment as ft, CLAIM_REASONS as g, MAX_QUANTITY as gn, PaymentLink as gt, CLAIM_OUTCOMES as h, ListSort as hn, PaymentFeeDetails as ht, SubscribableEventType as i, Address as in, INVOICE_STATUSES as it, CurrencyAvailability as j, Environment as jn, Refund as jt, CollectSettings as k, nationalPhone as kn, RESET_FREQUENCIES as kt, Balance as l, CURRENCIES as ln, MAX_SEATS as lt, CHECKOUT_PURPOSES as m, ListQuery as mn, PaymentFailure as mt, EventDataMap as n, ApiErrorCode as nn, FulfillmentTracking as nt, WebhookEvent as o, BILLING_MONTHS as on, InvoiceReason as ot, CARRIER_TEST_SCENARIOS as p, List as pn, PaymentAttempt as pt, FeatureOperationResult as q, ReceiptReference as qt, EventType as r, ACCOUNT_NUMBER_LENGTH as rn, INVOICE_REASONS as rt, Actor as s, BankCode as sn, InvoiceStatus as st, EVENT_TYPES as t, API_ERROR_CODES as tn, FulfillmentStatus as tt, BalanceAmount as u, Currency as un, PAYMENT_STATUSES as ut, CancellationFeedback as v, Metadata as vn, PaymentStatus as vt, Claim as w, Timestamp as wn, PortalSession as wt, Checkout as x, SuspensionDays as xn, PlanFeatureValues as xt, Carrier as y, MobilePrefix as yn, Payout as yt, Deletion as z, SubscriptionChangePreview as zt };
|
|
@@ -18,7 +18,7 @@ var BilleteError = class extends Error {
|
|
|
18
18
|
};
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/http.ts
|
|
21
|
-
const SDK_VERSION = "
|
|
21
|
+
const SDK_VERSION = "9.0.0";
|
|
22
22
|
const DEFAULT_BASE_URL = "https://api.billete.run";
|
|
23
23
|
const RETRYABLE_STATUS = /* @__PURE__ */ new Set([
|
|
24
24
|
429,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { $ as FulfillmentHandover, $t as
|
|
1
|
+
import { $ as PortalSessionCreate, A as CustomerSessionCreate, At as PublicPaymentLink, B as FulfillmentTrackingInput, Bt as LatestApiVersion, C as CouponCreate, Ct as PublicCheckout, D as CustomerInput, Dt as PublicFulfillment, E as CustomerCreate, Et as PublicClaimSummary, F as FeatureOperationCreate, Ft as API_VERSION_PATTERN, G as PaymentLinkUpdate, Gt as isApiVersionRetired, H as InvoiceLineInput, Ht as apiVersionStage, I as FeatureUpdate, It as ApiVersion, J as PlanCreate, K as PlanCheckoutCreate, Kt as supportedApiVersions, L as FulfillmentDeliverInput, Lt as ApiVersionLifecycle, M as EventSelector, Mt as PublicPortal, N as FeatureCreate, Nt as API_VERSIONS, O as CustomerMemberCreate, Ot as PublicFulfillmentRefund, P as FeatureOperationCommit, Pt as API_VERSION_HEADER, Q as PlanUpdate, R as FulfillmentHandoverInput, Rt as ApiVersionStage, S as CollectInput, St as PortalFeatures, T as CustomFieldInput, Tt as PublicClaim, U as KEY_PATTERN, Ut as currentApiVersion, V as InvoiceCreate, Vt as apiVersionLifecycle, W as PaymentLinkCreate, Wt as isApiVersion, X as PlanLinkCreate, Y as PlanFeaturesInput, Z as PlanPriceInput, _ as ClientPaymentCode, _t as PaymentInstructions, a as AfterCompletionInput, at as RefundCreate, b as ClientSubscriptionSeats, bt as PaymentNextAction, c as ClaimResolve, ct as SubscriptionChangePreviewInput, d as ClientCheckoutUpdate, dt as VariantInput, et as ProductCheckoutCreate, f as ClientClaimCreate, ft as WebhookEndpointCreate, g as ClientLinkCheckout, gt as FulfillmentOption, h as ClientInvoicePay, ht as CustomerSubscriptionChangeResult, i as TransportOptions, it as ProductUpdate, j as CustomerUpdate, jt as PublicPaymentState, k as CustomerMemberUpdate, kt as PublicInvoice, l as ClaimRespond, lt as SubscriptionCreate, m as ClientFulfillmentProblem, mt as CustomerSubscription, n as BilleteErrorCode, nt as ProductCreate, o as CheckoutCreate, ot as SubscriptionCancel, p as ClientCustomerClaimCreate, pt as WebhookEndpointUpdate, q as PlanCouponCreate, r as RequestOptions, rt as ProductLinkCreate, s as CheckoutItemInput, st as SubscriptionChangeCreate, t as BilleteError, tt as ProductCouponCreate, u as ClientCheckoutPay, ut as SubscriptionUpdate, v as ClientRefundDestination, vt as PaymentMethodField, w as CouponUpdate, wt as PublicCheckoutItem, x as ClientSubscriptionUpdate, xt as PaymentTestScenario, y as ClientSubscriptionCancel, yt as PaymentMethodOption, z as FulfillmentInput, zt as LATEST_API_VERSION } from "./errors-CTtPcwiO.js";
|
|
2
|
+
import { $ as FulfillmentHandover, $t as PAYMENT_FAILURE_CODES, A as Coupon, An as ENVIRONMENTS, At as RISK_LEVELS, B as Event, Bt as SubscriptionChangeResult, C as CheckoutPurpose, Cn as TaxBehavior, Ct as PlanSeats, D as ClaimReason, Dn as isLandlinePhone, Dt as ProductVariant, E as ClaimOutcome, En as findBank, Et as ProductCategory, F as CustomerFeature, Ft as SUBSCRIPTION_STATUSES, G as Feature, Gt as WebhookEndpoint, H as FEATURE_TYPES, Ht as SubscriptionStatus, I as CustomerMember, It as SubmitLabel, J as FeatureReset, Jt as ReceiptSend, K as FeatureOperation, Kt as Weekday, L as CustomerMemberList, Lt as Subscription, M as CustomField, Mn as TokenKind, Mt as ResetFrequency, N as Customer, Nn as tokenEnvironment, Nt as RiskLevel, O as ClaimStatus, On as isMobilePhone, Ot as REFUND_MODES, P as CustomerDetails, Pn as tokenPrefix, Pt as SUBMIT_LABELS, Q as FulfillmentChoice, Qt as ApiErrorType, R as CustomerSession, Rt as SubscriptionChange, S as CheckoutItem, Sn as TAX_BEHAVIORS, St as PlanPrice, T as ClaimMessage, Tn as VENEZUELAN_BANKS, Tt as Product, U as FULFILLMENT_METHODS, Ut as SubscriptionTerms, V as ExchangeRate, Vt as SubscriptionRenewal, W as FULFILLMENT_STATUSES, Wt as USAGE_FEATURE_TYPES, X as FeatureUsageResult, Xt as ApiErrorBody, Y as FeatureType, Yt as API_ERROR_TYPES, Z as Fulfillment, Zt as ApiErrorEnvelope, _ as CLAIM_STATUSES, _n as MOBILE_PREFIXES, _t as PaymentSettlement, a as WEBHOOK_TEST_EVENT, an as AddressInput, at as Invoice, b as CarrierOffice, bn as SUSPENSION_DAYS, bt as Plan, c as AfterCompletion, cn as BillingMonths, ct as LineItem, d as CANCELLATION_FEEDBACK, dn as GRACE_PERIOD_DAYS, dt as PRODUCT_CATEGORIES, en as PaymentFailureCode, et as FulfillmentMethod, f as CARRIERS, fn as GracePeriodDays, ft as Payment, g as CLAIM_REASONS, gn as MAX_QUANTITY, gt as PaymentLink, h as CLAIM_OUTCOMES, hn as ListSort, ht as PaymentFeeDetails, i as SubscribableEventType, in as Address, it as INVOICE_STATUSES, j as CurrencyAvailability, jn as Environment, jt as Refund, k as CollectSettings, kn as nationalPhone, kt as RESET_FREQUENCIES, l as Balance, ln as CURRENCIES, lt as MAX_SEATS, m as CHECKOUT_PURPOSES, mn as ListQuery, mt as PaymentFailure, n as EventDataMap, nn as ApiErrorCode, nt as FulfillmentTracking, o as WebhookEvent, on as BILLING_MONTHS, ot as InvoiceReason, p as CARRIER_TEST_SCENARIOS, pn as List, pt as PaymentAttempt, q as FeatureOperationResult, qt as ReceiptReference, r as EventType, rn as ACCOUNT_NUMBER_LENGTH, rt as INVOICE_REASONS, s as Actor, sn as BankCode, st as InvoiceStatus, t as EVENT_TYPES, tn as API_ERROR_CODES, tt as FulfillmentStatus, u as BalanceAmount, un as Currency, ut as PAYMENT_STATUSES, v as CancellationFeedback, vn as Metadata, vt as PaymentStatus, w as Claim, wn as Timestamp, wt as PortalSession, x as Checkout, xn as SuspensionDays, xt as PlanFeatureValues, y as Carrier, yn as MobilePrefix, yt as Payout, z as Deletion, zt as SubscriptionChangePreview } from "./events-Dry7XWQH.js";
|
|
3
3
|
import { WebhookVerificationError, verifyWebhook } from "./webhooks.js";
|
|
4
4
|
//#region src/server.d.ts
|
|
5
5
|
type Filters<T> = ListQuery & T;
|
|
@@ -25,7 +25,7 @@ interface BilleteOptions extends TransportOptions {
|
|
|
25
25
|
*
|
|
26
26
|
* ```ts
|
|
27
27
|
* // Reads BILLETE_API_KEY.
|
|
28
|
-
* const billete = createBillete({ apiVersion: "2026-10-
|
|
28
|
+
* const billete = createBillete({ apiVersion: "2026-10-24", environment: "test" });
|
|
29
29
|
* const { allowed } = await billete.features.consume("user_123", "tokens", 850);
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
@@ -389,4 +389,4 @@ export declare function createBillete(options: BilleteOptions): {
|
|
|
389
389
|
/** The server client: what `createBillete` returns. */
|
|
390
390
|
type Billete = ReturnType<typeof createBillete>;
|
|
391
391
|
//#endregion
|
|
392
|
-
export { type ACCOUNT_NUMBER_LENGTH, type API_ERROR_CODES, type API_ERROR_TYPES, type API_VERSIONS, type API_VERSION_HEADER, type API_VERSION_PATTERN, type Actor, type Address, type AddressInput, type AfterCompletion, type AfterCompletionInput, type ApiErrorBody, type ApiErrorCode, type ApiErrorEnvelope, type ApiErrorType, type ApiVersion, type ApiVersionLifecycle, type ApiVersionStage, type BILLING_MONTHS, type Balance, type BalanceAmount, type BankCode, type Billete, BilleteError, type BilleteErrorCode, type BilleteOptions, type BillingMonths, type CANCELLATION_FEEDBACK, type CARRIERS, type CARRIER_TEST_SCENARIOS, type CHECKOUT_PURPOSES, type CLAIM_OUTCOMES, type CLAIM_REASONS, type CLAIM_STATUSES, type CURRENCIES, type CancellationFeedback, type Carrier, type CarrierOffice, type Checkout, type CheckoutCreate, type CheckoutItem, type CheckoutItemInput, type CheckoutPurpose, type Claim, type ClaimMessage, type ClaimOutcome, type ClaimReason, type ClaimResolve, type ClaimRespond, type ClaimStatus, type ClientCheckoutPay, type ClientCheckoutUpdate, type ClientClaimCreate, type ClientCustomerClaimCreate, type ClientFulfillmentProblem, type ClientInvoicePay, type ClientLinkCheckout, type ClientPaymentCode, type ClientSubscriptionCancel, type ClientSubscriptionSeats, type ClientSubscriptionUpdate, type CollectInput, type CollectSettings, type Coupon, type CouponCreate, type CouponUpdate, type Currency, type CurrencyAvailability, type CustomField, type CustomFieldInput, type Customer, type CustomerCreate, type CustomerDetails, type CustomerFeature, type CustomerInput, type CustomerMember, type CustomerMemberCreate, type CustomerMemberList, type CustomerMemberUpdate, type CustomerSession, type CustomerSessionCreate, type CustomerSubscription, type CustomerSubscriptionChangeResult, type CustomerUpdate, type Deletion, type ENVIRONMENTS, type EVENT_TYPES, type Environment, type Event, type EventDataMap, type EventSelector, type EventType, type ExchangeRate, type FEATURE_TYPES, type FULFILLMENT_METHODS, type FULFILLMENT_STATUSES, type Feature, type FeatureCreate, type FeatureOperation, type FeatureOperationCommit, type FeatureOperationCreate, type FeatureOperationResult, type FeatureReset, type FeatureType, type FeatureUpdate, type FeatureUsageResult, type Fulfillment, type FulfillmentChoice, type FulfillmentDeliverInput, type FulfillmentHandover, type FulfillmentHandoverInput, type FulfillmentInput, type FulfillmentMethod, type FulfillmentOption, type FulfillmentStatus, type FulfillmentTracking, type FulfillmentTrackingInput, type GRACE_PERIOD_DAYS, type GracePeriodDays, type INVOICE_REASONS, type INVOICE_STATUSES, type Invoice, type InvoiceCreate, type InvoiceLineInput, type InvoiceReason, type InvoiceStatus, type KEY_PATTERN, type LATEST_API_VERSION, type LatestApiVersion, type LineItem, type List, type ListQuery, type ListSort, type MAX_QUANTITY, type MAX_SEATS, type MOBILE_PREFIXES, type Metadata, type MobilePrefix, type PAYMENT_FAILURE_CODES, type PAYMENT_STATUSES, type PRODUCT_CATEGORIES, type Payment, type PaymentAttempt, type PaymentFailure, type PaymentFailureCode, type PaymentFeeDetails, type PaymentInstructions, type PaymentLink, type PaymentLinkCreate, type PaymentLinkUpdate, type PaymentMethodField, type PaymentMethodOption, type PaymentNextAction, type PaymentSettlement, type PaymentStatus, type PaymentTestScenario, type Payout, type Plan, type PlanCheckoutCreate, type PlanCouponCreate, type PlanCreate, type PlanFeatureValues, type PlanFeaturesInput, type PlanLinkCreate, type PlanPrice, type PlanPriceInput, type PlanSeats, type PlanUpdate, type PortalFeatures, type PortalSession, type PortalSessionCreate, type Product, type ProductCategory, type ProductCheckoutCreate, type ProductCouponCreate, type ProductCreate, type ProductLinkCreate, type ProductUpdate, type ProductVariant, type PublicCheckout, type PublicCheckoutItem, type PublicClaim, type PublicClaimSummary, type PublicFulfillment, type PublicInvoice, type PublicPaymentLink, type PublicPaymentState, type PublicPortal, type RESET_FREQUENCIES, type RISK_LEVELS, type ReceiptReference, type ReceiptSend, type Refund, type RefundCreate, type RequestOptions, type ResetFrequency, type RiskLevel, type SUBMIT_LABELS, type SUBSCRIPTION_STATUSES, type SubmitLabel, type SubscribableEventType, type Subscription, type SubscriptionCancel, type SubscriptionChange, type SubscriptionChangeCreate, type SubscriptionChangePreview, type SubscriptionChangePreviewInput, type SubscriptionChangeResult, type SubscriptionCreate, type SubscriptionRenewal, type SubscriptionStatus, type SubscriptionTerms, type SubscriptionUpdate, type TAX_BEHAVIORS, type TaxBehavior, type Timestamp, type TokenKind, type TransportOptions, type USAGE_FEATURE_TYPES, type VENEZUELAN_BANKS, type VariantInput, type WEBHOOK_TEST_EVENT, type WebhookEndpoint, type WebhookEndpointCreate, type WebhookEndpointUpdate, type WebhookEvent, WebhookVerificationError, type Weekday, type apiVersionLifecycle, type apiVersionStage, type currentApiVersion, type findBank, type isApiVersion, type isApiVersionRetired, type isLandlinePhone, type isMobilePhone, type nationalPhone, type supportedApiVersions, type tokenEnvironment, type tokenPrefix, verifyWebhook };
|
|
392
|
+
export { type ACCOUNT_NUMBER_LENGTH, type API_ERROR_CODES, type API_ERROR_TYPES, type API_VERSIONS, type API_VERSION_HEADER, type API_VERSION_PATTERN, type Actor, type Address, type AddressInput, type AfterCompletion, type AfterCompletionInput, type ApiErrorBody, type ApiErrorCode, type ApiErrorEnvelope, type ApiErrorType, type ApiVersion, type ApiVersionLifecycle, type ApiVersionStage, type BILLING_MONTHS, type Balance, type BalanceAmount, type BankCode, type Billete, BilleteError, type BilleteErrorCode, type BilleteOptions, type BillingMonths, type CANCELLATION_FEEDBACK, type CARRIERS, type CARRIER_TEST_SCENARIOS, type CHECKOUT_PURPOSES, type CLAIM_OUTCOMES, type CLAIM_REASONS, type CLAIM_STATUSES, type CURRENCIES, type CancellationFeedback, type Carrier, type CarrierOffice, type Checkout, type CheckoutCreate, type CheckoutItem, type CheckoutItemInput, type CheckoutPurpose, type Claim, type ClaimMessage, type ClaimOutcome, type ClaimReason, type ClaimResolve, type ClaimRespond, type ClaimStatus, type ClientCheckoutPay, type ClientCheckoutUpdate, type ClientClaimCreate, type ClientCustomerClaimCreate, type ClientFulfillmentProblem, type ClientInvoicePay, type ClientLinkCheckout, type ClientPaymentCode, type ClientRefundDestination, type ClientSubscriptionCancel, type ClientSubscriptionSeats, type ClientSubscriptionUpdate, type CollectInput, type CollectSettings, type Coupon, type CouponCreate, type CouponUpdate, type Currency, type CurrencyAvailability, type CustomField, type CustomFieldInput, type Customer, type CustomerCreate, type CustomerDetails, type CustomerFeature, type CustomerInput, type CustomerMember, type CustomerMemberCreate, type CustomerMemberList, type CustomerMemberUpdate, type CustomerSession, type CustomerSessionCreate, type CustomerSubscription, type CustomerSubscriptionChangeResult, type CustomerUpdate, type Deletion, type ENVIRONMENTS, type EVENT_TYPES, type Environment, type Event, type EventDataMap, type EventSelector, type EventType, type ExchangeRate, type FEATURE_TYPES, type FULFILLMENT_METHODS, type FULFILLMENT_STATUSES, type Feature, type FeatureCreate, type FeatureOperation, type FeatureOperationCommit, type FeatureOperationCreate, type FeatureOperationResult, type FeatureReset, type FeatureType, type FeatureUpdate, type FeatureUsageResult, type Fulfillment, type FulfillmentChoice, type FulfillmentDeliverInput, type FulfillmentHandover, type FulfillmentHandoverInput, type FulfillmentInput, type FulfillmentMethod, type FulfillmentOption, type FulfillmentStatus, type FulfillmentTracking, type FulfillmentTrackingInput, type GRACE_PERIOD_DAYS, type GracePeriodDays, type INVOICE_REASONS, type INVOICE_STATUSES, type Invoice, type InvoiceCreate, type InvoiceLineInput, type InvoiceReason, type InvoiceStatus, type KEY_PATTERN, type LATEST_API_VERSION, type LatestApiVersion, type LineItem, type List, type ListQuery, type ListSort, type MAX_QUANTITY, type MAX_SEATS, type MOBILE_PREFIXES, type Metadata, type MobilePrefix, type PAYMENT_FAILURE_CODES, type PAYMENT_STATUSES, type PRODUCT_CATEGORIES, type Payment, type PaymentAttempt, type PaymentFailure, type PaymentFailureCode, type PaymentFeeDetails, type PaymentInstructions, type PaymentLink, type PaymentLinkCreate, type PaymentLinkUpdate, type PaymentMethodField, type PaymentMethodOption, type PaymentNextAction, type PaymentSettlement, type PaymentStatus, type PaymentTestScenario, type Payout, type Plan, type PlanCheckoutCreate, type PlanCouponCreate, type PlanCreate, type PlanFeatureValues, type PlanFeaturesInput, type PlanLinkCreate, type PlanPrice, type PlanPriceInput, type PlanSeats, type PlanUpdate, type PortalFeatures, type PortalSession, type PortalSessionCreate, type Product, type ProductCategory, type ProductCheckoutCreate, type ProductCouponCreate, type ProductCreate, type ProductLinkCreate, type ProductUpdate, type ProductVariant, type PublicCheckout, type PublicCheckoutItem, type PublicClaim, type PublicClaimSummary, type PublicFulfillment, type PublicFulfillmentRefund, type PublicInvoice, type PublicPaymentLink, type PublicPaymentState, type PublicPortal, type REFUND_MODES, type RESET_FREQUENCIES, type RISK_LEVELS, type ReceiptReference, type ReceiptSend, type Refund, type RefundCreate, type RequestOptions, type ResetFrequency, type RiskLevel, type SUBMIT_LABELS, type SUBSCRIPTION_STATUSES, type SUSPENSION_DAYS, type SubmitLabel, type SubscribableEventType, type Subscription, type SubscriptionCancel, type SubscriptionChange, type SubscriptionChangeCreate, type SubscriptionChangePreview, type SubscriptionChangePreviewInput, type SubscriptionChangeResult, type SubscriptionCreate, type SubscriptionRenewal, type SubscriptionStatus, type SubscriptionTerms, type SubscriptionUpdate, type SuspensionDays, type TAX_BEHAVIORS, type TaxBehavior, type Timestamp, type TokenKind, type TransportOptions, type USAGE_FEATURE_TYPES, type VENEZUELAN_BANKS, type VariantInput, type WEBHOOK_TEST_EVENT, type WebhookEndpoint, type WebhookEndpointCreate, type WebhookEndpointUpdate, type WebhookEvent, WebhookVerificationError, type Weekday, type apiVersionLifecycle, type apiVersionStage, type currentApiVersion, type findBank, type isApiVersion, type isApiVersionRetired, type isLandlinePhone, type isMobilePhone, type nationalPhone, type supportedApiVersions, type tokenEnvironment, type tokenPrefix, verifyWebhook };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as segment, r as BilleteError, t as createTransport } from "./http-
|
|
1
|
+
import { n as segment, r as BilleteError, t as createTransport } from "./http-BMld1QWi.js";
|
|
2
2
|
import { WebhookVerificationError, verifyWebhook } from "./webhooks.js";
|
|
3
3
|
//#region ../contracts/src/environment.ts
|
|
4
4
|
/**
|
|
@@ -75,7 +75,7 @@ function fromEnv(name) {
|
|
|
75
75
|
*
|
|
76
76
|
* ```ts
|
|
77
77
|
* // Reads BILLETE_API_KEY.
|
|
78
|
-
* const billete = createBillete({ apiVersion: "2026-10-
|
|
78
|
+
* const billete = createBillete({ apiVersion: "2026-10-24", environment: "test" });
|
|
79
79
|
* const { allowed } = await billete.features.consume("user_123", "tokens", 850);
|
|
80
80
|
* ```
|
|
81
81
|
*/
|
package/dist/webhooks.d.ts
CHANGED