core-3nweb-client-lib 0.24.0 → 0.24.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/build/ipc-via-protobuf/asmail-cap.js +17 -18
  2. package/build/ipc-via-protobuf/bytes.js +10 -11
  3. package/build/ipc-via-protobuf/connector.d.ts +2 -1
  4. package/build/ipc-via-protobuf/connector.js +4 -2
  5. package/build/ipc-via-protobuf/file.d.ts +1 -1
  6. package/build/ipc-via-protobuf/file.js +30 -31
  7. package/build/ipc-via-protobuf/fs.d.ts +1 -1
  8. package/build/ipc-via-protobuf/fs.js +37 -38
  9. package/build/ipc-via-protobuf/log-cap.js +4 -5
  10. package/build/ipc-via-protobuf/mailerid.js +5 -7
  11. package/build/ipc-via-protobuf/protobuf-msg.d.ts +1 -2
  12. package/build/ipc-via-protobuf/protobuf-msg.js +9 -24
  13. package/build/ipc-via-protobuf/startup-cap.js +10 -11
  14. package/build/ipc-via-protobuf/storage-cap.js +7 -8
  15. package/build/lib-client/cryptor/cryptor-in-worker.js +7 -20
  16. package/build/lib-client/cryptor/cryptor-wasm.js +1 -1
  17. package/build/lib-client/cryptor/cryptor.wasm +0 -0
  18. package/build/lib-client/cryptor/in-proc-wasm.js +7 -20
  19. package/build/lib-client/{protobuf-loader.d.ts → protobuf-type.d.ts} +2 -4
  20. package/build/lib-client/{protobuf-loader.js → protobuf-type.js} +3 -43
  21. package/build/lib-index.d.ts +0 -1
  22. package/build/protos/asmail.proto.js +22296 -0
  23. package/build/protos/bytes.proto.js +3614 -0
  24. package/build/protos/common.proto.js +1863 -0
  25. package/build/protos/cryptor.proto.js +1667 -0
  26. package/build/protos/file.proto.js +7264 -0
  27. package/build/protos/fs.proto.js +17142 -0
  28. package/build/protos/ipc.proto.js +2349 -0
  29. package/build/protos/logger.proto.js +2112 -0
  30. package/build/protos/mailerid.proto.js +2249 -0
  31. package/build/protos/startup.proto.js +3291 -0
  32. package/build/protos/storage.proto.js +2689 -0
  33. package/package.json +2 -2
  34. package/{build/ipc-via-protobuf/protos → protos}/asmail.proto +0 -0
  35. package/{build/ipc-via-protobuf/protos → protos}/bytes.proto +0 -0
  36. package/{build/ipc-via-protobuf/protos → protos}/common.proto +0 -0
  37. package/{build/ipc-via-protobuf/protos → protos}/file.proto +0 -0
  38. package/{build/ipc-via-protobuf/protos → protos}/fs.proto +0 -0
  39. package/{build/ipc-via-protobuf/protos → protos}/ipc.proto +0 -0
  40. package/{build/ipc-via-protobuf/protos → protos}/logger.proto +0 -0
  41. package/{build/ipc-via-protobuf/protos → protos}/mailerid.proto +0 -0
  42. package/{build/ipc-via-protobuf/protos → protos}/startup.proto +0 -0
  43. package/{build/ipc-via-protobuf/protos → protos}/storage.proto +0 -0
  44. package/build/api-defs/asmail.d.ts +0 -292
  45. package/build/api-defs/common-caps.d.ts +0 -81
  46. package/build/api-defs/files.d.ts +0 -1037
  47. package/build/api-defs/mailerid.d.ts +0 -29
  48. package/build/api-defs/startup.d.ts +0 -121
  49. package/build/api-defs/storage.d.ts +0 -69
  50. package/build/api-defs/web3n.d.ts +0 -50
  51. package/build/ipc-via-protobuf/proto-defs.js +0 -1092
  52. package/build/lib-client/cryptor/proto-defs.js +0 -50
  53. package/build/lib-client/cryptor/protos/cryptor.proto +0 -45
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- Copyright (C) 2020 - 2021 3NSoft Inc.
3
+ Copyright (C) 2020 - 2022 3NSoft Inc.
4
4
 
5
5
  This program is free software: you can redistribute it and/or modify it under
6
6
  the terms of the GNU General Public License as published by the Free Software
@@ -18,6 +18,8 @@
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.makeASMailCaller = exports.exposeASMailCAP = void 0;
20
20
  const protobuf_msg_1 = require("./protobuf-msg");
21
+ const protobuf_type_1 = require("../lib-client/protobuf-type");
22
+ const asmail_proto_1 = require("../protos/asmail.proto");
21
23
  const connector_1 = require("./connector");
22
24
  const rxjs_1 = require("rxjs");
23
25
  const operators_1 = require("rxjs/operators");
@@ -68,9 +70,6 @@ function makeASMailCaller(caller, objPath) {
68
70
  };
69
71
  }
70
72
  exports.makeASMailCaller = makeASMailCaller;
71
- function asmailType(type) {
72
- return protobuf_msg_1.makeProtobufTypeFrom('asmail.proto', `asmail.${type}`);
73
- }
74
73
  var getUserId;
75
74
  (function (getUserId) {
76
75
  function wrapService(fn) {
@@ -96,8 +95,8 @@ var getUserId;
96
95
  Object.freeze(getUserId);
97
96
  var inboxListMsgs;
98
97
  (function (inboxListMsgs) {
99
- const requestType = asmailType('ListMsgsRequestBody');
100
- const replyType = asmailType('ListMsgsInboxReplyBody');
98
+ const requestType = protobuf_type_1.ProtoType.for(asmail_proto_1.asmail.ListMsgsRequestBody);
99
+ const replyType = protobuf_type_1.ProtoType.for(asmail_proto_1.asmail.ListMsgsInboxReplyBody);
101
100
  function unpackMsgInfos(buf) {
102
101
  const msgs = protobuf_msg_1.fixArray(replyType.unpack(buf).infos);
103
102
  for (const msg of msgs) {
@@ -128,7 +127,7 @@ var inboxListMsgs;
128
127
  Object.freeze(inboxListMsgs);
129
128
  var removeMsg;
130
129
  (function (removeMsg) {
131
- const requestType = asmailType('RemoveMsgRequestBody');
130
+ const requestType = protobuf_type_1.ProtoType.for(asmail_proto_1.asmail.RemoveMsgRequestBody);
132
131
  function wrapService(fn) {
133
132
  return (reqBody) => {
134
133
  const { msgId } = requestType.unpack(reqBody);
@@ -148,7 +147,7 @@ var removeMsg;
148
147
  Object.freeze(removeMsg);
149
148
  var getMsg;
150
149
  (function (getMsg) {
151
- const requestType = asmailType('GetMsgRequestBody');
150
+ const requestType = protobuf_type_1.ProtoType.for(asmail_proto_1.asmail.GetMsgRequestBody);
152
151
  function wrapService(fn, expServices) {
153
152
  return (reqBody) => {
154
153
  const { msgId } = requestType.unpack(reqBody);
@@ -167,7 +166,7 @@ var getMsg;
167
166
  getMsg.makeCaller = makeCaller;
168
167
  })(getMsg || (getMsg = {}));
169
168
  Object.freeze(getMsg);
170
- const incomingMessageType = asmailType('IncomingMessageMsg');
169
+ const incomingMessageType = protobuf_type_1.ProtoType.for(asmail_proto_1.asmail.IncomingMessageMsg);
171
170
  function packIncomingMessage(m, expServices) {
172
171
  const ipcMsg = {
173
172
  msgType: m.msgType,
@@ -207,7 +206,7 @@ function unpackIncomingMessage(buf, caller) {
207
206
  }
208
207
  var inboxSubscribe;
209
208
  (function (inboxSubscribe) {
210
- const requestType = asmailType('SubscribeStartCallBody');
209
+ const requestType = protobuf_type_1.ProtoType.for(asmail_proto_1.asmail.SubscribeStartCallBody);
211
210
  function wrapService(fn, expServices) {
212
211
  return buf => {
213
212
  const { event } = requestType.unpack(buf);
@@ -240,7 +239,7 @@ var inboxSubscribe;
240
239
  Object.freeze(inboxSubscribe);
241
240
  var preFlight;
242
241
  (function (preFlight) {
243
- const requestType = asmailType('PreFlightRequestBody');
242
+ const requestType = protobuf_type_1.ProtoType.for(asmail_proto_1.asmail.PreFlightRequestBody);
244
243
  function wrapService(fn) {
245
244
  return (reqBody) => {
246
245
  const { toAddress } = requestType.unpack(reqBody);
@@ -261,7 +260,7 @@ var preFlight;
261
260
  Object.freeze(preFlight);
262
261
  var addMsg;
263
262
  (function (addMsg) {
264
- const requestType = asmailType('AddMsgRequestBody');
263
+ const requestType = protobuf_type_1.ProtoType.for(asmail_proto_1.asmail.AddMsgRequestBody);
265
264
  function packMsg(m, caller) {
266
265
  const ipcMsg = {
267
266
  msgType: m.msgType,
@@ -361,7 +360,7 @@ var addMsg;
361
360
  Object.freeze(addMsg);
362
361
  var delivListMsgs;
363
362
  (function (delivListMsgs) {
364
- const replyType = asmailType('ListMsgsDeliveryReplyBody');
363
+ const replyType = protobuf_type_1.ProtoType.for(asmail_proto_1.asmail.ListMsgsDeliveryReplyBody);
365
364
  function wrapService(fn) {
366
365
  return () => {
367
366
  const promise = fn()
@@ -385,7 +384,7 @@ var delivListMsgs;
385
384
  delivListMsgs.makeCaller = makeCaller;
386
385
  })(delivListMsgs || (delivListMsgs = {}));
387
386
  Object.freeze(delivListMsgs);
388
- const deliveryProgressMsgType = asmailType('DeliveryProgressMsg');
387
+ const deliveryProgressMsgType = protobuf_type_1.ProtoType.for(asmail_proto_1.asmail.DeliveryProgressMsg);
389
388
  function packDeliveryProgress(p) {
390
389
  const m = {
391
390
  notConnected: protobuf_msg_1.toOptVal(p.notConnected),
@@ -427,7 +426,7 @@ function unpackDeliveryProgress(m) {
427
426
  }
428
427
  var currentState;
429
428
  (function (currentState) {
430
- const requestType = asmailType('CurrentStateRequestBody');
429
+ const requestType = protobuf_type_1.ProtoType.for(asmail_proto_1.asmail.CurrentStateRequestBody);
431
430
  function wrapService(fn) {
432
431
  return (reqBody) => {
433
432
  const { id } = requestType.unpack(reqBody);
@@ -458,7 +457,7 @@ var currentState;
458
457
  Object.freeze(currentState);
459
458
  var rmMsg;
460
459
  (function (rmMsg) {
461
- const requestType = asmailType('RmMsgRequestBody');
460
+ const requestType = protobuf_type_1.ProtoType.for(asmail_proto_1.asmail.RmMsgRequestBody);
462
461
  function wrapService(fn) {
463
462
  return (reqBody) => {
464
463
  const { id, cancelSending } = requestType.unpack(reqBody);
@@ -479,7 +478,7 @@ var rmMsg;
479
478
  Object.freeze(rmMsg);
480
479
  var observeAllDeliveries;
481
480
  (function (observeAllDeliveries) {
482
- const notifType = asmailType('DeliveryNotificationWithId');
481
+ const notifType = protobuf_type_1.ProtoType.for(asmail_proto_1.asmail.DeliveryNotificationWithId);
483
482
  function wrapService(fn) {
484
483
  return () => {
485
484
  const s = new rxjs_1.Subject();
@@ -518,7 +517,7 @@ var observeAllDeliveries;
518
517
  Object.freeze(observeAllDeliveries);
519
518
  var observeDelivery;
520
519
  (function (observeDelivery) {
521
- const requestType = asmailType('ObserveDeliveryRequestBody');
520
+ const requestType = protobuf_type_1.ProtoType.for(asmail_proto_1.asmail.ObserveDeliveryRequestBody);
522
521
  function wrapService(fn) {
523
522
  return buf => {
524
523
  const { id } = requestType.unpack(buf);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- Copyright (C) 2020 3NSoft Inc.
3
+ Copyright (C) 2020, 2022 3NSoft Inc.
4
4
 
5
5
  This program is free software: you can redistribute it and/or modify it under
6
6
  the terms of the GNU General Public License as published by the Free Software
@@ -18,6 +18,8 @@
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.exposeSrcService = exports.makeSrcCaller = exports.exposeSinkService = exports.makeSinkCaller = void 0;
20
20
  const protobuf_msg_1 = require("./protobuf-msg");
21
+ const protobuf_type_1 = require("../lib-client/protobuf-type");
22
+ const bytes_proto_1 = require("../protos/bytes.proto");
21
23
  const connector_1 = require("./connector");
22
24
  function makeSinkCaller(caller, ref) {
23
25
  connector_1.checkRefObjTypeIs('FileByteSink', ref);
@@ -69,9 +71,6 @@ function exposeSrcService(src, expServices) {
69
71
  return ref;
70
72
  }
71
73
  exports.exposeSrcService = exposeSrcService;
72
- function bytesType(type) {
73
- return protobuf_msg_1.makeProtobufTypeFrom('bytes.proto', `bytes.${type}`);
74
- }
75
74
  var sinkGetSize;
76
75
  (function (sinkGetSize) {
77
76
  function wrapService(fn) {
@@ -93,7 +92,7 @@ var sinkGetSize;
93
92
  Object.freeze(sinkGetSize);
94
93
  var sinkSplice;
95
94
  (function (sinkSplice) {
96
- const requestType = bytesType('SpliceRequestBody');
95
+ const requestType = protobuf_type_1.ProtoType.for(bytes_proto_1.bytes.SpliceRequestBody);
97
96
  function wrapService(fn) {
98
97
  return buf => {
99
98
  const { pos, del, bytes } = requestType.unpack(buf);
@@ -117,7 +116,7 @@ var sinkSplice;
117
116
  Object.freeze(sinkSplice);
118
117
  var sinkTruncate;
119
118
  (function (sinkTruncate) {
120
- const requestType = bytesType('TruncateRequestBody');
119
+ const requestType = protobuf_type_1.ProtoType.for(bytes_proto_1.bytes.TruncateRequestBody);
121
120
  function wrapService(fn) {
122
121
  return buf => {
123
122
  const { size } = requestType.unpack(buf);
@@ -138,7 +137,7 @@ var sinkTruncate;
138
137
  Object.freeze(sinkTruncate);
139
138
  var sinkShowLayout;
140
139
  (function (sinkShowLayout) {
141
- const replyType = bytesType('FileLayoutMsg');
140
+ const replyType = protobuf_type_1.ProtoType.for(bytes_proto_1.bytes.FileLayoutMsg);
142
141
  function packLayout(l) {
143
142
  return {
144
143
  base: protobuf_msg_1.toOptVal(l.base),
@@ -172,7 +171,7 @@ var sinkShowLayout;
172
171
  Object.freeze(sinkShowLayout);
173
172
  var sinkDone;
174
173
  (function (sinkDone) {
175
- const requestType = bytesType('DoneRequestBody');
174
+ const requestType = protobuf_type_1.ProtoType.for(bytes_proto_1.bytes.DoneRequestBody);
176
175
  function wrapService(fn) {
177
176
  return buf => {
178
177
  const { err } = requestType.unpack(buf);
@@ -232,8 +231,8 @@ var srcGetPosition;
232
231
  Object.freeze(srcGetPosition);
233
232
  var srcRead;
234
233
  (function (srcRead) {
235
- const requestType = bytesType('ReadRequestBody');
236
- const replyType = bytesType('ReadReplyBody');
234
+ const requestType = protobuf_type_1.ProtoType.for(bytes_proto_1.bytes.ReadRequestBody);
235
+ const replyType = protobuf_type_1.ProtoType.for(bytes_proto_1.bytes.ReadReplyBody);
237
236
  function wrapService(fn) {
238
237
  return buf => {
239
238
  const { len } = requestType.unpack(buf);
@@ -254,7 +253,7 @@ var srcRead;
254
253
  Object.freeze(srcRead);
255
254
  var srcSeek;
256
255
  (function (srcSeek) {
257
- const requestType = bytesType('SeekRequestBody');
256
+ const requestType = protobuf_type_1.ProtoType.for(bytes_proto_1.bytes.SeekRequestBody);
258
257
  function wrapService(fn) {
259
258
  return buf => {
260
259
  const { offset } = requestType.unpack(buf);
@@ -1,6 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { Observable, Observer, Subject } from "rxjs";
3
3
  import { ObjectReference, Value } from "./protobuf-msg";
4
+ import { ProtoType } from '../lib-client/protobuf-type';
4
5
  export interface ExposedServices {
5
6
  exposeDroppableService<T>(objType: T, exp: ExposedFn | ExposedObj<any>, original: any): ObjectReference<T>;
6
7
  getOriginalObj<T>(ref: ObjectReference<any>): T;
@@ -58,7 +59,7 @@ export declare type EnvelopeBody = Buffer | void;
58
59
  export declare type MsgType = ClientToService | ServiceToClient;
59
60
  export declare type ClientToService = 'start' | 'cancel' | 'drop' | 'list-obj';
60
61
  export declare type ServiceToClient = 'interim' | 'end' | 'error';
61
- export declare const msgProtoType: import("../lib-client/protobuf-loader").ProtoType<Envelope>;
62
+ export declare const msgProtoType: ProtoType<Envelope>;
62
63
  export declare type ExposedFn = (reqBody: EnvelopeBody) => ({
63
64
  promise?: Promise<EnvelopeBody>;
64
65
  obs?: Observable<EnvelopeBody>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- Copyright (C) 2020 - 2021 3NSoft Inc.
3
+ Copyright (C) 2020 - 2022 3NSoft Inc.
4
4
 
5
5
  This program is free software: you can redistribute it and/or modify it under
6
6
  the terms of the GNU General Public License as published by the Free Software
@@ -18,6 +18,8 @@
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.checkRefObjTypeIs = exports.makeIPCException = exports.msgProtoType = exports.W3N_NAME = exports.ObjectsConnector = void 0;
20
20
  const protobuf_msg_1 = require("./protobuf-msg");
21
+ const protobuf_type_1 = require("../lib-client/protobuf-type");
22
+ const ipc_proto_1 = require("../protos/ipc.proto");
21
23
  // Note that make_?_Side functions could've been imported normally, but client
22
24
  // side uses weakrefs, while services side doesn't, and services side is used
23
25
  // in embedding without weakrefs, needing to hide require points.
@@ -156,7 +158,7 @@ exports.ObjectsConnector = ObjectsConnector;
156
158
  Object.freeze(ObjectsConnector.prototype);
157
159
  Object.freeze(ObjectsConnector);
158
160
  exports.W3N_NAME = 'w3n';
159
- exports.msgProtoType = protobuf_msg_1.makeProtobufTypeFrom('ipc.proto', 'ipc.Envelope');
161
+ exports.msgProtoType = protobuf_type_1.ProtoType.for(ipc_proto_1.ipc.Envelope);
160
162
  function makeIPCException(fields) {
161
163
  const exc = {
162
164
  runtimeException: true,
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { ObjectReference, Value } from "./protobuf-msg";
3
+ import { ProtoType } from '../lib-client/protobuf-type';
3
4
  import { ExposedFn, EnvelopeBody, Caller, ExposedServices } from "./connector";
4
- import { ProtoType } from "../lib-client/protobuf-loader";
5
5
  declare type ReadonlyFile = web3n.files.ReadonlyFile;
6
6
  declare type ReadonlyFileVersionedAPI = web3n.files.ReadonlyFileVersionedAPI;
7
7
  declare type WritableFile = web3n.files.WritableFile;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- Copyright (C) 2020 3NSoft Inc.
3
+ Copyright (C) 2020, 2022 3NSoft Inc.
4
4
 
5
5
  This program is free software: you can redistribute it and/or modify it under
6
6
  the terms of the GNU General Public License as published by the Free Software
@@ -18,6 +18,8 @@
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.vGetByteSink = exports.updateXAttrs = 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.unpackStats = exports.packStats = exports.fileMsgType = exports.exposeFileService = exports.makeFileCaller = void 0;
20
20
  const protobuf_msg_1 = require("./protobuf-msg");
21
+ const protobuf_type_1 = require("../lib-client/protobuf-type");
22
+ const file_proto_1 = require("../protos/file.proto");
21
23
  const connector_1 = require("./connector");
22
24
  const error_1 = require("../lib-common/exceptions/error");
23
25
  const bytes_1 = require("./bytes");
@@ -118,11 +120,8 @@ function exposeFileService(file, expServices) {
118
120
  return fileMsg;
119
121
  }
120
122
  exports.exposeFileService = exposeFileService;
121
- function makeFileType(type) {
122
- return protobuf_msg_1.makeProtobufTypeFrom('file.proto', `file.${type}`);
123
- }
124
- exports.fileMsgType = makeFileType('File');
125
- const statsMsgType = makeFileType('StatsMsg');
123
+ exports.fileMsgType = protobuf_type_1.ProtoType.for(file_proto_1.file.File);
124
+ const statsMsgType = protobuf_type_1.ProtoType.for(file_proto_1.file.StatsMsg);
126
125
  function packStats(s) {
127
126
  const msg = {
128
127
  writable: s.writable,
@@ -151,7 +150,7 @@ function unpackStats(buf) {
151
150
  };
152
151
  }
153
152
  exports.unpackStats = unpackStats;
154
- const fileType = makeFileType('File');
153
+ const fileType = protobuf_type_1.ProtoType.for(file_proto_1.file.File);
155
154
  var stat;
156
155
  (function (stat) {
157
156
  function wrapService(fn) {
@@ -171,7 +170,7 @@ var stat;
171
170
  stat.makeCaller = makeCaller;
172
171
  })(stat || (stat = {}));
173
172
  Object.freeze(stat);
174
- const xattrValueType = makeFileType('XAttrValue');
173
+ const xattrValueType = protobuf_type_1.ProtoType.for(file_proto_1.file.XAttrValue);
175
174
  function packXAttrValue(val) {
176
175
  if (Buffer.isBuffer(val)) {
177
176
  return xattrValueType.pack({ bytes: protobuf_msg_1.toVal(val) });
@@ -202,7 +201,7 @@ function unpackXAttrValue(buf) {
202
201
  exports.unpackXAttrValue = unpackXAttrValue;
203
202
  var getXAttr;
204
203
  (function (getXAttr) {
205
- const requestType = makeFileType('GetXAttrRequestBody');
204
+ const requestType = protobuf_type_1.ProtoType.for(file_proto_1.file.GetXAttrRequestBody);
206
205
  function wrapService(fn) {
207
206
  return buf => {
208
207
  const { xaName } = requestType.unpack(buf);
@@ -242,8 +241,8 @@ var listXAttrs;
242
241
  Object.freeze(listXAttrs);
243
242
  var readBytes;
244
243
  (function (readBytes) {
245
- const requestType = makeFileType('ReadBytesRequestBody');
246
- const replyType = makeFileType('ReadBytesReplyBody');
244
+ const requestType = protobuf_type_1.ProtoType.for(file_proto_1.file.ReadBytesRequestBody);
245
+ const replyType = protobuf_type_1.ProtoType.for(file_proto_1.file.ReadBytesReplyBody);
247
246
  function packReply(bytes) {
248
247
  return replyType.pack({ bytes: protobuf_msg_1.toOptVal(bytes) });
249
248
  }
@@ -351,7 +350,7 @@ var getByteSource;
351
350
  getByteSource.makeCaller = makeCaller;
352
351
  })(getByteSource || (getByteSource = {}));
353
352
  Object.freeze(getByteSource);
354
- const fileEventType = makeFileType('FileEventMsg');
353
+ const fileEventType = protobuf_type_1.ProtoType.for(file_proto_1.file.FileEventMsg);
355
354
  function packFileEvent(e) {
356
355
  const msg = {
357
356
  type: e.type,
@@ -411,8 +410,8 @@ var watch;
411
410
  Object.freeze(watch);
412
411
  var vGetXAttr;
413
412
  (function (vGetXAttr) {
414
- const requestType = makeFileType('GetXAttrRequestBody');
415
- vGetXAttr.replyType = makeFileType('VersionedGetXAttrReplyBody');
413
+ const requestType = protobuf_type_1.ProtoType.for(file_proto_1.file.GetXAttrRequestBody);
414
+ vGetXAttr.replyType = protobuf_type_1.ProtoType.for(file_proto_1.file.VersionedGetXAttrReplyBody);
416
415
  function unpackReply(buf) {
417
416
  const { json, str, bytes, version: v } = vGetXAttr.replyType.unpack(buf);
418
417
  const version = protobuf_msg_1.fixInt(v);
@@ -457,7 +456,7 @@ var vGetXAttr;
457
456
  Object.freeze(vGetXAttr);
458
457
  var vListXAttrs;
459
458
  (function (vListXAttrs) {
460
- vListXAttrs.replyType = makeFileType('VersionedListXAttrsReplyBody');
459
+ vListXAttrs.replyType = protobuf_type_1.ProtoType.for(file_proto_1.file.VersionedListXAttrsReplyBody);
461
460
  function wrapService(fn) {
462
461
  return () => {
463
462
  const promise = fn()
@@ -480,8 +479,8 @@ var vListXAttrs;
480
479
  Object.freeze(vListXAttrs);
481
480
  var vReadBytes;
482
481
  (function (vReadBytes) {
483
- const requestType = makeFileType('ReadBytesRequestBody');
484
- const replyType = makeFileType('VersionedReadBytesReplyBody');
482
+ const requestType = protobuf_type_1.ProtoType.for(file_proto_1.file.ReadBytesRequestBody);
483
+ const replyType = protobuf_type_1.ProtoType.for(file_proto_1.file.VersionedReadBytesReplyBody);
485
484
  function packReply(r) {
486
485
  return replyType.pack({
487
486
  version: r.version, bytes: protobuf_msg_1.toOptVal(r.bytes)
@@ -515,7 +514,7 @@ var vReadBytes;
515
514
  Object.freeze(vReadBytes);
516
515
  var vReadTxt;
517
516
  (function (vReadTxt) {
518
- vReadTxt.replyType = makeFileType('VersionedReadTxtReplyBody');
517
+ vReadTxt.replyType = protobuf_type_1.ProtoType.for(file_proto_1.file.VersionedReadTxtReplyBody);
519
518
  function wrapService(fn) {
520
519
  return () => {
521
520
  const promise = fn()
@@ -538,7 +537,7 @@ var vReadTxt;
538
537
  Object.freeze(vReadTxt);
539
538
  var vReadJSON;
540
539
  (function (vReadJSON) {
541
- vReadJSON.replyType = makeFileType('VersionedReadJsonReplyBody');
540
+ vReadJSON.replyType = protobuf_type_1.ProtoType.for(file_proto_1.file.VersionedReadJsonReplyBody);
542
541
  function wrapService(fn) {
543
542
  return () => {
544
543
  const promise = fn()
@@ -568,7 +567,7 @@ var vReadJSON;
568
567
  Object.freeze(vReadJSON);
569
568
  var vGetByteSource;
570
569
  (function (vGetByteSource) {
571
- vGetByteSource.replyType = makeFileType('VersionedGetByteSourceReplyBody');
570
+ vGetByteSource.replyType = protobuf_type_1.ProtoType.for(file_proto_1.file.VersionedGetByteSourceReplyBody);
572
571
  function wrapService(fn, expServices) {
573
572
  return () => {
574
573
  const promise = fn()
@@ -594,7 +593,7 @@ var vGetByteSource;
594
593
  Object.freeze(vGetByteSource);
595
594
  var updateXAttrs;
596
595
  (function (updateXAttrs) {
597
- const requestType = makeFileType('UpdateXAttrsRequestBody');
596
+ const requestType = protobuf_type_1.ProtoType.for(file_proto_1.file.UpdateXAttrsRequestBody);
598
597
  function fromReqChanges(r) {
599
598
  const attrs = {};
600
599
  if (r.set) {
@@ -668,7 +667,7 @@ var updateXAttrs;
668
667
  Object.freeze(updateXAttrs);
669
668
  var writeBytes;
670
669
  (function (writeBytes) {
671
- const requestType = makeFileType('WriteBytesRequestBody');
670
+ const requestType = protobuf_type_1.ProtoType.for(file_proto_1.file.WriteBytesRequestBody);
672
671
  function wrapService(fn) {
673
672
  return buf => {
674
673
  const { bytes } = requestType.unpack(buf);
@@ -689,7 +688,7 @@ var writeBytes;
689
688
  Object.freeze(writeBytes);
690
689
  var writeTxt;
691
690
  (function (writeTxt) {
692
- const requestType = makeFileType('WriteTxtRequestBody');
691
+ const requestType = protobuf_type_1.ProtoType.for(file_proto_1.file.WriteTxtRequestBody);
693
692
  function wrapService(fn) {
694
693
  return buf => {
695
694
  const { txt } = requestType.unpack(buf);
@@ -708,7 +707,7 @@ var writeTxt;
708
707
  Object.freeze(writeTxt);
709
708
  var writeJSON;
710
709
  (function (writeJSON) {
711
- const requestType = makeFileType('WriteJsonRequestBody');
710
+ const requestType = protobuf_type_1.ProtoType.for(file_proto_1.file.WriteJsonRequestBody);
712
711
  function wrapService(fn) {
713
712
  return buf => {
714
713
  const { json } = requestType.unpack(buf);
@@ -729,7 +728,7 @@ var writeJSON;
729
728
  Object.freeze(writeJSON);
730
729
  var getByteSink;
731
730
  (function (getByteSink) {
732
- const requestType = makeFileType('GetByteSinkRequestBody');
731
+ const requestType = protobuf_type_1.ProtoType.for(file_proto_1.file.GetByteSinkRequestBody);
733
732
  function wrapService(fn, expServices) {
734
733
  return buf => {
735
734
  const { truncateFile } = requestType.unpack(buf);
@@ -758,7 +757,7 @@ var getByteSink;
758
757
  Object.freeze(getByteSink);
759
758
  var copy;
760
759
  (function (copy) {
761
- copy.requestType = makeFileType('CopyRequestBody');
760
+ copy.requestType = protobuf_type_1.ProtoType.for(file_proto_1.file.CopyRequestBody);
762
761
  function wrapService(fn, expServices) {
763
762
  return buf => {
764
763
  const { file: fRef } = copy.requestType.unpack(buf);
@@ -827,7 +826,7 @@ var vUpdateXAttrs;
827
826
  Object.freeze(vUpdateXAttrs);
828
827
  var vWriteBytes;
829
828
  (function (vWriteBytes) {
830
- const requestType = makeFileType('WriteBytesRequestBody');
829
+ const requestType = protobuf_type_1.ProtoType.for(file_proto_1.file.WriteBytesRequestBody);
831
830
  function wrapService(fn) {
832
831
  return buf => {
833
832
  const { bytes } = requestType.unpack(buf);
@@ -848,7 +847,7 @@ var vWriteBytes;
848
847
  Object.freeze(vWriteBytes);
849
848
  var vWriteTxt;
850
849
  (function (vWriteTxt) {
851
- const requestType = makeFileType('WriteTxtRequestBody');
850
+ const requestType = protobuf_type_1.ProtoType.for(file_proto_1.file.WriteTxtRequestBody);
852
851
  function wrapService(fn) {
853
852
  return buf => {
854
853
  const { txt } = requestType.unpack(buf);
@@ -869,7 +868,7 @@ var vWriteTxt;
869
868
  Object.freeze(vWriteTxt);
870
869
  var vWriteJSON;
871
870
  (function (vWriteJSON) {
872
- const requestType = makeFileType('WriteJsonRequestBody');
871
+ const requestType = protobuf_type_1.ProtoType.for(file_proto_1.file.WriteJsonRequestBody);
873
872
  function wrapService(fn) {
874
873
  return buf => {
875
874
  const { json } = requestType.unpack(buf);
@@ -890,8 +889,8 @@ var vWriteJSON;
890
889
  Object.freeze(vWriteJSON);
891
890
  var vGetByteSink;
892
891
  (function (vGetByteSink) {
893
- const requestType = makeFileType('VersionedGetByteSinkRequestBody');
894
- vGetByteSink.replyType = makeFileType('VersionedGetByteSinkReplyBody');
892
+ const requestType = protobuf_type_1.ProtoType.for(file_proto_1.file.VersionedGetByteSinkRequestBody);
893
+ vGetByteSink.replyType = protobuf_type_1.ProtoType.for(file_proto_1.file.VersionedGetByteSinkReplyBody);
895
894
  function wrapService(fn, expServices) {
896
895
  return buf => {
897
896
  const { truncateFile, currentVersion } = requestType.unpack(buf);
@@ -1,7 +1,7 @@
1
1
  import { ObjectReference, Value } from "./protobuf-msg";
2
+ import { ProtoType } from '../lib-client/protobuf-type';
2
3
  import { Caller, ExposedServices } from "./connector";
3
4
  import { FileMsg } from "./file";
4
- import { ProtoType } from "../lib-client/protobuf-loader";
5
5
  declare type FS = web3n.files.FS;
6
6
  declare type FSItem = web3n.files.FSItem;
7
7
  export declare function makeFSCaller(caller: Caller, fsMsg: FSMsg): FS;