core-3nweb-client-lib 0.26.1 → 0.27.3

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 (211) hide show
  1. package/build/api-defs/asmail.d.ts +1 -1
  2. package/build/api-defs/files.d.ts +281 -75
  3. package/build/core/app-files.js +7 -7
  4. package/build/core/asmail/config/common.js +2 -2
  5. package/build/core/asmail/config/index.js +2 -2
  6. package/build/core/asmail/config/published-intro-key.js +1 -1
  7. package/build/core/asmail/delivery/common.js +7 -7
  8. package/build/core/asmail/delivery/index.js +5 -5
  9. package/build/core/asmail/delivery/msg.js +4 -4
  10. package/build/core/asmail/delivery/per-recipient-wip.js +1 -1
  11. package/build/core/asmail/inbox/attachments/fs.d.ts +2 -1
  12. package/build/core/asmail/inbox/attachments/fs.js +9 -4
  13. package/build/core/asmail/inbox/cached-msgs.js +1 -1
  14. package/build/core/asmail/inbox/inbox-events.js +4 -4
  15. package/build/core/asmail/inbox/index.js +10 -10
  16. package/build/core/asmail/inbox/msg-downloader.js +1 -1
  17. package/build/core/asmail/inbox/msg-indexing.js +1 -1
  18. package/build/core/asmail/inbox/msg-on-disk.js +5 -5
  19. package/build/core/asmail/index.d.ts +3 -3
  20. package/build/core/asmail/index.js +13 -8
  21. package/build/core/asmail/key-verification.js +5 -5
  22. package/build/core/asmail/keyring/common.js +7 -6
  23. package/build/core/asmail/keyring/correspondent-keys.js +8 -7
  24. package/build/core/asmail/keyring/id-to-email-map.js +2 -1
  25. package/build/core/asmail/keyring/index.d.ts +7 -8
  26. package/build/core/asmail/keyring/index.js +15 -14
  27. package/build/core/asmail/keyring/keyring-storage.js +2 -1
  28. package/build/core/asmail/msg/opener.js +3 -3
  29. package/build/core/asmail/msg/packer.js +13 -13
  30. package/build/core/asmail/sending-params/own-params.js +2 -2
  31. package/build/core/asmail/sending-params/params-from-others.js +1 -1
  32. package/build/core/id-manager/index.d.ts +43 -0
  33. package/build/core/{id-manager.js → id-manager/index.js} +36 -114
  34. package/build/core/id-manager/key-storage.d.ts +21 -0
  35. package/build/core/id-manager/key-storage.js +96 -0
  36. package/build/core/index.d.ts +2 -1
  37. package/build/core/index.js +31 -33
  38. package/build/core/sign-in.d.ts +1 -2
  39. package/build/core/sign-in.js +8 -17
  40. package/build/core/sign-up.d.ts +2 -0
  41. package/build/core/sign-up.js +11 -10
  42. package/build/core/storage/common/json-saving.js +2 -2
  43. package/build/core/storage/common/obj-info-file.d.ts +12 -4
  44. package/build/core/storage/common/obj-info-file.js +66 -34
  45. package/build/core/storage/common/utils.d.ts +2 -0
  46. package/build/core/storage/common/utils.js +32 -0
  47. package/build/core/storage/index.d.ts +5 -17
  48. package/build/core/storage/index.js +78 -119
  49. package/build/core/storage/local/obj-files-gc.d.ts +2 -0
  50. package/build/core/storage/local/obj-files-gc.js +49 -37
  51. package/build/core/storage/local/obj-files.d.ts +4 -7
  52. package/build/core/storage/local/obj-files.js +7 -10
  53. package/build/core/storage/local/obj-status.d.ts +12 -6
  54. package/build/core/storage/local/obj-status.js +24 -9
  55. package/build/core/storage/local/storage.d.ts +10 -7
  56. package/build/core/storage/local/storage.js +29 -18
  57. package/build/core/storage/synced/downloader.js +1 -1
  58. package/build/core/storage/synced/obj-files-gc.d.ts +1 -0
  59. package/build/core/storage/synced/obj-files-gc.js +76 -39
  60. package/build/core/storage/synced/obj-files.d.ts +50 -36
  61. package/build/core/storage/synced/obj-files.js +201 -162
  62. package/build/core/storage/synced/obj-status.d.ts +99 -86
  63. package/build/core/storage/synced/obj-status.js +520 -251
  64. package/build/core/storage/synced/remote-events.d.ts +11 -12
  65. package/build/core/storage/synced/remote-events.js +73 -56
  66. package/build/core/storage/synced/storage.d.ts +24 -10
  67. package/build/core/storage/synced/storage.js +147 -47
  68. package/build/core/storage/synced/upload-header-file.d.ts +4 -0
  69. package/build/core/storage/synced/upload-header-file.js +64 -0
  70. package/build/core/storage/synced/upsyncer.d.ts +12 -7
  71. package/build/core/storage/synced/upsyncer.js +210 -280
  72. package/build/core/storage/system-folders/apps-data.d.ts +16 -0
  73. package/build/core/storage/system-folders/apps-data.js +110 -0
  74. package/build/core/storage/system-folders/index.d.ts +18 -0
  75. package/build/core/storage/system-folders/index.js +77 -0
  76. package/build/core-ipc/common-caps.js +3 -3
  77. package/build/core-ipc/generic.js +8 -8
  78. package/build/core-ipc/startup-caps.js +2 -2
  79. package/build/cryptors.js +6 -2
  80. package/build/ipc-via-protobuf/asmail-cap.js +58 -57
  81. package/build/ipc-via-protobuf/bytes.js +16 -17
  82. package/build/ipc-via-protobuf/connector-clients-side.d.ts +1 -0
  83. package/build/ipc-via-protobuf/connector-clients-side.js +14 -15
  84. package/build/ipc-via-protobuf/connector-services-side.js +10 -10
  85. package/build/ipc-via-protobuf/connector.js +4 -4
  86. package/build/ipc-via-protobuf/file.d.ts +48 -12
  87. package/build/ipc-via-protobuf/file.js +474 -126
  88. package/build/ipc-via-protobuf/fs.d.ts +8 -0
  89. package/build/ipc-via-protobuf/fs.js +577 -142
  90. package/build/ipc-via-protobuf/log-cap.js +2 -2
  91. package/build/ipc-via-protobuf/mailerid.js +3 -3
  92. package/build/ipc-via-protobuf/protobuf-msg.d.ts +1 -0
  93. package/build/ipc-via-protobuf/protobuf-msg.js +11 -7
  94. package/build/ipc-via-protobuf/startup-cap.js +21 -21
  95. package/build/ipc-via-protobuf/storage-cap.js +12 -12
  96. package/build/ipc.js +7 -2
  97. package/build/lib-client/3nstorage/exceptions.d.ts +16 -1
  98. package/build/lib-client/3nstorage/exceptions.js +21 -3
  99. package/build/lib-client/3nstorage/service.d.ts +21 -3
  100. package/build/lib-client/3nstorage/service.js +128 -46
  101. package/build/lib-client/3nstorage/util/file-based-json.d.ts +2 -1
  102. package/build/lib-client/3nstorage/util/file-based-json.js +3 -2
  103. package/build/lib-client/3nstorage/util/for-arrays.d.ts +1 -0
  104. package/build/lib-client/3nstorage/util/for-arrays.js +32 -0
  105. package/build/lib-client/3nstorage/xsp-fs/attrs.js +17 -17
  106. package/build/lib-client/3nstorage/xsp-fs/common.d.ts +44 -19
  107. package/build/lib-client/3nstorage/xsp-fs/common.js +30 -19
  108. package/build/lib-client/3nstorage/xsp-fs/file-node.d.ts +1 -0
  109. package/build/lib-client/3nstorage/xsp-fs/file-node.js +17 -13
  110. package/build/lib-client/3nstorage/xsp-fs/file.d.ts +31 -6
  111. package/build/lib-client/3nstorage/xsp-fs/file.js +73 -25
  112. package/build/lib-client/3nstorage/xsp-fs/folder-node-serialization.js +4 -4
  113. package/build/lib-client/3nstorage/xsp-fs/folder-node.d.ts +32 -13
  114. package/build/lib-client/3nstorage/xsp-fs/folder-node.js +752 -192
  115. package/build/lib-client/3nstorage/xsp-fs/fs.d.ts +35 -4
  116. package/build/lib-client/3nstorage/xsp-fs/fs.js +236 -119
  117. package/build/lib-client/3nstorage/xsp-fs/link-node.d.ts +1 -0
  118. package/build/lib-client/3nstorage/xsp-fs/link-node.js +7 -2
  119. package/build/lib-client/3nstorage/xsp-fs/node-in-fs.d.ts +30 -29
  120. package/build/lib-client/3nstorage/xsp-fs/node-in-fs.js +232 -127
  121. package/build/lib-client/3nstorage/xsp-fs/node-persistence.d.ts +1 -1
  122. package/build/lib-client/3nstorage/xsp-fs/node-persistence.js +17 -18
  123. package/build/lib-client/3nstorage/xsp-fs/xsp-payload-v1.js +3 -3
  124. package/build/lib-client/3nstorage/xsp-fs/xsp-payload-v2.js +53 -53
  125. package/build/lib-client/3nweb-signup.js +4 -4
  126. package/build/lib-client/asmail/recipient.js +15 -15
  127. package/build/lib-client/asmail/sender.js +22 -22
  128. package/build/lib-client/asmail/service-config.js +3 -3
  129. package/build/lib-client/cryptor/cryptor-in-worker.js +18 -16
  130. package/build/lib-client/cryptor/cryptor-wasm.js +1 -1
  131. package/build/lib-client/cryptor/cryptor.js +4 -2
  132. package/build/lib-client/cryptor/cryptor.wasm +0 -0
  133. package/build/lib-client/cryptor/in-proc-js.js +1 -1
  134. package/build/lib-client/cryptor/in-proc-wasm.js +6 -6
  135. package/build/lib-client/cryptor/worker-js.js +2 -2
  136. package/build/lib-client/cryptor/worker-wasm.js +2 -2
  137. package/build/lib-client/files-select.js +1 -1
  138. package/build/lib-client/files.d.ts +1 -1
  139. package/build/lib-client/files.js +71 -6
  140. package/build/lib-client/fs-collection.js +1 -1
  141. package/build/lib-client/fs-sync-utils.d.ts +5 -0
  142. package/build/lib-client/fs-sync-utils.js +61 -0
  143. package/build/lib-client/fs-view.d.ts +14 -0
  144. package/build/lib-client/fs-view.js +33 -0
  145. package/build/lib-client/key-derivation.js +1 -1
  146. package/build/lib-client/local-files/dev-file-sink.js +9 -9
  147. package/build/lib-client/local-files/dev-file-src.js +2 -2
  148. package/build/lib-client/local-files/device-fs.d.ts +1 -1
  149. package/build/lib-client/local-files/device-fs.js +56 -54
  150. package/build/lib-client/logging/log-to-file.d.ts +1 -1
  151. package/build/lib-client/logging/log-to-file.js +7 -7
  152. package/build/lib-client/mailer-id/login.js +7 -7
  153. package/build/lib-client/mailer-id/provisioner.js +12 -12
  154. package/build/lib-client/objs-on-disk/file-writing-proc.js +3 -3
  155. package/build/lib-client/objs-on-disk/obj-folders.js +31 -31
  156. package/build/lib-client/objs-on-disk/obj-on-disk.d.ts +13 -2
  157. package/build/lib-client/objs-on-disk/obj-on-disk.js +24 -9
  158. package/build/lib-client/request-utils.d.ts +1 -0
  159. package/build/lib-client/request-utils.js +13 -13
  160. package/build/lib-client/server-events.d.ts +3 -3
  161. package/build/lib-client/server-events.js +9 -8
  162. package/build/lib-client/service-locator.js +10 -10
  163. package/build/lib-client/user-with-mid-session.d.ts +2 -1
  164. package/build/lib-client/user-with-mid-session.js +14 -8
  165. package/build/lib-client/user-with-pkl-session.js +25 -25
  166. package/build/lib-client/ws-utils.js +2 -2
  167. package/build/lib-common/async-cryptor-wrap.js +4 -4
  168. package/build/lib-common/async-fs-node.d.ts +5 -3
  169. package/build/lib-common/async-fs-node.js +17 -17
  170. package/build/lib-common/byte-streaming/pipe.js +1 -1
  171. package/build/lib-common/byte-streaming/wrapping.js +13 -13
  172. package/build/lib-common/canonical-address.js +1 -1
  173. package/build/lib-common/exceptions/error.d.ts +1 -0
  174. package/build/lib-common/exceptions/error.js +7 -6
  175. package/build/lib-common/exceptions/file.d.ts +4 -2
  176. package/build/lib-common/exceptions/file.js +24 -54
  177. package/build/lib-common/ipc/generic-ipc.js +5 -4
  178. package/build/lib-common/ipc/ws-ipc.js +2 -2
  179. package/build/lib-common/mid-sigs-NaCl-Ed.js +14 -14
  180. package/build/lib-common/objs-on-disk/file-layout.d.ts +19 -0
  181. package/build/lib-common/objs-on-disk/file-layout.js +130 -12
  182. package/build/lib-common/objs-on-disk/obj-file.d.ts +13 -2
  183. package/build/lib-common/objs-on-disk/obj-file.js +96 -35
  184. package/build/lib-common/objs-on-disk/utils.d.ts +1 -0
  185. package/build/lib-common/objs-on-disk/utils.js +3 -3
  186. package/build/lib-common/objs-on-disk/v1-obj-file-format.js +14 -14
  187. package/build/lib-common/processes/labelled-exec-pools.d.ts +1 -1
  188. package/build/lib-common/processes/labelled-exec-pools.js +1 -1
  189. package/build/lib-common/processes/pressure.js +2 -2
  190. package/build/lib-common/processes/synced.js +1 -1
  191. package/build/lib-common/processes/timeout.js +2 -2
  192. package/build/lib-common/random-node.js +7 -7
  193. package/build/lib-common/service-api/3nstorage/owner.d.ts +101 -42
  194. package/build/lib-common/service-api/3nstorage/owner.js +83 -40
  195. package/build/lib-common/service-api/asmail/delivery.js +2 -2
  196. package/build/lib-common/service-api/asmail/retrieval.js +1 -1
  197. package/build/lib-common/timed-cache.d.ts +1 -0
  198. package/build/lib-common/timed-non-weak-cache.d.ts +1 -0
  199. package/build/lib-common/timed-non-weak-cache.js +11 -0
  200. package/build/lib-common/utils-for-observables.js +4 -4
  201. package/build/lib-common/weak-cache.d.ts +1 -0
  202. package/build/lib-common/weak-cache.js +12 -1
  203. package/build/lib-index.d.ts +2 -1
  204. package/build/lib-index.js +10 -7
  205. package/build/protos/asmail.proto.js +12955 -7496
  206. package/build/protos/file.proto.js +4867 -2744
  207. package/build/protos/fs.proto.js +9227 -3768
  208. package/package.json +7 -5
  209. package/protos/file.proto +91 -19
  210. package/protos/fs.proto +107 -8
  211. package/build/core/id-manager.d.ts +0 -46
@@ -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.fsItem = exports.fsMsgType = exports.exposeFSService = exports.makeFSCaller = void 0;
19
+ exports.optionsToAdoptRemoteItemFromMsg = exports.optionsToAdoptRemoteItemToMsg = exports.fsItem = exports.fsMsgType = exports.exposeFSService = exports.makeFSCaller = 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 fs_proto_1 = require("../protos/fs.proto");
@@ -30,7 +30,7 @@ const deferred_1 = require("../lib-common/processes/deferred");
30
30
  const operators_1 = require("rxjs/operators");
31
31
  const utils_for_observables_1 = require("../lib-common/utils-for-observables");
32
32
  function makeFSCaller(caller, fsMsg) {
33
- connector_1.checkRefObjTypeIs('FSImpl', fsMsg.impl);
33
+ (0, connector_1.checkRefObjTypeIs)('FSImpl', fsMsg.impl);
34
34
  const objPath = fsMsg.impl.path;
35
35
  const fs = {
36
36
  name: fsMsg.name,
@@ -54,7 +54,7 @@ function makeFSCaller(caller, fsMsg) {
54
54
  stat: stat.makeCaller(caller, objPath),
55
55
  watchFolder: watch.makeFolderCaller(caller, objPath),
56
56
  watchFile: watch.makeFileCaller(caller, objPath),
57
- watchTree: watch.makeTreeCaller(caller, objPath),
57
+ watchTree: watchTree.makeCaller(caller, objPath),
58
58
  };
59
59
  if (fsMsg.writable) {
60
60
  fs.copyFile = copyFile.makeCaller(caller, objPath);
@@ -85,13 +85,31 @@ function makeFSCaller(caller, fsMsg) {
85
85
  readBytes: vReadBytes.makeCaller(caller, vPath),
86
86
  readJSONFile: vReadJSONFile.makeCaller(caller, vPath),
87
87
  readTxtFile: vReadTxtFile.makeCaller(caller, vPath),
88
+ listVersions: vListVersions.makeCaller(caller, vPath)
88
89
  };
89
- if (fsMsg.writable) {
90
+ if (fs.writable) {
90
91
  fs.v.getByteSink = vGetByteSink.makeCaller(caller, vPath);
91
92
  fs.v.writeBytes = vWriteBytes.makeCaller(caller, vPath);
92
93
  fs.v.writeJSONFile = vWriteJSONFile.makeCaller(caller, vPath);
93
94
  fs.v.writeTxtFile = vWriteTxtFile.makeCaller(caller, vPath);
94
95
  fs.v.updateXAttrs = vUpdateXAttrs.makeCaller(caller, vPath);
96
+ fs.v.archiveCurrent = vArchiveCurrent.makeCaller(caller, vPath);
97
+ }
98
+ if (fsMsg.isSynced) {
99
+ const vsPath = objPath.concat('v', 'sync');
100
+ fs.v.sync = {
101
+ status: vsStatus.makeCaller(caller, vsPath),
102
+ updateStatusInfo: vsUpdateStatusInfo.makeCaller(caller, vsPath),
103
+ isRemoteVersionOnDisk: vsIsRemoteVersionOnDisk.makeCaller(caller, vsPath),
104
+ download: vsDownload.makeCaller(caller, vsPath),
105
+ adoptRemote: vsAdoptRemote.makeCaller(caller, vsPath),
106
+ diffCurrentAndRemoteFolderVersions: vsDiffCurrentAndRemoteFolderVersions.makeCaller(caller, vsPath)
107
+ };
108
+ if (fs.writable) {
109
+ fs.v.sync.upload = vsUpload.makeCaller(caller, vsPath);
110
+ fs.v.sync.adoptRemoteFolderItem =
111
+ vsAdoptRemoteFolderItem.makeCaller(caller, vsPath);
112
+ }
95
113
  }
96
114
  }
97
115
  caller.registerClientDrop(fs, fsMsg.impl);
@@ -118,7 +136,7 @@ function exposeFSService(fs, expServices) {
118
136
  stat: stat.wrapService(fs.stat),
119
137
  watchFolder: watch.wrapService(fs.watchFolder, packFSEvent),
120
138
  watchFile: watch.wrapService(fs.watchFile, file_1.packFileEvent),
121
- watchTree: watch.wrapService(fs.watchTree, packFSEvent),
139
+ watchTree: watchTree.wrapService(fs.watchTree),
122
140
  };
123
141
  if (fs.writable) {
124
142
  implExp.copyFile = copyFile.wrapService(fs.copyFile);
@@ -148,6 +166,7 @@ function exposeFSService(fs, expServices) {
148
166
  readBytes: vReadBytes.wrapService(fs.v.readBytes),
149
167
  readJSONFile: vReadJSONFile.wrapService(fs.v.readJSONFile),
150
168
  readTxtFile: vReadTxtFile.wrapService(fs.v.readTxtFile),
169
+ listVersions: vListVersions.wrapService(fs.v.listVersions)
151
170
  };
152
171
  if (fs.writable) {
153
172
  implExp.v.getByteSink = vGetByteSink.wrapService(fs.v.getByteSink, expServices);
@@ -155,12 +174,29 @@ function exposeFSService(fs, expServices) {
155
174
  implExp.v.writeJSONFile = vWriteJSONFile.wrapService(fs.v.writeJSONFile);
156
175
  implExp.v.writeTxtFile = vWriteTxtFile.wrapService(fs.v.writeTxtFile);
157
176
  implExp.v.updateXAttrs = vUpdateXAttrs.wrapService(fs.v.updateXAttrs);
177
+ implExp.v.archiveCurrent = vArchiveCurrent.wrapService(fs.v.archiveCurrent);
178
+ }
179
+ if (fs.v.sync) {
180
+ implExp.v.sync = {
181
+ status: vsStatus.wrapService(fs.v.sync.status),
182
+ updateStatusInfo: vsUpdateStatusInfo.wrapService(fs.v.sync.updateStatusInfo),
183
+ isRemoteVersionOnDisk: vsIsRemoteVersionOnDisk.wrapService(fs.v.sync.isRemoteVersionOnDisk),
184
+ download: vsDownload.wrapService(fs.v.sync.download),
185
+ adoptRemote: vsAdoptRemote.wrapService(fs.v.sync.adoptRemote),
186
+ diffCurrentAndRemoteFolderVersions: vsDiffCurrentAndRemoteFolderVersions.wrapService(fs.v.sync.diffCurrentAndRemoteFolderVersions)
187
+ };
188
+ if (fs.writable) {
189
+ implExp.v.sync.upload = vsUpload.wrapService(fs.v.sync.upload);
190
+ implExp.v.sync.adoptRemoteFolderItem =
191
+ vsAdoptRemoteFolderItem.wrapService(fs.v.sync.adoptRemoteFolderItem);
192
+ }
158
193
  }
159
194
  }
160
195
  const impl = expServices.exposeDroppableService('FSImpl', implExp, fs);
161
196
  const fsMsg = {
162
197
  impl,
163
198
  isVersioned: !!fs.v,
199
+ isSynced: !!(fs.v && fs.v.sync),
164
200
  name: fs.name,
165
201
  type: fs.type,
166
202
  writable: fs.writable
@@ -175,7 +211,7 @@ var checkPresence;
175
211
  function wrapService(fn) {
176
212
  return buf => {
177
213
  const { path, throwIfMissing } = requestType.unpack(buf);
178
- const promise = fn(path, protobuf_msg_1.valOfOpt(throwIfMissing))
214
+ const promise = fn(path, (0, protobuf_msg_1.valOfOpt)(throwIfMissing))
179
215
  .then(found => protobuf_msg_1.boolValType.pack({ value: found }));
180
216
  return { promise };
181
217
  };
@@ -184,7 +220,7 @@ var checkPresence;
184
220
  function makeCaller(caller, objPath) {
185
221
  return (path, throwIfMissing) => caller
186
222
  .startPromiseCall(objPath, requestType.pack({
187
- path, throwIfMissing: protobuf_msg_1.toOptVal(throwIfMissing)
223
+ path, throwIfMissing: (0, protobuf_msg_1.toOptVal)(throwIfMissing)
188
224
  }))
189
225
  .then(buf => protobuf_msg_1.boolValType.unpack(buf).value);
190
226
  }
@@ -259,7 +295,7 @@ var listXAttrs;
259
295
  const ipcPath = objPath.concat('listXAttrs');
260
296
  return path => caller
261
297
  .startPromiseCall(ipcPath, reqWithPathType.pack({ path }))
262
- .then(buf => protobuf_msg_1.fixArray(protobuf_msg_1.strArrValType.unpack(buf).values));
298
+ .then(buf => (0, protobuf_msg_1.fixArray)(protobuf_msg_1.strArrValType.unpack(buf).values));
263
299
  }
264
300
  listXAttrs.makeCaller = makeCaller;
265
301
  })(listXAttrs || (listXAttrs = {}));
@@ -271,7 +307,7 @@ function exposeSymLink(link, expServices) {
271
307
  if (link.isFile) {
272
308
  const promise = link.target()
273
309
  .then(f => {
274
- const file = file_1.exposeFileService(f, expServices);
310
+ const file = (0, file_1.exposeFileService)(f, expServices);
275
311
  return symLinkTargetType.pack({ file });
276
312
  });
277
313
  return { promise };
@@ -285,20 +321,20 @@ function exposeSymLink(link, expServices) {
285
321
  return { promise };
286
322
  }
287
323
  else {
288
- assert_1.assert(false);
324
+ (0, assert_1.assert)(false);
289
325
  }
290
326
  };
291
327
  const ref = expServices.exposeDroppableService('SymLinkImpl', exp, link);
292
328
  const msg = {
293
329
  readonly: link.readonly,
294
- isFile: protobuf_msg_1.toOptVal(link.isFile),
295
- isFolder: protobuf_msg_1.toOptVal(link.isFolder),
330
+ isFile: (0, protobuf_msg_1.toOptVal)(link.isFile),
331
+ isFolder: (0, protobuf_msg_1.toOptVal)(link.isFolder),
296
332
  impl: ref
297
333
  };
298
334
  return msg;
299
335
  }
300
336
  function makeSymLinkCaller(caller, linkMsg) {
301
- connector_1.checkRefObjTypeIs('SymLinkImpl', linkMsg.impl);
337
+ (0, connector_1.checkRefObjTypeIs)('SymLinkImpl', linkMsg.impl);
302
338
  const link = {
303
339
  readonly: linkMsg.readonly,
304
340
  target: () => caller
@@ -306,7 +342,7 @@ function makeSymLinkCaller(caller, linkMsg) {
306
342
  .then(buf => {
307
343
  const { file, fs } = symLinkTargetType.unpack(buf);
308
344
  if (file) {
309
- return file_1.makeFileCaller(caller, file);
345
+ return (0, file_1.makeFileCaller)(caller, file);
310
346
  }
311
347
  else if (fs) {
312
348
  return makeFSCaller(caller, fs);
@@ -315,8 +351,8 @@ function makeSymLinkCaller(caller, linkMsg) {
315
351
  throw new Error('Missing target info');
316
352
  }
317
353
  }),
318
- isFile: protobuf_msg_1.valOfOpt(linkMsg.isFile),
319
- isFolder: protobuf_msg_1.valOfOpt(linkMsg.isFolder)
354
+ isFile: (0, protobuf_msg_1.valOfOpt)(linkMsg.isFile),
355
+ isFolder: (0, protobuf_msg_1.valOfOpt)(linkMsg.isFolder)
320
356
  };
321
357
  return link;
322
358
  }
@@ -348,60 +384,146 @@ var readLink;
348
384
  Object.freeze(readLink);
349
385
  const fsEventMsgType = protobuf_type_1.ProtoType.for(fs_proto_1.fs.FSEventMsg);
350
386
  function packFSEvent(e) {
351
- const m = {
352
- type: e.type,
353
- path: e.path,
354
- isRemote: protobuf_msg_1.toOptVal(e.isRemote),
355
- newVersion: protobuf_msg_1.toOptVal(e.newVersion),
356
- name: protobuf_msg_1.toOptVal(e.name),
357
- oldName: protobuf_msg_1.toOptVal(e.oldName),
358
- newName: protobuf_msg_1.toOptVal(e.newName),
359
- entry: (e.entry ?
360
- lsEntryToMsg(e.entry) : undefined),
361
- current: protobuf_msg_1.toOptVal(e.current),
362
- uploaded: protobuf_msg_1.toOptVal(e.uploaded),
363
- moveLabel: protobuf_msg_1.toOptVal(e.moveLabel)
364
- };
365
- return fsEventMsgType.pack(m);
387
+ const { type, path } = e;
388
+ switch (type) {
389
+ case 'removed':
390
+ return fsEventMsgType.pack({
391
+ type, path,
392
+ src: (0, protobuf_msg_1.toVal)(e.src)
393
+ });
394
+ case 'remote-removal':
395
+ return fsEventMsgType.pack({
396
+ type, path
397
+ });
398
+ case 'file-change':
399
+ return fsEventMsgType.pack({
400
+ type, path,
401
+ src: (0, protobuf_msg_1.toVal)(e.src),
402
+ newVersion: (0, protobuf_msg_1.toOptVal)(e.newVersion)
403
+ });
404
+ case 'remote-change':
405
+ return fsEventMsgType.pack({
406
+ type, path,
407
+ newVersion: (0, protobuf_msg_1.toOptVal)(e.newVersion)
408
+ });
409
+ case 'entry-addition':
410
+ return fsEventMsgType.pack({
411
+ type, path,
412
+ src: (0, protobuf_msg_1.toVal)(e.src),
413
+ newVersion: (0, protobuf_msg_1.toOptVal)(e.newVersion),
414
+ entry: lsEntryToMsg(e.entry),
415
+ moveLabel: (0, protobuf_msg_1.toOptVal)(e.moveLabel)
416
+ });
417
+ case 'entry-removal':
418
+ return fsEventMsgType.pack({
419
+ type, path,
420
+ src: (0, protobuf_msg_1.toVal)(e.src),
421
+ newVersion: (0, protobuf_msg_1.toOptVal)(e.newVersion),
422
+ name: (0, protobuf_msg_1.toVal)(e.name),
423
+ moveLabel: (0, protobuf_msg_1.toOptVal)(e.moveLabel)
424
+ });
425
+ case 'entry-renaming':
426
+ return fsEventMsgType.pack({
427
+ type, path,
428
+ src: (0, protobuf_msg_1.toVal)(e.src),
429
+ newVersion: (0, protobuf_msg_1.toOptVal)(e.newVersion),
430
+ oldName: (0, protobuf_msg_1.toVal)(e.oldName),
431
+ newName: (0, protobuf_msg_1.toVal)(e.newName)
432
+ });
433
+ case 'remote-arch-ver-removal':
434
+ return fsEventMsgType.pack({
435
+ type, path,
436
+ removedArchVer: (0, protobuf_msg_1.toVal)(e.removedArchVer)
437
+ });
438
+ case 'remote-version-archival':
439
+ return fsEventMsgType.pack({
440
+ type, path,
441
+ archivedVersion: (0, protobuf_msg_1.toVal)(e.archivedVersion)
442
+ });
443
+ default:
444
+ throw new Error(`Unknown event type ${type}`);
445
+ }
366
446
  }
367
447
  function unpackFSEvent(buf) {
368
448
  const m = fsEventMsgType.unpack(buf);
369
- const event = {
370
- type: m.type,
371
- path: m.path,
372
- isRemote: protobuf_msg_1.valOfOpt(m.isRemote),
373
- newVersion: protobuf_msg_1.valOfOptInt(m.newVersion),
374
- name: protobuf_msg_1.valOfOpt(m.name),
375
- oldName: protobuf_msg_1.valOfOpt(m.oldName),
376
- newName: protobuf_msg_1.valOfOpt(m.newName),
377
- entry: (m.entry ? lsEntryFromMsg(m.entry) : undefined),
378
- current: protobuf_msg_1.valOfOptInt(m.current),
379
- uploaded: protobuf_msg_1.valOfOptInt(m.uploaded),
380
- moveLabel: protobuf_msg_1.valOfOptInt(m.moveLabel)
381
- };
382
- return event;
449
+ const { type, path } = m;
450
+ switch (type) {
451
+ case 'entry-addition':
452
+ return {
453
+ type, path,
454
+ src: (0, protobuf_msg_1.valOf)(m.src),
455
+ newVersion: (0, protobuf_msg_1.valOfOptInt)(m.newVersion),
456
+ entry: lsEntryFromMsg(m.entry),
457
+ moveLabel: (0, protobuf_msg_1.valOfOptInt)(m.moveLabel)
458
+ };
459
+ case 'entry-removal':
460
+ return {
461
+ type, path,
462
+ src: (0, protobuf_msg_1.valOf)(m.src),
463
+ newVersion: (0, protobuf_msg_1.valOfOptInt)(m.newVersion),
464
+ name: (0, protobuf_msg_1.valOf)(m.name),
465
+ moveLabel: (0, protobuf_msg_1.valOfOptInt)(m.moveLabel)
466
+ };
467
+ case 'entry-renaming':
468
+ return {
469
+ type, path,
470
+ src: (0, protobuf_msg_1.valOf)(m.src),
471
+ newVersion: (0, protobuf_msg_1.valOfOptInt)(m.newVersion),
472
+ oldName: (0, protobuf_msg_1.valOf)(m.oldName),
473
+ newName: (0, protobuf_msg_1.valOf)(m.newName)
474
+ };
475
+ case 'file-change':
476
+ return {
477
+ type, path,
478
+ src: (0, protobuf_msg_1.valOf)(m.src),
479
+ newVersion: (0, protobuf_msg_1.valOfOptInt)(m.newVersion)
480
+ };
481
+ case 'removed':
482
+ return {
483
+ type, path,
484
+ src: (0, protobuf_msg_1.valOf)(m.src)
485
+ };
486
+ case 'remote-removal':
487
+ return {
488
+ type, path
489
+ };
490
+ case 'remote-change':
491
+ return {
492
+ type, path, newVersion: (0, protobuf_msg_1.intValOf)(m.newVersion)
493
+ };
494
+ case 'remote-arch-ver-removal':
495
+ return {
496
+ type, path, removedArchVer: (0, protobuf_msg_1.intValOf)(m.removedArchVer)
497
+ };
498
+ case 'remote-version-archival':
499
+ return {
500
+ type, path, archivedVersion: (0, protobuf_msg_1.intValOf)(m.archivedVersion)
501
+ };
502
+ default:
503
+ throw new Error(`Unknown event type ${type}`);
504
+ }
383
505
  }
384
506
  function lsEntryToMsg(e) {
385
507
  return {
386
508
  name: e.name,
387
- isFile: protobuf_msg_1.toOptVal(e.isFile),
388
- isFolder: protobuf_msg_1.toOptVal(e.isFolder),
389
- isLink: protobuf_msg_1.toOptVal(e.isLink)
509
+ isFile: (0, protobuf_msg_1.toOptVal)(e.isFile),
510
+ isFolder: (0, protobuf_msg_1.toOptVal)(e.isFolder),
511
+ isLink: (0, protobuf_msg_1.toOptVal)(e.isLink)
390
512
  };
391
513
  }
392
514
  function lsEntryFromMsg(m) {
393
515
  const name = m.name;
394
- if (protobuf_msg_1.valOfOpt(m.isFile)) {
516
+ if ((0, protobuf_msg_1.valOfOpt)(m.isFile)) {
395
517
  return { name, isFile: true };
396
518
  }
397
- else if (protobuf_msg_1.valOfOpt(m.isFolder)) {
519
+ else if ((0, protobuf_msg_1.valOfOpt)(m.isFolder)) {
398
520
  return { name, isFolder: true };
399
521
  }
400
- else if (protobuf_msg_1.valOfOpt(m.isLink)) {
522
+ else if ((0, protobuf_msg_1.valOfOpt)(m.isLink)) {
401
523
  return { name, isLink: true };
402
524
  }
403
525
  else {
404
- throw connector_1.makeIPCException({
526
+ throw (0, connector_1.makeIPCException)({
405
527
  badReply: true, message: `Missing fs entry type flag`
406
528
  });
407
529
  }
@@ -412,7 +534,7 @@ var watch;
412
534
  return buf => {
413
535
  const { path } = reqWithPathType.unpack(buf);
414
536
  const s = new rxjs_1.Subject();
415
- const obs = s.asObservable().pipe(operators_1.map(packEvent));
537
+ const obs = s.asObservable().pipe((0, operators_1.map)(packEvent));
416
538
  const onCancel = fn(path, s);
417
539
  return { obs, onCancel };
418
540
  };
@@ -423,8 +545,8 @@ var watch;
423
545
  const s = new rxjs_1.Subject();
424
546
  const unsub = caller.startObservableCall(ipcPath, reqWithPathType.pack({ path }), s);
425
547
  s.asObservable()
426
- .pipe(operators_1.map(unpackEvent))
427
- .subscribe(utils_for_observables_1.toRxObserver(obs));
548
+ .pipe((0, operators_1.map)(unpackEvent))
549
+ .subscribe((0, utils_for_observables_1.toRxObserver)(obs));
428
550
  return unsub;
429
551
  };
430
552
  }
@@ -433,11 +555,6 @@ var watch;
433
555
  return makeCaller(caller, ipcPath, unpackFSEvent);
434
556
  }
435
557
  watch.makeFolderCaller = makeFolderCaller;
436
- function makeTreeCaller(caller, objPath) {
437
- const ipcPath = objPath.concat('watchTree');
438
- return makeCaller(caller, ipcPath, unpackFSEvent);
439
- }
440
- watch.makeTreeCaller = makeTreeCaller;
441
558
  function makeFileCaller(caller, objPath) {
442
559
  const ipcPath = objPath.concat('watchFile');
443
560
  return makeCaller(caller, ipcPath, file_1.unpackFileEvent);
@@ -445,6 +562,33 @@ var watch;
445
562
  watch.makeFileCaller = makeFileCaller;
446
563
  })(watch || (watch = {}));
447
564
  Object.freeze(watch);
565
+ var watchTree;
566
+ (function (watchTree) {
567
+ const requestType = protobuf_type_1.ProtoType.for(fs_proto_1.fs.WatchTreeRequestBody);
568
+ function wrapService(fn) {
569
+ return buf => {
570
+ const { path, depth } = requestType.unpack(buf);
571
+ const s = new rxjs_1.Subject();
572
+ const obs = s.asObservable().pipe((0, operators_1.map)(packFSEvent));
573
+ const onCancel = fn(path, (0, protobuf_msg_1.valOfOpt)(depth), s);
574
+ return { obs, onCancel };
575
+ };
576
+ }
577
+ watchTree.wrapService = wrapService;
578
+ function makeCaller(caller, objPath) {
579
+ const ipcPath = objPath.concat('watchTree');
580
+ return (path, depth, obs) => {
581
+ const s = new rxjs_1.Subject();
582
+ const unsub = caller.startObservableCall(ipcPath, requestType.pack({ path, depth: (0, protobuf_msg_1.toOptVal)(depth) }), s);
583
+ s.asObservable()
584
+ .pipe((0, operators_1.map)(unpackFSEvent))
585
+ .subscribe((0, utils_for_observables_1.toRxObserver)(obs));
586
+ return unsub;
587
+ };
588
+ }
589
+ watchTree.makeCaller = makeCaller;
590
+ })(watchTree || (watchTree = {}));
591
+ Object.freeze(watchTree);
448
592
  var close;
449
593
  (function (close) {
450
594
  function wrapService(fn) {
@@ -504,7 +648,7 @@ var listFolder;
504
648
  const ipcPath = objPath.concat('listFolder');
505
649
  return path => caller
506
650
  .startPromiseCall(ipcPath, reqWithPathType.pack({ path }))
507
- .then(buf => protobuf_msg_1.fixArray(requestType.unpack(buf).entries).map(lsEntryFromMsg));
651
+ .then(buf => (0, protobuf_msg_1.fixArray)(requestType.unpack(buf).entries).map(lsEntryFromMsg));
508
652
  }
509
653
  listFolder.makeCaller = makeCaller;
510
654
  })(listFolder || (listFolder = {}));
@@ -535,7 +679,7 @@ var readTxtFile;
535
679
  return buf => {
536
680
  const { path } = reqWithPathType.unpack(buf);
537
681
  const promise = fn(path)
538
- .then(txt => protobuf_msg_1.encodeToUtf8(txt));
682
+ .then(txt => (0, protobuf_msg_1.encodeToUtf8)(txt));
539
683
  return { promise };
540
684
  };
541
685
  }
@@ -544,7 +688,7 @@ var readTxtFile;
544
688
  const ipcPath = objPath.concat('readTxtFile');
545
689
  return path => caller
546
690
  .startPromiseCall(ipcPath, reqWithPathType.pack({ path }))
547
- .then(buf => (buf ? protobuf_msg_1.decodeFromUtf8(buf) : ''));
691
+ .then(buf => (buf ? (0, protobuf_msg_1.decodeFromUtf8)(buf) : ''));
548
692
  }
549
693
  readTxtFile.makeCaller = makeCaller;
550
694
  })(readTxtFile || (readTxtFile = {}));
@@ -555,7 +699,7 @@ var readBytes;
555
699
  function wrapService(fn) {
556
700
  return buf => {
557
701
  const { path, start, end } = readBytes.requestType.unpack(buf);
558
- const promise = fn(path, protobuf_msg_1.valOfOptInt(start), protobuf_msg_1.valOfOptInt(end))
702
+ const promise = fn(path, (0, protobuf_msg_1.valOfOptInt)(start), (0, protobuf_msg_1.valOfOptInt)(end))
559
703
  .then(file.readBytes.packReply);
560
704
  return { promise };
561
705
  };
@@ -565,7 +709,7 @@ var readBytes;
565
709
  const ipcPath = objPath.concat('readBytes');
566
710
  return (path, start, end) => caller
567
711
  .startPromiseCall(ipcPath, readBytes.requestType.pack({
568
- path, start: protobuf_msg_1.toOptVal(start), end: protobuf_msg_1.toOptVal(end)
712
+ path, start: (0, protobuf_msg_1.toOptVal)(start), end: (0, protobuf_msg_1.toOptVal)(end)
569
713
  }))
570
714
  .then(file.readBytes.unpackReply);
571
715
  }
@@ -579,7 +723,7 @@ var getByteSource;
579
723
  const { path } = reqWithPathType.unpack(buf);
580
724
  const promise = fn(path)
581
725
  .then(src => {
582
- const ref = bytes_1.exposeSrcService(src, expServices);
726
+ const ref = (0, bytes_1.exposeSrcService)(src, expServices);
583
727
  return protobuf_msg_1.objRefType.pack(ref);
584
728
  });
585
729
  return { promise };
@@ -592,7 +736,7 @@ var getByteSource;
592
736
  .startPromiseCall(ipcPath, reqWithPathType.pack({ path }))
593
737
  .then(buf => {
594
738
  const ref = protobuf_msg_1.objRefType.unpack(buf);
595
- return bytes_1.makeSrcCaller(caller, ref);
739
+ return (0, bytes_1.makeSrcCaller)(caller, ref);
596
740
  });
597
741
  }
598
742
  getByteSource.makeCaller = makeCaller;
@@ -605,7 +749,7 @@ var readonlyFile;
605
749
  const { path } = reqWithPathType.unpack(buf);
606
750
  const promise = fn(path)
607
751
  .then(file => {
608
- const fileMsg = file_1.exposeFileService(file, expServices);
752
+ const fileMsg = (0, file_1.exposeFileService)(file, expServices);
609
753
  return file_1.fileMsgType.pack(fileMsg);
610
754
  });
611
755
  return { promise };
@@ -618,7 +762,7 @@ var readonlyFile;
618
762
  .startPromiseCall(ipcPath, reqWithPathType.pack({ path }))
619
763
  .then(buf => {
620
764
  const fileMsg = file_1.fileMsgType.unpack(buf);
621
- return file_1.makeFileCaller(caller, fileMsg);
765
+ return (0, file_1.makeFileCaller)(caller, fileMsg);
622
766
  });
623
767
  }
624
768
  readonlyFile.makeCaller = makeCaller;
@@ -632,41 +776,41 @@ var select;
632
776
  action: sc.action,
633
777
  type: (Array.isArray(sc.type) ?
634
778
  sc.type : ((typeof sc.type === 'string') ? [sc.type] : [])),
635
- depth: protobuf_msg_1.toOptVal(sc.depth),
779
+ depth: (0, protobuf_msg_1.toOptVal)(sc.depth),
636
780
  };
637
781
  if (typeof sc.name === 'string') {
638
- c.pattern = protobuf_msg_1.toVal(sc.name);
782
+ c.pattern = (0, protobuf_msg_1.toVal)(sc.name);
639
783
  }
640
784
  else if (sc.name.type === 'pattern') {
641
- c.pattern = protobuf_msg_1.toVal(sc.name.p);
785
+ c.pattern = (0, protobuf_msg_1.toVal)(sc.name.p);
642
786
  }
643
787
  else if (sc.name.type === 'exact') {
644
- c.exactName = protobuf_msg_1.toVal(sc.name.p);
788
+ c.exactName = (0, protobuf_msg_1.toVal)(sc.name.p);
645
789
  }
646
790
  else if (sc.name.type === 'regexp') {
647
- c.regexp = protobuf_msg_1.toVal(sc.name.p);
791
+ c.regexp = (0, protobuf_msg_1.toVal)(sc.name.p);
648
792
  }
649
793
  return c;
650
794
  }
651
795
  function criteriaFromMsg(c) {
652
796
  let name;
653
797
  if (c.exactName) {
654
- name = { type: 'exact', p: protobuf_msg_1.valOf(c.exactName) };
798
+ name = { type: 'exact', p: (0, protobuf_msg_1.valOf)(c.exactName) };
655
799
  }
656
800
  else if (c.pattern) {
657
- name = { type: 'pattern', p: protobuf_msg_1.valOf(c.pattern) };
801
+ name = { type: 'pattern', p: (0, protobuf_msg_1.valOf)(c.pattern) };
658
802
  }
659
803
  else if (c.regexp) {
660
- name = { type: 'regexp', p: protobuf_msg_1.valOf(c.regexp) };
804
+ name = { type: 'regexp', p: (0, protobuf_msg_1.valOf)(c.regexp) };
661
805
  }
662
806
  else {
663
- throw connector_1.makeIPCException({ message: `Invalid name parameter in select criteria` });
807
+ throw (0, connector_1.makeIPCException)({ message: `Invalid name parameter in select criteria` });
664
808
  }
665
- const typeArr = protobuf_msg_1.fixArray(c.type);
809
+ const typeArr = (0, protobuf_msg_1.fixArray)(c.type);
666
810
  const sc = {
667
811
  action: c.action,
668
812
  name,
669
- depth: protobuf_msg_1.valOfOptInt(c.depth),
813
+ depth: (0, protobuf_msg_1.valOfOptInt)(c.depth),
670
814
  type: ((typeArr.length > 0) ? typeArr : undefined)
671
815
  };
672
816
  return sc;
@@ -691,21 +835,21 @@ var select;
691
835
  const req = { path, criteria: criteriaToMsg(criteria) };
692
836
  const s = new rxjs_1.Subject();
693
837
  caller.startObservableCall(ipcPath, requestType.pack(req), s);
694
- const reply = deferred_1.defer();
838
+ const reply = (0, deferred_1.defer)();
695
839
  let completion = undefined;
696
840
  s.subscribe({
697
841
  next: buf => {
698
842
  const ref = protobuf_msg_1.objRefType.unpack(buf);
699
843
  const collection = fsCollection.makeCollectionCaller(ref, caller);
700
844
  reply.resolve(collection);
701
- completion = deferred_1.defer();
845
+ completion = (0, deferred_1.defer)();
702
846
  },
703
847
  complete: () => {
704
848
  if (completion) {
705
849
  completion.resolve();
706
850
  }
707
851
  else {
708
- reply.reject(connector_1.makeIPCException({
852
+ reply.reject((0, connector_1.makeIPCException)({
709
853
  message: `Early completion sent by core side`
710
854
  }));
711
855
  }
@@ -740,7 +884,7 @@ var fsCollection;
740
884
  }
741
885
  fsCollection.exposeCollectionService = exposeCollectionService;
742
886
  function makeCollectionCaller(ref, caller) {
743
- connector_1.checkRefObjTypeIs('FSCollection', ref);
887
+ (0, connector_1.checkRefObjTypeIs)('FSCollection', ref);
744
888
  const objPath = ref.path;
745
889
  const collection = {
746
890
  get: get.makeCaller(caller, objPath),
@@ -805,7 +949,7 @@ var fsCollection;
805
949
  return () => caller
806
950
  .startPromiseCall(ipcPath, undefined)
807
951
  .then(buf => {
808
- const items = protobuf_msg_1.fixArray(replyType.unpack(buf).items);
952
+ const items = (0, protobuf_msg_1.fixArray)(replyType.unpack(buf).items);
809
953
  const pairs = [];
810
954
  for (const { name, item } of items) {
811
955
  pairs.push([name, fsItem.fsItemFromMsg(caller, item)]);
@@ -826,7 +970,7 @@ var fsCollection;
826
970
  return ref;
827
971
  }
828
972
  function makeIterCaller(ref, caller) {
829
- connector_1.checkRefObjTypeIs('FSItemsIter', ref);
973
+ (0, connector_1.checkRefObjTypeIs)('FSItemsIter', ref);
830
974
  const objPath = ref.path;
831
975
  const iter = {
832
976
  next: makeIterNextCaller(caller, objPath)
@@ -838,7 +982,7 @@ var fsCollection;
838
982
  function packIterRes(res, expServices) {
839
983
  let msg;
840
984
  if (res.done) {
841
- msg = { done: protobuf_msg_1.toVal(true) };
985
+ msg = { done: (0, protobuf_msg_1.toVal)(true) };
842
986
  }
843
987
  else {
844
988
  const itemRef = fsItem.exposeFSItem(expServices, res.value[1]);
@@ -899,7 +1043,7 @@ var fsCollection;
899
1043
  function wrapService(fn, expServices) {
900
1044
  return () => {
901
1045
  const s = new rxjs_1.Subject();
902
- const obs = s.asObservable().pipe(operators_1.map(event => packEvent(event, expServices)));
1046
+ const obs = s.asObservable().pipe((0, operators_1.map)(event => packEvent(event, expServices)));
903
1047
  const onCancel = fn(s);
904
1048
  return { obs, onCancel };
905
1049
  };
@@ -908,7 +1052,7 @@ var fsCollection;
908
1052
  function packEvent(event, expServices) {
909
1053
  const msg = {
910
1054
  type: event.type,
911
- path: protobuf_msg_1.toOptVal(event.path)
1055
+ path: (0, protobuf_msg_1.toOptVal)(event.path)
912
1056
  };
913
1057
  if (event.item) {
914
1058
  msg.item = fsItem.exposeFSItem(expServices, event.item);
@@ -919,7 +1063,7 @@ var fsCollection;
919
1063
  const msg = eventType.unpack(buf);
920
1064
  const event = {
921
1065
  type: msg.type,
922
- path: protobuf_msg_1.valOfOpt(msg.path)
1066
+ path: (0, protobuf_msg_1.valOfOpt)(msg.path)
923
1067
  };
924
1068
  if (msg.item) {
925
1069
  event.item = fsItem.fsItemFromMsg(caller, msg.item);
@@ -932,8 +1076,8 @@ var fsCollection;
932
1076
  const s = new rxjs_1.Subject();
933
1077
  const unsub = caller.startObservableCall(path, undefined, s);
934
1078
  s.asObservable()
935
- .pipe(operators_1.map(buf => unpackEvent(buf, caller)))
936
- .subscribe(utils_for_observables_1.toRxObserver(obs));
1079
+ .pipe((0, operators_1.map)(buf => unpackEvent(buf, caller)))
1080
+ .subscribe((0, utils_for_observables_1.toRxObserver)(obs));
937
1081
  return unsub;
938
1082
  };
939
1083
  }
@@ -947,18 +1091,18 @@ var fsItem;
947
1091
  fsItem.msgType = protobuf_type_1.ProtoType.for(fs_proto_1.fs.FSItem);
948
1092
  function exposeFSItem(expServices, item) {
949
1093
  const msg = {
950
- isLink: protobuf_msg_1.toOptVal(item.isLink)
1094
+ isLink: (0, protobuf_msg_1.toOptVal)(item.isLink)
951
1095
  };
952
1096
  if (item.isFile) {
953
- msg.isFile = protobuf_msg_1.toVal(true);
1097
+ msg.isFile = (0, protobuf_msg_1.toVal)(true);
954
1098
  if (item.item) {
955
1099
  msg.item = {
956
- file: file_1.exposeFileService(item.item, expServices)
1100
+ file: (0, file_1.exposeFileService)(item.item, expServices)
957
1101
  };
958
1102
  }
959
1103
  }
960
1104
  else if (item.isFolder) {
961
- msg.isFolder = protobuf_msg_1.toVal(true);
1105
+ msg.isFolder = (0, protobuf_msg_1.toVal)(true);
962
1106
  if (item.item) {
963
1107
  msg.item = {
964
1108
  fs: exposeFSService(item.item, expServices)
@@ -966,7 +1110,7 @@ var fsItem;
966
1110
  }
967
1111
  }
968
1112
  else if (item.isCollection) {
969
- msg.isCollection = protobuf_msg_1.toVal(true);
1113
+ msg.isCollection = (0, protobuf_msg_1.toVal)(true);
970
1114
  if (item.item) {
971
1115
  msg.item = {
972
1116
  collection: fsCollection.exposeCollectionService(item.item, expServices)
@@ -989,21 +1133,21 @@ var fsItem;
989
1133
  fsItem.exposeFSItem = exposeFSItem;
990
1134
  function fsItemFromMsg(caller, msg) {
991
1135
  const item = {
992
- isLink: protobuf_msg_1.valOfOpt(msg.isLink)
1136
+ isLink: (0, protobuf_msg_1.valOfOpt)(msg.isLink)
993
1137
  };
994
- if (protobuf_msg_1.valOfOpt(msg.isFile)) {
1138
+ if ((0, protobuf_msg_1.valOfOpt)(msg.isFile)) {
995
1139
  item.isFile = true;
996
1140
  if (msg.item) {
997
- item.item = file_1.makeFileCaller(caller, msg.item.file);
1141
+ item.item = (0, file_1.makeFileCaller)(caller, msg.item.file);
998
1142
  }
999
1143
  }
1000
- else if (protobuf_msg_1.valOfOpt(msg.isFolder)) {
1144
+ else if ((0, protobuf_msg_1.valOfOpt)(msg.isFolder)) {
1001
1145
  item.isFolder = true;
1002
1146
  if (msg.item) {
1003
1147
  item.item = makeFSCaller(caller, msg.item.fs);
1004
1148
  }
1005
1149
  }
1006
- else if (protobuf_msg_1.valOfOpt(msg.isCollection)) {
1150
+ else if ((0, protobuf_msg_1.valOfOpt)(msg.isCollection)) {
1007
1151
  item.isCollection = true;
1008
1152
  if (msg.item) {
1009
1153
  item.item = fsCollection.makeCollectionCaller(msg.item.collection, caller);
@@ -1062,7 +1206,7 @@ var vListXAttrs;
1062
1206
  .startPromiseCall(ipcPath, reqWithPathType.pack({ path }))
1063
1207
  .then(buf => {
1064
1208
  const { version: v, xaNames } = file.vListXAttrs.replyType.unpack(buf);
1065
- return { version: protobuf_msg_1.fixInt(v), lst: (xaNames ? xaNames : []) };
1209
+ return { version: (0, protobuf_msg_1.fixInt)(v), lst: (xaNames ? xaNames : []) };
1066
1210
  });
1067
1211
  }
1068
1212
  vListXAttrs.makeCaller = makeCaller;
@@ -1089,7 +1233,7 @@ var vListFolder;
1089
1233
  .then(buf => {
1090
1234
  const { version: v, entries } = replyType.unpack(buf);
1091
1235
  return {
1092
- version: protobuf_msg_1.fixInt(v), lst: protobuf_msg_1.fixArray(entries.map(lsEntryFromMsg))
1236
+ version: (0, protobuf_msg_1.fixInt)(v), lst: (0, protobuf_msg_1.fixArray)(entries.map(lsEntryFromMsg))
1093
1237
  };
1094
1238
  });
1095
1239
  }
@@ -1115,7 +1259,7 @@ var vReadJSONFile;
1115
1259
  .startPromiseCall(ipcPath, reqWithPathType.pack({ path }))
1116
1260
  .then(buf => {
1117
1261
  const { version: v, json } = file.vReadJSON.replyType.unpack(buf);
1118
- return { version: protobuf_msg_1.fixInt(v), json: JSON.parse(json) };
1262
+ return { version: (0, protobuf_msg_1.fixInt)(v), json: JSON.parse(json) };
1119
1263
  });
1120
1264
  }
1121
1265
  vReadJSONFile.makeCaller = makeCaller;
@@ -1138,7 +1282,7 @@ var vReadTxtFile;
1138
1282
  .startPromiseCall(ipcPath, reqWithPathType.pack({ path }))
1139
1283
  .then(buf => {
1140
1284
  const { version: v, txt } = file.vReadTxt.replyType.unpack(buf);
1141
- return { version: protobuf_msg_1.fixInt(v), txt };
1285
+ return { version: (0, protobuf_msg_1.fixInt)(v), txt };
1142
1286
  });
1143
1287
  }
1144
1288
  vReadTxtFile.makeCaller = makeCaller;
@@ -1149,7 +1293,7 @@ var vReadBytes;
1149
1293
  function wrapService(fn) {
1150
1294
  return buf => {
1151
1295
  const { path, start, end } = readBytes.requestType.unpack(buf);
1152
- const promise = fn(path, protobuf_msg_1.valOfOptInt(start), protobuf_msg_1.valOfOptInt(end))
1296
+ const promise = fn(path, (0, protobuf_msg_1.valOfOptInt)(start), (0, protobuf_msg_1.valOfOptInt)(end))
1153
1297
  .then(file.vReadBytes.packReply);
1154
1298
  return { promise };
1155
1299
  };
@@ -1160,7 +1304,7 @@ var vReadBytes;
1160
1304
  return (path, start, end) => {
1161
1305
  return caller
1162
1306
  .startPromiseCall(ipcPath, readBytes.requestType.pack({
1163
- path, start: protobuf_msg_1.toOptVal(start), end: protobuf_msg_1.toOptVal(end)
1307
+ path, start: (0, protobuf_msg_1.toOptVal)(start), end: (0, protobuf_msg_1.toOptVal)(end)
1164
1308
  }))
1165
1309
  .then(file.vReadBytes.unpackReply);
1166
1310
  };
@@ -1175,7 +1319,7 @@ var vGetByteSource;
1175
1319
  const { path } = reqWithPathType.unpack(buf);
1176
1320
  const promise = fn(path)
1177
1321
  .then(({ version, src }) => {
1178
- const ref = bytes_1.exposeSrcService(src, expServices);
1322
+ const ref = (0, bytes_1.exposeSrcService)(src, expServices);
1179
1323
  return file.vGetByteSource.replyType.pack({ version, src: ref });
1180
1324
  });
1181
1325
  return { promise };
@@ -1188,7 +1332,7 @@ var vGetByteSource;
1188
1332
  .startPromiseCall(ipcPath, reqWithPathType.pack({ path }))
1189
1333
  .then(buf => {
1190
1334
  const { version: v, src } = file.vGetByteSource.replyType.unpack(buf);
1191
- return { version: protobuf_msg_1.fixInt(v), src: bytes_1.makeSrcCaller(caller, src) };
1335
+ return { version: (0, protobuf_msg_1.fixInt)(v), src: (0, bytes_1.makeSrcCaller)(caller, src) };
1192
1336
  });
1193
1337
  }
1194
1338
  vGetByteSource.makeCaller = makeCaller;
@@ -1228,7 +1372,7 @@ var makeFolder;
1228
1372
  function wrapService(fn) {
1229
1373
  return buf => {
1230
1374
  const { path, exclusive } = requestType.unpack(buf);
1231
- const promise = fn(path, protobuf_msg_1.valOfOpt(exclusive));
1375
+ const promise = fn(path, (0, protobuf_msg_1.valOfOpt)(exclusive));
1232
1376
  return { promise };
1233
1377
  };
1234
1378
  }
@@ -1237,7 +1381,7 @@ var makeFolder;
1237
1381
  const ipcPath = objPath.concat('makeFolder');
1238
1382
  return (path, exclusive) => caller
1239
1383
  .startPromiseCall(ipcPath, requestType.pack({
1240
- path, exclusive: protobuf_msg_1.toOptVal(exclusive)
1384
+ path, exclusive: (0, protobuf_msg_1.toOptVal)(exclusive)
1241
1385
  }));
1242
1386
  }
1243
1387
  makeFolder.makeCaller = makeCaller;
@@ -1249,7 +1393,7 @@ var deleteFolder;
1249
1393
  function wrapService(fn) {
1250
1394
  return buf => {
1251
1395
  const { path, removeContent } = requestType.unpack(buf);
1252
- const promise = fn(path, protobuf_msg_1.valOfOpt(removeContent));
1396
+ const promise = fn(path, (0, protobuf_msg_1.valOfOpt)(removeContent));
1253
1397
  return { promise };
1254
1398
  };
1255
1399
  }
@@ -1258,7 +1402,7 @@ var deleteFolder;
1258
1402
  const ipcPath = objPath.concat('deleteFolder');
1259
1403
  return (path, removeContent) => caller
1260
1404
  .startPromiseCall(ipcPath, requestType.pack({
1261
- path, removeContent: protobuf_msg_1.toOptVal(removeContent)
1405
+ path, removeContent: (0, protobuf_msg_1.toOptVal)(removeContent)
1262
1406
  }));
1263
1407
  }
1264
1408
  deleteFolder.makeCaller = makeCaller;
@@ -1325,7 +1469,7 @@ var copyFile;
1325
1469
  function wrapService(fn) {
1326
1470
  return buf => {
1327
1471
  const { src, dst, overwrite } = requestType.unpack(buf);
1328
- const promise = fn(src, dst, protobuf_msg_1.valOfOpt(overwrite));
1472
+ const promise = fn(src, dst, (0, protobuf_msg_1.valOfOpt)(overwrite));
1329
1473
  return { promise };
1330
1474
  };
1331
1475
  }
@@ -1334,7 +1478,7 @@ var copyFile;
1334
1478
  const ipcPath = objPath.concat('copyFile');
1335
1479
  return (src, dst, overwrite) => caller
1336
1480
  .startPromiseCall(ipcPath, requestType.pack({
1337
- src, dst, overwrite: protobuf_msg_1.toOptVal(overwrite)
1481
+ src, dst, overwrite: (0, protobuf_msg_1.toOptVal)(overwrite)
1338
1482
  }));
1339
1483
  }
1340
1484
  copyFile.makeCaller = makeCaller;
@@ -1346,7 +1490,7 @@ var copyFolder;
1346
1490
  function wrapService(fn) {
1347
1491
  return buf => {
1348
1492
  const { src, dst, mergeAndOverwrite } = requestType.unpack(buf);
1349
- const promise = fn(src, dst, protobuf_msg_1.valOfOpt(mergeAndOverwrite));
1493
+ const promise = fn(src, dst, (0, protobuf_msg_1.valOfOpt)(mergeAndOverwrite));
1350
1494
  return { promise };
1351
1495
  };
1352
1496
  }
@@ -1355,7 +1499,7 @@ var copyFolder;
1355
1499
  const ipcPath = objPath.concat('copyFolder');
1356
1500
  return (src, dst, mergeAndOverwrite) => caller
1357
1501
  .startPromiseCall(ipcPath, requestType.pack({
1358
- src, dst, mergeAndOverwrite: protobuf_msg_1.toOptVal(mergeAndOverwrite)
1502
+ src, dst, mergeAndOverwrite: (0, protobuf_msg_1.toOptVal)(mergeAndOverwrite)
1359
1503
  }));
1360
1504
  }
1361
1505
  copyFolder.makeCaller = makeCaller;
@@ -1368,7 +1512,7 @@ var saveFile;
1368
1512
  return buf => {
1369
1513
  const { dst, file, overwrite } = requestType.unpack(buf);
1370
1514
  const f = expServices.getOriginalObj(file);
1371
- const promise = fn(f, dst, protobuf_msg_1.valOfOpt(overwrite));
1515
+ const promise = fn(f, dst, (0, protobuf_msg_1.valOfOpt)(overwrite));
1372
1516
  return { promise };
1373
1517
  };
1374
1518
  }
@@ -1377,7 +1521,7 @@ var saveFile;
1377
1521
  const ipcPath = objPath.concat('saveFile');
1378
1522
  return (f, dst, overwrite) => caller
1379
1523
  .startPromiseCall(ipcPath, requestType.pack({
1380
- file: caller.srvRefOf(f), dst, overwrite: protobuf_msg_1.toOptVal(overwrite)
1524
+ file: caller.srvRefOf(f), dst, overwrite: (0, protobuf_msg_1.toOptVal)(overwrite)
1381
1525
  }));
1382
1526
  }
1383
1527
  saveFile.makeCaller = makeCaller;
@@ -1390,7 +1534,7 @@ var saveFolder;
1390
1534
  return buf => {
1391
1535
  const { dst, folder: file, overwrite } = requestType.unpack(buf);
1392
1536
  const f = expServices.getOriginalObj(file);
1393
- const promise = fn(f, dst, protobuf_msg_1.valOfOpt(overwrite));
1537
+ const promise = fn(f, dst, (0, protobuf_msg_1.valOfOpt)(overwrite));
1394
1538
  return { promise };
1395
1539
  };
1396
1540
  }
@@ -1399,7 +1543,7 @@ var saveFolder;
1399
1543
  const ipcPath = objPath.concat('saveFolder');
1400
1544
  return (f, dst, overwrite) => caller
1401
1545
  .startPromiseCall(ipcPath, requestType.pack({
1402
- folder: caller.srvRefOf(f), dst, overwrite: protobuf_msg_1.toOptVal(overwrite)
1546
+ folder: caller.srvRefOf(f), dst, overwrite: (0, protobuf_msg_1.toOptVal)(overwrite)
1403
1547
  }));
1404
1548
  }
1405
1549
  saveFolder.makeCaller = makeCaller;
@@ -1435,16 +1579,16 @@ function unpackPathAndFlags(buf) {
1435
1579
  }
1436
1580
  function optFlagsToMsg(flags) {
1437
1581
  return (flags ? {
1438
- create: protobuf_msg_1.toOptVal(flags.create),
1439
- exclusive: protobuf_msg_1.toOptVal(flags.exclusive),
1440
- truncate: protobuf_msg_1.toOptVal(flags.truncate)
1582
+ create: (0, protobuf_msg_1.toOptVal)(flags.create),
1583
+ exclusive: (0, protobuf_msg_1.toOptVal)(flags.exclusive),
1584
+ truncate: (0, protobuf_msg_1.toOptVal)(flags.truncate)
1441
1585
  } : undefined);
1442
1586
  }
1443
1587
  function optFlagsFromMsg(m) {
1444
1588
  return (m ? {
1445
- create: protobuf_msg_1.valOfOpt(m.create),
1446
- exclusive: protobuf_msg_1.valOfOpt(m.exclusive),
1447
- truncate: protobuf_msg_1.valOfOpt(m.truncate)
1589
+ create: (0, protobuf_msg_1.valOfOpt)(m.create),
1590
+ exclusive: (0, protobuf_msg_1.valOfOpt)(m.exclusive),
1591
+ truncate: (0, protobuf_msg_1.valOfOpt)(m.truncate)
1448
1592
  } : undefined);
1449
1593
  }
1450
1594
  var writableSubRoot;
@@ -1480,7 +1624,7 @@ var writableFile;
1480
1624
  const { path, flags } = unpackPathAndFlags(buf);
1481
1625
  const promise = fn(path, flags)
1482
1626
  .then(file => {
1483
- const fileMsg = file_1.exposeFileService(file, expServices);
1627
+ const fileMsg = (0, file_1.exposeFileService)(file, expServices);
1484
1628
  return file_1.fileMsgType.pack(fileMsg);
1485
1629
  });
1486
1630
  return { promise };
@@ -1493,7 +1637,7 @@ var writableFile;
1493
1637
  .startPromiseCall(ipcPath, packPathAndFlags(path, flags))
1494
1638
  .then(buf => {
1495
1639
  const fileMsg = file_1.fileMsgType.unpack(buf);
1496
- return file_1.makeFileCaller(caller, fileMsg);
1640
+ return (0, file_1.makeFileCaller)(caller, fileMsg);
1497
1641
  });
1498
1642
  }
1499
1643
  writableFile.makeCaller = makeCaller;
@@ -1556,9 +1700,7 @@ var writeBytes;
1556
1700
  const ipcPath = objPath.concat('writeBytes');
1557
1701
  return (path, bytes, flags) => caller
1558
1702
  .startPromiseCall(ipcPath, requestType.pack({
1559
- path,
1560
- bytes: bytes,
1561
- flags: optFlagsToMsg(flags)
1703
+ path, bytes: bytes, flags: optFlagsToMsg(flags)
1562
1704
  }));
1563
1705
  }
1564
1706
  writeBytes.makeCaller = makeCaller;
@@ -1571,7 +1713,7 @@ var getByteSink;
1571
1713
  const { path, flags } = unpackPathAndFlags(buf);
1572
1714
  const promise = fn(path, flags)
1573
1715
  .then(sink => {
1574
- const ref = bytes_1.exposeSinkService(sink, expServices);
1716
+ const ref = (0, bytes_1.exposeSinkService)(sink, expServices);
1575
1717
  return protobuf_msg_1.objRefType.pack(ref);
1576
1718
  });
1577
1719
  return { promise };
@@ -1584,7 +1726,7 @@ var getByteSink;
1584
1726
  .startPromiseCall(ipcPath, packPathAndFlags(path, flags))
1585
1727
  .then(buf => {
1586
1728
  const ref = protobuf_msg_1.objRefType.unpack(buf);
1587
- return bytes_1.makeSinkCaller(caller, ref);
1729
+ return (0, bytes_1.makeSinkCaller)(caller, ref);
1588
1730
  });
1589
1731
  }
1590
1732
  getByteSink.makeCaller = makeCaller;
@@ -1615,7 +1757,7 @@ function optVerFlagsToMsg(f) {
1615
1757
  return;
1616
1758
  }
1617
1759
  const m = optFlagsToMsg(f);
1618
- m.currentVersion = protobuf_msg_1.toOptVal(f.currentVersion);
1760
+ m.currentVersion = (0, protobuf_msg_1.toOptVal)(f.currentVersion);
1619
1761
  return m;
1620
1762
  }
1621
1763
  function optVerFlagsFromMsg(m) {
@@ -1623,7 +1765,7 @@ function optVerFlagsFromMsg(m) {
1623
1765
  return;
1624
1766
  }
1625
1767
  const f = optFlagsFromMsg(m);
1626
- f.currentVersion = protobuf_msg_1.valOfOpt(m.currentVersion);
1768
+ f.currentVersion = (0, protobuf_msg_1.valOfOpt)(m.currentVersion);
1627
1769
  return f;
1628
1770
  }
1629
1771
  var vWriteJSONFile;
@@ -1688,9 +1830,7 @@ var vWriteBytes;
1688
1830
  const ipcPath = objPath.concat('writeBytes');
1689
1831
  return (path, bytes, flags) => caller
1690
1832
  .startPromiseCall(ipcPath, requestType.pack({
1691
- path,
1692
- bytes: bytes,
1693
- flags: optVerFlagsToMsg(flags)
1833
+ path, bytes: bytes, flags: optVerFlagsToMsg(flags)
1694
1834
  }))
1695
1835
  .then(protobuf_msg_1.unpackInt);
1696
1836
  }
@@ -1705,7 +1845,7 @@ var vGetByteSink;
1705
1845
  const { path, flags } = requestType.unpack(buf);
1706
1846
  const promise = fn(path, optVerFlagsFromMsg(flags))
1707
1847
  .then(({ version, sink }) => {
1708
- const ref = bytes_1.exposeSinkService(sink, expServices);
1848
+ const ref = (0, bytes_1.exposeSinkService)(sink, expServices);
1709
1849
  return file.vGetByteSink.replyType.pack({ version, sink: ref });
1710
1850
  });
1711
1851
  return { promise };
@@ -1720,10 +1860,305 @@ var vGetByteSink;
1720
1860
  }))
1721
1861
  .then(buf => {
1722
1862
  const { sink, version: v } = file.vGetByteSink.replyType.unpack(buf);
1723
- return { version: protobuf_msg_1.fixInt(v), sink: bytes_1.makeSinkCaller(caller, sink) };
1863
+ return { version: (0, protobuf_msg_1.fixInt)(v), sink: (0, bytes_1.makeSinkCaller)(caller, sink) };
1724
1864
  });
1725
1865
  }
1726
1866
  vGetByteSink.makeCaller = makeCaller;
1727
1867
  })(vGetByteSink || (vGetByteSink = {}));
1728
1868
  Object.freeze(vGetByteSink);
1869
+ var vsStatus;
1870
+ (function (vsStatus) {
1871
+ function wrapService(fn) {
1872
+ return buf => {
1873
+ const { path } = reqWithPathType.unpack(buf);
1874
+ const promise = fn(path)
1875
+ .then(file.packSyncStatus);
1876
+ return { promise };
1877
+ };
1878
+ }
1879
+ vsStatus.wrapService = wrapService;
1880
+ function makeCaller(caller, objPath) {
1881
+ const ipcPath = objPath.concat('status');
1882
+ return (path) => caller
1883
+ .startPromiseCall(ipcPath, reqWithPathType.pack({ path }))
1884
+ .then(file.unpackSyncStatus);
1885
+ }
1886
+ vsStatus.makeCaller = makeCaller;
1887
+ })(vsStatus || (vsStatus = {}));
1888
+ Object.freeze(vsStatus);
1889
+ var vsUpdateStatusInfo;
1890
+ (function (vsUpdateStatusInfo) {
1891
+ function wrapService(fn) {
1892
+ return buf => {
1893
+ const { path } = reqWithPathType.unpack(buf);
1894
+ const promise = fn(path)
1895
+ .then(file.packSyncStatus);
1896
+ return { promise };
1897
+ };
1898
+ }
1899
+ vsUpdateStatusInfo.wrapService = wrapService;
1900
+ function makeCaller(caller, objPath) {
1901
+ const ipcPath = objPath.concat('updateStatusInfo');
1902
+ return (path) => caller
1903
+ .startPromiseCall(ipcPath, reqWithPathType.pack({ path }))
1904
+ .then(file.unpackSyncStatus);
1905
+ }
1906
+ vsUpdateStatusInfo.makeCaller = makeCaller;
1907
+ })(vsUpdateStatusInfo || (vsUpdateStatusInfo = {}));
1908
+ Object.freeze(vsUpdateStatusInfo);
1909
+ var vsIsRemoteVersionOnDisk;
1910
+ (function (vsIsRemoteVersionOnDisk) {
1911
+ const requestType = protobuf_type_1.ProtoType.for(fs_proto_1.fs.FSSyncIsOnDiskRequestBody);
1912
+ const replyType = protobuf_type_1.ProtoType.for(fs_proto_1.fs.FSSyncIsOnDiskReplyBody);
1913
+ function wrapService(fn) {
1914
+ return buf => {
1915
+ const { path, version } = requestType.unpack(buf);
1916
+ const promise = fn(path, (0, protobuf_msg_1.fixInt)(version))
1917
+ .then(status => replyType.pack({ status }));
1918
+ return { promise };
1919
+ };
1920
+ }
1921
+ vsIsRemoteVersionOnDisk.wrapService = wrapService;
1922
+ function makeCaller(caller, objPath) {
1923
+ const ipcPath = objPath.concat('isRemoteVersionOnDisk');
1924
+ return (path, version) => caller
1925
+ .startPromiseCall(ipcPath, requestType.pack({ path, version }))
1926
+ .then(buf => replyType.unpack(buf).status);
1927
+ }
1928
+ vsIsRemoteVersionOnDisk.makeCaller = makeCaller;
1929
+ })(vsIsRemoteVersionOnDisk || (vsIsRemoteVersionOnDisk = {}));
1930
+ Object.freeze(vsIsRemoteVersionOnDisk);
1931
+ var vsDownload;
1932
+ (function (vsDownload) {
1933
+ const requestType = protobuf_type_1.ProtoType.for(fs_proto_1.fs.FSSyncDownloadRequestBody);
1934
+ function wrapService(fn) {
1935
+ return buf => {
1936
+ const { path, version } = requestType.unpack(buf);
1937
+ const promise = fn(path, (0, protobuf_msg_1.fixInt)(version));
1938
+ return { promise };
1939
+ };
1940
+ }
1941
+ vsDownload.wrapService = wrapService;
1942
+ function makeCaller(caller, objPath) {
1943
+ const ipcPath = objPath.concat('download');
1944
+ return (path, version) => caller
1945
+ .startPromiseCall(ipcPath, requestType.pack({
1946
+ path, version
1947
+ }));
1948
+ }
1949
+ vsDownload.makeCaller = makeCaller;
1950
+ })(vsDownload || (vsDownload = {}));
1951
+ Object.freeze(vsDownload);
1952
+ var vsUpload;
1953
+ (function (vsUpload) {
1954
+ const requestType = protobuf_type_1.ProtoType.for(fs_proto_1.fs.FSSyncUploadRequestBody);
1955
+ function wrapService(fn) {
1956
+ return buf => {
1957
+ const { path, opts } = requestType.unpack(buf);
1958
+ const promise = fn(path, file.optionsToUploadLocalFromMsg(opts));
1959
+ return { promise };
1960
+ };
1961
+ }
1962
+ vsUpload.wrapService = wrapService;
1963
+ function makeCaller(caller, objPath) {
1964
+ const ipcPath = objPath.concat('upload');
1965
+ return (path, opts) => caller
1966
+ .startPromiseCall(ipcPath, requestType.pack({
1967
+ path, opts: file.optionsToUploadLocalToMsg(opts)
1968
+ }));
1969
+ }
1970
+ vsUpload.makeCaller = makeCaller;
1971
+ })(vsUpload || (vsUpload = {}));
1972
+ Object.freeze(vsUpload);
1973
+ function optionsToAdoptRemoteItemToMsg(opts) {
1974
+ if (!opts) {
1975
+ return;
1976
+ }
1977
+ return {
1978
+ localVersion: (0, protobuf_msg_1.toOptVal)(opts.localVersion),
1979
+ remoteVersion: (0, protobuf_msg_1.toOptVal)(opts.remoteVersion)
1980
+ };
1981
+ }
1982
+ exports.optionsToAdoptRemoteItemToMsg = optionsToAdoptRemoteItemToMsg;
1983
+ function optionsToAdoptRemoteItemFromMsg(msg) {
1984
+ if (!msg) {
1985
+ return;
1986
+ }
1987
+ return {
1988
+ localVersion: (0, protobuf_msg_1.valOfOptInt)(msg.localVersion),
1989
+ remoteVersion: (0, protobuf_msg_1.valOfOptInt)(msg.remoteVersion)
1990
+ };
1991
+ }
1992
+ exports.optionsToAdoptRemoteItemFromMsg = optionsToAdoptRemoteItemFromMsg;
1993
+ var vsAdoptRemoteFolderItem;
1994
+ (function (vsAdoptRemoteFolderItem) {
1995
+ const requestType = protobuf_type_1.ProtoType.for(fs_proto_1.fs.AdoptRemoteFolderItemRequestBody);
1996
+ function wrapService(fn) {
1997
+ return buf => {
1998
+ const { path, itemName, opts } = requestType.unpack(buf);
1999
+ const promise = fn(path, itemName, optionsToAdoptRemoteItemFromMsg(opts))
2000
+ .then(protobuf_msg_1.packInt);
2001
+ return { promise };
2002
+ };
2003
+ }
2004
+ vsAdoptRemoteFolderItem.wrapService = wrapService;
2005
+ function makeCaller(caller, objPath) {
2006
+ const ipcPath = objPath.concat('adoptRemoteFolderItem');
2007
+ return (path, itemName, opts) => caller
2008
+ .startPromiseCall(ipcPath, requestType.pack({
2009
+ path, itemName, opts: optionsToAdoptRemoteItemToMsg(opts)
2010
+ }))
2011
+ .then(protobuf_msg_1.unpackInt);
2012
+ }
2013
+ vsAdoptRemoteFolderItem.makeCaller = makeCaller;
2014
+ })(vsAdoptRemoteFolderItem || (vsAdoptRemoteFolderItem = {}));
2015
+ Object.freeze(vsAdoptRemoteFolderItem);
2016
+ var vsAdoptRemote;
2017
+ (function (vsAdoptRemote) {
2018
+ const requestType = protobuf_type_1.ProtoType.for(fs_proto_1.fs.AdoptRemoteRequestBody);
2019
+ function wrapService(fn) {
2020
+ return buf => {
2021
+ const { path, opts } = requestType.unpack(buf);
2022
+ const promise = fn(path, file.remoteAdoptionOptsFromMsg(opts));
2023
+ return { promise };
2024
+ };
2025
+ }
2026
+ vsAdoptRemote.wrapService = wrapService;
2027
+ function makeCaller(caller, objPath) {
2028
+ const ipcPath = objPath.concat('adoptRemote');
2029
+ return (path, opts) => caller
2030
+ .startPromiseCall(ipcPath, requestType.pack({
2031
+ path, opts: file.remoteAdoptionOptsToMsg(opts)
2032
+ }));
2033
+ }
2034
+ vsAdoptRemote.makeCaller = makeCaller;
2035
+ })(vsAdoptRemote || (vsAdoptRemote = {}));
2036
+ Object.freeze(vsAdoptRemote);
2037
+ var vListVersions;
2038
+ (function (vListVersions) {
2039
+ function wrapService(fn) {
2040
+ return buf => {
2041
+ const { path } = reqWithPathType.unpack(buf);
2042
+ const promise = fn(path)
2043
+ .then(file.vListVersions.packReply);
2044
+ return { promise };
2045
+ };
2046
+ }
2047
+ vListVersions.wrapService = wrapService;
2048
+ function makeCaller(caller, objPath) {
2049
+ const ipcPath = objPath.concat('listVersions');
2050
+ return path => caller
2051
+ .startPromiseCall(ipcPath, reqWithPathType.pack({ path }))
2052
+ .then(file.vListVersions.unpackReply);
2053
+ }
2054
+ vListVersions.makeCaller = makeCaller;
2055
+ })(vListVersions || (vListVersions = {}));
2056
+ Object.freeze(vListVersions);
2057
+ var vArchiveCurrent;
2058
+ (function (vArchiveCurrent) {
2059
+ const requestType = protobuf_type_1.ProtoType.for(fs_proto_1.fs.ArchiveCurrentRequestBody);
2060
+ function wrapService(fn) {
2061
+ return buf => {
2062
+ const { path, version } = requestType.unpack(buf);
2063
+ const promise = fn(path, (0, protobuf_msg_1.valOfOptInt)(version))
2064
+ .then(protobuf_msg_1.packInt);
2065
+ return { promise };
2066
+ };
2067
+ }
2068
+ vArchiveCurrent.wrapService = wrapService;
2069
+ function makeCaller(caller, objPath) {
2070
+ const ipcPath = objPath.concat('archiveCurrent');
2071
+ return (path, version) => caller
2072
+ .startPromiseCall(ipcPath, requestType.pack({ path, version: (0, protobuf_msg_1.toOptVal)(version) }))
2073
+ .then(protobuf_msg_1.unpackInt);
2074
+ }
2075
+ vArchiveCurrent.makeCaller = makeCaller;
2076
+ })(vArchiveCurrent || (vArchiveCurrent = {}));
2077
+ Object.freeze(vArchiveCurrent);
2078
+ function folderDiffToMsg(diff) {
2079
+ var _a, _b, _c, _d;
2080
+ if (!diff) {
2081
+ return;
2082
+ }
2083
+ return {
2084
+ remoteVersion: (0, protobuf_msg_1.toOptVal)(diff.remoteVersion),
2085
+ currentVersion: diff.currentVersion,
2086
+ isCurrentLocal: diff.isCurrentLocal,
2087
+ isRemoteArchived: diff.isRemoteArchived,
2088
+ inCurrent: (_a = diff.inCurrent) === null || _a === void 0 ? void 0 : _a.map(lsEntryToMsg),
2089
+ inRemote: (_b = diff.inRemote) === null || _b === void 0 ? void 0 : _b.map(lsEntryToMsg),
2090
+ nameOverlaps: diff.nameOverlaps,
2091
+ ctime: diffTStoMsg(diff.ctime),
2092
+ mtime: diffTStoMsg(diff.mtime),
2093
+ xattrs: (diff.xattrs ? {
2094
+ inCurrent: (_c = diff.xattrs.inCurrent) === null || _c === void 0 ? void 0 : _c.map(({ name, value }) => file.xattrToMsg(name, value)),
2095
+ inRemote: (_d = diff.xattrs.inRemote) === null || _d === void 0 ? void 0 : _d.map(({ name, value }) => file.xattrToMsg(name, value)),
2096
+ nameOverlaps: diff.xattrs.nameOverlaps
2097
+ } : undefined)
2098
+ };
2099
+ }
2100
+ function diffTStoMsg(diffTS) {
2101
+ var _a;
2102
+ return {
2103
+ current: diffTS.current.valueOf(),
2104
+ remote: (0, protobuf_msg_1.toOptVal)((_a = diffTS.remote) === null || _a === void 0 ? void 0 : _a.valueOf())
2105
+ };
2106
+ }
2107
+ function folderDiffFromMsg(msg) {
2108
+ if (!msg) {
2109
+ return;
2110
+ }
2111
+ return {
2112
+ remoteVersion: (0, protobuf_msg_1.valOfOptInt)(msg.remoteVersion),
2113
+ currentVersion: (0, protobuf_msg_1.fixInt)(msg.currentVersion),
2114
+ isCurrentLocal: msg.isCurrentLocal,
2115
+ isRemoteArchived: msg.isRemoteArchived,
2116
+ inCurrent: ((msg.inCurrent.length > 0) ?
2117
+ msg.inCurrent.map(lsEntryFromMsg) : undefined),
2118
+ inRemote: ((msg.inRemote.length > 0) ?
2119
+ msg.inRemote.map(lsEntryFromMsg) : undefined),
2120
+ nameOverlaps: ((msg.nameOverlaps.length > 0) ?
2121
+ msg.nameOverlaps : undefined),
2122
+ ctime: diffTSfromMsg(msg.ctime),
2123
+ mtime: diffTSfromMsg(msg.mtime),
2124
+ xattrs: (msg.xattrs ? {
2125
+ inCurrent: ((msg.xattrs.inCurrent.length > 0) ?
2126
+ msg.xattrs.inCurrent.map(file.xattrFromMsg) : undefined),
2127
+ inRemote: ((msg.xattrs.inRemote.length > 0) ?
2128
+ msg.xattrs.inRemote.map(file.xattrFromMsg) : undefined),
2129
+ nameOverlaps: ((msg.xattrs.nameOverlaps.length > 0) ?
2130
+ msg.xattrs.nameOverlaps : undefined)
2131
+ } : undefined)
2132
+ };
2133
+ }
2134
+ function diffTSfromMsg(m) {
2135
+ return {
2136
+ current: new Date((0, protobuf_msg_1.fixInt)(m.current)),
2137
+ remote: (m.remote ? new Date((0, protobuf_msg_1.intValOf)(m.remote)) : undefined)
2138
+ };
2139
+ }
2140
+ var vsDiffCurrentAndRemoteFolderVersions;
2141
+ (function (vsDiffCurrentAndRemoteFolderVersions) {
2142
+ const requestType = protobuf_type_1.ProtoType.for(fs_proto_1.fs.DiffCurrentAndRemoteRequestBody);
2143
+ const replyType = protobuf_type_1.ProtoType.for(fs_proto_1.fs.DiffCurrentAndRemoteReplyBody);
2144
+ function wrapService(fn) {
2145
+ return buf => {
2146
+ const { path, remoteVersion } = requestType.unpack(buf);
2147
+ const promise = fn(path, (0, protobuf_msg_1.valOfOptInt)(remoteVersion))
2148
+ .then(diff => replyType.pack({ diff: folderDiffToMsg(diff) }));
2149
+ return { promise };
2150
+ };
2151
+ }
2152
+ vsDiffCurrentAndRemoteFolderVersions.wrapService = wrapService;
2153
+ function makeCaller(caller, objPath) {
2154
+ const ipcPath = objPath.concat('diffCurrentAndRemoteFolderVersions');
2155
+ return (path, remoteVersion) => caller
2156
+ .startPromiseCall(ipcPath, requestType.pack({
2157
+ path, remoteVersion: (0, protobuf_msg_1.toOptVal)(remoteVersion)
2158
+ }))
2159
+ .then(buf => folderDiffFromMsg(replyType.unpack(buf).diff));
2160
+ }
2161
+ vsDiffCurrentAndRemoteFolderVersions.makeCaller = makeCaller;
2162
+ })(vsDiffCurrentAndRemoteFolderVersions || (vsDiffCurrentAndRemoteFolderVersions = {}));
2163
+ Object.freeze(vsDiffCurrentAndRemoteFolderVersions);
1729
2164
  Object.freeze(exports);