palbase 0.78.1 → 0.80.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/ai/index.js +2 -2
  2. package/dist/ai-sdk/index.js +2 -2
  3. package/dist/backend/engine.js +2 -2
  4. package/dist/backend/env.js +1 -1
  5. package/dist/backend/index.js +3 -3
  6. package/dist/backend/stack.js +1 -1
  7. package/dist/backend/test.js +2 -2
  8. package/dist/chunks/{35KQJQ77.js → 2NB7UENO.js} +2 -2
  9. package/dist/chunks/{3XF644A5.js → 5BQM5XTX.js} +2 -2
  10. package/dist/chunks/{VNUCKM7H.js → 6INSGN37.js} +1 -1
  11. package/dist/chunks/{ROV6TJZK.js → 6PUARVHY.js} +1 -1
  12. package/dist/chunks/{TFPVJ3C3.js → 7NOXAQOX.js} +2 -2
  13. package/dist/chunks/{L63FWRZX.js → 7QS5ABCT.js} +2 -2
  14. package/dist/chunks/{RB4JQXKZ.js → 7XQVUV65.js} +2 -2
  15. package/dist/chunks/{UUDOMSKW.js → BQUNZH5E.js} +2 -2
  16. package/dist/chunks/{FCCX2OTM.js → DP6WZPTF.js} +2 -2
  17. package/dist/chunks/{WTFMJKDB.js → FUNHIQCH.js} +2 -2
  18. package/dist/chunks/G4PGGIAO.js +2 -0
  19. package/dist/chunks/{LXS7JHPJ.js → IK4MB3HQ.js} +2 -2
  20. package/dist/chunks/{JY7YG3BO.js → IS5HMTJX.js} +2 -2
  21. package/dist/chunks/{2T3EX52E.js → LZXD4SBY.js} +1 -1
  22. package/dist/chunks/{6Y4ICGZ7.js → N767RMLK.js} +2 -2
  23. package/dist/chunks/{ZIHVYOXE.js → OY6JSD3B.js} +2 -2
  24. package/dist/chunks/{EUMY6SCM.js → QV53HO4D.js} +1 -1
  25. package/dist/chunks/{ZBTOHVML.js → RGCK6WN2.js} +2 -2
  26. package/dist/chunks/{QWKOKJKM.js → RU3A4ASQ.js} +1 -1
  27. package/dist/chunks/{25KG2TVU.js → T2XBJBUC.js} +1 -1
  28. package/dist/chunks/TNNTPBI3.js +23 -0
  29. package/dist/chunks/{5KGMQFET.js → TOGOOVTU.js} +1 -1
  30. package/dist/chunks/{LONPNPNX.js → UKM6LWJ3.js} +2 -2
  31. package/dist/chunks/{IO5HB5B6.js → VZQI2MW2.js} +2 -2
  32. package/dist/chunks/WUOSCBJ3.js +13 -0
  33. package/dist/cli.js +5 -4
  34. package/dist/cloud/index.js +2 -2
  35. package/dist/refuse/ai-sdk.js +1 -1
  36. package/dist/refuse/ai.js +1 -1
  37. package/dist/refuse/backend.js +1 -1
  38. package/dist/refuse/cloud.js +1 -1
  39. package/dist/refuse/server.js +1 -1
  40. package/dist/server/index.js +2 -2
  41. package/dist/server/testing.js +2 -2
  42. package/dist/web/index.js +2 -2
  43. package/dist/web/message.js +2 -2
  44. package/dist/web/palbe.js +2 -2
  45. package/dist/web/payments-ui.js +2 -2
  46. package/dist/web/paywall.js +2 -2
  47. package/dist/web/push-sw.js +1 -1
  48. package/dist/web/ssr.js +2 -2
  49. package/dist/web/vite.js +2 -2
  50. package/package.json +2 -2
  51. package/types/cloud/src/generated/project.d.ts +2 -2
  52. package/types/internal/src/chat.d.ts +17 -0
  53. package/types/internal/src/modules/ai.d.ts +48 -3
  54. package/types/internal/src/modules/commerce.d.ts +38 -12
  55. package/types/internal/src/modules/events.d.ts +2 -2
  56. package/types/internal/src/modules/iap.d.ts +112 -101
  57. package/types/internal/src/modules/payments.d.ts +828 -18
  58. package/types/web/src/chat.d.ts +4 -2
  59. package/types/web/src/iap.d.ts +6 -0
  60. package/dist/chunks/3TJFV35H.js +0 -2
  61. package/dist/chunks/426QPZNS.js +0 -13
  62. package/dist/chunks/4XE4HLPK.js +0 -23
@@ -298,23 +298,6 @@ export type AppleTransactionReport = {
298
298
  */
299
299
  transactions: string[];
300
300
  };
301
- /**
302
- * What the Stripe account holds of the catalog once a plan was written, read back from Stripe; null maps when the plan failed before reading it.
303
- */
304
- export type AppliedStripe = {
305
- /**
306
- * The prices, by lookup key.
307
- */
308
- prices: ({
309
- [key: string]: StripePrice;
310
- }) | null;
311
- /**
312
- * The products, by the catalog's product key.
313
- */
314
- products: ({
315
- [key: string]: StripeProduct;
316
- }) | null;
317
- };
318
301
  /**
319
302
  * A key the project's apps sent in their attributes, as they said it — unverified, a suggestion for writing rules —, never its value.
320
303
  */
@@ -384,7 +367,7 @@ export type Catalog = {
384
367
  products: Product[];
385
368
  };
386
369
  /**
387
- * iap.catalog.applied: a plan's Stripe part was written (applied) or failed; or the stores module answered of its App Store or Google Play part.
370
+ * iap.catalog.applied: the stores module answered of a plan's App Store or Google Play part: written (applied) or failed.
388
371
  */
389
372
  export type CatalogAppliedEvent = {
390
373
  /**
@@ -541,7 +524,7 @@ export type CatalogPlan = {
541
524
  */
542
525
  created_at: string;
543
526
  /**
544
- * Why it failed, as Stripe said it.
527
+ * Why writing it failed, as the stores module said it.
545
528
  */
546
529
  error?: string;
547
530
  google: StorePlan;
@@ -554,7 +537,6 @@ export type CatalogPlan = {
554
537
  * What the check found of the revision (warnings: a saved revision has no other).
555
538
  */
556
539
  problems: CatalogProblem[];
557
- result?: AppliedStripe;
558
540
  /**
559
541
  * The revision it was made from.
560
542
  */
@@ -563,6 +545,7 @@ export type CatalogPlan = {
563
545
  * planned (waits on a person), stale (the catalog changed since), applying, applied, failed (`error` says why), declined.
564
546
  */
565
547
  status: "planned" | "stale" | "applying" | "applied" | "failed" | "declined";
548
+ web: WebPlan;
566
549
  };
567
550
  /**
568
551
  * One thing wrong with a catalog.
@@ -1078,6 +1061,10 @@ export type CheckoutConflictError = {
1078
1061
  * Human-readable explanation
1079
1062
  */
1080
1063
  error_description: string;
1064
+ /**
1065
+ * With `already_entitled`, when what they have is a web subscription: its id in the payments module. For a plan sold by the seat, more or fewer seats are a change of its quantity (POST /payments/subscriptions/{id}/quantity).
1066
+ */
1067
+ payments_subscription_id?: string;
1081
1068
  /**
1082
1069
  * The catalog's product they have — the same, or one of its group: with `already_entitled`, absent otherwise.
1083
1070
  */
@@ -1115,6 +1102,10 @@ export type CheckoutRequest = {
1115
1102
  * Optional ISO 4217 currency override from the plan's web price overrides.
1116
1103
  */
1117
1104
  currency?: string;
1105
+ /**
1106
+ * The customer the checkout is for, named by the project's server (its secret key) — a team, a company, a user it acts for: the purchase is theirs at once, with nothing to redeem. They become a customer if they were not one. Refused with any other credential (403 `customer_id_not_allowed`): a signed-in customer buys for themselves.
1107
+ */
1108
+ customer_id?: string;
1118
1109
  /**
1119
1110
  * One of the catalog's offers the customer may take, on this plan: its coupon (or the promotion code of the coupon code that opened it), or its free trial, on the checkout.
1120
1111
  */
@@ -1127,6 +1118,10 @@ export type CheckoutRequest = {
1127
1118
  * The catalog's product (sold on the web).
1128
1119
  */
1129
1120
  product: string;
1121
+ /**
1122
+ * How many seats of the plan to buy: 1 when absent, at most the plan's `max_quantity` (`invalid_quantity`). The plan's price is one seat's; the subscription is charged that times the seats, each period. More or fewer seats of a subscription the customer already has are a change of its quantity (POST /payments/subscriptions/{id}/quantity), not another checkout.
1123
+ */
1124
+ quantity?: number;
1130
1125
  source?: CheckoutSource;
1131
1126
  /**
1132
1127
  * Where Stripe sends the buyer back once paid: a registered web app's origin, or a native app's own scheme. Stripe replaces `{CHECKOUT_SESSION_ID}` in it with the session's id: the page asks the redemption link with it.
@@ -1784,9 +1779,9 @@ export type CustomerEvent = {
1784
1779
  */
1785
1780
  is_sandbox: boolean;
1786
1781
  /**
1787
- * What happened: a payment (`purchase`, `renewal`), a `refund`, a subscription's renewal turned off (`cancellation`) or back on (`resumption`), a failed charge (`billing_issue`), its end (`expiration`), a grant given (`grant`) or taken back (`grant_revoked`), credits moved (`credits`), a purchase moved to (`transfer_in`) or from (`transfer_out`) the customer. Support's own: a subscription extended (`extension`), refunded (`refund_issued`) or its renewal turned off (`cancel_requested`); and the customer asking the App Store for a refund (`refund_requested`).
1782
+ * What happened: a payment (`purchase`, `renewal`, `seats`: seats added to a web subscription within its period, charged at once), a `refund`, a subscription's renewal turned off (`cancellation`) or back on (`resumption`), a failed charge (`billing_issue`), its end (`expiration`), a grant given (`grant`) or taken back (`grant_revoked`), credits moved (`credits`), a purchase moved to (`transfer_in`) or from (`transfer_out`) the customer. Support's own: a subscription extended (`extension`), refunded (`refund_issued`) or its renewal turned off (`cancel_requested`); and the customer asking the App Store for a refund (`refund_requested`).
1788
1783
  */
1789
- kind: "purchase" | "renewal" | "refund" | "cancellation" | "resumption" | "billing_issue" | "expiration" | "grant" | "grant_revoked" | "credits" | "transfer_in" | "transfer_out" | "extension" | "refund_issued" | "cancel_requested" | "refund_requested";
1784
+ kind: "purchase" | "renewal" | "seats" | "refund" | "cancellation" | "resumption" | "billing_issue" | "expiration" | "grant" | "grant_revoked" | "credits" | "transfer_in" | "transfer_out" | "extension" | "refund_issued" | "cancel_requested" | "refund_requested";
1790
1785
  /**
1791
1786
  * What support wrote of what it did.
1792
1787
  */
@@ -2919,6 +2914,10 @@ export type OfferingPlan = {
2919
2914
  * The catalog's plan key.
2920
2915
  */
2921
2916
  key: string;
2917
+ /**
2918
+ * When more than one, how many seats one subscription of the plan may be of: `price` is one seat's. Absent for a plan sold as one.
2919
+ */
2920
+ max_quantity?: number;
2922
2921
  /**
2923
2922
  * A subscription's period.
2924
2923
  */
@@ -4848,6 +4847,10 @@ export type Plan = {
4848
4847
  * Its key: lowercase letters, digits and _, starting with a letter.
4849
4848
  */
4850
4849
  key: string;
4850
+ /**
4851
+ * How many seats one subscription of the plan may be of — for an app sold by the seat: the plan's price is one seat's, and a checkout names how many (`quantity`). 1 when absent. A plan of several is a subscription's, and is sold on the web alone: the App Store and Google Play sell a subscription as one (`quantity_web_only`, on that store's channel).
4852
+ */
4853
+ max_quantity?: number;
4851
4854
  /**
4852
4855
  * A subscription's billing period, an ISO 8601 duration: the App Store sells by P1W, P1M, P2M, P3M, P6M, P1Y; Google Play adds P4W, P4M, P8M; Stripe bills at most once a year.
4853
4856
  */
@@ -4863,7 +4866,7 @@ export type Plan = {
4863
4866
  */
4864
4867
  export type PlanConfirmation = {
4865
4868
  /**
4866
- * The Stripe part's hash; with no Stripe account connected, the App Store part's.
4869
+ * The App Store part's hash; with nothing to write there, the Google Play part's.
4867
4870
  */
4868
4871
  hash: string;
4869
4872
  };
@@ -4886,7 +4889,7 @@ export type PlanStep = {
4886
4889
  */
4887
4890
  note?: string;
4888
4891
  /**
4889
- * What it does: create_product, update_product, create_price (Stripe); create_subscription_group, create_subscription, create_in_app_purchase, update_subscription, update_in_app_purchase (what the catalog changed of a product App Store Connect has: its text, its price — a subscription's from the day after tomorrow (UTC) on, its subscribers keeping theirs; an in-app purchase's now —, its review screenshot and note), link_subscription, link_in_app_purchase (a product App Store Connect already sells, found by its id, nothing made or changed) (the App Store); create_subscription, create_onetime_product, update_subscription, update_onetime_product, link_subscription, link_onetime_product (Google Play).
4892
+ * What it does: create_subscription_group, create_subscription, create_in_app_purchase, update_subscription, update_in_app_purchase (what the catalog changed of a product App Store Connect has: its text, its price — a subscription's from the day after tomorrow (UTC) on, its subscribers keeping theirs; an in-app purchase's now —, its review screenshot and note), link_subscription, link_in_app_purchase (a product App Store Connect already sells, found by its id, nothing made or changed) (the App Store); create_subscription, create_onetime_product, update_subscription, update_onetime_product, link_subscription, link_onetime_product (Google Play).
4890
4893
  */
4891
4894
  op: string;
4892
4895
  /**
@@ -4924,9 +4927,13 @@ export type PlayStoreOffer = {
4924
4927
  */
4925
4928
  export type PortalRequest = {
4926
4929
  /**
4927
- * Optional payment channel key override.
4930
+ * The payment channel whose portal to open. When absent: the channel of the customer's newest web subscription — the provider that knows them.
4928
4931
  */
4929
4932
  channel?: string;
4933
+ /**
4934
+ * The customer whose portal to open, named by the project's server (its secret key): required with the secret key (400 `customer_id_required`), refused with a customer's own session (403 `customer_id_not_allowed`), which opens their own.
4935
+ */
4936
+ customer_id?: string;
4930
4937
  /**
4931
4938
  * A registered web app's origin, or a native app's own scheme.
4932
4939
  */
@@ -5028,6 +5035,16 @@ export type Price = {
5028
5035
  overrides?: {
5029
5036
  [key: string]: number;
5030
5037
  };
5038
+ /**
5039
+ * On the web: whether the amount holds the tax (inclusive) or the tax is added to it (exclusive), when web_tax is managed — for every currency of the price but those tax_behaviors names. Left out, the Stripe account's default decides: its "Automatic" adds tax to USD and CAD prices and holds it in every other currency.
5040
+ */
5041
+ tax_behavior?: "inclusive" | "exclusive";
5042
+ /**
5043
+ * On the web: a currency's own tax behavior, by its ISO 4217 code — the price's currency's or an override's.
5044
+ */
5045
+ tax_behaviors?: {
5046
+ [key: string]: "inclusive" | "exclusive";
5047
+ };
5031
5048
  };
5032
5049
  /**
5033
5050
  * One thing sold, on every channel it names.
@@ -5916,7 +5933,7 @@ export type StoreID = {
5916
5933
  */
5917
5934
  export type StorePlan = {
5918
5935
  /**
5919
- * The part's hash: a confirmation names the Stripe part's, or — with no Stripe account connected — the App Store part's.
5936
+ * The part's hash: a confirmation names the App Store part's, or — with nothing to write there — the Google Play part's.
5920
5937
  */
5921
5938
  hash?: string;
5922
5939
  /**
@@ -5928,78 +5945,10 @@ export type StorePlan = {
5928
5945
  */
5929
5946
  steps: PlanStep[];
5930
5947
  /**
5931
- * The Stripe account's mode the part is for.
5948
+ * The store's environment the part is for.
5932
5949
  */
5933
5950
  store_env?: "sandbox" | "production";
5934
5951
  };
5935
- /**
5936
- * A price on the project's Stripe account.
5937
- */
5938
- export type StripePrice = {
5939
- /**
5940
- * Whether it is on sale.
5941
- */
5942
- active: boolean;
5943
- /**
5944
- * Its currency (lowercase, as Stripe writes it).
5945
- */
5946
- currency: string;
5947
- /**
5948
- * Its amounts in other currencies.
5949
- */
5950
- currency_options?: {
5951
- [key: string]: number;
5952
- };
5953
- /**
5954
- * Stripe's id.
5955
- */
5956
- id: string;
5957
- /**
5958
- * A subscription's: day, week, month or year.
5959
- */
5960
- interval?: string;
5961
- /**
5962
- * How many intervals a period is.
5963
- */
5964
- interval_count?: number;
5965
- /**
5966
- * Its lookup key: palbase:<ref>:<product>.<plan>.
5967
- */
5968
- lookup_key: string;
5969
- /**
5970
- * Its Stripe product.
5971
- */
5972
- product: string;
5973
- /**
5974
- * Its amount, in minor units.
5975
- */
5976
- unit_amount: number;
5977
- };
5978
- /**
5979
- * A product on the project's Stripe account.
5980
- */
5981
- export type StripeProduct = {
5982
- /**
5983
- * Whether it is on sale.
5984
- */
5985
- active: boolean;
5986
- /**
5987
- * Its description.
5988
- */
5989
- description: string;
5990
- /**
5991
- * Stripe's id.
5992
- */
5993
- id: string;
5994
- /**
5995
- * Its name.
5996
- */
5997
- name: string;
5998
- /**
5999
- * What Stripe taxes it as (txcd_…); absent when none.
6000
- */
6001
- tax_code?: string;
6002
- };
6003
5952
  /**
6004
5953
  * iap.subscription.changed: a customer's subscription started, renewed, stopped renewing (canceled) or renews again (uncanceled), could not be charged (billing_issue) or was again (recovered), ended (expired), or moved to another product (product_changed).
6005
5954
  */
@@ -6053,6 +6002,10 @@ export type SubscriptionInfo = {
6053
6002
  * Whether it gives access now.
6054
6003
  */
6055
6004
  active: boolean;
6005
+ /**
6006
+ * The ISO 4217 currency of `unit_amount`. With `quantity`.
6007
+ */
6008
+ currency?: string;
6056
6009
  /**
6057
6010
  * When access ends.
6058
6011
  */
@@ -6061,11 +6014,23 @@ export type SubscriptionInfo = {
6061
6014
  * Its id in the ledger.
6062
6015
  */
6063
6016
  id: string;
6017
+ /**
6018
+ * How often it is billed: day, week, month or year — every `interval_count` of them. With `quantity`.
6019
+ */
6020
+ interval?: string;
6021
+ /**
6022
+ * How many `interval`s a period is. With `quantity`.
6023
+ */
6024
+ interval_count?: number;
6064
6025
  /**
6065
6026
  * Whether it is a store's test purchase.
6066
6027
  */
6067
6028
  is_sandbox: boolean;
6068
6029
  manage?: Management;
6030
+ /**
6031
+ * The subscription in the payments module: what the project's server changes its seats by (POST /payments/subscriptions/{id}/quantity), and reads it by (GET /payments/subscriptions). Absent until the payments module has told of it, moments after the payment.
6032
+ */
6033
+ payments_subscription_id?: string;
6069
6034
  /**
6070
6035
  * Its plan.
6071
6036
  */
@@ -6074,6 +6039,14 @@ export type SubscriptionInfo = {
6074
6039
  * The catalog's product; absent when the catalog does not map what the store sold.
6075
6040
  */
6076
6041
  product?: string;
6042
+ /**
6043
+ * A web subscription's seats: how many are paid for in the current period. Absent for a store's subscription, which is one.
6044
+ */
6045
+ quantity?: number;
6046
+ /**
6047
+ * How many seats the next renewal bills, when that is fewer than are paid for now (seats given up stay until the period ends). Absent when the renewal bills the same.
6048
+ */
6049
+ renewal_quantity?: number;
6077
6050
  /**
6078
6051
  * Where it is: trial, active and grace give access; billing_retry, paused, expired, revoked (refunded) and replaced (another purchase took it over) do not.
6079
6052
  */
@@ -6082,6 +6055,10 @@ export type SubscriptionInfo = {
6082
6055
  * Where it was bought.
6083
6056
  */
6084
6057
  store: "app_store" | "play_store" | "web";
6058
+ /**
6059
+ * What one seat costs each period, in `currency`'s minor units. With `quantity`.
6060
+ */
6061
+ unit_amount?: number;
6085
6062
  /**
6086
6063
  * Whether it renews (false once canceled: it runs to expires_at).
6087
6064
  */
@@ -6197,6 +6174,40 @@ export type WebOffer = {
6197
6174
  */
6198
6175
  plans: string[];
6199
6176
  };
6177
+ /**
6178
+ * The web's part of a plan: what it sells, each currency apart. Nothing is written for it: a web checkout prices from the catalog at its moment.
6179
+ */
6180
+ export type WebPlan = {
6181
+ /**
6182
+ * Each plan's prices on the web, a currency apiece.
6183
+ */
6184
+ prices: WebPrice[];
6185
+ };
6186
+ /**
6187
+ * A price the web sells a plan at.
6188
+ */
6189
+ export type WebPrice = {
6190
+ /**
6191
+ * In the currency's minor units.
6192
+ */
6193
+ amount: number;
6194
+ /**
6195
+ * Its ISO 4217 currency.
6196
+ */
6197
+ currency: string;
6198
+ /**
6199
+ * The plan's key.
6200
+ */
6201
+ plan: string;
6202
+ /**
6203
+ * The product's key.
6204
+ */
6205
+ product: string;
6206
+ /**
6207
+ * Whether the amount holds the tax (inclusive) or the tax is added to it (exclusive) when web_tax is managed; account_default when the price says neither and the Stripe account's "Include tax in prices" decides.
6208
+ */
6209
+ tax_behavior: "inclusive" | "exclusive" | "account_default";
6210
+ };
6200
6211
  /**
6201
6212
  * The variant that won, and how it is rolled out.
6202
6213
  */
@@ -6269,7 +6280,7 @@ export type XcodeOfferKeyRequest = {
6269
6280
  /** The events this module sends the project's webhooks (x-palbase-events), by type: each one's payload, the event's data. */
6270
6281
  export interface Events {
6271
6282
  /**
6272
- * iap.catalog.applied: a plan's Stripe part was written (applied) or failed; or the stores module answered of its App Store or Google Play part.
6283
+ * iap.catalog.applied: the stores module answered of a plan's App Store or Google Play part: written (applied) or failed.
6273
6284
  */
6274
6285
  "iap.catalog.applied": CatalogAppliedEvent;
6275
6286
  /**
@@ -6474,7 +6485,7 @@ export declare function client(t: Transport): {
6474
6485
  /**
6475
6486
  * Plan bringing the stores to the catalog
6476
6487
  *
6477
- * Computes what writing the newest revision to the stores takes, store by store, before anything is written. The Stripe part is against what the project's Stripe account holds now: a product for each web product, a price for each plan — a price never changes at Stripe: a new amount is a new price, which takes the old one's lookup key, and customers on the old one keep paying it. The App Store and Google Play parts are as the stores module writes them once their accounts are connected; each creation there is permanent. A plan is confirmed with the Stripe part's hash (POST /iap/catalog/plans/{plan_id}/confirm) — the Stripe part is null with no Stripe account connected, and the App Store part's hash confirms it then.
6488
+ * Computes what writing the newest revision to the stores takes, store by store, before anything is written. The App Store and Google Play parts are as the stores module writes them once their accounts are connected; each creation there is permanent. The web's part writes nothing — a web checkout prices from the catalog at its moment — and says what it sells at: each plan's price in each currency, and its tax behavior (inclusive, exclusive, or the Stripe account's default). A plan is confirmed with the App Store part's hash (POST /iap/catalog/plans/{plan_id}/confirm), or the Google Play part's when the App Store's has nothing to write; one with nothing to write at either is not confirmed.
6478
6489
  */
6479
6490
  planCatalog(input?: {
6480
6491
  headers?: {
@@ -6496,7 +6507,7 @@ export declare function client(t: Transport): {
6496
6507
  /**
6497
6508
  * Confirm a plan
6498
6509
  *
6499
- * Writes the plan: only with the hash of the plan shown (the Stripe part's; with no Stripe account connected, the App Store part's), and only while it is planned — a plan the catalog moved past is refused, not written as something nobody saw. The Stripe part is written now, each write with an idempotency key of its own at Stripe: answers the plan applied, with what the account holds now, or failed, with what Stripe said; a new plan picks up where a failed one stopped. The App Store part goes to the stores module, which writes it to App Store Connect with the project's Apple account and answers later (`apple_result`; a plan with no Stripe part stays applying until then); from the confirmation on, a purchase of what it sells maps to the catalog's product and plan. Emits `iap.catalog.applied`.
6510
+ * Writes the plan: only with the hash of the plan shown (the App Store part's; with nothing to write there, the Google Play part's), and only while it is planned — a plan the catalog moved past is refused, not written as something nobody saw. The App Store and Google Play parts go to the stores module, which writes them with the project's Apple and Google accounts and answers later (`apple_result`, `google_result`; the plan stays applying until then); from the confirmation on, a purchase of what it sells maps to the catalog's product and plan. The web's part writes nothing. Emits `iap.catalog.applied` once the stores module answered.
6500
6511
  */
6501
6512
  confirmCatalogPlan(input: {
6502
6513
  path: {
@@ -6619,7 +6630,7 @@ export declare function client(t: Transport): {
6619
6630
  /**
6620
6631
  * Buy on the web
6621
6632
  *
6622
- * Opens a Stripe Checkout session to buy one of the catalog's products sold on the web, at the plan's price on the project's Stripe account: send the buyer to `url`. Stripe sends them back to `success_url` or `cancel_url`, which go back to one of the project's registered apps — a web app's origin, or a native app's own scheme — and nowhere else. With a customer's session — a guest's as well: what a guest buys is theirs, and goes with them to the account they sign in to — the purchase is that customer's; a customer who already has the product, or a subscription of its group, from any store is refused (409 `already_entitled`, naming the store to manage it in): nothing is charged twice. Credits can always be bought again. A free trial is given once per customer, across every channel, and not to a guest: a new one is free to make. With the app's key alone (no session) the buyer is no one yet: Checkout asks their email, no free trial is given, and what they buy waits for the app user who redeems it — its link is shown on the success page to the holder of `redemption_key` (POST /iap/stripe/checkout/redemption) and sent to that email. Checkouts are limited per address and per project with the app's key alone, per customer and per address with a session (429 `too_many_checkouts`). `source` records where the checkout was opened: an app linking out to buy on the web (the App Store's United States storefront allows it, Guideline 3.1.1(a)) says its platform and storefront, and the charts take the App Store's link fee (settings) off what it brings. The checkout is kept as the record of it. The purchase is applied once Stripe reports it (POST /iap/webhooks/stripe).
6633
+ * Opens a Stripe Checkout session to buy one of the catalog's products sold on the web, at the plan's price on the project's Stripe account: send the buyer to `url`. Stripe sends them back to `success_url` or `cancel_url`, which go back to one of the project's registered apps — a web app's origin, or a native app's own scheme — and nowhere else. With a customer's session — a guest's as well: what a guest buys is theirs, and goes with them to the account they sign in to — the purchase is that customer's; a customer who already has the product, or a subscription of its group, from any store is refused (409 `already_entitled`, naming the store to manage it in): nothing is charged twice. Credits can always be bought again. A free trial is given once per customer, across every channel, and not to a guest: a new one is free to make. With the project's secret key and `customer_id`, the checkout is for the customer the server names — a team or a company buying seats, a user it acts for — and the purchase is theirs at once. A plan sold by the seat (its `max_quantity`) takes `quantity`: the plan's price is one seat's, and a customer who already has the subscription is refused with its `payments_subscription_id`, by which its quantity is changed. With the app's key alone (no session), or the secret key naming no customer, the buyer is no one yet: Checkout asks their email, no free trial is given, and what they buy waits for the app user who redeems it — its link is shown on the success page to the holder of `redemption_key` (POST /iap/stripe/checkout/redemption) and sent to that email. Checkouts are limited per address and per project with the app's key alone, per customer and per address with a session (429 `too_many_checkouts`). `source` records where the checkout was opened: an app linking out to buy on the web (the App Store's United States storefront allows it, Guideline 3.1.1(a)) says its platform and storefront, and the charts take the App Store's link fee (settings) off what it brings. The checkout is kept as the record of it. The purchase is applied once Stripe reports it (POST /iap/webhooks/stripe).
6623
6634
  */
6624
6635
  createCheckout(input: {
6625
6636
  body: CheckoutRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
@@ -6999,7 +7010,7 @@ export declare function client(t: Transport): {
6999
7010
  /**
7000
7011
  * Refund a subscription
7001
7012
  *
7002
- * Refunds the subscription's latest payment — all of it (`full`) or what is left of its period (`prorated`) — and ends it now: the customer's access ends as the call answers. Google Play and Stripe; the App Store decides its own refunds (`409 store_decides_refunds`: the customer asks Apple, which asks the app what they used — Palbase answers it when they consented). Kept in the history (`refund_issued`).
7013
+ * Refunds the subscription's latest payment — all of it (`full`) or what is left of its period (`prorated`) — and ends it now: the customer's access ends as the call answers. Google Play and the web; the App Store decides its own refunds (`409 store_decides_refunds`: the customer asks Apple, which asks the app what they used — Palbase answers it when they consented). On the web (Stripe) the newest payment for a period — the last renewal's, or the first payment when it never renewed; never seats charged within a period — is given back in full at Stripe, then the subscription is ended there at once; asked again, it finds the refund made and gives nothing back twice. A web subscription's payment is refunded in full only (`409 refund_in_full_only` for `prorated`); one nothing was charged for yet, a free trial, is refused (`409 nothing_to_refund`: cancel it); an iyzico channel's is given back at iyzico (`409 refund_unavailable`). Kept in the history (`refund_issued`).
7003
7014
  */
7004
7015
  refundSubscription(input: {
7005
7016
  path: {
@@ -7554,7 +7565,7 @@ export declare function client(t: Transport): {
7554
7565
  /**
7555
7566
  * Manage what was bought on the web
7556
7567
  *
7557
- * Opens Stripe's customer portal for the signed-in customer, where they change, cancel or renew what they bought on the web and how they pay: send them to `url`. `return_url` goes back to one of the project's registered apps.
7568
+ * Opens the payment provider's customer portal, where a customer changes, cancels or renews what they bought on the web and how they pay: send them to `url`. With a customer's session it is their own; the project's server, with its secret key, names the customer in `customer_id` — a team's or a company's billing page, opened for whoever manages it. The portal is of the payment channel the customer bought on, unless `channel` names another. `return_url` goes back to one of the project's registered apps. Closed to an environment's token (403 `token_out_of_scope`): whoever holds the link manages the customer's subscriptions and cards at the provider, for as long as the provider keeps it open.
7558
7569
  */
7559
7570
  createPortalSession(input: {
7560
7571
  body: PortalRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */