@fonoster/apiserver 0.8.25 → 0.8.27

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 (120) hide show
  1. package/dist/applications/buildService.js +10 -10
  2. package/dist/applications/{createApplication.d.ts → createCreateApplication.d.ts} +2 -2
  3. package/dist/applications/{createApplication.js → createCreateApplication.js} +14 -7
  4. package/dist/applications/{getApplication.d.ts → createDeleteApplication.d.ts} +2 -2
  5. package/dist/applications/{deleteApplication.js → createDeleteApplication.js} +4 -4
  6. package/dist/applications/{updateApplication.d.ts → createGetApplication.d.ts} +2 -2
  7. package/dist/applications/{getApplication.js → createGetApplication.js} +4 -4
  8. package/dist/applications/createGetFnUtil.d.ts +2 -0
  9. package/dist/applications/{listApplications.d.ts → createListApplications.d.ts} +2 -2
  10. package/dist/applications/{listApplications.js → createListApplications.js} +5 -6
  11. package/dist/applications/{deleteApplication.d.ts → createUpdateApplication.d.ts} +2 -2
  12. package/dist/applications/{updateApplication.js → createUpdateApplication.js} +7 -7
  13. package/dist/applications/utils/applicationWithEncodedStruct.js +2 -0
  14. package/dist/applications/utils/convertToApplicationData.d.ts +2 -2
  15. package/dist/applications/validation/assistantWithoutApiKeySchema.d.ts +671 -0
  16. package/dist/applications/validation/assistantWithoutApiKeySchema.js +35 -0
  17. package/dist/applications/validation/createValidationSchema.d.ts +1107 -0
  18. package/dist/applications/validation/createValidationSchema.js +67 -0
  19. package/dist/applications/validation/speechValidators.d.ts +29 -0
  20. package/dist/applications/{utils/getApplicationValidationSchema.js → validation/speechValidators.js} +3 -28
  21. package/dist/applications/{utils → validation}/validOrThrow.js +3 -2
  22. package/dist/calls/buildService.js +2 -2
  23. package/dist/calls/createCall.js +1 -2
  24. package/dist/calls/{makeTrackCall.d.ts → createTrackCall.d.ts} +2 -2
  25. package/dist/calls/{makeTrackCall.js → createTrackCall.js} +4 -4
  26. package/dist/calls/getCall.js +1 -2
  27. package/dist/calls/listCalls.js +1 -2
  28. package/dist/core/httpBridge.js +1 -1
  29. package/dist/core/runServices.js +2 -3
  30. package/dist/core/seed.js +11 -1
  31. package/dist/core/services.js +1 -1
  32. package/dist/envs.d.ts +1 -0
  33. package/dist/envs.js +3 -2
  34. package/dist/secrets/createGetFnUtil.js +12 -10
  35. package/dist/secrets/createSecret.js +1 -2
  36. package/dist/secrets/listSecrets.js +1 -2
  37. package/dist/secrets/updateSecret.js +1 -2
  38. package/dist/utils/createCheckNumberPreconditions.d.ts +6 -0
  39. package/dist/utils/{makeCheckNumberPreconditions.js → createCheckNumberPreconditions.js} +4 -4
  40. package/dist/utils/createHandleDialEventsWithNats.d.ts +5 -0
  41. package/dist/utils/{makeHandleDialEventsWithNats.js → createHandleDialEventsWithNats.js} +10 -8
  42. package/dist/utils/createHandleDialEventsWithVoiceClient.d.ts +5 -0
  43. package/dist/utils/{makeHandleDialEventsWithVoiceClient.js → createHandleDialEventsWithVoiceClient.js} +13 -11
  44. package/dist/utils/index.d.ts +3 -3
  45. package/dist/utils/index.js +3 -3
  46. package/dist/voice/VoiceClientImpl.js +13 -7
  47. package/dist/voice/VoiceDispatcher.js +16 -17
  48. package/dist/voice/connectToAri.js +3 -3
  49. package/dist/voice/{makeCreateVoiceClient.d.ts → createCreateVoiceClient.d.ts} +2 -2
  50. package/dist/voice/createCreateVoiceClient.js +76 -0
  51. package/dist/voice/handlers/createAnswerHandler.d.ts +5 -0
  52. package/dist/voice/handlers/{Answer.js → createAnswerHandler.js} +2 -2
  53. package/dist/voice/handlers/createHangupHandler.d.ts +5 -0
  54. package/dist/voice/handlers/{Hangup.js → createHangupHandler.js} +2 -2
  55. package/dist/voice/handlers/createMuteHandler.d.ts +4 -0
  56. package/dist/voice/handlers/{Mute.js → createMuteHandler.js} +2 -2
  57. package/dist/voice/handlers/createPlayDtmfHandler.d.ts +4 -0
  58. package/dist/voice/handlers/{PlayDtmf.js → createPlayDtmfHandler.js} +2 -2
  59. package/dist/voice/handlers/createPlayHandler.d.ts +4 -0
  60. package/dist/voice/handlers/{Play.js → createPlayHandler.js} +2 -2
  61. package/dist/voice/handlers/createPlaybackControlHandler.d.ts +4 -0
  62. package/dist/voice/handlers/{PlaybackControl.js → createPlaybackControlHandler.js} +2 -2
  63. package/dist/voice/handlers/createRecordHandler.d.ts +4 -0
  64. package/dist/voice/handlers/{Record.js → createRecordHandler.js} +2 -2
  65. package/dist/voice/handlers/createSayHandler.d.ts +4 -0
  66. package/dist/voice/handlers/{Say.js → createSayHandler.js} +2 -2
  67. package/dist/voice/handlers/createStreamGatherHandler.d.ts +3 -0
  68. package/dist/voice/handlers/{StreamGather.js → createStreamGatherHandler.js} +2 -2
  69. package/dist/voice/handlers/{StreamGather.d.ts → createStreamHandler.d.ts} +2 -2
  70. package/dist/voice/handlers/{Stream.js → createStreamHandler.js} +2 -2
  71. package/dist/voice/handlers/createUnmuteHandler.d.ts +4 -0
  72. package/dist/voice/handlers/{Unmute.js → createUnmuteHandler.js} +2 -2
  73. package/dist/voice/handlers/dial/createDialHandler.d.ts +5 -0
  74. package/dist/voice/handlers/dial/createDialHandler.js +78 -0
  75. package/dist/voice/handlers/dial/index.d.ts +1 -0
  76. package/dist/voice/handlers/dial/index.js +35 -0
  77. package/dist/voice/handlers/gather/createGatherHandler.d.ts +3 -0
  78. package/dist/voice/handlers/gather/{Gather.js → createGatherHandler.js} +2 -2
  79. package/dist/voice/handlers/index.d.ts +13 -12
  80. package/dist/voice/handlers/index.js +13 -12
  81. package/dist/voice/integrations/createCreateContainer.d.ts +4 -0
  82. package/dist/voice/integrations/{makeCreateContainer.js → createCreateContainer.js} +28 -26
  83. package/dist/voice/integrations/getSttConfig.js +20 -2
  84. package/dist/voice/integrations/getTtsConfig.js +2 -2
  85. package/dist/voice/integrations/index.d.ts +1 -1
  86. package/dist/voice/integrations/index.js +1 -1
  87. package/dist/voice/stt/types.d.ts +1 -1
  88. package/dist/voice/utils/createGetChannelVar.d.ts +4 -0
  89. package/dist/voice/utils/{makeGetChannelVar.js → createGetChannelVar.js} +14 -12
  90. package/dist/voice/utils/createGetChannelVarWithoutThrow.d.ts +4 -0
  91. package/dist/voice/utils/{makeGetChannelVarWithoutThrow.js → createGetChannelVarWithoutThrow.js} +14 -12
  92. package/dist/voice/utils/index.d.ts +2 -2
  93. package/dist/voice/utils/index.js +2 -2
  94. package/package.json +9 -9
  95. package/dist/applications/utils/getApplicationValidationSchema.d.ts +0 -64
  96. package/dist/utils/makeCheckNumberPreconditions.d.ts +0 -6
  97. package/dist/utils/makeHandleDialEventsWithNats.d.ts +0 -5
  98. package/dist/utils/makeHandleDialEventsWithVoiceClient.d.ts +0 -5
  99. package/dist/voice/handlers/Answer.d.ts +0 -5
  100. package/dist/voice/handlers/Hangup.d.ts +0 -5
  101. package/dist/voice/handlers/Mute.d.ts +0 -4
  102. package/dist/voice/handlers/Play.d.ts +0 -4
  103. package/dist/voice/handlers/PlayDtmf.d.ts +0 -4
  104. package/dist/voice/handlers/PlaybackControl.d.ts +0 -4
  105. package/dist/voice/handlers/Record.d.ts +0 -4
  106. package/dist/voice/handlers/Say.d.ts +0 -4
  107. package/dist/voice/handlers/Stream.d.ts +0 -3
  108. package/dist/voice/handlers/Unmute.d.ts +0 -4
  109. package/dist/voice/handlers/dial/Dial.d.ts +0 -5
  110. package/dist/voice/handlers/dial/Dial.js +0 -76
  111. package/dist/voice/handlers/gather/Gather.d.ts +0 -3
  112. package/dist/voice/integrations/findIntegrationsCredentials.d.ts +0 -3
  113. package/dist/voice/integrations/findIntegrationsCredentials.js +0 -7
  114. package/dist/voice/integrations/makeCreateContainer.d.ts +0 -4
  115. package/dist/voice/makeCreateVoiceClient.js +0 -74
  116. package/dist/voice/utils/makeGetChannelVar.d.ts +0 -4
  117. package/dist/voice/utils/makeGetChannelVarWithoutThrow.d.ts +0 -4
  118. /package/dist/applications/{utils → validation}/prepareForValidation.d.ts +0 -0
  119. /package/dist/applications/{utils → validation}/prepareForValidation.js +0 -0
  120. /package/dist/applications/{utils → validation}/validOrThrow.d.ts +0 -0
@@ -19,11 +19,11 @@ exports.buildService = buildService;
19
19
  * See the License for the specific language governing permissions and
20
20
  * limitations under the License.
21
21
  */
22
- const createApplication_1 = require("./createApplication");
23
- const deleteApplication_1 = require("./deleteApplication");
24
- const getApplication_1 = require("./getApplication");
25
- const listApplications_1 = require("./listApplications");
26
- const updateApplication_1 = require("./updateApplication");
22
+ const createCreateApplication_1 = require("./createCreateApplication");
23
+ const createDeleteApplication_1 = require("./createDeleteApplication");
24
+ const createGetApplication_1 = require("./createGetApplication");
25
+ const createListApplications_1 = require("./createListApplications");
26
+ const createUpdateApplication_1 = require("./createUpdateApplication");
27
27
  function buildService(prisma) {
28
28
  return {
29
29
  definition: {
@@ -33,11 +33,11 @@ function buildService(prisma) {
33
33
  proto: "applications.proto"
34
34
  },
35
35
  handlers: {
36
- createApplication: (0, createApplication_1.createApplication)(prisma),
37
- getApplication: (0, getApplication_1.getApplication)(prisma),
38
- listApplications: (0, listApplications_1.listApplications)(prisma),
39
- deleteApplication: (0, deleteApplication_1.deleteApplication)(prisma),
40
- updateApplication: (0, updateApplication_1.updateApplication)(prisma)
36
+ createApplication: (0, createCreateApplication_1.createCreateApplication)(prisma),
37
+ getApplication: (0, createGetApplication_1.createGetApplication)(prisma),
38
+ listApplications: (0, createListApplications_1.createListApplications)(prisma),
39
+ deleteApplication: (0, createDeleteApplication_1.createDeleteApplication)(prisma),
40
+ updateApplication: (0, createUpdateApplication_1.createUpdateApplication)(prisma)
41
41
  }
42
42
  };
43
43
  }
@@ -1,6 +1,6 @@
1
1
  import { GrpcErrorMessage } from "@fonoster/common";
2
2
  import { Prisma } from "../core/db";
3
- declare function createApplication(prisma: Prisma): (call: {
3
+ declare function createCreateApplication(prisma: Prisma): (call: {
4
4
  request: unknown;
5
5
  }, callback: (error?: GrpcErrorMessage, response?: unknown) => void) => Promise<void>;
6
- export { createApplication };
6
+ export { createCreateApplication };
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.createApplication = createApplication;
12
+ exports.createCreateApplication = createCreateApplication;
13
13
  /*
14
14
  * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
15
15
  * http://github.com/fonoster/fonoster
@@ -29,25 +29,32 @@ exports.createApplication = createApplication;
29
29
  * limitations under the License.
30
30
  */
31
31
  const common_1 = require("@fonoster/common");
32
- const identity_1 = require("@fonoster/identity");
33
32
  const logger_1 = require("@fonoster/logger");
34
33
  const convertToApplicationData_1 = require("./utils/convertToApplicationData");
35
- const validOrThrow_1 = require("./utils/validOrThrow");
34
+ const validOrThrow_1 = require("./validation/validOrThrow");
35
+ const envs_1 = require("../envs");
36
+ const client_1 = require("@prisma/client");
36
37
  const logger = (0, logger_1.getLogger)({ service: "apiserver", filePath: __filename });
37
- function createApplication(prisma) {
38
- const fn = (call, callback) => __awaiter(this, void 0, void 0, function* () {
38
+ function createCreateApplication(prisma) {
39
+ const createApplication = (call, callback) => __awaiter(this, void 0, void 0, function* () {
39
40
  const { request } = call;
40
41
  const { type } = request;
41
- const accessKeyId = (0, identity_1.getAccessKeyIdFromCall)(call);
42
+ const accessKeyId = (0, common_1.getAccessKeyIdFromCall)(call);
42
43
  logger.verbose("call to createApplication", {
43
44
  accessKeyId,
44
45
  type
45
46
  });
47
+ if (type === client_1.ApplicationType.AUTOPILOT && !request.endpoint) {
48
+ logger.verbose("setting default endpoint for autopilot application", {
49
+ autopilotEndpoint: envs_1.APISERVER_AUTOPILOT_ENDPOINT
50
+ });
51
+ request.endpoint = envs_1.APISERVER_AUTOPILOT_ENDPOINT;
52
+ }
46
53
  (0, validOrThrow_1.validOrThrow)(request);
47
54
  const result = yield prisma.application.create({
48
55
  data: Object.assign(Object.assign({}, (0, convertToApplicationData_1.convertToApplicationData)(request)), { accessKeyId })
49
56
  });
50
57
  callback(null, { ref: result.ref });
51
58
  });
52
- return (0, common_1.withErrorHandling)(fn);
59
+ return (0, common_1.withErrorHandling)(createApplication);
53
60
  }
@@ -1,5 +1,5 @@
1
1
  import { Prisma } from "../core/db";
2
- declare function getApplication(prisma: Prisma): (call: {
2
+ declare function createDeleteApplication(prisma: Prisma): (call: {
3
3
  request: unknown;
4
4
  }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: unknown) => void) => Promise<void>;
5
- export { getApplication };
5
+ export { createDeleteApplication };
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.deleteApplication = deleteApplication;
12
+ exports.createDeleteApplication = createDeleteApplication;
13
13
  /*
14
14
  * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
15
15
  * http://github.com/fonoster/fonoster
@@ -33,13 +33,13 @@ const identity_1 = require("@fonoster/identity");
33
33
  const logger_1 = require("@fonoster/logger");
34
34
  const createGetFnUtil_1 = require("./createGetFnUtil");
35
35
  const logger = (0, logger_1.getLogger)({ service: "apiserver", filePath: __filename });
36
- function deleteApplication(prisma) {
36
+ function createDeleteApplication(prisma) {
37
37
  const getFn = (0, createGetFnUtil_1.createGetFnUtil)(prisma);
38
- const fn = (call) => __awaiter(this, void 0, void 0, function* () {
38
+ const deleteApplication = (call) => __awaiter(this, void 0, void 0, function* () {
39
39
  const { ref } = call.request;
40
40
  logger.verbose("call to deleteApplication", { ref });
41
41
  yield prisma.application.delete({ where: { ref } });
42
42
  return { ref };
43
43
  });
44
- return (0, common_1.withErrorHandlingAndValidation)((0, identity_1.withAccess)(fn, (ref) => getFn(ref)), common_1.Validators.emptySchema);
44
+ return (0, common_1.withErrorHandlingAndValidation)((0, identity_1.withAccess)(deleteApplication, (ref) => getFn(ref)), common_1.Validators.emptySchema);
45
45
  }
@@ -1,5 +1,5 @@
1
1
  import { Prisma } from "../core/db";
2
- declare function updateApplication(prisma: Prisma): (call: {
2
+ declare function createGetApplication(prisma: Prisma): (call: {
3
3
  request: unknown;
4
4
  }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: unknown) => void) => Promise<void>;
5
- export { updateApplication };
5
+ export { createGetApplication };
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getApplication = getApplication;
12
+ exports.createGetApplication = createGetApplication;
13
13
  /*
14
14
  * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
15
15
  * http://github.com/fonoster/fonoster
@@ -34,13 +34,13 @@ const createGetFnUtil_1 = require("./createGetFnUtil");
34
34
  const applicationWithEncodedStruct_1 = require("./utils/applicationWithEncodedStruct");
35
35
  const withErrorHandlingAndValidationAndAccess_1 = require("../utils/withErrorHandlingAndValidationAndAccess");
36
36
  const logger = (0, logger_1.getLogger)({ service: "apiserver", filePath: __filename });
37
- function getApplication(prisma) {
37
+ function createGetApplication(prisma) {
38
38
  const getFn = (0, createGetFnUtil_1.createGetFnUtil)(prisma);
39
- const fn = (call) => __awaiter(this, void 0, void 0, function* () {
39
+ const getApplication = (call) => __awaiter(this, void 0, void 0, function* () {
40
40
  const { ref } = call.request;
41
41
  logger.verbose("call to getApplication", { ref });
42
42
  const result = yield getFn(ref);
43
43
  return result ? (0, applicationWithEncodedStruct_1.applicationWithEncodedStruct)(result) : null;
44
44
  });
45
- return (0, withErrorHandlingAndValidationAndAccess_1.withErrorHandlingAndValidationAndAccess)(fn, (ref) => getFn(ref), common_1.Validators.emptySchema);
45
+ return (0, withErrorHandlingAndValidationAndAccess_1.withErrorHandlingAndValidationAndAccess)(getApplication, (ref) => getFn(ref), common_1.Validators.emptySchema);
46
46
  }
@@ -6,12 +6,14 @@ declare function createGetFnUtil(prisma: Prisma): (ref: string) => Promise<{
6
6
  textToSpeech: {
7
7
  ref: string;
8
8
  config: import("@prisma/client/runtime/library").JsonValue;
9
+ credentials: string;
9
10
  productRef: string;
10
11
  applicationRef: string;
11
12
  };
12
13
  speechToText: {
13
14
  ref: string;
14
15
  config: import("@prisma/client/runtime/library").JsonValue;
16
+ credentials: string;
15
17
  productRef: string;
16
18
  applicationRef: string;
17
19
  };
@@ -1,6 +1,6 @@
1
1
  import { GrpcErrorMessage } from "@fonoster/common";
2
2
  import { Prisma } from "../core/db";
3
- declare function listApplications(prisma: Prisma): (call: {
3
+ declare function createListApplications(prisma: Prisma): (call: {
4
4
  request: unknown;
5
5
  }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: unknown) => void) => Promise<void>;
6
- export { listApplications };
6
+ export { createListApplications };
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.listApplications = listApplications;
12
+ exports.createListApplications = createListApplications;
13
13
  /*
14
14
  * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
15
15
  * http://github.com/fonoster/fonoster
@@ -29,15 +29,14 @@ exports.listApplications = listApplications;
29
29
  * limitations under the License.
30
30
  */
31
31
  const common_1 = require("@fonoster/common");
32
- const identity_1 = require("@fonoster/identity");
33
32
  const logger_1 = require("@fonoster/logger");
34
33
  const applicationWithEncodedStruct_1 = require("./utils/applicationWithEncodedStruct");
35
34
  const logger = (0, logger_1.getLogger)({ service: "apiserver", filePath: __filename });
36
- function listApplications(prisma) {
37
- const fn = (call, callback) => __awaiter(this, void 0, void 0, function* () {
35
+ function createListApplications(prisma) {
36
+ const listApplications = (call, callback) => __awaiter(this, void 0, void 0, function* () {
38
37
  var _a;
39
38
  const { pageSize, pageToken } = call.request;
40
- const accessKeyId = (0, identity_1.getAccessKeyIdFromCall)(call);
39
+ const accessKeyId = (0, common_1.getAccessKeyIdFromCall)(call);
41
40
  logger.verbose("call to getApplication", {
42
41
  accessKeyId,
43
42
  pageSize,
@@ -60,5 +59,5 @@ function listApplications(prisma) {
60
59
  nextPageToken: (_a = result[result.length - 1]) === null || _a === void 0 ? void 0 : _a.ref
61
60
  });
62
61
  });
63
- return (0, common_1.withErrorHandlingAndValidation)(fn, common_1.Validators.listRequestSchema);
62
+ return (0, common_1.withErrorHandlingAndValidation)(listApplications, common_1.Validators.listRequestSchema);
64
63
  }
@@ -1,5 +1,5 @@
1
1
  import { Prisma } from "../core/db";
2
- declare function deleteApplication(prisma: Prisma): (call: {
2
+ declare function createUpdateApplication(prisma: Prisma): (call: {
3
3
  request: unknown;
4
4
  }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: unknown) => void) => Promise<void>;
5
- export { deleteApplication };
5
+ export { createUpdateApplication };
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.updateApplication = updateApplication;
12
+ exports.createUpdateApplication = createUpdateApplication;
13
13
  /*
14
14
  * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
15
15
  * http://github.com/fonoster/fonoster
@@ -29,18 +29,18 @@ exports.updateApplication = updateApplication;
29
29
  * limitations under the License.
30
30
  */
31
31
  const common_1 = require("@fonoster/common");
32
- const identity_1 = require("@fonoster/identity");
33
32
  const logger_1 = require("@fonoster/logger");
34
33
  const createGetFnUtil_1 = require("./createGetFnUtil");
35
34
  const convertToApplicationData_1 = require("./utils/convertToApplicationData");
36
- const validOrThrow_1 = require("./utils/validOrThrow");
35
+ const validOrThrow_1 = require("./validation/validOrThrow");
36
+ const identity_1 = require("@fonoster/identity");
37
37
  const logger = (0, logger_1.getLogger)({ service: "apiserver", filePath: __filename });
38
- function updateApplication(prisma) {
38
+ function createUpdateApplication(prisma) {
39
39
  const getFn = (0, createGetFnUtil_1.createGetFnUtil)(prisma);
40
- const fn = (call) => __awaiter(this, void 0, void 0, function* () {
40
+ const updateApplication = (call) => __awaiter(this, void 0, void 0, function* () {
41
41
  const { request } = call;
42
42
  const { type, ref: applicationRef } = request;
43
- const accessKeyId = (0, identity_1.getAccessKeyIdFromCall)(call);
43
+ const accessKeyId = (0, common_1.getAccessKeyIdFromCall)(call);
44
44
  (0, validOrThrow_1.validOrThrow)(request);
45
45
  logger.verbose("call to updateApplication", {
46
46
  accessKeyId,
@@ -72,5 +72,5 @@ function updateApplication(prisma) {
72
72
  ]);
73
73
  return { ref: applicationRef };
74
74
  });
75
- return (0, common_1.withErrorHandling)((0, identity_1.withAccess)(fn, (ref) => getFn(ref)));
75
+ return (0, common_1.withErrorHandling)((0, identity_1.withAccess)(updateApplication, (ref) => getFn(ref)));
76
76
  }
@@ -27,9 +27,11 @@ function applicationWithEncodedStruct(application) {
27
27
  };
28
28
  const result = Object.assign({}, application);
29
29
  if (application.textToSpeech) {
30
+ delete application.textToSpeech.credentials;
30
31
  result.textToSpeech = Object.assign(Object.assign({}, application.textToSpeech), { config: encodeConfig(application.textToSpeech) });
31
32
  }
32
33
  if (application.speechToText) {
34
+ delete application.speechToText.credentials;
33
35
  result.speechToText = Object.assign(Object.assign({}, application.speechToText), { config: encodeConfig(application.speechToText) });
34
36
  }
35
37
  if (application.intelligence) {
@@ -1,4 +1,4 @@
1
1
  import { CreateApplicationRequest, UpdateApplicationRequest } from "@fonoster/types";
2
- import { ApplicationData } from "../types";
3
- declare function convertToApplicationData(request: CreateApplicationRequest | UpdateApplicationRequest): ApplicationData;
2
+ import { Application } from "@prisma/client";
3
+ declare function convertToApplicationData(request: CreateApplicationRequest | UpdateApplicationRequest): Application;
4
4
  export { convertToApplicationData };