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.mjs
CHANGED
|
@@ -1867,6 +1867,33 @@ async function updateObject(client, object, lockHandle, transport) {
|
|
|
1867
1867
|
return ok(void 0);
|
|
1868
1868
|
}
|
|
1869
1869
|
|
|
1870
|
+
// src/core/adt/craud/classInclude.ts
|
|
1871
|
+
async function updateClassInclude(client, className, includeType, source, lockHandle, transport) {
|
|
1872
|
+
const [config, configErr] = requireConfig("aclass");
|
|
1873
|
+
if (configErr) return err(configErr);
|
|
1874
|
+
const params = {
|
|
1875
|
+
"lockHandle": lockHandle
|
|
1876
|
+
};
|
|
1877
|
+
if (transport) {
|
|
1878
|
+
params["corrNr"] = transport;
|
|
1879
|
+
}
|
|
1880
|
+
debug(`Update class include ${className}/${includeType}: length=${source.length}`);
|
|
1881
|
+
const [response, requestErr] = await client.request({
|
|
1882
|
+
method: "PUT",
|
|
1883
|
+
path: `/sap/bc/adt/${config.endpoint}/${className.toLowerCase()}/includes/${includeType}`,
|
|
1884
|
+
params,
|
|
1885
|
+
headers: { "Content-Type": "*/*" },
|
|
1886
|
+
body: source
|
|
1887
|
+
});
|
|
1888
|
+
const [, checkErr] = await checkResponse(
|
|
1889
|
+
response,
|
|
1890
|
+
requestErr,
|
|
1891
|
+
`Failed to write ${includeType} include of class ${className}`
|
|
1892
|
+
);
|
|
1893
|
+
if (checkErr) return err(checkErr);
|
|
1894
|
+
return ok(void 0);
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1870
1897
|
// src/core/adt/craud/activation.ts
|
|
1871
1898
|
var MAX_POLL_ATTEMPTS = 30;
|
|
1872
1899
|
var POLL_RETRY_DELAY_MS = 1e3;
|
|
@@ -3557,6 +3584,19 @@ async function update(state, requestor, object, transport) {
|
|
|
3557
3584
|
return ok(void 0);
|
|
3558
3585
|
}
|
|
3559
3586
|
|
|
3587
|
+
// src/client/methods/craud/specialcases/classes/writeClassInclude.ts
|
|
3588
|
+
async function writeClassInclude(state, requestor, className, includeType, source, transport) {
|
|
3589
|
+
if (!state.session) return err(new Error("Not logged in"));
|
|
3590
|
+
const objRef = { name: className, extension: "aclass" };
|
|
3591
|
+
const [lockHandle, lockErr] = await lockObject(requestor, objRef);
|
|
3592
|
+
if (lockErr) return err(lockErr);
|
|
3593
|
+
const [, updateErr] = await updateClassInclude(requestor, className, includeType, source, lockHandle, transport);
|
|
3594
|
+
const [, unlockErr] = await unlockObject(requestor, objRef, lockHandle);
|
|
3595
|
+
if (updateErr) return err(updateErr);
|
|
3596
|
+
if (unlockErr) return err(unlockErr);
|
|
3597
|
+
return ok(void 0);
|
|
3598
|
+
}
|
|
3599
|
+
|
|
3560
3600
|
// src/client/methods/craud/upsert.ts
|
|
3561
3601
|
async function upsertSingle(state, requestor, object, packageName, transport) {
|
|
3562
3602
|
if (!state.session) return err(new Error("Not logged in"));
|
|
@@ -3733,7 +3773,7 @@ function getObjectConfig() {
|
|
|
3733
3773
|
return Object.values(OBJECT_CONFIG_MAP);
|
|
3734
3774
|
}
|
|
3735
3775
|
|
|
3736
|
-
// src/client/methods/businessservices/createServiceBinding.ts
|
|
3776
|
+
// src/client/methods/craud/specialcases/businessservices/createServiceBinding.ts
|
|
3737
3777
|
async function createServiceBinding(state, requestor, options) {
|
|
3738
3778
|
if (!state.session) return err(new Error("Not logged in"));
|
|
3739
3779
|
const [, validateErr] = await validateServiceBinding(requestor, options);
|
|
@@ -3762,7 +3802,7 @@ async function createServiceBinding(state, requestor, options) {
|
|
|
3762
3802
|
return ok(result);
|
|
3763
3803
|
}
|
|
3764
3804
|
|
|
3765
|
-
// src/client/methods/businessservices/deleteServiceBinding.ts
|
|
3805
|
+
// src/client/methods/craud/specialcases/businessservices/deleteServiceBinding.ts
|
|
3766
3806
|
async function deleteServiceBinding2(state, requestor, bindingName, transport) {
|
|
3767
3807
|
if (!state.session) return err(new Error("Not logged in"));
|
|
3768
3808
|
return deleteServiceBinding(requestor, bindingName, transport);
|
|
@@ -4080,6 +4120,9 @@ var ADTClientImpl = class {
|
|
|
4080
4120
|
async update(object, transport) {
|
|
4081
4121
|
return update(this.state, this.requestor, object, transport);
|
|
4082
4122
|
}
|
|
4123
|
+
async writeClassInclude(className, includeType, source, transport) {
|
|
4124
|
+
return writeClassInclude(this.state, this.requestor, className, includeType, source, transport);
|
|
4125
|
+
}
|
|
4083
4126
|
async upsert(objects, packageName, transport) {
|
|
4084
4127
|
return upsert(this.state, this.requestor, objects, packageName, transport);
|
|
4085
4128
|
}
|