@boelabs/billete-sdk 8.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-DERevGF5.d.ts → errors-CTtPcwiO.d.ts} +31 -3
- package/dist/{events-b2qMWZF8.d.ts → events-Dry7XWQH.d.ts} +27 -10
- package/dist/{http-CNxkDxq4.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 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 };
|
|
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-CN
|
|
|
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, An as Environment, At as Refund, C as Checkou
|
|
|
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", "2026-10-21"];
|
|
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;
|
|
@@ -1056,6 +1075,15 @@ interface FulfillmentDeliverInput {
|
|
|
1056
1075
|
interface ClientFulfillmentProblem {
|
|
1057
1076
|
comment: string;
|
|
1058
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
|
+
}
|
|
1059
1087
|
/** Opens a claim about a payment, from the customer's page of it. */
|
|
1060
1088
|
interface ClientClaimCreate {
|
|
1061
1089
|
reason: ClaimReason;
|
|
@@ -1134,4 +1162,4 @@ declare class BilleteError extends Error {
|
|
|
1134
1162
|
}, status: number, options?: ErrorOptions);
|
|
1135
1163
|
}
|
|
1136
1164
|
//#endregion
|
|
1137
|
-
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 };
|
|
@@ -430,6 +430,7 @@ declare const API_ERROR_CODES: {
|
|
|
430
430
|
readonly receipt_resend_limit: "Puedes enviar el recibo hasta cinco veces por hora. Inténtalo más tarde.";
|
|
431
431
|
readonly refund_amount_mismatch: "Registra el importe completo de la devolución pendiente.";
|
|
432
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.";
|
|
433
434
|
readonly refund_exceeds_payment: "El reembolso supera lo que queda por reembolsar del pago.";
|
|
434
435
|
readonly refund_threshold_change_pending: "Ya hay un cambio de la aprobación de reembolsos pendiente: cancélalo antes de pedir otro.";
|
|
435
436
|
readonly renewal_invoice: "El cobro es la renovación de una suscripción y no se puede cerrar a mano.";
|
|
@@ -1132,9 +1133,10 @@ interface Fulfillment extends Resource<"fulfillment"> {
|
|
|
1132
1133
|
receivedAt: Timestamp | null;
|
|
1133
1134
|
/**
|
|
1134
1135
|
* `customer`: they confirmed it. `timeout`: they said nothing before `confirmBy`. `carrier`: the
|
|
1135
|
-
* carrier delivered it.
|
|
1136
|
+
* carrier delivered it. `billete`: Billete reviewed the problem reported and decided it in the
|
|
1137
|
+
* business's favor.
|
|
1136
1138
|
*/
|
|
1137
|
-
receivedBy: "customer" | "timeout" | "carrier" | null;
|
|
1139
|
+
receivedBy: "customer" | "timeout" | "carrier" | "billete" | null;
|
|
1138
1140
|
problem: {
|
|
1139
1141
|
comment: string;
|
|
1140
1142
|
reportedAt: Timestamp;
|
|
@@ -1142,7 +1144,7 @@ interface Fulfillment extends Resource<"fulfillment"> {
|
|
|
1142
1144
|
canceledAt: Timestamp | null;
|
|
1143
1145
|
/**
|
|
1144
1146
|
* `refunded`: its payment was fully refunded. `not_shipped`: it had no valid tracking number by
|
|
1145
|
-
* `trackingDueAt`;
|
|
1147
|
+
* `trackingDueAt`; Billete refunds its customer (`mode: "billete"`).
|
|
1146
1148
|
*/
|
|
1147
1149
|
cancellationReason: "refunded" | "not_shipped" | null;
|
|
1148
1150
|
updatedAt: Timestamp;
|
|
@@ -1268,13 +1270,19 @@ interface Payment extends Resource<"payment"> {
|
|
|
1268
1270
|
succeededAt: Timestamp | null;
|
|
1269
1271
|
updatedAt: Timestamp;
|
|
1270
1272
|
}
|
|
1273
|
+
declare const REFUND_MODES: readonly ["provider", "manual", "billete"];
|
|
1271
1274
|
interface Refund extends Resource<"refund"> {
|
|
1272
1275
|
paymentId: string;
|
|
1273
1276
|
amount: number;
|
|
1274
1277
|
currency: Currency;
|
|
1275
1278
|
reason: string | null;
|
|
1276
|
-
/**
|
|
1277
|
-
|
|
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];
|
|
1278
1286
|
status: "pending" | "succeeded" | "failed";
|
|
1279
1287
|
}
|
|
1280
1288
|
/**
|
|
@@ -1295,10 +1303,13 @@ type ClaimStatus = (typeof CLAIM_STATUSES)[number];
|
|
|
1295
1303
|
/** In whose favor a claim was resolved. */
|
|
1296
1304
|
declare const CLAIM_OUTCOMES: readonly ["customer", "business"];
|
|
1297
1305
|
type ClaimOutcome = (typeof CLAIM_OUTCOMES)[number];
|
|
1298
|
-
/**
|
|
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
|
+
*/
|
|
1299
1310
|
interface ClaimMessage {
|
|
1300
1311
|
id: string;
|
|
1301
|
-
author: "customer" | "business";
|
|
1312
|
+
author: "customer" | "business" | "billete";
|
|
1302
1313
|
body: string;
|
|
1303
1314
|
createdAt: Timestamp;
|
|
1304
1315
|
}
|
|
@@ -1320,7 +1331,9 @@ interface Claim extends Resource<"claim"> {
|
|
|
1320
1331
|
messages: ClaimMessage[];
|
|
1321
1332
|
resolution: {
|
|
1322
1333
|
outcome: ClaimOutcome;
|
|
1323
|
-
/**
|
|
1334
|
+
/** Who decided it: the business, or Billete reviewing a problem with a delivery. */
|
|
1335
|
+
by: "business" | "billete";
|
|
1336
|
+
/** What the customer was told. */
|
|
1324
1337
|
note: string;
|
|
1325
1338
|
/** The refund issued when resolving it in the customer's favor. */
|
|
1326
1339
|
refundId: string | null;
|
|
@@ -1443,6 +1456,10 @@ interface EventDataMap {
|
|
|
1443
1456
|
"refund.created": Refund;
|
|
1444
1457
|
/** The provider could not return the funds; the amount is back in the balance. */
|
|
1445
1458
|
"refund.failed": Refund;
|
|
1459
|
+
"payout.created": Payout;
|
|
1460
|
+
"payout.paid": Payout;
|
|
1461
|
+
"payout.failed": Payout;
|
|
1462
|
+
"payout.canceled": Payout;
|
|
1446
1463
|
"invoice.created": Invoice;
|
|
1447
1464
|
"invoice.paid": Invoice;
|
|
1448
1465
|
"invoice.voided": Invoice;
|
|
@@ -1473,7 +1490,7 @@ type EventType = keyof EventDataMap;
|
|
|
1473
1490
|
declare const WEBHOOK_TEST_EVENT: "webhook_endpoint.test";
|
|
1474
1491
|
/** What a webhook endpoint can subscribe to: everything that happens in a business. */
|
|
1475
1492
|
type SubscribableEventType = Exclude<EventType, typeof WEBHOOK_TEST_EVENT>;
|
|
1476
|
-
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.suspended", "subscription.reactivated", "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"];
|
|
1477
1494
|
/** A delivered webhook, discriminated by `type` so `data` narrows automatically. */
|
|
1478
1495
|
type WebhookEvent = { [TType in EventType]: {
|
|
1479
1496
|
id: string;
|
|
@@ -1486,4 +1503,4 @@ type WebhookEvent = { [TType in EventType]: {
|
|
|
1486
1503
|
data: EventDataMap[TType];
|
|
1487
1504
|
}; }[EventType];
|
|
1488
1505
|
//#endregion
|
|
1489
|
-
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 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 };
|
|
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