catalyst-relay 0.5.14 → 0.6.1

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/README.md CHANGED
@@ -170,6 +170,7 @@ curl -X POST http://localhost:3000/login \
170
170
  - Query table/view data with filtering and sorting
171
171
  - Get distinct column values
172
172
  - Count rows
173
+ - Run freestyle OpenSQL queries with per-request row limits and timeouts
173
174
 
174
175
  ### Search
175
176
  - Search objects by name pattern
@@ -222,6 +223,7 @@ curl -X POST http://localhost:3000/login \
222
223
  | `previewData(query)` | Query table/view |
223
224
  | `getDistinctValues(name, parameters, column, type?)` | Distinct values with counts |
224
225
  | `countRows(name, type, parameters?)` | Row count |
226
+ | `freestyleQuery(sqlQuery, limit?, timeout?)` | Run arbitrary read-only OpenSQL; optional row limit and per-request timeout (ms) |
225
227
  | `search(query, options?)` | Search objects (`{ types?, includePackages? }`) |
226
228
  | `whereUsed(object)` | Find dependencies |
227
229
  | `gitDiff(objects)` | Compare with server |
@@ -290,6 +292,18 @@ const [data, error] = await client.previewData({
290
292
  });
291
293
  ```
292
294
 
295
+ #### Freestyle OpenSQL Query
296
+
297
+ For cases where the structured preview isn't enough, run an arbitrary read-only `SELECT`. This is a power-user surface — the query is not parsed or restricted beyond an optional row `limit` (max 50,000) and per-request `timeout` in milliseconds (max 5 minutes), so callers are responsible for deciding who may issue arbitrary SQL.
298
+
299
+ ```typescript
300
+ const [data, error] = await client.freestyleQuery(
301
+ "SELECT carrid, connid, fldate FROM sflight WHERE carrid = 'LH'",
302
+ 500, // optional row limit (default 100)
303
+ 60000 // optional per-request timeout in ms
304
+ );
305
+ ```
306
+
293
307
  ## Server Mode API Reference
294
308
 
295
309
  ### HTTP Endpoints
@@ -317,6 +331,7 @@ const [data, error] = await client.previewData({
317
331
  | POST | `/preview/data` | Query table/view data |
318
332
  | POST | `/preview/distinct` | Get distinct values |
319
333
  | POST | `/preview/count` | Count rows |
334
+ | POST | `/preview/freestyle` | Run arbitrary read-only OpenSQL |
320
335
  | POST | `/search/:query` | Search objects |
321
336
  | POST | `/where-used` | Find dependencies |
322
337
  | POST | `/git-diff` | Compare with server |
@@ -354,6 +369,19 @@ curl -X POST http://localhost:3000/preview/data \
354
369
  }'
355
370
  ```
356
371
 
372
+ #### Freestyle OpenSQL Query
373
+
374
+ ```bash
375
+ curl -X POST http://localhost:3000/preview/freestyle \
376
+ -H "Content-Type: application/json" \
377
+ -H "x-session-id: abc123" \
378
+ -d '{
379
+ "sqlQuery": "SELECT carrid, connid, fldate FROM sflight WHERE carrid = '\''LH'\''",
380
+ "limit": 500,
381
+ "timeout": 60000
382
+ }'
383
+ ```
384
+
357
385
  #### Search Objects
358
386
 
359
387
  ```bash
@@ -497,4 +525,4 @@ Egan Bosch
497
525
 
498
526
  ---
499
527
 
500
- *Last updated: v0.5.13*
528
+ *Last updated: v0.5.14*
package/dist/index.d.mts CHANGED
@@ -125,6 +125,15 @@ interface ObjectRef {
125
125
  /** File extension indicating object type (e.g., 'asddls') */
126
126
  extension: string;
127
127
  }
128
+ /**
129
+ * Behavior definition implementation type.
130
+ *
131
+ * Only managed RAP is supported today; the enum exists so callers specify the
132
+ * type explicitly and so it can be widened (unmanaged, abstract, projection) later.
133
+ */
134
+ declare enum BehaviorImplementationType {
135
+ Managed = "Managed"
136
+ }
128
137
  /**
129
138
  * Object with content for create/update operations
130
139
  */
@@ -133,6 +142,8 @@ interface ObjectContent extends ObjectRef {
133
142
  content: string;
134
143
  /** Optional description for transport */
135
144
  description?: string;
145
+ /** Implementation type for behavior definitions (.asbdef). Defaults to Managed. */
146
+ implementationType?: BehaviorImplementationType;
136
147
  }
137
148
  /**
138
149
  * Tree discovery query for hierarchical browsing
@@ -257,6 +268,10 @@ interface ObjectConfig {
257
268
  dpEndpoint?: string;
258
269
  /** Data preview parameter name (if supported) */
259
270
  dpParam?: string;
271
+ /** Extra attributes to add to the root element on create (e.g., srvd:srvdSourceType) */
272
+ rootAttributes?: Record<string, string>;
273
+ /** Inject an <adtcore:adtTemplate> block carrying the implementation type (behavior definitions) */
274
+ requiresImplementationType?: boolean;
260
275
  }
261
276
  /**
262
277
  * Result of upsert operation
@@ -307,6 +322,18 @@ interface ActivationMessage {
307
322
  line?: number;
308
323
  column?: number;
309
324
  }
325
+ /**
326
+ * A pre-resolved object reference for activation.
327
+ *
328
+ * Used for objects that aren't source-file-backed (e.g. service bindings) and so
329
+ * can't be resolved through the extension registry.
330
+ */
331
+ interface ActivationReference {
332
+ uri: string;
333
+ type: string;
334
+ name: string;
335
+ extension: string;
336
+ }
310
337
 
311
338
  /**
312
339
  * Where-Used — Find object dependencies
@@ -557,6 +584,20 @@ interface SearchOptions {
557
584
  includePackages?: boolean;
558
585
  }
559
586
 
587
+ /**
588
+ * Class Include — write a global class's local-source include (CCDEF/CCIMP/CCMAC/CCAU)
589
+ */
590
+
591
+ /**
592
+ * Local-source include sections of a global ABAP class.
593
+ *
594
+ * - definitions → "Class-relevant Local Definitions" (CCDEF)
595
+ * - implementations → "Local Types" (CCIMP) — where RAP behaviour handlers live
596
+ * - macros → "Macros" (CCMAC)
597
+ * - testclasses → "Test Classes" (CCAU)
598
+ */
599
+ type ClassIncludeType = 'definitions' | 'implementations' | 'macros' | 'testclasses';
600
+
560
601
  /**
561
602
  * Create Transport — Create a new transport request for a package
562
603
  */
@@ -640,6 +681,43 @@ interface DiffResult {
640
681
  diffs: DiffHunk[];
641
682
  }
642
683
 
684
+ /** Binding protocol. Only OData is supported today. */
685
+ type ServiceBindingType = 'ODATA';
686
+ /** Binding version. Only OData V4 (category 1) is supported today. */
687
+ type ServiceBindingVersion = 'V4';
688
+ /**
689
+ * Options for creating a service binding
690
+ */
691
+ interface CreateServiceBindingOptions {
692
+ /** Name of the service binding to create (e.g., 'ZBEACON_DOCS_O5') */
693
+ bindingName: string;
694
+ /** Name of the backing service definition (e.g., 'ZBEACON_DOCS_API') */
695
+ serviceDefinition: string;
696
+ /** Target package */
697
+ packageName: string;
698
+ /** Optional description */
699
+ description?: string;
700
+ /** Binding protocol (default: 'ODATA') */
701
+ bindingType?: ServiceBindingType;
702
+ /** Binding version (default: 'V4') */
703
+ bindingVersion?: ServiceBindingVersion;
704
+ /** Transport request (required for non-$TMP packages) */
705
+ transport?: string;
706
+ /** Whether to publish the binding after activation (default: true) */
707
+ publish?: boolean;
708
+ }
709
+ /**
710
+ * Result of creating a service binding
711
+ */
712
+ interface ServiceBindingResult {
713
+ name: string;
714
+ serviceDefinition: string;
715
+ created: boolean;
716
+ activation: ActivationResult[];
717
+ published: boolean;
718
+ publishMessage?: string;
719
+ }
720
+
643
721
  /**
644
722
  * ADT Client Core Implementation
645
723
  *
@@ -664,6 +742,7 @@ interface ADTClient {
664
742
  read(objects: ObjectRef[]): AsyncResult<ObjectWithContent[]>;
665
743
  create(object: ObjectContent, packageName: string, transport?: string): AsyncResult<void>;
666
744
  update(object: ObjectContent, transport?: string): AsyncResult<void>;
745
+ writeClassInclude(className: string, includeType: ClassIncludeType, source: string, transport?: string): AsyncResult<void>;
667
746
  upsert(objects: ObjectContent[], packageName: string, transport?: string): AsyncResult<UpsertResult[]>;
668
747
  activate(objects: ObjectRef[]): AsyncResult<ActivationResult[]>;
669
748
  checkSyntax(objects: ObjectRef[]): AsyncResult<CheckResult[]>;
@@ -685,6 +764,8 @@ interface ADTClient {
685
764
  removeFromTransport(transportId: string, objectName: string): AsyncResult<void>;
686
765
  viewTransportObjects(transportId: string): AsyncResult<TaskContents[]>;
687
766
  gitDiff(objects: ObjectContent[]): AsyncResult<DiffResult[]>;
767
+ createServiceBinding(options: CreateServiceBindingOptions): AsyncResult<ServiceBindingResult>;
768
+ deleteServiceBinding(bindingName: string, transport?: string): AsyncResult<void>;
688
769
  getObjectConfig(): ObjectConfig[];
689
770
  }
690
771
 
@@ -710,4 +791,4 @@ declare function activateLogging(): void;
710
791
  */
711
792
  declare function deactivateLogging(): void;
712
793
 
713
- export { type ADTClient, type ActivationMessage, type ActivationResult, type Aggregation, type ApiResponse, type AsyncResult, type AuthConfig, type AuthType, type BasicAuthConfig, type BasicFilter, type BetweenFilter, type CheckResult, type ClientConfig, type ColumnInfo, type DataFrame, type DataPreviewQuery, type DeleteResult, type Dependency, type DiffHunk, type DiffResult, type DistinctResult, type ErrorCode, type ErrorResponse, type ExportableSessionState, type ExternalReference, ExternalReferencesError, type FolderNode, type GetPackagesOptions, type InactiveEntry, type InactiveObject, type InactiveRef, type InactiveTransport, type ListFilter, type ModifiedDiffHunk, 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 SearchOptions, type SearchResult, type Session, type SimpleDiffHunk, type Sorting, type SsoAuthConfig, type SuccessResponse, type TaskContents, type Transport, type TransportConfig, type TransportObject, type TreeQuery, type TreeResponse, type UpsertResult, activateLogging, buildSQLQuery, createClient, deactivateLogging, err, ok };
794
+ export { type ADTClient, type ActivationMessage, type ActivationReference, type ActivationResult, type Aggregation, type ApiResponse, type AsyncResult, type AuthConfig, type AuthType, type BasicAuthConfig, type BasicFilter, BehaviorImplementationType, type BetweenFilter, type CheckResult, type ClassIncludeType, type ClientConfig, type ColumnInfo, type CreateServiceBindingOptions, type DataFrame, type DataPreviewQuery, type DeleteResult, type Dependency, type DiffHunk, type DiffResult, type DistinctResult, type ErrorCode, type ErrorResponse, type ExportableSessionState, type ExternalReference, ExternalReferencesError, type FolderNode, type GetPackagesOptions, type InactiveEntry, type InactiveObject, type InactiveRef, type InactiveTransport, type ListFilter, type ModifiedDiffHunk, 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 SearchOptions, type SearchResult, type ServiceBindingResult, type ServiceBindingType, type ServiceBindingVersion, type Session, type SimpleDiffHunk, type Sorting, type SsoAuthConfig, type SuccessResponse, type TaskContents, type Transport, type TransportConfig, type TransportObject, type TreeQuery, type TreeResponse, type UpsertResult, activateLogging, buildSQLQuery, createClient, deactivateLogging, err, ok };
package/dist/index.d.ts CHANGED
@@ -125,6 +125,15 @@ interface ObjectRef {
125
125
  /** File extension indicating object type (e.g., 'asddls') */
126
126
  extension: string;
127
127
  }
128
+ /**
129
+ * Behavior definition implementation type.
130
+ *
131
+ * Only managed RAP is supported today; the enum exists so callers specify the
132
+ * type explicitly and so it can be widened (unmanaged, abstract, projection) later.
133
+ */
134
+ declare enum BehaviorImplementationType {
135
+ Managed = "Managed"
136
+ }
128
137
  /**
129
138
  * Object with content for create/update operations
130
139
  */
@@ -133,6 +142,8 @@ interface ObjectContent extends ObjectRef {
133
142
  content: string;
134
143
  /** Optional description for transport */
135
144
  description?: string;
145
+ /** Implementation type for behavior definitions (.asbdef). Defaults to Managed. */
146
+ implementationType?: BehaviorImplementationType;
136
147
  }
137
148
  /**
138
149
  * Tree discovery query for hierarchical browsing
@@ -257,6 +268,10 @@ interface ObjectConfig {
257
268
  dpEndpoint?: string;
258
269
  /** Data preview parameter name (if supported) */
259
270
  dpParam?: string;
271
+ /** Extra attributes to add to the root element on create (e.g., srvd:srvdSourceType) */
272
+ rootAttributes?: Record<string, string>;
273
+ /** Inject an <adtcore:adtTemplate> block carrying the implementation type (behavior definitions) */
274
+ requiresImplementationType?: boolean;
260
275
  }
261
276
  /**
262
277
  * Result of upsert operation
@@ -307,6 +322,18 @@ interface ActivationMessage {
307
322
  line?: number;
308
323
  column?: number;
309
324
  }
325
+ /**
326
+ * A pre-resolved object reference for activation.
327
+ *
328
+ * Used for objects that aren't source-file-backed (e.g. service bindings) and so
329
+ * can't be resolved through the extension registry.
330
+ */
331
+ interface ActivationReference {
332
+ uri: string;
333
+ type: string;
334
+ name: string;
335
+ extension: string;
336
+ }
310
337
 
311
338
  /**
312
339
  * Where-Used — Find object dependencies
@@ -557,6 +584,20 @@ interface SearchOptions {
557
584
  includePackages?: boolean;
558
585
  }
559
586
 
587
+ /**
588
+ * Class Include — write a global class's local-source include (CCDEF/CCIMP/CCMAC/CCAU)
589
+ */
590
+
591
+ /**
592
+ * Local-source include sections of a global ABAP class.
593
+ *
594
+ * - definitions → "Class-relevant Local Definitions" (CCDEF)
595
+ * - implementations → "Local Types" (CCIMP) — where RAP behaviour handlers live
596
+ * - macros → "Macros" (CCMAC)
597
+ * - testclasses → "Test Classes" (CCAU)
598
+ */
599
+ type ClassIncludeType = 'definitions' | 'implementations' | 'macros' | 'testclasses';
600
+
560
601
  /**
561
602
  * Create Transport — Create a new transport request for a package
562
603
  */
@@ -640,6 +681,43 @@ interface DiffResult {
640
681
  diffs: DiffHunk[];
641
682
  }
642
683
 
684
+ /** Binding protocol. Only OData is supported today. */
685
+ type ServiceBindingType = 'ODATA';
686
+ /** Binding version. Only OData V4 (category 1) is supported today. */
687
+ type ServiceBindingVersion = 'V4';
688
+ /**
689
+ * Options for creating a service binding
690
+ */
691
+ interface CreateServiceBindingOptions {
692
+ /** Name of the service binding to create (e.g., 'ZBEACON_DOCS_O5') */
693
+ bindingName: string;
694
+ /** Name of the backing service definition (e.g., 'ZBEACON_DOCS_API') */
695
+ serviceDefinition: string;
696
+ /** Target package */
697
+ packageName: string;
698
+ /** Optional description */
699
+ description?: string;
700
+ /** Binding protocol (default: 'ODATA') */
701
+ bindingType?: ServiceBindingType;
702
+ /** Binding version (default: 'V4') */
703
+ bindingVersion?: ServiceBindingVersion;
704
+ /** Transport request (required for non-$TMP packages) */
705
+ transport?: string;
706
+ /** Whether to publish the binding after activation (default: true) */
707
+ publish?: boolean;
708
+ }
709
+ /**
710
+ * Result of creating a service binding
711
+ */
712
+ interface ServiceBindingResult {
713
+ name: string;
714
+ serviceDefinition: string;
715
+ created: boolean;
716
+ activation: ActivationResult[];
717
+ published: boolean;
718
+ publishMessage?: string;
719
+ }
720
+
643
721
  /**
644
722
  * ADT Client Core Implementation
645
723
  *
@@ -664,6 +742,7 @@ interface ADTClient {
664
742
  read(objects: ObjectRef[]): AsyncResult<ObjectWithContent[]>;
665
743
  create(object: ObjectContent, packageName: string, transport?: string): AsyncResult<void>;
666
744
  update(object: ObjectContent, transport?: string): AsyncResult<void>;
745
+ writeClassInclude(className: string, includeType: ClassIncludeType, source: string, transport?: string): AsyncResult<void>;
667
746
  upsert(objects: ObjectContent[], packageName: string, transport?: string): AsyncResult<UpsertResult[]>;
668
747
  activate(objects: ObjectRef[]): AsyncResult<ActivationResult[]>;
669
748
  checkSyntax(objects: ObjectRef[]): AsyncResult<CheckResult[]>;
@@ -685,6 +764,8 @@ interface ADTClient {
685
764
  removeFromTransport(transportId: string, objectName: string): AsyncResult<void>;
686
765
  viewTransportObjects(transportId: string): AsyncResult<TaskContents[]>;
687
766
  gitDiff(objects: ObjectContent[]): AsyncResult<DiffResult[]>;
767
+ createServiceBinding(options: CreateServiceBindingOptions): AsyncResult<ServiceBindingResult>;
768
+ deleteServiceBinding(bindingName: string, transport?: string): AsyncResult<void>;
688
769
  getObjectConfig(): ObjectConfig[];
689
770
  }
690
771
 
@@ -710,4 +791,4 @@ declare function activateLogging(): void;
710
791
  */
711
792
  declare function deactivateLogging(): void;
712
793
 
713
- export { type ADTClient, type ActivationMessage, type ActivationResult, type Aggregation, type ApiResponse, type AsyncResult, type AuthConfig, type AuthType, type BasicAuthConfig, type BasicFilter, type BetweenFilter, type CheckResult, type ClientConfig, type ColumnInfo, type DataFrame, type DataPreviewQuery, type DeleteResult, type Dependency, type DiffHunk, type DiffResult, type DistinctResult, type ErrorCode, type ErrorResponse, type ExportableSessionState, type ExternalReference, ExternalReferencesError, type FolderNode, type GetPackagesOptions, type InactiveEntry, type InactiveObject, type InactiveRef, type InactiveTransport, type ListFilter, type ModifiedDiffHunk, 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 SearchOptions, type SearchResult, type Session, type SimpleDiffHunk, type Sorting, type SsoAuthConfig, type SuccessResponse, type TaskContents, type Transport, type TransportConfig, type TransportObject, type TreeQuery, type TreeResponse, type UpsertResult, activateLogging, buildSQLQuery, createClient, deactivateLogging, err, ok };
794
+ export { type ADTClient, type ActivationMessage, type ActivationReference, type ActivationResult, type Aggregation, type ApiResponse, type AsyncResult, type AuthConfig, type AuthType, type BasicAuthConfig, type BasicFilter, BehaviorImplementationType, type BetweenFilter, type CheckResult, type ClassIncludeType, type ClientConfig, type ColumnInfo, type CreateServiceBindingOptions, type DataFrame, type DataPreviewQuery, type DeleteResult, type Dependency, type DiffHunk, type DiffResult, type DistinctResult, type ErrorCode, type ErrorResponse, type ExportableSessionState, type ExternalReference, ExternalReferencesError, type FolderNode, type GetPackagesOptions, type InactiveEntry, type InactiveObject, type InactiveRef, type InactiveTransport, type ListFilter, type ModifiedDiffHunk, 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 SearchOptions, type SearchResult, type ServiceBindingResult, type ServiceBindingType, type ServiceBindingVersion, type Session, type SimpleDiffHunk, type Sorting, type SsoAuthConfig, type SuccessResponse, type TaskContents, type Transport, type TransportConfig, type TransportObject, type TreeQuery, type TreeResponse, type UpsertResult, activateLogging, buildSQLQuery, createClient, deactivateLogging, err, ok };