@fonoster/apiserver 0.9.19 → 0.9.22

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 (180) hide show
  1. package/dist/applications/buildService.d.ts +18 -0
  2. package/dist/applications/buildService.js +0 -18
  3. package/dist/applications/createCreateApplication.d.ts +18 -0
  4. package/dist/applications/createCreateApplication.js +2 -2
  5. package/dist/applications/createDeleteApplication.js +1 -1
  6. package/dist/applications/createGetApplication.js +2 -2
  7. package/dist/applications/createGetFnUtil.d.ts +3 -3
  8. package/dist/applications/createGetFnUtil.js +1 -1
  9. package/dist/applications/createListApplications.d.ts +18 -0
  10. package/dist/applications/createListApplications.js +1 -1
  11. package/dist/applications/createUpdateApplication.js +2 -2
  12. package/dist/applications/index.d.ts +18 -0
  13. package/dist/applications/index.js +1 -1
  14. package/dist/applications/types.d.ts +18 -0
  15. package/dist/applications/utils/applicationWithEncodedStruct.js +1 -1
  16. package/dist/applications/utils/convertToApplicationData.d.ts +18 -0
  17. package/dist/applications/validation/assistantWithoutApiKeySchema.js +1 -1
  18. package/dist/applications/validation/createValidationSchema.d.ts +4 -4
  19. package/dist/applications/validation/createValidationSchema.js +2 -2
  20. package/dist/applications/validation/prepareForValidation.d.ts +18 -0
  21. package/dist/applications/validation/speechValidators.d.ts +18 -0
  22. package/dist/applications/validation/speechValidators.js +1 -1
  23. package/dist/applications/validation/validOrThrow.d.ts +18 -0
  24. package/dist/calls/buildService.d.ts +18 -0
  25. package/dist/calls/buildService.js +3 -21
  26. package/dist/calls/createCall.d.ts +19 -1
  27. package/dist/calls/createCall.js +1 -1
  28. package/dist/calls/createCallPublisher.js +1 -1
  29. package/dist/calls/createFetchCalls.d.ts +19 -1
  30. package/dist/calls/createFetchCalls.js +2 -2
  31. package/dist/calls/createFetchSingleCall.d.ts +19 -1
  32. package/dist/calls/createFetchSingleCall.js +2 -2
  33. package/dist/calls/createTrackCall.js +1 -1
  34. package/dist/calls/getCall.d.ts +18 -0
  35. package/dist/calls/getCall.js +2 -2
  36. package/dist/calls/index.d.ts +18 -0
  37. package/dist/calls/index.js +1 -1
  38. package/dist/calls/influxdb.js +1 -1
  39. package/dist/calls/listCalls.d.ts +18 -0
  40. package/dist/calls/listCalls.js +1 -1
  41. package/dist/calls/runCallManager.js +1 -1
  42. package/dist/calls/types.d.ts +18 -0
  43. package/dist/core/allowList.d.ts +18 -0
  44. package/dist/core/allowList.js +2 -1
  45. package/dist/core/badRequestError.d.ts +18 -0
  46. package/dist/core/badRequestError.js +1 -1
  47. package/dist/core/buildWelcomeDemoService.d.ts +18 -0
  48. package/dist/core/buildWelcomeDemoService.js +1 -1
  49. package/dist/core/db.js +1 -1
  50. package/dist/core/httpBridge.d.ts +18 -0
  51. package/dist/core/identityConfig.js +1 -1
  52. package/dist/core/loadServices.d.ts +18 -0
  53. package/dist/core/loadServices.js +1 -1
  54. package/dist/core/notFoundError.d.ts +18 -0
  55. package/dist/core/notFoundError.js +1 -1
  56. package/dist/core/removeSwaggerNotice.js +1 -2
  57. package/dist/core/routrConfig.js +1 -1
  58. package/dist/core/runServices.js +6 -6
  59. package/dist/core/seed.js +1 -1
  60. package/dist/core/services.d.ts +3 -0
  61. package/dist/core/services.js +4 -4
  62. package/dist/core/upsertDefaultPeer.d.ts +0 -1
  63. package/dist/core/upsertDefaultPeer.js +2 -3
  64. package/dist/envs.js +4 -4
  65. package/dist/events/createInfluxDbPub.js +1 -1
  66. package/dist/events/mapCallDirectionToEnum.d.ts +18 -0
  67. package/dist/events/mapCallDirectionToEnum.js +1 -1
  68. package/dist/events/nats.js +1 -1
  69. package/dist/events/transformEvent.js +2 -2
  70. package/dist/events/types.d.ts +18 -0
  71. package/dist/index.d.ts +0 -1
  72. package/dist/index.js +2 -21
  73. package/dist/secrets/buildService.d.ts +18 -0
  74. package/dist/secrets/buildService.js +0 -18
  75. package/dist/secrets/createGetFnUtil.d.ts +2 -2
  76. package/dist/secrets/createGetFnUtil.js +1 -1
  77. package/dist/secrets/createSecret.d.ts +18 -0
  78. package/dist/secrets/createSecret.js +1 -1
  79. package/dist/secrets/deleteSecret.js +2 -2
  80. package/dist/secrets/getSecret.js +2 -2
  81. package/dist/secrets/index.d.ts +18 -0
  82. package/dist/secrets/index.js +1 -1
  83. package/dist/secrets/listSecrets.d.ts +18 -0
  84. package/dist/secrets/listSecrets.js +1 -1
  85. package/dist/secrets/updateSecret.js +2 -2
  86. package/dist/utils/createCheckNumberPreconditions.js +1 -1
  87. package/dist/utils/createHandleDialEventsWithNats.d.ts +18 -0
  88. package/dist/utils/createHandleDialEventsWithNats.js +1 -1
  89. package/dist/utils/createHandleDialEventsWithVoiceClient.d.ts +18 -0
  90. package/dist/utils/createHandleDialEventsWithVoiceClient.js +0 -18
  91. package/dist/utils/index.d.ts +18 -0
  92. package/dist/utils/index.js +1 -1
  93. package/dist/utils/mapDialStatus.d.ts +18 -0
  94. package/dist/utils/mapDialStatus.js +1 -1
  95. package/dist/utils/withErrorHandlingAndValidationAndAccess.js +1 -2
  96. package/dist/voice/VoiceClientImpl.d.ts +18 -0
  97. package/dist/voice/VoiceClientImpl.js +3 -4
  98. package/dist/voice/VoiceDispatcher.js +2 -2
  99. package/dist/voice/connectToAri.js +4 -4
  100. package/dist/voice/createCreateVoiceClient.js +3 -3
  101. package/dist/voice/errors/ChannelVarNotFoundError.d.ts +18 -0
  102. package/dist/voice/errors/MethodNotImplementedError.d.ts +18 -0
  103. package/dist/voice/errors/MethodNotImplementedError.js +1 -1
  104. package/dist/voice/errors/index.d.ts +18 -0
  105. package/dist/voice/errors/index.js +1 -1
  106. package/dist/voice/handlers/createAnswerHandler.d.ts +18 -0
  107. package/dist/voice/handlers/createHangupHandler.d.ts +18 -0
  108. package/dist/voice/handlers/createPlaybackControlHandler.js +1 -1
  109. package/dist/voice/handlers/createRecordHandler.js +1 -1
  110. package/dist/voice/handlers/createSayHandler.js +1 -1
  111. package/dist/voice/handlers/createStreamGatherHandler.js +1 -1
  112. package/dist/voice/handlers/createStreamHandler.js +1 -1
  113. package/dist/voice/handlers/dial/createDialHandler.d.ts +18 -0
  114. package/dist/voice/handlers/dial/createDialHandler.js +4 -4
  115. package/dist/voice/handlers/dial/handleChannelLeftBridge.d.ts +18 -0
  116. package/dist/voice/handlers/dial/handleStasisEnd.d.ts +18 -0
  117. package/dist/voice/handlers/dial/handleStasisStart.d.ts +18 -0
  118. package/dist/voice/handlers/dial/handleStasisStart.js +1 -1
  119. package/dist/voice/handlers/dial/index.d.ts +18 -0
  120. package/dist/voice/handlers/dial/index.js +1 -1
  121. package/dist/voice/handlers/dial/recordChannel.d.ts +18 -0
  122. package/dist/voice/handlers/dial/recordChannel.js +1 -1
  123. package/dist/voice/handlers/gather/createGatherHandler.js +2 -2
  124. package/dist/voice/handlers/gather/getTimeoutPromise.d.ts +18 -0
  125. package/dist/voice/handlers/index.d.ts +18 -0
  126. package/dist/voice/handlers/index.js +1 -1
  127. package/dist/voice/handlers/utils/awaitForPlaybackFinished.d.ts +18 -0
  128. package/dist/voice/handlers/utils/awaitForRecordingFinished.js +1 -1
  129. package/dist/voice/handlers/utils/index.d.ts +18 -0
  130. package/dist/voice/handlers/utils/index.js +1 -1
  131. package/dist/voice/handlers/utils/isDtmf.d.ts +18 -0
  132. package/dist/voice/handlers/utils/isDtmf.js +1 -1
  133. package/dist/voice/handlers/utils/textChunksByClause.js +1 -2
  134. package/dist/voice/handlers/utils/textChunksByFirstNaturalPause.js +1 -2
  135. package/dist/voice/handlers/utils/withErrorHandling.d.ts +18 -0
  136. package/dist/voice/integrations/ApplicationNotFoundError.d.ts +18 -0
  137. package/dist/voice/integrations/ApplicationNotFoundError.js +1 -1
  138. package/dist/voice/integrations/createCreateContainer.d.ts +1 -1
  139. package/dist/voice/integrations/createCreateContainer.js +5 -5
  140. package/dist/voice/integrations/getSttConfig.d.ts +18 -0
  141. package/dist/voice/integrations/getSttConfig.js +1 -1
  142. package/dist/voice/integrations/getTtsConfig.js +18 -0
  143. package/dist/voice/integrations/index.d.ts +18 -0
  144. package/dist/voice/integrations/index.js +1 -1
  145. package/dist/voice/integrations/types.d.ts +18 -0
  146. package/dist/voice/stt/AbstractSpeechToText.d.ts +19 -1
  147. package/dist/voice/stt/Deepgram.d.ts +19 -1
  148. package/dist/voice/stt/Deepgram.js +4 -3
  149. package/dist/voice/stt/Google.d.ts +1 -1
  150. package/dist/voice/stt/Google.js +19 -1
  151. package/dist/voice/stt/SpeechToTextFactory.js +1 -1
  152. package/dist/voice/stt/types.d.ts +18 -0
  153. package/dist/voice/transcribeOnConnection.d.ts +18 -0
  154. package/dist/voice/tts/AbstractTextToSpeech.d.ts +18 -0
  155. package/dist/voice/tts/Azure.d.ts +18 -0
  156. package/dist/voice/tts/Azure.js +1 -1
  157. package/dist/voice/tts/Deepgram.d.ts +18 -0
  158. package/dist/voice/tts/Deepgram.js +2 -3
  159. package/dist/voice/tts/ElevenLabs.d.ts +18 -0
  160. package/dist/voice/tts/ElevenLabs.js +2 -2
  161. package/dist/voice/tts/Google.d.ts +18 -0
  162. package/dist/voice/tts/Google.js +1 -1
  163. package/dist/voice/tts/TextToSpeechFactory.js +1 -1
  164. package/dist/voice/tts/isSsml.d.ts +18 -0
  165. package/dist/voice/tts/isSsml.js +1 -1
  166. package/dist/voice/tts/streamToBuffer.d.ts +18 -0
  167. package/dist/voice/tts/streamToBuffer.js +1 -2
  168. package/dist/voice/tts/types.d.ts +18 -0
  169. package/dist/voice/types/ari.d.ts +18 -0
  170. package/dist/voice/types/ari.js +1 -1
  171. package/dist/voice/types/index.d.ts +18 -0
  172. package/dist/voice/types/index.js +1 -1
  173. package/dist/voice/types/voice.d.ts +18 -0
  174. package/dist/voice/utils/VoiceServiceClientConstructor.js +1 -1
  175. package/dist/voice/utils/createExternalMediaConfig.js +1 -1
  176. package/dist/voice/utils/createGetChannelVar.d.ts +18 -0
  177. package/dist/voice/utils/createGetChannelVarWithoutThrow.d.ts +18 -0
  178. package/dist/voice/utils/index.d.ts +18 -0
  179. package/dist/voice/utils/index.js +1 -1
  180. package/package.json +9 -9
@@ -1,3 +1,21 @@
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
+ */
1
19
  import { GrpcErrorMessage, InfluxDBClient } from "@fonoster/common";
2
20
  declare function getCall(influx: InfluxDBClient): (call: {
3
21
  request: unknown;
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.getCall = getCall;
13
- /*
13
+ /**
14
14
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
15
15
  * http://github.com/fonoster/fonoster
16
16
  *
@@ -30,8 +30,8 @@ exports.getCall = getCall;
30
30
  */
31
31
  const common_1 = require("@fonoster/common");
32
32
  const logger_1 = require("@fonoster/logger");
33
- const createFetchSingleCall_1 = require("./createFetchSingleCall");
34
33
  const notFoundError_1 = require("../core/notFoundError");
34
+ const createFetchSingleCall_1 = require("./createFetchSingleCall");
35
35
  const logger = (0, logger_1.getLogger)({ service: "apiserver", filePath: __filename });
36
36
  function getCall(influx) {
37
37
  const fetchSingleCall = (0, createFetchSingleCall_1.createFetchSingleCall)(influx);
@@ -1 +1,19 @@
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
+ */
1
19
  export { buildService as buildCallsService } from "./buildService";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.buildCallsService = void 0;
4
- /*
4
+ /**
5
5
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
6
6
  * http://github.com/fonoster/fonoster
7
7
  *
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.influxdb = void 0;
4
- /*
4
+ /**
5
5
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
6
6
  * http://github.com/fonoster/fonoster
7
7
  *
@@ -1,3 +1,21 @@
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
+ */
1
19
  import { GrpcErrorMessage, InfluxDBClient } from "@fonoster/common";
2
20
  declare function listCalls(influx: InfluxDBClient): (call: {
3
21
  request: unknown;
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.listCalls = listCalls;
13
- /*
13
+ /**
14
14
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
15
15
  * http://github.com/fonoster/fonoster
16
16
  *
@@ -13,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.createCreateCallSubscriber = createCreateCallSubscriber;
16
- /*
16
+ /**
17
17
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
18
18
  * http://github.com/fonoster/fonoster
19
19
  *
@@ -1,3 +1,21 @@
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
+ */
1
19
  import { DialStatus, GrpcErrorMessage } from "@fonoster/common";
2
20
  import { CallDetailRecord, CallStatus, CallType } from "@fonoster/types";
3
21
  type ListCallsRequest = {
@@ -1,2 +1,20 @@
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
+ */
1
19
  declare const allowList: string[];
2
20
  export { allowList };
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.allowList = void 0;
4
- /*
4
+ /**
5
5
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
6
6
  * http://github.com/fonoster/fonoster
7
7
  *
@@ -22,6 +22,7 @@ exports.allowList = void 0;
22
22
  const allowList = [
23
23
  "/grpc.health.v1.Health/Check",
24
24
  "/fonoster.identity.v1beta2.Identity/CreateUser",
25
+ "/fonoster.identity.v1beta2.Identity/CreateUserWithOauth2Code",
25
26
  "/fonoster.identity.v1beta2.Identity/CreateWorkspace",
26
27
  "/fonoster.identity.v1beta2.Identity/ExchangeApiKey",
27
28
  "/fonoster.identity.v1beta2.Identity/ExchangeCredentials",
@@ -1,3 +1,21 @@
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
+ */
1
19
  import { status } from "@grpc/grpc-js";
2
20
  declare const badRequestError: (message: string) => {
3
21
  code: status;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.badRequestError = void 0;
4
- /*
4
+ /**
5
5
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
6
6
  * http://github.com/fonoster/fonoster
7
7
  *
@@ -1,3 +1,21 @@
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
+ */
1
19
  import { VoiceSessionStreamServer } from "@fonoster/common";
2
20
  declare function buildWelcomeDemoService(): {
3
21
  definition: {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.buildWelcomeDemoService = buildWelcomeDemoService;
4
- /*
4
+ /**
5
5
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
6
6
  * http://github.com/fonoster/fonoster
7
7
  *
package/dist/core/db.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.prisma = void 0;
4
- /*
4
+ /**
5
5
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
6
6
  * http://github.com/fonoster/fonoster
7
7
  *
@@ -1,3 +1,21 @@
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
+ */
1
19
  import { Readable } from "stream";
2
20
  import { IdentityConfig } from "@fonoster/identity";
3
21
  declare function httpBridge(identityConfig: IdentityConfig, params: {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.identityConfig = void 0;
4
- /*
4
+ /**
5
5
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
6
6
  * http://github.com/fonoster/fonoster
7
7
  *
@@ -1,3 +1,21 @@
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
+ */
1
19
  import { ServiceDefinitionParams } from "@fonoster/common";
2
20
  import * as grpc from "@grpc/grpc-js";
3
21
  type FonosterService = {
@@ -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
- /*
12
+ /**
13
13
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
14
14
  * http://github.com/fonoster/fonoster
15
15
  *
@@ -1,3 +1,21 @@
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
+ */
1
19
  import { status } from "@grpc/grpc-js";
2
20
  declare const notFoundError: (message: string) => {
3
21
  code: status;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.notFoundError = void 0;
4
- /*
4
+ /**
5
5
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
6
6
  * http://github.com/fonoster/fonoster
7
7
  *
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- /*
3
+ /**
4
4
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
5
5
  * http://github.com/fonoster/fonoster
6
6
  *
@@ -18,7 +18,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  * See the License for the specific language governing permissions and
19
19
  * limitations under the License.
20
20
  */
21
- // eslint-disable-next-line no-console
22
21
  const originalLog = console.log;
23
22
  const containsDeprecationWarning = (str) => {
24
23
  const deprecationWarning = "This API is using a deprecated version of Swagger! Please see http://github.com/wordnik/swagger-core/wiki for more info";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.routrConfig = void 0;
4
- /*
4
+ /**
5
5
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
6
6
  * http://github.com/fonoster/fonoster
7
7
  *
@@ -45,7 +45,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
45
45
  return (mod && mod.__esModule) ? mod : { "default": mod };
46
46
  };
47
47
  Object.defineProperty(exports, "__esModule", { value: true });
48
- /*
48
+ /**
49
49
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
50
50
  * http://github.com/fonoster/fonoster
51
51
  *
@@ -63,19 +63,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
63
63
  * See the License for the specific language governing permissions and
64
64
  * limitations under the License.
65
65
  */
66
+ const authz_1 = require("@fonoster/authz");
66
67
  const common_1 = require("@fonoster/common");
67
68
  const logger_1 = require("@fonoster/logger");
68
69
  const grpc = __importStar(require("@grpc/grpc-js"));
69
70
  const grpc_health_check_1 = require("grpc-health-check");
70
- const allowList_1 = require("./allowList");
71
- const httpBridge_1 = require("./httpBridge");
72
- const loadServices_1 = __importDefault(require("./loadServices"));
73
- const services_1 = __importDefault(require("./services"));
74
71
  const runCallManager_1 = require("../calls/runCallManager");
75
72
  const envs_1 = require("../envs");
76
73
  const connectToAri_1 = require("../voice/connectToAri");
77
- const authz_1 = require("@fonoster/authz");
74
+ const allowList_1 = require("./allowList");
75
+ const httpBridge_1 = require("./httpBridge");
78
76
  const identityConfig_1 = require("./identityConfig");
77
+ const loadServices_1 = __importDefault(require("./loadServices"));
78
+ const services_1 = __importDefault(require("./services"));
79
79
  const logger = (0, logger_1.getLogger)({ service: "apiserver", filePath: __filename });
80
80
  const authorization = (0, common_1.createAuthInterceptor)(envs_1.IDENTITY_PUBLIC_KEY, allowList_1.allowList);
81
81
  const checkMethodAuthorized = (0, authz_1.createCheckMethodAuthorized)(`${envs_1.AUTHZ_SERVICE_HOST}:${envs_1.AUTHZ_SERVICE_PORT}`, envs_1.AUTHZ_SERVICE_METHODS);
package/dist/core/seed.js CHANGED
@@ -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
- /*
12
+ /**
13
13
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
14
14
  * http://github.com/fonoster/fonoster
15
15
  *
@@ -105,6 +105,9 @@ declare const services: Promise<[{
105
105
  createUser: (call: {
106
106
  request: unknown;
107
107
  }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: unknown) => void) => Promise<void>;
108
+ createUserWithOauth2Code: (call: {
109
+ request: unknown;
110
+ }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: unknown) => void) => Promise<void>;
108
111
  getUser: (call: {
109
112
  request: unknown;
110
113
  }, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: unknown) => void) => Promise<void>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- /*
3
+ /**
4
4
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
5
5
  * http://github.com/fonoster/fonoster
6
6
  *
@@ -20,15 +20,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
20
20
  */
21
21
  const identity_1 = require("@fonoster/identity");
22
22
  const sipnet_1 = require("@fonoster/sipnet");
23
- const db_1 = require("./db");
24
- const identityConfig_1 = require("./identityConfig");
25
- const routrConfig_1 = require("./routrConfig");
26
23
  const applications_1 = require("../applications");
27
24
  const calls_1 = require("../calls");
28
25
  const influxdb_1 = require("../calls/influxdb");
29
26
  const secrets_1 = require("../secrets");
30
27
  const utils_1 = require("../utils");
31
28
  const buildWelcomeDemoService_1 = require("./buildWelcomeDemoService");
29
+ const db_1 = require("./db");
30
+ const identityConfig_1 = require("./identityConfig");
31
+ const routrConfig_1 = require("./routrConfig");
32
32
  const applicationsService = (0, applications_1.buildApplicationsService)(db_1.prisma);
33
33
  const secretsService = (0, secrets_1.buildSecretsService)(db_1.prisma);
34
34
  const callsService = (0, calls_1.buildCallsService)(influxdb_1.influxdb);
@@ -1,3 +1,2 @@
1
- #!/usr/bin/env node
2
1
  declare function upsertDefaultPeer(): Promise<void>;
3
2
  export { upsertDefaultPeer };
@@ -1,4 +1,3 @@
1
- #!/usr/bin/env node
2
1
  "use strict";
3
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -14,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
13
  };
15
14
  Object.defineProperty(exports, "__esModule", { value: true });
16
15
  exports.upsertDefaultPeer = upsertDefaultPeer;
17
- /*
16
+ /**
18
17
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
19
18
  * http://github.com/fonoster/fonoster
20
19
  *
@@ -35,8 +34,8 @@ exports.upsertDefaultPeer = upsertDefaultPeer;
35
34
  const logger_1 = require("@fonoster/logger");
36
35
  const common_1 = require("@routr/common");
37
36
  const sdk_1 = __importDefault(require("@routr/sdk"));
38
- const routrConfig_1 = require("./routrConfig");
39
37
  const envs_1 = require("../envs");
38
+ const routrConfig_1 = require("./routrConfig");
40
39
  const logger = (0, logger_1.getLogger)({ service: "apiserver", filePath: __filename });
41
40
  function createCredentialsForDefaultPeer() {
42
41
  const credentials = new sdk_1.default.Credentials(routrConfig_1.routrConfig);
package/dist/envs.js CHANGED
@@ -6,7 +6,7 @@ var _a;
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.SMTP_AUTH_USER = exports.SMTP_AUTH_PASS = exports.ROUTR_DEFAULT_PEER_USERNAME = exports.ROUTR_DEFAULT_PEER_PASSWORD = exports.ROUTR_DEFAULT_PEER_NAME = exports.ROUTR_DEFAULT_PEER_AOR = exports.ROUTR_API_ENDPOINT = exports.OWNER_PASSWORD = exports.OWNER_NAME = exports.OWNER_EMAIL = exports.NATS_URL = exports.INTEGRATIONS_FILE = exports.INFLUXDB_USERNAME = exports.INFLUXDB_URL = exports.INFLUXDB_TOKEN = exports.INFLUXDB_PASSWORD = exports.INFLUXDB_ORG = exports.AUTHZ_SERVICE_METHODS = exports.AUTHZ_SERVICE_PORT = exports.AUTHZ_SERVICE_HOST = exports.AUTHZ_SERVICE_ENABLED = exports.IDENTITY_DATABASE_URL = exports.IDENTITY_WORKSPACE_INVITE_URL = exports.IDENTITY_WORKSPACE_INVITE_EXPIRATION = exports.IDENTITY_RESET_PASSWORD_URL = exports.IDENTITY_WORKSPACE_INVITE_FAIL_URL = exports.IDENTITY_REFRESH_TOKEN_EXPIRES_IN = exports.IDENTITY_PUBLIC_KEY = exports.IDENTITY_PRIVATE_KEY = exports.IDENTITY_OAUTH2_GITHUB_CLIENT_SECRET = exports.IDENTITY_OAUTH2_GITHUB_CLIENT_ID = exports.IDENTITY_OAUTH2_GITHUB_ENABLED = exports.IDENTITY_USER_VERIFICATION_REQUIRED = exports.IDENTITY_ISSUER = exports.IDENTITY_ID_TOKEN_EXPIRES_IN = exports.IDENTITY_AUDIENCE = exports.IDENTITY_ACCESS_TOKEN_EXPIRES_IN = exports.HTTP_BRIDGE_PORT = exports.DEFAULT_NATS_QUEUE_GROUP = exports.CLOAK_ENCRYPTION_KEY = exports.CALLS_TRACK_CALL_SUBJECT = exports.CALLS_CREATE_SUBJECT = exports.ASTERISK_TRUNK = exports.ASTERISK_SYSTEM_DOMAIN = exports.ASTERISK_ARI_USERNAME = exports.ASTERISK_ARI_SECRET = exports.ASTERISK_ARI_PROXY_URL = exports.APP_URL = exports.APISERVER_HOST = exports.APISERVER_BIND_ADDR = void 0;
8
8
  exports.TWILIO_PHONE_NUMBER = exports.TWILIO_AUTH_TOKEN = exports.TWILIO_ACCOUNT_SID = exports.TEMPLATES_DIR = exports.SMTP_SENDER = exports.SMTP_SECURE = exports.SMTP_PORT = exports.SMTP_HOST = void 0;
9
- /*
9
+ /**
10
10
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
11
11
  * http://github.com/fonoster/fonoster
12
12
  *
@@ -99,9 +99,9 @@ if (e.APISERVER_IDENTITY_OAUTH2_GITHUB_ENABLED === "true") {
99
99
  }
100
100
  if (exports.IDENTITY_USER_VERIFICATION_REQUIRED) {
101
101
  (0, common_1.assertEnvsAreSet)([
102
- "TWILIO_ACCOUNT_SID",
103
- "TWILIO_AUTH_TOKEN",
104
- "TWILIO_PHONE_NUMBER"
102
+ "APISERVER_TWILIO_ACCOUNT_SID",
103
+ "APISERVER_TWILIO_AUTH_TOKEN",
104
+ "APISERVER_TWILIO_PHONE_NUMBER"
105
105
  ]);
106
106
  }
107
107
  if (e.APISERVER_AUTHZ_SERVICE_ENABLED === "true") {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createInfluxDbPub = createInfluxDbPub;
4
- /*
4
+ /**
5
5
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
6
6
  * http://github.com/fonoster/fonoster
7
7
  *
@@ -1,3 +1,21 @@
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
+ */
1
19
  import { CallDirection } from "@fonoster/types";
2
20
  declare function mapCallDirectionToEnum(direction: string): CallDirection;
3
21
  export { mapCallDirectionToEnum };
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mapCallDirectionToEnum = mapCallDirectionToEnum;
4
- /*
4
+ /**
5
5
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
6
6
  * http://github.com/fonoster/fonoster
7
7
  *
@@ -17,7 +17,7 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
17
17
  };
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.watchNats = watchNats;
20
- /*
20
+ /**
21
21
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
22
22
  * http://github.com/fonoster/fonoster
23
23
  *
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.transformEvent = transformEvent;
4
- /*
4
+ /**
5
5
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
6
6
  * http://github.com/fonoster/fonoster
7
7
  *
@@ -20,8 +20,8 @@ exports.transformEvent = transformEvent;
20
20
  * limitations under the License.
21
21
  */
22
22
  const types_1 = require("@fonoster/types");
23
- const mapCallDirectionToEnum_1 = require("./mapCallDirectionToEnum");
24
23
  const uuid_1 = require("uuid");
24
+ const mapCallDirectionToEnum_1 = require("./mapCallDirectionToEnum");
25
25
  const ACCESS_KEY_ID_HEADER = "X-Access-Key-Id";
26
26
  const CALL_REF_HEADER = "X-Call-Ref";
27
27
  const CALL_DIRECTION_HEADER = "X-Call-Direction";
@@ -1,3 +1,21 @@
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
+ */
1
19
  type RegisterEvent = {
2
20
  aor: string;
3
21
  registeredAt: Date;
package/dist/index.d.ts CHANGED
@@ -1,2 +1 @@
1
- #!/usr/bin/env node
2
1
  export {};