catalyst-relay 0.2.1 → 0.2.4
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 +5 -4
- package/dist/index.d.mts +53 -26
- package/dist/index.d.ts +53 -26
- package/dist/index.js +130 -279
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +129 -279
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -270,9 +270,9 @@ if (!error) {
|
|
|
270
270
|
```typescript
|
|
271
271
|
const [data, error] = await client.previewData({
|
|
272
272
|
objectName: 'T000',
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
273
|
+
objectType: 'table',
|
|
274
|
+
sqlQuery: "SELECT MANDT, MTEXT FROM T000 WHERE MANDT = '100'",
|
|
275
|
+
limit: 10
|
|
276
276
|
});
|
|
277
277
|
```
|
|
278
278
|
|
|
@@ -327,7 +327,8 @@ curl -X POST http://localhost:3000/preview/data \
|
|
|
327
327
|
-H "x-session-id: abc123" \
|
|
328
328
|
-d '{
|
|
329
329
|
"objectName": "T000",
|
|
330
|
-
"
|
|
330
|
+
"objectType": "table",
|
|
331
|
+
"sqlQuery": "SELECT MANDT, MTEXT FROM T000 WHERE MANDT = '\''100'\''",
|
|
331
332
|
"limit": 10
|
|
332
333
|
}'
|
|
333
334
|
```
|
package/dist/index.d.mts
CHANGED
|
@@ -108,35 +108,15 @@ interface TreeQuery {
|
|
|
108
108
|
/**
|
|
109
109
|
* Data preview query
|
|
110
110
|
*/
|
|
111
|
-
interface
|
|
111
|
+
interface PreviewSQL {
|
|
112
112
|
/** Object name (table or CDS view) */
|
|
113
113
|
objectName: string;
|
|
114
114
|
/** Object type ('table' or 'view') */
|
|
115
115
|
objectType: 'table' | 'view';
|
|
116
|
-
/**
|
|
117
|
-
|
|
118
|
-
/** ORDER BY columns */
|
|
119
|
-
orderBy?: OrderBy[];
|
|
116
|
+
/** SQL query to execute */
|
|
117
|
+
sqlQuery: string;
|
|
120
118
|
/** Maximum rows to return (default: 100) */
|
|
121
119
|
limit?: number;
|
|
122
|
-
/** Row offset for pagination */
|
|
123
|
-
offset?: number;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Filter condition for data preview
|
|
127
|
-
*/
|
|
128
|
-
interface Filter {
|
|
129
|
-
column: string;
|
|
130
|
-
operator: FilterOperator;
|
|
131
|
-
value: string | number | boolean | null;
|
|
132
|
-
}
|
|
133
|
-
type FilterOperator = 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le' | 'like' | 'in';
|
|
134
|
-
/**
|
|
135
|
-
* Sort specification for data preview
|
|
136
|
-
*/
|
|
137
|
-
interface OrderBy {
|
|
138
|
-
column: string;
|
|
139
|
-
direction: 'asc' | 'desc';
|
|
140
120
|
}
|
|
141
121
|
|
|
142
122
|
/**
|
|
@@ -331,6 +311,53 @@ interface ColumnInfo {
|
|
|
331
311
|
label?: string;
|
|
332
312
|
}
|
|
333
313
|
|
|
314
|
+
/**
|
|
315
|
+
* Query Builder — Optional helper for building SQL queries for data preview
|
|
316
|
+
*/
|
|
317
|
+
|
|
318
|
+
type BasicFilter = {
|
|
319
|
+
type: "basic";
|
|
320
|
+
field: string;
|
|
321
|
+
value: string | number;
|
|
322
|
+
operator: "=" | "<>" | "<" | "<=" | ">" | ">=" | "like" | "not like";
|
|
323
|
+
};
|
|
324
|
+
type BetweenFilter = {
|
|
325
|
+
type: "between";
|
|
326
|
+
field: string;
|
|
327
|
+
minimum: string | number;
|
|
328
|
+
maximum: string | number;
|
|
329
|
+
};
|
|
330
|
+
type ListFilter = {
|
|
331
|
+
type: "list";
|
|
332
|
+
field: string;
|
|
333
|
+
values: (string | number)[];
|
|
334
|
+
include: boolean;
|
|
335
|
+
};
|
|
336
|
+
type QueryFilter = BasicFilter | BetweenFilter | ListFilter;
|
|
337
|
+
type Sorting = {
|
|
338
|
+
field: string;
|
|
339
|
+
direction: "ascending" | "descending";
|
|
340
|
+
};
|
|
341
|
+
type Aggregation = {
|
|
342
|
+
field: string;
|
|
343
|
+
function: "count" | "sum" | "avg" | "min" | "max";
|
|
344
|
+
};
|
|
345
|
+
type Parameter = {
|
|
346
|
+
name: string;
|
|
347
|
+
value: string | number;
|
|
348
|
+
};
|
|
349
|
+
type DataPreviewQuery = {
|
|
350
|
+
objectName: string;
|
|
351
|
+
objectType: 'table' | 'view';
|
|
352
|
+
limit?: number;
|
|
353
|
+
fields: string[];
|
|
354
|
+
parameters?: Parameter[];
|
|
355
|
+
filters?: QueryFilter[];
|
|
356
|
+
sortings?: Sorting[];
|
|
357
|
+
aggregations?: Aggregation[];
|
|
358
|
+
};
|
|
359
|
+
declare function buildSQLQuery(query: DataPreviewQuery): Result<PreviewSQL>;
|
|
360
|
+
|
|
334
361
|
/**
|
|
335
362
|
* Distinct Values — Get distinct column values with counts
|
|
336
363
|
*/
|
|
@@ -453,8 +480,8 @@ interface ADTClient {
|
|
|
453
480
|
getPackages(): AsyncResult<Package[]>;
|
|
454
481
|
getTree(query: TreeQuery): AsyncResult<TreeNode[]>;
|
|
455
482
|
getTransports(packageName: string): AsyncResult<Transport[]>;
|
|
456
|
-
previewData(query:
|
|
457
|
-
getDistinctValues(objectName: string, column: string, objectType?: 'table' | 'view'): AsyncResult<DistinctResult>;
|
|
483
|
+
previewData(query: PreviewSQL): AsyncResult<DataFrame>;
|
|
484
|
+
getDistinctValues(objectName: string, parameters: Parameter[], column: string, objectType?: 'table' | 'view'): AsyncResult<DistinctResult>;
|
|
458
485
|
countRows(objectName: string, objectType: 'table' | 'view'): AsyncResult<number>;
|
|
459
486
|
search(query: string, types?: string[]): AsyncResult<SearchResult[]>;
|
|
460
487
|
whereUsed(object: ObjectRef): AsyncResult<Dependency[]>;
|
|
@@ -464,4 +491,4 @@ interface ADTClient {
|
|
|
464
491
|
}
|
|
465
492
|
declare function createClient(config: ClientConfig): Result<ADTClient, Error>;
|
|
466
493
|
|
|
467
|
-
export { type ADTClient, type ActivationMessage, type ActivationResult, type ApiResponse, type AsyncResult, type AuthConfig, type AuthType, type BasicAuthConfig, type ClientConfig, type ColumnInfo, type DataFrame, type Dependency, type DiffResult, type DistinctResult, type ErrorCode, type ErrorResponse, type
|
|
494
|
+
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 ListFilter, type ObjectConfig, type ObjectContent, type ObjectMetadata, type ObjectRef, type ObjectWithContent, type Package, 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 TreeNode, type TreeQuery, type UpsertResult, buildSQLQuery, createClient, err, ok };
|
package/dist/index.d.ts
CHANGED
|
@@ -108,35 +108,15 @@ interface TreeQuery {
|
|
|
108
108
|
/**
|
|
109
109
|
* Data preview query
|
|
110
110
|
*/
|
|
111
|
-
interface
|
|
111
|
+
interface PreviewSQL {
|
|
112
112
|
/** Object name (table or CDS view) */
|
|
113
113
|
objectName: string;
|
|
114
114
|
/** Object type ('table' or 'view') */
|
|
115
115
|
objectType: 'table' | 'view';
|
|
116
|
-
/**
|
|
117
|
-
|
|
118
|
-
/** ORDER BY columns */
|
|
119
|
-
orderBy?: OrderBy[];
|
|
116
|
+
/** SQL query to execute */
|
|
117
|
+
sqlQuery: string;
|
|
120
118
|
/** Maximum rows to return (default: 100) */
|
|
121
119
|
limit?: number;
|
|
122
|
-
/** Row offset for pagination */
|
|
123
|
-
offset?: number;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Filter condition for data preview
|
|
127
|
-
*/
|
|
128
|
-
interface Filter {
|
|
129
|
-
column: string;
|
|
130
|
-
operator: FilterOperator;
|
|
131
|
-
value: string | number | boolean | null;
|
|
132
|
-
}
|
|
133
|
-
type FilterOperator = 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le' | 'like' | 'in';
|
|
134
|
-
/**
|
|
135
|
-
* Sort specification for data preview
|
|
136
|
-
*/
|
|
137
|
-
interface OrderBy {
|
|
138
|
-
column: string;
|
|
139
|
-
direction: 'asc' | 'desc';
|
|
140
120
|
}
|
|
141
121
|
|
|
142
122
|
/**
|
|
@@ -331,6 +311,53 @@ interface ColumnInfo {
|
|
|
331
311
|
label?: string;
|
|
332
312
|
}
|
|
333
313
|
|
|
314
|
+
/**
|
|
315
|
+
* Query Builder — Optional helper for building SQL queries for data preview
|
|
316
|
+
*/
|
|
317
|
+
|
|
318
|
+
type BasicFilter = {
|
|
319
|
+
type: "basic";
|
|
320
|
+
field: string;
|
|
321
|
+
value: string | number;
|
|
322
|
+
operator: "=" | "<>" | "<" | "<=" | ">" | ">=" | "like" | "not like";
|
|
323
|
+
};
|
|
324
|
+
type BetweenFilter = {
|
|
325
|
+
type: "between";
|
|
326
|
+
field: string;
|
|
327
|
+
minimum: string | number;
|
|
328
|
+
maximum: string | number;
|
|
329
|
+
};
|
|
330
|
+
type ListFilter = {
|
|
331
|
+
type: "list";
|
|
332
|
+
field: string;
|
|
333
|
+
values: (string | number)[];
|
|
334
|
+
include: boolean;
|
|
335
|
+
};
|
|
336
|
+
type QueryFilter = BasicFilter | BetweenFilter | ListFilter;
|
|
337
|
+
type Sorting = {
|
|
338
|
+
field: string;
|
|
339
|
+
direction: "ascending" | "descending";
|
|
340
|
+
};
|
|
341
|
+
type Aggregation = {
|
|
342
|
+
field: string;
|
|
343
|
+
function: "count" | "sum" | "avg" | "min" | "max";
|
|
344
|
+
};
|
|
345
|
+
type Parameter = {
|
|
346
|
+
name: string;
|
|
347
|
+
value: string | number;
|
|
348
|
+
};
|
|
349
|
+
type DataPreviewQuery = {
|
|
350
|
+
objectName: string;
|
|
351
|
+
objectType: 'table' | 'view';
|
|
352
|
+
limit?: number;
|
|
353
|
+
fields: string[];
|
|
354
|
+
parameters?: Parameter[];
|
|
355
|
+
filters?: QueryFilter[];
|
|
356
|
+
sortings?: Sorting[];
|
|
357
|
+
aggregations?: Aggregation[];
|
|
358
|
+
};
|
|
359
|
+
declare function buildSQLQuery(query: DataPreviewQuery): Result<PreviewSQL>;
|
|
360
|
+
|
|
334
361
|
/**
|
|
335
362
|
* Distinct Values — Get distinct column values with counts
|
|
336
363
|
*/
|
|
@@ -453,8 +480,8 @@ interface ADTClient {
|
|
|
453
480
|
getPackages(): AsyncResult<Package[]>;
|
|
454
481
|
getTree(query: TreeQuery): AsyncResult<TreeNode[]>;
|
|
455
482
|
getTransports(packageName: string): AsyncResult<Transport[]>;
|
|
456
|
-
previewData(query:
|
|
457
|
-
getDistinctValues(objectName: string, column: string, objectType?: 'table' | 'view'): AsyncResult<DistinctResult>;
|
|
483
|
+
previewData(query: PreviewSQL): AsyncResult<DataFrame>;
|
|
484
|
+
getDistinctValues(objectName: string, parameters: Parameter[], column: string, objectType?: 'table' | 'view'): AsyncResult<DistinctResult>;
|
|
458
485
|
countRows(objectName: string, objectType: 'table' | 'view'): AsyncResult<number>;
|
|
459
486
|
search(query: string, types?: string[]): AsyncResult<SearchResult[]>;
|
|
460
487
|
whereUsed(object: ObjectRef): AsyncResult<Dependency[]>;
|
|
@@ -464,4 +491,4 @@ interface ADTClient {
|
|
|
464
491
|
}
|
|
465
492
|
declare function createClient(config: ClientConfig): Result<ADTClient, Error>;
|
|
466
493
|
|
|
467
|
-
export { type ADTClient, type ActivationMessage, type ActivationResult, type ApiResponse, type AsyncResult, type AuthConfig, type AuthType, type BasicAuthConfig, type ClientConfig, type ColumnInfo, type DataFrame, type Dependency, type DiffResult, type DistinctResult, type ErrorCode, type ErrorResponse, type
|
|
494
|
+
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 ListFilter, type ObjectConfig, type ObjectContent, type ObjectMetadata, type ObjectRef, type ObjectWithContent, type Package, 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 TreeNode, type TreeQuery, type UpsertResult, buildSQLQuery, createClient, err, ok };
|