core-3nweb-client-lib 0.27.3 → 0.27.5

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.
Files changed (102) hide show
  1. package/build/api-defs/files.d.ts +92 -29
  2. package/build/core/asmail/config/index.d.ts +2 -2
  3. package/build/core/asmail/config/index.js +2 -2
  4. package/build/core/asmail/config/invitations-anon.d.ts +10 -24
  5. package/build/core/asmail/config/invitations-anon.js +43 -31
  6. package/build/core/asmail/config/published-intro-key.d.ts +11 -22
  7. package/build/core/asmail/config/published-intro-key.js +47 -38
  8. package/build/core/asmail/delivery/per-recipient-wip.js +2 -2
  9. package/build/core/asmail/inbox/inbox-events.js +10 -5
  10. package/build/core/asmail/inbox/index.d.ts +3 -2
  11. package/build/core/asmail/inbox/index.js +15 -11
  12. package/build/core/asmail/inbox/msg-indexing.d.ts +17 -64
  13. package/build/core/asmail/inbox/msg-indexing.js +440 -311
  14. package/build/core/asmail/inbox/msg-on-disk.js +2 -1
  15. package/build/core/asmail/index.d.ts +1 -1
  16. package/build/core/asmail/index.js +5 -4
  17. package/build/core/asmail/keyring/correspondent-keys.d.ts +2 -2
  18. package/build/core/asmail/keyring/correspondent-keys.js +4 -2
  19. package/build/core/asmail/keyring/index.d.ts +10 -33
  20. package/build/core/asmail/keyring/index.js +88 -75
  21. package/build/core/asmail/msg/opener.js +4 -3
  22. package/build/core/asmail/msg/packer.d.ts +1 -0
  23. package/build/core/asmail/msg/packer.js +8 -4
  24. package/build/core/index.js +3 -5
  25. package/build/core/sign-in.js +1 -1
  26. package/build/core/storage/local/obj-files.js +2 -1
  27. package/build/core/storage/synced/obj-files.d.ts +2 -0
  28. package/build/core/storage/synced/obj-files.js +18 -1
  29. package/build/core/storage/synced/obj-status.d.ts +1 -0
  30. package/build/core/storage/synced/obj-status.js +10 -0
  31. package/build/core/storage/synced/storage.js +7 -23
  32. package/build/core/storage/synced/upload-header-file.js +4 -2
  33. package/build/core/storage/synced/upsyncer.js +3 -5
  34. package/build/ipc-via-protobuf/asmail-cap.js +14 -15
  35. package/build/ipc-via-protobuf/bytes.js +42 -18
  36. package/build/ipc-via-protobuf/file.d.ts +7 -0
  37. package/build/ipc-via-protobuf/file.js +103 -66
  38. package/build/ipc-via-protobuf/fs.js +127 -105
  39. package/build/ipc-via-protobuf/mailerid.js +2 -2
  40. package/build/ipc-via-protobuf/protobuf-msg.d.ts +1 -0
  41. package/build/ipc-via-protobuf/protobuf-msg.js +5 -1
  42. package/build/ipc-via-protobuf/startup-cap.js +8 -8
  43. package/build/ipc-via-protobuf/storage-cap.js +4 -4
  44. package/build/lib-client/3nstorage/xsp-fs/common.js +2 -0
  45. package/build/lib-client/3nstorage/xsp-fs/file-node.d.ts +5 -10
  46. package/build/lib-client/3nstorage/xsp-fs/file-node.js +26 -45
  47. package/build/lib-client/3nstorage/xsp-fs/file.d.ts +8 -7
  48. package/build/lib-client/3nstorage/xsp-fs/file.js +12 -18
  49. package/build/lib-client/3nstorage/xsp-fs/folder-node.d.ts +6 -1
  50. package/build/lib-client/3nstorage/xsp-fs/folder-node.js +20 -8
  51. package/build/lib-client/3nstorage/xsp-fs/fs.d.ts +19 -18
  52. package/build/lib-client/3nstorage/xsp-fs/fs.js +18 -19
  53. package/build/lib-client/3nstorage/xsp-fs/node-in-fs.d.ts +13 -4
  54. package/build/lib-client/3nstorage/xsp-fs/node-in-fs.js +63 -8
  55. package/build/lib-client/3nstorage/xsp-fs/node-persistence.d.ts +1 -0
  56. package/build/lib-client/3nstorage/xsp-fs/node-persistence.js +7 -5
  57. package/build/lib-client/3nstorage/xsp-fs/xsp-payload-v1.js +3 -4
  58. package/build/lib-client/3nstorage/xsp-fs/xsp-payload-v2.js +20 -15
  59. package/build/lib-client/cryptor/cryptor-in-worker.js +37 -47
  60. package/build/lib-client/cryptor/cryptor-wasm.js +1 -1
  61. package/build/lib-client/cryptor/cryptor.wasm +0 -0
  62. package/build/lib-client/cryptor/in-proc-js.js +15 -12
  63. package/build/lib-client/cryptor/in-proc-wasm.js +11 -8
  64. package/build/lib-client/cryptor/serialization-for-wasm.d.ts +36 -0
  65. package/build/lib-client/cryptor/serialization-for-wasm.js +58 -0
  66. package/build/lib-client/cryptor-work-labels.d.ts +26 -0
  67. package/build/lib-client/cryptor-work-labels.js +152 -0
  68. package/build/lib-client/fs-sync-utils.d.ts +7 -1
  69. package/build/lib-client/fs-sync-utils.js +18 -7
  70. package/build/lib-client/local-files/dev-file-src.d.ts +2 -1
  71. package/build/lib-client/local-files/dev-file-src.js +5 -1
  72. package/build/lib-client/local-files/device-fs.js +2 -1
  73. package/build/lib-client/objs-on-disk/obj-on-disk.d.ts +5 -2
  74. package/build/lib-client/objs-on-disk/obj-on-disk.js +21 -2
  75. package/build/lib-client/request-utils.js +14 -14
  76. package/build/lib-common/async-cryptor-wrap.d.ts +9 -9
  77. package/build/lib-common/async-cryptor-wrap.js +13 -13
  78. package/build/lib-common/byte-streaming/pipe.d.ts +1 -1
  79. package/build/lib-common/byte-streaming/pipe.js +3 -3
  80. package/build/lib-common/byte-streaming/wrapping.js +4 -2
  81. package/build/lib-common/json-utils.js +0 -3
  82. package/build/lib-common/objs-on-disk/file-layout.js +1 -1
  83. package/build/lib-common/processes/synced.js +0 -184
  84. package/build/lib-sqlite-on-3nstorage/index.d.ts +32 -0
  85. package/build/lib-sqlite-on-3nstorage/index.js +117 -0
  86. package/build/lib-sqlite-on-3nstorage/sqljs.d.ts +279 -0
  87. package/build/lib-sqlite-on-3nstorage/sqljs.js +223 -0
  88. package/build/protos/asmail.proto.js +10145 -5923
  89. package/build/protos/bytes.proto.js +731 -204
  90. package/build/protos/common.proto.js +192 -44
  91. package/build/protos/cryptor.proto.js +184 -61
  92. package/build/protos/file.proto.js +2388 -502
  93. package/build/protos/fs.proto.js +9894 -6046
  94. package/build/protos/ipc.proto.js +244 -61
  95. package/build/protos/logger.proto.js +219 -53
  96. package/build/protos/mailerid.proto.js +230 -50
  97. package/build/protos/startup.proto.js +341 -77
  98. package/build/protos/storage.proto.js +276 -62
  99. package/package.json +8 -7
  100. package/protos/bytes.proto +13 -4
  101. package/protos/file.proto +27 -8
  102. package/protos/fs.proto +31 -14
@@ -16,7 +16,7 @@
16
16
  this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  */
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.vListVersions = exports.remoteAdoptionOptsFromMsg = exports.remoteAdoptionOptsToMsg = exports.optionsToUploadLocalFromMsg = exports.optionsToUploadLocalToMsg = exports.vGetByteSink = exports.updateXAttrs = exports.xattrFromMsg = exports.xattrToMsg = exports.vGetByteSource = exports.vReadJSON = exports.vReadTxt = exports.vReadBytes = exports.vListXAttrs = exports.vGetXAttr = exports.unpackFileEvent = exports.packFileEvent = exports.unpackJSON = exports.packJSON = exports.readBytes = exports.unpackXAttrValue = exports.packXAttrValue = exports.unpackSyncStatus = exports.packSyncStatus = exports.unpackStats = exports.packStats = exports.fileMsgType = exports.exposeFileService = exports.makeFileCaller = void 0;
19
+ exports.vListVersions = exports.remoteAdoptionOptsFromMsg = exports.remoteAdoptionOptsToMsg = exports.optionsToUploadLocalFromMsg = exports.optionsToUploadLocalToMsg = exports.vGetByteSink = exports.updateXAttrs = exports.xattrFromMsg = exports.xattrToMsg = exports.vGetByteSource = exports.vReadJSON = exports.vReadTxt = exports.vReadBytes = exports.vListXAttrs = exports.vGetXAttr = exports.versionedReadFlagsToMsg = exports.versionedReadFlagsFromMsg = exports.unpackFileEvent = exports.packFileEvent = exports.unpackJSON = exports.packJSON = exports.readBytes = exports.unpackXAttrValue = exports.packXAttrValue = exports.unpackSyncStatus = exports.packSyncStatus = exports.unpackStats = exports.packStats = exports.fileMsgType = exports.exposeFileService = exports.makeFileCaller = void 0;
20
20
  const protobuf_msg_1 = require("./protobuf-msg");
21
21
  const protobuf_type_1 = require("../lib-client/protobuf-type");
22
22
  const file_proto_1 = require("../protos/file.proto");
@@ -52,7 +52,7 @@ function makeFileCaller(caller, fileMsg) {
52
52
  file.writeTxt = writeTxt.makeCaller(caller, objPath);
53
53
  }
54
54
  if (fileMsg.isVersioned) {
55
- const vPath = objPath.concat('v');
55
+ const vPath = (0, protobuf_msg_1.methodPathFor)(objPath, 'v');
56
56
  file.v = {
57
57
  getByteSource: vGetByteSource.makeCaller(caller, vPath),
58
58
  getXAttr: vGetXAttr.makeCaller(caller, vPath),
@@ -72,8 +72,7 @@ function makeFileCaller(caller, fileMsg) {
72
72
  file.v.archiveCurrent = vArchiveCurrent.makeCaller(caller, vPath);
73
73
  }
74
74
  if (fileMsg.isSynced) {
75
- const vsPath = objPath.concat('v', 'sync');
76
- const vsConnectPath = objPath.concat('v', 'sync', 'connect');
75
+ const vsPath = (0, protobuf_msg_1.methodPathFor)(vPath, 'sync');
77
76
  file.v.sync = {
78
77
  status: vsStatus.makeCaller(caller, vsPath),
79
78
  updateStatusInfo: vsUpdateStatusInfo.makeCaller(caller, vsPath),
@@ -248,7 +247,7 @@ var stat;
248
247
  }
249
248
  stat.wrapService = wrapService;
250
249
  function makeCaller(caller, objPath) {
251
- const path = objPath.concat('stat');
250
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'stat');
252
251
  return () => caller
253
252
  .startPromiseCall(path, undefined)
254
253
  .then(unpackStats);
@@ -298,7 +297,7 @@ var getXAttr;
298
297
  }
299
298
  getXAttr.wrapService = wrapService;
300
299
  function makeCaller(caller, objPath) {
301
- const path = objPath.concat('getXAttr');
300
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'getXAttr');
302
301
  return xaName => caller
303
302
  .startPromiseCall(path, requestType.pack({ xaName }))
304
303
  .then(unpackXAttrValue);
@@ -317,7 +316,7 @@ var listXAttrs;
317
316
  }
318
317
  listXAttrs.wrapService = wrapService;
319
318
  function makeCaller(caller, objPath) {
320
- const path = objPath.concat('listXAttrs');
319
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'listXAttrs');
321
320
  return () => caller
322
321
  .startPromiseCall(path, undefined)
323
322
  .then(buf => (0, protobuf_msg_1.fixArray)(protobuf_msg_1.strArrValType.unpack(buf).values));
@@ -347,7 +346,7 @@ var readBytes;
347
346
  }
348
347
  readBytes.wrapService = wrapService;
349
348
  function makeCaller(caller, objPath) {
350
- const path = objPath.concat('readBytes');
349
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'readBytes');
351
350
  return (start, end) => caller
352
351
  .startPromiseCall(path, requestType.pack({
353
352
  start: (0, protobuf_msg_1.toOptVal)(start), end: (0, protobuf_msg_1.toOptVal)(end)
@@ -368,7 +367,7 @@ var readTxt;
368
367
  }
369
368
  readTxt.wrapService = wrapService;
370
369
  function makeCaller(caller, objPath) {
371
- const path = objPath.concat('readTxt');
370
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'readTxt');
372
371
  return () => caller
373
372
  .startPromiseCall(path, undefined)
374
373
  .then(buf => (buf ? (0, protobuf_msg_1.decodeFromUtf8)(buf) : ''));
@@ -403,7 +402,7 @@ var readJSON;
403
402
  }
404
403
  readJSON.wrapService = wrapService;
405
404
  function makeCaller(caller, objPath) {
406
- const path = objPath.concat('readJSON');
405
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'readJSON');
407
406
  return () => caller
408
407
  .startPromiseCall(path, undefined)
409
408
  .then(unpackJSON);
@@ -425,7 +424,7 @@ var getByteSource;
425
424
  }
426
425
  getByteSource.wrapService = wrapService;
427
426
  function makeCaller(caller, objPath) {
428
- const path = objPath.concat('getByteSource');
427
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'getByteSource');
429
428
  return () => caller
430
429
  .startPromiseCall(path, undefined)
431
430
  .then(buf => {
@@ -520,7 +519,7 @@ var watch;
520
519
  }
521
520
  watch.wrapService = wrapService;
522
521
  function makeCaller(caller, objPath) {
523
- const path = objPath.concat('watch');
522
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'watch');
524
523
  return obs => {
525
524
  const s = new rxjs_1.Subject();
526
525
  const unsub = caller.startObservableCall(path, undefined, s);
@@ -533,9 +532,29 @@ var watch;
533
532
  watch.makeCaller = makeCaller;
534
533
  })(watch || (watch = {}));
535
534
  Object.freeze(watch);
535
+ function versionedReadFlagsFromMsg(msg) {
536
+ if (!msg) {
537
+ return;
538
+ }
539
+ return {
540
+ archivedVersion: (0, protobuf_msg_1.valOfOptInt)(msg.archivedVersion),
541
+ remoteVersion: (0, protobuf_msg_1.valOfOptInt)(msg.remoteVersion)
542
+ };
543
+ }
544
+ exports.versionedReadFlagsFromMsg = versionedReadFlagsFromMsg;
545
+ function versionedReadFlagsToMsg(flags) {
546
+ if (!flags) {
547
+ return;
548
+ }
549
+ return {
550
+ archivedVersion: (0, protobuf_msg_1.toOptVal)(flags.archivedVersion),
551
+ remoteVersion: (0, protobuf_msg_1.toOptVal)(flags.remoteVersion)
552
+ };
553
+ }
554
+ exports.versionedReadFlagsToMsg = versionedReadFlagsToMsg;
536
555
  var vGetXAttr;
537
556
  (function (vGetXAttr) {
538
- const requestType = protobuf_type_1.ProtoType.for(file_proto_1.file.GetXAttrRequestBody);
557
+ const requestType = protobuf_type_1.ProtoType.for(file_proto_1.file.VersionedGetXAttrRequestBody);
539
558
  vGetXAttr.replyType = protobuf_type_1.ProtoType.for(file_proto_1.file.VersionedGetXAttrReplyBody);
540
559
  function unpackReply(buf) {
541
560
  const { json, str, bytes, version: v } = vGetXAttr.replyType.unpack(buf);
@@ -553,8 +572,8 @@ var vGetXAttr;
553
572
  vGetXAttr.unpackReply = unpackReply;
554
573
  function wrapService(fn) {
555
574
  return buf => {
556
- const { xaName } = requestType.unpack(buf);
557
- const promise = fn(xaName)
575
+ const { xaName, flags } = requestType.unpack(buf);
576
+ const promise = fn(xaName, versionedReadFlagsFromMsg(flags))
558
577
  .then(({ attr, version }) => {
559
578
  if (Buffer.isBuffer(attr)) {
560
579
  return vGetXAttr.replyType.pack({ version, bytes: (0, protobuf_msg_1.toVal)(attr) });
@@ -571,29 +590,41 @@ var vGetXAttr;
571
590
  }
572
591
  vGetXAttr.wrapService = wrapService;
573
592
  function makeCaller(caller, objPath) {
574
- const path = objPath.concat('getXAttr');
575
- return () => caller
576
- .startPromiseCall(path, undefined)
593
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'getXAttr');
594
+ return (xaName, flags) => caller
595
+ .startPromiseCall(path, requestType.pack({
596
+ xaName, flags: versionedReadFlagsToMsg(flags)
597
+ }))
577
598
  .then(unpackReply);
578
599
  }
579
600
  vGetXAttr.makeCaller = makeCaller;
580
601
  })(vGetXAttr = exports.vGetXAttr || (exports.vGetXAttr = {}));
581
602
  Object.freeze(vGetXAttr);
603
+ const requestWithReadFlags = protobuf_type_1.ProtoType.for(file_proto_1.file.RequestWithVersionedReadFlags);
604
+ function packVersionedReadFlagsRequest(flags) {
605
+ return requestWithReadFlags.pack({
606
+ flags: versionedReadFlagsToMsg(flags)
607
+ });
608
+ }
609
+ function unpackVersionedReadFlagsRequest(buf) {
610
+ const { flags } = requestWithReadFlags.unpack(buf);
611
+ return versionedReadFlagsFromMsg(flags);
612
+ }
582
613
  var vListXAttrs;
583
614
  (function (vListXAttrs) {
584
615
  vListXAttrs.replyType = protobuf_type_1.ProtoType.for(file_proto_1.file.VersionedListXAttrsReplyBody);
585
616
  function wrapService(fn) {
586
- return () => {
587
- const promise = fn()
617
+ return buf => {
618
+ const promise = fn(unpackVersionedReadFlagsRequest(buf))
588
619
  .then(({ version, lst }) => vListXAttrs.replyType.pack({ version, xaNames: lst }));
589
620
  return { promise };
590
621
  };
591
622
  }
592
623
  vListXAttrs.wrapService = wrapService;
593
624
  function makeCaller(caller, objPath) {
594
- const path = objPath.concat('listXAttrs');
595
- return () => caller
596
- .startPromiseCall(path, undefined)
625
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'listXAttrs');
626
+ return flags => caller
627
+ .startPromiseCall(path, packVersionedReadFlagsRequest(flags))
597
628
  .then(buf => {
598
629
  const { xaNames, version: v } = vListXAttrs.replyType.unpack(buf);
599
630
  return { version: (0, protobuf_msg_1.fixInt)(v), lst: (xaNames ? xaNames : []) };
@@ -604,7 +635,7 @@ var vListXAttrs;
604
635
  Object.freeze(vListXAttrs);
605
636
  var vReadBytes;
606
637
  (function (vReadBytes) {
607
- const requestType = protobuf_type_1.ProtoType.for(file_proto_1.file.ReadBytesRequestBody);
638
+ const requestType = protobuf_type_1.ProtoType.for(file_proto_1.file.VersionedReadBytesRequestBody);
608
639
  const replyType = protobuf_type_1.ProtoType.for(file_proto_1.file.VersionedReadBytesReplyBody);
609
640
  function packReply(r) {
610
641
  return replyType.pack({
@@ -619,18 +650,19 @@ var vReadBytes;
619
650
  vReadBytes.unpackReply = unpackReply;
620
651
  function wrapService(fn) {
621
652
  return buf => {
622
- const { start, end } = requestType.unpack(buf);
623
- const promise = fn((0, protobuf_msg_1.valOfOptInt)(start), (0, protobuf_msg_1.valOfOptInt)(end))
653
+ const { start, end, flags } = requestType.unpack(buf);
654
+ const promise = fn((0, protobuf_msg_1.valOfOptInt)(start), (0, protobuf_msg_1.valOfOptInt)(end), versionedReadFlagsFromMsg(flags))
624
655
  .then(packReply);
625
656
  return { promise };
626
657
  };
627
658
  }
628
659
  vReadBytes.wrapService = wrapService;
629
660
  function makeCaller(caller, objPath) {
630
- const path = objPath.concat('readBytes');
631
- return (start, end) => caller
661
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'readBytes');
662
+ return (start, end, flags) => caller
632
663
  .startPromiseCall(path, requestType.pack({
633
- start: (0, protobuf_msg_1.toOptVal)(start), end: (0, protobuf_msg_1.toOptVal)(end)
664
+ start: (0, protobuf_msg_1.toOptVal)(start), end: (0, protobuf_msg_1.toOptVal)(end),
665
+ flags: versionedReadFlagsToMsg(flags)
634
666
  }))
635
667
  .then(unpackReply);
636
668
  }
@@ -641,17 +673,17 @@ var vReadTxt;
641
673
  (function (vReadTxt) {
642
674
  vReadTxt.replyType = protobuf_type_1.ProtoType.for(file_proto_1.file.VersionedReadTxtReplyBody);
643
675
  function wrapService(fn) {
644
- return () => {
645
- const promise = fn()
676
+ return buf => {
677
+ const promise = fn(unpackVersionedReadFlagsRequest(buf))
646
678
  .then(verAndTxt => vReadTxt.replyType.pack(verAndTxt));
647
679
  return { promise };
648
680
  };
649
681
  }
650
682
  vReadTxt.wrapService = wrapService;
651
683
  function makeCaller(caller, objPath) {
652
- const path = objPath.concat('readTxt');
653
- return () => caller
654
- .startPromiseCall(path, undefined)
684
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'readTxt');
685
+ return flags => caller
686
+ .startPromiseCall(path, packVersionedReadFlagsRequest(flags))
655
687
  .then(buf => {
656
688
  const { version: v, txt } = vReadTxt.replyType.unpack(buf);
657
689
  return { version: (0, protobuf_msg_1.fixInt)(v), txt };
@@ -664,8 +696,8 @@ var vReadJSON;
664
696
  (function (vReadJSON) {
665
697
  vReadJSON.replyType = protobuf_type_1.ProtoType.for(file_proto_1.file.VersionedReadJsonReplyBody);
666
698
  function wrapService(fn) {
667
- return () => {
668
- const promise = fn()
699
+ return buf => {
700
+ const promise = fn(unpackVersionedReadFlagsRequest(buf))
669
701
  .then(({ version, json }) => {
670
702
  return vReadJSON.replyType.pack({ version, json: JSON.stringify(json) });
671
703
  });
@@ -674,9 +706,9 @@ var vReadJSON;
674
706
  }
675
707
  vReadJSON.wrapService = wrapService;
676
708
  function makeCaller(caller, objPath) {
677
- const path = objPath.concat('readJSON');
678
- return () => caller
679
- .startPromiseCall(path, undefined)
709
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'readJSON');
710
+ return flags => caller
711
+ .startPromiseCall(path, packVersionedReadFlagsRequest(flags))
680
712
  .then(buf => {
681
713
  const { version: v, json } = vReadJSON.replyType.unpack(buf);
682
714
  try {
@@ -694,8 +726,8 @@ var vGetByteSource;
694
726
  (function (vGetByteSource) {
695
727
  vGetByteSource.replyType = protobuf_type_1.ProtoType.for(file_proto_1.file.VersionedGetByteSourceReplyBody);
696
728
  function wrapService(fn, expServices) {
697
- return () => {
698
- const promise = fn()
729
+ return buf => {
730
+ const promise = fn(unpackVersionedReadFlagsRequest(buf))
699
731
  .then(({ version, src }) => {
700
732
  const ref = (0, bytes_1.exposeSrcService)(src, expServices);
701
733
  return vGetByteSource.replyType.pack({ version, src: ref });
@@ -705,9 +737,9 @@ var vGetByteSource;
705
737
  }
706
738
  vGetByteSource.wrapService = wrapService;
707
739
  function makeCaller(caller, objPath) {
708
- const path = objPath.concat('getByteSource');
709
- return () => caller
710
- .startPromiseCall(path, undefined)
740
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'getByteSource');
741
+ return flags => caller
742
+ .startPromiseCall(path, packVersionedReadFlagsRequest(flags))
711
743
  .then(buf => {
712
744
  const { version: v, src: ref } = vGetByteSource.replyType.unpack(buf);
713
745
  return { version: (0, protobuf_msg_1.fixInt)(v), src: (0, bytes_1.makeSrcCaller)(caller, ref) };
@@ -795,7 +827,7 @@ var updateXAttrs;
795
827
  }
796
828
  updateXAttrs.packXAttrsChanges = packXAttrsChanges;
797
829
  function makeCaller(caller, objPath) {
798
- const path = objPath.concat('updateXAttrs');
830
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'updateXAttrs');
799
831
  return async (changes) => {
800
832
  await caller.startPromiseCall(path, packXAttrsChanges(changes));
801
833
  };
@@ -815,7 +847,7 @@ var writeBytes;
815
847
  }
816
848
  writeBytes.wrapService = wrapService;
817
849
  function makeCaller(caller, objPath) {
818
- const path = objPath.concat('writeBytes');
850
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'writeBytes');
819
851
  return bytes => caller
820
852
  .startPromiseCall(path, requestType.pack({
821
853
  bytes: bytes
@@ -836,7 +868,7 @@ var writeTxt;
836
868
  }
837
869
  writeTxt.wrapService = wrapService;
838
870
  function makeCaller(caller, objPath) {
839
- const path = objPath.concat('writeTxt');
871
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'writeTxt');
840
872
  return txt => caller
841
873
  .startPromiseCall(path, requestType.pack({ txt }));
842
874
  }
@@ -855,7 +887,7 @@ var writeJSON;
855
887
  }
856
888
  writeJSON.wrapService = wrapService;
857
889
  function makeCaller(caller, objPath) {
858
- const path = objPath.concat('writeJSON');
890
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'writeJSON');
859
891
  return json => caller
860
892
  .startPromiseCall(path, requestType.pack({
861
893
  json: JSON.stringify(json)
@@ -880,7 +912,7 @@ var getByteSink;
880
912
  }
881
913
  getByteSink.wrapService = wrapService;
882
914
  function makeCaller(caller, objPath) {
883
- const path = objPath.concat('getByteSink');
915
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'getByteSink');
884
916
  return truncateFile => caller
885
917
  .startPromiseCall(path, requestType.pack({
886
918
  truncateFile: (0, protobuf_msg_1.toOptVal)(truncateFile)
@@ -906,7 +938,7 @@ var copy;
906
938
  }
907
939
  copy.wrapService = wrapService;
908
940
  function makeCaller(caller, objPath) {
909
- const path = objPath.concat('copy');
941
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'copy');
910
942
  return async (file) => {
911
943
  const fRef = caller.srvRefOf(file);
912
944
  await caller
@@ -929,7 +961,7 @@ var vCopy;
929
961
  }
930
962
  vCopy.wrapService = wrapService;
931
963
  function makeCaller(caller, objPath) {
932
- const path = objPath.concat('copy');
964
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'copy');
933
965
  return file => {
934
966
  const fRef = caller.srvRefOf(file);
935
967
  return caller
@@ -952,7 +984,7 @@ var vUpdateXAttrs;
952
984
  }
953
985
  vUpdateXAttrs.wrapService = wrapService;
954
986
  function makeCaller(caller, objPath) {
955
- const path = objPath.concat('updateXAttrs');
987
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'updateXAttrs');
956
988
  return changes => {
957
989
  const reqBody = updateXAttrs.packXAttrsChanges(changes);
958
990
  return caller.startPromiseCall(path, reqBody)
@@ -975,7 +1007,7 @@ var vWriteBytes;
975
1007
  }
976
1008
  vWriteBytes.wrapService = wrapService;
977
1009
  function makeCaller(caller, objPath) {
978
- const path = objPath.concat('writeBytes');
1010
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'writeBytes');
979
1011
  return bytes => caller
980
1012
  .startPromiseCall(path, requestType.pack({ bytes: bytes }))
981
1013
  .then(protobuf_msg_1.unpackInt);
@@ -996,7 +1028,7 @@ var vWriteTxt;
996
1028
  }
997
1029
  vWriteTxt.wrapService = wrapService;
998
1030
  function makeCaller(caller, objPath) {
999
- const path = objPath.concat('writeTxt');
1031
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'writeTxt');
1000
1032
  return txt => caller
1001
1033
  .startPromiseCall(path, requestType.pack({ txt }))
1002
1034
  .then(protobuf_msg_1.unpackInt);
@@ -1017,7 +1049,7 @@ var vWriteJSON;
1017
1049
  }
1018
1050
  vWriteJSON.wrapService = wrapService;
1019
1051
  function makeCaller(caller, objPath) {
1020
- const path = objPath.concat('writeJSON');
1052
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'writeJSON');
1021
1053
  return json => caller
1022
1054
  .startPromiseCall(path, requestType.pack({ json: JSON.stringify(json) }))
1023
1055
  .then(protobuf_msg_1.unpackInt);
@@ -1042,7 +1074,7 @@ var vGetByteSink;
1042
1074
  }
1043
1075
  vGetByteSink.wrapService = wrapService;
1044
1076
  function makeCaller(caller, objPath) {
1045
- const path = objPath.concat('getByteSink');
1077
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'getByteSink');
1046
1078
  return (truncateFile, currentVersion) => caller
1047
1079
  .startPromiseCall(path, requestType.pack({
1048
1080
  truncateFile: (0, protobuf_msg_1.toOptVal)(truncateFile),
@@ -1067,7 +1099,7 @@ var vsStatus;
1067
1099
  }
1068
1100
  vsStatus.wrapService = wrapService;
1069
1101
  function makeCaller(caller, objPath) {
1070
- const path = objPath.concat('status');
1102
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'status');
1071
1103
  return () => caller
1072
1104
  .startPromiseCall(path, undefined)
1073
1105
  .then(unpackSyncStatus);
@@ -1086,7 +1118,7 @@ var vsUpdateStatusInfo;
1086
1118
  }
1087
1119
  vsUpdateStatusInfo.wrapService = wrapService;
1088
1120
  function makeCaller(caller, objPath) {
1089
- const path = objPath.concat('updateStatusInfo');
1121
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'updateStatusInfo');
1090
1122
  return () => caller
1091
1123
  .startPromiseCall(path, undefined)
1092
1124
  .then(unpackSyncStatus);
@@ -1108,7 +1140,7 @@ var vsIsRemoteVersionOnDisk;
1108
1140
  }
1109
1141
  vsIsRemoteVersionOnDisk.wrapService = wrapService;
1110
1142
  function makeCaller(caller, objPath) {
1111
- const path = objPath.concat('isRemoteVersionOnDisk');
1143
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'isRemoteVersionOnDisk');
1112
1144
  return version => caller
1113
1145
  .startPromiseCall(path, requestType.pack({ version }))
1114
1146
  .then(buf => replyType.unpack(buf).status);
@@ -1128,7 +1160,7 @@ var vsDownload;
1128
1160
  }
1129
1161
  vsDownload.wrapService = wrapService;
1130
1162
  function makeCaller(caller, objPath) {
1131
- const path = objPath.concat('download');
1163
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'download');
1132
1164
  return version => caller
1133
1165
  .startPromiseCall(path, requestType.pack({ version }));
1134
1166
  }
@@ -1158,20 +1190,25 @@ exports.optionsToUploadLocalFromMsg = optionsToUploadLocalFromMsg;
1158
1190
  var vsUpload;
1159
1191
  (function (vsUpload) {
1160
1192
  const requestType = protobuf_type_1.ProtoType.for(file_proto_1.file.FileSyncUploadRequestBody);
1193
+ const replyType = protobuf_type_1.ProtoType.for(file_proto_1.file.FileSyncUploadReplyBody);
1161
1194
  function wrapService(fn) {
1162
1195
  return buf => {
1163
1196
  const { opts } = requestType.unpack(buf);
1164
- const promise = fn(optionsToUploadLocalFromMsg(opts));
1197
+ const promise = fn(optionsToUploadLocalFromMsg(opts))
1198
+ .then(uploadedVersion => replyType.pack({
1199
+ uploadedVersion: (0, protobuf_msg_1.toOptVal)(uploadedVersion)
1200
+ }));
1165
1201
  return { promise };
1166
1202
  };
1167
1203
  }
1168
1204
  vsUpload.wrapService = wrapService;
1169
1205
  function makeCaller(caller, objPath) {
1170
- const path = objPath.concat('upload');
1206
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'upload');
1171
1207
  return opts => caller
1172
1208
  .startPromiseCall(path, requestType.pack({
1173
1209
  opts: optionsToUploadLocalToMsg(opts)
1174
- }));
1210
+ }))
1211
+ .then(buf => (0, protobuf_msg_1.valOfOptInt)(replyType.unpack(buf).uploadedVersion));
1175
1212
  }
1176
1213
  vsUpload.makeCaller = makeCaller;
1177
1214
  })(vsUpload || (vsUpload = {}));
@@ -1208,7 +1245,7 @@ var vsAdoptRemote;
1208
1245
  }
1209
1246
  vsAdoptRemote.wrapService = wrapService;
1210
1247
  function makeCaller(caller, objPath) {
1211
- const path = objPath.concat('adoptRemote');
1248
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'adoptRemote');
1212
1249
  return opts => caller
1213
1250
  .startPromiseCall(path, requestType.pack({
1214
1251
  opts: remoteAdoptionOptsToMsg(opts)
@@ -1245,7 +1282,7 @@ var vListVersions;
1245
1282
  }
1246
1283
  vListVersions.wrapService = wrapService;
1247
1284
  function makeCaller(caller, objPath) {
1248
- const path = objPath.concat('listVersions');
1285
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'listVersions');
1249
1286
  return () => caller
1250
1287
  .startPromiseCall(path)
1251
1288
  .then(unpackReply);
@@ -1266,7 +1303,7 @@ var vArchiveCurrent;
1266
1303
  }
1267
1304
  vArchiveCurrent.wrapService = wrapService;
1268
1305
  function makeCaller(caller, objPath) {
1269
- const path = objPath.concat('archiveCurrent');
1306
+ const path = (0, protobuf_msg_1.methodPathFor)(objPath, 'archiveCurrent');
1270
1307
  return version => caller
1271
1308
  .startPromiseCall(path, requestType.pack({ version: (0, protobuf_msg_1.toOptVal)(version) }))
1272
1309
  .then(protobuf_msg_1.unpackInt);