wontopos 2.2.22 → 2.2.23
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/wontopos.d.ts +6 -0
- package/dist/wontopos.js +2 -2
- package/package.json +1 -1
package/dist/wontopos.d.ts
CHANGED
|
@@ -240,6 +240,12 @@ export interface ClientOptions {
|
|
|
240
240
|
* 502/503 and connection errors only when a retry can never double-process a
|
|
241
241
|
* write. 0 disables retries (default 2). */
|
|
242
242
|
maxRetries?: number;
|
|
243
|
+
/** Alias of `maxRetries`. The Python SDK calls this option `retries`, and these
|
|
244
|
+
* SDKs are published in lockstep as "the same surface" — so code ported between
|
|
245
|
+
* them silently lost its retry setting instead of failing loudly (an unknown
|
|
246
|
+
* key on an options object is not an error in TS at runtime). Both names work;
|
|
247
|
+
* `maxRetries` wins if somehow both are given. */
|
|
248
|
+
retries?: number;
|
|
243
249
|
}
|
|
244
250
|
/** Wontopos memory client. Store and recall memories, isolated per `userId`. */
|
|
245
251
|
export declare class Client {
|
package/dist/wontopos.js
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
* runtime's (never disabled by this SDK; Node 18+ floors TLS at 1.2). Prefer
|
|
38
38
|
* `Client.fromEnv()` over keys in source code.
|
|
39
39
|
*/
|
|
40
|
-
const VERSION = "2.2.
|
|
40
|
+
const VERSION = "2.2.23";
|
|
41
41
|
/** Runtime info helps support debug a report ("node 18 on Windows...") —
|
|
42
42
|
* platform only, never anything identifying. Browsers have no `process` (and
|
|
43
43
|
* silently drop the UA header anyway). */
|
|
@@ -263,7 +263,7 @@ export class Client {
|
|
|
263
263
|
// Coerce a non-finite maxRetries (NaN/Infinity) back to the default — otherwise
|
|
264
264
|
// NaN makes `attempts = NaN + 1` and the loop runs zero requests then throws
|
|
265
265
|
// "retries exhausted"; Infinity would retry forever.
|
|
266
|
-
const mr = opts.maxRetries;
|
|
266
|
+
const mr = opts.maxRetries ?? opts.retries;
|
|
267
267
|
this.maxRetries = typeof mr === "number" && Number.isFinite(mr) ? Math.max(0, Math.floor(mr)) : 2;
|
|
268
268
|
this.headers = {
|
|
269
269
|
"X-API-Key": this.apiKey,
|
package/package.json
CHANGED