catalyst-relay 0.5.14 → 0.6.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/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
@@ -640,6 +667,43 @@ interface DiffResult {
640
667
  diffs: DiffHunk[];
641
668
  }
642
669
 
670
+ /** Binding protocol. Only OData is supported today. */
671
+ type ServiceBindingType = 'ODATA';
672
+ /** Binding version. Only OData V4 (category 1) is supported today. */
673
+ type ServiceBindingVersion = 'V4';
674
+ /**
675
+ * Options for creating a service binding
676
+ */
677
+ interface CreateServiceBindingOptions {
678
+ /** Name of the service binding to create (e.g., 'ZBEACON_DOCS_O5') */
679
+ bindingName: string;
680
+ /** Name of the backing service definition (e.g., 'ZBEACON_DOCS_API') */
681
+ serviceDefinition: string;
682
+ /** Target package */
683
+ packageName: string;
684
+ /** Optional description */
685
+ description?: string;
686
+ /** Binding protocol (default: 'ODATA') */
687
+ bindingType?: ServiceBindingType;
688
+ /** Binding version (default: 'V4') */
689
+ bindingVersion?: ServiceBindingVersion;
690
+ /** Transport request (required for non-$TMP packages) */
691
+ transport?: string;
692
+ /** Whether to publish the binding after activation (default: true) */
693
+ publish?: boolean;
694
+ }
695
+ /**
696
+ * Result of creating a service binding
697
+ */
698
+ interface ServiceBindingResult {
699
+ name: string;
700
+ serviceDefinition: string;
701
+ created: boolean;
702
+ activation: ActivationResult[];
703
+ published: boolean;
704
+ publishMessage?: string;
705
+ }
706
+
643
707
  /**
644
708
  * ADT Client Core Implementation
645
709
  *
@@ -685,6 +749,8 @@ interface ADTClient {
685
749
  removeFromTransport(transportId: string, objectName: string): AsyncResult<void>;
686
750
  viewTransportObjects(transportId: string): AsyncResult<TaskContents[]>;
687
751
  gitDiff(objects: ObjectContent[]): AsyncResult<DiffResult[]>;
752
+ createServiceBinding(options: CreateServiceBindingOptions): AsyncResult<ServiceBindingResult>;
753
+ deleteServiceBinding(bindingName: string, transport?: string): AsyncResult<void>;
688
754
  getObjectConfig(): ObjectConfig[];
689
755
  }
690
756
 
@@ -710,4 +776,4 @@ declare function activateLogging(): void;
710
776
  */
711
777
  declare function deactivateLogging(): void;
712
778
 
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 };
779
+ 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 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
@@ -640,6 +667,43 @@ interface DiffResult {
640
667
  diffs: DiffHunk[];
641
668
  }
642
669
 
670
+ /** Binding protocol. Only OData is supported today. */
671
+ type ServiceBindingType = 'ODATA';
672
+ /** Binding version. Only OData V4 (category 1) is supported today. */
673
+ type ServiceBindingVersion = 'V4';
674
+ /**
675
+ * Options for creating a service binding
676
+ */
677
+ interface CreateServiceBindingOptions {
678
+ /** Name of the service binding to create (e.g., 'ZBEACON_DOCS_O5') */
679
+ bindingName: string;
680
+ /** Name of the backing service definition (e.g., 'ZBEACON_DOCS_API') */
681
+ serviceDefinition: string;
682
+ /** Target package */
683
+ packageName: string;
684
+ /** Optional description */
685
+ description?: string;
686
+ /** Binding protocol (default: 'ODATA') */
687
+ bindingType?: ServiceBindingType;
688
+ /** Binding version (default: 'V4') */
689
+ bindingVersion?: ServiceBindingVersion;
690
+ /** Transport request (required for non-$TMP packages) */
691
+ transport?: string;
692
+ /** Whether to publish the binding after activation (default: true) */
693
+ publish?: boolean;
694
+ }
695
+ /**
696
+ * Result of creating a service binding
697
+ */
698
+ interface ServiceBindingResult {
699
+ name: string;
700
+ serviceDefinition: string;
701
+ created: boolean;
702
+ activation: ActivationResult[];
703
+ published: boolean;
704
+ publishMessage?: string;
705
+ }
706
+
643
707
  /**
644
708
  * ADT Client Core Implementation
645
709
  *
@@ -685,6 +749,8 @@ interface ADTClient {
685
749
  removeFromTransport(transportId: string, objectName: string): AsyncResult<void>;
686
750
  viewTransportObjects(transportId: string): AsyncResult<TaskContents[]>;
687
751
  gitDiff(objects: ObjectContent[]): AsyncResult<DiffResult[]>;
752
+ createServiceBinding(options: CreateServiceBindingOptions): AsyncResult<ServiceBindingResult>;
753
+ deleteServiceBinding(bindingName: string, transport?: string): AsyncResult<void>;
688
754
  getObjectConfig(): ObjectConfig[];
689
755
  }
690
756
 
@@ -710,4 +776,4 @@ declare function activateLogging(): void;
710
776
  */
711
777
  declare function deactivateLogging(): void;
712
778
 
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 };
779
+ 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 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 };