@stewardhq/sdk 0.6.0 → 0.7.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 CHANGED
@@ -270,7 +270,8 @@ await steward.admin.settings.update({
270
270
 
271
271
  const secret = generateWebhookSecret(); // whsec_ + 32 random bytes
272
272
  const endpoint = await steward.admin.endpoints.create({ url: "http://api.acme.svc.cluster.local/billing/events", secret });
273
- // without eventTypes, ["account.state_changed"]; the address must be https:// or http://*.svc.cluster.local
273
+ // without eventTypes, ["account.state_changed"]; the address must be public https://, or http(s)://*.svc.cluster.local
274
+ // when called from inside the cluster (otherwise 422 webhook_url_not_allowed)
274
275
  await steward.admin.endpoints.rotate(endpoint.id, { secret: generateWebhookSecret() }); // the old secret stays as a second signature during the transition
275
276
  ```
276
277
 
@@ -447,6 +448,23 @@ version in `sdk/package.json` and push the `sdk-v<version>` tag
447
448
  (`.github/workflows/sdk-publish.yml`). **The first version on npmjs is 0.5.0** (2026-09-21);
448
449
  0.4.0 stayed inside the repository and was never published.
449
450
 
451
+ **0.7.0** (contract 0.6.0; additive; `API_VERSION` `2026-10-01` unchanged):
452
+
453
+ - Admin operations that used to need the pod CLI (issue #57), under `steward.admin`: `apiKeys.list/create/revoke`
454
+ (the caller generates the token with `generateApiKeyToken()`; steward never returns it; an admin key always
455
+ expires; a key cannot revoke itself, `api_key_self_revoke`), `dunning.get/set` (`DunningPolicySchema`),
456
+ `events.redeliver`, `subscriptions.reprice` (`dryRun` required), `meters.recompute/closePeriods`,
457
+ `credits.adjust` (signed units: negative = adjustment), `bankTransfers.list/record`.
458
+ - Settings: `provider` in `ProductSettingsPatch` (only a provider configured in the deployment;
459
+ `provider_not_available`).
460
+ - `doctor()`: `apiKeys` (active keys with age, last use and expiry) and the warnings `api_key_expiring`,
461
+ `admin_key_without_expiry`.
462
+ - Webhook endpoints: `internal` (a cluster address registered from inside the cluster); `webhook_url_not_allowed`
463
+ when the URL fails the SSRF policy.
464
+ - Error codes: `payload_too_large` (413), `api_key_not_found`, `api_key_exists`, `api_key_self_revoke`,
465
+ `event_not_found`, `provider_not_available`, `webhook_url_not_allowed`. `rate_limited` (429) now also comes
466
+ from the `/v1` per-key budgets, always with `Retry-After`.
467
+
450
468
  **0.6.0** (contract 0.5.0, bank transfer F1; additive; `API_VERSION` `2026-10-01` unchanged):
451
469
 
452
470
  - `Checkout().create({ replacesSubscriptionId })`: an upgrade that replaces the live subscription only
@@ -1,4 +1,4 @@
1
- import { nt as errorCodeSpec } from "./src.js";
1
+ import { it as errorCodeSpec } from "./src.js";
2
2
  //#region src/errors.ts
3
3
  var StewardError = class extends Error {
4
4
  code;
@@ -1520,6 +1520,288 @@ declare const BankTransferRecordedSchema: z.ZodObject<{
1520
1520
  }, z.core.$strip>;
1521
1521
  type BankTransferRecorded = z.infer<typeof BankTransferRecordedSchema>;
1522
1522
  //#endregion
1523
+ //#region ../contract/src/admin.d.ts
1524
+ declare const API_KEY_SCOPES: readonly ['product', 'admin', 'checkout'];
1525
+ declare const ApiKeyScopeSchema: z.ZodEnum<{
1526
+ admin: "admin";
1527
+ checkout: "checkout";
1528
+ product: "product";
1529
+ }>;
1530
+ type ApiKeyScope = z.infer<typeof ApiKeyScopeSchema>;
1531
+ /** The public part of a key: the 12 hex characters after `stw_` (in logs, audit rows and `doctor`). */
1532
+ declare const ApiKeyPrefixSchema: z.ZodString;
1533
+ /**
1534
+ * `stw_<prefix: 12 hex>_<secret: 43 base64url>`. A low-variety secret (e.g. one character
1535
+ * repeated) is refused; `generateApiKeyToken` draws 32 random bytes.
1536
+ */
1537
+ declare const ApiKeyTokenSchema: z.ZodString;
1538
+ /** Longest expiry a key can be given, in days (about ten years). */
1539
+ declare const MAX_API_KEY_TTL_DAYS = 3650;
1540
+ declare const ApiKeyCreateInputSchema: z.ZodObject<{
1541
+ token: z.ZodString;
1542
+ name: z.ZodString;
1543
+ scope: z.ZodEnum<{
1544
+ admin: "admin";
1545
+ checkout: "checkout";
1546
+ product: "product";
1547
+ }>;
1548
+ expiresInDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1549
+ }, z.core.$strict>;
1550
+ type ApiKeyCreateInput = z.input<typeof ApiKeyCreateInputSchema>;
1551
+ declare const ApiKeySchema: z.ZodObject<{
1552
+ prefix: z.ZodString;
1553
+ name: z.ZodString;
1554
+ scope: z.ZodEnum<{
1555
+ admin: "admin";
1556
+ checkout: "checkout";
1557
+ product: "product";
1558
+ }>;
1559
+ createdAt: z.ZodISODateTime;
1560
+ lastUsedAt: z.ZodNullable<z.ZodISODateTime>;
1561
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
1562
+ revokedAt: z.ZodNullable<z.ZodISODateTime>;
1563
+ }, z.core.$strip>;
1564
+ type ApiKey = z.infer<typeof ApiKeySchema>;
1565
+ /** `GET /v1/admin/api-keys`: the product's keys, revoked and expired ones included, oldest first. */
1566
+ declare const ApiKeyListSchema: z.ZodObject<{
1567
+ items: z.ZodArray<z.ZodObject<{
1568
+ prefix: z.ZodString;
1569
+ name: z.ZodString;
1570
+ scope: z.ZodEnum<{
1571
+ admin: "admin";
1572
+ checkout: "checkout";
1573
+ product: "product";
1574
+ }>;
1575
+ createdAt: z.ZodISODateTime;
1576
+ lastUsedAt: z.ZodNullable<z.ZodISODateTime>;
1577
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
1578
+ revokedAt: z.ZodNullable<z.ZodISODateTime>;
1579
+ }, z.core.$strip>>;
1580
+ }, z.core.$strip>;
1581
+ type ApiKeyList = z.infer<typeof ApiKeyListSchema>;
1582
+ /** A new API key token (`stw_…`), Web Crypto; Node ≥22, edge and workerd. Store it once, send it once. */
1583
+ declare function generateApiKeyToken(): string;
1584
+ declare const DUNNING_ACTIONS: readonly ['retry_payment', 'suspend', 'terminate'];
1585
+ /**
1586
+ * `products.dunning_policy`: steps by days after the first failed payment; `dryRun` only audits.
1587
+ * Not strict: stored policies are read through it too (an unknown field must not turn a stored
1588
+ * policy into the default).
1589
+ */
1590
+ declare const DunningPolicySchema: z.ZodObject<{
1591
+ steps: z.ZodArray<z.ZodObject<{
1592
+ afterDays: z.ZodNumber;
1593
+ action: z.ZodEnum<{
1594
+ retry_payment: "retry_payment";
1595
+ suspend: "suspend";
1596
+ terminate: "terminate";
1597
+ }>;
1598
+ }, z.core.$strip>>;
1599
+ dryRun: z.ZodDefault<z.ZodBoolean>;
1600
+ }, z.core.$strip>;
1601
+ type DunningPolicy = z.output<typeof DunningPolicySchema>;
1602
+ type DunningPolicyInput = z.input<typeof DunningPolicySchema>;
1603
+ /** `POST /v1/admin/events/:id/redeliver`: every delivery of the event requeued, attempts reset. */
1604
+ declare const RedeliveredEventSchema: z.ZodObject<{
1605
+ eventId: z.ZodString;
1606
+ type: z.ZodString;
1607
+ deliveries: z.ZodArray<z.ZodObject<{
1608
+ endpointId: z.ZodUUID;
1609
+ status: z.ZodEnum<{
1610
+ dead: "dead";
1611
+ delivered: "delivered";
1612
+ pending: "pending";
1613
+ }>;
1614
+ attempts: z.ZodNumber;
1615
+ nextAttemptAt: z.ZodISODateTime;
1616
+ }, z.core.$strip>>;
1617
+ }, z.core.$strip>;
1618
+ type RedeliveredEvent = z.infer<typeof RedeliveredEventSchema>;
1619
+ declare const MAX_NOTICE_DAYS = 3650;
1620
+ declare const RepriceInputSchema: z.ZodObject<{
1621
+ planCode: z.ZodString;
1622
+ noticeDays: z.ZodNumber;
1623
+ dryRun: z.ZodBoolean;
1624
+ }, z.core.$strict>;
1625
+ type RepriceInput = z.input<typeof RepriceInputSchema>;
1626
+ declare const RepriceItemSchema: z.ZodObject<{
1627
+ subscriptionId: z.ZodUUID;
1628
+ accountRef: z.ZodString;
1629
+ interval: z.ZodEnum<{
1630
+ month: "month";
1631
+ year: "year";
1632
+ }>;
1633
+ currency: z.ZodString;
1634
+ oldAmountMinor: z.ZodNumber;
1635
+ newAmountMinor: z.ZodNumber;
1636
+ taxInclusive: z.ZodBoolean;
1637
+ effectiveAt: z.ZodNullable<z.ZodISODateTime>;
1638
+ action: z.ZodEnum<{
1639
+ already_scheduled: "already_scheduled";
1640
+ schedule: "schedule";
1641
+ skip: "skip";
1642
+ }>;
1643
+ reason: z.ZodOptional<z.ZodEnum<{
1644
+ cancel_scheduled: "cancel_scheduled";
1645
+ change_scheduled: "change_scheduled";
1646
+ legacy_provider: "legacy_provider";
1647
+ no_period: "no_period";
1648
+ }>>;
1649
+ meteredRates: z.ZodOptional<z.ZodArray<z.ZodObject<{
1650
+ meter: z.ZodString;
1651
+ label: z.ZodObject<{
1652
+ tr: z.ZodString;
1653
+ en: z.ZodString;
1654
+ }, z.core.$strip>;
1655
+ unitLabel: z.ZodNullable<z.ZodObject<{
1656
+ tr: z.ZodString;
1657
+ en: z.ZodString;
1658
+ }, z.core.$strip>>;
1659
+ displayPer: z.ZodNullable<z.ZodNumber>;
1660
+ oldRate: z.ZodNullable<z.ZodObject<{
1661
+ amountMinor: z.ZodNumber;
1662
+ perUnits: z.ZodNumber;
1663
+ capMinor: z.ZodNullable<z.ZodNumber>;
1664
+ }, z.core.$strip>>;
1665
+ newRate: z.ZodNullable<z.ZodObject<{
1666
+ amountMinor: z.ZodNumber;
1667
+ perUnits: z.ZodNumber;
1668
+ capMinor: z.ZodNullable<z.ZodNumber>;
1669
+ }, z.core.$strip>>;
1670
+ }, z.core.$strip>>>;
1671
+ }, z.core.$strip>;
1672
+ type RepriceItem = z.infer<typeof RepriceItemSchema>;
1673
+ declare const RepriceResultSchema: z.ZodObject<{
1674
+ dryRun: z.ZodBoolean;
1675
+ effectiveNotBefore: z.ZodISODateTime;
1676
+ scheduled: z.ZodNumber;
1677
+ items: z.ZodArray<z.ZodObject<{
1678
+ subscriptionId: z.ZodUUID;
1679
+ accountRef: z.ZodString;
1680
+ interval: z.ZodEnum<{
1681
+ month: "month";
1682
+ year: "year";
1683
+ }>;
1684
+ currency: z.ZodString;
1685
+ oldAmountMinor: z.ZodNumber;
1686
+ newAmountMinor: z.ZodNumber;
1687
+ taxInclusive: z.ZodBoolean;
1688
+ effectiveAt: z.ZodNullable<z.ZodISODateTime>;
1689
+ action: z.ZodEnum<{
1690
+ already_scheduled: "already_scheduled";
1691
+ schedule: "schedule";
1692
+ skip: "skip";
1693
+ }>;
1694
+ reason: z.ZodOptional<z.ZodEnum<{
1695
+ cancel_scheduled: "cancel_scheduled";
1696
+ change_scheduled: "change_scheduled";
1697
+ legacy_provider: "legacy_provider";
1698
+ no_period: "no_period";
1699
+ }>>;
1700
+ meteredRates: z.ZodOptional<z.ZodArray<z.ZodObject<{
1701
+ meter: z.ZodString;
1702
+ label: z.ZodObject<{
1703
+ tr: z.ZodString;
1704
+ en: z.ZodString;
1705
+ }, z.core.$strip>;
1706
+ unitLabel: z.ZodNullable<z.ZodObject<{
1707
+ tr: z.ZodString;
1708
+ en: z.ZodString;
1709
+ }, z.core.$strip>>;
1710
+ displayPer: z.ZodNullable<z.ZodNumber>;
1711
+ oldRate: z.ZodNullable<z.ZodObject<{
1712
+ amountMinor: z.ZodNumber;
1713
+ perUnits: z.ZodNumber;
1714
+ capMinor: z.ZodNullable<z.ZodNumber>;
1715
+ }, z.core.$strip>>;
1716
+ newRate: z.ZodNullable<z.ZodObject<{
1717
+ amountMinor: z.ZodNumber;
1718
+ perUnits: z.ZodNumber;
1719
+ capMinor: z.ZodNullable<z.ZodNumber>;
1720
+ }, z.core.$strip>>;
1721
+ }, z.core.$strip>>>;
1722
+ }, z.core.$strip>>;
1723
+ }, z.core.$strip>;
1724
+ type RepriceResult = z.infer<typeof RepriceResultSchema>;
1725
+ /** `POST /v1/admin/accounts/:ref/meters/recompute`: every meter, or one. */
1726
+ declare const MeterRecomputeInputSchema: z.ZodObject<{
1727
+ meter: z.ZodOptional<z.ZodString>;
1728
+ }, z.core.$strict>;
1729
+ type MeterRecomputeInput = z.input<typeof MeterRecomputeInputSchema>;
1730
+ declare const MeterRecomputeResultSchema: z.ZodObject<{
1731
+ items: z.ZodArray<z.ZodObject<{
1732
+ meter: z.ZodString;
1733
+ periodStart: z.ZodNullable<z.ZodISODateTime>;
1734
+ periodEnd: z.ZodNullable<z.ZodISODateTime>;
1735
+ before: z.ZodNullable<z.ZodString>;
1736
+ after: z.ZodNullable<z.ZodString>;
1737
+ }, z.core.$strip>>;
1738
+ }, z.core.$strip>;
1739
+ type MeterRecomputeResult = z.infer<typeof MeterRecomputeResultSchema>;
1740
+ /** `POST /v1/admin/accounts/:ref/meters/close-periods`: `force` does not wait for unrolled events. */
1741
+ declare const MeterClosePeriodsInputSchema: z.ZodObject<{
1742
+ meter: z.ZodOptional<z.ZodString>;
1743
+ force: z.ZodOptional<z.ZodBoolean>;
1744
+ }, z.core.$strict>;
1745
+ type MeterClosePeriodsInput = z.input<typeof MeterClosePeriodsInputSchema>;
1746
+ declare const MeterClosePeriodsResultSchema: z.ZodObject<{
1747
+ closed: z.ZodNumber;
1748
+ events: z.ZodNumber;
1749
+ pending: z.ZodNumber;
1750
+ }, z.core.$strip>;
1751
+ type MeterClosePeriodsResult = z.infer<typeof MeterClosePeriodsResultSchema>;
1752
+ /**
1753
+ * `POST /v1/admin/accounts/:ref/credits`: positive units = `manual_grant` (as the product route),
1754
+ * negative = `adjustment` (a correction; admin only, issue #57 decision 3). Response:
1755
+ * `CreditGrantResponseSchema`.
1756
+ */
1757
+ declare const CreditAdjustmentInputSchema: z.ZodObject<{
1758
+ meter: z.ZodString;
1759
+ units: z.ZodNumber;
1760
+ reason: z.ZodString;
1761
+ }, z.core.$strict>;
1762
+ type CreditAdjustmentInput = z.input<typeof CreditAdjustmentInputSchema>;
1763
+ declare const BANK_TRANSFER_LIST_STATUSES: readonly ['pending', 'expired'];
1764
+ declare const BankTransferListStatusSchema: z.ZodEnum<{
1765
+ expired: "expired";
1766
+ pending: "pending";
1767
+ }>;
1768
+ type BankTransferListStatus = z.infer<typeof BankTransferListStatusSchema>;
1769
+ declare const BankTransferListItemSchema: z.ZodObject<{
1770
+ kind: z.ZodEnum<{
1771
+ checkout: "checkout";
1772
+ invoice: "invoice";
1773
+ }>;
1774
+ id: z.ZodUUID;
1775
+ status: z.ZodString;
1776
+ planCode: z.ZodNullable<z.ZodString>;
1777
+ totalMinor: z.ZodNumber;
1778
+ currency: z.ZodString;
1779
+ deadline: z.ZodNullable<z.ZodISODateTime>;
1780
+ code: z.ZodNullable<z.ZodString>;
1781
+ accountRef: z.ZodString;
1782
+ selectedAt: z.ZodNullable<z.ZodISODateTime>;
1783
+ }, z.core.$strip>;
1784
+ type BankTransferListItem = z.infer<typeof BankTransferListItemSchema>;
1785
+ /** `GET /v1/admin/bank-transfers`: `pending` by deadline; `expired`: expired in the last 30 days. */
1786
+ declare const BankTransferListSchema: z.ZodObject<{
1787
+ items: z.ZodArray<z.ZodObject<{
1788
+ kind: z.ZodEnum<{
1789
+ checkout: "checkout";
1790
+ invoice: "invoice";
1791
+ }>;
1792
+ id: z.ZodUUID;
1793
+ status: z.ZodString;
1794
+ planCode: z.ZodNullable<z.ZodString>;
1795
+ totalMinor: z.ZodNumber;
1796
+ currency: z.ZodString;
1797
+ deadline: z.ZodNullable<z.ZodISODateTime>;
1798
+ code: z.ZodNullable<z.ZodString>;
1799
+ accountRef: z.ZodString;
1800
+ selectedAt: z.ZodNullable<z.ZodISODateTime>;
1801
+ }, z.core.$strip>>;
1802
+ }, z.core.$strip>;
1803
+ type BankTransferList = z.infer<typeof BankTransferListSchema>;
1804
+ //#endregion
1523
1805
  //#region ../contract/src/portal.d.ts
1524
1806
  declare const PortalSessionCreateInputSchema: z.ZodObject<{
1525
1807
  locale: z.ZodOptional<z.ZodEnum<{
@@ -4118,6 +4400,11 @@ declare const ERROR_CODES: Readonly<{
4118
4400
  actor_ref_required: ErrorCodeSpec;
4119
4401
  idempotency_key_required: ErrorCodeSpec;
4120
4402
  invalid_idempotency_key: ErrorCodeSpec;
4403
+ /**
4404
+ * The request body is over the route's limit (`/v1`: 64 KiB; catalog sync 1 MiB; invoice issue
4405
+ * 10 MiB). Event ingest keeps its own code (`batch_too_large`).
4406
+ */
4407
+ payload_too_large: ErrorCodeSpec;
4121
4408
  /** Anahtar yok / iptal / yanlış — neden ayrıştırılmaz. */
4122
4409
  unauthorized: ErrorCodeSpec;
4123
4410
  /** Admin kapsamı gereken uç. */
@@ -4136,6 +4423,22 @@ declare const ERROR_CODES: Readonly<{
4136
4423
  checkout_session_not_found: ErrorCodeSpec;
4137
4424
  /** Yönetim ucu: endpoint yok ya da başka ürünün. */
4138
4425
  webhook_endpoint_not_found: ErrorCodeSpec;
4426
+ /** Admin endpoint (issue #57): no API key of the product has this prefix. */
4427
+ api_key_not_found: ErrorCodeSpec;
4428
+ /** Admin endpoint (issue #57): no event of the product has this id. */
4429
+ event_not_found: ErrorCodeSpec;
4430
+ /**
4431
+ * `POST /v1/admin/webhook-endpoints`: the URL fails the SSRF policy (through the Ingress only public
4432
+ * `https://` names resolving to public addresses; cluster addresses only from inside the cluster).
4433
+ * The message says which rule.
4434
+ */
4435
+ webhook_url_not_allowed: ErrorCodeSpec;
4436
+ /** `POST /v1/admin/api-keys`: a key with this prefix already exists (generate a new token). */
4437
+ api_key_exists: ErrorCodeSpec;
4438
+ /** `POST /v1/admin/api-keys/:prefix/revoke`: a key cannot revoke itself (revoke it with another admin key). */
4439
+ api_key_self_revoke: ErrorCodeSpec;
4440
+ /** `PATCH /v1/admin/settings`: the `provider` is not configured in this deployment. */
4441
+ provider_not_available: ErrorCodeSpec;
4139
4442
  /** Ürün için henüz katalog senkronlanmadı (404 ama kurulum eksiği). */
4140
4443
  catalog_not_configured: ErrorCodeSpec;
4141
4444
  plan_missing_feature: ErrorCodeSpec;
@@ -4226,9 +4529,9 @@ declare const ERROR_CODES: Readonly<{
4226
4529
  /** `/health`: veritabanına ulaşılamıyor. */
4227
4530
  database_unavailable: ErrorCodeSpec;
4228
4531
  /**
4229
- * Bugün yalnızca hosted sayfalar üretir (yanlış sayfa anahtarı / aksiyon sınırı; `hosted/routes.ts`,
4230
- * `hosted/portal-routes.ts`); `Retry-After` başlığı taşır. `/v1` için anahtar başına bütçe (F2c, K26)
4231
- * ertelendi — geldiğinde aynı kod kullanılır.
4532
+ * Always with `Retry-After` (seconds). `/v1`: the key's budget for the route is spent, or the client
4533
+ * IP is blocked after too many rejected keys (`service/src/http/rate-limit.ts`, issue #43). Hosted
4534
+ * pages: wrong page key / action limit (`hosted/routes.ts`, `hosted/portal-routes.ts`).
4232
4535
  */
4233
4536
  rate_limited: ErrorCodeSpec;
4234
4537
  unknown_provider: ErrorCodeSpec;
@@ -5466,6 +5769,7 @@ declare const BrandingPatchSchema: z.ZodObject<{
5466
5769
  }, z.core.$strict>;
5467
5770
  /** `PATCH /v1/admin/settings` gövdesi. */
5468
5771
  declare const ProductSettingsPatchSchema: z.ZodObject<{
5772
+ provider: z.ZodOptional<z.ZodString>;
5469
5773
  appUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
5470
5774
  defaultCurrency: z.ZodOptional<z.ZodString>;
5471
5775
  defaultLocale: z.ZodOptional<z.ZodEnum<{
@@ -5563,9 +5867,7 @@ type ProductSettingsPatch = z.input<typeof ProductSettingsPatchSchema>;
5563
5867
  * Doğrulanmış yamayı ayarlara uygular (saf). Sonuç şemadan geçer; alan kuralları
5564
5868
  * yamada zaten denetlendiği için yalnızca programlama hatasında fırlatır.
5565
5869
  */
5566
- declare function applySettingsPatch(current: ProductSettings, patch: z.output<typeof ProductSettingsPatchSchema> & {
5567
- readonly provider?: string | undefined;
5568
- }): ProductSettings;
5870
+ declare function applySettingsPatch(current: ProductSettings, patch: z.output<typeof ProductSettingsPatchSchema>): ProductSettings;
5569
5871
  /** Checkout dönüşüne izinli origin'ler: `appUrl`'in origin'i + `extraReturnOrigins`. */
5570
5872
  declare function returnOriginsOf(settings: Pick<ProductSettings, 'appUrl' | 'extraReturnOrigins'>): string[];
5571
5873
  /** `returnUrl`'in origin'i izinli mi (geçersiz adres: hayır). */
@@ -5614,9 +5916,10 @@ declare const WebhookEndpointStatusSchema: z.ZodEnum<{
5614
5916
  }>;
5615
5917
  type WebhookEndpointStatus = z.infer<typeof WebhookEndpointStatusSchema>;
5616
5918
  /**
5617
- * Adres politikası; uygunsa null, değilse nedeni. `allowLoopback` üretimde false.
5618
- * Şemadan ayrıdır: üretim bilgisi yalnızca serviste var (servis ve sahte steward
5619
- * gövde şemasına `superRefine` ile ekler).
5919
+ * Address SYNTAX policy; null when acceptable, otherwise the reason. `allowLoopback` is false in
5920
+ * production. Separate from the schema: only the service knows whether it runs in production. The
5921
+ * service adds the SSRF rules on top (who may register a cluster address, public names only, DNS
5922
+ * resolving to public addresses; `service/src/domain/webhook-url-policy.ts`).
5620
5923
  */
5621
5924
  declare function webhookEndpointUrlProblem(value: string, options: {
5622
5925
  allowLoopback: boolean;
@@ -5715,6 +6018,7 @@ declare const WebhookEndpointSchema: z.ZodObject<{
5715
6018
  "subscription.terminated": "subscription.terminated";
5716
6019
  }>>>;
5717
6020
  description: z.ZodNullable<z.ZodString>;
6021
+ internal: z.ZodOptional<z.ZodBoolean>;
5718
6022
  createdAt: z.ZodISODateTime;
5719
6023
  rotatedAt: z.ZodNullable<z.ZodISODateTime>;
5720
6024
  lastDelivery: z.ZodNullable<z.ZodObject<{
@@ -5768,6 +6072,7 @@ declare const WebhookEndpointListSchema: z.ZodObject<{
5768
6072
  "subscription.terminated": "subscription.terminated";
5769
6073
  }>>>;
5770
6074
  description: z.ZodNullable<z.ZodString>;
6075
+ internal: z.ZodOptional<z.ZodBoolean>;
5771
6076
  createdAt: z.ZodISODateTime;
5772
6077
  rotatedAt: z.ZodNullable<z.ZodISODateTime>;
5773
6078
  lastDelivery: z.ZodNullable<z.ZodObject<{
@@ -5796,7 +6101,7 @@ declare const DoctorSeveritySchema: z.ZodEnum<{
5796
6101
  }>;
5797
6102
  type DoctorSeverity = z.infer<typeof DoctorSeveritySchema>;
5798
6103
  /** `warnings[].code` — bu sürümün ürettiği kodlar; küme açık. */
5799
- type DoctorWarningCode = 'catalog_not_synced' | 'price_unsellable' | 'price_drift' | 'legacy_provider_subscription' | 'provider_not_configured' | 'provider_unhealthy' | 'no_return_origin' | 'app_url_missing' | 'branding_incomplete' | 'legal_links_missing' | 'no_active_endpoint' | 'no_state_changed_endpoint' | 'endpoint_wrong_secret' | 'endpoint_old_contract' | 'endpoint_unreachable' | 'endpoint_failing' | 'endpoint_dead_deliveries' | 'endpoint_pending_backlog' | 'dunning_dry_run' | 'email_not_configured' | 'email_sender_missing' | 'email_billing_link_missing' | 'events_backlog' | 'meter_rollup_lag' | 'events_invalid_value' | 'meter_without_events' | 'events_unmatched' | 'overage_charge_mode_off' | 'overage_dry_run' | 'overage_unrated_subscriptions' | (string & Record<never, never>);
6104
+ type DoctorWarningCode = 'catalog_not_synced' | 'price_unsellable' | 'price_drift' | 'legacy_provider_subscription' | 'provider_not_configured' | 'card_payments_unavailable' | 'provider_unhealthy' | 'no_return_origin' | 'app_url_missing' | 'branding_incomplete' | 'legal_links_missing' | 'no_active_endpoint' | 'no_state_changed_endpoint' | 'endpoint_wrong_secret' | 'endpoint_old_contract' | 'endpoint_unreachable' | 'endpoint_failing' | 'endpoint_dead_deliveries' | 'endpoint_pending_backlog' | 'dunning_dry_run' | 'email_not_configured' | 'email_sender_missing' | 'email_billing_link_missing' | 'events_backlog' | 'meter_rollup_lag' | 'events_invalid_value' | 'meter_without_events' | 'events_unmatched' | 'overage_charge_mode_off' | 'overage_dry_run' | 'overage_unrated_subscriptions' | 'api_key_expiring' | 'admin_key_without_expiry' | (string & Record<never, never>);
5800
6105
  declare const DoctorWarningSchema: z.ZodObject<{
5801
6106
  code: z.ZodString;
5802
6107
  severity: z.ZodEnum<{
@@ -5991,6 +6296,19 @@ declare const DoctorEmailsSchema: z.ZodObject<{
5991
6296
  ready: z.ZodBoolean;
5992
6297
  }, z.core.$strip>;
5993
6298
  type DoctorEmails = z.infer<typeof DoctorEmailsSchema>;
6299
+ /** An active `api_keys` row (not revoked, not expired); issue #43. Never the secret. */
6300
+ declare const DoctorApiKeySchema: z.ZodObject<{
6301
+ name: z.ZodString;
6302
+ prefix: z.ZodString;
6303
+ scope: z.ZodString;
6304
+ createdAt: z.ZodISODateTime;
6305
+ lastUsedAt: z.ZodNullable<z.ZodISODateTime>;
6306
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
6307
+ ageDays: z.ZodNumber;
6308
+ }, z.core.$strip>;
6309
+ type DoctorApiKey = z.infer<typeof DoctorApiKeySchema>;
6310
+ /** A key expiring within this many days is a warning. */
6311
+ declare const DOCTOR_KEY_EXPIRY_WARN_DAYS = 14;
5994
6312
  declare const DoctorReportSchema: z.ZodObject<{
5995
6313
  ok: z.ZodBoolean;
5996
6314
  checkedAt: z.ZodISODateTime;
@@ -6131,6 +6449,15 @@ declare const DoctorReportSchema: z.ZodObject<{
6131
6449
  unratedSubscriptions: z.ZodNumber;
6132
6450
  carriedCharges: z.ZodNumber;
6133
6451
  }, z.core.$strip>>;
6452
+ apiKeys: z.ZodOptional<z.ZodArray<z.ZodObject<{
6453
+ name: z.ZodString;
6454
+ prefix: z.ZodString;
6455
+ scope: z.ZodString;
6456
+ createdAt: z.ZodISODateTime;
6457
+ lastUsedAt: z.ZodNullable<z.ZodISODateTime>;
6458
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
6459
+ ageDays: z.ZodNumber;
6460
+ }, z.core.$strip>>>;
6134
6461
  warnings: z.ZodArray<z.ZodObject<{
6135
6462
  code: z.ZodString;
6136
6463
  severity: z.ZodEnum<{
@@ -6163,6 +6490,12 @@ type DoctorFacts = {
6163
6490
  events?: DoctorEvents;
6164
6491
  /** Overage facts (MF5); omitted: no overage section in the report. */
6165
6492
  overage?: DoctorOverage;
6493
+ /** Currencies the product sells by bank transfer (switch on and a deployment IBAN); omitted: none. */
6494
+ bankTransfer?: {
6495
+ currencies: string[];
6496
+ };
6497
+ /** Active API keys; omitted: no `apiKeys` section in the report. */
6498
+ apiKeys?: Omit<DoctorApiKey, 'ageDays'>[];
6166
6499
  };
6167
6500
  /** Email readiness from settings and the deployment's transport (pure). */
6168
6501
  declare function emailReadinessOf(settings: DoctorFacts['settings'], transport: NonNullable<DoctorFacts['emailTransport']>): DoctorEmails;
@@ -6175,4 +6508,4 @@ declare function hostedReadinessOf(settings: DoctorFacts['settings']): DoctorHos
6175
6508
  /** Olgulardan raporu türetir (saf): endpoint teşhisleri, hosted hazırlığı, uyarılar ve `ok`. */
6176
6509
  declare function buildDoctorReport(facts: DoctorFacts): DoctorReport;
6177
6510
  //#endregion
6178
- export { WebhookEndpointStatus as $, Consent as $a, InvoiceStatusSchema as $i, MeterCreditsOptions as $n, MeterCreditBenefitDefSchema as $o, ResolvedBenefits as $r, MeterLowAtSchema as $s, BankTransferInstructionsEmail as $t, DoctorSeveritySchema as A, PortalSessionError as Aa, ErrorResponseSchema as Ac, InvoiceIssueResponseSchema as Ai, emailLocaleOf as An, PriceDef as Ao, EventsIngestInput as Ar, MeterChargeListSchema as As, MeterChargeMode as At, hostedReadinessOf as B, CheckoutPrefill as Ba, InvoicePaymentStatusSchema as Bc, StewardCapability as Bi, PlanSetMode as Bn, BenefitFeatureType as Bo, IngestRejectionSchema as Br, MeterDef as Bs, ReturnOriginSchema as Bt, DoctorProvider as C, SubscriptionChangeInput as Ca, EntitlementValue as Cc, GrantCreateResponseSchema as Ci, NotificationEmailsSchema as Cn, MAX_CATALOG_METERED_PRICES as Co, EventExternalIdSchema as Cr, MeterAggregation as Cs, DEFAULT_PORTAL_TTL_MINUTES as Ct, DoctorSettings as D, PortalSession as Da, ErrorCategory as Dc, HEADER_REQUEST_ID as Di, PriceChangeNoticeMeteredRateSchema as Dn, PlanDef as Do, EventMetadataValue as Dr, MeterChargeLine as Ds, EventsSettingsSchema as Dt, DoctorReportSchema as E, PORTAL_SESSION_ERRORS as Ea, EntitlementsSchema as Ec, HEADER_IDEMPOTENCY_KEY as Ei, PriceChangeNoticeMeteredRate as En, METERED_PRICE_TAX_MISMATCH as Eo, EventMetadataSchema as Er, MeterCharge as Es, EventsSettingsPatchSchema as Et, DoctorWarningCode as F, BankTransferRecordedSchema as Fa, Interval as Fc, ManualInvoiceResponse as Fi, liveSubscriptionOf as Fn, BENEFIT_TYPES as Fo, IngestEvent as Fr, MeterCreditEntryKind as Fs, PaymentDueDaysSchema as Ft, WebhookEndpoint as G, CheckoutSessionCreateInput as Ga, InvoiceIssueInputSchema as Gi, PlanSetWarningCode as Gn, CatalogBenefitSchema as Go, EntitlementRulesCatalog as Gr, MeterFilterCondition as Gs, WebUrlSchema as Gt, EventTypeSchema as H, CheckoutRedirectTarget as Ha, UncancelSubscriptionResponseSchema as Hi, PlanSetResponse as Hn, BenefitType as Ho, isEventTimestampInRange as Hr, MeterDefSchema as Hs, SettingsLocale as Ht, DoctorWarningSchema as I, CHECKOUT_ERRORS as Ia, IntervalSchema as Ic, ManualInvoiceResponseSchema as Ii, uniqueEmails as In, BenefitDef as Io, IngestEventSchema as Ir, MeterCreditEntryKindSchema as Is, ProductSettings as It, WebhookEndpointList as J, CheckoutSessionCreated as Ja, InvoicePaymentSession as Ji, ResyncResultSchema as Jn, FeatureFlagBenefitDefSchema as Jo, LIVE_SUBSCRIPTION_STATUSES as Jr, MeterFilterOperator as Js, eventsSettingsOf as Jt, WebhookEndpointCreateInput as K, CheckoutSessionCreateInputSchema as Ka, InvoiceLine as Ki, PlanSetWarningSchema as Kn, FeatureFlagAccountBenefit as Ko, EntitlementRulesGrant as Kr, MeterFilterGroup as Ks, applySettingsPatch as Kt, buildDoctorReport as L, CheckoutConsentInput as La, InvoiceBillingReason as Lc, MeResponse as Li, PLAN_SET_MODES as Ln, BenefitDefSchema as Lo, IngestRejectCode as Lr, MeterCreditEntrySchema as Ls, ProductSettingsPatch as Lt, DoctorUnsellablePriceSchema as M, BankTransferRecordInput as Ma, INVOICE_BILLING_REASONS as Mc, InvoiceVoidResponseSchema as Mi, emailTemplateOf as Mn, PriceSchema as Mo, EventsIngestResult as Mr, MeterChargeStatus as Ms, MeteringSettings as Mt, DoctorUnsellableReason as N, BankTransferRecordInputSchema as Na, INVOICE_PAYMENT_STATUSES as Nc, InvoiceWaiveResponse as Ni, emailTemplateSettings as Nn, AccountBenefit as No, EventsIngestResultSchema as Nr, MeterChargeStatusSchema as Ns, MeteringSettingsPatchSchema as Nt, DoctorSettingsSchema as O, PortalSessionCreateInput as Oa, ErrorCategorySchema as Oc, HEADER_SDK as Oi, applyEmailSettingsPatch as On, PlanDefSchema as Oo, EventMetadataValueSchema as Or, MeterChargeLineSchema as Os, LateGraceMinutesSchema as Ot, DoctorWarning as P, BankTransferRecorded as Pa, IdSchema as Pc, InvoiceWaiveResponseSchema as Pi, isEmailRelevant as Pn, AccountBenefitSchema as Po, INGEST_REJECT_CODES as Pr, MeterCreditEntry as Ps, MeteringSettingsSchema as Pt, WebhookEndpointSchema as Q, CheckoutStatusSchema as Qa, InvoiceSchema as Qi, MeterCreditBenefit as Qn, MeterCreditBenefitDef as Qo, ResolvedBenefit as Qr, MeterLabelSchema as Qs, BILLING_PATH_PLACEHOLDERS as Qt, emailReadinessOf as R, CheckoutConsentInputSchema as Ra, InvoiceBillingReasonSchema as Rc, MeResponseSchema as Ri, PlanSetInput as Rn, BenefitDescription as Ro, IngestRejectCodeSchema as Rr, MeterCreditProperties as Rs, ProductSettingsPatchSchema as Rt, DoctorOverageSchema as S, Subscription as Sa, ERROR_CATEGORIES as Sc, GrantCreateResponse as Si, NoticedMeteredRateSchema as Sn, MAX_CATALOG_BENEFITS as So, EVENT_TIMESTAMP_MAX_SKEW_MINUTES as Sr, METER_STANDINGS as Ss, DEFAULT_PAYMENT_DUE_DAYS as St, DoctorReport as T, SubscriptionSchema as Ta, Entitlements as Tc, HEADER_API_VERSION as Ti, PriceChangeNoticeEmailSchema as Tn, MAX_PLAN_BENEFITS as To, EventMetadataKeySchema as Tr, MeterAggregationSchema as Ts, EventsSettings as Tt, WEBHOOK_ENDPOINT_STATUSES as U, CheckoutReturnStatus as Ua, Invoice as Ui, PlanSetResponseSchema as Un, BenefitTypeSchema as Uo, BenefitRulesDefinition as Ur, MeterFilter as Us, SettingsLocaleSchema as Ut, DEFAULT_ENDPOINT_EVENT_TYPES as V, CheckoutPrefillSchema as Va, MetadataSchema as Vc, UncancelSubscriptionResponse as Vi, PlanSetModeSchema as Vn, BenefitSourceSchema as Vo, hasControlCharacters as Vr, MeterDefInput as Vs, SETTINGS_LOCALES as Vt, WEBHOOK_SECRET_PREFIX as W, CheckoutSession as Wa, InvoiceIssueInput as Wi, PlanSetWarning as Wn, CatalogBenefit as Wo, BenefitRulesSubscription as Wr, MeterFilterClause as Ws, TtlMinutesSchema as Wt, WebhookEndpointRotateInput as X, CheckoutSessionSchema as Xa, InvoicePaymentSessionCreateInputSchema as Xi, MeterChargeTotalsLine as Xn, FeatureFlagPropertiesSchema as Xo, ResolveBenefitsInput as Xr, MeterFilterValue as Xs, meteringSettingsOf as Xt, WebhookEndpointListSchema as Y, CheckoutSessionCreatedSchema as Ya, InvoicePaymentSessionCreateInput as Yi, GrantedMeterCredit as Yn, FeatureFlagProperties as Yo, OVERRIDE_BENEFIT_SOURCE as Yr, MeterFilterSchema as Ys, isReturnUrlAllowed as Yt, WebhookEndpointRotateInputSchema as Z, CheckoutStatus as Za, InvoicePaymentSessionSchema as Zi, MeterContribution as Zn, MeterCreditAccountBenefit as Zo, ResolveEntitlementsInput as Zr, MeterLabel as Zs, returnOriginsOf as Zt, DoctorEventsSchema as _, MAX_GRANT_BENEFITS as _a, AmountMinorSchema as _c, ChangeSubscriptionResponseSchema as _i, EmailTemplateSettingsSchema as _n, CatalogSyncResult as _o, EVENT_METADATA_KEY_MAX_LENGTH as _r, METER_CREDIT_ENTRY_KINDS as _s, DEFAULT_CHECKOUT_TTL_MINUTES as _t, DOCTOR_ROLLUP_LAG_WARN_SECONDS as a, ManualInvoiceInput as aa, MeterPeriodStatusSchema as ac, ERROR_CODES as ai, EMAIL_TEMPLATE_BY_EVENT as an, PaymentMethodSchema as ao, contributionOf as ar, AccountMeters as as, webhookEndpointUrlProblem as at, DoctorHostedSchema as b, Stats as ba, CurrencySchema as bc, CreditGrantResponse as bi, MAX_NOTIFICATION_EMAILS as bn, FeatureDefSchema as bo, EVENT_NAME_MAX_LENGTH as br, METER_FILTER_OPERATORS as bs, DEFAULT_METER_CHARGE_MODE as bt, DoctorBillingSchema as c, ManualInvoiceLineInputSchema as ca, MeterUnitsSchema as cc, errorCodeSpec as ci, EmailRelevanceFacts as cn, checkoutRedirectUrl as co, meterCreditsOf as cr, CatalogMeterSchema as cs, BankTransferSettingsPatchSchema as ct, DoctorEmails as d, CancelSubscriptionInput as da, MeteredPriceDefSchema as dc, AccountDetailSchema as di, EmailSettingsPatch as dn, Catalog as do, periodBoundsOf as dr, DEFAULT_METER_LOW_AT as ds, BillingSettingsPatchSchema as dt, InvoiceVoidInput as ea, MeterPeriod as ec, ResolvedEntitlements as ei, BankTransferInstructionsEmailSchema as en, ConsentSchema as eo, MeterRulesEvent as er, featureValueMatchesType as es, WebhookEndpointStatusSchema as et, DoctorEmailsSchema as f, CancelSubscriptionInputSchema as fa, MeteredPriceSchema as fc, AccountUpsertResponse as fi, EmailSettingsPatchSchema as fn, CatalogPlan as fo, rateOverage as fr, DecimalUnitsStringSchema as fs, BillingSettingsSchema as ft, DoctorEvents as g, GrantSchema as ga, ActorRefSchema as gc, ChangeSubscriptionResponse as gi, EmailTemplateSettings as gn, CatalogSyncInputSchema as go, EVENTS_INGEST_MAX_EVENTS as gr, METER_CHARGE_STATUSES as gs, DEFAULT_BANK_TRANSFER_PAYMENT_DAYS as gt, DoctorEndpointSchema as h, GrantCreateInputSchema as ha, API_VERSION as hc, CancelSubscriptionResponseSchema as hi, EmailTemplateSchema as hn, CatalogSyncInput as ho, EVENTS_INGEST_MAX_BYTES as hr, METER_AGGREGATION_KINDS as hs, BrandingSchema as ht, DOCTOR_REQUIRED_LEGAL_LINKS as i, MANUAL_INVOICE_MAX_AMOUNT_MINOR as ia, MeterPeriodStatus as ic, resolveEntitlements as ii, EMAIL_TEMPLATES as in, PaymentMethod as io, consumptionOf as ir, AccountMeterSchema as is, generateWebhookSecret as it, DoctorUnsellablePrice as j, PortalSessionSchema as ja, ExternalRefSchema as jc, InvoiceVoidResponse as ji, emailRecipients as jn, PriceDefSchema as jo, EventsIngestInputSchema as jr, MeterChargeSchema as js, MeterChargeModeSchema as jt, DoctorSeverity as k, PortalSessionCreateInputSchema as ka, ErrorResponse as kc, InvoiceIssueResponse as ki, billingPageUrl as kn, Price as ko, EventNameSchema as kr, MeterChargeList as ks, METER_CHARGE_MODES as kt, DoctorCatalog as l, manualInvoiceTotals as la, MeteredPrice as lc, isKnownErrorCode as li, EmailSenderSchema as ln, AccountsRefreshResult as lo, overageCapReached as lr, CreditGrantInput as ls, BankTransferSettingsSchema as lt, DoctorEndpointDiagnosis as m, GrantCreateInput as ma, meterFilterClauseOf as mc, CancelSubscriptionResponse as mi, EmailTemplate as mn, CatalogSchema as mo, standingOf as mr, MAX_METER_UNITS as ms, BrandingPatchSchema as mt, DOCTOR_PROVIDER_ENVIRONMENTS as n, InvoiceWaiveInput as na, MeterPeriodListSchema as nc, isLiveSubscriptionStatus as ni, EMAIL_LOCALES as nn, MAX_CHECKOUT_CONSENT_DOCS as no, OverageRateInput as nr, isMeterCreditBenefit as ns, WebhookLastDeliverySchema as nt, DOCTOR_SEVERITIES as o, ManualInvoiceInputSchema as oa, MeterStanding as oc, ErrorCode as oi, EmailExtraTextSchema as on, ProviderPayload as oo, matchesFilter as or, AccountMetersSchema as os, BankTransferPaymentDaysSchema as ot, DoctorEndpoint as p, Grant as pa, canonicalMeterFilter as pc, AccountUpsertResponseSchema as pi, EmailSettingsSchema as pn, CatalogPlanSchema as po, rolloverOf as pr, MAX_METERED_PRICE_PER_UNITS as ps, Branding as pt, WebhookEndpointCreateInputSchema as q, CheckoutSessionCreateParsed as qa, InvoiceLineSchema as qi, ResyncResult as qn, FeatureFlagBenefitDef as qo, FEATURE_FLAG_BENEFIT_TYPE as qr, MeterFilterOperand as qs, billingSettingsOf as qt, DOCTOR_REQUIRED_BRANDING as r, InvoiceWaiveInputSchema as ra, MeterPeriodSchema as rc, resolveBenefits as ri, EMAIL_PAYLOAD_SCHEMAS as rn, PAYMENT_METHODS as ro, addUtcMonths as rr, AccountMeter as rs, WebhookSecretSchema as rt, DoctorBilling as s, ManualInvoiceLineInput as sa, MeterStandingSchema as sc, ErrorCodeSpec as si, EmailLocale as sn, ProviderPayloadSchema as so, meterChargeTotals as sr, CatalogMeter as ss, BankTransferSettings as st, DOCTOR_PENDING_BACKLOG_MS as t, InvoiceVoidInputSchema as ta, MeterPeriodList as tc, isGrantActive as ti, BillingPathSchema as tn, INDIVIDUAL_IDENTITY_PLACEHOLDER as to, MeterRulesMeter as tr, isFeatureFlagBenefit as ts, WebhookLastDelivery as tt, DoctorCatalogSchema as u, splitInclusiveTax as ua, MeteredPriceDef as uc, AccountDetail as ui, EmailSettings as un, AccountsRefreshResultSchema as uo, overageOf as ur, CreditGrantInputSchema as us, BillingSettings as ut, DoctorFacts as v, Payment as va, CodeSchema as vc, CheckoutSessionResponse as vi, InvoicePaymentDueEmail as vn, CatalogSyncResultSchema as vo, EVENT_METADATA_MAX_PAIRS as vr, METER_FILTER_MAX_CONDITIONS as vs, DEFAULT_EVENT_RETENTION_DAYS as vt, DoctorProviderSchema as w, SubscriptionChangeInputSchema as wa, EntitlementValueSchema as wc, HEADER_ACTOR_REF as wi, PriceChangeNoticeEmail as wn, MAX_CATALOG_METERS as wo, EventMetadata as wr, MeterAggregationKind as ws, EventRetentionDaysSchema as wt, DoctorOverage as x, StatsSchema as xa, DateTimeSchema as xc, CreditGrantResponseSchema as xi, NoticedMeteredRate as xn, FeatureTypeSchema as xo, EVENT_TIMESTAMP_MAX_AGE_DAYS as xr, METER_PERIOD_STATUSES as xs, DEFAULT_MIN_INVOICE_MINOR as xt, DoctorHosted as y, PaymentSchema as ya, Currency as yc, CheckoutSessionResponseSchema as yi, InvoicePaymentDueEmailSchema as yn, FeatureDef as yo, EVENT_METADATA_STRING_MAX_LENGTH as yr, METER_FILTER_MAX_DEPTH as ys, DEFAULT_LATE_GRACE_MINUTES as yt, endpointDiagnosisOf as z, CheckoutError as za, InvoicePaymentStatus as zc, STEWARD_CAPABILITIES as zi, PlanSetInputSchema as zn, BenefitDescriptionSchema as zo, IngestRejection as zr, MeterCreditPropertiesSchema as zs, ProductSettingsSchema as zt };
6511
+ export { WebhookEndpointRotateInput as $, CreditAdjustmentInput as $a, MeterStandingSchema as $c, InvoicePaymentSessionCreateInputSchema as $i, MeterChargeTotalsLine as $n, ProviderPayloadSchema as $o, ResolveBenefitsInput as $r, CatalogMeter as $s, meteringSettingsOf as $t, DoctorSettings as A, PortalSession as Aa, MeterCreditProperties as Ac, HEADER_REQUEST_ID as Ai, InvoiceBillingReasonSchema as Al, PriceChangeNoticeMeteredRateSchema as An, CheckoutConsentInputSchema as Ao, EventMetadataValue as Ar, BenefitDescription as As, EventsSettingsSchema as At, buildDoctorReport as B, ApiKeyListSchema as Ba, MeterFilterOperator as Bc, MeResponse as Bi, PLAN_SET_MODES as Bn, CheckoutSessionCreated as Bo, IngestRejectCode as Br, FeatureFlagBenefitDefSchema as Bs, ProductSettingsPatch as Bt, DoctorHostedSchema as C, Stats as Ca, MeterChargeSchema as Cc, CreditGrantResponse as Ci, ExternalRefSchema as Cl, MAX_NOTIFICATION_EMAILS as Cn, generateApiKeyToken as Co, EVENT_NAME_MAX_LENGTH as Cr, PriceDefSchema as Cs, DEFAULT_METER_CHARGE_MODE as Ct, DoctorProviderSchema as D, SubscriptionChangeInputSchema as Da, MeterCreditEntryKind as Dc, HEADER_ACTOR_REF as Di, Interval as Dl, PriceChangeNoticeEmail as Dn, BankTransferRecordedSchema as Do, EventMetadata as Dr, BENEFIT_TYPES as Ds, EventRetentionDaysSchema as Dt, DoctorProvider as E, SubscriptionChangeInput as Ea, MeterCreditEntry as Ec, GrantCreateResponseSchema as Ei, IdSchema as El, NotificationEmailsSchema as En, BankTransferRecorded as Eo, EventExternalIdSchema as Er, AccountBenefitSchema as Es, DEFAULT_PORTAL_TTL_MINUTES as Et, DoctorUnsellablePriceSchema as F, API_KEY_SCOPES as Fa, MeterFilter as Fc, InvoiceVoidResponseSchema as Fi, emailTemplateOf as Fn, CheckoutReturnStatus as Fo, EventsIngestResult as Fr, BenefitTypeSchema as Fs, MeteringSettings as Ft, EventTypeSchema as G, ApiKeyTokenSchema as Ga, MeterLowAtSchema as Gc, UncancelSubscriptionResponseSchema as Gi, PlanSetResponse as Gn, Consent as Go, isEventTimestampInRange as Gr, MeterCreditBenefitDefSchema as Gs, SettingsLocale as Gt, endpointDiagnosisOf as H, ApiKeySchema as Ha, MeterFilterValue as Hc, STEWARD_CAPABILITIES as Hi, PlanSetInputSchema as Hn, CheckoutSessionSchema as Ho, IngestRejection as Hr, FeatureFlagPropertiesSchema as Hs, ProductSettingsSchema as Ht, DoctorUnsellableReason as I, ApiKey as Ia, MeterFilterClause as Ic, InvoiceWaiveResponse as Ii, emailTemplateSettings as In, CheckoutSession as Io, EventsIngestResultSchema as Ir, CatalogBenefit as Is, MeteringSettingsPatchSchema as It, WebhookEndpoint as J, BankTransferListItem as Ja, MeterPeriodListSchema as Jc, InvoiceIssueInputSchema as Ji, PlanSetWarningCode as Jn, MAX_CHECKOUT_CONSENT_DOCS as Jo, EntitlementRulesCatalog as Jr, isMeterCreditBenefit as Js, WebUrlSchema as Jt, WEBHOOK_ENDPOINT_STATUSES as K, BANK_TRANSFER_LIST_STATUSES as Ka, MeterPeriod as Kc, Invoice as Ki, PlanSetResponseSchema as Kn, ConsentSchema as Ko, BenefitRulesDefinition as Kr, featureValueMatchesType as Ks, SettingsLocaleSchema as Kt, DoctorWarning as L, ApiKeyCreateInput as La, MeterFilterCondition as Lc, InvoiceWaiveResponseSchema as Li, isEmailRelevant as Ln, CheckoutSessionCreateInput as Lo, INGEST_REJECT_CODES as Lr, CatalogBenefitSchema as Ls, MeteringSettingsSchema as Lt, DoctorSeverity as M, PortalSessionCreateInputSchema as Ma, MeterDef as Mc, InvoiceIssueResponse as Mi, InvoicePaymentStatusSchema as Ml, billingPageUrl as Mn, CheckoutPrefill as Mo, EventNameSchema as Mr, BenefitFeatureType as Ms, METER_CHARGE_MODES as Mt, DoctorSeveritySchema as N, PortalSessionError as Na, MeterDefInput as Nc, InvoiceIssueResponseSchema as Ni, MetadataSchema as Nl, emailLocaleOf as Nn, CheckoutPrefillSchema as No, EventsIngestInput as Nr, BenefitSourceSchema as Ns, MeterChargeMode as Nt, DoctorReport as O, SubscriptionSchema as Oa, MeterCreditEntryKindSchema as Oc, HEADER_API_VERSION as Oi, IntervalSchema as Ol, PriceChangeNoticeEmailSchema as On, CHECKOUT_ERRORS as Oo, EventMetadataKeySchema as Or, BenefitDef as Os, EventsSettings as Ot, DoctorUnsellablePrice as P, PortalSessionSchema as Pa, MeterDefSchema as Pc, InvoiceVoidResponse as Pi, emailRecipients as Pn, CheckoutRedirectTarget as Po, EventsIngestInputSchema as Pr, BenefitType as Ps, MeterChargeModeSchema as Pt, WebhookEndpointListSchema as Q, BankTransferListStatusSchema as Qa, MeterStanding as Qc, InvoicePaymentSessionCreateInput as Qi, GrantedMeterCredit as Qn, ProviderPayload as Qo, OVERRIDE_BENEFIT_SOURCE as Qr, AccountMetersSchema as Qs, isReturnUrlAllowed as Qt, DoctorWarningCode as R, ApiKeyCreateInputSchema as Ra, MeterFilterGroup as Rc, ManualInvoiceResponse as Ri, liveSubscriptionOf as Rn, CheckoutSessionCreateInputSchema as Ro, IngestEvent as Rr, FeatureFlagAccountBenefit as Rs, PaymentDueDaysSchema as Rt, DoctorHosted as S, PaymentSchema as Sa, MeterChargeListSchema as Sc, CheckoutSessionResponseSchema as Si, ErrorResponseSchema as Sl, InvoicePaymentDueEmailSchema as Sn, RepriceResultSchema as So, EVENT_METADATA_STRING_MAX_LENGTH as Sr, PriceDef as Ss, DEFAULT_LATE_GRACE_MINUTES as St, DoctorOverageSchema as T, Subscription as Ta, MeterChargeStatusSchema as Tc, GrantCreateResponse as Ti, INVOICE_PAYMENT_STATUSES as Tl, NoticedMeteredRateSchema as Tn, BankTransferRecordInputSchema as To, EVENT_TIMESTAMP_MAX_SKEW_MINUTES as Tr, AccountBenefit as Ts, DEFAULT_PAYMENT_DUE_DAYS as Tt, hostedReadinessOf as U, ApiKeyScope as Ua, MeterLabel as Uc, StewardCapability as Ui, PlanSetMode as Un, CheckoutStatus as Uo, IngestRejectionSchema as Ur, MeterCreditAccountBenefit as Us, ReturnOriginSchema as Ut, emailReadinessOf as V, ApiKeyPrefixSchema as Va, MeterFilterSchema as Vc, MeResponseSchema as Vi, PlanSetInput as Vn, CheckoutSessionCreatedSchema as Vo, IngestRejectCodeSchema as Vr, FeatureFlagProperties as Vs, ProductSettingsPatchSchema as Vt, DEFAULT_ENDPOINT_EVENT_TYPES as W, ApiKeyScopeSchema as Wa, MeterLabelSchema as Wc, UncancelSubscriptionResponse as Wi, PlanSetModeSchema as Wn, CheckoutStatusSchema as Wo, hasControlCharacters as Wr, MeterCreditBenefitDef as Ws, SETTINGS_LOCALES as Wt, WebhookEndpointCreateInputSchema as X, BankTransferListSchema as Xa, MeterPeriodStatus as Xc, InvoiceLineSchema as Xi, ResyncResult as Xn, PaymentMethod as Xo, FEATURE_FLAG_BENEFIT_TYPE as Xr, AccountMeterSchema as Xs, billingSettingsOf as Xt, WebhookEndpointCreateInput as Y, BankTransferListItemSchema as Ya, MeterPeriodSchema as Yc, InvoiceLine as Yi, PlanSetWarningSchema as Yn, PAYMENT_METHODS as Yo, EntitlementRulesGrant as Yr, AccountMeter as Ys, applySettingsPatch as Yt, WebhookEndpointList as Z, BankTransferListStatus as Za, MeterPeriodStatusSchema as Zc, InvoicePaymentSession as Zi, ResyncResultSchema as Zn, PaymentMethodSchema as Zo, LIVE_SUBSCRIPTION_STATUSES as Zr, AccountMeters as Zs, eventsSettingsOf as Zt, DoctorEndpointDiagnosis as _, GrantCreateInput as _a, MeterAggregationSchema as _c, CancelSubscriptionResponse as _i, Entitlements as _l, EmailTemplate as _n, RepriceInput as _o, standingOf as _r, MAX_PLAN_BENEFITS as _s, BrandingPatchSchema as _t, DOCTOR_REQUIRED_LEGAL_LINKS as a, InvoiceWaiveInput as aa, MAX_METERED_PRICE_PER_UNITS as ac, isLiveSubscriptionStatus as ai, canonicalMeterFilter as al, EMAIL_LOCALES as an, MAX_API_KEY_TTL_DAYS as ao, OverageRateInput as ar, CatalogPlanSchema as as, WebhookLastDeliverySchema as at, DoctorEventsSchema as b, MAX_GRANT_BENEFITS as ba, MeterChargeLineSchema as bc, ChangeSubscriptionResponseSchema as bi, ErrorCategorySchema as bl, EmailTemplateSettingsSchema as bn, RepriceItemSchema as bo, EVENT_METADATA_KEY_MAX_LENGTH as br, PlanDefSchema as bs, DEFAULT_CHECKOUT_TTL_MINUTES as bt, DoctorApiKey as c, ManualInvoiceInput as ca, METER_CHARGE_STATUSES as cc, ERROR_CODES as ci, ActorRefSchema as cl, EMAIL_TEMPLATE_BY_EVENT as cn, MeterClosePeriodsInputSchema as co, contributionOf as cr, CatalogSyncInputSchema as cs, webhookEndpointUrlProblem as ct, DoctorBillingSchema as d, ManualInvoiceLineInputSchema as da, METER_FILTER_MAX_DEPTH as dc, errorCodeSpec as di, Currency as dl, EmailRelevanceFacts as dn, MeterRecomputeInput as do, meterCreditsOf as dr, FeatureDef as ds, BankTransferSettingsPatchSchema as dt, InvoicePaymentSessionSchema as ea, CatalogMeterSchema as ec, ResolveEntitlementsInput as ei, MeterUnitsSchema as el, returnOriginsOf as en, CreditAdjustmentInputSchema as eo, MeterContribution as er, checkoutRedirectUrl as es, WebhookEndpointRotateInputSchema as et, DoctorCatalog as f, manualInvoiceTotals as fa, METER_FILTER_OPERATORS as fc, isKnownErrorCode as fi, CurrencySchema as fl, EmailSenderSchema as fn, MeterRecomputeInputSchema as fo, overageCapReached as fr, FeatureDefSchema as fs, BankTransferSettingsSchema as ft, DoctorEndpoint as g, Grant as ga, MeterAggregationKind as gc, AccountUpsertResponseSchema as gi, EntitlementValueSchema as gl, EmailSettingsSchema as gn, RedeliveredEventSchema as go, rolloverOf as gr, MAX_CATALOG_METERS as gs, Branding as gt, DoctorEmailsSchema as h, CancelSubscriptionInputSchema as ha, MeterAggregation as hc, AccountUpsertResponse as hi, EntitlementValue as hl, EmailSettingsPatchSchema as hn, RedeliveredEvent as ho, rateOverage as hr, MAX_CATALOG_METERED_PRICES as hs, BillingSettingsSchema as ht, DOCTOR_REQUIRED_BRANDING as i, InvoiceVoidInputSchema as ia, DecimalUnitsStringSchema as ic, isGrantActive as ii, MeteredPriceSchema as il, BillingPathSchema as in, DunningPolicySchema as io, MeterRulesMeter as ir, CatalogPlan as is, WebhookLastDelivery as it, DoctorSettingsSchema as j, PortalSessionCreateInput as ja, MeterCreditPropertiesSchema as jc, HEADER_SDK as ji, InvoicePaymentStatus as jl, applyEmailSettingsPatch as jn, CheckoutError as jo, EventMetadataValueSchema as jr, BenefitDescriptionSchema as js, LateGraceMinutesSchema as jt, DoctorReportSchema as k, PORTAL_SESSION_ERRORS as ka, MeterCreditEntrySchema as kc, HEADER_IDEMPOTENCY_KEY as ki, InvoiceBillingReason as kl, PriceChangeNoticeMeteredRate as kn, CheckoutConsentInput as ko, EventMetadataSchema as kr, BenefitDefSchema as ks, EventsSettingsPatchSchema as kt, DoctorApiKeySchema as l, ManualInvoiceInputSchema as la, METER_CREDIT_ENTRY_KINDS as lc, ErrorCode as li, AmountMinorSchema as ll, EmailExtraTextSchema as ln, MeterClosePeriodsResult as lo, matchesFilter as lr, CatalogSyncResult as ls, BankTransferPaymentDaysSchema as lt, DoctorEmails as m, CancelSubscriptionInput as ma, METER_STANDINGS as mc, AccountDetailSchema as mi, ERROR_CATEGORIES as ml, EmailSettingsPatch as mn, MeterRecomputeResultSchema as mo, periodBoundsOf as mr, MAX_CATALOG_BENEFITS as ms, BillingSettingsPatchSchema as mt, DOCTOR_PENDING_BACKLOG_MS as n, InvoiceStatusSchema as na, CreditGrantInputSchema as nc, ResolvedBenefits as ni, MeteredPriceDef as nl, BankTransferInstructionsEmail as nn, DunningPolicy as no, MeterCreditsOptions as nr, AccountsRefreshResultSchema as ns, WebhookEndpointStatus as nt, DOCTOR_ROLLUP_LAG_WARN_SECONDS as o, InvoiceWaiveInputSchema as oa, MAX_METER_UNITS as oc, resolveBenefits as oi, meterFilterClauseOf as ol, EMAIL_PAYLOAD_SCHEMAS as on, MAX_NOTICE_DAYS as oo, addUtcMonths as or, CatalogSchema as os, WebhookSecretSchema as ot, DoctorCatalogSchema as p, splitInclusiveTax as pa, METER_PERIOD_STATUSES as pc, AccountDetail as pi, DateTimeSchema as pl, EmailSettings as pn, MeterRecomputeResult as po, overageOf as pr, FeatureTypeSchema as ps, BillingSettings as pt, WEBHOOK_SECRET_PREFIX as q, BankTransferList as qa, MeterPeriodList as qc, InvoiceIssueInput as qi, PlanSetWarning as qn, INDIVIDUAL_IDENTITY_PLACEHOLDER as qo, BenefitRulesSubscription as qr, isFeatureFlagBenefit as qs, TtlMinutesSchema as qt, DOCTOR_PROVIDER_ENVIRONMENTS as r, InvoiceVoidInput as ra, DEFAULT_METER_LOW_AT as rc, ResolvedEntitlements as ri, MeteredPriceDefSchema as rl, BankTransferInstructionsEmailSchema as rn, DunningPolicyInput as ro, MeterRulesEvent as rr, Catalog as rs, WebhookEndpointStatusSchema as rt, DOCTOR_SEVERITIES as s, MANUAL_INVOICE_MAX_AMOUNT_MINOR as sa, METER_AGGREGATION_KINDS as sc, resolveEntitlements as si, API_VERSION as sl, EMAIL_TEMPLATES as sn, MeterClosePeriodsInput as so, consumptionOf as sr, CatalogSyncInput as ss, generateWebhookSecret as st, DOCTOR_KEY_EXPIRY_WARN_DAYS as t, InvoiceSchema as ta, CreditGrantInput as tc, ResolvedBenefit as ti, MeteredPrice as tl, BILLING_PATH_PLACEHOLDERS as tn, DUNNING_ACTIONS as to, MeterCreditBenefit as tr, AccountsRefreshResult as ts, WebhookEndpointSchema as tt, DoctorBilling as u, ManualInvoiceLineInput as ua, METER_FILTER_MAX_CONDITIONS as uc, ErrorCodeSpec as ui, CodeSchema as ul, EmailLocale as un, MeterClosePeriodsResultSchema as uo, meterChargeTotals as ur, CatalogSyncResultSchema as us, BankTransferSettings as ut, DoctorEndpointSchema as v, GrantCreateInputSchema as va, MeterCharge as vc, CancelSubscriptionResponseSchema as vi, EntitlementsSchema as vl, EmailTemplateSchema as vn, RepriceInputSchema as vo, EVENTS_INGEST_MAX_BYTES as vr, METERED_PRICE_TAX_MISMATCH as vs, BrandingSchema as vt, DoctorOverage as w, StatsSchema as wa, MeterChargeStatus as wc, CreditGrantResponseSchema as wi, INVOICE_BILLING_REASONS as wl, NoticedMeteredRate as wn, BankTransferRecordInput as wo, EVENT_TIMESTAMP_MAX_AGE_DAYS as wr, PriceSchema as ws, DEFAULT_MIN_INVOICE_MINOR as wt, DoctorFacts as x, Payment as xa, MeterChargeList as xc, CheckoutSessionResponse as xi, ErrorResponse as xl, InvoicePaymentDueEmail as xn, RepriceResult as xo, EVENT_METADATA_MAX_PAIRS as xr, Price as xs, DEFAULT_EVENT_RETENTION_DAYS as xt, DoctorEvents as y, GrantSchema as ya, MeterChargeLine as yc, ChangeSubscriptionResponse as yi, ErrorCategory as yl, EmailTemplateSettings as yn, RepriceItem as yo, EVENTS_INGEST_MAX_EVENTS as yr, PlanDef as ys, DEFAULT_BANK_TRANSFER_PAYMENT_DAYS as yt, DoctorWarningSchema as z, ApiKeyList as za, MeterFilterOperand as zc, ManualInvoiceResponseSchema as zi, uniqueEmails as zn, CheckoutSessionCreateParsed as zo, IngestEventSchema as zr, FeatureFlagBenefitDef as zs, ProductSettings as zt };
@@ -1,4 +1,4 @@
1
- import { Ar as EventsIngestInput, Ca as SubscriptionChangeInput, Da as PortalSession, Fi as ManualInvoiceResponse, G as WebhookEndpoint, Ga as CheckoutSessionCreateInput, Hn as PlanSetResponse, It as ProductSettings, J as WebhookEndpointList, Ja as CheckoutSessionCreated, Ji as InvoicePaymentSession, K as WebhookEndpointCreateInput, Li as MeResponse, Lt as ProductSettingsPatch, Mr as EventsIngestResult, Ni as InvoiceWaiveResponse, Oa as PortalSessionCreateInput, Rn as PlanSetInput, Si as GrantCreateResponse, T as DoctorReport, Vi as UncancelSubscriptionResponse, Wi as InvoiceIssueInput, X as WebhookEndpointRotateInput, Yi as InvoicePaymentSessionCreateInput, _o as CatalogSyncResult, aa as ManualInvoiceInput, as as AccountMeters, ba as Stats, bi as CreditGrantResponse, da as CancelSubscriptionInput, do as Catalog, ea as InvoiceVoidInput, fi as AccountUpsertResponse, gi as ChangeSubscriptionResponse, ho as CatalogSyncInput, ji as InvoiceVoidResponse, ki as InvoiceIssueResponse, ks as MeterChargeList, lo as AccountsRefreshResult, ls as CreditGrantInput, ma as GrantCreateInput, mi as CancelSubscriptionResponse, na as InvoiceWaiveInput, qn as ResyncResult, tc as MeterPeriodList, ui as AccountDetail, vi as CheckoutSessionResponse } from "./index.js";
1
+ import { $ as WebhookEndpointRotateInput, $a as CreditAdjustmentInput, Aa as PortalSession, Bi as MeResponse, Bo as CheckoutSessionCreated, Bt as ProductSettingsPatch, Ca as Stats, Ci as CreditGrantResponse, Ea as SubscriptionChangeInput, Eo as BankTransferRecorded, Fr as EventsIngestResult, Gn as PlanSetResponse, Ia as ApiKey, Ii as InvoiceWaiveResponse, J as WebhookEndpoint, La as ApiKeyCreateInput, Lo as CheckoutSessionCreateInput, Mi as InvoiceIssueResponse, Nr as EventsIngestInput, O as DoctorReport, Pi as InvoiceVoidResponse, Qi as InvoicePaymentSessionCreateInput, Ri as ManualInvoiceResponse, Ti as GrantCreateResponse, Vn as PlanSetInput, Wi as UncancelSubscriptionResponse, Xn as ResyncResult, Y as WebhookEndpointCreateInput, Z as WebhookEndpointList, Za as BankTransferListStatus, Zi as InvoicePaymentSession, Zs as AccountMeters, _a as GrantCreateInput, _i as CancelSubscriptionResponse, _o as RepriceInput, aa as InvoiceWaiveInput, ca as ManualInvoiceInput, do as MeterRecomputeInput, hi as AccountUpsertResponse, ho as RedeliveredEvent, ja as PortalSessionCreateInput, lo as MeterClosePeriodsResult, ls as CatalogSyncResult, ma as CancelSubscriptionInput, no as DunningPolicy, pi as AccountDetail, po as MeterRecomputeResult, qa as BankTransferList, qc as MeterPeriodList, qi as InvoiceIssueInput, ra as InvoiceVoidInput, ro as DunningPolicyInput, rs as Catalog, so as MeterClosePeriodsInput, ss as CatalogSyncInput, tc as CreditGrantInput, ts as AccountsRefreshResult, wo as BankTransferRecordInput, xc as MeterChargeList, xi as CheckoutSessionResponse, xo as RepriceResult, yi as ChangeSubscriptionResponse, za as ApiKeyList, zt as ProductSettings } from "./index.js";
2
2
  import { O as AccountInclude, U as AccountState, q as AccountUpsertInput, w as AccountDeleteResponse } from "./events.js";
3
3
  //#region ../contract/src/client.d.ts
4
4
  type CallOptions = {
@@ -262,6 +262,45 @@ type Steward = {
262
262
  /** `status: inactive`; geri alınmaz (yeni endpoint açılır). */
263
263
  deactivate(id: string, options?: MutationOptions): Promise<WebhookEndpoint>;
264
264
  };
265
+ /**
266
+ * API keys of the product (issue #57). The caller generates the token (`generateApiKeyToken()`)
267
+ * and keeps it; steward never returns it. An admin key always expires (default 90 days).
268
+ */
269
+ apiKeys: {
270
+ list(): Promise<ApiKeyList>;
271
+ create(input: ApiKeyCreateInput, options?: MutationOptions): Promise<ApiKey>;
272
+ /** 409 `api_key_self_revoke` for the key making the call. */
273
+ revoke(prefix: string, options?: MutationOptions): Promise<ApiKey>;
274
+ };
275
+ dunning: {
276
+ /** The stored policy, or the default. */
277
+ get(): Promise<DunningPolicy>;
278
+ set(policy: DunningPolicyInput, options?: MutationOptions): Promise<DunningPolicy>;
279
+ };
280
+ events: {
281
+ /** Requeues every delivery of one event (dead ones included); 404 `event_not_found`. */
282
+ redeliver(eventId: string, options?: MutationOptions): Promise<RedeliveredEvent>;
283
+ };
284
+ subscriptions: {
285
+ /** Moves a plan's subscriptions to its current price and metered rates; `dryRun: true` writes nothing. */
286
+ reprice(input: RepriceInput, options?: MutationOptions): Promise<RepriceResult>;
287
+ };
288
+ meters: {
289
+ /** Rebuilds the account's open usage periods from the raw events. */
290
+ recompute(accountRef: string, input?: MeterRecomputeInput, options?: MutationOptions): Promise<MeterRecomputeResult>;
291
+ /** Closes the account's closing periods now instead of after the late window. */
292
+ closePeriods(accountRef: string, input?: MeterClosePeriodsInput, options?: MutationOptions): Promise<MeterClosePeriodsResult>;
293
+ };
294
+ credits: {
295
+ /** Signed units: negative = `adjustment` (admin only), positive = `manual_grant`. */
296
+ adjust(accountRef: string, input: CreditAdjustmentInput, options?: MutationOptions): Promise<CreditGrantResponse>;
297
+ };
298
+ bankTransfers: {
299
+ /** `pending` (default): waiting for a transfer, by deadline; `expired`: the last 30 days. */
300
+ list(status?: BankTransferListStatus): Promise<BankTransferList>;
301
+ /** Records a transfer seen on the bank account (exact amount; see the contract's errors). */
302
+ record(input: BankTransferRecordInput, options?: MutationOptions): Promise<BankTransferRecorded>;
303
+ };
265
304
  };
266
305
  };
267
306
  declare function createSteward(options?: StewardOptions): Steward;