catalyst-relay 0.4.5 → 0.5.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.mts CHANGED
@@ -91,6 +91,31 @@ interface ClientConfig {
91
91
  autoRefresh?: AutoRefreshConfig;
92
92
  }
93
93
 
94
+ /**
95
+ * Result type for error handling (Go-style tuples)
96
+ *
97
+ * Usage:
98
+ * const [data, error] = await someFunction();
99
+ * if (error) {
100
+ * console.error(error);
101
+ * return;
102
+ * }
103
+ * // data is guaranteed non-null
104
+ */
105
+ type Result<T, E extends Error = Error> = [T, null] | [null, E];
106
+ /**
107
+ * Async result type alias for convenience
108
+ */
109
+ type AsyncResult<T, E extends Error = Error> = Promise<Result<T, E>>;
110
+ /**
111
+ * Create a success result
112
+ */
113
+ declare function ok<T>(value: T): Result<T, never>;
114
+ /**
115
+ * Create an error result
116
+ */
117
+ declare function err<E extends Error = Error>(error: E): Result<never, E>;
118
+
94
119
  /**
95
120
  * Reference to an SAP development object
96
121
  */
@@ -159,31 +184,6 @@ type ApiResponse<T> = SuccessResponse<T> | ErrorResponse;
159
184
  */
160
185
  type ErrorCode = 'AUTH_FAILED' | 'SESSION_EXPIRED' | 'SESSION_NOT_FOUND' | 'CSRF_INVALID' | 'OBJECT_LOCKED' | 'OBJECT_NOT_FOUND' | 'TRANSPORT_REQUIRED' | 'ACTIVATION_FAILED' | 'VALIDATION_ERROR' | 'NETWORK_ERROR' | 'UNKNOWN_ERROR';
161
186
 
162
- /**
163
- * Result type for error handling (Go-style tuples)
164
- *
165
- * Usage:
166
- * const [data, error] = await someFunction();
167
- * if (error) {
168
- * console.error(error);
169
- * return;
170
- * }
171
- * // data is guaranteed non-null
172
- */
173
- type Result<T, E extends Error = Error> = [T, null] | [null, E];
174
- /**
175
- * Async result type alias for convenience
176
- */
177
- type AsyncResult<T, E extends Error = Error> = Promise<Result<T, E>>;
178
- /**
179
- * Create a success result
180
- */
181
- declare function ok<T>(value: T): Result<T, never>;
182
- /**
183
- * Create an error result
184
- */
185
- declare function err<E extends Error = Error>(error: E): Result<never, E>;
186
-
187
187
  /**
188
188
  * Session management type definitions
189
189
  */
@@ -199,6 +199,25 @@ interface Session {
199
199
  /** Session expiration timestamp */
200
200
  expiresAt: number;
201
201
  }
202
+ /**
203
+ * Serializable session state for export/import across processes
204
+ *
205
+ * Used to transfer authenticated session state from daemon to CLI processes,
206
+ * allowing session reuse without re-authentication.
207
+ */
208
+ interface ExportableSessionState {
209
+ csrfToken: string;
210
+ session: Session;
211
+ cookies: Array<{
212
+ name: string;
213
+ value: string;
214
+ }>;
215
+ authType: AuthType;
216
+ ssoCertPaths?: {
217
+ fullChainPath: string;
218
+ keyPath: string;
219
+ };
220
+ }
202
221
 
203
222
  /**
204
223
  * Session Refresh via Reentrance Ticket
@@ -517,6 +536,8 @@ interface ADTClient {
517
536
  login(): AsyncResult<Session>;
518
537
  logout(): AsyncResult<void>;
519
538
  refreshSession(): AsyncResult<RefreshResult>;
539
+ exportSessionState(): ExportableSessionState | null;
540
+ importSessionState(state: ExportableSessionState): AsyncResult<boolean>;
520
541
  read(objects: ObjectRef[]): AsyncResult<ObjectWithContent[]>;
521
542
  create(object: ObjectContent, packageName: string, transport?: string): AsyncResult<void>;
522
543
  update(object: ObjectContent, transport?: string): AsyncResult<void>;
@@ -537,6 +558,13 @@ interface ADTClient {
537
558
  gitDiff(objects: ObjectContent[]): AsyncResult<DiffResult[]>;
538
559
  getObjectConfig(): ObjectConfig[];
539
560
  }
561
+
562
+ /**
563
+ * ADT Client Module
564
+ *
565
+ * Exports the ADTClient interface and createClient factory function.
566
+ */
567
+
540
568
  declare function createClient(config: ClientConfig): Result<ADTClient, Error>;
541
569
 
542
- export { type ADTClient, type ActivationMessage, type ActivationResult, type Aggregation, type ApiResponse, type AsyncResult, type AuthConfig, type AuthType, type BasicAuthConfig, type BasicFilter, type BetweenFilter, type ClientConfig, type ColumnInfo, type DataFrame, type DataPreviewQuery, type Dependency, type DiffResult, type DistinctResult, type ErrorCode, type ErrorResponse, type FolderNode, type ListFilter, type ObjectConfig, type ObjectContent, type ObjectMetadata, type ObjectNode, type ObjectRef, type ObjectWithContent, type Package, type PackageNode, type Parameter, type PreviewSQL, type QueryFilter, type Result, type SamlAuthConfig, type SearchResult, type Session, type Sorting, type SsoAuthConfig, type SuccessResponse, type Transport, type TransportConfig, type TreeQuery, type TreeResponse, type UpsertResult, buildSQLQuery, createClient, err, ok };
570
+ export { type ADTClient, type ActivationMessage, type ActivationResult, type Aggregation, type ApiResponse, type AsyncResult, type AuthConfig, type AuthType, type BasicAuthConfig, type BasicFilter, type BetweenFilter, type ClientConfig, type ColumnInfo, type DataFrame, type DataPreviewQuery, type Dependency, type DiffResult, type DistinctResult, type ErrorCode, type ErrorResponse, type ExportableSessionState, type FolderNode, type ListFilter, type ObjectConfig, type ObjectContent, type ObjectMetadata, type ObjectNode, type ObjectRef, type ObjectWithContent, type Package, type PackageNode, type Parameter, type PreviewSQL, type QueryFilter, type Result, type SamlAuthConfig, type SearchResult, type Session, type Sorting, type SsoAuthConfig, type SuccessResponse, type Transport, type TransportConfig, type TreeQuery, type TreeResponse, type UpsertResult, buildSQLQuery, createClient, err, ok };
package/dist/index.d.ts CHANGED
@@ -91,6 +91,31 @@ interface ClientConfig {
91
91
  autoRefresh?: AutoRefreshConfig;
92
92
  }
93
93
 
94
+ /**
95
+ * Result type for error handling (Go-style tuples)
96
+ *
97
+ * Usage:
98
+ * const [data, error] = await someFunction();
99
+ * if (error) {
100
+ * console.error(error);
101
+ * return;
102
+ * }
103
+ * // data is guaranteed non-null
104
+ */
105
+ type Result<T, E extends Error = Error> = [T, null] | [null, E];
106
+ /**
107
+ * Async result type alias for convenience
108
+ */
109
+ type AsyncResult<T, E extends Error = Error> = Promise<Result<T, E>>;
110
+ /**
111
+ * Create a success result
112
+ */
113
+ declare function ok<T>(value: T): Result<T, never>;
114
+ /**
115
+ * Create an error result
116
+ */
117
+ declare function err<E extends Error = Error>(error: E): Result<never, E>;
118
+
94
119
  /**
95
120
  * Reference to an SAP development object
96
121
  */
@@ -159,31 +184,6 @@ type ApiResponse<T> = SuccessResponse<T> | ErrorResponse;
159
184
  */
160
185
  type ErrorCode = 'AUTH_FAILED' | 'SESSION_EXPIRED' | 'SESSION_NOT_FOUND' | 'CSRF_INVALID' | 'OBJECT_LOCKED' | 'OBJECT_NOT_FOUND' | 'TRANSPORT_REQUIRED' | 'ACTIVATION_FAILED' | 'VALIDATION_ERROR' | 'NETWORK_ERROR' | 'UNKNOWN_ERROR';
161
186
 
162
- /**
163
- * Result type for error handling (Go-style tuples)
164
- *
165
- * Usage:
166
- * const [data, error] = await someFunction();
167
- * if (error) {
168
- * console.error(error);
169
- * return;
170
- * }
171
- * // data is guaranteed non-null
172
- */
173
- type Result<T, E extends Error = Error> = [T, null] | [null, E];
174
- /**
175
- * Async result type alias for convenience
176
- */
177
- type AsyncResult<T, E extends Error = Error> = Promise<Result<T, E>>;
178
- /**
179
- * Create a success result
180
- */
181
- declare function ok<T>(value: T): Result<T, never>;
182
- /**
183
- * Create an error result
184
- */
185
- declare function err<E extends Error = Error>(error: E): Result<never, E>;
186
-
187
187
  /**
188
188
  * Session management type definitions
189
189
  */
@@ -199,6 +199,25 @@ interface Session {
199
199
  /** Session expiration timestamp */
200
200
  expiresAt: number;
201
201
  }
202
+ /**
203
+ * Serializable session state for export/import across processes
204
+ *
205
+ * Used to transfer authenticated session state from daemon to CLI processes,
206
+ * allowing session reuse without re-authentication.
207
+ */
208
+ interface ExportableSessionState {
209
+ csrfToken: string;
210
+ session: Session;
211
+ cookies: Array<{
212
+ name: string;
213
+ value: string;
214
+ }>;
215
+ authType: AuthType;
216
+ ssoCertPaths?: {
217
+ fullChainPath: string;
218
+ keyPath: string;
219
+ };
220
+ }
202
221
 
203
222
  /**
204
223
  * Session Refresh via Reentrance Ticket
@@ -517,6 +536,8 @@ interface ADTClient {
517
536
  login(): AsyncResult<Session>;
518
537
  logout(): AsyncResult<void>;
519
538
  refreshSession(): AsyncResult<RefreshResult>;
539
+ exportSessionState(): ExportableSessionState | null;
540
+ importSessionState(state: ExportableSessionState): AsyncResult<boolean>;
520
541
  read(objects: ObjectRef[]): AsyncResult<ObjectWithContent[]>;
521
542
  create(object: ObjectContent, packageName: string, transport?: string): AsyncResult<void>;
522
543
  update(object: ObjectContent, transport?: string): AsyncResult<void>;
@@ -537,6 +558,13 @@ interface ADTClient {
537
558
  gitDiff(objects: ObjectContent[]): AsyncResult<DiffResult[]>;
538
559
  getObjectConfig(): ObjectConfig[];
539
560
  }
561
+
562
+ /**
563
+ * ADT Client Module
564
+ *
565
+ * Exports the ADTClient interface and createClient factory function.
566
+ */
567
+
540
568
  declare function createClient(config: ClientConfig): Result<ADTClient, Error>;
541
569
 
542
- export { type ADTClient, type ActivationMessage, type ActivationResult, type Aggregation, type ApiResponse, type AsyncResult, type AuthConfig, type AuthType, type BasicAuthConfig, type BasicFilter, type BetweenFilter, type ClientConfig, type ColumnInfo, type DataFrame, type DataPreviewQuery, type Dependency, type DiffResult, type DistinctResult, type ErrorCode, type ErrorResponse, type FolderNode, type ListFilter, type ObjectConfig, type ObjectContent, type ObjectMetadata, type ObjectNode, type ObjectRef, type ObjectWithContent, type Package, type PackageNode, type Parameter, type PreviewSQL, type QueryFilter, type Result, type SamlAuthConfig, type SearchResult, type Session, type Sorting, type SsoAuthConfig, type SuccessResponse, type Transport, type TransportConfig, type TreeQuery, type TreeResponse, type UpsertResult, buildSQLQuery, createClient, err, ok };
570
+ export { type ADTClient, type ActivationMessage, type ActivationResult, type Aggregation, type ApiResponse, type AsyncResult, type AuthConfig, type AuthType, type BasicAuthConfig, type BasicFilter, type BetweenFilter, type ClientConfig, type ColumnInfo, type DataFrame, type DataPreviewQuery, type Dependency, type DiffResult, type DistinctResult, type ErrorCode, type ErrorResponse, type ExportableSessionState, type FolderNode, type ListFilter, type ObjectConfig, type ObjectContent, type ObjectMetadata, type ObjectNode, type ObjectRef, type ObjectWithContent, type Package, type PackageNode, type Parameter, type PreviewSQL, type QueryFilter, type Result, type SamlAuthConfig, type SearchResult, type Session, type Sorting, type SsoAuthConfig, type SuccessResponse, type Transport, type TransportConfig, type TreeQuery, type TreeResponse, type UpsertResult, buildSQLQuery, createClient, err, ok };