@fonoster/common 0.7.4 → 0.7.5
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 +2 -2
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +2 -2
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.js +6 -5
- package/dist/notifications/compileTemplate.d.ts +1 -1
- package/dist/notifications/createEmailSender.d.ts +1 -1
- package/dist/tts/index.d.ts +1 -1
- package/dist/tts/index.js +2 -2
- package/dist/tts/types.d.ts +1 -1
- package/dist/tts/types.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils/createService.d.ts +1 -1
- package/dist/utils/getServerCredentials.d.ts +1 -1
- package/dist/utils/index.d.ts +4 -2
- package/dist/utils/index.js +4 -2
- package/dist/utils/withErrorHandling.d.ts +5 -0
- package/dist/utils/withErrorHandling.js +42 -0
- package/dist/utils/withValidation.d.ts +6 -0
- package/dist/utils/withValidation.js +18 -0
- package/dist/validators/common.d.ts +9 -0
- package/dist/validators/common.js +26 -0
- package/dist/validators/hostOrHostPortSchema.d.ts +3 -0
- package/dist/validators/hostOrHostPortSchema.js +34 -0
- package/dist/validators/index.d.ts +3 -0
- package/dist/validators/index.js +37 -0
- package/dist/validators/listCallsRequestSchema.d.ts +18 -0
- package/dist/validators/listCallsRequestSchema.js +53 -0
- package/dist/voice/Dial.d.ts +1 -1
- package/dist/voice/Dial.js +1 -1
- package/dist/voice/Mute.d.ts +1 -1
- package/dist/voice/Play.d.ts +1 -1
- package/dist/voice/PlaybackControl.d.ts +1 -1
- package/dist/voice/Record.d.ts +1 -1
- package/dist/voice/Say.d.ts +1 -1
- package/dist/voice/Stream.d.ts +1 -1
- package/dist/voice/Stream.js +1 -1
- package/dist/voice/StreamGather.d.ts +1 -1
- package/dist/voice/index.d.ts +3 -3
- package/dist/voice/index.js +11 -11
- package/dist/voice/voice.d.ts +1 -1
- package/dist/voice/voice.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
[](https://discord.gg/4QWgSz4hTC)  
|
|
2
2
|
|
|
3
|
-
This module is part of the [Fonoster](https://fonoster.com)
|
|
3
|
+
This module is part of the [Fonoster](https://fonoster.com) open-source. By itself, it does not do much. It is intended to be used as a dependency for other modules. For more information about the project, please visit [https://github.com/fonoster/fonoster](https://github.com/fonoster/fonoster).
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ServingStatus } from "grpc-health-check";
|
|
2
|
-
export declare const GRPC_SERVING_STATUS: ServingStatus;
|
|
3
2
|
export declare const GRPC_NOT_SERVING_STATUS: ServingStatus;
|
|
3
|
+
export declare const GRPC_SERVING_STATUS: ServingStatus;
|
|
4
4
|
export declare const STASIS_APP_NAME = "mediacontroller";
|
package/dist/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.STASIS_APP_NAME = exports.
|
|
4
|
-
exports.GRPC_SERVING_STATUS = "SERVING";
|
|
3
|
+
exports.STASIS_APP_NAME = exports.GRPC_SERVING_STATUS = exports.GRPC_NOT_SERVING_STATUS = void 0;
|
|
5
4
|
exports.GRPC_NOT_SERVING_STATUS = "NOT_SERVING";
|
|
5
|
+
exports.GRPC_SERVING_STATUS = "SERVING";
|
|
6
6
|
exports.STASIS_APP_NAME = "mediacontroller";
|
package/dist/errors/index.d.ts
CHANGED
package/dist/errors/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./PrismaErrorEnum"), exports);
|
|
17
18
|
/*
|
|
18
19
|
* Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
|
|
19
20
|
* http://github.com/fonoster/fonoster
|
|
@@ -33,6 +34,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
33
34
|
* limitations under the License.
|
|
34
35
|
*/
|
|
35
36
|
__exportStar(require("./handleError"), exports);
|
|
36
|
-
__exportStar(require("./PrismaErrorEnum"), exports);
|
|
37
37
|
__exportStar(require("./handleZodError"), exports);
|
|
38
38
|
__exportStar(require("./types"), exports);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./notifications";
|
|
3
|
-
export * from "./errors";
|
|
1
|
+
export * from "./GrpcError";
|
|
4
2
|
export * from "./constants";
|
|
3
|
+
export * from "./errors";
|
|
5
4
|
export * from "./grpcStatusMap";
|
|
6
|
-
export * from "./
|
|
5
|
+
export * from "./notifications";
|
|
7
6
|
export * from "./tts";
|
|
8
7
|
export * from "./types";
|
|
9
|
-
export * from "./
|
|
8
|
+
export * from "./utils";
|
|
9
|
+
export * from "./validators";
|
|
10
|
+
export * from "./voice";
|
package/dist/index.js
CHANGED
|
@@ -32,12 +32,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
32
32
|
* See the License for the specific language governing permissions and
|
|
33
33
|
* limitations under the License.
|
|
34
34
|
*/
|
|
35
|
-
__exportStar(require("./
|
|
36
|
-
__exportStar(require("./notifications"), exports);
|
|
37
|
-
__exportStar(require("./errors"), exports);
|
|
35
|
+
__exportStar(require("./GrpcError"), exports);
|
|
38
36
|
__exportStar(require("./constants"), exports);
|
|
37
|
+
__exportStar(require("./errors"), exports);
|
|
39
38
|
__exportStar(require("./grpcStatusMap"), exports);
|
|
40
|
-
__exportStar(require("./
|
|
39
|
+
__exportStar(require("./notifications"), exports);
|
|
41
40
|
__exportStar(require("./tts"), exports);
|
|
42
41
|
__exportStar(require("./types"), exports);
|
|
43
|
-
__exportStar(require("./
|
|
42
|
+
__exportStar(require("./utils"), exports);
|
|
43
|
+
__exportStar(require("./validators"), exports);
|
|
44
|
+
__exportStar(require("./voice"), exports);
|
|
@@ -14,4 +14,4 @@ type EmailParams = {
|
|
|
14
14
|
html: string;
|
|
15
15
|
};
|
|
16
16
|
declare function createEmailSender(config: EmailSenderConfig): (params: EmailParams) => Promise<void>;
|
|
17
|
-
export {
|
|
17
|
+
export { EmailParams, EmailSenderConfig, createEmailSender };
|
package/dist/tts/index.d.ts
CHANGED
package/dist/tts/index.js
CHANGED
|
@@ -14,6 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./AzureVoices"), exports);
|
|
18
|
+
__exportStar(require("./DeepgramVoices"), exports);
|
|
17
19
|
/*
|
|
18
20
|
* Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
|
|
19
21
|
* http://github.com/fonoster/fonoster
|
|
@@ -33,6 +35,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
33
35
|
* limitations under the License.
|
|
34
36
|
*/
|
|
35
37
|
__exportStar(require("./GoogleVoices"), exports);
|
|
36
|
-
__exportStar(require("./AzureVoices"), exports);
|
|
37
|
-
__exportStar(require("./DeepgramVoices"), exports);
|
|
38
38
|
__exportStar(require("./types"), exports);
|
package/dist/tts/types.d.ts
CHANGED
package/dist/tts/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.VoiceLanguage = exports.VoiceGender = void 0;
|
|
4
4
|
/*
|
|
5
5
|
* Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
|
|
6
6
|
* http://github.com/fonoster/fonoster
|
package/dist/types.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ type ServiceDefinitionParams = {
|
|
|
6
6
|
version: string;
|
|
7
7
|
};
|
|
8
8
|
declare function createServiceDefinition(params: ServiceDefinitionParams): grpc.ServiceDefinition<grpc.UntypedServiceImplementation>;
|
|
9
|
-
export {
|
|
9
|
+
export { ServiceDefinitionParams, createServiceDefinition };
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export * from "./assertEnvsAreSet";
|
|
2
2
|
export * from "./assertFileExists";
|
|
3
|
-
export * from "./createService";
|
|
4
3
|
export * from "./createInterceptingCall";
|
|
4
|
+
export * from "./createService";
|
|
5
5
|
export * from "./datesMapper";
|
|
6
6
|
export * from "./getServerCredentials";
|
|
7
|
-
export * from "./toPascalCase";
|
|
8
7
|
export * from "./toCamelCase";
|
|
8
|
+
export * from "./toPascalCase";
|
|
9
|
+
export * from "./withErrorHandling";
|
|
10
|
+
export * from "./withValidation";
|
package/dist/utils/index.js
CHANGED
|
@@ -34,9 +34,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
34
34
|
*/
|
|
35
35
|
__exportStar(require("./assertEnvsAreSet"), exports);
|
|
36
36
|
__exportStar(require("./assertFileExists"), exports);
|
|
37
|
-
__exportStar(require("./createService"), exports);
|
|
38
37
|
__exportStar(require("./createInterceptingCall"), exports);
|
|
38
|
+
__exportStar(require("./createService"), exports);
|
|
39
39
|
__exportStar(require("./datesMapper"), exports);
|
|
40
40
|
__exportStar(require("./getServerCredentials"), exports);
|
|
41
|
-
__exportStar(require("./toPascalCase"), exports);
|
|
42
41
|
__exportStar(require("./toCamelCase"), exports);
|
|
42
|
+
__exportStar(require("./toPascalCase"), exports);
|
|
43
|
+
__exportStar(require("./withErrorHandling"), exports);
|
|
44
|
+
__exportStar(require("./withValidation"), exports);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.withErrorHandling = withErrorHandling;
|
|
13
|
+
/* eslint-disable @typescript-eslint/ban-types */
|
|
14
|
+
/*
|
|
15
|
+
* Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
|
|
16
|
+
* http://github.com/fonoster/fonoster
|
|
17
|
+
*
|
|
18
|
+
* This file is part of Fonoster
|
|
19
|
+
*
|
|
20
|
+
* Licensed under the MIT License (the "License");
|
|
21
|
+
* you may not use this file except in compliance with
|
|
22
|
+
* the License. You may obtain a copy of the License at
|
|
23
|
+
*
|
|
24
|
+
* https://opensource.org/licenses/MIT
|
|
25
|
+
*
|
|
26
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
27
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
28
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
29
|
+
* See the License for the specific language governing permissions and
|
|
30
|
+
* limitations under the License.
|
|
31
|
+
*/
|
|
32
|
+
const errors_1 = require("../errors");
|
|
33
|
+
function withErrorHandling(fn) {
|
|
34
|
+
return (call, callback) => __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
try {
|
|
36
|
+
yield fn(call, callback);
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
(0, errors_1.handleError)(error, callback);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { GrpcErrorMessage } from "../errors";
|
|
3
|
+
declare function withValidation(fn: Function, schema: z.ZodSchema): (call: {
|
|
4
|
+
request: unknown;
|
|
5
|
+
}, callback: (error?: GrpcErrorMessage, response?: unknown) => void) => Promise<void>;
|
|
6
|
+
export { withValidation };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.withValidation = withValidation;
|
|
13
|
+
function withValidation(fn, schema) {
|
|
14
|
+
return (call, callback) => __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
schema.parse(call.request);
|
|
16
|
+
yield fn(call, callback);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.basicApiCallSchema = 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 zod_1 = require("zod");
|
|
23
|
+
const basicApiCallSchema = zod_1.z.object({
|
|
24
|
+
ref: zod_1.z.string()
|
|
25
|
+
});
|
|
26
|
+
exports.basicApiCallSchema = basicApiCallSchema;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hostOrHostPortSchema = 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 zod_1 = require("zod");
|
|
23
|
+
const hostOrHostPortSchema = zod_1.z
|
|
24
|
+
.string()
|
|
25
|
+
.optional()
|
|
26
|
+
.nullable()
|
|
27
|
+
.refine((value) => {
|
|
28
|
+
const hostRegex = /^(?!:\/\/)([a-zA-Z0-9-_]+(\.[a-zA-Z0-9-_]+)*|(\d{1,3}\.){3}\d{1,3})$/;
|
|
29
|
+
const hostPortRegex = /^(?!:\/\/)([a-zA-Z0-9-_]+(\.[a-zA-Z0-9-_]+)*|(\d{1,3}\.){3}\d{1,3}):\d{1,5}$/;
|
|
30
|
+
return hostRegex.test(value) || hostPortRegex.test(value);
|
|
31
|
+
}, {
|
|
32
|
+
message: "Invalid format. Expected 'host' or 'host:port'"
|
|
33
|
+
});
|
|
34
|
+
exports.hostOrHostPortSchema = hostOrHostPortSchema;
|
|
@@ -0,0 +1,37 @@
|
|
|
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("./common"), exports);
|
|
36
|
+
__exportStar(require("./hostOrHostPortSchema"), exports);
|
|
37
|
+
__exportStar(require("./listCallsRequestSchema"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const listCallsRequestSchema: z.ZodObject<{
|
|
3
|
+
after: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
4
|
+
before: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
5
|
+
pageSize: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
6
|
+
pageToken: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
after?: string;
|
|
9
|
+
before?: string;
|
|
10
|
+
pageSize?: number;
|
|
11
|
+
pageToken?: string;
|
|
12
|
+
}, {
|
|
13
|
+
after?: string;
|
|
14
|
+
before?: string;
|
|
15
|
+
pageSize?: number;
|
|
16
|
+
pageToken?: string;
|
|
17
|
+
}>;
|
|
18
|
+
export { listCallsRequestSchema };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listCallsRequestSchema = 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 zod_1 = require("zod");
|
|
23
|
+
const listCallsRequestSchema = zod_1.z.object({
|
|
24
|
+
after: zod_1.z
|
|
25
|
+
.string()
|
|
26
|
+
.datetime({ offset: true, message: "The date must be a valid ISO 8601" })
|
|
27
|
+
.optional()
|
|
28
|
+
.nullable(),
|
|
29
|
+
before: zod_1.z
|
|
30
|
+
.string()
|
|
31
|
+
.datetime({ offset: true, message: "The date must be a valid ISO 8601" })
|
|
32
|
+
.optional()
|
|
33
|
+
.nullable(),
|
|
34
|
+
pageSize: zod_1.z
|
|
35
|
+
.number({ message: "Invalid pageSize value" })
|
|
36
|
+
.optional()
|
|
37
|
+
.nullable(),
|
|
38
|
+
// type: z
|
|
39
|
+
// .nativeEnum(CallType, {
|
|
40
|
+
// message: "Invalid call type"
|
|
41
|
+
// })
|
|
42
|
+
// .optional()
|
|
43
|
+
// .nullable(),
|
|
44
|
+
// status: z
|
|
45
|
+
// .nativeEnum(CallStatus, { message: "Invalid call status" })
|
|
46
|
+
// .optional()
|
|
47
|
+
// .nullable(),
|
|
48
|
+
pageToken: zod_1.z
|
|
49
|
+
.string({ message: "The pageToken must be a string" })
|
|
50
|
+
.optional()
|
|
51
|
+
.nullable()
|
|
52
|
+
});
|
|
53
|
+
exports.listCallsRequestSchema = listCallsRequestSchema;
|
package/dist/voice/Dial.d.ts
CHANGED
package/dist/voice/Dial.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DialStatus = exports.DialRecordDirection = void 0;
|
|
4
4
|
var DialRecordDirection;
|
|
5
5
|
(function (DialRecordDirection) {
|
|
6
6
|
DialRecordDirection["IN"] = "IN";
|
package/dist/voice/Mute.d.ts
CHANGED
package/dist/voice/Play.d.ts
CHANGED
package/dist/voice/Record.d.ts
CHANGED
package/dist/voice/Say.d.ts
CHANGED
package/dist/voice/Stream.d.ts
CHANGED
|
@@ -32,4 +32,4 @@ type StreamPayload = {
|
|
|
32
32
|
code?: string;
|
|
33
33
|
message?: string;
|
|
34
34
|
};
|
|
35
|
-
export {
|
|
35
|
+
export { StartStreamRequest, StartStreamResponse, StopStreamRequest, StreamAudioFormat, StreamDirection, StreamMessageType, StreamOptions, StreamPayload };
|
package/dist/voice/Stream.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StreamMessageType = exports.
|
|
3
|
+
exports.StreamMessageType = exports.StreamDirection = exports.StreamAudioFormat = void 0;
|
|
4
4
|
/*
|
|
5
5
|
* Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
|
|
6
6
|
* http://github.com/fonoster/fonoster
|
|
@@ -12,4 +12,4 @@ type StreamGatherPayload = VerbResponse & {
|
|
|
12
12
|
speech?: string;
|
|
13
13
|
digit?: string;
|
|
14
14
|
};
|
|
15
|
-
export {
|
|
15
|
+
export { StartStreamGatherRequest, StreamGatherOptions, StreamGatherPayload, StreamGatherSource };
|
package/dist/voice/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export * from "./voice";
|
|
2
1
|
export * from "./Dial";
|
|
3
2
|
export * from "./Gather";
|
|
4
|
-
export * from "./Verb";
|
|
5
3
|
export * from "./Mute";
|
|
6
4
|
export * from "./Play";
|
|
7
|
-
export * from "./PlaybackControl";
|
|
8
5
|
export * from "./PlayDtmf";
|
|
6
|
+
export * from "./PlaybackControl";
|
|
9
7
|
export * from "./Record";
|
|
10
8
|
export * from "./Say";
|
|
11
9
|
export * from "./Stream";
|
|
12
10
|
export * from "./StreamGather";
|
|
11
|
+
export * from "./Verb";
|
|
12
|
+
export * from "./voice";
|
package/dist/voice/index.js
CHANGED
|
@@ -14,6 +14,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Dial"), exports);
|
|
18
|
+
__exportStar(require("./Gather"), exports);
|
|
19
|
+
__exportStar(require("./Mute"), exports);
|
|
20
|
+
__exportStar(require("./Play"), exports);
|
|
21
|
+
__exportStar(require("./PlayDtmf"), exports);
|
|
22
|
+
__exportStar(require("./PlaybackControl"), exports);
|
|
23
|
+
__exportStar(require("./Record"), exports);
|
|
24
|
+
__exportStar(require("./Say"), exports);
|
|
25
|
+
__exportStar(require("./Stream"), exports);
|
|
26
|
+
__exportStar(require("./StreamGather"), exports);
|
|
27
|
+
__exportStar(require("./Verb"), exports);
|
|
17
28
|
/*
|
|
18
29
|
* Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
|
|
19
30
|
* http://github.com/fonoster/fonoster
|
|
@@ -33,14 +44,3 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
33
44
|
* limitations under the License.
|
|
34
45
|
*/
|
|
35
46
|
__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);
|
|
46
|
-
__exportStar(require("./StreamGather"), exports);
|
package/dist/voice/voice.d.ts
CHANGED
|
@@ -111,4 +111,4 @@ type BaseVoiceStream<T, W> = {
|
|
|
111
111
|
};
|
|
112
112
|
type VoiceSessionStreamServer = BaseVoiceStream<VoiceIn, VoiceOut>;
|
|
113
113
|
type VoiceSessionStreamClient = BaseVoiceStream<VoiceOut | GrpcError, VoiceIn | GrpcError>;
|
|
114
|
-
export {
|
|
114
|
+
export { DATA, END, ERROR, StreamContent, StreamEvent, VoiceClientConfig, VoiceIn, VoiceOut, VoiceSessionStreamClient, VoiceSessionStreamServer };
|
package/dist/voice/voice.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.StreamEvent = exports.StreamContent = exports.ERROR = exports.END = exports.DATA = void 0;
|
|
4
4
|
const DATA = "data";
|
|
5
5
|
exports.DATA = DATA;
|
|
6
6
|
const END = "end";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonoster/common",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5",
|
|
4
4
|
"description": "Common library for Fonoster projects",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/fonoster#readme",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"clean": "rimraf ./dist node_modules tsconfig.tsbuildinfo"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@fonoster/logger": "^0.7.
|
|
21
|
+
"@fonoster/logger": "^0.7.5",
|
|
22
22
|
"@grpc/grpc-js": "~1.10.6",
|
|
23
23
|
"@grpc/proto-loader": "^0.7.12",
|
|
24
24
|
"grpc-health-check": "^2.0.2",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/nodemailer": "^6.4.14"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "cf28444503e4e698ccc001e061c7c918a4204757"
|
|
46
46
|
}
|