@mcp-abap-adt/interfaces 0.1.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/CHANGELOG.md +39 -0
- package/LICENSE +22 -0
- package/README.md +130 -0
- package/dist/auth/AuthType.d.ts +5 -0
- package/dist/auth/AuthType.d.ts.map +1 -0
- package/dist/auth/AuthType.js +2 -0
- package/dist/auth/IAuthorizationConfig.d.ts +15 -0
- package/dist/auth/IAuthorizationConfig.d.ts.map +1 -0
- package/dist/auth/IAuthorizationConfig.js +2 -0
- package/dist/auth/IConfig.d.ts +8 -0
- package/dist/auth/IConfig.d.ts.map +1 -0
- package/dist/auth/IConfig.js +2 -0
- package/dist/auth/IConnectionConfig.d.ts +15 -0
- package/dist/auth/IConnectionConfig.d.ts.map +1 -0
- package/dist/auth/IConnectionConfig.js +2 -0
- package/dist/connection/IAbapConnection.d.ts +21 -0
- package/dist/connection/IAbapConnection.d.ts.map +1 -0
- package/dist/connection/IAbapConnection.js +2 -0
- package/dist/connection/IAbapRequestOptions.d.ts +9 -0
- package/dist/connection/IAbapRequestOptions.d.ts.map +1 -0
- package/dist/connection/IAbapRequestOptions.js +2 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/logging/ILogger.d.ts +35 -0
- package/dist/logging/ILogger.d.ts.map +1 -0
- package/dist/logging/ILogger.js +2 -0
- package/dist/sap/ISapConfig.d.ts +14 -0
- package/dist/sap/ISapConfig.d.ts.map +1 -0
- package/dist/sap/ISapConfig.js +2 -0
- package/dist/sap/SapAuthType.d.ts +2 -0
- package/dist/sap/SapAuthType.d.ts.map +1 -0
- package/dist/sap/SapAuthType.js +2 -0
- package/dist/serviceKey/IServiceKeyStore.d.ts +31 -0
- package/dist/serviceKey/IServiceKeyStore.d.ts.map +1 -0
- package/dist/serviceKey/IServiceKeyStore.js +2 -0
- package/dist/session/ISessionStore.d.ts +59 -0
- package/dist/session/ISessionStore.d.ts.map +1 -0
- package/dist/session/ISessionStore.js +2 -0
- package/dist/storage/ISessionState.d.ts +10 -0
- package/dist/storage/ISessionState.d.ts.map +1 -0
- package/dist/storage/ISessionState.js +2 -0
- package/dist/storage/ISessionStorage.d.ts +25 -0
- package/dist/storage/ISessionStorage.d.ts.map +1 -0
- package/dist/storage/ISessionStorage.js +2 -0
- package/dist/token/ITokenProvider.d.ts +33 -0
- package/dist/token/ITokenProvider.d.ts.map +1 -0
- package/dist/token/ITokenProvider.js +10 -0
- package/dist/token/ITokenProviderOptions.d.ts +11 -0
- package/dist/token/ITokenProviderOptions.d.ts.map +1 -0
- package/dist/token/ITokenProviderOptions.js +2 -0
- package/dist/token/ITokenProviderResult.d.ts +11 -0
- package/dist/token/ITokenProviderResult.d.ts.map +1 -0
- package/dist/token/ITokenProviderResult.js +2 -0
- package/dist/utils/ITimeoutConfig.d.ts +6 -0
- package/dist/utils/ITimeoutConfig.d.ts.map +1 -0
- package/dist/utils/ITimeoutConfig.js +2 -0
- package/dist/utils/ITokenRefreshResult.d.ts +8 -0
- package/dist/utils/ITokenRefreshResult.d.ts.map +1 -0
- package/dist/utils/ITokenRefreshResult.js +2 -0
- package/dist/validation/IHeaderValidationResult.d.ts +15 -0
- package/dist/validation/IHeaderValidationResult.d.ts.map +1 -0
- package/dist/validation/IHeaderValidationResult.js +2 -0
- package/dist/validation/IValidatedAuthConfig.d.ts +46 -0
- package/dist/validation/IValidatedAuthConfig.d.ts.map +1 -0
- package/dist/validation/IValidatedAuthConfig.js +15 -0
- package/package.json +51 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.0] - 2025-12-04
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Initial release of interfaces package
|
|
12
|
+
- All interfaces from `@mcp-abap-adt/auth-broker`
|
|
13
|
+
- All interfaces from `@mcp-abap-adt/connection`
|
|
14
|
+
- All interfaces from `@mcp-abap-adt/header-validator`
|
|
15
|
+
- Interface renaming to follow `I` prefix convention:
|
|
16
|
+
- `TokenProviderResult` → `ITokenProviderResult`
|
|
17
|
+
- `TokenProviderOptions` → `ITokenProviderOptions`
|
|
18
|
+
- `AbapConnection` → `IAbapConnection`
|
|
19
|
+
- `AbapRequestOptions` → `IAbapRequestOptions`
|
|
20
|
+
- `SapConfig` → `ISapConfig`
|
|
21
|
+
- `SessionState` → `ISessionState`
|
|
22
|
+
- `TokenRefreshResult` → `ITokenRefreshResult`
|
|
23
|
+
- `TimeoutConfig` → `ITimeoutConfig`
|
|
24
|
+
- `ValidatedAuthConfig` → `IValidatedAuthConfig`
|
|
25
|
+
- `HeaderValidationResult` → `IHeaderValidationResult`
|
|
26
|
+
- Organized interfaces by domain:
|
|
27
|
+
- `auth/` - Authentication interfaces
|
|
28
|
+
- `token/` - Token-related interfaces
|
|
29
|
+
- `session/` - Session storage interface
|
|
30
|
+
- `serviceKey/` - Service key storage interface
|
|
31
|
+
- `connection/` - Connection interfaces
|
|
32
|
+
- `sap/` - SAP-specific configuration
|
|
33
|
+
- `storage/` - Storage interfaces
|
|
34
|
+
- `logging/` - Logging interfaces
|
|
35
|
+
- `validation/` - Validation interfaces
|
|
36
|
+
- `utils/` - Utility types and interfaces
|
|
37
|
+
|
|
38
|
+
[0.1.0]: https://github.com/fr0ster/mcp-abap-adt-interfaces/releases/tag/v0.1.0
|
|
39
|
+
|
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Oleksii Kyslytsia
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# @mcp-abap-adt/interfaces
|
|
2
|
+
|
|
3
|
+
Shared interfaces for MCP ABAP ADT packages.
|
|
4
|
+
|
|
5
|
+
This package provides all TypeScript interfaces used across the MCP ABAP ADT ecosystem, ensuring consistency and type safety across all packages.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @mcp-abap-adt/interfaces
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
This package contains all interfaces organized by domain:
|
|
16
|
+
|
|
17
|
+
- **`auth/`** - Core authentication interfaces (configs, auth types)
|
|
18
|
+
- **`token/`** - Token-related interfaces (token provider, results, options)
|
|
19
|
+
- **`session/`** - Session storage interface
|
|
20
|
+
- **`serviceKey/`** - Service key storage interface
|
|
21
|
+
- **`connection/`** - Connection interfaces (AbapConnection, request options)
|
|
22
|
+
- **`sap/`** - SAP-specific configuration (SapConfig, SapAuthType)
|
|
23
|
+
- **`storage/`** - Storage interfaces (session storage, state)
|
|
24
|
+
- **`logging/`** - Logging interfaces
|
|
25
|
+
- **`validation/`** - Validation interfaces
|
|
26
|
+
- **`utils/`** - Utility types and interfaces
|
|
27
|
+
|
|
28
|
+
## Interface Naming Convention
|
|
29
|
+
|
|
30
|
+
**All interfaces start with `I` prefix** (e.g., `IAbapConnection`, `ISapConfig`, `ITokenProvider`).
|
|
31
|
+
|
|
32
|
+
This ensures consistency across all packages and follows TypeScript naming conventions for interfaces.
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import {
|
|
38
|
+
IAuthorizationConfig,
|
|
39
|
+
IConnectionConfig,
|
|
40
|
+
ISessionStore,
|
|
41
|
+
IServiceKeyStore,
|
|
42
|
+
ITokenProvider,
|
|
43
|
+
IAbapConnection,
|
|
44
|
+
ISapConfig,
|
|
45
|
+
ILogger
|
|
46
|
+
} from '@mcp-abap-adt/interfaces';
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Responsibilities and Design Principles
|
|
50
|
+
|
|
51
|
+
### Core Development Principle
|
|
52
|
+
|
|
53
|
+
**Interface-Only Communication**: This package defines **interfaces only**. It contains no implementations, no dependencies on other packages (except type-only imports), and serves as the single source of truth for all interface definitions.
|
|
54
|
+
|
|
55
|
+
### Package Responsibilities
|
|
56
|
+
|
|
57
|
+
This package is responsible for:
|
|
58
|
+
|
|
59
|
+
1. **Defining interfaces**: Provides all TypeScript interfaces used across MCP ABAP ADT packages
|
|
60
|
+
2. **Type safety**: Ensures consistent type definitions across all packages
|
|
61
|
+
3. **Version management**: Single version for all interfaces
|
|
62
|
+
4. **Documentation**: Centralized documentation for all interfaces
|
|
63
|
+
|
|
64
|
+
#### What This Package Does
|
|
65
|
+
|
|
66
|
+
- **Defines interfaces**: All interfaces used across MCP ABAP ADT packages
|
|
67
|
+
- **Organizes by domain**: Interfaces grouped by functional domain
|
|
68
|
+
- **Follows naming convention**: All interfaces start with `I` prefix
|
|
69
|
+
- **Type-only exports**: No runtime code, only type definitions
|
|
70
|
+
|
|
71
|
+
#### What This Package Does NOT Do
|
|
72
|
+
|
|
73
|
+
- **Does NOT implement anything**: This is a type-only package
|
|
74
|
+
- **Does NOT have runtime dependencies**: Only devDependencies for TypeScript compilation
|
|
75
|
+
- **Does NOT know about implementations**: Interfaces are independent of implementations
|
|
76
|
+
|
|
77
|
+
## Interface Domains
|
|
78
|
+
|
|
79
|
+
### Authentication Domain (`auth/`)
|
|
80
|
+
- `IAuthorizationConfig` - Authorization values (UAA credentials, refresh token)
|
|
81
|
+
- `IConnectionConfig` - Connection values (service URL, token, client, language)
|
|
82
|
+
- `IConfig` - Composition of authorization and connection config
|
|
83
|
+
- `AuthType` - Auth type: `'jwt' | 'xsuaa' | 'basic'`
|
|
84
|
+
|
|
85
|
+
### Token Domain (`token/`)
|
|
86
|
+
- `ITokenProvider` - Token provider interface
|
|
87
|
+
- `ITokenProviderResult` - Result from token provider
|
|
88
|
+
- `ITokenProviderOptions` - Options for token providers
|
|
89
|
+
|
|
90
|
+
### Session Domain (`session/`)
|
|
91
|
+
- `ISessionStore` - Session storage interface
|
|
92
|
+
|
|
93
|
+
### Service Key Domain (`serviceKey/`)
|
|
94
|
+
- `IServiceKeyStore` - Service key storage interface
|
|
95
|
+
|
|
96
|
+
### Connection Domain (`connection/`)
|
|
97
|
+
- `IAbapConnection` - Main connection interface for ADT operations
|
|
98
|
+
- `IAbapRequestOptions` - Request options for ADT operations
|
|
99
|
+
|
|
100
|
+
### SAP Domain (`sap/`)
|
|
101
|
+
- `ISapConfig` - SAP connection configuration
|
|
102
|
+
- `SapAuthType` - Authentication type: `"basic" | "jwt"`
|
|
103
|
+
|
|
104
|
+
### Storage Domain (`storage/`)
|
|
105
|
+
- `ISessionStorage` - Session storage interface
|
|
106
|
+
- `ISessionState` - Session state structure
|
|
107
|
+
|
|
108
|
+
### Logging Domain (`logging/`)
|
|
109
|
+
- `ILogger` - Logger interface
|
|
110
|
+
|
|
111
|
+
### Validation Domain (`validation/`)
|
|
112
|
+
- `IValidatedAuthConfig` - Validated authentication configuration
|
|
113
|
+
- `IHeaderValidationResult` - Header validation result
|
|
114
|
+
- `AuthMethodPriority` - Authentication method priority enum
|
|
115
|
+
|
|
116
|
+
### Utilities Domain (`utils/`)
|
|
117
|
+
- `ITokenRefreshResult` - Token refresh result
|
|
118
|
+
- `ITimeoutConfig` - Timeout configuration
|
|
119
|
+
|
|
120
|
+
## Dependencies
|
|
121
|
+
|
|
122
|
+
This package has **no runtime dependencies**. It only has devDependencies for TypeScript compilation:
|
|
123
|
+
- `typescript` - TypeScript compiler
|
|
124
|
+
- `@types/node` - Node.js type definitions
|
|
125
|
+
- `axios` - For AxiosResponse type (dev dependency only)
|
|
126
|
+
|
|
127
|
+
## License
|
|
128
|
+
|
|
129
|
+
MIT
|
|
130
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthType.d.ts","sourceRoot":"","sources":["../../src/auth/AuthType.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authorization configuration - values needed for obtaining and refreshing tokens
|
|
3
|
+
* Returned by stores with actual values (not file paths)
|
|
4
|
+
*/
|
|
5
|
+
export interface IAuthorizationConfig {
|
|
6
|
+
/** UAA URL for token refresh */
|
|
7
|
+
uaaUrl: string;
|
|
8
|
+
/** UAA client ID */
|
|
9
|
+
uaaClientId: string;
|
|
10
|
+
/** UAA client secret */
|
|
11
|
+
uaaClientSecret: string;
|
|
12
|
+
/** Refresh token for token renewal (optional) */
|
|
13
|
+
refreshToken?: string;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=IAuthorizationConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAuthorizationConfig.d.ts","sourceRoot":"","sources":["../../src/auth/IAuthorizationConfig.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,oBAAoB;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,wBAAwB;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration - optional composition of authorization and connection configuration
|
|
3
|
+
* Can contain either authorization config, or connection config, or both
|
|
4
|
+
*/
|
|
5
|
+
import type { IAuthorizationConfig } from './IAuthorizationConfig';
|
|
6
|
+
import type { IConnectionConfig } from './IConnectionConfig';
|
|
7
|
+
export type IConfig = Partial<IAuthorizationConfig> & Partial<IConnectionConfig>;
|
|
8
|
+
//# sourceMappingURL=IConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IConfig.d.ts","sourceRoot":"","sources":["../../src/auth/IConfig.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC,oBAAoB,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Connection configuration - values needed for connecting to services
|
|
3
|
+
* Returned by stores with actual values (not file paths)
|
|
4
|
+
*/
|
|
5
|
+
export interface IConnectionConfig {
|
|
6
|
+
/** Service URL (SAP/ABAP/MCP URL) - undefined for XSUAA if not provided */
|
|
7
|
+
serviceUrl?: string;
|
|
8
|
+
/** Authorization token (JWT token) */
|
|
9
|
+
authorizationToken: string;
|
|
10
|
+
/** SAP client number (optional, for ABAP/BTP) */
|
|
11
|
+
sapClient?: string;
|
|
12
|
+
/** Language (optional, for ABAP/BTP) */
|
|
13
|
+
language?: string;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=IConnectionConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IConnectionConfig.d.ts","sourceRoot":"","sources":["../../src/auth/IConnectionConfig.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ISapConfig } from '../sap/ISapConfig';
|
|
2
|
+
import type { ISessionState } from '../storage/ISessionState';
|
|
3
|
+
import type { IAbapRequestOptions } from './IAbapRequestOptions';
|
|
4
|
+
/**
|
|
5
|
+
* Axios response type - using any to avoid dependency on axios package
|
|
6
|
+
* Consumers should use proper AxiosResponse type from axios
|
|
7
|
+
*/
|
|
8
|
+
export type AxiosResponse = any;
|
|
9
|
+
export interface IAbapConnection {
|
|
10
|
+
getConfig(): ISapConfig;
|
|
11
|
+
getBaseUrl(): Promise<string>;
|
|
12
|
+
getAuthHeaders(): Promise<Record<string, string>>;
|
|
13
|
+
getSessionId(): string | null;
|
|
14
|
+
setSessionType(type: "stateful" | "stateless"): void;
|
|
15
|
+
makeAdtRequest(options: IAbapRequestOptions): Promise<AxiosResponse>;
|
|
16
|
+
connect(): Promise<void>;
|
|
17
|
+
reset(): void;
|
|
18
|
+
getSessionState(): ISessionState | null;
|
|
19
|
+
setSessionState(state: ISessionState): void;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=IAbapConnection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAbapConnection.d.ts","sourceRoot":"","sources":["../../src/connection/IAbapConnection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC;AAEhC,MAAM,WAAW,eAAe;IAC9B,SAAS,IAAI,UAAU,CAAC;IACxB,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9B,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAClD,YAAY,IAAI,MAAM,GAAG,IAAI,CAAC;IAC9B,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,WAAW,GAAG,IAAI,CAAC;IACrD,cAAc,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACrE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,KAAK,IAAI,IAAI,CAAC;IACd,eAAe,IAAI,aAAa,GAAG,IAAI,CAAC;IACxC,eAAe,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;CAC7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAbapRequestOptions.d.ts","sourceRoot":"","sources":["../../src/connection/IAbapRequestOptions.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @mcp-abap-adt/interfaces
|
|
3
|
+
*
|
|
4
|
+
* Shared interfaces for MCP ABAP ADT packages
|
|
5
|
+
* All interfaces follow the convention of starting with 'I' prefix
|
|
6
|
+
*/
|
|
7
|
+
export type { IAuthorizationConfig } from './auth/IAuthorizationConfig';
|
|
8
|
+
export type { IConnectionConfig } from './auth/IConnectionConfig';
|
|
9
|
+
export type { IConfig } from './auth/IConfig';
|
|
10
|
+
export type { AuthType } from './auth/AuthType';
|
|
11
|
+
export type { ITokenProvider } from './token/ITokenProvider';
|
|
12
|
+
export type { ITokenProviderResult } from './token/ITokenProviderResult';
|
|
13
|
+
export type { ITokenProviderOptions } from './token/ITokenProviderOptions';
|
|
14
|
+
export type { ISessionStore } from './session/ISessionStore';
|
|
15
|
+
export type { IServiceKeyStore } from './serviceKey/IServiceKeyStore';
|
|
16
|
+
export type { IAbapConnection } from './connection/IAbapConnection';
|
|
17
|
+
export type { IAbapRequestOptions } from './connection/IAbapRequestOptions';
|
|
18
|
+
export type { ISapConfig } from './sap/ISapConfig';
|
|
19
|
+
export type { SapAuthType } from './sap/SapAuthType';
|
|
20
|
+
export type { ISessionStorage } from './storage/ISessionStorage';
|
|
21
|
+
export type { ISessionState } from './storage/ISessionState';
|
|
22
|
+
export type { ILogger } from './logging/ILogger';
|
|
23
|
+
export type { IValidatedAuthConfig } from './validation/IValidatedAuthConfig';
|
|
24
|
+
export type { IHeaderValidationResult } from './validation/IHeaderValidationResult';
|
|
25
|
+
export { AuthMethodPriority } from './validation/IValidatedAuthConfig';
|
|
26
|
+
export type { ITokenRefreshResult } from './utils/ITokenRefreshResult';
|
|
27
|
+
export type { ITimeoutConfig } from './utils/ITimeoutConfig';
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,YAAY,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,YAAY,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAG3E,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,YAAY,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGtE,YAAY,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,YAAY,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAG5E,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,YAAY,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAGjD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,YAAY,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAGvE,YAAY,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @mcp-abap-adt/interfaces
|
|
4
|
+
*
|
|
5
|
+
* Shared interfaces for MCP ABAP ADT packages
|
|
6
|
+
* All interfaces follow the convention of starting with 'I' prefix
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.AuthMethodPriority = void 0;
|
|
10
|
+
var IValidatedAuthConfig_1 = require("./validation/IValidatedAuthConfig");
|
|
11
|
+
Object.defineProperty(exports, "AuthMethodPriority", { enumerable: true, get: function () { return IValidatedAuthConfig_1.AuthMethodPriority; } });
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logger interface for connection layer
|
|
3
|
+
* Allows connection layer to be independent of specific logger implementation
|
|
4
|
+
*/
|
|
5
|
+
export interface ILogger {
|
|
6
|
+
/**
|
|
7
|
+
* Log informational message
|
|
8
|
+
*/
|
|
9
|
+
info(message: string, meta?: any): void;
|
|
10
|
+
/**
|
|
11
|
+
* Log error message
|
|
12
|
+
*/
|
|
13
|
+
error(message: string, meta?: any): void;
|
|
14
|
+
/**
|
|
15
|
+
* Log warning message
|
|
16
|
+
*/
|
|
17
|
+
warn(message: string, meta?: any): void;
|
|
18
|
+
/**
|
|
19
|
+
* Log debug message
|
|
20
|
+
*/
|
|
21
|
+
debug(message: string, meta?: any): void;
|
|
22
|
+
/**
|
|
23
|
+
* Log CSRF token operations
|
|
24
|
+
* @param action - Type of CSRF operation: "fetch", "retry", "success", or "error"
|
|
25
|
+
* @param message - Log message
|
|
26
|
+
* @param meta - Additional metadata
|
|
27
|
+
*/
|
|
28
|
+
csrfToken?(action: "fetch" | "retry" | "success" | "error", message: string, meta?: any): void;
|
|
29
|
+
/**
|
|
30
|
+
* Log TLS configuration
|
|
31
|
+
* @param rejectUnauthorized - Whether TLS certificate validation is enabled
|
|
32
|
+
*/
|
|
33
|
+
tlsConfig?(rejectUnauthorized: boolean): void;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=ILogger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ILogger.d.ts","sourceRoot":"","sources":["../../src/logging/ILogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IAExC;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IAEzC;;OAEG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IAExC;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IAEzC;;;;;OAKG;IACH,SAAS,CAAC,CACR,MAAM,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,EAC/C,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,GAAG,GACT,IAAI,CAAC;IAER;;;OAGG;IACH,SAAS,CAAC,CAAC,kBAAkB,EAAE,OAAO,GAAG,IAAI,CAAC;CAC/C"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SapAuthType } from './SapAuthType';
|
|
2
|
+
export interface ISapConfig {
|
|
3
|
+
url: string;
|
|
4
|
+
client?: string;
|
|
5
|
+
authType: SapAuthType;
|
|
6
|
+
username?: string;
|
|
7
|
+
password?: string;
|
|
8
|
+
jwtToken?: string;
|
|
9
|
+
refreshToken?: string;
|
|
10
|
+
uaaUrl?: string;
|
|
11
|
+
uaaClientId?: string;
|
|
12
|
+
uaaClientSecret?: string;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=ISapConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISapConfig.d.ts","sourceRoot":"","sources":["../../src/sap/ISapConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SapAuthType.d.ts","sourceRoot":"","sources":["../../src/sap/SapAuthType.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for storing and retrieving service keys
|
|
3
|
+
*
|
|
4
|
+
* Service keys contain UAA credentials and connection URLs.
|
|
5
|
+
*/
|
|
6
|
+
import type { IConfig } from '../auth/IConfig';
|
|
7
|
+
import type { IAuthorizationConfig } from '../auth/IAuthorizationConfig';
|
|
8
|
+
import type { IConnectionConfig } from '../auth/IConnectionConfig';
|
|
9
|
+
export interface IServiceKeyStore {
|
|
10
|
+
/**
|
|
11
|
+
* Get raw service key for destination
|
|
12
|
+
* @param destination Destination name (e.g., "TRIAL")
|
|
13
|
+
* @returns Service key object (implementation-specific) or null if not found
|
|
14
|
+
*/
|
|
15
|
+
getServiceKey(destination: string): Promise<IConfig | null>;
|
|
16
|
+
/**
|
|
17
|
+
* Get authorization configuration from service key
|
|
18
|
+
* Returns values needed for obtaining and refreshing tokens
|
|
19
|
+
* @param destination Destination name (e.g., "TRIAL")
|
|
20
|
+
* @returns IAuthorizationConfig with actual values or null if not found
|
|
21
|
+
*/
|
|
22
|
+
getAuthorizationConfig(destination: string): Promise<IAuthorizationConfig | null>;
|
|
23
|
+
/**
|
|
24
|
+
* Get connection configuration from service key
|
|
25
|
+
* Returns values needed for connecting to services
|
|
26
|
+
* @param destination Destination name (e.g., "TRIAL")
|
|
27
|
+
* @returns IConnectionConfig with actual values or null if not found
|
|
28
|
+
*/
|
|
29
|
+
getConnectionConfig(destination: string): Promise<IConnectionConfig | null>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=IServiceKeyStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IServiceKeyStore.d.ts","sourceRoot":"","sources":["../../src/serviceKey/IServiceKeyStore.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IAE5D;;;;;OAKG;IACH,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAElF;;;;;OAKG;IACH,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CAC7E"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for session stores - stores and retrieves session data
|
|
3
|
+
*
|
|
4
|
+
* Session stores handle loading, saving, and managing session data (tokens, configuration).
|
|
5
|
+
*/
|
|
6
|
+
import type { IConfig } from '../auth/IConfig';
|
|
7
|
+
import type { IAuthorizationConfig } from '../auth/IAuthorizationConfig';
|
|
8
|
+
import type { IConnectionConfig } from '../auth/IConnectionConfig';
|
|
9
|
+
export interface ISessionStore {
|
|
10
|
+
/**
|
|
11
|
+
* Load session configuration for destination
|
|
12
|
+
* Returns optional composition of IAuthorizationConfig and IConnectionConfig
|
|
13
|
+
* Can contain either authorization config, or connection config, or both
|
|
14
|
+
* @param destination Destination name (e.g., "TRIAL" or "mcp")
|
|
15
|
+
* @returns IConfig with actual values or null if not found
|
|
16
|
+
*/
|
|
17
|
+
loadSession(destination: string): Promise<IConfig | null>;
|
|
18
|
+
/**
|
|
19
|
+
* Save session configuration for destination
|
|
20
|
+
* Accepts IConfig (optional composition) or internal representation (for backward compatibility)
|
|
21
|
+
* @param destination Destination name (e.g., "TRIAL" or "mcp")
|
|
22
|
+
* @param config IConfig or internal session configuration to save
|
|
23
|
+
*/
|
|
24
|
+
saveSession(destination: string, config: IConfig | unknown): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Delete session for destination (optional)
|
|
27
|
+
* @param destination Destination name (e.g., "TRIAL" or "mcp")
|
|
28
|
+
*/
|
|
29
|
+
deleteSession?(destination: string): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Get authorization configuration with actual values (not file paths)
|
|
32
|
+
* Returns values needed for obtaining and refreshing tokens
|
|
33
|
+
* @param destination Destination name (e.g., "TRIAL" or "mcp")
|
|
34
|
+
* @returns IAuthorizationConfig with actual values or null if not found
|
|
35
|
+
*/
|
|
36
|
+
getAuthorizationConfig(destination: string): Promise<IAuthorizationConfig | null>;
|
|
37
|
+
/**
|
|
38
|
+
* Get connection configuration with actual values (not file paths)
|
|
39
|
+
* Returns values needed for connecting to services
|
|
40
|
+
* @param destination Destination name (e.g., "TRIAL" or "mcp")
|
|
41
|
+
* @returns IConnectionConfig with actual values or null if not found
|
|
42
|
+
*/
|
|
43
|
+
getConnectionConfig(destination: string): Promise<IConnectionConfig | null>;
|
|
44
|
+
/**
|
|
45
|
+
* Set authorization configuration
|
|
46
|
+
* Updates values needed for obtaining and refreshing tokens
|
|
47
|
+
* @param destination Destination name (e.g., "TRIAL" or "mcp")
|
|
48
|
+
* @param config IAuthorizationConfig with values to set
|
|
49
|
+
*/
|
|
50
|
+
setAuthorizationConfig(destination: string, config: IAuthorizationConfig): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Set connection configuration
|
|
53
|
+
* Updates values needed for connecting to services
|
|
54
|
+
* @param destination Destination name (e.g., "TRIAL" or "mcp")
|
|
55
|
+
* @param config IConnectionConfig with values to set
|
|
56
|
+
*/
|
|
57
|
+
setConnectionConfig(destination: string, config: IConnectionConfig): Promise<void>;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=ISessionStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISessionStore.d.ts","sourceRoot":"","sources":["../../src/session/ISessionStore.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IAE1D;;;;;OAKG;IACH,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3E;;;OAGG;IACH,aAAa,CAAC,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnD;;;;;OAKG;IACH,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAElF;;;;;OAKG;IACH,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAE5E;;;;;OAKG;IACH,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzF;;;;;OAKG;IACH,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session state interface for stateful connections
|
|
3
|
+
* Contains cookies and CSRF token that need to be preserved across requests
|
|
4
|
+
*/
|
|
5
|
+
export interface ISessionState {
|
|
6
|
+
cookies: string | null;
|
|
7
|
+
csrfToken: string | null;
|
|
8
|
+
cookieStore: Record<string, string>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=ISessionState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISessionState.d.ts","sourceRoot":"","sources":["../../src/storage/ISessionState.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for storing and retrieving session state
|
|
3
|
+
* Allows connection layer to persist session state (cookies, CSRF token) externally
|
|
4
|
+
*/
|
|
5
|
+
import type { ISessionState } from './ISessionState';
|
|
6
|
+
export interface ISessionStorage {
|
|
7
|
+
/**
|
|
8
|
+
* Save session state for a given session ID
|
|
9
|
+
* @param sessionId - Unique session identifier
|
|
10
|
+
* @param state - Session state to save
|
|
11
|
+
*/
|
|
12
|
+
save(sessionId: string, state: ISessionState): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Load session state for a given session ID
|
|
15
|
+
* @param sessionId - Unique session identifier
|
|
16
|
+
* @returns Session state or null if not found
|
|
17
|
+
*/
|
|
18
|
+
load(sessionId: string): Promise<ISessionState | null>;
|
|
19
|
+
/**
|
|
20
|
+
* Delete session state for a given session ID
|
|
21
|
+
* @param sessionId - Unique session identifier
|
|
22
|
+
*/
|
|
23
|
+
delete(sessionId: string): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=ISessionStorage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISessionStorage.d.ts","sourceRoot":"","sources":["../../src/storage/ISessionStorage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7D;;;;OAIG;IACH,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IAEvD;;;OAGG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1C"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Token Provider interface
|
|
3
|
+
*
|
|
4
|
+
* Converts IAuthorizationConfig to IConnectionConfig by obtaining tokens.
|
|
5
|
+
* Different implementations handle different authentication flows:
|
|
6
|
+
* - XSUAA: client_credentials grant type (no browser)
|
|
7
|
+
* - BTP/ABAP: browser-based OAuth2 or refresh token
|
|
8
|
+
*/
|
|
9
|
+
import type { IAuthorizationConfig } from '../auth/IAuthorizationConfig';
|
|
10
|
+
import type { ITokenProviderResult } from './ITokenProviderResult';
|
|
11
|
+
import type { ITokenProviderOptions } from './ITokenProviderOptions';
|
|
12
|
+
/**
|
|
13
|
+
* Interface for token providers
|
|
14
|
+
*
|
|
15
|
+
* Takes authorization configuration and returns connection configuration with token.
|
|
16
|
+
*/
|
|
17
|
+
export interface ITokenProvider {
|
|
18
|
+
/**
|
|
19
|
+
* Get connection configuration with token from authorization configuration
|
|
20
|
+
* @param authConfig Authorization configuration (UAA credentials, optional refresh token)
|
|
21
|
+
* @param options Optional provider-specific options (e.g., browser type for BTP)
|
|
22
|
+
* @returns Promise that resolves to connection configuration with authorization token and optional refresh token
|
|
23
|
+
*/
|
|
24
|
+
getConnectionConfig(authConfig: IAuthorizationConfig, options?: ITokenProviderOptions): Promise<ITokenProviderResult>;
|
|
25
|
+
/**
|
|
26
|
+
* Validate JWT token by testing connection to service
|
|
27
|
+
* @param token JWT token to validate
|
|
28
|
+
* @param serviceUrl Service URL (optional, for services that require URL validation)
|
|
29
|
+
* @returns Promise that resolves to true if token is valid, false otherwise
|
|
30
|
+
*/
|
|
31
|
+
validateToken?(token: string, serviceUrl?: string): Promise<boolean>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=ITokenProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITokenProvider.d.ts","sourceRoot":"","sources":["../../src/token/ITokenProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAErE;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,mBAAmB,CACjB,UAAU,EAAE,oBAAoB,EAChC,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAEjC;;;;;OAKG;IACH,aAAa,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACtE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Token Provider interface
|
|
4
|
+
*
|
|
5
|
+
* Converts IAuthorizationConfig to IConnectionConfig by obtaining tokens.
|
|
6
|
+
* Different implementations handle different authentication flows:
|
|
7
|
+
* - XSUAA: client_credentials grant type (no browser)
|
|
8
|
+
* - BTP/ABAP: browser-based OAuth2 or refresh token
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for token providers
|
|
3
|
+
*/
|
|
4
|
+
import type { ILogger } from '../logging/ILogger';
|
|
5
|
+
export interface ITokenProviderOptions {
|
|
6
|
+
/** Browser type for browser-based authentication (chrome, edge, firefox, system, none) */
|
|
7
|
+
browser?: string;
|
|
8
|
+
/** Logger instance for logging */
|
|
9
|
+
logger?: ILogger;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=ITokenProviderOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITokenProviderOptions.d.ts","sourceRoot":"","sources":["../../src/token/ITokenProviderOptions.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,WAAW,qBAAqB;IACpC,0FAA0F;IAC1F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result from token provider
|
|
3
|
+
*/
|
|
4
|
+
import type { IConnectionConfig } from '../auth/IConnectionConfig';
|
|
5
|
+
export interface ITokenProviderResult {
|
|
6
|
+
/** Connection configuration with authorization token */
|
|
7
|
+
connectionConfig: IConnectionConfig;
|
|
8
|
+
/** Refresh token (optional, for BTP/ABAP) */
|
|
9
|
+
refreshToken?: string;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=ITokenProviderResult.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITokenProviderResult.d.ts","sourceRoot":"","sources":["../../src/token/ITokenProviderResult.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,gBAAgB,EAAE,iBAAiB,CAAC;IACpC,6CAA6C;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITimeoutConfig.d.ts","sourceRoot":"","sources":["../../src/utils/ITimeoutConfig.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITokenRefreshResult.d.ts","sourceRoot":"","sources":["../../src/utils/ITokenRefreshResult.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Header validation result
|
|
3
|
+
*/
|
|
4
|
+
import type { IValidatedAuthConfig } from './IValidatedAuthConfig';
|
|
5
|
+
export interface IHeaderValidationResult {
|
|
6
|
+
/** Is configuration valid? */
|
|
7
|
+
isValid: boolean;
|
|
8
|
+
/** Validated authentication configuration */
|
|
9
|
+
config?: IValidatedAuthConfig;
|
|
10
|
+
/** Validation errors */
|
|
11
|
+
errors: string[];
|
|
12
|
+
/** Warnings */
|
|
13
|
+
warnings: string[];
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=IHeaderValidationResult.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IHeaderValidationResult.d.ts","sourceRoot":"","sources":["../../src/validation/IHeaderValidationResult.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnE,MAAM,WAAW,uBAAuB;IACtC,8BAA8B;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,wBAAwB;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,eAAe;IACf,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validated authentication configuration
|
|
3
|
+
*/
|
|
4
|
+
import type { AuthType } from '../auth/AuthType';
|
|
5
|
+
/**
|
|
6
|
+
* Authentication method priority
|
|
7
|
+
* Higher number = higher priority
|
|
8
|
+
*/
|
|
9
|
+
export declare enum AuthMethodPriority {
|
|
10
|
+
SAP_DESTINATION = 4,// x-sap-destination (uses AuthBroker, JWT only)
|
|
11
|
+
MCP_DESTINATION = 3,// x-mcp-destination + x-sap-auth-type=jwt (uses AuthBroker)
|
|
12
|
+
DIRECT_JWT = 2,// x-sap-jwt-token + x-sap-auth-type=jwt
|
|
13
|
+
BASIC = 1,// x-sap-login + x-sap-password + x-sap-auth-type=basic
|
|
14
|
+
NONE = 0
|
|
15
|
+
}
|
|
16
|
+
export interface IValidatedAuthConfig {
|
|
17
|
+
/** Authentication method priority */
|
|
18
|
+
priority: AuthMethodPriority;
|
|
19
|
+
/** Authentication type */
|
|
20
|
+
authType: AuthType;
|
|
21
|
+
/** SAP URL */
|
|
22
|
+
sapUrl: string;
|
|
23
|
+
/** SAP Client (optional) */
|
|
24
|
+
sapClient?: string;
|
|
25
|
+
/** Destination name (for destination-based auth: x-sap-destination or x-mcp-destination) */
|
|
26
|
+
destination?: string;
|
|
27
|
+
/** JWT token (for direct JWT auth) */
|
|
28
|
+
jwtToken?: string;
|
|
29
|
+
/** Refresh token (optional, for JWT auth) */
|
|
30
|
+
refreshToken?: string;
|
|
31
|
+
/** UAA URL (optional, for JWT auth) */
|
|
32
|
+
uaaUrl?: string;
|
|
33
|
+
/** UAA Client ID (optional, for JWT auth) */
|
|
34
|
+
uaaClientId?: string;
|
|
35
|
+
/** UAA Client Secret (optional, for JWT auth) */
|
|
36
|
+
uaaClientSecret?: string;
|
|
37
|
+
/** Username (for basic auth) */
|
|
38
|
+
username?: string;
|
|
39
|
+
/** Password (for basic auth) */
|
|
40
|
+
password?: string;
|
|
41
|
+
/** Validation errors (if any) */
|
|
42
|
+
errors: string[];
|
|
43
|
+
/** Warnings (if any) */
|
|
44
|
+
warnings: string[];
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=IValidatedAuthConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IValidatedAuthConfig.d.ts","sourceRoot":"","sources":["../../src/validation/IValidatedAuthConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;GAGG;AACH,oBAAY,kBAAkB;IAC5B,eAAe,IAAI,CAAK,gDAAgD;IACxE,eAAe,IAAI,CAAK,4DAA4D;IACpF,UAAU,IAAI,CAAU,wCAAwC;IAChE,KAAK,IAAI,CAAe,uDAAuD;IAC/E,IAAI,IAAI;CACT;AAED,MAAM,WAAW,oBAAoB;IACnC,qCAAqC;IACrC,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,0BAA0B;IAC1B,QAAQ,EAAE,QAAQ,CAAC;IACnB,cAAc;IACd,MAAM,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4FAA4F;IAC5F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iDAAiD;IACjD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,wBAAwB;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthMethodPriority = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Authentication method priority
|
|
6
|
+
* Higher number = higher priority
|
|
7
|
+
*/
|
|
8
|
+
var AuthMethodPriority;
|
|
9
|
+
(function (AuthMethodPriority) {
|
|
10
|
+
AuthMethodPriority[AuthMethodPriority["SAP_DESTINATION"] = 4] = "SAP_DESTINATION";
|
|
11
|
+
AuthMethodPriority[AuthMethodPriority["MCP_DESTINATION"] = 3] = "MCP_DESTINATION";
|
|
12
|
+
AuthMethodPriority[AuthMethodPriority["DIRECT_JWT"] = 2] = "DIRECT_JWT";
|
|
13
|
+
AuthMethodPriority[AuthMethodPriority["BASIC"] = 1] = "BASIC";
|
|
14
|
+
AuthMethodPriority[AuthMethodPriority["NONE"] = 0] = "NONE"; // No valid authentication
|
|
15
|
+
})(AuthMethodPriority || (exports.AuthMethodPriority = AuthMethodPriority = {}));
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mcp-abap-adt/interfaces",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared interfaces for MCP ABAP ADT packages",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"README.md",
|
|
10
|
+
"CHANGELOG.md",
|
|
11
|
+
"LICENSE"
|
|
12
|
+
],
|
|
13
|
+
"keywords": [
|
|
14
|
+
"abap",
|
|
15
|
+
"sap",
|
|
16
|
+
"adt",
|
|
17
|
+
"interfaces",
|
|
18
|
+
"types",
|
|
19
|
+
"mcp",
|
|
20
|
+
"abap-adt"
|
|
21
|
+
],
|
|
22
|
+
"author": "Oleksii Kyslytsia <oleksij.kyslytsja@gmail.com>",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"homepage": "https://github.com/fr0ster/mcp-abap-adt-interfaces#readme",
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/fr0ster/mcp-abap-adt-interfaces/issues"
|
|
27
|
+
},
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/fr0ster/mcp-abap-adt-interfaces.git"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"clean": "rm -rf dist tsconfig.tsbuildinfo",
|
|
37
|
+
"build": "npm run clean --silent && npx tsc -p tsconfig.json",
|
|
38
|
+
"build:fast": "npx tsc -p tsconfig.json",
|
|
39
|
+
"test:check": "npx tsc --noEmit",
|
|
40
|
+
"prepublishOnly": "npm run build"
|
|
41
|
+
},
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=18.0.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/node": "^24.2.1",
|
|
47
|
+
"axios": "^1.11.0",
|
|
48
|
+
"typescript": "^5.9.2"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|