@fonoster/common 0.5.5 → 0.6.0

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.
Files changed (88) hide show
  1. package/README.md +3 -0
  2. package/dist/constants.d.ts +4 -0
  3. package/dist/constants.js +6 -0
  4. package/dist/errors.d.ts +8 -0
  5. package/dist/errors.js +95 -0
  6. package/dist/grpcStatusMap.d.ts +4 -0
  7. package/dist/{envs.js → grpcStatusMap.js} +8 -6
  8. package/dist/index.d.ts +7 -8
  9. package/dist/index.js +38 -14
  10. package/dist/notifications/compileTemplate.d.ts +6 -0
  11. package/dist/{env_is_set.js → notifications/compileTemplate.js} +12 -14
  12. package/dist/notifications/createEmailSender.d.ts +17 -0
  13. package/dist/notifications/createEmailSender.js +55 -0
  14. package/dist/notifications/index.d.ts +2 -0
  15. package/dist/notifications/index.js +36 -0
  16. package/dist/protos/acls.proto +119 -0
  17. package/dist/protos/agents.proto +155 -0
  18. package/dist/protos/applications.proto +154 -0
  19. package/dist/protos/calls.proto +162 -0
  20. package/dist/protos/credentials.proto +119 -0
  21. package/dist/protos/domains.proto +127 -0
  22. package/dist/protos/identity.proto +286 -0
  23. package/dist/protos/numbers.proto +155 -0
  24. package/dist/protos/secrets.proto +113 -0
  25. package/dist/protos/trunks.proto +164 -0
  26. package/dist/protos/voice.proto +421 -0
  27. package/dist/tts/AzureVoices.d.ts +523 -0
  28. package/dist/tts/AzureVoices.js +3622 -0
  29. package/dist/tts/GoogleVoices.d.ts +475 -0
  30. package/dist/tts/GoogleVoices.js +3284 -0
  31. package/dist/tts/index.d.ts +3 -0
  32. package/dist/tts/index.js +37 -0
  33. package/dist/tts/types.d.ts +164 -0
  34. package/dist/tts/types.js +186 -0
  35. package/dist/utils/assertEnvsAreSet.d.ts +7 -0
  36. package/dist/utils/assertEnvsAreSet.js +37 -0
  37. package/dist/utils/assertFileExists.d.ts +5 -0
  38. package/dist/utils/assertFileExists.js +38 -0
  39. package/dist/utils/createInterceptingCall.d.ts +7 -0
  40. package/dist/utils/createInterceptingCall.js +9 -0
  41. package/dist/utils/createService.d.ts +9 -0
  42. package/dist/{service_runner.js → utils/createService.js} +15 -40
  43. package/dist/utils/datesMapper.d.ts +9 -0
  44. package/dist/utils/datesMapper.js +8 -0
  45. package/dist/utils/getServerCredentials.d.ts +10 -0
  46. package/dist/{trust_util.js → utils/getServerCredentials.js} +33 -37
  47. package/dist/utils/index.d.ts +8 -0
  48. package/dist/utils/index.js +42 -0
  49. package/dist/utils/toCamelCase.d.ts +2 -0
  50. package/dist/utils/toCamelCase.js +27 -0
  51. package/dist/utils/toPascalCase.d.ts +2 -0
  52. package/dist/{speech/plugin.js → utils/toPascalCase.js} +9 -13
  53. package/dist/voice/Dial.d.ts +23 -0
  54. package/dist/voice/Dial.js +19 -0
  55. package/dist/voice/Gather.d.ts +18 -0
  56. package/dist/voice/Gather.js +9 -0
  57. package/dist/voice/Mute.d.ts +13 -0
  58. package/dist/voice/Mute.js +9 -0
  59. package/dist/voice/Play.d.ts +12 -0
  60. package/dist/voice/PlayDtmf.d.ts +5 -0
  61. package/dist/voice/PlaybackControl.d.ts +13 -0
  62. package/dist/voice/PlaybackControl.js +11 -0
  63. package/dist/voice/Record.d.ts +18 -0
  64. package/dist/voice/Record.js +7 -0
  65. package/dist/voice/Say.d.ts +15 -0
  66. package/dist/voice/Say.js +2 -0
  67. package/dist/voice/Stream.d.ts +41 -0
  68. package/dist/voice/Stream.js +39 -0
  69. package/dist/voice/Verb.d.ts +9 -0
  70. package/dist/{healthcheck.js → voice/Verb.js} +2 -5
  71. package/dist/voice/index.d.ts +11 -0
  72. package/dist/voice/index.js +45 -0
  73. package/dist/voice/voice.d.ts +101 -0
  74. package/dist/voice/voice.js +44 -0
  75. package/package.json +28 -25
  76. package/LICENSE +0 -21
  77. package/dist/api_client.d.ts +0 -27
  78. package/dist/api_client.js +0 -110
  79. package/dist/env_is_set.d.ts +0 -1
  80. package/dist/envs.d.ts +0 -4
  81. package/dist/healthcheck.d.ts +0 -2
  82. package/dist/service_runner.d.ts +0 -13
  83. package/dist/speech/plugin.d.ts +0 -6
  84. package/dist/speech/types.d.ts +0 -17
  85. package/dist/trust_util.d.ts +0 -4
  86. package/dist/types.d.ts +0 -6
  87. /package/dist/{speech/types.js → voice/Play.js} +0 -0
  88. /package/dist/{types.js → voice/PlayDtmf.js} +0 -0
@@ -22,13 +22,19 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
27
33
  };
28
34
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.getServerCredentials = exports.getClientCredentials = void 0;
35
+ exports.getServerCredentials = void 0;
30
36
  /*
31
- * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
37
+ * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
32
38
  * http://github.com/fonoster/fonoster
33
39
  *
34
40
  * This file is part of Fonoster
@@ -45,41 +51,31 @@ exports.getServerCredentials = exports.getClientCredentials = void 0;
45
51
  * See the License for the specific language governing permissions and
46
52
  * limitations under the License.
47
53
  */
48
- const grpc = __importStar(require("@grpc/grpc-js"));
49
- const os = __importStar(require("os"));
50
54
  const fs = __importStar(require("fs"));
51
55
  const logger_1 = require("@fonoster/logger");
52
- const path_1 = __importDefault(require("path"));
53
- const atob_1 = __importDefault(require("atob"));
54
- const envs_1 = require("./envs");
55
- const prepCert = (cert) => Buffer.from((0, atob_1.default)(cert), "utf-8");
56
+ const grpc = __importStar(require("@grpc/grpc-js"));
56
57
  const logger = (0, logger_1.getLogger)({ service: "common", filePath: __filename });
57
- let config = {};
58
- try {
59
- config = JSON.parse(fs
60
- .readFileSync(path_1.default.join(os.homedir(), ".fonoster", "config"))
61
- .toString("utf-8"));
62
- }
63
- catch (e) {
64
- logger.verbose("no config found at " + path_1.default.join(os.homedir(), ".fonoster", "config"));
65
- }
66
- const getServerCredentials = () => {
67
- try {
68
- return grpc.ServerCredentials.createSsl(prepCert(config.caCertificate), [
69
- {
70
- cert_chain: prepCert(config.serverCertificate),
71
- private_key: prepCert(config.serverKey)
72
- }
73
- ], true);
74
- }
75
- catch (e) {
76
- logger.info("unable to load security certificates");
77
- logger.info("starting server in insecure mode");
58
+ function getServerCredentials(config) {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ const { tlsOn, verifyClientCert, caCert, serverCert, serverKey } = config;
61
+ logger.verbose("get server credentials", {
62
+ tlsOn,
63
+ verifyClientCert,
64
+ caCert,
65
+ serverCert,
66
+ serverKey
67
+ });
68
+ if (tlsOn) {
69
+ // TODO: Assert that all the required fields are present
70
+ const cacert = verifyClientCert ? fs.readFileSync(caCert) : null;
71
+ return grpc.ServerCredentials.createSsl(cacert, [
72
+ {
73
+ private_key: yield fs.promises.readFile(serverKey),
74
+ cert_chain: yield fs.promises.readFile(serverCert)
75
+ }
76
+ ]);
77
+ }
78
78
  return grpc.ServerCredentials.createInsecure();
79
- }
80
- };
79
+ });
80
+ }
81
81
  exports.getServerCredentials = getServerCredentials;
82
- const getClientCredentials = () => envs_1.GRPC_ALLOW_INSECURE === "true"
83
- ? grpc.credentials.createInsecure()
84
- : grpc.credentials.createSsl();
85
- exports.getClientCredentials = getClientCredentials;
@@ -0,0 +1,8 @@
1
+ export * from "./assertEnvsAreSet";
2
+ export * from "./assertFileExists";
3
+ export * from "./createService";
4
+ export * from "./createInterceptingCall";
5
+ export * from "./datesMapper";
6
+ export * from "./getServerCredentials";
7
+ export * from "./toPascalCase";
8
+ export * from "./toCamelCase";
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /*
18
+ * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
19
+ * http://github.com/fonoster/fonoster
20
+ *
21
+ * This file is part of Fonoster
22
+ *
23
+ * Licensed under the MIT License (the "License");
24
+ * you may not use this file except in compliance with
25
+ * the License. You may obtain a copy of the License at
26
+ *
27
+ * https://opensource.org/licenses/MIT
28
+ *
29
+ * Unless required by applicable law or agreed to in writing, software
30
+ * distributed under the License is distributed on an "AS IS" BASIS,
31
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32
+ * See the License for the specific language governing permissions and
33
+ * limitations under the License.
34
+ */
35
+ __exportStar(require("./assertEnvsAreSet"), exports);
36
+ __exportStar(require("./assertFileExists"), exports);
37
+ __exportStar(require("./createService"), exports);
38
+ __exportStar(require("./createInterceptingCall"), exports);
39
+ __exportStar(require("./datesMapper"), exports);
40
+ __exportStar(require("./getServerCredentials"), exports);
41
+ __exportStar(require("./toPascalCase"), exports);
42
+ __exportStar(require("./toCamelCase"), exports);
@@ -0,0 +1,2 @@
1
+ declare function toCamelCase(str: string): string;
2
+ export { toCamelCase };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toCamelCase = void 0;
4
+ /*
5
+ * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
6
+ * http://github.com/fonoster/fonoster
7
+ *
8
+ * This file is part of Fonoster
9
+ *
10
+ * Licensed under the MIT License (the "License");
11
+ * you may not use this file except in compliance with
12
+ * the License. You may obtain a copy of the License at
13
+ *
14
+ * https://opensource.org/licenses/MIT
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ */
22
+ const toPascalCase_1 = require("./toPascalCase");
23
+ function toCamelCase(str) {
24
+ const pascalCase = (0, toPascalCase_1.toPascalCase)(str);
25
+ return pascalCase.charAt(0).toLowerCase() + pascalCase.slice(1);
26
+ }
27
+ exports.toCamelCase = toCamelCase;
@@ -0,0 +1,2 @@
1
+ declare function toPascalCase(str: string): string;
2
+ export { toPascalCase };
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Plugin = void 0;
3
+ exports.toPascalCase = void 0;
4
4
  /*
5
- * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
5
+ * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
6
6
  * http://github.com/fonoster/fonoster
7
7
  *
8
8
  * This file is part of Fonoster
@@ -19,15 +19,11 @@ exports.Plugin = void 0;
19
19
  * See the License for the specific language governing permissions and
20
20
  * limitations under the License.
21
21
  */
22
- class Plugin {
23
- type;
24
- name;
25
- constructor(type, name) {
26
- this.name = name;
27
- this.type = type;
28
- }
29
- getType() {
30
- return this.type;
31
- }
22
+ function toPascalCase(str) {
23
+ return str
24
+ .replace(/(?:^\w|[A-Z]|\b\w)/g, (word) => {
25
+ return word.toUpperCase();
26
+ })
27
+ .replace(/\s+/g, "");
32
28
  }
33
- exports.Plugin = Plugin;
29
+ exports.toPascalCase = toPascalCase;
@@ -0,0 +1,23 @@
1
+ import { VerbRequest } from "./Verb";
2
+ declare enum DialRecordDirection {
3
+ IN = "IN",
4
+ OUT = "OUT",
5
+ BOTH = "BOTH"
6
+ }
7
+ declare enum DialStatus {
8
+ TRYING = "TRYING",
9
+ CANCEL = "CANCEL",
10
+ ANSWER = "ANSWER",
11
+ BUSY = "BUSY",
12
+ PROGRESS = "PROGRESS",
13
+ NOANSWER = "NOANSWER",
14
+ FAILED = "FAILED"
15
+ }
16
+ type DialOptions = {
17
+ timeout?: number;
18
+ recordDirection?: DialRecordDirection;
19
+ };
20
+ type DialRequest = VerbRequest & DialOptions & {
21
+ destination: string;
22
+ };
23
+ export { DialRequest, DialOptions, DialStatus, DialRecordDirection };
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DialRecordDirection = exports.DialStatus = void 0;
4
+ var DialRecordDirection;
5
+ (function (DialRecordDirection) {
6
+ DialRecordDirection["IN"] = "IN";
7
+ DialRecordDirection["OUT"] = "OUT";
8
+ DialRecordDirection["BOTH"] = "BOTH";
9
+ })(DialRecordDirection || (exports.DialRecordDirection = DialRecordDirection = {}));
10
+ var DialStatus;
11
+ (function (DialStatus) {
12
+ DialStatus["TRYING"] = "TRYING";
13
+ DialStatus["CANCEL"] = "CANCEL";
14
+ DialStatus["ANSWER"] = "ANSWER";
15
+ DialStatus["BUSY"] = "BUSY";
16
+ DialStatus["PROGRESS"] = "PROGRESS";
17
+ DialStatus["NOANSWER"] = "NOANSWER";
18
+ DialStatus["FAILED"] = "FAILED";
19
+ })(DialStatus || (exports.DialStatus = DialStatus = {}));
@@ -0,0 +1,18 @@
1
+ import { VerbRequest, VerbResponse } from "./Verb";
2
+ declare enum GatherSource {
3
+ SPEECH = "speech",
4
+ DTMF = "dtmf",
5
+ SPEECH_AND_DTMF = "speech,dtmf"
6
+ }
7
+ type GatherOptions = {
8
+ finishOnKey?: string;
9
+ maxDigits?: number;
10
+ timeout?: number;
11
+ source?: GatherSource;
12
+ };
13
+ type GatherRequest = VerbRequest & GatherOptions;
14
+ type GatherResponse = VerbResponse & {
15
+ speech?: string;
16
+ digits?: string;
17
+ };
18
+ export { GatherOptions, GatherRequest, GatherResponse, GatherSource };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GatherSource = void 0;
4
+ var GatherSource;
5
+ (function (GatherSource) {
6
+ GatherSource["SPEECH"] = "speech";
7
+ GatherSource["DTMF"] = "dtmf";
8
+ GatherSource["SPEECH_AND_DTMF"] = "speech,dtmf";
9
+ })(GatherSource || (exports.GatherSource = GatherSource = {}));
@@ -0,0 +1,13 @@
1
+ import { VerbRequest } from "./Verb";
2
+ type MuteOptions = {
3
+ direction?: MuteDirection;
4
+ };
5
+ declare enum MuteDirection {
6
+ IN = "IN",
7
+ OUT = "OUT",
8
+ BOTH = "BOTH"
9
+ }
10
+ type MuteRequest = VerbRequest & {
11
+ direction: MuteDirection;
12
+ };
13
+ export { MuteOptions, MuteRequest, MuteDirection };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MuteDirection = void 0;
4
+ var MuteDirection;
5
+ (function (MuteDirection) {
6
+ MuteDirection["IN"] = "IN";
7
+ MuteDirection["OUT"] = "OUT";
8
+ MuteDirection["BOTH"] = "BOTH";
9
+ })(MuteDirection || (exports.MuteDirection = MuteDirection = {}));
@@ -0,0 +1,12 @@
1
+ import { VerbRequest } from "./Verb";
2
+ type PlayOptions = {
3
+ playbackRef?: string;
4
+ };
5
+ type PlayRequest = VerbRequest & {
6
+ url: string;
7
+ } & PlayOptions;
8
+ type PlayResponse = {
9
+ sessionRef: string;
10
+ playbackRef: string;
11
+ };
12
+ export { PlayRequest, PlayResponse, PlayOptions };
@@ -0,0 +1,5 @@
1
+ import { VerbRequest } from "./Verb";
2
+ type PlayDtmfRequest = VerbRequest & {
3
+ digits: string;
4
+ };
5
+ export { PlayDtmfRequest };
@@ -0,0 +1,13 @@
1
+ import { VerbRequest } from "./Verb";
2
+ declare enum PlaybackControlAction {
3
+ STOP = "stop",
4
+ RESTART = "restart",
5
+ PAUSE = "pause",
6
+ UNPAUSE = "unpause",
7
+ FORWARD = "forward"
8
+ }
9
+ type PlaybackControlRequest = VerbRequest & {
10
+ playbackRef: string;
11
+ action: PlaybackControlAction;
12
+ };
13
+ export { PlaybackControlRequest, PlaybackControlAction };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PlaybackControlAction = void 0;
4
+ var PlaybackControlAction;
5
+ (function (PlaybackControlAction) {
6
+ PlaybackControlAction["STOP"] = "stop";
7
+ PlaybackControlAction["RESTART"] = "restart";
8
+ PlaybackControlAction["PAUSE"] = "pause";
9
+ PlaybackControlAction["UNPAUSE"] = "unpause";
10
+ PlaybackControlAction["FORWARD"] = "forward";
11
+ })(PlaybackControlAction || (exports.PlaybackControlAction = PlaybackControlAction = {}));
@@ -0,0 +1,18 @@
1
+ import { VerbRequest } from "./Verb";
2
+ declare enum RecordFormat {
3
+ WAV = "wav"
4
+ }
5
+ type RecordOptions = {
6
+ maxDuration?: number;
7
+ maxSilence?: number;
8
+ beep?: boolean;
9
+ finishOnKey?: string;
10
+ };
11
+ type RecordRequest = VerbRequest & RecordOptions;
12
+ type RecordResponse = {
13
+ sessionRef: string;
14
+ name: string;
15
+ duration: number;
16
+ format: RecordFormat;
17
+ };
18
+ export { RecordOptions, RecordRequest, RecordResponse, RecordFormat };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RecordFormat = void 0;
4
+ var RecordFormat;
5
+ (function (RecordFormat) {
6
+ RecordFormat["WAV"] = "wav";
7
+ })(RecordFormat || (exports.RecordFormat = RecordFormat = {}));
@@ -0,0 +1,15 @@
1
+ import { Struct } from "pb-util";
2
+ import { VerbRequest } from "./Verb";
3
+ type SayRequest = VerbRequest & {
4
+ text: string;
5
+ playbackRef?: string;
6
+ options?: Struct;
7
+ };
8
+ type SayResponse = {
9
+ playbackRef: string;
10
+ };
11
+ type SayOptions = {
12
+ playbackRef?: string;
13
+ [key: string]: any;
14
+ };
15
+ export { SayRequest, SayResponse, SayOptions };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,41 @@
1
+ /// <reference types="node" />
2
+ import { VerbRequest, VerbResponse } from "./Verb";
3
+ declare enum StreamDirection {
4
+ IN = "IN",
5
+ OUT = "OUT",
6
+ BOTH = "BOTH"
7
+ }
8
+ declare enum StreamAudioFormat {
9
+ WAV = "WAV"
10
+ }
11
+ declare enum StreamMessageType {
12
+ AUDIO_IN = "AUDIO_IN",
13
+ AUDIO_OUT = "AUDIO_OUT",
14
+ ERROR = "ERROR",
15
+ VOICE_ACTIVITY_START = "VOICE_ACTIVITY_START",
16
+ VOICE_ACTIVITY_STOP = "VOICE_ACTIVITY_STOP"
17
+ }
18
+ type StreamOptions = {
19
+ direction: StreamDirection;
20
+ format: StreamAudioFormat;
21
+ enableVad: boolean;
22
+ };
23
+ type StartStreamRequest = VerbRequest & StreamOptions;
24
+ type StartStreamResponse = VerbResponse & {
25
+ streamRef: string;
26
+ };
27
+ type StopStreamRequest = VerbRequest & {
28
+ streamRef: string;
29
+ };
30
+ type StreamPayload = {
31
+ sessionRef: string;
32
+ streamRef: string;
33
+ direction: StreamDirection;
34
+ format: StreamAudioFormat;
35
+ type: StreamMessageType;
36
+ enableVad?: boolean;
37
+ data?: Buffer;
38
+ code?: string;
39
+ message?: string;
40
+ };
41
+ export { StreamDirection, StreamAudioFormat, StreamMessageType, StreamOptions, StartStreamRequest, StartStreamResponse, StopStreamRequest, StreamPayload };
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StreamMessageType = exports.StreamAudioFormat = exports.StreamDirection = void 0;
4
+ /*
5
+ * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
6
+ * http://github.com/fonoster/fonoster
7
+ *
8
+ * This file is part of Fonoster
9
+ *
10
+ * Licensed under the MIT License (the "License");
11
+ * you may not use this file except in compliance with
12
+ * the License. You may obtain a copy of the License at
13
+ *
14
+ * https://opensource.org/licenses/MIT
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ */
22
+ var StreamDirection;
23
+ (function (StreamDirection) {
24
+ StreamDirection["IN"] = "IN";
25
+ StreamDirection["OUT"] = "OUT";
26
+ StreamDirection["BOTH"] = "BOTH";
27
+ })(StreamDirection || (exports.StreamDirection = StreamDirection = {}));
28
+ var StreamAudioFormat;
29
+ (function (StreamAudioFormat) {
30
+ StreamAudioFormat["WAV"] = "WAV";
31
+ })(StreamAudioFormat || (exports.StreamAudioFormat = StreamAudioFormat = {}));
32
+ var StreamMessageType;
33
+ (function (StreamMessageType) {
34
+ StreamMessageType["AUDIO_IN"] = "AUDIO_IN";
35
+ StreamMessageType["AUDIO_OUT"] = "AUDIO_OUT";
36
+ StreamMessageType["ERROR"] = "ERROR";
37
+ StreamMessageType["VOICE_ACTIVITY_START"] = "VOICE_ACTIVITY_START";
38
+ StreamMessageType["VOICE_ACTIVITY_STOP"] = "VOICE_ACTIVITY_STOP";
39
+ })(StreamMessageType || (exports.StreamMessageType = StreamMessageType = {}));
@@ -0,0 +1,9 @@
1
+ import { VoiceClientConfig } from "./voice";
2
+ type VoiceRequest = VoiceClientConfig;
3
+ type VerbRequest = {
4
+ sessionRef: string;
5
+ };
6
+ type VerbResponse = {
7
+ sessionRef: string;
8
+ };
9
+ export { VerbRequest, VerbResponse, VoiceRequest };
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
2
  /*
4
- * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
3
+ * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
5
4
  * http://github.com/fonoster/fonoster
6
5
  *
7
6
  * This file is part of Fonoster
@@ -18,6 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
17
  * See the License for the specific language governing permissions and
19
18
  * limitations under the License.
20
19
  */
21
- /* eslint-disable require-jsdoc */
22
- const grpc_health_check_1 = require("@fonoster/grpc-health-check");
23
- exports.default = async () => (0, grpc_health_check_1.checker)("", `localhost:50052`);
20
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ export * from "./voice";
2
+ export * from "./Dial";
3
+ export * from "./Gather";
4
+ export * from "./Verb";
5
+ export * from "./Mute";
6
+ export * from "./Play";
7
+ export * from "./PlaybackControl";
8
+ export * from "./PlayDtmf";
9
+ export * from "./Record";
10
+ export * from "./Say";
11
+ export * from "./Stream";
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /*
18
+ * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
19
+ * http://github.com/fonoster/fonoster
20
+ *
21
+ * This file is part of Fonoster
22
+ *
23
+ * Licensed under the MIT License (the "License");
24
+ * you may not use this file except in compliance with
25
+ * the License. You may obtain a copy of the License at
26
+ *
27
+ * https://opensource.org/licenses/MIT
28
+ *
29
+ * Unless required by applicable law or agreed to in writing, software
30
+ * distributed under the License is distributed on an "AS IS" BASIS,
31
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32
+ * See the License for the specific language governing permissions and
33
+ * limitations under the License.
34
+ */
35
+ __exportStar(require("./voice"), exports);
36
+ __exportStar(require("./Dial"), exports);
37
+ __exportStar(require("./Gather"), exports);
38
+ __exportStar(require("./Verb"), exports);
39
+ __exportStar(require("./Mute"), exports);
40
+ __exportStar(require("./Play"), exports);
41
+ __exportStar(require("./PlaybackControl"), exports);
42
+ __exportStar(require("./PlayDtmf"), exports);
43
+ __exportStar(require("./Record"), exports);
44
+ __exportStar(require("./Say"), exports);
45
+ __exportStar(require("./Stream"), exports);