catalyst-relay 0.6.0 → 0.6.2
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 +17 -1
- package/dist/index.d.ts +17 -1
- package/dist/index.js +71 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +71 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -584,6 +584,20 @@ interface SearchOptions {
|
|
|
584
584
|
includePackages?: boolean;
|
|
585
585
|
}
|
|
586
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
|
+
|
|
587
601
|
/**
|
|
588
602
|
* Create Transport — Create a new transport request for a package
|
|
589
603
|
*/
|
|
@@ -728,6 +742,8 @@ interface ADTClient {
|
|
|
728
742
|
read(objects: ObjectRef[]): AsyncResult<ObjectWithContent[]>;
|
|
729
743
|
create(object: ObjectContent, packageName: string, transport?: string): AsyncResult<void>;
|
|
730
744
|
update(object: ObjectContent, transport?: string): AsyncResult<void>;
|
|
745
|
+
readClassInclude(className: string, includeType: ClassIncludeType): AsyncResult<string>;
|
|
746
|
+
writeClassInclude(className: string, includeType: ClassIncludeType, source: string, transport?: string): AsyncResult<void>;
|
|
731
747
|
upsert(objects: ObjectContent[], packageName: string, transport?: string): AsyncResult<UpsertResult[]>;
|
|
732
748
|
activate(objects: ObjectRef[]): AsyncResult<ActivationResult[]>;
|
|
733
749
|
checkSyntax(objects: ObjectRef[]): AsyncResult<CheckResult[]>;
|
|
@@ -776,4 +792,4 @@ declare function activateLogging(): void;
|
|
|
776
792
|
*/
|
|
777
793
|
declare function deactivateLogging(): void;
|
|
778
794
|
|
|
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 };
|
|
795
|
+
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
|
@@ -584,6 +584,20 @@ interface SearchOptions {
|
|
|
584
584
|
includePackages?: boolean;
|
|
585
585
|
}
|
|
586
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
|
+
|
|
587
601
|
/**
|
|
588
602
|
* Create Transport — Create a new transport request for a package
|
|
589
603
|
*/
|
|
@@ -728,6 +742,8 @@ interface ADTClient {
|
|
|
728
742
|
read(objects: ObjectRef[]): AsyncResult<ObjectWithContent[]>;
|
|
729
743
|
create(object: ObjectContent, packageName: string, transport?: string): AsyncResult<void>;
|
|
730
744
|
update(object: ObjectContent, transport?: string): AsyncResult<void>;
|
|
745
|
+
readClassInclude(className: string, includeType: ClassIncludeType): AsyncResult<string>;
|
|
746
|
+
writeClassInclude(className: string, includeType: ClassIncludeType, source: string, transport?: string): AsyncResult<void>;
|
|
731
747
|
upsert(objects: ObjectContent[], packageName: string, transport?: string): AsyncResult<UpsertResult[]>;
|
|
732
748
|
activate(objects: ObjectRef[]): AsyncResult<ActivationResult[]>;
|
|
733
749
|
checkSyntax(objects: ObjectRef[]): AsyncResult<CheckResult[]>;
|
|
@@ -776,4 +792,4 @@ declare function activateLogging(): void;
|
|
|
776
792
|
*/
|
|
777
793
|
declare function deactivateLogging(): void;
|
|
778
794
|
|
|
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 };
|
|
795
|
+
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.js
CHANGED
|
@@ -1903,6 +1903,50 @@ async function updateObject(client, object, lockHandle, transport) {
|
|
|
1903
1903
|
return ok(void 0);
|
|
1904
1904
|
}
|
|
1905
1905
|
|
|
1906
|
+
// src/core/adt/craud/classInclude.ts
|
|
1907
|
+
async function readClassInclude(client, className, includeType) {
|
|
1908
|
+
const [config, configErr] = requireConfig("aclass");
|
|
1909
|
+
if (configErr) return err(configErr);
|
|
1910
|
+
debug(`Read class include ${className}/${includeType}`);
|
|
1911
|
+
const [response, requestErr] = await client.request({
|
|
1912
|
+
method: "GET",
|
|
1913
|
+
path: `/sap/bc/adt/${config.endpoint}/${className.toLowerCase()}/includes/${includeType}`,
|
|
1914
|
+
headers: { "Accept": "text/plain" }
|
|
1915
|
+
});
|
|
1916
|
+
const [content, checkErr] = await checkResponse(
|
|
1917
|
+
response,
|
|
1918
|
+
requestErr,
|
|
1919
|
+
`Failed to read ${includeType} include of class ${className}`
|
|
1920
|
+
);
|
|
1921
|
+
if (checkErr) return err(checkErr);
|
|
1922
|
+
return ok(content);
|
|
1923
|
+
}
|
|
1924
|
+
async function updateClassInclude(client, className, includeType, source, lockHandle, transport) {
|
|
1925
|
+
const [config, configErr] = requireConfig("aclass");
|
|
1926
|
+
if (configErr) return err(configErr);
|
|
1927
|
+
const params = {
|
|
1928
|
+
"lockHandle": lockHandle
|
|
1929
|
+
};
|
|
1930
|
+
if (transport) {
|
|
1931
|
+
params["corrNr"] = transport;
|
|
1932
|
+
}
|
|
1933
|
+
debug(`Update class include ${className}/${includeType}: length=${source.length}`);
|
|
1934
|
+
const [response, requestErr] = await client.request({
|
|
1935
|
+
method: "PUT",
|
|
1936
|
+
path: `/sap/bc/adt/${config.endpoint}/${className.toLowerCase()}/includes/${includeType}`,
|
|
1937
|
+
params,
|
|
1938
|
+
headers: { "Content-Type": "*/*" },
|
|
1939
|
+
body: source
|
|
1940
|
+
});
|
|
1941
|
+
const [, checkErr] = await checkResponse(
|
|
1942
|
+
response,
|
|
1943
|
+
requestErr,
|
|
1944
|
+
`Failed to write ${includeType} include of class ${className}`
|
|
1945
|
+
);
|
|
1946
|
+
if (checkErr) return err(checkErr);
|
|
1947
|
+
return ok(void 0);
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1906
1950
|
// src/core/adt/craud/activation.ts
|
|
1907
1951
|
var MAX_POLL_ATTEMPTS = 30;
|
|
1908
1952
|
var POLL_RETRY_DELAY_MS = 1e3;
|
|
@@ -3593,6 +3637,25 @@ async function update(state, requestor, object, transport) {
|
|
|
3593
3637
|
return ok(void 0);
|
|
3594
3638
|
}
|
|
3595
3639
|
|
|
3640
|
+
// src/client/methods/craud/specialcases/classes/readClassInclude.ts
|
|
3641
|
+
async function readClassInclude2(state, requestor, className, includeType) {
|
|
3642
|
+
if (!state.session) return err(new Error("Not logged in"));
|
|
3643
|
+
return readClassInclude(requestor, className, includeType);
|
|
3644
|
+
}
|
|
3645
|
+
|
|
3646
|
+
// src/client/methods/craud/specialcases/classes/writeClassInclude.ts
|
|
3647
|
+
async function writeClassInclude(state, requestor, className, includeType, source, transport) {
|
|
3648
|
+
if (!state.session) return err(new Error("Not logged in"));
|
|
3649
|
+
const objRef = { name: className, extension: "aclass" };
|
|
3650
|
+
const [lockHandle, lockErr] = await lockObject(requestor, objRef);
|
|
3651
|
+
if (lockErr) return err(lockErr);
|
|
3652
|
+
const [, updateErr] = await updateClassInclude(requestor, className, includeType, source, lockHandle, transport);
|
|
3653
|
+
const [, unlockErr] = await unlockObject(requestor, objRef, lockHandle);
|
|
3654
|
+
if (updateErr) return err(updateErr);
|
|
3655
|
+
if (unlockErr) return err(unlockErr);
|
|
3656
|
+
return ok(void 0);
|
|
3657
|
+
}
|
|
3658
|
+
|
|
3596
3659
|
// src/client/methods/craud/upsert.ts
|
|
3597
3660
|
async function upsertSingle(state, requestor, object, packageName, transport) {
|
|
3598
3661
|
if (!state.session) return err(new Error("Not logged in"));
|
|
@@ -3769,7 +3832,7 @@ function getObjectConfig() {
|
|
|
3769
3832
|
return Object.values(OBJECT_CONFIG_MAP);
|
|
3770
3833
|
}
|
|
3771
3834
|
|
|
3772
|
-
// src/client/methods/businessservices/createServiceBinding.ts
|
|
3835
|
+
// src/client/methods/craud/specialcases/businessservices/createServiceBinding.ts
|
|
3773
3836
|
async function createServiceBinding(state, requestor, options) {
|
|
3774
3837
|
if (!state.session) return err(new Error("Not logged in"));
|
|
3775
3838
|
const [, validateErr] = await validateServiceBinding(requestor, options);
|
|
@@ -3798,7 +3861,7 @@ async function createServiceBinding(state, requestor, options) {
|
|
|
3798
3861
|
return ok(result);
|
|
3799
3862
|
}
|
|
3800
3863
|
|
|
3801
|
-
// src/client/methods/businessservices/deleteServiceBinding.ts
|
|
3864
|
+
// src/client/methods/craud/specialcases/businessservices/deleteServiceBinding.ts
|
|
3802
3865
|
async function deleteServiceBinding2(state, requestor, bindingName, transport) {
|
|
3803
3866
|
if (!state.session) return err(new Error("Not logged in"));
|
|
3804
3867
|
return deleteServiceBinding(requestor, bindingName, transport);
|
|
@@ -4116,6 +4179,12 @@ var ADTClientImpl = class {
|
|
|
4116
4179
|
async update(object, transport) {
|
|
4117
4180
|
return update(this.state, this.requestor, object, transport);
|
|
4118
4181
|
}
|
|
4182
|
+
async readClassInclude(className, includeType) {
|
|
4183
|
+
return readClassInclude2(this.state, this.requestor, className, includeType);
|
|
4184
|
+
}
|
|
4185
|
+
async writeClassInclude(className, includeType, source, transport) {
|
|
4186
|
+
return writeClassInclude(this.state, this.requestor, className, includeType, source, transport);
|
|
4187
|
+
}
|
|
4119
4188
|
async upsert(objects, packageName, transport) {
|
|
4120
4189
|
return upsert(this.state, this.requestor, objects, packageName, transport);
|
|
4121
4190
|
}
|