@resolveio/server-lib 1.0.12 → 1.0.14

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.
@@ -4,6 +4,6 @@ import { UserModel } from '../models/user.model';
4
4
  interface ResolveIOModel extends UserModel, PassportLocalDocument {
5
5
  }
6
6
  export declare const Users: PassportLocalModel<ResolveIOModel>;
7
- export declare const ClientUsers: PassportLocalModel<ResolveIOModel>;
7
+ export declare let ClientUsers: PassportLocalModel<ResolveIOModel>;
8
8
  export declare const UserVersions: Model<ResolveIOModel>;
9
9
  export {};
@@ -136,7 +136,10 @@ DefaultSchema.plugin(passportLocalMongoose, {
136
136
  }
137
137
  });
138
138
  exports.Users = index_1.ResolveIOServer.getMainDB().model('users', DefaultSchema);
139
- exports.ClientUsers = index_1.ResolveIOServer.getSupportDB().model('users', DefaultSchema);
139
+ exports.ClientUsers = null;
140
+ if (index_1.ResolveIOServer.getSupportDB()) {
141
+ exports.ClientUsers = index_1.ResolveIOServer.getSupportDB().model('users', DefaultSchema);
142
+ }
140
143
  exports.Users['simplschema'] = new simpl_schema_1.default(schema);
141
144
  schema._id = {
142
145
  type: mongoose_1.Schema.Types.Mixed
@@ -50,6 +50,7 @@ var method_calls_1 = require("../publications/method-calls");
50
50
  var method_responses_1 = require("../publications/method-responses");
51
51
  var support_tickets_1 = require("../publications/support-tickets");
52
52
  var index_1 = require("../index");
53
+ var notifications_1 = require("../publications/notifications");
53
54
  var SubscriptionManager = /** @class */ (function () {
54
55
  function SubscriptionManager(mainServer, wss, serverConfig) {
55
56
  var _this = this;
@@ -71,6 +72,7 @@ var SubscriptionManager = /** @class */ (function () {
71
72
  method_calls_1.loadMethodCallsPublications(this);
72
73
  method_responses_1.loadMethodResponsePublications(this);
73
74
  support_tickets_1.loadSupportTicketPublications(this);
75
+ notifications_1.loadNotificationPublications(this);
74
76
  this.tailOpLog();
75
77
  if (index_1.ResolveIOServer.getSupportDB()) {
76
78
  this.tailOpLogSupport();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resolveio/server-lib",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "",
5
5
  "main": "index.ts",
6
6
  "scripts": {
@@ -0,0 +1,2 @@
1
+ import { SubscriptionManager } from '../managers/subscription.manager';
2
+ export declare function loadNotificationPublications(subscriptionManager: SubscriptionManager): void;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var notification_collection_1 = require("../collections/notification.collection");
4
+ function loadNotificationPublications(subscriptionManager) {
5
+ subscriptionManager.publications({
6
+ notifications: {
7
+ function: function () {
8
+ return notification_collection_1.Notifications.find({}).sort({ name: 1 }).exec();
9
+ },
10
+ collections: ['notifications']
11
+ }
12
+ });
13
+ }
14
+ exports.loadNotificationPublications = loadNotificationPublications;
@@ -48,7 +48,12 @@ function loadSupportCronJobMethods(methodManager) {
48
48
  var _this = this;
49
49
  return __generator(this, function (_a) {
50
50
  switch (_a.label) {
51
- case 0: return [4 /*yield*/, user_collection_1.Users.find({})];
51
+ case 0:
52
+ if (!user_collection_1.ClientUsers) {
53
+ resolve();
54
+ return [2 /*return*/];
55
+ }
56
+ return [4 /*yield*/, user_collection_1.Users.find({})];
52
57
  case 1:
53
58
  users = _a.sent();
54
59
  count = 0;