phonic 0.30.30 → 0.30.32

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.
@@ -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.30",
55
- "User-Agent": "phonic/0.30.30",
54
+ "X-Fern-SDK-Version": "0.30.31",
55
+ "User-Agent": "phonic/0.30.31",
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) });
@@ -617,12 +617,17 @@ class Agents {
617
617
  __addCustomPhoneNumber(nameOrId, request, requestOptions) {
618
618
  return __awaiter(this, void 0, void 0, function* () {
619
619
  var _a, _b, _c, _d;
620
- const { project } = request, _body = __rest(request, ["project"]);
620
+ const { project, "X-Sip-Address": sipAddress, "X-Sip-Auth-Username": sipAuthUsername, "X-Sip-Auth-Password": sipAuthPassword } = request, _body = __rest(request, ["project", "X-Sip-Address", "X-Sip-Auth-Username", "X-Sip-Auth-Password"]);
621
621
  const _queryParams = {};
622
622
  if (project != null) {
623
623
  _queryParams["project"] = project;
624
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);
625
+ let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
626
+ Authorization: yield this._getAuthorizationHeader(),
627
+ "X-Sip-Address": sipAddress != null ? sipAddress : undefined,
628
+ "X-Sip-Auth-Username": sipAuthUsername != null ? sipAuthUsername : undefined,
629
+ "X-Sip-Auth-Password": sipAuthPassword != null ? sipAuthPassword : undefined,
630
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
626
631
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
627
632
  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
633
  .base, `agents/${encodeURIComponent(nameOrId)}/add-custom-phone-number`),
@@ -11,6 +11,12 @@
11
11
  export interface AgentsAddCustomPhoneNumberRequest {
12
12
  /** The name of the project containing the agent. Only used when `nameOrId` is a name. */
13
13
  project?: string;
14
+ /** SIP address of the user's SIP trunk. Optional, but if provided, all three SIP headers (X-Sip-Address, X-Sip-Auth-Username, X-Sip-Auth-Password) must be provided. When these headers are provided, call transfers from the agent will use the provided SIP details. */
15
+ "X-Sip-Address"?: string;
16
+ /** SIP auth username. Optional, but if provided, all three SIP headers (X-Sip-Address, X-Sip-Auth-Username, X-Sip-Auth-Password) must be provided. When these headers are provided, call transfers from the agent will use the provided SIP details. */
17
+ "X-Sip-Auth-Username"?: string;
18
+ /** SIP auth password. Optional, but if provided, all three SIP headers (X-Sip-Address, X-Sip-Auth-Username, X-Sip-Auth-Password) must be provided. When these headers are provided, call transfers from the agent will use the provided SIP details. */
19
+ "X-Sip-Auth-Password"?: string;
14
20
  /** The E.164 formatted phone number to add (e.g., "+15551234567"). */
15
21
  phone_number: string;
16
22
  }
@@ -42,7 +42,7 @@ export interface AgentsCreateRequest {
42
42
  project?: string;
43
43
  /** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
44
44
  name: string;
45
- phone_number: Phonic.CreateAgentRequest.PhoneNumber | null;
45
+ phone_number?: Phonic.CreateAgentRequest.PhoneNumber | null;
46
46
  /** The custom phone number to use for the agent in E.164 format (e.g., +1234567890). This field is deprecated. Use `custom_phone_numbers` instead. */
47
47
  custom_phone_number?: string | null;
48
48
  /** Array of custom phone numbers in E.164 format (e.g., ["+1234567890", "+0987654321"]). The agent will be able to receive phone calls on any of these numbers. Required when `phone_number` is set to `"custom"`. All phone numbers must be unique. */
@@ -42,7 +42,7 @@ export interface UpdateAgentRequest {
42
42
  project?: string;
43
43
  /** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
44
44
  name?: string;
45
- phone_number: UpdateAgentRequest.PhoneNumber | null;
45
+ phone_number?: UpdateAgentRequest.PhoneNumber | null;
46
46
  /** The custom phone number to use for the agent in E.164 format (e.g., +1234567890). This field is deprecated. Use `custom_phone_numbers` instead. */
47
47
  custom_phone_number?: string | null;
48
48
  /** Array of custom phone numbers in E.164 format (e.g., ["+1234567890", "+0987654321"]). The agent will be able to receive phone calls on any of these numbers. Required when `phone_number` is set to `"custom"`. All phone numbers must be unique. */
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.30.30";
1
+ export declare const SDK_VERSION = "0.30.31";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.30.30";
4
+ exports.SDK_VERSION = "0.30.31";
@@ -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.30",
19
- "User-Agent": "phonic/0.30.30",
18
+ "X-Fern-SDK-Version": "0.30.31",
19
+ "User-Agent": "phonic/0.30.31",
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) });
@@ -581,12 +581,17 @@ export class Agents {
581
581
  __addCustomPhoneNumber(nameOrId, request, requestOptions) {
582
582
  return __awaiter(this, void 0, void 0, function* () {
583
583
  var _a, _b, _c, _d;
584
- const { project } = request, _body = __rest(request, ["project"]);
584
+ const { project, "X-Sip-Address": sipAddress, "X-Sip-Auth-Username": sipAuthUsername, "X-Sip-Auth-Password": sipAuthPassword } = request, _body = __rest(request, ["project", "X-Sip-Address", "X-Sip-Auth-Username", "X-Sip-Auth-Password"]);
585
585
  const _queryParams = {};
586
586
  if (project != null) {
587
587
  _queryParams["project"] = project;
588
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);
589
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
590
+ Authorization: yield this._getAuthorizationHeader(),
591
+ "X-Sip-Address": sipAddress != null ? sipAddress : undefined,
592
+ "X-Sip-Auth-Username": sipAuthUsername != null ? sipAuthUsername : undefined,
593
+ "X-Sip-Auth-Password": sipAuthPassword != null ? sipAuthPassword : undefined,
594
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
590
595
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
591
596
  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
597
  .base, `agents/${encodeURIComponent(nameOrId)}/add-custom-phone-number`),
@@ -11,6 +11,12 @@
11
11
  export interface AgentsAddCustomPhoneNumberRequest {
12
12
  /** The name of the project containing the agent. Only used when `nameOrId` is a name. */
13
13
  project?: string;
14
+ /** SIP address of the user's SIP trunk. Optional, but if provided, all three SIP headers (X-Sip-Address, X-Sip-Auth-Username, X-Sip-Auth-Password) must be provided. When these headers are provided, call transfers from the agent will use the provided SIP details. */
15
+ "X-Sip-Address"?: string;
16
+ /** SIP auth username. Optional, but if provided, all three SIP headers (X-Sip-Address, X-Sip-Auth-Username, X-Sip-Auth-Password) must be provided. When these headers are provided, call transfers from the agent will use the provided SIP details. */
17
+ "X-Sip-Auth-Username"?: string;
18
+ /** SIP auth password. Optional, but if provided, all three SIP headers (X-Sip-Address, X-Sip-Auth-Username, X-Sip-Auth-Password) must be provided. When these headers are provided, call transfers from the agent will use the provided SIP details. */
19
+ "X-Sip-Auth-Password"?: string;
14
20
  /** The E.164 formatted phone number to add (e.g., "+15551234567"). */
15
21
  phone_number: string;
16
22
  }
@@ -42,7 +42,7 @@ export interface AgentsCreateRequest {
42
42
  project?: string;
43
43
  /** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
44
44
  name: string;
45
- phone_number: Phonic.CreateAgentRequest.PhoneNumber | null;
45
+ phone_number?: Phonic.CreateAgentRequest.PhoneNumber | null;
46
46
  /** The custom phone number to use for the agent in E.164 format (e.g., +1234567890). This field is deprecated. Use `custom_phone_numbers` instead. */
47
47
  custom_phone_number?: string | null;
48
48
  /** Array of custom phone numbers in E.164 format (e.g., ["+1234567890", "+0987654321"]). The agent will be able to receive phone calls on any of these numbers. Required when `phone_number` is set to `"custom"`. All phone numbers must be unique. */
@@ -42,7 +42,7 @@ export interface UpdateAgentRequest {
42
42
  project?: string;
43
43
  /** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
44
44
  name?: string;
45
- phone_number: UpdateAgentRequest.PhoneNumber | null;
45
+ phone_number?: UpdateAgentRequest.PhoneNumber | null;
46
46
  /** The custom phone number to use for the agent in E.164 format (e.g., +1234567890). This field is deprecated. Use `custom_phone_numbers` instead. */
47
47
  custom_phone_number?: string | null;
48
48
  /** Array of custom phone numbers in E.164 format (e.g., ["+1234567890", "+0987654321"]). The agent will be able to receive phone calls on any of these numbers. Required when `phone_number` is set to `"custom"`. All phone numbers must be unique. */
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.30.30";
1
+ export declare const SDK_VERSION = "0.30.31";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.30.30";
1
+ export const SDK_VERSION = "0.30.31";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phonic",
3
- "version": "0.30.30",
3
+ "version": "0.30.32",
4
4
  "private": false,
5
5
  "repository": "github:Phonic-Co/phonic-node",
6
6
  "type": "commonjs",