@codeqr/ts-mcp 0.6.0 → 0.7.0
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/filtering.d.mts +1 -0
- package/filtering.d.mts.map +1 -1
- package/filtering.d.ts +1 -0
- package/filtering.d.ts.map +1 -1
- package/filtering.js +4 -0
- package/filtering.js.map +1 -1
- package/filtering.mjs +3 -0
- package/filtering.mjs.map +1 -1
- package/headers.d.mts.map +1 -1
- package/headers.d.ts.map +1 -1
- package/headers.js +1 -1
- package/headers.js.map +1 -1
- package/headers.mjs +1 -1
- package/headers.mjs.map +1 -1
- package/http.js +2 -2
- package/http.js.map +1 -1
- package/http.mjs +2 -2
- package/http.mjs.map +1 -1
- package/package.json +3 -3
- package/server.js +1 -1
- package/server.mjs +1 -1
- package/src/filtering.ts +4 -0
- package/src/headers.ts +3 -1
- package/src/http.ts +2 -2
- package/src/server.ts +1 -1
- package/src/tools/domains/create-domains.ts +20 -4
- package/src/tools/domains/delete-domains.ts +10 -3
- package/src/tools/domains/list-domains.ts +11 -4
- package/src/tools/domains/update-domains.ts +20 -4
- package/src/tools/links/bulk/delete-links-bulk.ts +10 -3
- package/src/tools/links/delete-links.ts +10 -3
- package/src/tools/links/retrieve-info-links.ts +10 -3
- package/src/tools/projects/list-projects.ts +10 -3
- package/src/tools/projects/retrieve-projects.ts +10 -3
- package/src/tools/qrcodes/bulk/delete-qrcodes-bulk.ts +10 -3
- package/src/tools/qrcodes/count-qrcodes.ts +10 -3
- package/src/tools/qrcodes/delete-qrcodes.ts +10 -3
- package/src/tools/tags/create-tags.ts +10 -3
- package/src/tools/tags/delete-tags.ts +10 -3
- package/src/tools/tags/list-tags.ts +10 -3
- package/src/tools/tags/update-tags.ts +10 -3
- package/src/tools/track/track-lead-track.ts +10 -3
- package/src/tools/track/track-sale-track.ts +10 -3
- package/src/tools/types.ts +12 -0
- package/tools/domains/create-domains.d.mts.map +1 -1
- package/tools/domains/create-domains.d.ts.map +1 -1
- package/tools/domains/create-domains.js +19 -2
- package/tools/domains/create-domains.js.map +1 -1
- package/tools/domains/create-domains.mjs +21 -4
- package/tools/domains/create-domains.mjs.map +1 -1
- package/tools/domains/delete-domains.d.mts.map +1 -1
- package/tools/domains/delete-domains.d.ts.map +1 -1
- package/tools/domains/delete-domains.js +9 -1
- package/tools/domains/delete-domains.js.map +1 -1
- package/tools/domains/delete-domains.mjs +11 -3
- package/tools/domains/delete-domains.mjs.map +1 -1
- package/tools/domains/list-domains.d.mts.map +1 -1
- package/tools/domains/list-domains.d.ts.map +1 -1
- package/tools/domains/list-domains.js +10 -2
- package/tools/domains/list-domains.js.map +1 -1
- package/tools/domains/list-domains.mjs +12 -4
- package/tools/domains/list-domains.mjs.map +1 -1
- package/tools/domains/update-domains.d.mts.map +1 -1
- package/tools/domains/update-domains.d.ts.map +1 -1
- package/tools/domains/update-domains.js +19 -2
- package/tools/domains/update-domains.js.map +1 -1
- package/tools/domains/update-domains.mjs +21 -4
- package/tools/domains/update-domains.mjs.map +1 -1
- package/tools/links/bulk/delete-links-bulk.d.mts.map +1 -1
- package/tools/links/bulk/delete-links-bulk.d.ts.map +1 -1
- package/tools/links/bulk/delete-links-bulk.js +9 -1
- package/tools/links/bulk/delete-links-bulk.js.map +1 -1
- package/tools/links/bulk/delete-links-bulk.mjs +11 -3
- package/tools/links/bulk/delete-links-bulk.mjs.map +1 -1
- package/tools/links/delete-links.d.mts.map +1 -1
- package/tools/links/delete-links.d.ts.map +1 -1
- package/tools/links/delete-links.js +9 -1
- package/tools/links/delete-links.js.map +1 -1
- package/tools/links/delete-links.mjs +11 -3
- package/tools/links/delete-links.mjs.map +1 -1
- package/tools/links/retrieve-info-links.d.mts.map +1 -1
- package/tools/links/retrieve-info-links.d.ts.map +1 -1
- package/tools/links/retrieve-info-links.js +9 -1
- package/tools/links/retrieve-info-links.js.map +1 -1
- package/tools/links/retrieve-info-links.mjs +11 -3
- package/tools/links/retrieve-info-links.mjs.map +1 -1
- package/tools/projects/list-projects.d.mts.map +1 -1
- package/tools/projects/list-projects.d.ts.map +1 -1
- package/tools/projects/list-projects.js +9 -1
- package/tools/projects/list-projects.js.map +1 -1
- package/tools/projects/list-projects.mjs +11 -3
- package/tools/projects/list-projects.mjs.map +1 -1
- package/tools/projects/retrieve-projects.d.mts.map +1 -1
- package/tools/projects/retrieve-projects.d.ts.map +1 -1
- package/tools/projects/retrieve-projects.js +9 -1
- package/tools/projects/retrieve-projects.js.map +1 -1
- package/tools/projects/retrieve-projects.mjs +11 -3
- package/tools/projects/retrieve-projects.mjs.map +1 -1
- package/tools/qrcodes/bulk/delete-qrcodes-bulk.d.mts.map +1 -1
- package/tools/qrcodes/bulk/delete-qrcodes-bulk.d.ts.map +1 -1
- package/tools/qrcodes/bulk/delete-qrcodes-bulk.js +9 -1
- package/tools/qrcodes/bulk/delete-qrcodes-bulk.js.map +1 -1
- package/tools/qrcodes/bulk/delete-qrcodes-bulk.mjs +11 -3
- package/tools/qrcodes/bulk/delete-qrcodes-bulk.mjs.map +1 -1
- package/tools/qrcodes/count-qrcodes.d.mts.map +1 -1
- package/tools/qrcodes/count-qrcodes.d.ts.map +1 -1
- package/tools/qrcodes/count-qrcodes.js +9 -1
- package/tools/qrcodes/count-qrcodes.js.map +1 -1
- package/tools/qrcodes/count-qrcodes.mjs +11 -3
- package/tools/qrcodes/count-qrcodes.mjs.map +1 -1
- package/tools/qrcodes/delete-qrcodes.d.mts.map +1 -1
- package/tools/qrcodes/delete-qrcodes.d.ts.map +1 -1
- package/tools/qrcodes/delete-qrcodes.js +9 -1
- package/tools/qrcodes/delete-qrcodes.js.map +1 -1
- package/tools/qrcodes/delete-qrcodes.mjs +11 -3
- package/tools/qrcodes/delete-qrcodes.mjs.map +1 -1
- package/tools/tags/create-tags.d.mts.map +1 -1
- package/tools/tags/create-tags.d.ts.map +1 -1
- package/tools/tags/create-tags.js +9 -1
- package/tools/tags/create-tags.js.map +1 -1
- package/tools/tags/create-tags.mjs +11 -3
- package/tools/tags/create-tags.mjs.map +1 -1
- package/tools/tags/delete-tags.d.mts.map +1 -1
- package/tools/tags/delete-tags.d.ts.map +1 -1
- package/tools/tags/delete-tags.js +9 -1
- package/tools/tags/delete-tags.js.map +1 -1
- package/tools/tags/delete-tags.mjs +11 -3
- package/tools/tags/delete-tags.mjs.map +1 -1
- package/tools/tags/list-tags.d.mts.map +1 -1
- package/tools/tags/list-tags.d.ts.map +1 -1
- package/tools/tags/list-tags.js +9 -1
- package/tools/tags/list-tags.js.map +1 -1
- package/tools/tags/list-tags.mjs +11 -3
- package/tools/tags/list-tags.mjs.map +1 -1
- package/tools/tags/update-tags.d.mts.map +1 -1
- package/tools/tags/update-tags.d.ts.map +1 -1
- package/tools/tags/update-tags.js +9 -1
- package/tools/tags/update-tags.js.map +1 -1
- package/tools/tags/update-tags.mjs +11 -3
- package/tools/tags/update-tags.mjs.map +1 -1
- package/tools/track/track-lead-track.d.mts.map +1 -1
- package/tools/track/track-lead-track.d.ts.map +1 -1
- package/tools/track/track-lead-track.js +9 -1
- package/tools/track/track-lead-track.js.map +1 -1
- package/tools/track/track-lead-track.mjs +11 -3
- package/tools/track/track-lead-track.mjs.map +1 -1
- package/tools/track/track-sale-track.d.mts.map +1 -1
- package/tools/track/track-sale-track.d.ts.map +1 -1
- package/tools/track/track-sale-track.js +9 -1
- package/tools/track/track-sale-track.js.map +1 -1
- package/tools/track/track-sale-track.mjs +11 -3
- package/tools/track/track-sale-track.mjs.map +1 -1
- package/tools/types.d.mts +1 -0
- package/tools/types.d.mts.map +1 -1
- package/tools/types.d.ts +1 -0
- package/tools/types.d.ts.map +1 -1
- package/tools/types.js +12 -0
- package/tools/types.js.map +1 -1
- package/tools/types.mjs +11 -0
- package/tools/types.mjs.map +1 -1
package/filtering.d.mts
CHANGED
package/filtering.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filtering.d.mts","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":"AAGA,wBAAsB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAM5F"}
|
|
1
|
+
{"version":3,"file":"filtering.d.mts","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":"AAGA,wBAAsB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAM5F;AAMD,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,KAAK,CAEpD"}
|
package/filtering.d.ts
CHANGED
package/filtering.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filtering.d.ts","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":"AAGA,wBAAsB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAM5F"}
|
|
1
|
+
{"version":3,"file":"filtering.d.ts","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":"AAGA,wBAAsB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAM5F;AAMD,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,KAAK,CAEpD"}
|
package/filtering.js
CHANGED
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.maybeFilter = maybeFilter;
|
|
7
|
+
exports.isJqError = isJqError;
|
|
7
8
|
// @ts-nocheck
|
|
8
9
|
const jq_web_1 = __importDefault(require("jq-web"));
|
|
9
10
|
async function maybeFilter(jqFilter, response) {
|
|
@@ -17,4 +18,7 @@ async function maybeFilter(jqFilter, response) {
|
|
|
17
18
|
async function jq(json, jqFilter) {
|
|
18
19
|
return (await jq_web_1.default).json(json, jqFilter);
|
|
19
20
|
}
|
|
21
|
+
function isJqError(error) {
|
|
22
|
+
return error instanceof Error && 'stderr' in error;
|
|
23
|
+
}
|
|
20
24
|
//# sourceMappingURL=filtering.js.map
|
package/filtering.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filtering.js","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":";;;;;AAGA,kCAMC;
|
|
1
|
+
{"version":3,"file":"filtering.js","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":";;;;;AAGA,kCAMC;AAMD,8BAEC;AAjBD,cAAc;AACd,oDAA4B;AAErB,KAAK,UAAU,WAAW,CAAC,QAA6B,EAAE,QAAa;IAC5E,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC7C,OAAO,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC,IAAS,EAAE,QAAgB;IAC3C,OAAO,CAAC,MAAM,gBAAM,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC;AAED,SAAgB,SAAS,CAAC,KAAU;IAClC,OAAO,KAAK,YAAY,KAAK,IAAI,QAAQ,IAAI,KAAK,CAAC;AACrD,CAAC"}
|
package/filtering.mjs
CHANGED
|
@@ -10,4 +10,7 @@ export async function maybeFilter(jqFilter, response) {
|
|
|
10
10
|
async function jq(json, jqFilter) {
|
|
11
11
|
return (await initJq).json(json, jqFilter);
|
|
12
12
|
}
|
|
13
|
+
export function isJqError(error) {
|
|
14
|
+
return error instanceof Error && 'stderr' in error;
|
|
15
|
+
}
|
|
13
16
|
//# sourceMappingURL=filtering.mjs.map
|
package/filtering.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filtering.mjs","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":"OACO,MAAM,MAAM,QAAQ;AAE3B,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,QAA6B,EAAE,QAAa;IAC5E,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC7C,OAAO,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC,IAAS,EAAE,QAAgB;IAC3C,OAAO,CAAC,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC"}
|
|
1
|
+
{"version":3,"file":"filtering.mjs","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":"OACO,MAAM,MAAM,QAAQ;AAE3B,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,QAA6B,EAAE,QAAa;IAC5E,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC7C,OAAO,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC,IAAS,EAAE,QAAgB;IAC3C,OAAO,CAAC,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAAU;IAClC,OAAO,KAAK,YAAY,KAAK,IAAI,QAAQ,IAAI,KAAK,CAAC;AACrD,CAAC"}
|
package/headers.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headers.d.mts","sourceRoot":"","sources":["src/headers.ts"],"names":[],"mappings":"OAEO,EAAE,eAAe,EAAE,MAAM,WAAW;OACpC,EAAE,aAAa,EAAE,MAAM,YAAY;AAE1C,eAAO,MAAM,gBAAgB,GAAI,KAAK,eAAe,KAAG,OAAO,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"headers.d.mts","sourceRoot":"","sources":["src/headers.ts"],"names":[],"mappings":"OAEO,EAAE,eAAe,EAAE,MAAM,WAAW;OACpC,EAAE,aAAa,EAAE,MAAM,YAAY;AAE1C,eAAO,MAAM,gBAAgB,GAAI,KAAK,eAAe,KAAG,OAAO,CAAC,aAAa,CAmB5E,CAAC"}
|
package/headers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["src/headers.ts"],"names":[],"mappings":"OAEO,EAAE,eAAe,EAAE,MAAM,WAAW;OACpC,EAAE,aAAa,EAAE,MAAM,YAAY;AAE1C,eAAO,MAAM,gBAAgB,GAAI,KAAK,eAAe,KAAG,OAAO,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["src/headers.ts"],"names":[],"mappings":"OAEO,EAAE,eAAe,EAAE,MAAM,WAAW;OACpC,EAAE,aAAa,EAAE,MAAM,YAAY;AAE1C,eAAO,MAAM,gBAAgB,GAAI,KAAK,eAAe,KAAG,OAAO,CAAC,aAAa,CAmB5E,CAAC"}
|
package/headers.js
CHANGED
|
@@ -10,7 +10,7 @@ const parseAuthHeaders = (req) => {
|
|
|
10
10
|
case 'Bearer':
|
|
11
11
|
return { apiKey: req.headers.authorization.slice('Bearer '.length) };
|
|
12
12
|
default:
|
|
13
|
-
throw new Error(
|
|
13
|
+
throw new Error('Unsupported authorization scheme. Expected the "Authorization" header to be a supported scheme (Bearer).');
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
const apiKey = Array.isArray(req.headers['x-codeqr-api-key']) ?
|
package/headers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headers.js","sourceRoot":"","sources":["src/headers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAK/E,MAAM,gBAAgB,GAAG,CAAC,GAAoB,EAA0B,EAAE;IAC/E,IAAI,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC;QACxD,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACjE,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,QAAQ;gBACX,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;YACvE;gBACE,MAAM,IAAI,KAAK,
|
|
1
|
+
{"version":3,"file":"headers.js","sourceRoot":"","sources":["src/headers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAK/E,MAAM,gBAAgB,GAAG,CAAC,GAAoB,EAA0B,EAAE;IAC/E,IAAI,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC;QACxD,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACjE,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,QAAQ;gBACX,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;YACvE;gBACE,MAAM,IAAI,KAAK,CACb,0GAA0G,CAC3G,CAAC;QACN,CAAC;IACH,CAAC;IAED,MAAM,MAAM,GACV,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;QAC9C,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;QACpC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACpC,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC,CAAC;AAnBW,QAAA,gBAAgB,oBAmB3B"}
|
package/headers.mjs
CHANGED
|
@@ -7,7 +7,7 @@ export const parseAuthHeaders = (req) => {
|
|
|
7
7
|
case 'Bearer':
|
|
8
8
|
return { apiKey: req.headers.authorization.slice('Bearer '.length) };
|
|
9
9
|
default:
|
|
10
|
-
throw new Error(
|
|
10
|
+
throw new Error('Unsupported authorization scheme. Expected the "Authorization" header to be a supported scheme (Bearer).');
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
const apiKey = Array.isArray(req.headers['x-codeqr-api-key']) ?
|
package/headers.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headers.mjs","sourceRoot":"","sources":["src/headers.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAKtF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAAoB,EAA0B,EAAE;IAC/E,IAAI,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC;QACxD,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACjE,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,QAAQ;gBACX,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;YACvE;gBACE,MAAM,IAAI,KAAK,
|
|
1
|
+
{"version":3,"file":"headers.mjs","sourceRoot":"","sources":["src/headers.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAKtF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAAoB,EAA0B,EAAE;IAC/E,IAAI,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC;QACxD,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACjE,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,QAAQ;gBACX,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;YACvE;gBACE,MAAM,IAAI,KAAK,CACb,0GAA0G,CAC3G,CAAC;QACN,CAAC;IACH,CAAC;IAED,MAAM,MAAM,GACV,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;QAC9C,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;QACpC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACpC,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC,CAAC"}
|
package/http.js
CHANGED
|
@@ -38,12 +38,12 @@ const newServer = ({ clientOptions, mcpOptions: defaultMcpOptions, req, res, })
|
|
|
38
38
|
mcpOptions,
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
catch {
|
|
41
|
+
catch (error) {
|
|
42
42
|
res.status(401).json({
|
|
43
43
|
jsonrpc: '2.0',
|
|
44
44
|
error: {
|
|
45
45
|
code: -32000,
|
|
46
|
-
message:
|
|
46
|
+
message: `Unauthorized: ${error instanceof Error ? error.message : error}`,
|
|
47
47
|
},
|
|
48
48
|
});
|
|
49
49
|
return null;
|
package/http.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sourceRoot":"","sources":["src/http.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;AAGtF,0FAAmG;AAEnG,sDAA8B;AAC9B,gDAAoD;AACpD,0CAA0D;AAC1D,wCAAsE;AACtE,0CAA6C;AAE7C,MAAM,SAAS,GAAG,CAAC,EACjB,aAAa,EACb,UAAU,EAAE,iBAAiB,EAC7B,GAAG,EACH,GAAG,GAMJ,EAAoB,EAAE;IACrB,MAAM,MAAM,GAAG,IAAA,qBAAY,GAAE,CAAC;IAE9B,IAAI,UAAsB,CAAC;IAC3B,IAAI,CAAC;QACH,UAAU,GAAG,IAAA,2BAAiB,EAAC,iBAAiB,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;IAC/D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;YACnB,OAAO,EAAE,KAAK;YACd,KAAK,EAAE;gBACL,IAAI,EAAE,CAAC,KAAK;gBACZ,OAAO,EAAE,oBAAoB,IAAA,cAAS,EAAC,KAAK,CAAC,EAAE;aAChD;SACF,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,IAAA,0BAAgB,EAAC,GAAG,CAAC,CAAC;QAC1C,IAAA,sBAAa,EAAC;YACZ,MAAM,EAAE,MAAM;YACd,aAAa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AACH,CAAC,CAAC;AAZW,QAAA,0BAA0B,8BAYrC"}
|
package/http.mjs
CHANGED
|
@@ -32,12 +32,12 @@ const newServer = ({ clientOptions, mcpOptions: defaultMcpOptions, req, res, })
|
|
|
32
32
|
mcpOptions,
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
catch {
|
|
35
|
+
catch (error) {
|
|
36
36
|
res.status(401).json({
|
|
37
37
|
jsonrpc: '2.0',
|
|
38
38
|
error: {
|
|
39
39
|
code: -32000,
|
|
40
|
-
message:
|
|
40
|
+
message: `Unauthorized: ${error instanceof Error ? error.message : error}`,
|
|
41
41
|
},
|
|
42
42
|
});
|
|
43
43
|
return null;
|
package/http.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.mjs","sourceRoot":"","sources":["src/http.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAG/E,EAAE,6BAA6B,EAAE,MAAM,oDAAoD;OAE3F,OAAO,MAAM,SAAS;OACtB,EAAE,SAAS,EAAE,MAAM,yBAAyB;OAC5C,EAAc,iBAAiB,EAAE;OACjC,EAAiB,aAAa,EAAE,YAAY,EAAE;OAC9C,EAAE,gBAAgB,EAAE;AAE3B,MAAM,SAAS,GAAG,CAAC,EACjB,aAAa,EACb,UAAU,EAAE,iBAAiB,EAC7B,GAAG,EACH,GAAG,GAMJ,EAAoB,EAAE;IACrB,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAE9B,IAAI,UAAsB,CAAC;IAC3B,IAAI,CAAC;QACH,UAAU,GAAG,iBAAiB,CAAC,iBAAiB,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;IAC/D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;YACnB,OAAO,EAAE,KAAK;YACd,KAAK,EAAE;gBACL,IAAI,EAAE,CAAC,KAAK;gBACZ,OAAO,EAAE,oBAAoB,SAAS,CAA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OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;SAAM,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QAC5B,OAAO,CAAC,KAAK,CAAC,iDAAiD,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACjF,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,KAAK,CAAC,iDAAiD,IAAI,EAAE,CAAC,CAAC;IACzE,CAAC;AACH,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeqr/ts-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "The official MCP Server for the CodeQR API",
|
|
5
5
|
"author": "CodeQR <contact@codeqr.io>",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
"fix": "eslint --fix --ext ts,js ."
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@codeqr/ts": "^0.
|
|
30
|
+
"@codeqr/ts": "^0.7.0",
|
|
31
31
|
"@cloudflare/cabidela": "^0.2.4",
|
|
32
32
|
"@modelcontextprotocol/sdk": "^1.11.5",
|
|
33
33
|
"@valtown/deno-http-worker": "^0.0.21",
|
|
34
34
|
"cors": "^2.8.5",
|
|
35
35
|
"express": "^5.1.0",
|
|
36
36
|
"fuse.js": "^7.1.0",
|
|
37
|
-
"jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.
|
|
37
|
+
"jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.8/jq-web.tar.gz",
|
|
38
38
|
"qs": "^6.14.0",
|
|
39
39
|
"typescript": "5.8.3",
|
|
40
40
|
"yargs": "^17.7.2",
|
package/server.js
CHANGED
|
@@ -22,7 +22,7 @@ var tools_2 = require("./tools.js");
|
|
|
22
22
|
Object.defineProperty(exports, "endpoints", { enumerable: true, get: function () { return tools_2.endpoints; } });
|
|
23
23
|
const newMcpServer = () => new mcp_js_1.McpServer({
|
|
24
24
|
name: 'codeqr_ts_api',
|
|
25
|
-
version: '0.
|
|
25
|
+
version: '0.7.0',
|
|
26
26
|
}, { capabilities: { tools: {}, logging: {} } });
|
|
27
27
|
exports.newMcpServer = newMcpServer;
|
|
28
28
|
// Create server instance
|
package/server.mjs
CHANGED
|
@@ -11,7 +11,7 @@ export { ClientType } from "./compat.mjs";
|
|
|
11
11
|
export { endpoints } from "./tools.mjs";
|
|
12
12
|
export const newMcpServer = () => new McpServer({
|
|
13
13
|
name: 'codeqr_ts_api',
|
|
14
|
-
version: '0.
|
|
14
|
+
version: '0.7.0',
|
|
15
15
|
}, { capabilities: { tools: {}, logging: {} } });
|
|
16
16
|
// Create server instance
|
|
17
17
|
export const server = newMcpServer();
|
package/src/filtering.ts
CHANGED
|
@@ -12,3 +12,7 @@ export async function maybeFilter(jqFilter: unknown | undefined, response: any):
|
|
|
12
12
|
async function jq(json: any, jqFilter: string) {
|
|
13
13
|
return (await initJq).json(json, jqFilter);
|
|
14
14
|
}
|
|
15
|
+
|
|
16
|
+
export function isJqError(error: any): error is Error {
|
|
17
|
+
return error instanceof Error && 'stderr' in error;
|
|
18
|
+
}
|
package/src/headers.ts
CHANGED
|
@@ -11,7 +11,9 @@ export const parseAuthHeaders = (req: IncomingMessage): Partial<ClientOptions> =
|
|
|
11
11
|
case 'Bearer':
|
|
12
12
|
return { apiKey: req.headers.authorization.slice('Bearer '.length) };
|
|
13
13
|
default:
|
|
14
|
-
throw new Error(
|
|
14
|
+
throw new Error(
|
|
15
|
+
'Unsupported authorization scheme. Expected the "Authorization" header to be a supported scheme (Bearer).',
|
|
16
|
+
);
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
19
|
|
package/src/http.ts
CHANGED
|
@@ -46,12 +46,12 @@ const newServer = ({
|
|
|
46
46
|
},
|
|
47
47
|
mcpOptions,
|
|
48
48
|
});
|
|
49
|
-
} catch {
|
|
49
|
+
} catch (error) {
|
|
50
50
|
res.status(401).json({
|
|
51
51
|
jsonrpc: '2.0',
|
|
52
52
|
error: {
|
|
53
53
|
code: -32000,
|
|
54
|
-
message:
|
|
54
|
+
message: `Unauthorized: ${error instanceof Error ? error.message : error}`,
|
|
55
55
|
},
|
|
56
56
|
});
|
|
57
57
|
return null;
|
package/src/server.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Codeqr from '@codeqr/ts';
|
|
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
|
|
|
18
18
|
export const tool: Tool = {
|
|
19
19
|
name: 'create_domains',
|
|
20
20
|
description:
|
|
21
|
-
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nCreate a domain for the authenticated workspace.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/domain',\n $defs: {\n domain: {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n description: 'The unique identifier of the domain.'\n },\n archived: {\n type: 'boolean',\n description: 'Whether the domain is archived.'\n },\n createdAt: {\n type: 'string',\n description: 'The date the domain was created.'\n },\n expiredUrl: {\n type: 'string',\n description: 'The URL to redirect to when a link under this domain has expired.'\n },\n placeholder: {\n type: 'string',\n description: 'Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.'\n },\n primary: {\n type: 'boolean',\n description: 'Whether the domain is the primary domain for the project.'\n },\n slug: {\n type: 'string',\n description: 'The domain name.'\n },\n updatedAt: {\n type: 'string',\n description: 'The date the domain was last updated.'\n },\n verified: {\n type: 'boolean',\n description: 'Whether the domain is verified.'\n }\n },\n required: [ 'id',\n 'archived',\n 'createdAt',\n 'expiredUrl',\n 'placeholder',\n 'primary',\n 'slug',\n 'updatedAt',\n 'verified'\n ]\n }\n }\n}\n```",
|
|
21
|
+
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nCreate a domain for the authenticated workspace.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/domain',\n $defs: {\n domain: {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n description: 'The unique identifier of the domain.'\n },\n archived: {\n type: 'boolean',\n description: 'Whether the domain is archived.'\n },\n createdAt: {\n type: 'string',\n description: 'The date the domain was created.'\n },\n expiredUrl: {\n type: 'string',\n description: 'The URL to redirect to when a link under this domain has expired.'\n },\n placeholder: {\n type: 'string',\n description: 'Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.'\n },\n primary: {\n type: 'boolean',\n description: 'Whether the domain is the primary domain for the project.'\n },\n slug: {\n type: 'string',\n description: 'The domain name.'\n },\n target: {\n type: 'string',\n description: 'The target URL to redirect to when accessing the domain root.'\n },\n type: {\n type: 'string',\n description: 'The behavior type for the domain root redirect.',\n enum: [ 'redirect',\n 'rewrite'\n ]\n },\n updatedAt: {\n type: 'string',\n description: 'The date the domain was last updated.'\n },\n verified: {\n type: 'boolean',\n description: 'Whether the domain is verified.'\n }\n },\n required: [ 'id',\n 'archived',\n 'createdAt',\n 'expiredUrl',\n 'placeholder',\n 'primary',\n 'slug',\n 'target',\n 'type',\n 'updatedAt',\n 'verified'\n ]\n }\n }\n}\n```",
|
|
22
22
|
inputSchema: {
|
|
23
23
|
type: 'object',
|
|
24
24
|
properties: {
|
|
@@ -39,6 +39,15 @@ export const tool: Tool = {
|
|
|
39
39
|
description:
|
|
40
40
|
'Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.',
|
|
41
41
|
},
|
|
42
|
+
target: {
|
|
43
|
+
type: 'string',
|
|
44
|
+
description: 'The target URL to redirect to when accessing the domain root.',
|
|
45
|
+
},
|
|
46
|
+
type: {
|
|
47
|
+
type: 'string',
|
|
48
|
+
description: 'The behavior type for the domain root redirect.',
|
|
49
|
+
enum: ['redirect', 'rewrite'],
|
|
50
|
+
},
|
|
42
51
|
jq_filter: {
|
|
43
52
|
type: 'string',
|
|
44
53
|
title: 'jq Filter',
|
|
@@ -53,7 +62,14 @@ export const tool: Tool = {
|
|
|
53
62
|
|
|
54
63
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
55
64
|
const { jq_filter, ...body } = args as any;
|
|
56
|
-
|
|
65
|
+
try {
|
|
66
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.domains.create(body)));
|
|
67
|
+
} catch (error) {
|
|
68
|
+
if (isJqError(error)) {
|
|
69
|
+
return asErrorResult(error.message);
|
|
70
|
+
}
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
57
73
|
};
|
|
58
74
|
|
|
59
75
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Codeqr from '@codeqr/ts';
|
|
@@ -42,7 +42,14 @@ export const tool: Tool = {
|
|
|
42
42
|
|
|
43
43
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
44
44
|
const { slug, jq_filter, ...body } = args as any;
|
|
45
|
-
|
|
45
|
+
try {
|
|
46
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.domains.delete(slug)));
|
|
47
|
+
} catch (error) {
|
|
48
|
+
if (isJqError(error)) {
|
|
49
|
+
return asErrorResult(error.message);
|
|
50
|
+
}
|
|
51
|
+
throw error;
|
|
52
|
+
}
|
|
46
53
|
};
|
|
47
54
|
|
|
48
55
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Codeqr from '@codeqr/ts';
|
|
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
|
|
|
18
18
|
export const tool: Tool = {
|
|
19
19
|
name: 'list_domains',
|
|
20
20
|
description:
|
|
21
|
-
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nRetrieve a list of domains associated with the authenticated workspace.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/domain_list_response',\n $defs: {\n domain_list_response: {\n type: 'array',\n items: {\n $ref: '#/$defs/domain'\n }\n },\n domain: {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n description: 'The unique identifier of the domain.'\n },\n archived: {\n type: 'boolean',\n description: 'Whether the domain is archived.'\n },\n createdAt: {\n type: 'string',\n description: 'The date the domain was created.'\n },\n expiredUrl: {\n type: 'string',\n description: 'The URL to redirect to when a link under this domain has expired.'\n },\n placeholder: {\n type: 'string',\n description: 'Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.'\n },\n primary: {\n type: 'boolean',\n description: 'Whether the domain is the primary domain for the project.'\n },\n slug: {\n type: 'string',\n description: 'The domain name.'\n },\n updatedAt: {\n type: 'string',\n description: 'The date the domain was last updated.'\n },\n verified: {\n type: 'boolean',\n description: 'Whether the domain is verified.'\n }\n },\n required: [ 'id',\n 'archived',\n 'createdAt',\n 'expiredUrl',\n 'placeholder',\n 'primary',\n 'slug',\n 'updatedAt',\n 'verified'\n ]\n }\n }\n}\n```",
|
|
21
|
+
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nRetrieve a list of domains associated with the authenticated workspace.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/domain_list_response',\n $defs: {\n domain_list_response: {\n type: 'array',\n items: {\n $ref: '#/$defs/domain'\n }\n },\n domain: {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n description: 'The unique identifier of the domain.'\n },\n archived: {\n type: 'boolean',\n description: 'Whether the domain is archived.'\n },\n createdAt: {\n type: 'string',\n description: 'The date the domain was created.'\n },\n expiredUrl: {\n type: 'string',\n description: 'The URL to redirect to when a link under this domain has expired.'\n },\n placeholder: {\n type: 'string',\n description: 'Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.'\n },\n primary: {\n type: 'boolean',\n description: 'Whether the domain is the primary domain for the project.'\n },\n slug: {\n type: 'string',\n description: 'The domain name.'\n },\n target: {\n type: 'string',\n description: 'The target URL to redirect to when accessing the domain root.'\n },\n type: {\n type: 'string',\n description: 'The behavior type for the domain root redirect.',\n enum: [ 'redirect',\n 'rewrite'\n ]\n },\n updatedAt: {\n type: 'string',\n description: 'The date the domain was last updated.'\n },\n verified: {\n type: 'boolean',\n description: 'Whether the domain is verified.'\n }\n },\n required: [ 'id',\n 'archived',\n 'createdAt',\n 'expiredUrl',\n 'placeholder',\n 'primary',\n 'slug',\n 'target',\n 'type',\n 'updatedAt',\n 'verified'\n ]\n }\n }\n}\n```",
|
|
22
22
|
inputSchema: {
|
|
23
23
|
type: 'object',
|
|
24
24
|
properties: {
|
|
@@ -55,7 +55,14 @@ export const tool: Tool = {
|
|
|
55
55
|
|
|
56
56
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
57
57
|
const { jq_filter, ...body } = args as any;
|
|
58
|
-
|
|
58
|
+
try {
|
|
59
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.domains.list(body)));
|
|
60
|
+
} catch (error) {
|
|
61
|
+
if (isJqError(error)) {
|
|
62
|
+
return asErrorResult(error.message);
|
|
63
|
+
}
|
|
64
|
+
throw error;
|
|
65
|
+
}
|
|
59
66
|
};
|
|
60
67
|
|
|
61
68
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Codeqr from '@codeqr/ts';
|
|
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
|
|
|
18
18
|
export const tool: Tool = {
|
|
19
19
|
name: 'update_domains',
|
|
20
20
|
description:
|
|
21
|
-
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nUpdate a domain for the authenticated workspace.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/domain',\n $defs: {\n domain: {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n description: 'The unique identifier of the domain.'\n },\n archived: {\n type: 'boolean',\n description: 'Whether the domain is archived.'\n },\n createdAt: {\n type: 'string',\n description: 'The date the domain was created.'\n },\n expiredUrl: {\n type: 'string',\n description: 'The URL to redirect to when a link under this domain has expired.'\n },\n placeholder: {\n type: 'string',\n description: 'Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.'\n },\n primary: {\n type: 'boolean',\n description: 'Whether the domain is the primary domain for the project.'\n },\n slug: {\n type: 'string',\n description: 'The domain name.'\n },\n updatedAt: {\n type: 'string',\n description: 'The date the domain was last updated.'\n },\n verified: {\n type: 'boolean',\n description: 'Whether the domain is verified.'\n }\n },\n required: [ 'id',\n 'archived',\n 'createdAt',\n 'expiredUrl',\n 'placeholder',\n 'primary',\n 'slug',\n 'updatedAt',\n 'verified'\n ]\n }\n }\n}\n```",
|
|
21
|
+
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nUpdate a domain for the authenticated workspace.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/domain',\n $defs: {\n domain: {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n description: 'The unique identifier of the domain.'\n },\n archived: {\n type: 'boolean',\n description: 'Whether the domain is archived.'\n },\n createdAt: {\n type: 'string',\n description: 'The date the domain was created.'\n },\n expiredUrl: {\n type: 'string',\n description: 'The URL to redirect to when a link under this domain has expired.'\n },\n placeholder: {\n type: 'string',\n description: 'Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.'\n },\n primary: {\n type: 'boolean',\n description: 'Whether the domain is the primary domain for the project.'\n },\n slug: {\n type: 'string',\n description: 'The domain name.'\n },\n target: {\n type: 'string',\n description: 'The target URL to redirect to when accessing the domain root.'\n },\n type: {\n type: 'string',\n description: 'The behavior type for the domain root redirect.',\n enum: [ 'redirect',\n 'rewrite'\n ]\n },\n updatedAt: {\n type: 'string',\n description: 'The date the domain was last updated.'\n },\n verified: {\n type: 'boolean',\n description: 'Whether the domain is verified.'\n }\n },\n required: [ 'id',\n 'archived',\n 'createdAt',\n 'expiredUrl',\n 'placeholder',\n 'primary',\n 'slug',\n 'target',\n 'type',\n 'updatedAt',\n 'verified'\n ]\n }\n }\n}\n```",
|
|
22
22
|
inputSchema: {
|
|
23
23
|
type: 'object',
|
|
24
24
|
properties: {
|
|
@@ -43,6 +43,15 @@ export const tool: Tool = {
|
|
|
43
43
|
type: 'string',
|
|
44
44
|
description: 'Name of the domain.',
|
|
45
45
|
},
|
|
46
|
+
target: {
|
|
47
|
+
type: 'string',
|
|
48
|
+
description: 'The target URL to redirect to when accessing the domain root.',
|
|
49
|
+
},
|
|
50
|
+
type: {
|
|
51
|
+
type: 'string',
|
|
52
|
+
description: 'The behavior type for the domain root redirect.',
|
|
53
|
+
enum: ['redirect', 'rewrite'],
|
|
54
|
+
},
|
|
46
55
|
jq_filter: {
|
|
47
56
|
type: 'string',
|
|
48
57
|
title: 'jq Filter',
|
|
@@ -57,7 +66,14 @@ export const tool: Tool = {
|
|
|
57
66
|
|
|
58
67
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
59
68
|
const { slug, jq_filter, ...body } = args as any;
|
|
60
|
-
|
|
69
|
+
try {
|
|
70
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.domains.update(slug, body)));
|
|
71
|
+
} catch (error) {
|
|
72
|
+
if (isJqError(error)) {
|
|
73
|
+
return asErrorResult(error.message);
|
|
74
|
+
}
|
|
75
|
+
throw error;
|
|
76
|
+
}
|
|
61
77
|
};
|
|
62
78
|
|
|
63
79
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Codeqr from '@codeqr/ts';
|
|
@@ -46,7 +46,14 @@ export const tool: Tool = {
|
|
|
46
46
|
|
|
47
47
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
48
48
|
const { jq_filter, ...body } = args as any;
|
|
49
|
-
|
|
49
|
+
try {
|
|
50
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.links.bulk.delete(body)));
|
|
51
|
+
} catch (error) {
|
|
52
|
+
if (isJqError(error)) {
|
|
53
|
+
return asErrorResult(error.message);
|
|
54
|
+
}
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
50
57
|
};
|
|
51
58
|
|
|
52
59
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Codeqr from '@codeqr/ts';
|
|
@@ -43,7 +43,14 @@ export const tool: Tool = {
|
|
|
43
43
|
|
|
44
44
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
45
45
|
const { linkId, jq_filter, ...body } = args as any;
|
|
46
|
-
|
|
46
|
+
try {
|
|
47
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.links.delete(linkId)));
|
|
48
|
+
} catch (error) {
|
|
49
|
+
if (isJqError(error)) {
|
|
50
|
+
return asErrorResult(error.message);
|
|
51
|
+
}
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
47
54
|
};
|
|
48
55
|
|
|
49
56
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Codeqr from '@codeqr/ts';
|
|
@@ -62,7 +62,14 @@ export const tool: Tool = {
|
|
|
62
62
|
|
|
63
63
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
64
64
|
const { jq_filter, ...body } = args as any;
|
|
65
|
-
|
|
65
|
+
try {
|
|
66
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.links.retrieveInfo(body)));
|
|
67
|
+
} catch (error) {
|
|
68
|
+
if (isJqError(error)) {
|
|
69
|
+
return asErrorResult(error.message);
|
|
70
|
+
}
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
66
73
|
};
|
|
67
74
|
|
|
68
75
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Codeqr from '@codeqr/ts';
|
|
@@ -38,7 +38,14 @@ export const tool: Tool = {
|
|
|
38
38
|
|
|
39
39
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
40
40
|
const { jq_filter } = args as any;
|
|
41
|
-
|
|
41
|
+
try {
|
|
42
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.projects.list()));
|
|
43
|
+
} catch (error) {
|
|
44
|
+
if (isJqError(error)) {
|
|
45
|
+
return asErrorResult(error.message);
|
|
46
|
+
}
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
42
49
|
};
|
|
43
50
|
|
|
44
51
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Codeqr from '@codeqr/ts';
|
|
@@ -43,7 +43,14 @@ export const tool: Tool = {
|
|
|
43
43
|
|
|
44
44
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
45
45
|
const { projectSlug, jq_filter, ...body } = args as any;
|
|
46
|
-
|
|
46
|
+
try {
|
|
47
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.projects.retrieve(projectSlug)));
|
|
48
|
+
} catch (error) {
|
|
49
|
+
if (isJqError(error)) {
|
|
50
|
+
return asErrorResult(error.message);
|
|
51
|
+
}
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
47
54
|
};
|
|
48
55
|
|
|
49
56
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@codeqr/ts-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@codeqr/ts-mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import Codeqr from '@codeqr/ts';
|
|
@@ -46,7 +46,14 @@ export const tool: Tool = {
|
|
|
46
46
|
|
|
47
47
|
export const handler = async (client: Codeqr, args: Record<string, unknown> | undefined) => {
|
|
48
48
|
const { jq_filter, ...body } = args as any;
|
|
49
|
-
|
|
49
|
+
try {
|
|
50
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.qrcodes.bulk.delete(body)));
|
|
51
|
+
} catch (error) {
|
|
52
|
+
if (isJqError(error)) {
|
|
53
|
+
return asErrorResult(error.message);
|
|
54
|
+
}
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
50
57
|
};
|
|
51
58
|
|
|
52
59
|
export default { metadata, tool, handler };
|