@pouchy_ai/admin-sdk 0.39.1 → 0.40.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.
- package/CHANGELOG.md +21 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.js +20 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@pouchy_ai/admin-sdk` are documented here.
|
|
4
4
|
|
|
5
|
+
## 0.40.1 — 2026-09-30
|
|
6
|
+
|
|
7
|
+
- **A 2xx whose body cannot be read now rejects with `AdminApiError`.** It
|
|
8
|
+
used to resolve as `{}` typed as the method's result: an HTML 200 from a
|
|
9
|
+
proxy or captive portal, a truncated body, or a deadline that fired
|
|
10
|
+
mid-body read as a success with every field `undefined`. For a one-shot
|
|
11
|
+
secret (`createKey`, `rotateKey`, `createWebhook`, `rotateWebhookSecret`)
|
|
12
|
+
the server had already minted it, and the caller lost it silently. The
|
|
13
|
+
error's `status` is the server's 2xx, because the request did land: do not
|
|
14
|
+
blindly retry a mint. A 204 / 205 still resolves `{}`; non-2xx errors are
|
|
15
|
+
unchanged.
|
|
16
|
+
|
|
17
|
+
## 0.40.0 — 2026-09-29
|
|
18
|
+
|
|
19
|
+
- **`recording` on agents.** Turning it on grants `call.record` on the agent's
|
|
20
|
+
session mints, so a call started with `record: true` (companion-sdk 0.65.0)
|
|
21
|
+
is recorded by the voice provider — both voices, one MP3, kept 7 days — and
|
|
22
|
+
fetchable with `getCallRecording`. Default false; the template flag is the
|
|
23
|
+
only way to get the scope. You own telling readers their calls are recorded
|
|
24
|
+
and getting their consent.
|
|
25
|
+
|
|
5
26
|
## 0.39.1 — 2026-09-28
|
|
6
27
|
|
|
7
28
|
Type corrections. The server's responses did not change; three return types
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const ADMIN_SDK_VERSION = "0.
|
|
1
|
+
export declare const ADMIN_SDK_VERSION = "0.40.1";
|
|
2
2
|
export declare const DEFAULT_BASE_URL = "https://pouchy.ai/v1/admin";
|
|
3
3
|
/** Deadline for the routes whose server handler declares `maxDuration: 300` —
|
|
4
4
|
* the server's own ceiling plus headroom, so a client abort can only ever mean
|
|
@@ -176,6 +176,13 @@ export interface Agent {
|
|
|
176
176
|
* on purpose, so asking for it in the session-mint body is narrowed away.
|
|
177
177
|
* Leave it off unless your backend assembles per-turn rules itself. */
|
|
178
178
|
instructions?: boolean;
|
|
179
|
+
/** Grant `call.record` on this agent's session mints (0.40.0), so a call
|
|
180
|
+
* started with `record: true` is recorded by the voice provider — both
|
|
181
|
+
* voices, one MP3, kept 7 days — and fetchable with the companion SDK's
|
|
182
|
+
* `getCallRecording`. Default false; this flag is the ONLY way to obtain
|
|
183
|
+
* the scope. Turning it on makes you responsible for telling readers their
|
|
184
|
+
* calls are recorded and getting their consent. */
|
|
185
|
+
recording?: boolean;
|
|
179
186
|
/** Reply-cue opt-in (see ReplyCues). */
|
|
180
187
|
replyCues?: ReplyCues;
|
|
181
188
|
templateRev: number;
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// import { createAdminClient } from '@pouchy_ai/admin-sdk';
|
|
9
9
|
// const admin = createAdminClient({ adminKey: process.env.POUCHY_ADMIN_KEY! });
|
|
10
10
|
// const { agents } = await admin.listAgents();
|
|
11
|
-
export const ADMIN_SDK_VERSION = '0.
|
|
11
|
+
export const ADMIN_SDK_VERSION = '0.40.1';
|
|
12
12
|
export const DEFAULT_BASE_URL = 'https://pouchy.ai/v1/admin';
|
|
13
13
|
/** Default per-request timeout (ms). A hung upstream otherwise never rejects. */
|
|
14
14
|
const DEFAULT_TIMEOUT_MS = 30_000;
|
|
@@ -270,7 +270,25 @@ export function createAdminClient(opts) {
|
|
|
270
270
|
? `${method} ${path} — request timed out after ${timeoutMs}ms`
|
|
271
271
|
: `${method} ${path} — network error: ${e instanceof Error ? e.message : String(e)}`, 0);
|
|
272
272
|
}
|
|
273
|
-
|
|
273
|
+
// 0.40.1: a 2xx whose body cannot be read is an error, not `{}`. It used
|
|
274
|
+
// to resolve as a success with every field undefined — an HTML 200 from a
|
|
275
|
+
// proxy, a truncated body, a deadline that fired mid-body — and a secret
|
|
276
|
+
// the server had already minted (`createKey`, `rotateKey`,
|
|
277
|
+
// `createWebhook`) was lost with no signal. `status` stays the server's
|
|
278
|
+
// 2xx: the request DID land, so a blind retry of a mint is not safe. A
|
|
279
|
+
// 204 / 205 (no body by definition) still resolves `{}`, and the non-2xx
|
|
280
|
+
// arm keeps its fallback. Still `res.json()`, not `text()`: an injected
|
|
281
|
+
// `fetch` may hand back a minimal response that only implements `json`.
|
|
282
|
+
let readError = null;
|
|
283
|
+
const data = (await res.json().catch((e) => {
|
|
284
|
+
readError = e;
|
|
285
|
+
return {};
|
|
286
|
+
}));
|
|
287
|
+
if (res.ok && readError !== null && res.status !== 204 && res.status !== 205) {
|
|
288
|
+
const why = readError instanceof Error ? readError.message : String(readError);
|
|
289
|
+
const msg = `${method} ${path} — unreadable ${res.status} body: ${why}`;
|
|
290
|
+
throw new AdminApiError(msg, res.status, retryAfterFrom(res, null));
|
|
291
|
+
}
|
|
274
292
|
if (!res.ok)
|
|
275
293
|
throw new AdminApiError(
|
|
276
294
|
// The server's own `error` string is passed through UNCHANGED — it is
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pouchy_ai/admin-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.1",
|
|
4
4
|
"description": "Typed TypeScript client for the Pouchy Admin API \u2014 manage agents, keys, end users, knowledge, skills, channels, schedules, webhooks and credentials headlessly, with a project Admin key.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|