palbase 0.17.0 → 0.18.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.
- package/dist/ai/index.js +2 -2
- package/dist/backend/engine.js +2 -2
- package/dist/backend/env.js +1 -1
- package/dist/backend/index.js +3 -3
- package/dist/backend/stack.js +1 -1
- package/dist/backend/test.js +2 -2
- package/dist/chunks/{KBO5NELQ.js → 32XY6IBN.js} +2 -2
- package/dist/chunks/{XAHQAK65.js → 3GWBIPGH.js} +2 -2
- package/dist/chunks/{MI5QEZ7Y.js → 4HFD24QY.js} +1 -1
- package/dist/chunks/{FQLY6TBH.js → 4S4ODZVM.js} +2 -2
- package/dist/chunks/{K2CN4CGB.js → 6IMY2J5W.js} +1 -1
- package/dist/chunks/{K3KCYVMN.js → 7QFBZLAK.js} +1 -1
- package/dist/chunks/{ENZI5RN5.js → 7R4WTDHI.js} +1 -1
- package/dist/chunks/{GL5Y2PAS.js → ART5HP5M.js} +2 -2
- package/dist/chunks/{55C2GHGA.js → BKGX3AZA.js} +2 -2
- package/dist/chunks/{KUTBWXNL.js → BW5DFI3C.js} +1 -1
- package/dist/chunks/{6VLC4QJY.js → CAZYHE64.js} +2 -2
- package/dist/chunks/EVBWED24.js +22 -0
- package/dist/chunks/{HPQSHDEH.js → FT7G3QQ4.js} +2 -2
- package/dist/chunks/{IG2INK7Z.js → JKA2W4E5.js} +2 -2
- package/dist/chunks/{45DR7TF6.js → KRQZOF2L.js} +2 -2
- package/dist/chunks/{56S5CF3M.js → OC32TP3L.js} +2 -2
- package/dist/chunks/{O6LRXDFY.js → PMQOJ7FF.js} +2 -2
- package/dist/chunks/{6CEXEK2F.js → PPK2UEAY.js} +2 -2
- package/dist/chunks/{CPQR6PSB.js → T2O6XEQO.js} +1 -1
- package/dist/chunks/{25FDQIKY.js → VQXYHAU4.js} +2 -2
- package/dist/chunks/{4GIYAC3R.js → XF3JEDIQ.js} +1 -1
- package/dist/chunks/{WW4HVDSO.js → XHNZDLR4.js} +2 -2
- package/dist/chunks/{V72PBUK4.js → ZXV3ZKVM.js} +2 -2
- package/dist/cli.js +114 -113
- package/dist/refuse/ai.js +1 -1
- package/dist/refuse/backend.js +1 -1
- package/dist/refuse/server.js +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/testing.js +2 -2
- package/dist/web/index.js +2 -2
- package/dist/web/message.js +2 -2
- package/dist/web/palbe.js +2 -2
- package/dist/web/paywall.js +2 -2
- package/dist/web/push-sw.js +1 -1
- package/dist/web/ssr.js +2 -2
- package/dist/web/vite.js +2 -2
- package/package.json +2 -2
- package/types/internal/src/messaging/engine.d.ts +31 -0
- package/types/internal/src/messaging/files.d.ts +11 -0
- package/types/internal/src/messaging/index.d.ts +5 -0
- package/types/internal/src/messaging/local.d.ts +31 -0
- package/types/internal/src/messaging/outbox.d.ts +53 -0
- package/types/internal/src/messaging/store.d.ts +67 -0
- package/types/internal/src/modules/purchases.d.ts +383 -0
- package/types/web/src/client.d.ts +5 -0
- package/types/web/src/index.d.ts +1 -0
- package/types/web/src/messaging.d.ts +280 -0
- package/dist/chunks/JGUQKVFH.js +0 -22
|
@@ -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`, the developer whose Studio or CLI call it was (`developer:…`), 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 (`developer:…` for Studio or the CLI, `key:…`, `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>;
|
|
@@ -10,6 +10,7 @@ import { Notify } from './notify.js';
|
|
|
10
10
|
import { Purchases } from './purchases.js';
|
|
11
11
|
import { type ChatToolCall } from './chat.js';
|
|
12
12
|
import { Flags } from './flags.js';
|
|
13
|
+
import { Messaging, type MessagingOptions } from './messaging.js';
|
|
13
14
|
export interface ClientOptions {
|
|
14
15
|
/** The project's address: https://<ref>.<domain> */
|
|
15
16
|
url: string;
|
|
@@ -68,6 +69,8 @@ export interface ClientOptions {
|
|
|
68
69
|
* pb.setLanguage changes it.
|
|
69
70
|
*/
|
|
70
71
|
language?: string | readonly string[];
|
|
72
|
+
/** What the device keeps of the signed-in person's conversations (pb.messaging): dropped on sign-out unless keepOnSignOut. */
|
|
73
|
+
messaging?: MessagingOptions;
|
|
71
74
|
}
|
|
72
75
|
/**
|
|
73
76
|
* The app's client. A backend's generated Palbe module (palbase apps:sync)
|
|
@@ -93,6 +96,8 @@ export interface PalbaseClient {
|
|
|
93
96
|
notify: Notify;
|
|
94
97
|
/** The project's feature flags and remote configuration, resolved for this app and its reader, kept current as they change. */
|
|
95
98
|
flags: Flags;
|
|
99
|
+
/** The signed-in person's conversations — direct ones and groups — kept up to date, on the device and live. */
|
|
100
|
+
messaging: Messaging;
|
|
96
101
|
/** The language every request says from now on (ClientOptions.language); null for the browser's own. */
|
|
97
102
|
setLanguage(language: string | readonly string[] | null): void;
|
|
98
103
|
/**
|
package/types/web/src/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { connectVoice, type StartedVoice, type VoiceConnection, type VoiceOption
|
|
|
10
10
|
export { Purchases, redemptionToken, type CheckoutSource, type CustomerInfo, type CustomerInfoListener, type GrantInfo, type MergeGrant, type OfferView, type Offerings, type Redeemed, type RedemptionLink, } from './purchases.js';
|
|
11
11
|
export { Notify, WebPush, type PushPermission, type PushSubscribeOptions } from './notify.js';
|
|
12
12
|
export { Flags, type FlagSource, type FlagsListener } from './flags.js';
|
|
13
|
+
export { ConversationList, ConversationView, indexedDBKeyValue, Messaging, ScheduledList, ThreadView, type Conversation, type ConversationViewState, type ConversationListState, type Entry, type Member, type Message, type MessagingOptions, type MyProfile, type Observed, type OpenedFile, type OutboxItem, type OutgoingFile, type Profile, type ScheduledMessage, type SendOptions, type ThreadState, type ThreadViewState, } from './messaging.js';
|
|
13
14
|
export { Inbox, type InboxItem, type InboxListOptions, type InboxPage, type InboxView, type InboxViewOptions } from './inbox.js';
|
|
14
15
|
export { InApp, SESSION_START, type InAppOptions } from './inapp.js';
|
|
15
16
|
export type { Paywall, PaywallRenderOptions } from './paywall/placement.js';
|