@openrails/billing-ui 0.238.0 → 0.239.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/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## Public products and staff route groups
4
+
5
+ - Breaking: public `listProducts()` now reads `GET /products`. Catalog
6
+ management uses `/catalog`, merchant configuration `/merchant`, and metrics
7
+ `/metrics`; customer support stays under `/admin`.
8
+
9
+ ## Provider operations removed
10
+
11
+ - Breaking: `OpenRailsErrorCode` and `OPENRAILS_ERROR_CODES` lose
12
+ `provider_operation_not_found`, `provider_operation_conflict`,
13
+ `provider_operation_not_open`, `provider_operation_has_billing_evidence`,
14
+ `provider_operation_refused`, `provider_operation_not_refused` and
15
+ `provider_billing_observation_conflict`.
16
+
17
+ ## Usage report
18
+
19
+ - `getUsage({ currency, groupBy, from, to, limit, cursor })` reads a page of
20
+ the customer's usage (`GET /me/usage`): `Usage`, its `rows` by total
21
+ amount, largest first, and `next_cursor` (null on the last page). A page
22
+ holds at most 1,000 groups (default 100); a cursor reads only the report it
23
+ came from.
24
+
3
25
  ## Public reads name their merchant; token source
4
26
 
5
27
  - Breaking: `listProducts({ merchant, keys })`, `useProducts({ merchant, keys
package/README.md CHANGED
@@ -180,7 +180,7 @@ no bearer.
180
180
 
181
181
  | Call | Route |
182
182
  | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
183
- | `listProducts({ merchant, keys })`: the products `merchant` (its id) has on sale named by `keys` (1 to 100 product keys), each with its prices, in one page; `useProducts` reads the same | `GET /catalog/products` |
183
+ | `listProducts({ merchant, keys })`: the products `merchant` (its id) has on sale named by `keys` (1 to 100 product keys), each with its prices, in one page; `useProducts` reads the same | `GET /products` |
184
184
  | `getConfig()` (capabilities, `currencies`, `captcha`; `client.currencies` is the pinned registry) | `GET /config` |
185
185
  | `getCustomerConfig()` (the customer's merchant: `payment` with PSPs, `solana.network` and tokens, and `merchant`, its name) | `GET /me/config` |
186
186
  | `previewSubscriptionChange(id, { priceId?, quantity? })` | `POST /me/subscriptions/{id}/change/preview` |
@@ -288,3 +288,7 @@ pnpm contract:check # fail if a generated contract file is stale
288
288
  `BILLING_UI_SCREENSHOTS=<dir>` to capture light, dark and mobile screenshots.
289
289
  Card deletion calls NMI, which the harness has no credentials for; jsdom tests
290
290
  cover it.
291
+
292
+ ## License
293
+
294
+ MIT; see [LICENSE](LICENSE). Only this package is MIT: the rest of the OpenRails repository is under the Functional Source License (FSL-1.1-ALv2).
@@ -1,5 +1,5 @@
1
1
  import { BillingError } from './errors';
2
- import { Account, CustomerConfig, CustomerLink, NetworkLinkChallenge, PublicConfig, CurrencyScales, ListPage, NewCard, NextAction, Cart, Order, OrderPaymentInput, Page, Payment, PaymentMethod, Product, Subscription, SubscriptionChange, SubscriptionChangePreview } from './types';
2
+ import { Account, CustomerConfig, CustomerLink, NetworkLinkChallenge, PublicConfig, CurrencyScales, ListPage, NewCard, NextAction, Cart, Order, OrderPaymentInput, Page, Payment, PaymentMethod, Product, Subscription, SubscriptionChange, SubscriptionChangePreview, Usage } from './types';
3
3
  export interface BillingClientOptions {
4
4
  /** OpenRails embedded mount. Default "/billing/v1". */
5
5
  baseUrl?: string;
@@ -53,6 +53,18 @@ export interface CursorOptions {
53
53
  cursor?: string | null;
54
54
  signal?: AbortSignal;
55
55
  }
56
+ /**
57
+ * A page of the customer's usage report in `currency`, grouped by `groupBy`
58
+ * (event type by default). `from` and `to` are RFC 3339 or a date; left out,
59
+ * the month before now, or with `cursor` the window of the page it came from.
60
+ * `limit` is at most 1,000 groups (default 100).
61
+ */
62
+ export interface UsageOptions extends CursorOptions {
63
+ currency: string;
64
+ groupBy?: "event_type" | "resource" | "invoker";
65
+ from?: string;
66
+ to?: string;
67
+ }
56
68
  /**
57
69
  * Signs and submits a base64 transaction with the customer's wallet and
58
70
  * returns its signature. Throw `WalletRejectedError` when the user declines.
@@ -212,6 +224,11 @@ export declare function createBillingClient(options?: BillingClientOptions): {
212
224
  * that pays each currency, and unread notices.
213
225
  */
214
226
  getAccount(signal?: AbortSignal): Promise<Account>;
227
+ /**
228
+ * A page of the customer's usage: its groups by total amount, largest
229
+ * first. Pass the answer's `next_cursor` as `cursor` for the next page.
230
+ */
231
+ getUsage(opts: UsageOptions): Promise<Usage>;
215
232
  /**
216
233
  * The products `merchant` has on sale named by `keys`, each with its
217
234
  * current prices: a public read, the same signed in or out. No keys
@@ -1,4 +1,4 @@
1
- export type OpenRailsErrorCode = "admission_captured" | "admission_not_found" | "allowance_meter_not_found" | "allowance_source_in_use" | "allowance_source_invalid" | "already_owned" | "application_required" | "as_of_required" | "authentication_required" | "authentication_unavailable" | "authorization_unavailable" | "billing_archive_integrity" | "billing_archive_invalid_artifact" | "billing_archive_merchant_mismatch" | "billing_archive_not_empty" | "billing_archive_unavailable" | "billing_archive_unsupported_state" | "billing_policy_not_found" | "cancel_unsupported_on_rail" | "captcha_invalid" | "captcha_required" | "card_attempts_blocked" | "card_declined" | "card_not_saved" | "card_requires_https" | "catalog_benefit_overlap" | "catalog_revision_conflict" | "checkout_attempt_closed" | "checkout_attempt_expired" | "checkout_attempts_exhausted" | "checkout_embed_origins_required" | "checkout_expired" | "checkout_not_found" | "credential_expired" | "credential_revoked" | "credit_grant_held" | "credit_grant_not_found" | "credit_grant_unavailable" | "csrf_origin_denied" | "currency_unsupported" | "custodian_capture_unavailable" | "customer_action_required" | "customer_email_required" | "customer_not_found" | "customer_payment_unsupported" | "customer_session_required" | "dashboard_invalid" | "database_busy" | "default_payment_method_invalid" | "default_payment_method_required" | "default_rate_card_not_found" | "default_rate_card_required" | "finding_action_failed" | "finding_not_actionable" | "hold_not_found" | "host_event_not_found" | "host_principal_invalid" | "hosted_checkout_unavailable" | "idempotency_key_in_progress" | "idempotency_key_in_use" | "idempotency_key_required" | "idempotency_key_reused" | "insufficient_credits" | "insufficient_funds" | "internal_error" | "invalid_cursor" | "invalid_customer_id" | "invalid_host_event_request" | "invalid_param" | "invalid_payment_method" | "invalid_psp_reference" | "invalid_query" | "invalid_request_body" | "invalid_settlement_status_request" | "invoker_scoped_principal" | "merchant_binding_mismatch" | "merchant_config_read_only" | "merchant_directory_unavailable" | "merchant_not_found" | "merchant_selector_invalid" | "merchant_unresolved" | "meter_in_use" | "meter_rate_card_conflict" | "method_not_allowed" | "metrics_query_invalid" | "model_unavailable" | "network_account_linked" | "network_link_challenge_invalid" | "network_link_conflict" | "network_link_in_use" | "network_terms_required" | "order_action_not_allowed" | "order_has_recurring_line" | "order_line_unavailable" | "order_not_cancelable" | "order_not_payable" | "order_payment_in_progress" | "order_total_changed" | "payment_duplicate_refused" | "payment_exceeds_due" | "payment_failed" | "payment_idempotency_conflict" | "payment_in_progress" | "payment_method_delete_failed" | "payment_method_delete_unsupported" | "payment_method_not_psp_vaulted" | "payment_method_not_usable" | "payment_method_psp_mismatch" | "payment_method_required" | "payment_method_same_vault" | "payment_method_stale" | "payment_method_update_failed" | "payment_method_update_unsupported" | "payment_not_found" | "payment_not_refundable" | "payment_not_retryable" | "payment_option_unavailable" | "payment_provider_rejected" | "permission_required" | "price_change_currency_mismatch" | "price_change_target_archived" | "price_increase_notice_too_short" | "price_key_cadence_conflict" | "price_key_not_found" | "price_migration_not_found" | "price_not_found" | "price_not_sellable" | "product_not_found" | "product_tier_group_conflict" | "product_tier_group_in_use" | "provider_billing_observation_conflict" | "provider_cancel_held" | "provider_operation_conflict" | "provider_operation_has_billing_evidence" | "provider_operation_not_found" | "provider_operation_not_open" | "provider_operation_not_refused" | "provider_operation_refused" | "provider_outcome_unknown" | "psp_claim_requires_proof" | "psp_credentials_rejected" | "psp_exists" | "psp_key_taken" | "psp_last_active" | "psp_not_found" | "purchase_review_resolved" | "quantity_not_allowed" | "rate_card_currency_mismatch" | "rate_card_has_overrides" | "rate_card_product_not_found" | "rate_limit_exceeded" | "rebill_terms_committed" | "refund_failed" | "refund_rail_unavailable" | "refund_unsupported" | "request_body_too_large" | "resource_access_denied" | "resource_conflict" | "resource_not_found" | "revision_mismatch" | "route_not_found" | "running_charge_not_found" | "scheduled_change_exists" | "service_credential_customer_scope_denied" | "service_unavailable" | "solana_rpc_unavailable" | "solana_transaction_refused" | "step_up_required" | "step_up_unavailable" | "stored_credential_required" | "subscription_change_already_scheduled" | "subscription_change_cadence_unsupported" | "subscription_change_credit_exceeds_price" | "subscription_change_cycle_unknown" | "subscription_change_idempotency_conflict" | "subscription_change_idempotency_key_required" | "subscription_change_in_flight" | "subscription_change_period_unknown" | "subscription_change_provider_conflict" | "subscription_change_refused" | "subscription_change_renewal_due" | "subscription_change_requires_linked_plan" | "subscription_change_target_inactive" | "subscription_change_unsupported_on_rail" | "subscription_not_active" | "subscription_not_found" | "subscription_paid_through" | "subscription_resumable" | "trial_unsupported_on_rail" | "unknown_field" | "unsupported_media_type" | "usage_meter_invalid" | "usage_meter_not_found" | "usage_rate_card_invalid" | "webhook_account_mismatch" | "webhook_invalid" | "widget_generation_invalid";
1
+ export type OpenRailsErrorCode = "admission_captured" | "admission_not_found" | "allowance_meter_not_found" | "allowance_source_in_use" | "allowance_source_invalid" | "already_owned" | "application_required" | "as_of_required" | "authentication_required" | "authentication_unavailable" | "authorization_unavailable" | "billing_archive_integrity" | "billing_archive_invalid_artifact" | "billing_archive_merchant_mismatch" | "billing_archive_not_empty" | "billing_archive_unavailable" | "billing_archive_unsupported_state" | "billing_policy_not_found" | "cancel_unsupported_on_rail" | "captcha_invalid" | "captcha_required" | "card_attempts_blocked" | "card_declined" | "card_not_saved" | "card_requires_https" | "catalog_benefit_overlap" | "catalog_revision_conflict" | "checkout_attempt_closed" | "checkout_attempt_expired" | "checkout_attempts_exhausted" | "checkout_embed_origins_required" | "checkout_expired" | "checkout_not_found" | "credential_expired" | "credential_revoked" | "credit_grant_held" | "credit_grant_not_found" | "credit_grant_unavailable" | "csrf_origin_denied" | "currency_unsupported" | "custodian_capture_unavailable" | "customer_action_required" | "customer_email_required" | "customer_issuer_mismatch" | "customer_not_found" | "customer_payment_unsupported" | "customer_session_required" | "dashboard_invalid" | "database_busy" | "default_payment_method_invalid" | "default_payment_method_required" | "default_rate_card_not_found" | "finding_action_failed" | "finding_not_actionable" | "hold_not_found" | "host_event_not_found" | "host_principal_invalid" | "hosted_checkout_unavailable" | "idempotency_key_in_progress" | "idempotency_key_in_use" | "idempotency_key_required" | "idempotency_key_reused" | "insufficient_credits" | "insufficient_funds" | "internal_error" | "invalid_cursor" | "invalid_customer_id" | "invalid_host_event_request" | "invalid_param" | "invalid_payment_method" | "invalid_psp_reference" | "invalid_query" | "invalid_request_body" | "invalid_settlement_status_request" | "invoker_scoped_principal" | "merchant_config_read_only" | "merchant_unresolved" | "meter_in_use" | "meter_rate_card_conflict" | "method_not_allowed" | "metrics_query_invalid" | "model_unavailable" | "network_account_linked" | "network_link_challenge_invalid" | "network_link_conflict" | "network_link_in_use" | "network_terms_required" | "order_action_not_allowed" | "order_has_recurring_line" | "order_line_unavailable" | "order_not_cancelable" | "order_not_payable" | "order_payment_in_progress" | "order_total_changed" | "payment_duplicate_refused" | "payment_exceeds_due" | "payment_failed" | "payment_idempotency_conflict" | "payment_in_progress" | "payment_method_delete_failed" | "payment_method_delete_unsupported" | "payment_method_not_psp_vaulted" | "payment_method_not_usable" | "payment_method_psp_mismatch" | "payment_method_required" | "payment_method_same_vault" | "payment_method_stale" | "payment_method_update_failed" | "payment_method_update_unsupported" | "payment_not_found" | "payment_not_refundable" | "payment_not_retryable" | "payment_option_unavailable" | "payment_provider_rejected" | "permission_required" | "price_change_currency_mismatch" | "price_change_target_archived" | "price_increase_notice_too_short" | "price_key_cadence_conflict" | "price_key_not_found" | "price_migration_not_found" | "price_not_found" | "price_not_sellable" | "product_not_found" | "product_tier_group_conflict" | "product_tier_group_in_use" | "provider_cancel_held" | "provider_outcome_unknown" | "psp_claim_requires_proof" | "psp_credentials_rejected" | "psp_exists" | "psp_key_taken" | "psp_last_active" | "psp_not_found" | "purchase_review_resolved" | "quantity_not_allowed" | "rate_card_product_not_found" | "rate_limit_exceeded" | "rebill_terms_committed" | "refund_failed" | "refund_rail_unavailable" | "refund_unsupported" | "request_body_too_large" | "resource_access_denied" | "resource_conflict" | "resource_not_found" | "revision_mismatch" | "route_not_found" | "running_charge_not_found" | "scheduled_change_exists" | "service_credential_customer_scope_denied" | "service_unavailable" | "solana_rpc_unavailable" | "solana_transaction_refused" | "step_up_required" | "step_up_unavailable" | "stored_credential_required" | "subscription_change_already_scheduled" | "subscription_change_cadence_unsupported" | "subscription_change_credit_exceeds_price" | "subscription_change_cycle_unknown" | "subscription_change_idempotency_conflict" | "subscription_change_idempotency_key_required" | "subscription_change_in_flight" | "subscription_change_period_unknown" | "subscription_change_provider_conflict" | "subscription_change_refused" | "subscription_change_renewal_due" | "subscription_change_requires_linked_plan" | "subscription_change_target_inactive" | "subscription_change_unsupported_on_rail" | "subscription_not_active" | "subscription_not_found" | "subscription_paid_through" | "subscription_resumable" | "trial_unsupported_on_rail" | "unknown_field" | "unsupported_media_type" | "usage_meter_invalid" | "usage_meter_not_found" | "usage_rate_card_invalid" | "webhook_account_mismatch" | "webhook_invalid";
2
2
  export type OpenRailsErrorType = "api_error" | "authentication_error" | "authorization_error" | "card_error" | "invalid_request_error" | "rate_limit_error";
3
3
  export declare const OPENRAILS_ERROR_CODES: Readonly<Record<OpenRailsErrorCode, {
4
4
  status: number;
@@ -241,7 +241,7 @@ export declare const OPENRAILS_ROUTES: readonly [{
241
241
  readonly errorSets: readonly ["tier:customer"];
242
242
  }, {
243
243
  readonly method: "GET";
244
- readonly path: "/v1/catalog/products";
244
+ readonly path: "/v1/products";
245
245
  readonly group: "checkout";
246
246
  readonly auth: "public";
247
247
  readonly permission: null;
@@ -436,7 +436,7 @@ export declare const OPENRAILS_ROUTES: readonly [{
436
436
  readonly responses: {
437
437
  readonly 200: "Usage";
438
438
  };
439
- readonly errors: readonly ["currency_unsupported"];
439
+ readonly errors: readonly ["currency_unsupported", "invalid_cursor"];
440
440
  readonly errorSets: readonly ["tier:customer", "request"];
441
441
  }, {
442
442
  readonly method: "GET";
@@ -551,6 +551,34 @@ export declare const OPENRAILS_ROUTES: readonly [{
551
551
  };
552
552
  readonly errors: readonly ["invalid_param", "resource_not_found", "route_not_found"];
553
553
  readonly errorSets: readonly ["tier:customer"];
554
+ }, {
555
+ readonly method: "GET";
556
+ readonly path: "/v1/me/agreements";
557
+ readonly group: "customer";
558
+ readonly auth: "customer";
559
+ readonly permission: null;
560
+ readonly sensitive: false;
561
+ readonly mountedWhen: null;
562
+ readonly request: null;
563
+ readonly responses: {
564
+ readonly 200: "ListPage<Agreement>";
565
+ };
566
+ readonly errors: readonly ["invalid_cursor"];
567
+ readonly errorSets: readonly ["tier:customer", "request"];
568
+ }, {
569
+ readonly method: "POST";
570
+ readonly path: "/v1/me/agreements/{id}/revoke";
571
+ readonly group: "customer";
572
+ readonly auth: "customer";
573
+ readonly permission: null;
574
+ readonly sensitive: false;
575
+ readonly mountedWhen: null;
576
+ readonly request: null;
577
+ readonly responses: {
578
+ readonly 200: "AgreementRevocation";
579
+ };
580
+ readonly errors: readonly ["cancel_unsupported_on_rail", "customer_action_required", "invalid_param", "payment_in_progress", "provider_cancel_held", "resource_not_found", "service_unavailable", "subscription_not_active"];
581
+ readonly errorSets: readonly ["tier:customer"];
554
582
  }, {
555
583
  readonly method: "GET";
556
584
  readonly path: "/v1/me/notifications";
@@ -2,6 +2,29 @@ export type ListPage<T> = {
2
2
  data: T[];
3
3
  next_cursor: string | null;
4
4
  };
5
+ export type Agreement = {
6
+ id: string;
7
+ kind: "card_on_file" | "recurring" | "unscheduled";
8
+ status: "active" | "ended" | "requires_reconsent" | "revoked";
9
+ currency: string;
10
+ payment_method_id: string | null;
11
+ card: CardDetails | null;
12
+ subscription: AgreementSubscription | null;
13
+ accepted_at: string;
14
+ ended_at: string | null;
15
+ };
16
+ export type AgreementRevocation = {
17
+ agreement: Agreement;
18
+ subscription: Subscription | null;
19
+ usage_order: Order | null;
20
+ };
21
+ export type AgreementSubscription = {
22
+ id: string;
23
+ product: string;
24
+ amount: string;
25
+ billing_interval_hours: number | null;
26
+ next_charge_at: string | null;
27
+ };
5
28
  export type Balance = {
6
29
  customer_id: string;
7
30
  currency: string;
@@ -689,6 +712,7 @@ export type Usage = {
689
712
  to: string;
690
713
  group_by: "event_type" | "invoker" | "resource";
691
714
  rows: UsageRow[];
715
+ next_cursor: string | null;
692
716
  };
693
717
  export type UsageRow = {
694
718
  key: string;
@@ -1,5 +1,5 @@
1
- export { CANCEL_REASON_MAX, CANCEL_REASON_MIN, createBillingClient, isWalletAction, isWalletRejection, RETRY_BUDGET_MS, signWalletAction, WalletRejectedError, type BillingClient, type BillingClientOptions, type ListOptions, type OrderResult, type ProductListOptions, type SendSolanaTransaction, type SubscriptionChangeInput, } from './client';
1
+ export { CANCEL_REASON_MAX, CANCEL_REASON_MIN, createBillingClient, isWalletAction, isWalletRejection, RETRY_BUDGET_MS, signWalletAction, WalletRejectedError, type BillingClient, type BillingClientOptions, type ListOptions, type OrderResult, type ProductListOptions, type SendSolanaTransaction, type SubscriptionChangeInput, type UsageOptions, } from './client';
2
2
  export { redeemAssertion, tokenSource, type RedeemAssertionOptions, type TokenResponse, type TokenSource, type TokenSourceOptions, } from './token-source';
3
3
  export { BillingError, isBillingError, isServerError, readBillingError, toBillingError, type BillingErrorBody, } from './errors';
4
- export type { Account, Balance, CaptchaConfig, CardSummary, Cart, Currency, CurrencyScales, CustomerConfig, CustomerLink, PaymentConfig, PaymentFailure, PublicConfig, PublicMerchant, ListPage, NetworkLinkChallenge, NewCard, NextAction, Order, OrderLine, OrderLineRefusal, OrderPaymentInput, OrderPreviewLine, Page, Payment, PaymentMethod, PaymentRecovery, Price, Product, Subscription, SubscriptionDunning, SubscriptionProduct, SubscriptionStatus, SubscriptionChange, SubscriptionChangePreview, } from './types';
4
+ export type { Account, Balance, CaptchaConfig, CardSummary, Cart, Currency, CurrencyScales, CustomerConfig, CustomerLink, PaymentConfig, PaymentFailure, PublicConfig, PublicMerchant, ListPage, NetworkLinkChallenge, NewCard, NextAction, Order, OrderLine, OrderLineRefusal, OrderPaymentInput, OrderPreviewLine, Page, Payment, PaymentMethod, PaymentRecovery, Price, Product, Subscription, SubscriptionDunning, SubscriptionProduct, SubscriptionStatus, SubscriptionChange, SubscriptionChangePreview, Usage, UsageRow, } from './types';
5
5
  export { amountToDecimal, decimalToAmount, formatAmount, type Amount, } from '../lib/money';
@@ -35,7 +35,7 @@ export declare const pspLinkStateSchema: z.ZodObject<{
35
35
  sync_status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
36
36
  }, z.core.$strip>;
37
37
  /**
38
- * A catalog price, embedded in a product (`GET /catalog/products`): `unit_amount` of
38
+ * A catalog price, embedded in a product (`GET /products`): `unit_amount` of
39
39
  * `currency` for `access_duration_hours` of access (null: for good),
40
40
  * charging every `billing_interval_hours` (null: one-time).
41
41
  */
@@ -717,6 +717,37 @@ export declare const accountSchema: z.ZodObject<{
717
717
  unread_notifications: z.ZodNumber;
718
718
  }, z.core.$strip>;
719
719
  export type Account = z.infer<typeof accountSchema>;
720
+ /**
721
+ * One group of a usage report: its events and their total `amount`.
722
+ * `dimensions` are the summed event dimensions when grouped by event type.
723
+ */
724
+ export declare const usageRowSchema: z.ZodObject<{
725
+ key: z.ZodString;
726
+ event_count: z.ZodNumber;
727
+ amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
728
+ dimensions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNumber>>>;
729
+ }, z.core.$strip>;
730
+ export type UsageRow = z.infer<typeof usageRowSchema>;
731
+ /**
732
+ * One page of the customer's usage in `currency` over [`from`, `to`): its
733
+ * groups by total amount, largest first, then by key. `next_cursor` reads the
734
+ * next page; null on the last.
735
+ */
736
+ export declare const usageSchema: z.ZodObject<{
737
+ customer_id: z.ZodString;
738
+ currency: z.ZodString;
739
+ from: z.ZodString;
740
+ to: z.ZodString;
741
+ group_by: z.ZodString;
742
+ rows: z.ZodArray<z.ZodObject<{
743
+ key: z.ZodString;
744
+ event_count: z.ZodNumber;
745
+ amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
746
+ dimensions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNumber>>>;
747
+ }, z.core.$strip>>;
748
+ next_cursor: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
749
+ }, z.core.$strip>;
750
+ export type Usage = z.infer<typeof usageSchema>;
720
751
  /** Currency code (upper case) to its native-unit scale. */
721
752
  export type CurrencyScales = Readonly<Record<string, number>>;
722
753
  export declare const currencySchema: z.ZodObject<{