@boelabs/billete-sdk 6.0.0 → 6.1.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/dist/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as ProductCheckoutCreate, A as CustomerUpdate, At as PublicPaymentState, B as InvoiceCreate, Bt as apiVersionLifecycle, C as CouponUpdate, Ct as PublicCheckout, D as CustomerMemberCreate, Dt as PublicFulfillment, E as CustomerInput, Et as PublicClaimSummary, F as FeatureUpdate, Ft as ApiVersion, G as PlanCheckoutCreate, Gt as supportedApiVersions, H as KEY_PATTERN, Ht as currentApiVersion, I as FulfillmentDeliverInput, It as ApiVersionLifecycle, J as PlanFeaturesInput, K as PlanCouponCreate, L as FulfillmentHandoverInput, Lt as ApiVersionStage, M as FeatureCreate, Mt as API_VERSIONS, N as FeatureOperationCommit, Nt as API_VERSION_HEADER, O as CustomerMemberUpdate, Ot as PublicInvoice, P as FeatureOperationCreate, Pt as API_VERSION_PATTERN, Q as PortalSessionCreate, R as FulfillmentInput, Rt as LATEST_API_VERSION, S as CouponCreate, St as PortalFeatures, T as CustomerCreate, Tt as PublicClaim, U as PaymentLinkCreate, Ut as isApiVersion, V as InvoiceLineInput, Vt as apiVersionStage, W as PaymentLinkUpdate, Wt as isApiVersionRetired, X as PlanPriceInput, Y as PlanLinkCreate, Z as PlanUpdate, _ as ClientPaymentCode, _t as PaymentInstructions, a as AfterCompletionInput, at as RetireInput, b as ClientSubscriptionUpdate, bt as PaymentNextAction, c as ClaimResolve, ct as SubscriptionChangePreviewInput, d as ClientCheckoutUpdate, dt as VariantInput, et as ProductCouponCreate, f as ClientClaimCreate, ft as WebhookEndpointCreate, g as ClientLinkCheckout, gt as FulfillmentOption, h as ClientInvoicePay, ht as CustomerSubscriptionChangeResult, i as TransportOptions, it as RefundCreate, j as EventSelector, jt as PublicPortal, k as CustomerSessionCreate, kt as PublicPaymentLink, l as ClaimRespond, lt as SubscriptionCreate, m as ClientFulfillmentProblem, mt as CustomerSubscription, n as BilleteErrorCode, nt as ProductLinkCreate, o as CheckoutCreate, ot as SubscriptionCancel, p as ClientCustomerClaimCreate, pt as WebhookEndpointUpdate, q as PlanCreate, r as RequestOptions, rt as ProductUpdate, s as CheckoutItemInput, st as SubscriptionChangeCreate, t as BilleteError, tt as ProductCreate, u as ClientCheckoutPay, ut as SubscriptionUpdate, v as ClientSubscriptionCancel, vt as PaymentMethodField, w as CustomFieldInput, wt as PublicCheckoutItem, x as CollectInput, xt as PaymentTestScenario, y as ClientSubscriptionSeats, yt as PaymentMethodOption, z as FulfillmentTrackingInput, zt as LatestApiVersion } from "./errors-DuKEl7b6.js";
1
+ import { $ as ProductCheckoutCreate, A as CustomerUpdate, At as PublicPaymentState, B as InvoiceCreate, Bt as apiVersionLifecycle, C as CouponUpdate, Ct as PublicCheckout, D as CustomerMemberCreate, Dt as PublicFulfillment, E as CustomerInput, Et as PublicClaimSummary, F as FeatureUpdate, Ft as ApiVersion, G as PlanCheckoutCreate, Gt as supportedApiVersions, H as KEY_PATTERN, Ht as currentApiVersion, I as FulfillmentDeliverInput, It as ApiVersionLifecycle, J as PlanFeaturesInput, K as PlanCouponCreate, L as FulfillmentHandoverInput, Lt as ApiVersionStage, M as FeatureCreate, Mt as API_VERSIONS, N as FeatureOperationCommit, Nt as API_VERSION_HEADER, O as CustomerMemberUpdate, Ot as PublicInvoice, P as FeatureOperationCreate, Pt as API_VERSION_PATTERN, Q as PortalSessionCreate, R as FulfillmentInput, Rt as LATEST_API_VERSION, S as CouponCreate, St as PortalFeatures, T as CustomerCreate, Tt as PublicClaim, U as PaymentLinkCreate, Ut as isApiVersion, V as InvoiceLineInput, Vt as apiVersionStage, W as PaymentLinkUpdate, Wt as isApiVersionRetired, X as PlanPriceInput, Y as PlanLinkCreate, Z as PlanUpdate, _ as ClientPaymentCode, _t as PaymentInstructions, a as AfterCompletionInput, at as RetireInput, b as ClientSubscriptionUpdate, bt as PaymentNextAction, c as ClaimResolve, ct as SubscriptionChangePreviewInput, d as ClientCheckoutUpdate, dt as VariantInput, et as ProductCouponCreate, f as ClientClaimCreate, ft as WebhookEndpointCreate, g as ClientLinkCheckout, gt as FulfillmentOption, h as ClientInvoicePay, ht as CustomerSubscriptionChangeResult, i as TransportOptions, it as RefundCreate, j as EventSelector, jt as PublicPortal, k as CustomerSessionCreate, kt as PublicPaymentLink, l as ClaimRespond, lt as SubscriptionCreate, m as ClientFulfillmentProblem, mt as CustomerSubscription, n as BilleteErrorCode, nt as ProductLinkCreate, o as CheckoutCreate, ot as SubscriptionCancel, p as ClientCustomerClaimCreate, pt as WebhookEndpointUpdate, q as PlanCreate, r as RequestOptions, rt as ProductUpdate, s as CheckoutItemInput, st as SubscriptionChangeCreate, t as BilleteError, tt as ProductCreate, u as ClientCheckoutPay, ut as SubscriptionUpdate, v as ClientSubscriptionCancel, vt as PaymentMethodField, w as CustomFieldInput, wt as PublicCheckoutItem, x as CollectInput, xt as PaymentTestScenario, y as ClientSubscriptionSeats, yt as PaymentMethodOption, z as FulfillmentTrackingInput, zt as LatestApiVersion } from "./errors-DYVtvVCW.js";
2
2
  import { $ as FulfillmentMethod, $t as PaymentFailureCode, A as Coupon, An as tokenEnvironment, At as ResetFrequency, B as ExchangeRate, Bt as SubscriptionRenewal, C as CheckoutPurpose, Cn as findBank, Ct as PortalSession, D as ClaimReason, Dn as ENVIRONMENTS, Dt as RESET_FREQUENCIES, E as ClaimOutcome, En as nationalPhone, Et as ProductVariant, F as CustomerFeature, Ft as SubmitLabel, G as FeatureOperation, Gt as Weekday, H as FULFILLMENT_METHODS, Ht as SubscriptionTerms, I as CustomerMember, It as Subscription, J as FeatureType, Jt as API_ERROR_TYPES, K as FeatureOperationResult, Kt as ReceiptReference, L as CustomerMemberList, Lt as SubscriptionChange, M as CustomField, Mt as RiskLevel, N as Customer, Nt as SUBMIT_LABELS, O as ClaimStatus, On as Environment, Ot as RISK_LEVELS, P as CustomerDetails, Pt as SUBSCRIPTION_STATUSES, Q as FulfillmentHandover, Qt as PAYMENT_FAILURE_CODES, R as CustomerSession, Rt as SubscriptionChangePreview, S as CheckoutItem, Sn as VENEZUELAN_BANKS, St as PlanSeats, T as ClaimMessage, Tn as isMobilePhone, Tt as ProductCategory, U as FULFILLMENT_STATUSES, Ut as USAGE_FEATURE_TYPES, V as FEATURE_TYPES, Vt as SubscriptionStatus, W as Feature, Wt as WebhookEndpoint, X as Fulfillment, Xt as ApiErrorEnvelope, Y as FeatureUsageResult, Yt as ApiErrorBody, Z as FulfillmentChoice, Zt as ApiErrorType, _ as CLAIM_STATUSES, _n as Metadata, _t as PaymentStatus, a as WEBHOOK_TEST_EVENT, an as BILLING_MONTHS, at as InvoiceReason, b as CarrierOffice, bn as TaxBehavior, bt as PlanFeatureValues, c as AfterCompletion, cn as CURRENCIES, ct as MAX_SEATS, d as CANCELLATION_FEEDBACK, dn as GracePeriodDays, dt as Payment, en as API_ERROR_CODES, et as FulfillmentStatus, f as CARRIERS, fn as List, ft as PaymentAttempt, g as CLAIM_REASONS, gn as MOBILE_PREFIXES, gt as PaymentSettlement, h as CLAIM_OUTCOMES, hn as MAX_QUANTITY, ht as PaymentLink, i as SubscribableEventType, in as AddressInput, it as Invoice, j as CurrencyAvailability, jn as tokenPrefix, jt as Retirement, k as CollectSettings, kn as TokenKind, kt as Refund, l as Balance, ln as Currency, lt as PAYMENT_STATUSES, m as CHECKOUT_PURPOSES, mn as ListSort, mt as PaymentFeeDetails, n as EventDataMap, nn as ACCOUNT_NUMBER_LENGTH, nt as INVOICE_REASONS, o as WebhookEvent, on as BankCode, ot as InvoiceStatus, p as CARRIER_TEST_SCENARIOS, pn as ListQuery, pt as PaymentFailure, q as FeatureReset, qt as ReceiptSend, r as EventType, rn as Address, rt as INVOICE_STATUSES, s as Actor, sn as BillingMonths, st as LineItem, t as EVENT_TYPES, tn as ApiErrorCode, tt as FulfillmentTracking, u as BalanceAmount, un as GRACE_PERIOD_DAYS, ut as PRODUCT_CATEGORIES, v as CancellationFeedback, vn as MobilePrefix, vt as Payout, w as Claim, wn as isLandlinePhone, wt as Product, x as Checkout, xn as Timestamp, xt as PlanPrice, y as Carrier, yn as TAX_BEHAVIORS, yt as Plan, z as Event, zt as SubscriptionChangeResult } from "./events-DCYMRhVr.js";
3
3
  //#region src/create-client.d.ts
4
4
  interface ClientOptions extends TransportOptions {
package/dist/client.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as segment, r as BilleteError, t as createTransport } from "./http-CjvNSEg5.js";
1
+ import { n as segment, r as BilleteError, t as createTransport } from "./http-BXhZoczC.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
@@ -742,6 +742,11 @@ interface SubscriptionChangeCreate extends SubscriptionChangePreviewInput {
742
742
  interface SubscriptionCancel {
743
743
  /** `false` ends the subscription immediately. */
744
744
  atPeriodEnd?: boolean;
745
+ /**
746
+ * `false` ends it instead of moving it to its plan's free fallback. Only with
747
+ * `atPeriodEnd: false`.
748
+ */
749
+ fallback?: boolean;
745
750
  feedback?: CancellationFeedback;
746
751
  comment?: string;
747
752
  }
@@ -18,7 +18,7 @@ var BilleteError = class extends Error {
18
18
  };
19
19
  //#endregion
20
20
  //#region src/http.ts
21
- const SDK_VERSION = "6.0.0";
21
+ const SDK_VERSION = "6.1.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,4 +1,4 @@
1
- import { $ as ProductCheckoutCreate, A as CustomerUpdate, At as PublicPaymentState, B as InvoiceCreate, Bt as apiVersionLifecycle, C as CouponUpdate, Ct as PublicCheckout, D as CustomerMemberCreate, Dt as PublicFulfillment, E as CustomerInput, Et as PublicClaimSummary, F as FeatureUpdate, Ft as ApiVersion, G as PlanCheckoutCreate, Gt as supportedApiVersions, H as KEY_PATTERN, Ht as currentApiVersion, I as FulfillmentDeliverInput, It as ApiVersionLifecycle, J as PlanFeaturesInput, K as PlanCouponCreate, L as FulfillmentHandoverInput, Lt as ApiVersionStage, M as FeatureCreate, Mt as API_VERSIONS, N as FeatureOperationCommit, Nt as API_VERSION_HEADER, O as CustomerMemberUpdate, Ot as PublicInvoice, P as FeatureOperationCreate, Pt as API_VERSION_PATTERN, Q as PortalSessionCreate, R as FulfillmentInput, Rt as LATEST_API_VERSION, S as CouponCreate, St as PortalFeatures, T as CustomerCreate, Tt as PublicClaim, U as PaymentLinkCreate, Ut as isApiVersion, V as InvoiceLineInput, Vt as apiVersionStage, W as PaymentLinkUpdate, Wt as isApiVersionRetired, X as PlanPriceInput, Y as PlanLinkCreate, Z as PlanUpdate, _ as ClientPaymentCode, _t as PaymentInstructions, a as AfterCompletionInput, at as RetireInput, b as ClientSubscriptionUpdate, bt as PaymentNextAction, c as ClaimResolve, ct as SubscriptionChangePreviewInput, d as ClientCheckoutUpdate, dt as VariantInput, et as ProductCouponCreate, f as ClientClaimCreate, ft as WebhookEndpointCreate, g as ClientLinkCheckout, gt as FulfillmentOption, h as ClientInvoicePay, ht as CustomerSubscriptionChangeResult, i as TransportOptions, it as RefundCreate, j as EventSelector, jt as PublicPortal, k as CustomerSessionCreate, kt as PublicPaymentLink, l as ClaimRespond, lt as SubscriptionCreate, m as ClientFulfillmentProblem, mt as CustomerSubscription, n as BilleteErrorCode, nt as ProductLinkCreate, o as CheckoutCreate, ot as SubscriptionCancel, p as ClientCustomerClaimCreate, pt as WebhookEndpointUpdate, q as PlanCreate, r as RequestOptions, rt as ProductUpdate, s as CheckoutItemInput, st as SubscriptionChangeCreate, t as BilleteError, tt as ProductCreate, u as ClientCheckoutPay, ut as SubscriptionUpdate, v as ClientSubscriptionCancel, vt as PaymentMethodField, w as CustomFieldInput, wt as PublicCheckoutItem, x as CollectInput, xt as PaymentTestScenario, y as ClientSubscriptionSeats, yt as PaymentMethodOption, z as FulfillmentTrackingInput, zt as LatestApiVersion } from "./errors-DuKEl7b6.js";
1
+ import { $ as ProductCheckoutCreate, A as CustomerUpdate, At as PublicPaymentState, B as InvoiceCreate, Bt as apiVersionLifecycle, C as CouponUpdate, Ct as PublicCheckout, D as CustomerMemberCreate, Dt as PublicFulfillment, E as CustomerInput, Et as PublicClaimSummary, F as FeatureUpdate, Ft as ApiVersion, G as PlanCheckoutCreate, Gt as supportedApiVersions, H as KEY_PATTERN, Ht as currentApiVersion, I as FulfillmentDeliverInput, It as ApiVersionLifecycle, J as PlanFeaturesInput, K as PlanCouponCreate, L as FulfillmentHandoverInput, Lt as ApiVersionStage, M as FeatureCreate, Mt as API_VERSIONS, N as FeatureOperationCommit, Nt as API_VERSION_HEADER, O as CustomerMemberUpdate, Ot as PublicInvoice, P as FeatureOperationCreate, Pt as API_VERSION_PATTERN, Q as PortalSessionCreate, R as FulfillmentInput, Rt as LATEST_API_VERSION, S as CouponCreate, St as PortalFeatures, T as CustomerCreate, Tt as PublicClaim, U as PaymentLinkCreate, Ut as isApiVersion, V as InvoiceLineInput, Vt as apiVersionStage, W as PaymentLinkUpdate, Wt as isApiVersionRetired, X as PlanPriceInput, Y as PlanLinkCreate, Z as PlanUpdate, _ as ClientPaymentCode, _t as PaymentInstructions, a as AfterCompletionInput, at as RetireInput, b as ClientSubscriptionUpdate, bt as PaymentNextAction, c as ClaimResolve, ct as SubscriptionChangePreviewInput, d as ClientCheckoutUpdate, dt as VariantInput, et as ProductCouponCreate, f as ClientClaimCreate, ft as WebhookEndpointCreate, g as ClientLinkCheckout, gt as FulfillmentOption, h as ClientInvoicePay, ht as CustomerSubscriptionChangeResult, i as TransportOptions, it as RefundCreate, j as EventSelector, jt as PublicPortal, k as CustomerSessionCreate, kt as PublicPaymentLink, l as ClaimRespond, lt as SubscriptionCreate, m as ClientFulfillmentProblem, mt as CustomerSubscription, n as BilleteErrorCode, nt as ProductLinkCreate, o as CheckoutCreate, ot as SubscriptionCancel, p as ClientCustomerClaimCreate, pt as WebhookEndpointUpdate, q as PlanCreate, r as RequestOptions, rt as ProductUpdate, s as CheckoutItemInput, st as SubscriptionChangeCreate, t as BilleteError, tt as ProductCreate, u as ClientCheckoutPay, ut as SubscriptionUpdate, v as ClientSubscriptionCancel, vt as PaymentMethodField, w as CustomFieldInput, wt as PublicCheckoutItem, x as CollectInput, xt as PaymentTestScenario, y as ClientSubscriptionSeats, yt as PaymentMethodOption, z as FulfillmentTrackingInput, zt as LatestApiVersion } from "./errors-DYVtvVCW.js";
2
2
  import { $ as FulfillmentMethod, $t as PaymentFailureCode, A as Coupon, An as tokenEnvironment, At as ResetFrequency, B as ExchangeRate, Bt as SubscriptionRenewal, C as CheckoutPurpose, Cn as findBank, Ct as PortalSession, D as ClaimReason, Dn as ENVIRONMENTS, Dt as RESET_FREQUENCIES, E as ClaimOutcome, En as nationalPhone, Et as ProductVariant, F as CustomerFeature, Ft as SubmitLabel, G as FeatureOperation, Gt as Weekday, H as FULFILLMENT_METHODS, Ht as SubscriptionTerms, I as CustomerMember, It as Subscription, J as FeatureType, Jt as API_ERROR_TYPES, K as FeatureOperationResult, Kt as ReceiptReference, L as CustomerMemberList, Lt as SubscriptionChange, M as CustomField, Mt as RiskLevel, N as Customer, Nt as SUBMIT_LABELS, O as ClaimStatus, On as Environment, Ot as RISK_LEVELS, P as CustomerDetails, Pt as SUBSCRIPTION_STATUSES, Q as FulfillmentHandover, Qt as PAYMENT_FAILURE_CODES, R as CustomerSession, Rt as SubscriptionChangePreview, S as CheckoutItem, Sn as VENEZUELAN_BANKS, St as PlanSeats, T as ClaimMessage, Tn as isMobilePhone, Tt as ProductCategory, U as FULFILLMENT_STATUSES, Ut as USAGE_FEATURE_TYPES, V as FEATURE_TYPES, Vt as SubscriptionStatus, W as Feature, Wt as WebhookEndpoint, X as Fulfillment, Xt as ApiErrorEnvelope, Y as FeatureUsageResult, Yt as ApiErrorBody, Z as FulfillmentChoice, Zt as ApiErrorType, _ as CLAIM_STATUSES, _n as Metadata, _t as PaymentStatus, a as WEBHOOK_TEST_EVENT, an as BILLING_MONTHS, at as InvoiceReason, b as CarrierOffice, bn as TaxBehavior, bt as PlanFeatureValues, c as AfterCompletion, cn as CURRENCIES, ct as MAX_SEATS, d as CANCELLATION_FEEDBACK, dn as GracePeriodDays, dt as Payment, en as API_ERROR_CODES, et as FulfillmentStatus, f as CARRIERS, fn as List, ft as PaymentAttempt, g as CLAIM_REASONS, gn as MOBILE_PREFIXES, gt as PaymentSettlement, h as CLAIM_OUTCOMES, hn as MAX_QUANTITY, ht as PaymentLink, i as SubscribableEventType, in as AddressInput, it as Invoice, j as CurrencyAvailability, jn as tokenPrefix, jt as Retirement, k as CollectSettings, kn as TokenKind, kt as Refund, l as Balance, ln as Currency, lt as PAYMENT_STATUSES, m as CHECKOUT_PURPOSES, mn as ListSort, mt as PaymentFeeDetails, n as EventDataMap, nn as ACCOUNT_NUMBER_LENGTH, nt as INVOICE_REASONS, o as WebhookEvent, on as BankCode, ot as InvoiceStatus, p as CARRIER_TEST_SCENARIOS, pn as ListQuery, pt as PaymentFailure, q as FeatureReset, qt as ReceiptSend, r as EventType, rn as Address, rt as INVOICE_STATUSES, s as Actor, sn as BillingMonths, st as LineItem, t as EVENT_TYPES, tn as ApiErrorCode, tt as FulfillmentTracking, u as BalanceAmount, un as GRACE_PERIOD_DAYS, ut as PRODUCT_CATEGORIES, v as CancellationFeedback, vn as MobilePrefix, vt as Payout, w as Claim, wn as isLandlinePhone, wt as Product, x as Checkout, xn as Timestamp, xt as PlanPrice, y as Carrier, yn as TAX_BEHAVIORS, yt as Plan, z as Event, zt as SubscriptionChangeResult } from "./events-DCYMRhVr.js";
3
3
  import { WebhookVerificationError, verifyWebhook } from "./webhooks.js";
4
4
  //#region src/server.d.ts
@@ -240,7 +240,8 @@ export declare function createBillete(options: BilleteOptions): {
240
240
  };
241
241
  /**
242
242
  * Cancels at period end by default; pass `{ atPeriodEnd: false }` to end it now. With a
243
- * fallback plan it moves to that free plan instead (`subscription.updated`), keeping its ID.
243
+ * fallback plan it moves to that free plan instead (`subscription.updated`), keeping its ID,
244
+ * unless you also pass `fallback: false`.
244
245
  */
245
246
  cancel: (id: string, input?: SubscriptionCancel, options?: RequestOptions) => Promise<Subscription>;
246
247
  resume: (id: string, options?: RequestOptions) => Promise<Subscription>;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as segment, r as BilleteError, t as createTransport } from "./http-CjvNSEg5.js";
1
+ import { n as segment, r as BilleteError, t as createTransport } from "./http-BXhZoczC.js";
2
2
  import { WebhookVerificationError, verifyWebhook } from "./webhooks.js";
3
3
  //#region ../contracts/src/environment.ts
4
4
  /**
@@ -317,7 +317,8 @@ create: (input, options) => http.request({
317
317
  },
318
318
  /**
319
319
  * Cancels at period end by default; pass `{ atPeriodEnd: false }` to end it now. With a
320
- * fallback plan it moves to that free plan instead (`subscription.updated`), keeping its ID.
320
+ * fallback plan it moves to that free plan instead (`subscription.updated`), keeping its ID,
321
+ * unless you also pass `fallback: false`.
321
322
  */
322
323
  cancel: (id, input = {}, options) => http.request({
323
324
  method: "POST",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boelabs/billete-sdk",
3
- "version": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "description": "Billete SDK: server client, browser client and webhook verification",
5
5
  "keywords": [
6
6
  "billete",