palbase 0.16.1 → 0.17.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 (53) hide show
  1. package/dist/ai/index.js +2 -2
  2. package/dist/backend/engine.js +2 -2
  3. package/dist/backend/env.js +1 -1
  4. package/dist/backend/index.js +3 -3
  5. package/dist/backend/stack.js +1 -1
  6. package/dist/backend/test.js +2 -2
  7. package/dist/chunks/{JTVDCPW7.js → 22M4UQVQ.js} +2 -2
  8. package/dist/chunks/{T2YPRKJ3.js → 2PIDGENK.js} +2 -2
  9. package/dist/chunks/{KGF5JQ55.js → 3UVLEWTM.js} +1 -1
  10. package/dist/chunks/{P7GVSVOQ.js → 3Y4K6F6T.js} +2 -2
  11. package/dist/chunks/{CQFCBON3.js → 6WGPEHCE.js} +1 -1
  12. package/dist/chunks/{BPDWFY5W.js → 7C7HACEZ.js} +2 -2
  13. package/dist/chunks/{YAS3UQG4.js → B2IIU37G.js} +1 -1
  14. package/dist/chunks/CYLNEHKQ.js +2 -0
  15. package/dist/chunks/{DK4U5V6J.js → DWRLUP7O.js} +2 -2
  16. package/dist/chunks/{4VWCHDF7.js → E27BZ5SM.js} +2 -2
  17. package/dist/chunks/{MDWPVJRO.js → FWX3RGVS.js} +2 -2
  18. package/dist/chunks/{PNWXM3F7.js → K23K6ZFG.js} +2 -2
  19. package/dist/chunks/{TDJKVGZK.js → KBDCHYSD.js} +1 -1
  20. package/dist/chunks/{BOD4ISVQ.js → LAHIVWPV.js} +1 -1
  21. package/dist/chunks/LIKE2KDM.js +22 -0
  22. package/dist/chunks/{3I7TLVPS.js → LR5ONXTF.js} +2 -2
  23. package/dist/chunks/{4NM7FLWE.js → NJFKRHS6.js} +2 -2
  24. package/dist/chunks/{RPMMGWJZ.js → OER3S5NN.js} +2 -2
  25. package/dist/chunks/{W65UTO2K.js → R7PRW7FG.js} +1 -1
  26. package/dist/chunks/{W4QRU33N.js → VXT46THA.js} +2 -2
  27. package/dist/chunks/{RLBTQDNG.js → XT3I7PG3.js} +2 -2
  28. package/dist/chunks/{2ZGWY65B.js → Y6NZV7LU.js} +1 -1
  29. package/dist/chunks/{DZBKUOW6.js → ZSUSEU5H.js} +2 -2
  30. package/dist/cli.js +126 -120
  31. package/dist/refuse/ai.js +1 -1
  32. package/dist/refuse/backend.js +1 -1
  33. package/dist/refuse/server.js +1 -1
  34. package/dist/server/index.js +2 -2
  35. package/dist/server/testing.js +2 -2
  36. package/dist/web/index.js +2 -2
  37. package/dist/web/message.js +2 -2
  38. package/dist/web/palbe.js +2 -2
  39. package/dist/web/paywall.js +2 -2
  40. package/dist/web/push-sw.js +2 -2
  41. package/dist/web/ssr.js +2 -2
  42. package/dist/web/vite.js +2 -2
  43. package/package.json +2 -2
  44. package/types/internal/src/modules/ai.d.ts +39 -0
  45. package/types/internal/src/modules/events.d.ts +4 -3
  46. package/types/internal/src/modules/index.d.ts +1 -0
  47. package/types/internal/src/modules/messaging.d.ts +2322 -0
  48. package/types/internal/src/modules/notify.d.ts +54 -1
  49. package/types/internal/src/modules/purchases.d.ts +383 -0
  50. package/types/internal/src/modules/stores.d.ts +685 -3
  51. package/types/web/src/socket.d.ts +7 -0
  52. package/dist/chunks/AVVQBB3X.js +0 -22
  53. package/dist/chunks/LVST7TZJ.js +0 -2
@@ -45,6 +45,14 @@ export type DeliveryEvent = {
45
45
  * A device — never its token: a signed-in user's, or, with no one signed in on it, its installation's (user_id absent).
46
46
  */
47
47
  export type Device = {
48
+ /**
49
+ * The APNs environment an iOS token is for: the one its SDK said, or the one a push reached it through.
50
+ */
51
+ apns_environment?: "sandbox" | "production";
52
+ /**
53
+ * The project's app the device registered from: the one whose publishable key it presented. An iOS push goes to its bundle.
54
+ */
55
+ app_id?: string;
48
56
  app_version?: string;
49
57
  created_at: string;
50
58
  device_id: string;
@@ -80,6 +88,10 @@ export type DevicePage = {
80
88
  * A device's push token as the app's push SDK gave it: FCM's, APNs' (a PushKit VoIP token on ios_voip), Expo's (ExponentPushToken[…]), or a browser's push subscription (platform web: PushSubscription.toJSON(), its endpoint one of the browsers' push services). A token another device held moves here.
81
89
  */
82
90
  export type DeviceRegistration = {
91
+ /**
92
+ * The Apple Push Notification service environment an iOS token is for: sandbox (an app run from Xcode, a development-signed build) or production (TestFlight, the App Store, ad hoc). Palbase sends through it, to the bundle of the app whose publishable key registered the device. Absent: Palbase tries both and keeps the one that delivers.
93
+ */
94
+ apns_environment?: ("sandbox" | "production") | null;
83
95
  app_version?: string | null;
84
96
  /**
85
97
  * The app's own stable name for the device.
@@ -1957,6 +1969,14 @@ export type NotifyProvider = {
1957
1969
  active: boolean;
1958
1970
  channel: "email" | "sms" | "verify" | "whatsapp" | "push" | "iys";
1959
1971
  created_at: string;
1972
+ /**
1973
+ * Since when the provider's sends have failed for its own fault — its credential refused, a topic an APNs key may not send to: every send through it fails alike until it is fixed. A send to the app it failed for that goes through ends it, and so does saving it anew. Null while it works.
1974
+ */
1975
+ failing_since: string | null;
1976
+ /**
1977
+ * The provider's last such error (APNs error 403: InvalidProviderToken). Null while it works.
1978
+ */
1979
+ last_error: string | null;
1960
1980
  /**
1961
1981
  * Lower is tried first.
1962
1982
  */
@@ -1976,7 +1996,7 @@ export type NotifyProviderList = {
1976
1996
  export type NotifyProviderWrite = {
1977
1997
  active?: boolean;
1978
1998
  /**
1979
- * The provider's credentials, by channel. email — acs {connection_string, from_email}; ses {region, access_key_id, secret_access_key, from_domain}; sendgrid {api_key, from_domain, webhook_public_key: the signed Event Webhook's verification key, for delivery reports}; smtp {host, port, username, password, from_email, use_starttls}. sms — twilio {account_sid, auth_token or api_key_sid + api_key_secret, from_number or messaging_service_sid; with the auth token Twilio reports each text's delivery}; vonage {api_key, api_secret, from, signature_secret + signature_method (md5hash, md5, sha1, sha256, sha512) for its signed delivery receipts}; acs {connection_string, from_number}. verify — twilio_verify {account_sid, auth_token or api_key_sid + api_key_secret, service_sid}. whatsapp — meta {phone_number_id, access_token, api_version, app_secret + verify_token for its webhook}. push — fcm {the service account JSON}; apns {private_key, team_id, key_id, bundle_id, is_production}; expo {access_token}.
1999
+ * The provider's credentials, by channel. email — acs {connection_string, from_email}; ses {region, access_key_id, secret_access_key, from_domain}; sendgrid {api_key, from_domain, webhook_public_key: the signed Event Webhook's verification key, for delivery reports}; smtp {host, port, username, password, from_email, use_starttls}. sms — twilio {account_sid, auth_token or api_key_sid + api_key_secret, from_number or messaging_service_sid; with the auth token Twilio reports each text's delivery}; vonage {api_key, api_secret, from, signature_secret + signature_method (md5hash, md5, sha1, sha256, sha512) for its signed delivery receipts}; acs {connection_string, from_number}. verify — twilio_verify {account_sid, auth_token or api_key_sid + api_key_secret, service_sid}. whatsapp — meta {phone_number_id, access_token, api_version, app_secret + verify_token for its webhook}. push — fcm {the service account JSON}; apns {private_key, team_id, key_id: a team-scoped APNs key, asked of Apple when saved; bundle_id and is_production optional — a push goes to the bundle of the app the device registered from, through the APNs environment it said}; expo {access_token}.
1980
2000
  */
1981
2001
  credentials: {
1982
2002
  [key: string]: unknown;
@@ -2095,11 +2115,40 @@ export type PushDelivery = {
2095
2115
  platform: string;
2096
2116
  provider: string;
2097
2117
  provider_message_id?: string;
2118
+ /**
2119
+ * Where an APNs push went: its environment and the app's bundle (production com.centauri).
2120
+ */
2121
+ route?: string;
2098
2122
  /**
2099
2123
  * The furthest it got.
2100
2124
  */
2101
2125
  status: "sent" | "failed" | "token_invalid" | "delivered" | "not_shown" | "dismissed" | "opened" | "action" | "unconfirmed";
2102
2126
  };
2127
+ /**
2128
+ * notification.push_failing: a push provider that has started failing for its own fault.
2129
+ */
2130
+ export type PushFailingEvent = {
2131
+ /**
2132
+ * push.
2133
+ */
2134
+ channel: string;
2135
+ /**
2136
+ * The provider's error (APNs error 403: InvalidProviderToken).
2137
+ */
2138
+ error: string;
2139
+ /**
2140
+ * When it started failing.
2141
+ */
2142
+ failing_since: string;
2143
+ /**
2144
+ * The project whose provider it is: the platform's own copy names the customer's.
2145
+ */
2146
+ project_id: string;
2147
+ /**
2148
+ * apns, fcm or expo.
2149
+ */
2150
+ provider: string;
2151
+ };
2103
2152
  /**
2104
2153
  * One report from the app about a push on this device.
2105
2154
  */
@@ -2685,6 +2734,10 @@ export interface Events {
2685
2734
  * notification.opened: the person opened a push.
2686
2735
  */
2687
2736
  "notification.opened": NotificationEvent;
2737
+ /**
2738
+ * notification.push_failing: a push provider has started failing for its own fault — its APNs key refused, a topic the key may not send to — and every push through it fails until its setting is fixed. Told to the project and to the platform's own (whose Studio mails the organization's owners), at most once a day a provider.
2739
+ */
2740
+ "notification.push_failing": PushFailingEvent;
2688
2741
  /**
2689
2742
  * notification.read: the recipient read it (WhatsApp).
2690
2743
  */
@@ -5937,6 +5937,314 @@ export type StoreID = {
5937
5937
  */
5938
5938
  product: string;
5939
5939
  };
5940
+ /**
5941
+ * A customer support found, and what found them.
5942
+ */
5943
+ export type CustomerMatch = {
5944
+ /**
5945
+ * The customer; null for a purchase made on the web by no one yet (its link not redeemed).
5946
+ */
5947
+ customer_id: string | null;
5948
+ /**
5949
+ * What found them: `customer_id`, an id a store gave the purchase or the buyer (`app_store`, `play_store`, `stripe`), or `email` (the address a buyer with no account gave at checkout).
5950
+ */
5951
+ matched_by: "customer_id" | "app_store" | "play_store" | "stripe" | "email";
5952
+ /**
5953
+ * The purchase found, when one was.
5954
+ */
5955
+ chain_id?: string;
5956
+ /**
5957
+ * The purchase's store.
5958
+ */
5959
+ store?: "app_store" | "play_store" | "stripe";
5960
+ /**
5961
+ * The purchase's product, as the catalog names it.
5962
+ */
5963
+ product?: string;
5964
+ /**
5965
+ * The purchase is the store's sandbox's.
5966
+ */
5967
+ is_sandbox: boolean;
5968
+ /**
5969
+ * When the customer was first seen, or the purchase made.
5970
+ */
5971
+ at: string;
5972
+ };
5973
+ /**
5974
+ * The customers a query found, the newest first (at most 50).
5975
+ */
5976
+ export type CustomerSearch = {
5977
+ /**
5978
+ * The query, trimmed.
5979
+ */
5980
+ query: string;
5981
+ customers: CustomerMatch[];
5982
+ };
5983
+ /**
5984
+ * A movement of a customer's credits.
5985
+ */
5986
+ export type CreditMove = {
5987
+ /**
5988
+ * The credits' currency.
5989
+ */
5990
+ currency: string;
5991
+ /**
5992
+ * What moved them.
5993
+ */
5994
+ kind: "grant" | "revoke" | "unrevoke" | "expire" | "merge" | "forgive";
5995
+ /**
5996
+ * The change of the balance (negative: taken).
5997
+ */
5998
+ delta: number;
5999
+ };
6000
+ /**
6001
+ * One thing that happened to a customer.
6002
+ */
6003
+ export type CustomerEvent = {
6004
+ /**
6005
+ * When it happened, as the store or the module recorded it.
6006
+ */
6007
+ at: string;
6008
+ /**
6009
+ * 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.
6010
+ */
6011
+ kind: "purchase" | "renewal" | "refund" | "cancellation" | "resumption" | "billing_issue" | "expiration" | "grant" | "grant_revoked" | "credits" | "transfer_in" | "transfer_out";
6012
+ /**
6013
+ * The purchase's store.
6014
+ */
6015
+ store?: "app_store" | "play_store" | "stripe";
6016
+ /**
6017
+ * The product, as the catalog names it.
6018
+ */
6019
+ product?: string;
6020
+ /**
6021
+ * The product's plan, as the catalog names it.
6022
+ */
6023
+ plan?: string;
6024
+ /**
6025
+ * The store's id of the product.
6026
+ */
6027
+ store_product_id?: string;
6028
+ /**
6029
+ * The purchase is the store's sandbox's.
6030
+ */
6031
+ is_sandbox: boolean;
6032
+ /**
6033
+ * What was paid — a refund: what was given back —, as the store said it, in millionths of `currency`.
6034
+ */
6035
+ amount_micros?: number;
6036
+ /**
6037
+ * ISO 4217.
6038
+ */
6039
+ currency?: string;
6040
+ /**
6041
+ * The record's why: a refund's kind (`refund`, `chargeback`, `family`, `other`), a grant's or a credit movement's reason, how a purchase moved (`restore`, `merge`, `assign`, `purchase`).
6042
+ */
6043
+ reason?: string;
6044
+ /**
6045
+ * Who did it: `store` (the store, or the customer at it), `customer`, `project`, or the key or user that gave a grant or moved credits (`key:…`, `user:…`).
6046
+ */
6047
+ actor: string;
6048
+ /**
6049
+ * The purchase.
6050
+ */
6051
+ chain_id?: string;
6052
+ /**
6053
+ * The store's id of the transaction.
6054
+ */
6055
+ transaction_id?: string;
6056
+ /**
6057
+ * The grant.
6058
+ */
6059
+ grant_id?: string;
6060
+ /**
6061
+ * The grant's entitlement.
6062
+ */
6063
+ entitlement?: string;
6064
+ credits?: CreditMove;
6065
+ /**
6066
+ * A transfer's other side: whom from, whom to (null: a purchase that was no one's).
6067
+ */
6068
+ other_customer_id?: string | null;
6069
+ };
6070
+ /**
6071
+ * What happened to a customer, the newest first, a page at a time.
6072
+ */
6073
+ export type CustomerHistory = {
6074
+ /**
6075
+ * The customer.
6076
+ */
6077
+ customer_id: string;
6078
+ events: CustomerEvent[];
6079
+ /**
6080
+ * Goes on to the next page (send it as `cursor`); absent on the last page.
6081
+ */
6082
+ next_cursor?: string;
6083
+ };
6084
+ /**
6085
+ * A grant as support reads it: active or not, and who took it back.
6086
+ */
6087
+ export type GrantRecord = {
6088
+ /**
6089
+ * Its customer.
6090
+ */
6091
+ customer_id: string;
6092
+ /**
6093
+ * The entitlement.
6094
+ */
6095
+ entitlement: string;
6096
+ /**
6097
+ * When it ends; null for life.
6098
+ */
6099
+ expires_at: string | null;
6100
+ /**
6101
+ * Who gave it (the API key).
6102
+ */
6103
+ granted_by: string;
6104
+ /**
6105
+ * The grant's id.
6106
+ */
6107
+ id: string;
6108
+ /**
6109
+ * Why.
6110
+ */
6111
+ reason: string;
6112
+ /**
6113
+ * When it was revoked.
6114
+ */
6115
+ revoked_at: string | null;
6116
+ /**
6117
+ * When it started.
6118
+ */
6119
+ starts_at: string;
6120
+ /**
6121
+ * Who revoked it (the API key or user); null while it is not.
6122
+ */
6123
+ revoked_by: string | null;
6124
+ /**
6125
+ * Given now: started, not ended, not revoked.
6126
+ */
6127
+ active: boolean;
6128
+ };
6129
+ /**
6130
+ * The grants given a customer, the newest first.
6131
+ */
6132
+ export type CustomerGrants = {
6133
+ /**
6134
+ * The customer.
6135
+ */
6136
+ customer_id: string;
6137
+ grants: GrantRecord[];
6138
+ };
6139
+ /**
6140
+ * A revision of the catalog, as the list shows it.
6141
+ */
6142
+ export type CatalogRevision = {
6143
+ /**
6144
+ * Its number.
6145
+ */
6146
+ revision: number;
6147
+ /**
6148
+ * When it was saved.
6149
+ */
6150
+ created_at: string;
6151
+ /**
6152
+ * Who saved it (the API key or user).
6153
+ */
6154
+ created_by: string;
6155
+ /**
6156
+ * The catalog is this revision now.
6157
+ */
6158
+ current: boolean;
6159
+ /**
6160
+ * How many products it defines.
6161
+ */
6162
+ products: number;
6163
+ /**
6164
+ * How many entitlements it defines.
6165
+ */
6166
+ entitlements: number;
6167
+ /**
6168
+ * How many credit currencies it defines.
6169
+ */
6170
+ currencies: number;
6171
+ /**
6172
+ * How many limits it defines.
6173
+ */
6174
+ limits: number;
6175
+ /**
6176
+ * How many offers it defines.
6177
+ */
6178
+ offers: number;
6179
+ /**
6180
+ * When a confirmed plan of it was last written to the stores; null for one never written.
6181
+ */
6182
+ applied_at: string | null;
6183
+ };
6184
+ /**
6185
+ * The catalog's revisions, the newest first.
6186
+ */
6187
+ export type CatalogRevisions = {
6188
+ revisions: CatalogRevision[];
6189
+ /**
6190
+ * Goes on to the next page (send it as `cursor`); absent on the last page.
6191
+ */
6192
+ next_cursor?: string;
6193
+ };
6194
+ /**
6195
+ * An entitlement, and the product that gives it with more of a limit.
6196
+ */
6197
+ export type LimitUpgrade = {
6198
+ /**
6199
+ * The entitlement.
6200
+ */
6201
+ entitlement: string;
6202
+ /**
6203
+ * The entitlement's name, as the catalog gives it.
6204
+ */
6205
+ name: string;
6206
+ /**
6207
+ * The product that gives it.
6208
+ */
6209
+ product: string;
6210
+ /**
6211
+ * What the product gives of the limit in a window.
6212
+ */
6213
+ max: number;
6214
+ };
6215
+ /**
6216
+ * The error envelope of a refused spend: with `limit_reached`, the limit and what would give the customer more of it.
6217
+ */
6218
+ export type SpendRefusal = {
6219
+ /**
6220
+ * Machine-readable error code (snake_case)
6221
+ */
6222
+ error: string;
6223
+ /**
6224
+ * Human-readable explanation
6225
+ */
6226
+ error_description: string;
6227
+ /**
6228
+ * Correlation ID for log/audit lookup
6229
+ */
6230
+ request_id: string;
6231
+ /**
6232
+ * Seconds to wait before retrying; present on a refusal that ends with time.
6233
+ */
6234
+ retry_after?: number;
6235
+ /**
6236
+ * HTTP status code (mirrors the response status)
6237
+ */
6238
+ status: number;
6239
+ /**
6240
+ * With `limit_reached`: the limit.
6241
+ */
6242
+ limit?: string;
6243
+ /**
6244
+ * With `limit_reached`: the entitlements whose products give more of the limit than the customer has now, the smallest step up first (empty when none does) — for the app to offer.
6245
+ */
6246
+ upgrades?: LimitUpgrade[];
6247
+ };
5940
6248
  /** The events this module sends the project's webhooks (x-palbase-events), by type: each one's payload, the event's data. */
5941
6249
  export interface Events {
5942
6250
  /**
@@ -6391,6 +6699,17 @@ export declare function client(t: Transport): {
6391
6699
  body: CreditForgiveRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
6392
6700
  signal?: AbortSignal;
6393
6701
  }): Promise<Reply<200, CreditForgiven>>;
6702
+ /**
6703
+ * List a customer's grants
6704
+ *
6705
+ * The grants given the customer, active, ended and revoked, the newest first (at most 500): a grant is revoked by the id read here (DELETE …/grants/{grant_id}).
6706
+ */
6707
+ listCustomerGrants(input: {
6708
+ path: {
6709
+ customer_id: string;
6710
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
6711
+ signal?: AbortSignal;
6712
+ }): Promise<Reply<200, CustomerGrants>>;
6394
6713
  /**
6395
6714
  * Grant an entitlement
6396
6715
  *
@@ -7283,5 +7602,69 @@ export declare function client(t: Transport): {
7283
7602
  body: XcodeOfferKeyRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
7284
7603
  signal?: AbortSignal;
7285
7604
  }): Promise<Reply<200, XcodeOfferKey>>;
7605
+ /**
7606
+ * Find customers
7607
+ *
7608
+ * Finds customers by what a person writing in has: their id; Apple's original transaction id or any transaction id of theirs; a Google order id (a renewal's `..N` or not); Stripe's subscription, payment intent, invoice or customer id; or the email address a buyer with no account gave at checkout, matched whole (case and spaces around it aside). The address is never kept: an HMAC of it is.
7609
+ */
7610
+ searchCustomers(input: {
7611
+ query: {
7612
+ q: string;
7613
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
7614
+ signal?: AbortSignal;
7615
+ }): Promise<Reply<200, CustomerSearch>>;
7616
+ /**
7617
+ * Read a customer's history
7618
+ *
7619
+ * What happened to the customer, the newest first: their purchases' payments and refunds, their subscriptions' renewal turned off and on, failed charges and ends, the grants given and taken back (with their reason and by whom), the credits granted, taken back, expired and forgiven (spends are the credits' entries: GET …/credits/entries), and the purchases that moved to or from them.
7620
+ */
7621
+ getCustomerHistory(input: {
7622
+ path: {
7623
+ customer_id: string;
7624
+ };
7625
+ query?: {
7626
+ cursor?: string; /** Events in a page (default 50). */
7627
+ limit?: number;
7628
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
7629
+ signal?: AbortSignal;
7630
+ }): Promise<Reply<200, CustomerHistory>>;
7631
+ /**
7632
+ * List the catalog's revisions
7633
+ *
7634
+ * Every revision the catalog was saved as, the newest first: who saved it, when, what it defines, and when a confirmed plan of it was last written to the stores.
7635
+ */
7636
+ listCatalogRevisions(input?: {
7637
+ query?: {
7638
+ cursor?: string; /** Revisions in a page (default 50). */
7639
+ limit?: number;
7640
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
7641
+ signal?: AbortSignal;
7642
+ }): Promise<Reply<200, CatalogRevisions>>;
7643
+ /**
7644
+ * Read a revision of the catalog
7645
+ *
7646
+ * The catalog as it was saved at that revision.
7647
+ */
7648
+ getCatalogRevision(input: {
7649
+ path: {
7650
+ revision: number;
7651
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
7652
+ signal?: AbortSignal;
7653
+ }): Promise<Reply<200, CatalogDoc>>;
7654
+ /**
7655
+ * Put an older revision back
7656
+ *
7657
+ * Saves the revision's catalog as the next revision, as an edit is: checked against the catalog's rules now (an older revision may break one added since: 422 `invalid_catalog`), what customers bought kept in it, If-Match the revision the catalog is now. Nothing is written to a store: a plan of it is made and confirmed (POST /purchases/catalog/plans). Emits `purchases.catalog.changed` with `restored_from`.
7658
+ */
7659
+ restoreCatalogRevision(input: {
7660
+ path: {
7661
+ revision: number;
7662
+ };
7663
+ headers: {
7664
+ "If-Match": string; /** Makes the write safe to send again (at most 255 characters). A retry with the same key and the same request gets the first answer back, marked `Idempotent-Replayed: true`, and changes nothing; the same key with a different request is refused with 422, and while the first request still runs a retry gets 409 with Retry-After. Answers are kept for 24 hours. */
7665
+ "Idempotency-Key"?: string;
7666
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
7667
+ signal?: AbortSignal;
7668
+ }): Promise<Reply<200, CatalogDoc>>;
7286
7669
  };
7287
7670
  export type Client = ReturnType<typeof client>;