phonic 0.30.0-rc2 → 0.30.0-rc3

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.
@@ -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.0rc1",
54
- "User-Agent": "phonic/0.30.0rc1",
53
+ "X-Fern-SDK-Version": "0.30.0-rc3",
54
+ "User-Agent": "phonic/0.30.0-rc3",
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) });
@@ -29,7 +29,6 @@ export declare namespace Conversations {
29
29
  }
30
30
  interface ConnectArgs {
31
31
  downstream_websocket_url?: string | undefined;
32
- Authorization: string;
33
32
  /** Arbitrary headers to send with the websocket connect request. */
34
33
  headers?: Record<string, string>;
35
34
  /** Enable debug mode on the websocket. Defaults to false. */
@@ -232,6 +231,6 @@ export declare class Conversations {
232
231
  */
233
232
  sipOutboundCall(request: Phonic.ConversationsSipOutboundCallRequest, requestOptions?: Conversations.RequestOptions): core.HttpResponsePromise<Phonic.ConversationsSipOutboundCallResponse>;
234
233
  private __sipOutboundCall;
235
- connect(args: Conversations.ConnectArgs): Promise<ConversationsSocket>;
234
+ connect(args?: Conversations.ConnectArgs): Promise<ConversationsSocket>;
236
235
  protected _getAuthorizationHeader(): Promise<string>;
237
236
  }
@@ -858,8 +858,8 @@ class Conversations {
858
858
  }
859
859
  });
860
860
  }
861
- connect(args) {
862
- return __awaiter(this, void 0, void 0, function* () {
861
+ connect() {
862
+ return __awaiter(this, arguments, void 0, function* (args = {}) {
863
863
  var _a, _b;
864
864
  const { downstream_websocket_url, headers, debug, reconnectAttempts } = args;
865
865
  const _queryParams = {};
@@ -867,9 +867,6 @@ class Conversations {
867
867
  _queryParams["downstream_websocket_url"] = downstream_websocket_url;
868
868
  }
869
869
  let _headers = Object.assign({}, headers);
870
- if (args["Authorization"] != null) {
871
- _headers["Authorization"] = args["Authorization"];
872
- }
873
870
  const socket = new core.ReconnectingWebSocket({
874
871
  url: core.url.join((_a = (yield core.Supplier.get(this._options["baseUrl"]))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options["environment"]))) !== null && _b !== void 0 ? _b : environments.PhonicEnvironment.Default)
875
872
  .production, "/v1/sts/ws"),
@@ -1,4 +1,6 @@
1
+ import type { Conversation } from "./Conversation";
1
2
  type PhonicTool = "send_dtmf_tone" | "end_conversation" | (string & {});
3
+ type ISODateTime = `${string}Z`;
2
4
  export type PhonicConfigurationEndpointRequestPayload = {
3
5
  project: {
4
6
  name: string;
@@ -20,4 +22,29 @@ export type PhonicConfigurationEndpointResponsePayload = {
20
22
  tools?: Array<PhonicTool>;
21
23
  boosted_keywords?: string[];
22
24
  };
25
+ export type ConversationEndedWebhookPayload = {
26
+ event_type: "conversation.ended";
27
+ created_at: ISODateTime;
28
+ data: {
29
+ conversation: Conversation;
30
+ call_info: {
31
+ from_phone_number: string;
32
+ to_phone_number: string;
33
+ } | null;
34
+ };
35
+ };
36
+ export type ConversationAnalysisWebhookPayload = {
37
+ event_type: "conversation.analysis";
38
+ created_at: ISODateTime;
39
+ data: {
40
+ conversation: {
41
+ latencies_ms: number[];
42
+ interruptions_count: number;
43
+ };
44
+ call_info: {
45
+ from_phone_number: string;
46
+ to_phone_number: string;
47
+ } | null;
48
+ };
49
+ };
23
50
  export {};
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.30.0rc1";
1
+ export declare const SDK_VERSION = "0.30.0-rc3";
@@ -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.0rc1";
4
+ exports.SDK_VERSION = "0.30.0-rc3";
@@ -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.0rc1",
18
- "User-Agent": "phonic/0.30.0rc1",
17
+ "X-Fern-SDK-Version": "0.30.0-rc3",
18
+ "User-Agent": "phonic/0.30.0-rc3",
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) });
@@ -29,7 +29,6 @@ export declare namespace Conversations {
29
29
  }
30
30
  interface ConnectArgs {
31
31
  downstream_websocket_url?: string | undefined;
32
- Authorization: string;
33
32
  /** Arbitrary headers to send with the websocket connect request. */
34
33
  headers?: Record<string, string>;
35
34
  /** Enable debug mode on the websocket. Defaults to false. */
@@ -232,6 +231,6 @@ export declare class Conversations {
232
231
  */
233
232
  sipOutboundCall(request: Phonic.ConversationsSipOutboundCallRequest, requestOptions?: Conversations.RequestOptions): core.HttpResponsePromise<Phonic.ConversationsSipOutboundCallResponse>;
234
233
  private __sipOutboundCall;
235
- connect(args: Conversations.ConnectArgs): Promise<ConversationsSocket>;
234
+ connect(args?: Conversations.ConnectArgs): Promise<ConversationsSocket>;
236
235
  protected _getAuthorizationHeader(): Promise<string>;
237
236
  }
@@ -822,8 +822,8 @@ export class Conversations {
822
822
  }
823
823
  });
824
824
  }
825
- connect(args) {
826
- return __awaiter(this, void 0, void 0, function* () {
825
+ connect() {
826
+ return __awaiter(this, arguments, void 0, function* (args = {}) {
827
827
  var _a, _b;
828
828
  const { downstream_websocket_url, headers, debug, reconnectAttempts } = args;
829
829
  const _queryParams = {};
@@ -831,9 +831,6 @@ export class Conversations {
831
831
  _queryParams["downstream_websocket_url"] = downstream_websocket_url;
832
832
  }
833
833
  let _headers = Object.assign({}, headers);
834
- if (args["Authorization"] != null) {
835
- _headers["Authorization"] = args["Authorization"];
836
- }
837
834
  const socket = new core.ReconnectingWebSocket({
838
835
  url: core.url.join((_a = (yield core.Supplier.get(this._options["baseUrl"]))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options["environment"]))) !== null && _b !== void 0 ? _b : environments.PhonicEnvironment.Default)
839
836
  .production, "/v1/sts/ws"),
@@ -1,4 +1,6 @@
1
+ import type { Conversation } from "./Conversation";
1
2
  type PhonicTool = "send_dtmf_tone" | "end_conversation" | (string & {});
3
+ type ISODateTime = `${string}Z`;
2
4
  export type PhonicConfigurationEndpointRequestPayload = {
3
5
  project: {
4
6
  name: string;
@@ -20,4 +22,29 @@ export type PhonicConfigurationEndpointResponsePayload = {
20
22
  tools?: Array<PhonicTool>;
21
23
  boosted_keywords?: string[];
22
24
  };
25
+ export type ConversationEndedWebhookPayload = {
26
+ event_type: "conversation.ended";
27
+ created_at: ISODateTime;
28
+ data: {
29
+ conversation: Conversation;
30
+ call_info: {
31
+ from_phone_number: string;
32
+ to_phone_number: string;
33
+ } | null;
34
+ };
35
+ };
36
+ export type ConversationAnalysisWebhookPayload = {
37
+ event_type: "conversation.analysis";
38
+ created_at: ISODateTime;
39
+ data: {
40
+ conversation: {
41
+ latencies_ms: number[];
42
+ interruptions_count: number;
43
+ };
44
+ call_info: {
45
+ from_phone_number: string;
46
+ to_phone_number: string;
47
+ } | null;
48
+ };
49
+ };
23
50
  export {};
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.30.0rc1";
1
+ export declare const SDK_VERSION = "0.30.0-rc3";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.30.0rc1";
1
+ export const SDK_VERSION = "0.30.0-rc3";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phonic",
3
- "version": "0.30.0-rc2",
3
+ "version": "0.30.0-rc3",
4
4
  "private": false,
5
5
  "repository": "github:fern-demo/phonic-ts-sdk",
6
6
  "type": "commonjs",