@frontmcp/sdk 0.9.0 → 0.11.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.
- package/adapter/adapter.instance.d.ts +10 -3
- package/adapter/adapter.instance.d.ts.map +1 -1
- package/adapter/{adapter.regsitry.d.ts → adapter.registry.d.ts} +2 -1
- package/adapter/adapter.registry.d.ts.map +1 -0
- package/adapter/adapter.utils.d.ts.map +1 -1
- package/agent/agent.instance.d.ts.map +1 -1
- package/agent/agent.scope.d.ts +9 -9
- package/agent/agent.scope.d.ts.map +1 -1
- package/agent/agent.utils.d.ts.map +1 -1
- package/app/app.registry.d.ts.map +1 -1
- package/app/app.utils.d.ts.map +1 -1
- package/app/instances/app.local.instance.d.ts +1 -1
- package/auth/auth.registry.d.ts +1 -1
- package/auth/auth.registry.d.ts.map +1 -1
- package/auth/auth.utils.d.ts.map +1 -1
- package/auth/authorization/index.d.ts +0 -6
- package/auth/authorization/index.d.ts.map +1 -1
- package/auth/authorization/orchestrated.context-extension.d.ts +1 -1
- package/auth/authorization/orchestrated.context-extension.d.ts.map +1 -1
- package/auth/flows/auth.verify.flow.d.ts +1 -1
- package/auth/flows/auth.verify.flow.d.ts.map +1 -1
- package/auth/flows/oauth.authorize.flow.d.ts.map +1 -1
- package/auth/flows/oauth.callback.flow.d.ts.map +1 -1
- package/auth/flows/oauth.provider-callback.flow.d.ts.map +1 -1
- package/auth/flows/session.verify.flow.d.ts +2 -2
- package/auth/flows/session.verify.flow.d.ts.map +1 -1
- package/auth/flows/well-known.jwks.flow.d.ts.map +1 -1
- package/auth/flows/well-known.oauth-authorization-server.flow.d.ts.map +1 -1
- package/auth/flows/well-known.prm.flow.d.ts.map +1 -1
- package/auth/instances/instance.local-primary-auth.d.ts +2 -2
- package/auth/instances/instance.local-primary-auth.d.ts.map +1 -1
- package/auth/session/index.d.ts +7 -11
- package/auth/session/index.d.ts.map +1 -1
- package/auth/session/record/session.base.d.ts +1 -1
- package/auth/session/record/session.base.d.ts.map +1 -1
- package/auth/session/session-store.factory.d.ts +19 -3
- package/auth/session/session-store.factory.d.ts.map +1 -1
- package/auth/session/session.service.d.ts +1 -1
- package/auth/session/session.service.d.ts.map +1 -1
- package/auth/session/transport-session.manager.d.ts +1 -1
- package/auth/session/transport-session.manager.d.ts.map +1 -1
- package/auth/session/utils/session-id.utils.d.ts +1 -2
- package/auth/session/utils/session-id.utils.d.ts.map +1 -1
- package/auth/vault/auth-providers.context-extension.d.ts +2 -2
- package/auth/vault/auth-providers.context-extension.d.ts.map +1 -1
- package/auth/vault/auth-providers.providers.d.ts +1 -1
- package/auth/vault/auth-providers.providers.d.ts.map +1 -1
- package/auth/vault/index.d.ts +0 -52
- package/auth/vault/index.d.ts.map +1 -1
- package/builtin/config/config-resolver.d.ts.map +1 -1
- package/common/decorators/app.decorator.d.ts +1 -1
- package/common/decorators/app.decorator.d.ts.map +1 -1
- package/common/decorators/front-mcp.decorator.d.ts.map +1 -1
- package/common/decorators/plugin.decorator.d.ts.map +1 -1
- package/common/dynamic/dynamic.adapter.d.ts.map +1 -1
- package/common/dynamic/dynamic.plugin.d.ts.map +1 -1
- package/common/interfaces/agent.interface.d.ts.map +1 -1
- package/common/interfaces/internal/flow.utils.d.ts.map +1 -1
- package/common/interfaces/server.interface.d.ts +4 -2
- package/common/interfaces/server.interface.d.ts.map +1 -1
- package/common/metadata/app.metadata.d.ts +16 -16
- package/common/metadata/front-mcp.metadata.d.ts +184 -52
- package/common/metadata/front-mcp.metadata.d.ts.map +1 -1
- package/common/providers/base-config.provider.d.ts.map +1 -1
- package/common/tokens/front-mcp.tokens.d.ts.map +1 -1
- package/common/types/auth/jwt.types.d.ts +2 -86
- package/common/types/auth/jwt.types.d.ts.map +1 -1
- package/common/types/auth/session.types.d.ts +5 -101
- package/common/types/auth/session.types.d.ts.map +1 -1
- package/common/types/options/auth/app-auth.schema.d.ts +8 -8
- package/common/types/options/auth/index.d.ts +14 -14
- package/common/types/options/auth/index.d.ts.map +1 -1
- package/common/types/options/auth/interfaces.d.ts +1 -1
- package/common/types/options/auth/interfaces.d.ts.map +1 -1
- package/common/types/options/auth/orchestrated.schema.d.ts +10 -10
- package/common/types/options/auth/public.schema.d.ts +2 -2
- package/common/types/options/auth/schema.d.ts +8 -8
- package/common/types/options/auth/shared.schemas.d.ts +2 -132
- package/common/types/options/auth/shared.schemas.d.ts.map +1 -1
- package/common/types/options/auth/transparent.schema.d.ts +1 -1
- package/common/types/options/http/index.d.ts +1 -1
- package/common/types/options/http/index.d.ts.map +1 -1
- package/common/types/options/http/interfaces.d.ts +36 -0
- package/common/types/options/http/interfaces.d.ts.map +1 -1
- package/common/types/options/http/schema.d.ts +6 -0
- package/common/types/options/http/schema.d.ts.map +1 -1
- package/common/types/options/index.d.ts +1 -0
- package/common/types/options/index.d.ts.map +1 -1
- package/common/types/options/session/schema.d.ts +3 -3
- package/common/types/options/sqlite/index.d.ts +3 -0
- package/common/types/options/sqlite/index.d.ts.map +1 -0
- package/common/types/options/sqlite/schema.d.ts +26 -0
- package/common/types/options/sqlite/schema.d.ts.map +1 -0
- package/common/types/options/transport/schema.d.ts +1 -1
- package/elicitation/store/elicitation-encryption.d.ts +1 -1
- package/elicitation/store/elicitation-encryption.d.ts.map +1 -1
- package/elicitation/store/elicitation-store.factory.d.ts +21 -1
- package/elicitation/store/elicitation-store.factory.d.ts.map +1 -1
- package/errors/auth-internal.errors.d.ts +2 -0
- package/errors/auth-internal.errors.d.ts.map +1 -0
- package/errors/decorator.errors.d.ts +14 -0
- package/errors/decorator.errors.d.ts.map +1 -0
- package/errors/index.d.ts +8 -1
- package/errors/index.d.ts.map +1 -1
- package/errors/normalization.errors.d.ts +32 -0
- package/errors/normalization.errors.d.ts.map +1 -0
- package/errors/provider.errors.d.ts +63 -0
- package/errors/provider.errors.d.ts.map +1 -0
- package/errors/registry.errors.d.ts +50 -0
- package/errors/registry.errors.d.ts.map +1 -0
- package/errors/remote.errors.d.ts +8 -0
- package/errors/remote.errors.d.ts.map +1 -1
- package/errors/sdk.errors.d.ts +139 -0
- package/errors/sdk.errors.d.ts.map +1 -0
- package/errors/transport.errors.d.ts +46 -0
- package/errors/transport.errors.d.ts.map +1 -0
- package/esm/index.mjs +7422 -8497
- package/esm/package.json +11 -7
- package/flows/flow.instance.d.ts.map +1 -1
- package/flows/flow.registry.d.ts.map +1 -1
- package/flows/flow.utils.d.ts.map +1 -1
- package/front-mcp/front-mcp.d.ts +30 -1
- package/front-mcp/front-mcp.d.ts.map +1 -1
- package/front-mcp/front-mcp.providers.d.ts +76 -20
- package/front-mcp/front-mcp.providers.d.ts.map +1 -1
- package/front-mcp/serverless-handler.d.ts +0 -4
- package/front-mcp/serverless-handler.d.ts.map +1 -1
- package/hooks/hook.instance.d.ts.map +1 -1
- package/hooks/hook.registry.d.ts.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +19714 -20739
- package/logger/logger.registry.d.ts.map +1 -1
- package/logger/logger.utils.d.ts.map +1 -1
- package/package.json +11 -7
- package/plugin/plugin.utils.d.ts.map +1 -1
- package/prompt/prompt.instance.d.ts.map +1 -1
- package/prompt/prompt.registry.d.ts.map +1 -1
- package/prompt/prompt.utils.d.ts.map +1 -1
- package/provider/provider.registry.d.ts.map +1 -1
- package/provider/provider.utils.d.ts.map +1 -1
- package/regsitry/registry.base.d.ts.map +1 -1
- package/remote-mcp/mcp-client.service.d.ts.map +1 -1
- package/remote-mcp/resilience/retry.d.ts.map +1 -1
- package/resource/resource.instance.d.ts.map +1 -1
- package/resource/resource.registry.d.ts.map +1 -1
- package/resource/resource.utils.d.ts.map +1 -1
- package/scope/flows/http.request.flow.d.ts +1 -1
- package/scope/flows/http.request.flow.d.ts.map +1 -1
- package/scope/scope.instance.d.ts.map +1 -1
- package/scope/scope.registry.d.ts.map +1 -1
- package/scope/scope.utils.d.ts.map +1 -1
- package/server/adapters/base.host.adapter.d.ts +4 -2
- package/server/adapters/base.host.adapter.d.ts.map +1 -1
- package/server/adapters/express.host.adapter.d.ts +6 -32
- package/server/adapters/express.host.adapter.d.ts.map +1 -1
- package/server/server.instance.d.ts +1 -1
- package/server/server.instance.d.ts.map +1 -1
- package/skill/flows/search-skills.flow.d.ts +2 -2
- package/skill/session/skill-session.manager.d.ts.map +1 -1
- package/skill/skill.utils.d.ts.map +1 -1
- package/skill/tools/search-skills.tool.d.ts +1 -1
- package/tool/tool.instance.d.ts.map +1 -1
- package/tool/tool.registry.d.ts.map +1 -1
- package/tool/tool.utils.d.ts.map +1 -1
- package/transport/adapters/streamable-http-transport.d.ts +9 -3
- package/transport/adapters/streamable-http-transport.d.ts.map +1 -1
- package/transport/event-stores/event-store.factory.d.ts +8 -3
- package/transport/event-stores/event-store.factory.d.ts.map +1 -1
- package/transport/event-stores/redis.event-store.d.ts.map +1 -1
- package/transport/flows/handle.sse.flow.d.ts +1 -1
- package/transport/flows/handle.streamable-http.flow.d.ts +1 -1
- package/transport/legacy/legacy.sse.tranporter.d.ts.map +1 -1
- package/transport/mcp-handlers/skills-mcp.types.d.ts +1 -1
- package/transport/transport.local.d.ts.map +1 -1
- package/transport/transport.registry.d.ts +1 -1
- package/transport/transport.registry.d.ts.map +1 -1
- package/transport/transport.remote.d.ts.map +1 -1
- package/adapter/adapter.regsitry.d.ts.map +0 -1
- package/auth/authorization/authorization.class.d.ts +0 -123
- package/auth/authorization/authorization.class.d.ts.map +0 -1
- package/auth/authorization/authorization.types.d.ts +0 -128
- package/auth/authorization/authorization.types.d.ts.map +0 -1
- package/auth/authorization/orchestrated.accessor.d.ts +0 -161
- package/auth/authorization/orchestrated.accessor.d.ts.map +0 -1
- package/auth/authorization/orchestrated.authorization.d.ts +0 -258
- package/auth/authorization/orchestrated.authorization.d.ts.map +0 -1
- package/auth/authorization/public.authorization.d.ts +0 -92
- package/auth/authorization/public.authorization.d.ts.map +0 -1
- package/auth/authorization/transparent.authorization.d.ts +0 -131
- package/auth/authorization/transparent.authorization.d.ts.map +0 -1
- package/auth/consent/consent.types.d.ts +0 -112
- package/auth/consent/consent.types.d.ts.map +0 -1
- package/auth/consent/index.d.ts +0 -2
- package/auth/consent/index.d.ts.map +0 -1
- package/auth/detection/auth-provider-detection.d.ts +0 -85
- package/auth/detection/auth-provider-detection.d.ts.map +0 -1
- package/auth/detection/index.d.ts +0 -2
- package/auth/detection/index.d.ts.map +0 -1
- package/auth/machine-id.d.ts +0 -28
- package/auth/machine-id.d.ts.map +0 -1
- package/auth/session/encrypted-authorization-vault.d.ts +0 -181
- package/auth/session/encrypted-authorization-vault.d.ts.map +0 -1
- package/auth/session/federated-auth.session.d.ts +0 -252
- package/auth/session/federated-auth.session.d.ts.map +0 -1
- package/auth/session/orchestrated-token.store.d.ts +0 -155
- package/auth/session/orchestrated-token.store.d.ts.map +0 -1
- package/auth/session/redis-session.store.d.ts +0 -93
- package/auth/session/redis-session.store.d.ts.map +0 -1
- package/auth/session/session-crypto.d.ts +0 -84
- package/auth/session/session-crypto.d.ts.map +0 -1
- package/auth/session/session-rate-limiter.d.ts +0 -114
- package/auth/session/session-rate-limiter.d.ts.map +0 -1
- package/auth/session/session.transport.d.ts +0 -11
- package/auth/session/session.transport.d.ts.map +0 -1
- package/auth/session/session.types.d.ts +0 -66
- package/auth/session/session.types.d.ts.map +0 -1
- package/auth/session/token.refresh.d.ts +0 -60
- package/auth/session/token.refresh.d.ts.map +0 -1
- package/auth/session/transport-session.types.d.ts +0 -479
- package/auth/session/transport-session.types.d.ts.map +0 -1
- package/auth/session/utils/auth-token.utils.d.ts +0 -12
- package/auth/session/utils/auth-token.utils.d.ts.map +0 -1
- package/auth/session/vercel-kv-session.store.d.ts +0 -117
- package/auth/session/vercel-kv-session.store.d.ts.map +0 -1
- package/auth/ui/base-layout.d.ts +0 -181
- package/auth/ui/base-layout.d.ts.map +0 -1
- package/auth/ui/index.d.ts +0 -11
- package/auth/ui/index.d.ts.map +0 -1
- package/auth/ui/templates.d.ts +0 -135
- package/auth/ui/templates.d.ts.map +0 -1
- package/auth/utils/authorization-id.utils.d.ts +0 -12
- package/auth/utils/authorization-id.utils.d.ts.map +0 -1
- package/auth/utils/index.d.ts +0 -2
- package/auth/utils/index.d.ts.map +0 -1
- package/auth/vault/auth-providers.accessor.d.ts +0 -153
- package/auth/vault/auth-providers.accessor.d.ts.map +0 -1
- package/auth/vault/auth-providers.accessor.impl.d.ts +0 -52
- package/auth/vault/auth-providers.accessor.impl.d.ts.map +0 -1
- package/auth/vault/auth-providers.registry.d.ts +0 -110
- package/auth/vault/auth-providers.registry.d.ts.map +0 -1
- package/auth/vault/auth-providers.vault.d.ts +0 -93
- package/auth/vault/auth-providers.vault.d.ts.map +0 -1
- package/auth/vault/credential-loaders/eager-loader.d.ts +0 -46
- package/auth/vault/credential-loaders/eager-loader.d.ts.map +0 -1
- package/auth/vault/credential-loaders/index.d.ts +0 -7
- package/auth/vault/credential-loaders/index.d.ts.map +0 -1
- package/auth/vault/credential-loaders/lazy-loader.d.ts +0 -53
- package/auth/vault/credential-loaders/lazy-loader.d.ts.map +0 -1
package/auth/ui/base-layout.d.ts
DELETED
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base Layout for Server-Rendered Pages
|
|
3
|
-
*
|
|
4
|
-
* Provides a consistent HTML shell with all CDN resources pre-configured:
|
|
5
|
-
* - Tailwind CSS v4 (Browser CDN) - Utility-first CSS framework with @theme support
|
|
6
|
-
* - Google Fonts (Inter) - Modern UI typography
|
|
7
|
-
*
|
|
8
|
-
* No build step required - all resources loaded from CDN at runtime.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```typescript
|
|
12
|
-
* // Basic usage
|
|
13
|
-
* const html = baseLayout('<div>content</div>', { title: 'Page' });
|
|
14
|
-
*
|
|
15
|
-
* // With custom theme
|
|
16
|
-
* const html = baseLayout('<div>content</div>', {
|
|
17
|
-
* title: 'Page',
|
|
18
|
-
* theme: {
|
|
19
|
-
* colors: {
|
|
20
|
-
* primary: '#3b82f6',
|
|
21
|
-
* 'primary-dark': '#2563eb',
|
|
22
|
-
* },
|
|
23
|
-
* },
|
|
24
|
-
* });
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
/**
|
|
28
|
-
* CDN URLs and versions - centralized for easy updates
|
|
29
|
-
*/
|
|
30
|
-
export declare const CDN: {
|
|
31
|
-
/** Tailwind CSS v4 Browser CDN - generates styles on-the-fly with @theme support */
|
|
32
|
-
readonly tailwind: "https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4";
|
|
33
|
-
/** Google Fonts - Inter for modern UI */
|
|
34
|
-
readonly fonts: {
|
|
35
|
-
readonly preconnect: readonly ["https://fonts.googleapis.com", "https://fonts.gstatic.com"];
|
|
36
|
-
readonly stylesheet: "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap";
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Theme color configuration
|
|
41
|
-
* Keys become CSS custom properties: --color-{key}
|
|
42
|
-
*/
|
|
43
|
-
export interface ThemeColors {
|
|
44
|
-
/** Primary brand color */
|
|
45
|
-
primary?: string;
|
|
46
|
-
/** Darker primary for hover states */
|
|
47
|
-
'primary-dark'?: string;
|
|
48
|
-
/** Secondary brand color */
|
|
49
|
-
secondary?: string;
|
|
50
|
-
/** Accent color for highlights */
|
|
51
|
-
accent?: string;
|
|
52
|
-
/** Success state color */
|
|
53
|
-
success?: string;
|
|
54
|
-
/** Warning state color */
|
|
55
|
-
warning?: string;
|
|
56
|
-
/** Error/danger state color */
|
|
57
|
-
danger?: string;
|
|
58
|
-
/** Custom colors (any additional colors) */
|
|
59
|
-
[key: string]: string | undefined;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Theme font configuration
|
|
63
|
-
* Keys become CSS custom properties: --font-{key}
|
|
64
|
-
*/
|
|
65
|
-
export interface ThemeFonts {
|
|
66
|
-
/** Sans-serif font family */
|
|
67
|
-
sans?: string;
|
|
68
|
-
/** Serif font family */
|
|
69
|
-
serif?: string;
|
|
70
|
-
/** Monospace font family */
|
|
71
|
-
mono?: string;
|
|
72
|
-
/** Custom fonts */
|
|
73
|
-
[key: string]: string | undefined;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Complete theme configuration for FrontMCP UI
|
|
77
|
-
*/
|
|
78
|
-
export interface ThemeConfig {
|
|
79
|
-
/** Custom colors */
|
|
80
|
-
colors?: ThemeColors;
|
|
81
|
-
/** Custom fonts */
|
|
82
|
-
fonts?: ThemeFonts;
|
|
83
|
-
/** Additional custom CSS variables (raw @theme content) */
|
|
84
|
-
customVars?: string;
|
|
85
|
-
/** Additional custom CSS (outside @theme) */
|
|
86
|
-
customCss?: string;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Default theme with FrontMCP branding
|
|
90
|
-
*/
|
|
91
|
-
export declare const DEFAULT_THEME: ThemeConfig;
|
|
92
|
-
/**
|
|
93
|
-
* Options for the base layout
|
|
94
|
-
*/
|
|
95
|
-
export interface BaseLayoutOptions {
|
|
96
|
-
/** Page title (will be suffixed with " - FrontMCP") */
|
|
97
|
-
title: string;
|
|
98
|
-
/** Optional description for meta tag */
|
|
99
|
-
description?: string;
|
|
100
|
-
/** Include Tailwind CSS (default: true) */
|
|
101
|
-
includeTailwind?: boolean;
|
|
102
|
-
/** Include Google Fonts (default: true) */
|
|
103
|
-
includeFonts?: boolean;
|
|
104
|
-
/** Additional head content (scripts, styles, meta tags) */
|
|
105
|
-
headExtra?: string;
|
|
106
|
-
/** Body classes (default: 'bg-gray-50 min-h-screen font-sans antialiased') */
|
|
107
|
-
bodyClass?: string;
|
|
108
|
-
/** Theme configuration - colors, fonts, and custom CSS */
|
|
109
|
-
theme?: ThemeConfig;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Escape HTML special characters to prevent XSS
|
|
113
|
-
* Per OWASP guidelines, escapes: & < > " ' /
|
|
114
|
-
*
|
|
115
|
-
* @param str - The string to escape
|
|
116
|
-
* @returns The escaped string safe for HTML content and attributes
|
|
117
|
-
*
|
|
118
|
-
* @example
|
|
119
|
-
* escapeHtml('<script>alert("xss")</script>')
|
|
120
|
-
* // => '<script>alert("xss")</script>'
|
|
121
|
-
*/
|
|
122
|
-
export declare function escapeHtml(str: string): string;
|
|
123
|
-
/**
|
|
124
|
-
* Build the complete HTML document with CDN resources
|
|
125
|
-
*
|
|
126
|
-
* @param content - The page content (HTML string)
|
|
127
|
-
* @param options - Layout configuration options
|
|
128
|
-
* @returns Complete HTML document string
|
|
129
|
-
*
|
|
130
|
-
* @example
|
|
131
|
-
* ```typescript
|
|
132
|
-
* const html = baseLayout('<div>My content</div>', {
|
|
133
|
-
* title: 'Sign In',
|
|
134
|
-
* description: 'Sign in to your account',
|
|
135
|
-
* theme: {
|
|
136
|
-
* colors: {
|
|
137
|
-
* primary: '#ff6b6b',
|
|
138
|
-
* },
|
|
139
|
-
* },
|
|
140
|
-
* });
|
|
141
|
-
* ```
|
|
142
|
-
*/
|
|
143
|
-
export declare function baseLayout(content: string, options: BaseLayoutOptions): string;
|
|
144
|
-
/**
|
|
145
|
-
* Create a layout wrapper function with preset options
|
|
146
|
-
*
|
|
147
|
-
* @param defaultOptions - Default options to apply to all pages
|
|
148
|
-
* @returns A function that wraps content with the layout
|
|
149
|
-
*
|
|
150
|
-
* @example
|
|
151
|
-
* ```typescript
|
|
152
|
-
* const brandedLayout = createLayout({
|
|
153
|
-
* theme: {
|
|
154
|
-
* colors: {
|
|
155
|
-
* primary: '#ff6b6b',
|
|
156
|
-
* 'primary-dark': '#ee5a5a',
|
|
157
|
-
* },
|
|
158
|
-
* },
|
|
159
|
-
* });
|
|
160
|
-
*
|
|
161
|
-
* const html = brandedLayout('<div>Content</div>', { title: 'Page' });
|
|
162
|
-
* ```
|
|
163
|
-
*/
|
|
164
|
-
export declare function createLayout(defaultOptions: Partial<BaseLayoutOptions>): (content: string, options: BaseLayoutOptions) => string;
|
|
165
|
-
/**
|
|
166
|
-
* Default auth layout with standard styling
|
|
167
|
-
*/
|
|
168
|
-
export declare const authLayout: (content: string, options: BaseLayoutOptions) => string;
|
|
169
|
-
/**
|
|
170
|
-
* Centered card layout for login/auth pages
|
|
171
|
-
*/
|
|
172
|
-
export declare function centeredCardLayout(content: string, options: BaseLayoutOptions): string;
|
|
173
|
-
/**
|
|
174
|
-
* Wide layout for consent/selection pages
|
|
175
|
-
*/
|
|
176
|
-
export declare function wideLayout(content: string, options: BaseLayoutOptions): string;
|
|
177
|
-
/**
|
|
178
|
-
* Extra wide layout for tool selection pages
|
|
179
|
-
*/
|
|
180
|
-
export declare function extraWideLayout(content: string, options: BaseLayoutOptions): string;
|
|
181
|
-
//# sourceMappingURL=base-layout.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-layout.d.ts","sourceRoot":"","sources":["../../../src/auth/ui/base-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAMH;;GAEG;AACH,eAAO,MAAM,GAAG;IACd,oFAAoF;;IAGpF,yCAAyC;;;;;CAKjC,CAAC;AAMX;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,0BAA0B;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0BAA0B;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0BAA0B;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,6BAA6B;IAC7B,IAAI,CAAC,EAAE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MAAM,EAAE,OAAO,EAAE,iBAAiB,KAAK,MAAM,CAmBzD;AAMD;;GAEG;AACH,eAAO,MAAM,UAAU,YA5BV,MAAM,WAAW,iBAAiB,KAAK,MA8BlD,CAAC;AAEH;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAYtF;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAS9E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,MAAM,CASnF"}
|
package/auth/ui/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auth UI Module
|
|
3
|
-
*
|
|
4
|
-
* Server-rendered UI templates for OAuth flows with Tailwind CSS (CDN)
|
|
5
|
-
* and Google Fonts.
|
|
6
|
-
*
|
|
7
|
-
* No build step required - all rendering is done at runtime.
|
|
8
|
-
*/
|
|
9
|
-
export { CDN, DEFAULT_THEME, type ThemeColors, type ThemeFonts, type ThemeConfig, type BaseLayoutOptions, baseLayout, createLayout, authLayout, centeredCardLayout, wideLayout, extraWideLayout, escapeHtml, } from './base-layout';
|
|
10
|
-
export { type AppAuthCard, type ProviderCard, type ToolCard, buildConsentPage, buildIncrementalAuthPage, buildFederatedLoginPage, buildToolConsentPage, buildLoginPage, buildErrorPage, renderToHtml, } from './templates';
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
package/auth/ui/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,GAAG,EACH,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,UAAU,EACV,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,eAAe,EACf,UAAU,GACX,MAAM,eAAe,CAAC;AAGvB,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,QAAQ,EAEb,gBAAgB,EAChB,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,cAAc,EACd,cAAc,EAEd,YAAY,GACb,MAAM,aAAa,CAAC"}
|
package/auth/ui/templates.d.ts
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Template Builders for OAuth UI
|
|
3
|
-
*
|
|
4
|
-
* Server-side HTML rendering with Tailwind CSS for OAuth authorization flows.
|
|
5
|
-
* No build step required - pure runtime rendering with Tailwind CSS CDN.
|
|
6
|
-
*
|
|
7
|
-
* Features:
|
|
8
|
-
* - OAuth consent page with multiple apps
|
|
9
|
-
* - Incremental authorization page for single app
|
|
10
|
-
* - Federated login page for multi-provider selection
|
|
11
|
-
* - All pages use Tailwind CSS from CDN (no build required)
|
|
12
|
-
* - Google Fonts (Inter) for modern typography
|
|
13
|
-
*
|
|
14
|
-
* Uses base-layout.ts for consistent HTML shell with CDN resources.
|
|
15
|
-
*/
|
|
16
|
-
import { escapeHtml as baseEscapeHtml } from './base-layout';
|
|
17
|
-
/**
|
|
18
|
-
* App information for authorization cards
|
|
19
|
-
*/
|
|
20
|
-
export interface AppAuthCard {
|
|
21
|
-
/** App identifier */
|
|
22
|
-
appId: string;
|
|
23
|
-
/** Display name */
|
|
24
|
-
appName: string;
|
|
25
|
-
/** App description */
|
|
26
|
-
description?: string;
|
|
27
|
-
/** Icon URL (optional, will use initials fallback) */
|
|
28
|
-
iconUrl?: string;
|
|
29
|
-
/** Scopes required by this app */
|
|
30
|
-
requiredScopes?: string[];
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Provider information for federated login
|
|
34
|
-
*/
|
|
35
|
-
export interface ProviderCard {
|
|
36
|
-
/** Provider identifier */
|
|
37
|
-
providerId: string;
|
|
38
|
-
/** Display name */
|
|
39
|
-
providerName: string;
|
|
40
|
-
/** Provider URL (for remote providers) */
|
|
41
|
-
providerUrl?: string;
|
|
42
|
-
/** Auth mode */
|
|
43
|
-
mode: string;
|
|
44
|
-
/** App IDs associated with this provider */
|
|
45
|
-
appIds: string[];
|
|
46
|
-
/** Whether this is the parent/primary provider */
|
|
47
|
-
isPrimary?: boolean;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Tool information for consent page
|
|
51
|
-
*/
|
|
52
|
-
export interface ToolCard {
|
|
53
|
-
/** Tool identifier */
|
|
54
|
-
toolId: string;
|
|
55
|
-
/** Display name */
|
|
56
|
-
toolName: string;
|
|
57
|
-
/** Tool description */
|
|
58
|
-
description?: string;
|
|
59
|
-
/** Parent app ID */
|
|
60
|
-
appId: string;
|
|
61
|
-
/** Parent app name */
|
|
62
|
-
appName: string;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Escape HTML special characters
|
|
66
|
-
* Re-exported from base-layout for convenience
|
|
67
|
-
*/
|
|
68
|
-
export declare const escapeHtml: typeof baseEscapeHtml;
|
|
69
|
-
/**
|
|
70
|
-
* Build OAuth consent page with Tailwind
|
|
71
|
-
* Shows all apps at once with Authorize/Skip buttons
|
|
72
|
-
*/
|
|
73
|
-
export declare function buildConsentPage(params: {
|
|
74
|
-
apps: AppAuthCard[];
|
|
75
|
-
clientName: string;
|
|
76
|
-
pendingAuthId: string;
|
|
77
|
-
csrfToken: string;
|
|
78
|
-
callbackPath: string;
|
|
79
|
-
}): string;
|
|
80
|
-
/**
|
|
81
|
-
* Build incremental auth page (single app) with Tailwind
|
|
82
|
-
* Used when a tool requires authorization for a skipped app
|
|
83
|
-
*/
|
|
84
|
-
export declare function buildIncrementalAuthPage(params: {
|
|
85
|
-
app: AppAuthCard;
|
|
86
|
-
toolId: string;
|
|
87
|
-
sessionHint: string;
|
|
88
|
-
callbackPath: string;
|
|
89
|
-
}): string;
|
|
90
|
-
/**
|
|
91
|
-
* Build federated login page for multi-provider selection
|
|
92
|
-
*/
|
|
93
|
-
export declare function buildFederatedLoginPage(params: {
|
|
94
|
-
providers: ProviderCard[];
|
|
95
|
-
clientName: string;
|
|
96
|
-
pendingAuthId: string;
|
|
97
|
-
csrfToken: string;
|
|
98
|
-
callbackPath: string;
|
|
99
|
-
}): string;
|
|
100
|
-
/**
|
|
101
|
-
* Build consent page for tool selection
|
|
102
|
-
*/
|
|
103
|
-
export declare function buildToolConsentPage(params: {
|
|
104
|
-
tools: ToolCard[];
|
|
105
|
-
clientName: string;
|
|
106
|
-
pendingAuthId: string;
|
|
107
|
-
csrfToken: string;
|
|
108
|
-
callbackPath: string;
|
|
109
|
-
userName?: string;
|
|
110
|
-
userEmail?: string;
|
|
111
|
-
}): string;
|
|
112
|
-
/**
|
|
113
|
-
* Build simple login page
|
|
114
|
-
*/
|
|
115
|
-
export declare function buildLoginPage(params: {
|
|
116
|
-
clientName: string;
|
|
117
|
-
scope: string;
|
|
118
|
-
pendingAuthId: string;
|
|
119
|
-
callbackPath: string;
|
|
120
|
-
}): string;
|
|
121
|
-
/**
|
|
122
|
-
* Build error page
|
|
123
|
-
*/
|
|
124
|
-
export declare function buildErrorPage(params: {
|
|
125
|
-
error: string;
|
|
126
|
-
description: string;
|
|
127
|
-
}): string;
|
|
128
|
-
/**
|
|
129
|
-
* Simple wrapper for compatibility - just returns the HTML string
|
|
130
|
-
* (Templates are already complete HTML documents)
|
|
131
|
-
*/
|
|
132
|
-
export declare function renderToHtml(html: string, _options?: {
|
|
133
|
-
title?: string;
|
|
134
|
-
}): string;
|
|
135
|
-
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/auth/ui/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;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
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Derive a consistent authorization ID from a JWT token.
|
|
3
|
-
*
|
|
4
|
-
* Uses the token's signature (third part) to generate a deterministic
|
|
5
|
-
* ID that uniquely identifies this authorization without exposing
|
|
6
|
-
* the full token.
|
|
7
|
-
*
|
|
8
|
-
* @param token - JWT token string
|
|
9
|
-
* @returns 16-character hex string authorization ID
|
|
10
|
-
*/
|
|
11
|
-
export declare function deriveAuthorizationId(token: string): string;
|
|
12
|
-
//# sourceMappingURL=authorization-id.utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authorization-id.utils.d.ts","sourceRoot":"","sources":["../../../src/auth/utils/authorization-id.utils.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAI3D"}
|
package/auth/utils/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/utils/index.ts"],"names":[],"mappings":"AAEA,cAAc,0BAA0B,CAAC"}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AuthProvidersAccessor - Interface for accessing auth provider credentials
|
|
3
|
-
*
|
|
4
|
-
* This interface provides the runtime API for tools to access credentials
|
|
5
|
-
* from registered auth providers. It supports:
|
|
6
|
-
* - Credential retrieval by provider name
|
|
7
|
-
* - Lazy loading with session-scoped caching
|
|
8
|
-
* - Automatic token refresh for OAuth providers
|
|
9
|
-
* - Headers generation for HTTP requests
|
|
10
|
-
*/
|
|
11
|
-
import { Token } from '@frontmcp/di';
|
|
12
|
-
import type { Credential, ResolvedCredential, GetCredentialOptions } from '@frontmcp/auth';
|
|
13
|
-
/**
|
|
14
|
-
* AuthProvidersAccessor - Runtime accessor for auth providers in tool contexts.
|
|
15
|
-
*
|
|
16
|
-
* Available in tool execution via `this.authProviders`:
|
|
17
|
-
* ```typescript
|
|
18
|
-
* @Tool({ name: 'my_tool' })
|
|
19
|
-
* class MyTool extends ToolContext {
|
|
20
|
-
* async execute(input: Input) {
|
|
21
|
-
* const github = await this.authProviders.get('github');
|
|
22
|
-
* const headers = await this.authProviders.headers('github');
|
|
23
|
-
* }
|
|
24
|
-
* }
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export interface AuthProvidersAccessor {
|
|
28
|
-
/**
|
|
29
|
-
* Get a credential by provider name.
|
|
30
|
-
*
|
|
31
|
-
* @param providerName - Registered provider name (e.g., 'github', 'google')
|
|
32
|
-
* @param options - Retrieval options (forceRefresh, scopes, timeout)
|
|
33
|
-
* @returns Resolved credential or null if not available
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```typescript
|
|
37
|
-
* const cred = await this.authProviders.get('github');
|
|
38
|
-
* if (cred?.credential.type === 'oauth') {
|
|
39
|
-
* const token = cred.credential.accessToken;
|
|
40
|
-
* }
|
|
41
|
-
* ```
|
|
42
|
-
*
|
|
43
|
-
* @example Force refresh
|
|
44
|
-
* ```typescript
|
|
45
|
-
* const cred = await this.authProviders.get('github', { forceRefresh: true });
|
|
46
|
-
* ```
|
|
47
|
-
*/
|
|
48
|
-
get<T extends Credential = Credential>(providerName: string, options?: GetCredentialOptions): Promise<ResolvedCredential<T> | null>;
|
|
49
|
-
/**
|
|
50
|
-
* Get multiple credentials by provider names.
|
|
51
|
-
* Executes all retrievals in parallel for efficiency.
|
|
52
|
-
*
|
|
53
|
-
* @param providerNames - Array of provider names
|
|
54
|
-
* @param options - Retrieval options applied to all providers
|
|
55
|
-
* @returns Map of provider name to resolved credential (null if not available)
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* ```typescript
|
|
59
|
-
* const creds = await this.authProviders.getMany(['github', 'jira']);
|
|
60
|
-
* const github = creds.get('github');
|
|
61
|
-
* const jira = creds.get('jira');
|
|
62
|
-
* ```
|
|
63
|
-
*/
|
|
64
|
-
getMany(providerNames: string[], options?: GetCredentialOptions): Promise<Map<string, ResolvedCredential | null>>;
|
|
65
|
-
/**
|
|
66
|
-
* Get headers for a provider (convenience method).
|
|
67
|
-
* Automatically handles different credential types:
|
|
68
|
-
* - OAuth/Bearer: `Authorization: Bearer <token>`
|
|
69
|
-
* - API Key: Uses configured header name
|
|
70
|
-
* - Basic: `Authorization: Basic <base64>`
|
|
71
|
-
*
|
|
72
|
-
* @param providerName - Provider name
|
|
73
|
-
* @returns Headers record or empty object if not available
|
|
74
|
-
*
|
|
75
|
-
* @example
|
|
76
|
-
* ```typescript
|
|
77
|
-
* const headers = await this.authProviders.headers('github');
|
|
78
|
-
* const response = await fetch(url, { headers });
|
|
79
|
-
* ```
|
|
80
|
-
*/
|
|
81
|
-
headers(providerName: string): Promise<Record<string, string>>;
|
|
82
|
-
/**
|
|
83
|
-
* Get headers for multiple providers merged into a single object.
|
|
84
|
-
* Later providers override earlier ones if headers conflict.
|
|
85
|
-
*
|
|
86
|
-
* @param providerNames - Array of provider names
|
|
87
|
-
* @returns Merged headers from all providers
|
|
88
|
-
*/
|
|
89
|
-
headersMany(providerNames: string[]): Promise<Record<string, string>>;
|
|
90
|
-
/**
|
|
91
|
-
* Force refresh a credential (for OAuth token refresh).
|
|
92
|
-
* Uses the provider's refresh function if available, otherwise calls factory.
|
|
93
|
-
*
|
|
94
|
-
* @param providerName - Provider name to refresh
|
|
95
|
-
* @returns New credential or null if refresh failed
|
|
96
|
-
*
|
|
97
|
-
* @example
|
|
98
|
-
* ```typescript
|
|
99
|
-
* // On 401 response, try refreshing
|
|
100
|
-
* if (response.status === 401) {
|
|
101
|
-
* const newCred = await this.authProviders.refresh('github');
|
|
102
|
-
* if (newCred) {
|
|
103
|
-
* // Retry request with new credential
|
|
104
|
-
* }
|
|
105
|
-
* }
|
|
106
|
-
* ```
|
|
107
|
-
*/
|
|
108
|
-
refresh(providerName: string): Promise<ResolvedCredential | null>;
|
|
109
|
-
/**
|
|
110
|
-
* Check if a provider credential is available and valid.
|
|
111
|
-
* Does not trigger credential loading.
|
|
112
|
-
*
|
|
113
|
-
* @param providerName - Provider name
|
|
114
|
-
* @returns true if credential exists in cache/vault and is valid
|
|
115
|
-
*/
|
|
116
|
-
has(providerName: string): Promise<boolean>;
|
|
117
|
-
/**
|
|
118
|
-
* Check if a provider is registered (regardless of credential availability).
|
|
119
|
-
*
|
|
120
|
-
* @param providerName - Provider name
|
|
121
|
-
* @returns true if provider is registered
|
|
122
|
-
*/
|
|
123
|
-
isRegistered(providerName: string): boolean;
|
|
124
|
-
/**
|
|
125
|
-
* Invalidate cached credential (triggers reload on next access).
|
|
126
|
-
* Does not remove from persistent vault storage.
|
|
127
|
-
*
|
|
128
|
-
* @param providerName - Provider name to invalidate
|
|
129
|
-
*/
|
|
130
|
-
invalidate(providerName: string): void;
|
|
131
|
-
/**
|
|
132
|
-
* Invalidate all cached credentials for this session.
|
|
133
|
-
*/
|
|
134
|
-
invalidateAll(): void;
|
|
135
|
-
/**
|
|
136
|
-
* List all registered provider names.
|
|
137
|
-
*/
|
|
138
|
-
listProviders(): string[];
|
|
139
|
-
/**
|
|
140
|
-
* List all available credentials (loaded in cache or vault).
|
|
141
|
-
*/
|
|
142
|
-
listAvailable(): Promise<string[]>;
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* DI Token for AuthProvidersAccessor
|
|
146
|
-
*
|
|
147
|
-
* Used to resolve the accessor in tool contexts:
|
|
148
|
-
* ```typescript
|
|
149
|
-
* const accessor = this.get(AUTH_PROVIDERS_ACCESSOR);
|
|
150
|
-
* ```
|
|
151
|
-
*/
|
|
152
|
-
export declare const AUTH_PROVIDERS_ACCESSOR: Token<AuthProvidersAccessor>;
|
|
153
|
-
//# sourceMappingURL=auth-providers.accessor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth-providers.accessor.d.ts","sourceRoot":"","sources":["../../../src/auth/vault/auth-providers.access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;OAEG;IACH,aAAa,IAAI,IAAI,CAAC;IAEtB;;OAEG;IACH,aAAa,IAAI,MAAM,EAAE,CAAC;IAE1B;;OAEG;IACH,aAAa,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CACpC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,EAAqD,KAAK,CAAC,qBAAqB,CAAC,CAAC"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AuthProvidersAccessorImpl - Implementation of AuthProvidersAccessor
|
|
3
|
-
*
|
|
4
|
-
* Provides runtime access to credential providers in tool contexts.
|
|
5
|
-
* Handles caching, vault storage, lazy loading, and credential refresh.
|
|
6
|
-
*/
|
|
7
|
-
import type { Credential, CredentialCache, CredentialFactoryContext, GetCredentialOptions, ResolvedCredential } from '@frontmcp/auth';
|
|
8
|
-
import type { AuthProvidersAccessor } from './auth-providers.accessor';
|
|
9
|
-
import type { AuthProvidersRegistry } from './auth-providers.registry';
|
|
10
|
-
import type { AuthProvidersVault } from './auth-providers.vault';
|
|
11
|
-
import type { LazyCredentialLoader } from './credential-loaders/lazy-loader';
|
|
12
|
-
import { FrontMcpLogger } from '../../common';
|
|
13
|
-
/**
|
|
14
|
-
* AuthProvidersAccessorImpl - Runtime implementation
|
|
15
|
-
*/
|
|
16
|
-
export declare class AuthProvidersAccessorImpl implements AuthProvidersAccessor {
|
|
17
|
-
private readonly registry;
|
|
18
|
-
private readonly vault;
|
|
19
|
-
private readonly cache;
|
|
20
|
-
private readonly loader;
|
|
21
|
-
private readonly context;
|
|
22
|
-
private readonly logger?;
|
|
23
|
-
constructor(registry: AuthProvidersRegistry, vault: AuthProvidersVault, cache: CredentialCache, loader: LazyCredentialLoader, context: CredentialFactoryContext, logger?: FrontMcpLogger);
|
|
24
|
-
get<T extends Credential = Credential>(providerName: string, options?: GetCredentialOptions): Promise<ResolvedCredential<T> | null>;
|
|
25
|
-
getMany(providerNames: string[], options?: GetCredentialOptions): Promise<Map<string, ResolvedCredential | null>>;
|
|
26
|
-
headers(providerName: string): Promise<Record<string, string>>;
|
|
27
|
-
headersMany(providerNames: string[]): Promise<Record<string, string>>;
|
|
28
|
-
refresh(providerName: string): Promise<ResolvedCredential | null>;
|
|
29
|
-
has(providerName: string): Promise<boolean>;
|
|
30
|
-
isRegistered(providerName: string): boolean;
|
|
31
|
-
invalidate(providerName: string): void;
|
|
32
|
-
invalidateAll(): void;
|
|
33
|
-
listProviders(): string[];
|
|
34
|
-
listAvailable(): Promise<string[]>;
|
|
35
|
-
/**
|
|
36
|
-
* Load credential from vault storage
|
|
37
|
-
*/
|
|
38
|
-
private loadFromVault;
|
|
39
|
-
/**
|
|
40
|
-
* Store credential in vault storage
|
|
41
|
-
*/
|
|
42
|
-
private storeInVault;
|
|
43
|
-
/**
|
|
44
|
-
* Check if a resolved credential is still valid
|
|
45
|
-
*/
|
|
46
|
-
private isValid;
|
|
47
|
-
/**
|
|
48
|
-
* Generate default headers for a credential type
|
|
49
|
-
*/
|
|
50
|
-
private defaultHeaders;
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=auth-providers.accessor.impl.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth-providers.accessor.impl.d.ts","sourceRoot":"","sources":["../../../src/auth/vault/auth-providers.accessor.impl.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EACf,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,KAAK,EAAE,qBAAqB,EAA4B,MAAM,2BAA2B,CAAC;AACjG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE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