@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.
Files changed (45) hide show
  1. package/README.md +2 -2
  2. package/dist/constants.d.ts +1 -1
  3. package/dist/constants.js +2 -2
  4. package/dist/errors/index.d.ts +1 -1
  5. package/dist/errors/index.js +1 -1
  6. package/dist/index.d.ts +6 -5
  7. package/dist/index.js +6 -5
  8. package/dist/notifications/compileTemplate.d.ts +1 -1
  9. package/dist/notifications/createEmailSender.d.ts +1 -1
  10. package/dist/tts/index.d.ts +1 -1
  11. package/dist/tts/index.js +2 -2
  12. package/dist/tts/types.d.ts +1 -1
  13. package/dist/tts/types.js +1 -1
  14. package/dist/types.d.ts +1 -1
  15. package/dist/utils/createService.d.ts +1 -1
  16. package/dist/utils/getServerCredentials.d.ts +1 -1
  17. package/dist/utils/index.d.ts +4 -2
  18. package/dist/utils/index.js +4 -2
  19. package/dist/utils/withErrorHandling.d.ts +5 -0
  20. package/dist/utils/withErrorHandling.js +42 -0
  21. package/dist/utils/withValidation.d.ts +6 -0
  22. package/dist/utils/withValidation.js +18 -0
  23. package/dist/validators/common.d.ts +9 -0
  24. package/dist/validators/common.js +26 -0
  25. package/dist/validators/hostOrHostPortSchema.d.ts +3 -0
  26. package/dist/validators/hostOrHostPortSchema.js +34 -0
  27. package/dist/validators/index.d.ts +3 -0
  28. package/dist/validators/index.js +37 -0
  29. package/dist/validators/listCallsRequestSchema.d.ts +18 -0
  30. package/dist/validators/listCallsRequestSchema.js +53 -0
  31. package/dist/voice/Dial.d.ts +1 -1
  32. package/dist/voice/Dial.js +1 -1
  33. package/dist/voice/Mute.d.ts +1 -1
  34. package/dist/voice/Play.d.ts +1 -1
  35. package/dist/voice/PlaybackControl.d.ts +1 -1
  36. package/dist/voice/Record.d.ts +1 -1
  37. package/dist/voice/Say.d.ts +1 -1
  38. package/dist/voice/Stream.d.ts +1 -1
  39. package/dist/voice/Stream.js +1 -1
  40. package/dist/voice/StreamGather.d.ts +1 -1
  41. package/dist/voice/index.d.ts +3 -3
  42. package/dist/voice/index.js +11 -11
  43. package/dist/voice/voice.d.ts +1 -1
  44. package/dist/voice/voice.js +1 -1
  45. package/package.json +3 -3
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
- <a href="https://gitpod.io/#https://github.com/fonoster/fonoster"> <img src="https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod" alt="Contribute with Gitpod" />
1
+ [![Discord](https://img.shields.io/discord/1016419835455996076?color=5865F2&label=Discord&logo=discord&logoColor=white)](https://discord.gg/4QWgSz4hTC) ![GitHub](https://img.shields.io/github/license/fonoster/fonoster?color=%2347b96d) ![Twitter Follow](https://img.shields.io/twitter/follow/fonoster?style=social)
2
2
 
3
- This module is part of the [Fonoster](https://fonoster.com) project. 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).
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).
@@ -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.GRPC_NOT_SERVING_STATUS = exports.GRPC_SERVING_STATUS = void 0;
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";
@@ -1,4 +1,4 @@
1
- export * from "./handleError";
2
1
  export * from "./PrismaErrorEnum";
2
+ export * from "./handleError";
3
3
  export * from "./handleZodError";
4
4
  export * from "./types";
@@ -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 "./utils";
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 "./voice";
5
+ export * from "./notifications";
7
6
  export * from "./tts";
8
7
  export * from "./types";
9
- export * from "./GrpcError";
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("./utils"), exports);
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("./voice"), exports);
39
+ __exportStar(require("./notifications"), exports);
41
40
  __exportStar(require("./tts"), exports);
42
41
  __exportStar(require("./types"), exports);
43
- __exportStar(require("./GrpcError"), exports);
42
+ __exportStar(require("./utils"), exports);
43
+ __exportStar(require("./validators"), exports);
44
+ __exportStar(require("./voice"), exports);
@@ -3,4 +3,4 @@ type CompileTemplateParams = {
3
3
  data: Record<string, string>;
4
4
  };
5
5
  declare function compileTemplate(params: CompileTemplateParams): string;
6
- export { compileTemplate, CompileTemplateParams };
6
+ export { CompileTemplateParams, compileTemplate };
@@ -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 { createEmailSender, EmailSenderConfig, EmailParams };
17
+ export { EmailParams, EmailSenderConfig, createEmailSender };
@@ -1,4 +1,4 @@
1
- export * from "./GoogleVoices";
2
1
  export * from "./AzureVoices";
3
2
  export * from "./DeepgramVoices";
3
+ export * from "./GoogleVoices";
4
4
  export * from "./types";
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);
@@ -161,4 +161,4 @@ declare enum VoiceGender {
161
161
  FEMALE = 1,
162
162
  NEUTRAL = 2
163
163
  }
164
- export { VoiceLanguage, VoiceGender };
164
+ export { VoiceGender, VoiceLanguage };
package/dist/tts/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VoiceGender = exports.VoiceLanguage = void 0;
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
@@ -5,4 +5,4 @@ type NumberPreconditionsCheck = (request: {
5
5
  appRef?: string;
6
6
  agentAor?: string;
7
7
  }) => Promise<void>;
8
- export { NumberPreconditionsCheck, BaseApiObject };
8
+ export { BaseApiObject, NumberPreconditionsCheck };
@@ -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 { createServiceDefinition, ServiceDefinitionParams };
9
+ export { ServiceDefinitionParams, createServiceDefinition };
@@ -7,4 +7,4 @@ type CredentialsConfig = {
7
7
  serverKey?: string;
8
8
  };
9
9
  declare function getServerCredentials(config: CredentialsConfig): Promise<grpc.ServerCredentials>;
10
- export { getServerCredentials, CredentialsConfig };
10
+ export { CredentialsConfig, getServerCredentials };
@@ -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";
@@ -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,5 @@
1
+ import { GrpcErrorMessage } from "../errors";
2
+ declare function withErrorHandling(fn: Function): (call: {
3
+ request: unknown;
4
+ }, callback: (error?: GrpcErrorMessage, response?: unknown) => void) => Promise<void>;
5
+ export { withErrorHandling };
@@ -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,9 @@
1
+ import { z } from "zod";
2
+ declare const basicApiCallSchema: z.ZodObject<{
3
+ ref: z.ZodString;
4
+ }, "strip", z.ZodTypeAny, {
5
+ ref?: string;
6
+ }, {
7
+ ref?: string;
8
+ }>;
9
+ export { basicApiCallSchema };
@@ -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,3 @@
1
+ import { z } from "zod";
2
+ declare const hostOrHostPortSchema: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string, string>;
3
+ export { hostOrHostPortSchema };
@@ -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,3 @@
1
+ export * from "./common";
2
+ export * from "./hostOrHostPortSchema";
3
+ export * from "./listCallsRequestSchema";
@@ -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;
@@ -20,4 +20,4 @@ type DialOptions = {
20
20
  type DialRequest = VerbRequest & DialOptions & {
21
21
  destination: string;
22
22
  };
23
- export { DialRequest, DialOptions, DialStatus, DialRecordDirection };
23
+ export { DialOptions, DialRecordDirection, DialRequest, DialStatus };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DialRecordDirection = exports.DialStatus = void 0;
3
+ exports.DialStatus = exports.DialRecordDirection = void 0;
4
4
  var DialRecordDirection;
5
5
  (function (DialRecordDirection) {
6
6
  DialRecordDirection["IN"] = "IN";
@@ -10,4 +10,4 @@ declare enum MuteDirection {
10
10
  type MuteRequest = VerbRequest & {
11
11
  direction: MuteDirection;
12
12
  };
13
- export { MuteOptions, MuteRequest, MuteDirection };
13
+ export { MuteDirection, MuteOptions, MuteRequest };
@@ -9,4 +9,4 @@ type PlayResponse = {
9
9
  sessionRef: string;
10
10
  playbackRef: string;
11
11
  };
12
- export { PlayRequest, PlayResponse, PlayOptions };
12
+ export { PlayOptions, PlayRequest, PlayResponse };
@@ -10,4 +10,4 @@ type PlaybackControlRequest = VerbRequest & {
10
10
  playbackRef: string;
11
11
  action: PlaybackControlAction;
12
12
  };
13
- export { PlaybackControlRequest, PlaybackControlAction };
13
+ export { PlaybackControlAction, PlaybackControlRequest };
@@ -15,4 +15,4 @@ type RecordResponse = {
15
15
  duration: number;
16
16
  format: RecordFormat;
17
17
  };
18
- export { RecordOptions, RecordRequest, RecordResponse, RecordFormat };
18
+ export { RecordFormat, RecordOptions, RecordRequest, RecordResponse };
@@ -12,4 +12,4 @@ type SayOptions = {
12
12
  playbackRef?: string;
13
13
  [key: string]: any;
14
14
  };
15
- export { SayRequest, SayResponse, SayOptions };
15
+ export { SayOptions, SayRequest, SayResponse };
@@ -32,4 +32,4 @@ type StreamPayload = {
32
32
  code?: string;
33
33
  message?: string;
34
34
  };
35
- export { StreamDirection, StreamAudioFormat, StreamMessageType, StreamOptions, StartStreamRequest, StartStreamResponse, StopStreamRequest, StreamPayload };
35
+ export { StartStreamRequest, StartStreamResponse, StopStreamRequest, StreamAudioFormat, StreamDirection, StreamMessageType, StreamOptions, StreamPayload };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StreamMessageType = exports.StreamAudioFormat = exports.StreamDirection = void 0;
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 { StreamGatherSource, StreamGatherPayload, StartStreamGatherRequest, StreamGatherOptions };
15
+ export { StartStreamGatherRequest, StreamGatherOptions, StreamGatherPayload, StreamGatherSource };
@@ -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";
@@ -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);
@@ -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 { VoiceClientConfig, VoiceSessionStreamServer, VoiceSessionStreamClient, StreamEvent, StreamContent, VoiceIn, VoiceOut, DATA, END, ERROR };
114
+ export { DATA, END, ERROR, StreamContent, StreamEvent, VoiceClientConfig, VoiceIn, VoiceOut, VoiceSessionStreamClient, VoiceSessionStreamServer };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ERROR = exports.END = exports.DATA = exports.StreamContent = exports.StreamEvent = void 0;
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.4",
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.4",
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": "e550aa46c1a9087a70157496365b64afd5aea11d"
45
+ "gitHead": "cf28444503e4e698ccc001e061c7c918a4204757"
46
46
  }