integrate-sdk 0.7.57 → 0.7.58
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/adapters/index.js +60 -17
- package/dist/adapters/solid-start.js +60 -17
- package/dist/adapters/svelte-kit.js +60 -17
- package/dist/index.js +60 -17
- package/dist/server.js +60 -17
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/oauth/manager.d.ts +20 -0
- package/dist/src/oauth/manager.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/adapters/index.js
CHANGED
|
@@ -1613,6 +1613,9 @@ class OAuthManager {
|
|
|
1613
1613
|
getAllProviderTokens() {
|
|
1614
1614
|
return new Map(this.providerTokens);
|
|
1615
1615
|
}
|
|
1616
|
+
getProviderTokenFromCache(provider) {
|
|
1617
|
+
return this.providerTokens.get(provider);
|
|
1618
|
+
}
|
|
1616
1619
|
async setProviderToken(provider, tokenData, context) {
|
|
1617
1620
|
this.providerTokens.set(provider, tokenData);
|
|
1618
1621
|
await this.saveProviderToken(provider, tokenData, context);
|
|
@@ -1707,6 +1710,34 @@ class OAuthManager {
|
|
|
1707
1710
|
}
|
|
1708
1711
|
}
|
|
1709
1712
|
}
|
|
1713
|
+
loadProviderTokenSync(provider) {
|
|
1714
|
+
if (this.getTokenCallback) {
|
|
1715
|
+
return;
|
|
1716
|
+
}
|
|
1717
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
1718
|
+
try {
|
|
1719
|
+
const key = `integrate_token_${provider}`;
|
|
1720
|
+
const stored = window.localStorage.getItem(key);
|
|
1721
|
+
if (stored) {
|
|
1722
|
+
return JSON.parse(stored);
|
|
1723
|
+
}
|
|
1724
|
+
} catch (error) {
|
|
1725
|
+
console.error(`Failed to load token for ${provider} from localStorage:`, error);
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
return;
|
|
1729
|
+
}
|
|
1730
|
+
loadAllProviderTokensSync(providers) {
|
|
1731
|
+
if (this.getTokenCallback) {
|
|
1732
|
+
return;
|
|
1733
|
+
}
|
|
1734
|
+
for (const provider of providers) {
|
|
1735
|
+
const tokenData = this.loadProviderTokenSync(provider);
|
|
1736
|
+
if (tokenData) {
|
|
1737
|
+
this.providerTokens.set(provider, tokenData);
|
|
1738
|
+
}
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1710
1741
|
savePendingAuthToStorage(state, pendingAuth) {
|
|
1711
1742
|
if (typeof window !== "undefined" && window.localStorage) {
|
|
1712
1743
|
try {
|
|
@@ -1913,28 +1944,40 @@ class MCPClientBase {
|
|
|
1913
1944
|
}
|
|
1914
1945
|
}
|
|
1915
1946
|
const providers = this.integrations.filter((p) => p.oauth).map((p) => p.oauth.provider);
|
|
1916
|
-
|
|
1947
|
+
const usingDatabaseCallbacks = !!config.getProviderToken;
|
|
1948
|
+
if (usingDatabaseCallbacks) {
|
|
1949
|
+
this.oauthManager.loadAllProviderTokens(providers).then(async () => {
|
|
1950
|
+
for (const integration of this.integrations) {
|
|
1951
|
+
if (integration.oauth) {
|
|
1952
|
+
const provider = integration.oauth.provider;
|
|
1953
|
+
try {
|
|
1954
|
+
const tokenData = await this.oauthManager.getProviderToken(provider);
|
|
1955
|
+
const currentState = this.authState.get(provider);
|
|
1956
|
+
if (currentState && !currentState.authenticated && !currentState.lastError) {
|
|
1957
|
+
this.authState.set(provider, { authenticated: !!tokenData });
|
|
1958
|
+
}
|
|
1959
|
+
} catch (error) {
|
|
1960
|
+
console.error(`Failed to check token for ${provider}:`, error);
|
|
1961
|
+
const currentState = this.authState.get(provider);
|
|
1962
|
+
if (currentState && !currentState.authenticated && !currentState.lastError) {
|
|
1963
|
+
this.authState.set(provider, { authenticated: false });
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1968
|
+
}).catch((error) => {
|
|
1969
|
+
console.error("Failed to load provider tokens:", error);
|
|
1970
|
+
});
|
|
1971
|
+
} else {
|
|
1972
|
+
this.oauthManager.loadAllProviderTokensSync(providers);
|
|
1917
1973
|
for (const integration of this.integrations) {
|
|
1918
1974
|
if (integration.oauth) {
|
|
1919
1975
|
const provider = integration.oauth.provider;
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
const currentState = this.authState.get(provider);
|
|
1923
|
-
if (currentState && !currentState.authenticated && !currentState.lastError) {
|
|
1924
|
-
this.authState.set(provider, { authenticated: !!tokenData });
|
|
1925
|
-
}
|
|
1926
|
-
} catch (error) {
|
|
1927
|
-
console.error(`Failed to check token for ${provider}:`, error);
|
|
1928
|
-
const currentState = this.authState.get(provider);
|
|
1929
|
-
if (currentState && !currentState.authenticated && !currentState.lastError) {
|
|
1930
|
-
this.authState.set(provider, { authenticated: false });
|
|
1931
|
-
}
|
|
1932
|
-
}
|
|
1976
|
+
const tokenData = this.oauthManager.getProviderTokenFromCache(provider);
|
|
1977
|
+
this.authState.set(provider, { authenticated: !!tokenData });
|
|
1933
1978
|
}
|
|
1934
1979
|
}
|
|
1935
|
-
}
|
|
1936
|
-
console.error("Failed to load provider tokens:", error);
|
|
1937
|
-
});
|
|
1980
|
+
}
|
|
1938
1981
|
const integrationIds = this.integrations.map((i) => i.id);
|
|
1939
1982
|
if (integrationIds.includes("github")) {
|
|
1940
1983
|
this.github = this.createIntegrationProxy("github");
|
|
@@ -1472,6 +1472,9 @@ class OAuthManager {
|
|
|
1472
1472
|
getAllProviderTokens() {
|
|
1473
1473
|
return new Map(this.providerTokens);
|
|
1474
1474
|
}
|
|
1475
|
+
getProviderTokenFromCache(provider) {
|
|
1476
|
+
return this.providerTokens.get(provider);
|
|
1477
|
+
}
|
|
1475
1478
|
async setProviderToken(provider, tokenData, context) {
|
|
1476
1479
|
this.providerTokens.set(provider, tokenData);
|
|
1477
1480
|
await this.saveProviderToken(provider, tokenData, context);
|
|
@@ -1566,6 +1569,34 @@ class OAuthManager {
|
|
|
1566
1569
|
}
|
|
1567
1570
|
}
|
|
1568
1571
|
}
|
|
1572
|
+
loadProviderTokenSync(provider) {
|
|
1573
|
+
if (this.getTokenCallback) {
|
|
1574
|
+
return;
|
|
1575
|
+
}
|
|
1576
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
1577
|
+
try {
|
|
1578
|
+
const key = `integrate_token_${provider}`;
|
|
1579
|
+
const stored = window.localStorage.getItem(key);
|
|
1580
|
+
if (stored) {
|
|
1581
|
+
return JSON.parse(stored);
|
|
1582
|
+
}
|
|
1583
|
+
} catch (error) {
|
|
1584
|
+
console.error(`Failed to load token for ${provider} from localStorage:`, error);
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
return;
|
|
1588
|
+
}
|
|
1589
|
+
loadAllProviderTokensSync(providers) {
|
|
1590
|
+
if (this.getTokenCallback) {
|
|
1591
|
+
return;
|
|
1592
|
+
}
|
|
1593
|
+
for (const provider of providers) {
|
|
1594
|
+
const tokenData = this.loadProviderTokenSync(provider);
|
|
1595
|
+
if (tokenData) {
|
|
1596
|
+
this.providerTokens.set(provider, tokenData);
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1569
1600
|
savePendingAuthToStorage(state, pendingAuth) {
|
|
1570
1601
|
if (typeof window !== "undefined" && window.localStorage) {
|
|
1571
1602
|
try {
|
|
@@ -1772,28 +1803,40 @@ class MCPClientBase {
|
|
|
1772
1803
|
}
|
|
1773
1804
|
}
|
|
1774
1805
|
const providers = this.integrations.filter((p) => p.oauth).map((p) => p.oauth.provider);
|
|
1775
|
-
|
|
1806
|
+
const usingDatabaseCallbacks = !!config.getProviderToken;
|
|
1807
|
+
if (usingDatabaseCallbacks) {
|
|
1808
|
+
this.oauthManager.loadAllProviderTokens(providers).then(async () => {
|
|
1809
|
+
for (const integration of this.integrations) {
|
|
1810
|
+
if (integration.oauth) {
|
|
1811
|
+
const provider = integration.oauth.provider;
|
|
1812
|
+
try {
|
|
1813
|
+
const tokenData = await this.oauthManager.getProviderToken(provider);
|
|
1814
|
+
const currentState = this.authState.get(provider);
|
|
1815
|
+
if (currentState && !currentState.authenticated && !currentState.lastError) {
|
|
1816
|
+
this.authState.set(provider, { authenticated: !!tokenData });
|
|
1817
|
+
}
|
|
1818
|
+
} catch (error) {
|
|
1819
|
+
console.error(`Failed to check token for ${provider}:`, error);
|
|
1820
|
+
const currentState = this.authState.get(provider);
|
|
1821
|
+
if (currentState && !currentState.authenticated && !currentState.lastError) {
|
|
1822
|
+
this.authState.set(provider, { authenticated: false });
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
}
|
|
1827
|
+
}).catch((error) => {
|
|
1828
|
+
console.error("Failed to load provider tokens:", error);
|
|
1829
|
+
});
|
|
1830
|
+
} else {
|
|
1831
|
+
this.oauthManager.loadAllProviderTokensSync(providers);
|
|
1776
1832
|
for (const integration of this.integrations) {
|
|
1777
1833
|
if (integration.oauth) {
|
|
1778
1834
|
const provider = integration.oauth.provider;
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
const currentState = this.authState.get(provider);
|
|
1782
|
-
if (currentState && !currentState.authenticated && !currentState.lastError) {
|
|
1783
|
-
this.authState.set(provider, { authenticated: !!tokenData });
|
|
1784
|
-
}
|
|
1785
|
-
} catch (error) {
|
|
1786
|
-
console.error(`Failed to check token for ${provider}:`, error);
|
|
1787
|
-
const currentState = this.authState.get(provider);
|
|
1788
|
-
if (currentState && !currentState.authenticated && !currentState.lastError) {
|
|
1789
|
-
this.authState.set(provider, { authenticated: false });
|
|
1790
|
-
}
|
|
1791
|
-
}
|
|
1835
|
+
const tokenData = this.oauthManager.getProviderTokenFromCache(provider);
|
|
1836
|
+
this.authState.set(provider, { authenticated: !!tokenData });
|
|
1792
1837
|
}
|
|
1793
1838
|
}
|
|
1794
|
-
}
|
|
1795
|
-
console.error("Failed to load provider tokens:", error);
|
|
1796
|
-
});
|
|
1839
|
+
}
|
|
1797
1840
|
const integrationIds = this.integrations.map((i) => i.id);
|
|
1798
1841
|
if (integrationIds.includes("github")) {
|
|
1799
1842
|
this.github = this.createIntegrationProxy("github");
|
|
@@ -1472,6 +1472,9 @@ class OAuthManager {
|
|
|
1472
1472
|
getAllProviderTokens() {
|
|
1473
1473
|
return new Map(this.providerTokens);
|
|
1474
1474
|
}
|
|
1475
|
+
getProviderTokenFromCache(provider) {
|
|
1476
|
+
return this.providerTokens.get(provider);
|
|
1477
|
+
}
|
|
1475
1478
|
async setProviderToken(provider, tokenData, context) {
|
|
1476
1479
|
this.providerTokens.set(provider, tokenData);
|
|
1477
1480
|
await this.saveProviderToken(provider, tokenData, context);
|
|
@@ -1566,6 +1569,34 @@ class OAuthManager {
|
|
|
1566
1569
|
}
|
|
1567
1570
|
}
|
|
1568
1571
|
}
|
|
1572
|
+
loadProviderTokenSync(provider) {
|
|
1573
|
+
if (this.getTokenCallback) {
|
|
1574
|
+
return;
|
|
1575
|
+
}
|
|
1576
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
1577
|
+
try {
|
|
1578
|
+
const key = `integrate_token_${provider}`;
|
|
1579
|
+
const stored = window.localStorage.getItem(key);
|
|
1580
|
+
if (stored) {
|
|
1581
|
+
return JSON.parse(stored);
|
|
1582
|
+
}
|
|
1583
|
+
} catch (error) {
|
|
1584
|
+
console.error(`Failed to load token for ${provider} from localStorage:`, error);
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
return;
|
|
1588
|
+
}
|
|
1589
|
+
loadAllProviderTokensSync(providers) {
|
|
1590
|
+
if (this.getTokenCallback) {
|
|
1591
|
+
return;
|
|
1592
|
+
}
|
|
1593
|
+
for (const provider of providers) {
|
|
1594
|
+
const tokenData = this.loadProviderTokenSync(provider);
|
|
1595
|
+
if (tokenData) {
|
|
1596
|
+
this.providerTokens.set(provider, tokenData);
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1569
1600
|
savePendingAuthToStorage(state, pendingAuth) {
|
|
1570
1601
|
if (typeof window !== "undefined" && window.localStorage) {
|
|
1571
1602
|
try {
|
|
@@ -1772,28 +1803,40 @@ class MCPClientBase {
|
|
|
1772
1803
|
}
|
|
1773
1804
|
}
|
|
1774
1805
|
const providers = this.integrations.filter((p) => p.oauth).map((p) => p.oauth.provider);
|
|
1775
|
-
|
|
1806
|
+
const usingDatabaseCallbacks = !!config.getProviderToken;
|
|
1807
|
+
if (usingDatabaseCallbacks) {
|
|
1808
|
+
this.oauthManager.loadAllProviderTokens(providers).then(async () => {
|
|
1809
|
+
for (const integration of this.integrations) {
|
|
1810
|
+
if (integration.oauth) {
|
|
1811
|
+
const provider = integration.oauth.provider;
|
|
1812
|
+
try {
|
|
1813
|
+
const tokenData = await this.oauthManager.getProviderToken(provider);
|
|
1814
|
+
const currentState = this.authState.get(provider);
|
|
1815
|
+
if (currentState && !currentState.authenticated && !currentState.lastError) {
|
|
1816
|
+
this.authState.set(provider, { authenticated: !!tokenData });
|
|
1817
|
+
}
|
|
1818
|
+
} catch (error) {
|
|
1819
|
+
console.error(`Failed to check token for ${provider}:`, error);
|
|
1820
|
+
const currentState = this.authState.get(provider);
|
|
1821
|
+
if (currentState && !currentState.authenticated && !currentState.lastError) {
|
|
1822
|
+
this.authState.set(provider, { authenticated: false });
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
}
|
|
1827
|
+
}).catch((error) => {
|
|
1828
|
+
console.error("Failed to load provider tokens:", error);
|
|
1829
|
+
});
|
|
1830
|
+
} else {
|
|
1831
|
+
this.oauthManager.loadAllProviderTokensSync(providers);
|
|
1776
1832
|
for (const integration of this.integrations) {
|
|
1777
1833
|
if (integration.oauth) {
|
|
1778
1834
|
const provider = integration.oauth.provider;
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
const currentState = this.authState.get(provider);
|
|
1782
|
-
if (currentState && !currentState.authenticated && !currentState.lastError) {
|
|
1783
|
-
this.authState.set(provider, { authenticated: !!tokenData });
|
|
1784
|
-
}
|
|
1785
|
-
} catch (error) {
|
|
1786
|
-
console.error(`Failed to check token for ${provider}:`, error);
|
|
1787
|
-
const currentState = this.authState.get(provider);
|
|
1788
|
-
if (currentState && !currentState.authenticated && !currentState.lastError) {
|
|
1789
|
-
this.authState.set(provider, { authenticated: false });
|
|
1790
|
-
}
|
|
1791
|
-
}
|
|
1835
|
+
const tokenData = this.oauthManager.getProviderTokenFromCache(provider);
|
|
1836
|
+
this.authState.set(provider, { authenticated: !!tokenData });
|
|
1792
1837
|
}
|
|
1793
1838
|
}
|
|
1794
|
-
}
|
|
1795
|
-
console.error("Failed to load provider tokens:", error);
|
|
1796
|
-
});
|
|
1839
|
+
}
|
|
1797
1840
|
const integrationIds = this.integrations.map((i) => i.id);
|
|
1798
1841
|
if (integrationIds.includes("github")) {
|
|
1799
1842
|
this.github = this.createIntegrationProxy("github");
|
package/dist/index.js
CHANGED
|
@@ -1313,6 +1313,9 @@ class OAuthManager {
|
|
|
1313
1313
|
getAllProviderTokens() {
|
|
1314
1314
|
return new Map(this.providerTokens);
|
|
1315
1315
|
}
|
|
1316
|
+
getProviderTokenFromCache(provider) {
|
|
1317
|
+
return this.providerTokens.get(provider);
|
|
1318
|
+
}
|
|
1316
1319
|
async setProviderToken(provider, tokenData, context) {
|
|
1317
1320
|
this.providerTokens.set(provider, tokenData);
|
|
1318
1321
|
await this.saveProviderToken(provider, tokenData, context);
|
|
@@ -1407,6 +1410,34 @@ class OAuthManager {
|
|
|
1407
1410
|
}
|
|
1408
1411
|
}
|
|
1409
1412
|
}
|
|
1413
|
+
loadProviderTokenSync(provider) {
|
|
1414
|
+
if (this.getTokenCallback) {
|
|
1415
|
+
return;
|
|
1416
|
+
}
|
|
1417
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
1418
|
+
try {
|
|
1419
|
+
const key = `integrate_token_${provider}`;
|
|
1420
|
+
const stored = window.localStorage.getItem(key);
|
|
1421
|
+
if (stored) {
|
|
1422
|
+
return JSON.parse(stored);
|
|
1423
|
+
}
|
|
1424
|
+
} catch (error) {
|
|
1425
|
+
console.error(`Failed to load token for ${provider} from localStorage:`, error);
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
return;
|
|
1429
|
+
}
|
|
1430
|
+
loadAllProviderTokensSync(providers) {
|
|
1431
|
+
if (this.getTokenCallback) {
|
|
1432
|
+
return;
|
|
1433
|
+
}
|
|
1434
|
+
for (const provider of providers) {
|
|
1435
|
+
const tokenData = this.loadProviderTokenSync(provider);
|
|
1436
|
+
if (tokenData) {
|
|
1437
|
+
this.providerTokens.set(provider, tokenData);
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1410
1441
|
savePendingAuthToStorage(state, pendingAuth) {
|
|
1411
1442
|
if (typeof window !== "undefined" && window.localStorage) {
|
|
1412
1443
|
try {
|
|
@@ -1615,28 +1646,40 @@ class MCPClientBase {
|
|
|
1615
1646
|
}
|
|
1616
1647
|
}
|
|
1617
1648
|
const providers = this.integrations.filter((p) => p.oauth).map((p) => p.oauth.provider);
|
|
1618
|
-
|
|
1649
|
+
const usingDatabaseCallbacks = !!config.getProviderToken;
|
|
1650
|
+
if (usingDatabaseCallbacks) {
|
|
1651
|
+
this.oauthManager.loadAllProviderTokens(providers).then(async () => {
|
|
1652
|
+
for (const integration of this.integrations) {
|
|
1653
|
+
if (integration.oauth) {
|
|
1654
|
+
const provider = integration.oauth.provider;
|
|
1655
|
+
try {
|
|
1656
|
+
const tokenData = await this.oauthManager.getProviderToken(provider);
|
|
1657
|
+
const currentState = this.authState.get(provider);
|
|
1658
|
+
if (currentState && !currentState.authenticated && !currentState.lastError) {
|
|
1659
|
+
this.authState.set(provider, { authenticated: !!tokenData });
|
|
1660
|
+
}
|
|
1661
|
+
} catch (error) {
|
|
1662
|
+
console.error(`Failed to check token for ${provider}:`, error);
|
|
1663
|
+
const currentState = this.authState.get(provider);
|
|
1664
|
+
if (currentState && !currentState.authenticated && !currentState.lastError) {
|
|
1665
|
+
this.authState.set(provider, { authenticated: false });
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
}).catch((error) => {
|
|
1671
|
+
console.error("Failed to load provider tokens:", error);
|
|
1672
|
+
});
|
|
1673
|
+
} else {
|
|
1674
|
+
this.oauthManager.loadAllProviderTokensSync(providers);
|
|
1619
1675
|
for (const integration of this.integrations) {
|
|
1620
1676
|
if (integration.oauth) {
|
|
1621
1677
|
const provider = integration.oauth.provider;
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
const currentState = this.authState.get(provider);
|
|
1625
|
-
if (currentState && !currentState.authenticated && !currentState.lastError) {
|
|
1626
|
-
this.authState.set(provider, { authenticated: !!tokenData });
|
|
1627
|
-
}
|
|
1628
|
-
} catch (error) {
|
|
1629
|
-
console.error(`Failed to check token for ${provider}:`, error);
|
|
1630
|
-
const currentState = this.authState.get(provider);
|
|
1631
|
-
if (currentState && !currentState.authenticated && !currentState.lastError) {
|
|
1632
|
-
this.authState.set(provider, { authenticated: false });
|
|
1633
|
-
}
|
|
1634
|
-
}
|
|
1678
|
+
const tokenData = this.oauthManager.getProviderTokenFromCache(provider);
|
|
1679
|
+
this.authState.set(provider, { authenticated: !!tokenData });
|
|
1635
1680
|
}
|
|
1636
1681
|
}
|
|
1637
|
-
}
|
|
1638
|
-
console.error("Failed to load provider tokens:", error);
|
|
1639
|
-
});
|
|
1682
|
+
}
|
|
1640
1683
|
const integrationIds = this.integrations.map((i) => i.id);
|
|
1641
1684
|
if (integrationIds.includes("github")) {
|
|
1642
1685
|
this.github = this.createIntegrationProxy("github");
|
package/dist/server.js
CHANGED
|
@@ -1306,6 +1306,9 @@ class OAuthManager {
|
|
|
1306
1306
|
getAllProviderTokens() {
|
|
1307
1307
|
return new Map(this.providerTokens);
|
|
1308
1308
|
}
|
|
1309
|
+
getProviderTokenFromCache(provider) {
|
|
1310
|
+
return this.providerTokens.get(provider);
|
|
1311
|
+
}
|
|
1309
1312
|
async setProviderToken(provider, tokenData, context) {
|
|
1310
1313
|
this.providerTokens.set(provider, tokenData);
|
|
1311
1314
|
await this.saveProviderToken(provider, tokenData, context);
|
|
@@ -1400,6 +1403,34 @@ class OAuthManager {
|
|
|
1400
1403
|
}
|
|
1401
1404
|
}
|
|
1402
1405
|
}
|
|
1406
|
+
loadProviderTokenSync(provider) {
|
|
1407
|
+
if (this.getTokenCallback) {
|
|
1408
|
+
return;
|
|
1409
|
+
}
|
|
1410
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
1411
|
+
try {
|
|
1412
|
+
const key = `integrate_token_${provider}`;
|
|
1413
|
+
const stored = window.localStorage.getItem(key);
|
|
1414
|
+
if (stored) {
|
|
1415
|
+
return JSON.parse(stored);
|
|
1416
|
+
}
|
|
1417
|
+
} catch (error) {
|
|
1418
|
+
console.error(`Failed to load token for ${provider} from localStorage:`, error);
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
return;
|
|
1422
|
+
}
|
|
1423
|
+
loadAllProviderTokensSync(providers) {
|
|
1424
|
+
if (this.getTokenCallback) {
|
|
1425
|
+
return;
|
|
1426
|
+
}
|
|
1427
|
+
for (const provider of providers) {
|
|
1428
|
+
const tokenData = this.loadProviderTokenSync(provider);
|
|
1429
|
+
if (tokenData) {
|
|
1430
|
+
this.providerTokens.set(provider, tokenData);
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1403
1434
|
savePendingAuthToStorage(state, pendingAuth) {
|
|
1404
1435
|
if (typeof window !== "undefined" && window.localStorage) {
|
|
1405
1436
|
try {
|
|
@@ -1606,28 +1637,40 @@ class MCPClientBase {
|
|
|
1606
1637
|
}
|
|
1607
1638
|
}
|
|
1608
1639
|
const providers = this.integrations.filter((p) => p.oauth).map((p) => p.oauth.provider);
|
|
1609
|
-
|
|
1640
|
+
const usingDatabaseCallbacks = !!config.getProviderToken;
|
|
1641
|
+
if (usingDatabaseCallbacks) {
|
|
1642
|
+
this.oauthManager.loadAllProviderTokens(providers).then(async () => {
|
|
1643
|
+
for (const integration of this.integrations) {
|
|
1644
|
+
if (integration.oauth) {
|
|
1645
|
+
const provider = integration.oauth.provider;
|
|
1646
|
+
try {
|
|
1647
|
+
const tokenData = await this.oauthManager.getProviderToken(provider);
|
|
1648
|
+
const currentState = this.authState.get(provider);
|
|
1649
|
+
if (currentState && !currentState.authenticated && !currentState.lastError) {
|
|
1650
|
+
this.authState.set(provider, { authenticated: !!tokenData });
|
|
1651
|
+
}
|
|
1652
|
+
} catch (error) {
|
|
1653
|
+
console.error(`Failed to check token for ${provider}:`, error);
|
|
1654
|
+
const currentState = this.authState.get(provider);
|
|
1655
|
+
if (currentState && !currentState.authenticated && !currentState.lastError) {
|
|
1656
|
+
this.authState.set(provider, { authenticated: false });
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
}).catch((error) => {
|
|
1662
|
+
console.error("Failed to load provider tokens:", error);
|
|
1663
|
+
});
|
|
1664
|
+
} else {
|
|
1665
|
+
this.oauthManager.loadAllProviderTokensSync(providers);
|
|
1610
1666
|
for (const integration of this.integrations) {
|
|
1611
1667
|
if (integration.oauth) {
|
|
1612
1668
|
const provider = integration.oauth.provider;
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
const currentState = this.authState.get(provider);
|
|
1616
|
-
if (currentState && !currentState.authenticated && !currentState.lastError) {
|
|
1617
|
-
this.authState.set(provider, { authenticated: !!tokenData });
|
|
1618
|
-
}
|
|
1619
|
-
} catch (error) {
|
|
1620
|
-
console.error(`Failed to check token for ${provider}:`, error);
|
|
1621
|
-
const currentState = this.authState.get(provider);
|
|
1622
|
-
if (currentState && !currentState.authenticated && !currentState.lastError) {
|
|
1623
|
-
this.authState.set(provider, { authenticated: false });
|
|
1624
|
-
}
|
|
1625
|
-
}
|
|
1669
|
+
const tokenData = this.oauthManager.getProviderTokenFromCache(provider);
|
|
1670
|
+
this.authState.set(provider, { authenticated: !!tokenData });
|
|
1626
1671
|
}
|
|
1627
1672
|
}
|
|
1628
|
-
}
|
|
1629
|
-
console.error("Failed to load provider tokens:", error);
|
|
1630
|
-
});
|
|
1673
|
+
}
|
|
1631
1674
|
const integrationIds = this.integrations.map((i) => i.id);
|
|
1632
1675
|
if (integrationIds.includes("github")) {
|
|
1633
1676
|
this.github = this.createIntegrationProxy("github");
|
package/dist/src/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACV,OAAO,EAEP,mBAAmB,EAGpB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAiB,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACrG,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE/E,OAAO,KAAK,EACV,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAgE1B;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED;;GAEG;AACH,KAAK,oBAAoB,CAAC,CAAC,IAAI,CAAC,S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AAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CA2BzD;AAmED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,eAAe,CAAC,aAAa,SAAS,SAAS,cAAc,EAAE,EAC7E,MAAM,EAAE,eAAe,CAAC,aAAa,CAAC,GACrC,SAAS,CAAC,aAAa,CAAC,CAkE1B;AA0ED;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAetD"}
|
|
@@ -111,6 +111,13 @@ export declare class OAuthManager {
|
|
|
111
111
|
* Get all provider tokens
|
|
112
112
|
*/
|
|
113
113
|
getAllProviderTokens(): Map<string, ProviderTokenData>;
|
|
114
|
+
/**
|
|
115
|
+
* Get provider token from in-memory cache synchronously
|
|
116
|
+
* Only returns cached tokens, does not call database callbacks
|
|
117
|
+
* Used for immediate synchronous checks after tokens are loaded
|
|
118
|
+
* @param provider - Provider name (e.g., 'github', 'gmail')
|
|
119
|
+
*/
|
|
120
|
+
getProviderTokenFromCache(provider: string): ProviderTokenData | undefined;
|
|
114
121
|
/**
|
|
115
122
|
* Set provider token (for manual token management)
|
|
116
123
|
* Uses callback if provided, otherwise uses localStorage
|
|
@@ -152,6 +159,19 @@ export declare class OAuthManager {
|
|
|
152
159
|
* Load all provider tokens from database (via callback) or localStorage on initialization
|
|
153
160
|
*/
|
|
154
161
|
loadAllProviderTokens(providers: string[]): Promise<void>;
|
|
162
|
+
/**
|
|
163
|
+
* Load provider token synchronously from localStorage only
|
|
164
|
+
* Returns undefined if not found or if using database callbacks
|
|
165
|
+
* This method is synchronous and should only be used during initialization
|
|
166
|
+
* when database callbacks are NOT configured
|
|
167
|
+
*/
|
|
168
|
+
private loadProviderTokenSync;
|
|
169
|
+
/**
|
|
170
|
+
* Load all provider tokens synchronously from localStorage on initialization
|
|
171
|
+
* Only works when database callbacks are NOT configured
|
|
172
|
+
* This ensures tokens are available immediately for isAuthorized() calls
|
|
173
|
+
*/
|
|
174
|
+
loadAllProviderTokensSync(providers: string[]): void;
|
|
155
175
|
/**
|
|
156
176
|
* Save pending auth to localStorage (for redirect flows)
|
|
157
177
|
* Uses localStorage instead of sessionStorage because OAuth may open in a new tab,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../src/oauth/manager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EACV,eAAe,EAEf,UAAU,EAGV,iBAAiB,EAClB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIrD;;;GAGG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,YAAY,CAAuC;IAC3D,OAAO,CAAC,cAAc,CAA6C;IACnE,OAAO,CAAC,aAAa,CAAqB;IAC1C,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,UAAU,CAAC,CAAS;IAC5B,OAAO,CAAC,gBAAgB,CAAC,CAAqH;IAC9I,OAAO,CAAC,gBAAgB,CAAC,CAAiG;gBAGxH,YAAY,EAAE,MAAM,EACpB,UAAU,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,EACrC,UAAU,CAAC,EAAE,MAAM,EACnB,cAAc,CAAC,EAAE;QACf,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,KAAK,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,GAAG,iBAAiB,GAAG,SAAS,CAAC;QACtI,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI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