@boelabs/billete-sdk 0.6.0 → 1.0.0-canary.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 -0
- package/dist/client.d.ts +3 -3
- package/dist/client.js +1 -1
- package/dist/{errors-BzzXE5C2.d.ts → errors-BWbGS6Bf.d.ts} +20 -4
- package/dist/{events-DjO9ARae.d.ts → events-IdoR4Qfi.d.ts} +150 -1
- package/dist/{http-Q-RXDFbe.js → http-BRltPxje.js} +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +1 -1
- package/dist/webhooks.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -64,6 +64,9 @@ const checkout = await billete.checkouts.create({
|
|
|
64
64
|
plan: "plan_…",
|
|
65
65
|
months: 1,
|
|
66
66
|
customer: { email: "ana@example.com", externalId: "user_123" },
|
|
67
|
+
// {CHECKOUT_ID} se reemplaza por el ID del checkout.
|
|
68
|
+
successUrl: "https://tuapp.com/gracias?checkout={CHECKOUT_ID}",
|
|
69
|
+
cancelUrl: "https://tuapp.com/planes",
|
|
67
70
|
});
|
|
68
71
|
|
|
69
72
|
// Redirige a tu cliente a checkout.url para que pague.
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as RISK_LEVELS, A as INVOICE_REASONS, At as
|
|
2
|
-
import { $ as PaymentTestScenario, A as PlanCreate, B as RefundCreate, C as FeatureUpdate, D as PaymentLinkCreate, E as KEY_PATTERN, F as PortalSessionCreate, G as VariantInput, H as SubscriptionCancel, I as ProductCheckoutCreate, J as CustomerSubscription, K as WebhookEndpointCreate, L as ProductCreate, M as PlanLinkCreate, N as PlanPriceInput, O as PaymentLinkUpdate, P as PlanUpdate, Q as PaymentNextAction, R as ProductLinkCreate, S as FeatureCreate, T as InvoiceLineInput, U as SubscriptionCreate, V as RetireInput, W as SubscriptionUpdate, X as PaymentMethodField, Y as PaymentInstructions, Z as PaymentMethodOption, _ as CustomerCreate, a as CheckoutCreate, at as PublicPortal, b as CustomerUpdate, c as ClientCheckoutUpdate, d as ClientSubscriptionCancel, et as PortalFeatures, f as ClientSubscriptionUpdate, g as CustomFieldInput, h as CouponUpdate, i as AfterCompletionInput, it as PublicPaymentState, j as PlanFeaturesInput, k as PlanCheckoutCreate, l as ClientInvoicePay, m as CouponCreate, n as RequestOptions, nt as PublicInvoice, o as CheckoutItemInput, p as CollectInput, q as WebhookEndpointUpdate, r as TransportOptions, rt as PublicPaymentLink, s as ClientCheckoutPay, t as BilleteError, tt as PublicCheckout, u as ClientLinkCheckout, v as CustomerInput, w as InvoiceCreate, x as EventSelector, y as CustomerSessionCreate, z as ProductUpdate } from "./errors-
|
|
1
|
+
import { $ as RISK_LEVELS, A as INVOICE_REASONS, At as ListQuery, B as PaymentFailure, Bt as isLandlinePhone, C as Event, Ct as BankCode, D as FeatureReset, Dt as GRACE_PERIOD_DAYS, E as Feature, Et as Currency, F as LineItem, Ft as TAX_BEHAVIORS, G as Plan, Gt as TokenKind, H as PaymentSettlement, Ht as nationalPhone, I as PAYMENT_STATUSES, It as TaxBehavior, J as PortalSession, K as PlanFeatureValues, Kt as tokenEnvironment, L as PRODUCT_CATEGORIES, Lt as Timestamp, M as Invoice, Mt as MOBILE_PREFIXES, N as InvoiceReason, Nt as Metadata, O as FeatureType, Ot as GracePeriodDays, P as InvoiceStatus, Pt as MobilePrefix, Q as RESET_FREQUENCIES, R as Payment, Rt as VENEZUELAN_BANKS, S as CustomerSession, St as BILLING_MONTHS, T as FEATURE_TYPES, Tt as CURRENCIES, U as PaymentStatus, Ut as ENVIRONMENTS, V as PaymentLink, Vt as isMobilePhone, W as Payout, Wt as Environment, X as ProductCategory, Y as Product, Z as ProductVariant, _ as CurrencyAvailability, _t as PAYMENT_FAILURE_CODES, a as Actor, at as SUBSCRIPTION_STATUSES, b as CustomerDetails, bt as Address, c as BalanceAmount, ct as SubscriptionRenewal, d as CancellationFeedback, dt as WebhookEndpoint, et as Refund, f as Checkout, ft as Weekday, g as Coupon, gt as ApiErrorType, h as CollectSettings, ht as ApiErrorEnvelope, i as WebhookEvent, it as SUBMIT_LABELS, j as INVOICE_STATUSES, jt as MAX_QUANTITY, k as FeatureUsageResult, kt as List, l as CANCELLATION_FEEDBACK, lt as SubscriptionStatus, m as CheckoutPurpose, mt as ApiErrorBody, n as EventDataMap, nt as Retirement, o as AfterCompletion, ot as SubmitLabel, p as CheckoutItem, pt as API_ERROR_TYPES, q as PlanPrice, qt as tokenPrefix, r as EventType, rt as RiskLevel, s as Balance, st as Subscription, t as EVENT_TYPES, tt as ResetFrequency, u as CHECKOUT_PURPOSES, ut as USAGE_FEATURE_TYPES, v as CustomField, vt as PaymentFailureCode, w as ExchangeRate, wt as BillingMonths, x as CustomerFeature, xt as AddressInput, y as Customer, yt as ACCOUNT_NUMBER_LENGTH, z as PaymentAttempt, zt as findBank } from "./events-IdoR4Qfi.js";
|
|
2
|
+
import { $ as PaymentTestScenario, A as PlanCreate, B as RefundCreate, C as FeatureUpdate, D as PaymentLinkCreate, E as KEY_PATTERN, F as PortalSessionCreate, G as VariantInput, H as SubscriptionCancel, I as ProductCheckoutCreate, J as CustomerSubscription, K as WebhookEndpointCreate, L as ProductCreate, M as PlanLinkCreate, N as PlanPriceInput, O as PaymentLinkUpdate, P as PlanUpdate, Q as PaymentNextAction, R as ProductLinkCreate, S as FeatureCreate, T as InvoiceLineInput, U as SubscriptionCreate, V as RetireInput, W as SubscriptionUpdate, X as PaymentMethodField, Y as PaymentInstructions, Z as PaymentMethodOption, _ as CustomerCreate, a as CheckoutCreate, at as PublicPortal, b as CustomerUpdate, c as ClientCheckoutUpdate, d as ClientSubscriptionCancel, et as PortalFeatures, f as ClientSubscriptionUpdate, g as CustomFieldInput, h as CouponUpdate, i as AfterCompletionInput, it as PublicPaymentState, j as PlanFeaturesInput, k as PlanCheckoutCreate, l as ClientInvoicePay, m as CouponCreate, n as RequestOptions, nt as PublicInvoice, o as CheckoutItemInput, p as CollectInput, q as WebhookEndpointUpdate, r as TransportOptions, rt as PublicPaymentLink, s as ClientCheckoutPay, t as BilleteError, tt as PublicCheckout, u as ClientLinkCheckout, v as CustomerInput, w as InvoiceCreate, x as EventSelector, y as CustomerSessionCreate, z as ProductUpdate } from "./errors-BWbGS6Bf.js";
|
|
3
3
|
//#region src/create-client.d.ts
|
|
4
4
|
interface ClientOptions extends TransportOptions {
|
|
5
5
|
/**
|
|
@@ -67,4 +67,4 @@ export declare function createClient(options?: ClientOptions): {
|
|
|
67
67
|
};
|
|
68
68
|
type BilleteClient = ReturnType<typeof createClient>;
|
|
69
69
|
//#endregion
|
|
70
|
-
export { type API_ERROR_TYPES, type Actor, type Address, type AddressInput, type AfterCompletion, type AfterCompletionInput, type ApiErrorBody, type ApiErrorEnvelope, type ApiErrorType, type BILLING_MONTHS, type Balance, type BalanceAmount, type BilleteClient, BilleteError, type BillingMonths, type CANCELLATION_FEEDBACK, type CHECKOUT_PURPOSES, type CURRENCIES, type CancellationFeedback, type Checkout, type CheckoutCreate, type CheckoutItem, type CheckoutItemInput, type CheckoutPurpose, type ClientCheckoutPay, type ClientCheckoutUpdate, type ClientInvoicePay, type ClientLinkCheckout, type ClientOptions, type ClientSubscriptionCancel, 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 CustomerSession, type CustomerSessionCreate, type CustomerSubscription, type CustomerUpdate, type ENVIRONMENTS, type EVENT_TYPES, type Environment, type Event, type EventDataMap, type EventSelector, type EventType, type ExchangeRate, type FEATURE_TYPES, type Feature, type FeatureCreate, type FeatureReset, type FeatureType, type FeatureUpdate, type FeatureUsageResult, 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 LineItem, type List, type ListQuery, type MAX_QUANTITY, 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 PlanUpdate, type PortalFeatures, type PortalSession, type PortalSessionCreate, type Product, type ProductCategory, type ProductCheckoutCreate, type ProductCreate, type ProductLinkCreate, type ProductUpdate, type ProductVariant, type PublicCheckout, type PublicInvoice, type PublicPaymentLink, type PublicPaymentState, type PublicPortal, type RESET_FREQUENCIES, type RISK_LEVELS, 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 SubscriptionCreate, type SubscriptionRenewal, type SubscriptionStatus, type SubscriptionUpdate, type TAX_BEHAVIORS, type TaxBehavior, type Timestamp, type TokenKind, type USAGE_FEATURE_TYPES, type VariantInput, type WebhookEndpoint, type WebhookEndpointCreate, type WebhookEndpointUpdate, type WebhookEvent, type Weekday, type isLandlinePhone, type isMobilePhone, type nationalPhone, type tokenEnvironment, type tokenPrefix };
|
|
70
|
+
export { type ACCOUNT_NUMBER_LENGTH, type API_ERROR_TYPES, type Actor, type Address, type AddressInput, type AfterCompletion, type AfterCompletionInput, type ApiErrorBody, type ApiErrorEnvelope, type ApiErrorType, type BILLING_MONTHS, type Balance, type BalanceAmount, type BankCode, type BilleteClient, BilleteError, type BillingMonths, type CANCELLATION_FEEDBACK, type CHECKOUT_PURPOSES, type CURRENCIES, type CancellationFeedback, type Checkout, type CheckoutCreate, type CheckoutItem, type CheckoutItemInput, type CheckoutPurpose, type ClientCheckoutPay, type ClientCheckoutUpdate, type ClientInvoicePay, type ClientLinkCheckout, type ClientOptions, type ClientSubscriptionCancel, 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 CustomerSession, type CustomerSessionCreate, type CustomerSubscription, type CustomerUpdate, type ENVIRONMENTS, type EVENT_TYPES, type Environment, type Event, type EventDataMap, type EventSelector, type EventType, type ExchangeRate, type FEATURE_TYPES, type Feature, type FeatureCreate, type FeatureReset, type FeatureType, type FeatureUpdate, type FeatureUsageResult, 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 LineItem, type List, type ListQuery, type MAX_QUANTITY, 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 PlanUpdate, type PortalFeatures, type PortalSession, type PortalSessionCreate, type Product, type ProductCategory, type ProductCheckoutCreate, type ProductCreate, type ProductLinkCreate, type ProductUpdate, type ProductVariant, type PublicCheckout, type PublicInvoice, type PublicPaymentLink, type PublicPaymentState, type PublicPortal, type RESET_FREQUENCIES, type RISK_LEVELS, 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 SubscriptionCreate, type SubscriptionRenewal, type SubscriptionStatus, 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 findBank, type isLandlinePhone, type isMobilePhone, type nationalPhone, 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-BRltPxje.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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as PaymentFailure,
|
|
1
|
+
import { B as PaymentFailure, D as FeatureReset, Et as Currency, F as LineItem, It as TaxBehavior, Lt as Timestamp, N as InvoiceReason, Nt as Metadata, Ot as GracePeriodDays, P as InvoiceStatus, U as PaymentStatus, Wt as Environment, X as ProductCategory, b as CustomerDetails, d as CancellationFeedback, gt as ApiErrorType, h as CollectSettings, m as CheckoutPurpose, mt as ApiErrorBody, o as AfterCompletion, ot as SubmitLabel, p as CheckoutItem, q as PlanPrice, r as EventType, st as Subscription, v as CustomField, wt as BillingMonths, xt as AddressInput } from "./events-IdoR4Qfi.js";
|
|
2
2
|
//#region ../contracts/src/client.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* A subscription as its customer sees it, in the browser: without the business's `metadata`, with
|
|
@@ -132,8 +132,10 @@ interface PublicCheckout {
|
|
|
132
132
|
customFields: CustomField[];
|
|
133
133
|
customerDetails: CustomerDetails;
|
|
134
134
|
submitLabel: SubmitLabel;
|
|
135
|
+
/** What follows payment; a redirect's URL already has `{CHECKOUT_ID}` replaced. */
|
|
135
136
|
afterCompletion: AfterCompletion;
|
|
136
|
-
|
|
137
|
+
/** Where "Volver" leads, resolved like the redirect; `null` hides it. */
|
|
138
|
+
cancelUrl: string | null;
|
|
137
139
|
expiresAt: Timestamp;
|
|
138
140
|
payment: PublicPaymentState | null;
|
|
139
141
|
}
|
|
@@ -476,7 +478,13 @@ interface CheckoutFields {
|
|
|
476
478
|
customer?: CustomerInput;
|
|
477
479
|
coupon?: string;
|
|
478
480
|
collect?: CollectInput;
|
|
481
|
+
/**
|
|
482
|
+
* Where the customer goes after paying. `{CHECKOUT_ID}` is replaced by the checkout's ID, so
|
|
483
|
+
* the page can confirm the order: `https://tienda.com/gracias?checkout={CHECKOUT_ID}`.
|
|
484
|
+
*/
|
|
479
485
|
successUrl?: string;
|
|
486
|
+
/** Where "Volver" leads when the customer leaves without paying; `{CHECKOUT_ID}` works too. */
|
|
487
|
+
cancelUrl?: string;
|
|
480
488
|
expiresInMinutes?: number;
|
|
481
489
|
metadata?: Metadata;
|
|
482
490
|
}
|
|
@@ -493,12 +501,20 @@ interface PlanCheckoutCreate extends CheckoutFields {
|
|
|
493
501
|
months: BillingMonths;
|
|
494
502
|
}
|
|
495
503
|
type CheckoutCreate = ProductCheckoutCreate | PlanCheckoutCreate;
|
|
496
|
-
|
|
504
|
+
/**
|
|
505
|
+
* A line of a one-off Cobro: a product of the catalog, priced by it (units are held while its
|
|
506
|
+
* payment is verified, like a checkout's), or a line the business describes and prices.
|
|
507
|
+
*/
|
|
508
|
+
type InvoiceLineInput = {
|
|
509
|
+
product: string;
|
|
510
|
+
variant?: string;
|
|
511
|
+
quantity?: number;
|
|
512
|
+
} | {
|
|
497
513
|
description: string;
|
|
498
514
|
quantity?: number;
|
|
499
515
|
/** Per unit, in minor units. */
|
|
500
516
|
unitAmount: number;
|
|
501
|
-
}
|
|
517
|
+
};
|
|
502
518
|
/** A one-off Cobro for a customer, payable from its page (`url`). */
|
|
503
519
|
interface InvoiceCreate {
|
|
504
520
|
customer: CustomerInput;
|
|
@@ -53,6 +53,154 @@ interface AddressInput {
|
|
|
53
53
|
postalCode?: string;
|
|
54
54
|
country?: string;
|
|
55
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Venezuelan banks by their four-digit code, which is also how every account number of the bank
|
|
58
|
+
* begins (`0134…` is Banesco).
|
|
59
|
+
*/
|
|
60
|
+
declare const VENEZUELAN_BANKS: readonly [{
|
|
61
|
+
readonly code: "0102";
|
|
62
|
+
readonly name: "Banco de Venezuela";
|
|
63
|
+
}, {
|
|
64
|
+
readonly code: "0104";
|
|
65
|
+
readonly name: "Venezolano de Crédito";
|
|
66
|
+
}, {
|
|
67
|
+
readonly code: "0105";
|
|
68
|
+
readonly name: "Mercantil";
|
|
69
|
+
}, {
|
|
70
|
+
readonly code: "0108";
|
|
71
|
+
readonly name: "BBVA Provincial";
|
|
72
|
+
}, {
|
|
73
|
+
readonly code: "0114";
|
|
74
|
+
readonly name: "Bancaribe";
|
|
75
|
+
}, {
|
|
76
|
+
readonly code: "0115";
|
|
77
|
+
readonly name: "Exterior";
|
|
78
|
+
}, {
|
|
79
|
+
readonly code: "0128";
|
|
80
|
+
readonly name: "Caroní";
|
|
81
|
+
}, {
|
|
82
|
+
readonly code: "0134";
|
|
83
|
+
readonly name: "Banesco";
|
|
84
|
+
}, {
|
|
85
|
+
readonly code: "0137";
|
|
86
|
+
readonly name: "Sofitasa";
|
|
87
|
+
}, {
|
|
88
|
+
readonly code: "0138";
|
|
89
|
+
readonly name: "Plaza";
|
|
90
|
+
}, {
|
|
91
|
+
readonly code: "0151";
|
|
92
|
+
readonly name: "BFC";
|
|
93
|
+
}, {
|
|
94
|
+
readonly code: "0156";
|
|
95
|
+
readonly name: "100% Banco";
|
|
96
|
+
}, {
|
|
97
|
+
readonly code: "0157";
|
|
98
|
+
readonly name: "DelSur";
|
|
99
|
+
}, {
|
|
100
|
+
readonly code: "0163";
|
|
101
|
+
readonly name: "Banco del Tesoro";
|
|
102
|
+
}, {
|
|
103
|
+
readonly code: "0166";
|
|
104
|
+
readonly name: "Banco Agrícola";
|
|
105
|
+
}, {
|
|
106
|
+
readonly code: "0168";
|
|
107
|
+
readonly name: "Bancrecer";
|
|
108
|
+
}, {
|
|
109
|
+
readonly code: "0169";
|
|
110
|
+
readonly name: "Mi Banco";
|
|
111
|
+
}, {
|
|
112
|
+
readonly code: "0171";
|
|
113
|
+
readonly name: "Banco Activo";
|
|
114
|
+
}, {
|
|
115
|
+
readonly code: "0172";
|
|
116
|
+
readonly name: "Bancamiga";
|
|
117
|
+
}, {
|
|
118
|
+
readonly code: "0174";
|
|
119
|
+
readonly name: "Banplus";
|
|
120
|
+
}, {
|
|
121
|
+
readonly code: "0175";
|
|
122
|
+
readonly name: "Bicentenario";
|
|
123
|
+
}, {
|
|
124
|
+
readonly code: "0177";
|
|
125
|
+
readonly name: "Banfanb";
|
|
126
|
+
}, {
|
|
127
|
+
readonly code: "0191";
|
|
128
|
+
readonly name: "Banco Nacional de Crédito";
|
|
129
|
+
}];
|
|
130
|
+
type BankCode = (typeof VENEZUELAN_BANKS)[number]["code"];
|
|
131
|
+
/** The bank of a code, or `undefined` for a code no bank uses. */
|
|
132
|
+
declare function findBank(code: string): {
|
|
133
|
+
readonly code: "0102";
|
|
134
|
+
readonly name: "Banco de Venezuela";
|
|
135
|
+
} | {
|
|
136
|
+
readonly code: "0104";
|
|
137
|
+
readonly name: "Venezolano de Crédito";
|
|
138
|
+
} | {
|
|
139
|
+
readonly code: "0105";
|
|
140
|
+
readonly name: "Mercantil";
|
|
141
|
+
} | {
|
|
142
|
+
readonly code: "0108";
|
|
143
|
+
readonly name: "BBVA Provincial";
|
|
144
|
+
} | {
|
|
145
|
+
readonly code: "0114";
|
|
146
|
+
readonly name: "Bancaribe";
|
|
147
|
+
} | {
|
|
148
|
+
readonly code: "0115";
|
|
149
|
+
readonly name: "Exterior";
|
|
150
|
+
} | {
|
|
151
|
+
readonly code: "0128";
|
|
152
|
+
readonly name: "Caroní";
|
|
153
|
+
} | {
|
|
154
|
+
readonly code: "0134";
|
|
155
|
+
readonly name: "Banesco";
|
|
156
|
+
} | {
|
|
157
|
+
readonly code: "0137";
|
|
158
|
+
readonly name: "Sofitasa";
|
|
159
|
+
} | {
|
|
160
|
+
readonly code: "0138";
|
|
161
|
+
readonly name: "Plaza";
|
|
162
|
+
} | {
|
|
163
|
+
readonly code: "0151";
|
|
164
|
+
readonly name: "BFC";
|
|
165
|
+
} | {
|
|
166
|
+
readonly code: "0156";
|
|
167
|
+
readonly name: "100% Banco";
|
|
168
|
+
} | {
|
|
169
|
+
readonly code: "0157";
|
|
170
|
+
readonly name: "DelSur";
|
|
171
|
+
} | {
|
|
172
|
+
readonly code: "0163";
|
|
173
|
+
readonly name: "Banco del Tesoro";
|
|
174
|
+
} | {
|
|
175
|
+
readonly code: "0166";
|
|
176
|
+
readonly name: "Banco Agrícola";
|
|
177
|
+
} | {
|
|
178
|
+
readonly code: "0168";
|
|
179
|
+
readonly name: "Bancrecer";
|
|
180
|
+
} | {
|
|
181
|
+
readonly code: "0169";
|
|
182
|
+
readonly name: "Mi Banco";
|
|
183
|
+
} | {
|
|
184
|
+
readonly code: "0171";
|
|
185
|
+
readonly name: "Banco Activo";
|
|
186
|
+
} | {
|
|
187
|
+
readonly code: "0172";
|
|
188
|
+
readonly name: "Bancamiga";
|
|
189
|
+
} | {
|
|
190
|
+
readonly code: "0174";
|
|
191
|
+
readonly name: "Banplus";
|
|
192
|
+
} | {
|
|
193
|
+
readonly code: "0175";
|
|
194
|
+
readonly name: "Bicentenario";
|
|
195
|
+
} | {
|
|
196
|
+
readonly code: "0177";
|
|
197
|
+
readonly name: "Banfanb";
|
|
198
|
+
} | {
|
|
199
|
+
readonly code: "0191";
|
|
200
|
+
readonly name: "Banco Nacional de Crédito";
|
|
201
|
+
} | undefined;
|
|
202
|
+
/** A Venezuelan account number: the bank's four digits and sixteen more. */
|
|
203
|
+
declare const ACCOUNT_NUMBER_LENGTH = 20;
|
|
56
204
|
/** Venezuelan mobile operators by prefix. */
|
|
57
205
|
declare const MOBILE_PREFIXES: readonly [{
|
|
58
206
|
readonly prefix: "0412";
|
|
@@ -432,6 +580,7 @@ interface Checkout extends Resource<"checkout"> {
|
|
|
432
580
|
customFieldValues: Record<string, string | number>;
|
|
433
581
|
customerDetails: CustomerDetails;
|
|
434
582
|
successUrl: string | null;
|
|
583
|
+
cancelUrl: string | null;
|
|
435
584
|
expiresAt: Timestamp;
|
|
436
585
|
completedAt: Timestamp | null;
|
|
437
586
|
metadata: Metadata;
|
|
@@ -650,4 +799,4 @@ type WebhookEvent = { [TType in EventType]: {
|
|
|
650
799
|
data: EventDataMap[TType];
|
|
651
800
|
}; }[EventType];
|
|
652
801
|
//#endregion
|
|
653
|
-
export { RISK_LEVELS as $, INVOICE_REASONS as A,
|
|
802
|
+
export { RISK_LEVELS as $, INVOICE_REASONS as A, ListQuery as At, PaymentFailure as B, isLandlinePhone as Bt, Event as C, BankCode as Ct, FeatureReset as D, GRACE_PERIOD_DAYS as Dt, Feature as E, Currency as Et, LineItem as F, TAX_BEHAVIORS as Ft, Plan as G, TokenKind as Gt, PaymentSettlement as H, nationalPhone as Ht, PAYMENT_STATUSES as I, TaxBehavior as It, PortalSession as J, PlanFeatureValues as K, tokenEnvironment as Kt, PRODUCT_CATEGORIES as L, Timestamp as Lt, Invoice as M, MOBILE_PREFIXES as Mt, InvoiceReason as N, Metadata as Nt, FeatureType as O, GracePeriodDays as Ot, InvoiceStatus as P, MobilePrefix as Pt, RESET_FREQUENCIES as Q, Payment as R, VENEZUELAN_BANKS as Rt, CustomerSession as S, BILLING_MONTHS as St, FEATURE_TYPES as T, CURRENCIES as Tt, PaymentStatus as U, ENVIRONMENTS as Ut, PaymentLink as V, isMobilePhone as Vt, Payout as W, Environment as Wt, ProductCategory as X, Product as Y, ProductVariant as Z, CurrencyAvailability as _, PAYMENT_FAILURE_CODES as _t, Actor as a, SUBSCRIPTION_STATUSES as at, CustomerDetails as b, Address as bt, BalanceAmount as c, SubscriptionRenewal as ct, CancellationFeedback as d, WebhookEndpoint as dt, Refund as et, Checkout as f, Weekday as ft, Coupon as g, ApiErrorType as gt, CollectSettings as h, ApiErrorEnvelope as ht, WebhookEvent as i, SUBMIT_LABELS as it, INVOICE_STATUSES as j, MAX_QUANTITY as jt, FeatureUsageResult as k, List as kt, CANCELLATION_FEEDBACK as l, SubscriptionStatus as lt, CheckoutPurpose as m, ApiErrorBody as mt, EventDataMap as n, Retirement as nt, AfterCompletion as o, SubmitLabel as ot, CheckoutItem as p, API_ERROR_TYPES as pt, PlanPrice as q, tokenPrefix as qt, EventType as r, RiskLevel as rt, Balance as s, Subscription as st, EVENT_TYPES as t, ResetFrequency as tt, CHECKOUT_PURPOSES as u, USAGE_FEATURE_TYPES as ut, CustomField as v, PaymentFailureCode as vt, ExchangeRate as w, BillingMonths as wt, CustomerFeature as x, AddressInput as xt, Customer as y, ACCOUNT_NUMBER_LENGTH as yt, PaymentAttempt as z, findBank 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 = "0.
|
|
21
|
+
const SDK_VERSION = "1.0.0-canary.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 RISK_LEVELS, A as INVOICE_REASONS, At as
|
|
2
|
-
import { $ as PaymentTestScenario, A as PlanCreate, B as RefundCreate, C as FeatureUpdate, D as PaymentLinkCreate, E as KEY_PATTERN, F as PortalSessionCreate, G as VariantInput, H as SubscriptionCancel, I as ProductCheckoutCreate, J as CustomerSubscription, K as WebhookEndpointCreate, L as ProductCreate, M as PlanLinkCreate, N as PlanPriceInput, O as PaymentLinkUpdate, P as PlanUpdate, Q as PaymentNextAction, R as ProductLinkCreate, S as FeatureCreate, T as InvoiceLineInput, U as SubscriptionCreate, V as RetireInput, W as SubscriptionUpdate, X as PaymentMethodField, Y as PaymentInstructions, Z as PaymentMethodOption, _ as CustomerCreate, a as CheckoutCreate, at as PublicPortal, b as CustomerUpdate, c as ClientCheckoutUpdate, d as ClientSubscriptionCancel, et as PortalFeatures, f as ClientSubscriptionUpdate, g as CustomFieldInput, h as CouponUpdate, i as AfterCompletionInput, it as PublicPaymentState, j as PlanFeaturesInput, k as PlanCheckoutCreate, l as ClientInvoicePay, m as CouponCreate, n as RequestOptions, nt as PublicInvoice, o as CheckoutItemInput, p as CollectInput, q as WebhookEndpointUpdate, r as TransportOptions, rt as PublicPaymentLink, s as ClientCheckoutPay, t as BilleteError, tt as PublicCheckout, u as ClientLinkCheckout, v as CustomerInput, w as InvoiceCreate, x as EventSelector, y as CustomerSessionCreate, z as ProductUpdate } from "./errors-
|
|
1
|
+
import { $ as RISK_LEVELS, A as INVOICE_REASONS, At as ListQuery, B as PaymentFailure, Bt as isLandlinePhone, C as Event, Ct as BankCode, D as FeatureReset, Dt as GRACE_PERIOD_DAYS, E as Feature, Et as Currency, F as LineItem, Ft as TAX_BEHAVIORS, G as Plan, Gt as TokenKind, H as PaymentSettlement, Ht as nationalPhone, I as PAYMENT_STATUSES, It as TaxBehavior, J as PortalSession, K as PlanFeatureValues, Kt as tokenEnvironment, L as PRODUCT_CATEGORIES, Lt as Timestamp, M as Invoice, Mt as MOBILE_PREFIXES, N as InvoiceReason, Nt as Metadata, O as FeatureType, Ot as GracePeriodDays, P as InvoiceStatus, Pt as MobilePrefix, Q as RESET_FREQUENCIES, R as Payment, Rt as VENEZUELAN_BANKS, S as CustomerSession, St as BILLING_MONTHS, T as FEATURE_TYPES, Tt as CURRENCIES, U as PaymentStatus, Ut as ENVIRONMENTS, V as PaymentLink, Vt as isMobilePhone, W as Payout, Wt as Environment, X as ProductCategory, Y as Product, Z as ProductVariant, _ as CurrencyAvailability, _t as PAYMENT_FAILURE_CODES, a as Actor, at as SUBSCRIPTION_STATUSES, b as CustomerDetails, bt as Address, c as BalanceAmount, ct as SubscriptionRenewal, d as CancellationFeedback, dt as WebhookEndpoint, et as Refund, f as Checkout, ft as Weekday, g as Coupon, gt as ApiErrorType, h as CollectSettings, ht as ApiErrorEnvelope, i as WebhookEvent, it as SUBMIT_LABELS, j as INVOICE_STATUSES, jt as MAX_QUANTITY, k as FeatureUsageResult, kt as List, l as CANCELLATION_FEEDBACK, lt as SubscriptionStatus, m as CheckoutPurpose, mt as ApiErrorBody, n as EventDataMap, nt as Retirement, o as AfterCompletion, ot as SubmitLabel, p as CheckoutItem, pt as API_ERROR_TYPES, q as PlanPrice, qt as tokenPrefix, r as EventType, rt as RiskLevel, s as Balance, st as Subscription, t as EVENT_TYPES, tt as ResetFrequency, u as CHECKOUT_PURPOSES, ut as USAGE_FEATURE_TYPES, v as CustomField, vt as PaymentFailureCode, w as ExchangeRate, wt as BillingMonths, x as CustomerFeature, xt as AddressInput, y as Customer, yt as ACCOUNT_NUMBER_LENGTH, z as PaymentAttempt, zt as findBank } from "./events-IdoR4Qfi.js";
|
|
2
|
+
import { $ as PaymentTestScenario, A as PlanCreate, B as RefundCreate, C as FeatureUpdate, D as PaymentLinkCreate, E as KEY_PATTERN, F as PortalSessionCreate, G as VariantInput, H as SubscriptionCancel, I as ProductCheckoutCreate, J as CustomerSubscription, K as WebhookEndpointCreate, L as ProductCreate, M as PlanLinkCreate, N as PlanPriceInput, O as PaymentLinkUpdate, P as PlanUpdate, Q as PaymentNextAction, R as ProductLinkCreate, S as FeatureCreate, T as InvoiceLineInput, U as SubscriptionCreate, V as RetireInput, W as SubscriptionUpdate, X as PaymentMethodField, Y as PaymentInstructions, Z as PaymentMethodOption, _ as CustomerCreate, a as CheckoutCreate, at as PublicPortal, b as CustomerUpdate, c as ClientCheckoutUpdate, d as ClientSubscriptionCancel, et as PortalFeatures, f as ClientSubscriptionUpdate, g as CustomFieldInput, h as CouponUpdate, i as AfterCompletionInput, it as PublicPaymentState, j as PlanFeaturesInput, k as PlanCheckoutCreate, l as ClientInvoicePay, m as CouponCreate, n as RequestOptions, nt as PublicInvoice, o as CheckoutItemInput, p as CollectInput, q as WebhookEndpointUpdate, r as TransportOptions, rt as PublicPaymentLink, s as ClientCheckoutPay, t as BilleteError, tt as PublicCheckout, u as ClientLinkCheckout, v as CustomerInput, w as InvoiceCreate, x as EventSelector, y as CustomerSessionCreate, z as ProductUpdate } from "./errors-BWbGS6Bf.js";
|
|
3
3
|
import { WebhookVerificationError, verifyWebhook } from "./webhooks.js";
|
|
4
4
|
//#region src/server.d.ts
|
|
5
5
|
type Filters<T> = ListQuery & T;
|
|
@@ -29,10 +29,12 @@ export declare function createBillete(options: BilleteOptions): {
|
|
|
29
29
|
update: (id: string, input: CustomerUpdate, options?: RequestOptions) => Promise<Customer>;
|
|
30
30
|
list: (query?: Filters<{
|
|
31
31
|
email?: string;
|
|
32
|
+
search?: string;
|
|
32
33
|
}>, options?: RequestOptions) => Promise<List<Customer>>;
|
|
33
34
|
/** Iterates every item across pages: `for await (const item of iterate())`. */
|
|
34
35
|
iterate: (query?: Filters<{
|
|
35
36
|
email?: string;
|
|
37
|
+
search?: string;
|
|
36
38
|
}>) => AsyncGenerator<Customer, any, any>;
|
|
37
39
|
};
|
|
38
40
|
customerSessions: {
|
|
@@ -213,4 +215,4 @@ export declare function createBillete(options: BilleteOptions): {
|
|
|
213
215
|
/** The server client: what `createBillete` returns. */
|
|
214
216
|
type Billete = ReturnType<typeof createBillete>;
|
|
215
217
|
//#endregion
|
|
216
|
-
export { type API_ERROR_TYPES, type Actor, type Address, type AddressInput, type AfterCompletion, type AfterCompletionInput, type ApiErrorBody, type ApiErrorEnvelope, type ApiErrorType, type BILLING_MONTHS, type Balance, type BalanceAmount, type Billete, BilleteError, type BilleteOptions, type BillingMonths, type CANCELLATION_FEEDBACK, type CHECKOUT_PURPOSES, type CURRENCIES, type CancellationFeedback, type Checkout, type CheckoutCreate, type CheckoutItem, type CheckoutItemInput, type CheckoutPurpose, type ClientCheckoutPay, type ClientCheckoutUpdate, type ClientInvoicePay, type ClientLinkCheckout, type ClientSubscriptionCancel, 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 CustomerSession, type CustomerSessionCreate, type CustomerSubscription, type CustomerUpdate, type ENVIRONMENTS, type EVENT_TYPES, type Environment, type Event, type EventDataMap, type EventSelector, type EventType, type ExchangeRate, type FEATURE_TYPES, type Feature, type FeatureCreate, type FeatureReset, type FeatureType, type FeatureUpdate, type FeatureUsageResult, 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 LineItem, type List, type ListQuery, type MAX_QUANTITY, 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 PlanUpdate, type PortalFeatures, type PortalSession, type PortalSessionCreate, type Product, type ProductCategory, type ProductCheckoutCreate, type ProductCreate, type ProductLinkCreate, type ProductUpdate, type ProductVariant, type PublicCheckout, type PublicInvoice, type PublicPaymentLink, type PublicPaymentState, type PublicPortal, type RESET_FREQUENCIES, type RISK_LEVELS, 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 SubscriptionCreate, type SubscriptionRenewal, type SubscriptionStatus, type SubscriptionUpdate, type TAX_BEHAVIORS, type TaxBehavior, type Timestamp, type TokenKind, type TransportOptions, type USAGE_FEATURE_TYPES, type VariantInput, type WebhookEndpoint, type WebhookEndpointCreate, type WebhookEndpointUpdate, type WebhookEvent, WebhookVerificationError, type Weekday, type isLandlinePhone, type isMobilePhone, type nationalPhone, type tokenEnvironment, type tokenPrefix, verifyWebhook };
|
|
218
|
+
export { type ACCOUNT_NUMBER_LENGTH, type API_ERROR_TYPES, type Actor, type Address, type AddressInput, type AfterCompletion, type AfterCompletionInput, type ApiErrorBody, type ApiErrorEnvelope, type ApiErrorType, type BILLING_MONTHS, type Balance, type BalanceAmount, type BankCode, type Billete, BilleteError, type BilleteOptions, type BillingMonths, type CANCELLATION_FEEDBACK, type CHECKOUT_PURPOSES, type CURRENCIES, type CancellationFeedback, type Checkout, type CheckoutCreate, type CheckoutItem, type CheckoutItemInput, type CheckoutPurpose, type ClientCheckoutPay, type ClientCheckoutUpdate, type ClientInvoicePay, type ClientLinkCheckout, type ClientSubscriptionCancel, 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 CustomerSession, type CustomerSessionCreate, type CustomerSubscription, type CustomerUpdate, type ENVIRONMENTS, type EVENT_TYPES, type Environment, type Event, type EventDataMap, type EventSelector, type EventType, type ExchangeRate, type FEATURE_TYPES, type Feature, type FeatureCreate, type FeatureReset, type FeatureType, type FeatureUpdate, type FeatureUsageResult, 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 LineItem, type List, type ListQuery, type MAX_QUANTITY, 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 PlanUpdate, type PortalFeatures, type PortalSession, type PortalSessionCreate, type Product, type ProductCategory, type ProductCheckoutCreate, type ProductCreate, type ProductLinkCreate, type ProductUpdate, type ProductVariant, type PublicCheckout, type PublicInvoice, type PublicPaymentLink, type PublicPaymentState, type PublicPortal, type RESET_FREQUENCIES, type RISK_LEVELS, 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 SubscriptionCreate, type SubscriptionRenewal, type SubscriptionStatus, 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 findBank, type isLandlinePhone, type isMobilePhone, type nationalPhone, 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-BRltPxje.js";
|
|
2
2
|
import { WebhookVerificationError, verifyWebhook } from "./webhooks.js";
|
|
3
3
|
//#region ../contracts/src/environment.ts
|
|
4
4
|
/**
|
package/dist/webhooks.d.ts
CHANGED