@fonoster/voice 0.27.0 → 0.31.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.
- package/README.md +32 -419
- package/dist/Session.d.ts +161 -0
- package/dist/Session.js +576 -0
- package/dist/VoiceServer.d.ts +70 -5
- package/dist/VoiceServer.js +149 -43
- package/dist/{verbs/Dial.d.ts → errors.d.ts} +9 -13
- package/dist/{verbs/Answer.js → errors.js} +18 -7
- package/dist/index.d.ts +4 -6
- package/dist/index.js +4 -15
- package/dist/signature.d.ts +31 -0
- package/dist/signature.js +93 -0
- package/dist/types.d.ts +88 -10
- package/dist/types.js +0 -21
- package/package.json +13 -19
- package/session.d.ts +1 -0
- package/session.js +2 -0
- package/dist/VoiceResponse.d.ts +0 -304
- package/dist/VoiceResponse.js +0 -461
- package/dist/createSession.d.ts +0 -22
- package/dist/createSession.js +0 -66
- package/dist/defaultServerConfig.d.ts +0 -21
- package/dist/defaultServerConfig.js +0 -10
- package/dist/demo.d.ts +0 -1
- package/dist/demo.js +0 -83
- package/dist/filters.d.ts +0 -44
- package/dist/filters.js +0 -17
- package/dist/serviceDefinition.d.ts +0 -2
- package/dist/serviceDefinition.js +0 -29
- package/dist/verbs/Answer.d.ts +0 -24
- package/dist/verbs/Dial.js +0 -60
- package/dist/verbs/Gather.d.ts +0 -25
- package/dist/verbs/Gather.js +0 -57
- package/dist/verbs/Hangup.d.ts +0 -24
- package/dist/verbs/Hangup.js +0 -29
- package/dist/verbs/Mute.d.ts +0 -25
- package/dist/verbs/Mute.js +0 -36
- package/dist/verbs/Play.d.ts +0 -25
- package/dist/verbs/Play.js +0 -33
- package/dist/verbs/PlayDtmf.d.ts +0 -25
- package/dist/verbs/PlayDtmf.js +0 -32
- package/dist/verbs/PlaybackControl.d.ts +0 -25
- package/dist/verbs/PlaybackControl.js +0 -35
- package/dist/verbs/Record.d.ts +0 -25
- package/dist/verbs/Record.js +0 -49
- package/dist/verbs/Say.d.ts +0 -25
- package/dist/verbs/Say.js +0 -33
- package/dist/verbs/SetAudioFilters.d.ts +0 -25
- package/dist/verbs/SetAudioFilters.js +0 -16
- package/dist/verbs/StopSay.d.ts +0 -25
- package/dist/verbs/StopSay.js +0 -11
- package/dist/verbs/Stream.d.ts +0 -39
- package/dist/verbs/Stream.js +0 -80
- package/dist/verbs/StreamGather.d.ts +0 -37
- package/dist/verbs/StreamGather.js +0 -66
- package/dist/verbs/Unmute.d.ts +0 -22
- package/dist/verbs/Unmute.js +0 -26
- package/dist/verbs/Verb.d.ts +0 -28
- package/dist/verbs/Verb.js +0 -103
- package/dist/verbs/getExpectedContent.d.ts +0 -2
- package/dist/verbs/getExpectedContent.js +0 -32
- package/dist/verbs/index.d.ts +0 -35
- package/dist/verbs/index.js +0 -51
- package/dist/verbs/validateRequest.d.ts +0 -20
- package/dist/verbs/validateRequest.js +0 -13
package/dist/filters.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
-
* http://github.com/fonoster/fonoster
|
|
4
|
-
*
|
|
5
|
-
* This file is part of Fonoster
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the MIT License (the "License");
|
|
8
|
-
* you may not use this file except in compliance with
|
|
9
|
-
* the License. You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* https://opensource.org/licenses/MIT
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
import { AudioFilterConfig } from "@fonoster/common";
|
|
20
|
-
/**
|
|
21
|
-
* Options for the ai-coustics filter. Tuning only: the license key is read
|
|
22
|
-
* from the Media Server's environment and never travels with the session.
|
|
23
|
-
*/
|
|
24
|
-
type AiCousticsOptions = {
|
|
25
|
-
/** Model to load. Defaults to Quail Voice Focus at 16 kHz. */
|
|
26
|
-
model?: string;
|
|
27
|
-
/** 0 to 1. Higher values also suppress competing speech. Defaults to 1. */
|
|
28
|
-
enhancementLevel?: number;
|
|
29
|
-
/** Keeps the processing delay but stops enhancing. Useful for A/B tests. */
|
|
30
|
-
bypass?: boolean;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* ai-coustics speech enhancement: keeps the primary speaker and suppresses
|
|
34
|
-
* noise and competing voices.
|
|
35
|
-
*
|
|
36
|
-
* @param {AiCousticsOptions} options - Tuning options for the filter
|
|
37
|
-
* @return {AudioFilterConfig} A filter to pass to `setAudioFilters`
|
|
38
|
-
* @example
|
|
39
|
-
*
|
|
40
|
-
* await voice.setAudioFilters([aiCoustics({ enhancementLevel: 0.8 })]);
|
|
41
|
-
* await voice.answer();
|
|
42
|
-
*/
|
|
43
|
-
declare function aiCoustics(options?: AiCousticsOptions): AudioFilterConfig;
|
|
44
|
-
export { aiCoustics, AiCousticsOptions };
|
package/dist/filters.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.aiCoustics = aiCoustics;
|
|
4
|
-
/**
|
|
5
|
-
* ai-coustics speech enhancement: keeps the primary speaker and suppresses
|
|
6
|
-
* noise and competing voices.
|
|
7
|
-
*
|
|
8
|
-
* @param {AiCousticsOptions} options - Tuning options for the filter
|
|
9
|
-
* @return {AudioFilterConfig} A filter to pass to `setAudioFilters`
|
|
10
|
-
* @example
|
|
11
|
-
*
|
|
12
|
-
* await voice.setAudioFilters([aiCoustics({ enhancementLevel: 0.8 })]);
|
|
13
|
-
* await voice.answer();
|
|
14
|
-
*/
|
|
15
|
-
function aiCoustics(options = {}) {
|
|
16
|
-
return { name: "aiCoustics", options };
|
|
17
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.serviceDefinition = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Copyright (C) 2025 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 common_1 = require("@fonoster/common");
|
|
23
|
-
const serviceDefinition = (0, common_1.createServiceDefinition)({
|
|
24
|
-
serviceName: "Voice",
|
|
25
|
-
pckg: "voice",
|
|
26
|
-
proto: "voice.proto",
|
|
27
|
-
version: "v1beta2"
|
|
28
|
-
});
|
|
29
|
-
exports.serviceDefinition = serviceDefinition;
|
package/dist/verbs/Answer.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
-
* http://github.com/fonoster/fonoster
|
|
4
|
-
*
|
|
5
|
-
* This file is part of Fonoster
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the MIT License (the "License");
|
|
8
|
-
* you may not use this file except in compliance with
|
|
9
|
-
* the License. You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* https://opensource.org/licenses/MIT
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
import { z } from "zod";
|
|
20
|
-
import { Verb } from "./Verb";
|
|
21
|
-
declare class Answer extends Verb {
|
|
22
|
-
getValidationSchema(): z.Schema;
|
|
23
|
-
}
|
|
24
|
-
export { Answer };
|
package/dist/verbs/Dial.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DialStatusStream = exports.Dial = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Copyright (C) 2025 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 stream_1 = require("stream");
|
|
23
|
-
const common_1 = require("@fonoster/common");
|
|
24
|
-
const zod_1 = require("zod");
|
|
25
|
-
const Verb_1 = require("./Verb");
|
|
26
|
-
class Dial extends Verb_1.Verb {
|
|
27
|
-
getValidationSchema() {
|
|
28
|
-
return zod_1.z.object({
|
|
29
|
-
destination: zod_1.z.string(),
|
|
30
|
-
timeout: zod_1.z
|
|
31
|
-
.number()
|
|
32
|
-
.int({ message: common_1.Messages.POSITIVE_INTEGER_MESSAGE })
|
|
33
|
-
.positive({ message: common_1.Messages.POSITIVE_INTEGER_MESSAGE })
|
|
34
|
-
.optional(),
|
|
35
|
-
recordDirection: zod_1.z
|
|
36
|
-
.nativeEnum(common_1.DialRecordDirection, {
|
|
37
|
-
message: "Invalid record direction."
|
|
38
|
-
})
|
|
39
|
-
.optional()
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.Dial = Dial;
|
|
44
|
-
class DialStatusStream {
|
|
45
|
-
constructor() {
|
|
46
|
-
this.stream = new stream_1.Stream();
|
|
47
|
-
}
|
|
48
|
-
close() {
|
|
49
|
-
this.stream.removeAllListeners();
|
|
50
|
-
}
|
|
51
|
-
on(callback) {
|
|
52
|
-
this.stream.on("status", (data) => {
|
|
53
|
-
callback(data);
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
emit(status) {
|
|
57
|
-
this.stream.emit("status", status);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
exports.DialStatusStream = DialStatusStream;
|
package/dist/verbs/Gather.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
-
* http://github.com/fonoster/fonoster
|
|
4
|
-
*
|
|
5
|
-
* This file is part of Fonoster
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the MIT License (the "License");
|
|
8
|
-
* you may not use this file except in compliance with
|
|
9
|
-
* the License. You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* https://opensource.org/licenses/MIT
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
import { GatherRequest } from "@fonoster/common";
|
|
20
|
-
import { z } from "zod";
|
|
21
|
-
import { Verb } from "./Verb";
|
|
22
|
-
declare class Gather extends Verb<GatherRequest> {
|
|
23
|
-
getValidationSchema(): z.Schema;
|
|
24
|
-
}
|
|
25
|
-
export { Gather };
|
package/dist/verbs/Gather.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Gather = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Copyright (C) 2025 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 common_1 = require("@fonoster/common");
|
|
23
|
-
const zod_1 = require("zod");
|
|
24
|
-
const Verb_1 = require("./Verb");
|
|
25
|
-
class Gather extends Verb_1.Verb {
|
|
26
|
-
getValidationSchema() {
|
|
27
|
-
return zod_1.z.object({
|
|
28
|
-
source: zod_1.z
|
|
29
|
-
.nativeEnum(common_1.GatherSource, {
|
|
30
|
-
message: "Invalid gather source."
|
|
31
|
-
})
|
|
32
|
-
.optional(),
|
|
33
|
-
finishOnKey: zod_1.z
|
|
34
|
-
.string()
|
|
35
|
-
.regex(/^[0-9*#]+$/, { message: common_1.Messages.VALID_DTMF })
|
|
36
|
-
.length(1, { message: common_1.Messages.MUST_BE_A_SINGLE_CHARACTER })
|
|
37
|
-
.optional(),
|
|
38
|
-
timeout: zod_1.z
|
|
39
|
-
.number()
|
|
40
|
-
.int({ message: common_1.Messages.POSITIVE_INTEGER_MESSAGE })
|
|
41
|
-
.positive({ message: common_1.Messages.POSITIVE_INTEGER_MESSAGE })
|
|
42
|
-
.optional(),
|
|
43
|
-
maxDigits: zod_1.z
|
|
44
|
-
.number({
|
|
45
|
-
message: common_1.Messages.POSITIVE_INTEGER_MESSAGE
|
|
46
|
-
})
|
|
47
|
-
.int({
|
|
48
|
-
message: common_1.Messages.POSITIVE_INTEGER_MESSAGE
|
|
49
|
-
})
|
|
50
|
-
.positive({
|
|
51
|
-
message: common_1.Messages.POSITIVE_INTEGER_MESSAGE
|
|
52
|
-
})
|
|
53
|
-
.optional()
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
exports.Gather = Gather;
|
package/dist/verbs/Hangup.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
-
* http://github.com/fonoster/fonoster
|
|
4
|
-
*
|
|
5
|
-
* This file is part of Fonoster
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the MIT License (the "License");
|
|
8
|
-
* you may not use this file except in compliance with
|
|
9
|
-
* the License. You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* https://opensource.org/licenses/MIT
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
import { z } from "zod";
|
|
20
|
-
import { Verb } from "./Verb";
|
|
21
|
-
declare class Hangup extends Verb {
|
|
22
|
-
getValidationSchema(): z.Schema;
|
|
23
|
-
}
|
|
24
|
-
export { Hangup };
|
package/dist/verbs/Hangup.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Hangup = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Copyright (C) 2025 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 zod_1 = require("zod");
|
|
23
|
-
const Verb_1 = require("./Verb");
|
|
24
|
-
class Hangup extends Verb_1.Verb {
|
|
25
|
-
getValidationSchema() {
|
|
26
|
-
return zod_1.z.object({});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.Hangup = Hangup;
|
package/dist/verbs/Mute.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
-
* http://github.com/fonoster/fonoster
|
|
4
|
-
*
|
|
5
|
-
* This file is part of Fonoster
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the MIT License (the "License");
|
|
8
|
-
* you may not use this file except in compliance with
|
|
9
|
-
* the License. You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* https://opensource.org/licenses/MIT
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
import { MuteRequest } from "@fonoster/common";
|
|
20
|
-
import { z } from "zod";
|
|
21
|
-
import { Verb } from "./Verb";
|
|
22
|
-
declare class Mute extends Verb<MuteRequest> {
|
|
23
|
-
getValidationSchema(): z.Schema;
|
|
24
|
-
}
|
|
25
|
-
export { Mute };
|
package/dist/verbs/Mute.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Mute = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Copyright (C) 2025 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 common_1 = require("@fonoster/common");
|
|
23
|
-
const zod_1 = require("zod");
|
|
24
|
-
const Verb_1 = require("./Verb");
|
|
25
|
-
class Mute extends Verb_1.Verb {
|
|
26
|
-
getValidationSchema() {
|
|
27
|
-
return zod_1.z.object({
|
|
28
|
-
direction: zod_1.z.enum([
|
|
29
|
-
common_1.MuteDirection.IN,
|
|
30
|
-
common_1.MuteDirection.OUT,
|
|
31
|
-
common_1.MuteDirection.BOTH
|
|
32
|
-
])
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
exports.Mute = Mute;
|
package/dist/verbs/Play.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
-
* http://github.com/fonoster/fonoster
|
|
4
|
-
*
|
|
5
|
-
* This file is part of Fonoster
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the MIT License (the "License");
|
|
8
|
-
* you may not use this file except in compliance with
|
|
9
|
-
* the License. You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* https://opensource.org/licenses/MIT
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
import { PlayRequest } from "@fonoster/common";
|
|
20
|
-
import { z } from "zod";
|
|
21
|
-
import { Verb } from "./Verb";
|
|
22
|
-
declare class Play extends Verb<PlayRequest> {
|
|
23
|
-
getValidationSchema(): z.Schema;
|
|
24
|
-
}
|
|
25
|
-
export { Play };
|
package/dist/verbs/Play.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Play = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Copyright (C) 2025 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 common_1 = require("@fonoster/common");
|
|
23
|
-
const zod_1 = require("zod");
|
|
24
|
-
const Verb_1 = require("./Verb");
|
|
25
|
-
class Play extends Verb_1.Verb {
|
|
26
|
-
getValidationSchema() {
|
|
27
|
-
return zod_1.z.object({
|
|
28
|
-
url: zod_1.z.string().url({ message: common_1.Messages.VALID_URL }),
|
|
29
|
-
playbackRef: zod_1.z.string().uuid({ message: common_1.Messages.VALID_UUID }).optional()
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.Play = Play;
|
package/dist/verbs/PlayDtmf.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
-
* http://github.com/fonoster/fonoster
|
|
4
|
-
*
|
|
5
|
-
* This file is part of Fonoster
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the MIT License (the "License");
|
|
8
|
-
* you may not use this file except in compliance with
|
|
9
|
-
* the License. You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* https://opensource.org/licenses/MIT
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
import { PlayDtmfRequest } from "@fonoster/common";
|
|
20
|
-
import { z } from "zod";
|
|
21
|
-
import { Verb } from "./Verb";
|
|
22
|
-
declare class PlayDtmf extends Verb<PlayDtmfRequest> {
|
|
23
|
-
getValidationSchema(): z.Schema;
|
|
24
|
-
}
|
|
25
|
-
export { PlayDtmf };
|
package/dist/verbs/PlayDtmf.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PlayDtmf = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Copyright (C) 2025 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 common_1 = require("@fonoster/common");
|
|
23
|
-
const zod_1 = require("zod");
|
|
24
|
-
const Verb_1 = require("./Verb");
|
|
25
|
-
class PlayDtmf extends Verb_1.Verb {
|
|
26
|
-
getValidationSchema() {
|
|
27
|
-
return zod_1.z.object({
|
|
28
|
-
digits: zod_1.z.string().regex(/^[0-9*#]+$/, { message: common_1.Messages.VALID_DTMF })
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.PlayDtmf = PlayDtmf;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
-
* http://github.com/fonoster/fonoster
|
|
4
|
-
*
|
|
5
|
-
* This file is part of Fonoster
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the MIT License (the "License");
|
|
8
|
-
* you may not use this file except in compliance with
|
|
9
|
-
* the License. You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* https://opensource.org/licenses/MIT
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
import { PlaybackControlRequest } from "@fonoster/common";
|
|
20
|
-
import { z } from "zod";
|
|
21
|
-
import { Verb } from "./Verb";
|
|
22
|
-
declare class PlaybackControl extends Verb<PlaybackControlRequest> {
|
|
23
|
-
getValidationSchema(): z.Schema;
|
|
24
|
-
}
|
|
25
|
-
export { PlaybackControl };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PlaybackControl = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Copyright (C) 2025 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 common_1 = require("@fonoster/common");
|
|
23
|
-
const zod_1 = require("zod");
|
|
24
|
-
const Verb_1 = require("./Verb");
|
|
25
|
-
class PlaybackControl extends Verb_1.Verb {
|
|
26
|
-
getValidationSchema() {
|
|
27
|
-
return zod_1.z.object({
|
|
28
|
-
playbackRef: zod_1.z.string().uuid({ message: common_1.Messages.VALID_UUID }),
|
|
29
|
-
action: zod_1.z.nativeEnum(common_1.PlaybackControlAction, {
|
|
30
|
-
message: "Invalid playback control action"
|
|
31
|
-
})
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.PlaybackControl = PlaybackControl;
|
package/dist/verbs/Record.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
-
* http://github.com/fonoster/fonoster
|
|
4
|
-
*
|
|
5
|
-
* This file is part of Fonoster
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the MIT License (the "License");
|
|
8
|
-
* you may not use this file except in compliance with
|
|
9
|
-
* the License. You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* https://opensource.org/licenses/MIT
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
import { RecordRequest } from "@fonoster/common";
|
|
20
|
-
import { z } from "zod";
|
|
21
|
-
import { Verb } from "./Verb";
|
|
22
|
-
declare class Record extends Verb<RecordRequest> {
|
|
23
|
-
getValidationSchema(): z.Schema;
|
|
24
|
-
}
|
|
25
|
-
export { Record };
|
package/dist/verbs/Record.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Record = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Copyright (C) 2025 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 common_1 = require("@fonoster/common");
|
|
23
|
-
const zod_1 = require("zod");
|
|
24
|
-
const Verb_1 = require("./Verb");
|
|
25
|
-
class Record extends Verb_1.Verb {
|
|
26
|
-
getValidationSchema() {
|
|
27
|
-
return zod_1.z.object({
|
|
28
|
-
maxDuration: zod_1.z
|
|
29
|
-
.number()
|
|
30
|
-
.int({ message: common_1.Messages.POSITIVE_INTEGER_MESSAGE })
|
|
31
|
-
.positive({ message: common_1.Messages.POSITIVE_INTEGER_MESSAGE })
|
|
32
|
-
.optional(),
|
|
33
|
-
maxSilence: zod_1.z
|
|
34
|
-
.number()
|
|
35
|
-
.int({ message: common_1.Messages.POSITIVE_INTEGER_MESSAGE })
|
|
36
|
-
.positive({ message: common_1.Messages.POSITIVE_INTEGER_MESSAGE })
|
|
37
|
-
.optional(),
|
|
38
|
-
beep: zod_1.z.boolean().optional(),
|
|
39
|
-
finishOnKey: zod_1.z
|
|
40
|
-
.string()
|
|
41
|
-
.regex(/^[0-9*#]+$/, { message: common_1.Messages.VALID_DTMF })
|
|
42
|
-
.length(1, {
|
|
43
|
-
message: common_1.Messages.MUST_BE_A_SINGLE_CHARACTER
|
|
44
|
-
})
|
|
45
|
-
.optional()
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
exports.Record = Record;
|
package/dist/verbs/Say.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
-
* http://github.com/fonoster/fonoster
|
|
4
|
-
*
|
|
5
|
-
* This file is part of Fonoster
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the MIT License (the "License");
|
|
8
|
-
* you may not use this file except in compliance with
|
|
9
|
-
* the License. You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* https://opensource.org/licenses/MIT
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
import { SayRequest } from "@fonoster/common";
|
|
20
|
-
import { z } from "zod";
|
|
21
|
-
import { Verb } from "./Verb";
|
|
22
|
-
declare class Say extends Verb<SayRequest> {
|
|
23
|
-
getValidationSchema(): z.Schema;
|
|
24
|
-
}
|
|
25
|
-
export { Say };
|