Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
load: function () {
var _load = _asyncToGenerator(
/*#__PURE__*/
_regeneratorRuntime.mark(function _callee(_ref) {
var commit, dispatch, rootGetters;
return _regeneratorRuntime.wrap(function (_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
commit = _ref.commit, dispatch = _ref.dispatch, rootGetters = _ref.rootGetters;
_context.next = 3;
return dispatch('apollo/query', {
query: currencyGetGql
}, {
root: true
});
case 3:
if (!rootGetters['vuefront/error']) {
commit('setCurrency', rootGetters['apollo/get'].currency);
function _createSocketEventEmitter() {
_createSocketEventEmitter = _asyncToGenerator(
/*#__PURE__*/
_regeneratorRuntime.mark(function _callee11(channelName, readerUuid, paths) {
var pathToSocket, emitter, server;
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
while (1) {
switch (_context11.prev = _context11.next) {
case 0:
pathToSocket = socketPath(channelName, readerUuid, paths);
emitter = new events.EventEmitter();
server = net.createServer(function (stream) {
stream.on('end', function () {});
stream.on('data', function (msg) {
emitter.emit('data', msg.toString());
});
});
_context11.next = 5;
return new Promise(function (resolve, reject) {
server.on('error',
logout: function () {
var _logout = _asyncToGenerator(
/*#__PURE__*/
_regeneratorRuntime.mark(function _callee2(_ref2) {
var commit, dispatch, rootGetters;
return _regeneratorRuntime.wrap(function (_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
commit = _ref2.commit, dispatch = _ref2.dispatch, rootGetters = _ref2.rootGetters;
_context2.next = 3;
return dispatch('apollo/mutate', {
mutation: LogoutGql
}, {
root: true
});
case 3:
if (!rootGetters['vuefront/error']) {
commit('setCustomer', {});
function _setLastPushSequence() {
_setLastPushSequence = _asyncToGenerator(
/*#__PURE__*/
_regeneratorRuntime.mark(function _callee2(collection, endpointHash, seq) {
var _id, doc, res;
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
_id = pushSequenceId(endpointHash);
_context2.next = 3;
return getDocFromPouchOrNull(collection, _id);
case 3:
doc = _context2.sent;
if (!doc) {
doc = {
_id: _id,
function () {
var _run2 = _asyncToGenerator(
/*#__PURE__*/
_regeneratorRuntime.mark(function _callee2() {
var _this2 = this;
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
if (!this.isStopped()) {
_context2.next = 2;
break;
}
return _context2.abrupt("return");
case 2:
if (!(this._runQueueCount > 2)) {
_context2.next = 4;
get: function () {
var _get = _asyncToGenerator(
/*#__PURE__*/
_regeneratorRuntime.mark(function _callee2(_ref2, _ref3) {
var commit, dispatch, rootGetters, id;
return _regeneratorRuntime.wrap(function (_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
commit = _ref2.commit, dispatch = _ref2.dispatch, rootGetters = _ref2.rootGetters;
id = _ref3.id;
_context2.next = 4;
return dispatch('apollo/query', {
query: ZoneGql,
variables: {
id: id
}
}, {
root: true
});
function _countChannelFolders() {
_countChannelFolders = _asyncToGenerator(
/*#__PURE__*/
_regeneratorRuntime.mark(function _callee7() {
var folders;
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
while (1) {
switch (_context7.prev = _context7.next) {
case 0:
_context7.next = 2;
return ensureBaseFolderExists();
case 2:
_context7.next = 4;
return readdir(TMP_FOLDER_BASE);
case 4:
folders = _context7.sent;
return _context7.abrupt("return", folders.length);
edit: function () {
var _edit = _asyncToGenerator(
/*#__PURE__*/
_regeneratorRuntime.mark(function _callee3(_ref3, customerData) {
var commit, dispatch, rootGetters;
return _regeneratorRuntime.wrap(function (_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
case 0:
commit = _ref3.commit, dispatch = _ref3.dispatch, rootGetters = _ref3.rootGetters;
_context3.next = 3;
return dispatch('apollo/mutate', {
mutation: EditGql,
variables: {
customer: customerData
}
}, {
root: true
});
function () {
var _ref6 = _asyncToGenerator(
/*#__PURE__*/
_regeneratorRuntime.mark(function _callee9(err) {
var useErr;
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
while (1) {
switch (_context9.prev = _context9.next) {
case 0:
_context9.next = 2;
return connectionError(err);
case 2:
useErr = _context9.sent;
reject(useErr);
case 4:
case "end":
return _context9.stop();
}
add: function () {
var _add = _asyncToGenerator(
/*#__PURE__*/
_regeneratorRuntime.mark(function _callee2(_ref2, _ref3) {
var commit, dispatch, rootGetters, product;
return _regeneratorRuntime.wrap(function (_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
commit = _ref2.commit, dispatch = _ref2.dispatch, rootGetters = _ref2.rootGetters;
product = _ref3.product;
_context2.next = 4;
return dispatch('apollo/mutate', {
mutation: addToCompareGraphql,
variables: {
id: Number(product.id)
}
}, {
root: true
});