@prmichaelsen/mcp-auth 0.1.3 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +2 -2
- package/dist/tenant/api-contracts.d.ts +171 -0
- package/dist/tenant/api-contracts.d.ts.map +1 -0
- package/dist/tenant/api-contracts.js +81 -0
- package/dist/tenant/api-contracts.js.map +7 -0
- package/dist/tenant/index.d.ts +8 -0
- package/dist/tenant/index.d.ts.map +1 -0
- package/dist/tenant/index.js +13 -0
- package/dist/tenant/index.js.map +7 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export type { TransportType, RequestContext, AuthResult, TransportConfig, RateLi
|
|
|
15
15
|
export type { AuthProvider, ResourceTokenResolver, AuthenticatedContext, AuthProviderConfig, TokenResolverConfig } from './auth/types.js';
|
|
16
16
|
export { BaseAuthProvider } from './auth/base-provider.js';
|
|
17
17
|
export { EnvAuthProvider, type EnvAuthProviderConfig, SimpleTokenResolver, type SimpleTokenResolverConfig, JWTAuthProvider, type JWTAuthProviderConfig, type JWTPayload, JWTTokenResolver, type JWTTokenResolverConfig, APITokenResolver, type APITokenResolverConfig } from './auth/providers/index.js';
|
|
18
|
+
export { type TenantAPIErrorResponse, type CredentialsAPIResponse, type CredentialsAPIHeaders, type TenantManagerAPI, TenantAPIStatusCode, TenantAPIErrorCode, createTenantAPIError, TenantAPIErrors } from './tenant/index.js';
|
|
18
19
|
export { MCPAuthError, AuthenticationError, TokenResolutionError, InvalidTokenError, MissingCredentialsError, ConfigurationError, RateLimitError, ServerPoolError, TransportError, ValidationError, isMCPAuthError, isAuthenticationError, isTokenResolutionError, isRateLimitError, formatErrorForClient, Logger, LogLevel, defaultLogger, createLogger, sanitizeForLogging, validateNonEmptyString, validateUrl, validatePositiveNumber, validatePort, validateEnum, validateObject, validateFunction, validateRequiredFields, validateTransportConfig, validateRateLimitConfig, validateLoggingConfig, validatePoolingConfig, sanitizeString, validateUserId, validateResourceType, validateAccessToken } from './utils/index.js';
|
|
19
20
|
export type { LogEntry } from './utils/logger.js';
|
|
20
21
|
/**
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAQH,OAAO,EACL,UAAU,EACV,0BAA0B,EAC1B,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,6BAA6B,EACnC,MAAM,oBAAoB,CAAC;AAQ5B,OAAO,EACL,sBAAsB,EACtB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,QAAQ,EACR,OAAO,EACP,WAAW,EACX,aAAa,EACb,WAAW,EACX,SAAS,EACT,KAAK,IAAI,EACT,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,wBAAwB,EAC9B,MAAM,mBAAmB,CAAC;AAM3B,YAAY,EACV,aAAa,EACb,cAAc,EACd,UAAU,EACV,eAAe,EACf,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACX,MAAM,YAAY,CAAC;AAMpB,YAAY,EACV,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,EACL,eAAe,EACf,KAAK,qBAAqB,EAC1B,mBAAmB,EACnB,KAAK,yBAAyB,EAC9B,eAAe,EACf,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,gBAAgB,EAChB,KAAK,sBAAsB,EAC3B,gBAAgB,EAChB,KAAK,sBAAsB,EAC5B,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAQH,OAAO,EACL,UAAU,EACV,0BAA0B,EAC1B,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,6BAA6B,EACnC,MAAM,oBAAoB,CAAC;AAQ5B,OAAO,EACL,sBAAsB,EACtB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,QAAQ,EACR,OAAO,EACP,WAAW,EACX,aAAa,EACb,WAAW,EACX,SAAS,EACT,KAAK,IAAI,EACT,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,wBAAwB,EAC9B,MAAM,mBAAmB,CAAC;AAM3B,YAAY,EACV,aAAa,EACb,cAAc,EACd,UAAU,EACV,eAAe,EACf,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACX,MAAM,YAAY,CAAC;AAMpB,YAAY,EACV,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,EACL,eAAe,EACf,KAAK,qBAAqB,EAC1B,mBAAmB,EACnB,KAAK,yBAAyB,EAC9B,eAAe,EACf,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,gBAAgB,EAChB,KAAK,sBAAsB,EAC3B,gBAAgB,EAChB,KAAK,sBAAsB,EAC5B,MAAM,2BAA2B,CAAC;AAQnC,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EAEL,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,cAAc,EACd,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,EAChB,oBAAoB,EAGpB,MAAM,EACN,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,kBAAkB,EAGlB,sBAAsB,EACtB,WAAW,EACX,sBAAsB,EACtB,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAMlD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG"}
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,12 @@ import {
|
|
|
21
21
|
JWTTokenResolver,
|
|
22
22
|
APITokenResolver
|
|
23
23
|
} from "./auth/providers/index.js";
|
|
24
|
+
import {
|
|
25
|
+
TenantAPIStatusCode,
|
|
26
|
+
TenantAPIErrorCode,
|
|
27
|
+
createTenantAPIError,
|
|
28
|
+
TenantAPIErrors
|
|
29
|
+
} from "./tenant/index.js";
|
|
24
30
|
import {
|
|
25
31
|
MCPAuthError,
|
|
26
32
|
AuthenticationError,
|
|
@@ -78,12 +84,16 @@ export {
|
|
|
78
84
|
RateLimitError,
|
|
79
85
|
ServerPoolError,
|
|
80
86
|
SimpleTokenResolver,
|
|
87
|
+
TenantAPIErrorCode,
|
|
88
|
+
TenantAPIErrors,
|
|
89
|
+
TenantAPIStatusCode,
|
|
81
90
|
TokenResolutionError,
|
|
82
91
|
TransportError,
|
|
83
92
|
ValidationError,
|
|
84
93
|
compose,
|
|
85
94
|
createAuthenticatedTool,
|
|
86
95
|
createLogger,
|
|
96
|
+
createTenantAPIError,
|
|
87
97
|
defaultLogger,
|
|
88
98
|
formatErrorForClient,
|
|
89
99
|
isAuthenticationError,
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @prmichaelsen/mcp-auth\n *\n * Authentication and multi-tenancy framework for MCP (Model Context Protocol) servers.\n *\n * Supports two complementary patterns:\n * 1. **Server Wrapping** - Wrap existing MCP servers without modification (MCP-level auth)\n * 2. **Tool-Level Auth** - Build new MCP servers with integrated auth\n *\n * @packageDocumentation\n */\n\n// ============================================================================\n// PATTERN 1: SERVER WRAPPING (MCP-Level Auth)\n// ============================================================================\n// Use this to wrap existing MCP servers without modifying them\n// Ideal for multi-tenant services that host multiple MCP servers\n\nexport {\n wrapServer,\n AuthenticatedServerWrapper,\n type ServerWrapperConfig,\n type MCPServerFactory,\n type NormalizedServerWrapperConfig\n} from './wrapper/index.js';\n\n// ============================================================================\n// PATTERN 2: TOOL-LEVEL AUTH\n// ============================================================================\n// Use this to build new MCP servers with integrated authentication\n// Provides fine-grained control over auth per tool\n\nexport {\n AuthenticatedMCPServer,\n type ServerConfig,\n type NormalizedServerConfig,\n withAuth,\n compose,\n withLogging,\n withRateLimit,\n withTimeout,\n withRetry,\n type Tool,\n AuthenticatedTool,\n createAuthenticatedTool,\n type AuthenticatedToolHandler\n} from './server/index.js';\n\n// ============================================================================\n// SHARED: CORE TYPES\n// ============================================================================\n\nexport type {\n TransportType,\n RequestContext,\n AuthResult,\n TransportConfig,\n RateLimitConfig,\n LoggingConfig,\n MiddlewareConfig,\n PoolingConfig,\n Result,\n AsyncFunction,\n ToolHandler,\n Middleware\n} from './types.js';\n\n// ============================================================================\n// SHARED: AUTHENTICATION\n// ============================================================================\n\nexport type {\n AuthProvider,\n ResourceTokenResolver,\n AuthenticatedContext,\n AuthProviderConfig,\n TokenResolverConfig\n} from './auth/types.js';\n\nexport { BaseAuthProvider } from './auth/base-provider.js';\n\n// Providers\nexport {\n EnvAuthProvider,\n type EnvAuthProviderConfig,\n SimpleTokenResolver,\n type SimpleTokenResolverConfig,\n JWTAuthProvider,\n type JWTAuthProviderConfig,\n type JWTPayload,\n JWTTokenResolver,\n type JWTTokenResolverConfig,\n APITokenResolver,\n type APITokenResolverConfig\n} from './auth/providers/index.js';\n\n//
|
|
5
|
-
"mappings": "AAkBA;AAAA,EACE;AAAA,EACA;AAAA,OAIK;AAQP;AAAA,EACE;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,OAEK;AAiCP,SAAS,wBAAwB;AAGjC;AAAA,EACE;AAAA,EAEA;AAAA,EAEA;AAAA,EAGA;AAAA,EAEA;AAAA,OAEK;
|
|
4
|
+
"sourcesContent": ["/**\n * @prmichaelsen/mcp-auth\n *\n * Authentication and multi-tenancy framework for MCP (Model Context Protocol) servers.\n *\n * Supports two complementary patterns:\n * 1. **Server Wrapping** - Wrap existing MCP servers without modification (MCP-level auth)\n * 2. **Tool-Level Auth** - Build new MCP servers with integrated auth\n *\n * @packageDocumentation\n */\n\n// ============================================================================\n// PATTERN 1: SERVER WRAPPING (MCP-Level Auth)\n// ============================================================================\n// Use this to wrap existing MCP servers without modifying them\n// Ideal for multi-tenant services that host multiple MCP servers\n\nexport {\n wrapServer,\n AuthenticatedServerWrapper,\n type ServerWrapperConfig,\n type MCPServerFactory,\n type NormalizedServerWrapperConfig\n} from './wrapper/index.js';\n\n// ============================================================================\n// PATTERN 2: TOOL-LEVEL AUTH\n// ============================================================================\n// Use this to build new MCP servers with integrated authentication\n// Provides fine-grained control over auth per tool\n\nexport {\n AuthenticatedMCPServer,\n type ServerConfig,\n type NormalizedServerConfig,\n withAuth,\n compose,\n withLogging,\n withRateLimit,\n withTimeout,\n withRetry,\n type Tool,\n AuthenticatedTool,\n createAuthenticatedTool,\n type AuthenticatedToolHandler\n} from './server/index.js';\n\n// ============================================================================\n// SHARED: CORE TYPES\n// ============================================================================\n\nexport type {\n TransportType,\n RequestContext,\n AuthResult,\n TransportConfig,\n RateLimitConfig,\n LoggingConfig,\n MiddlewareConfig,\n PoolingConfig,\n Result,\n AsyncFunction,\n ToolHandler,\n Middleware\n} from './types.js';\n\n// ============================================================================\n// SHARED: AUTHENTICATION\n// ============================================================================\n\nexport type {\n AuthProvider,\n ResourceTokenResolver,\n AuthenticatedContext,\n AuthProviderConfig,\n TokenResolverConfig\n} from './auth/types.js';\n\nexport { BaseAuthProvider } from './auth/base-provider.js';\n\n// Providers\nexport {\n EnvAuthProvider,\n type EnvAuthProviderConfig,\n SimpleTokenResolver,\n type SimpleTokenResolverConfig,\n JWTAuthProvider,\n type JWTAuthProviderConfig,\n type JWTPayload,\n JWTTokenResolver,\n type JWTTokenResolverConfig,\n APITokenResolver,\n type APITokenResolverConfig\n} from './auth/providers/index.js';\n\n// ============================================================================\n// TENANT MANAGER INTEGRATION\n// ============================================================================\n// Standard interfaces for tenant manager APIs\n// Helps tenant platforms provide consistent APIs for MCP servers\n\nexport {\n type TenantAPIErrorResponse,\n type CredentialsAPIResponse,\n type CredentialsAPIHeaders,\n type TenantManagerAPI,\n TenantAPIStatusCode,\n TenantAPIErrorCode,\n createTenantAPIError,\n TenantAPIErrors\n} from './tenant/index.js';\n\n// ============================================================================\n// SHARED: UTILITIES\n// ============================================================================\n\nexport {\n // Errors\n MCPAuthError,\n AuthenticationError,\n TokenResolutionError,\n InvalidTokenError,\n MissingCredentialsError,\n ConfigurationError,\n RateLimitError,\n ServerPoolError,\n TransportError,\n ValidationError,\n isMCPAuthError,\n isAuthenticationError,\n isTokenResolutionError,\n isRateLimitError,\n formatErrorForClient,\n \n // Logger\n Logger,\n LogLevel,\n defaultLogger,\n createLogger,\n sanitizeForLogging,\n \n // Validation\n validateNonEmptyString,\n validateUrl,\n validatePositiveNumber,\n validatePort,\n validateEnum,\n validateObject,\n validateFunction,\n validateRequiredFields,\n validateTransportConfig,\n validateRateLimitConfig,\n validateLoggingConfig,\n validatePoolingConfig,\n sanitizeString,\n validateUserId,\n validateResourceType,\n validateAccessToken\n} from './utils/index.js';\n\n// Re-export types for convenience\nexport type { LogEntry } from './utils/logger.js';\n\n// ============================================================================\n// USAGE EXAMPLES\n// ============================================================================\n\n/**\n * @example Server Wrapping Pattern (MCP-Level Auth)\n * ```typescript\n * import { wrapServer, JWTAuthProvider, DatabaseTokenResolver } from '@prmichaelsen/mcp-auth';\n * import { createServer as createInstagramServer } from '@prmichaelsen/instagram-mcp';\n *\n * const wrapped = wrapServer({\n * serverFactory: (accessToken, userId) => createInstagramServer(accessToken, userId),\n * authProvider: new JWTAuthProvider({ jwtSecret: process.env.JWT_SECRET }),\n * tokenResolver: new DatabaseTokenResolver({ database: {...} }),\n * resourceType: 'instagram',\n * transport: { type: 'sse', port: 3000 }\n * });\n *\n * await wrapped.start();\n * ```\n *\n * @example Tool-Level Auth Pattern\n * ```typescript\n * import { AuthenticatedMCPServer, withAuth, EnvAuthProvider } from '@prmichaelsen/mcp-auth';\n *\n * const server = new AuthenticatedMCPServer({\n * name: 'my-server',\n * authProvider: new EnvAuthProvider(),\n * tokenResolver: new SimpleTokenResolver({ tokenEnvVar: 'API_TOKEN' }),\n * resourceType: 'myapi',\n * transport: { type: 'stdio' }\n * });\n *\n * server.registerTool('get_data', withAuth(async (args, accessToken, userId) => {\n * const client = new MyAPIClient(accessToken);\n * return client.getData(args);\n * }));\n *\n * await server.start();\n * ```\n */\n"],
|
|
5
|
+
"mappings": "AAkBA;AAAA,EACE;AAAA,EACA;AAAA,OAIK;AAQP;AAAA,EACE;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,OAEK;AAiCP,SAAS,wBAAwB;AAGjC;AAAA,EACE;AAAA,EAEA;AAAA,EAEA;AAAA,EAGA;AAAA,EAEA;AAAA,OAEK;AAQP;AAAA,EAKE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMP;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tenant Manager API Contracts
|
|
3
|
+
*
|
|
4
|
+
* Standard interfaces for tenant manager APIs that MCP servers integrate with.
|
|
5
|
+
* These interfaces help tenant platforms provide consistent APIs for MCP servers.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Standard error response format
|
|
9
|
+
* Used by tenant manager APIs
|
|
10
|
+
*/
|
|
11
|
+
export interface TenantAPIErrorResponse {
|
|
12
|
+
/**
|
|
13
|
+
* Error type/title
|
|
14
|
+
*/
|
|
15
|
+
error: string;
|
|
16
|
+
/**
|
|
17
|
+
* Human-readable error message
|
|
18
|
+
*/
|
|
19
|
+
message?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Error code for programmatic handling
|
|
22
|
+
*/
|
|
23
|
+
code?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Additional error details (development only)
|
|
26
|
+
*/
|
|
27
|
+
details?: Record<string, unknown>;
|
|
28
|
+
/**
|
|
29
|
+
* Timestamp of the error
|
|
30
|
+
*/
|
|
31
|
+
timestamp: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Credentials API response
|
|
35
|
+
* Returned by GET /api/credentials/:userId/:provider
|
|
36
|
+
*/
|
|
37
|
+
export interface CredentialsAPIResponse {
|
|
38
|
+
/**
|
|
39
|
+
* Access token for the provider
|
|
40
|
+
*/
|
|
41
|
+
access_token: string;
|
|
42
|
+
/**
|
|
43
|
+
* Token expiration timestamp (ISO 8601)
|
|
44
|
+
*/
|
|
45
|
+
expires_at?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Provider-specific user ID (e.g., Instagram user ID, GitHub user ID)
|
|
48
|
+
* Note: Provider is already specified in the URL path
|
|
49
|
+
*/
|
|
50
|
+
user_id?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Provider-specific username (e.g., Instagram username, GitHub username)
|
|
53
|
+
* Note: Provider is already specified in the URL path
|
|
54
|
+
*/
|
|
55
|
+
username?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Additional provider-specific metadata
|
|
58
|
+
*/
|
|
59
|
+
metadata?: Record<string, unknown>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Standard HTTP status codes for tenant manager APIs
|
|
63
|
+
*/
|
|
64
|
+
export declare enum TenantAPIStatusCode {
|
|
65
|
+
OK = 200,
|
|
66
|
+
BAD_REQUEST = 400,
|
|
67
|
+
UNAUTHORIZED = 401,
|
|
68
|
+
FORBIDDEN = 403,
|
|
69
|
+
NOT_FOUND = 404,
|
|
70
|
+
CONFLICT = 409,
|
|
71
|
+
TOO_MANY_REQUESTS = 429,
|
|
72
|
+
INTERNAL_ERROR = 500,
|
|
73
|
+
NOT_IMPLEMENTED = 501
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Standard error codes for tenant manager APIs
|
|
77
|
+
*/
|
|
78
|
+
export declare enum TenantAPIErrorCode {
|
|
79
|
+
VALIDATION_ERROR = "VALIDATION_ERROR",
|
|
80
|
+
AUTHENTICATION_ERROR = "AUTHENTICATION_ERROR",
|
|
81
|
+
AUTHORIZATION_ERROR = "AUTHORIZATION_ERROR",
|
|
82
|
+
NOT_FOUND = "NOT_FOUND",
|
|
83
|
+
TOKEN_EXPIRED = "TOKEN_EXPIRED",
|
|
84
|
+
RATE_LIMIT_EXCEEDED = "RATE_LIMIT_EXCEEDED",
|
|
85
|
+
INTERNAL_ERROR = "INTERNAL_ERROR"
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Credentials API request headers
|
|
89
|
+
* Expected by GET /api/credentials/:userId/:provider
|
|
90
|
+
*/
|
|
91
|
+
export interface CredentialsAPIHeaders {
|
|
92
|
+
/**
|
|
93
|
+
* Service token for MCP server → tenant manager authentication
|
|
94
|
+
*/
|
|
95
|
+
'Authorization': string;
|
|
96
|
+
/**
|
|
97
|
+
* Optional: User ID (alternative to path parameter)
|
|
98
|
+
*/
|
|
99
|
+
'X-User-ID'?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Optional: Request ID for tracing
|
|
102
|
+
*/
|
|
103
|
+
'X-Request-ID'?: string;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Tenant Manager API Contract
|
|
107
|
+
*
|
|
108
|
+
* Interface that tenant managers should implement for MCP server integration.
|
|
109
|
+
*/
|
|
110
|
+
export interface TenantManagerAPI {
|
|
111
|
+
/**
|
|
112
|
+
* Get credentials for a user and provider
|
|
113
|
+
*
|
|
114
|
+
* @endpoint GET /api/credentials/:userId/:provider
|
|
115
|
+
* @auth Service token in Authorization header
|
|
116
|
+
*
|
|
117
|
+
* @param userId - User identifier
|
|
118
|
+
* @param provider - Provider name (e.g., 'instagram', 'github')
|
|
119
|
+
* @returns Credentials response or error
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```
|
|
123
|
+
* GET /api/credentials/user-123/instagram
|
|
124
|
+
* Authorization: Bearer service-token-xyz
|
|
125
|
+
*
|
|
126
|
+
* Response 200:
|
|
127
|
+
* {
|
|
128
|
+
* "access_token": "IGQVJXabc...",
|
|
129
|
+
* "expires_at": "2026-12-31T23:59:59Z",
|
|
130
|
+
* "user_id": "17841400008460056",
|
|
131
|
+
* "username": "johndoe"
|
|
132
|
+
* }
|
|
133
|
+
*
|
|
134
|
+
* Response 404:
|
|
135
|
+
* {
|
|
136
|
+
* "error": "Not Found",
|
|
137
|
+
* "message": "Credentials not found for user",
|
|
138
|
+
* "timestamp": "2026-02-09T21:00:00.000Z"
|
|
139
|
+
* }
|
|
140
|
+
*
|
|
141
|
+
* Response 401:
|
|
142
|
+
* {
|
|
143
|
+
* "error": "Unauthorized",
|
|
144
|
+
* "message": "Token expired",
|
|
145
|
+
* "code": "TOKEN_EXPIRED",
|
|
146
|
+
* "timestamp": "2026-02-09T21:00:00.000Z"
|
|
147
|
+
* }
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
getCredentials(userId: string, provider: string, headers: CredentialsAPIHeaders): Promise<CredentialsAPIResponse | TenantAPIErrorResponse>;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Helper function to create standardized error responses
|
|
154
|
+
* Tenant managers can use this to ensure consistency
|
|
155
|
+
*/
|
|
156
|
+
export declare function createTenantAPIError(error: string, statusCode: TenantAPIStatusCode, options?: {
|
|
157
|
+
message?: string;
|
|
158
|
+
code?: TenantAPIErrorCode;
|
|
159
|
+
details?: Record<string, unknown>;
|
|
160
|
+
}): TenantAPIErrorResponse;
|
|
161
|
+
/**
|
|
162
|
+
* Common error responses for tenant manager APIs
|
|
163
|
+
*/
|
|
164
|
+
export declare const TenantAPIErrors: {
|
|
165
|
+
missingHeader: (headerName: string) => TenantAPIErrorResponse;
|
|
166
|
+
unsupportedProvider: (provider: string) => TenantAPIErrorResponse;
|
|
167
|
+
credentialsNotFound: (userId: string, provider: string) => TenantAPIErrorResponse;
|
|
168
|
+
tokenExpired: (provider: string) => TenantAPIErrorResponse;
|
|
169
|
+
internalError: (message?: string) => TenantAPIErrorResponse;
|
|
170
|
+
};
|
|
171
|
+
//# sourceMappingURL=api-contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-contracts.d.ts","sourceRoot":"","sources":["../../src/tenant/api-contracts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAElC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,oBAAY,mBAAmB;IAC7B,EAAE,MAAM;IACR,WAAW,MAAM;IACjB,YAAY,MAAM;IAClB,SAAS,MAAM;IACf,SAAS,MAAM;IACf,QAAQ,MAAM;IACd,iBAAiB,MAAM;IACvB,cAAc,MAAM;IACpB,eAAe,MAAM;CACtB;AAED;;GAEG;AACH,oBAAY,kBAAkB;IAC5B,gBAAgB,qBAAqB;IACrC,oBAAoB,yBAAyB;IAC7C,mBAAmB,wBAAwB;IAC3C,SAAS,cAAc;IACvB,aAAa,kBAAkB;IAC/B,mBAAmB,wBAAwB;IAC3C,cAAc,mBAAmB;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,cAAc,CACZ,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,sBAAsB,GAAG,sBAAsB,CAAC,CAAC;CAC7D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,mBAAmB,EAC/B,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,GACA,sBAAsB,CAQxB;AAED;;GAEG;AACH,eAAO,MAAM,eAAe;gCACE,MAAM;oCAUF,MAAM;kCAUR,MAAM,YAAY,MAAM;6BAW7B,MAAM;8BAUL,MAAM;CASjC,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
var TenantAPIStatusCode = /* @__PURE__ */ ((TenantAPIStatusCode2) => {
|
|
2
|
+
TenantAPIStatusCode2[TenantAPIStatusCode2["OK"] = 200] = "OK";
|
|
3
|
+
TenantAPIStatusCode2[TenantAPIStatusCode2["BAD_REQUEST"] = 400] = "BAD_REQUEST";
|
|
4
|
+
TenantAPIStatusCode2[TenantAPIStatusCode2["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
|
|
5
|
+
TenantAPIStatusCode2[TenantAPIStatusCode2["FORBIDDEN"] = 403] = "FORBIDDEN";
|
|
6
|
+
TenantAPIStatusCode2[TenantAPIStatusCode2["NOT_FOUND"] = 404] = "NOT_FOUND";
|
|
7
|
+
TenantAPIStatusCode2[TenantAPIStatusCode2["CONFLICT"] = 409] = "CONFLICT";
|
|
8
|
+
TenantAPIStatusCode2[TenantAPIStatusCode2["TOO_MANY_REQUESTS"] = 429] = "TOO_MANY_REQUESTS";
|
|
9
|
+
TenantAPIStatusCode2[TenantAPIStatusCode2["INTERNAL_ERROR"] = 500] = "INTERNAL_ERROR";
|
|
10
|
+
TenantAPIStatusCode2[TenantAPIStatusCode2["NOT_IMPLEMENTED"] = 501] = "NOT_IMPLEMENTED";
|
|
11
|
+
return TenantAPIStatusCode2;
|
|
12
|
+
})(TenantAPIStatusCode || {});
|
|
13
|
+
var TenantAPIErrorCode = /* @__PURE__ */ ((TenantAPIErrorCode2) => {
|
|
14
|
+
TenantAPIErrorCode2["VALIDATION_ERROR"] = "VALIDATION_ERROR";
|
|
15
|
+
TenantAPIErrorCode2["AUTHENTICATION_ERROR"] = "AUTHENTICATION_ERROR";
|
|
16
|
+
TenantAPIErrorCode2["AUTHORIZATION_ERROR"] = "AUTHORIZATION_ERROR";
|
|
17
|
+
TenantAPIErrorCode2["NOT_FOUND"] = "NOT_FOUND";
|
|
18
|
+
TenantAPIErrorCode2["TOKEN_EXPIRED"] = "TOKEN_EXPIRED";
|
|
19
|
+
TenantAPIErrorCode2["RATE_LIMIT_EXCEEDED"] = "RATE_LIMIT_EXCEEDED";
|
|
20
|
+
TenantAPIErrorCode2["INTERNAL_ERROR"] = "INTERNAL_ERROR";
|
|
21
|
+
return TenantAPIErrorCode2;
|
|
22
|
+
})(TenantAPIErrorCode || {});
|
|
23
|
+
function createTenantAPIError(error, statusCode, options) {
|
|
24
|
+
return {
|
|
25
|
+
error,
|
|
26
|
+
message: options?.message || error,
|
|
27
|
+
code: options?.code,
|
|
28
|
+
details: options?.details,
|
|
29
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const TenantAPIErrors = {
|
|
33
|
+
missingHeader: (headerName) => createTenantAPIError(
|
|
34
|
+
"Bad Request",
|
|
35
|
+
400 /* BAD_REQUEST */,
|
|
36
|
+
{
|
|
37
|
+
message: `${headerName} header required`,
|
|
38
|
+
code: "VALIDATION_ERROR" /* VALIDATION_ERROR */
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
unsupportedProvider: (provider) => createTenantAPIError(
|
|
42
|
+
"Bad Request",
|
|
43
|
+
400 /* BAD_REQUEST */,
|
|
44
|
+
{
|
|
45
|
+
message: `Unsupported provider: ${provider}`,
|
|
46
|
+
code: "VALIDATION_ERROR" /* VALIDATION_ERROR */
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
credentialsNotFound: (userId, provider) => createTenantAPIError(
|
|
50
|
+
"Not Found",
|
|
51
|
+
404 /* NOT_FOUND */,
|
|
52
|
+
{
|
|
53
|
+
message: `No ${provider} credentials found for user`,
|
|
54
|
+
code: "NOT_FOUND" /* NOT_FOUND */,
|
|
55
|
+
details: { userId, provider }
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
tokenExpired: (provider) => createTenantAPIError(
|
|
59
|
+
"Unauthorized",
|
|
60
|
+
401 /* UNAUTHORIZED */,
|
|
61
|
+
{
|
|
62
|
+
message: `${provider} token has expired`,
|
|
63
|
+
code: "TOKEN_EXPIRED" /* TOKEN_EXPIRED */
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
internalError: (message) => createTenantAPIError(
|
|
67
|
+
"Internal Server Error",
|
|
68
|
+
500 /* INTERNAL_ERROR */,
|
|
69
|
+
{
|
|
70
|
+
message: message || "An unexpected error occurred",
|
|
71
|
+
code: "INTERNAL_ERROR" /* INTERNAL_ERROR */
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
};
|
|
75
|
+
export {
|
|
76
|
+
TenantAPIErrorCode,
|
|
77
|
+
TenantAPIErrors,
|
|
78
|
+
TenantAPIStatusCode,
|
|
79
|
+
createTenantAPIError
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=api-contracts.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/tenant/api-contracts.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Tenant Manager API Contracts\n * \n * Standard interfaces for tenant manager APIs that MCP servers integrate with.\n * These interfaces help tenant platforms provide consistent APIs for MCP servers.\n */\n\n/**\n * Standard error response format\n * Used by tenant manager APIs\n */\nexport interface TenantAPIErrorResponse {\n /**\n * Error type/title\n */\n error: string;\n \n /**\n * Human-readable error message\n */\n message?: string;\n \n /**\n * Error code for programmatic handling\n */\n code?: string;\n \n /**\n * Additional error details (development only)\n */\n details?: Record<string, unknown>;\n \n /**\n * Timestamp of the error\n */\n timestamp: string;\n}\n\n/**\n * Credentials API response\n * Returned by GET /api/credentials/:userId/:provider\n */\nexport interface CredentialsAPIResponse {\n /**\n * Access token for the provider\n */\n access_token: string;\n \n /**\n * Token expiration timestamp (ISO 8601)\n */\n expires_at?: string;\n \n /**\n * Provider-specific user ID (e.g., Instagram user ID, GitHub user ID)\n * Note: Provider is already specified in the URL path\n */\n user_id?: string;\n \n /**\n * Provider-specific username (e.g., Instagram username, GitHub username)\n * Note: Provider is already specified in the URL path\n */\n username?: string;\n \n /**\n * Additional provider-specific metadata\n */\n metadata?: Record<string, unknown>;\n}\n\n/**\n * Standard HTTP status codes for tenant manager APIs\n */\nexport enum TenantAPIStatusCode {\n OK = 200,\n BAD_REQUEST = 400,\n UNAUTHORIZED = 401,\n FORBIDDEN = 403,\n NOT_FOUND = 404,\n CONFLICT = 409,\n TOO_MANY_REQUESTS = 429,\n INTERNAL_ERROR = 500,\n NOT_IMPLEMENTED = 501\n}\n\n/**\n * Standard error codes for tenant manager APIs\n */\nexport enum TenantAPIErrorCode {\n VALIDATION_ERROR = 'VALIDATION_ERROR',\n AUTHENTICATION_ERROR = 'AUTHENTICATION_ERROR',\n AUTHORIZATION_ERROR = 'AUTHORIZATION_ERROR',\n NOT_FOUND = 'NOT_FOUND',\n TOKEN_EXPIRED = 'TOKEN_EXPIRED',\n RATE_LIMIT_EXCEEDED = 'RATE_LIMIT_EXCEEDED',\n INTERNAL_ERROR = 'INTERNAL_ERROR'\n}\n\n/**\n * Credentials API request headers\n * Expected by GET /api/credentials/:userId/:provider\n */\nexport interface CredentialsAPIHeaders {\n /**\n * Service token for MCP server \u2192 tenant manager authentication\n */\n 'Authorization': string; // Bearer <service-token>\n \n /**\n * Optional: User ID (alternative to path parameter)\n */\n 'X-User-ID'?: string;\n \n /**\n * Optional: Request ID for tracing\n */\n 'X-Request-ID'?: string;\n}\n\n/**\n * Tenant Manager API Contract\n * \n * Interface that tenant managers should implement for MCP server integration.\n */\nexport interface TenantManagerAPI {\n /**\n * Get credentials for a user and provider\n * \n * @endpoint GET /api/credentials/:userId/:provider\n * @auth Service token in Authorization header\n * \n * @param userId - User identifier\n * @param provider - Provider name (e.g., 'instagram', 'github')\n * @returns Credentials response or error\n * \n * @example\n * ```\n * GET /api/credentials/user-123/instagram\n * Authorization: Bearer service-token-xyz\n * \n * Response 200:\n * {\n * \"access_token\": \"IGQVJXabc...\",\n * \"expires_at\": \"2026-12-31T23:59:59Z\",\n * \"user_id\": \"17841400008460056\",\n * \"username\": \"johndoe\"\n * }\n * \n * Response 404:\n * {\n * \"error\": \"Not Found\",\n * \"message\": \"Credentials not found for user\",\n * \"timestamp\": \"2026-02-09T21:00:00.000Z\"\n * }\n * \n * Response 401:\n * {\n * \"error\": \"Unauthorized\",\n * \"message\": \"Token expired\",\n * \"code\": \"TOKEN_EXPIRED\",\n * \"timestamp\": \"2026-02-09T21:00:00.000Z\"\n * }\n * ```\n */\n getCredentials(\n userId: string,\n provider: string,\n headers: CredentialsAPIHeaders\n ): Promise<CredentialsAPIResponse | TenantAPIErrorResponse>;\n}\n\n/**\n * Helper function to create standardized error responses\n * Tenant managers can use this to ensure consistency\n */\nexport function createTenantAPIError(\n error: string,\n statusCode: TenantAPIStatusCode,\n options?: {\n message?: string;\n code?: TenantAPIErrorCode;\n details?: Record<string, unknown>;\n }\n): TenantAPIErrorResponse {\n return {\n error,\n message: options?.message || error,\n code: options?.code,\n details: options?.details,\n timestamp: new Date().toISOString()\n };\n}\n\n/**\n * Common error responses for tenant manager APIs\n */\nexport const TenantAPIErrors = {\n missingHeader: (headerName: string) =>\n createTenantAPIError(\n 'Bad Request',\n TenantAPIStatusCode.BAD_REQUEST,\n {\n message: `${headerName} header required`,\n code: TenantAPIErrorCode.VALIDATION_ERROR\n }\n ),\n \n unsupportedProvider: (provider: string) =>\n createTenantAPIError(\n 'Bad Request',\n TenantAPIStatusCode.BAD_REQUEST,\n {\n message: `Unsupported provider: ${provider}`,\n code: TenantAPIErrorCode.VALIDATION_ERROR\n }\n ),\n \n credentialsNotFound: (userId: string, provider: string) =>\n createTenantAPIError(\n 'Not Found',\n TenantAPIStatusCode.NOT_FOUND,\n {\n message: `No ${provider} credentials found for user`,\n code: TenantAPIErrorCode.NOT_FOUND,\n details: { userId, provider }\n }\n ),\n \n tokenExpired: (provider: string) =>\n createTenantAPIError(\n 'Unauthorized',\n TenantAPIStatusCode.UNAUTHORIZED,\n {\n message: `${provider} token has expired`,\n code: TenantAPIErrorCode.TOKEN_EXPIRED\n }\n ),\n \n internalError: (message?: string) =>\n createTenantAPIError(\n 'Internal Server Error',\n TenantAPIStatusCode.INTERNAL_ERROR,\n {\n message: message || 'An unexpected error occurred',\n code: TenantAPIErrorCode.INTERNAL_ERROR\n }\n )\n};\n"],
|
|
5
|
+
"mappings": "AA0EO,IAAK,sBAAL,kBAAKA,yBAAL;AACL,EAAAA,0CAAA,QAAK,OAAL;AACA,EAAAA,0CAAA,iBAAc,OAAd;AACA,EAAAA,0CAAA,kBAAe,OAAf;AACA,EAAAA,0CAAA,eAAY,OAAZ;AACA,EAAAA,0CAAA,eAAY,OAAZ;AACA,EAAAA,0CAAA,cAAW,OAAX;AACA,EAAAA,0CAAA,uBAAoB,OAApB;AACA,EAAAA,0CAAA,oBAAiB,OAAjB;AACA,EAAAA,0CAAA,qBAAkB,OAAlB;AATU,SAAAA;AAAA,GAAA;AAeL,IAAK,qBAAL,kBAAKC,wBAAL;AACL,EAAAA,oBAAA,sBAAmB;AACnB,EAAAA,oBAAA,0BAAuB;AACvB,EAAAA,oBAAA,yBAAsB;AACtB,EAAAA,oBAAA,eAAY;AACZ,EAAAA,oBAAA,mBAAgB;AAChB,EAAAA,oBAAA,yBAAsB;AACtB,EAAAA,oBAAA,oBAAiB;AAPP,SAAAA;AAAA,GAAA;AAuFL,SAAS,qBACd,OACA,YACA,SAKwB;AACxB,SAAO;AAAA,IACL;AAAA,IACA,SAAS,SAAS,WAAW;AAAA,IAC7B,MAAM,SAAS;AAAA,IACf,SAAS,SAAS;AAAA,IAClB,YAAW,oBAAI,KAAK,GAAE,YAAY;AAAA,EACpC;AACF;AAKO,MAAM,kBAAkB;AAAA,EAC7B,eAAe,CAAC,eACd;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,MACE,SAAS,GAAG,UAAU;AAAA,MACtB,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EAEF,qBAAqB,CAAC,aACpB;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,MACE,SAAS,yBAAyB,QAAQ;AAAA,MAC1C,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EAEF,qBAAqB,CAAC,QAAgB,aACpC;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,MACE,SAAS,MAAM,QAAQ;AAAA,MACvB,MAAM;AAAA,MACN,SAAS,EAAE,QAAQ,SAAS;AAAA,IAC9B;AAAA,EACF;AAAA,EAEF,cAAc,CAAC,aACb;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,MACE,SAAS,GAAG,QAAQ;AAAA,MACpB,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EAEF,eAAe,CAAC,YACd;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,MACE,SAAS,WAAW;AAAA,MACpB,MAAM;AAAA,IACR;AAAA,EACF;AACJ;",
|
|
6
|
+
"names": ["TenantAPIStatusCode", "TenantAPIErrorCode"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tenant Manager Integration Module
|
|
3
|
+
*
|
|
4
|
+
* Provides interfaces and utilities for tenant managers to integrate with MCP servers.
|
|
5
|
+
*/
|
|
6
|
+
export type { TenantAPIErrorResponse, CredentialsAPIResponse, CredentialsAPIHeaders, TenantManagerAPI } from './api-contracts.js';
|
|
7
|
+
export { TenantAPIStatusCode, TenantAPIErrorCode, createTenantAPIError, TenantAPIErrors } from './api-contracts.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tenant/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EACV,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EAChB,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TenantAPIStatusCode,
|
|
3
|
+
TenantAPIErrorCode,
|
|
4
|
+
createTenantAPIError,
|
|
5
|
+
TenantAPIErrors
|
|
6
|
+
} from "./api-contracts.js";
|
|
7
|
+
export {
|
|
8
|
+
TenantAPIErrorCode,
|
|
9
|
+
TenantAPIErrors,
|
|
10
|
+
TenantAPIStatusCode,
|
|
11
|
+
createTenantAPIError
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/tenant/index.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Tenant Manager Integration Module\n * \n * Provides interfaces and utilities for tenant managers to integrate with MCP servers.\n */\n\nexport type {\n TenantAPIErrorResponse,\n CredentialsAPIResponse,\n CredentialsAPIHeaders,\n TenantManagerAPI\n} from './api-contracts.js';\n\nexport {\n TenantAPIStatusCode,\n TenantAPIErrorCode,\n createTenantAPIError,\n TenantAPIErrors\n} from './api-contracts.js';\n"],
|
|
5
|
+
"mappings": "AAaA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|