@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.js
CHANGED
|
@@ -634,7 +634,22 @@ var KontextMcp = class {
|
|
|
634
634
|
const url = typeof item.url === "string" ? item.url : "";
|
|
635
635
|
if (!id || !url) return null;
|
|
636
636
|
const category = item.category === "internal_mcp_credentials" ? "internal_mcp_credentials" : "gateway_remote_mcp";
|
|
637
|
-
const
|
|
637
|
+
const rawConnectType = item.connectType;
|
|
638
|
+
if (typeof rawConnectType !== "string") {
|
|
639
|
+
throw new KontextError(
|
|
640
|
+
"Runtime integration connectType is required in API response.",
|
|
641
|
+
"kontext_runtime_integrations_invalid_response",
|
|
642
|
+
{ meta: { integrationId: id, connectType: rawConnectType } }
|
|
643
|
+
);
|
|
644
|
+
}
|
|
645
|
+
const connectType = rawConnectType === "credentials" || rawConnectType === "oauth" || rawConnectType === "user_token" || rawConnectType === "none" ? rawConnectType : null;
|
|
646
|
+
if (!connectType) {
|
|
647
|
+
throw new KontextError(
|
|
648
|
+
`Unknown runtime integration connectType "${rawConnectType}".`,
|
|
649
|
+
"kontext_runtime_integrations_invalid_response",
|
|
650
|
+
{ meta: { integrationId: id, connectType: rawConnectType } }
|
|
651
|
+
);
|
|
652
|
+
}
|
|
638
653
|
const rawConnection = item.connection && typeof item.connection === "object" ? item.connection : void 0;
|
|
639
654
|
const connected = rawConnection && typeof rawConnection.connected === "boolean" ? rawConnection.connected : false;
|
|
640
655
|
const status = rawConnection?.status === "connected" ? "connected" : "disconnected";
|
|
@@ -645,6 +660,9 @@ var KontextMcp = class {
|
|
|
645
660
|
category,
|
|
646
661
|
connectType,
|
|
647
662
|
authMode: item.authMode === "oauth" || item.authMode === "user_token" || item.authMode === "server_token" || item.authMode === "none" ? item.authMode : void 0,
|
|
663
|
+
tokenLabel: typeof item.tokenLabel === "string" ? item.tokenLabel : void 0,
|
|
664
|
+
tokenHelpUrl: typeof item.tokenHelpUrl === "string" ? item.tokenHelpUrl : void 0,
|
|
665
|
+
tokenPlaceholder: typeof item.tokenPlaceholder === "string" ? item.tokenPlaceholder : void 0,
|
|
648
666
|
credentialSchema: item.credentialSchema,
|
|
649
667
|
requiresOauth: typeof item.requiresOauth === "boolean" ? item.requiresOauth : void 0,
|
|
650
668
|
connection: rawConnection ? {
|