catalyst-relay 0.5.9 → 0.5.10
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 +43 -1
- package/dist/index.d.ts +43 -1
- package/dist/index.js +86 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +86 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -459,6 +459,47 @@ interface DistinctResult {
|
|
|
459
459
|
}>;
|
|
460
460
|
}
|
|
461
461
|
|
|
462
|
+
/**
|
|
463
|
+
* Inactive Objects — Query inactive (unsaved) objects from SAP ADT
|
|
464
|
+
*
|
|
465
|
+
* Calls GET /sap/bc/adt/activation/inactiveobjects to retrieve objects
|
|
466
|
+
* and transports that have inactive versions pending activation.
|
|
467
|
+
*/
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Reference to an inactive object or transport
|
|
471
|
+
*/
|
|
472
|
+
interface InactiveRef {
|
|
473
|
+
uri: string;
|
|
474
|
+
type: string;
|
|
475
|
+
name: string;
|
|
476
|
+
description?: string;
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* An inactive object entry (object with unsaved changes)
|
|
480
|
+
*/
|
|
481
|
+
interface InactiveObject {
|
|
482
|
+
user: string;
|
|
483
|
+
deleted: boolean;
|
|
484
|
+
ref: InactiveRef;
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* An inactive transport entry (transport containing inactive objects)
|
|
488
|
+
*/
|
|
489
|
+
interface InactiveTransport {
|
|
490
|
+
user: string;
|
|
491
|
+
linked: boolean;
|
|
492
|
+
ref: InactiveRef;
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* A single entry from the inactive objects response.
|
|
496
|
+
* Each entry has either an object, a transport, or both.
|
|
497
|
+
*/
|
|
498
|
+
interface InactiveEntry {
|
|
499
|
+
object?: InactiveObject;
|
|
500
|
+
transport?: InactiveTransport;
|
|
501
|
+
}
|
|
502
|
+
|
|
462
503
|
/**
|
|
463
504
|
* Search Objects — Quick search by name pattern
|
|
464
505
|
*/
|
|
@@ -614,6 +655,7 @@ interface ADTClient {
|
|
|
614
655
|
getPackageStats(packageName: string): AsyncResult<PackageNode>;
|
|
615
656
|
getPackageStats(packageNames: string[]): AsyncResult<PackageNode[]>;
|
|
616
657
|
getTransports(packageName: string): AsyncResult<Transport[]>;
|
|
658
|
+
getInactiveObjects(): AsyncResult<InactiveEntry[]>;
|
|
617
659
|
previewData(query: PreviewSQL): AsyncResult<DataFrame>;
|
|
618
660
|
getDistinctValues(objectName: string, parameters: Parameter[], column: string, objectType?: 'table' | 'view'): AsyncResult<DistinctResult>;
|
|
619
661
|
countRows(objectName: string, objectType: 'table' | 'view', parameters?: Parameter[]): AsyncResult<number>;
|
|
@@ -649,4 +691,4 @@ declare function activateLogging(): void;
|
|
|
649
691
|
*/
|
|
650
692
|
declare function deactivateLogging(): void;
|
|
651
693
|
|
|
652
|
-
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 SearchOptions, type SearchResult, type Session, 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 };
|
|
694
|
+
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 InactiveEntry, type InactiveObject, type InactiveRef, type InactiveTransport, 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 SearchOptions, type SearchResult, type Session, 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
|
@@ -459,6 +459,47 @@ interface DistinctResult {
|
|
|
459
459
|
}>;
|
|
460
460
|
}
|
|
461
461
|
|
|
462
|
+
/**
|
|
463
|
+
* Inactive Objects — Query inactive (unsaved) objects from SAP ADT
|
|
464
|
+
*
|
|
465
|
+
* Calls GET /sap/bc/adt/activation/inactiveobjects to retrieve objects
|
|
466
|
+
* and transports that have inactive versions pending activation.
|
|
467
|
+
*/
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Reference to an inactive object or transport
|
|
471
|
+
*/
|
|
472
|
+
interface InactiveRef {
|
|
473
|
+
uri: string;
|
|
474
|
+
type: string;
|
|
475
|
+
name: string;
|
|
476
|
+
description?: string;
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* An inactive object entry (object with unsaved changes)
|
|
480
|
+
*/
|
|
481
|
+
interface InactiveObject {
|
|
482
|
+
user: string;
|
|
483
|
+
deleted: boolean;
|
|
484
|
+
ref: InactiveRef;
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* An inactive transport entry (transport containing inactive objects)
|
|
488
|
+
*/
|
|
489
|
+
interface InactiveTransport {
|
|
490
|
+
user: string;
|
|
491
|
+
linked: boolean;
|
|
492
|
+
ref: InactiveRef;
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* A single entry from the inactive objects response.
|
|
496
|
+
* Each entry has either an object, a transport, or both.
|
|
497
|
+
*/
|
|
498
|
+
interface InactiveEntry {
|
|
499
|
+
object?: InactiveObject;
|
|
500
|
+
transport?: InactiveTransport;
|
|
501
|
+
}
|
|
502
|
+
|
|
462
503
|
/**
|
|
463
504
|
* Search Objects — Quick search by name pattern
|
|
464
505
|
*/
|
|
@@ -614,6 +655,7 @@ interface ADTClient {
|
|
|
614
655
|
getPackageStats(packageName: string): AsyncResult<PackageNode>;
|
|
615
656
|
getPackageStats(packageNames: string[]): AsyncResult<PackageNode[]>;
|
|
616
657
|
getTransports(packageName: string): AsyncResult<Transport[]>;
|
|
658
|
+
getInactiveObjects(): AsyncResult<InactiveEntry[]>;
|
|
617
659
|
previewData(query: PreviewSQL): AsyncResult<DataFrame>;
|
|
618
660
|
getDistinctValues(objectName: string, parameters: Parameter[], column: string, objectType?: 'table' | 'view'): AsyncResult<DistinctResult>;
|
|
619
661
|
countRows(objectName: string, objectType: 'table' | 'view', parameters?: Parameter[]): AsyncResult<number>;
|
|
@@ -649,4 +691,4 @@ declare function activateLogging(): void;
|
|
|
649
691
|
*/
|
|
650
692
|
declare function deactivateLogging(): void;
|
|
651
693
|
|
|
652
|
-
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 SearchOptions, type SearchResult, type Session, 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 };
|
|
694
|
+
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 InactiveEntry, type InactiveObject, type InactiveRef, type InactiveTransport, 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 SearchOptions, type SearchResult, type Session, 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.js
CHANGED
|
@@ -2075,6 +2075,83 @@ function extractTransports(xml) {
|
|
|
2075
2075
|
return ok(transports);
|
|
2076
2076
|
}
|
|
2077
2077
|
|
|
2078
|
+
// src/core/adt/discovery/inactiveObjects.ts
|
|
2079
|
+
var IOC_NS = "http://www.sap.com/abapxml/inactiveCtsObjects";
|
|
2080
|
+
var ADTCORE_NS = "http://www.sap.com/adt/core";
|
|
2081
|
+
async function getInactiveObjects(client) {
|
|
2082
|
+
const [response, requestErr] = await client.request({
|
|
2083
|
+
method: "GET",
|
|
2084
|
+
path: "/sap/bc/adt/activation/inactiveobjects",
|
|
2085
|
+
headers: {
|
|
2086
|
+
"Accept": "application/vnd.sap.adt.inactivectsobjects.v1+xml, application/xml;q=0.8"
|
|
2087
|
+
}
|
|
2088
|
+
});
|
|
2089
|
+
if (requestErr) return err(requestErr);
|
|
2090
|
+
if (!response.ok) {
|
|
2091
|
+
const text2 = await response.text();
|
|
2092
|
+
const errorMsg = extractError(text2);
|
|
2093
|
+
return err(new Error(`Failed to fetch inactive objects: ${errorMsg}`));
|
|
2094
|
+
}
|
|
2095
|
+
const text = await response.text();
|
|
2096
|
+
return parseInactiveObjects(text);
|
|
2097
|
+
}
|
|
2098
|
+
function parseInactiveObjects(xml) {
|
|
2099
|
+
const [doc, parseErr] = safeParseXml(xml);
|
|
2100
|
+
if (parseErr) return err(parseErr);
|
|
2101
|
+
const entries = [];
|
|
2102
|
+
const entryElements = doc.getElementsByTagNameNS(IOC_NS, "entry");
|
|
2103
|
+
for (let i = 0; i < entryElements.length; i++) {
|
|
2104
|
+
const entryEl = entryElements[i];
|
|
2105
|
+
if (!entryEl) continue;
|
|
2106
|
+
const entry = {};
|
|
2107
|
+
const objectEls = entryEl.getElementsByTagNameNS(IOC_NS, "object");
|
|
2108
|
+
if (objectEls.length > 0) {
|
|
2109
|
+
const objectEl = objectEls[0];
|
|
2110
|
+
const objectRef = extractRef(objectEl);
|
|
2111
|
+
if (objectRef) {
|
|
2112
|
+
const user = objectEl.getAttributeNS(IOC_NS, "user") || objectEl.getAttribute("ioc:user") || "";
|
|
2113
|
+
const deletedStr = objectEl.getAttributeNS(IOC_NS, "deleted") || objectEl.getAttribute("ioc:deleted") || "false";
|
|
2114
|
+
entry.object = {
|
|
2115
|
+
user,
|
|
2116
|
+
deleted: deletedStr === "true",
|
|
2117
|
+
ref: objectRef
|
|
2118
|
+
};
|
|
2119
|
+
}
|
|
2120
|
+
}
|
|
2121
|
+
const transportEls = entryEl.getElementsByTagNameNS(IOC_NS, "transport");
|
|
2122
|
+
if (transportEls.length > 0) {
|
|
2123
|
+
const transportEl = transportEls[0];
|
|
2124
|
+
const transportRef = extractRef(transportEl);
|
|
2125
|
+
if (transportRef) {
|
|
2126
|
+
const user = transportEl.getAttributeNS(IOC_NS, "user") || transportEl.getAttribute("ioc:user") || "";
|
|
2127
|
+
const linkedStr = transportEl.getAttributeNS(IOC_NS, "linked") || transportEl.getAttribute("ioc:linked") || "false";
|
|
2128
|
+
entry.transport = {
|
|
2129
|
+
user,
|
|
2130
|
+
linked: linkedStr === "true",
|
|
2131
|
+
ref: transportRef
|
|
2132
|
+
};
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2135
|
+
if (entry.object || entry.transport) {
|
|
2136
|
+
entries.push(entry);
|
|
2137
|
+
}
|
|
2138
|
+
}
|
|
2139
|
+
return ok(entries);
|
|
2140
|
+
}
|
|
2141
|
+
function extractRef(parent) {
|
|
2142
|
+
const refs = parent.getElementsByTagNameNS(IOC_NS, "ref");
|
|
2143
|
+
if (refs.length === 0) return null;
|
|
2144
|
+
const ref = refs[0];
|
|
2145
|
+
const uri = ref.getAttributeNS(ADTCORE_NS, "uri") || ref.getAttribute("adtcore:uri") || "";
|
|
2146
|
+
const type = ref.getAttributeNS(ADTCORE_NS, "type") || ref.getAttribute("adtcore:type") || "";
|
|
2147
|
+
const name = ref.getAttributeNS(ADTCORE_NS, "name") || ref.getAttribute("adtcore:name") || "";
|
|
2148
|
+
const description = ref.getAttributeNS(ADTCORE_NS, "description") || ref.getAttribute("adtcore:description") || void 0;
|
|
2149
|
+
if (!uri && !name) return null;
|
|
2150
|
+
const result = { uri, type, name };
|
|
2151
|
+
if (description) result.description = description;
|
|
2152
|
+
return result;
|
|
2153
|
+
}
|
|
2154
|
+
|
|
2078
2155
|
// src/core/adt/data_extraction/previewParser.ts
|
|
2079
2156
|
function parseDataPreview(xml, maxRows, isTable) {
|
|
2080
2157
|
const [doc, parseErr] = safeParseXml(xml);
|
|
@@ -2909,6 +2986,12 @@ async function getTransports2(state, requestor, packageName) {
|
|
|
2909
2986
|
return getTransports(requestor, packageName);
|
|
2910
2987
|
}
|
|
2911
2988
|
|
|
2989
|
+
// src/client/methods/discovery/getInactiveObjects.ts
|
|
2990
|
+
async function getInactiveObjects2(state, requestor) {
|
|
2991
|
+
if (!state.session) return err(new Error("Not logged in"));
|
|
2992
|
+
return getInactiveObjects(requestor);
|
|
2993
|
+
}
|
|
2994
|
+
|
|
2912
2995
|
// src/client/methods/preview/previewData.ts
|
|
2913
2996
|
async function previewData2(state, requestor, query) {
|
|
2914
2997
|
if (!state.session) return err(new Error("Not logged in"));
|
|
@@ -3318,6 +3401,9 @@ var ADTClientImpl = class {
|
|
|
3318
3401
|
async getTransports(packageName) {
|
|
3319
3402
|
return getTransports2(this.state, this.requestor, packageName);
|
|
3320
3403
|
}
|
|
3404
|
+
async getInactiveObjects() {
|
|
3405
|
+
return getInactiveObjects2(this.state, this.requestor);
|
|
3406
|
+
}
|
|
3321
3407
|
// --- Data Preview ---
|
|
3322
3408
|
async previewData(query) {
|
|
3323
3409
|
return previewData2(this.state, this.requestor, query);
|