@stewardhq/sdk 0.5.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.
@@ -1,4 +1,4 @@
1
- import { Ai as MeResponse, Bn as ResyncResult, Cr as EventsIngestInput, Ei as InvoiceWaiveResponse, Fn as PlanSetResponse, G as WebhookEndpoint, Go as AccountMeters, Hi as InvoicePaymentSessionCreateInput, J as WebhookEndpointList, K as WebhookEndpointCreateInput, La as CheckoutSessionCreated, Li as InvoiceIssueInput, Mt as ProductSettingsPatch, Oi as ManualInvoiceResponse, Pa as CheckoutSessionCreateInput, Pi as UncancelSubscriptionResponse, Qi as ManualInvoiceInput, Si as InvoiceIssueResponse, T as DoctorReport, Tr as EventsIngestResult, Vi as InvoicePaymentSession, Vs as MeterPeriodList, X as WebhookEndpointRotateInput, Ya as AccountsRefreshResult, Yi as InvoiceWaiveInput, Yo as CreditGrantInput, Za as Catalog, ai as AccountUpsertResponse, ba as PortalSession, di as CheckoutSessionResponse, ga as SubscriptionChangeInput, hi as GrantCreateResponse, hs as MeterChargeList, ia as CancelSubscriptionInput, jn as PlanSetInput, jt as ProductSettings, li as ChangeSubscriptionResponse, pa as Stats, pi as CreditGrantResponse, qi as InvoiceVoidInput, ri as AccountDetail, ro as CatalogSyncResult, sa as GrantCreateInput, si as CancelSubscriptionResponse, to as CatalogSyncInput, wi as InvoiceVoidResponse, xa as PortalSessionCreateInput } 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 = {
@@ -25,7 +25,7 @@ type AccountMetersRead = {
25
25
  };
26
26
  //#endregion
27
27
  //#region src/retry.d.ts
28
- type RetryClass = "network" | "5xx" | "429";
28
+ type RetryClass = 'network' | '5xx' | '429';
29
29
  type RetryOptions = {
30
30
  /** İlk istekten sonraki en çok tekrar sayısı; 0 kapatır. Varsayılan 2. */
31
31
  attempts?: number;
@@ -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;
@@ -280,6 +319,6 @@ declare function httpStatusFor(err: unknown, options?: {
280
319
  }): HttpStatusResult;
281
320
  //#endregion
282
321
  //#region src/locale.d.ts
283
- type StewardLocale = "tr" | "en";
322
+ type StewardLocale = 'tr' | 'en';
284
323
  //#endregion
285
324
  export { CatalogRead as a, Steward as c, StewardOptions as d, createSteward as f, AccountStateRead as g, AccountMetersRead as h, httpStatusFor as i, StewardEnv as l, RetryOptions as m, HttpStatusResult as n, InvoiceDocument as o, RetryClass as p, StewardLogger as r, MutationOptions as s, StewardLocale as t, StewardMe as u };