-
Update Available
-
+
+ -
+
+
+
{{#each updates}}
@@ -33,8 +34,9 @@
{{/each}}
-
-
+
+
+
{{/if}}
{{/if}}
diff --git a/client/Dashboard/dashboard.js b/client/Dashboard/dashboard.js
index 68e0d7f..4eb2c8c 100644
--- a/client/Dashboard/dashboard.js
+++ b/client/Dashboard/dashboard.js
@@ -7,6 +7,8 @@ import moment from 'moment';
import { TaskItems } from "../../imports/api/tasks";
import { UpdateInfo } from '../../imports/api/updateInfo.js';
import { SysConfig } from '../../imports/api/systemConfig.js';
+import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
+import { M } from '../lib/assets/materialize.js';
Template.dashboard.onCreated(function() {
this.subscribe("userList");
@@ -23,7 +25,10 @@ Template.dashboard.onCreated(function() {
});
Template.dashboard.onRendered(function() {
-
+ setTimeout(function() {
+ var elems = document.querySelectorAll('.collapsible');
+ var instances = M.Collapsible.init(elems, {});
+ }, 200);
});
Template.dashboard.helpers({
@@ -61,18 +66,47 @@ Template.dashboard.helpers({
},
updates: function() {
let updateAvail = UpdateInfo.find({});
- return updateAvail;
- },
- updatesExist: function() {
- let updateExists = UpdateInfo.find({ viewed: false }).fetch();
- if (updateExists.length > 0) {
- return true;
- } else {
- return false;
+ try {
+ if (!updateAvail) {
+ console.log("No update info found.");
+ return false;
+ } else {
+ console.dir(updateAvail);
+ return updateAvail;
+ }
+ } catch(error) {
+ console.log(" ERROR trying to grab update info: " + error);
}
},
+ updatesExist: function() {
+ const ifUpdate = async() => {
+ let updateExists = await UpdateInfo.findOneAsync({ viewed: false });
+ if (!updateExists) {
+ console.log("Update doesn't exist as false.");
+ return false;
+ } else {
+ console.log("Update found with false.");
+ return true;
+ }
+ }
+ let updateAvail = ifUpdate();
+ return updateAvail;
+ },
currConfig: function() {
- return SysConfig.findOne({});
+ const getSys = async() => {
+ let currSys = SysConfig.findOneAsync({});
+ try {
+ if (!currSys) {
+ // console.log("No System Config found.")
+ } else {
+ return currSys;
+ }
+ } catch(error) {
+ console.log(" ERROR trying to fetch current system config: " + error);
+ }
+ }
+ let currConf = getSys();
+ return currConf;
},
descriptionSinHTML: function() {
let desc = this.description;
@@ -141,12 +175,19 @@ Template.dashboard.events({
'click .readLink' (event) {
let eventId = event.currentTarget.id;
- Meteor.call('markUpdate.read', eventId, function(err, result) {
- if (err) {
- console.log(" ERROR marking update as 'read': " + err);
- } else {
- console.log("marked read successfully!");
+ const markUpdate = async() => {
+ let result = await Meteor.callAsync('markUpdate.read', eventId);
+ try {
+ if (!result) {
+ console.log(" Error marking this read.");
+ showSnackbar("Error Marking Read!", "red");
+ } else {
+ showSnackbar("Successfully Marked as Read.", "green");
+ }
+ } catch(error) {
+ console.log(" ERROR trying to mark this update as read: " + error);
}
- });
+ }
+ markUpdate();
}
});
diff --git a/client/General/DeleteConfModal/deleteConfirmationModal.js b/client/General/DeleteConfModal/deleteConfirmationModal.js
index dde7bfb..f153ae7 100644
--- a/client/General/DeleteConfModal/deleteConfirmationModal.js
+++ b/client/General/DeleteConfModal/deleteConfirmationModal.js
@@ -22,14 +22,16 @@ Template.deleteConfirmationModal.events({
let deleteId = Session.get("deleteId");
let method = Session.get("method");
- Meteor.call(method, deleteId, function(err, result) {
- if (err) {
+ const delItem = async() => {
+ let result = await Meteor.callAsync(method, deleteId);
+ if (!result) {
console.log(" ERROR deleting item from modal: " + err);
} else {
console.log(" SUCCESSFULLY deleted.");
// put the new modal open / close here
// $('#modalDelete').modal('close');
}
- });
+ }
+ delItem();
},
});
\ No newline at end of file
diff --git a/client/General/headerBar.html b/client/General/headerBar.html
index 9ba8e1b..f3cd1fa 100644
--- a/client/General/headerBar.html
+++ b/client/General/headerBar.html
@@ -12,7 +12,7 @@
My Tasks
My Settings
- {{#if isInRole 'systemadmin'}}
+ {{#if isInRole "systemadmin"}}
Manage
{{/if}}
Log Out
diff --git a/client/General/headerBar.js b/client/General/headerBar.js
index 9de0b62..3a3af52 100644
--- a/client/General/headerBar.js
+++ b/client/General/headerBar.js
@@ -1,15 +1,38 @@
+import { Meteor } from 'meteor/meteor';
import { M } from '../lib/assets/materialize';
import { UpdateInfo } from '../../imports/api/updateInfo.js';
+import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
+import { Roles } from 'meteor/roles';
Template.headerBar.onCreated(function() {
this.subscribe("UpdateVersion");
+ this.subscribe("assignment");
});
Template.headerBar.onRendered(function() {
var elems = document.querySelectorAll('.sidenav');
var instances = M.Sidenav.init(elems, {});
var elemd = document.querySelectorAll('.dropdown-trigger');
- var instances = M.Dropdown.init(elemd, {});
+ var instances = M.Dropdown.init(elemd, {});
+
+ setTimeout(function() {
+ const getRoles = async() => {
+ let userId = Meteor.userId();
+ // let isRole = await Roles.userIsInRoleAsync(userId, "systemadmin");
+ let isRole = await Roles.getRolesForUserAsync(userId);
+ try {
+ if (!isRole) {
+ console.log("SystemAdmin role for user not found: " + isRole);;
+ } else {
+ console.log("Found role for the user: ");
+ console.dir(isRole);
+ }
+ } catch(error) {
+ console.log(" ERROR getting role for user: " + error);
+ }
+ }
+ getRoles();
+ }, 1000);
});
Template.headerBar.helpers({
diff --git a/client/ListItems/listItemsForm.js b/client/ListItems/listItemsForm.js
index ff1b481..2f73857 100644
--- a/client/ListItems/listItemsForm.js
+++ b/client/ListItems/listItemsForm.js
@@ -48,6 +48,7 @@ Template.listItemsForm.helpers({
}
},
itemProdName: function() {
+
return Products.find({});
},
editMode: function() {
@@ -66,14 +67,7 @@ Template.listItemsForm.events({
if (item == null || item == "") {
Session.set("itemReqErr", true);
} else {
- Meteor.call("add.listItem", item, listId, function(err, result) {
- if (err) {
- console.log(" ERROR adding item to list: " + err);
- } else {
- console.log(" SUCCESS adding item to list.");
- $("#findListItems").val("");
- }
- });
+ addItem(item, listId);
}
},
'keydown #findListItems' (event) {
@@ -83,14 +77,7 @@ Template.listItemsForm.events({
if (item == null || item == "") {
Session.set("itemReqErr", true);
} else {
- Meteor.call("add.listItem", item, listId, function(err, result) {
- if (err) {
- console.log(" ERROR adding item to list: " + err);
- } else {
- console.log(" SUCCESS adding item to list.");
- $("#findListItems").val("");
- }
- });
+ addItem(item, listId);
}
}
},
@@ -110,8 +97,11 @@ Template.listItemsForm.events({
'keyup #findListItems' (event) {
if (event.which !== 13) {
let findItemVal = $("#findListItems").val();
+ // console.log(findItemVal);
let listItemInfo = Products.find({ prodName: {$regex: findItemVal + '.*', $options: 'i'}}).fetch();
- if (typeof listItemInfo != 'undefined' && listItemInfo != "" && listItemInfo != null) {
+ if (!listItemInfo) {
+ console.log("No data for key input.");
+ } else {
getDataList(listItemInfo);
}
}
@@ -128,7 +118,21 @@ Template.listItemsForm.events({
});
getDataList = function(listItemInfo) {
+ // console.log(listItemInfo);
let listItemObjArray = [];
listItemObjArray = listItemInfo.map(info => ({ id: info._id, text: info.prodName, store: info.prodStore }))
Session.set("findListItems", listItemObjArray);
}
+
+const addItem = async(item, listId) => {
+ let result = await Meteor.callAsync("add.listItem", item, listId);
+ try {
+ if (!result) {
+ console.log(" ISSUE adding list item. See logs.");
+ } else {
+ $("#findListItems").val("");
+ }
+ } catch(error) {
+ console.log(" ERROR adding list item: " + error);
+ }
+}
diff --git a/client/ListItems/listItemsTbl.js b/client/ListItems/listItemsTbl.js
index e17a006..497b4f9 100644
--- a/client/ListItems/listItemsTbl.js
+++ b/client/ListItems/listItemsTbl.js
@@ -22,13 +22,13 @@ Template.listItemsTbl.helpers({
let showRecvd = Session.get("showReceivedItems");
let searchVal = Session.get("searchVal");
if (showRecvd == false) {
- if (typeof searchVal == 'undefined' || searchVal.length === 0) {
+ if (!searchVal) {
return ListItems.find({ itemReceived: false });
} else {
return ListItems.find({ itemReceived: false, itemName: { $regex: searchVal + '.*', $options: 'i' } });
}
} else {
- if (typeof searchVal == 'undefined' || searchVal.length == 0) {
+ if (!searchVal) {
return ListItems.find({});
} else {
return ListItems.find({ itemName: { $regex: searchVal + '.*', $options: 'i' } });
diff --git a/client/Lists/listsTbl.js b/client/Lists/listsTbl.js
index 1d7a8f0..a905e78 100644
--- a/client/Lists/listsTbl.js
+++ b/client/Lists/listsTbl.js
@@ -1,5 +1,6 @@
import { Lists } from '../../imports/api/lists.js';
import { M } from '../lib/assets/materialize.js';
+import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
Template.listsTbl.onCreated(function() {
this.subscribe("myLists");
@@ -25,17 +26,19 @@ Template.listsTbl.events({
if (listId == "addList") {
// opens the modal and allows you to add a new List
} else {
- // console.log("listId is: " + listId);
+ console.log("listId is: " + listId);
Session.set("listId", listId);
- Meteor.call('add.userLast', "List", listId, function(err, result) {
- if (err) {
+ const addUserLast = async() => {
+ let result = await Meteor.callAsync('add.userLast', "List", listId);
+ if (!result) {
console.log(" ERROR setting user last list id in db: " + err);
} else {
- Meteor.setTimeout(function() {
+ setTimeout(function() {
FlowRouter.go('/listitems');
}, 100);
}
- });
+ }
+ addUserLast();
}
}
},
@@ -47,15 +50,17 @@ Template.listsTbl.events({
let splitList = listFullId.split("_");
let listId = splitList[1];
// console.log("listId is " + listId);
- Meteor.call("mark.complete", listId, function(err, result){
- if (err) {
- console.log(" ERROR marking list complete! " + err);
+ const markComp = async() => {
+ let result = await Meteor.callAsync("mark.complete", listId);
+ if (!result) {
+ console.log(" ERROR marking list complete!");
showSnackbar("ERROR! List Not Makred Complete!", "red");
} else {
// console.log(" SUCCESS marking list complete.");
showSnackbar("List Marked Complete!", "green");
}
- });
+ }
+ markComp();
}
}
});
\ No newline at end of file
diff --git a/client/MainLayout.js b/client/MainLayout.js
index 2a37018..ebcea0b 100644
--- a/client/MainLayout.js
+++ b/client/MainLayout.js
@@ -7,20 +7,27 @@ Template.MainLayout.onCreated(function() {
Template.MainLayout.onRendered(function() {
this.autorun(() => {
let myId = Meteor.userId();
- let myprefs = UserConfig.findOne({ user: myId });
- if (typeof myprefs != 'undefined') {
- if (myprefs.darkMode == "light") {
- console.log("Found theme as light");
- Session.set("myTheme", "light");
- document.documentElement.setAttribute('theme', "light");
- } else {
- console.log("Found theme as dark");
- Session.set("myTheme", "dark");
- document.documentElement.setAttribute('theme', "dark");
- }
- } else {
- console.log("User Prefs appear undefined.");
+ const getConfig = async() => {
+ let myprefs = await UserConfig.findOneAsync({ user: myId });
+ try {
+ if (!myprefs) {
+ console.log("User Prefs appear undefined.");
+ } else {
+ if (myprefs.darkMode == "light") {
+ console.log("Found theme as light");
+ Session.set("myTheme", "light");
+ document.documentElement.setAttribute('theme', "light");
+ } else {
+ console.log("Found theme as dark");
+ Session.set("myTheme", "dark");
+ document.documentElement.setAttribute('theme', "dark");
+ }
+ }
+ } catch(error) {
+ console.log(" ERROR getting user preferences: " + error);
+ }
}
+ getConfig();
});
});
diff --git a/client/MenuItems/addProdToListModal.js b/client/MenuItems/addProdToListModal.js
index 7204281..79543e5 100644
--- a/client/MenuItems/addProdToListModal.js
+++ b/client/MenuItems/addProdToListModal.js
@@ -53,12 +53,14 @@ Template.addProdToListModal.events({
event.preventDefault();
let selectedItems = Session.get("itemsSelected");
let listId = $("#chooseList").val();
- Meteor.call('add.itemsFromMenuItem', selectedItems, listId, function(err, result) {
- if (err) {
+ const addItemsFromMenu = async() => {
+ let result = await Meteor.callAsync('add.itemsFromMenuItem', selectedItems, listId);
+ if (!result) {
console.log(" ERROR adding menu components to list: " + err);
} else {
showSnackbar("Items Added to List!", "green");
}
- });
+ }
+ addItemsFromMenu();
}
});
diff --git a/client/MenuItems/menuItemsForm.js b/client/MenuItems/menuItemsForm.js
index 9419402..d5c102c 100644
--- a/client/MenuItems/menuItemsForm.js
+++ b/client/MenuItems/menuItemsForm.js
@@ -38,13 +38,27 @@ Template.menuItemsForm.helpers({
if (Session.get("menuId")) {
menuId = Session.get("menuId");
} else {
- menuId = UserLast.findOne({ view: "Menu" }).viewId;
+ const menuInfor = async() => {
+ let result = await UserLast.findOneAsync({ view: "Menu" }).viewId;
+ if (!result) {
+
+ } else {
+ return result;
+ }
+ }
+ let menuId = menuInfor();
}
- let menuInfo = Menus.findOne({ _id: menuId });
- if (menuInfo) {
- return menuInfo.menuName;
+ const menuData = async() => {
+ let menuInfo = await Menus.findOneAsync({ _id: menuId });
+ if (!menuInfo) {
+ return;
+ } else {
+ return menuInfo.menuName;
+ }
}
+ let menuInformation = menuData();
+ return menuInformation;
}
});
@@ -55,10 +69,54 @@ Template.menuItemsForm.events({
let dateSrv = $("#dateServed").val();
let menuId = Session.get("menuId");
+ const mie = async() => {
+ let menuItemExists = await MenuItems.findOneAsync({ itemName: menuItem });
+ if (!menuItemExists) {
+ // call to add it
+ notExists();
+ } else {
+ // call to add it to the menu only
+ itExists(menuItemExists);
+ }
+ }
+ mie();
- let menuItemExists = MenuItems.findOne({ itemName: menuItem });
+ const notExists = async() => {
+ // add the item as new and add to the menu
+ if (menuItem == null || menuItem == "") {
+ Session.set("menuItemErr", true);
+ } else {
+ const addMenuItem = async() => {
+ let result = await Meteor.callAsync('add.menuItem', menuItem);
+ if (!result) {
+ console.log(" ERROR adding menu item: " + err);
+ } else {
+ // console.log(" SUCCESS adding menu item.");
+ return result;
+ }
+ }
+ let addedItem = addMenuItem();
- if (typeof menuItemExists != 'undefined' && menuItemExists != null && menuItemExists != "") {
+ if (!addedItem) {
+ console.log("Item was not added.");
+ } else {
+ // now add this item to the menu
+ const addToMenu = async() => {
+ let result2 = await Meteor.callAsync('addto.Menu', menuId, menuItem, result, dateSrv);
+ if (!result2) {
+ console.log(" ERROR adding menuitem to menu: " + error);
+ } else {
+ $("#menuItemInp").val("");
+ $("#dateServed").val("");
+ // console.log("Added item to menu - no problem.");
+ }
+ }
+ addToMenu();
+ }
+ }
+ }
+
+ const itExists = async(menuItemExists) => {
// use the existing item on the menu
let menuItemId = menuItemExists._id;
let isLinked = menuItemExists.isLinked;
@@ -75,30 +133,6 @@ Template.menuItemsForm.events({
}
});
}
- } else {
- // add the item as new and add to the menu
- if (menuItem == null || menuItem == "") {
- Session.set("menuItemErr", true);
- } else {
- Meteor.call('add.menuItem', menuItem, function(err, result) {
- if (err) {
- console.log(" ERROR adding menu item: " + err);
- } else {
- // console.log(" SUCCESS adding menu item.");
- $("#menuItemInp").val("");
- $("#dateServed").val("");
-
- // now add this item to the menu
- Meteor.call('addto.Menu', menuId, menuItem, result, dateSrv, false, function(error, nresult) {
- if (error) {
- console.log(" ERROR adding menuitem to menu: " + error);
- } else {
- // console.log("Added item to menu - no problem.");
- }
- });
- }
- });
- }
}
},
'click .shiftOneDay' (event) {
@@ -110,13 +144,14 @@ Template.menuItemsForm.events({
let menuItemId = menuInfo[i]._id;
let momentAddDay = moment(menuInfo[i].serveDate).add(1, 'day').format("MMM DD, YYYY");
// console.log(momentAddDay);
- Meteor.call('shiftDate', menuItemId, momentAddDay, function(err,result) {
- if (err) {
+ const shiftDay = async() => {
+ let result = await Meteor.callAsync('shiftDate', menuItemId, momentAddDay);
+ if (!result) {
console.log(" ERROR shifting meal days: " + err);
} else {
showSnackbar("Items Shifted Out by 1 Calendar Day", "green");
}
- });
+ }
}
},
'keyup #menuItemInp' (event) {
diff --git a/client/MenuItems/menuItemsTbl.js b/client/MenuItems/menuItemsTbl.js
index 40e279c..b75f811 100644
--- a/client/MenuItems/menuItemsTbl.js
+++ b/client/MenuItems/menuItemsTbl.js
@@ -30,11 +30,21 @@ Template.menuItemsTbl.helpers({
if (Session.get("menuId")) {
menuId = Session.get("menuId");
} else {
- menuId = UserLast.findOne({ view: "Menu" }).viewId;
+ const menu = async() => {
+ let menId = await UserLast.findOneAsync({ view: "Menu" }).viewId;
+ if (!menId) {
+
+ } else {
+ return menId;
+ }
+ }
+ menuId = menu();
}
- let menuInfo = Menus.find({ _id: menuId }, { sort: { serveDateActual: 1 }});
- if (menuInfo) {
- return menuInfo
+ if (menuId) {
+ let menuInfo = Menus.find({ _id: menuId }, { sort: { serveDateActual: 1 }});
+ if (menuInfo) {
+ return menuInfo;
+ }
}
}
});
diff --git a/client/MenuItems/modalLinkProducts.js b/client/MenuItems/modalLinkProducts.js
index d15780e..674a63c 100644
--- a/client/MenuItems/modalLinkProducts.js
+++ b/client/MenuItems/modalLinkProducts.js
@@ -42,7 +42,7 @@ Template.modalLinkProducts.events({
let links = M.FormSelect.getInstance(linkSelect).getSelectedValues();
if (typeof links != undefined && links != [] && links != null) {
// let's split these links into their parts, and make an array of objects
- for (i=0; i
{
+ let result = await Meteor.callAsync("add.menuProdLinks", menuItemId, menuItemName, linkObjArray);
+ if (!result) {
console.log(" ERROR adding product links to this menu item: " + err);
} else {
- Meteor.call('update.menuItemLinked', menuItemId, true, function(err, result) {
- if (err) {
- console.log(" ERROR adding link to menu item: " + err);
- } else {
- Meteor.call('link.inMenu', menuItemId, true, function(error, nresult) {
- if (error) {
- console.log(" ERROR adding link to menu sub-item: " + error);
- } else {
- showSnackbar("Products added to Menu Item successfully!", "green");
- }
- });
- }
- });
+ updMenuItemLinks();
}
- });
+ }
+ addMenuProdLinks();
+
+ const updMenuItemLinks = async() => {
+ let result = await Meteor.callAsync('update.menuItemLinked', menuItemId, true);
+ if (!result) {
+ console.log(" ERROR adding link to menu item: " + err);
+ } else {
+ linkInMenu();
+ }
+ }
+
+ const linkInMenu = async() => {
+ let result = await Meteor.callAsync('link.inMenu', menuItemId, true);
+ if (!result) {
+ console.log(" ERROR adding link to menu sub-item: " + error);
+ } else {
+ showSnackbar("Products added to Menu Item successfully!", "green");
+ }
+ }
}
}
});
diff --git a/client/Menus/addMenuModal.js b/client/Menus/addMenuModal.js
index ae92d87..449c8be 100644
--- a/client/Menus/addMenuModal.js
+++ b/client/Menus/addMenuModal.js
@@ -27,14 +27,16 @@ Template.addMenuModal.events({
if (menuName == "" || menuName == null) {
Session.set("menuNameErr", true);
} else {
- Meteor.call("add.menu", menuName, function(err, result) {
- if (err) {
+ const addMenu = async() => {
+ let result = await Meteor.callAsync("add.menu", menuName);
+ if (!result) {
console.log(" ERROR adding menu: " + err);
} else {
console.log(" SUCCESS adding menu.");
$("#menuNameInp").val("");
}
- });
+ }
+ addMenu();
}
},
});
\ No newline at end of file
diff --git a/client/Menus/mainMenuTbl.js b/client/Menus/mainMenuTbl.js
index 0ae96b7..97fbb0b 100644
--- a/client/Menus/mainMenuTbl.js
+++ b/client/Menus/mainMenuTbl.js
@@ -1,5 +1,6 @@
import { Menus } from '../../imports/api/menu.js';
import { M } from '../lib/assets/materialize.js';
+import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
Template.mainMenuTbl.onCreated(function() {
this.subscribe("myMenus");
@@ -21,41 +22,48 @@ Template.mainMenuTbl.events({
'click li.collection-item' (event) {
event.preventDefault();
let sender = event.target;
- // console.log("Sender origination from: ");
+ // console.log("Sender originated from: ");
// console.log(sender.localName);
if (sender.localName == "li") {
let menuId = event.currentTarget.id;
if (menuId == "addMenu") {
- // console.log("add menu clicked");
+ console.log("add menu clicked");
} else {
- // console.log("menuId is: " + menuId);
- Meteor.call('add.userLast', "Menu", menuId, function(err, result) {
- if (err) {
- console.log(" ERROR writing last menu viewed by user to db: " + err);
+ console.log("menuId is: " + menuId);
+ const addUserLast = async() => {
+ let result = await Meteor.callAsync('add.userLast', "Menu", menuId);
+ if (!result) {
+ console.log(" ERROR writing last menu viewed by user to db.");
} else {
Session.set("menuId", menuId);
Meteor.setTimeout(function() {
FlowRouter.go('/menuitems');
}, 100);
}
- });
+ }
+ addUserLast();
}
} else if (sender.localName == "i") {
let menuId = this._id;
- Meteor.call("markMenu.complete", menuId, function(err, result) {
- if (err) {
- console.log(" ERROR: can't mark menu complete: " + err);
+ const makrMenuComp = async() => {
+ let result = await Meteor.callAsync("markMenu.complete", menuId);
+ if (!result) {
+ console.log(" ERROR: can't mark menu complete.");
} else {
console.log(" SUCCESS marking menu complete.");
- Meteor.call('setAllMade.menuItem', menuId, function(err, result) {
- if (err) {
- console.log(" ERROR: cannot set all items as made: " + err);
- } else {
- console.log(" SUCCESS setting all items made.");
- }
- });
+ setAllMade();
}
- });
+ }
+ makrMenuComp();
+
+ const setAllMade = async() => {
+ let result = await Meteor.callAsync('setAllMade.menuItem', menuId);
+ if (!result) {
+ console.log(" ERROR: cannot set all items as made.");
+ } else {
+ console.log(" SUCCESS setting all items made.");
+ }
+ }
}
},
});
\ No newline at end of file
diff --git a/client/MyTasks/myTasksForm.js b/client/MyTasks/myTasksForm.js
index 7d50d29..05ce454 100644
--- a/client/MyTasks/myTasksForm.js
+++ b/client/MyTasks/myTasksForm.js
@@ -40,7 +40,7 @@ Template.myTasksForm.events({
if (taskDateArray == null || taskDateArray == []|| taskDateArray == "") {
taskDateErr = true;
} else {
- for (i = 0; i < taskDateArray.length; i++) {
+ for (let i = 0; i < taskDateArray.length; i++) {
// console.log(taskDateArray[i]);
let actDateTask = new Date(taskDateArray[i]);
actDate.push(actDateTask);
@@ -49,10 +49,11 @@ Template.myTasksForm.events({
console.log("Date Error: " + taskDateErr + " - Name Error: " + taskNameErr);
if (taskDateErr == false && taskNameErr == false) {
- Meteor.call("add.task", taskNameArray, "self", "selfId", taskDateArray, actDate, function(err, result) {
- if (err) {
- console.log(" ERROR adding task for self: " + err);
- showSnackbar("ERROR adding task for self!", "red");
+ const addTask = async() => {
+ let result = await Meteor.callAsync("add.task", taskNameArray, "self", "selfId", taskDateArray, actDate);
+ if (!result) {
+ console.log(" ERROR adding task for self: ");
+ showSnackbar("Error adding task for self!", "red");
} else {
console.log(" SUCCESS adding task for self.");
Session.set("taskDateArr", []);
@@ -60,7 +61,8 @@ Template.myTasksForm.events({
$("#myTaskDate").val("");
showSnackbar("Added Tasks Successfully!", "green");
}
- });
+ }
+ addTask();
} else {
showSnackbar("Error! Both Task & Date are Required!", "red");
}
diff --git a/client/MyTasks/myTasksTbl.js b/client/MyTasks/myTasksTbl.js
index ea3569c..cb82446 100644
--- a/client/MyTasks/myTasksTbl.js
+++ b/client/MyTasks/myTasksTbl.js
@@ -55,15 +55,15 @@ Template.myTasksTbl.events({
'click .markMyTaskComplete' (event) {
event.preventDefault();
let taskId = this._id;
- Meteor.call("markTask.complete", taskId, function(err, result) {
- if (err) {
+ const makrTaskComp = async() => {
+ let result = await Meteor.callAsync("markTask.complete", taskId);
+ if (!result) {
console.log(" ERROR marking task completeL " + err);
showSnackbar("ERROR Marking Task Complete!", "red");
} else {
showSnackbar("Successfully Marked Task Complete!", "green");
-
}
- });
+ }
},
'click .deleteMyTask' (event) {
event.preventDefault();
diff --git a/client/UserConfig/userConfig.js b/client/UserConfig/userConfig.js
index 8afff09..7c83fca 100644
--- a/client/UserConfig/userConfig.js
+++ b/client/UserConfig/userConfig.js
@@ -5,15 +5,29 @@ Template.userConfig.onCreated(function() {
});
Template.userConfig.onRendered(function() {
- let myConfig = UserConfig.findOne({ user: Meteor.userId() });
- if (typeof myConfig != 'undefined') {
- console.log("My Pref: " + myConfig.darkPref);
- if (myConfig.darkMode == 'light') {
- $("#darkMode").prop('checked', false);
- } else {
- $("#darkMode").prop('checked', true);
+ const getConfig = async() => {
+ // console.log("tried to get switch config.")
+ let myConfig = await UserConfig.findOneAsync({ user: Meteor.userId() });
+ try {
+ // console.dir(myConfig);
+ if (!myConfig) {
+ // console.log("config not found, setting to light mode.");
+ $("#darkMode").prop('checked', false);
+ } else {
+ // console.log("My Pref: " + myConfig.darkMode);
+ if (myConfig.darkMode == 'light') {
+ $("#darkMode").prop('checked', false);
+ } else {
+ // console.log("should be checked.")
+ $("#darkMode").prop('checked', true);
+ }
+ }
+ } catch(error) {
+ console.log(" ERROR getting dark theme for setting swtich: " + error);
}
+
}
+ getConfig();
});
Template.userConfig.helpers({
@@ -22,23 +36,22 @@ Template.userConfig.helpers({
Template.userConfig.events({
'click #darkMode' (event) {
- let darkModePref = $("#darkMode").prop('checked');
+ let darkModePref = $("#darkMode").prop('checked')
if (darkModePref == true) {
- Meteor.call('update.darkModePref', 'dark', function(err, reuslt) {
- if (err) {
- console.log(" ERROR: could not set dark mode preference to dark: " + err);
- } else {
- showSnackbar("Dark Mode Preference Set to Dark", "green");
- }
- });
+ let mode = 'dark';
+ setDarkMode(mode);
} else {
- Meteor.call('update.darkModePref', 'light', function(err, result) {
- if (err) {
- console.log(" ERROR: could not set dark mode preference to light: " + err);
- } else {
- showSnackbar("Dark Mode Preference Set to Light", "green");
- }
- });
+ let mode = 'light';
+ setDarkMode(mode);
}
},
-});
\ No newline at end of file
+});
+
+const setDarkMode = async(mode) => {
+ let result = await Meteor.callAsync('update.darkModePref', mode);
+ if (!result) {
+ console.log(" - Did not receive back a 'result' from the update.");
+ } else {
+ showSnackbar("Dark Mode Preference Set to " + mode, "green");
+ }
+}
\ No newline at end of file
diff --git a/imports/api/listItems.js b/imports/api/listItems.js
index 9459395..7f3ff0c 100644
--- a/imports/api/listItems.js
+++ b/imports/api/listItems.js
@@ -25,38 +25,48 @@ Meteor.methods({
let iname = itemName.charAt(0).toUpperCase() + itemName.slice(1);
// look up the item from the Products collection
- let prodInfo = Products.findOne({ prodName: iname });
- if (!prodInfo) {
- Meteor.call("add.product", itemName, [""], function(err, result) {
- if (err) {
- console.log(" ERROR adding item to products: " + err);
- } else {
- // console.log(" SUCCESS adding item to Products.");
+ const prodIsIn = async() => {
+ let prodInfo = await Products.findOneAsync({ prodName: iname });
+ try {
+ if (!prodInfo) {
+ // add product info first
+ const addProd = async() => {
+ let added = await Meteor.callAsync("add.product", itemName, [""]);
+ if (!added) {
+ console.log(" ERROR adding item to products: " + err);
+ } else {
+ // console.log(" SUCCESS adding item to Products.");
- return ListItems.insert({
+ return ListItems.insertAsync({
+ itemName: iname,
+ listId: listId,
+ prodId: result,
+ addedBy: this.userId,
+ itemStore: "",
+ itemOrdered: false,
+ itemReceived: false,
+ dateAddedToList: new Date(),
+ });
+ }
+ }
+ } else {
+ return ListItems.insertAsync({
itemName: iname,
listId: listId,
- prodId: result,
+ prodId: prodInfo._id,
addedBy: this.userId,
- itemStore: "",
+ itemStore: prodInfo.prodStore,
itemOrdered: false,
itemReceived: false,
dateAddedToList: new Date(),
});
}
- });
- } else {
- return ListItems.insert({
- itemName: iname,
- listId: listId,
- prodId: prodInfo._id,
- addedBy: this.userId,
- itemStore: prodInfo.prodStore,
- itemOrdered: false,
- itemReceived: false,
- dateAddedToList: new Date(),
- });
+ } catch(error) {
+ console.log(" ERROR adding new product and item: " + error);
+ }
}
+ let prodIn = prodIsIn();
+ return prodIn;
},
'add.itemsFromMenuItem' (itemIds, listId) {
check(itemIds, [String]);
@@ -75,7 +85,7 @@ Meteor.methods({
if (onList == 0) {
// now pull the product
let prodInfo = Products.findOne({ _id: itemIds[i] });
- ListItems.insert({
+ ListItems.insertAsync({
itemName: prodInfo.prodName,
listId: listId,
prodId: prodInfo._id,
@@ -98,7 +108,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to set items as ordered. Make sure you are logged in with valid user credentials.');
}
- return ListItems.update({ _id: itemId }, {
+ return ListItems.updateAsync({ _id: itemId }, {
$set: {
itemOrdered: true,
dateOrdered: new Date(),
@@ -116,7 +126,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to set items as not ordered. Make sure you are logged in with valid user credentials.');
}
- return ListItems.update({ _id: itemId }, {
+ return ListItems.updateAsync({ _id: itemId }, {
$set: {
itemOrdered: false,
dateUnOrdered: new Date(),
@@ -130,7 +140,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to set items as received. Make sure you are logged in with valid user credentials.');
}
- return ListItems.update({ _id: itemId }, {
+ return ListItems.updateAsync({ _id: itemId }, {
$set: {
itemReceived: true,
dateReceived: new Date(),
@@ -145,7 +155,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to set items as not received. Make sure you are logged in with valid user credentials.');
}
- return ListItems.update({ _id: itemId }, {
+ return ListItems.updateAsync({ _id: itemId }, {
$set: {
itemReceived: false,
dateNotReceived: new Date(),
@@ -164,7 +174,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to add items. Make sure you are logged in with valid user credentials.');
}
- return ListItems.update({ _id: itemId }, {
+ return ListItems.updateAsync({ _id: itemId }, {
$set: {
itemName: itemName,
}
@@ -177,6 +187,6 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to delete list items. Make sure you are logged in with valid user credentials.');
}
- return ListItems.remove({ _id: itemId });
+ return ListItems.removeAsync({ _id: itemId });
}
});
diff --git a/imports/api/lists.js b/imports/api/lists.js
index 1c02722..037e73e 100644
--- a/imports/api/lists.js
+++ b/imports/api/lists.js
@@ -20,7 +20,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to add lists. Make sure you are logged in with valid user credentials.');
}
- return Lists.insert({
+ return Lists.insertAsync({
listName: listName,
listShared: isShared,
listOwner: this.userId,
@@ -36,7 +36,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to edit lists. Make sure you are logged in with valid user credentials.');
}
- return Lists.update({ _id: listId }, {
+ return Lists.updateAsync({ _id: listId }, {
$set: {
listName: listName,
listShared: isShared,
@@ -50,7 +50,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to delete lists. Make sure you are logged in with valid user credentials.');
}
- return Lists.remove({ _id: listId });
+ return Lists.removeAsync({ _id: listId });
},
'mark.complete' (listId) {
check(listId, String);
@@ -59,7 +59,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to mark lists complete. Make sure you are logged in with valid user credentials.');
}
- return Lists.update({ _id: listId }, {
+ return Lists.updateAsync({ _id: listId }, {
$set: {
listComplete: true,
completedOn: new Date()
@@ -73,7 +73,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to restore completed lists. Make sure you are logged in with valid user credentials.');
}
- return Lists.update({ _id: listId }, {
+ return Lists.updateAsync({ _id: listId }, {
$set: {
listComplete: false,
completedOn: new Date()
@@ -85,6 +85,6 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to clean up old lists. Make sure you are logged in with valid user credentials.');
}
- return Lists.remove({ listComplete: true });
+ return Lists.removeAsync({ listComplete: true });
},
});
\ No newline at end of file
diff --git a/imports/api/mScripts.js b/imports/api/mScripts.js
index 4152b65..710c530 100644
--- a/imports/api/mScripts.js
+++ b/imports/api/mScripts.js
@@ -15,7 +15,7 @@ Meteor.methods({
'set.ScriptRun' (scriptName) {
check(scriptName, String);
- MScripts.insert({
+ MScripts.insertAsync({
scriptName: scriptName,
hasRun: true,
runOn: new Date(),
diff --git a/imports/api/menu.js b/imports/api/menu.js
index b97d21a..8221a0f 100644
--- a/imports/api/menu.js
+++ b/imports/api/menu.js
@@ -22,7 +22,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to add menus. Make sure you are logged in with valid user credentials.');
}
- return Menus.insert({
+ return Menus.insertAsync({
menuName: menuName,
menuOwner: this.userId,
menuComplete: false,
@@ -36,7 +36,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to edit menus. Make sure you are logged in with valid user credentials.');
}
- return Menus.update({ _id: menuId }, {
+ return Menus.updateAsync({ _id: menuId }, {
$set: {
menuName: menuName,
}
@@ -49,7 +49,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to delete menus. Make sure you are logged in with valid user credentials.');
}
- return Menus.remove({ _id: menuId });
+ return Menus.removeAsync({ _id: menuId });
},
'markMenu.complete' (menuId) {
check(menuId, String);
@@ -58,7 +58,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to mark menus complete. Make sure you are logged in with valid user credentials.');
}
- return Menus.update({ _id: menuId }, {
+ return Menus.updateAsync({ _id: menuId }, {
$set: {
menuComplete: true,
}
@@ -71,7 +71,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to mark menus not complete. Make sure you are logged in with valid user credentials.');
}
- return Menus.update({ _id: menuId }, {
+ return Menus.updateAsync({ _id: menuId }, {
$set: {
menuComplete: false,
}
@@ -90,7 +90,7 @@ Meteor.methods({
for (i=0; i < menuList.length; i++) {
let removeMenu = true;
let items = MenuItems.find({ menuId: menuList[i]._id }).fetch();
- for (j=0; j < items.length; j++) {
+ for (let j=0; j < items.length; j++) {
let srvDate = moment(items[j].serveDateActual);
let today = moment();
let expired = moment(today).isAfter(srvDate);
@@ -107,14 +107,14 @@ Meteor.methods({
// next let's add the ids of any menus that are marked complete
let markedComplete = Menus.find({ menuComplete: true }).fetch();
- for (k = 0; k < markedComplete.length; k++) {
+ for (let k = 0; k < markedComplete.length; k++) {
let menuId = markedComplete[k]._id;
removeMenuIds.push(menuId);
}
// finally we'll cycle through the ids and remove the items we collected up.
- for (l = 0; l < removeMenuIds.length; l++) {
- Menus.remove({ _id: removeMenuIds[l] });
+ for (let l = 0; l < removeMenuIds.length; l++) {
+ Menus.removeAsync({ _id: removeMenuIds[l] });
}
},
'addto.Menu' (menuId, menuItem, menuItemId, dateSrv, isLinked) {
@@ -130,7 +130,7 @@ Meteor.methods({
serveDateActual = new Date(dateSrv);
- return Menus.update({ _id: menuId }, {
+ return Menus.updateAsync({ _id: menuId }, {
$addToSet: {
menuItems:
{
@@ -151,7 +151,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to link menu items to products. Make sure you are logged in with valid user credentials.');
}
- return Menus.update({ 'menuItems.menuItemId': menuItemId }, {
+ return Menus.updateAsync({ 'menuItems.menuItemId': menuItemId }, {
$set: {
"menuItems.$.isLinked": isLinked
}
@@ -167,7 +167,7 @@ Meteor.methods({
let ids = itemIds.split('_');
console.log("item ids: " + ids[0] + " and " + ids[1]);
- return Menus.update({ _id: ids[0] }, {
+ return Menus.updateAsync({ _id: ids[0] }, {
$pull: {
menuItems: {
menuItemId: ids[1],
diff --git a/imports/api/menuItems.js b/imports/api/menuItems.js
index eca07b0..69f47fe 100644
--- a/imports/api/menuItems.js
+++ b/imports/api/menuItems.js
@@ -19,7 +19,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to add items. Make sure you are logged in with valid user credentials.');
}
- return MenuItems.insert({
+ return MenuItems.insertAsync({
itemName: itemName,
addedBy: this.userId,
dateAddedtoMenu: new Date(),
@@ -34,7 +34,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to set this menu item as linked to products. Make sure you are logged in with valid user credentials.');
}
- return MenuItems.update({ _id: itemId }, {
+ return MenuItems.updateAsync({ _id: itemId }, {
$set: {
isLinked: isLinked,
}
@@ -48,7 +48,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to edit menu items. Make sure you are logged in with valid user credentials.');
}
- return MenuItems.update({ _id: itemId }, {
+ return MenuItems.updateAsync({ _id: itemId }, {
$set: {
itemName: itemName,
}
@@ -61,7 +61,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to delete menu items. Make sure you are logged in with valid user credentials.');
}
- return MenuItems.remove({ _id: itemId });
+ return MenuItems.removeAsync({ _id: itemId });
},
'shiftDate' (itemId, momentAddDay) {
check(itemId, String);
@@ -71,7 +71,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to shift menu item dates. Make sure you are logged in with valid user credentials.');
}
- return MenuItems.update({ _id: itemId }, {
+ return MenuItems.updateAsync({ _id: itemId }, {
$set: {
serveDate: momentAddDay,
}
diff --git a/imports/api/menuProdLinks.js b/imports/api/menuProdLinks.js
index 042755b..0a9b2de 100644
--- a/imports/api/menuProdLinks.js
+++ b/imports/api/menuProdLinks.js
@@ -34,7 +34,7 @@ Meteor.methods({
}
});
} else {
- return MenuProdLinks.insert({
+ return MenuProdLinks.insertAsync({
menuItemId: menuItemId,
menuItemName: menuItemName,
products: prodNameArray,
@@ -52,7 +52,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to add menu and product links. Make sure you are logged in with valid user credentials.');
};
- return MenuProdLinks.update({ menuItemId: menuItemId }, {
+ return MenuProdLinks.updateAsync({ menuItemId: menuItemId }, {
$set: {
products: prodNameArray,
dateUpdated: Date(),
diff --git a/imports/api/products.js b/imports/api/products.js
index d63bf2a..3eafefa 100644
--- a/imports/api/products.js
+++ b/imports/api/products.js
@@ -24,15 +24,22 @@ Meteor.methods({
// first does this product already exist?
- let prodExists = Products.findOne({ prodName: pname });
-
- if (!prodExists) {
- return Products.insert({
- prodName: pname,
- prodOwner: this.userId,
- prodStore: prodStore,
- });
+ const productIsIn = async() => {
+ let prodExists = await Products.findOneAsync({ prodName: pname });
+ try {
+ if (!prodExists) {
+ return Products.insertAsync({
+ prodName: pname,
+ prodOwner: this.userId,
+ prodStore: prodStore,
+ });
+ }
+ } catch(error) {
+ console.log(" ERROR adding Pdocut: " + error);
+ }
}
+ let prodIn = productIsIn();
+ return prodIn;
},
'edit.product' (prodId, prodName, prodStore) {
check(prodId, String);
@@ -45,7 +52,7 @@ Meteor.methods({
let pname = prodName.charAt(0).toUpperCase() + prodName.slice(1);
- return Products.update({ _id: prodId }, {
+ return Products.updateAsync({ _id: prodId }, {
$set: {
prodName: pname,
prodStore: prodStore,
@@ -59,6 +66,6 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to delete products. Make sure you are logged in with valid user credentials.');
}
- return Products.remove({ _id: prodId });
+ return Products.removeAsync({ _id: prodId });
}
});
diff --git a/imports/api/recipeItems.js b/imports/api/recipeItems.js
index a0688be..b19a0ea 100644
--- a/imports/api/recipeItems.js
+++ b/imports/api/recipeItems.js
@@ -21,7 +21,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to add recipe items. Make sure you are logged in with valid user credentials.');
}
- return RecipeItems.insert({
+ return RecipeItems.insertAsync({
recipeId: recipeId,
recipeItemType: recipeItemType,
recipeItem: recipeItem,
@@ -37,7 +37,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to edit recipe items. Make sure you are logged in with valid user credentials.');
}
- return RecipeItems.update({ _id: recipeItemId }, {
+ return RecipeItems.updateAsync({ _id: recipeItemId }, {
$set: {
recipeId: recipeId,
recipeItemType: recipeItemType,
@@ -52,6 +52,6 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to delete recipe items. Make sure you are logged in with valid user credentials.');
}
- return RecipeItems.remove({ _id: recipeItemId });
+ return RecipeItems.removeAsync({ _id: recipeItemId });
}
});
\ No newline at end of file
diff --git a/imports/api/recipes.js b/imports/api/recipes.js
index 9ad2169..d1edbe3 100644
--- a/imports/api/recipes.js
+++ b/imports/api/recipes.js
@@ -19,7 +19,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to add recipes. Make sure you are logged in with valid user credentials.');
}
- return Recipes.insert({
+ return Recipes.insertAsync({
recipeName: recipeName,
addedBy: this.userId,
addedOn: new Date(),
@@ -33,7 +33,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to add recipes. Make sure you are logged in with valid user credentials.');
}
- return Recipes.update({ _id: recipeId }, {
+ return Recipes.updateAsync({ _id: recipeId }, {
$set: {
recipeName: recipeName,
updatedOn: new Date(),
@@ -48,6 +48,6 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to delete recipes. Make sure you are logged in with valid user credentials.');
}
- return Recipes.remove({ _id: recipeId });
+ return Recipes.removeAsync({ _id: recipeId });
}
});
\ No newline at end of file
diff --git a/imports/api/stores.js b/imports/api/stores.js
index 4638595..b0fbec9 100644
--- a/imports/api/stores.js
+++ b/imports/api/stores.js
@@ -19,7 +19,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to add stores. Make sure you are logged in with valid user credentials.');
}
- return Stores.insert({
+ return Stores.insertAsync({
storeName: storeName,
owner: this.userId,
});
@@ -32,7 +32,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to edit stores. Make sure you are logged in with valid user credentials.');
}
- return Stores.update({ _id: storeId }, {
+ return Stores.updateAsync({ _id: storeId }, {
$set: {
storeName: storeName,
}
@@ -45,6 +45,6 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to delete stores. Make sure you are logged in with valid user credentials.');
}
- return Stores.remove({ _id: storeId });
+ return Stores.removeAsync({ _id: storeId });
},
});
\ No newline at end of file
diff --git a/imports/api/systemConfig.js b/imports/api/systemConfig.js
index 3f848be..7188ebd 100644
--- a/imports/api/systemConfig.js
+++ b/imports/api/systemConfig.js
@@ -20,23 +20,37 @@ Meteor.methods({
throw new Meteor.Error('Not able to change registration setting. Make sure you are logged in with valid system administrator credentials.');
}
- let curr = SysConfig.findOne({});
- if (typeof curr != 'undefined') {
- let configId = curr._id;
- Meteor.call('edit.noSysAdminReg', configId, admReg, genReg, function(err, result) {
- if (err) {
- console.log(" ERROR updating sys admin reg: " + err);
+ const currConfig = async() => {
+ let curr = await SysConfig.findOneAsync({});
+ if (!curr) {
+ try {
+ return SysConfig.insertAsync({
+ SysAdminReg: admReg,
+ dateAdded: new Date(),
+ allowReg: genReg,
+ });
+ } catch(error) {
+ console.log(" ERROR trying to insert system config:");
+ console.log(error.message);
+ console.log(error.stack);
+ }
+ } else {
+ try {
+ let configId = curr._id;
+ const addNoSys = await Meteor.callAsync('edit.noSysAdminReg', configId, admReg, genReg);
+ if (!addNoSys) {
+ console.log(" Couldn't edit the system config.");
} else {
console.log("Success updating sys admin reg.");
}
- });
- } else {
- return SysConfig.insert({
- SysAdminReg: admReg,
- dateAdded: new Date(),
- allowReg: genReg,
- });
+ } catch(error) {
+ console.log(" ERROR trying to pull current system config:");
+ console.log(error.message);
+ console.log(error.stack);
+ }
}
+ }
+ currConfig();
},
'edit.noSysAdminReg' (configId, canReg, genReg) {
check(canReg, Boolean);
@@ -47,7 +61,7 @@ Meteor.methods({
throw new Meteor.Error('Not able to change registration setting. Make sure you are logged in with valid system administrator credentials.');
}
- return SysConfig.update({ _id: configId }, {
+ return SysConfig.updateAsync({ _id: configId }, {
$set: {
SysAdminReg: canReg,
allowReg: genReg,
@@ -66,7 +80,7 @@ Meteor.methods({
let configId = curr._id;
- return SysConfig.update({ _id: configId }, {
+ return SysConfig.updateAsync({ _id: configId }, {
$set: {
allowUpdates: allowUpdate,
}
diff --git a/imports/api/tasks.js b/imports/api/tasks.js
index 7e581b1..eb49df3 100644
--- a/imports/api/tasks.js
+++ b/imports/api/tasks.js
@@ -27,16 +27,23 @@ Meteor.methods({
let username;
if (assignedTo == "self") {
- let userInfo = Meteor.users.findOne({ _id: this.userId });
- username = userInfo.profile.fullname;
- assignedToId = this.userId;
+ const uInfo = async() => {
+ let userInfo = await Meteor.users.findOneAsync({ _id: this.userId });
+ if (!userInfo) {
+ console.log("No matching user info found.")
+ } else {
+ username = userInfo.profile.fullname;
+ assignedToId = this.userId;
+ }
+ }
+ uInfo();
} else {
username = assignedTo;
}
for (i=0; i < taskDateArr.length; i++) {
for (j=0; j < taskNameArr.length; j++) {
- TaskItems.insert({
+ TaskItems.insertAsync({
taskName: taskNameArr[j].id,
taskDate: taskDateArr[i],
actualDate: actDate[i],
@@ -62,14 +69,21 @@ Meteor.methods({
let username;
if (assignedTo == "self") {
- let userInfo = Meteor.users.findOne({ _id: this.userId });
- username = userInfo.profile.fullname;
- assignedToId = this.userId;
+ const uInfo = async() => {
+ let userInfo = await Meteor.users.findOneAsync({ _id: this.userId });
+ if (!userInfo) {
+ console.log("No matching user info found.")
+ } else {
+ username = userInfo.profile.fullname;
+ assignedToId = this.userId;
+ }
+ }
+ uInfo();
} else {
username = assignedTo;
}
- return TaskItems.insert({
+ return TaskItems.insertAsync({
taskName: taskName,
taskDate: taskDate,
actualDate: actDate,
@@ -91,7 +105,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to edit tasks. Make sure you are logged in with valid user credentials.');
}
- return TaskItems.update({ _id: taskId }, {
+ return TaskItems.updateAsync({ _id: taskId }, {
$set: {
taskName: taskName,
taskDate: taskDate,
@@ -108,7 +122,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to delete tasks. Make sure you are logged in with valid user credentials.');
}
- return TaskItems.remove({ _id: taskId });
+ return TaskItems.removeAsync({ _id: taskId });
},
'markTask.complete' (taskId) {
check(taskId, String);
@@ -117,7 +131,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to mark tasks complete. Make sure you are logged in with valid user credentials.');
}
- return TaskItems.update({ _id: taskId }, {
+ return TaskItems.updateAsync({ _id: taskId }, {
$set: {
isComplete: true,
completedOn: new Date(),
@@ -132,7 +146,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to mark tasks not complete. Make sure you are logged in with valid user credentials.');
}
- return TaskItems.update({ _id: taskId }, {
+ return TaskItems.updateAsync({ _id: taskId }, {
$set: {
isComplete: false,
markedUncomplteOn: new Date(),
@@ -174,6 +188,6 @@ Meteor.methods({
break;
}
- return TaskItems.remove({ actualDate: { $lt: new Date((new Date()) - upToDate )}});
+ return TaskItems.removeAsync({ actualDate: { $lt: new Date((new Date()) - upToDate )}});
}
});
\ No newline at end of file
diff --git a/imports/api/updateInfo.js b/imports/api/updateInfo.js
index 75ce240..4fd9faa 100644
--- a/imports/api/updateInfo.js
+++ b/imports/api/updateInfo.js
@@ -15,7 +15,7 @@ Meteor.methods({
'add.updateInfo' (updateObject) {
check(updateObject, Object);
- UpdateInfo.insert({
+ return UpdateInfo.insertAsync({
title: updateObject.title,
description: updateObject.description,
dateRelease: updateObject.date,
@@ -29,7 +29,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to mark updates as read. Make sure you are logged in with valid user credentials.');
}
- return UpdateInfo.update({ _id: updateId }, {
+ return UpdateInfo.updateAsync({ _id: updateId }, {
$set: {
viewed: true
}
diff --git a/imports/api/userConfig.js b/imports/api/userConfig.js
index 354230a..a1d0614 100644
--- a/imports/api/userConfig.js
+++ b/imports/api/userConfig.js
@@ -9,6 +9,10 @@ UserConfig.allow({
// if use id exists, allow insert
return !!userId;
},
+ update: function(userId, doc){
+ // if use id exists, allow insert
+ return !!userId;
+ },
});
Meteor.methods({
@@ -16,10 +20,10 @@ Meteor.methods({
check(pref, String);
if (!this.userId) {
- throw new Meteor.Error('Not able to change registration setting. Make sure you are logged in with valid system administrator credentials.');
+ throw new Meteor.Error('Not able to change theme setting. Make sure you are logged in with valid system administrator credentials.');
}
- return UserConfig.insert({
+ return UserConfig.insertAsync({
user: this.userId,
darkMode: pref,
dateAdded: Date()
@@ -29,23 +33,14 @@ Meteor.methods({
check(pref, String);
if (!this.userId) {
- throw new Meteor.Error('Not able to change registration setting. Make sure you are logged in with valid system administrator credentials.');
+ throw new Meteor.Error('Not able to change theme setting. Make sure you are logged in with valid system administrator credentials.');
}
- let myConfig = UserConfig.findOne({ user: this.userId });
- if (typeof myConfig == 'undefined') {
- Meteor.call('add.darkModePref', pref, function(err, result) {
- if (err) {
- console.log(" ERROR calling the add functioin for dark mode: " + err);
- }
- });
- } else {
- return UserConfig.update({ user: this.userId }, {
- $set: {
- darkMode: pref,
- dateUpdate: Date()
- }
- });
- }
+ return UserConfig.updateAsync({ user: this.userId }, {
+ $set: {
+ darkMode: pref,
+ dateUpdate: Date()
+ }
+ });
}
});
\ No newline at end of file
diff --git a/imports/api/userConfigOptions.js b/imports/api/userConfigOptions.js
index d7b59c3..c6290a2 100644
--- a/imports/api/userConfigOptions.js
+++ b/imports/api/userConfigOptions.js
@@ -16,6 +16,6 @@ Meteor.methods({
check(usersId, String);
check(password, String);
- return Accounts.setPassword(usersId, password);
+ return Accounts.setPasswordAsync(usersId, password);
},
});
\ No newline at end of file
diff --git a/imports/api/userLast.js b/imports/api/userLast.js
index 93c12a9..dbeb078 100644
--- a/imports/api/userLast.js
+++ b/imports/api/userLast.js
@@ -22,22 +22,34 @@ Meteor.methods({
// first let's find out if there's an entry for this user and view, and if so
// we'll just edit that entry with updated information
- let userListInfo = UserLast.findOne({ userId: this.userId, view: view });
- if (typeof userListInfo != 'undefined' && userListInfo != "" && userListInfo != null) {
- // entry exists, call the edit function instead
- Meteor.call('edit.userLast', view, viewId, function(err, result) {
- if (err) {
- console.log(" ERROR moving user to edit for last view: " + err);
+ const getUserLast = async() => {
+ let userListInfo = await UserLast.findOneAsync({ userId: this.userId, view: view });
+ if (!userListInfo) {
+ console.log("Adding new user last item.");
+ return UserLast.insertAsync({
+ userId: this.userId,
+ view: view,
+ viewId: viewId,
+ dateAdded: Date(),
+ });
+ } else {
+ console.log("Editing existing user last itme.");
+ // entry exists, call the edit function instead
+ let result = await Meteor.callAsync('edit.userLast', view, viewId);
+ if (!result) {
+ try {
+ console.log("Issue editing existing entry in userLast. Check the logs.");
+ } catch(error) {
+ console.log(" ERROR adding userLast item: " + error);
+ console.log(error.message);
+ console.log(error.stack);
+ }
+ } else {
+ return true;
}
- });
- } else {
- return UserLast.insert({
- userId: this.userId,
- view: view,
- viewId: viewId,
- dateAdded: Date(),
- });
+ }
}
+ return getUserLast();
},
'edit.userLast' (view, viewId) {
check(view, String);
@@ -47,7 +59,8 @@ Meteor.methods({
throw new Meteor.Error('Not able to change user view last setting. Make sure you are logged in with valid system administrator credentials.');
}
- return UserLast.update({ view: view, userId: this.userId }, {
+ console.log("Edit in progress.");
+ return UserLast.updateAsync({ view: view, userId: this.userId }, {
$set: {
viewId: viewId,
dateLastUpdate: Date(),
diff --git a/lib/routes.js b/lib/routes.js
index 6071936..0a4df86 100644
--- a/lib/routes.js
+++ b/lib/routes.js
@@ -1,132 +1,134 @@
+import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
+
FlowRouter.route('/dashboard', {
name: 'home',
action() {
- BlazeLayout.render('MainLayout', { main: "dashboard" });
+ this.render('MainLayout', { main: "dashboard" });
}
});
FlowRouter.route('/', {
name: 'homeNoRoute',
action() {
- BlazeLayout.render('MainLayout', { main: "dashboard" });
+ this.render('MainLayout', { main: "dashboard" });
}
});
FlowRouter.route('/', {
name: 'homeNotLoggedIn',
action() {
- BlazeLayout.render('MainLayout', { notLoggedIn: "login" });
+ this.render('MainLayout', { notLoggedIn: "login" });
}
});
FlowRouter.route('/login', {
name: 'login',
action() {
- BlazeLayout.render('MainLayout', { notLoggedIn: "login" });
+ this.render('MainLayout', { notLoggedIn: "login" });
}
});
FlowRouter.route('/reg', {
name: 'reg',
action() {
- BlazeLayout.render('MainLayout', { notLoggedIn: "reg" });
+ this.render('MainLayout', { notLoggedIn: "reg" });
}
});
FlowRouter.route('/userMgmt', {
name: 'userMgmt',
action() {
- BlazeLayout.render('MainLayout', { main: 'userMgmt' });
+ this.render('MainLayout', { main: 'userMgmt' });
}
});
FlowRouter.route('/manageStore', {
name: 'storeMgmt',
action() {
- BlazeLayout.render('MainLayout', { main: 'storeMgmt' });
+ this.render('MainLayout', { main: 'storeMgmt' });
}
});
FlowRouter.route('/manage', {
name: 'mgmtPage',
action() {
- BlazeLayout.render('MainLayout', { main: 'mgmtPage' });
+ this.render('MainLayout', { main: 'mgmtPage' });
}
});
FlowRouter.route('/manageProduct', {
name: 'manageProduct',
action() {
- BlazeLayout.render('MainLayout', { main: 'prodMgmt' });
+ this.render('MainLayout', { main: 'prodMgmt' });
}
});
FlowRouter.route('/manageLists', {
name: 'manageLists',
action() {
- BlazeLayout.render('MainLayout', { main: 'listMgmt' });
+ this.render('MainLayout', { main: 'listMgmt' });
}
});
FlowRouter.route('/mylists', {
name: 'mylists',
action() {
- BlazeLayout.render('MainLayout', { main: 'listsMain' });
+ this.render('MainLayout', { main: 'listsMain' });
}
});
FlowRouter.route('/listItems', {
name: 'listItems',
action() {
- BlazeLayout.render('MainLayout', { main: 'listItemsMain' });
+ this.render('MainLayout', { main: 'listItemsMain' });
}
});
FlowRouter.route('/mymenus', {
name: 'mymenus',
action() {
- BlazeLayout.render('MainLayout', { main: 'mainMenu' });
+ this.render('MainLayout', { main: 'mainMenu' });
}
});
FlowRouter.route('/menuItems', {
name: 'menuItems',
action() {
- BlazeLayout.render('MainLayout', { main: 'menuItems' });
+ this.render('MainLayout', { main: 'menuItems' });
}
});
FlowRouter.route('/taskHome', {
name: 'taskHome',
action() {
- BlazeLayout.render('MainLayout', { main: 'taskHome' });
+ this.render('MainLayout', { main: 'taskHome' });
}
});
FlowRouter.route('/myTasks', {
name: 'myTasks',
action() {
- BlazeLayout.render('MainLayout', { main: 'myTasks' });
+ this.render('MainLayout', { main: 'myTasks' });
}
});
FlowRouter.route('/systemAdmin', {
name: 'systemAdmin',
action() {
- BlazeLayout.render('MainLayout', { main: 'systemAdmin' });
+ this.render('MainLayout', { main: 'systemAdmin' });
}
});
FlowRouter.route('/cleanUp', {
name: 'cleanUp',
action() {
- BlazeLayout.render('MainLayout', { main: 'cleanUp'});
+ this.render('MainLayout', { main: 'cleanUp'});
}
});
FlowRouter.route('/mySettings', {
name: 'mySettings',
action() {
- BlazeLayout.render('MainLayout', { main: 'userConfig'});
+ this.render('MainLayout', { main: 'userConfig'});
}
});
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index 119939f..f2a6116 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,36 +1,51 @@
{
- "name": "pPickup",
+ "name": "get-my",
+ "lockfileVersion": 3,
"requires": true,
- "lockfileVersion": 1,
- "dependencies": {
- "@babel/runtime": {
+ "packages": {
+ "": {
+ "name": "get-my",
+ "dependencies": {
+ "@babel/runtime": "^7.15.3",
+ "jquery": "^3.6.0",
+ "meteor-node-stubs": "^1.2.5",
+ "moment": "^2.29.4",
+ "node-cron": "^3.0.3",
+ "rss-url-parser": "^3.0.0",
+ "typeahead-standalone": "^5.2.0"
+ }
+ },
+ "node_modules/@babel/runtime": {
"version": "7.15.4",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.15.4.tgz",
"integrity": "sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw==",
- "requires": {
+ "dependencies": {
"regenerator-runtime": "^0.13.4"
+ },
+ "engines": {
+ "node": ">=6.9.0"
}
},
- "addressparser": {
+ "node_modules/addressparser": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/addressparser/-/addressparser-1.0.1.tgz",
"integrity": "sha512-aQX7AISOMM7HFE0iZ3+YnD07oIeJqWGVnJ+ZIKaBZAk03ftmVYVqsGas/rbXKR21n4D/hKCSHypvcyOkds/xzg=="
},
- "array-indexofobject": {
+ "node_modules/array-indexofobject": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/array-indexofobject/-/array-indexofobject-0.0.1.tgz",
"integrity": "sha512-tpdPBIBm4TMNxSp8O3pZgC7mF4+wn9SmJlhE+7bi5so6x39PvzUqChQMbv93R5ilYGZ1HV+Neki4IH/i+87AoQ=="
},
- "core-util-is": {
+ "node_modules/core-util-is": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
},
- "feedparser": {
+ "node_modules/feedparser": {
"version": "2.2.10",
"resolved": "https://registry.npmjs.org/feedparser/-/feedparser-2.2.10.tgz",
"integrity": "sha512-WoAOooa61V8/xuKMi2pEtK86qQ3ZH/M72EEGdqlOTxxb3m6ve1NPvZcmPFs3wEDfcBbFLId2GqZ4YjsYi+h1xA==",
- "requires": {
+ "dependencies": {
"addressparser": "^1.0.1",
"array-indexofobject": "~0.0.1",
"lodash.assign": "^4.2.0",
@@ -40,48 +55,80 @@
"mri": "^1.1.5",
"readable-stream": "^2.3.7",
"sax": "^1.2.4"
+ },
+ "bin": {
+ "feedparser": "bin/feedparser.js"
+ },
+ "engines": {
+ "node": ">= 10.18.1"
}
},
- "inherits": {
+ "node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
- "isarray": {
+ "node_modules/isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="
},
- "jquery": {
+ "node_modules/jquery": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz",
"integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw=="
},
- "lodash.assign": {
+ "node_modules/lodash.assign": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz",
"integrity": "sha512-hFuH8TY+Yji7Eja3mGiuAxBqLagejScbG8GbG0j6o9vzn0YL14My+ktnqtZgFTosKymC9/44wP6s7xyuLfnClw=="
},
- "lodash.get": {
+ "node_modules/lodash.get": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz",
- "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ=="
+ "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==",
+ "deprecated": "This package is deprecated. Use the optional chaining (?.) operator instead."
},
- "lodash.has": {
+ "node_modules/lodash.has": {
"version": "4.5.2",
"resolved": "https://registry.npmjs.org/lodash.has/-/lodash.has-4.5.2.tgz",
"integrity": "sha512-rnYUdIo6xRCJnQmbVFEwcxF144erlD+M3YcJUVesflU9paQaE8p+fJDcIQrlMYbxoANFL+AB9hZrzSBBk5PL+g=="
},
- "lodash.uniq": {
+ "node_modules/lodash.uniq": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz",
"integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ=="
},
- "meteor-node-stubs": {
+ "node_modules/meteor-node-stubs": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/meteor-node-stubs/-/meteor-node-stubs-1.2.5.tgz",
"integrity": "sha512-FLlOFZx3KnZ5s3yPCK+x58DyX9ewN+oQ12LcpwBXMLtzJ/YyprMQVivd6KIrahZbKJrNenPNUGuDS37WUFg+Mw==",
- "requires": {
+ "bundleDependencies": [
+ "assert",
+ "browserify-zlib",
+ "buffer",
+ "console-browserify",
+ "constants-browserify",
+ "crypto-browserify",
+ "domain-browser",
+ "events",
+ "https-browserify",
+ "os-browserify",
+ "path-browserify",
+ "process",
+ "punycode",
+ "querystring-es3",
+ "readable-stream",
+ "stream-browserify",
+ "stream-http",
+ "string_decoder",
+ "timers-browserify",
+ "tty-browserify",
+ "url",
+ "util",
+ "vm-browserify"
+ ],
+ "dependencies": {
"assert": "^2.0.0",
"browserify-zlib": "^0.2.0",
"buffer": "^5.7.1",
@@ -106,790 +153,1145 @@
"url": "^0.11.0",
"util": "^0.12.4",
"vm-browserify": "^1.1.2"
- },
- "dependencies": {
- "asn1.js": {
- "version": "5.4.1",
- "bundled": true,
- "requires": {
- "bn.js": "^4.0.0",
- "inherits": "^2.0.1",
- "minimalistic-assert": "^1.0.0",
- "safer-buffer": "^2.1.0"
- },
- "dependencies": {
- "bn.js": {
- "version": "4.12.0",
- "bundled": true
- }
- }
- },
- "assert": {
- "version": "2.0.0",
- "bundled": true,
- "requires": {
- "es6-object-assign": "^1.1.0",
- "is-nan": "^1.2.1",
- "object-is": "^1.0.1",
- "util": "^0.12.0"
- }
- },
- "available-typed-arrays": {
- "version": "1.0.4",
- "bundled": true
- },
- "base64-js": {
- "version": "1.5.1",
- "bundled": true
- },
- "bn.js": {
- "version": "5.2.0",
- "bundled": true
- },
- "brorand": {
- "version": "1.1.0",
- "bundled": true
- },
- "browserify-aes": {
- "version": "1.2.0",
- "bundled": true,
- "requires": {
- "buffer-xor": "^1.0.3",
- "cipher-base": "^1.0.0",
- "create-hash": "^1.1.0",
- "evp_bytestokey": "^1.0.3",
- "inherits": "^2.0.1",
- "safe-buffer": "^5.0.1"
- }
- },
- "browserify-cipher": {
- "version": "1.0.1",
- "bundled": true,
- "requires": {
- "browserify-aes": "^1.0.4",
- "browserify-des": "^1.0.0",
- "evp_bytestokey": "^1.0.0"
- }
- },
- "browserify-des": {
- "version": "1.0.2",
- "bundled": true,
- "requires": {
- "cipher-base": "^1.0.1",
- "des.js": "^1.0.0",
- "inherits": "^2.0.1",
- "safe-buffer": "^5.1.2"
- }
- },
- "browserify-rsa": {
- "version": "4.1.0",
- "bundled": true,
- "requires": {
- "bn.js": "^5.0.0",
- "randombytes": "^2.0.1"
- }
- },
- "browserify-sign": {
- "version": "4.2.1",
- "bundled": true,
- "requires": {
- "bn.js": "^5.1.1",
- "browserify-rsa": "^4.0.1",
- "create-hash": "^1.2.0",
- "create-hmac": "^1.1.7",
- "elliptic": "^6.5.3",
- "inherits": "^2.0.4",
- "parse-asn1": "^5.1.5",
- "readable-stream": "^3.6.0",
- "safe-buffer": "^5.2.0"
- }
- },
- "browserify-zlib": {
- "version": "0.2.0",
- "bundled": true,
- "requires": {
- "pako": "~1.0.5"
- }
- },
- "buffer": {
- "version": "5.7.1",
- "bundled": true,
- "requires": {
- "base64-js": "^1.3.1",
- "ieee754": "^1.1.13"
- }
- },
- "buffer-xor": {
- "version": "1.0.3",
- "bundled": true
- },
- "builtin-status-codes": {
- "version": "3.0.0",
- "bundled": true
- },
- "call-bind": {
- "version": "1.0.2",
- "bundled": true,
- "requires": {
- "function-bind": "^1.1.1",
- "get-intrinsic": "^1.0.2"
- }
- },
- "cipher-base": {
- "version": "1.0.4",
- "bundled": true,
- "requires": {
- "inherits": "^2.0.1",
- "safe-buffer": "^5.0.1"
- }
- },
- "console-browserify": {
- "version": "1.2.0",
- "bundled": true
- },
- "constants-browserify": {
- "version": "1.0.0",
- "bundled": true
- },
- "create-ecdh": {
- "version": "4.0.4",
- "bundled": true,
- "requires": {
- "bn.js": "^4.1.0",
- "elliptic": "^6.5.3"
- },
- "dependencies": {
- "bn.js": {
- "version": "4.12.0",
- "bundled": true
- }
- }
- },
- "create-hash": {
- "version": "1.2.0",
- "bundled": true,
- "requires": {
- "cipher-base": "^1.0.1",
- "inherits": "^2.0.1",
- "md5.js": "^1.3.4",
- "ripemd160": "^2.0.1",
- "sha.js": "^2.4.0"
- }
- },
- "create-hmac": {
- "version": "1.1.7",
- "bundled": true,
- "requires": {
- "cipher-base": "^1.0.3",
- "create-hash": "^1.1.0",
- "inherits": "^2.0.1",
- "ripemd160": "^2.0.0",
- "safe-buffer": "^5.0.1",
- "sha.js": "^2.4.8"
- }
- },
- "crypto-browserify": {
- "version": "3.12.0",
- "bundled": true,
- "requires": {
- "browserify-cipher": "^1.0.0",
- "browserify-sign": "^4.0.0",
- "create-ecdh": "^4.0.0",
- "create-hash": "^1.1.0",
- "create-hmac": "^1.1.0",
- "diffie-hellman": "^5.0.0",
- "inherits": "^2.0.1",
- "pbkdf2": "^3.0.3",
- "public-encrypt": "^4.0.0",
- "randombytes": "^2.0.0",
- "randomfill": "^1.0.3"
- }
- },
- "define-properties": {
- "version": "1.1.3",
- "bundled": true,
- "requires": {
- "object-keys": "^1.0.12"
- }
- },
- "des.js": {
- "version": "1.0.1",
- "bundled": true,
- "requires": {
- "inherits": "^2.0.1",
- "minimalistic-assert": "^1.0.0"
- }
- },
- "diffie-hellman": {
- "version": "5.0.3",
- "bundled": true,
- "requires": {
- "bn.js": "^4.1.0",
- "miller-rabin": "^4.0.0",
- "randombytes": "^2.0.0"
- },
- "dependencies": {
- "bn.js": {
- "version": "4.12.0",
- "bundled": true
- }
- }
- },
- "domain-browser": {
- "version": "4.22.0",
- "bundled": true
- },
- "elliptic": {
- "version": "6.5.4",
- "bundled": true,
- "requires": {
- "bn.js": "^4.11.9",
- "brorand": "^1.1.0",
- "hash.js": "^1.0.0",
- "hmac-drbg": "^1.0.1",
- "inherits": "^2.0.4",
- "minimalistic-assert": "^1.0.1",
- "minimalistic-crypto-utils": "^1.0.1"
- },
- "dependencies": {
- "bn.js": {
- "version": "4.12.0",
- "bundled": true
- }
- }
- },
- "es-abstract": {
- "version": "1.18.3",
- "bundled": true,
- "requires": {
- "call-bind": "^1.0.2",
- "es-to-primitive": "^1.2.1",
- "function-bind": "^1.1.1",
- "get-intrinsic": "^1.1.1",
- "has": "^1.0.3",
- "has-symbols": "^1.0.2",
- "is-callable": "^1.2.3",
- "is-negative-zero": "^2.0.1",
- "is-regex": "^1.1.3",
- "is-string": "^1.0.6",
- "object-inspect": "^1.10.3",
- "object-keys": "^1.1.1",
- "object.assign": "^4.1.2",
- "string.prototype.trimend": "^1.0.4",
- "string.prototype.trimstart": "^1.0.4",
- "unbox-primitive": "^1.0.1"
- }
- },
- "es-to-primitive": {
- "version": "1.2.1",
- "bundled": true,
- "requires": {
- "is-callable": "^1.1.4",
- "is-date-object": "^1.0.1",
- "is-symbol": "^1.0.2"
- }
- },
- "es6-object-assign": {
- "version": "1.1.0",
- "bundled": true
- },
- "events": {
- "version": "3.3.0",
- "bundled": true
- },
- "evp_bytestokey": {
- "version": "1.0.3",
- "bundled": true,
- "requires": {
- "md5.js": "^1.3.4",
- "safe-buffer": "^5.1.1"
- }
- },
- "foreach": {
- "version": "2.0.5",
- "bundled": true
- },
- "function-bind": {
- "version": "1.1.1",
- "bundled": true
- },
- "get-intrinsic": {
- "version": "1.1.1",
- "bundled": true,
- "requires": {
- "function-bind": "^1.1.1",
- "has": "^1.0.3",
- "has-symbols": "^1.0.1"
- }
- },
- "has": {
- "version": "1.0.3",
- "bundled": true,
- "requires": {
- "function-bind": "^1.1.1"
- }
- },
- "has-bigints": {
- "version": "1.0.1",
- "bundled": true
- },
- "has-symbols": {
- "version": "1.0.2",
- "bundled": true
- },
- "hash-base": {
- "version": "3.1.0",
- "bundled": true,
- "requires": {
- "inherits": "^2.0.4",
- "readable-stream": "^3.6.0",
- "safe-buffer": "^5.2.0"
- }
- },
- "hash.js": {
- "version": "1.1.7",
- "bundled": true,
- "requires": {
- "inherits": "^2.0.3",
- "minimalistic-assert": "^1.0.1"
- }
- },
- "hmac-drbg": {
- "version": "1.0.1",
- "bundled": true,
- "requires": {
- "hash.js": "^1.0.3",
- "minimalistic-assert": "^1.0.0",
- "minimalistic-crypto-utils": "^1.0.1"
- }
- },
- "https-browserify": {
- "version": "1.0.0",
- "bundled": true
- },
- "ieee754": {
- "version": "1.2.1",
- "bundled": true
- },
- "inherits": {
- "version": "2.0.4",
- "bundled": true
- },
- "is-arguments": {
- "version": "1.1.0",
- "bundled": true,
- "requires": {
- "call-bind": "^1.0.0"
- }
- },
- "is-bigint": {
- "version": "1.0.2",
- "bundled": true
- },
- "is-boolean-object": {
- "version": "1.1.1",
- "bundled": true,
- "requires": {
- "call-bind": "^1.0.2"
- }
- },
- "is-callable": {
- "version": "1.2.3",
- "bundled": true
- },
- "is-date-object": {
- "version": "1.0.4",
- "bundled": true
- },
- "is-generator-function": {
- "version": "1.0.9",
- "bundled": true
- },
- "is-nan": {
- "version": "1.3.2",
- "bundled": true,
- "requires": {
- "call-bind": "^1.0.0",
- "define-properties": "^1.1.3"
- }
- },
- "is-negative-zero": {
- "version": "2.0.1",
- "bundled": true
- },
- "is-number-object": {
- "version": "1.0.5",
- "bundled": true
- },
- "is-regex": {
- "version": "1.1.3",
- "bundled": true,
- "requires": {
- "call-bind": "^1.0.2",
- "has-symbols": "^1.0.2"
- }
- },
- "is-string": {
- "version": "1.0.6",
- "bundled": true
- },
- "is-symbol": {
- "version": "1.0.4",
- "bundled": true,
- "requires": {
- "has-symbols": "^1.0.2"
- }
- },
- "is-typed-array": {
- "version": "1.1.5",
- "bundled": true,
- "requires": {
- "available-typed-arrays": "^1.0.2",
- "call-bind": "^1.0.2",
- "es-abstract": "^1.18.0-next.2",
- "foreach": "^2.0.5",
- "has-symbols": "^1.0.1"
- }
- },
- "md5.js": {
- "version": "1.3.5",
- "bundled": true,
- "requires": {
- "hash-base": "^3.0.0",
- "inherits": "^2.0.1",
- "safe-buffer": "^5.1.2"
- }
- },
- "miller-rabin": {
- "version": "4.0.1",
- "bundled": true,
- "requires": {
- "bn.js": "^4.0.0",
- "brorand": "^1.0.1"
- },
- "dependencies": {
- "bn.js": {
- "version": "4.12.0",
- "bundled": true
- }
- }
- },
- "minimalistic-assert": {
- "version": "1.0.1",
- "bundled": true
- },
- "minimalistic-crypto-utils": {
- "version": "1.0.1",
- "bundled": true
- },
- "object-inspect": {
- "version": "1.10.3",
- "bundled": true
- },
- "object-is": {
- "version": "1.1.5",
- "bundled": true,
- "requires": {
- "call-bind": "^1.0.2",
- "define-properties": "^1.1.3"
- }
- },
- "object-keys": {
- "version": "1.1.1",
- "bundled": true
- },
- "object.assign": {
- "version": "4.1.2",
- "bundled": true,
- "requires": {
- "call-bind": "^1.0.0",
- "define-properties": "^1.1.3",
- "has-symbols": "^1.0.1",
- "object-keys": "^1.1.1"
- }
- },
- "os-browserify": {
- "version": "0.3.0",
- "bundled": true
- },
- "pako": {
- "version": "1.0.11",
- "bundled": true
- },
- "parse-asn1": {
- "version": "5.1.6",
- "bundled": true,
- "requires": {
- "asn1.js": "^5.2.0",
- "browserify-aes": "^1.0.0",
- "evp_bytestokey": "^1.0.0",
- "pbkdf2": "^3.0.3",
- "safe-buffer": "^5.1.1"
- }
- },
- "path-browserify": {
- "version": "1.0.1",
- "bundled": true
- },
- "pbkdf2": {
- "version": "3.1.2",
- "bundled": true,
- "requires": {
- "create-hash": "^1.1.2",
- "create-hmac": "^1.1.4",
- "ripemd160": "^2.0.1",
- "safe-buffer": "^5.0.1",
- "sha.js": "^2.4.8"
- }
- },
- "process": {
- "version": "0.11.10",
- "bundled": true
- },
- "public-encrypt": {
- "version": "4.0.3",
- "bundled": true,
- "requires": {
- "bn.js": "^4.1.0",
- "browserify-rsa": "^4.0.0",
- "create-hash": "^1.1.0",
- "parse-asn1": "^5.0.0",
- "randombytes": "^2.0.1",
- "safe-buffer": "^5.1.2"
- },
- "dependencies": {
- "bn.js": {
- "version": "4.12.0",
- "bundled": true
- }
- }
- },
- "punycode": {
- "version": "1.4.1",
- "bundled": true
- },
- "querystring": {
- "version": "0.2.0",
- "bundled": true
- },
- "querystring-es3": {
- "version": "0.2.1",
- "bundled": true
- },
- "randombytes": {
- "version": "2.1.0",
- "bundled": true,
- "requires": {
- "safe-buffer": "^5.1.0"
- }
- },
- "randomfill": {
- "version": "1.0.4",
- "bundled": true,
- "requires": {
- "randombytes": "^2.0.5",
- "safe-buffer": "^5.1.0"
- }
- },
- "readable-stream": {
- "version": "3.6.0",
- "bundled": true,
- "requires": {
- "inherits": "^2.0.3",
- "string_decoder": "^1.1.1",
- "util-deprecate": "^1.0.1"
- }
- },
- "ripemd160": {
- "version": "2.0.2",
- "bundled": true,
- "requires": {
- "hash-base": "^3.0.0",
- "inherits": "^2.0.1"
- }
- },
- "safe-buffer": {
- "version": "5.2.1",
- "bundled": true
- },
- "safer-buffer": {
- "version": "2.1.2",
- "bundled": true
- },
- "setimmediate": {
- "version": "1.0.5",
- "bundled": true
- },
- "sha.js": {
- "version": "2.4.11",
- "bundled": true,
- "requires": {
- "inherits": "^2.0.1",
- "safe-buffer": "^5.0.1"
- }
- },
- "stream-browserify": {
- "version": "3.0.0",
- "bundled": true,
- "requires": {
- "inherits": "~2.0.4",
- "readable-stream": "^3.5.0"
- }
- },
- "stream-http": {
- "version": "3.2.0",
- "bundled": true,
- "requires": {
- "builtin-status-codes": "^3.0.0",
- "inherits": "^2.0.4",
- "readable-stream": "^3.6.0",
- "xtend": "^4.0.2"
- }
- },
- "string.prototype.trimend": {
- "version": "1.0.4",
- "bundled": true,
- "requires": {
- "call-bind": "^1.0.2",
- "define-properties": "^1.1.3"
- }
- },
- "string.prototype.trimstart": {
- "version": "1.0.4",
- "bundled": true,
- "requires": {
- "call-bind": "^1.0.2",
- "define-properties": "^1.1.3"
- }
- },
- "string_decoder": {
- "version": "1.3.0",
- "bundled": true,
- "requires": {
- "safe-buffer": "~5.2.0"
- }
- },
- "timers-browserify": {
- "version": "2.0.12",
- "bundled": true,
- "requires": {
- "setimmediate": "^1.0.4"
- }
- },
- "tty-browserify": {
- "version": "0.0.1",
- "bundled": true
- },
- "unbox-primitive": {
- "version": "1.0.1",
- "bundled": true,
- "requires": {
- "function-bind": "^1.1.1",
- "has-bigints": "^1.0.1",
- "has-symbols": "^1.0.2",
- "which-boxed-primitive": "^1.0.2"
- }
- },
- "url": {
- "version": "0.11.0",
- "bundled": true,
- "requires": {
- "punycode": "1.3.2",
- "querystring": "0.2.0"
- },
- "dependencies": {
- "punycode": {
- "version": "1.3.2",
- "bundled": true
- }
- }
- },
- "util": {
- "version": "0.12.4",
- "bundled": true,
- "requires": {
- "inherits": "^2.0.3",
- "is-arguments": "^1.0.4",
- "is-generator-function": "^1.0.7",
- "is-typed-array": "^1.1.3",
- "safe-buffer": "^5.1.2",
- "which-typed-array": "^1.1.2"
- }
- },
- "util-deprecate": {
- "version": "1.0.2",
- "bundled": true
- },
- "vm-browserify": {
- "version": "1.1.2",
- "bundled": true
- },
- "which-boxed-primitive": {
- "version": "1.0.2",
- "bundled": true,
- "requires": {
- "is-bigint": "^1.0.1",
- "is-boolean-object": "^1.1.0",
- "is-number-object": "^1.0.4",
- "is-string": "^1.0.5",
- "is-symbol": "^1.0.3"
- }
- },
- "which-typed-array": {
- "version": "1.1.4",
- "bundled": true,
- "requires": {
- "available-typed-arrays": "^1.0.2",
- "call-bind": "^1.0.0",
- "es-abstract": "^1.18.0-next.1",
- "foreach": "^2.0.5",
- "function-bind": "^1.1.1",
- "has-symbols": "^1.0.1",
- "is-typed-array": "^1.1.3"
- }
- },
- "xtend": {
- "version": "4.0.2",
- "bundled": true
- }
}
},
- "moment": {
+ "node_modules/meteor-node-stubs/node_modules/asn1.js": {
+ "version": "5.4.1",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "bn.js": "^4.0.0",
+ "inherits": "^2.0.1",
+ "minimalistic-assert": "^1.0.0",
+ "safer-buffer": "^2.1.0"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/asn1.js/node_modules/bn.js": {
+ "version": "4.12.0",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/assert": {
+ "version": "2.0.0",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "es6-object-assign": "^1.1.0",
+ "is-nan": "^1.2.1",
+ "object-is": "^1.0.1",
+ "util": "^0.12.0"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/available-typed-arrays": {
+ "version": "1.0.4",
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/base64-js": {
+ "version": "1.5.1",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/bn.js": {
+ "version": "5.2.0",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/brorand": {
+ "version": "1.1.0",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/browserify-aes": {
+ "version": "1.2.0",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "buffer-xor": "^1.0.3",
+ "cipher-base": "^1.0.0",
+ "create-hash": "^1.1.0",
+ "evp_bytestokey": "^1.0.3",
+ "inherits": "^2.0.1",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/browserify-cipher": {
+ "version": "1.0.1",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "browserify-aes": "^1.0.4",
+ "browserify-des": "^1.0.0",
+ "evp_bytestokey": "^1.0.0"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/browserify-des": {
+ "version": "1.0.2",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "cipher-base": "^1.0.1",
+ "des.js": "^1.0.0",
+ "inherits": "^2.0.1",
+ "safe-buffer": "^5.1.2"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/browserify-rsa": {
+ "version": "4.1.0",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "bn.js": "^5.0.0",
+ "randombytes": "^2.0.1"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/browserify-sign": {
+ "version": "4.2.1",
+ "inBundle": true,
+ "license": "ISC",
+ "dependencies": {
+ "bn.js": "^5.1.1",
+ "browserify-rsa": "^4.0.1",
+ "create-hash": "^1.2.0",
+ "create-hmac": "^1.1.7",
+ "elliptic": "^6.5.3",
+ "inherits": "^2.0.4",
+ "parse-asn1": "^5.1.5",
+ "readable-stream": "^3.6.0",
+ "safe-buffer": "^5.2.0"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/browserify-zlib": {
+ "version": "0.2.0",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "pako": "~1.0.5"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/buffer": {
+ "version": "5.7.1",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "base64-js": "^1.3.1",
+ "ieee754": "^1.1.13"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/buffer-xor": {
+ "version": "1.0.3",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/builtin-status-codes": {
+ "version": "3.0.0",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/call-bind": {
+ "version": "1.0.2",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "function-bind": "^1.1.1",
+ "get-intrinsic": "^1.0.2"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/cipher-base": {
+ "version": "1.0.4",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "inherits": "^2.0.1",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/console-browserify": {
+ "version": "1.2.0",
+ "inBundle": true
+ },
+ "node_modules/meteor-node-stubs/node_modules/constants-browserify": {
+ "version": "1.0.0",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/create-ecdh": {
+ "version": "4.0.4",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "bn.js": "^4.1.0",
+ "elliptic": "^6.5.3"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/create-ecdh/node_modules/bn.js": {
+ "version": "4.12.0",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/create-hash": {
+ "version": "1.2.0",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "cipher-base": "^1.0.1",
+ "inherits": "^2.0.1",
+ "md5.js": "^1.3.4",
+ "ripemd160": "^2.0.1",
+ "sha.js": "^2.4.0"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/create-hmac": {
+ "version": "1.1.7",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "cipher-base": "^1.0.3",
+ "create-hash": "^1.1.0",
+ "inherits": "^2.0.1",
+ "ripemd160": "^2.0.0",
+ "safe-buffer": "^5.0.1",
+ "sha.js": "^2.4.8"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/crypto-browserify": {
+ "version": "3.12.0",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "browserify-cipher": "^1.0.0",
+ "browserify-sign": "^4.0.0",
+ "create-ecdh": "^4.0.0",
+ "create-hash": "^1.1.0",
+ "create-hmac": "^1.1.0",
+ "diffie-hellman": "^5.0.0",
+ "inherits": "^2.0.1",
+ "pbkdf2": "^3.0.3",
+ "public-encrypt": "^4.0.0",
+ "randombytes": "^2.0.0",
+ "randomfill": "^1.0.3"
+ },
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/define-properties": {
+ "version": "1.1.3",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "object-keys": "^1.0.12"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/des.js": {
+ "version": "1.0.1",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "inherits": "^2.0.1",
+ "minimalistic-assert": "^1.0.0"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/diffie-hellman": {
+ "version": "5.0.3",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "bn.js": "^4.1.0",
+ "miller-rabin": "^4.0.0",
+ "randombytes": "^2.0.0"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/diffie-hellman/node_modules/bn.js": {
+ "version": "4.12.0",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/domain-browser": {
+ "version": "4.22.0",
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://bevry.me/fund"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/elliptic": {
+ "version": "6.5.4",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "bn.js": "^4.11.9",
+ "brorand": "^1.1.0",
+ "hash.js": "^1.0.0",
+ "hmac-drbg": "^1.0.1",
+ "inherits": "^2.0.4",
+ "minimalistic-assert": "^1.0.1",
+ "minimalistic-crypto-utils": "^1.0.1"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/elliptic/node_modules/bn.js": {
+ "version": "4.12.0",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/es-abstract": {
+ "version": "1.18.3",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "es-to-primitive": "^1.2.1",
+ "function-bind": "^1.1.1",
+ "get-intrinsic": "^1.1.1",
+ "has": "^1.0.3",
+ "has-symbols": "^1.0.2",
+ "is-callable": "^1.2.3",
+ "is-negative-zero": "^2.0.1",
+ "is-regex": "^1.1.3",
+ "is-string": "^1.0.6",
+ "object-inspect": "^1.10.3",
+ "object-keys": "^1.1.1",
+ "object.assign": "^4.1.2",
+ "string.prototype.trimend": "^1.0.4",
+ "string.prototype.trimstart": "^1.0.4",
+ "unbox-primitive": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/es-to-primitive": {
+ "version": "1.2.1",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "is-callable": "^1.1.4",
+ "is-date-object": "^1.0.1",
+ "is-symbol": "^1.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/es6-object-assign": {
+ "version": "1.1.0",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/events": {
+ "version": "3.3.0",
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.8.x"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/evp_bytestokey": {
+ "version": "1.0.3",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "md5.js": "^1.3.4",
+ "safe-buffer": "^5.1.1"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/foreach": {
+ "version": "2.0.5",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/function-bind": {
+ "version": "1.1.1",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/get-intrinsic": {
+ "version": "1.1.1",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "function-bind": "^1.1.1",
+ "has": "^1.0.3",
+ "has-symbols": "^1.0.1"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/has": {
+ "version": "1.0.3",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "function-bind": "^1.1.1"
+ },
+ "engines": {
+ "node": ">= 0.4.0"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/has-bigints": {
+ "version": "1.0.1",
+ "inBundle": true,
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/has-symbols": {
+ "version": "1.0.2",
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/hash-base": {
+ "version": "3.1.0",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "inherits": "^2.0.4",
+ "readable-stream": "^3.6.0",
+ "safe-buffer": "^5.2.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/hash.js": {
+ "version": "1.1.7",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "inherits": "^2.0.3",
+ "minimalistic-assert": "^1.0.1"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/hmac-drbg": {
+ "version": "1.0.1",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "hash.js": "^1.0.3",
+ "minimalistic-assert": "^1.0.0",
+ "minimalistic-crypto-utils": "^1.0.1"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/https-browserify": {
+ "version": "1.0.0",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/ieee754": {
+ "version": "1.2.1",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "inBundle": true,
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/meteor-node-stubs/node_modules/inherits": {
+ "version": "2.0.4",
+ "inBundle": true,
+ "license": "ISC"
+ },
+ "node_modules/meteor-node-stubs/node_modules/is-arguments": {
+ "version": "1.1.0",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "call-bind": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/is-bigint": {
+ "version": "1.0.2",
+ "inBundle": true,
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/is-boolean-object": {
+ "version": "1.1.1",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "call-bind": "^1.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/is-callable": {
+ "version": "1.2.3",
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/is-date-object": {
+ "version": "1.0.4",
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/is-generator-function": {
+ "version": "1.0.9",
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/is-nan": {
+ "version": "1.3.2",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "call-bind": "^1.0.0",
+ "define-properties": "^1.1.3"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/is-negative-zero": {
+ "version": "2.0.1",
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/is-number-object": {
+ "version": "1.0.5",
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/is-regex": {
+ "version": "1.1.3",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "has-symbols": "^1.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/is-string": {
+ "version": "1.0.6",
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/is-symbol": {
+ "version": "1.0.4",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "has-symbols": "^1.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/is-typed-array": {
+ "version": "1.1.5",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "available-typed-arrays": "^1.0.2",
+ "call-bind": "^1.0.2",
+ "es-abstract": "^1.18.0-next.2",
+ "foreach": "^2.0.5",
+ "has-symbols": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/md5.js": {
+ "version": "1.3.5",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "hash-base": "^3.0.0",
+ "inherits": "^2.0.1",
+ "safe-buffer": "^5.1.2"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/miller-rabin": {
+ "version": "4.0.1",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "bn.js": "^4.0.0",
+ "brorand": "^1.0.1"
+ },
+ "bin": {
+ "miller-rabin": "bin/miller-rabin"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/miller-rabin/node_modules/bn.js": {
+ "version": "4.12.0",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/minimalistic-assert": {
+ "version": "1.0.1",
+ "inBundle": true,
+ "license": "ISC"
+ },
+ "node_modules/meteor-node-stubs/node_modules/minimalistic-crypto-utils": {
+ "version": "1.0.1",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/object-inspect": {
+ "version": "1.10.3",
+ "inBundle": true,
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/object-is": {
+ "version": "1.1.5",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.1.3"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/object-keys": {
+ "version": "1.1.1",
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/object.assign": {
+ "version": "4.1.2",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "call-bind": "^1.0.0",
+ "define-properties": "^1.1.3",
+ "has-symbols": "^1.0.1",
+ "object-keys": "^1.1.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/os-browserify": {
+ "version": "0.3.0",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/pako": {
+ "version": "1.0.11",
+ "inBundle": true,
+ "license": "(MIT AND Zlib)"
+ },
+ "node_modules/meteor-node-stubs/node_modules/parse-asn1": {
+ "version": "5.1.6",
+ "inBundle": true,
+ "license": "ISC",
+ "dependencies": {
+ "asn1.js": "^5.2.0",
+ "browserify-aes": "^1.0.0",
+ "evp_bytestokey": "^1.0.0",
+ "pbkdf2": "^3.0.3",
+ "safe-buffer": "^5.1.1"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/path-browserify": {
+ "version": "1.0.1",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/pbkdf2": {
+ "version": "3.1.2",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "create-hash": "^1.1.2",
+ "create-hmac": "^1.1.4",
+ "ripemd160": "^2.0.1",
+ "safe-buffer": "^5.0.1",
+ "sha.js": "^2.4.8"
+ },
+ "engines": {
+ "node": ">=0.12"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/process": {
+ "version": "0.11.10",
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6.0"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/public-encrypt": {
+ "version": "4.0.3",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "bn.js": "^4.1.0",
+ "browserify-rsa": "^4.0.0",
+ "create-hash": "^1.1.0",
+ "parse-asn1": "^5.0.0",
+ "randombytes": "^2.0.1",
+ "safe-buffer": "^5.1.2"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/public-encrypt/node_modules/bn.js": {
+ "version": "4.12.0",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/punycode": {
+ "version": "1.4.1",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/querystring": {
+ "version": "0.2.0",
+ "inBundle": true,
+ "engines": {
+ "node": ">=0.4.x"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/querystring-es3": {
+ "version": "0.2.1",
+ "inBundle": true,
+ "engines": {
+ "node": ">=0.4.x"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/randombytes": {
+ "version": "2.1.0",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "safe-buffer": "^5.1.0"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/randomfill": {
+ "version": "1.0.4",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "randombytes": "^2.0.5",
+ "safe-buffer": "^5.1.0"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/readable-stream": {
+ "version": "3.6.0",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "inherits": "^2.0.3",
+ "string_decoder": "^1.1.1",
+ "util-deprecate": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/ripemd160": {
+ "version": "2.0.2",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "hash-base": "^3.0.0",
+ "inherits": "^2.0.1"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/safe-buffer": {
+ "version": "5.2.1",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/safer-buffer": {
+ "version": "2.1.2",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/setimmediate": {
+ "version": "1.0.5",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/sha.js": {
+ "version": "2.4.11",
+ "inBundle": true,
+ "license": "(MIT AND BSD-3-Clause)",
+ "dependencies": {
+ "inherits": "^2.0.1",
+ "safe-buffer": "^5.0.1"
+ },
+ "bin": {
+ "sha.js": "bin.js"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/stream-browserify": {
+ "version": "3.0.0",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "inherits": "~2.0.4",
+ "readable-stream": "^3.5.0"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/stream-http": {
+ "version": "3.2.0",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "builtin-status-codes": "^3.0.0",
+ "inherits": "^2.0.4",
+ "readable-stream": "^3.6.0",
+ "xtend": "^4.0.2"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/string_decoder": {
+ "version": "1.3.0",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "safe-buffer": "~5.2.0"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/string.prototype.trimend": {
+ "version": "1.0.4",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.1.3"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/string.prototype.trimstart": {
+ "version": "1.0.4",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "define-properties": "^1.1.3"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/timers-browserify": {
+ "version": "2.0.12",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "setimmediate": "^1.0.4"
+ },
+ "engines": {
+ "node": ">=0.6.0"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/tty-browserify": {
+ "version": "0.0.1",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/unbox-primitive": {
+ "version": "1.0.1",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "function-bind": "^1.1.1",
+ "has-bigints": "^1.0.1",
+ "has-symbols": "^1.0.2",
+ "which-boxed-primitive": "^1.0.2"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/url": {
+ "version": "0.11.0",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "punycode": "1.3.2",
+ "querystring": "0.2.0"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/url/node_modules/punycode": {
+ "version": "1.3.2",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/util": {
+ "version": "0.12.4",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "inherits": "^2.0.3",
+ "is-arguments": "^1.0.4",
+ "is-generator-function": "^1.0.7",
+ "is-typed-array": "^1.1.3",
+ "safe-buffer": "^5.1.2",
+ "which-typed-array": "^1.1.2"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/util-deprecate": {
+ "version": "1.0.2",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/vm-browserify": {
+ "version": "1.1.2",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/meteor-node-stubs/node_modules/which-boxed-primitive": {
+ "version": "1.0.2",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "is-bigint": "^1.0.1",
+ "is-boolean-object": "^1.1.0",
+ "is-number-object": "^1.0.4",
+ "is-string": "^1.0.5",
+ "is-symbol": "^1.0.3"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/which-typed-array": {
+ "version": "1.1.4",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "available-typed-arrays": "^1.0.2",
+ "call-bind": "^1.0.0",
+ "es-abstract": "^1.18.0-next.1",
+ "foreach": "^2.0.5",
+ "function-bind": "^1.1.1",
+ "has-symbols": "^1.0.1",
+ "is-typed-array": "^1.1.3"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/meteor-node-stubs/node_modules/xtend": {
+ "version": "4.0.2",
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.4"
+ }
+ },
+ "node_modules/moment": {
"version": "2.29.4",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
- "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w=="
+ "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==",
+ "engines": {
+ "node": "*"
+ }
},
- "mri": {
+ "node_modules/mri": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz",
- "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA=="
+ "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==",
+ "engines": {
+ "node": ">=4"
+ }
},
- "node-cron": {
+ "node_modules/node-cron": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/node-cron/-/node-cron-3.0.3.tgz",
"integrity": "sha512-dOal67//nohNgYWb+nWmg5dkFdIwDm8EpeGYMekPMrngV3637lqnX0lbUcCtgibHTz6SEz7DAIjKvKDFYCnO1A==",
- "requires": {
+ "dependencies": {
"uuid": "8.3.2"
+ },
+ "engines": {
+ "node": ">=6.0.0"
}
},
- "node-fetch": {
+ "node_modules/node-fetch": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
"integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
- "requires": {
+ "dependencies": {
"whatwg-url": "^5.0.0"
+ },
+ "engines": {
+ "node": "4.x || >=6.0.0"
+ },
+ "peerDependencies": {
+ "encoding": "^0.1.0"
+ },
+ "peerDependenciesMeta": {
+ "encoding": {
+ "optional": true
+ }
}
},
- "process-nextick-args": {
+ "node_modules/process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
},
- "readable-stream": {
+ "node_modules/readable-stream": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
"integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
- "requires": {
+ "dependencies": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
@@ -899,68 +1301,75 @@
"util-deprecate": "~1.0.1"
}
},
- "regenerator-runtime": {
+ "node_modules/regenerator-runtime": {
"version": "0.13.9",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
"integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA=="
},
- "rss-url-parser": {
+ "node_modules/rss-url-parser": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/rss-url-parser/-/rss-url-parser-3.0.0.tgz",
"integrity": "sha512-x39bDQDe1BwpiVwPrjg52ILbTMZc5h7oDPE7FRLa/sgYar7BrNRBTU/msxgokacPZN1rawXmK1rtBU5N7Gsn4A==",
- "requires": {
+ "dependencies": {
"feedparser": "^2.2.10",
"node-fetch": "^2.6.7"
+ },
+ "engines": {
+ "node": "^16 || ^18 || ^20",
+ "npm": "9.x.x"
}
},
- "safe-buffer": {
+ "node_modules/safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
- "sax": {
+ "node_modules/sax": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz",
"integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg=="
},
- "string_decoder": {
+ "node_modules/string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
- "requires": {
+ "dependencies": {
"safe-buffer": "~5.1.0"
}
},
- "tr46": {
+ "node_modules/tr46": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
},
- "typeahead-standalone": {
+ "node_modules/typeahead-standalone": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/typeahead-standalone/-/typeahead-standalone-5.2.0.tgz",
"integrity": "sha512-9GTbCO7XhwimgolmxzuPklftoIa2NEGXBI30n9f5kQZOptvTeJ9ublhNYy4W00RN1D5gSHM5n4dI5vOojr51hg=="
},
- "util-deprecate": {
+ "node_modules/util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
},
- "uuid": {
+ "node_modules/uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
- "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
+ "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
+ "bin": {
+ "uuid": "dist/bin/uuid"
+ }
},
- "webidl-conversions": {
+ "node_modules/webidl-conversions": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
},
- "whatwg-url": {
+ "node_modules/whatwg-url": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
- "requires": {
+ "dependencies": {
"tr46": "~0.0.3",
"webidl-conversions": "^3.0.0"
}
diff --git a/package.json b/package.json
index 4801b6a..1e134b9 100644
--- a/package.json
+++ b/package.json
@@ -1,5 +1,5 @@
{
- "name": "pPickup",
+ "name": "get-my",
"private": true,
"scripts": {
"start": "meteor run",
diff --git a/server/main.js b/server/main.js
index 4af2669..05920f8 100644
--- a/server/main.js
+++ b/server/main.js
@@ -1,3 +1,5 @@
+// this file has been converted for meteor 3 and later
+
import { Meteor } from 'meteor/meteor';
import { SysConfig } from '../imports/api/systemConfig';
import { MenuItems } from '../imports/api/menuItems';
@@ -5,142 +7,178 @@ import { Products } from '../imports/api/products.js';
import { Menus } from '../imports/api/menu.js';
import { MScripts } from '../imports/api/mScripts.js';
import { UpdateInfo } from '../imports/api/updateInfo.js';
+import { Roles } from 'meteor/roles';
-Meteor.startup(() => {
+Meteor.startup(async() => {
// code to run on server at startup
- Roles.createRole("user", {unlessExists: true});
- Roles.createRole("admin", {unlessExists: true});
- Roles.createRole("systemadmin", {unlessExists: true});
+ Roles.createRoleAsync("user", {unlessExists: true});
+ Roles.createRoleAsync("admin", {unlessExists: true});
+ Roles.createRoleAsync("systemadmin", {unlessExists: true});
// set the systemconfig defaults for registration
// check if this has already been run
- let regPolRun = MScripts.findOne({ scriptName: "DefaultRegPolicy", scriptRun: true });
- if (typeof regPolRun == "undefined" || regPolRun == null || regPolRun == "") {
- let regPolicy = SysConfig.findOne({});
- if (typeof regPolicy == 'undefined') {
- return SysConfig.insert({
- SysAdminReg: false,
- dateAdded: new Date(),
- allowReg: true,
- allowUpdates: true,
- });
- } else {
- // console.log("Registration policy already set.");
- markScriptRun("DefaultRegPolicy");
- }
+ let regPolRun = await MScripts.findOneAsync({ scriptName: "DefaultRegPolicy", scriptRun: true });
+ if (!regPolRun) {
+ try {
+ let regPolicy = await SysConfig.findOneAsync({});
+ if (!regPolicy) {
+ SysConfig.insertAsync({
+ SysAdminReg: false,
+ dateAdded: new Date(),
+ allowReg: true,
+ allowUpdates: true,
+ });
+ markScriptRun("DefaultRegPolicy");
+ } else {
+ // console.log("Registration policy already set.");
+ markScriptRun("DefaultRegPolicy");
+ }
+ } catch(error) {
+ console.log(" ERROR trying to check if registration policy was set.");
+ console.log(error.message);
+ console.log(error.stack);
+ }
}
-
-
+
// check if the isLInked item exists on menuitems, and if not, add it (data cleanup task)
// see if already updated
- let linkUpdateRun = MScripts.findOne({ scriptName: "updateMenuItemLinks", scriptRun: true });
- if (typeof linkUpdateRun == 'undefined' || linkUpdateRun == null || linkUpdateRun == "") {
- let itemInfoNoLink = MenuItems.find({ isLinked: { $exists: false } }).fetch();
- // console.log("No Ites with isLinked not set: " + itemInfoNoLink.length);
- if (itemInfoNoLink.length > 0) {
- // console.log("found items with isLinked not set.");
- // console.dir(itemInfoNoLink);
- let infoLength = itemInfoNoLink.length;
- for (i=0; i < infoLength; i++) {
- MenuItems.update({ _id: itemInfoNoLink[i]._id }, {
- $set: {
- isLinked: false,
+ let linkUpdateRun = await MScripts.findOneAsync({ scriptName: "updateMenuItemLinks", scriptRun: true });
+ try {
+ if (!linkUpdateRun) {
+ let itemInfoNoLink = MenuItems.find({ isLinked: { $exists: false } }).fetch();
+ // console.log("No Ites with isLinked not set: " + itemInfoNoLink.length);
+ if (itemInfoNoLink.length > 0) {
+ // console.log("Found items with isLinked not set. Updating...");
+ // console.dir(itemInfoNoLink);
+ let infoLength = itemInfoNoLink.length;
+ for (i=0; i < infoLength; i++) {
+ MenuItems.updateAsync({ _id: itemInfoNoLink[i]._id }, {
+ $set: {
+ isLinked: false,
+ }
+ });
+ if (i == (infoLength -1)) {
+ markScriptRun("updateMenuItemLinks");
}
- });
- if (i == (infoLength -1)) {
- markScriptRun("updateMenuItemLinks");
}
+ } else {
+ // this will show if all items are found to have isLInked set.
+ // console.log("No items with isLinked not set.");
+ markScriptRun("updateMenuItemLinks");
}
- } else {
- // this will show if all items are found to have isLInked set.
- // console.log("No items with isLinked not set.");
- markScriptRun("updateMenuItemLinks");
}
+ } catch(error) {
+ console.log(" ERROR running check for isLinked items.");
+ console.log(error.message);
+ console.log(error.stack);
}
-
// update Products to be able to have multiple stores in the document
// check if update already run
- let prodStoreArrayRun = MScripts.findOne({ scriptName: "changeProdStoreToArray", scriptRun: true });
+ let prodStoreArrayRun = await MScripts.findOneAsync({ scriptName: "changeProdStoreToArray", scriptRun: true });
if (!prodStoreArrayRun) {
- let prodInfo = Products.find({}).fetch();
- let prodCount = prodInfo.length;
- console.log("Updating Products to allow multiple store assocation for " + prodCount + " products.");
- for (j = 0; j < prodCount; j++) {
- if (typeof prodInfo[j].prodStore == 'object') {
- // console.log(typeof prodInfo[j].prodStore);
- // console.log("Is Array already");
- } else {
- let prodStoreArray = [];
- // console.log("---- ---- ----");
- // console.log(typeof prodInfo[j].prodStore);
- // console.log("---- Is Not Array.");
- let prodStore = prodInfo[j].prodStore;
+ try {
+ let prodInfo = Products.find({}).fetch();
+ let prodCount = prodInfo.length;
+ // console.log("Updating Products to allow multiple store assocation for " + prodCount + " products.");
+ for (let j = 0; j < prodCount; j++) {
+ if (typeof prodInfo[j].prodStore == 'object') {
+ // console.log(typeof prodInfo[j].prodStore);
+ // console.log("Is Array already");
+ } else {
+ let prodStoreArray = [];
+ // console.log("---- ---- ----");
+ // console.log(typeof prodInfo[j].prodStore);
+ // console.log("---- Is Not Array.");
+ let prodStore = prodInfo[j].prodStore;
- prodStoreArray.push(prodStore);
- // console.dir(prodStoreArray);
- Products.update({ _id: prodInfo[j]._id }, {
- $set: {
- prodStore: prodStoreArray,
- }
- });
+ prodStoreArray.push(prodStore);
+ // console.dir(prodStoreArray);
+ Products.update({ _id: prodInfo[j]._id }, {
+ $set: {
+ prodStore: prodStoreArray,
+ }
+ });
+ }
+ if (j == (prodCount -1)) {
+ markScriptRun("changeProdStoreToArray");
+ }
}
- if (j == (prodCount -1)) {
- markScriptRun("changeProdStoreToArray");
- }
- }
+ } catch(error) {
+ console.log("Script to update product stores couldn't run.");
+ console.log(error.message);
+ console.log(error.stack);
+ }
}
// update menu items to new format so they get the linked products
// check if this update has run
- let menuItemUpdRun = MScripts.findOne({ scriptName: "updateMenuProdLinks", scriptRun: true });
+ let menuItemUpdRun = await MScripts.findOneAsync({ scriptName: "updateMenuProdLinks", scriptRun: true });
if (!menuItemUpdRun) {
- let openMenus = Menus.find({ menuComplete: false }).fetch();
- let openMenuCount = openMenus.length;
- // console.log("Open Menu count is: " + openMenuCount);
- for (k = 0; k < openMenuCount; k++) {
- if (typeof openMenus.menuItems == 'object') {
- // console.log(openMenus.menuName + " appears to be converted.");
- markScriptRun("updateMenuProdLinks");
- } else {
- let menuId = openMenus[k]._id;
+ try {
+ let openMenus = Menus.find({ menuComplete: false }).fetch();
+ let openMenuCount = openMenus.length;
+ // console.log("Open Menu count is: " + openMenuCount);
+ for (let k = 0; k < openMenuCount; k++) {
+ if (typeof openMenus.menuItems == 'object') {
+ // console.log(openMenus.menuName + " appears to be converted.");
+ markScriptRun("updateMenuProdLinks");
+ } else {
+ let menuId = openMenus[k]._id;
- let thisMenuItems = MenuItems.find({ menuId: menuId }).fetch();
+ let thisMenuItems = MenuItems.find({ menuId: menuId }).fetch();
- let itemCount = thisMenuItems.length;
+ let itemCount = thisMenuItems.length;
- for (l = 0; l < itemCount; l++) {
- Menus.update({ _id: menuId }, {
- $addToSet: {
- menuItems:
- {
- menuItemId: thisMenuItems[l]._id,
- menuItemName: thisMenuItems[l].itemName,
- serveDate: thisMenuItems[l].serveDate,
- serveDateActual: thisMenuItems[l].serveDateActual,
- isLinked: thisMenuItems[l].isLinked
- },
- }
- });
+ for (l = 0; l < itemCount; l++) {
+ Menus.update({ _id: menuId }, {
+ $addToSet: {
+ menuItems:
+ {
+ menuItemId: thisMenuItems[l]._id,
+ menuItemName: thisMenuItems[l].itemName,
+ serveDate: thisMenuItems[l].serveDate,
+ serveDateActual: thisMenuItems[l].serveDateActual,
+ isLinked: thisMenuItems[l].isLinked
+ },
+ }
+ });
+ }
+ }
+ if (k == (openMenuCount - 1)) {
+ markScriptRun("updateMenuProdLinks");
}
}
- if (k == (openMenuCount - 1)) {
- markScriptRun("updateMenuProdLinks");
- }
- }
+ } catch(error) {
+ console.log(" ERROR updating the menu product links: ");
+ console.log(error.message);
+ console.log(error.stack);
+ }
+ } else {
+ // console.log("Menu Item updates have already been run.");
}
// get update available information if enabled in system confiuration
- let currConfig = SysConfig.findOne({});
- let feedurl = "https://gitlab.com/bmcgonag/get_my/-/releases.atom"
- if (currConfig.allowUpdates == true) {
- // console.log("Allow Updates is true");
- startCronForUpdates(feedurl);
- } else if (typeof currConfig.allowUpdates == 'undefined' || currConfig.allowUpdates == null) {
- SysConfig.update({ _id: currConfig._id }, { $set: {
- allowUpdates: true,
- }});
- startCronForUpdates(feedurl);
+ let currConfig = await SysConfig.findOneAsync({});
+ if (!currConfig) {
+ // console.log("No Current Config found.")
+ } else {
+ try {
+ let feedurl = "https://gitlab.com/bmcgonag/get_my/-/releases.atom"
+ if (currConfig.allowUpdates == true) {
+ // console.log("Allow Updates is true");
+ startCronForUpdates(feedurl);
+ } else if (typeof currConfig.allowUpdates == 'undefined' || currConfig.allowUpdates == null) {
+ SysConfig.update({ _id: currConfig._id }, { $set: {
+ allowUpdates: true,
+ }});
+ startCronForUpdates(feedurl);
+ }
+ } catch(error) {
+ console.log(" ERROR checking current config for updates: " + error);
+ console.log(error.message);
+ console.log(error.stack);
+ }
}
});
@@ -152,18 +190,23 @@ var startCronForUpdates = function(feedurl) {
});
}
-var markScriptRun = function(scriptName) {
+var markScriptRun = async function(scriptName) {
// check if this is already set
- let scriptRun = MScripts.findOne({ scriptName: scriptName });
-
- if (scriptRun) {
- console.log(scriptName + " already set as run on " + scriptRun.runOn);
+ let scriptRun = await MScripts.findOneAsync({ scriptName: scriptName });
+ if (!scriptRun) {
+ try {
+ return MScripts.insertAsync({
+ scriptName: scriptName,
+ scriptRun: true,
+ runOn: new Date()
+ });
+ } catch(error) {
+ console.log(" ERROR inserting the script run log: " + error);
+ console.log(error.message);
+ console.log(error.stack);
+ }
} else {
- MScripts.insert({
- scriptName: scriptName,
- scriptRun: true,
- runOn: new Date()
- });
+ // console.log(scriptName + " already set as run on " + scriptRun.runOn);
}
}
@@ -175,16 +218,22 @@ var getUpdateInfoNow = async function(feedurl) {
// console.dir(data[0].title);
// check if this title already exists in db
- let updatesExist = UpdateInfo.findOne({ title: data[0].title });
- if (!updatesExist) {
- UpdateInfo.insert({
- title: data[0].title,
- description: data[0].description,
- dateRelease: data[0].date,
- releaseLink: data[0].link,
- viewed: false
- });
- } else {
- console.log("No new updates available at this time.");
+ let updatesExist = await UpdateInfo.findOneAsync({ title: data[0].title });
+ try {
+ if (!updatesExist) {
+ UpdateInfo.insertAsync({
+ title: data[0].title,
+ description: data[0].description,
+ dateRelease: data[0].date,
+ releaseLink: data[0].link,
+ viewed: false
+ });
+ } else {
+ console.log("No new updates available at this time.");
+ }
+ } catch(error) {
+ console.log(" ERROR checking for update: " + error);
+ console.log(error.message);
+ console.log(error.stack);
}
}
diff --git a/server/methods.js b/server/methods.js
index 1d6e9a5..742a93e 100644
--- a/server/methods.js
+++ b/server/methods.js
@@ -3,52 +3,60 @@ import { Mongo } from 'meteor/mongo';
import { check } from 'meteor/check';
import { TaskItems } from '../imports/api/tasks';
import { SysConfig } from '../imports/api/systemConfig';
+import { Roles } from 'meteor/roles';
Meteor.methods({
'addToRole' (role) {
- let countOfUsers = Meteor.users.find().count();
-
- // if users = 1 - set to role passed in function call
- if (countOfUsers > 1) {
- console.log("User id for role: " + Meteor.userId() );
- let userId = Meteor.userId();
- Roles.addUsersToRoles(userId, role);
- Meteor.call('add.darkModePref', "light", function(err, result) {
- if (err) {
- console.log(" ERROR: can't set user dark mode preference: " + err);
+ const getUserInfo = async() => {
+ try {
+ let countOfUsers = await Meteor.users.find().countAsync();
+ const user = await Meteor.userAsync();
+ if (user) {
+ let userId = user._id;
+ if (countOfUsers > 1) {
+ Roles.addUsersToRolesAsync(userId, role);
+ const result = await Meteor.callAsync('add.darkModePref', "light");
+ if (!result) {
+ console.log(" ERROR: can't set user dark mode preference: " + err);
+ } else {
+ // console.log(" SUCCESSFULLY set user dark mode preference.");
+ }
+ } else if (countOfUsers == 1) {
+ Roles.addUsersToRolesAsync(userId, "systemadmin");
+ const result = await Meteor.callAsync('add.darkModePref', "light");
+ if (!result) {
+ console.log(" ERROR: can't set user dark mode preference: " + err);
+ } else {
+ console.log(" SUCCESSFULLY set user dark mode preference.");
+ }
+ } else {
+ console.log("The count of users didn't seem to work when adding a new user.");
+ }
} else {
- // console.log(" SUCCESSFULLY set user dark mode preference.");
+ console.log(" ---- No user info found.")
}
- });
- } else if (countOfUsers == 1) {
- console.log("Creating first system admin user: " + Meteor.userId() );
- let userId = Meteor.userId();
- Roles.addUsersToRoles(userId, "systemadmin");
- Meteor.call('add.darkModePref', "light", function(err, result) {
- if (err) {
- console.log(" ERROR: can't set user dark mode preference: " + err);
- } else {
- // console.log(" SUCCESSFULLY set user dark mode preference.");
- }
- });
+ } catch(error) {
+ console.log(" ERROR getting user info on server: " + error);
+ }
}
+ getUserInfo();
},
'edit.userPass' (userId, newPassword) {
check(userId, String);
check(newPassword, String);
- return Accounts.setPassword(userId, newPassword);
+ return Accounts.setPasswordAsync(userId, newPassword);
},
'delete.userFromSys' (userId) {
check(userId, String);
- return Meteor.users.remove({ _id: userId });
+ return Meteor.users.removeAsync({ _id: userId });
},
'update.userEmail' (userId, email) {
check(userId, String);
check(email, String);
- return Meteor.users.update({ _id: userId }, {
+ return Meteor.users.updateAsync({ _id: userId }, {
$set: {
'emails.0.address': email,
}
@@ -58,6 +66,6 @@ Meteor.methods({
check(userId, String);
check(role, String);
- return Roles.setUserRoles(userId, role);
+ return Roles.setUserRolesAsync(userId, role);
},
});
diff --git a/server/publish.js b/server/publish.js
index 124eb64..c0f8072 100644
--- a/server/publish.js
+++ b/server/publish.js
@@ -13,6 +13,13 @@ import { MenuProdLinks } from '../imports/api/menuProdLinks.js';
import { UserLast } from '../imports/api/userLast.js';
import { UpdateInfo } from '../imports/api/updateInfo.js';
+Meteor.publish(null, function () {
+ if (this.userId) {
+ return Meteor.roleAssignment.find({ "user._id": this.userId });
+ }
+ this.ready();
+});
+
Meteor.publish("SystemConfig", function() {
try {
return SysConfig.find({});