@sylphx/sdk 0.32.24 → 0.32.27
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/auth/client.d.ts +3 -7
- package/dist/auth/client.js +3 -7
- package/dist/auth/client.js.map +1 -1
- package/dist/auth.d.ts +4 -1
- package/dist/auth.js +1 -0
- package/dist/auth.js.map +1 -1
- package/dist/ids.d.ts +6 -6
- package/dist/ids.js +6 -6
- package/dist/ids.js.map +1 -1
- package/dist/methods.js +0 -263
- package/dist/methods.js.map +1 -1
- package/dist/money.d.ts +120 -1
- package/dist/money.js +40 -2
- package/dist/money.js.map +1 -1
- package/dist/notify.d.ts +6 -1165
- package/dist/notify.js +1 -838
- package/dist/notify.js.map +1 -1
- package/dist/sandboxes.d.ts +28 -4
- package/dist/sandboxes.js +4 -0
- package/dist/sandboxes.js.map +1 -1
- package/dist/secrets.d.ts +9 -5
- package/dist/secrets.js +3 -2
- package/dist/secrets.js.map +1 -1
- package/package.json +1 -1
package/dist/money.d.ts
CHANGED
|
@@ -237,6 +237,14 @@ export interface CatalogSpec {
|
|
|
237
237
|
* The old home currency's wallet must also be empty. Unset means 90.
|
|
238
238
|
*/
|
|
239
239
|
rehomeCooldownDays?: number;
|
|
240
|
+
/**
|
|
241
|
+
* Exact FX snapshot used by opted-in prices: target major units per USD,
|
|
242
|
+
* as positive decimal strings with at most 18 fractional places. USD is
|
|
243
|
+
* always 1 and can be omitted. Money does not fetch rates during a write.
|
|
244
|
+
*/
|
|
245
|
+
fxRatesPerUsd?: Record<string, string>;
|
|
246
|
+
/** Optional Stripe Checkout styling applied to new sessions in this environment. */
|
|
247
|
+
checkoutBranding?: CheckoutBranding;
|
|
240
248
|
}
|
|
241
249
|
/** CatalogStatus is the observed state of a Catalog. */
|
|
242
250
|
export interface CatalogStatus {
|
|
@@ -248,6 +256,30 @@ export interface CatalogStatus {
|
|
|
248
256
|
readonly syncTime?: string;
|
|
249
257
|
/** The processor object behind each price, by lookup key. */
|
|
250
258
|
readonly processorPriceIds?: Record<string, string>;
|
|
259
|
+
/** The observed diff, present only in a dry-run SyncCatalog response. */
|
|
260
|
+
readonly syncPlan?: CatalogSyncPlan;
|
|
261
|
+
}
|
|
262
|
+
/** CatalogSyncChange describes a managed product or price that needs to change. */
|
|
263
|
+
export interface CatalogSyncChange {
|
|
264
|
+
/** Catalog product key. */
|
|
265
|
+
readonly productKey?: string;
|
|
266
|
+
/** Catalog price key, unset for product changes. */
|
|
267
|
+
readonly priceKey?: string;
|
|
268
|
+
/** One of create_product, update_product, create_price, replace_price, archive_price. */
|
|
269
|
+
readonly action?: string;
|
|
270
|
+
/** Observed Stripe object ID, unset for creations. */
|
|
271
|
+
readonly processorId?: string;
|
|
272
|
+
/** Existing minor-unit amounts by ISO currency, for price changes. */
|
|
273
|
+
readonly observedUnitAmounts?: Record<string, string>;
|
|
274
|
+
/** Desired minor-unit amounts by ISO currency, unset for archival and product changes. */
|
|
275
|
+
readonly desiredUnitAmounts?: Record<string, string>;
|
|
276
|
+
}
|
|
277
|
+
/** CatalogSyncPlan reports pending outward changes to the connected Stripe account. */
|
|
278
|
+
export interface CatalogSyncPlan {
|
|
279
|
+
/** Opaque precondition for applying this exact plan with SyncCatalog. */
|
|
280
|
+
readonly fingerprint?: string;
|
|
281
|
+
/** Pending changes in deterministic apply order. Empty means already matched. */
|
|
282
|
+
readonly changes?: CatalogSyncChange[];
|
|
251
283
|
}
|
|
252
284
|
/** The request of ChangeCustomerSubscriptionPlan. */
|
|
253
285
|
export interface ChangeCustomerSubscriptionPlanRequest {
|
|
@@ -328,6 +360,36 @@ export interface CheckUsageStandingRequest {
|
|
|
328
360
|
/** For a customer organization: the acting user's token. */
|
|
329
361
|
actorProof?: string;
|
|
330
362
|
}
|
|
363
|
+
/** Select exactly one source for the image; Money does not fetch it. */
|
|
364
|
+
export interface CheckoutBrandImage {
|
|
365
|
+
/** A Stripe File ID owned by the connected merchant account. */
|
|
366
|
+
file?: string;
|
|
367
|
+
/** A public HTTPS image URL on a public DNS name, up to 2,048 bytes. */
|
|
368
|
+
url?: string;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Merchant-controlled styling for hosted Stripe Checkout Sessions. Omitted
|
|
372
|
+
* fields keep the existing behavior; this does not change the Stripe account.
|
|
373
|
+
*/
|
|
374
|
+
export interface CheckoutBranding {
|
|
375
|
+
/**
|
|
376
|
+
* Header override, folded to one line and limited to 60 characters by Money.
|
|
377
|
+
* If omitted, use the catalog name for a single product, or Stripe's default.
|
|
378
|
+
*/
|
|
379
|
+
displayName?: string;
|
|
380
|
+
/** Square brand image. */
|
|
381
|
+
icon?: CheckoutBrandImage;
|
|
382
|
+
/** Brand logo image. */
|
|
383
|
+
logo?: CheckoutBrandImage;
|
|
384
|
+
/** Six-digit hex color, including the leading '#'. */
|
|
385
|
+
buttonColor?: string;
|
|
386
|
+
/** Six-digit hex color, including the leading '#'. */
|
|
387
|
+
backgroundColor?: string;
|
|
388
|
+
/** Stripe Checkout's shape for buttons and inputs. */
|
|
389
|
+
borderStyle?: string;
|
|
390
|
+
/** Stripe Checkout's font family, in lowercase snake_case. */
|
|
391
|
+
fontFamily?: string;
|
|
392
|
+
}
|
|
331
393
|
/**
|
|
332
394
|
* The consent evidence of one checkout: what was asked, what the buyer
|
|
333
395
|
* answered, and when Money recorded it.
|
|
@@ -782,6 +844,12 @@ export interface CustomerSubscription {
|
|
|
782
844
|
readonly latestPaymentId?: string;
|
|
783
845
|
/** Timestamp of the latest settled subscription payment, when reported. */
|
|
784
846
|
readonly lastPaidTime?: string;
|
|
847
|
+
/**
|
|
848
|
+
* On GetCustomerSubscription, the eligible annual catalog price key, or
|
|
849
|
+
* empty when Money cannot offer the switch. An offer is not a quote: Money
|
|
850
|
+
* checks eligibility again when creating the hosted confirmation session.
|
|
851
|
+
*/
|
|
852
|
+
readonly availablePortalSwitchPrice?: string;
|
|
785
853
|
}
|
|
786
854
|
/** The request of DeleteRevenueSource. */
|
|
787
855
|
export interface DeleteRevenueSourceRequest {
|
|
@@ -903,6 +971,31 @@ export interface Feature {
|
|
|
903
971
|
/** Shown to people. */
|
|
904
972
|
displayName?: string;
|
|
905
973
|
}
|
|
974
|
+
/**
|
|
975
|
+
* FxPricing opts a price into Money's retail tier policy. Stored-value
|
|
976
|
+
* products use top-up tiers; other recurring and one-time prices use retail
|
|
977
|
+
* tiers. Currency amounts are always expressed in ISO minor units.
|
|
978
|
+
*/
|
|
979
|
+
export interface FxPricing {
|
|
980
|
+
/** Positive base anchor, in USD minor units (cents), as a decimal integer. */
|
|
981
|
+
usdMinor?: string;
|
|
982
|
+
/**
|
|
983
|
+
* The exact set of currencies to publish, including USD only if listed.
|
|
984
|
+
* Every non-USD currency needs a rate unless it has an exact override.
|
|
985
|
+
*/
|
|
986
|
+
currencies?: string[];
|
|
987
|
+
/**
|
|
988
|
+
* Exact positive minor-unit amounts, by listed currency. Bypass snapping
|
|
989
|
+
* and hysteresis for these currencies.
|
|
990
|
+
*/
|
|
991
|
+
overrides?: Record<string, string>;
|
|
992
|
+
/**
|
|
993
|
+
* How far conversion must cross the next tier boundary before changing a
|
|
994
|
+
* prior Money-generated tier, in basis points of that prior amount. Unset
|
|
995
|
+
* means 500 (5%); 0 disables hysteresis.
|
|
996
|
+
*/
|
|
997
|
+
deadbandBps?: number;
|
|
998
|
+
}
|
|
906
999
|
/** The request of GenerateLicenceKey. */
|
|
907
1000
|
export interface GenerateLicenceKeyRequest {
|
|
908
1001
|
/** The environment the key belongs to. */
|
|
@@ -1676,6 +1769,12 @@ export interface PortalSession {
|
|
|
1676
1769
|
* Omitted: use the subject's original customer binding.
|
|
1677
1770
|
*/
|
|
1678
1771
|
customerSubscription?: string;
|
|
1772
|
+
/**
|
|
1773
|
+
* The explicitly allowed annual catalog price key to offer for the named
|
|
1774
|
+
* customer_subscription. Opens only a hosted confirmation, not the general
|
|
1775
|
+
* portal, and never changes the subscription until the buyer confirms.
|
|
1776
|
+
*/
|
|
1777
|
+
switchPrice?: string;
|
|
1679
1778
|
/** The hosted page; valid for a few minutes. */
|
|
1680
1779
|
readonly url?: string;
|
|
1681
1780
|
}
|
|
@@ -1695,6 +1794,8 @@ export interface Price {
|
|
|
1695
1794
|
* of minor units, for example `{"USD": "499", "GBP": "399"}`. The processor's
|
|
1696
1795
|
* base currency is `default_currency` when set, else the first currency in
|
|
1697
1796
|
* code order.
|
|
1797
|
+
* Required for a price without `fx_pricing`. For an opted-in price Money
|
|
1798
|
+
* ignores this field on input and returns the materialized amounts here.
|
|
1698
1799
|
*/
|
|
1699
1800
|
unitAmounts?: Record<string, string>;
|
|
1700
1801
|
/** `inclusive` (the amount includes tax) or `exclusive`. */
|
|
@@ -1720,6 +1821,18 @@ export interface Price {
|
|
|
1720
1821
|
* Store introductory offers are configured and enforced by the store.
|
|
1721
1822
|
*/
|
|
1722
1823
|
introductoryUnitAmounts?: Record<string, string>;
|
|
1824
|
+
/** Localized pricing intent. Unset to author `unit_amounts` directly. */
|
|
1825
|
+
fxPricing?: FxPricing;
|
|
1826
|
+
/** Feature grants overriding the product for this price. */
|
|
1827
|
+
features?: Record<string, string>;
|
|
1828
|
+
/** Overrides the product cadence. Unset inherits the product cadence. */
|
|
1829
|
+
grantCadence?: string;
|
|
1830
|
+
/**
|
|
1831
|
+
* Opt in to a Stripe-hosted switch from this active monthly price to the
|
|
1832
|
+
* named active yearly price on the same product. Both intervals must have
|
|
1833
|
+
* a count of one. Empty disables buyer-initiated switches from this price.
|
|
1834
|
+
*/
|
|
1835
|
+
portalAnnualPrice?: string;
|
|
1723
1836
|
}
|
|
1724
1837
|
/**
|
|
1725
1838
|
* A stored Stripe hint. No payload, customer details, credential or raw error
|
|
@@ -1831,6 +1944,8 @@ export interface Product {
|
|
|
1831
1944
|
* price paid.
|
|
1832
1945
|
*/
|
|
1833
1946
|
storedValue?: boolean;
|
|
1947
|
+
/** Default wallet grant cadence for recurring prices: billing_period or monthly. */
|
|
1948
|
+
grantCadence?: string;
|
|
1834
1949
|
}
|
|
1835
1950
|
/** Records statement evidence and confirms only an exact, timely, unambiguous payment. */
|
|
1836
1951
|
export interface RecordBankReceiptRequest {
|
|
@@ -2490,6 +2605,10 @@ export interface Subject {
|
|
|
2490
2605
|
export interface SyncCatalogRequest {
|
|
2491
2606
|
/** The catalog to push. */
|
|
2492
2607
|
name: string;
|
|
2608
|
+
/** Observe Stripe and return a plan without updating Stripe or Money. */
|
|
2609
|
+
dryRun?: boolean;
|
|
2610
|
+
/** If set on apply, refuse the entire operation if the plan no longer matches. */
|
|
2611
|
+
planFingerprint?: string;
|
|
2493
2612
|
}
|
|
2494
2613
|
/**
|
|
2495
2614
|
* A Tax Threshold Status is where the environment's consumer (B2C) paid
|
|
@@ -3664,7 +3783,7 @@ export declare class PortalSessionsCollection {
|
|
|
3664
3783
|
*
|
|
3665
3784
|
* `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/portal_sessions` · permission `billing:write` · effect `write`
|
|
3666
3785
|
*
|
|
3667
|
-
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `UNAVAILABLE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
3786
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `UNAVAILABLE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
3668
3787
|
*/
|
|
3669
3788
|
create(request: CreatePortalSessionRequest): Promise<PortalSession>;
|
|
3670
3789
|
/**
|
package/dist/money.js
CHANGED
|
@@ -74,12 +74,25 @@ runtime.registerSchemas({
|
|
|
74
74
|
['applicationData', 'application_data', undefined, 'json'],
|
|
75
75
|
['currencyMode', 'currency_mode'],
|
|
76
76
|
['rehomeCooldownDays', 'rehome_cooldown_days'],
|
|
77
|
+
['fxRatesPerUsd', 'fx_rates_per_usd', undefined, 'map'],
|
|
78
|
+
['checkoutBranding', 'checkout_branding', 'sylphx.money.v1.CheckoutBranding'],
|
|
77
79
|
],
|
|
78
80
|
'sylphx.money.v1.CatalogStatus': [
|
|
79
81
|
['observedGeneration', 'observed_generation'],
|
|
80
82
|
['conditions', 'conditions', 'sylphx.common.v1.Condition'],
|
|
81
83
|
['syncTime', 'sync_time'],
|
|
82
84
|
['processorPriceIds', 'processor_price_ids', undefined, 'map'],
|
|
85
|
+
['syncPlan', 'sync_plan', 'sylphx.money.v1.CatalogSyncPlan'],
|
|
86
|
+
],
|
|
87
|
+
'sylphx.money.v1.CatalogSyncChange': [
|
|
88
|
+
['productKey', 'product_key'],
|
|
89
|
+
['priceKey', 'price_key'],
|
|
90
|
+
['processorId', 'processor_id'],
|
|
91
|
+
['observedUnitAmounts', 'observed_unit_amounts', undefined, 'map'],
|
|
92
|
+
['desiredUnitAmounts', 'desired_unit_amounts', undefined, 'map'],
|
|
93
|
+
],
|
|
94
|
+
'sylphx.money.v1.CatalogSyncPlan': [
|
|
95
|
+
['changes', 'changes', 'sylphx.money.v1.CatalogSyncChange'],
|
|
83
96
|
],
|
|
84
97
|
'sylphx.money.v1.ChangeCustomerSubscriptionPlanRequest': [
|
|
85
98
|
['prorationBehavior', 'proration_behavior'],
|
|
@@ -103,6 +116,16 @@ runtime.registerSchemas({
|
|
|
103
116
|
['subjectProof', 'subject_proof'],
|
|
104
117
|
['actorProof', 'actor_proof'],
|
|
105
118
|
],
|
|
119
|
+
'sylphx.money.v1.CheckoutBrandImage': [],
|
|
120
|
+
'sylphx.money.v1.CheckoutBranding': [
|
|
121
|
+
['displayName', 'display_name'],
|
|
122
|
+
['icon', 'icon', 'sylphx.money.v1.CheckoutBrandImage'],
|
|
123
|
+
['logo', 'logo', 'sylphx.money.v1.CheckoutBrandImage'],
|
|
124
|
+
['buttonColor', 'button_color'],
|
|
125
|
+
['backgroundColor', 'background_color'],
|
|
126
|
+
['borderStyle', 'border_style'],
|
|
127
|
+
['fontFamily', 'font_family'],
|
|
128
|
+
],
|
|
106
129
|
'sylphx.money.v1.CheckoutConsent': [
|
|
107
130
|
['termsAccepted', 'terms_accepted'],
|
|
108
131
|
['termsText', 'terms_text'],
|
|
@@ -238,6 +261,7 @@ runtime.registerSchemas({
|
|
|
238
261
|
['latestInvoiceId', 'latest_invoice_id'],
|
|
239
262
|
['latestPaymentId', 'latest_payment_id'],
|
|
240
263
|
['lastPaidTime', 'last_paid_time'],
|
|
264
|
+
['availablePortalSwitchPrice', 'available_portal_switch_price'],
|
|
241
265
|
],
|
|
242
266
|
'sylphx.money.v1.DeleteRevenueSourceRequest': [
|
|
243
267
|
['validateOnly', 'validate_only'],
|
|
@@ -261,6 +285,11 @@ runtime.registerSchemas({
|
|
|
261
285
|
'sylphx.money.v1.Feature': [
|
|
262
286
|
['displayName', 'display_name'],
|
|
263
287
|
],
|
|
288
|
+
'sylphx.money.v1.FxPricing': [
|
|
289
|
+
['usdMinor', 'usd_minor'],
|
|
290
|
+
['overrides', 'overrides', undefined, 'map'],
|
|
291
|
+
['deadbandBps', 'deadband_bps'],
|
|
292
|
+
],
|
|
264
293
|
'sylphx.money.v1.GenerateLicenceKeyRequest': [
|
|
265
294
|
['licenceKeyId', 'licence_key_id'],
|
|
266
295
|
['spec', 'spec', 'sylphx.money.v1.LicenceKeySpec'],
|
|
@@ -517,6 +546,7 @@ runtime.registerSchemas({
|
|
|
517
546
|
['subject', 'subject', 'sylphx.money.v1.Subject'],
|
|
518
547
|
['returnUrl', 'return_url'],
|
|
519
548
|
['customerSubscription', 'customer_subscription'],
|
|
549
|
+
['switchPrice', 'switch_price'],
|
|
520
550
|
],
|
|
521
551
|
'sylphx.money.v1.Price': [
|
|
522
552
|
['recurringInterval', 'recurring_interval'],
|
|
@@ -526,6 +556,10 @@ runtime.registerSchemas({
|
|
|
526
556
|
['trialDays', 'trial_days'],
|
|
527
557
|
['defaultCurrency', 'default_currency'],
|
|
528
558
|
['introductoryUnitAmounts', 'introductory_unit_amounts', undefined, 'map'],
|
|
559
|
+
['fxPricing', 'fx_pricing', 'sylphx.money.v1.FxPricing'],
|
|
560
|
+
['features', 'features', undefined, 'map'],
|
|
561
|
+
['grantCadence', 'grant_cadence'],
|
|
562
|
+
['portalAnnualPrice', 'portal_annual_price'],
|
|
529
563
|
],
|
|
530
564
|
'sylphx.money.v1.ProcessorEvent': [
|
|
531
565
|
['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
|
|
@@ -554,6 +588,7 @@ runtime.registerSchemas({
|
|
|
554
588
|
['googleplayPackageName', 'googleplay_package_name'],
|
|
555
589
|
['storeProductAliases', 'store_product_aliases', 'sylphx.money.v1.StoreProductAlias'],
|
|
556
590
|
['storedValue', 'stored_value'],
|
|
591
|
+
['grantCadence', 'grant_cadence'],
|
|
557
592
|
],
|
|
558
593
|
'sylphx.money.v1.RecordBankReceiptRequest': [
|
|
559
594
|
['checkoutSession', 'checkout_session'],
|
|
@@ -733,7 +768,10 @@ runtime.registerSchemas({
|
|
|
733
768
|
['endUser', 'end_user'],
|
|
734
769
|
['customerOrganization', 'customer_organization'],
|
|
735
770
|
],
|
|
736
|
-
'sylphx.money.v1.SyncCatalogRequest': [
|
|
771
|
+
'sylphx.money.v1.SyncCatalogRequest': [
|
|
772
|
+
['dryRun', 'dry_run'],
|
|
773
|
+
['planFingerprint', 'plan_fingerprint'],
|
|
774
|
+
],
|
|
737
775
|
'sylphx.money.v1.TaxThresholdStatus': [
|
|
738
776
|
['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
|
|
739
777
|
['regionCode', 'region_code'],
|
|
@@ -2131,7 +2169,7 @@ export class PortalSessionsCollection {
|
|
|
2131
2169
|
*
|
|
2132
2170
|
* `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/portal_sessions` · permission `billing:write` · effect `write`
|
|
2133
2171
|
*
|
|
2134
|
-
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `UNAVAILABLE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
2172
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `UNAVAILABLE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
2135
2173
|
*/
|
|
2136
2174
|
async create(request) {
|
|
2137
2175
|
return this.client.call({
|