@resolveio/server-lib 1.0.0-rc21 → 1.0.0-rc23

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.
package/index.js CHANGED
@@ -59,9 +59,7 @@ var ResolveIOServer = /** @class */ (function () {
59
59
  case 1:
60
60
  serverApp = (_a.sent()).default;
61
61
  ResolveIOServer._mainServer = new serverApp(this, ResolveIOServer._serverConfig);
62
- setTimeout(function () {
63
- resolve();
64
- }, 5000);
62
+ resolve();
65
63
  return [2 /*return*/];
66
64
  }
67
65
  });
@@ -88,9 +86,7 @@ var ResolveIOServer = /** @class */ (function () {
88
86
  case 1:
89
87
  serverApp = (_a.sent()).default;
90
88
  ResolveIOServer._mainServer = new serverApp(this, ResolveIOServer._serverConfig);
91
- setTimeout(function () {
92
- resolve();
93
- }, 5000);
89
+ resolve();
94
90
  return [2 /*return*/];
95
91
  }
96
92
  });
@@ -262,7 +262,7 @@ var MethodManager = /** @class */ (function () {
262
262
  }
263
263
  }
264
264
  }
265
- (_a = that._methods[method].function).call.apply(_a, [Object.assign({}, that, { id_user: '', user: '', id_ws: '' })].concat(methodData));
265
+ (_a = that._methods[method].function).call.apply(_a, [Object.assign({}, that, MethodManager.prototype, { id_user: '', user: '', id_ws: '' })].concat(methodData));
266
266
  };
267
267
  MethodManager.prototype.callMethodQueue = function (update) {
268
268
  // console.log('Call Method Queue', update);
@@ -330,7 +330,7 @@ var MethodManager = /** @class */ (function () {
330
330
  }
331
331
  }
332
332
  // console.log('Run Method', update.method);
333
- (_a = that._methods[update.method].function).call.apply(_a, [Object.assign({}, that, { id_user: update.id_user, user: update.user, id_ws: update.id_ws })].concat(update.method_data)).then(function (res) {
333
+ (_a = that._methods[update.method].function).call.apply(_a, [Object.assign({}, that, MethodManager.prototype, { id_user: update.id_user, user: update.user, id_ws: update.id_ws })].concat(update.method_data)).then(function (res) {
334
334
  var serverRes = {
335
335
  messageId: update.messageId,
336
336
  hasError: false,
@@ -414,7 +414,7 @@ var MethodManager = /** @class */ (function () {
414
414
  }
415
415
  }
416
416
  }
417
- (_a = that._methods[method].function).call.apply(_a, [Object.assign({}, that, { id_user: ws['id_user'], user: ws['user'], id_ws: ws['id_socket'] })].concat(methodData)).then(function (res) {
417
+ (_a = that._methods[method].function).call.apply(_a, [Object.assign({}, that, MethodManager.prototype, { id_user: ws['id_user'], user: ws['user'], id_ws: ws['id_socket'] })].concat(methodData)).then(function (res) {
418
418
  var serverRes = {
419
419
  messageId: messageId,
420
420
  hasError: false,
@@ -452,7 +452,7 @@ var MethodManager = /** @class */ (function () {
452
452
  return;
453
453
  }
454
454
  }
455
- var promise = (_a = that._methods[method].function).call.apply(_a, [that].concat(methodData));
455
+ var promise = (_a = that._methods[method].function).call.apply(_a, [Object.assign({}, that, MethodManager.prototype)].concat(methodData));
456
456
  if (methodData[methodData.length - 1] && typeof (methodData[methodData.length - 1]) === 'function') {
457
457
  promise.then(function (res) { return methodData[methodData.length - 1](null, res); }, function (err) { return methodData[methodData.length - 1](err, null); });
458
458
  }
@@ -614,7 +614,7 @@ var SubscriptionManager = /** @class */ (function () {
614
614
  return __generator(this, function (_c) {
615
615
  that = this;
616
616
  if (!that._publications[subscription.publication].ws_specific) { // Same pub for all users
617
- (_a = that._publications[subscription.publication].function).call.apply(_a, [that].concat(subscription.subscriptionData)).then(function (res) {
617
+ (_a = that._publications[subscription.publication].function).call.apply(_a, [Object.assign({}, that, SubscriptionManager.prototype)].concat(subscription.subscriptionData)).then(function (res) {
618
618
  var serverRes = {
619
619
  messageId: messageId,
620
620
  hasError: false,
@@ -631,7 +631,7 @@ var SubscriptionManager = /** @class */ (function () {
631
631
  });
632
632
  }
633
633
  else { // Pub is different for each user (Look at users publication) [MUCH SLOWER, RE-RUNS FOR EACH USER]
634
- (_b = that._publications[subscription.publication].function).call.apply(_b, [that, ws['id_user']].concat(subscription.subscriptionData)).then(function (res) {
634
+ (_b = that._publications[subscription.publication].function).call.apply(_b, [Object.assign({}, that, SubscriptionManager.prototype), ws['id_user']].concat(subscription.subscriptionData)).then(function (res) {
635
635
  var serverRes = {
636
636
  messageId: messageId,
637
637
  hasError: false,
@@ -658,7 +658,7 @@ var SubscriptionManager = /** @class */ (function () {
658
658
  var _this = this;
659
659
  return __generator(this, function (_b) {
660
660
  that = this;
661
- (_a = that._publications[subscription.publication].function).call.apply(_a, [that].concat(subscription.subscriptionData)).then(function (res) {
661
+ (_a = that._publications[subscription.publication].function).call.apply(_a, [Object.assign({}, that, SubscriptionManager.prototype)].concat(subscription.subscriptionData)).then(function (res) {
662
662
  subscription.clients.forEach(function (client) {
663
663
  that._wss.clients.forEach(function (ws) {
664
664
  if (ws['id_socket'] === client.id_socket) {
@@ -164,7 +164,7 @@ var SupportManager = /** @class */ (function () {
164
164
  }
165
165
  }
166
166
  }
167
- (_a = that._supportMethods[supportMethod].function).call.apply(_a, [Object.assign({}, that, { id_user: ws['id_user'], user: ws['user'], id_ws: ws['id_socket'] })].concat(methodData)).then(function (res) {
167
+ (_a = that._supportMethods[supportMethod].function).call.apply(_a, [Object.assign({}, that, SupportManager.prototype, { id_user: ws['id_user'], user: ws['user'], id_ws: ws['id_socket'] })].concat(methodData)).then(function (res) {
168
168
  var serverRes = {
169
169
  messageId: messageId,
170
170
  hasError: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resolveio/server-lib",
3
- "version": "1.0.0-rc21",
3
+ "version": "1.0.0-rc23",
4
4
  "description": "",
5
5
  "main": "index.ts",
6
6
  "scripts": {