@fonoster/apiserver 0.12.6 → 0.12.8
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/dist/core/httpBridge.d.ts +0 -18
- package/dist/core/httpBridge.js +26 -0
- package/package.json +2 -2
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
-
* http://github.com/fonoster/fonoster
|
|
4
|
-
*
|
|
5
|
-
* This file is part of Fonoster
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the MIT License (the "License");
|
|
8
|
-
* you may not use this file except in compliance with
|
|
9
|
-
* the License. You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* https://opensource.org/licenses/MIT
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
1
|
import { Readable } from "stream";
|
|
20
2
|
import { IdentityConfig } from "@fonoster/identity";
|
|
21
3
|
declare function httpBridge(identityConfig: IdentityConfig, params: {
|
package/dist/core/httpBridge.js
CHANGED
|
@@ -13,6 +13,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.httpBridge = httpBridge;
|
|
16
|
+
/**
|
|
17
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
18
|
+
* http://github.com/fonoster/fonoster
|
|
19
|
+
*
|
|
20
|
+
* This file is part of Fonoster
|
|
21
|
+
*
|
|
22
|
+
* Licensed under the MIT License (the "License");
|
|
23
|
+
* you may not use this file except in compliance with
|
|
24
|
+
* the License. You may obtain a copy of the License at
|
|
25
|
+
*
|
|
26
|
+
* https://opensource.org/licenses/MIT
|
|
27
|
+
*
|
|
28
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
29
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
30
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
31
|
+
* See the License for the specific language governing permissions and
|
|
32
|
+
* limitations under the License.
|
|
33
|
+
*/
|
|
34
|
+
const fs_1 = __importDefault(require("fs"));
|
|
35
|
+
const path_1 = __importDefault(require("path"));
|
|
16
36
|
const identity_1 = require("@fonoster/identity");
|
|
17
37
|
const logger_1 = require("@fonoster/logger");
|
|
18
38
|
const express_1 = __importDefault(require("express"));
|
|
@@ -58,6 +78,12 @@ function httpBridge(identityConfig, params) {
|
|
|
58
78
|
res.redirect(identityConfig.workspaceInviteFailUrl);
|
|
59
79
|
}
|
|
60
80
|
}));
|
|
81
|
+
app.get("/api/recordings/:id", (req, res) => {
|
|
82
|
+
const RECORDINGS_PATH = path_1.default.join("/opt/fonoster/recordings", req.params.id);
|
|
83
|
+
const wave = fs_1.default.readFileSync(RECORDINGS_PATH);
|
|
84
|
+
res.setHeader("content-type", "audio/wav");
|
|
85
|
+
res.send(wave);
|
|
86
|
+
});
|
|
61
87
|
app.listen(port, () => {
|
|
62
88
|
logger.info(`HTTP bridge is running on port ${port}`);
|
|
63
89
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonoster/apiserver",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.8",
|
|
4
4
|
"description": "APIServer for Fonoster",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/fonoster#readme",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"@types/uuid": "^10.0.0",
|
|
74
74
|
"@types/validator": "^13.12.0"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "9f8a2105d2b9d7b98bb32d9439e3314b747e1083"
|
|
77
77
|
}
|