spec-3nweb-server 1.3.8 → 1.4.0

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 (89) hide show
  1. package/build/3nstorage/3nstorage-app.js +4 -4
  2. package/build/3nstorage/owner.js +21 -21
  3. package/build/3nstorage/resources/store.js +25 -24
  4. package/build/3nstorage/resources/users.js +2 -2
  5. package/build/3nstorage/routes/owner/archive-obj-version.d.ts +2 -2
  6. package/build/3nstorage/routes/owner/archive-obj-version.js +3 -2
  7. package/build/3nstorage/routes/owner/cancel-trans.js +1 -1
  8. package/build/3nstorage/routes/owner/delete-obj.js +1 -1
  9. package/build/3nstorage/routes/owner/get-archived-obj-ver.js +2 -2
  10. package/build/3nstorage/routes/owner/get-current-obj.js +2 -2
  11. package/build/3nstorage/routes/owner/list-obj-archive.js +3 -2
  12. package/build/3nstorage/routes/owner/param-getter.js +3 -2
  13. package/build/3nstorage/routes/owner/param-setter.js +3 -2
  14. package/build/3nstorage/routes/owner/put-current-obj.js +12 -10
  15. package/build/3nstorage/routes/owner/session-params.js +4 -3
  16. package/build/admin/admin-app.js +5 -5
  17. package/build/admin/resources/users.js +42 -42
  18. package/build/admin/routes/add.js +3 -3
  19. package/build/admin/signup-tokens.js +8 -8
  20. package/build/asmail/asmail-app.js +7 -7
  21. package/build/asmail/config.js +9 -8
  22. package/build/asmail/delivery.js +10 -9
  23. package/build/asmail/resources/delivery-sessions.js +4 -3
  24. package/build/asmail/resources/inbox.d.ts +1 -1
  25. package/build/asmail/resources/inbox.js +22 -22
  26. package/build/asmail/resources/recipients.d.ts +2 -1
  27. package/build/asmail/resources/recipients.js +4 -4
  28. package/build/asmail/resources/sessions.js +2 -1
  29. package/build/asmail/retrieval.js +13 -8
  30. package/build/asmail/routes/config/param-getter.js +3 -2
  31. package/build/asmail/routes/config/param-setter.js +3 -2
  32. package/build/asmail/routes/delivery/finalize-delivery.js +3 -2
  33. package/build/asmail/routes/delivery/pre-flight.js +5 -4
  34. package/build/asmail/routes/delivery/provide-recipient-pubkey.js +3 -2
  35. package/build/asmail/routes/delivery/put-metadata.js +3 -2
  36. package/build/asmail/routes/delivery/put-obj.js +4 -4
  37. package/build/asmail/routes/delivery/restart-session.js +4 -3
  38. package/build/asmail/routes/delivery/sender-authorization.d.ts +1 -3
  39. package/build/asmail/routes/delivery/sender-authorization.js +3 -2
  40. package/build/asmail/routes/delivery/start-session.js +5 -4
  41. package/build/asmail/routes/retrieval/get-message-meta.js +3 -2
  42. package/build/asmail/routes/retrieval/get-message-obj.js +4 -3
  43. package/build/asmail/routes/retrieval/list-messages.js +3 -2
  44. package/build/asmail/routes/retrieval/remove-message.js +3 -2
  45. package/build/lib-common/async-fs-node.js +13 -13
  46. package/build/lib-common/byte-streaming/common.js +9 -9
  47. package/build/lib-common/canonical-address.js +1 -1
  48. package/build/lib-common/ipc/generic-ipc.js +12 -12
  49. package/build/lib-common/ipc/ws-ipc.js +2 -2
  50. package/build/lib-common/mid-sigs-NaCl-Ed.js +14 -14
  51. package/build/lib-common/objs-on-disk/file-layout.js +10 -10
  52. package/build/lib-common/objs-on-disk/obj-file.js +11 -11
  53. package/build/lib-common/objs-on-disk/utils.js +3 -3
  54. package/build/lib-common/processes.js +1 -1
  55. package/build/lib-common/random-node.js +7 -7
  56. package/build/lib-common/service-api/3nstorage/owner.d.ts +5 -4
  57. package/build/lib-common/service-api/3nstorage/owner.js +11 -10
  58. package/build/lib-common/service-api/asmail/delivery.js +2 -2
  59. package/build/lib-common/service-api/asmail/retrieval.js +1 -1
  60. package/build/lib-server/conf-util.js +2 -1
  61. package/build/lib-server/middleware/body-parsers.js +16 -16
  62. package/build/lib-server/middleware/error-handler.js +1 -1
  63. package/build/lib-server/resources/mailerid-authorizer.js +3 -3
  64. package/build/lib-server/resources/mem-backed-sessions-factory.js +3 -3
  65. package/build/lib-server/resources/server-data-folders.js +23 -23
  66. package/build/lib-server/resources/sessions.js +5 -5
  67. package/build/lib-server/resources/user-files.js +8 -8
  68. package/build/lib-server/routes/pub-key-login/complete-exchange.js +4 -3
  69. package/build/lib-server/routes/pub-key-login/start-exchange.js +7 -6
  70. package/build/lib-server/routes/sessions/mid-auth.js +6 -5
  71. package/build/lib-server/routes/sessions/start.js +4 -3
  72. package/build/lib-server/web-sockets/app.js +6 -5
  73. package/build/lib-server/web-sockets/server-events.js +5 -4
  74. package/build/mailerId/mailerId-app.js +7 -7
  75. package/build/mailerId/resources/certifier.d.ts +4 -6
  76. package/build/mailerId/resources/certifier.js +8 -7
  77. package/build/mailerId/resources/compute-login-dhshared-key.js +2 -1
  78. package/build/mailerId/resources/sessions.js +2 -1
  79. package/build/mailerId/resources/users.js +4 -4
  80. package/build/mailerId/routes/certify.js +1 -1
  81. package/build/main.js +10 -10
  82. package/build/mock/dns.js +1 -1
  83. package/build/mock/mock-as-child-proc.js +10 -10
  84. package/build/mock/node-child-ipc.js +2 -2
  85. package/build/mock/run-in-proc.js +7 -7
  86. package/build/run-config.js +10 -10
  87. package/build/run.js +4 -4
  88. package/build/services.js +5 -5
  89. package/package.json +7 -4
@@ -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.makeFactory = exports.BIN_TYPE = void 0;
19
+ exports.makeFactory = exports.BIN_TYPE = exports.SC = void 0;
20
20
  const inbox_1 = require("./inbox");
21
21
  const server_data_folders_1 = require("../../lib-server/resources/server-data-folders");
22
22
  var inbox_2 = require("./inbox");
@@ -77,7 +77,7 @@ async function adaptToFreeSpaceLeft(inbox, msgSize) {
77
77
  }
78
78
  /**
79
79
  * @param inbox
80
- * @param invitation is a string invitation token, or null.
80
+ * @param invitation is a string invitation token, or undefined.
81
81
  * @returns a promise, resolvable to
82
82
  * (1) zero (0), if leaving mail is forbidden,
83
83
  * (2) greater than zero maximum message length, and
@@ -107,7 +107,7 @@ async function allowedMsgSizeForAnonSender(inbox, invitation) {
107
107
  /**
108
108
  * @param inbox
109
109
  * @param sender is sender string address
110
- * @param invitation is a string invitation token, or null.
110
+ * @param invitation is a string invitation token, or undefined.
111
111
  * @returns a promise, resolvable to
112
112
  * (1) zero (0), if leaving mail is forbidden,
113
113
  * (2) greater than zero maximum message length, and
@@ -163,7 +163,7 @@ function makeFactory(rootFolder, writeBufferSize, readBufferSize) {
163
163
  }
164
164
  }
165
165
  else {
166
- const userFolder = server_data_folders_1.userDataInRootFolder(rootFolder, userId);
166
+ const userFolder = (0, server_data_folders_1.userDataInRootFolder)(rootFolder, userId);
167
167
  inbox = await inbox_1.Inbox.make(userFolder, userId, mailEventsSink, writeBufferSize, readBufferSize);
168
168
  boxes.set(userId, inbox);
169
169
  return inbox;
@@ -13,7 +13,8 @@
13
13
  See the GNU General Public License for more details.
14
14
 
15
15
  You should have received a copy of the GNU General Public License along with
16
- this program. If not, see <http://www.gnu.org/licenses/>. */
16
+ this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
17
18
  Object.defineProperty(exports, "__esModule", { value: true });
18
19
  exports.makeSessionFactory = void 0;
19
20
  const mem_backed_sessions_factory_1 = require("../../lib-server/resources/mem-backed-sessions-factory");
@@ -13,9 +13,14 @@
13
13
  See the GNU General Public License for more details.
14
14
 
15
15
  You should have received a copy of the GNU General Public License along with
16
- this program. If not, see <http://www.gnu.org/licenses/>. */
16
+ this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
17
18
  Object.defineProperty(exports, "__esModule", { value: true });
18
19
  exports.makeApp = void 0;
20
+ /**
21
+ * This module gives a function that creates a mountable, or app.use()-able,
22
+ * express ASMail application.
23
+ */
19
24
  // Internal libs
20
25
  const body_parsers_1 = require("../lib-server/middleware/body-parsers");
21
26
  const app_1 = require("../lib-server/web-sockets/app");
@@ -47,14 +52,14 @@ function setWSPart(app, sessions, recipients) {
47
52
  }
48
53
  function setHttpPart(app, domain, sessions, recipients, midAuthorizer) {
49
54
  app.http.disable('etag');
50
- app.http.post('/' + api.midLogin.START_URL_END, sessions.checkSession(), body_parsers_1.json('1kb'), start_1.startSession(recipients.exists, sessions.generate));
51
- app.http.post('/' + api.midLogin.AUTH_URL_END, sessions.ensureOpenedSession(), body_parsers_1.json('4kb'), mid_auth_1.midLogin(domain, midAuthorizer));
55
+ app.http.post('/' + api.midLogin.START_URL_END, sessions.checkSession(), (0, body_parsers_1.json)('1kb'), (0, start_1.startSession)(recipients.exists, sessions.generate));
56
+ app.http.post('/' + api.midLogin.AUTH_URL_END, sessions.ensureOpenedSession(), (0, body_parsers_1.json)('4kb'), (0, mid_auth_1.midLogin)(domain, midAuthorizer));
52
57
  // *** Require authorized session for everything below ***
53
58
  app.http.use(sessions.ensureAuthorizedSession());
54
- app.http.post('/' + api.closeSession.URL_END, body_parsers_1.emptyBody(), close_1.closeSession());
55
- app.http.get('/' + api.listMsgs.URL_END, list_messages_1.listMsgIds(recipients.getMsgIds));
56
- app.http.get('/' + api.msgMetadata.EXPRESS_URL_END, get_message_meta_1.getMsgMeta(recipients.getMsgMeta));
57
- app.http.delete('/' + api.rmMsg.EXPRESS_URL_END, remove_message_1.deleteMsg(recipients.deleteMsg));
58
- app.http.get('/' + api.msgObj.EXPRESS_URL_END, get_message_obj_1.getMsgObj(recipients.getObj));
59
+ app.http.post('/' + api.closeSession.URL_END, (0, body_parsers_1.emptyBody)(), (0, close_1.closeSession)());
60
+ app.http.get('/' + api.listMsgs.URL_END, (0, list_messages_1.listMsgIds)(recipients.getMsgIds));
61
+ app.http.get('/' + api.msgMetadata.EXPRESS_URL_END, (0, get_message_meta_1.getMsgMeta)(recipients.getMsgMeta));
62
+ app.http.delete('/' + api.rmMsg.EXPRESS_URL_END, (0, remove_message_1.deleteMsg)(recipients.deleteMsg));
63
+ app.http.get('/' + api.msgObj.EXPRESS_URL_END, (0, get_message_obj_1.getMsgObj)(recipients.getObj));
59
64
  }
60
65
  Object.freeze(exports);
@@ -13,7 +13,8 @@
13
13
  See the GNU General Public License for more details.
14
14
 
15
15
  You should have received a copy of the GNU General Public License along with
16
- this program. If not, see <http://www.gnu.org/licenses/>. */
16
+ this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
17
18
  Object.defineProperty(exports, "__esModule", { value: true });
18
19
  exports.getParam = void 0;
19
20
  const recipients_1 = require("../../resources/recipients");
@@ -22,7 +23,7 @@ function getParam(paramGetter) {
22
23
  if ('function' !== typeof paramGetter) {
23
24
  throw new TypeError("Given argument 'paramGetter' must be function, but is not.");
24
25
  }
25
- return async function (req, res, next) {
26
+ return async (req, res, next) => {
26
27
  const session = req.session;
27
28
  const userId = session.params.userId;
28
29
  try {
@@ -13,7 +13,8 @@
13
13
  See the GNU General Public License for more details.
14
14
 
15
15
  You should have received a copy of the GNU General Public License along with
16
- this program. If not, see <http://www.gnu.org/licenses/>. */
16
+ this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
17
18
  Object.defineProperty(exports, "__esModule", { value: true });
18
19
  exports.setParam = void 0;
19
20
  const recipients_1 = require("../../resources/recipients");
@@ -22,7 +23,7 @@ function setParam(paramSetter) {
22
23
  if ('function' !== typeof paramSetter) {
23
24
  throw new TypeError("Given argument 'paramSetter' must be function, but is not.");
24
25
  }
25
- return async function (req, res, next) {
26
+ return async (req, res, next) => {
26
27
  const session = req.session;
27
28
  const userId = session.params.userId;
28
29
  const pValue = req.body;
@@ -13,7 +13,8 @@
13
13
  See the GNU General Public License for more details.
14
14
 
15
15
  You should have received a copy of the GNU General Public License along with
16
- this program. If not, see <http://www.gnu.org/licenses/>. */
16
+ this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
17
18
  Object.defineProperty(exports, "__esModule", { value: true });
18
19
  exports.finalizeDelivery = void 0;
19
20
  const recipients_1 = require("../../resources/recipients");
@@ -22,7 +23,7 @@ function finalizeDelivery(finDelivFunc) {
22
23
  if ('function' !== typeof finDelivFunc) {
23
24
  throw new TypeError("Given argument 'finDelivFunc' must be function, but is not.");
24
25
  }
25
- return async function (req, res, next) {
26
+ return async (req, res, next) => {
26
27
  const session = req.session;
27
28
  const recipient = session.params.recipient;
28
29
  const msgId = session.params.msgId;
@@ -13,7 +13,8 @@
13
13
  See the GNU General Public License for more details.
14
14
 
15
15
  You should have received a copy of the GNU General Public License along with
16
- this program. If not, see <http://www.gnu.org/licenses/>. */
16
+ this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
17
18
  Object.defineProperty(exports, "__esModule", { value: true });
18
19
  exports.preFlight = void 0;
19
20
  const recipients_1 = require("../../resources/recipients");
@@ -59,9 +60,9 @@ function preFlight(allowedMsgSizeFunc, redirectFunc) {
59
60
  throw new Error(`Unrecognized code ${msgSize} for message size limits.`);
60
61
  }
61
62
  }
62
- return async function (req, res, next) {
63
+ return async (req, res, next) => {
63
64
  const rb = req.body;
64
- const recipient = canonical_address_1.checkAndTransformAddress(rb.recipient);
65
+ const recipient = (0, canonical_address_1.checkAndTransformAddress)(rb.recipient);
65
66
  let sender = rb.sender;
66
67
  const invitation = rb.invitation;
67
68
  const session = req.session;
@@ -81,7 +82,7 @@ function preFlight(allowedMsgSizeFunc, redirectFunc) {
81
82
  }
82
83
  // if sender is given, we canonicalize the address
83
84
  if (sender) {
84
- sender = canonical_address_1.checkAndTransformAddress(sender);
85
+ sender = (0, canonical_address_1.checkAndTransformAddress)(sender);
85
86
  if (!sender) {
86
87
  res.status(delivery_1.ERR_SC.malformed).json({
87
88
  error: "Sender field is malformed"
@@ -13,7 +13,8 @@
13
13
  See the GNU General Public License for more details.
14
14
 
15
15
  You should have received a copy of the GNU General Public License along with
16
- this program. If not, see <http://www.gnu.org/licenses/>. */
16
+ this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
17
18
  Object.defineProperty(exports, "__esModule", { value: true });
18
19
  exports.getRecipientPubKey = void 0;
19
20
  const recipients_1 = require("../../resources/recipients");
@@ -27,7 +28,7 @@ function getRecipientPubKey(pkeyProvidingFunc) {
27
28
  if ('function' !== typeof pkeyProvidingFunc) {
28
29
  throw new TypeError("Given argument 'pkeyProvidingFunc' must be function, but is not.");
29
30
  }
30
- return async function (req, res, next) {
31
+ return async (req, res, next) => {
31
32
  const session = req.session;
32
33
  try {
33
34
  const certs = await pkeyProvidingFunc(session.params.recipient);
@@ -13,7 +13,8 @@
13
13
  See the GNU General Public License for more details.
14
14
 
15
15
  You should have received a copy of the GNU General Public License along with
16
- this program. If not, see <http://www.gnu.org/licenses/>. */
16
+ this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
17
18
  Object.defineProperty(exports, "__esModule", { value: true });
18
19
  exports.saveMetadata = void 0;
19
20
  const recipients_1 = require("../../resources/recipients");
@@ -48,7 +49,7 @@ function saveMetadata(setMsgStorageFunc, maxChunk) {
48
49
  "be function, but is not.");
49
50
  }
50
51
  const maxChunkSize = confUtil.stringToNumOfBytes(maxChunk);
51
- return async function (req, res, next) {
52
+ return async (req, res, next) => {
52
53
  const session = req.session;
53
54
  const msgMeta = req.body;
54
55
  const recipient = session.params.recipient;
@@ -26,9 +26,9 @@ function saveMsgObj(saveObjFunc, chunkLimit) {
26
26
  throw new TypeError("Given argument 'saveObjFunc' must be function, but is not.");
27
27
  }
28
28
  const maxChunkSize = confUtil.stringToNumOfBytes(chunkLimit);
29
- return async function (req, res, next) {
29
+ return async (req, res, next) => {
30
30
  if (!req.is(recipients_1.BIN_TYPE)) {
31
- body_parsers_1.attachByteDrainToRequest(req);
31
+ (0, body_parsers_1.attachByteDrainToRequest)(req);
32
32
  res.status(delivery_1.ERR_SC.wrongContentType).send(`Content-Type must be ${recipients_1.BIN_TYPE} for this call.`);
33
33
  return;
34
34
  }
@@ -43,7 +43,7 @@ function saveMsgObj(saveObjFunc, chunkLimit) {
43
43
  // get and check Content-Length, implicitly sending replies for bad length
44
44
  let len = getContentLenOrSendError(req, res, maxChunkSize);
45
45
  if (len === undefined) {
46
- body_parsers_1.attachByteDrainToRequest(req);
46
+ (0, body_parsers_1.attachByteDrainToRequest)(req);
47
47
  return;
48
48
  }
49
49
  // extract and check query parameters
@@ -149,7 +149,7 @@ function getContentLenOrSendError(req, res, maxChunkSize) {
149
149
  return;
150
150
  }
151
151
  function replyToMalformed(req, msg, res) {
152
- body_parsers_1.attachByteDrainToRequest(req);
152
+ (0, body_parsers_1.attachByteDrainToRequest)(req);
153
153
  res.status(delivery_1.ERR_SC.malformed).send(msg);
154
154
  }
155
155
  Object.freeze(exports);
@@ -13,7 +13,8 @@
13
13
  See the GNU General Public License for more details.
14
14
 
15
15
  You should have received a copy of the GNU General Public License along with
16
- this program. If not, see <http://www.gnu.org/licenses/>. */
16
+ this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
17
18
  Object.defineProperty(exports, "__esModule", { value: true });
18
19
  exports.restartSession = void 0;
19
20
  const recipients_1 = require("../../resources/recipients");
@@ -64,9 +65,9 @@ function restartSession(sessionGenFunc, sessionForMsgFunc, incompleteMsgFunc, ma
64
65
  maxChunkSize
65
66
  });
66
67
  }
67
- return async function (req, res, next) {
68
+ return async (req, res, next) => {
68
69
  const rb = req.body;
69
- const recipient = canonical_address_1.checkAndTransformAddress(rb.recipient);
70
+ const recipient = (0, canonical_address_1.checkAndTransformAddress)(rb.recipient);
70
71
  const msgId = rb.msgId;
71
72
  const session = req.session;
72
73
  // session is opened, and is even mentioned in a header
@@ -1,8 +1,6 @@
1
1
  import { RequestHandler } from 'express';
2
2
  import { SignedLoad } from '../../../lib-common/jwkeys';
3
- export interface IMidAuthorizer {
4
- (rpDomain: string, sessionId: string, userId: string, mailerIdAssertion: SignedLoad, userCert: SignedLoad, provCert: SignedLoad): Promise<boolean>;
5
- }
3
+ export declare type IMidAuthorizer = (rpDomain: string, sessionId: string, userId: string, mailerIdAssertion: SignedLoad, userCert: SignedLoad, provCert: SignedLoad) => Promise<boolean>;
6
4
  /**
7
5
  * This creates an authorize-sender route handler.
8
6
  * @param relyingPartyDomain at which this service operates, as seen by client
@@ -13,7 +13,8 @@
13
13
  See the GNU General Public License for more details.
14
14
 
15
15
  You should have received a copy of the GNU General Public License along with
16
- this program. If not, see <http://www.gnu.org/licenses/>. */
16
+ this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
17
18
  Object.defineProperty(exports, "__esModule", { value: true });
18
19
  exports.authorize = void 0;
19
20
  const delivery_1 = require("../../../lib-common/service-api/asmail/delivery");
@@ -28,7 +29,7 @@ function authorize(relyingPartyDomain, midAuthorizingFunc) {
28
29
  if ('function' !== typeof midAuthorizingFunc) {
29
30
  throw new TypeError("Given argument 'midAuthorizingFunc' must be function, but is not.");
30
31
  }
31
- return async function (req, res, next) {
32
+ return async (req, res, next) => {
32
33
  if (req.session.isAuthorized) {
33
34
  res.status(delivery_1.ERR_SC.duplicateReq).send("This protocol request has already been served.");
34
35
  return;
@@ -13,7 +13,8 @@
13
13
  See the GNU General Public License for more details.
14
14
 
15
15
  You should have received a copy of the GNU General Public License along with
16
- this program. If not, see <http://www.gnu.org/licenses/>. */
16
+ this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
17
18
  Object.defineProperty(exports, "__esModule", { value: true });
18
19
  exports.startSession = void 0;
19
20
  const recipients_1 = require("../../resources/recipients");
@@ -75,9 +76,9 @@ function startSession(allowedMsgSizeFunc, sessionGenFunc, redirectFunc) {
75
76
  throw new Error(`Unrecognized code ${msgSize} for message size limits.`);
76
77
  }
77
78
  }
78
- return async function (req, res, next) {
79
+ return async (req, res, next) => {
79
80
  const rb = req.body;
80
- const recipient = canonical_address_1.checkAndTransformAddress(rb.recipient);
81
+ const recipient = (0, canonical_address_1.checkAndTransformAddress)(rb.recipient);
81
82
  let sender = rb.sender;
82
83
  const invitation = rb.invitation;
83
84
  const session = req.session;
@@ -97,7 +98,7 @@ function startSession(allowedMsgSizeFunc, sessionGenFunc, redirectFunc) {
97
98
  }
98
99
  // if sender is given, we canonicalize the address
99
100
  if (sender) {
100
- sender = canonical_address_1.checkAndTransformAddress(sender);
101
+ sender = (0, canonical_address_1.checkAndTransformAddress)(sender);
101
102
  if (!sender) {
102
103
  res.status(delivery_1.ERR_SC.malformed).json({
103
104
  error: "Sender field is malformed"
@@ -13,7 +13,8 @@
13
13
  See the GNU General Public License for more details.
14
14
 
15
15
  You should have received a copy of the GNU General Public License along with
16
- this program. If not, see <http://www.gnu.org/licenses/>. */
16
+ this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
17
18
  Object.defineProperty(exports, "__esModule", { value: true });
18
19
  exports.getMsgMeta = void 0;
19
20
  const recipients_1 = require("../../resources/recipients");
@@ -22,7 +23,7 @@ function getMsgMeta(getMsgMetaFunc) {
22
23
  if ('function' !== typeof getMsgMetaFunc) {
23
24
  throw new TypeError("Given argument 'getMsgMetaFunc' must be function, but is not.");
24
25
  }
25
- return async function (req, res, next) {
26
+ return async (req, res, next) => {
26
27
  const userId = req.session.params.userId;
27
28
  const msgId = req.params.msgId;
28
29
  try {
@@ -13,7 +13,8 @@
13
13
  See the GNU General Public License for more details.
14
14
 
15
15
  You should have received a copy of the GNU General Public License along with
16
- this program. If not, see <http://www.gnu.org/licenses/>. */
16
+ this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
17
18
  Object.defineProperty(exports, "__esModule", { value: true });
18
19
  exports.getMsgObj = void 0;
19
20
  const recipients_1 = require("../../resources/recipients");
@@ -44,7 +45,7 @@ function getMsgObj(getMsgObjFunc) {
44
45
  if ('function' !== typeof getMsgObjFunc) {
45
46
  throw new TypeError("Given argument 'getMsgObjFunc' must be function, but is not.");
46
47
  }
47
- return async function (req, res, next) {
48
+ return async (req, res, next) => {
48
49
  const userId = req.session.params.userId;
49
50
  const msgId = req.params.msgId;
50
51
  const objId = req.params.objId;
@@ -67,7 +68,7 @@ function getMsgObj(getMsgObjFunc) {
67
68
  await reader.pipe(res);
68
69
  }
69
70
  catch (err) {
70
- console.error(error_1.errWithCause(err, `Wasn't able to complete sending segments due to error in piping`));
71
+ console.error((0, error_1.errWithCause)(err, `Wasn't able to complete sending segments due to error in piping`));
71
72
  }
72
73
  finally {
73
74
  res.end();
@@ -13,7 +13,8 @@
13
13
  See the GNU General Public License for more details.
14
14
 
15
15
  You should have received a copy of the GNU General Public License along with
16
- this program. If not, see <http://www.gnu.org/licenses/>. */
16
+ this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
17
18
  Object.defineProperty(exports, "__esModule", { value: true });
18
19
  exports.listMsgIds = void 0;
19
20
  const recipients_1 = require("../../resources/recipients");
@@ -22,7 +23,7 @@ function listMsgIds(listMsgIdsFunc) {
22
23
  if ('function' !== typeof listMsgIdsFunc) {
23
24
  throw new TypeError("Given argument 'listMsgIdsFunc' must be function, but is not.");
24
25
  }
25
- return async function (req, res, next) {
26
+ return async (req, res, next) => {
26
27
  const userId = req.session.params.userId;
27
28
  try {
28
29
  const msgIds = await listMsgIdsFunc(userId);
@@ -13,7 +13,8 @@
13
13
  See the GNU General Public License for more details.
14
14
 
15
15
  You should have received a copy of the GNU General Public License along with
16
- this program. If not, see <http://www.gnu.org/licenses/>. */
16
+ this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
17
18
  Object.defineProperty(exports, "__esModule", { value: true });
18
19
  exports.deleteMsg = void 0;
19
20
  const recipients_1 = require("../../resources/recipients");
@@ -22,7 +23,7 @@ function deleteMsg(delMsgFunc) {
22
23
  if ('function' !== typeof delMsgFunc) {
23
24
  throw new TypeError("Given argument 'delMsgFunc' must be function, but is not.");
24
25
  }
25
- return async function (req, res, next) {
26
+ return async (req, res, next) => {
26
27
  const userId = req.session.params.userId;
27
28
  const msgId = req.params.msgId;
28
29
  try {
@@ -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.copyTree = exports.copyFile = exports.streamFromFile = exports.rmDirWithContent = exports.read = exports.streamToExistingFile = exports.append = exports.write = exports.getFolderContentSize = exports.getFileSize = exports.existsFolderSync = exports.createEmptyFile = exports.writeFromBuf = exports.readToBuf = exports.ftruncate = exports.truncate = exports.rename = exports.unlink = exports.rmdir = exports.readdir = exports.fstat = exports.stat = exports.lstat = exports.readlink = exports.symlink = exports.close = exports.open = exports.mkdir = exports.writeFile = exports.readFile = void 0;
19
+ exports.copyTree = exports.copyFile = exports.streamFromFile = exports.rmDirWithContent = exports.read = exports.streamToExistingFile = exports.append = exports.write = exports.getFolderContentSize = exports.getFileSize = exports.existsFolderSync = exports.createEmptyFile = exports.writeFromBuf = exports.readToBuf = exports.ftruncate = exports.truncate = exports.rename = exports.unlink = exports.rmdir = exports.readdir = exports.fstat = exports.stat = exports.lstat = exports.readlink = exports.symlink = exports.close = exports.open = exports.mkdir = exports.writeFile = exports.readFile = exports.Stats = void 0;
20
20
  const fs = require("fs");
21
21
  const fs_1 = require("fs");
22
22
  const file_1 = require("./exceptions/file");
@@ -27,7 +27,7 @@ const path_1 = require("path");
27
27
  var fs_2 = require("fs");
28
28
  Object.defineProperty(exports, "Stats", { enumerable: true, get: function () { return fs_2.Stats; } });
29
29
  function makeFileExceptionFromNodes(nodeExc) {
30
- return file_1.makeFileException(nodeExc.code, nodeExc.path);
30
+ return (0, file_1.makeFileException)(nodeExc.code, nodeExc.path);
31
31
  }
32
32
  function readFile(path, options) {
33
33
  return new Promise((resolve, reject) => {
@@ -292,7 +292,7 @@ async function readToBuf(fd, pos, buf) {
292
292
  while (bytesRead < buf.length) {
293
293
  const bNum = await readOrig(fd, buf, bytesRead, buf.length - bytesRead, pos);
294
294
  if (bNum === 0) {
295
- throw file_1.makeFileException(file_1.Code.endOfFile, '<file descriptor>');
295
+ throw (0, file_1.makeFileException)(file_1.Code.endOfFile, '<file descriptor>');
296
296
  }
297
297
  bytesRead += bNum;
298
298
  pos += bNum;
@@ -358,11 +358,11 @@ exports.createEmptyFile = createEmptyFile;
358
358
  */
359
359
  function existsFolderSync(path) {
360
360
  try {
361
- if (fs_1.statSync(path).isDirectory()) {
361
+ if ((0, fs_1.statSync)(path).isDirectory()) {
362
362
  return true;
363
363
  }
364
364
  else {
365
- throw file_1.makeFileException(file_1.Code.notDirectory, path);
365
+ throw (0, file_1.makeFileException)(file_1.Code.notDirectory, path);
366
366
  }
367
367
  }
368
368
  catch (e) {
@@ -473,7 +473,7 @@ async function streamToExistingFile(filePath, pos, len, src, bufSize) {
473
473
  let bytesWritten = 0;
474
474
  let bytesRead = 0;
475
475
  const buf = new common_1.BytesFIFOBuffer();
476
- let deferred = processes_1.defer();
476
+ let deferred = (0, processes_1.defer)();
477
477
  let doneReading = false;
478
478
  const complete = (err) => {
479
479
  if (!deferred) {
@@ -510,7 +510,7 @@ async function streamToExistingFile(filePath, pos, len, src, bufSize) {
510
510
  if (!bytesToWrite) {
511
511
  return;
512
512
  }
513
- await writeToExistingFile(filePath, pos, buffer_utils_1.toBuffer(bytesToWrite));
513
+ await writeToExistingFile(filePath, pos, (0, buffer_utils_1.toBuffer)(bytesToWrite));
514
514
  pos += bytesToWrite.length;
515
515
  bytesWritten += bytesToWrite.length;
516
516
  if (bytesWritten < len) {
@@ -527,7 +527,7 @@ async function streamToExistingFile(filePath, pos, len, src, bufSize) {
527
527
  if (doneReading) {
528
528
  return;
529
529
  }
530
- complete(file_1.makeFileException(file_1.Code.endOfFile, '<input stream>'));
530
+ complete((0, file_1.makeFileException)(file_1.Code.endOfFile, '<input stream>'));
531
531
  });
532
532
  src.on('error', (err) => {
533
533
  complete(err);
@@ -555,7 +555,7 @@ async function read(fd, pos, buf) {
555
555
  while (bytesRead < buf.length) {
556
556
  const bNum = await readOrig(fd, buf, bytesRead, buf.length - bytesRead, pos);
557
557
  if (bNum === 0) {
558
- throw file_1.makeFileException(file_1.Code.endOfFile, '<file descriptor>');
558
+ throw (0, file_1.makeFileException)(file_1.Code.endOfFile, '<file descriptor>');
559
559
  }
560
560
  bytesRead += bNum;
561
561
  pos += bNum;
@@ -670,8 +670,8 @@ exports.streamFromFile = streamFromFile;
670
670
  */
671
671
  function copyFile(src, dst, overwrite = false, dstMode = '660') {
672
672
  return new Promise((resolve, reject) => {
673
- const srcStream = fs_1.createReadStream(src);
674
- const dstStream = fs_1.createWriteStream(dst, {
673
+ const srcStream = (0, fs_1.createReadStream)(src);
674
+ const dstStream = (0, fs_1.createWriteStream)(dst, {
675
675
  mode: parseInt(dstMode, 8),
676
676
  flags: (overwrite ? 'w' : 'wx')
677
677
  });
@@ -713,8 +713,8 @@ async function copyTree(src, dst, fileOverwrite = false) {
713
713
  const srcFNames = await readdir(src);
714
714
  const cpTasks = [];
715
715
  for (const fName of srcFNames) {
716
- const srcPath = path_1.join(src, fName);
717
- const dstPath = path_1.join(dst, fName);
716
+ const srcPath = (0, path_1.join)(src, fName);
717
+ const dstPath = (0, path_1.join)(dst, fName);
718
718
  const task = stat(srcPath)
719
719
  .then((stats) => {
720
720
  if (stats.isFile()) {
@@ -19,12 +19,12 @@ exports.sourceFromArray = exports.BytesFIFOBuffer = exports.wrapByteSinkImplemen
19
19
  const binding_1 = require("../binding");
20
20
  function wrapByteSourceImplementation(src) {
21
21
  const wrap = {
22
- read: binding_1.bind(src, src.read),
23
- getSize: binding_1.bind(src, src.getSize)
22
+ read: (0, binding_1.bind)(src, src.read),
23
+ getSize: (0, binding_1.bind)(src, src.getSize)
24
24
  };
25
25
  if (src.seek) {
26
- wrap.seek = binding_1.bind(src, src.seek);
27
- wrap.getPosition = binding_1.bind(src, src.getPosition);
26
+ wrap.seek = (0, binding_1.bind)(src, src.seek);
27
+ wrap.getPosition = (0, binding_1.bind)(src, src.getPosition);
28
28
  }
29
29
  wrap.$_transferrable_type_id_$ = 'ByteSource';
30
30
  return wrap;
@@ -32,13 +32,13 @@ function wrapByteSourceImplementation(src) {
32
32
  exports.wrapByteSourceImplementation = wrapByteSourceImplementation;
33
33
  function wrapByteSinkImplementation(sink) {
34
34
  const wrap = {
35
- setSize: binding_1.bind(sink, sink.setSize),
36
- write: binding_1.bind(sink, sink.write),
37
- getSize: binding_1.bind(sink, sink.getSize)
35
+ setSize: (0, binding_1.bind)(sink, sink.setSize),
36
+ write: (0, binding_1.bind)(sink, sink.write),
37
+ getSize: (0, binding_1.bind)(sink, sink.getSize)
38
38
  };
39
39
  if (sink.seek) {
40
- wrap.seek = binding_1.bind(sink, sink.seek);
41
- wrap.getPosition = binding_1.bind(sink, sink.getPosition);
40
+ wrap.seek = (0, binding_1.bind)(sink, sink.seek);
41
+ wrap.getPosition = (0, binding_1.bind)(sink, sink.getPosition);
42
42
  }
43
43
  wrap.$_transferrable_type_id_$ = 'ByteSink';
44
44
  return wrap;
@@ -50,7 +50,7 @@ function checkDomainString(d, addrForErrMsg) {
50
50
  }
51
51
  let ascii;
52
52
  try {
53
- ascii = punycode_1.toASCII(d);
53
+ ascii = (0, punycode_1.toASCII)(d);
54
54
  }
55
55
  catch (err) {
56
56
  throw makeParseExc(addrForErrMsg, err);
@@ -159,8 +159,8 @@ class RequestingSide extends MessageHandler {
159
159
  wrap() {
160
160
  const w = {
161
161
  makeRequest: this.makeRequest.bind(this),
162
- close: binding_1.bind(this, this.close),
163
- on: binding_1.bind(this, this.on)
162
+ close: (0, binding_1.bind)(this, this.close),
163
+ on: (0, binding_1.bind)(this, this.on)
164
164
  };
165
165
  return Object.freeze(w);
166
166
  }
@@ -261,10 +261,10 @@ class ReplyingSide extends MessageHandler {
261
261
  }
262
262
  wrap() {
263
263
  const w = {
264
- addHandler: binding_1.bind(this, this.addHandler),
265
- notifyOfProgressOnRequest: binding_1.bind(this, this.notifyOfProgressOnRequest),
266
- close: binding_1.bind(this, this.close),
267
- on: binding_1.bind(this, this.on)
264
+ addHandler: (0, binding_1.bind)(this, this.addHandler),
265
+ notifyOfProgressOnRequest: (0, binding_1.bind)(this, this.notifyOfProgressOnRequest),
266
+ close: (0, binding_1.bind)(this, this.close),
267
+ on: (0, binding_1.bind)(this, this.on)
268
268
  };
269
269
  return Object.freeze(w);
270
270
  }
@@ -287,8 +287,8 @@ class EventsSendingSide extends ReplyingSide {
287
287
  super(channel, comm);
288
288
  this.subscriptionGroups = [];
289
289
  this.subscribedEvents = new Set();
290
- this.addHandler(ipc_api_1.events.subscribe.REQ_NAME, binding_1.bind(this, this.handleSubscribe));
291
- this.addHandler(ipc_api_1.events.unsubscribe.REQ_NAME, binding_1.bind(this, this.handleUnsubscribe));
290
+ this.addHandler(ipc_api_1.events.subscribe.REQ_NAME, (0, binding_1.bind)(this, this.handleSubscribe));
291
+ this.addHandler(ipc_api_1.events.unsubscribe.REQ_NAME, (0, binding_1.bind)(this, this.handleUnsubscribe));
292
292
  }
293
293
  findGroup(eventChannel) {
294
294
  for (const gr of this.subscriptionGroups) {
@@ -373,9 +373,9 @@ class EventsSendingSide extends ReplyingSide {
373
373
  notifyOfProgressOnRequest: reqServer.notifyOfProgressOnRequest,
374
374
  close: reqServer.close,
375
375
  on: reqServer.on,
376
- addEventGroup: binding_1.bind(this, this.addEventGroup),
377
- sendEvent: binding_1.bind(this, this.sendEvent),
378
- endEvent: binding_1.bind(this, this.endEvent)
376
+ addEventGroup: (0, binding_1.bind)(this, this.addEventGroup),
377
+ sendEvent: (0, binding_1.bind)(this, this.sendEvent),
378
+ endEvent: (0, binding_1.bind)(this, this.endEvent)
379
379
  };
380
380
  return Object.freeze(w);
381
381
  }
@@ -536,7 +536,7 @@ class EventsReceivingSide extends RequestingSide {
536
536
  makeRequest: reqClient.makeRequest,
537
537
  close: reqClient.close,
538
538
  on: reqClient.on,
539
- subscribe: binding_1.bind(this, this.subscribe)
539
+ subscribe: (0, binding_1.bind)(this, this.subscribe)
540
540
  };
541
541
  return Object.freeze(w);
542
542
  }
@@ -15,7 +15,7 @@
15
15
  You should have received a copy of the GNU General Public License along with
16
16
  this program. If not, see <http://www.gnu.org/licenses/>. */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.makeSubscriber = exports.makeJsonCommPoint = void 0;
18
+ exports.makeSubscriber = exports.makeJsonCommPoint = exports.makeEventfulServer = void 0;
19
19
  const generic_ipc_1 = require("./generic-ipc");
20
20
  var generic_ipc_2 = require("./generic-ipc");
21
21
  Object.defineProperty(exports, "makeEventfulServer", { enumerable: true, get: function () { return generic_ipc_2.makeEventfulServer; } });
@@ -93,7 +93,7 @@ function onError(ws, observers) {
93
93
  }
94
94
  function makeSubscriber(ws, ipcChannel) {
95
95
  const comm = makeJsonCommPoint(ws);
96
- return generic_ipc_1.makeSubscribingClient(ipcChannel, comm);
96
+ return (0, generic_ipc_1.makeSubscribingClient)(ipcChannel, comm);
97
97
  }
98
98
  exports.makeSubscriber = makeSubscriber;
99
99
  Object.freeze(exports);