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.
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/conversations/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/conversations/client/Client.js +2 -5
- package/dist/cjs/api/types/overrides.d.ts +27 -0
- 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/conversations/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/conversations/client/Client.mjs +2 -5
- package/dist/esm/api/types/overrides.d.mts +27 -0
- 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.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
|
|
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(
|
|
862
|
-
return __awaiter(this,
|
|
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 {};
|
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.0-rc3";
|
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.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
|
|
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(
|
|
826
|
-
return __awaiter(this,
|
|
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 {};
|
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.0-rc3";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.30.
|
|
1
|
+
export const SDK_VERSION = "0.30.0-rc3";
|