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