phonic 0.30.12 → 0.30.14
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/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/agents/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/agents/client/Client.js +3 -3
- package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.d.ts +1 -1
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +1 -1
- package/dist/cjs/api/resources/conversations/client/requests/ConversationsListRequest.d.ts +3 -3
- package/dist/cjs/api/resources/conversations/types/ConversationsListResponse.d.ts +4 -0
- package/dist/cjs/api/resources/projects/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/projects/client/Client.js +3 -3
- package/dist/cjs/api/resources/projects/client/requests/UpdateProjectRequest.d.ts +1 -1
- package/dist/cjs/api/types/CreateAgentRequest.d.ts +1 -1
- package/dist/cjs/api/types/ToolCallOutputProcessedPayload.d.ts +4 -2
- package/dist/cjs/core/websocket/ws.js +2 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/agents/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/agents/client/Client.mjs +3 -3
- package/dist/esm/api/resources/agents/client/requests/AgentsCreateRequest.d.mts +1 -1
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +1 -1
- package/dist/esm/api/resources/conversations/client/requests/ConversationsListRequest.d.mts +3 -3
- package/dist/esm/api/resources/conversations/types/ConversationsListResponse.d.mts +4 -0
- package/dist/esm/api/resources/projects/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/projects/client/Client.mjs +3 -3
- package/dist/esm/api/resources/projects/client/requests/UpdateProjectRequest.d.mts +1 -1
- package/dist/esm/api/types/CreateAgentRequest.d.mts +1 -1
- package/dist/esm/api/types/ToolCallOutputProcessedPayload.d.mts +4 -2
- package/dist/esm/core/websocket/ws.mjs +2 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
package/dist/cjs/Client.js
CHANGED
|
@@ -50,8 +50,8 @@ class PhonicClient {
|
|
|
50
50
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
51
51
|
"X-Fern-Language": "JavaScript",
|
|
52
52
|
"X-Fern-SDK-Name": "phonic",
|
|
53
|
-
"X-Fern-SDK-Version": "0.30.
|
|
54
|
-
"User-Agent": "phonic/0.30.
|
|
53
|
+
"X-Fern-SDK-Version": "0.30.14",
|
|
54
|
+
"User-Agent": "phonic/0.30.14",
|
|
55
55
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
56
56
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
57
57
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -212,7 +212,7 @@ export declare class Agents {
|
|
|
212
212
|
* }
|
|
213
213
|
* })
|
|
214
214
|
*/
|
|
215
|
-
update(nameOrId: string, request
|
|
215
|
+
update(nameOrId: string, request: Phonic.UpdateAgentRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Phonic.AgentsUpdateResponse>;
|
|
216
216
|
private __update;
|
|
217
217
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
218
218
|
}
|
|
@@ -528,11 +528,11 @@ class Agents {
|
|
|
528
528
|
* }
|
|
529
529
|
* })
|
|
530
530
|
*/
|
|
531
|
-
update(nameOrId, request
|
|
531
|
+
update(nameOrId, request, requestOptions) {
|
|
532
532
|
return core.HttpResponsePromise.fromPromise(this.__update(nameOrId, request, requestOptions));
|
|
533
533
|
}
|
|
534
|
-
__update(
|
|
535
|
-
return __awaiter(this,
|
|
534
|
+
__update(nameOrId, request, requestOptions) {
|
|
535
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
536
536
|
var _a, _b, _c, _d;
|
|
537
537
|
const { project } = request, _body = __rest(request, ["project"]);
|
|
538
538
|
const _queryParams = {};
|
|
@@ -41,7 +41,7 @@ export interface AgentsCreateRequest {
|
|
|
41
41
|
project?: string;
|
|
42
42
|
/** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
|
|
43
43
|
name: string;
|
|
44
|
-
phone_number
|
|
44
|
+
phone_number: "assign-automatically" | null;
|
|
45
45
|
/** The timezone of the agent. Used to format system variables like `{{system_time}}`. */
|
|
46
46
|
timezone?: string;
|
|
47
47
|
/** The voice ID to use. */
|
|
@@ -41,7 +41,7 @@ export interface UpdateAgentRequest {
|
|
|
41
41
|
project?: string;
|
|
42
42
|
/** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
|
|
43
43
|
name?: string;
|
|
44
|
-
phone_number
|
|
44
|
+
phone_number: "assign-automatically" | null;
|
|
45
45
|
/** The timezone of the agent. Used to format system variables like `{{system_time}}`. */
|
|
46
46
|
timezone?: string;
|
|
47
47
|
/** The voice ID to use. */
|
|
@@ -21,10 +21,10 @@ export interface ConversationsListRequest {
|
|
|
21
21
|
started_at_min?: string;
|
|
22
22
|
/** Maximum start date/time. Valid examples: `2025-04-17`, `2025-04-17T02:48:52.708Z` */
|
|
23
23
|
started_at_max?: string;
|
|
24
|
-
/** Cursor for pagination
|
|
24
|
+
/** Cursor for backward pagination. Use a conversation ID from `pagination.prev_cursor` to fetch the previous page of conversations. Cannot be used with `after`. */
|
|
25
25
|
before?: string;
|
|
26
|
-
/** Cursor for pagination
|
|
26
|
+
/** Cursor for forward pagination. Use a conversation ID from `pagination.next_cursor` to fetch the next page of conversations. Cannot be used with `before`. */
|
|
27
27
|
after?: string;
|
|
28
|
-
/** Maximum number of conversations to return. */
|
|
28
|
+
/** Maximum number of conversations to return per page. */
|
|
29
29
|
limit?: number;
|
|
30
30
|
}
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
import * as Phonic from "../../../index.js";
|
|
5
5
|
export type ConversationsListResponse = {
|
|
6
6
|
conversations: Phonic.Conversation[];
|
|
7
|
+
pagination: {
|
|
8
|
+
prev_cursor: string | null;
|
|
9
|
+
next_cursor: string | null;
|
|
10
|
+
};
|
|
7
11
|
} | {
|
|
8
12
|
conversation: Phonic.Conversation;
|
|
9
13
|
};
|
|
@@ -113,7 +113,7 @@ export declare class Projects {
|
|
|
113
113
|
* default_agent: "another-agent"
|
|
114
114
|
* })
|
|
115
115
|
*/
|
|
116
|
-
update(nameOrId: string, request
|
|
116
|
+
update(nameOrId: string, request: Phonic.UpdateProjectRequest, requestOptions?: Projects.RequestOptions): core.HttpResponsePromise<Phonic.ProjectsUpdateResponse>;
|
|
117
117
|
private __update;
|
|
118
118
|
/**
|
|
119
119
|
* Returns all conversation evaluation prompts for a project.
|
|
@@ -349,11 +349,11 @@ class Projects {
|
|
|
349
349
|
* default_agent: "another-agent"
|
|
350
350
|
* })
|
|
351
351
|
*/
|
|
352
|
-
update(nameOrId, request
|
|
352
|
+
update(nameOrId, request, requestOptions) {
|
|
353
353
|
return core.HttpResponsePromise.fromPromise(this.__update(nameOrId, request, requestOptions));
|
|
354
354
|
}
|
|
355
|
-
__update(
|
|
356
|
-
return __awaiter(this,
|
|
355
|
+
__update(nameOrId, request, requestOptions) {
|
|
356
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
357
357
|
var _a, _b, _c, _d;
|
|
358
358
|
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
359
359
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
@@ -5,7 +5,7 @@ import * as Phonic from "../index.js";
|
|
|
5
5
|
export interface CreateAgentRequest {
|
|
6
6
|
/** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
|
|
7
7
|
name: string;
|
|
8
|
-
phone_number
|
|
8
|
+
phone_number: "assign-automatically" | null;
|
|
9
9
|
/** The timezone of the agent. Used to format system variables like `{{system_time}}`. */
|
|
10
10
|
timezone?: string;
|
|
11
11
|
/** The voice ID to use. */
|
|
@@ -14,10 +14,12 @@ export interface ToolCallOutputProcessedPayload {
|
|
|
14
14
|
endpoint_called_at?: string | null;
|
|
15
15
|
/** Webhook request body (null for WebSocket tools) */
|
|
16
16
|
request_body?: Record<string, unknown> | null;
|
|
17
|
-
|
|
17
|
+
/** Webhook response body (null for WebSocket tools) */
|
|
18
|
+
response_body?: unknown | null;
|
|
18
19
|
/** WebSocket tool parameters (null for webhook tools) */
|
|
19
20
|
parameters?: Record<string, unknown> | null;
|
|
20
|
-
output
|
|
21
|
+
/** WebSocket tool output (null for webhook tools) */
|
|
22
|
+
output?: unknown | null;
|
|
21
23
|
/** Webhook HTTP status code (null for WebSocket tools) */
|
|
22
24
|
response_status_code?: number | null;
|
|
23
25
|
/** Whether the tool call timed out */
|
|
@@ -39,7 +39,8 @@ const index_js_1 = require("../runtime/index.js");
|
|
|
39
39
|
const qs_js_1 = require("../url/qs.js");
|
|
40
40
|
const Events = __importStar(require("./events.js"));
|
|
41
41
|
const getGlobalWebSocket = () => {
|
|
42
|
-
|
|
42
|
+
// Use Node.js 'ws' library for server-side runtimes since native WebSocket doesn't support headers
|
|
43
|
+
if (index_js_1.RUNTIME.type === "node" || index_js_1.RUNTIME.type === "bun" || index_js_1.RUNTIME.type === "deno") {
|
|
43
44
|
return ws_1.WebSocket;
|
|
44
45
|
}
|
|
45
46
|
else if (typeof WebSocket !== "undefined") {
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.30.
|
|
1
|
+
export declare const SDK_VERSION = "0.30.14";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -14,8 +14,8 @@ export class PhonicClient {
|
|
|
14
14
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
15
15
|
"X-Fern-Language": "JavaScript",
|
|
16
16
|
"X-Fern-SDK-Name": "phonic",
|
|
17
|
-
"X-Fern-SDK-Version": "0.30.
|
|
18
|
-
"User-Agent": "phonic/0.30.
|
|
17
|
+
"X-Fern-SDK-Version": "0.30.14",
|
|
18
|
+
"User-Agent": "phonic/0.30.14",
|
|
19
19
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
20
20
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
21
21
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -212,7 +212,7 @@ export declare class Agents {
|
|
|
212
212
|
* }
|
|
213
213
|
* })
|
|
214
214
|
*/
|
|
215
|
-
update(nameOrId: string, request
|
|
215
|
+
update(nameOrId: string, request: Phonic.UpdateAgentRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Phonic.AgentsUpdateResponse>;
|
|
216
216
|
private __update;
|
|
217
217
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
218
218
|
}
|
|
@@ -492,11 +492,11 @@ export class Agents {
|
|
|
492
492
|
* }
|
|
493
493
|
* })
|
|
494
494
|
*/
|
|
495
|
-
update(nameOrId, request
|
|
495
|
+
update(nameOrId, request, requestOptions) {
|
|
496
496
|
return core.HttpResponsePromise.fromPromise(this.__update(nameOrId, request, requestOptions));
|
|
497
497
|
}
|
|
498
|
-
__update(
|
|
499
|
-
return __awaiter(this,
|
|
498
|
+
__update(nameOrId, request, requestOptions) {
|
|
499
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
500
500
|
var _a, _b, _c, _d;
|
|
501
501
|
const { project } = request, _body = __rest(request, ["project"]);
|
|
502
502
|
const _queryParams = {};
|
|
@@ -41,7 +41,7 @@ export interface AgentsCreateRequest {
|
|
|
41
41
|
project?: string;
|
|
42
42
|
/** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
|
|
43
43
|
name: string;
|
|
44
|
-
phone_number
|
|
44
|
+
phone_number: "assign-automatically" | null;
|
|
45
45
|
/** The timezone of the agent. Used to format system variables like `{{system_time}}`. */
|
|
46
46
|
timezone?: string;
|
|
47
47
|
/** The voice ID to use. */
|
|
@@ -41,7 +41,7 @@ export interface UpdateAgentRequest {
|
|
|
41
41
|
project?: string;
|
|
42
42
|
/** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
|
|
43
43
|
name?: string;
|
|
44
|
-
phone_number
|
|
44
|
+
phone_number: "assign-automatically" | null;
|
|
45
45
|
/** The timezone of the agent. Used to format system variables like `{{system_time}}`. */
|
|
46
46
|
timezone?: string;
|
|
47
47
|
/** The voice ID to use. */
|
|
@@ -21,10 +21,10 @@ export interface ConversationsListRequest {
|
|
|
21
21
|
started_at_min?: string;
|
|
22
22
|
/** Maximum start date/time. Valid examples: `2025-04-17`, `2025-04-17T02:48:52.708Z` */
|
|
23
23
|
started_at_max?: string;
|
|
24
|
-
/** Cursor for pagination
|
|
24
|
+
/** Cursor for backward pagination. Use a conversation ID from `pagination.prev_cursor` to fetch the previous page of conversations. Cannot be used with `after`. */
|
|
25
25
|
before?: string;
|
|
26
|
-
/** Cursor for pagination
|
|
26
|
+
/** Cursor for forward pagination. Use a conversation ID from `pagination.next_cursor` to fetch the next page of conversations. Cannot be used with `before`. */
|
|
27
27
|
after?: string;
|
|
28
|
-
/** Maximum number of conversations to return. */
|
|
28
|
+
/** Maximum number of conversations to return per page. */
|
|
29
29
|
limit?: number;
|
|
30
30
|
}
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
import * as Phonic from "../../../index.mjs";
|
|
5
5
|
export type ConversationsListResponse = {
|
|
6
6
|
conversations: Phonic.Conversation[];
|
|
7
|
+
pagination: {
|
|
8
|
+
prev_cursor: string | null;
|
|
9
|
+
next_cursor: string | null;
|
|
10
|
+
};
|
|
7
11
|
} | {
|
|
8
12
|
conversation: Phonic.Conversation;
|
|
9
13
|
};
|
|
@@ -113,7 +113,7 @@ export declare class Projects {
|
|
|
113
113
|
* default_agent: "another-agent"
|
|
114
114
|
* })
|
|
115
115
|
*/
|
|
116
|
-
update(nameOrId: string, request
|
|
116
|
+
update(nameOrId: string, request: Phonic.UpdateProjectRequest, requestOptions?: Projects.RequestOptions): core.HttpResponsePromise<Phonic.ProjectsUpdateResponse>;
|
|
117
117
|
private __update;
|
|
118
118
|
/**
|
|
119
119
|
* Returns all conversation evaluation prompts for a project.
|
|
@@ -313,11 +313,11 @@ export class Projects {
|
|
|
313
313
|
* default_agent: "another-agent"
|
|
314
314
|
* })
|
|
315
315
|
*/
|
|
316
|
-
update(nameOrId, request
|
|
316
|
+
update(nameOrId, request, requestOptions) {
|
|
317
317
|
return core.HttpResponsePromise.fromPromise(this.__update(nameOrId, request, requestOptions));
|
|
318
318
|
}
|
|
319
|
-
__update(
|
|
320
|
-
return __awaiter(this,
|
|
319
|
+
__update(nameOrId, request, requestOptions) {
|
|
320
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
321
321
|
var _a, _b, _c, _d;
|
|
322
322
|
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
323
323
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
@@ -5,7 +5,7 @@ import * as Phonic from "../index.mjs";
|
|
|
5
5
|
export interface CreateAgentRequest {
|
|
6
6
|
/** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
|
|
7
7
|
name: string;
|
|
8
|
-
phone_number
|
|
8
|
+
phone_number: "assign-automatically" | null;
|
|
9
9
|
/** The timezone of the agent. Used to format system variables like `{{system_time}}`. */
|
|
10
10
|
timezone?: string;
|
|
11
11
|
/** The voice ID to use. */
|
|
@@ -14,10 +14,12 @@ export interface ToolCallOutputProcessedPayload {
|
|
|
14
14
|
endpoint_called_at?: string | null;
|
|
15
15
|
/** Webhook request body (null for WebSocket tools) */
|
|
16
16
|
request_body?: Record<string, unknown> | null;
|
|
17
|
-
|
|
17
|
+
/** Webhook response body (null for WebSocket tools) */
|
|
18
|
+
response_body?: unknown | null;
|
|
18
19
|
/** WebSocket tool parameters (null for webhook tools) */
|
|
19
20
|
parameters?: Record<string, unknown> | null;
|
|
20
|
-
output
|
|
21
|
+
/** WebSocket tool output (null for webhook tools) */
|
|
22
|
+
output?: unknown | null;
|
|
21
23
|
/** Webhook HTTP status code (null for WebSocket tools) */
|
|
22
24
|
response_status_code?: number | null;
|
|
23
25
|
/** Whether the tool call timed out */
|
|
@@ -3,7 +3,8 @@ import { RUNTIME } from "../runtime/index.mjs";
|
|
|
3
3
|
import { toQueryString } from "../url/qs.mjs";
|
|
4
4
|
import * as Events from "./events.mjs";
|
|
5
5
|
const getGlobalWebSocket = () => {
|
|
6
|
-
|
|
6
|
+
// Use Node.js 'ws' library for server-side runtimes since native WebSocket doesn't support headers
|
|
7
|
+
if (RUNTIME.type === "node" || RUNTIME.type === "bun" || RUNTIME.type === "deno") {
|
|
7
8
|
return NodeWebSocket;
|
|
8
9
|
}
|
|
9
10
|
else if (typeof WebSocket !== "undefined") {
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.30.
|
|
1
|
+
export declare const SDK_VERSION = "0.30.14";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.30.
|
|
1
|
+
export const SDK_VERSION = "0.30.14";
|