catalyst-relay 0.5.8 → 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 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
  */
@@ -535,6 +576,15 @@ interface TransportObject {
535
576
  position: string;
536
577
  }
537
578
 
579
+ /**
580
+ * Parse Transport Tasks — Extract task IDs and their objects from transport XML
581
+ */
582
+
583
+ interface TaskContents {
584
+ taskId: string;
585
+ objects: TransportObject[];
586
+ }
587
+
538
588
  /**
539
589
  * Git Diff — Compare local content with server content
540
590
  *
@@ -605,6 +655,7 @@ interface ADTClient {
605
655
  getPackageStats(packageName: string): AsyncResult<PackageNode>;
606
656
  getPackageStats(packageNames: string[]): AsyncResult<PackageNode[]>;
607
657
  getTransports(packageName: string): AsyncResult<Transport[]>;
658
+ getInactiveObjects(): AsyncResult<InactiveEntry[]>;
608
659
  previewData(query: PreviewSQL): AsyncResult<DataFrame>;
609
660
  getDistinctValues(objectName: string, parameters: Parameter[], column: string, objectType?: 'table' | 'view'): AsyncResult<DistinctResult>;
610
661
  countRows(objectName: string, objectType: 'table' | 'view', parameters?: Parameter[]): AsyncResult<number>;
@@ -613,6 +664,7 @@ interface ADTClient {
613
664
  createTransport(config: TransportConfig): AsyncResult<string>;
614
665
  deleteTransport(transportId: string, removeObjects?: boolean): AsyncResult<void>;
615
666
  removeFromTransport(transportId: string, objectName: string): AsyncResult<void>;
667
+ viewTransportObjects(transportId: string): AsyncResult<TaskContents[]>;
616
668
  gitDiff(objects: ObjectContent[]): AsyncResult<DiffResult[]>;
617
669
  getObjectConfig(): ObjectConfig[];
618
670
  }
@@ -639,4 +691,4 @@ declare function activateLogging(): void;
639
691
  */
640
692
  declare function deactivateLogging(): void;
641
693
 
642
- 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 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
  */
@@ -535,6 +576,15 @@ interface TransportObject {
535
576
  position: string;
536
577
  }
537
578
 
579
+ /**
580
+ * Parse Transport Tasks — Extract task IDs and their objects from transport XML
581
+ */
582
+
583
+ interface TaskContents {
584
+ taskId: string;
585
+ objects: TransportObject[];
586
+ }
587
+
538
588
  /**
539
589
  * Git Diff — Compare local content with server content
540
590
  *
@@ -605,6 +655,7 @@ interface ADTClient {
605
655
  getPackageStats(packageName: string): AsyncResult<PackageNode>;
606
656
  getPackageStats(packageNames: string[]): AsyncResult<PackageNode[]>;
607
657
  getTransports(packageName: string): AsyncResult<Transport[]>;
658
+ getInactiveObjects(): AsyncResult<InactiveEntry[]>;
608
659
  previewData(query: PreviewSQL): AsyncResult<DataFrame>;
609
660
  getDistinctValues(objectName: string, parameters: Parameter[], column: string, objectType?: 'table' | 'view'): AsyncResult<DistinctResult>;
610
661
  countRows(objectName: string, objectType: 'table' | 'view', parameters?: Parameter[]): AsyncResult<number>;
@@ -613,6 +664,7 @@ interface ADTClient {
613
664
  createTransport(config: TransportConfig): AsyncResult<string>;
614
665
  deleteTransport(transportId: string, removeObjects?: boolean): AsyncResult<void>;
615
666
  removeFromTransport(transportId: string, objectName: string): AsyncResult<void>;
667
+ viewTransportObjects(transportId: string): AsyncResult<TaskContents[]>;
616
668
  gitDiff(objects: ObjectContent[]): AsyncResult<DiffResult[]>;
617
669
  getObjectConfig(): ObjectConfig[];
618
670
  }
@@ -639,4 +691,4 @@ declare function activateLogging(): void;
639
691
  */
640
692
  declare function deactivateLogging(): void;
641
693
 
642
- 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 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);
@@ -2668,6 +2745,26 @@ async function deleteTransport(client, transportId, removeObjects = false) {
2668
2745
  return deleteRequest(client, transportId);
2669
2746
  }
2670
2747
 
2748
+ // src/core/adt/transports/viewTransportObjects.ts
2749
+ var ACCEPT_HEADER3 = "application/vnd.sap.adt.transportorganizer.v1+xml";
2750
+ async function viewTransportObjects(client, transportId) {
2751
+ const [response, requestErr] = await client.request({
2752
+ method: "GET",
2753
+ path: `/sap/bc/adt/cts/transportrequests/${transportId}`,
2754
+ headers: { "Accept": ACCEPT_HEADER3 }
2755
+ });
2756
+ if (requestErr) return err(requestErr);
2757
+ if (!response.ok) {
2758
+ const text2 = await response.text();
2759
+ const errorMsg = extractError(text2);
2760
+ return err(new Error(`Failed to read transport ${transportId}: ${errorMsg}`));
2761
+ }
2762
+ const text = await response.text();
2763
+ const [doc, parseErr] = safeParseXml(text);
2764
+ if (parseErr) return err(parseErr);
2765
+ return ok(parseTransportTasks(doc));
2766
+ }
2767
+
2671
2768
  // src/core/adt/craud/gitDiff.ts
2672
2769
  var import_diff = require("diff");
2673
2770
  function computeDiff(serverLines, localLines) {
@@ -2889,6 +2986,12 @@ async function getTransports2(state, requestor, packageName) {
2889
2986
  return getTransports(requestor, packageName);
2890
2987
  }
2891
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
+
2892
2995
  // src/client/methods/preview/previewData.ts
2893
2996
  async function previewData2(state, requestor, query) {
2894
2997
  if (!state.session) return err(new Error("Not logged in"));
@@ -2937,6 +3040,12 @@ async function removeFromTransport2(state, requestor, transportId, objectName) {
2937
3040
  return removeFromTransport(requestor, transportId, objectName);
2938
3041
  }
2939
3042
 
3043
+ // src/client/methods/transport/viewTransportObjects.ts
3044
+ async function viewTransportObjects2(state, requestor, transportId) {
3045
+ if (!state.session) return err(new Error("Not logged in"));
3046
+ return viewTransportObjects(requestor, transportId);
3047
+ }
3048
+
2940
3049
  // src/client/methods/diff/gitDiff.ts
2941
3050
  async function gitDiff2(state, requestor, objects) {
2942
3051
  if (!state.session) return err(new Error("Not logged in"));
@@ -3292,6 +3401,9 @@ var ADTClientImpl = class {
3292
3401
  async getTransports(packageName) {
3293
3402
  return getTransports2(this.state, this.requestor, packageName);
3294
3403
  }
3404
+ async getInactiveObjects() {
3405
+ return getInactiveObjects2(this.state, this.requestor);
3406
+ }
3295
3407
  // --- Data Preview ---
3296
3408
  async previewData(query) {
3297
3409
  return previewData2(this.state, this.requestor, query);
@@ -3319,6 +3431,9 @@ var ADTClientImpl = class {
3319
3431
  async removeFromTransport(transportId, objectName) {
3320
3432
  return removeFromTransport2(this.state, this.requestor, transportId, objectName);
3321
3433
  }
3434
+ async viewTransportObjects(transportId) {
3435
+ return viewTransportObjects2(this.state, this.requestor, transportId);
3436
+ }
3322
3437
  // --- Diff Operations ---
3323
3438
  async gitDiff(objects) {
3324
3439
  return gitDiff2(this.state, this.requestor, objects);