catalyst-relay 0.6.0 → 0.6.1
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 +16 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.js +45 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +45 -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,7 @@ 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
|
+
writeClassInclude(className: string, includeType: ClassIncludeType, source: string, transport?: string): AsyncResult<void>;
|
|
731
746
|
upsert(objects: ObjectContent[], packageName: string, transport?: string): AsyncResult<UpsertResult[]>;
|
|
732
747
|
activate(objects: ObjectRef[]): AsyncResult<ActivationResult[]>;
|
|
733
748
|
checkSyntax(objects: ObjectRef[]): AsyncResult<CheckResult[]>;
|
|
@@ -776,4 +791,4 @@ declare function activateLogging(): void;
|
|
|
776
791
|
*/
|
|
777
792
|
declare function deactivateLogging(): void;
|
|
778
793
|
|
|
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 };
|
|
794
|
+
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,7 @@ 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
|
+
writeClassInclude(className: string, includeType: ClassIncludeType, source: string, transport?: string): AsyncResult<void>;
|
|
731
746
|
upsert(objects: ObjectContent[], packageName: string, transport?: string): AsyncResult<UpsertResult[]>;
|
|
732
747
|
activate(objects: ObjectRef[]): AsyncResult<ActivationResult[]>;
|
|
733
748
|
checkSyntax(objects: ObjectRef[]): AsyncResult<CheckResult[]>;
|
|
@@ -776,4 +791,4 @@ declare function activateLogging(): void;
|
|
|
776
791
|
*/
|
|
777
792
|
declare function deactivateLogging(): void;
|
|
778
793
|
|
|
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 };
|
|
794
|
+
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,33 @@ 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 updateClassInclude(client, className, includeType, source, lockHandle, transport) {
|
|
1908
|
+
const [config, configErr] = requireConfig("aclass");
|
|
1909
|
+
if (configErr) return err(configErr);
|
|
1910
|
+
const params = {
|
|
1911
|
+
"lockHandle": lockHandle
|
|
1912
|
+
};
|
|
1913
|
+
if (transport) {
|
|
1914
|
+
params["corrNr"] = transport;
|
|
1915
|
+
}
|
|
1916
|
+
debug(`Update class include ${className}/${includeType}: length=${source.length}`);
|
|
1917
|
+
const [response, requestErr] = await client.request({
|
|
1918
|
+
method: "PUT",
|
|
1919
|
+
path: `/sap/bc/adt/${config.endpoint}/${className.toLowerCase()}/includes/${includeType}`,
|
|
1920
|
+
params,
|
|
1921
|
+
headers: { "Content-Type": "*/*" },
|
|
1922
|
+
body: source
|
|
1923
|
+
});
|
|
1924
|
+
const [, checkErr] = await checkResponse(
|
|
1925
|
+
response,
|
|
1926
|
+
requestErr,
|
|
1927
|
+
`Failed to write ${includeType} include of class ${className}`
|
|
1928
|
+
);
|
|
1929
|
+
if (checkErr) return err(checkErr);
|
|
1930
|
+
return ok(void 0);
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1906
1933
|
// src/core/adt/craud/activation.ts
|
|
1907
1934
|
var MAX_POLL_ATTEMPTS = 30;
|
|
1908
1935
|
var POLL_RETRY_DELAY_MS = 1e3;
|
|
@@ -3593,6 +3620,19 @@ async function update(state, requestor, object, transport) {
|
|
|
3593
3620
|
return ok(void 0);
|
|
3594
3621
|
}
|
|
3595
3622
|
|
|
3623
|
+
// src/client/methods/craud/specialcases/classes/writeClassInclude.ts
|
|
3624
|
+
async function writeClassInclude(state, requestor, className, includeType, source, transport) {
|
|
3625
|
+
if (!state.session) return err(new Error("Not logged in"));
|
|
3626
|
+
const objRef = { name: className, extension: "aclass" };
|
|
3627
|
+
const [lockHandle, lockErr] = await lockObject(requestor, objRef);
|
|
3628
|
+
if (lockErr) return err(lockErr);
|
|
3629
|
+
const [, updateErr] = await updateClassInclude(requestor, className, includeType, source, lockHandle, transport);
|
|
3630
|
+
const [, unlockErr] = await unlockObject(requestor, objRef, lockHandle);
|
|
3631
|
+
if (updateErr) return err(updateErr);
|
|
3632
|
+
if (unlockErr) return err(unlockErr);
|
|
3633
|
+
return ok(void 0);
|
|
3634
|
+
}
|
|
3635
|
+
|
|
3596
3636
|
// src/client/methods/craud/upsert.ts
|
|
3597
3637
|
async function upsertSingle(state, requestor, object, packageName, transport) {
|
|
3598
3638
|
if (!state.session) return err(new Error("Not logged in"));
|
|
@@ -3769,7 +3809,7 @@ function getObjectConfig() {
|
|
|
3769
3809
|
return Object.values(OBJECT_CONFIG_MAP);
|
|
3770
3810
|
}
|
|
3771
3811
|
|
|
3772
|
-
// src/client/methods/businessservices/createServiceBinding.ts
|
|
3812
|
+
// src/client/methods/craud/specialcases/businessservices/createServiceBinding.ts
|
|
3773
3813
|
async function createServiceBinding(state, requestor, options) {
|
|
3774
3814
|
if (!state.session) return err(new Error("Not logged in"));
|
|
3775
3815
|
const [, validateErr] = await validateServiceBinding(requestor, options);
|
|
@@ -3798,7 +3838,7 @@ async function createServiceBinding(state, requestor, options) {
|
|
|
3798
3838
|
return ok(result);
|
|
3799
3839
|
}
|
|
3800
3840
|
|
|
3801
|
-
// src/client/methods/businessservices/deleteServiceBinding.ts
|
|
3841
|
+
// src/client/methods/craud/specialcases/businessservices/deleteServiceBinding.ts
|
|
3802
3842
|
async function deleteServiceBinding2(state, requestor, bindingName, transport) {
|
|
3803
3843
|
if (!state.session) return err(new Error("Not logged in"));
|
|
3804
3844
|
return deleteServiceBinding(requestor, bindingName, transport);
|
|
@@ -4116,6 +4156,9 @@ var ADTClientImpl = class {
|
|
|
4116
4156
|
async update(object, transport) {
|
|
4117
4157
|
return update(this.state, this.requestor, object, transport);
|
|
4118
4158
|
}
|
|
4159
|
+
async writeClassInclude(className, includeType, source, transport) {
|
|
4160
|
+
return writeClassInclude(this.state, this.requestor, className, includeType, source, transport);
|
|
4161
|
+
}
|
|
4119
4162
|
async upsert(objects, packageName, transport) {
|
|
4120
4163
|
return upsert(this.state, this.requestor, objects, packageName, transport);
|
|
4121
4164
|
}
|