@sylphx/sdk 0.32.33 → 0.32.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/money.d.ts CHANGED
@@ -177,13 +177,20 @@ export interface CancelCustomerSubscriptionRequest {
177
177
  /** Refund the last payment in full; only with `at_period_end` false. */
178
178
  refundLastPayment?: boolean;
179
179
  }
180
+ /** Request to settle the hold against a terminal receipt. */
180
181
  export interface CapturePlatformUsageHoldRequest {
181
- payerOrg?: string;
182
- service?: string;
183
- executionKey?: string;
184
- actualPicousd?: string;
182
+ /** Organization whose balance backs the hold. */
183
+ payerOrg: string;
184
+ /** Metered service associated with the execution. */
185
+ service: string;
186
+ /** Stable caller-generated identity of the metered execution. */
187
+ executionKey: string;
188
+ /** Actual amount, as a decimal string in pico-USD. Zero is valid. */
189
+ actualPicousd: string;
185
190
  /** Stable receipt identity (include the provider/account namespace). */
186
- terminalReceiptKey?: string;
191
+ terminalReceiptKey: string;
192
+ /** Authenticated platform service organization, as orgs/{org}; not the payer. */
193
+ parent: string;
187
194
  }
188
195
  /**
189
196
  * A Catalog is an environment's features, products, and prices: the desired
@@ -602,10 +609,21 @@ export interface CheckoutSession {
602
609
  /** When the browser possession proof expires. The existing wire name is retained. */
603
610
  readonly claimSecretExpiresAt?: string;
604
611
  }
612
+ /** Request to claim dispatch using the reserved hold. */
605
613
  export interface ClaimPlatformUsageHoldRequest {
606
- payerOrg?: string;
607
- service?: string;
608
- executionKey?: string;
614
+ /** Organization whose balance backs the hold. */
615
+ payerOrg: string;
616
+ /** Metered service associated with the execution. */
617
+ service: string;
618
+ /** Stable caller-generated identity of the metered execution. */
619
+ executionKey: string;
620
+ /** Authenticated platform service organization, as orgs/{org}; not the payer. */
621
+ parent: string;
622
+ /**
623
+ * Check these terms atomically before a fresh claim. Absence preserves the
624
+ * ordinary claim contract for platform callers that do not require a fuse.
625
+ */
626
+ preconditions?: PlatformUsageHoldClaimPreconditions;
609
627
  }
610
628
  /** The request of ClientVerifyStorePurchase. */
611
629
  export interface ClientVerifyStorePurchaseRequest {
@@ -1762,27 +1780,50 @@ export interface MerchantAccount {
1762
1780
  /** Fixed, actionable warnings; never Stripe response bodies or credentials. */
1763
1781
  readonly processorWarnings?: string[];
1764
1782
  }
1783
+ /** Preconditions for dispatching with an exact hold and a bounded monthly fuse. */
1784
+ export interface PlatformUsageHoldClaimPreconditions {
1785
+ /** The uid returned by ReservePlatformUsageHold. */
1786
+ holdUid?: string;
1787
+ /** Exact reserved upper bound, as a decimal string in pico-USD. */
1788
+ upperBoundPicousd?: string;
1789
+ /** Largest permitted positive monthly fuse, in USD cents. */
1790
+ maxMonthlyFuseUsdMinor?: string;
1791
+ }
1765
1792
  /**
1766
1793
  * Authority to dispatch and, separately, a deadline to submit the terminal
1767
1794
  * receipt. Amounts are canonical decimal strings in pico-USD (10^-12 USD).
1768
1795
  */
1769
1796
  export interface PlatformUsageHoldReceipt {
1797
+ /** Canonical resource name of the hold receipt. */
1770
1798
  name?: string;
1799
+ /** Stable identifier of the hold. */
1771
1800
  readonly uid?: string;
1801
+ /** Resource metadata, when available. */
1772
1802
  meta?: common.ResourceMeta;
1803
+ /** Organization whose balance backs the hold. */
1773
1804
  payerOrg?: string;
1805
+ /** Metered service associated with the execution. */
1774
1806
  service?: string;
1807
+ /** Stable caller-generated identity of the metered execution. */
1775
1808
  executionKey?: string;
1809
+ /** Maximum amount authorized by the hold, in pico-USD. */
1776
1810
  upperBoundPicousd?: string;
1811
+ /** Deadline to claim dispatch, as an RFC 3339 timestamp. */
1777
1812
  dispatchBy?: string;
1813
+ /** Deadline to submit a terminal receipt, as an RFC 3339 timestamp. */
1778
1814
  settleBy?: string;
1779
1815
  /** pending, in_flight, awaiting_settlement (receipt overdue), captured, released, or expired. */
1780
1816
  state?: string;
1817
+ /** Amount charged to the hold, in pico-USD. */
1781
1818
  capturedPicousd?: string;
1819
+ /** Amount returned from the hold, in pico-USD. */
1782
1820
  releasedPicousd?: string;
1783
1821
  /** Present only for a positive capture; this is the only billable journal. */
1784
1822
  ledgerTransactionId?: string;
1823
+ /** Whether the operation returned an already recorded result. */
1785
1824
  replayed?: boolean;
1825
+ /** Positive only on a fresh claim that verified the requested fuse ceiling. */
1826
+ readonly verifiedMonthlyFuseUsdMinor?: string;
1786
1827
  }
1787
1828
  /**
1788
1829
  * A Portal Session is a hosted page where a subject manages its
@@ -2039,12 +2080,18 @@ export interface RefundCheckoutSessionResponse {
2039
2080
  /** The refund receipt, read back from the processor after creation. */
2040
2081
  readonly refund?: Refund;
2041
2082
  }
2083
+ /** Request to return the hold without charging the payer. */
2042
2084
  export interface ReleasePlatformUsageHoldRequest {
2043
- payerOrg?: string;
2044
- service?: string;
2045
- executionKey?: string;
2085
+ /** Organization whose balance backs the hold. */
2086
+ payerOrg: string;
2087
+ /** Metered service associated with the execution. */
2088
+ service: string;
2089
+ /** Stable caller-generated identity of the metered execution. */
2090
+ executionKey: string;
2046
2091
  /** Required after claim. An unknown dispatch or missing receipt is not proof. */
2047
2092
  definitiveNoCharge?: boolean;
2093
+ /** Authenticated platform service organization, as orgs/{org}; not the payer. */
2094
+ parent: string;
2048
2095
  }
2049
2096
  /** The request of ReleaseUsageInvoiceCollection. */
2050
2097
  export interface ReleaseUsageInvoiceCollectionRequest {
@@ -2102,14 +2149,22 @@ export interface ReportStorePurchaseUsageResponse {
2102
2149
  /** The store purchase that was answered. */
2103
2150
  storePurchase?: StorePurchase;
2104
2151
  }
2152
+ /** Request to reserve an upper bound against the payer balance. */
2105
2153
  export interface ReservePlatformUsageHoldRequest {
2106
- payerOrg?: string;
2107
- service?: string;
2154
+ /** Organization whose balance backs the hold. */
2155
+ payerOrg: string;
2156
+ /** Metered service associated with the execution. */
2157
+ service: string;
2108
2158
  /** Use a durable, caller-generated platform-hold:<unique-execution-id>. */
2109
- executionKey?: string;
2110
- upperBoundPicousd?: string;
2111
- dispatchBy?: string;
2112
- settleBy?: string;
2159
+ executionKey: string;
2160
+ /** Maximum amount authorized by the hold, in pico-USD. */
2161
+ upperBoundPicousd: string;
2162
+ /** Deadline to claim dispatch, as an RFC 3339 timestamp. */
2163
+ dispatchBy: string;
2164
+ /** Deadline to submit a terminal receipt, as an RFC 3339 timestamp. */
2165
+ settleBy: string;
2166
+ /** Authenticated platform service organization, as orgs/{org}; not the payer. */
2167
+ parent: string;
2113
2168
  }
2114
2169
  /** Resolves held evidence without altering its original receipt. */
2115
2170
  export interface ResolveBankReceiptRequest {
@@ -3273,33 +3328,33 @@ export declare class PlatformUsageHoldsCollection {
3273
3328
  private readonly client;
3274
3329
  constructor(client: runtime.Client);
3275
3330
  /**
3276
- * ReservePlatformUsageHold is an internal platform service operation.
3331
+ * ReservePlatformUsageHold holds an upper bound before dispatch.
3277
3332
  *
3278
- * `POST /v1/platform_usage_holds:reserve` · permission `money:platform_usage:write` · effect `write`
3333
+ * `POST /v1/{parent=orgs/*}/platform_usage_holds:reserve` · permission `money:platform_usage:write` · effect `write`
3279
3334
  *
3280
3335
  * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `FAILED_PRECONDITION`, `IDEMPOTENCY_KEY_REUSED`, `UNAVAILABLE`.
3281
3336
  */
3282
3337
  reserve(request: ReservePlatformUsageHoldRequest): Promise<PlatformUsageHoldReceipt>;
3283
3338
  /**
3284
- * ClaimPlatformUsageHold is an internal platform service operation.
3339
+ * ClaimPlatformUsageHold records that dispatch has been claimed against the hold.
3285
3340
  *
3286
- * `POST /v1/platform_usage_holds:claim` · permission `money:platform_usage:write` · effect `write`
3341
+ * `POST /v1/{parent=orgs/*}/platform_usage_holds:claim` · permission `money:platform_usage:write` · effect `write`
3287
3342
  *
3288
3343
  * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `FAILED_PRECONDITION`, `IDEMPOTENCY_KEY_REUSED`, `UNAVAILABLE`.
3289
3344
  */
3290
3345
  claim(request: ClaimPlatformUsageHoldRequest): Promise<PlatformUsageHoldReceipt>;
3291
3346
  /**
3292
- * CapturePlatformUsageHold is an internal platform service operation.
3347
+ * CapturePlatformUsageHold settles the hold against a definitive terminal receipt.
3293
3348
  *
3294
- * `POST /v1/platform_usage_holds:capture` · permission `money:platform_usage:write` · effect `write`
3349
+ * `POST /v1/{parent=orgs/*}/platform_usage_holds:capture` · permission `money:platform_usage:write` · effect `write`
3295
3350
  *
3296
3351
  * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `FAILED_PRECONDITION`, `IDEMPOTENCY_KEY_REUSED`, `UNAVAILABLE`.
3297
3352
  */
3298
3353
  capture(request: CapturePlatformUsageHoldRequest): Promise<PlatformUsageHoldReceipt>;
3299
3354
  /**
3300
- * ReleasePlatformUsageHold is an internal platform service operation.
3355
+ * ReleasePlatformUsageHold returns the held funds when the execution will not be charged.
3301
3356
  *
3302
- * `POST /v1/platform_usage_holds:release` · permission `money:platform_usage:write` · effect `write`
3357
+ * `POST /v1/{parent=orgs/*}/platform_usage_holds:release` · permission `money:platform_usage:write` · effect `write`
3303
3358
  *
3304
3359
  * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `FAILED_PRECONDITION`, `IDEMPOTENCY_KEY_REUSED`, `UNAVAILABLE`.
3305
3360
  */
package/dist/money.js CHANGED
@@ -190,6 +190,7 @@ runtime.registerSchemas({
190
190
  'sylphx.money.v1.ClaimPlatformUsageHoldRequest': [
191
191
  ['payerOrg', 'payer_org'],
192
192
  ['executionKey', 'execution_key'],
193
+ ['preconditions', 'preconditions', 'sylphx.money.v1.PlatformUsageHoldClaimPreconditions'],
193
194
  ],
194
195
  'sylphx.money.v1.ClientVerifyStorePurchaseRequest': [
195
196
  ['subject', 'subject', 'sylphx.money.v1.Subject'],
@@ -551,6 +552,11 @@ runtime.registerSchemas({
551
552
  ['processorPermissionsCheckTime', 'processor_permissions_check_time'],
552
553
  ['processorWarnings', 'processor_warnings'],
553
554
  ],
555
+ 'sylphx.money.v1.PlatformUsageHoldClaimPreconditions': [
556
+ ['holdUid', 'hold_uid'],
557
+ ['upperBoundPicousd', 'upper_bound_picousd'],
558
+ ['maxMonthlyFuseUsdMinor', 'max_monthly_fuse_usd_minor'],
559
+ ],
554
560
  'sylphx.money.v1.PlatformUsageHoldReceipt': [
555
561
  ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
556
562
  ['payerOrg', 'payer_org'],
@@ -561,6 +567,7 @@ runtime.registerSchemas({
561
567
  ['capturedPicousd', 'captured_picousd'],
562
568
  ['releasedPicousd', 'released_picousd'],
563
569
  ['ledgerTransactionId', 'ledger_transaction_id'],
570
+ ['verifiedMonthlyFuseUsdMinor', 'verified_monthly_fuse_usd_minor'],
564
571
  ],
565
572
  'sylphx.money.v1.PortalSession': [
566
573
  ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
@@ -1078,68 +1085,68 @@ export class PlatformUsageHoldsCollection {
1078
1085
  this.client = client;
1079
1086
  }
1080
1087
  /**
1081
- * ReservePlatformUsageHold is an internal platform service operation.
1088
+ * ReservePlatformUsageHold holds an upper bound before dispatch.
1082
1089
  *
1083
- * `POST /v1/platform_usage_holds:reserve` · permission `money:platform_usage:write` · effect `write`
1090
+ * `POST /v1/{parent=orgs/*}/platform_usage_holds:reserve` · permission `money:platform_usage:write` · effect `write`
1084
1091
  *
1085
1092
  * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `FAILED_PRECONDITION`, `IDEMPOTENCY_KEY_REUSED`, `UNAVAILABLE`.
1086
1093
  */
1087
1094
  async reserve(request) {
1088
1095
  return this.client.call({
1089
1096
  method: 'POST',
1090
- path: `/v1/platform_usage_holds:reserve`,
1091
- body: runtime.omit(request, []),
1097
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*', 'parent')}/platform_usage_holds:reserve`,
1098
+ body: runtime.omit(request, ['parent']),
1092
1099
  bodyType: 'sylphx.money.v1.ReservePlatformUsageHoldRequest',
1093
1100
  responseType: 'sylphx.money.v1.PlatformUsageHoldReceipt',
1094
1101
  mutation: true,
1095
1102
  });
1096
1103
  }
1097
1104
  /**
1098
- * ClaimPlatformUsageHold is an internal platform service operation.
1105
+ * ClaimPlatformUsageHold records that dispatch has been claimed against the hold.
1099
1106
  *
1100
- * `POST /v1/platform_usage_holds:claim` · permission `money:platform_usage:write` · effect `write`
1107
+ * `POST /v1/{parent=orgs/*}/platform_usage_holds:claim` · permission `money:platform_usage:write` · effect `write`
1101
1108
  *
1102
1109
  * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `FAILED_PRECONDITION`, `IDEMPOTENCY_KEY_REUSED`, `UNAVAILABLE`.
1103
1110
  */
1104
1111
  async claim(request) {
1105
1112
  return this.client.call({
1106
1113
  method: 'POST',
1107
- path: `/v1/platform_usage_holds:claim`,
1108
- body: runtime.omit(request, []),
1114
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*', 'parent')}/platform_usage_holds:claim`,
1115
+ body: runtime.omit(request, ['parent']),
1109
1116
  bodyType: 'sylphx.money.v1.ClaimPlatformUsageHoldRequest',
1110
1117
  responseType: 'sylphx.money.v1.PlatformUsageHoldReceipt',
1111
1118
  mutation: true,
1112
1119
  });
1113
1120
  }
1114
1121
  /**
1115
- * CapturePlatformUsageHold is an internal platform service operation.
1122
+ * CapturePlatformUsageHold settles the hold against a definitive terminal receipt.
1116
1123
  *
1117
- * `POST /v1/platform_usage_holds:capture` · permission `money:platform_usage:write` · effect `write`
1124
+ * `POST /v1/{parent=orgs/*}/platform_usage_holds:capture` · permission `money:platform_usage:write` · effect `write`
1118
1125
  *
1119
1126
  * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `FAILED_PRECONDITION`, `IDEMPOTENCY_KEY_REUSED`, `UNAVAILABLE`.
1120
1127
  */
1121
1128
  async capture(request) {
1122
1129
  return this.client.call({
1123
1130
  method: 'POST',
1124
- path: `/v1/platform_usage_holds:capture`,
1125
- body: runtime.omit(request, []),
1131
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*', 'parent')}/platform_usage_holds:capture`,
1132
+ body: runtime.omit(request, ['parent']),
1126
1133
  bodyType: 'sylphx.money.v1.CapturePlatformUsageHoldRequest',
1127
1134
  responseType: 'sylphx.money.v1.PlatformUsageHoldReceipt',
1128
1135
  mutation: true,
1129
1136
  });
1130
1137
  }
1131
1138
  /**
1132
- * ReleasePlatformUsageHold is an internal platform service operation.
1139
+ * ReleasePlatformUsageHold returns the held funds when the execution will not be charged.
1133
1140
  *
1134
- * `POST /v1/platform_usage_holds:release` · permission `money:platform_usage:write` · effect `write`
1141
+ * `POST /v1/{parent=orgs/*}/platform_usage_holds:release` · permission `money:platform_usage:write` · effect `write`
1135
1142
  *
1136
1143
  * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `FAILED_PRECONDITION`, `IDEMPOTENCY_KEY_REUSED`, `UNAVAILABLE`.
1137
1144
  */
1138
1145
  async release(request) {
1139
1146
  return this.client.call({
1140
1147
  method: 'POST',
1141
- path: `/v1/platform_usage_holds:release`,
1142
- body: runtime.omit(request, []),
1148
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*', 'parent')}/platform_usage_holds:release`,
1149
+ body: runtime.omit(request, ['parent']),
1143
1150
  bodyType: 'sylphx.money.v1.ReleasePlatformUsageHoldRequest',
1144
1151
  responseType: 'sylphx.money.v1.PlatformUsageHoldReceipt',
1145
1152
  mutation: true,