catalyst-relay 0.6.1 → 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 CHANGED
@@ -742,6 +742,7 @@ interface ADTClient {
742
742
  read(objects: ObjectRef[]): AsyncResult<ObjectWithContent[]>;
743
743
  create(object: ObjectContent, packageName: string, transport?: string): AsyncResult<void>;
744
744
  update(object: ObjectContent, transport?: string): AsyncResult<void>;
745
+ readClassInclude(className: string, includeType: ClassIncludeType): AsyncResult<string>;
745
746
  writeClassInclude(className: string, includeType: ClassIncludeType, source: string, transport?: string): AsyncResult<void>;
746
747
  upsert(objects: ObjectContent[], packageName: string, transport?: string): AsyncResult<UpsertResult[]>;
747
748
  activate(objects: ObjectRef[]): AsyncResult<ActivationResult[]>;
package/dist/index.d.ts CHANGED
@@ -742,6 +742,7 @@ interface ADTClient {
742
742
  read(objects: ObjectRef[]): AsyncResult<ObjectWithContent[]>;
743
743
  create(object: ObjectContent, packageName: string, transport?: string): AsyncResult<void>;
744
744
  update(object: ObjectContent, transport?: string): AsyncResult<void>;
745
+ readClassInclude(className: string, includeType: ClassIncludeType): AsyncResult<string>;
745
746
  writeClassInclude(className: string, includeType: ClassIncludeType, source: string, transport?: string): AsyncResult<void>;
746
747
  upsert(objects: ObjectContent[], packageName: string, transport?: string): AsyncResult<UpsertResult[]>;
747
748
  activate(objects: ObjectRef[]): AsyncResult<ActivationResult[]>;
package/dist/index.js CHANGED
@@ -1904,6 +1904,23 @@ async function updateObject(client, object, lockHandle, transport) {
1904
1904
  }
1905
1905
 
1906
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
+ }
1907
1924
  async function updateClassInclude(client, className, includeType, source, lockHandle, transport) {
1908
1925
  const [config, configErr] = requireConfig("aclass");
1909
1926
  if (configErr) return err(configErr);
@@ -3620,6 +3637,12 @@ async function update(state, requestor, object, transport) {
3620
3637
  return ok(void 0);
3621
3638
  }
3622
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
+
3623
3646
  // src/client/methods/craud/specialcases/classes/writeClassInclude.ts
3624
3647
  async function writeClassInclude(state, requestor, className, includeType, source, transport) {
3625
3648
  if (!state.session) return err(new Error("Not logged in"));
@@ -4156,6 +4179,9 @@ var ADTClientImpl = class {
4156
4179
  async update(object, transport) {
4157
4180
  return update(this.state, this.requestor, object, transport);
4158
4181
  }
4182
+ async readClassInclude(className, includeType) {
4183
+ return readClassInclude2(this.state, this.requestor, className, includeType);
4184
+ }
4159
4185
  async writeClassInclude(className, includeType, source, transport) {
4160
4186
  return writeClassInclude(this.state, this.requestor, className, includeType, source, transport);
4161
4187
  }