@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.
@@ -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 connectType = item.connectType === "credentials" || item.connectType === "oauth" || item.connectType === "none" ? item.connectType : category === "internal_mcp_credentials" ? "credentials" : item.authMode === "oauth" ? "oauth" : "none";
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 ? {