rhombus-node-mcp 0.1.5 → 0.1.7
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/index.js +2 -12
- package/dist/types.js +19 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31,22 +31,13 @@ const STATIC_ARGS = {
|
|
|
31
31
|
.optional(z.any())
|
|
32
32
|
.describe("Optional headers accepted by tools. LLM should never ever use this. 😅"),
|
|
33
33
|
};
|
|
34
|
-
const shouldUseCustomHeaders = (headers) => {
|
|
35
|
-
let valid = true;
|
|
36
|
-
if (!headers)
|
|
37
|
-
return false;
|
|
38
|
-
Object.keys(headers).forEach(key => {
|
|
39
|
-
if (headers[key].length === 0)
|
|
40
|
-
valid = false;
|
|
41
|
-
});
|
|
42
|
-
return valid;
|
|
43
|
-
};
|
|
44
34
|
async function postApi(url, body, customHeaders) {
|
|
45
35
|
let headers = {
|
|
46
|
-
...(
|
|
36
|
+
...(customHeaders || AUTH_HEADERS),
|
|
47
37
|
...STATIC_HEADERS,
|
|
48
38
|
};
|
|
49
39
|
try {
|
|
40
|
+
console.error(`[POSTAPI] - ${url} - ${body} - ${JSON.stringify(customHeaders)}`);
|
|
50
41
|
const response = await fetch(url, { method: "POST", headers, body });
|
|
51
42
|
if (!response.ok) {
|
|
52
43
|
if (response.status === 401 || response.status === 403) {
|
|
@@ -72,7 +63,6 @@ async function getOrg(headers) {
|
|
|
72
63
|
}
|
|
73
64
|
async function getLocations(headers) {
|
|
74
65
|
const url = BASE_URL + "/location/getLocationsV2";
|
|
75
|
-
console.error("headers:", JSON.stringify(headers));
|
|
76
66
|
return await postApi(url, "{}", headers);
|
|
77
67
|
}
|
|
78
68
|
async function getCameraList(headers) {
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const CreateVideoWallOptions = z.optional(z.object({
|
|
3
|
+
displayName: z.optional(z.string()).describe("What to call the video wall"),
|
|
4
|
+
orgUuid: z.string().describe("The uuid of the organization"),
|
|
5
|
+
deviceList: z
|
|
6
|
+
.array(z.string())
|
|
7
|
+
.min(1)
|
|
8
|
+
.describe("The list of camera uuids (unique identifiers) to exist in the video wall. You must provide this manually by prompting the user at least once."),
|
|
9
|
+
othersCanEdit: z
|
|
10
|
+
.optional(z.boolean())
|
|
11
|
+
.default(false)
|
|
12
|
+
.describe("Whether or not other users can edit the wall, defaults to false"),
|
|
13
|
+
settings: z.object({
|
|
14
|
+
rowCount: z.number(),
|
|
15
|
+
columnCount: z.number(),
|
|
16
|
+
intervalSeconds: z.optional(z.number()),
|
|
17
|
+
rotateStrategy: z.enum(["none", "motion", "interval"]),
|
|
18
|
+
}),
|
|
19
|
+
}));
|