integrate-sdk 0.3.8 → 0.3.9
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/index.js +167 -11
- package/dist/server.js +167 -11
- package/dist/src/client.d.ts +43 -5
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/config/types.d.ts +15 -0
- package/dist/src/config/types.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/oauth/manager.d.ts +4 -0
- package/dist/src/oauth/manager.d.ts.map +1 -1
- package/dist/src/oauth/types.d.ts +33 -0
- package/dist/src/oauth/types.d.ts.map +1 -1
- package/dist/src/oauth/window-manager.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -591,6 +591,7 @@ function base64UrlEncode(array) {
|
|
|
591
591
|
}
|
|
592
592
|
|
|
593
593
|
// src/oauth/window-manager.ts
|
|
594
|
+
"use client";
|
|
594
595
|
function isBrowser() {
|
|
595
596
|
return typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
596
597
|
}
|
|
@@ -776,6 +777,8 @@ function sendCallbackToOpener(params) {
|
|
|
776
777
|
}
|
|
777
778
|
|
|
778
779
|
// src/oauth/manager.ts
|
|
780
|
+
"use client";
|
|
781
|
+
|
|
779
782
|
class OAuthManager {
|
|
780
783
|
pendingAuths = new Map;
|
|
781
784
|
sessionToken;
|
|
@@ -839,6 +842,7 @@ class OAuthManager {
|
|
|
839
842
|
try {
|
|
840
843
|
const response = await this.exchangeCodeForToken(pendingAuth.provider, code, pendingAuth.codeVerifier, state);
|
|
841
844
|
this.sessionToken = response.sessionToken;
|
|
845
|
+
this.saveSessionToken(response.sessionToken);
|
|
842
846
|
this.pendingAuths.delete(state);
|
|
843
847
|
return response.sessionToken;
|
|
844
848
|
} catch (error) {
|
|
@@ -882,9 +886,26 @@ class OAuthManager {
|
|
|
882
886
|
}
|
|
883
887
|
setSessionToken(token) {
|
|
884
888
|
this.sessionToken = token;
|
|
889
|
+
this.saveSessionToken(token);
|
|
885
890
|
}
|
|
886
891
|
clearSessionToken() {
|
|
887
892
|
this.sessionToken = undefined;
|
|
893
|
+
if (typeof window !== "undefined" && window.sessionStorage) {
|
|
894
|
+
try {
|
|
895
|
+
window.sessionStorage.removeItem("integrate_session_token");
|
|
896
|
+
} catch (error) {
|
|
897
|
+
console.error("Failed to clear session token from sessionStorage:", error);
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
saveSessionToken(token) {
|
|
902
|
+
if (typeof window !== "undefined" && window.sessionStorage) {
|
|
903
|
+
try {
|
|
904
|
+
window.sessionStorage.setItem("integrate_session_token", token);
|
|
905
|
+
} catch (error) {
|
|
906
|
+
console.error("Failed to save session token to sessionStorage:", error);
|
|
907
|
+
}
|
|
908
|
+
}
|
|
888
909
|
}
|
|
889
910
|
async getAuthorizationUrl(provider, scopes, state, codeChallenge, redirectUri) {
|
|
890
911
|
const url = `${this.oauthApiBase}/authorize`;
|
|
@@ -936,6 +957,42 @@ class OAuthManager {
|
|
|
936
957
|
}
|
|
937
958
|
|
|
938
959
|
// src/client.ts
|
|
960
|
+
"use client";
|
|
961
|
+
|
|
962
|
+
class SimpleEventEmitter {
|
|
963
|
+
handlers = new Map;
|
|
964
|
+
on(event, handler) {
|
|
965
|
+
if (!this.handlers.has(event)) {
|
|
966
|
+
this.handlers.set(event, new Set);
|
|
967
|
+
}
|
|
968
|
+
this.handlers.get(event).add(handler);
|
|
969
|
+
}
|
|
970
|
+
off(event, handler) {
|
|
971
|
+
const handlers = this.handlers.get(event);
|
|
972
|
+
if (handlers) {
|
|
973
|
+
handlers.delete(handler);
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
emit(event, payload) {
|
|
977
|
+
const handlers = this.handlers.get(event);
|
|
978
|
+
if (handlers) {
|
|
979
|
+
handlers.forEach((handler) => {
|
|
980
|
+
try {
|
|
981
|
+
handler(payload);
|
|
982
|
+
} catch (error) {
|
|
983
|
+
console.error(`Error in event handler for ${event}:`, error);
|
|
984
|
+
}
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
removeAllListeners(event) {
|
|
989
|
+
if (event) {
|
|
990
|
+
this.handlers.delete(event);
|
|
991
|
+
} else {
|
|
992
|
+
this.handlers.clear();
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
}
|
|
939
996
|
var MCP_SERVER_URL = "https://mcp.integrate.dev/api/v1/mcp";
|
|
940
997
|
var clientCache = new Map;
|
|
941
998
|
var cleanupClients = new Set;
|
|
@@ -954,6 +1011,7 @@ class MCPClient {
|
|
|
954
1011
|
connectionMode;
|
|
955
1012
|
connecting = null;
|
|
956
1013
|
oauthManager;
|
|
1014
|
+
eventEmitter = new SimpleEventEmitter;
|
|
957
1015
|
github;
|
|
958
1016
|
gmail;
|
|
959
1017
|
server;
|
|
@@ -972,9 +1030,16 @@ class MCPClient {
|
|
|
972
1030
|
this.maxReauthRetries = config.maxReauthRetries ?? 1;
|
|
973
1031
|
this.connectionMode = config.connectionMode ?? "lazy";
|
|
974
1032
|
this.oauthManager = new OAuthManager(config.oauthApiBase || "/api/integrate/oauth", config.oauthFlow);
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
this.
|
|
1033
|
+
let sessionToken = config.sessionToken;
|
|
1034
|
+
if (!sessionToken) {
|
|
1035
|
+
const storedToken = this.loadSessionToken();
|
|
1036
|
+
if (storedToken) {
|
|
1037
|
+
sessionToken = storedToken;
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
if (sessionToken) {
|
|
1041
|
+
this.oauthManager.setSessionToken(sessionToken);
|
|
1042
|
+
this.transport.setHeader("X-Session-Token", sessionToken);
|
|
978
1043
|
}
|
|
979
1044
|
for (const plugin of this.plugins) {
|
|
980
1045
|
for (const toolName of plugin.tools) {
|
|
@@ -1190,6 +1255,42 @@ class MCPClient {
|
|
|
1190
1255
|
onMessage(handler) {
|
|
1191
1256
|
return this.transport.onMessage(handler);
|
|
1192
1257
|
}
|
|
1258
|
+
on(event, handler) {
|
|
1259
|
+
this.eventEmitter.on(event, handler);
|
|
1260
|
+
}
|
|
1261
|
+
off(event, handler) {
|
|
1262
|
+
this.eventEmitter.off(event, handler);
|
|
1263
|
+
}
|
|
1264
|
+
saveSessionToken(token) {
|
|
1265
|
+
if (typeof window !== "undefined" && window.sessionStorage) {
|
|
1266
|
+
try {
|
|
1267
|
+
window.sessionStorage.setItem("integrate_session_token", token);
|
|
1268
|
+
} catch (error) {
|
|
1269
|
+
console.error("Failed to save session token to sessionStorage:", error);
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1273
|
+
loadSessionToken() {
|
|
1274
|
+
if (typeof window !== "undefined" && window.sessionStorage) {
|
|
1275
|
+
try {
|
|
1276
|
+
return window.sessionStorage.getItem("integrate_session_token") || undefined;
|
|
1277
|
+
} catch (error) {
|
|
1278
|
+
console.error("Failed to load session token from sessionStorage:", error);
|
|
1279
|
+
return;
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
return;
|
|
1283
|
+
}
|
|
1284
|
+
clearSessionToken() {
|
|
1285
|
+
if (typeof window !== "undefined" && window.sessionStorage) {
|
|
1286
|
+
try {
|
|
1287
|
+
window.sessionStorage.removeItem("integrate_session_token");
|
|
1288
|
+
} catch (error) {
|
|
1289
|
+
console.error("Failed to clear session token from sessionStorage:", error);
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
this.oauthManager.clearSessionToken();
|
|
1293
|
+
}
|
|
1193
1294
|
async disconnect() {
|
|
1194
1295
|
for (const plugin of this.plugins) {
|
|
1195
1296
|
if (plugin.onDisconnect) {
|
|
@@ -1233,18 +1334,44 @@ class MCPClient {
|
|
|
1233
1334
|
async authorize(provider) {
|
|
1234
1335
|
const plugin = this.plugins.find((p) => p.oauth?.provider === provider);
|
|
1235
1336
|
if (!plugin?.oauth) {
|
|
1236
|
-
|
|
1337
|
+
const error = new Error(`No OAuth configuration found for provider: ${provider}`);
|
|
1338
|
+
this.eventEmitter.emit("auth:error", { provider, error });
|
|
1339
|
+
throw error;
|
|
1340
|
+
}
|
|
1341
|
+
this.eventEmitter.emit("auth:started", { provider });
|
|
1342
|
+
try {
|
|
1343
|
+
await this.oauthManager.initiateFlow(provider, plugin.oauth);
|
|
1344
|
+
const sessionToken = this.oauthManager.getSessionToken();
|
|
1345
|
+
if (sessionToken) {
|
|
1346
|
+
this.saveSessionToken(sessionToken);
|
|
1347
|
+
this.eventEmitter.emit("auth:complete", { provider, sessionToken });
|
|
1348
|
+
}
|
|
1349
|
+
this.authState.set(provider, { authenticated: true });
|
|
1350
|
+
} catch (error) {
|
|
1351
|
+
this.eventEmitter.emit("auth:error", { provider, error });
|
|
1352
|
+
throw error;
|
|
1237
1353
|
}
|
|
1238
|
-
await this.oauthManager.initiateFlow(provider, plugin.oauth);
|
|
1239
|
-
this.authState.set(provider, { authenticated: true });
|
|
1240
1354
|
}
|
|
1241
1355
|
async handleOAuthCallback(params) {
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1356
|
+
try {
|
|
1357
|
+
const sessionToken = await this.oauthManager.handleCallback(params.code, params.state);
|
|
1358
|
+
this.saveSessionToken(sessionToken);
|
|
1359
|
+
this.transport.setHeader("X-Session-Token", sessionToken);
|
|
1360
|
+
for (const plugin of this.plugins) {
|
|
1361
|
+
if (plugin.oauth) {
|
|
1362
|
+
this.authState.set(plugin.oauth.provider, { authenticated: true });
|
|
1363
|
+
this.eventEmitter.emit("auth:complete", {
|
|
1364
|
+
provider: plugin.oauth.provider,
|
|
1365
|
+
sessionToken
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1247
1368
|
}
|
|
1369
|
+
} catch (error) {
|
|
1370
|
+
this.eventEmitter.emit("auth:error", {
|
|
1371
|
+
provider: "unknown",
|
|
1372
|
+
error
|
|
1373
|
+
});
|
|
1374
|
+
throw error;
|
|
1248
1375
|
}
|
|
1249
1376
|
}
|
|
1250
1377
|
getSessionToken() {
|
|
@@ -1339,6 +1466,9 @@ function createMCPClient(config) {
|
|
|
1339
1466
|
console.error("Failed to connect client:", error);
|
|
1340
1467
|
});
|
|
1341
1468
|
}
|
|
1469
|
+
if (config.autoHandleOAuthCallback !== false) {
|
|
1470
|
+
processOAuthCallbackFromHash(client);
|
|
1471
|
+
}
|
|
1342
1472
|
return client;
|
|
1343
1473
|
} else {
|
|
1344
1474
|
const client = new MCPClient(config);
|
|
@@ -1351,9 +1481,35 @@ function createMCPClient(config) {
|
|
|
1351
1481
|
console.error("Failed to connect client:", error);
|
|
1352
1482
|
});
|
|
1353
1483
|
}
|
|
1484
|
+
if (config.autoHandleOAuthCallback !== false) {
|
|
1485
|
+
processOAuthCallbackFromHash(client);
|
|
1486
|
+
}
|
|
1354
1487
|
return client;
|
|
1355
1488
|
}
|
|
1356
1489
|
}
|
|
1490
|
+
function processOAuthCallbackFromHash(client) {
|
|
1491
|
+
if (typeof window === "undefined") {
|
|
1492
|
+
return;
|
|
1493
|
+
}
|
|
1494
|
+
try {
|
|
1495
|
+
const hash = window.location.hash;
|
|
1496
|
+
if (hash && hash.includes("oauth_callback=")) {
|
|
1497
|
+
const hashParams = new URLSearchParams(hash.substring(1));
|
|
1498
|
+
const oauthCallbackData = hashParams.get("oauth_callback");
|
|
1499
|
+
if (oauthCallbackData) {
|
|
1500
|
+
const callbackParams = JSON.parse(decodeURIComponent(oauthCallbackData));
|
|
1501
|
+
if (callbackParams.code && callbackParams.state) {
|
|
1502
|
+
client.handleOAuthCallback(callbackParams).catch((error) => {
|
|
1503
|
+
console.error("Failed to process OAuth callback:", error);
|
|
1504
|
+
});
|
|
1505
|
+
window.history.replaceState(null, "", window.location.pathname + window.location.search);
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
} catch (error) {
|
|
1510
|
+
console.error("Failed to process OAuth callback from hash:", error);
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1357
1513
|
async function clearClientCache() {
|
|
1358
1514
|
const clients = Array.from(clientCache.values());
|
|
1359
1515
|
clientCache.clear();
|
package/dist/server.js
CHANGED
|
@@ -591,6 +591,7 @@ function base64UrlEncode(array) {
|
|
|
591
591
|
}
|
|
592
592
|
|
|
593
593
|
// src/oauth/window-manager.ts
|
|
594
|
+
"use client";
|
|
594
595
|
function isBrowser() {
|
|
595
596
|
return typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
596
597
|
}
|
|
@@ -776,6 +777,8 @@ function sendCallbackToOpener(params) {
|
|
|
776
777
|
}
|
|
777
778
|
|
|
778
779
|
// src/oauth/manager.ts
|
|
780
|
+
"use client";
|
|
781
|
+
|
|
779
782
|
class OAuthManager {
|
|
780
783
|
pendingAuths = new Map;
|
|
781
784
|
sessionToken;
|
|
@@ -839,6 +842,7 @@ class OAuthManager {
|
|
|
839
842
|
try {
|
|
840
843
|
const response = await this.exchangeCodeForToken(pendingAuth.provider, code, pendingAuth.codeVerifier, state);
|
|
841
844
|
this.sessionToken = response.sessionToken;
|
|
845
|
+
this.saveSessionToken(response.sessionToken);
|
|
842
846
|
this.pendingAuths.delete(state);
|
|
843
847
|
return response.sessionToken;
|
|
844
848
|
} catch (error) {
|
|
@@ -882,9 +886,26 @@ class OAuthManager {
|
|
|
882
886
|
}
|
|
883
887
|
setSessionToken(token) {
|
|
884
888
|
this.sessionToken = token;
|
|
889
|
+
this.saveSessionToken(token);
|
|
885
890
|
}
|
|
886
891
|
clearSessionToken() {
|
|
887
892
|
this.sessionToken = undefined;
|
|
893
|
+
if (typeof window !== "undefined" && window.sessionStorage) {
|
|
894
|
+
try {
|
|
895
|
+
window.sessionStorage.removeItem("integrate_session_token");
|
|
896
|
+
} catch (error) {
|
|
897
|
+
console.error("Failed to clear session token from sessionStorage:", error);
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
saveSessionToken(token) {
|
|
902
|
+
if (typeof window !== "undefined" && window.sessionStorage) {
|
|
903
|
+
try {
|
|
904
|
+
window.sessionStorage.setItem("integrate_session_token", token);
|
|
905
|
+
} catch (error) {
|
|
906
|
+
console.error("Failed to save session token to sessionStorage:", error);
|
|
907
|
+
}
|
|
908
|
+
}
|
|
888
909
|
}
|
|
889
910
|
async getAuthorizationUrl(provider, scopes, state, codeChallenge, redirectUri) {
|
|
890
911
|
const url = `${this.oauthApiBase}/authorize`;
|
|
@@ -936,6 +957,42 @@ class OAuthManager {
|
|
|
936
957
|
}
|
|
937
958
|
|
|
938
959
|
// src/client.ts
|
|
960
|
+
"use client";
|
|
961
|
+
|
|
962
|
+
class SimpleEventEmitter {
|
|
963
|
+
handlers = new Map;
|
|
964
|
+
on(event, handler) {
|
|
965
|
+
if (!this.handlers.has(event)) {
|
|
966
|
+
this.handlers.set(event, new Set);
|
|
967
|
+
}
|
|
968
|
+
this.handlers.get(event).add(handler);
|
|
969
|
+
}
|
|
970
|
+
off(event, handler) {
|
|
971
|
+
const handlers = this.handlers.get(event);
|
|
972
|
+
if (handlers) {
|
|
973
|
+
handlers.delete(handler);
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
emit(event, payload) {
|
|
977
|
+
const handlers = this.handlers.get(event);
|
|
978
|
+
if (handlers) {
|
|
979
|
+
handlers.forEach((handler) => {
|
|
980
|
+
try {
|
|
981
|
+
handler(payload);
|
|
982
|
+
} catch (error) {
|
|
983
|
+
console.error(`Error in event handler for ${event}:`, error);
|
|
984
|
+
}
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
removeAllListeners(event) {
|
|
989
|
+
if (event) {
|
|
990
|
+
this.handlers.delete(event);
|
|
991
|
+
} else {
|
|
992
|
+
this.handlers.clear();
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
}
|
|
939
996
|
var MCP_SERVER_URL = "https://mcp.integrate.dev/api/v1/mcp";
|
|
940
997
|
var clientCache = new Map;
|
|
941
998
|
var cleanupClients = new Set;
|
|
@@ -954,6 +1011,7 @@ class MCPClient {
|
|
|
954
1011
|
connectionMode;
|
|
955
1012
|
connecting = null;
|
|
956
1013
|
oauthManager;
|
|
1014
|
+
eventEmitter = new SimpleEventEmitter;
|
|
957
1015
|
github;
|
|
958
1016
|
gmail;
|
|
959
1017
|
server;
|
|
@@ -972,9 +1030,16 @@ class MCPClient {
|
|
|
972
1030
|
this.maxReauthRetries = config.maxReauthRetries ?? 1;
|
|
973
1031
|
this.connectionMode = config.connectionMode ?? "lazy";
|
|
974
1032
|
this.oauthManager = new OAuthManager(config.oauthApiBase || "/api/integrate/oauth", config.oauthFlow);
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
this.
|
|
1033
|
+
let sessionToken = config.sessionToken;
|
|
1034
|
+
if (!sessionToken) {
|
|
1035
|
+
const storedToken = this.loadSessionToken();
|
|
1036
|
+
if (storedToken) {
|
|
1037
|
+
sessionToken = storedToken;
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
if (sessionToken) {
|
|
1041
|
+
this.oauthManager.setSessionToken(sessionToken);
|
|
1042
|
+
this.transport.setHeader("X-Session-Token", sessionToken);
|
|
978
1043
|
}
|
|
979
1044
|
for (const plugin of this.plugins) {
|
|
980
1045
|
for (const toolName of plugin.tools) {
|
|
@@ -1190,6 +1255,42 @@ class MCPClient {
|
|
|
1190
1255
|
onMessage(handler) {
|
|
1191
1256
|
return this.transport.onMessage(handler);
|
|
1192
1257
|
}
|
|
1258
|
+
on(event, handler) {
|
|
1259
|
+
this.eventEmitter.on(event, handler);
|
|
1260
|
+
}
|
|
1261
|
+
off(event, handler) {
|
|
1262
|
+
this.eventEmitter.off(event, handler);
|
|
1263
|
+
}
|
|
1264
|
+
saveSessionToken(token) {
|
|
1265
|
+
if (typeof window !== "undefined" && window.sessionStorage) {
|
|
1266
|
+
try {
|
|
1267
|
+
window.sessionStorage.setItem("integrate_session_token", token);
|
|
1268
|
+
} catch (error) {
|
|
1269
|
+
console.error("Failed to save session token to sessionStorage:", error);
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1273
|
+
loadSessionToken() {
|
|
1274
|
+
if (typeof window !== "undefined" && window.sessionStorage) {
|
|
1275
|
+
try {
|
|
1276
|
+
return window.sessionStorage.getItem("integrate_session_token") || undefined;
|
|
1277
|
+
} catch (error) {
|
|
1278
|
+
console.error("Failed to load session token from sessionStorage:", error);
|
|
1279
|
+
return;
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
return;
|
|
1283
|
+
}
|
|
1284
|
+
clearSessionToken() {
|
|
1285
|
+
if (typeof window !== "undefined" && window.sessionStorage) {
|
|
1286
|
+
try {
|
|
1287
|
+
window.sessionStorage.removeItem("integrate_session_token");
|
|
1288
|
+
} catch (error) {
|
|
1289
|
+
console.error("Failed to clear session token from sessionStorage:", error);
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
this.oauthManager.clearSessionToken();
|
|
1293
|
+
}
|
|
1193
1294
|
async disconnect() {
|
|
1194
1295
|
for (const plugin of this.plugins) {
|
|
1195
1296
|
if (plugin.onDisconnect) {
|
|
@@ -1233,18 +1334,44 @@ class MCPClient {
|
|
|
1233
1334
|
async authorize(provider) {
|
|
1234
1335
|
const plugin = this.plugins.find((p) => p.oauth?.provider === provider);
|
|
1235
1336
|
if (!plugin?.oauth) {
|
|
1236
|
-
|
|
1337
|
+
const error = new Error(`No OAuth configuration found for provider: ${provider}`);
|
|
1338
|
+
this.eventEmitter.emit("auth:error", { provider, error });
|
|
1339
|
+
throw error;
|
|
1340
|
+
}
|
|
1341
|
+
this.eventEmitter.emit("auth:started", { provider });
|
|
1342
|
+
try {
|
|
1343
|
+
await this.oauthManager.initiateFlow(provider, plugin.oauth);
|
|
1344
|
+
const sessionToken = this.oauthManager.getSessionToken();
|
|
1345
|
+
if (sessionToken) {
|
|
1346
|
+
this.saveSessionToken(sessionToken);
|
|
1347
|
+
this.eventEmitter.emit("auth:complete", { provider, sessionToken });
|
|
1348
|
+
}
|
|
1349
|
+
this.authState.set(provider, { authenticated: true });
|
|
1350
|
+
} catch (error) {
|
|
1351
|
+
this.eventEmitter.emit("auth:error", { provider, error });
|
|
1352
|
+
throw error;
|
|
1237
1353
|
}
|
|
1238
|
-
await this.oauthManager.initiateFlow(provider, plugin.oauth);
|
|
1239
|
-
this.authState.set(provider, { authenticated: true });
|
|
1240
1354
|
}
|
|
1241
1355
|
async handleOAuthCallback(params) {
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1356
|
+
try {
|
|
1357
|
+
const sessionToken = await this.oauthManager.handleCallback(params.code, params.state);
|
|
1358
|
+
this.saveSessionToken(sessionToken);
|
|
1359
|
+
this.transport.setHeader("X-Session-Token", sessionToken);
|
|
1360
|
+
for (const plugin of this.plugins) {
|
|
1361
|
+
if (plugin.oauth) {
|
|
1362
|
+
this.authState.set(plugin.oauth.provider, { authenticated: true });
|
|
1363
|
+
this.eventEmitter.emit("auth:complete", {
|
|
1364
|
+
provider: plugin.oauth.provider,
|
|
1365
|
+
sessionToken
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1247
1368
|
}
|
|
1369
|
+
} catch (error) {
|
|
1370
|
+
this.eventEmitter.emit("auth:error", {
|
|
1371
|
+
provider: "unknown",
|
|
1372
|
+
error
|
|
1373
|
+
});
|
|
1374
|
+
throw error;
|
|
1248
1375
|
}
|
|
1249
1376
|
}
|
|
1250
1377
|
getSessionToken() {
|
|
@@ -1339,6 +1466,9 @@ function createMCPClient(config) {
|
|
|
1339
1466
|
console.error("Failed to connect client:", error);
|
|
1340
1467
|
});
|
|
1341
1468
|
}
|
|
1469
|
+
if (config.autoHandleOAuthCallback !== false) {
|
|
1470
|
+
processOAuthCallbackFromHash(client);
|
|
1471
|
+
}
|
|
1342
1472
|
return client;
|
|
1343
1473
|
} else {
|
|
1344
1474
|
const client = new MCPClient(config);
|
|
@@ -1351,9 +1481,35 @@ function createMCPClient(config) {
|
|
|
1351
1481
|
console.error("Failed to connect client:", error);
|
|
1352
1482
|
});
|
|
1353
1483
|
}
|
|
1484
|
+
if (config.autoHandleOAuthCallback !== false) {
|
|
1485
|
+
processOAuthCallbackFromHash(client);
|
|
1486
|
+
}
|
|
1354
1487
|
return client;
|
|
1355
1488
|
}
|
|
1356
1489
|
}
|
|
1490
|
+
function processOAuthCallbackFromHash(client) {
|
|
1491
|
+
if (typeof window === "undefined") {
|
|
1492
|
+
return;
|
|
1493
|
+
}
|
|
1494
|
+
try {
|
|
1495
|
+
const hash = window.location.hash;
|
|
1496
|
+
if (hash && hash.includes("oauth_callback=")) {
|
|
1497
|
+
const hashParams = new URLSearchParams(hash.substring(1));
|
|
1498
|
+
const oauthCallbackData = hashParams.get("oauth_callback");
|
|
1499
|
+
if (oauthCallbackData) {
|
|
1500
|
+
const callbackParams = JSON.parse(decodeURIComponent(oauthCallbackData));
|
|
1501
|
+
if (callbackParams.code && callbackParams.state) {
|
|
1502
|
+
client.handleOAuthCallback(callbackParams).catch((error) => {
|
|
1503
|
+
console.error("Failed to process OAuth callback:", error);
|
|
1504
|
+
});
|
|
1505
|
+
window.history.replaceState(null, "", window.location.pathname + window.location.search);
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
} catch (error) {
|
|
1510
|
+
console.error("Failed to process OAuth callback from hash:", error);
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1357
1513
|
async function clearClientCache() {
|
|
1358
1514
|
const clients = Array.from(clientCache.values());
|
|
1359
1515
|
clientCache.clear();
|
package/dist/src/client.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP Client
|
|
3
|
-
* Main client class that orchestrates transport, protocol, and plugins
|
|
4
|
-
*/
|
|
5
1
|
import type { MCPTool, MCPToolCallResponse } from "./protocol/messages.js";
|
|
6
2
|
import type { MCPPlugin, OAuthConfig } from "./plugins/types.js";
|
|
7
3
|
import type { MCPClientConfig } from "./config/types.js";
|
|
@@ -9,7 +5,7 @@ import { type AuthenticationError } from "./errors.js";
|
|
|
9
5
|
import type { GitHubPluginClient } from "./plugins/github-client.js";
|
|
10
6
|
import type { GmailPluginClient } from "./plugins/gmail-client.js";
|
|
11
7
|
import type { ServerPluginClient } from "./plugins/server-client.js";
|
|
12
|
-
import type { AuthStatus, OAuthCallbackParams } from "./oauth/types.js";
|
|
8
|
+
import type { AuthStatus, OAuthCallbackParams, OAuthEventHandler, AuthStartedEvent, AuthCompleteEvent, AuthErrorEvent } from "./oauth/types.js";
|
|
13
9
|
/**
|
|
14
10
|
* Tool invocation options
|
|
15
11
|
*/
|
|
@@ -56,6 +52,7 @@ export declare class MCPClient<TPlugins extends readonly MCPPlugin[] = readonly
|
|
|
56
52
|
private connectionMode;
|
|
57
53
|
private connecting;
|
|
58
54
|
private oauthManager;
|
|
55
|
+
private eventEmitter;
|
|
59
56
|
readonly github: PluginNamespaces<TPlugins> extends {
|
|
60
57
|
github: GitHubPluginClient;
|
|
61
58
|
} ? GitHubPluginClient : never;
|
|
@@ -148,6 +145,47 @@ export declare class MCPClient<TPlugins extends readonly MCPPlugin[] = readonly
|
|
|
148
145
|
* Register a message handler
|
|
149
146
|
*/
|
|
150
147
|
onMessage(handler: (message: unknown) => void): () => void;
|
|
148
|
+
/**
|
|
149
|
+
* Add event listener for OAuth events
|
|
150
|
+
*
|
|
151
|
+
* @param event - Event type to listen for
|
|
152
|
+
* @param handler - Handler function to call when event is emitted
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* ```typescript
|
|
156
|
+
* client.on('auth:complete', ({ provider, sessionToken }) => {
|
|
157
|
+
* console.log(`${provider} authorized!`);
|
|
158
|
+
* });
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
on(event: 'auth:started', handler: OAuthEventHandler<AuthStartedEvent>): void;
|
|
162
|
+
on(event: 'auth:complete', handler: OAuthEventHandler<AuthCompleteEvent>): void;
|
|
163
|
+
on(event: 'auth:error', handler: OAuthEventHandler<AuthErrorEvent>): void;
|
|
164
|
+
/**
|
|
165
|
+
* Remove event listener for OAuth events
|
|
166
|
+
*
|
|
167
|
+
* @param event - Event type to stop listening for
|
|
168
|
+
* @param handler - Handler function to remove
|
|
169
|
+
*/
|
|
170
|
+
off(event: 'auth:started', handler: OAuthEventHandler<AuthStartedEvent>): void;
|
|
171
|
+
off(event: 'auth:complete', handler: OAuthEventHandler<AuthCompleteEvent>): void;
|
|
172
|
+
off(event: 'auth:error', handler: OAuthEventHandler<AuthErrorEvent>): void;
|
|
173
|
+
/**
|
|
174
|
+
* Save session token to sessionStorage
|
|
175
|
+
*
|
|
176
|
+
* @param token - Session token to save
|
|
177
|
+
*/
|
|
178
|
+
private saveSessionToken;
|
|
179
|
+
/**
|
|
180
|
+
* Load session token from sessionStorage
|
|
181
|
+
*
|
|
182
|
+
* @returns Session token or undefined if not found
|
|
183
|
+
*/
|
|
184
|
+
private loadSessionToken;
|
|
185
|
+
/**
|
|
186
|
+
* Clear session token from sessionStorage
|
|
187
|
+
*/
|
|
188
|
+
clearSessionToken(): void;
|
|
151
189
|
/**
|
|
152
190
|
* Disconnect from the server
|
|
153
191
|
*/
|
package/dist/src/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,OAAO,EAEP,mBAAmB,EAIpB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAiB,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAGL,KAAK,mBAAmB,EAC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oCG;AACH,wBAAgB,eAAe,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE,EACnE,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,GAChC,SAAS,CAAC,QAAQ,CAAC,CAkErB;AA0CD;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAetD"}
|
|
@@ -148,6 +148,21 @@ export interface MCPClientConfig<TPlugins extends readonly MCPPlugin[]> {
|
|
|
148
148
|
* ```
|
|
149
149
|
*/
|
|
150
150
|
oauthApiBase?: string;
|
|
151
|
+
/**
|
|
152
|
+
* Automatically detect and handle OAuth callbacks from URL hash fragments
|
|
153
|
+
* When true, the SDK will automatically process #oauth_callback={...} in the URL
|
|
154
|
+
*
|
|
155
|
+
* @default true
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```typescript
|
|
159
|
+
* const client = createMCPClient({
|
|
160
|
+
* plugins: [githubPlugin({ ... })],
|
|
161
|
+
* autoHandleOAuthCallback: false // Disable automatic callback handling
|
|
162
|
+
* });
|
|
163
|
+
* ```
|
|
164
|
+
*/
|
|
165
|
+
autoHandleOAuthCallback?: boolean;
|
|
151
166
|
}
|
|
152
167
|
/**
|
|
153
168
|
* Helper type to infer enabled tools from plugins
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/config/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,uDAAuD;IACvD,QAAQ,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,KAAK,EAAE,mBAAmB,CAAC;IAC3B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH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CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;;;;;;;;;;OAcG;IACH,SAAS,CAAC,EAAE;QACV,+DAA+D;QAC/D,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;QAC5B,oDAAoD;QACpD,YAAY,CAAC,EAAE;YACb,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,MAAM,CAAC,EAAE,MAAM,CAAC;SACjB,CAAC;QACF,sDAAsD;QACtD,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;KACnF,CAAC;IAEF;;;;;;;;;;;;OAYG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;;;;;;;;;;;;;;OAkBG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;;;;;;;;;OAaG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE,IACjE,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpC;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE,IAAI;KACnE,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC;CAC/C,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type { ToolInvocationOptions } from "./client.js";
|
|
|
7
7
|
export { OAuthManager } from "./oauth/manager.js";
|
|
8
8
|
export { OAuthWindowManager, sendCallbackToOpener } from "./oauth/window-manager.js";
|
|
9
9
|
export { generateCodeVerifier, generateCodeChallenge, generateState } from "./oauth/pkce.js";
|
|
10
|
-
export type { OAuthFlowConfig, PopupOptions, AuthStatus, PendingAuth, AuthorizationUrlResponse, OAuthCallbackResponse, OAuthCallbackParams, } from "./oauth/types.js";
|
|
10
|
+
export type { OAuthFlowConfig, PopupOptions, AuthStatus, PendingAuth, AuthorizationUrlResponse, OAuthCallbackResponse, OAuthCallbackParams, OAuthEventType, OAuthEventHandler, AuthStartedEvent, AuthCompleteEvent, AuthErrorEvent, } from "./oauth/types.js";
|
|
11
11
|
export { OAuthHandler } from "./adapters/base-handler.js";
|
|
12
12
|
export type { OAuthHandlerConfig, AuthorizeRequest, AuthorizeResponse, CallbackRequest, CallbackResponse, StatusResponse, } from "./adapters/base-handler.js";
|
|
13
13
|
export { createNextOAuthHandler } from "./adapters/nextjs.js";
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC3E,YAAY,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGzD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC7F,YAAY,EACV,eAAe,EACf,YAAY,EACZ,UAAU,EACV,WAAW,EACX,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC3E,YAAY,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGzD,OAA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/F,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG3F,YAAY,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAGrE,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,YAAY,EACV,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,OAAO,EACP,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,YAAY,EACV,cAAc,EACd,2BAA2B,GAC5B,MAAM,6BAA6B,CAAC"}
|
|
@@ -75,6 +75,10 @@ export declare class OAuthManager {
|
|
|
75
75
|
* Clear session token
|
|
76
76
|
*/
|
|
77
77
|
clearSessionToken(): void;
|
|
78
|
+
/**
|
|
79
|
+
* Save session token to sessionStorage
|
|
80
|
+
*/
|
|
81
|
+
private saveSessionToken;
|
|
78
82
|
/**
|
|
79
83
|
* Request authorization URL from user's API route
|
|
80
84
|
* The API route will add OAuth secrets and forward to MCP server
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../src/oauth/manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../src/oauth/manager.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EACV,eAAe,EAEf,UAAU,EAGX,MAAM,YAAY,CAAC;AAIpB;;;GAGG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,YAAY,CAAuC;IAC3D,OAAO,CAAC,YAAY,CAAC,CAAS;IAC9B,OAAO,CAAC,aAAa,CAAqB;IAC1C,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,YAAY,CAAS;gBAG3B,YAAY,EAAE,MAAM,EACpB,UAAU,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC;IAWvC;;;;;;;;;;;;;;;;OAgBG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAwCxE;;;;;;;;;;;;;OAaG;IACG,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAiDlE;;;;;;;;;;;;;OAaG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAoC5D;;OAEG;IACH,eAAe,IAAI,MAAM,GAAG,SAAS;IAIrC;;OAEG;IACH,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKpC;;OAEG;IACH,iBAAiB,IAAI,IAAI;IAWzB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAUxB;;;OAGG;YACW,mBAAmB;IAiCjC;;;OAGG;YACW,oBAAoB;IA8BlC;;OAEG;IACH,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -81,4 +81,37 @@ export interface OAuthCallbackParams {
|
|
|
81
81
|
/** State parameter for CSRF protection */
|
|
82
82
|
state: string;
|
|
83
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Event payload for auth:started event
|
|
86
|
+
*/
|
|
87
|
+
export interface AuthStartedEvent {
|
|
88
|
+
/** Provider being authorized */
|
|
89
|
+
provider: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Event payload for auth:complete event
|
|
93
|
+
*/
|
|
94
|
+
export interface AuthCompleteEvent {
|
|
95
|
+
/** Provider that was authorized */
|
|
96
|
+
provider: string;
|
|
97
|
+
/** Session token for authenticated requests */
|
|
98
|
+
sessionToken: string;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Event payload for auth:error event
|
|
102
|
+
*/
|
|
103
|
+
export interface AuthErrorEvent {
|
|
104
|
+
/** Provider that failed authorization */
|
|
105
|
+
provider: string;
|
|
106
|
+
/** Error that occurred */
|
|
107
|
+
error: Error;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* All possible OAuth event types
|
|
111
|
+
*/
|
|
112
|
+
export type OAuthEventType = 'auth:started' | 'auth:complete' | 'auth:error';
|
|
113
|
+
/**
|
|
114
|
+
* Event handler function type
|
|
115
|
+
*/
|
|
116
|
+
export type OAuthEventHandler<T = any> = (payload: T) => void;
|
|
84
117
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/oauth/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,yCAAyC;IACzC,IAAI,EAAE,OAAO,GAAG,UAAU,CAAC;IAC3B,oDAAoD;IACpD,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,sDAAsD;IACtD,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM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AAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,+CAA+C;IAC/C,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,0BAA0B;IAC1B,KAAK,EAAE,KAAK,CAAC;CACd;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,eAAe,GAAG,YAAY,CAAC;AAE7E;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"window-manager.d.ts","sourceRoot":"","sources":["../../../src/oauth/window-manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"window-manager.d.ts","sourceRoot":"","sources":["../../../src/oauth/window-manager.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AASpE;;;;;;GAMG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,WAAW,CAAuB;IAC1C,OAAO,CAAC,kBAAkB,CAA+C;IACzE,OAAO,CAAC,iBAAiB,CAA8C;IAEvE;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,MAAM,GAAG,IAAI;IAwC7D;;;;;;;;;;OAUG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAQ/B;;;;;;;;;;;;;;;;;OAiBG;IACH,iBAAiB,CACf,IAAI,EAAE,OAAO,GAAG,UAAU,EAC1B,SAAS,GAAE,MAAsB,GAChC,OAAO,CAAC,mBAAmB,CAAC;IAQ/B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAkE9B;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAiEjC;;OAEG;IACH,OAAO,CAAC,OAAO;IAiBf;;;OAGG;IACH,KAAK,IAAI,IAAI;CAGd;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE;IAC3C,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,GAAG,IAAI,CAwBP"}
|