@sylphx/sdk 0.32.3 → 0.32.5

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/money.d.ts CHANGED
@@ -189,6 +189,27 @@ export interface CheckEntitlementResponse {
189
189
  */
190
190
  source?: string;
191
191
  }
192
+ /**
193
+ * Request for CheckMerchantAccountProcessorPermissions. Read-only Stripe
194
+ * calls, with the stored credential; no refresh, key rotation or state write.
195
+ */
196
+ export interface CheckMerchantAccountProcessorPermissionsRequest {
197
+ /** Merchant account resource name. */
198
+ name: string;
199
+ }
200
+ /** Response for CheckMerchantAccountProcessorPermissions. */
201
+ export interface CheckMerchantAccountProcessorPermissionsResponse {
202
+ /** Merchant account resource name. */
203
+ merchantAccount?: string;
204
+ /** True for a live merchant. */
205
+ livemode?: boolean;
206
+ /** All probes, including unavailable results (not a false success). */
207
+ permissions?: ProcessorReadPermission[];
208
+ /** Probe completion time. */
209
+ checkTime?: string;
210
+ /** Fixed warnings; missing access does not stop checkout. */
211
+ warnings?: string[];
212
+ }
192
213
  /** The request of CheckUsageStanding. */
193
214
  export interface CheckUsageStandingRequest {
194
215
  /** The environment. */
@@ -626,6 +647,19 @@ export interface DisconnectMerchantAccountRequest {
626
647
  /** The merchant account to disconnect. */
627
648
  name: string;
628
649
  }
650
+ /**
651
+ * Request for DismissProcessorEvent. Only an owned test-mode payout
652
+ * observation may be dismissed. Live, unknown-mode and payment events are
653
+ * refused. The inbox row and audit remain; no payment or grant is changed.
654
+ */
655
+ export interface DismissProcessorEventRequest {
656
+ /** Event resource name. */
657
+ name: string;
658
+ /** The event's current meta.etag. */
659
+ etag: string;
660
+ /** Must be `test_processor_observation`. */
661
+ reason: string;
662
+ }
629
663
  /**
630
664
  * An Entitlement Grant is one feature a subject holds, from one source: a
631
665
  * subscription, an order, a store purchase, or a manual grant. Money derives
@@ -766,6 +800,11 @@ export interface GetPortalSessionRequest {
766
800
  /** The name of the portal session to get. */
767
801
  name: string;
768
802
  }
803
+ /** Request for GetProcessorEvent. */
804
+ export interface GetProcessorEventRequest {
805
+ /** Event resource name. */
806
+ name: string;
807
+ }
769
808
  /** The request of GetRevenueSource. */
770
809
  export interface GetRevenueSourceRequest {
771
810
  /** The name of the source to get. */
@@ -1142,6 +1181,24 @@ export interface ListMerchantAccountsResponse {
1142
1181
  /** The token of the next page; empty on the last page. */
1143
1182
  nextPageToken?: string;
1144
1183
  }
1184
+ /** Request for ListProcessorEvents. */
1185
+ export interface ListProcessorEventsRequest {
1186
+ /** Environment resource name. */
1187
+ parent: string;
1188
+ /** Default 50, at most 1000. */
1189
+ pageSize?: number;
1190
+ /** Token from the preceding page, bound to environment and filter. */
1191
+ pageToken?: string;
1192
+ /** Only `state = "held"` (the default), `pending`, `applied`, or `dismissed`. */
1193
+ filter?: string;
1194
+ }
1195
+ /** Response for ListProcessorEvents. */
1196
+ export interface ListProcessorEventsResponse {
1197
+ /** Events ordered by received time and event id. */
1198
+ processorEvents?: ProcessorEvent[];
1199
+ /** Empty on the last page. */
1200
+ nextPageToken?: string;
1201
+ }
1145
1202
  /** The request of ListRevenueFacts. */
1146
1203
  export interface ListRevenueFactsRequest {
1147
1204
  /** The org: `orgs/{org}`. */
@@ -1373,6 +1430,15 @@ export interface MerchantAccount {
1373
1430
  * `post_tax_settlement` credit grant exists.
1374
1431
  */
1375
1432
  automaticTax?: boolean;
1433
+ /**
1434
+ * Payouts and Balance read probes. Missing access only delays bookkeeping;
1435
+ * it never disconnects this account or prevents checkout.
1436
+ */
1437
+ readonly processorReadPermissions?: ProcessorReadPermission[];
1438
+ /** When these probes ran. Unset means not checked yet. */
1439
+ readonly processorPermissionsCheckTime?: string;
1440
+ /** Fixed, actionable warnings; never Stripe response bodies or credentials. */
1441
+ readonly processorWarnings?: string[];
1376
1442
  }
1377
1443
  /**
1378
1444
  * A Portal Session is a hosted page where a subject manages its
@@ -1434,6 +1500,57 @@ export interface Price {
1434
1500
  */
1435
1501
  introductoryUnitAmounts?: Record<string, string>;
1436
1502
  }
1503
+ /**
1504
+ * A stored Stripe hint. No payload, customer details, credential or raw error
1505
+ * is returned. Recovery never creates a grant or writes a ledger entry: retry
1506
+ * schedules the existing authenticated, idempotent application path.
1507
+ */
1508
+ export interface ProcessorEvent {
1509
+ /** Name; the final segment is Stripe's event id. */
1510
+ name?: string;
1511
+ /** Stable, server-derived id. */
1512
+ readonly uid?: string;
1513
+ /** Metadata; meta.etag is required on recovery calls. */
1514
+ readonly meta?: common.ResourceMeta;
1515
+ /** Stripe account id, never the customer's identity. */
1516
+ readonly accountId?: string;
1517
+ /** Stripe event type. */
1518
+ readonly eventType?: string;
1519
+ /** Stripe object id (not a payload). */
1520
+ readonly objectId?: string;
1521
+ /** `pending`, `held`, `applied` or `dismissed`. */
1522
+ readonly state?: string;
1523
+ /** `processor_permission_denied`, `attempts_exhausted`, or empty. */
1524
+ readonly holdReason?: string;
1525
+ /** Number of failed application attempts. */
1526
+ readonly attempts?: number;
1527
+ /** Whether the owning merchant is live. Read only when mode_known is true. */
1528
+ readonly livemode?: boolean;
1529
+ /** False when the owning merchant cannot be resolved; never assumes test. */
1530
+ readonly modeKnown?: boolean;
1531
+ /** Last audited recovery decision, if any. Full history is retained. */
1532
+ readonly lastRecovery?: ProcessorEventRecovery;
1533
+ }
1534
+ /** An audited operator decision. No arbitrary free text or personal data. */
1535
+ export interface ProcessorEventRecovery {
1536
+ /** Stable receipt identity, scoped to this event and revision. */
1537
+ readonly receiptId?: string;
1538
+ /** `retry` or `dismiss`. */
1539
+ readonly action?: string;
1540
+ /** `operator_retry`, `permissions_restored`, or `test_processor_observation`. */
1541
+ readonly reason?: string;
1542
+ /** The verified caller's principal, never supplied by the caller. */
1543
+ readonly principal?: string;
1544
+ /** Commit's decision time. */
1545
+ readonly createTime?: string;
1546
+ }
1547
+ /** One read capability; failure never disables taking payments. */
1548
+ export interface ProcessorReadPermission {
1549
+ /** `payouts` or `balance` (Stripe's Payouts and Balance read permissions). */
1550
+ readonly permission?: string;
1551
+ /** `granted`, `missing` (403), or `unavailable` (no conclusion). */
1552
+ readonly state?: string;
1553
+ }
1437
1554
  /** A Product is one thing sold, with its prices and the features it grants. */
1438
1555
  export interface Product {
1439
1556
  /** The product key; `^[a-z][a-z0-9_]{0,63}$`. */
@@ -1529,6 +1646,15 @@ export interface RetireLicenceKeyRequest {
1529
1646
  /** The key to retire. */
1530
1647
  name: string;
1531
1648
  }
1649
+ /** Request for RetryProcessorEvent. Queues a held event once; no inline replay. */
1650
+ export interface RetryProcessorEventRequest {
1651
+ /** Event resource name. */
1652
+ name: string;
1653
+ /** The event's current meta.etag, required to avoid racing another decision. */
1654
+ etag: string;
1655
+ /** `operator_retry` or `permissions_restored`. */
1656
+ reason: string;
1657
+ }
1532
1658
  /** One day or month of a RevenueSummary. */
1533
1659
  export interface RevenueBucket {
1534
1660
  /** The day, or the first day of the month. */
@@ -2470,6 +2596,10 @@ export type ProrationBehavior = 'create_prorations' | 'none' | 'always_invoice'
2470
2596
  * Namespace of Sylphx Money on `Sylphx`.
2471
2597
  */
2472
2598
  export declare class MoneyApi {
2599
+ /** The `processor_events` collection. */
2600
+ readonly processorEvents: ProcessorEventsCollection;
2601
+ /** The `merchant_accounts` collection. */
2602
+ readonly merchantAccounts: MerchantAccountsCollection;
2473
2603
  /** The `price_catalogs` collection. */
2474
2604
  readonly priceCatalogs: PriceCatalogsCollection;
2475
2605
  /** The `checkout_policies` collection. */
@@ -2482,8 +2612,6 @@ export declare class MoneyApi {
2482
2612
  readonly customerSubscriptions: CustomerSubscriptionsCollection;
2483
2613
  /** The `entitlement_grants` collection. */
2484
2614
  readonly entitlementGrants: EntitlementGrantsCollection;
2485
- /** The `merchant_accounts` collection. */
2486
- readonly merchantAccounts: MerchantAccountsCollection;
2487
2615
  /** The `checkout_sessions` collection. */
2488
2616
  readonly checkoutSessions: CheckoutSessionsCollection;
2489
2617
  /** The `tax_threshold_statuses` collection. */
@@ -2520,6 +2648,111 @@ export declare class MoneyApi {
2520
2648
  readonly exchangeRates: ExchangeRatesCollection;
2521
2649
  constructor(client: runtime.Client);
2522
2650
  }
2651
+ /** `processor_events` of Sylphx Money: Resource type `money.sylphx.com/ProcessorEvent`. */
2652
+ export declare class ProcessorEventsCollection {
2653
+ private readonly client;
2654
+ constructor(client: runtime.Client);
2655
+ /**
2656
+ * Gets one stored processor hint, with its safe hold reason.
2657
+ *
2658
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/processor_events/*}` · permission `billing:processor_events:read` · effect `read`
2659
+ *
2660
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`.
2661
+ */
2662
+ get(request: GetProcessorEventRequest): Promise<ProcessorEvent>;
2663
+ /**
2664
+ * Lists stored processor hints; defaults to held events.
2665
+ *
2666
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/processor_events` · permission `billing:processor_events:read` · effect `read`
2667
+ *
2668
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
2669
+ */
2670
+ list(request: ListProcessorEventsRequest): Promise<ListProcessorEventsResponse>;
2671
+ /** Every item of every page of `list`. */
2672
+ listAll(request: ListProcessorEventsRequest): AsyncGenerator<ProcessorEvent>;
2673
+ /**
2674
+ * Schedules a held event through the existing idempotent application path. The decision is audited; an etag is required.
2675
+ *
2676
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/processor_events/*}:retry` · permission `billing:processor_events:write` · effect `write`
2677
+ *
2678
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`.
2679
+ */
2680
+ retry(request: RetryProcessorEventRequest): Promise<ProcessorEvent>;
2681
+ /**
2682
+ * Dismisses only a held test-mode payout observation, retaining the row and audit. Live, unknown-mode and payment events are refused.
2683
+ *
2684
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/processor_events/*}:dismiss` · permission `billing:processor_events:write` · effect `write`
2685
+ *
2686
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`.
2687
+ */
2688
+ dismiss(request: DismissProcessorEventRequest): Promise<ProcessorEvent>;
2689
+ }
2690
+ /** `merchant_accounts` of Sylphx Money: Resource type `money.sylphx.com/MerchantAccount`. */
2691
+ export declare class MerchantAccountsCollection {
2692
+ private readonly client;
2693
+ constructor(client: runtime.Client);
2694
+ /**
2695
+ * Checks Payouts and Balance read without modifying a merchant, its key or checkout.
2696
+ *
2697
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}:checkProcessorPermissions` · permission `billing:read` · effect `read`
2698
+ *
2699
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`.
2700
+ */
2701
+ checkProcessorPermissions(request: CheckMerchantAccountProcessorPermissionsRequest): Promise<CheckMerchantAccountProcessorPermissionsResponse>;
2702
+ /**
2703
+ * Gets a merchant account.
2704
+ *
2705
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}` · permission `billing:read` · effect `read`
2706
+ *
2707
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
2708
+ */
2709
+ get(request: GetMerchantAccountRequest): Promise<MerchantAccount>;
2710
+ /**
2711
+ * Lists merchant accounts.
2712
+ *
2713
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/merchant_accounts` · permission `billing:read` · effect `read`
2714
+ *
2715
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
2716
+ */
2717
+ list(request: ListMerchantAccountsRequest): Promise<ListMerchantAccountsResponse>;
2718
+ /** Every item of every page of `list`. */
2719
+ listAll(request: ListMerchantAccountsRequest): AsyncGenerator<MerchantAccount>;
2720
+ /**
2721
+ * Starts connecting a Stripe account: returns the processor's authorisation
2722
+ * URL for an org owner to open, which the processor's redirect completes.
2723
+ * With a restricted key in the request the account connects at once
2724
+ * instead, and the connected merchant account comes back in the response.
2725
+ *
2726
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/merchant_accounts:connect` · permission `billing:write` · effect `write`
2727
+ *
2728
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `UNAVAILABLE`.
2729
+ */
2730
+ connect(request: ConnectMerchantAccountRequest): Promise<ConnectMerchantAccountResponse>;
2731
+ /**
2732
+ * Reads the connected account back from the processor.
2733
+ *
2734
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}:refresh` · permission `billing:write` · effect `write`
2735
+ *
2736
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNAVAILABLE`.
2737
+ */
2738
+ refresh(request: RefreshMerchantAccountRequest): Promise<MerchantAccount>;
2739
+ /**
2740
+ * Disconnects the account: Sylphx loses access; checkout is refused.
2741
+ *
2742
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}:disconnect` · permission `billing:write` · effect `destructive`
2743
+ *
2744
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNAVAILABLE`.
2745
+ */
2746
+ disconnect(request: DisconnectMerchantAccountRequest): Promise<MerchantAccount>;
2747
+ /**
2748
+ * Updates the merchant account's own settings: the fields named in `update_mask`.
2749
+ *
2750
+ * `PATCH /v1/{merchant_account.name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}` · permission `billing:write` · effect `write`
2751
+ *
2752
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
2753
+ */
2754
+ update(request: UpdateMerchantAccountRequest): Promise<MerchantAccount>;
2755
+ }
2523
2756
  /** `price_catalogs` of Sylphx Money: Resource type `money.sylphx.com/PriceCatalog`. */
2524
2757
  export declare class PriceCatalogsCollection {
2525
2758
  private readonly client;
@@ -2785,64 +3018,6 @@ export declare class EntitlementGrantsCollection {
2785
3018
  */
2786
3019
  create(request: CreateEntitlementGrantRequest): Promise<EntitlementGrant>;
2787
3020
  }
2788
- /** `merchant_accounts` of Sylphx Money: Resource type `money.sylphx.com/MerchantAccount`. */
2789
- export declare class MerchantAccountsCollection {
2790
- private readonly client;
2791
- constructor(client: runtime.Client);
2792
- /**
2793
- * Gets a merchant account.
2794
- *
2795
- * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}` · permission `billing:read` · effect `read`
2796
- *
2797
- * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
2798
- */
2799
- get(request: GetMerchantAccountRequest): Promise<MerchantAccount>;
2800
- /**
2801
- * Lists merchant accounts.
2802
- *
2803
- * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/merchant_accounts` · permission `billing:read` · effect `read`
2804
- *
2805
- * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
2806
- */
2807
- list(request: ListMerchantAccountsRequest): Promise<ListMerchantAccountsResponse>;
2808
- /** Every item of every page of `list`. */
2809
- listAll(request: ListMerchantAccountsRequest): AsyncGenerator<MerchantAccount>;
2810
- /**
2811
- * Starts connecting a Stripe account: returns the processor's authorisation
2812
- * URL for an org owner to open, which the processor's redirect completes.
2813
- * With a restricted key in the request the account connects at once
2814
- * instead, and the connected merchant account comes back in the response.
2815
- *
2816
- * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/merchant_accounts:connect` · permission `billing:write` · effect `write`
2817
- *
2818
- * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `UNAVAILABLE`.
2819
- */
2820
- connect(request: ConnectMerchantAccountRequest): Promise<ConnectMerchantAccountResponse>;
2821
- /**
2822
- * Reads the connected account back from the processor.
2823
- *
2824
- * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}:refresh` · permission `billing:write` · effect `write`
2825
- *
2826
- * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNAVAILABLE`.
2827
- */
2828
- refresh(request: RefreshMerchantAccountRequest): Promise<MerchantAccount>;
2829
- /**
2830
- * Disconnects the account: Sylphx loses access; checkout is refused.
2831
- *
2832
- * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}:disconnect` · permission `billing:write` · effect `destructive`
2833
- *
2834
- * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNAVAILABLE`.
2835
- */
2836
- disconnect(request: DisconnectMerchantAccountRequest): Promise<MerchantAccount>;
2837
- /**
2838
- * Updates the merchant account's own settings: the fields named in `update_mask`.
2839
- *
2840
- * `PATCH /v1/{merchant_account.name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}` · permission `billing:write` · effect `write`
2841
- *
2842
- * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
2843
- */
2844
- update(request: UpdateMerchantAccountRequest): Promise<MerchantAccount>;
2845
- }
2846
3021
  /** `checkout_sessions` of Sylphx Money: Resource type `money.sylphx.com/CheckoutSession`. */
2847
3022
  export declare class CheckoutSessionsCollection {
2848
3023
  private readonly client;