@sylphx/sdk 0.32.0 → 0.32.1

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.
Files changed (80) hide show
  1. package/README.md +20 -0
  2. package/dist/access.d.ts +34 -0
  3. package/dist/access.js +14 -2
  4. package/dist/access.js.map +1 -1
  5. package/dist/agents.d.ts +1564 -0
  6. package/dist/agents.js +1096 -0
  7. package/dist/agents.js.map +1 -0
  8. package/dist/ai.js +1 -1
  9. package/dist/artifacts.js +1 -1
  10. package/dist/assets.js +1 -1
  11. package/dist/auth/client.js +1 -1
  12. package/dist/auth/end-user-keys-mock.d.ts +83 -0
  13. package/dist/auth/end-user-keys-mock.js +427 -0
  14. package/dist/auth/end-user-keys-mock.js.map +1 -0
  15. package/dist/auth/end-user-keys.d.ts +219 -0
  16. package/dist/auth/end-user-keys.js +240 -0
  17. package/dist/auth/end-user-keys.js.map +1 -0
  18. package/dist/auth/verify.js +1 -1
  19. package/dist/auth.d.ts +201 -2
  20. package/dist/auth.js +148 -2
  21. package/dist/auth.js.map +1 -1
  22. package/dist/billing.d.ts +86 -8
  23. package/dist/billing.js +39 -1
  24. package/dist/billing.js.map +1 -1
  25. package/dist/broker.js +1 -1
  26. package/dist/build.d.ts +361 -28
  27. package/dist/build.js +302 -10
  28. package/dist/build.js.map +1 -1
  29. package/dist/common.js +1 -1
  30. package/dist/config/flags.js +1 -1
  31. package/dist/config.js +1 -1
  32. package/dist/connections.js +1 -1
  33. package/dist/data.d.ts +52 -0
  34. package/dist/data.js +57 -1
  35. package/dist/data.js.map +1 -1
  36. package/dist/entitlement.js +1 -1
  37. package/dist/events/realtime.js +1 -1
  38. package/dist/events/webhooks.js +1 -1
  39. package/dist/events.js +1 -1
  40. package/dist/flags.d.ts +18 -0
  41. package/dist/flags.js +44 -0
  42. package/dist/flags.js.map +1 -0
  43. package/dist/hosting.js +1 -1
  44. package/dist/ids.d.ts +152 -2
  45. package/dist/ids.js +32 -2
  46. package/dist/ids.js.map +1 -1
  47. package/dist/index.d.ts +14 -1
  48. package/dist/index.js +20 -2
  49. package/dist/index.js.map +1 -1
  50. package/dist/keys.js +1 -1
  51. package/dist/knowledge.d.ts +1192 -0
  52. package/dist/knowledge.js +1002 -0
  53. package/dist/knowledge.js.map +1 -0
  54. package/dist/localization.js +1 -1
  55. package/dist/methods.js +1563 -40
  56. package/dist/methods.js.map +1 -1
  57. package/dist/money.d.ts +1687 -7
  58. package/dist/money.js +1269 -1
  59. package/dist/money.js.map +1 -1
  60. package/dist/network.js +1 -1
  61. package/dist/notify.d.ts +346 -1
  62. package/dist/notify.js +249 -1
  63. package/dist/notify.js.map +1 -1
  64. package/dist/observability.d.ts +138 -0
  65. package/dist/observability.js +89 -1
  66. package/dist/observability.js.map +1 -1
  67. package/dist/realtime.d.ts +404 -0
  68. package/dist/realtime.js +312 -0
  69. package/dist/realtime.js.map +1 -0
  70. package/dist/release.js +1 -1
  71. package/dist/runners.js +1 -1
  72. package/dist/runtime.js +1 -1
  73. package/dist/sandboxes.js +1 -1
  74. package/dist/secrets.d.ts +336 -0
  75. package/dist/secrets.js +268 -1
  76. package/dist/secrets.js.map +1 -1
  77. package/dist/workflows.d.ts +119 -3
  78. package/dist/workflows.js +144 -4
  79. package/dist/workflows.js.map +1 -1
  80. package/package.json +2 -2
package/dist/money.d.ts CHANGED
@@ -14,7 +14,7 @@ export interface AppStoreConnection {
14
14
  * returned; omit it on update to keep the stored key.
15
15
  */
16
16
  privateKey?: string;
17
- /** The app's Apple id, needed to verify production notifications. */
17
+ /** The app's Apple id: when set, production notifications must carry it. */
18
18
  appAppleId?: string;
19
19
  /**
20
20
  * An earlier `appAccountToken` scheme the app's shipped builds use: the
@@ -23,6 +23,27 @@ export interface AppStoreConnection {
23
23
  * Money's own scheme are always accepted as well.
24
24
  */
25
25
  accountTokenPrefix?: string;
26
+ /**
27
+ * The store environment this connection serves: `production` or `sandbox`.
28
+ * Only purchases signed for that environment are accepted (plus sandbox
29
+ * ones on a production connection with `allow_sandbox`), and each is read
30
+ * back from its own environment's App Store Server API. Xcode and
31
+ * local-testing signatures are refused either way. A connection created
32
+ * before this field existed serves `production`.
33
+ */
34
+ environment?: string;
35
+ }
36
+ /** The request of BatchIngestUsageEvents. */
37
+ export interface BatchIngestUsageEventsRequest {
38
+ /** The environment to record in. */
39
+ parent: string;
40
+ /** 1 to 500 events. */
41
+ usageEvents: IngestedUsageEvent[];
42
+ }
43
+ /** The response of BatchIngestUsageEvents. */
44
+ export interface BatchIngestUsageEventsResponse {
45
+ /** One per event, in request order. */
46
+ results?: IngestedUsageEventResult[];
26
47
  }
27
48
  /** The request of CancelCustomerSubscription. */
28
49
  export interface CancelCustomerSubscriptionRequest {
@@ -124,6 +145,52 @@ export interface CheckEntitlementResponse {
124
145
  * answer until then.
125
146
  */
126
147
  expireTime?: string;
148
+ /**
149
+ * The answering grant's source, for example `<checkout session>/line_items/<n>`:
150
+ * the `grant` claim of an offline licence token.
151
+ */
152
+ source?: string;
153
+ }
154
+ /** The request of CheckUsageStanding. */
155
+ export interface CheckUsageStandingRequest {
156
+ /** The environment. */
157
+ parent: string;
158
+ /** Whose standing. */
159
+ subject: Subject;
160
+ /** As on UsageReservation: a verified token for the subject. */
161
+ subjectProof: string;
162
+ /** For a customer organization: the acting user's token. */
163
+ actorProof?: string;
164
+ }
165
+ /**
166
+ * A Checkout Policy is an environment's seller setting for which buyers
167
+ * consumer checkout refuses, by buyer country (docs/services/money/web-payments.md,
168
+ * "Denying consumer checkout by country"). One per environment, id `default`;
169
+ * an environment without one refuses nobody.
170
+ */
171
+ export interface CheckoutPolicy {
172
+ /** `orgs/{org}/projects/{project}/envs/{env}/checkout_policies/default`. */
173
+ name?: string;
174
+ /** `cpl_<cell><ulid>`; never reused. */
175
+ readonly uid?: string;
176
+ /** Resource metadata. */
177
+ meta?: common.ResourceMeta;
178
+ /** Desired state. */
179
+ spec?: CheckoutPolicySpec;
180
+ }
181
+ /** CheckoutPolicySpec is the caller-writable state of a CheckoutPolicy. */
182
+ export interface CheckoutPolicySpec {
183
+ /**
184
+ * Buyer countries consumer checkout refuses: ISO 3166-1 alpha-2 codes
185
+ * (`DE`), or the group `EU` (the 27 member states). At most 300 entries.
186
+ * Empty refuses nobody.
187
+ */
188
+ deniedCountryCodes?: string[];
189
+ /**
190
+ * Whether a buyer from a denied country who gives a tax id (a business)
191
+ * may still buy. Checkout then asks for the tax id; default false.
192
+ */
193
+ allowTaxIdBuyers?: boolean;
127
194
  }
128
195
  /**
129
196
  * A Checkout Session is a hosted page where a subject pays for catalog
@@ -165,6 +232,15 @@ export interface CheckoutSession {
165
232
  metadata?: Record<string, string>;
166
233
  /** Whether the buyer may enter a promotion code. */
167
234
  allowPromotionCodes?: boolean;
235
+ /**
236
+ * Where the buyer is, upper-case ISO 3166-1 alpha-2, when the caller knows
237
+ * it (for example from the request's IP address). A country the
238
+ * environment's checkout policy denies is refused here, before any page is
239
+ * made, unless the policy lets a business buy. Not trusted for anything
240
+ * else: the billing address the buyer gives is checked again when the
241
+ * payment completes.
242
+ */
243
+ buyerCountryCode?: string;
168
244
  /** The hosted page. */
169
245
  readonly url?: string;
170
246
  /** `open`, `complete`, or `expired`. */
@@ -173,6 +249,46 @@ export interface CheckoutSession {
173
249
  readonly expireTime?: string;
174
250
  /** The processor's session id. */
175
251
  readonly processorSessionId?: string;
252
+ /**
253
+ * Why a completed checkout was refused and refunded instead of delivered:
254
+ * `country_denied` (the billing country is on the checkout policy's list) or
255
+ * `country_unknown` (no billing country to check). Empty otherwise.
256
+ */
257
+ readonly deniedReason?: string;
258
+ /**
259
+ * The billing country the completed checkout was checked against, upper-case
260
+ * ISO 3166-1 alpha-2; empty until completion.
261
+ */
262
+ readonly billingCountryCode?: string;
263
+ /**
264
+ * The billing state or province, upper-case, kept only for the countries
265
+ * whose tax thresholds are per subdivision (`US`, `CA`); empty otherwise.
266
+ * Nothing else of the buyer's address is stored.
267
+ */
268
+ readonly billingSubdivisionCode?: string;
269
+ }
270
+ /** The request of ClientVerifyStorePurchase. */
271
+ export interface ClientVerifyStorePurchaseRequest {
272
+ /** The environment the purchase is verified in. */
273
+ parent: string;
274
+ /** Who bought it: `end_user` of `inst_` and a lower-case UUID. */
275
+ subject: Subject;
276
+ /** `app_store` or `google_play`. */
277
+ store: string;
278
+ /** App Store: the StoreKit 2 signed transaction (`jwsRepresentation`). */
279
+ signedTransaction?: string;
280
+ /** Google Play: the purchase token. */
281
+ purchaseToken?: string;
282
+ /** Google Play: the store product id (for a subscription, its id). */
283
+ productId?: string;
284
+ /** Google Play: the package name, when the connection covers several. */
285
+ packageName?: string;
286
+ /**
287
+ * The account token the app set at purchase (Play `obfuscatedAccountId`,
288
+ * App Store `appAccountToken`). A consistency check only: it must match
289
+ * the subject's derivation and the store's copy.
290
+ */
291
+ accountToken?: string;
176
292
  }
177
293
  /** The request of ConnectMerchantAccount. */
178
294
  export interface ConnectMerchantAccountRequest {
@@ -221,6 +337,29 @@ export interface CreateCheckoutSessionRequest {
221
337
  /** The id, the final name segment; the server assigns one when empty. */
222
338
  checkoutSessionId?: string;
223
339
  }
340
+ /** The request of CreateCreditGrant. */
341
+ export interface CreateCreditGrantRequest {
342
+ /** The environment to create in. */
343
+ parent: string;
344
+ /** The credit grant. */
345
+ creditGrant: CreditGrant;
346
+ }
347
+ /** The request of CreateEntitlementGrant. */
348
+ export interface CreateEntitlementGrantRequest {
349
+ /** The environment the grant is in. */
350
+ parent: string;
351
+ /**
352
+ * The grant's id, also its idempotency: `^[a-z]([a-z0-9_-]{0,61}[a-z0-9])?$`.
353
+ * The same id with the same grant returns the stored one; the same id with
354
+ * another grant is RESOURCE_ALREADY_EXISTS.
355
+ */
356
+ entitlementGrantId: string;
357
+ /**
358
+ * The grant: `subject`, `feature`, `expire_time` (future, at most 400 days
359
+ * out), `campaign`, `reason` and `approval_ref` are required.
360
+ */
361
+ entitlementGrant: EntitlementGrant;
362
+ }
224
363
  /** The request of CreatePortalSession. */
225
364
  export interface CreatePortalSessionRequest {
226
365
  /** The parent to create in. */
@@ -230,6 +369,20 @@ export interface CreatePortalSessionRequest {
230
369
  /** The id, the final name segment; the server assigns one when empty. */
231
370
  portalSessionId?: string;
232
371
  }
372
+ /** The request of CreateRevenueSource. */
373
+ export interface CreateRevenueSourceRequest {
374
+ /** The org to create in: `orgs/{org}`. */
375
+ parent: string;
376
+ /**
377
+ * The source's id; `^[a-z]([a-z0-9_-]{0,61}[a-z0-9])?$`. Empty: Money
378
+ * assigns one.
379
+ */
380
+ revenueSourceId?: string;
381
+ /** The source to create. */
382
+ revenueSource: RevenueSource;
383
+ /** Validate only; write nothing. */
384
+ validateOnly?: boolean;
385
+ }
233
386
  /** The request of CreateStoreConnection. */
234
387
  export interface CreateStoreConnectionRequest {
235
388
  /** The parent to create in. */
@@ -241,6 +394,66 @@ export interface CreateStoreConnectionRequest {
241
394
  /** Validate and return the result without writing anything. */
242
395
  validateOnly?: boolean;
243
396
  }
397
+ /** The request of CreateUsageEvent. */
398
+ export interface CreateUsageEventRequest {
399
+ /** The environment to create in. */
400
+ parent: string;
401
+ /** The usage event. */
402
+ usageEvent: UsageEvent;
403
+ }
404
+ /** The request of CreateUsageMeterPrice. */
405
+ export interface CreateUsageMeterPriceRequest {
406
+ /** The environment to create in. */
407
+ parent: string;
408
+ /** The price. */
409
+ usageMeterPrice: UsageMeterPrice;
410
+ }
411
+ /** The request of CreateUsageReservation. */
412
+ export interface CreateUsageReservationRequest {
413
+ /** The environment to create in. */
414
+ parent: string;
415
+ /** The reservation. */
416
+ usageReservation: UsageReservation;
417
+ }
418
+ /**
419
+ * A Credit Grant is credit a merchant gives a subject: audited, append-only,
420
+ * invoiced at full price and then offset once at invoice issue, soonest
421
+ * expiry first. A change is a new grant that supersedes the old one.
422
+ */
423
+ export interface CreditGrant {
424
+ /** `orgs/{org}/projects/{project}/envs/{env}/credit_grants/{credit_grant}`. */
425
+ name?: string;
426
+ /** `cgrt_<cell><ulid>`; never reused. */
427
+ readonly uid?: string;
428
+ /** Resource metadata. */
429
+ meta?: common.ResourceMeta;
430
+ /** Who receives it. */
431
+ subject?: Subject;
432
+ /** `amount` (a total) or `monthly_cap` (up to the amount in each month). */
433
+ kind?: string;
434
+ /** Minor units, a decimal string. */
435
+ amountMinor?: string;
436
+ /** When it starts applying. */
437
+ startTime?: string;
438
+ /** When it stops applying; required. Not renewing is how charging starts. */
439
+ expireTime?: string;
440
+ /** Who approved it. */
441
+ approver?: string;
442
+ /** Why. */
443
+ reason?: string;
444
+ /** The grant this one replaces. */
445
+ supersedes?: string;
446
+ /**
447
+ * `undecided`, `price_reduction`, or `post_tax_settlement`; no default.
448
+ * `post_tax_settlement` is refused while the merchant has automatic tax on.
449
+ */
450
+ taxTreatment?: string;
451
+ /**
452
+ * `standard` or `hold`; no default. Over the credit, a held invoice stays
453
+ * due but is not collected until an explicit audited release.
454
+ */
455
+ collectionMode?: string;
456
+ }
244
457
  /**
245
458
  * A Customer Subscription is a subject's recurring purchase, mirrored from
246
459
  * the processor after Money read it back. Money writes it; a caller changes it
@@ -275,6 +488,18 @@ export interface CustomerSubscription {
275
488
  /** The checkout's metadata. */
276
489
  readonly metadata?: Record<string, unknown>;
277
490
  }
491
+ /** The request of DeleteRevenueSource. */
492
+ export interface DeleteRevenueSourceRequest {
493
+ /**
494
+ * The source to delete, with the facts it reported. The `money` source
495
+ * cannot be deleted (pause it instead).
496
+ */
497
+ name: string;
498
+ /** The current etag; when set, the delete happens only if it matches. */
499
+ etag?: string;
500
+ /** Validate only; delete nothing. */
501
+ validateOnly?: boolean;
502
+ }
278
503
  /** The request of DeleteStoreConnection. */
279
504
  export interface DeleteStoreConnectionRequest {
280
505
  /** The name of the store connection to delete. */
@@ -300,15 +525,56 @@ export interface EntitlementGrant {
300
525
  /** Resource metadata. */
301
526
  meta?: common.ResourceMeta;
302
527
  /** Who holds it. */
303
- readonly subject?: Subject;
528
+ subject?: Subject;
304
529
  /** The feature key. */
305
- readonly feature?: string;
530
+ feature?: string;
306
531
  /** For a `limit` feature, the allowance as a decimal string. */
307
532
  readonly limit?: string;
308
533
  /** The resource that grants it, for example a customer subscription's name. */
309
534
  readonly source?: string;
310
535
  /** When it ends; unset for no end. */
311
- readonly expireTime?: string;
536
+ expireTime?: string;
537
+ /** A manual grant's campaign (input on create, up to 64 characters). */
538
+ campaign?: string;
539
+ /** A manual grant's reason (input on create, up to 500 characters). */
540
+ reason?: string;
541
+ /**
542
+ * A free-text reference to the approval, for example `CEO 2026-10-02`
543
+ * (input on create, up to 200 characters).
544
+ */
545
+ approvalRef?: string;
546
+ /**
547
+ * The principal that created a manual grant: the verified key's principal,
548
+ * never a request field.
549
+ */
550
+ readonly approver?: string;
551
+ }
552
+ /**
553
+ * An Exchange Rate is the units of one currency per US dollar on one day,
554
+ * from the ECB reference rates (ADR §3). A day the ECB did not publish
555
+ * carries the previous business day's rate, named in `published_on`. The
556
+ * table is the same for every org: any reader that converts uses it.
557
+ */
558
+ export interface ExchangeRate {
559
+ /** `orgs/{org}/exchange_rates/{currency}-{YYYY-MM-DD}`, lower case. */
560
+ name?: string;
561
+ /** The rate's id, as in its name. */
562
+ readonly uid?: string;
563
+ /** Resource metadata. */
564
+ meta?: common.ResourceMeta;
565
+ /** The day, `YYYY-MM-DD`. */
566
+ readonly day?: string;
567
+ /** ISO 4217 code. */
568
+ readonly currencyCode?: string;
569
+ /** Units of the currency per US dollar, as a decimal string. */
570
+ readonly perUsd?: string;
571
+ /** `ecb`. */
572
+ readonly source?: string;
573
+ /**
574
+ * The publication the rate is from: the day itself, or the business day
575
+ * before a weekend or holiday.
576
+ */
577
+ readonly publicationDay?: string;
312
578
  }
313
579
  /**
314
580
  * A Feature is what an app checks, for example `plus` or
@@ -339,11 +605,21 @@ export interface GetCatalogRequest {
339
605
  /** The name of the catalog to get. */
340
606
  name: string;
341
607
  }
608
+ /** The request of GetCheckoutPolicy. */
609
+ export interface GetCheckoutPolicyRequest {
610
+ /** The name of the checkout policy to get. */
611
+ name: string;
612
+ }
342
613
  /** The request of GetCheckoutSession. */
343
614
  export interface GetCheckoutSessionRequest {
344
615
  /** The name of the checkout session to get. */
345
616
  name: string;
346
617
  }
618
+ /** The request of GetCreditGrant. */
619
+ export interface GetCreditGrantRequest {
620
+ /** The name of the credit grant to get. */
621
+ name: string;
622
+ }
347
623
  /** The request of GetCustomerSubscription. */
348
624
  export interface GetCustomerSubscriptionRequest {
349
625
  /** The name of the customer subscription to get. */
@@ -369,6 +645,35 @@ export interface GetPortalSessionRequest {
369
645
  /** The name of the portal session to get. */
370
646
  name: string;
371
647
  }
648
+ /** The request of GetRevenueSource. */
649
+ export interface GetRevenueSourceRequest {
650
+ /** The name of the source to get. */
651
+ name: string;
652
+ }
653
+ /** The request of GetRevenueSummary. */
654
+ export interface GetRevenueSummaryRequest {
655
+ /** `orgs/{org}/revenue`. */
656
+ name: string;
657
+ /**
658
+ * `today`, `mtd` (month to date, the default), `month` (with `month`), or
659
+ * `range` (with `start_day` and `end_day`). Days are UTC.
660
+ */
661
+ period?: string;
662
+ /** The month of a `month` period, `YYYY-MM`. */
663
+ month?: string;
664
+ /** The first day of a `range`, `YYYY-MM-DD`. */
665
+ startDay?: string;
666
+ /** The last day of a `range`, inclusive; at most 400 days after the first. */
667
+ endDay?: string;
668
+ /** `day` (the default) or `month`. */
669
+ groupBy?: string;
670
+ /** `none` (the default), `source` or `product`. */
671
+ split?: string;
672
+ /** `net` (the default) or `gross`. */
673
+ amount?: string;
674
+ /** The reporting currency, ISO 4217; default `USD`. */
675
+ currencyCode?: string;
676
+ }
372
677
  /** The request of GetStoreConnection. */
373
678
  export interface GetStoreConnectionRequest {
374
679
  /** The name of the store connection to get. */
@@ -379,6 +684,26 @@ export interface GetStorePurchaseRequest {
379
684
  /** The name of the store purchase to get. */
380
685
  name: string;
381
686
  }
687
+ /** The request of GetUsageInvoice. */
688
+ export interface GetUsageInvoiceRequest {
689
+ /** The name of the usage invoice to get. */
690
+ name: string;
691
+ }
692
+ /** The request of GetUsageMeter. */
693
+ export interface GetUsageMeterRequest {
694
+ /** The name of the usage meter to get. */
695
+ name: string;
696
+ }
697
+ /** The request of GetUsageReservation. */
698
+ export interface GetUsageReservationRequest {
699
+ /** The name of the usage reservation to get. */
700
+ name: string;
701
+ }
702
+ /** The request of GetUsageSettings. */
703
+ export interface GetUsageSettingsRequest {
704
+ /** The name of the usage settings to get. */
705
+ name: string;
706
+ }
382
707
  /** GooglePlayConnection is a Play service account and the app's package names. */
383
708
  export interface GooglePlayConnection {
384
709
  /** The apps' package names. */
@@ -415,6 +740,44 @@ export interface ImportLicenceKeyRequest {
415
740
  /** Shown to operators. */
416
741
  spec?: LicenceKeySpec;
417
742
  }
743
+ /** One already-incurred usage event of a batch. */
744
+ export interface IngestedUsageEvent {
745
+ /**
746
+ * The emitter's id of this event, 1 to 128 characters of `[A-Za-z0-9._:-]`;
747
+ * with the meter and its version, the dedupe key.
748
+ */
749
+ eventId?: string;
750
+ /** The meter. */
751
+ meter?: string;
752
+ /** The emitter's version of the meter's definition, 1 or more. */
753
+ meterVersion?: number;
754
+ /** Who used it, as attributed by the emitter. */
755
+ subject?: Subject;
756
+ /** How much, 1 to 2^40. */
757
+ quantity?: string;
758
+ /** When it happened. */
759
+ occurredTime?: string;
760
+ }
761
+ /** What became of one ingested event. */
762
+ export interface IngestedUsageEventResult {
763
+ /** The event's `event_id`. */
764
+ eventId?: string;
765
+ /**
766
+ * `accepted` (recorded now), `duplicate` (already recorded with the same
767
+ * content: a no-op), `conflict` (its key was recorded with other content;
768
+ * this one is never counted) or `rejected` (refused; see `reason`).
769
+ */
770
+ outcome?: string;
771
+ /**
772
+ * For `rejected`: `invalid` (a field is out of range), `unpriced` (no
773
+ * active meter with a price in force at `occurred_time`) or
774
+ * `reservation_required` (the meter records only through a reservation);
775
+ * empty otherwise.
776
+ */
777
+ reason?: string;
778
+ /** The UsageEvent that counts this usage, for `accepted` and `duplicate`. */
779
+ usageEvent?: string;
780
+ }
418
781
  /**
419
782
  * A Licence Key is one Ed25519 signing key Money holds for an environment. The
420
783
  * private half is generated here (or imported once, for a key already pinned in
@@ -528,6 +891,24 @@ export interface LineItem {
528
891
  /** How many; default 1. Seats for a per-seat or family price. */
529
892
  quantity?: number;
530
893
  }
894
+ /** The request of ListCreditGrants. */
895
+ export interface ListCreditGrantsRequest {
896
+ /** The parent to list in. */
897
+ parent: string;
898
+ /** At most this many; default 50, clamped to 1000. */
899
+ pageSize?: number;
900
+ /** `next_page_token` of the previous page. */
901
+ pageToken?: string;
902
+ /** AIP-160 filter, for example `subject = "…"`. */
903
+ filter?: string;
904
+ }
905
+ /** The response of ListCreditGrants. */
906
+ export interface ListCreditGrantsResponse {
907
+ /** The page. */
908
+ creditGrants?: CreditGrant[];
909
+ /** The token of the next page; empty on the last page. */
910
+ nextPageToken?: string;
911
+ }
531
912
  /** The request of ListCustomerSubscriptions. */
532
913
  export interface ListCustomerSubscriptionsRequest {
533
914
  /** The parent to list in. */
@@ -564,6 +945,28 @@ export interface ListEntitlementGrantsResponse {
564
945
  /** The token of the next page; empty on the last page. */
565
946
  nextPageToken?: string;
566
947
  }
948
+ /** The request of ListExchangeRates. */
949
+ export interface ListExchangeRatesRequest {
950
+ /** The org reading: `orgs/{org}`. The rates are the same for every org. */
951
+ parent: string;
952
+ /** At most this many; default 50, clamped to 1000. */
953
+ pageSize?: number;
954
+ /** `next_page_token` of the previous page. */
955
+ pageToken?: string;
956
+ /**
957
+ * AIP-160 filter, comparisons joined with `AND`: `currency_code = "EUR"`,
958
+ * `day >= "YYYY-MM-DD"`, `day <= "YYYY-MM-DD"`. The days
959
+ * default to the 31 days to today (UTC), and span at most 400 days.
960
+ */
961
+ filter?: string;
962
+ }
963
+ /** The response of ListExchangeRates. */
964
+ export interface ListExchangeRatesResponse {
965
+ /** The page, newest day first, then by currency. */
966
+ exchangeRates?: ExchangeRate[];
967
+ /** The token of the next page; empty on the last page. */
968
+ nextPageToken?: string;
969
+ }
567
970
  /** The request of ListLicenceKeys. */
568
971
  export interface ListLicenceKeysRequest {
569
972
  /** The parent to list in. */
@@ -618,6 +1021,45 @@ export interface ListMerchantAccountsResponse {
618
1021
  /** The token of the next page; empty on the last page. */
619
1022
  nextPageToken?: string;
620
1023
  }
1024
+ /** The request of ListRevenueFacts. */
1025
+ export interface ListRevenueFactsRequest {
1026
+ /** The org: `orgs/{org}`. */
1027
+ parent: string;
1028
+ /** At most this many; default 50, clamped to 1000. */
1029
+ pageSize?: number;
1030
+ /** `next_page_token` of the previous page. */
1031
+ pageToken?: string;
1032
+ /**
1033
+ * AIP-160 filter, comparisons joined with `AND`: `source = "…"` (a source
1034
+ * id or name), `basis`, `store_kind`, `product_ref` (each `=`), and
1035
+ * `day >= "YYYY-MM-DD"`, `day <= "YYYY-MM-DD"`. The days default to the 31
1036
+ * days to today (UTC), and span at most 400 days.
1037
+ */
1038
+ filter?: string;
1039
+ }
1040
+ /** The response of ListRevenueFacts. */
1041
+ export interface ListRevenueFactsResponse {
1042
+ /** The page, newest day first. */
1043
+ revenueFacts?: RevenueFact[];
1044
+ /** The token of the next page; empty on the last page. */
1045
+ nextPageToken?: string;
1046
+ }
1047
+ /** The request of ListRevenueSources. */
1048
+ export interface ListRevenueSourcesRequest {
1049
+ /** The org to list in: `orgs/{org}`. */
1050
+ parent: string;
1051
+ /** At most this many; default 50, clamped to 1000. */
1052
+ pageSize?: number;
1053
+ /** `next_page_token` of the previous page. */
1054
+ pageToken?: string;
1055
+ }
1056
+ /** The response of ListRevenueSources. */
1057
+ export interface ListRevenueSourcesResponse {
1058
+ /** The page, by id, each with its freshness. */
1059
+ revenueSources?: RevenueSource[];
1060
+ /** The token of the next page; empty on the last page. */
1061
+ nextPageToken?: string;
1062
+ }
621
1063
  /** The request of ListStoreConnections. */
622
1064
  export interface ListStoreConnectionsRequest {
623
1065
  /** The parent to list in. */
@@ -654,6 +1096,110 @@ export interface ListStorePurchasesResponse {
654
1096
  /** The token of the next page; empty on the last page. */
655
1097
  nextPageToken?: string;
656
1098
  }
1099
+ /** The request of ListTaxThresholdStatuses. */
1100
+ export interface ListTaxThresholdStatusesRequest {
1101
+ /** The parent to list in. */
1102
+ parent: string;
1103
+ /** At most this many; default 50, clamped to 1000. */
1104
+ pageSize?: number;
1105
+ /** `next_page_token` of the previous page. */
1106
+ pageToken?: string;
1107
+ }
1108
+ /** The response of ListTaxThresholdStatuses. */
1109
+ export interface ListTaxThresholdStatusesResponse {
1110
+ /** The page. */
1111
+ taxThresholdStatuses?: TaxThresholdStatus[];
1112
+ /** The token of the next page; empty on the last page. */
1113
+ nextPageToken?: string;
1114
+ }
1115
+ /** The request of ListUsageEvents. */
1116
+ export interface ListUsageEventsRequest {
1117
+ /** The parent to list in. */
1118
+ parent: string;
1119
+ /** At most this many; default 50, clamped to 1000. */
1120
+ pageSize?: number;
1121
+ /** `next_page_token` of the previous page. */
1122
+ pageToken?: string;
1123
+ /** AIP-160 filter, for example `subject = "…"`. */
1124
+ filter?: string;
1125
+ }
1126
+ /** The response of ListUsageEvents. */
1127
+ export interface ListUsageEventsResponse {
1128
+ /** The page. */
1129
+ usageEvents?: UsageEvent[];
1130
+ /** The token of the next page; empty on the last page. */
1131
+ nextPageToken?: string;
1132
+ }
1133
+ /** The request of ListUsageInvoices. */
1134
+ export interface ListUsageInvoicesRequest {
1135
+ /** The parent to list in. */
1136
+ parent: string;
1137
+ /** At most this many; default 50, clamped to 1000. */
1138
+ pageSize?: number;
1139
+ /** `next_page_token` of the previous page. */
1140
+ pageToken?: string;
1141
+ /** AIP-160 filter, for example `subject = "…"`. */
1142
+ filter?: string;
1143
+ }
1144
+ /** The response of ListUsageInvoices. */
1145
+ export interface ListUsageInvoicesResponse {
1146
+ /** The page. */
1147
+ usageInvoices?: UsageInvoice[];
1148
+ /** The token of the next page; empty on the last page. */
1149
+ nextPageToken?: string;
1150
+ }
1151
+ /** The request of ListUsageMeterPrices. */
1152
+ export interface ListUsageMeterPricesRequest {
1153
+ /** The parent to list in. */
1154
+ parent: string;
1155
+ /** At most this many; default 50, clamped to 1000. */
1156
+ pageSize?: number;
1157
+ /** `next_page_token` of the previous page. */
1158
+ pageToken?: string;
1159
+ /** AIP-160 filter, for example `meter = "tokens"`. */
1160
+ filter?: string;
1161
+ }
1162
+ /** The response of ListUsageMeterPrices. */
1163
+ export interface ListUsageMeterPricesResponse {
1164
+ /** The page. */
1165
+ usageMeterPrices?: UsageMeterPrice[];
1166
+ /** The token of the next page; empty on the last page. */
1167
+ nextPageToken?: string;
1168
+ }
1169
+ /** The request of ListUsageMeters. */
1170
+ export interface ListUsageMetersRequest {
1171
+ /** The parent to list in. */
1172
+ parent: string;
1173
+ /** At most this many; default 50, clamped to 1000. */
1174
+ pageSize?: number;
1175
+ /** `next_page_token` of the previous page. */
1176
+ pageToken?: string;
1177
+ }
1178
+ /** The response of ListUsageMeters. */
1179
+ export interface ListUsageMetersResponse {
1180
+ /** The page. */
1181
+ usageMeters?: UsageMeter[];
1182
+ /** The token of the next page; empty on the last page. */
1183
+ nextPageToken?: string;
1184
+ }
1185
+ /** The request of ListUsageTiers. */
1186
+ export interface ListUsageTiersRequest {
1187
+ /** The parent to list in. */
1188
+ parent: string;
1189
+ /** At most this many; default 50, clamped to 1000. */
1190
+ pageSize?: number;
1191
+ /** `next_page_token` of the previous page. */
1192
+ pageToken?: string;
1193
+ /** AIP-160 filter, for example `subject = "…"`. */
1194
+ filter?: string;
1195
+ }
1196
+ /** The response of ListUsageTiers. */
1197
+ export interface ListUsageTiersResponse {
1198
+ /** The page. */
1199
+ usageTiers?: UsageTier[];
1200
+ /** The token of the next page; empty on the last page. */
1201
+ nextPageToken?: string;
1202
+ }
657
1203
  /**
658
1204
  * A Merchant Account is the seller an environment charges as on the web: the
659
1205
  * customer's own Stripe account, connected through Stripe Connect OAuth, or
@@ -698,6 +1244,14 @@ export interface MerchantAccount {
698
1244
  * key, held sealed).
699
1245
  */
700
1246
  readonly credential?: string;
1247
+ /**
1248
+ * Whether Stripe computes tax on this merchant's checkouts and usage
1249
+ * invoices (its own cost decision: Stripe Tax charges per transaction).
1250
+ * Off by default. Writable through `UpdateMerchantAccount`
1251
+ * (`update_mask = "automatic_tax"`). Turning it on is refused while a live
1252
+ * `post_tax_settlement` credit grant exists.
1253
+ */
1254
+ automaticTax?: boolean;
701
1255
  }
702
1256
  /**
703
1257
  * A Portal Session is a hosted page where a subject manages its
@@ -791,6 +1345,18 @@ export interface RefreshMerchantAccountRequest {
791
1345
  /** The merchant account to read back. */
792
1346
  name: string;
793
1347
  }
1348
+ /** The request of ReleaseUsageInvoiceCollection. */
1349
+ export interface ReleaseUsageInvoiceCollectionRequest {
1350
+ /** The held invoice to release for collection. */
1351
+ name: string;
1352
+ /** Who releases it, and why: both are kept. */
1353
+ reason: string;
1354
+ }
1355
+ /** The request of ReleaseUsageReservation. */
1356
+ export interface ReleaseUsageReservationRequest {
1357
+ /** The reservation to release. */
1358
+ name: string;
1359
+ }
794
1360
  /** The request of ResumeCustomerSubscription. */
795
1361
  export interface ResumeCustomerSubscriptionRequest {
796
1362
  /** The subscription to resume. */
@@ -801,8 +1367,251 @@ export interface RetireLicenceKeyRequest {
801
1367
  /** The key to retire. */
802
1368
  name: string;
803
1369
  }
1370
+ /** One day or month of a RevenueSummary. */
1371
+ export interface RevenueBucket {
1372
+ /** The day, or the first day of the month. */
1373
+ startDay?: string;
1374
+ /** The bucket's total in minor units of the reporting currency. */
1375
+ total?: string;
1376
+ /**
1377
+ * The weakest basis that counted in the bucket: `final` when every row is
1378
+ * a source's final statement, `estimated` or `booked` otherwise.
1379
+ */
1380
+ basis?: string;
1381
+ /** A stale source has not reported this bucket yet. */
1382
+ incomplete?: boolean;
1383
+ /** Daily rows of this bucket with no rate yet. */
1384
+ unconvertedCount?: string;
1385
+ /** The bucket per source or product; empty when `split` is `none`. */
1386
+ lines?: RevenueLine[];
1387
+ }
804
1388
  /**
805
- * A Store Connection is the environment's access to one app store: its App
1389
+ * A Revenue Fact is one line a source reported, in that line's own currency
1390
+ * (ADR §1): read for audit and export. Facts are written by Money's own
1391
+ * bookings and by imports, never through this API.
1392
+ */
1393
+ export interface RevenueFact {
1394
+ /** `orgs/{org}/revenue_facts/{revenue_fact}`. */
1395
+ name?: string;
1396
+ /** The fact's id: a hash of its source and external key. */
1397
+ readonly uid?: string;
1398
+ /** Resource metadata. */
1399
+ meta?: common.ResourceMeta;
1400
+ /** The source that reported it: `orgs/{org}/revenue_sources/{id}`. */
1401
+ readonly source?: string;
1402
+ /** The source's own identity for the line. */
1403
+ readonly externalKey?: string;
1404
+ /** `booked`, `estimated` or `final`. */
1405
+ readonly basis?: string;
1406
+ /** `transaction`, `day` or `month`. */
1407
+ readonly granularity?: string;
1408
+ /** The source's reporting day; the first of the month for a month row. */
1409
+ readonly day?: string;
1410
+ /** `stripe`, `app_store`, `google_play`, `ad_network` or `other`. */
1411
+ readonly storeKind?: string;
1412
+ /** The account the source reports for. */
1413
+ readonly accountRef?: string;
1414
+ /** The product reference the source uses. */
1415
+ readonly productRef?: string;
1416
+ /** The store's item id. */
1417
+ readonly sku?: string;
1418
+ /** Buyer country (ISO 3166-1 alpha-2), where the source reports it. */
1419
+ readonly regionCode?: string;
1420
+ /** ISO 4217 code of the amounts. */
1421
+ readonly currencyCode?: string;
1422
+ /** What the buyer paid. */
1423
+ readonly gross?: string;
1424
+ /** The store's or processor's fee. */
1425
+ readonly fee?: string;
1426
+ /** Tax. */
1427
+ readonly tax?: string;
1428
+ /** What the org earns. */
1429
+ readonly net?: string;
1430
+ /** Items or orders, where reported. */
1431
+ readonly units?: string;
1432
+ /** The day the money reached the bank; empty until the source says so. */
1433
+ readonly settledOn?: string;
1434
+ }
1435
+ /** One source's or product's share of a total. */
1436
+ export interface RevenueLine {
1437
+ /**
1438
+ * The source's name (`orgs/{org}/revenue_sources/{id}`), or the product as
1439
+ * `{store_kind}/{product_ref}`.
1440
+ */
1441
+ key?: string;
1442
+ /**
1443
+ * The source's display name, or the product's label; the reference itself
1444
+ * when the product has no label.
1445
+ */
1446
+ label?: string;
1447
+ /** In minor units of the reporting currency. */
1448
+ total?: string;
1449
+ }
1450
+ /**
1451
+ * A Revenue Source is one place an org's revenue is read from. `kind`
1452
+ * selects the connector Money implements once (ADR §2). The `money` source
1453
+ * is implicit, one per environment with Money, made the first time Money
1454
+ * books a sale there; it cannot be created or deleted through the API, only
1455
+ * renamed or paused. A connector's credential is sealed and never returned;
1456
+ * connectors arrive kind by kind, and a source of a kind whose connector has
1457
+ * not shipped yet is registered and reported stale until it first syncs.
1458
+ */
1459
+ export interface RevenueSource {
1460
+ /** `orgs/{org}/revenue_sources/{revenue_source}`. */
1461
+ name?: string;
1462
+ /** The source's id (`rvs-…`); never reused. */
1463
+ readonly uid?: string;
1464
+ /** Resource metadata. */
1465
+ meta?: common.ResourceMeta;
1466
+ /** Desired state. */
1467
+ spec?: RevenueSourceSpec;
1468
+ /** Observed state. */
1469
+ readonly status?: RevenueSourceStatus;
1470
+ }
1471
+ /** RevenueSourceSpec is the caller-writable state of a RevenueSource. */
1472
+ export interface RevenueSourceSpec {
1473
+ /**
1474
+ * `money`, `stripe`, `google_play`, `app_store`, `ad_network`, `file` or
1475
+ * `manual`. Set on create and never changed; `money` is never created.
1476
+ */
1477
+ kind?: string;
1478
+ /** Shown on summaries and in the console. */
1479
+ displayName?: string;
1480
+ /** A paused source is not synced and cannot be run; its facts still count. */
1481
+ paused?: boolean;
1482
+ /**
1483
+ * The connector's settings (an account id, a bucket, a column mapping),
1484
+ * never a credential. At most 32 entries.
1485
+ */
1486
+ config?: Record<string, string>;
1487
+ }
1488
+ /** RevenueSourceStatus is the observed state of a RevenueSource. */
1489
+ export interface RevenueSourceStatus {
1490
+ /** The generation this status was computed from. */
1491
+ readonly observedGeneration?: string;
1492
+ /**
1493
+ * `Ready` while the source is fresh; `False` with reason `Stale`,
1494
+ * `Paused` or `NeverSynced` otherwise.
1495
+ */
1496
+ readonly conditions?: common.Condition[];
1497
+ /**
1498
+ * For a `money` source, the environment it books:
1499
+ * `orgs/{org}/projects/{project}/envs/{env}`. Empty for every other kind.
1500
+ */
1501
+ readonly environment?: string;
1502
+ /**
1503
+ * When the source last synced successfully. Unset for a `money` source,
1504
+ * which books in real time.
1505
+ */
1506
+ readonly lastSuccessTime?: string;
1507
+ /** The newest day the source holds, `YYYY-MM-DD`; empty when it holds none. */
1508
+ readonly newestDay?: string;
1509
+ /**
1510
+ * The newest day is older than the kind's normal lag plus one day, or the
1511
+ * source has never synced: summaries name it and mark the days it has not
1512
+ * reported as incomplete.
1513
+ */
1514
+ readonly stale?: boolean;
1515
+ /** The last run: `running`, `succeeded` or `failed`; empty before the first. */
1516
+ readonly lastRunState?: string;
1517
+ /** The last failed run's error code; never a response body. */
1518
+ readonly lastRunError?: string;
1519
+ }
1520
+ /**
1521
+ * The Revenue Summary is an org's revenue over a period, read from the daily
1522
+ * roll-up and never from raw facts (ADR §4), converted into one reporting
1523
+ * currency at each day's rate (§3), with the highest basis counting for each
1524
+ * store, product and day (§1 "Which row counts"). Computed on every read;
1525
+ * nothing writes it.
1526
+ */
1527
+ export interface RevenueSummary {
1528
+ /** `orgs/{org}/revenue`. */
1529
+ name?: string;
1530
+ /** The org's id. */
1531
+ readonly uid?: string;
1532
+ /** Resource metadata. */
1533
+ readonly meta?: common.ResourceMeta;
1534
+ /** The first day of the period, `YYYY-MM-DD`. */
1535
+ readonly startDay?: string;
1536
+ /** The last day of the period, inclusive. */
1537
+ readonly endDay?: string;
1538
+ /** The reporting currency every converted amount is in. */
1539
+ readonly currencyCode?: string;
1540
+ /** `net` or `gross`. */
1541
+ readonly amount?: string;
1542
+ /** `day` or `month`. */
1543
+ readonly groupBy?: string;
1544
+ /** `none`, `source` or `product`. */
1545
+ readonly split?: string;
1546
+ /** The period's total, in minor units of the reporting currency. */
1547
+ readonly total?: string;
1548
+ /** One bucket per day or month that holds revenue, oldest first. */
1549
+ readonly buckets?: RevenueBucket[];
1550
+ /**
1551
+ * The period's total per source or product, largest first; empty when
1552
+ * `split` is `none`.
1553
+ */
1554
+ readonly lines?: RevenueLine[];
1555
+ /** Sources that report late: their missing days make the period incomplete. */
1556
+ readonly staleSources?: StaleRevenueSource[];
1557
+ /**
1558
+ * Amounts with no exchange rate for their day yet, in their own currency:
1559
+ * counted here, never in `total`.
1560
+ */
1561
+ readonly unconverted?: UnconvertedAmount[];
1562
+ /** Daily rows that had no rate and are in `unconverted`. */
1563
+ readonly unconvertedCount?: string;
1564
+ /** A stale source has not reported some day of the period. */
1565
+ readonly incomplete?: boolean;
1566
+ }
1567
+ /** The request of RunRevenueSource. */
1568
+ export interface RunRevenueSourceRequest {
1569
+ /** The source to run. */
1570
+ name: string;
1571
+ /**
1572
+ * `sync` (default) reads what is new; `backfill` re-reads the period
1573
+ * `start_day` to `end_day`.
1574
+ */
1575
+ mode?: string;
1576
+ /** The first day of a backfill, `YYYY-MM-DD`. */
1577
+ startDay?: string;
1578
+ /** The last day of a backfill, `YYYY-MM-DD`, inclusive. */
1579
+ endDay?: string;
1580
+ }
1581
+ /** The response of RunRevenueSource. */
1582
+ export interface RunRevenueSourceResponse {
1583
+ /** The run's id. */
1584
+ run?: string;
1585
+ /** `succeeded`, `failed`, or `running` while a connector works through it. */
1586
+ state?: string;
1587
+ /** The facts the run wrote. */
1588
+ facts?: string;
1589
+ /** The source after the run. */
1590
+ revenueSource?: RevenueSource;
1591
+ }
1592
+ /** The request of SettleUsageReservation. */
1593
+ export interface SettleUsageReservationRequest {
1594
+ /** The reservation to settle. */
1595
+ name: string;
1596
+ /**
1597
+ * What was used, in the meter's base unit; 0 to the granted quantity, or
1598
+ * more after expiry (the work happened).
1599
+ */
1600
+ quantityUsed: string;
1601
+ /** When the work happened; now when absent. */
1602
+ occurredTime?: string;
1603
+ }
1604
+ /** A source named on a summary because it reports late. */
1605
+ export interface StaleRevenueSource {
1606
+ /** `orgs/{org}/revenue_sources/{id}`. */
1607
+ source?: string;
1608
+ /** The source's display name. */
1609
+ displayName?: string;
1610
+ /** The newest day it holds; empty when it holds none. */
1611
+ newestDay?: string;
1612
+ }
1613
+ /**
1614
+ * A Store Connection is the environment's access to one app store: its App
806
1615
  * Store Server API key or Google Play service account, sealed by Money and
807
1616
  * never returned, and the apps (bundle ids or package names) it covers.
808
1617
  */
@@ -831,8 +1640,10 @@ export interface StoreConnectionSpec {
831
1640
  /** Google Play. */
832
1641
  googlePlay?: GooglePlayConnection;
833
1642
  /**
834
- * Accept purchases the store marks as sandbox or license-test. Off in
835
- * production: a sandbox purchase is then refused.
1643
+ * Accept purchases the store marks as sandbox or license-test. Off: a
1644
+ * sandbox purchase is refused. On a `production` App Store connection it
1645
+ * also takes App Review and TestFlight purchases, read back from the
1646
+ * sandbox and recorded and granted as `sandbox`, never as production.
836
1647
  */
837
1648
  allowSandbox?: boolean;
838
1649
  /**
@@ -840,6 +1651,13 @@ export interface StoreConnectionSpec {
840
1651
  * Store `appAccountToken`, Play `obfuscatedAccountId`).
841
1652
  */
842
1653
  requireAccountToken?: boolean;
1654
+ /**
1655
+ * Let an app with no server verify its own purchases against this
1656
+ * connection (`store_purchases:clientVerify`, callable with a publishable
1657
+ * key). Off by default, including for every connection created before this
1658
+ * field existed; only a secret key holding `billing:write` can turn it on.
1659
+ */
1660
+ clientVerify?: boolean;
843
1661
  }
844
1662
  /** StoreConnectionStatus is the observed state of a StoreConnection. */
845
1663
  export interface StoreConnectionStatus {
@@ -898,6 +1716,16 @@ export interface StorePurchase {
898
1716
  readonly currencyCode?: string;
899
1717
  /** The subscription it belongs to, for a subscription purchase. */
900
1718
  readonly customerSubscription?: string;
1719
+ /**
1720
+ * ISO 3166-1 alpha-2 country of the buyer's storefront, upper case; empty
1721
+ * when the store did not report one.
1722
+ */
1723
+ readonly regionCode?: string;
1724
+ /**
1725
+ * When the store says the first purchase of this subscription or restored
1726
+ * purchase was made; unset when it did not report one.
1727
+ */
1728
+ readonly originalPurchaseTime?: string;
901
1729
  /**
902
1730
  * Revoked after it was delivered, and its goods come back: its
903
1731
  * entitlements ended, and the app takes back the assets its grant credited,
@@ -921,6 +1749,78 @@ export interface SyncCatalogRequest {
921
1749
  /** The catalog to push. */
922
1750
  name: string;
923
1751
  }
1752
+ /**
1753
+ * A Tax Threshold Status is where the environment's consumer (B2C) paid
1754
+ * sales stand against one jurisdiction's registration threshold for digital
1755
+ * services (docs/services/money/web-payments.md, "Tax registration
1756
+ * thresholds"). It is computed on read from the sales Money recorded and the
1757
+ * threshold table; nothing about it is written by a caller.
1758
+ */
1759
+ export interface TaxThresholdStatus {
1760
+ /**
1761
+ * `orgs/{org}/projects/{project}/envs/{env}/tax_threshold_statuses/{threshold}`,
1762
+ * the threshold's id (`au-gst`, `us-tx`).
1763
+ */
1764
+ name?: string;
1765
+ /** The threshold's id, as in `name`. */
1766
+ readonly uid?: string;
1767
+ /** Resource metadata; not set for a computed view. */
1768
+ meta?: common.ResourceMeta;
1769
+ /** The jurisdiction's country, upper-case ISO 3166-1 alpha-2. */
1770
+ readonly regionCode?: string;
1771
+ /** The jurisdiction's subdivision (a US state, `TX`); empty for a country. */
1772
+ readonly subdivisionCode?: string;
1773
+ /** The tax the threshold registers for, for example `GST`. */
1774
+ readonly taxName?: string;
1775
+ /** The threshold's currency, upper-case ISO 4217. */
1776
+ readonly currencyCode?: string;
1777
+ /**
1778
+ * The amount that triggers registration, integer minor units of
1779
+ * `currency_code`; "0" when the threshold is a transaction count only.
1780
+ */
1781
+ readonly thresholdAmount?: string;
1782
+ /** The transaction count that triggers registration; 0 when none. */
1783
+ readonly thresholdTransactionCount?: string;
1784
+ /** `rolling_12_months`, `calendar_year`, or `prior_or_current_calendar_year`. */
1785
+ readonly windowKind?: string;
1786
+ /** The start (inclusive) of the window the figures below cover. */
1787
+ readonly windowStartTime?: string;
1788
+ /** The end of the window (the moment of the read for a rolling window). */
1789
+ readonly windowEndTime?: string;
1790
+ /**
1791
+ * The consumer paid sales in the window, net of tax, in `currency_code`
1792
+ * minor units. Business sales (a tax id was given) are excluded.
1793
+ */
1794
+ readonly salesAmount?: string;
1795
+ /** The number of those sales. */
1796
+ readonly salesTransactionCount?: string;
1797
+ /**
1798
+ * How close the sales are to the threshold, in whole percent (the higher of
1799
+ * the amount and the count); it can exceed 100.
1800
+ */
1801
+ readonly percent?: number;
1802
+ /**
1803
+ * The highest alert level (70, 90, 100) already sent for this window; 0 if
1804
+ * none.
1805
+ */
1806
+ readonly alertedPercent?: number;
1807
+ /**
1808
+ * Currencies of sales that could not be converted into `currency_code`
1809
+ * (no rate in the rate table) and so are not counted in `sales_amount`.
1810
+ */
1811
+ readonly unconvertedCurrencyCodes?: string[];
1812
+ /** The authority page the threshold comes from. */
1813
+ readonly sourceUrl?: string;
1814
+ /** When the threshold row took effect. */
1815
+ readonly effectiveTime?: string;
1816
+ }
1817
+ /** An amount a summary could not convert yet. */
1818
+ export interface UnconvertedAmount {
1819
+ /** ISO 4217 code. */
1820
+ currencyCode?: string;
1821
+ /** In minor units of that currency. */
1822
+ amount?: string;
1823
+ }
924
1824
  /** The request of UpdateCatalog. */
925
1825
  export interface UpdateCatalogRequest {
926
1826
  /** The catalog to write; `name` identifies it. */
@@ -932,6 +1832,17 @@ export interface UpdateCatalogRequest {
932
1832
  /** Validate and return the result without writing anything. */
933
1833
  validateOnly?: boolean;
934
1834
  }
1835
+ /** The request of UpdateCheckoutPolicy. */
1836
+ export interface UpdateCheckoutPolicyRequest {
1837
+ /** The checkout policy to write; `name` identifies it. */
1838
+ checkoutPolicy: CheckoutPolicy;
1839
+ /** The fields to write; unset writes every populated field. */
1840
+ updateMask?: string;
1841
+ /** Create the policy when it does not exist (declarative upsert). */
1842
+ allowMissing?: boolean;
1843
+ /** Validate and return the result without writing anything. */
1844
+ validateOnly?: boolean;
1845
+ }
935
1846
  /** The request of UpdateCustomerSubscriptionQuantity. */
936
1847
  export interface UpdateCustomerSubscriptionQuantityRequest {
937
1848
  /** The subscription to change. */
@@ -944,6 +1855,25 @@ export interface UpdateCustomerSubscriptionQuantityRequest {
944
1855
  /** How the change is billed; unspecified is `create_prorations`. */
945
1856
  prorationBehavior?: ProrationBehavior;
946
1857
  }
1858
+ /** The request of UpdateMerchantAccount. */
1859
+ export interface UpdateMerchantAccountRequest {
1860
+ /** The merchant account with its new values; `name` selects it. */
1861
+ merchantAccount: MerchantAccount;
1862
+ /** The fields to change. */
1863
+ updateMask?: string;
1864
+ }
1865
+ /** The request of UpdateRevenueSource. */
1866
+ export interface UpdateRevenueSourceRequest {
1867
+ /** The source with its new values; `name` addresses it. */
1868
+ revenueSource: RevenueSource;
1869
+ /**
1870
+ * The fields to change: `spec.display_name`, `spec.paused`,
1871
+ * `spec.config`. Empty changes every one the body sets.
1872
+ */
1873
+ updateMask?: string;
1874
+ /** Validate only; write nothing. */
1875
+ validateOnly?: boolean;
1876
+ }
947
1877
  /** The request of UpdateStoreConnection. */
948
1878
  export interface UpdateStoreConnectionRequest {
949
1879
  /** The store connection to update; `name` identifies it. */
@@ -955,6 +1885,280 @@ export interface UpdateStoreConnectionRequest {
955
1885
  /** Validate and return the result without writing anything. */
956
1886
  validateOnly?: boolean;
957
1887
  }
1888
+ /** The request of UpdateUsageMeter. */
1889
+ export interface UpdateUsageMeterRequest {
1890
+ /** The usage meter with its new values; `name` selects it. */
1891
+ usageMeter: UsageMeter;
1892
+ /** The fields to change. */
1893
+ updateMask?: string;
1894
+ }
1895
+ /** The request of UpdateUsageSettings. */
1896
+ export interface UpdateUsageSettingsRequest {
1897
+ /** The usage settings with its new values; `name` selects it. */
1898
+ usageSettings: UsageSettings;
1899
+ /** The fields to change. */
1900
+ updateMask?: string;
1901
+ }
1902
+ /** The request of UpdateUsageTier. */
1903
+ export interface UpdateUsageTierRequest {
1904
+ /** The usage tier with its new values; `name` selects it. */
1905
+ usageTier: UsageTier;
1906
+ /** The fields to change. */
1907
+ updateMask?: string;
1908
+ }
1909
+ /**
1910
+ * A Usage Event is rated usage, immutable: what a settled reservation or a
1911
+ * direct record produced.
1912
+ */
1913
+ export interface UsageEvent {
1914
+ /** `orgs/{org}/projects/{project}/envs/{env}/usage_events/{usage_event}`. */
1915
+ name?: string;
1916
+ /** `uevt_<cell><ulid>`; never reused. */
1917
+ readonly uid?: string;
1918
+ /** Resource metadata. */
1919
+ meta?: common.ResourceMeta;
1920
+ /** Who used it. */
1921
+ subject?: Subject;
1922
+ /** As on UsageReservation. */
1923
+ subjectProof?: string;
1924
+ /** As on UsageReservation. */
1925
+ actorProof?: string;
1926
+ /** The meter's lookup key. */
1927
+ meter?: string;
1928
+ /** How much, in the meter's base unit. */
1929
+ quantity?: string;
1930
+ /** When the work happened. */
1931
+ occurredTime?: string;
1932
+ /** The rated amount, nano-minor, a decimal string. */
1933
+ readonly amountNano?: string;
1934
+ /** The reservation it settled, when it did. */
1935
+ readonly usageReservation?: string;
1936
+ /** Settled after the reservation expired; the usage is still recorded. */
1937
+ readonly late?: boolean;
1938
+ }
1939
+ /**
1940
+ * A Usage Invoice is Money's own invoice for a subject's usage. A `threshold`
1941
+ * invoice is cut mid-month; the `period` invoice nets those off.
1942
+ */
1943
+ export interface UsageInvoice {
1944
+ /** `orgs/{org}/projects/{project}/envs/{env}/usage_invoices/{usage_invoice}`. */
1945
+ name?: string;
1946
+ /** `uinv_<cell><ulid>`; never reused. */
1947
+ readonly uid?: string;
1948
+ /** Resource metadata. */
1949
+ meta?: common.ResourceMeta;
1950
+ /** The invoice number. */
1951
+ readonly number?: string;
1952
+ /** Who owes it. */
1953
+ readonly subject?: Subject;
1954
+ /** The month, `YYYY-MM`. */
1955
+ readonly period?: string;
1956
+ /** `period` or `threshold`. */
1957
+ readonly kind?: string;
1958
+ /** `tax_pending`, `issued`, or `void`. */
1959
+ readonly state?: string;
1960
+ /** Why it is not issued yet, when `tax_pending` (for example `location_required`, `grant_tax_treatment`). */
1961
+ readonly taxPendingReason?: string;
1962
+ /** The amounts, minor units, decimal strings. */
1963
+ readonly grossMinor?: string;
1964
+ /** Before tax. */
1965
+ readonly subtotalMinor?: string;
1966
+ /** The tax. */
1967
+ readonly taxMinor?: string;
1968
+ /** Credit settled after tax. */
1969
+ readonly postTaxCreditMinor?: string;
1970
+ /** What is owed: subtotal plus tax minus post-tax credit. */
1971
+ readonly totalMinor?: string;
1972
+ /** Paid so far. */
1973
+ readonly amountPaidMinor?: string;
1974
+ /** `standard` or `hold`, fixed at issue. */
1975
+ readonly collectionMode?: string;
1976
+ /** When it was issued. */
1977
+ readonly issueTime?: string;
1978
+ /** When it is due. */
1979
+ readonly dueTime?: string;
1980
+ }
1981
+ /**
1982
+ * A Usage Meter names one kind of usage a merchant bills for: its unit and
1983
+ * whether usage may be recorded without a reservation. The merchant creates
1984
+ * and changes it through this API; its prices are `UsageMeterPrice` records.
1985
+ */
1986
+ export interface UsageMeter {
1987
+ /** `orgs/{org}/projects/{project}/envs/{env}/usage_meters/{usage_meter}`; the id is the meter key. */
1988
+ name?: string;
1989
+ /** `umtr_<cell><ulid>`; never reused. */
1990
+ readonly uid?: string;
1991
+ /** Resource metadata. */
1992
+ meta?: common.ResourceMeta;
1993
+ /**
1994
+ * The unit of one quantity, for example `token`. It cannot change once the
1995
+ * meter has recorded usage.
1996
+ */
1997
+ unit?: string;
1998
+ /** A name for people. */
1999
+ displayName?: string;
2000
+ /** Whether usage may be recorded without a reservation. */
2001
+ reservationOptional?: boolean;
2002
+ /** A retired meter (false) refuses new usage; its history stays. */
2003
+ active?: boolean;
2004
+ /**
2005
+ * The unit price in force now, nano-minor, a decimal string; empty before
2006
+ * the meter's first price.
2007
+ */
2008
+ readonly currentUnitPriceNano?: string;
2009
+ }
2010
+ /**
2011
+ * A Usage Meter Price is one entry of a meter's append-only price history. A
2012
+ * price applies from `effective_time` on, so a change never rewrites usage
2013
+ * already rated.
2014
+ */
2015
+ export interface UsageMeterPrice {
2016
+ /** `orgs/{org}/projects/{project}/envs/{env}/usage_meter_prices/{usage_meter_price}`. */
2017
+ name?: string;
2018
+ /** `umpr_<cell><ulid>`; never reused. */
2019
+ readonly uid?: string;
2020
+ /** Resource metadata. */
2021
+ meta?: common.ResourceMeta;
2022
+ /** The meter's key. */
2023
+ meter?: string;
2024
+ /** ISO 4217; it must be the environment's currency. */
2025
+ currencyCode?: string;
2026
+ /** List price of one unit, nano-minor (a billionth of a minor unit), a decimal string. */
2027
+ unitPriceNano?: string;
2028
+ /**
2029
+ * When it starts applying; now when absent. Not in the past, and after the
2030
+ * meter's latest price.
2031
+ */
2032
+ effectiveTime?: string;
2033
+ /** The processor's tax code for the usage line; empty for the merchant's default. */
2034
+ taxCode?: string;
2035
+ }
2036
+ /**
2037
+ * A Usage Reservation holds usage before the work starts. Settling it records
2038
+ * what was used and releases the rest; releasing it records nothing.
2039
+ */
2040
+ export interface UsageReservation {
2041
+ /** `orgs/{org}/projects/{project}/envs/{env}/usage_reservations/{usage_reservation}`. */
2042
+ name?: string;
2043
+ /** `ures_<cell><ulid>`; never reused. */
2044
+ readonly uid?: string;
2045
+ /** Resource metadata. */
2046
+ meta?: common.ResourceMeta;
2047
+ /** Who uses it. */
2048
+ subject?: Subject;
2049
+ /**
2050
+ * The acting end user's access token, required on every reserve: Money
2051
+ * proves the subject itself, fresh, with the caller's own key
2052
+ * (`auth:sessions:verify`) or the merchant's configured issuer. Never
2053
+ * stored. A raw id is refused with PERMISSION_DENIED (reason `subject_unverified`).
2054
+ */
2055
+ subjectProof?: string;
2056
+ /**
2057
+ * For a customer organization: the token of the acting user, whose
2058
+ * membership of the organization is checked fresh. The subject is Sylphx
2059
+ * Auth's bare organization id (`acme`), never a resource name. Never stored.
2060
+ */
2061
+ actorProof?: string;
2062
+ /** The meter's lookup key. */
2063
+ meter?: string;
2064
+ /** The most the work may use, in the meter's base unit. */
2065
+ maxQuantity?: string;
2066
+ /** How long the hold lasts, at most `600s`; default `600s`. */
2067
+ ttl?: string;
2068
+ /** What was granted: at most `max_quantity`, less under headroom. */
2069
+ readonly grantedQuantity?: string;
2070
+ /** `held`, `settled`, or `released`. */
2071
+ readonly state?: string;
2072
+ /** When the hold ends. */
2073
+ readonly expireTime?: string;
2074
+ /**
2075
+ * While enforcement is dark: why it would have been refused
2076
+ * (`spend_limit_reached`, `no_payment_method`, `account_suspended`); empty otherwise.
2077
+ */
2078
+ readonly darkRefusal?: string;
2079
+ }
2080
+ /**
2081
+ * Usage Settings is the environment's usage-billing account: its currency, the
2082
+ * enforcement switch (dark until a merchant admin turns it on), the free
2083
+ * allowance, the dunning schedule and an extra token issuer. One per
2084
+ * environment (AIP-156 singleton, id `default`).
2085
+ */
2086
+ export interface UsageSettings {
2087
+ /** `orgs/{org}/projects/{project}/envs/{env}/usage_settings/default`. */
2088
+ name?: string;
2089
+ /** `uset_<cell><ulid>`; never reused. */
2090
+ readonly uid?: string;
2091
+ /** Resource metadata. */
2092
+ meta?: common.ResourceMeta;
2093
+ /** The currency usage is rated and invoiced in (ISO 4217, upper case). */
2094
+ currencyCode?: string;
2095
+ /**
2096
+ * While false a reservation is always granted and a would-be refusal is
2097
+ * only recorded. Off until the merchant's admin turns it on.
2098
+ */
2099
+ enforcementEnabled?: boolean;
2100
+ /**
2101
+ * What a subject with no payment method may use each month, nano-minor,
2102
+ * as a decimal string.
2103
+ */
2104
+ freeAllowanceNano?: string;
2105
+ /** Days after an invoice's due time before the subject is past due. */
2106
+ pastDueGraceDays?: number;
2107
+ /** Days after an invoice's due time before the subject is suspended. */
2108
+ suspendGraceDays?: number;
2109
+ /**
2110
+ * A further token issuer (the merchant's own OIDC provider) besides Sylphx
2111
+ * Auth; empty for Sylphx Auth only. It needs `extra_issuer_jwks_url`.
2112
+ */
2113
+ extraIssuer?: string;
2114
+ /** The issuer's HTTPS JWKS URL. */
2115
+ extraIssuerJwksUrl?: string;
2116
+ /** The audience that issuer's tokens must carry; required with `extra_issuer`. */
2117
+ extraIssuerAudience?: string;
2118
+ /**
2119
+ * The claim that names a customer organization in that issuer's tokens;
2120
+ * empty means the issuer proves no organization subject.
2121
+ */
2122
+ extraIssuerOrgClaim?: string;
2123
+ }
2124
+ /** A subject's standing. */
2125
+ export interface UsageStanding {
2126
+ /** `active`, `past_due`, or `suspended`. */
2127
+ state?: string;
2128
+ /** Whether a payment method is on file. */
2129
+ paymentMethodOnFile?: boolean;
2130
+ /**
2131
+ * What the subject may still use now, minor units, a decimal string; empty
2132
+ * when it has no limit.
2133
+ */
2134
+ headroomMinor?: string;
2135
+ /** The amount that makes a threshold invoice be cut, minor units. */
2136
+ thresholdMinor?: string;
2137
+ }
2138
+ /**
2139
+ * A Usage Tier is a trust tier of the merchant's own: the limits a subject
2140
+ * starts at and rises to with payment history. Rank 0 is the base tier.
2141
+ */
2142
+ export interface UsageTier {
2143
+ /** `orgs/{org}/projects/{project}/envs/{env}/usage_tiers/{usage_tier}`; the id is the tier key. */
2144
+ name?: string;
2145
+ /** `utier_<cell><ulid>`; never reused. */
2146
+ readonly uid?: string;
2147
+ /** Resource metadata. */
2148
+ meta?: common.ResourceMeta;
2149
+ /** Order of tiers; 0 is the base tier. */
2150
+ rank?: number;
2151
+ /** Daily exposure limit in minor units, a decimal string; empty for none. */
2152
+ dailyLimitMinor?: string;
2153
+ /** Monthly exposure limit in minor units, a decimal string; empty for none. */
2154
+ monthlyLimitMinor?: string;
2155
+ /** The amount an invoice would make due at which a threshold invoice is cut. */
2156
+ thresholdMinor?: string;
2157
+ /** Paid invoices needed to reach this tier. */
2158
+ requiresPaidInvoices?: number;
2159
+ /** Paid total, minor units, needed to reach this tier. */
2160
+ requiresPaidMinor?: string;
2161
+ }
958
2162
  /** The request of VerifyStorePurchase. */
959
2163
  export interface VerifyStorePurchaseRequest {
960
2164
  /** The environment the purchase is verified in. */
@@ -971,6 +2175,15 @@ export interface VerifyStorePurchaseRequest {
971
2175
  productId?: string;
972
2176
  /** Google Play: the package name, when the connection covers several. */
973
2177
  packageName?: string;
2178
+ /**
2179
+ * Verify fully and return the verdict Money would give, without writing
2180
+ * anything: no record, no subject binding, no Google Play acknowledge or
2181
+ * consume, no entitlement, no ledger posting, no event, and no signed
2182
+ * `grant_token`. Refusals are exactly the ones a real call gives. For
2183
+ * moving existing store sales onto Money, by comparing verdicts with the
2184
+ * seller's own path before switching.
2185
+ */
2186
+ validateOnly?: boolean;
974
2187
  /**
975
2188
  * App Store, instead of `signed_transaction`: the transaction id, for apps
976
2189
  * on original StoreKit whose receipts carry no signed transaction. Money
@@ -998,6 +2211,22 @@ export interface VerifyStorePurchaseResponse {
998
2211
  alreadyVerified?: boolean;
999
2212
  /** The subscription, for a subscription purchase. */
1000
2213
  customerSubscription?: CustomerSubscription;
2214
+ /**
2215
+ * With `validate_only`, the claims the grant would carry (the same JSON a
2216
+ * signed `grant_token` holds); empty otherwise.
2217
+ */
2218
+ grantClaims?: Record<string, unknown>;
2219
+ /**
2220
+ * `ClientVerifyStorePurchase` only: what Money did to finish the purchase
2221
+ * with the store: `acknowledged`, `consumed`, or `retry` (the store call
2222
+ * failed; call again later). Empty on `VerifyStorePurchase`.
2223
+ */
2224
+ storeCompletion?: string;
2225
+ /**
2226
+ * `ClientVerifyStorePurchase` only: the purchase moved from another install
2227
+ * to the caller (restore). Always false until restore transfer is served.
2228
+ */
2229
+ transferred?: boolean;
1001
2230
  }
1002
2231
  /** FeatureKind is how a feature is granted. */
1003
2232
  export type FeatureKind = 'boolean' | 'limit' | (string & {});
@@ -1019,6 +2248,8 @@ export type ProrationBehavior = 'create_prorations' | 'none' | 'always_invoice'
1019
2248
  export declare class MoneyApi {
1020
2249
  /** The `price_catalogs` collection. */
1021
2250
  readonly priceCatalogs: PriceCatalogsCollection;
2251
+ /** The `checkout_policies` collection. */
2252
+ readonly checkoutPolicies: CheckoutPoliciesCollection;
1022
2253
  /** The `store_connections` collection. */
1023
2254
  readonly storeConnections: StoreConnectionsCollection;
1024
2255
  /** The `store_purchases` collection. */
@@ -1031,12 +2262,38 @@ export declare class MoneyApi {
1031
2262
  readonly merchantAccounts: MerchantAccountsCollection;
1032
2263
  /** The `checkout_sessions` collection. */
1033
2264
  readonly checkoutSessions: CheckoutSessionsCollection;
2265
+ /** The `tax_threshold_statuses` collection. */
2266
+ readonly taxThresholdStatuses: TaxThresholdStatusesCollection;
1034
2267
  /** The `portal_sessions` collection. */
1035
2268
  readonly portalSessions: PortalSessionsCollection;
1036
2269
  /** The `licence_keys` collection. */
1037
2270
  readonly licenceKeys: LicenceKeysCollection;
1038
2271
  /** The `licence_tokens` collection. */
1039
2272
  readonly licenceTokens: LicenceTokensCollection;
2273
+ /** The `usage_settings` collection. */
2274
+ readonly usageSettings: UsageSettingsCollection;
2275
+ /** The `usage_tiers` collection. */
2276
+ readonly usageTiers: UsageTiersCollection;
2277
+ /** The `usage_reservations` collection. */
2278
+ readonly usageReservations: UsageReservationsCollection;
2279
+ /** The `usage_events` collection. */
2280
+ readonly usageEvents: UsageEventsCollection;
2281
+ /** The `credit_grants` collection. */
2282
+ readonly creditGrants: CreditGrantsCollection;
2283
+ /** The `usage_invoices` collection. */
2284
+ readonly usageInvoices: UsageInvoicesCollection;
2285
+ /** The `usage_meters` collection. */
2286
+ readonly usageMeters: UsageMetersCollection;
2287
+ /** The `usage_meter_prices` collection. */
2288
+ readonly usageMeterPrices: UsageMeterPricesCollection;
2289
+ /** The `revenue_sources` collection. */
2290
+ readonly revenueSources: RevenueSourcesCollection;
2291
+ /** The `revenue` collection. */
2292
+ readonly revenue: RevenueCollection;
2293
+ /** The `revenue_facts` collection. */
2294
+ readonly revenueFacts: RevenueFactsCollection;
2295
+ /** The `exchange_rates` collection. */
2296
+ readonly exchangeRates: ExchangeRatesCollection;
1040
2297
  constructor(client: runtime.Client);
1041
2298
  }
1042
2299
  /** `price_catalogs` of Sylphx Money: Resource type `money.sylphx.com/PriceCatalog`. */
@@ -1069,6 +2326,28 @@ export declare class PriceCatalogsCollection {
1069
2326
  */
1070
2327
  sync(request: SyncCatalogRequest): Promise<Catalog>;
1071
2328
  }
2329
+ /** `checkout_policies` of Sylphx Money: Resource type `money.sylphx.com/CheckoutPolicy`. */
2330
+ export declare class CheckoutPoliciesCollection {
2331
+ private readonly client;
2332
+ constructor(client: runtime.Client);
2333
+ /**
2334
+ * Gets the environment's checkout policy: which buyer countries consumer
2335
+ * checkout refuses. An environment that never wrote one refuses none.
2336
+ *
2337
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/checkout_policies/*}` · permission `billing:read` · effect `read`
2338
+ *
2339
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
2340
+ */
2341
+ get(request: GetCheckoutPolicyRequest): Promise<CheckoutPolicy>;
2342
+ /**
2343
+ * Updates the environment's checkout policy, whole.
2344
+ *
2345
+ * `PATCH /v1/{checkout_policy.name=orgs/*\/projects/*\/envs/*\/checkout_policies/*}` · permission `billing:write` · effect `write`
2346
+ *
2347
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
2348
+ */
2349
+ update(request: UpdateCheckoutPolicyRequest): Promise<CheckoutPolicy>;
2350
+ }
1072
2351
  /** `store_connections` of Sylphx Money: Resource type `money.sylphx.com/StoreConnection`. */
1073
2352
  export declare class StoreConnectionsCollection {
1074
2353
  private readonly client;
@@ -1131,6 +2410,19 @@ export declare class StorePurchasesCollection {
1131
2410
  * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `INVALID_STATE`, `RESOURCE_IN_USE`, `UNAVAILABLE`.
1132
2411
  */
1133
2412
  verify(request: VerifyStorePurchaseRequest): Promise<VerifyStorePurchaseResponse>;
2413
+ /**
2414
+ * Verifies a store purchase for an app with no server: called with the
2415
+ * environment's publishable key (`billing:client`), the subject is an
2416
+ * install id (`inst_` and a UUID), and Money completes the purchase with the
2417
+ * store (acknowledges or consumes it) so the app never calls the store's
2418
+ * server API. Works only on store connections that set `client_verify`.
2419
+ * Re-calling returns the same record and grant.
2420
+ *
2421
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/store_purchases:clientVerify` · permission `billing:client` · effect `write`
2422
+ *
2423
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `INVALID_STATE`, `RESOURCE_IN_USE`, `RATE_LIMITED`, `UNAVAILABLE`.
2424
+ */
2425
+ clientVerify(request: ClientVerifyStorePurchaseRequest): Promise<VerifyStorePurchaseResponse>;
1134
2426
  /**
1135
2427
  * Gets a store purchase.
1136
2428
  *
@@ -1243,6 +2535,15 @@ export declare class EntitlementGrantsCollection {
1243
2535
  * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`.
1244
2536
  */
1245
2537
  check(request: CheckEntitlementRequest): Promise<CheckEntitlementResponse>;
2538
+ /**
2539
+ * Creates a manual entitlement grant (support, comp, grace). Append-only;
2540
+ * needs the approval-class scope. The approver recorded is the key's principal.
2541
+ *
2542
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/entitlement_grants` · permission `billing:credits.approve` · effect `write`
2543
+ *
2544
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `UNKNOWN_FIELD`, `RESOURCE_ALREADY_EXISTS`.
2545
+ */
2546
+ create(request: CreateEntitlementGrantRequest): Promise<EntitlementGrant>;
1246
2547
  }
1247
2548
  /** `merchant_accounts` of Sylphx Money: Resource type `money.sylphx.com/MerchantAccount`. */
1248
2549
  export declare class MerchantAccountsCollection {
@@ -1293,6 +2594,14 @@ export declare class MerchantAccountsCollection {
1293
2594
  * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNAVAILABLE`.
1294
2595
  */
1295
2596
  disconnect(request: DisconnectMerchantAccountRequest): Promise<MerchantAccount>;
2597
+ /**
2598
+ * Updates the merchant account's own settings: the fields named in `update_mask`.
2599
+ *
2600
+ * `PATCH /v1/{merchant_account.name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}` · permission `billing:write` · effect `write`
2601
+ *
2602
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
2603
+ */
2604
+ update(request: UpdateMerchantAccountRequest): Promise<MerchantAccount>;
1296
2605
  }
1297
2606
  /** `checkout_sessions` of Sylphx Money: Resource type `money.sylphx.com/CheckoutSession`. */
1298
2607
  export declare class CheckoutSessionsCollection {
@@ -1315,6 +2624,23 @@ export declare class CheckoutSessionsCollection {
1315
2624
  */
1316
2625
  get(request: GetCheckoutSessionRequest): Promise<CheckoutSession>;
1317
2626
  }
2627
+ /** `tax_threshold_statuses` of Sylphx Money: Resource type `money.sylphx.com/TaxThresholdStatus`. */
2628
+ export declare class TaxThresholdStatusesCollection {
2629
+ private readonly client;
2630
+ constructor(client: runtime.Client);
2631
+ /**
2632
+ * Lists where the environment's consumer sales stand against each
2633
+ * jurisdiction's digital-services tax registration threshold, per its own
2634
+ * window. EU and UK have no threshold and are not tracked.
2635
+ *
2636
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/tax_threshold_statuses` · permission `billing:read` · effect `read`
2637
+ *
2638
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`.
2639
+ */
2640
+ list(request: ListTaxThresholdStatusesRequest): Promise<ListTaxThresholdStatusesResponse>;
2641
+ /** Every item of every page of `list`. */
2642
+ listAll(request: ListTaxThresholdStatusesRequest): AsyncGenerator<TaxThresholdStatus>;
2643
+ }
1318
2644
  /** `portal_sessions` of Sylphx Money: Resource type `money.sylphx.com/PortalSession`. */
1319
2645
  export declare class PortalSessionsCollection {
1320
2646
  private readonly client;
@@ -1404,3 +2730,357 @@ export declare class LicenceTokensCollection {
1404
2730
  /** Every item of every page of `list`. */
1405
2731
  listAll(request: ListLicenceTokensRequest): AsyncGenerator<LicenceToken>;
1406
2732
  }
2733
+ /** `usage_settings` of Sylphx Money: Resource type `money.sylphx.com/UsageSettings`. */
2734
+ export declare class UsageSettingsCollection {
2735
+ private readonly client;
2736
+ constructor(client: runtime.Client);
2737
+ /**
2738
+ * Gets the environment's usage settings.
2739
+ *
2740
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/usage_settings/*}` · permission `billing:read` · effect `read`
2741
+ *
2742
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
2743
+ */
2744
+ get(request: GetUsageSettingsRequest): Promise<UsageSettings>;
2745
+ /**
2746
+ * Updates the usage settings, the enforcement switch included. A change is recorded with who made it.
2747
+ *
2748
+ * `PATCH /v1/{usage_settings.name=orgs/*\/projects/*\/envs/*\/usage_settings/*}` · permission `billing:write` · effect `write`
2749
+ *
2750
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
2751
+ */
2752
+ update(request: UpdateUsageSettingsRequest): Promise<UsageSettings>;
2753
+ }
2754
+ /** `usage_tiers` of Sylphx Money: Resource type `money.sylphx.com/UsageTier`. */
2755
+ export declare class UsageTiersCollection {
2756
+ private readonly client;
2757
+ constructor(client: runtime.Client);
2758
+ /**
2759
+ * Lists usage tiers.
2760
+ *
2761
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/usage_tiers` · permission `billing:read` · effect `read`
2762
+ *
2763
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
2764
+ */
2765
+ list(request: ListUsageTiersRequest): Promise<ListUsageTiersResponse>;
2766
+ /** Every item of every page of `list`. */
2767
+ listAll(request: ListUsageTiersRequest): AsyncGenerator<UsageTier>;
2768
+ /**
2769
+ * Creates or updates a usage tier.
2770
+ *
2771
+ * `PATCH /v1/{usage_tier.name=orgs/*\/projects/*\/envs/*\/usage_tiers/*}` · permission `billing:write` · effect `write`
2772
+ *
2773
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
2774
+ */
2775
+ update(request: UpdateUsageTierRequest): Promise<UsageTier>;
2776
+ }
2777
+ /** `usage_reservations` of Sylphx Money: Resource type `money.sylphx.com/UsageReservation`. */
2778
+ export declare class UsageReservationsCollection {
2779
+ private readonly client;
2780
+ constructor(client: runtime.Client);
2781
+ /**
2782
+ * Reserves usage before the work starts. Refused with PLAN_LIMIT_REACHED (spend limit, no payment method) or INVALID_STATE (suspended) only while enforcement is on; while it is dark the reservation is granted and the refusal is recorded.
2783
+ *
2784
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/usage_reservations` · permission `billing:metering:write` · effect `write`
2785
+ *
2786
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `UNKNOWN_FIELD`, `INVALID_STATE`, `PLAN_LIMIT_REACHED`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `UNAVAILABLE`.
2787
+ */
2788
+ create(request: CreateUsageReservationRequest): Promise<UsageReservation>;
2789
+ /**
2790
+ * Gets a usage reservation.
2791
+ *
2792
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/usage_reservations/*}` · permission `billing:read` · effect `read`
2793
+ *
2794
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
2795
+ */
2796
+ get(request: GetUsageReservationRequest): Promise<UsageReservation>;
2797
+ /**
2798
+ * Settles a reservation with what was used; the unused part returns to headroom. A settle after expiry still records the usage.
2799
+ *
2800
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/usage_reservations/*}:settle` · permission `billing:metering:write` · effect `write`
2801
+ *
2802
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
2803
+ */
2804
+ settle(request: SettleUsageReservationRequest): Promise<UsageEvent>;
2805
+ /**
2806
+ * Releases a reservation that used nothing.
2807
+ *
2808
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/usage_reservations/*}:release` · permission `billing:metering:write` · effect `write`
2809
+ *
2810
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
2811
+ */
2812
+ release(request: ReleaseUsageReservationRequest): Promise<UsageReservation>;
2813
+ }
2814
+ /** `usage_events` of Sylphx Money: Resource type `money.sylphx.com/UsageEvent`. */
2815
+ export declare class UsageEventsCollection {
2816
+ private readonly client;
2817
+ constructor(client: runtime.Client);
2818
+ /**
2819
+ * Records usage directly, only for a meter the merchant marked reservation-optional.
2820
+ *
2821
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/usage_events` · permission `billing:metering:write` · effect `write`
2822
+ *
2823
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `UNKNOWN_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
2824
+ */
2825
+ create(request: CreateUsageEventRequest): Promise<UsageEvent>;
2826
+ /**
2827
+ * Records a batch of already-incurred usage from the merchant's own servers
2828
+ * (Stripe's meter-event model): the caller is a key of the merchant's own org
2829
+ * holding the exact grant `billing:metering:ingest`, which no wildcard covers,
2830
+ * and each event names its subject with no subject proof. Each event is keyed
2831
+ * by its project, meter, meter version and event id: a replay is a no-op
2832
+ * (`duplicate`), and the same key with different content is a `conflict` and
2833
+ * never counted. One result per event, in request order.
2834
+ *
2835
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/usage_events:batchIngest` · permission `billing:metering:ingest` · effect `write`
2836
+ *
2837
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `UNKNOWN_FIELD`, `INVALID_STATE`.
2838
+ */
2839
+ batchIngest(request: BatchIngestUsageEventsRequest): Promise<BatchIngestUsageEventsResponse>;
2840
+ /**
2841
+ * Lists usage events, newest first.
2842
+ *
2843
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/usage_events` · permission `billing:read` · effect `read`
2844
+ *
2845
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
2846
+ */
2847
+ list(request: ListUsageEventsRequest): Promise<ListUsageEventsResponse>;
2848
+ /** Every item of every page of `list`. */
2849
+ listAll(request: ListUsageEventsRequest): AsyncGenerator<UsageEvent>;
2850
+ /**
2851
+ * Reads a subject's standing: active, past due or suspended, whether a payment method is on file, headroom and the threshold.
2852
+ *
2853
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/usage_events:checkStanding` · permission `billing:read` · effect `read`
2854
+ *
2855
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`.
2856
+ */
2857
+ checkStanding(request: CheckUsageStandingRequest): Promise<UsageStanding>;
2858
+ }
2859
+ /** `credit_grants` of Sylphx Money: Resource type `money.sylphx.com/CreditGrant`. */
2860
+ export declare class CreditGrantsCollection {
2861
+ private readonly client;
2862
+ constructor(client: runtime.Client);
2863
+ /**
2864
+ * Gives a subject credit. Append-only: a change is a new grant that supersedes the old. Refused with INVALID_STATE (`tax_treatment_unsupported`) for `post_tax_settlement` while the merchant has automatic tax on.
2865
+ *
2866
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/credit_grants` · permission `billing:credits.approve` · effect `write`
2867
+ *
2868
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `UNKNOWN_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
2869
+ */
2870
+ create(request: CreateCreditGrantRequest): Promise<CreditGrant>;
2871
+ /**
2872
+ * Gets a credit grant.
2873
+ *
2874
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/credit_grants/*}` · permission `billing:read` · effect `read`
2875
+ *
2876
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
2877
+ */
2878
+ get(request: GetCreditGrantRequest): Promise<CreditGrant>;
2879
+ /**
2880
+ * Lists credit grants.
2881
+ *
2882
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/credit_grants` · permission `billing:read` · effect `read`
2883
+ *
2884
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
2885
+ */
2886
+ list(request: ListCreditGrantsRequest): Promise<ListCreditGrantsResponse>;
2887
+ /** Every item of every page of `list`. */
2888
+ listAll(request: ListCreditGrantsRequest): AsyncGenerator<CreditGrant>;
2889
+ }
2890
+ /** `usage_invoices` of Sylphx Money: Resource type `money.sylphx.com/UsageInvoice`. */
2891
+ export declare class UsageInvoicesCollection {
2892
+ private readonly client;
2893
+ constructor(client: runtime.Client);
2894
+ /**
2895
+ * Gets a usage invoice.
2896
+ *
2897
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/usage_invoices/*}` · permission `billing:read` · effect `read`
2898
+ *
2899
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
2900
+ */
2901
+ get(request: GetUsageInvoiceRequest): Promise<UsageInvoice>;
2902
+ /**
2903
+ * Lists usage invoices, newest first.
2904
+ *
2905
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/usage_invoices` · permission `billing:read` · effect `read`
2906
+ *
2907
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
2908
+ */
2909
+ list(request: ListUsageInvoicesRequest): Promise<ListUsageInvoicesResponse>;
2910
+ /** Every item of every page of `list`. */
2911
+ listAll(request: ListUsageInvoicesRequest): AsyncGenerator<UsageInvoice>;
2912
+ /**
2913
+ * Releases a held invoice for collection, audited with who and why. Grant expiry or replacement never does.
2914
+ *
2915
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/usage_invoices/*}:releaseCollection` · permission `billing:credits.approve` · effect `write`
2916
+ *
2917
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `INVALID_FIELD`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
2918
+ */
2919
+ releaseCollection(request: ReleaseUsageInvoiceCollectionRequest): Promise<UsageInvoice>;
2920
+ }
2921
+ /** `usage_meters` of Sylphx Money: Resource type `money.sylphx.com/UsageMeter`. */
2922
+ export declare class UsageMetersCollection {
2923
+ private readonly client;
2924
+ constructor(client: runtime.Client);
2925
+ /**
2926
+ * Gets a usage meter.
2927
+ *
2928
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/usage_meters/*}` · permission `billing:read` · effect `read`
2929
+ *
2930
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
2931
+ */
2932
+ get(request: GetUsageMeterRequest): Promise<UsageMeter>;
2933
+ /**
2934
+ * Lists usage meters.
2935
+ *
2936
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/usage_meters` · permission `billing:read` · effect `read`
2937
+ *
2938
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
2939
+ */
2940
+ list(request: ListUsageMetersRequest): Promise<ListUsageMetersResponse>;
2941
+ /** Every item of every page of `list`. */
2942
+ listAll(request: ListUsageMetersRequest): AsyncGenerator<UsageMeter>;
2943
+ /**
2944
+ * Creates or updates a usage meter. The unit cannot change once it has recorded usage.
2945
+ *
2946
+ * `PATCH /v1/{usage_meter.name=orgs/*\/projects/*\/envs/*\/usage_meters/*}` · permission `billing:write` · effect `write`
2947
+ *
2948
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
2949
+ */
2950
+ update(request: UpdateUsageMeterRequest): Promise<UsageMeter>;
2951
+ }
2952
+ /** `usage_meter_prices` of Sylphx Money: Resource type `money.sylphx.com/UsageMeterPrice`. */
2953
+ export declare class UsageMeterPricesCollection {
2954
+ private readonly client;
2955
+ constructor(client: runtime.Client);
2956
+ /**
2957
+ * Appends a price to a meter's history. It applies from its effective time on and never rewrites usage already rated.
2958
+ *
2959
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/usage_meter_prices` · permission `billing:write` · effect `write`
2960
+ *
2961
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `RESOURCE_NOT_FOUND`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
2962
+ */
2963
+ create(request: CreateUsageMeterPriceRequest): Promise<UsageMeterPrice>;
2964
+ /**
2965
+ * Lists meter prices, newest first; filter by `meter`.
2966
+ *
2967
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/usage_meter_prices` · permission `billing:read` · effect `read`
2968
+ *
2969
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
2970
+ */
2971
+ list(request: ListUsageMeterPricesRequest): Promise<ListUsageMeterPricesResponse>;
2972
+ /** Every item of every page of `list`. */
2973
+ listAll(request: ListUsageMeterPricesRequest): AsyncGenerator<UsageMeterPrice>;
2974
+ }
2975
+ /** `revenue_sources` of Sylphx Money: Resource type `money.sylphx.com/RevenueSource`. */
2976
+ export declare class RevenueSourcesCollection {
2977
+ private readonly client;
2978
+ constructor(client: runtime.Client);
2979
+ /**
2980
+ * Gets a revenue source, with its freshness. Revenue reporting
2981
+ * (docs/adr/ADR-01M40HRQT0VSXZ1WANP8M318F2) is org-wide: `revenue:read` or
2982
+ * `revenue:write`, held by an org-wide key or an org owner's or admin's
2983
+ * session only; a project or environment key is refused.
2984
+ *
2985
+ * `GET /v1/{name=orgs/*\/revenue_sources/*}` · permission `revenue:read` · effect `read`
2986
+ *
2987
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
2988
+ */
2989
+ get(request: GetRevenueSourceRequest): Promise<RevenueSource>;
2990
+ /**
2991
+ * Lists the org's revenue sources, with their freshness.
2992
+ *
2993
+ * `GET /v1/{parent=orgs/*}/revenue_sources` · permission `revenue:read` · effect `read`
2994
+ *
2995
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
2996
+ */
2997
+ list(request: ListRevenueSourcesRequest): Promise<ListRevenueSourcesResponse>;
2998
+ /** Every item of every page of `list`. */
2999
+ listAll(request: ListRevenueSourcesRequest): AsyncGenerator<RevenueSource>;
3000
+ /**
3001
+ * Registers a revenue source. The `money` source is implicit and never
3002
+ * created here.
3003
+ *
3004
+ * `POST /v1/{parent=orgs/*}/revenue_sources` · permission `revenue:write` · effect `write`
3005
+ *
3006
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
3007
+ */
3008
+ create(request: CreateRevenueSourceRequest): Promise<RevenueSource>;
3009
+ /**
3010
+ * Renames, pauses or resumes a revenue source, or changes its settings.
3011
+ *
3012
+ * `PATCH /v1/{revenue_source.name=orgs/*\/revenue_sources/*}` · permission `revenue:write` · effect `write`
3013
+ *
3014
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
3015
+ */
3016
+ update(request: UpdateRevenueSourceRequest): Promise<RevenueSource>;
3017
+ /**
3018
+ * Deletes a revenue source and the facts it reported. The `money` source
3019
+ * cannot be deleted; pause it instead.
3020
+ *
3021
+ * `DELETE /v1/{name=orgs/*\/revenue_sources/*}` · permission `revenue:write` · effect `destructive`
3022
+ *
3023
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
3024
+ */
3025
+ delete(request: DeleteRevenueSourceRequest): Promise<Record<string, never>>;
3026
+ /**
3027
+ * Syncs a revenue source now, or backfills a period. A `money` source
3028
+ * fills any booked fact its environment's ledger holds and the facts lack;
3029
+ * a paused source, or one whose connector has not shipped yet, is refused
3030
+ * (`INVALID_STATE`).
3031
+ *
3032
+ * `POST /v1/{name=orgs/*\/revenue_sources/*}:run` · permission `revenue:write` · effect `write`
3033
+ *
3034
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
3035
+ */
3036
+ run(request: RunRevenueSourceRequest): Promise<RunRevenueSourceResponse>;
3037
+ }
3038
+ /** `revenue` of Sylphx Money: Resource type `money.sylphx.com/RevenueSummary`. */
3039
+ export declare class RevenueCollection {
3040
+ private readonly client;
3041
+ constructor(client: runtime.Client);
3042
+ /**
3043
+ * Gets the org's revenue over a period: totals by day or month, split by
3044
+ * source or product, gross or net, in one reporting currency, with the
3045
+ * basis of each bucket, the sources that report late, and what has no
3046
+ * rate yet. Reads only the daily roll-up, bounded by a 5 second statement
3047
+ * timeout. For example `sylphx money revenue summary --period mtd
3048
+ * --split source`.
3049
+ *
3050
+ * `GET /v1/{name=orgs/*\/revenue}` · permission `revenue:read` · effect `read`
3051
+ *
3052
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `UNAVAILABLE`.
3053
+ */
3054
+ get(request: GetRevenueSummaryRequest): Promise<RevenueSummary>;
3055
+ }
3056
+ /** `revenue_facts` of Sylphx Money: Resource type `money.sylphx.com/RevenueFact`. */
3057
+ export declare class RevenueFactsCollection {
3058
+ private readonly client;
3059
+ constructor(client: runtime.Client);
3060
+ /**
3061
+ * Lists the org's revenue facts, newest day first, for audit and export.
3062
+ *
3063
+ * `GET /v1/{parent=orgs/*}/revenue_facts` · permission `revenue:read` · effect `read`
3064
+ *
3065
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`, `UNAVAILABLE`.
3066
+ */
3067
+ list(request: ListRevenueFactsRequest): Promise<ListRevenueFactsResponse>;
3068
+ /** Every item of every page of `list`. */
3069
+ listAll(request: ListRevenueFactsRequest): AsyncGenerator<RevenueFact>;
3070
+ }
3071
+ /** `exchange_rates` of Sylphx Money: Resource type `money.sylphx.com/ExchangeRate`. */
3072
+ export declare class ExchangeRatesCollection {
3073
+ private readonly client;
3074
+ constructor(client: runtime.Client);
3075
+ /**
3076
+ * Lists the exchange rates Money converts at (units per US dollar by day),
3077
+ * for any reader that converts revenue.
3078
+ *
3079
+ * `GET /v1/{parent=orgs/*}/exchange_rates` · permission `revenue:read` · effect `read`
3080
+ *
3081
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
3082
+ */
3083
+ list(request: ListExchangeRatesRequest): Promise<ListExchangeRatesResponse>;
3084
+ /** Every item of every page of `list`. */
3085
+ listAll(request: ListExchangeRatesRequest): AsyncGenerator<ExchangeRate>;
3086
+ }