@lanonasis/oauth-client 1.2.2 → 1.2.4
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/{browser-CUJNgghM.d.cts → api-key-storage-web-DannE11B.d.cts} +1 -39
- package/dist/{browser-CUJNgghM.d.ts → api-key-storage-web-DannE11B.d.ts} +1 -39
- package/dist/browser.cjs +80 -599
- package/dist/browser.d.cts +45 -1
- package/dist/browser.d.ts +45 -1
- package/dist/browser.mjs +80 -599
- package/dist/index.d.cts +41 -3
- package/dist/index.d.ts +41 -3
- package/package.json +3 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BaseOAuthFlow, O as OAuthConfig,
|
|
2
|
-
export {
|
|
1
|
+
import { B as BaseOAuthFlow, O as OAuthConfig, b as TokenResponse, T as TokenStorageAdapter } from './api-key-storage-web-DannE11B.cjs';
|
|
2
|
+
export { f as ApiKeyData, g as ApiKeyStorage, A as ApiKeyStorageWeb, d as AuthError, D as DesktopOAuthFlow, c as DeviceCodeResponse, G as GrantType, P as PKCEChallenge, e as TokenStorage, a as TokenStorageWeb } from './api-key-storage-web-DannE11B.cjs';
|
|
3
3
|
|
|
4
4
|
declare class TerminalOAuthFlow extends BaseOAuthFlow {
|
|
5
5
|
private pollInterval;
|
|
@@ -13,4 +13,42 @@ declare class TerminalOAuthFlow extends BaseOAuthFlow {
|
|
|
13
13
|
private checkDeviceCode;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
interface MCPClientConfig extends Partial<OAuthConfig> {
|
|
17
|
+
mcpEndpoint?: string;
|
|
18
|
+
autoRefresh?: boolean;
|
|
19
|
+
apiKey?: string;
|
|
20
|
+
tokenStorage?: TokenStorageAdapter;
|
|
21
|
+
}
|
|
22
|
+
declare class MCPClient {
|
|
23
|
+
private tokenStorage;
|
|
24
|
+
private authFlow;
|
|
25
|
+
private config;
|
|
26
|
+
private authMode;
|
|
27
|
+
private ws;
|
|
28
|
+
private eventSource;
|
|
29
|
+
private accessToken;
|
|
30
|
+
private refreshTimer;
|
|
31
|
+
constructor(config?: MCPClientConfig);
|
|
32
|
+
connect(): Promise<void>;
|
|
33
|
+
private authenticate;
|
|
34
|
+
private ensureAccessToken;
|
|
35
|
+
private scheduleTokenRefresh;
|
|
36
|
+
private establishConnection;
|
|
37
|
+
private connectWebSocket;
|
|
38
|
+
private connectSSE;
|
|
39
|
+
private handleMessage;
|
|
40
|
+
private reconnect;
|
|
41
|
+
request<T = unknown>(method: string, params?: unknown): Promise<T>;
|
|
42
|
+
disconnect(): void;
|
|
43
|
+
logout(): Promise<void>;
|
|
44
|
+
private isTerminal;
|
|
45
|
+
private isElectron;
|
|
46
|
+
private generateId;
|
|
47
|
+
createMemory<T = unknown>(title: string, content: string, options?: unknown): Promise<T>;
|
|
48
|
+
searchMemories<T = unknown>(query: string, options?: unknown): Promise<T[]>;
|
|
49
|
+
getMemory<T = unknown>(id: string): Promise<T>;
|
|
50
|
+
updateMemory<T = unknown>(id: string, updates: Partial<T>): Promise<T>;
|
|
51
|
+
deleteMemory(id: string): Promise<void>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export { BaseOAuthFlow, MCPClient, type MCPClientConfig, OAuthConfig, TerminalOAuthFlow, TokenResponse, TokenStorageAdapter };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BaseOAuthFlow, O as OAuthConfig,
|
|
2
|
-
export {
|
|
1
|
+
import { B as BaseOAuthFlow, O as OAuthConfig, b as TokenResponse, T as TokenStorageAdapter } from './api-key-storage-web-DannE11B.js';
|
|
2
|
+
export { f as ApiKeyData, g as ApiKeyStorage, A as ApiKeyStorageWeb, d as AuthError, D as DesktopOAuthFlow, c as DeviceCodeResponse, G as GrantType, P as PKCEChallenge, e as TokenStorage, a as TokenStorageWeb } from './api-key-storage-web-DannE11B.js';
|
|
3
3
|
|
|
4
4
|
declare class TerminalOAuthFlow extends BaseOAuthFlow {
|
|
5
5
|
private pollInterval;
|
|
@@ -13,4 +13,42 @@ declare class TerminalOAuthFlow extends BaseOAuthFlow {
|
|
|
13
13
|
private checkDeviceCode;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
interface MCPClientConfig extends Partial<OAuthConfig> {
|
|
17
|
+
mcpEndpoint?: string;
|
|
18
|
+
autoRefresh?: boolean;
|
|
19
|
+
apiKey?: string;
|
|
20
|
+
tokenStorage?: TokenStorageAdapter;
|
|
21
|
+
}
|
|
22
|
+
declare class MCPClient {
|
|
23
|
+
private tokenStorage;
|
|
24
|
+
private authFlow;
|
|
25
|
+
private config;
|
|
26
|
+
private authMode;
|
|
27
|
+
private ws;
|
|
28
|
+
private eventSource;
|
|
29
|
+
private accessToken;
|
|
30
|
+
private refreshTimer;
|
|
31
|
+
constructor(config?: MCPClientConfig);
|
|
32
|
+
connect(): Promise<void>;
|
|
33
|
+
private authenticate;
|
|
34
|
+
private ensureAccessToken;
|
|
35
|
+
private scheduleTokenRefresh;
|
|
36
|
+
private establishConnection;
|
|
37
|
+
private connectWebSocket;
|
|
38
|
+
private connectSSE;
|
|
39
|
+
private handleMessage;
|
|
40
|
+
private reconnect;
|
|
41
|
+
request<T = unknown>(method: string, params?: unknown): Promise<T>;
|
|
42
|
+
disconnect(): void;
|
|
43
|
+
logout(): Promise<void>;
|
|
44
|
+
private isTerminal;
|
|
45
|
+
private isElectron;
|
|
46
|
+
private generateId;
|
|
47
|
+
createMemory<T = unknown>(title: string, content: string, options?: unknown): Promise<T>;
|
|
48
|
+
searchMemories<T = unknown>(query: string, options?: unknown): Promise<T[]>;
|
|
49
|
+
getMemory<T = unknown>(id: string): Promise<T>;
|
|
50
|
+
updateMemory<T = unknown>(id: string, updates: Partial<T>): Promise<T>;
|
|
51
|
+
deleteMemory(id: string): Promise<void>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export { BaseOAuthFlow, MCPClient, type MCPClientConfig, OAuthConfig, TerminalOAuthFlow, TokenResponse, TokenStorageAdapter };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lanonasis/oauth-client",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "OAuth and API Key authentication client for Lan Onasis MCP integration",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,12 +51,13 @@
|
|
|
51
51
|
"desktop"
|
|
52
52
|
],
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"cross-fetch": "^
|
|
54
|
+
"cross-fetch": "^4.0.0",
|
|
55
55
|
"keytar": "^7.9.0",
|
|
56
56
|
"open": "^9.1.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@eslint/js": "^9.17.0",
|
|
60
|
+
"@types/eventsource": "^3.0.0",
|
|
60
61
|
"@types/node": "^20.0.0",
|
|
61
62
|
"eslint": "^9.17.0",
|
|
62
63
|
"globals": "^16.4.0",
|