@kontext-dev/js-sdk 0.3.0 → 1.0.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/dist/client/index.cjs +19 -1
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.js +19 -1
- package/dist/client/index.js.map +1 -1
- package/dist/index.cjs +27 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +27 -1
- package/dist/index.js.map +1 -1
- package/dist/management/index.cjs.map +1 -1
- package/dist/management/index.d.cts +2 -2
- package/dist/management/index.d.ts +2 -2
- package/dist/management/index.js.map +1 -1
- package/dist/mcp/index.cjs +19 -1
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.d.cts +4 -1
- package/dist/mcp/index.d.ts +4 -1
- package/dist/mcp/index.js +19 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/oauth/index.cjs.map +1 -1
- package/dist/oauth/index.d.cts +1 -1
- package/dist/oauth/index.d.ts +1 -1
- package/dist/oauth/index.js.map +1 -1
- package/dist/server/index.cjs +8 -0
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +8 -0
- package/dist/server/index.js.map +1 -1
- package/dist/{types-CzhnlJHW.d.cts → types-C6ep5fVw.d.cts} +2 -0
- package/dist/{types-CzhnlJHW.d.ts → types-C6ep5fVw.d.ts} +2 -0
- package/package.json +1 -1
package/dist/client/index.cjs
CHANGED
|
@@ -636,7 +636,22 @@ var KontextMcp = class {
|
|
|
636
636
|
const url = typeof item.url === "string" ? item.url : "";
|
|
637
637
|
if (!id || !url) return null;
|
|
638
638
|
const category = item.category === "internal_mcp_credentials" ? "internal_mcp_credentials" : "gateway_remote_mcp";
|
|
639
|
-
const
|
|
639
|
+
const rawConnectType = item.connectType;
|
|
640
|
+
if (typeof rawConnectType !== "string") {
|
|
641
|
+
throw new KontextError(
|
|
642
|
+
"Runtime integration connectType is required in API response.",
|
|
643
|
+
"kontext_runtime_integrations_invalid_response",
|
|
644
|
+
{ meta: { integrationId: id, connectType: rawConnectType } }
|
|
645
|
+
);
|
|
646
|
+
}
|
|
647
|
+
const connectType = rawConnectType === "credentials" || rawConnectType === "oauth" || rawConnectType === "user_token" || rawConnectType === "none" ? rawConnectType : null;
|
|
648
|
+
if (!connectType) {
|
|
649
|
+
throw new KontextError(
|
|
650
|
+
`Unknown runtime integration connectType "${rawConnectType}".`,
|
|
651
|
+
"kontext_runtime_integrations_invalid_response",
|
|
652
|
+
{ meta: { integrationId: id, connectType: rawConnectType } }
|
|
653
|
+
);
|
|
654
|
+
}
|
|
640
655
|
const rawConnection = item.connection && typeof item.connection === "object" ? item.connection : void 0;
|
|
641
656
|
const connected = rawConnection && typeof rawConnection.connected === "boolean" ? rawConnection.connected : false;
|
|
642
657
|
const status = rawConnection?.status === "connected" ? "connected" : "disconnected";
|
|
@@ -647,6 +662,9 @@ var KontextMcp = class {
|
|
|
647
662
|
category,
|
|
648
663
|
connectType,
|
|
649
664
|
authMode: item.authMode === "oauth" || item.authMode === "user_token" || item.authMode === "server_token" || item.authMode === "none" ? item.authMode : void 0,
|
|
665
|
+
tokenLabel: typeof item.tokenLabel === "string" ? item.tokenLabel : void 0,
|
|
666
|
+
tokenHelpUrl: typeof item.tokenHelpUrl === "string" ? item.tokenHelpUrl : void 0,
|
|
667
|
+
tokenPlaceholder: typeof item.tokenPlaceholder === "string" ? item.tokenPlaceholder : void 0,
|
|
650
668
|
credentialSchema: item.credentialSchema,
|
|
651
669
|
requiresOauth: typeof item.requiresOauth === "boolean" ? item.requiresOauth : void 0,
|
|
652
670
|
connection: rawConnection ? {
|