@fonoster/voice 0.2.20 → 0.2.24

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/server.js CHANGED
@@ -8,6 +8,7 @@ const logger_1 = __importDefault(require("@fonoster/logger"));
8
8
  const express_1 = __importDefault(require("express"));
9
9
  const path_1 = require("path");
10
10
  const fs_1 = __importDefault(require("fs"));
11
+ const os_1 = __importDefault(require("os"));
11
12
  const pubsub_js_1 = __importDefault(require("pubsub-js"));
12
13
  const merge = require("deepmerge");
13
14
  const app = (0, express_1.default)();
@@ -17,7 +18,7 @@ const defaultServerConfig = {
17
18
  base: "/",
18
19
  port: 3000,
19
20
  bind: "0.0.0.0",
20
- pathToFiles: "/tmp"
21
+ pathToFiles: os_1.default.tmpdir()
21
22
  };
22
23
  class VoiceServer {
23
24
  constructor(config = defaultServerConfig) {
package/dist/voice.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { GatherOptions } from "./gather/gather";
1
2
  import { MuteOptions } from "./mute/mute";
2
3
  import { PlayOptions } from "./play/play";
3
4
  import { RecordOptions, RecordResult } from "./record/record";
@@ -103,9 +104,7 @@ export default class VoiceResponse {
103
104
  * console.log("digits: " + digits);
104
105
  * }
105
106
  */
106
- gather(options: {
107
- source: "speech,dtmf";
108
- }): Promise<string>;
107
+ gather(options?: GatherOptions): Promise<string>;
109
108
  /**
110
109
  * Waits for data entry from the user's keypad or from a stream speech provider. This command is different from `gather`
111
110
  * in that it returns a stream of results instead of a single result. You can think of it as active listening.
package/dist/voice.js CHANGED
@@ -141,7 +141,7 @@ class VoiceResponse {
141
141
  * console.log("digits: " + digits);
142
142
  * }
143
143
  */
144
- async gather(options) {
144
+ async gather(options = { source: "speech,dtmf" }) {
145
145
  let asr = null;
146
146
  if (options.source.includes("speech")) {
147
147
  (0, asserts_1.assertPluginExist)(this, "asr");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fonoster/voice",
3
- "version": "0.2.20",
3
+ "version": "0.2.24",
4
4
  "description": "Voice verbs",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/fonoster#readme",
@@ -29,8 +29,8 @@
29
29
  "url": "https://github.com/fonoster/fonoster/issues"
30
30
  },
31
31
  "dependencies": {
32
- "@fonoster/common": "^0.2.20",
33
- "@fonoster/logger": "^0.2.20",
32
+ "@fonoster/common": "^0.2.24",
33
+ "@fonoster/logger": "^0.2.24",
34
34
  "axios": "^0.21.1",
35
35
  "deepmerge": "^4.2.2",
36
36
  "express": "^4.17.1",
@@ -39,7 +39,7 @@
39
39
  "pubsub-js": "^1.9.3",
40
40
  "sync": "^0.2.5"
41
41
  },
42
- "gitHead": "cfa2f99638592f1b2893134a9258d09a142f4aed",
42
+ "gitHead": "753040e40f01904b5f4c043574b0fafe9b234002",
43
43
  "devDependencies": {
44
44
  "@types/pubsub-js": "^1.8.2"
45
45
  }