@boelabs/billete-sdk 3.0.0 → 4.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 +4 -4
- package/dist/client.js +2 -2
- package/dist/{errors-BRQlJDjy.d.ts → errors-D0dmjljM.d.ts} +33 -7
- package/dist/{events-rtkF8fBQ.d.ts → events-C0pKiZ_h.d.ts} +18 -3
- package/dist/{http-PMxK43GM.js → http-BuqnZQ6s.js} +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.js +2 -2
- package/dist/webhooks.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -62,7 +62,7 @@ Crea una clave secreta en el dashboard (**Desarrolladores → Claves API**) y gu
|
|
|
62
62
|
```ts
|
|
63
63
|
import { createBillete } from "@boelabs/billete-sdk";
|
|
64
64
|
|
|
65
|
-
const billete = createBillete({ apiVersion: "2026-10-
|
|
65
|
+
const billete = createBillete({ apiVersion: "2026-10-10", environment: "test" });
|
|
66
66
|
|
|
67
67
|
const checkout = await billete.checkouts.create({
|
|
68
68
|
plan: "plan_…",
|
|
@@ -90,7 +90,7 @@ solicite expresamente. En carritos, solo ofrece los demás métodos que todos lo
|
|
|
90
90
|
|
|
91
91
|
```ts
|
|
92
92
|
const billete = createBillete({
|
|
93
|
-
apiVersion: "2026-10-
|
|
93
|
+
apiVersion: "2026-10-10",
|
|
94
94
|
environment: "production",
|
|
95
95
|
apiKey: process.env.BILLETE_API_KEY,
|
|
96
96
|
timeoutMs: 30_000,
|
|
@@ -256,7 +256,7 @@ return { token: session.token };
|
|
|
256
256
|
// Navegador
|
|
257
257
|
import { createClient } from "@boelabs/billete-sdk/client";
|
|
258
258
|
|
|
259
|
-
const billete = createClient({ apiVersion: "2026-10-
|
|
259
|
+
const billete = createClient({ apiVersion: "2026-10-10", customerSession: token });
|
|
260
260
|
|
|
261
261
|
const { data: subscriptions } = await billete.customer.subscriptions();
|
|
262
262
|
const tokens = await billete.customer.feature("tokens");
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { $ as PRODUCT_CATEGORIES, $t as ListQuery, A as ExchangeRate, At as SubscriptionTerms, B as Fulfillment, Bt as PAYMENT_FAILURE_CODES, C as Customer, Ct as SubmitLabel, D as CustomerMemberList, Dt as SubscriptionChangeResult, E as CustomerMember, Et as SubscriptionChangePreview, F as FeatureOperation, Ft as ReceiptSend, G as INVOICE_REASONS, Gt as BILLING_MONTHS, H as FulfillmentMethod, Ht as ACCOUNT_NUMBER_LENGTH, I as FeatureOperationResult, It as API_ERROR_TYPES, J as InvoiceReason, Jt as CURRENCIES, K as INVOICE_STATUSES, Kt as BankCode, L as FeatureReset, Lt as ApiErrorBody, M as FULFILLMENT_METHODS, Mt as WebhookEndpoint, N as FULFILLMENT_STATUSES, Nt as Weekday, O as CustomerSession, Ot as SubscriptionRenewal, P as Feature, Pt as ReceiptReference, Q as PAYMENT_STATUSES, Qt as List, R as FeatureType, Rt as ApiErrorEnvelope, S as CustomField, St as SUBSCRIPTION_STATUSES, T as CustomerFeature, Tt as SubscriptionChange, U as FulfillmentStatus, Ut as Address, V as FulfillmentChoice, Vt as PaymentFailureCode, W as FulfillmentTracking, Wt as AddressInput, X as LineItem, Xt as GRACE_PERIOD_DAYS, Y as InvoiceStatus, Yt as Currency, Z as MAX_SEATS, Zt as GracePeriodDays, _ as CheckoutItem, _n as tokenPrefix, _t as Refund, a as Actor, an as TAX_BEHAVIORS, at as PaymentStatus, b as Coupon, bt as RiskLevel, c as BalanceAmount, cn as VENEZUELAN_BANKS, ct as PlanFeatureValues, d as CARRIER_TEST_SCENARIOS, dn as isMobilePhone, dt as PortalSession, en as ListSort, et as Payment, f as CHECKOUT_PURPOSES, fn as nationalPhone, ft as Product, g as Checkout, gn as tokenEnvironment, gt as RISK_LEVELS, h as CarrierOffice, hn as TokenKind, ht as RESET_FREQUENCIES, i as WebhookEvent, in as MobilePrefix, it as PaymentSettlement, j as FEATURE_TYPES, jt as USAGE_FEATURE_TYPES, k as Event, kt as SubscriptionStatus, l as CANCELLATION_FEEDBACK, ln as findBank, lt as PlanPrice, m as Carrier, mn as Environment, mt as ProductVariant, n as EventDataMap, nn as MOBILE_PREFIXES, nt as PaymentFailure, o as AfterCompletion, on as TaxBehavior, ot as Payout, p as CancellationFeedback, pn as ENVIRONMENTS, pt as ProductCategory, q as Invoice, qt as BillingMonths, r as EventType, rn as Metadata, rt as PaymentLink, s as Balance, sn as Timestamp, st as Plan, t as EVENT_TYPES, tn as MAX_QUANTITY, tt as PaymentAttempt, u as CARRIERS, un as isLandlinePhone, ut as PlanSeats, v as CheckoutPurpose, vt as ResetFrequency, w as CustomerDetails, wt as Subscription, x as CurrencyAvailability, xt as SUBMIT_LABELS, y as CollectSettings, yt as Retirement, z as FeatureUsageResult, zt as ApiErrorType } from "./events-
|
|
1
|
+
import { $ as SubscriptionCancel, A as FeatureUpdate, At as apiVersionLifecycle, B as PlanCreate, C as CustomerMemberUpdate, Ct as API_VERSION_HEADER, D as FeatureCreate, Dt as ApiVersionStage, E as EventSelector, Et as ApiVersionLifecycle, F as KEY_PATTERN, Ft as supportedApiVersions, G as PortalSessionCreate, H as PlanLinkCreate, I as PaymentLinkCreate, J as ProductCreate, K as ProductCheckoutCreate, L as PaymentLinkUpdate, M as FulfillmentTrackingInput, Mt as currentApiVersion, N as InvoiceCreate, Nt as isApiVersion, O as FeatureOperationCommit, Ot as LATEST_API_VERSION, P as InvoiceLineInput, Pt as isApiVersionRetired, Q as RetireInput, R as PlanCheckoutCreate, S as CustomerMemberCreate, St as API_VERSIONS, T as CustomerUpdate, Tt as ApiVersion, U as PlanPriceInput, V as PlanFeaturesInput, W as PlanUpdate, X as ProductUpdate, Y as ProductLinkCreate, Z as RefundCreate, _ as CouponCreate, _t as PublicFulfillment, a as CheckoutCreate, at as WebhookEndpointCreate, b as CustomerCreate, bt as PublicPaymentState, c as ClientCheckoutUpdate, ct as CustomerSubscriptionChangeResult, d as ClientLinkCheckout, dt as PaymentMethodField, et as SubscriptionChangeCreate, f as ClientPaymentCode, ft as PaymentMethodOption, g as CollectInput, gt as PublicCheckout, h as ClientSubscriptionUpdate, ht as PortalFeatures, i as AfterCompletionInput, it as VariantInput, j as FulfillmentInput, jt as apiVersionStage, k as FeatureOperationCreate, kt as LatestApiVersion, l as ClientFulfillmentProblem, lt as FulfillmentOption, m as ClientSubscriptionSeats, mt as PaymentTestScenario, n as RequestOptions, nt as SubscriptionCreate, o as CheckoutItemInput, ot as WebhookEndpointUpdate, p as ClientSubscriptionCancel, pt as PaymentNextAction, q as ProductCouponCreate, r as TransportOptions, rt as SubscriptionUpdate, s as ClientCheckoutPay, st as CustomerSubscription, t as BilleteError, tt as SubscriptionChangePreviewInput, u as ClientInvoicePay, ut as PaymentInstructions, v as CouponUpdate, vt as PublicInvoice, w as CustomerSessionCreate, wt as API_VERSION_PATTERN, x as CustomerInput, xt as PublicPortal, y as CustomFieldInput, yt as PublicPaymentLink, z as PlanCouponCreate } from "./errors-D0dmjljM.js";
|
|
2
|
+
import { $ as PRODUCT_CATEGORIES, $t as ListQuery, A as ExchangeRate, At as SubscriptionTerms, B as Fulfillment, Bt as PAYMENT_FAILURE_CODES, C as Customer, Ct as SubmitLabel, D as CustomerMemberList, Dt as SubscriptionChangeResult, E as CustomerMember, Et as SubscriptionChangePreview, F as FeatureOperation, Ft as ReceiptSend, G as INVOICE_REASONS, Gt as BILLING_MONTHS, H as FulfillmentMethod, Ht as ACCOUNT_NUMBER_LENGTH, I as FeatureOperationResult, It as API_ERROR_TYPES, J as InvoiceReason, Jt as CURRENCIES, K as INVOICE_STATUSES, Kt as BankCode, L as FeatureReset, Lt as ApiErrorBody, M as FULFILLMENT_METHODS, Mt as WebhookEndpoint, N as FULFILLMENT_STATUSES, Nt as Weekday, O as CustomerSession, Ot as SubscriptionRenewal, P as Feature, Pt as ReceiptReference, Q as PAYMENT_STATUSES, Qt as List, R as FeatureType, Rt as ApiErrorEnvelope, S as CustomField, St as SUBSCRIPTION_STATUSES, T as CustomerFeature, Tt as SubscriptionChange, U as FulfillmentStatus, Ut as Address, V as FulfillmentChoice, Vt as PaymentFailureCode, W as FulfillmentTracking, Wt as AddressInput, X as LineItem, Xt as GRACE_PERIOD_DAYS, Y as InvoiceStatus, Yt as Currency, Z as MAX_SEATS, Zt as GracePeriodDays, _ as CheckoutItem, _n as tokenPrefix, _t as Refund, a as Actor, an as TAX_BEHAVIORS, at as PaymentStatus, b as Coupon, bt as RiskLevel, c as BalanceAmount, cn as VENEZUELAN_BANKS, ct as PlanFeatureValues, d as CARRIER_TEST_SCENARIOS, dn as isMobilePhone, dt as PortalSession, en as ListSort, et as Payment, f as CHECKOUT_PURPOSES, fn as nationalPhone, ft as Product, g as Checkout, gn as tokenEnvironment, gt as RISK_LEVELS, h as CarrierOffice, hn as TokenKind, ht as RESET_FREQUENCIES, i as WebhookEvent, in as MobilePrefix, it as PaymentSettlement, j as FEATURE_TYPES, jt as USAGE_FEATURE_TYPES, k as Event, kt as SubscriptionStatus, l as CANCELLATION_FEEDBACK, ln as findBank, lt as PlanPrice, m as Carrier, mn as Environment, mt as ProductVariant, n as EventDataMap, nn as MOBILE_PREFIXES, nt as PaymentFailure, o as AfterCompletion, on as TaxBehavior, ot as Payout, p as CancellationFeedback, pn as ENVIRONMENTS, pt as ProductCategory, q as Invoice, qt as BillingMonths, r as EventType, rn as Metadata, rt as PaymentLink, s as Balance, sn as Timestamp, st as Plan, t as EVENT_TYPES, tn as MAX_QUANTITY, tt as PaymentAttempt, u as CARRIERS, un as isLandlinePhone, ut as PlanSeats, v as CheckoutPurpose, vt as ResetFrequency, w as CustomerDetails, wt as Subscription, x as CurrencyAvailability, xt as SUBMIT_LABELS, y as CollectSettings, yt as Retirement, z as FeatureUsageResult, zt as ApiErrorType } from "./events-C0pKiZ_h.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-10", customerSession: token });
|
|
18
18
|
* const [subscription] = (await billete.customer.subscriptions()).data;
|
|
19
19
|
* if (subscription?.renewal?.status === "overdue") showBanner(subscription.renewal);
|
|
20
20
|
* ```
|
|
@@ -107,4 +107,4 @@ export declare function createClient(options: ClientOptions): {
|
|
|
107
107
|
};
|
|
108
108
|
type BilleteClient = ReturnType<typeof createClient>;
|
|
109
109
|
//#endregion
|
|
110
|
-
export { type ACCOUNT_NUMBER_LENGTH, 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 ApiErrorEnvelope, type ApiErrorType, type ApiVersion, type ApiVersionLifecycle, type ApiVersionStage, type BILLING_MONTHS, type Balance, type BalanceAmount, type BankCode, type BilleteClient, BilleteError, type BillingMonths, type CANCELLATION_FEEDBACK, type CARRIERS, type CARRIER_TEST_SCENARIOS, type CHECKOUT_PURPOSES, type CURRENCIES, type CancellationFeedback, type Carrier, type CarrierOffice, type Checkout, type CheckoutCreate, type CheckoutItem, type CheckoutItemInput, type CheckoutPurpose, type ClientCheckoutPay, type ClientCheckoutUpdate, 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 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 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 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 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 ProductCreate, type ProductLinkCreate, type ProductUpdate, type ProductVariant, type PublicCheckout, 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 RetireInput, type Retirement, type RiskLevel, type SUBMIT_LABELS, type SUBSCRIPTION_STATUSES, type SubmitLabel, 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 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 };
|
|
110
|
+
export { type ACCOUNT_NUMBER_LENGTH, 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 ApiErrorEnvelope, type ApiErrorType, type ApiVersion, type ApiVersionLifecycle, type ApiVersionStage, type BILLING_MONTHS, type Balance, type BalanceAmount, type BankCode, type BilleteClient, BilleteError, type BillingMonths, type CANCELLATION_FEEDBACK, type CARRIERS, type CARRIER_TEST_SCENARIOS, type CHECKOUT_PURPOSES, type CURRENCIES, type CancellationFeedback, type Carrier, type CarrierOffice, type Checkout, type CheckoutCreate, type CheckoutItem, type CheckoutItemInput, type CheckoutPurpose, type ClientCheckoutPay, type ClientCheckoutUpdate, 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 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 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 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 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 RetireInput, type Retirement, type RiskLevel, type SUBMIT_LABELS, type SUBSCRIPTION_STATUSES, type SubmitLabel, 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 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-BuqnZQ6s.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-PM
|
|
|
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-10", customerSession: token });
|
|
10
10
|
* const [subscription] = (await billete.customer.subscriptions()).data;
|
|
11
11
|
* if (subscription?.renewal?.status === "overdue") showBanner(subscription.renewal);
|
|
12
12
|
* ```
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as Fulfillment, Ct as SubmitLabel, H as FulfillmentMethod, J as InvoiceReason, L as FeatureReset, Lt as ApiErrorBody, Pt as ReceiptReference, S as CustomField, U as FulfillmentStatus, Ut as Address, W as FulfillmentTracking, Wt as AddressInput, X as LineItem, Y as InvoiceStatus, Yt as Currency, Zt as GracePeriodDays, _ as CheckoutItem, at as PaymentStatus, h as CarrierOffice, lt as PlanPrice, m as Carrier, mn as Environment, nt as PaymentFailure, o as AfterCompletion, on as TaxBehavior, p as CancellationFeedback, pt as ProductCategory, qt as BillingMonths, r as EventType, rn as Metadata, sn as Timestamp, ut as PlanSeats, v as CheckoutPurpose, w as CustomerDetails, wt as Subscription, y as CollectSettings, zt as ApiErrorType } from "./events-
|
|
1
|
+
import { B as Fulfillment, Ct as SubmitLabel, H as FulfillmentMethod, J as InvoiceReason, L as FeatureReset, Lt as ApiErrorBody, Pt as ReceiptReference, S as CustomField, U as FulfillmentStatus, Ut as Address, W as FulfillmentTracking, Wt as AddressInput, X as LineItem, Y as InvoiceStatus, Yt as Currency, Zt as GracePeriodDays, _ as CheckoutItem, at as PaymentStatus, h as CarrierOffice, lt as PlanPrice, m as Carrier, mn as Environment, nt as PaymentFailure, o as AfterCompletion, on as TaxBehavior, p as CancellationFeedback, pt as ProductCategory, qt as BillingMonths, r as EventType, rn as Metadata, sn as Timestamp, ut as PlanSeats, v as CheckoutPurpose, w as CustomerDetails, wt as Subscription, y as CollectSettings, zt as ApiErrorType } from "./events-C0pKiZ_h.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 { B as Fulfillment, Ct as SubmitLabel, H as FulfillmentMethod, J as Invoi
|
|
|
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"];
|
|
13
|
+
declare const API_VERSIONS: readonly ["2026-10-07.beta", "2026-10-08", "2026-10-09", "2026-10-10"];
|
|
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. */
|
|
@@ -640,18 +640,42 @@ interface ClientSubscriptionCancel {
|
|
|
640
640
|
feedback?: CancellationFeedback;
|
|
641
641
|
comment?: string;
|
|
642
642
|
}
|
|
643
|
-
/**
|
|
644
|
-
|
|
643
|
+
/**
|
|
644
|
+
* Exactly one of `percentOff` and `amountOff`. A `currency` is required by `amountOff` and
|
|
645
|
+
* `minimumAmount`, and limits the coupon to prices in it.
|
|
646
|
+
*/
|
|
647
|
+
interface CouponFields {
|
|
645
648
|
code: string;
|
|
646
649
|
name?: string;
|
|
647
650
|
percentOff?: number;
|
|
648
651
|
amountOff?: number;
|
|
649
652
|
currency?: Currency;
|
|
650
|
-
|
|
651
|
-
|
|
653
|
+
/** Smallest subtotal, before discount and tax, the coupon needs. */
|
|
654
|
+
minimumAmount?: number;
|
|
655
|
+
/** Each customer (by email) uses it once. */
|
|
656
|
+
oncePerCustomer?: boolean;
|
|
657
|
+
/** Only for customers who never bought from the business. */
|
|
658
|
+
firstPurchaseOnly?: boolean;
|
|
652
659
|
maxRedemptions?: number;
|
|
660
|
+
/** Until when it can be applied; omit for no end. */
|
|
653
661
|
expiresAt?: string;
|
|
654
662
|
}
|
|
663
|
+
interface ProductCouponCreate extends CouponFields {
|
|
664
|
+
appliesTo: "products";
|
|
665
|
+
/** Limits it to these products (IDs); omit for every product. */
|
|
666
|
+
products?: string[];
|
|
667
|
+
}
|
|
668
|
+
interface PlanCouponCreate extends CouponFields {
|
|
669
|
+
appliesTo: "plans";
|
|
670
|
+
/** Limits it to these plans (IDs); omit for every plan. */
|
|
671
|
+
plans?: string[];
|
|
672
|
+
/**
|
|
673
|
+
* How many payments of the subscription it discounts, from the first one charged (after a
|
|
674
|
+
* trial, the first renewal): `1` by default, `null` for every payment.
|
|
675
|
+
*/
|
|
676
|
+
payments?: number | null;
|
|
677
|
+
}
|
|
678
|
+
type CouponCreate = ProductCouponCreate | PlanCouponCreate;
|
|
655
679
|
interface CouponUpdate {
|
|
656
680
|
name?: string | null;
|
|
657
681
|
active?: boolean;
|
|
@@ -722,6 +746,8 @@ interface PaymentLinkUpdate {
|
|
|
722
746
|
interface CheckoutFields {
|
|
723
747
|
customer?: CustomerInput;
|
|
724
748
|
coupon?: string;
|
|
749
|
+
/** Lets the customer apply a coupon in the checkout. */
|
|
750
|
+
allowCoupons?: boolean;
|
|
725
751
|
collect?: CollectInput;
|
|
726
752
|
/**
|
|
727
753
|
* Where the customer goes after paying. `{CHECKOUT_ID}` is replaced by the checkout's ID, so
|
|
@@ -921,4 +947,4 @@ declare class BilleteError extends Error {
|
|
|
921
947
|
}, status: number);
|
|
922
948
|
}
|
|
923
949
|
//#endregion
|
|
924
|
-
export {
|
|
950
|
+
export { SubscriptionCancel as $, FeatureUpdate as A, apiVersionLifecycle as At, PlanCreate as B, CustomerMemberUpdate as C, API_VERSION_HEADER as Ct, FeatureCreate as D, ApiVersionStage as Dt, EventSelector as E, ApiVersionLifecycle as Et, KEY_PATTERN as F, supportedApiVersions as Ft, PortalSessionCreate as G, PlanLinkCreate as H, PaymentLinkCreate as I, ProductCreate as J, ProductCheckoutCreate as K, PaymentLinkUpdate as L, FulfillmentTrackingInput as M, currentApiVersion as Mt, InvoiceCreate as N, isApiVersion as Nt, FeatureOperationCommit as O, LATEST_API_VERSION as Ot, InvoiceLineInput as P, isApiVersionRetired as Pt, RetireInput as Q, PlanCheckoutCreate as R, CustomerMemberCreate as S, API_VERSIONS as St, CustomerUpdate as T, ApiVersion as Tt, PlanPriceInput as U, PlanFeaturesInput as V, PlanUpdate as W, ProductUpdate as X, ProductLinkCreate as Y, RefundCreate as Z, CouponCreate as _, PublicFulfillment as _t, CheckoutCreate as a, WebhookEndpointCreate as at, CustomerCreate as b, PublicPaymentState as bt, ClientCheckoutUpdate as c, CustomerSubscriptionChangeResult as ct, ClientLinkCheckout as d, PaymentMethodField as dt, SubscriptionChangeCreate as et, ClientPaymentCode as f, PaymentMethodOption as ft, CollectInput as g, PublicCheckout as gt, ClientSubscriptionUpdate as h, PortalFeatures as ht, AfterCompletionInput as i, VariantInput as it, FulfillmentInput as j, apiVersionStage as jt, FeatureOperationCreate as k, LatestApiVersion as kt, ClientFulfillmentProblem as l, FulfillmentOption as lt, ClientSubscriptionSeats as m, PaymentTestScenario as mt, RequestOptions as n, SubscriptionCreate as nt, CheckoutItemInput as o, WebhookEndpointUpdate as ot, ClientSubscriptionCancel as p, PaymentNextAction as pt, ProductCouponCreate as q, TransportOptions as r, SubscriptionUpdate as rt, ClientCheckoutPay as s, CustomerSubscription as st, BilleteError as t, SubscriptionChangePreviewInput as tt, ClientInvoicePay as u, PaymentInstructions as ut, CouponUpdate as v, PublicInvoice as vt, CustomerSessionCreate as w, API_VERSION_PATTERN as wt, CustomerInput as x, PublicPortal as xt, CustomFieldInput as y, PublicPaymentLink as yt, PlanCouponCreate as z };
|
|
@@ -557,11 +557,24 @@ interface Coupon extends Resource<"coupon"> {
|
|
|
557
557
|
name: string | null;
|
|
558
558
|
percentOff: number | null;
|
|
559
559
|
amountOff: number | null;
|
|
560
|
+
/** The currency of `amountOff` and `minimumAmount`: the coupon only applies to prices in it. */
|
|
560
561
|
currency: Currency | null;
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
562
|
+
appliesTo: "products" | "plans";
|
|
563
|
+
/** Products it is limited to (`appliesTo: "products"`); `null` for every product. */
|
|
564
|
+
productIds: string[] | null;
|
|
565
|
+
/** Plans it is limited to (`appliesTo: "plans"`); `null` for every plan. */
|
|
566
|
+
planIds: string[] | null;
|
|
567
|
+
/**
|
|
568
|
+
* Payments of a subscription it discounts, from the first one charged; `null` for every
|
|
569
|
+
* payment. Always `1` for products.
|
|
570
|
+
*/
|
|
571
|
+
payments: number | null;
|
|
572
|
+
/** Smallest subtotal, before discount and tax, it needs. */
|
|
573
|
+
minimumAmount: number | null;
|
|
574
|
+
oncePerCustomer: boolean;
|
|
575
|
+
firstPurchaseOnly: boolean;
|
|
564
576
|
maxRedemptions: number | null;
|
|
577
|
+
/** Checkouts paid with it; renewals of a subscription do not count. */
|
|
565
578
|
redemptions: number;
|
|
566
579
|
expiresAt: Timestamp | null;
|
|
567
580
|
active: boolean;
|
|
@@ -660,6 +673,8 @@ interface Checkout extends Resource<"checkout"> {
|
|
|
660
673
|
*/
|
|
661
674
|
trialDays: number | null;
|
|
662
675
|
couponCode: string | null;
|
|
676
|
+
/** The customer can apply a coupon in the checkout. */
|
|
677
|
+
allowCoupons: boolean;
|
|
663
678
|
subscriptionId: string | null;
|
|
664
679
|
paymentLinkId: string | null;
|
|
665
680
|
paymentId: string | null;
|
|
@@ -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 = "4.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 PRODUCT_CATEGORIES, $t as ListQuery, A as ExchangeRate, At as SubscriptionTerms, B as Fulfillment, Bt as PAYMENT_FAILURE_CODES, C as Customer, Ct as SubmitLabel, D as CustomerMemberList, Dt as SubscriptionChangeResult, E as CustomerMember, Et as SubscriptionChangePreview, F as FeatureOperation, Ft as ReceiptSend, G as INVOICE_REASONS, Gt as BILLING_MONTHS, H as FulfillmentMethod, Ht as ACCOUNT_NUMBER_LENGTH, I as FeatureOperationResult, It as API_ERROR_TYPES, J as InvoiceReason, Jt as CURRENCIES, K as INVOICE_STATUSES, Kt as BankCode, L as FeatureReset, Lt as ApiErrorBody, M as FULFILLMENT_METHODS, Mt as WebhookEndpoint, N as FULFILLMENT_STATUSES, Nt as Weekday, O as CustomerSession, Ot as SubscriptionRenewal, P as Feature, Pt as ReceiptReference, Q as PAYMENT_STATUSES, Qt as List, R as FeatureType, Rt as ApiErrorEnvelope, S as CustomField, St as SUBSCRIPTION_STATUSES, T as CustomerFeature, Tt as SubscriptionChange, U as FulfillmentStatus, Ut as Address, V as FulfillmentChoice, Vt as PaymentFailureCode, W as FulfillmentTracking, Wt as AddressInput, X as LineItem, Xt as GRACE_PERIOD_DAYS, Y as InvoiceStatus, Yt as Currency, Z as MAX_SEATS, Zt as GracePeriodDays, _ as CheckoutItem, _n as tokenPrefix, _t as Refund, a as Actor, an as TAX_BEHAVIORS, at as PaymentStatus, b as Coupon, bt as RiskLevel, c as BalanceAmount, cn as VENEZUELAN_BANKS, ct as PlanFeatureValues, d as CARRIER_TEST_SCENARIOS, dn as isMobilePhone, dt as PortalSession, en as ListSort, et as Payment, f as CHECKOUT_PURPOSES, fn as nationalPhone, ft as Product, g as Checkout, gn as tokenEnvironment, gt as RISK_LEVELS, h as CarrierOffice, hn as TokenKind, ht as RESET_FREQUENCIES, i as WebhookEvent, in as MobilePrefix, it as PaymentSettlement, j as FEATURE_TYPES, jt as USAGE_FEATURE_TYPES, k as Event, kt as SubscriptionStatus, l as CANCELLATION_FEEDBACK, ln as findBank, lt as PlanPrice, m as Carrier, mn as Environment, mt as ProductVariant, n as EventDataMap, nn as MOBILE_PREFIXES, nt as PaymentFailure, o as AfterCompletion, on as TaxBehavior, ot as Payout, p as CancellationFeedback, pn as ENVIRONMENTS, pt as ProductCategory, q as Invoice, qt as BillingMonths, r as EventType, rn as Metadata, rt as PaymentLink, s as Balance, sn as Timestamp, st as Plan, t as EVENT_TYPES, tn as MAX_QUANTITY, tt as PaymentAttempt, u as CARRIERS, un as isLandlinePhone, ut as PlanSeats, v as CheckoutPurpose, vt as ResetFrequency, w as CustomerDetails, wt as Subscription, x as CurrencyAvailability, xt as SUBMIT_LABELS, y as CollectSettings, yt as Retirement, z as FeatureUsageResult, zt as ApiErrorType } from "./events-
|
|
1
|
+
import { $ as SubscriptionCancel, A as FeatureUpdate, At as apiVersionLifecycle, B as PlanCreate, C as CustomerMemberUpdate, Ct as API_VERSION_HEADER, D as FeatureCreate, Dt as ApiVersionStage, E as EventSelector, Et as ApiVersionLifecycle, F as KEY_PATTERN, Ft as supportedApiVersions, G as PortalSessionCreate, H as PlanLinkCreate, I as PaymentLinkCreate, J as ProductCreate, K as ProductCheckoutCreate, L as PaymentLinkUpdate, M as FulfillmentTrackingInput, Mt as currentApiVersion, N as InvoiceCreate, Nt as isApiVersion, O as FeatureOperationCommit, Ot as LATEST_API_VERSION, P as InvoiceLineInput, Pt as isApiVersionRetired, Q as RetireInput, R as PlanCheckoutCreate, S as CustomerMemberCreate, St as API_VERSIONS, T as CustomerUpdate, Tt as ApiVersion, U as PlanPriceInput, V as PlanFeaturesInput, W as PlanUpdate, X as ProductUpdate, Y as ProductLinkCreate, Z as RefundCreate, _ as CouponCreate, _t as PublicFulfillment, a as CheckoutCreate, at as WebhookEndpointCreate, b as CustomerCreate, bt as PublicPaymentState, c as ClientCheckoutUpdate, ct as CustomerSubscriptionChangeResult, d as ClientLinkCheckout, dt as PaymentMethodField, et as SubscriptionChangeCreate, f as ClientPaymentCode, ft as PaymentMethodOption, g as CollectInput, gt as PublicCheckout, h as ClientSubscriptionUpdate, ht as PortalFeatures, i as AfterCompletionInput, it as VariantInput, j as FulfillmentInput, jt as apiVersionStage, k as FeatureOperationCreate, kt as LatestApiVersion, l as ClientFulfillmentProblem, lt as FulfillmentOption, m as ClientSubscriptionSeats, mt as PaymentTestScenario, n as RequestOptions, nt as SubscriptionCreate, o as CheckoutItemInput, ot as WebhookEndpointUpdate, p as ClientSubscriptionCancel, pt as PaymentNextAction, q as ProductCouponCreate, r as TransportOptions, rt as SubscriptionUpdate, s as ClientCheckoutPay, st as CustomerSubscription, t as BilleteError, tt as SubscriptionChangePreviewInput, u as ClientInvoicePay, ut as PaymentInstructions, v as CouponUpdate, vt as PublicInvoice, w as CustomerSessionCreate, wt as API_VERSION_PATTERN, x as CustomerInput, xt as PublicPortal, y as CustomFieldInput, yt as PublicPaymentLink, z as PlanCouponCreate } from "./errors-D0dmjljM.js";
|
|
2
|
+
import { $ as PRODUCT_CATEGORIES, $t as ListQuery, A as ExchangeRate, At as SubscriptionTerms, B as Fulfillment, Bt as PAYMENT_FAILURE_CODES, C as Customer, Ct as SubmitLabel, D as CustomerMemberList, Dt as SubscriptionChangeResult, E as CustomerMember, Et as SubscriptionChangePreview, F as FeatureOperation, Ft as ReceiptSend, G as INVOICE_REASONS, Gt as BILLING_MONTHS, H as FulfillmentMethod, Ht as ACCOUNT_NUMBER_LENGTH, I as FeatureOperationResult, It as API_ERROR_TYPES, J as InvoiceReason, Jt as CURRENCIES, K as INVOICE_STATUSES, Kt as BankCode, L as FeatureReset, Lt as ApiErrorBody, M as FULFILLMENT_METHODS, Mt as WebhookEndpoint, N as FULFILLMENT_STATUSES, Nt as Weekday, O as CustomerSession, Ot as SubscriptionRenewal, P as Feature, Pt as ReceiptReference, Q as PAYMENT_STATUSES, Qt as List, R as FeatureType, Rt as ApiErrorEnvelope, S as CustomField, St as SUBSCRIPTION_STATUSES, T as CustomerFeature, Tt as SubscriptionChange, U as FulfillmentStatus, Ut as Address, V as FulfillmentChoice, Vt as PaymentFailureCode, W as FulfillmentTracking, Wt as AddressInput, X as LineItem, Xt as GRACE_PERIOD_DAYS, Y as InvoiceStatus, Yt as Currency, Z as MAX_SEATS, Zt as GracePeriodDays, _ as CheckoutItem, _n as tokenPrefix, _t as Refund, a as Actor, an as TAX_BEHAVIORS, at as PaymentStatus, b as Coupon, bt as RiskLevel, c as BalanceAmount, cn as VENEZUELAN_BANKS, ct as PlanFeatureValues, d as CARRIER_TEST_SCENARIOS, dn as isMobilePhone, dt as PortalSession, en as ListSort, et as Payment, f as CHECKOUT_PURPOSES, fn as nationalPhone, ft as Product, g as Checkout, gn as tokenEnvironment, gt as RISK_LEVELS, h as CarrierOffice, hn as TokenKind, ht as RESET_FREQUENCIES, i as WebhookEvent, in as MobilePrefix, it as PaymentSettlement, j as FEATURE_TYPES, jt as USAGE_FEATURE_TYPES, k as Event, kt as SubscriptionStatus, l as CANCELLATION_FEEDBACK, ln as findBank, lt as PlanPrice, m as Carrier, mn as Environment, mt as ProductVariant, n as EventDataMap, nn as MOBILE_PREFIXES, nt as PaymentFailure, o as AfterCompletion, on as TaxBehavior, ot as Payout, p as CancellationFeedback, pn as ENVIRONMENTS, pt as ProductCategory, q as Invoice, qt as BillingMonths, r as EventType, rn as Metadata, rt as PaymentLink, s as Balance, sn as Timestamp, st as Plan, t as EVENT_TYPES, tn as MAX_QUANTITY, tt as PaymentAttempt, u as CARRIERS, un as isLandlinePhone, ut as PlanSeats, v as CheckoutPurpose, vt as ResetFrequency, w as CustomerDetails, wt as Subscription, x as CurrencyAvailability, xt as SUBMIT_LABELS, y as CollectSettings, yt as Retirement, z as FeatureUsageResult, zt as ApiErrorType } from "./events-C0pKiZ_h.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-10", environment: "test" });
|
|
29
29
|
* const { allowed } = await billete.features.consume("user_123", "tokens", 850);
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
@@ -101,10 +101,12 @@ export declare function createBillete(options: BilleteOptions): {
|
|
|
101
101
|
features: {
|
|
102
102
|
create: (input: FeatureCreate, options?: RequestOptions) => Promise<Feature>;
|
|
103
103
|
list: (query?: Filters<{
|
|
104
|
+
search?: string;
|
|
104
105
|
sort?: ListSort<"created" | "name">;
|
|
105
106
|
}>, options?: RequestOptions) => Promise<List<Feature>>;
|
|
106
107
|
/** Iterates every item across pages: `for await (const item of iterate())`. */
|
|
107
108
|
iterate: (query?: Filters<{
|
|
109
|
+
search?: string;
|
|
108
110
|
sort?: ListSort<"created" | "name">;
|
|
109
111
|
}>) => AsyncGenerator<Feature, any, any>;
|
|
110
112
|
/** A feature by its `key` (`tokens`) or its `feat_` ID. */
|
|
@@ -320,4 +322,4 @@ export declare function createBillete(options: BilleteOptions): {
|
|
|
320
322
|
/** The server client: what `createBillete` returns. */
|
|
321
323
|
type Billete = ReturnType<typeof createBillete>;
|
|
322
324
|
//#endregion
|
|
323
|
-
export { type ACCOUNT_NUMBER_LENGTH, 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 ApiErrorEnvelope, type ApiErrorType, type ApiVersion, type ApiVersionLifecycle, type ApiVersionStage, type BILLING_MONTHS, type Balance, type BalanceAmount, type BankCode, type Billete, BilleteError, type BilleteOptions, type BillingMonths, type CANCELLATION_FEEDBACK, type CARRIERS, type CARRIER_TEST_SCENARIOS, type CHECKOUT_PURPOSES, type CURRENCIES, type CancellationFeedback, type Carrier, type CarrierOffice, type Checkout, type CheckoutCreate, type CheckoutItem, type CheckoutItemInput, type CheckoutPurpose, type ClientCheckoutPay, type ClientCheckoutUpdate, 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 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 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 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 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 ProductCreate, type ProductLinkCreate, type ProductUpdate, type ProductVariant, type PublicCheckout, 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 RetireInput, type Retirement, type RiskLevel, type SUBMIT_LABELS, type SUBSCRIPTION_STATUSES, type SubmitLabel, 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 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 };
|
|
325
|
+
export { type ACCOUNT_NUMBER_LENGTH, 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 ApiErrorEnvelope, type ApiErrorType, type ApiVersion, type ApiVersionLifecycle, type ApiVersionStage, type BILLING_MONTHS, type Balance, type BalanceAmount, type BankCode, type Billete, BilleteError, type BilleteOptions, type BillingMonths, type CANCELLATION_FEEDBACK, type CARRIERS, type CARRIER_TEST_SCENARIOS, type CHECKOUT_PURPOSES, type CURRENCIES, type CancellationFeedback, type Carrier, type CarrierOffice, type Checkout, type CheckoutCreate, type CheckoutItem, type CheckoutItemInput, type CheckoutPurpose, type ClientCheckoutPay, type ClientCheckoutUpdate, 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 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 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 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 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 RetireInput, type Retirement, type RiskLevel, type SUBMIT_LABELS, type SUBSCRIPTION_STATUSES, type SubmitLabel, 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 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-BuqnZQ6s.js";
|
|
2
2
|
import { WebhookVerificationError, verifyWebhook } from "./webhooks.js";
|
|
3
3
|
//#region ../contracts/src/environment.ts
|
|
4
4
|
/**
|
|
@@ -64,7 +64,7 @@ function fromEnv(name) {
|
|
|
64
64
|
*
|
|
65
65
|
* ```ts
|
|
66
66
|
* // Reads BILLETE_API_KEY.
|
|
67
|
-
* const billete = createBillete({ apiVersion: "2026-10-
|
|
67
|
+
* const billete = createBillete({ apiVersion: "2026-10-10", environment: "test" });
|
|
68
68
|
* const { allowed } = await billete.features.consume("user_123", "tokens", 850);
|
|
69
69
|
* ```
|
|
70
70
|
*/
|
package/dist/webhooks.d.ts
CHANGED