core-3nweb-client-lib 0.22.0 → 0.22.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.
@@ -42,6 +42,10 @@ export declare namespace vGetXAttr {
42
42
  bytes?: Value<Buffer>;
43
43
  }
44
44
  const replyType: ProtoType<Reply>;
45
+ function unpackReply(buf: EnvelopeBody): {
46
+ attr: any;
47
+ version: number;
48
+ };
45
49
  function wrapService(fn: ReadonlyFileVersionedAPI['getXAttr']): ExposedFn;
46
50
  function makeCaller(caller: Caller, objPath: string[]): ReadonlyFileVersionedAPI['getXAttr'];
47
51
  }
@@ -214,8 +214,8 @@ var getXAttr;
214
214
  getXAttr.wrapService = wrapService;
215
215
  function makeCaller(caller, objPath) {
216
216
  const path = objPath.concat('getXAttr');
217
- return () => caller
218
- .startPromiseCall(path, undefined)
217
+ return xaName => caller
218
+ .startPromiseCall(path, requestType.pack({ xaName }))
219
219
  .then(unpackXAttrValue);
220
220
  }
221
221
  getXAttr.makeCaller = makeCaller;
@@ -413,6 +413,20 @@ var vGetXAttr;
413
413
  (function (vGetXAttr) {
414
414
  const requestType = makeFileType('GetXAttrRequestBody');
415
415
  vGetXAttr.replyType = makeFileType('VersionedGetXAttrReplyBody');
416
+ function unpackReply(buf) {
417
+ const { json, str, bytes, version: v } = vGetXAttr.replyType.unpack(buf);
418
+ const version = protobuf_msg_1.fixInt(v);
419
+ if (bytes) {
420
+ return { version, attr: protobuf_msg_1.valOf(bytes) };
421
+ }
422
+ else if (str) {
423
+ return { version, attr: protobuf_msg_1.valOf(str) };
424
+ }
425
+ else {
426
+ return { version, attr: protobuf_msg_1.valOfOptJson(json) };
427
+ }
428
+ }
429
+ vGetXAttr.unpackReply = unpackReply;
416
430
  function wrapService(fn) {
417
431
  return buf => {
418
432
  const { xaName } = requestType.unpack(buf);
@@ -436,19 +450,7 @@ var vGetXAttr;
436
450
  const path = objPath.concat('getXAttr');
437
451
  return () => caller
438
452
  .startPromiseCall(path, undefined)
439
- .then(buf => {
440
- const { json, str, bytes, version: v } = vGetXAttr.replyType.unpack(buf);
441
- const version = protobuf_msg_1.fixInt(v);
442
- if (bytes) {
443
- return { version, attr: protobuf_msg_1.valOf(bytes) };
444
- }
445
- else if (str) {
446
- return { version, attr: protobuf_msg_1.valOf(str) };
447
- }
448
- else {
449
- return { version, attr: protobuf_msg_1.valOfOptJson(json) };
450
- }
451
- });
453
+ .then(unpackReply);
452
454
  }
453
455
  vGetXAttr.makeCaller = makeCaller;
454
456
  })(vGetXAttr = exports.vGetXAttr || (exports.vGetXAttr = {}));
@@ -1043,7 +1043,7 @@ var vGetXAttr;
1043
1043
  const ipcPath = objPath.concat('getXAttr');
1044
1044
  return (path, xaName) => caller
1045
1045
  .startPromiseCall(ipcPath, getXAttr.requestType.pack({ path, xaName }))
1046
- .then(file_1.unpackXAttrValue);
1046
+ .then(file.vGetXAttr.unpackReply);
1047
1047
  }
1048
1048
  vGetXAttr.makeCaller = makeCaller;
1049
1049
  })(vGetXAttr || (vGetXAttr = {}));
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- Copyright (C) 2015 - 2018, 2020 3NSoft Inc.
3
+ Copyright (C) 2015 - 2018, 2020 - 2022 3NSoft Inc.
4
4
 
5
5
  This program is free software: you can redistribute it and/or modify it under
6
6
  the terms of the GNU General Public License as published by the Free Software
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "core-3nweb-client-lib",
3
- "version": "0.22.0",
3
+ "version": "0.22.1",
4
4
  "description": "3NWeb client core library, embeddable into different environments",
5
5
  "main": "build/lib-index.js",
6
6
  "types": "build/lib-index.d.ts",