hume 0.11.3 → 0.11.4
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/api/resources/empathicVoice/resources/chat/client/Client.d.ts +1 -0
- package/api/resources/empathicVoice/resources/chat/client/Client.js +12 -4
- package/dist/api/resources/empathicVoice/resources/chat/client/Client.d.ts +1 -0
- package/dist/api/resources/empathicVoice/resources/chat/client/Client.js +12 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import * as environments from "../../../../../../environments";
|
|
3
3
|
import * as core from "../../../../../../core";
|
|
4
4
|
import { ChatSocket } from "./Socket";
|
|
5
|
+
export declare function createHostnameWithProtocol(environment: string): string;
|
|
5
6
|
export declare namespace Chat {
|
|
6
7
|
interface Options {
|
|
7
8
|
environment?: core.Supplier<environments.HumeEnvironment | string>;
|
|
@@ -37,12 +37,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.Chat = void 0;
|
|
40
|
+
exports.createHostnameWithProtocol = createHostnameWithProtocol;
|
|
40
41
|
/** THIS FILE IS MANUALLY MAINAINED: see .fernignore */
|
|
41
42
|
const environments = __importStar(require("../../../../../../environments"));
|
|
42
43
|
const core = __importStar(require("../../../../../../core"));
|
|
43
44
|
const qs_1 = __importDefault(require("qs"));
|
|
44
45
|
const Socket_1 = require("./Socket");
|
|
45
46
|
const version_1 = require("../../../../../../version");
|
|
47
|
+
function createHostnameWithProtocol(environment) {
|
|
48
|
+
const protocol = /(https|http|wss|ws):\/\//.exec(environment);
|
|
49
|
+
if (protocol) {
|
|
50
|
+
return environment.replace("https://", "wss://").replace("http://", "ws://");
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
return `wss://${environment}`;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
46
56
|
class Chat {
|
|
47
57
|
constructor(_options) {
|
|
48
58
|
this._options = _options;
|
|
@@ -77,10 +87,8 @@ class Chat {
|
|
|
77
87
|
queryParams[name] = value;
|
|
78
88
|
}
|
|
79
89
|
}
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
.replace("http://", "ws://");
|
|
83
|
-
const socket = new core.ReconnectingWebSocket(`${environ}/v0/evi/chat?${qs_1.default.stringify(queryParams)}`, [], {
|
|
90
|
+
const hostname = createHostnameWithProtocol((_a = core.Supplier.get(this._options.environment)) !== null && _a !== void 0 ? _a : environments.HumeEnvironment.Production);
|
|
91
|
+
const socket = new core.ReconnectingWebSocket(`${hostname}/v0/evi/chat?${qs_1.default.stringify(queryParams)}`, [], {
|
|
84
92
|
debug: (_b = args.debug) !== null && _b !== void 0 ? _b : false,
|
|
85
93
|
maxRetries: (_c = args.reconnectAttempts) !== null && _c !== void 0 ? _c : 30,
|
|
86
94
|
});
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import * as environments from "../../../../../../environments";
|
|
3
3
|
import * as core from "../../../../../../core";
|
|
4
4
|
import { ChatSocket } from "./Socket";
|
|
5
|
+
export declare function createHostnameWithProtocol(environment: string): string;
|
|
5
6
|
export declare namespace Chat {
|
|
6
7
|
interface Options {
|
|
7
8
|
environment?: core.Supplier<environments.HumeEnvironment | string>;
|
|
@@ -37,12 +37,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.Chat = void 0;
|
|
40
|
+
exports.createHostnameWithProtocol = createHostnameWithProtocol;
|
|
40
41
|
/** THIS FILE IS MANUALLY MAINAINED: see .fernignore */
|
|
41
42
|
const environments = __importStar(require("../../../../../../environments"));
|
|
42
43
|
const core = __importStar(require("../../../../../../core"));
|
|
43
44
|
const qs_1 = __importDefault(require("qs"));
|
|
44
45
|
const Socket_1 = require("./Socket");
|
|
45
46
|
const version_1 = require("../../../../../../version");
|
|
47
|
+
function createHostnameWithProtocol(environment) {
|
|
48
|
+
const protocol = /(https|http|wss|ws):\/\//.exec(environment);
|
|
49
|
+
if (protocol) {
|
|
50
|
+
return environment.replace("https://", "wss://").replace("http://", "ws://");
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
return `wss://${environment}`;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
46
56
|
class Chat {
|
|
47
57
|
constructor(_options) {
|
|
48
58
|
this._options = _options;
|
|
@@ -77,10 +87,8 @@ class Chat {
|
|
|
77
87
|
queryParams[name] = value;
|
|
78
88
|
}
|
|
79
89
|
}
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
.replace("http://", "ws://");
|
|
83
|
-
const socket = new core.ReconnectingWebSocket(`${environ}/v0/evi/chat?${qs_1.default.stringify(queryParams)}`, [], {
|
|
90
|
+
const hostname = createHostnameWithProtocol((_a = core.Supplier.get(this._options.environment)) !== null && _a !== void 0 ? _a : environments.HumeEnvironment.Production);
|
|
91
|
+
const socket = new core.ReconnectingWebSocket(`${hostname}/v0/evi/chat?${qs_1.default.stringify(queryParams)}`, [], {
|
|
84
92
|
debug: (_b = args.debug) !== null && _b !== void 0 ? _b : false,
|
|
85
93
|
maxRetries: (_c = args.reconnectAttempts) !== null && _c !== void 0 ? _c : 30,
|
|
86
94
|
});
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.11.
|
|
1
|
+
export declare const SDK_VERSION = "0.11.4";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
package/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.11.
|
|
1
|
+
export declare const SDK_VERSION = "0.11.4";
|
package/version.js
CHANGED