phonic 0.30.28 → 0.30.30
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 +42 -0
- package/dist/cjs/api/resources/agents/client/Client.js +174 -0
- package/dist/cjs/api/resources/agents/client/requests/AgentsAddCustomPhoneNumberRequest.d.ts +16 -0
- package/dist/cjs/api/resources/agents/client/requests/AgentsAddCustomPhoneNumberRequest.js +5 -0
- package/dist/cjs/api/resources/agents/client/requests/AgentsRemoveCustomPhoneNumberRequest.d.ts +16 -0
- package/dist/cjs/api/resources/agents/client/requests/AgentsRemoveCustomPhoneNumberRequest.js +5 -0
- package/dist/cjs/api/resources/agents/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/agents/types/AgentsAddCustomPhoneNumberResponse.d.ts +6 -0
- package/dist/cjs/api/resources/agents/types/AgentsAddCustomPhoneNumberResponse.js +5 -0
- package/dist/cjs/api/resources/agents/types/AgentsRemoveCustomPhoneNumberResponse.d.ts +6 -0
- package/dist/cjs/api/resources/agents/types/AgentsRemoveCustomPhoneNumberResponse.js +5 -0
- package/dist/cjs/api/resources/agents/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/agents/types/index.js +2 -0
- package/dist/cjs/api/resources/tools/client/requests/CreateToolRequest.d.ts +2 -2
- package/dist/cjs/api/resources/tools/client/requests/UpdateToolRequest.d.ts +2 -2
- package/dist/cjs/api/types/Tool.d.ts +2 -2
- 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 +42 -0
- package/dist/esm/api/resources/agents/client/Client.mjs +174 -0
- package/dist/esm/api/resources/agents/client/requests/AgentsAddCustomPhoneNumberRequest.d.mts +16 -0
- package/dist/esm/api/resources/agents/client/requests/AgentsAddCustomPhoneNumberRequest.mjs +4 -0
- package/dist/esm/api/resources/agents/client/requests/AgentsRemoveCustomPhoneNumberRequest.d.mts +16 -0
- package/dist/esm/api/resources/agents/client/requests/AgentsRemoveCustomPhoneNumberRequest.mjs +4 -0
- package/dist/esm/api/resources/agents/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/agents/types/AgentsAddCustomPhoneNumberResponse.d.mts +6 -0
- package/dist/esm/api/resources/agents/types/AgentsAddCustomPhoneNumberResponse.mjs +4 -0
- package/dist/esm/api/resources/agents/types/AgentsRemoveCustomPhoneNumberResponse.d.mts +6 -0
- package/dist/esm/api/resources/agents/types/AgentsRemoveCustomPhoneNumberResponse.mjs +4 -0
- package/dist/esm/api/resources/agents/types/index.d.mts +2 -0
- package/dist/esm/api/resources/agents/types/index.mjs +2 -0
- package/dist/esm/api/resources/tools/client/requests/CreateToolRequest.d.mts +2 -2
- package/dist/esm/api/resources/tools/client/requests/UpdateToolRequest.d.mts +2 -2
- package/dist/esm/api/types/Tool.d.mts +2 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +148 -0
package/dist/cjs/Client.js
CHANGED
|
@@ -51,8 +51,8 @@ class PhonicClient {
|
|
|
51
51
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
52
52
|
"X-Fern-Language": "JavaScript",
|
|
53
53
|
"X-Fern-SDK-Name": "phonic",
|
|
54
|
-
"X-Fern-SDK-Version": "0.30.
|
|
55
|
-
"User-Agent": "phonic/0.30.
|
|
54
|
+
"X-Fern-SDK-Version": "0.30.30",
|
|
55
|
+
"User-Agent": "phonic/0.30.30",
|
|
56
56
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
57
57
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
58
58
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -217,5 +217,47 @@ export declare class Agents {
|
|
|
217
217
|
*/
|
|
218
218
|
update(nameOrId: string, request: Phonic.UpdateAgentRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Phonic.AgentsUpdateResponse>;
|
|
219
219
|
private __update;
|
|
220
|
+
/**
|
|
221
|
+
* Adds a custom phone number to an agent. The user must configure their SIP trunk to point to Phonic's SIP server.
|
|
222
|
+
*
|
|
223
|
+
* @param {string} nameOrId - The name or the ID of the agent.
|
|
224
|
+
* @param {Phonic.AgentsAddCustomPhoneNumberRequest} request
|
|
225
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
226
|
+
*
|
|
227
|
+
* @throws {@link Phonic.BadRequestError}
|
|
228
|
+
* @throws {@link Phonic.UnauthorizedError}
|
|
229
|
+
* @throws {@link Phonic.ForbiddenError}
|
|
230
|
+
* @throws {@link Phonic.NotFoundError}
|
|
231
|
+
* @throws {@link Phonic.ConflictError}
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* await client.agents.addCustomPhoneNumber("nameOrId", {
|
|
235
|
+
* project: "main",
|
|
236
|
+
* phone_number: "+15551234567"
|
|
237
|
+
* })
|
|
238
|
+
*/
|
|
239
|
+
addCustomPhoneNumber(nameOrId: string, request: Phonic.AgentsAddCustomPhoneNumberRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Phonic.AgentsAddCustomPhoneNumberResponse>;
|
|
240
|
+
private __addCustomPhoneNumber;
|
|
241
|
+
/**
|
|
242
|
+
* Removes a custom phone number from an agent.
|
|
243
|
+
*
|
|
244
|
+
* @param {string} nameOrId - The name or the ID of the agent.
|
|
245
|
+
* @param {Phonic.AgentsRemoveCustomPhoneNumberRequest} request
|
|
246
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
247
|
+
*
|
|
248
|
+
* @throws {@link Phonic.BadRequestError}
|
|
249
|
+
* @throws {@link Phonic.UnauthorizedError}
|
|
250
|
+
* @throws {@link Phonic.ForbiddenError}
|
|
251
|
+
* @throws {@link Phonic.NotFoundError}
|
|
252
|
+
* @throws {@link Phonic.ConflictError}
|
|
253
|
+
*
|
|
254
|
+
* @example
|
|
255
|
+
* await client.agents.removeCustomPhoneNumber("nameOrId", {
|
|
256
|
+
* project: "main",
|
|
257
|
+
* phone_number: "+15551234567"
|
|
258
|
+
* })
|
|
259
|
+
*/
|
|
260
|
+
removeCustomPhoneNumber(nameOrId: string, request: Phonic.AgentsRemoveCustomPhoneNumberRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Phonic.AgentsRemoveCustomPhoneNumberResponse>;
|
|
261
|
+
private __removeCustomPhoneNumber;
|
|
220
262
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
221
263
|
}
|
|
@@ -592,6 +592,180 @@ class Agents {
|
|
|
592
592
|
}
|
|
593
593
|
});
|
|
594
594
|
}
|
|
595
|
+
/**
|
|
596
|
+
* Adds a custom phone number to an agent. The user must configure their SIP trunk to point to Phonic's SIP server.
|
|
597
|
+
*
|
|
598
|
+
* @param {string} nameOrId - The name or the ID of the agent.
|
|
599
|
+
* @param {Phonic.AgentsAddCustomPhoneNumberRequest} request
|
|
600
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
601
|
+
*
|
|
602
|
+
* @throws {@link Phonic.BadRequestError}
|
|
603
|
+
* @throws {@link Phonic.UnauthorizedError}
|
|
604
|
+
* @throws {@link Phonic.ForbiddenError}
|
|
605
|
+
* @throws {@link Phonic.NotFoundError}
|
|
606
|
+
* @throws {@link Phonic.ConflictError}
|
|
607
|
+
*
|
|
608
|
+
* @example
|
|
609
|
+
* await client.agents.addCustomPhoneNumber("nameOrId", {
|
|
610
|
+
* project: "main",
|
|
611
|
+
* phone_number: "+15551234567"
|
|
612
|
+
* })
|
|
613
|
+
*/
|
|
614
|
+
addCustomPhoneNumber(nameOrId, request, requestOptions) {
|
|
615
|
+
return core.HttpResponsePromise.fromPromise(this.__addCustomPhoneNumber(nameOrId, request, requestOptions));
|
|
616
|
+
}
|
|
617
|
+
__addCustomPhoneNumber(nameOrId, request, requestOptions) {
|
|
618
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
619
|
+
var _a, _b, _c, _d;
|
|
620
|
+
const { project } = request, _body = __rest(request, ["project"]);
|
|
621
|
+
const _queryParams = {};
|
|
622
|
+
if (project != null) {
|
|
623
|
+
_queryParams["project"] = project;
|
|
624
|
+
}
|
|
625
|
+
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);
|
|
626
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
627
|
+
url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.PhonicEnvironment.Default)
|
|
628
|
+
.base, `agents/${encodeURIComponent(nameOrId)}/add-custom-phone-number`),
|
|
629
|
+
method: "POST",
|
|
630
|
+
headers: _headers,
|
|
631
|
+
contentType: "application/json",
|
|
632
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
633
|
+
requestType: "json",
|
|
634
|
+
body: _body,
|
|
635
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
636
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
637
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
638
|
+
});
|
|
639
|
+
if (_response.ok) {
|
|
640
|
+
return {
|
|
641
|
+
data: _response.body,
|
|
642
|
+
rawResponse: _response.rawResponse,
|
|
643
|
+
};
|
|
644
|
+
}
|
|
645
|
+
if (_response.error.reason === "status-code") {
|
|
646
|
+
switch (_response.error.statusCode) {
|
|
647
|
+
case 400:
|
|
648
|
+
throw new Phonic.BadRequestError(_response.error.body, _response.rawResponse);
|
|
649
|
+
case 401:
|
|
650
|
+
throw new Phonic.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
651
|
+
case 403:
|
|
652
|
+
throw new Phonic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
653
|
+
case 404:
|
|
654
|
+
throw new Phonic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
655
|
+
case 409:
|
|
656
|
+
throw new Phonic.ConflictError(_response.error.body, _response.rawResponse);
|
|
657
|
+
default:
|
|
658
|
+
throw new errors.PhonicError({
|
|
659
|
+
statusCode: _response.error.statusCode,
|
|
660
|
+
body: _response.error.body,
|
|
661
|
+
rawResponse: _response.rawResponse,
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
switch (_response.error.reason) {
|
|
666
|
+
case "non-json":
|
|
667
|
+
throw new errors.PhonicError({
|
|
668
|
+
statusCode: _response.error.statusCode,
|
|
669
|
+
body: _response.error.rawBody,
|
|
670
|
+
rawResponse: _response.rawResponse,
|
|
671
|
+
});
|
|
672
|
+
case "timeout":
|
|
673
|
+
throw new errors.PhonicTimeoutError("Timeout exceeded when calling POST /agents/{nameOrId}/add-custom-phone-number.");
|
|
674
|
+
case "unknown":
|
|
675
|
+
throw new errors.PhonicError({
|
|
676
|
+
message: _response.error.errorMessage,
|
|
677
|
+
rawResponse: _response.rawResponse,
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* Removes a custom phone number from an agent.
|
|
684
|
+
*
|
|
685
|
+
* @param {string} nameOrId - The name or the ID of the agent.
|
|
686
|
+
* @param {Phonic.AgentsRemoveCustomPhoneNumberRequest} request
|
|
687
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
688
|
+
*
|
|
689
|
+
* @throws {@link Phonic.BadRequestError}
|
|
690
|
+
* @throws {@link Phonic.UnauthorizedError}
|
|
691
|
+
* @throws {@link Phonic.ForbiddenError}
|
|
692
|
+
* @throws {@link Phonic.NotFoundError}
|
|
693
|
+
* @throws {@link Phonic.ConflictError}
|
|
694
|
+
*
|
|
695
|
+
* @example
|
|
696
|
+
* await client.agents.removeCustomPhoneNumber("nameOrId", {
|
|
697
|
+
* project: "main",
|
|
698
|
+
* phone_number: "+15551234567"
|
|
699
|
+
* })
|
|
700
|
+
*/
|
|
701
|
+
removeCustomPhoneNumber(nameOrId, request, requestOptions) {
|
|
702
|
+
return core.HttpResponsePromise.fromPromise(this.__removeCustomPhoneNumber(nameOrId, request, requestOptions));
|
|
703
|
+
}
|
|
704
|
+
__removeCustomPhoneNumber(nameOrId, request, requestOptions) {
|
|
705
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
706
|
+
var _a, _b, _c, _d;
|
|
707
|
+
const { project } = request, _body = __rest(request, ["project"]);
|
|
708
|
+
const _queryParams = {};
|
|
709
|
+
if (project != null) {
|
|
710
|
+
_queryParams["project"] = project;
|
|
711
|
+
}
|
|
712
|
+
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);
|
|
713
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
714
|
+
url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.PhonicEnvironment.Default)
|
|
715
|
+
.base, `agents/${encodeURIComponent(nameOrId)}/remove-custom-phone-number`),
|
|
716
|
+
method: "POST",
|
|
717
|
+
headers: _headers,
|
|
718
|
+
contentType: "application/json",
|
|
719
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
720
|
+
requestType: "json",
|
|
721
|
+
body: _body,
|
|
722
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
723
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
724
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
725
|
+
});
|
|
726
|
+
if (_response.ok) {
|
|
727
|
+
return {
|
|
728
|
+
data: _response.body,
|
|
729
|
+
rawResponse: _response.rawResponse,
|
|
730
|
+
};
|
|
731
|
+
}
|
|
732
|
+
if (_response.error.reason === "status-code") {
|
|
733
|
+
switch (_response.error.statusCode) {
|
|
734
|
+
case 400:
|
|
735
|
+
throw new Phonic.BadRequestError(_response.error.body, _response.rawResponse);
|
|
736
|
+
case 401:
|
|
737
|
+
throw new Phonic.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
738
|
+
case 403:
|
|
739
|
+
throw new Phonic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
740
|
+
case 404:
|
|
741
|
+
throw new Phonic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
742
|
+
case 409:
|
|
743
|
+
throw new Phonic.ConflictError(_response.error.body, _response.rawResponse);
|
|
744
|
+
default:
|
|
745
|
+
throw new errors.PhonicError({
|
|
746
|
+
statusCode: _response.error.statusCode,
|
|
747
|
+
body: _response.error.body,
|
|
748
|
+
rawResponse: _response.rawResponse,
|
|
749
|
+
});
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
switch (_response.error.reason) {
|
|
753
|
+
case "non-json":
|
|
754
|
+
throw new errors.PhonicError({
|
|
755
|
+
statusCode: _response.error.statusCode,
|
|
756
|
+
body: _response.error.rawBody,
|
|
757
|
+
rawResponse: _response.rawResponse,
|
|
758
|
+
});
|
|
759
|
+
case "timeout":
|
|
760
|
+
throw new errors.PhonicTimeoutError("Timeout exceeded when calling POST /agents/{nameOrId}/remove-custom-phone-number.");
|
|
761
|
+
case "unknown":
|
|
762
|
+
throw new errors.PhonicError({
|
|
763
|
+
message: _response.error.errorMessage,
|
|
764
|
+
rawResponse: _response.rawResponse,
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
});
|
|
768
|
+
}
|
|
595
769
|
_getAuthorizationHeader() {
|
|
596
770
|
return __awaiter(this, void 0, void 0, function* () {
|
|
597
771
|
var _a;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* project: "main",
|
|
8
|
+
* phone_number: "+15551234567"
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface AgentsAddCustomPhoneNumberRequest {
|
|
12
|
+
/** The name of the project containing the agent. Only used when `nameOrId` is a name. */
|
|
13
|
+
project?: string;
|
|
14
|
+
/** The E.164 formatted phone number to add (e.g., "+15551234567"). */
|
|
15
|
+
phone_number: string;
|
|
16
|
+
}
|
package/dist/cjs/api/resources/agents/client/requests/AgentsRemoveCustomPhoneNumberRequest.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* project: "main",
|
|
8
|
+
* phone_number: "+15551234567"
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface AgentsRemoveCustomPhoneNumberRequest {
|
|
12
|
+
/** The name of the project containing the agent. Only used when `nameOrId` is a name. */
|
|
13
|
+
project?: string;
|
|
14
|
+
/** The E.164 formatted phone number to remove (e.g., "+15551234567"). */
|
|
15
|
+
phone_number: string;
|
|
16
|
+
}
|
|
@@ -4,3 +4,5 @@ export { type UpsertAgentRequest } from "./UpsertAgentRequest.js";
|
|
|
4
4
|
export { type AgentsGetRequest } from "./AgentsGetRequest.js";
|
|
5
5
|
export { type AgentsDeleteRequest } from "./AgentsDeleteRequest.js";
|
|
6
6
|
export { type UpdateAgentRequest } from "./UpdateAgentRequest.js";
|
|
7
|
+
export { type AgentsAddCustomPhoneNumberRequest } from "./AgentsAddCustomPhoneNumberRequest.js";
|
|
8
|
+
export { type AgentsRemoveCustomPhoneNumberRequest } from "./AgentsRemoveCustomPhoneNumberRequest.js";
|
|
@@ -4,3 +4,5 @@ export * from "./AgentsUpsertResponse.js";
|
|
|
4
4
|
export * from "./AgentsGetResponse.js";
|
|
5
5
|
export * from "./AgentsDeleteResponse.js";
|
|
6
6
|
export * from "./AgentsUpdateResponse.js";
|
|
7
|
+
export * from "./AgentsAddCustomPhoneNumberResponse.js";
|
|
8
|
+
export * from "./AgentsRemoveCustomPhoneNumberResponse.js";
|
|
@@ -20,3 +20,5 @@ __exportStar(require("./AgentsUpsertResponse.js"), exports);
|
|
|
20
20
|
__exportStar(require("./AgentsGetResponse.js"), exports);
|
|
21
21
|
__exportStar(require("./AgentsDeleteResponse.js"), exports);
|
|
22
22
|
__exportStar(require("./AgentsUpdateResponse.js"), exports);
|
|
23
|
+
__exportStar(require("./AgentsAddCustomPhoneNumberResponse.js"), exports);
|
|
24
|
+
__exportStar(require("./AgentsRemoveCustomPhoneNumberResponse.js"), exports);
|
|
@@ -128,8 +128,8 @@ export interface CreateToolRequest {
|
|
|
128
128
|
endpoint_timeout_ms?: number;
|
|
129
129
|
/** Timeout for WebSocket tool responses. */
|
|
130
130
|
tool_call_output_timeout_ms?: number;
|
|
131
|
-
/** The E.164 formatted phone number to transfer calls to.
|
|
132
|
-
phone_number?: string;
|
|
131
|
+
/** The E.164 formatted phone number to transfer calls to. Set to null if the agent should determine the phone number. */
|
|
132
|
+
phone_number?: string | null;
|
|
133
133
|
/** DTMF digits to send after the transfer connects (e.g., "1234"). Defaults to null. */
|
|
134
134
|
dtmf?: string | null;
|
|
135
135
|
/** When true, Phonic will transfer the call using the agent's phone number. When false, Phonic will transfer the call using the phone number of the party to whom the agent is connected. This is only available for built_in_transfer_to_phone_number tools. */
|
|
@@ -37,8 +37,8 @@ export interface UpdateToolRequest {
|
|
|
37
37
|
endpoint_headers?: Record<string, string>;
|
|
38
38
|
endpoint_timeout_ms?: number;
|
|
39
39
|
tool_call_output_timeout_ms?: number;
|
|
40
|
-
/** The E.164 formatted phone number to transfer calls to.
|
|
41
|
-
phone_number?: string;
|
|
40
|
+
/** The E.164 formatted phone number to transfer calls to. Set to null if the agent should determine the phone number. */
|
|
41
|
+
phone_number?: string | null;
|
|
42
42
|
/** DTMF digits to send after the transfer connects (e.g., "1234"). Can be set to null to remove DTMF. */
|
|
43
43
|
dtmf?: string | null;
|
|
44
44
|
/** When true, Phonic will transfer the call using the agent's phone number. When false, Phonic will transfer the call using the phone number of the party to whom the agent is connected. This is only available for built_in_transfer_to_phone_number tools. */
|
|
@@ -26,8 +26,8 @@ export interface Tool {
|
|
|
26
26
|
endpoint_timeout_ms?: number;
|
|
27
27
|
/** Timeout in milliseconds for WebSocket tool responses. */
|
|
28
28
|
tool_call_output_timeout_ms?: number;
|
|
29
|
-
/** The E.164 formatted phone number to transfer calls to.
|
|
30
|
-
phone_number?: string;
|
|
29
|
+
/** The E.164 formatted phone number to transfer calls to. Set to null if the agent should determine the phone number. */
|
|
30
|
+
phone_number?: string | null;
|
|
31
31
|
/** DTMF digits to send after the transfer connects (e.g., "1234"). Defaults to null. */
|
|
32
32
|
dtmf?: string | null;
|
|
33
33
|
/** When true, Phonic will transfer the call using the agent's phone number. When false, Phonic will transfer the call using the phone number of the party to whom the agent is connected. This is only available for built_in_transfer_to_phone_number tools. */
|
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.30";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -15,8 +15,8 @@ export class PhonicClient {
|
|
|
15
15
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
16
16
|
"X-Fern-Language": "JavaScript",
|
|
17
17
|
"X-Fern-SDK-Name": "phonic",
|
|
18
|
-
"X-Fern-SDK-Version": "0.30.
|
|
19
|
-
"User-Agent": "phonic/0.30.
|
|
18
|
+
"X-Fern-SDK-Version": "0.30.30",
|
|
19
|
+
"User-Agent": "phonic/0.30.30",
|
|
20
20
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
21
21
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
22
22
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -217,5 +217,47 @@ export declare class Agents {
|
|
|
217
217
|
*/
|
|
218
218
|
update(nameOrId: string, request: Phonic.UpdateAgentRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Phonic.AgentsUpdateResponse>;
|
|
219
219
|
private __update;
|
|
220
|
+
/**
|
|
221
|
+
* Adds a custom phone number to an agent. The user must configure their SIP trunk to point to Phonic's SIP server.
|
|
222
|
+
*
|
|
223
|
+
* @param {string} nameOrId - The name or the ID of the agent.
|
|
224
|
+
* @param {Phonic.AgentsAddCustomPhoneNumberRequest} request
|
|
225
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
226
|
+
*
|
|
227
|
+
* @throws {@link Phonic.BadRequestError}
|
|
228
|
+
* @throws {@link Phonic.UnauthorizedError}
|
|
229
|
+
* @throws {@link Phonic.ForbiddenError}
|
|
230
|
+
* @throws {@link Phonic.NotFoundError}
|
|
231
|
+
* @throws {@link Phonic.ConflictError}
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* await client.agents.addCustomPhoneNumber("nameOrId", {
|
|
235
|
+
* project: "main",
|
|
236
|
+
* phone_number: "+15551234567"
|
|
237
|
+
* })
|
|
238
|
+
*/
|
|
239
|
+
addCustomPhoneNumber(nameOrId: string, request: Phonic.AgentsAddCustomPhoneNumberRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Phonic.AgentsAddCustomPhoneNumberResponse>;
|
|
240
|
+
private __addCustomPhoneNumber;
|
|
241
|
+
/**
|
|
242
|
+
* Removes a custom phone number from an agent.
|
|
243
|
+
*
|
|
244
|
+
* @param {string} nameOrId - The name or the ID of the agent.
|
|
245
|
+
* @param {Phonic.AgentsRemoveCustomPhoneNumberRequest} request
|
|
246
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
247
|
+
*
|
|
248
|
+
* @throws {@link Phonic.BadRequestError}
|
|
249
|
+
* @throws {@link Phonic.UnauthorizedError}
|
|
250
|
+
* @throws {@link Phonic.ForbiddenError}
|
|
251
|
+
* @throws {@link Phonic.NotFoundError}
|
|
252
|
+
* @throws {@link Phonic.ConflictError}
|
|
253
|
+
*
|
|
254
|
+
* @example
|
|
255
|
+
* await client.agents.removeCustomPhoneNumber("nameOrId", {
|
|
256
|
+
* project: "main",
|
|
257
|
+
* phone_number: "+15551234567"
|
|
258
|
+
* })
|
|
259
|
+
*/
|
|
260
|
+
removeCustomPhoneNumber(nameOrId: string, request: Phonic.AgentsRemoveCustomPhoneNumberRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Phonic.AgentsRemoveCustomPhoneNumberResponse>;
|
|
261
|
+
private __removeCustomPhoneNumber;
|
|
220
262
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
221
263
|
}
|
|
@@ -556,6 +556,180 @@ export class Agents {
|
|
|
556
556
|
}
|
|
557
557
|
});
|
|
558
558
|
}
|
|
559
|
+
/**
|
|
560
|
+
* Adds a custom phone number to an agent. The user must configure their SIP trunk to point to Phonic's SIP server.
|
|
561
|
+
*
|
|
562
|
+
* @param {string} nameOrId - The name or the ID of the agent.
|
|
563
|
+
* @param {Phonic.AgentsAddCustomPhoneNumberRequest} request
|
|
564
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
565
|
+
*
|
|
566
|
+
* @throws {@link Phonic.BadRequestError}
|
|
567
|
+
* @throws {@link Phonic.UnauthorizedError}
|
|
568
|
+
* @throws {@link Phonic.ForbiddenError}
|
|
569
|
+
* @throws {@link Phonic.NotFoundError}
|
|
570
|
+
* @throws {@link Phonic.ConflictError}
|
|
571
|
+
*
|
|
572
|
+
* @example
|
|
573
|
+
* await client.agents.addCustomPhoneNumber("nameOrId", {
|
|
574
|
+
* project: "main",
|
|
575
|
+
* phone_number: "+15551234567"
|
|
576
|
+
* })
|
|
577
|
+
*/
|
|
578
|
+
addCustomPhoneNumber(nameOrId, request, requestOptions) {
|
|
579
|
+
return core.HttpResponsePromise.fromPromise(this.__addCustomPhoneNumber(nameOrId, request, requestOptions));
|
|
580
|
+
}
|
|
581
|
+
__addCustomPhoneNumber(nameOrId, request, requestOptions) {
|
|
582
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
583
|
+
var _a, _b, _c, _d;
|
|
584
|
+
const { project } = request, _body = __rest(request, ["project"]);
|
|
585
|
+
const _queryParams = {};
|
|
586
|
+
if (project != null) {
|
|
587
|
+
_queryParams["project"] = project;
|
|
588
|
+
}
|
|
589
|
+
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);
|
|
590
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
591
|
+
url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.PhonicEnvironment.Default)
|
|
592
|
+
.base, `agents/${encodeURIComponent(nameOrId)}/add-custom-phone-number`),
|
|
593
|
+
method: "POST",
|
|
594
|
+
headers: _headers,
|
|
595
|
+
contentType: "application/json",
|
|
596
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
597
|
+
requestType: "json",
|
|
598
|
+
body: _body,
|
|
599
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
600
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
601
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
602
|
+
});
|
|
603
|
+
if (_response.ok) {
|
|
604
|
+
return {
|
|
605
|
+
data: _response.body,
|
|
606
|
+
rawResponse: _response.rawResponse,
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
if (_response.error.reason === "status-code") {
|
|
610
|
+
switch (_response.error.statusCode) {
|
|
611
|
+
case 400:
|
|
612
|
+
throw new Phonic.BadRequestError(_response.error.body, _response.rawResponse);
|
|
613
|
+
case 401:
|
|
614
|
+
throw new Phonic.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
615
|
+
case 403:
|
|
616
|
+
throw new Phonic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
617
|
+
case 404:
|
|
618
|
+
throw new Phonic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
619
|
+
case 409:
|
|
620
|
+
throw new Phonic.ConflictError(_response.error.body, _response.rawResponse);
|
|
621
|
+
default:
|
|
622
|
+
throw new errors.PhonicError({
|
|
623
|
+
statusCode: _response.error.statusCode,
|
|
624
|
+
body: _response.error.body,
|
|
625
|
+
rawResponse: _response.rawResponse,
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
switch (_response.error.reason) {
|
|
630
|
+
case "non-json":
|
|
631
|
+
throw new errors.PhonicError({
|
|
632
|
+
statusCode: _response.error.statusCode,
|
|
633
|
+
body: _response.error.rawBody,
|
|
634
|
+
rawResponse: _response.rawResponse,
|
|
635
|
+
});
|
|
636
|
+
case "timeout":
|
|
637
|
+
throw new errors.PhonicTimeoutError("Timeout exceeded when calling POST /agents/{nameOrId}/add-custom-phone-number.");
|
|
638
|
+
case "unknown":
|
|
639
|
+
throw new errors.PhonicError({
|
|
640
|
+
message: _response.error.errorMessage,
|
|
641
|
+
rawResponse: _response.rawResponse,
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* Removes a custom phone number from an agent.
|
|
648
|
+
*
|
|
649
|
+
* @param {string} nameOrId - The name or the ID of the agent.
|
|
650
|
+
* @param {Phonic.AgentsRemoveCustomPhoneNumberRequest} request
|
|
651
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
652
|
+
*
|
|
653
|
+
* @throws {@link Phonic.BadRequestError}
|
|
654
|
+
* @throws {@link Phonic.UnauthorizedError}
|
|
655
|
+
* @throws {@link Phonic.ForbiddenError}
|
|
656
|
+
* @throws {@link Phonic.NotFoundError}
|
|
657
|
+
* @throws {@link Phonic.ConflictError}
|
|
658
|
+
*
|
|
659
|
+
* @example
|
|
660
|
+
* await client.agents.removeCustomPhoneNumber("nameOrId", {
|
|
661
|
+
* project: "main",
|
|
662
|
+
* phone_number: "+15551234567"
|
|
663
|
+
* })
|
|
664
|
+
*/
|
|
665
|
+
removeCustomPhoneNumber(nameOrId, request, requestOptions) {
|
|
666
|
+
return core.HttpResponsePromise.fromPromise(this.__removeCustomPhoneNumber(nameOrId, request, requestOptions));
|
|
667
|
+
}
|
|
668
|
+
__removeCustomPhoneNumber(nameOrId, request, requestOptions) {
|
|
669
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
670
|
+
var _a, _b, _c, _d;
|
|
671
|
+
const { project } = request, _body = __rest(request, ["project"]);
|
|
672
|
+
const _queryParams = {};
|
|
673
|
+
if (project != null) {
|
|
674
|
+
_queryParams["project"] = project;
|
|
675
|
+
}
|
|
676
|
+
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);
|
|
677
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
678
|
+
url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.PhonicEnvironment.Default)
|
|
679
|
+
.base, `agents/${encodeURIComponent(nameOrId)}/remove-custom-phone-number`),
|
|
680
|
+
method: "POST",
|
|
681
|
+
headers: _headers,
|
|
682
|
+
contentType: "application/json",
|
|
683
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
684
|
+
requestType: "json",
|
|
685
|
+
body: _body,
|
|
686
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
687
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
688
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
689
|
+
});
|
|
690
|
+
if (_response.ok) {
|
|
691
|
+
return {
|
|
692
|
+
data: _response.body,
|
|
693
|
+
rawResponse: _response.rawResponse,
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
if (_response.error.reason === "status-code") {
|
|
697
|
+
switch (_response.error.statusCode) {
|
|
698
|
+
case 400:
|
|
699
|
+
throw new Phonic.BadRequestError(_response.error.body, _response.rawResponse);
|
|
700
|
+
case 401:
|
|
701
|
+
throw new Phonic.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
702
|
+
case 403:
|
|
703
|
+
throw new Phonic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
704
|
+
case 404:
|
|
705
|
+
throw new Phonic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
706
|
+
case 409:
|
|
707
|
+
throw new Phonic.ConflictError(_response.error.body, _response.rawResponse);
|
|
708
|
+
default:
|
|
709
|
+
throw new errors.PhonicError({
|
|
710
|
+
statusCode: _response.error.statusCode,
|
|
711
|
+
body: _response.error.body,
|
|
712
|
+
rawResponse: _response.rawResponse,
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
switch (_response.error.reason) {
|
|
717
|
+
case "non-json":
|
|
718
|
+
throw new errors.PhonicError({
|
|
719
|
+
statusCode: _response.error.statusCode,
|
|
720
|
+
body: _response.error.rawBody,
|
|
721
|
+
rawResponse: _response.rawResponse,
|
|
722
|
+
});
|
|
723
|
+
case "timeout":
|
|
724
|
+
throw new errors.PhonicTimeoutError("Timeout exceeded when calling POST /agents/{nameOrId}/remove-custom-phone-number.");
|
|
725
|
+
case "unknown":
|
|
726
|
+
throw new errors.PhonicError({
|
|
727
|
+
message: _response.error.errorMessage,
|
|
728
|
+
rawResponse: _response.rawResponse,
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
});
|
|
732
|
+
}
|
|
559
733
|
_getAuthorizationHeader() {
|
|
560
734
|
return __awaiter(this, void 0, void 0, function* () {
|
|
561
735
|
var _a;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* project: "main",
|
|
8
|
+
* phone_number: "+15551234567"
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface AgentsAddCustomPhoneNumberRequest {
|
|
12
|
+
/** The name of the project containing the agent. Only used when `nameOrId` is a name. */
|
|
13
|
+
project?: string;
|
|
14
|
+
/** The E.164 formatted phone number to add (e.g., "+15551234567"). */
|
|
15
|
+
phone_number: string;
|
|
16
|
+
}
|
package/dist/esm/api/resources/agents/client/requests/AgentsRemoveCustomPhoneNumberRequest.d.mts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* project: "main",
|
|
8
|
+
* phone_number: "+15551234567"
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface AgentsRemoveCustomPhoneNumberRequest {
|
|
12
|
+
/** The name of the project containing the agent. Only used when `nameOrId` is a name. */
|
|
13
|
+
project?: string;
|
|
14
|
+
/** The E.164 formatted phone number to remove (e.g., "+15551234567"). */
|
|
15
|
+
phone_number: string;
|
|
16
|
+
}
|
|
@@ -4,3 +4,5 @@ export { type UpsertAgentRequest } from "./UpsertAgentRequest.mjs";
|
|
|
4
4
|
export { type AgentsGetRequest } from "./AgentsGetRequest.mjs";
|
|
5
5
|
export { type AgentsDeleteRequest } from "./AgentsDeleteRequest.mjs";
|
|
6
6
|
export { type UpdateAgentRequest } from "./UpdateAgentRequest.mjs";
|
|
7
|
+
export { type AgentsAddCustomPhoneNumberRequest } from "./AgentsAddCustomPhoneNumberRequest.mjs";
|
|
8
|
+
export { type AgentsRemoveCustomPhoneNumberRequest } from "./AgentsRemoveCustomPhoneNumberRequest.mjs";
|
|
@@ -4,3 +4,5 @@ export * from "./AgentsUpsertResponse.mjs";
|
|
|
4
4
|
export * from "./AgentsGetResponse.mjs";
|
|
5
5
|
export * from "./AgentsDeleteResponse.mjs";
|
|
6
6
|
export * from "./AgentsUpdateResponse.mjs";
|
|
7
|
+
export * from "./AgentsAddCustomPhoneNumberResponse.mjs";
|
|
8
|
+
export * from "./AgentsRemoveCustomPhoneNumberResponse.mjs";
|
|
@@ -4,3 +4,5 @@ export * from "./AgentsUpsertResponse.mjs";
|
|
|
4
4
|
export * from "./AgentsGetResponse.mjs";
|
|
5
5
|
export * from "./AgentsDeleteResponse.mjs";
|
|
6
6
|
export * from "./AgentsUpdateResponse.mjs";
|
|
7
|
+
export * from "./AgentsAddCustomPhoneNumberResponse.mjs";
|
|
8
|
+
export * from "./AgentsRemoveCustomPhoneNumberResponse.mjs";
|
|
@@ -128,8 +128,8 @@ export interface CreateToolRequest {
|
|
|
128
128
|
endpoint_timeout_ms?: number;
|
|
129
129
|
/** Timeout for WebSocket tool responses. */
|
|
130
130
|
tool_call_output_timeout_ms?: number;
|
|
131
|
-
/** The E.164 formatted phone number to transfer calls to.
|
|
132
|
-
phone_number?: string;
|
|
131
|
+
/** The E.164 formatted phone number to transfer calls to. Set to null if the agent should determine the phone number. */
|
|
132
|
+
phone_number?: string | null;
|
|
133
133
|
/** DTMF digits to send after the transfer connects (e.g., "1234"). Defaults to null. */
|
|
134
134
|
dtmf?: string | null;
|
|
135
135
|
/** When true, Phonic will transfer the call using the agent's phone number. When false, Phonic will transfer the call using the phone number of the party to whom the agent is connected. This is only available for built_in_transfer_to_phone_number tools. */
|
|
@@ -37,8 +37,8 @@ export interface UpdateToolRequest {
|
|
|
37
37
|
endpoint_headers?: Record<string, string>;
|
|
38
38
|
endpoint_timeout_ms?: number;
|
|
39
39
|
tool_call_output_timeout_ms?: number;
|
|
40
|
-
/** The E.164 formatted phone number to transfer calls to.
|
|
41
|
-
phone_number?: string;
|
|
40
|
+
/** The E.164 formatted phone number to transfer calls to. Set to null if the agent should determine the phone number. */
|
|
41
|
+
phone_number?: string | null;
|
|
42
42
|
/** DTMF digits to send after the transfer connects (e.g., "1234"). Can be set to null to remove DTMF. */
|
|
43
43
|
dtmf?: string | null;
|
|
44
44
|
/** When true, Phonic will transfer the call using the agent's phone number. When false, Phonic will transfer the call using the phone number of the party to whom the agent is connected. This is only available for built_in_transfer_to_phone_number tools. */
|
|
@@ -26,8 +26,8 @@ export interface Tool {
|
|
|
26
26
|
endpoint_timeout_ms?: number;
|
|
27
27
|
/** Timeout in milliseconds for WebSocket tool responses. */
|
|
28
28
|
tool_call_output_timeout_ms?: number;
|
|
29
|
-
/** The E.164 formatted phone number to transfer calls to.
|
|
30
|
-
phone_number?: string;
|
|
29
|
+
/** The E.164 formatted phone number to transfer calls to. Set to null if the agent should determine the phone number. */
|
|
30
|
+
phone_number?: string | null;
|
|
31
31
|
/** DTMF digits to send after the transfer connects (e.g., "1234"). Defaults to null. */
|
|
32
32
|
dtmf?: string | null;
|
|
33
33
|
/** When true, Phonic will transfer the call using the agent's phone number. When false, Phonic will transfer the call using the phone number of the party to whom the agent is connected. This is only available for built_in_transfer_to_phone_number tools. */
|
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.30";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.30.
|
|
1
|
+
export const SDK_VERSION = "0.30.30";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -501,6 +501,154 @@ await client.agents.update("nameOrId", {
|
|
|
501
501
|
</dl>
|
|
502
502
|
</details>
|
|
503
503
|
|
|
504
|
+
<details><summary><code>client.agents.<a href="/src/api/resources/agents/client/Client.ts">addCustomPhoneNumber</a>(nameOrId, { ...params }) -> Phonic.AgentsAddCustomPhoneNumberResponse</code></summary>
|
|
505
|
+
<dl>
|
|
506
|
+
<dd>
|
|
507
|
+
|
|
508
|
+
#### 📝 Description
|
|
509
|
+
|
|
510
|
+
<dl>
|
|
511
|
+
<dd>
|
|
512
|
+
|
|
513
|
+
<dl>
|
|
514
|
+
<dd>
|
|
515
|
+
|
|
516
|
+
Adds a custom phone number to an agent. The user must configure their SIP trunk to point to Phonic's SIP server.
|
|
517
|
+
|
|
518
|
+
</dd>
|
|
519
|
+
</dl>
|
|
520
|
+
</dd>
|
|
521
|
+
</dl>
|
|
522
|
+
|
|
523
|
+
#### 🔌 Usage
|
|
524
|
+
|
|
525
|
+
<dl>
|
|
526
|
+
<dd>
|
|
527
|
+
|
|
528
|
+
<dl>
|
|
529
|
+
<dd>
|
|
530
|
+
|
|
531
|
+
```typescript
|
|
532
|
+
await client.agents.addCustomPhoneNumber("nameOrId", {
|
|
533
|
+
project: "main",
|
|
534
|
+
phone_number: "+15551234567",
|
|
535
|
+
});
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
</dd>
|
|
539
|
+
</dl>
|
|
540
|
+
</dd>
|
|
541
|
+
</dl>
|
|
542
|
+
|
|
543
|
+
#### ⚙️ Parameters
|
|
544
|
+
|
|
545
|
+
<dl>
|
|
546
|
+
<dd>
|
|
547
|
+
|
|
548
|
+
<dl>
|
|
549
|
+
<dd>
|
|
550
|
+
|
|
551
|
+
**nameOrId:** `string` — The name or the ID of the agent.
|
|
552
|
+
|
|
553
|
+
</dd>
|
|
554
|
+
</dl>
|
|
555
|
+
|
|
556
|
+
<dl>
|
|
557
|
+
<dd>
|
|
558
|
+
|
|
559
|
+
**request:** `Phonic.AgentsAddCustomPhoneNumberRequest`
|
|
560
|
+
|
|
561
|
+
</dd>
|
|
562
|
+
</dl>
|
|
563
|
+
|
|
564
|
+
<dl>
|
|
565
|
+
<dd>
|
|
566
|
+
|
|
567
|
+
**requestOptions:** `Agents.RequestOptions`
|
|
568
|
+
|
|
569
|
+
</dd>
|
|
570
|
+
</dl>
|
|
571
|
+
</dd>
|
|
572
|
+
</dl>
|
|
573
|
+
|
|
574
|
+
</dd>
|
|
575
|
+
</dl>
|
|
576
|
+
</details>
|
|
577
|
+
|
|
578
|
+
<details><summary><code>client.agents.<a href="/src/api/resources/agents/client/Client.ts">removeCustomPhoneNumber</a>(nameOrId, { ...params }) -> Phonic.AgentsRemoveCustomPhoneNumberResponse</code></summary>
|
|
579
|
+
<dl>
|
|
580
|
+
<dd>
|
|
581
|
+
|
|
582
|
+
#### 📝 Description
|
|
583
|
+
|
|
584
|
+
<dl>
|
|
585
|
+
<dd>
|
|
586
|
+
|
|
587
|
+
<dl>
|
|
588
|
+
<dd>
|
|
589
|
+
|
|
590
|
+
Removes a custom phone number from an agent.
|
|
591
|
+
|
|
592
|
+
</dd>
|
|
593
|
+
</dl>
|
|
594
|
+
</dd>
|
|
595
|
+
</dl>
|
|
596
|
+
|
|
597
|
+
#### 🔌 Usage
|
|
598
|
+
|
|
599
|
+
<dl>
|
|
600
|
+
<dd>
|
|
601
|
+
|
|
602
|
+
<dl>
|
|
603
|
+
<dd>
|
|
604
|
+
|
|
605
|
+
```typescript
|
|
606
|
+
await client.agents.removeCustomPhoneNumber("nameOrId", {
|
|
607
|
+
project: "main",
|
|
608
|
+
phone_number: "+15551234567",
|
|
609
|
+
});
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
</dd>
|
|
613
|
+
</dl>
|
|
614
|
+
</dd>
|
|
615
|
+
</dl>
|
|
616
|
+
|
|
617
|
+
#### ⚙️ Parameters
|
|
618
|
+
|
|
619
|
+
<dl>
|
|
620
|
+
<dd>
|
|
621
|
+
|
|
622
|
+
<dl>
|
|
623
|
+
<dd>
|
|
624
|
+
|
|
625
|
+
**nameOrId:** `string` — The name or the ID of the agent.
|
|
626
|
+
|
|
627
|
+
</dd>
|
|
628
|
+
</dl>
|
|
629
|
+
|
|
630
|
+
<dl>
|
|
631
|
+
<dd>
|
|
632
|
+
|
|
633
|
+
**request:** `Phonic.AgentsRemoveCustomPhoneNumberRequest`
|
|
634
|
+
|
|
635
|
+
</dd>
|
|
636
|
+
</dl>
|
|
637
|
+
|
|
638
|
+
<dl>
|
|
639
|
+
<dd>
|
|
640
|
+
|
|
641
|
+
**requestOptions:** `Agents.RequestOptions`
|
|
642
|
+
|
|
643
|
+
</dd>
|
|
644
|
+
</dl>
|
|
645
|
+
</dd>
|
|
646
|
+
</dl>
|
|
647
|
+
|
|
648
|
+
</dd>
|
|
649
|
+
</dl>
|
|
650
|
+
</details>
|
|
651
|
+
|
|
504
652
|
## Tools
|
|
505
653
|
|
|
506
654
|
<details><summary><code>client.tools.<a href="/src/api/resources/tools/client/Client.ts">list</a>({ ...params }) -> Phonic.ToolsListResponse</code></summary>
|