';
- },
- };
- ChatAreaWidget.init();
+ }
+ };
+ ChatAreaWidget.init();
- /**
+ /**
* ChatList Widget
* @type {{init: init}}
*/
- ChatListWidget = {
- elements: {
- chats: "#chats",
- contacts: "#recents",
- listScrollWrapper: "#chats_list_scroll_wrapper",
- listScroll: "#chats_list_scroll",
- },
- init: function () {
- this.subscribe();
- this.bindUIActions()
- },
- subscribe: function () {
-
- },
- bindUIActions: function () {
- var el = ChatListWidget.elements;
-
- $(el.chats).on("click", function () {
- //@TODO: need to refactoring this sheet
- var hidden = $('#recents').is(':hidden');
-
- if (hidden) {
- $('#chats').addClass('active selected');
- $('#recents').slideDown("slow");
- $('#favorite').slideDown("slow");
- $('#family').slideDown("slow");
- $('#work').slideDown("slow");
- $('#new_chat').slideDown("slow");
-
- //$('#recents').show('slow');
- //$('#favorite').show('slow');
- //$('#family').show('slow');
- ///$('#work').show('slow');
- //$('#new_chat').show('slow');
- } else {
- $('#chats').removeClass('active selected');
- $('#recents').slideUp('slow');
- $('#favorite').slideUp('slow');
- $('#family').slideUp('slow');
- $('#work').slideUp('slow');
- $('#new_chat').slideUp('slow');
- }
- });
-
- $(el.contacts).on("click", function () {
- //@TODO: need to refactoring this sheet
- var chats_is_hidden = $('#chats_list').is(':hidden');
- $('#tool_bar').css("width", '');
- $('#chat').css("width", '');
- $('.chat_wrapper').css("padding", '');
- if (chats_is_hidden) {
- $("#logo_wrap").fadeIn(750, function () {
- $(this).addClass("lookAtMe");
- });
-
- var tool_bar_width = ((DashboardWidget.settings.vw * $('#tool_bar').width()) - DashboardWidget.settings.panels_options['chats_list']['width']) + 'vw';
- $('#tool_bar').css("width", tool_bar_width);
-
- $('#contacts_list_view, #new_contact_view, #profile_view, #videos_list, #files_list, #photos_list, #links_list, #contact_requests_view').hide();
+ ChatListWidget = {
+ elements: {
+ chats: '#chats',
+ contacts: '#recents',
+ listScrollWrapper: '#chats_list_scroll_wrapper',
+ listScroll: '#chats_list_scroll'
+ },
+ init() {
+ this.subscribe();
+ this.bindUIActions();
+ },
+ subscribe() {
+
+ },
+ bindUIActions() {
+ const el = ChatListWidget.elements;
+
+ $(el.chats).on('click', () => {
+ // @TODO: need to refactoring this sheet
+ const hidden = $('#recents').is(':hidden');
+
+ if (hidden) {
+ $('#chats').addClass('active selected');
+ $('#recents').slideDown('slow');
+ $('#favorite').slideDown('slow');
+ $('#family').slideDown('slow');
+ $('#work').slideDown('slow');
+ $('#new_chat').slideDown('slow');
+
+ // $('#recents').show('slow');
+ // $('#favorite').show('slow');
+ // $('#family').show('slow');
+ // /$('#work').show('slow');
+ // $('#new_chat').show('slow');
+ } else {
+ $('#chats').removeClass('active selected');
+ $('#recents').slideUp('slow');
+ $('#favorite').slideUp('slow');
+ $('#family').slideUp('slow');
+ $('#work').slideUp('slow');
+ $('#new_chat').slideUp('slow');
+ }
+ });
- $("#chats_list, .drag_handle_left").fadeIn(750, function () {
- $(this).addClass("lookAtMe");
- });
+ $(el.contacts).on('click', () => {
+ // @TODO: need to refactoring this sheet
+ const chats_is_hidden = $('#chats_list').is(':hidden');
+ $('#tool_bar').css('width', '');
+ $('#chat').css('width', '');
+ $('.chat_wrapper').css('padding', '');
+ if (chats_is_hidden) {
+ $('#logo_wrap').fadeIn(750, function () {
+ $(this).addClass('lookAtMe');
+ });
- var vw = (100 / $(document).width());
- var chat_width = ((DashboardWidget.settings.vw * $('#chat').width()) - DashboardWidget.settings.panels_options['chats_list']['width']) + 'vw';
- $('#chat').css("width", chat_width);
+ const tool_bar_width = `${(DashboardWidget.settings.vw * $('#tool_bar').width()) - DashboardWidget.settings.panels_options.chats_list.width}vw`;
+ $('#tool_bar').css('width', tool_bar_width);
- var panel_width = t.settings.panels_options['chats_list']['width'];
- $('#logo_wrap').css("width", panel_width + 'vw');
+ $('#contacts_list_view, #new_contact_view, #profile_view, #videos_list, #files_list, #photos_list, #links_list, #contact_requests_view').hide();
- var padding_chat_wrapper = '0vw ' + ((15 - ((panel_width) / 2)) < 0 ? 0 : (15 - ((panel_width) / 2))) + 'vw';
- $('.chat_wrapper').css("padding", padding_chat_wrapper);
+ $('#chats_list, .drag_handle_left').fadeIn(750, function () {
+ $(this).addClass('lookAtMe');
+ });
- ChatListWidget.refreshList();
- } else {
- $('#logo_wrap, #chats_list, .drag_handle_left').hide();
- }
- });
- },
- getChatList: function () {
- var current = localStorage.getItem("chatList") || [];
+ const vw = (100 / $(document).width());
+ const chat_width = `${(DashboardWidget.settings.vw * $('#chat').width()) - DashboardWidget.settings.panels_options.chats_list.width}vw`;
+ $('#chat').css('width', chat_width);
- return (current.length) ? JSON.parse(current) : [];
- },
- addToChatList: function (chat) {
- var current = ChatListWidget.getChatList(),
- exists = false
-
- //@TODO: refactor this exp
- if (Array.isArray(current)) {
- current.forEach(function (value) {
- if (value.topicId == chat.topicId) {
- exists = true;
- }
- });
-
- if (!exists) {
- current.push(chat);
- localStorage.setItem("chatList", JSON.stringify(current));
- }
- }
+ const panel_width = t.settings.panels_options.chats_list.width;
+ $('#logo_wrap').css('width', `${panel_width}vw`);
- },
- refreshList: function () {
- var el = ChatListWidget.elements,
- s = ChatListWidget.settings,
- chatList = ChatListWidget.getChatList();
-
- $(el.listScroll).html('');
-
- if (Array.isArray(chatList)) {
- $.each(chatList, function (ind, chat) {
- $(el.listScroll).append(ChatListWidget.itemView(chat));
-
- //@TODO: !!! remove handlers events in loop!!!
- $(el.listScroll + ' ' + ' .chat_' + chat.topicId).on("click", function () {
- $('.contact_chat_' + chat.topicId).click();
- });
- });
- }
- },
- itemView : function(chat) {
- var item = '';
+ const padding_chat_wrapper = `0vw ${(15 - ((panel_width) / 2)) < 0 ? 0 : (15 - ((panel_width) / 2))}vw`;
+ $('.chat_wrapper').css('padding', padding_chat_wrapper);
- item += '
\n' +
+ ChatListWidget.refreshList();
+ } else {
+ $('#logo_wrap, #chats_list, .drag_handle_left').hide();
+ }
+ });
+ },
+ getChatList() {
+ const current = localStorage.getItem('chatList') || [];
+
+ return (current.length) ? JSON.parse(current) : [];
+ },
+ addToChatList(chat) {
+ let current = ChatListWidget.getChatList(),
+ exists = false;
+
+ // @TODO: refactor this exp
+ if (Array.isArray(current)) {
+ current.forEach((value) => {
+ if (value.topicId == chat.topicId) {
+ exists = true;
+ }
+ });
+
+ if (!exists) {
+ current.push(chat);
+ localStorage.setItem('chatList', JSON.stringify(current));
+ }
+ }
+ },
+ refreshList() {
+ let el = ChatListWidget.elements,
+ s = ChatListWidget.settings,
+ chatList = ChatListWidget.getChatList();
+
+ $(el.listScroll).html('');
+
+ if (Array.isArray(chatList)) {
+ $.each(chatList, (ind, chat) => {
+ $(el.listScroll).append(ChatListWidget.itemView(chat));
+
+ // @TODO: !!! remove handlers events in loop!!!
+ $(`${el.listScroll} ` + ` .chat_${chat.topicId}`).on('click', () => {
+ $(`.contact_chat_${chat.topicId}`).click();
+ });
+ });
+ }
+ },
+ itemView(chat) {
+ let item = '';
+
+ item += `
';
- return item;
- }
- };
- ChatListWidget.init();
+ return item;
+ }
+ };
+ ChatListWidget.init();
- /**
+ /**
* Profile Widget
* @type {{settings: {profileView: string, logoutBtn: string}, init: init, update: update}}
*/
- ProfileViewWidget = {
- elements: {
- profileImg: '#profile_img',
- firstName: "#first_name",
- lastName: "#last_name",
- userName: "#user_name",
- phoneNumber: "#phone_number",
- profileView: "#profile_view",
- editBtn: "#editBtn",
- logoutBtn: "#logoutBtn"
- },
- settings: {
- profile: {}
- },
- init: function () {
- this.subscribe();
- this.bindUIActions();
- },
- subscribe: function () {
- GlobalWidget.subscribe('profile.get', GlobalWidget, this.refresh);
- GlobalWidget.subscribe('io.error.nick_taken', GlobalWidget, this.errorNickTaken);
- GlobalWidget.subscribe('roster.patch', this, this.profileUpdated);
- GlobalWidget.subscribe('io.ok.logout', this, this.logout);
- },
- bindUIActions: function () {
- var t = ProfileViewWidget,
- el = t.elements;
-
- $(el.profileImg).on("click", function () {
- //@TODO: need to refactoring this sheet
- var hidden = $('#profile_view').is(':hidden');
- $('#tool_bar').css("width", '');
- $('#chat').css("width", '');
- $('.chat_wrapper').css("padding", '');
-
- if (hidden) {
- $("#logo_wrap").fadeIn(750, function () {
- $(this).addClass("lookAtMe");
- });
-
- var tool_bar_width = ((DashboardWidget.settings.vw * $('#tool_bar').width()) - DashboardWidget.settings.panels_options['profile_view']['width']) + 'vw';
- $('#tool_bar').css("width", tool_bar_width);
-
- $('#chats_list, #contacts_list_view, #new_contact_view, #videos_list, #files_list, #photos_list, #links_list, #contact_requests_view').hide();
-
-
- $("#profile_view, .drag_handle_left").fadeIn(750, function () {
- $(this).addClass("lookAtMe");
- });
-
- var vw = (100 / $(document).width());
-
- var chat_width = ((DashboardWidget.settings.vw * $('#chat').width()) - DashboardWidget.settings.panels_options['profile_view']['width']) + 'vw';
- $('#chat').css("width", chat_width);
-
- var panel_width = DashboardWidget.settings.panels_options['profile_view']['width'];
- $('#logo_wrap').css("width", panel_width + 'vw');
-
- var padding_chat_wrapper = '0vw ' + ((15 - ((panel_width) / 2)) < 0 ? 0 : (15 - ((panel_width) / 2))) + 'vw';
- console.log(padding_chat_wrapper);
- $('.chat_wrapper').css("padding", padding_chat_wrapper);
-
- } else {
- $('#logo_wrap, #profile_view, .drag_handle_left').hide();
- }
- });
- $(el.logoutBtn).on('click', function () {
- var msg = enc(encAuth({"type": "logout"}));
- ws.send(msg);
- });
- $(el.editBtn).on('click', function () {
- var f = $(el.firstName).val(),
- l = $(el.lastName).val(),
- un = $(el.userName).val();
-
- if (t.profileUpdateValidation(f, l, un)) {
- var mes = {
- "id": GlobalWidget.getRosterId(),
- "names": f,
- "surnames": l,
- "status": "patch"
- };
-
- if (typeof un != "undefined" && un != t.settings.profile.rosters[GlobalWidget.getRosterIndex()].nick) {
- mes.nick = un;
- }
-
- var msg = enc(encRoster(mes));
- ws.send(msg);
- }
- });
- },
- profileGet: function () {
- var msg = enc(encProfile({"phone": GlobalWidget.getPhoneNumber(), "status": "get"}));
- ws.send(msg);
- },
- profileUpdated: function () {
- var msg = GlobalWidget.messages(1100);
- GlobalWidget.sucsessMsg(msg);
- },
- profileUpdateValidation: function (firstName, lastName, userName) {
- try {
- if (!firstName.length) {
- throw new Error(GlobalWidget.messages(1101));
- }
- if (userName.length > 0 && userName.length < 2) {
- throw new Error(GlobalWidget.messages(1103));
- }
-
- var pattern = /^([a-zA-Z0-9_-]{2,})$/;
- if (userName && !pattern.test(userName)) {
- throw new Error(GlobalWidget.messages(1104));
- }
- } catch (err) {
- GlobalWidget.warningMsg(err.message)
- return;
- }
- return true;
- },
- errorNickTaken: function () {
- GlobalWidget.warningMsg(GlobalWidget.messages(1102));
- },
- refresh: function (res) {
- var el = ProfileViewWidget.elements,
- s = ProfileViewWidget.settings,
- rosInd = GlobalWidget.getRosterIndex();
-
- s.profile = res;
-
- $(el.firstName).val(res.rosters[rosInd].names);
- $(el.lastName).val(res.rosters[rosInd].surnames);
- $(el.userName).val(res.rosters[rosInd].nick);
- $(el.phoneNumber).val(res.phone);
- },
- logout: function () {
- //@TODO: need to clean needed data
- var chatList = localStorage.getItem('chatList');
-
- localStorage.clear();
- localStorage.setItem('chatList', chatList);
+ ProfileViewWidget = {
+ elements: {
+ profileImg: '#profile_img',
+ firstName: '#first_name',
+ lastName: '#last_name',
+ userName: '#user_name',
+ phoneNumber: '#phone_number',
+ profileView: '#profile_view',
+ editBtn: '#editBtn',
+ logoutBtn: '#logoutBtn'
+ },
+ settings: {
+ profile: {}
+ },
+ init() {
+ this.subscribe();
+ this.bindUIActions();
+ },
+ subscribe() {
+ GlobalWidget.subscribe('profile.get', GlobalWidget, this.refresh);
+ GlobalWidget.subscribe('io.error.nick_taken', GlobalWidget, this.errorNickTaken);
+ GlobalWidget.subscribe('roster.patch', this, this.profileUpdated);
+ GlobalWidget.subscribe('io.ok.logout', this, this.logout);
+ },
+ bindUIActions() {
+ let t = ProfileViewWidget,
+ el = t.elements;
+
+ $(el.profileImg).on('click', () => {
+ // @TODO: need to refactoring this sheet
+ const hidden = $('#profile_view').is(':hidden');
+ $('#tool_bar').css('width', '');
+ $('#chat').css('width', '');
+ $('.chat_wrapper').css('padding', '');
+
+ if (hidden) {
+ $('#logo_wrap').fadeIn(750, function () {
+ $(this).addClass('lookAtMe');
+ });
+
+ const tool_bar_width = `${(DashboardWidget.settings.vw * $('#tool_bar').width()) - DashboardWidget.settings.panels_options.profile_view.width}vw`;
+ $('#tool_bar').css('width', tool_bar_width);
+
+ $('#chats_list, #contacts_list_view, #new_contact_view, #videos_list, #files_list, #photos_list, #links_list, #contact_requests_view').hide();
+
+
+ $('#profile_view, .drag_handle_left').fadeIn(750, function () {
+ $(this).addClass('lookAtMe');
+ });
+
+ const vw = (100 / $(document).width());
+
+ const chat_width = `${(DashboardWidget.settings.vw * $('#chat').width()) - DashboardWidget.settings.panels_options.profile_view.width}vw`;
+ $('#chat').css('width', chat_width);
+
+ const panel_width = DashboardWidget.settings.panels_options.profile_view.width;
+ $('#logo_wrap').css('width', `${panel_width}vw`);
+
+ const padding_chat_wrapper = `0vw ${(15 - ((panel_width) / 2)) < 0 ? 0 : (15 - ((panel_width) / 2))}vw`;
+ console.log(padding_chat_wrapper);
+ $('.chat_wrapper').css('padding', padding_chat_wrapper);
+ } else {
+ $('#logo_wrap, #profile_view, .drag_handle_left').hide();
+ }
+ });
+ $(el.logoutBtn).on('click', () => {
+ const msg = enc(encAuth({ type: 'logout' }));
+ ws.send(msg);
+ });
+ $(el.editBtn).on('click', () => {
+ let f = $(el.firstName).val(),
+ l = $(el.lastName).val(),
+ un = $(el.userName).val();
+
+ if (t.profileUpdateValidation(f, l, un)) {
+ const mes = {
+ id: GlobalWidget.getRosterId(),
+ names: f,
+ surnames: l,
+ status: 'patch'
+ };
+
+ if (typeof un !== 'undefined' && un != t.settings.profile.rosters[GlobalWidget.getRosterIndex()].nick) {
+ mes.nick = un;
+ }
+
+ const msg = enc(encRoster(mes));
+ ws.send(msg);
+ }
+ });
+ },
+ profileGet() {
+ const msg = enc(encProfile({ phone: GlobalWidget.getPhoneNumber(), status: 'get' }));
+ ws.send(msg);
+ },
+ profileUpdated() {
+ const msg = GlobalWidget.messages(1100);
+ GlobalWidget.sucsessMsg(msg);
+ },
+ profileUpdateValidation(firstName, lastName, userName) {
+ try {
+ if (!firstName.length) {
+ throw new Error(GlobalWidget.messages(1101));
+ }
+ if (userName.length > 0 && userName.length < 2) {
+ throw new Error(GlobalWidget.messages(1103));
+ }
- location.replace("/web/welcome.htm");
+ const pattern = /^([a-zA-Z0-9_-]{2,})$/;
+ if (userName && !pattern.test(userName)) {
+ throw new Error(GlobalWidget.messages(1104));
}
- };
- ProfileViewWidget.init();
+ } catch (err) {
+ GlobalWidget.warningMsg(err.message);
+ return;
+ }
+ return true;
+ },
+ errorNickTaken() {
+ GlobalWidget.warningMsg(GlobalWidget.messages(1102));
+ },
+ refresh(res) {
+ let el = ProfileViewWidget.elements,
+ s = ProfileViewWidget.settings,
+ rosInd = GlobalWidget.getRosterIndex();
+
+ s.profile = res;
+
+ $(el.firstName).val(res.rosters[rosInd].names);
+ $(el.lastName).val(res.rosters[rosInd].surnames);
+ $(el.userName).val(res.rosters[rosInd].nick);
+ $(el.phoneNumber).val(res.phone);
+ },
+ logout() {
+ // @TODO: need to clean needed data
+ const chatList = localStorage.getItem('chatList');
+
+ localStorage.clear();
+ localStorage.setItem('chatList', chatList);
+
+ location.replace('/web/welcome.htm');
+ }
+ };
+ ProfileViewWidget.init();
- /**
+ /**
* Contacts
* @type {{elements: {chats: string, contacts: string, newContact: string, contactsList: string, contactRequest: string}, init: init, subscribe: subscribe, bindUIActions: bindUIActions}}
*/
- ContactsWidget = {
- elements: {
- contacts: '#contacts',
- newContact: '#new_contact',
- contactsList: '#contacts_list',
- contactRequest: '#contact_request',
- contactsListScroll: '#contacts_list_scroll',
- chatContactItem: '.chat_contact',
- },
- settings: {
- contacts: []
- },
- init: function () {
- this.subscribe();
- this.bindUIActions()
- },
- subscribe: function () {
- GlobalWidget.subscribe('profile.get', GlobalWidget, this.refreshList);
- GlobalWidget.subscribe('contact.internal', GlobalWidget, this.contactInternal);
- },
- bindUIActions: function () {
- var el = ContactsWidget.elements;
-
- $(el.contacts).on("click", function () {
- if ($(el.newContact).is(':hidden')) {
- $(el.contacts).addClass('active selected');
- $(el.contactRequest + ',' + el.newContact).removeClass('hidden').slideDown('slow');
- } else {
- $(el.newContact).removeClass('active selected');
- $(el.contactRequest, el.newContact).addClass('hidden').slideUp('slow');
- }
-
- //@TODO: need to refactoring the code below
- var hidden = $('#contacts_list_view').is(':hidden');
- $('#tool_bar').css("width", '');
- $('#chat').css("width", '');
- $('.chat_wrapper').css("padding", '');
-
- if (hidden) {
- $("#logo_wrap").fadeIn(750, function () {
- $(this).addClass("lookAtMe");
- });
+ ContactsWidget = {
+ elements: {
+ contacts: '#contacts',
+ newContact: '#new_contact',
+ contactsList: '#contacts_list',
+ contactRequest: '#contact_request',
+ contactsListScroll: '#contacts_list_scroll',
+ chatContactItem: '.chat_contact'
+ },
+ settings: {
+ contacts: []
+ },
+ init() {
+ this.subscribe();
+ this.bindUIActions();
+ },
+ subscribe() {
+ GlobalWidget.subscribe('profile.get', GlobalWidget, this.refreshList);
+ GlobalWidget.subscribe('contact.internal', GlobalWidget, this.contactInternal);
+ },
+ bindUIActions() {
+ const el = ContactsWidget.elements;
+
+ $(el.contacts).on('click', () => {
+ if ($(el.newContact).is(':hidden')) {
+ $(el.contacts).addClass('active selected');
+ $(`${el.contactRequest},${el.newContact}`).removeClass('hidden').slideDown('slow');
+ } else {
+ $(el.newContact).removeClass('active selected');
+ $(el.contactRequest, el.newContact).addClass('hidden').slideUp('slow');
+ }
- var tool_bar_width = ((DashboardWidget.settings.vw * $('#tool_bar').width()) - DashboardWidget.settings.panels_options['contacts_list_view']['width']) + 'vw';
- $('#tool_bar').css("width", tool_bar_width);
+ // @TODO: need to refactoring the code below
+ const hidden = $('#contacts_list_view').is(':hidden');
+ $('#tool_bar').css('width', '');
+ $('#chat').css('width', '');
+ $('.chat_wrapper').css('padding', '');
- $('#chats_list, #new_contact_view, #profile_view, #videos_list, #files_list, #photos_list, #links_list, #contact_requests_view').hide();
+ if (hidden) {
+ $('#logo_wrap').fadeIn(750, function () {
+ $(this).addClass('lookAtMe');
+ });
- $("#contacts_list_view").fadeIn(750, function () {
- $(this).addClass("lookAtMe");
- });
+ const tool_bar_width = `${(DashboardWidget.settings.vw * $('#tool_bar').width()) - DashboardWidget.settings.panels_options.contacts_list_view.width}vw`;
+ $('#tool_bar').css('width', tool_bar_width);
- $(".drag_handle_left").fadeIn(750, function () {
- $(this).addClass("lookAtMe");
- });
+ $('#chats_list, #new_contact_view, #profile_view, #videos_list, #files_list, #photos_list, #links_list, #contact_requests_view').hide();
- var vw = (100 / $(document).width());
+ $('#contacts_list_view').fadeIn(750, function () {
+ $(this).addClass('lookAtMe');
+ });
- var chat_width = ((DashboardWidget.settings.vw * $('#chat').width()) - DashboardWidget.settings.panels_options['contacts_list_view']['width']) + 'vw';
- $('#chat').css("width", chat_width);
+ $('.drag_handle_left').fadeIn(750, function () {
+ $(this).addClass('lookAtMe');
+ });
- var panel_width = DashboardWidget.settings.panels_options['contacts_list_view']['width'];
- $('#logo_wrap').css("width", panel_width + 'vw');
+ const vw = (100 / $(document).width());
- var padding_chat_wrapper = '0vw ' + ((15 - ((panel_width) / 2)) < 0 ? 0 : (15 - ((panel_width) / 2))) + 'vw';
- $('.chat_wrapper').css("padding", padding_chat_wrapper);
+ const chat_width = `${(DashboardWidget.settings.vw * $('#chat').width()) - DashboardWidget.settings.panels_options.contacts_list_view.width}vw`;
+ $('#chat').css('width', chat_width);
- } else {
- $('#logo_wrap, #chats_list, #contacts_list_view, .drag_handle_left').hide();
- }
- });
- },
- contactInternal: function (res) {
- var el = ContactsWidget.elements;
- if (typeof res.presence != "undefined") {
- $(el.contactsListScroll + ' .contact_' + res.phone_id + ' div.presence').html(res.presence);
- }
- },
- refreshList: function (res) {
- var el = ContactsWidget.elements,
- s = ContactsWidget.settings,
- rosInd = GlobalWidget.getRosterIndex(),
- userlist = res.rosters[rosInd].userlist;
-
- $(el.contactsListScroll).html('');
-
- $.each(userlist, function (ind, contact) {
- if (contact.status == "friend") {
- s.contacts[contact.phone_id] = contact;
-
- $(el.contactsListScroll).append(ContactsWidget.itemView(contact));
-
- //@TODO: !!! remove handlers events in loop!!!
- $(el.contactsListScroll + ' ' + ' .contact_' + contact.phone_id).on("click", function () {
- //@TODO: move to separate function
- //p2p chat
- ChatAreaWidget.settings.activeChat = {
- from: {
- names: ProfileViewWidget.settings.profile.rosters[GlobalWidget.getRosterIndex()].names,
- surnames: ProfileViewWidget.settings.profile.rosters[GlobalWidget.getRosterIndex()].surnames,
- phone: GlobalWidget.getPhoneNumber(),
- phone_id: GlobalWidget.getPhoneNumberId()
- },
- to: {
- names: $(this).data('names'),
- surnames: $(this).data('surnames'),
- phone: $(this).data('phone'),
- phone_id: $(this).data('phone-id'),
- reader: $(this).data('reader')
- },
- chatType: "p2p"
- };
-
- ChatAreaWidget.showChat();
- });
- }
- })
- },
- itemView: function (contact) {
- var item = '',
- presence = (typeof contact.presence != "undefined") ? contact.presence : '',
- names = (typeof contact.names != "undefined") ? contact.names : '',
- surnames = (typeof contact.surnames != "undefined") ? contact.surnames : '';
+ const panel_width = DashboardWidget.settings.panels_options.contacts_list_view.width;
+ $('#logo_wrap').css('width', `${panel_width}vw`);
- var op = '
' + presence + '
';
+ const padding_chat_wrapper = `0vw ${(15 - ((panel_width) / 2)) < 0 ? 0 : (15 - ((panel_width) / 2))}vw`;
+ $('.chat_wrapper').css('padding', padding_chat_wrapper);
+ } else {
+ $('#logo_wrap, #chats_list, #contacts_list_view, .drag_handle_left').hide();
+ }
+ });
+ },
+ contactInternal(res) {
+ const el = ContactsWidget.elements;
+ if (typeof res.presence !== 'undefined') {
+ $(`${el.contactsListScroll} .contact_${res.phone_id} div.presence`).html(res.presence);
+ }
+ },
+ refreshList(res) {
+ let el = ContactsWidget.elements,
+ s = ContactsWidget.settings,
+ rosInd = GlobalWidget.getRosterIndex(),
+ userlist = res.rosters[rosInd].userlist;
+
+ $(el.contactsListScroll).html('');
+
+ $.each(userlist, (ind, contact) => {
+ if (contact.status == 'friend') {
+ s.contacts[contact.phone_id] = contact;
+
+ $(el.contactsListScroll).append(ContactsWidget.itemView(contact));
+
+ // @TODO: !!! remove handlers events in loop!!!
+ $(`${el.contactsListScroll} ` + ` .contact_${contact.phone_id}`).on('click', function () {
+ // @TODO: move to separate function
+ // p2p chat
+ ChatAreaWidget.settings.activeChat = {
+ from: {
+ names: ProfileViewWidget.settings.profile.rosters[GlobalWidget.getRosterIndex()].names,
+ surnames: ProfileViewWidget.settings.profile.rosters[GlobalWidget.getRosterIndex()].surnames,
+ phone: GlobalWidget.getPhoneNumber(),
+ phone_id: GlobalWidget.getPhoneNumberId()
+ },
+ to: {
+ names: $(this).data('names'),
+ surnames: $(this).data('surnames'),
+ phone: $(this).data('phone'),
+ phone_id: $(this).data('phone-id'),
+ reader: $(this).data('reader')
+ },
+ chatType: 'p2p'
+ };
- item = '
';
- return item;
- },
- getNameByPhoneID: function (phoneId) {
- var s = ContactsWidget.settings;
+ return item;
+ },
+ getNameByPhoneID(phoneId) {
+ const s = ContactsWidget.settings;
- if (typeof s.contacts[phoneId] != "undefined") {
- return s.contacts[phoneId].names + ' ' + s.contacts[phoneId].surnames;
- }
+ if (typeof s.contacts[phoneId] !== 'undefined') {
+ return `${s.contacts[phoneId].names} ${s.contacts[phoneId].surnames}`;
+ }
- return phoneId;
- }
- };
- ContactsWidget.init();
+ return phoneId;
+ }
+ };
+ ContactsWidget.init();
- /**
+ /**
* Contact Request Widget
* @type {{elements: {}, init: init, subscribe: subscribe, bindUIActions: bindUIActions, refreshList: refreshList, itemView: itemView}}
*/
- ContactRequestsWidget = {
- elements: {
- contactRequest: "#contact_request",
- contactRequestsScroll: "#contact_requests_scroll",
- outcomeFriendRequests: "#outcome_friend_requests",
- incomeFriendRequests: "#income_friend_requests",
- revokeBtn: "button.revoke",
- confirmBtn: "button.confirm",
- },
- init: function () {
- this.subscribe();
- this.bindUIActions();
- },
- subscribe: function () {
- GlobalWidget.subscribe('profile.get', ContactRequestsWidget, this.refreshList);
- GlobalWidget.subscribe('contact.authorization', ContactRequestsWidget, this.requestNotification);
- GlobalWidget.subscribe('contact.authorization', ContactRequestsWidget, this.addWatingApprovalContact);
- GlobalWidget.subscribe('contact.request', ContactRequestsWidget, this.addWatingApprovalContact);
-
- //@TODO: add supporting a few handler functions
- GlobalWidget.subscribe('contact.friend', ContactRequestsWidget, ProfileViewWidget.profileGet);
- },
- bindUIActions: function () {
- var el = ContactRequestsWidget.elements;
-
- $(el.contactRequest).on('click', function () {
- //@TODO: need to refactor the code bellow
- $('#chats_list, #new_contact_view, #profile_view, #videos_list, #files_list, #photos_list, #links_list, #contacts_list_view').hide();
- $("#contact_requests_view, .drag_handle_left").fadeIn(750, function () {
- $(this).addClass("lookAtMe");
- });
- });
-
- $(el.contactRequestsScroll + ' ' + el.confirmBtn).on("click", function () {
- var phone_id = $(this).parent().data('phone-id');
-
- //3a. send Friend/Confirm
- var msg = enc(encFriend({
- "phone_id": GlobalWidget.getPhoneNumberId(),
- "friend_id": phone_id,
- "status": "confirm"
- }));
-
- ws.send(msg);
- });
-
- $(el.contactRequestsScroll + ' ' + el.revokeBtn).on("click", function () {
- var phone_id = $(this).parent().data('phone-id')
-
- //3b. send Friend/Revoke
- var msg = enc(encFriend({
- "phone_id": GlobalWidget.getPhoneNumberId(),
- "friend_id": phone_id,
- "status": "revoke"
- }));
-
- ws.send(msg);
- });
- },
- requestNotification: function (res) {
- GlobalWidget.sucsessMsg("Friend request from " + res.names + ' ' + res.surnames);
- },
- refreshList: function (res) {
- var el = ContactRequestsWidget.elements,
- rosInd = GlobalWidget.getRosterIndex(),
- userlist = res.rosters[rosInd].userlist,
- request = '',
- authorization = '';
-
- $.each(userlist, function (ind, contact) {
- if (contact.status == "request") {
- request += ContactRequestsWidget.itemView(contact);
- } else if (contact.status == "authorization") {
- authorization += ContactRequestsWidget.itemView(contact)
- }
- })
-
- if (request) {
- $(el.outcomeFriendRequests).html('');
- $(el.outcomeFriendRequests).append(request);
- } else {
- $(el.outcomeFriendRequests).html("
" + GlobalWidget.t("No Requests") + "
");
- }
-
- if (authorization) {
- $(el.incomeFriendRequests).html('');
- $(el.incomeFriendRequests).append(authorization);
- } else {
- $(el.incomeFriendRequests).html("
" + GlobalWidget.t("No Requests") + "
");
- }
-
- //@TODO: need to unbind handlers
- ContactRequestsWidget.bindUIActions();
- },
- addWatingApprovalContact: function (res) {
- var el = ContactRequestsWidget.elements
- $(el.contactRequest).click();
-
- //@TODO: need to optimize in order not to send Profile/get request
- ProfileViewWidget.profileGet();
- },
- itemView: function (contact) {
- var item = '',
- names = (typeof contact.names != "undefined") ? contact.names : GlobalWidget.cleanPhone(contact.phone_id),
- surnames = (typeof contact.surnames != "undefined") ? contact.surnames : '';
-
- var op = (contact.status == "request") ? "waiting" : ' ';
-
- item = '
\n' +
+ ContactRequestsWidget = {
+ elements: {
+ contactRequest: '#contact_request',
+ contactRequestsScroll: '#contact_requests_scroll',
+ outcomeFriendRequests: '#outcome_friend_requests',
+ incomeFriendRequests: '#income_friend_requests',
+ revokeBtn: 'button.revoke',
+ confirmBtn: 'button.confirm'
+ },
+ init() {
+ this.subscribe();
+ this.bindUIActions();
+ },
+ subscribe() {
+ GlobalWidget.subscribe('profile.get', ContactRequestsWidget, this.refreshList);
+ GlobalWidget.subscribe('contact.authorization', ContactRequestsWidget, this.requestNotification);
+ GlobalWidget.subscribe('contact.authorization', ContactRequestsWidget, this.addWatingApprovalContact);
+ GlobalWidget.subscribe('contact.request', ContactRequestsWidget, this.addWatingApprovalContact);
+
+ // @TODO: add supporting a few handler functions
+ GlobalWidget.subscribe('contact.friend', ContactRequestsWidget, ProfileViewWidget.profileGet);
+ },
+ bindUIActions() {
+ const el = ContactRequestsWidget.elements;
+
+ $(el.contactRequest).on('click', () => {
+ // @TODO: need to refactor the code bellow
+ $('#chats_list, #new_contact_view, #profile_view, #videos_list, #files_list, #photos_list, #links_list, #contacts_list_view').hide();
+ $('#contact_requests_view, .drag_handle_left').fadeIn(750, function () {
+ $(this).addClass('lookAtMe');
+ });
+ });
+
+ $(`${el.contactRequestsScroll} ${el.confirmBtn}`).on('click', function () {
+ const phone_id = $(this).parent().data('phone-id');
+
+ // 3a. send Friend/Confirm
+ const msg = enc(encFriend({
+ phone_id: GlobalWidget.getPhoneNumberId(),
+ friend_id: phone_id,
+ status: 'confirm'
+ }));
+
+ ws.send(msg);
+ });
+
+ $(`${el.contactRequestsScroll} ${el.revokeBtn}`).on('click', function () {
+ const phone_id = $(this).parent().data('phone-id');
+
+ // 3b. send Friend/Revoke
+ const msg = enc(encFriend({
+ phone_id: GlobalWidget.getPhoneNumberId(),
+ friend_id: phone_id,
+ status: 'revoke'
+ }));
+
+ ws.send(msg);
+ });
+ },
+ requestNotification(res) {
+ GlobalWidget.sucsessMsg(`Friend request from ${res.names} ${res.surnames}`);
+ },
+ refreshList(res) {
+ let el = ContactRequestsWidget.elements,
+ rosInd = GlobalWidget.getRosterIndex(),
+ userlist = res.rosters[rosInd].userlist,
+ request = '',
+ authorization = '';
+
+ $.each(userlist, (ind, contact) => {
+ if (contact.status == 'request') {
+ request += ContactRequestsWidget.itemView(contact);
+ } else if (contact.status == 'authorization') {
+ authorization += ContactRequestsWidget.itemView(contact);
+ }
+ });
+
+ if (request) {
+ $(el.outcomeFriendRequests).html('');
+ $(el.outcomeFriendRequests).append(request);
+ } else {
+ $(el.outcomeFriendRequests).html(`
${GlobalWidget.t('No Requests')}
`);
+ }
+
+ if (authorization) {
+ $(el.incomeFriendRequests).html('');
+ $(el.incomeFriendRequests).append(authorization);
+ } else {
+ $(el.incomeFriendRequests).html(`
${GlobalWidget.t('No Requests')}
`);
+ }
+
+ // @TODO: need to unbind handlers
+ ContactRequestsWidget.bindUIActions();
+ },
+ addWatingApprovalContact(res) {
+ const el = ContactRequestsWidget.elements;
+ $(el.contactRequest).click();
+
+ // @TODO: need to optimize in order not to send Profile/get request
+ ProfileViewWidget.profileGet();
+ },
+ itemView(contact) {
+ let item = '',
+ names = (typeof contact.names !== 'undefined') ? contact.names : GlobalWidget.cleanPhone(contact.phone_id),
+ surnames = (typeof contact.surnames !== 'undefined') ? contact.surnames : '';
+
+ const op = (contact.status == 'request') ? 'waiting' : ' ';
+
+ item = `${'
';
- return item;
- }
- };
- ContactRequestsWidget.init();
+ return item;
+ }
+ };
+ ContactRequestsWidget.init();
- /**
+ /**
* Add Contact Widget
* @type {{elements: {}, init: init, bindUIActions: bindUIActions}}
*/
- AddContactWidget = {
- elements: {
- newContact: "#new_contact",
- newContactView: "#new_contact_view",
- code: "#new_contact_view #code",
- number: "#new_contact_view #number",
- addContactBtn: "#new_contact_view #addContactBtn"
- },
- init: function () {
- this.subscribe();
- this.bindUIActions();
- },
- subscribe: function () {
- GlobalWidget.subscribe('io.ok.roster.contact', this, this.friendRequest);
- },
- bindUIActions: function () {
- var el = this.elements;
-
- $(el.newContact).on("click", function () {
- //@TODO: need to refactor the code below
- var hidden = $('#new_contact_view').is(':hidden');
-
- $('#tool_bar').css("width", '');
- $('#chat').css("width", '');
- $('.chat_wrapper').css("padding", '');
- if (hidden) {
- $("#logo_wrap").fadeIn(750, function () {
- $(this).addClass("lookAtMe");
- });
-
- var tool_bar_width = ((DashboardWidget.settings.vw * $('#tool_bar').width()) - DashboardWidget.settings.panels_options['new_contact_view']['width']) + 'vw';
- $('#tool_bar').css("width", tool_bar_width);
-
- $('#chats_list, #contacts_list_view, #profile_view, #videos_list, #files_list, #photos_list, #links_list, #contact_requests_view').hide();
-
- $("#new_contact_view, .drag_handle_left").fadeIn(750, function () {
- $(this).addClass("lookAtMe");
- });
-
- var vw = (100 / $(document).width());
-
- var chat_width = ((DashboardWidget.settings.vw * $('#chat').width()) - DashboardWidget.settings.panels_options['new_contact_view']['width']) + 'vw';
- $('#chat').css("width", chat_width);
-
- var panel_width = t.settings.panels_options['new_contact_view']['width'];
- $('#logo_wrap').css("width", panel_width + 'vw');
-
- var padding_chat_wrapper = '0vw ' + ((15 - ((panel_width) / 2)) < 0 ? 0 : (15 - ((panel_width) / 2))) + 'vw';
- console.log(padding_chat_wrapper);
- $('.chat_wrapper').css("padding", padding_chat_wrapper);
-
- } else {
- $('#logo_wrap, #new_contact_view, .drag_handle_left').hide();
- }
- });
-
- $(el.addContactBtn).on('click', function () {
- var code = $(el.code).val().replace("+", ""),
- phone = $(el.number).val().split(" ").join("");
-
- //1. search contact for getting friend_id
- var msg = enc(encSearch({
- id: GlobalWidget.getRosterId(),
- field: "phone",
- type: "==",
- value: [code + phone],
- status: "contact"
- }));
-
- ws.send(msg);
- });
- },
- friendRequest: function (res) {
- var el = this.elements;
-
- if ('userlist' in res.data && typeof res.data.userlist[0] != "undefined") {
- var phone_id = res.data.userlist[0].phone_id;
-
- //2. send Friend/Request
- var msg = enc(encFriend({
- "phone_id": GlobalWidget.getPhoneNumber() + '_' + GlobalWidget.getRosterId(),
- "friend_id": phone_id,
- "status": "request"
- }));
-
- ws.send(msg);
-
- $(ContactRequestsWidget.elements.contactRequest).click();
- } else {
- GlobalWidget.errorMsg("Phone was not found.")
- }
+ AddContactWidget = {
+ elements: {
+ newContact: '#new_contact',
+ newContactView: '#new_contact_view',
+ code: '#new_contact_view #code',
+ number: '#new_contact_view #number',
+ addContactBtn: '#new_contact_view #addContactBtn'
+ },
+ init() {
+ this.subscribe();
+ this.bindUIActions();
+ },
+ subscribe() {
+ GlobalWidget.subscribe('io.ok.roster.contact', this, this.friendRequest);
+ },
+ bindUIActions() {
+ const el = this.elements;
+
+ $(el.newContact).on('click', () => {
+ // @TODO: need to refactor the code below
+ const hidden = $('#new_contact_view').is(':hidden');
+
+ $('#tool_bar').css('width', '');
+ $('#chat').css('width', '');
+ $('.chat_wrapper').css('padding', '');
+ if (hidden) {
+ $('#logo_wrap').fadeIn(750, function () {
+ $(this).addClass('lookAtMe');
+ });
+
+ const tool_bar_width = `${(DashboardWidget.settings.vw * $('#tool_bar').width()) - DashboardWidget.settings.panels_options.new_contact_view.width}vw`;
+ $('#tool_bar').css('width', tool_bar_width);
+
+ $('#chats_list, #contacts_list_view, #profile_view, #videos_list, #files_list, #photos_list, #links_list, #contact_requests_view').hide();
+
+ $('#new_contact_view, .drag_handle_left').fadeIn(750, function () {
+ $(this).addClass('lookAtMe');
+ });
+
+ const vw = (100 / $(document).width());
+
+ const chat_width = `${(DashboardWidget.settings.vw * $('#chat').width()) - DashboardWidget.settings.panels_options.new_contact_view.width}vw`;
+ $('#chat').css('width', chat_width);
+
+ const panel_width = t.settings.panels_options.new_contact_view.width;
+ $('#logo_wrap').css('width', `${panel_width}vw`);
+
+ const padding_chat_wrapper = `0vw ${(15 - ((panel_width) / 2)) < 0 ? 0 : (15 - ((panel_width) / 2))}vw`;
+ console.log(padding_chat_wrapper);
+ $('.chat_wrapper').css('padding', padding_chat_wrapper);
+ } else {
+ $('#logo_wrap, #new_contact_view, .drag_handle_left').hide();
}
+ });
+
+ $(el.addContactBtn).on('click', () => {
+ let code = $(el.code).val().replace('+', ''),
+ phone = $(el.number).val().split(' ').join('');
+
+ // 1. search contact for getting friend_id
+ const msg = enc(encSearch({
+ id: GlobalWidget.getRosterId(),
+ field: 'phone',
+ type: '==',
+ value: [code + phone],
+ status: 'contact'
+ }));
+
+ ws.send(msg);
+ });
+ },
+ friendRequest(res) {
+ const el = this.elements;
+
+ if ('userlist' in res.data && typeof res.data.userlist[0] !== 'undefined') {
+ const phone_id = res.data.userlist[0].phone_id;
+
+ // 2. send Friend/Request
+ const msg = enc(encFriend({
+ phone_id: `${GlobalWidget.getPhoneNumber()}_${GlobalWidget.getRosterId()}`,
+ friend_id: phone_id,
+ status: 'request'
+ }));
+
+ ws.send(msg);
+
+ $(ContactRequestsWidget.elements.contactRequest).click();
+ } else {
+ GlobalWidget.errorMsg('Phone was not found.');
+ }
+ }
- };
- AddContactWidget.init();
-})();
+ };
+ AddContactWidget.init();
+}());
diff --git a/src/assets/vendor/utils/global.js b/src/assets/vendor/utils/global.js
index c8826afbe1f77912ba0860f7f32f3bbb96bf1999..0ca7332883681298a2215c7117f4c5648d24b1de 100644
--- a/src/assets/vendor/utils/global.js
+++ b/src/assets/vendor/utils/global.js
@@ -1,132 +1,133 @@
-var GlobalWidget;
+let GlobalWidget;
(function () {
- var el, t;
- GlobalWidget = {
- events: {},
- settings: {},
- init: function () {
- t = this;
- el = this.elements;
+ let el,
+ t;
+ GlobalWidget = {
+ events: {},
+ settings: {},
+ init() {
+ t = this;
+ el = this.elements;
- //success
- //GlobalWidget.subscribe('io.ok.added', this, this.sucsessMsg);
+ // success
+ // GlobalWidget.subscribe('io.ok.added', this, this.sucsessMsg);
- //errors
- GlobalWidget.subscribe('io.ok.error', this, this.errorMsg);
- GlobalWidget.subscribe('io.ok2.error', this, this.errorMsg);
- GlobalWidget.subscribe('io.error.invalid_sms_code', this, this.errorMsg);
- GlobalWidget.subscribe('io.error.session_not_found', this, this.errorMsg);
- GlobalWidget.subscribe('io.error.not_authorized', this, this.errorMsg);
- GlobalWidget.subscribe('io.error.roster_not_found', this, this.errorMsg);
- },
- subscribe: function (eventName, object, callback) {
- this.events[eventName] = this.events[eventName] || [];
- this.events[eventName].push({object: object, callback: callback});
- },
- unsubscribe: function (eventName, object, callback) {
- if (this.events[eventName]) {
- for (var i = 0; i < this.events[eventName].length; i++) {
- if (this.events[eventName][i].object === object) {
- this.events[eventName].splice(i, 1);
- break;
- }
- }
- }
- },
- publish: function (eventName, data) {
- if (this.events[eventName]) {
- //@TODO: add support a few eventName by commas
- this.events[eventName].forEach(function (instance) {
- instance.callback(data);
- });
- }
- },
- getRosterId: function () {
- return localStorage.getItem('rosterId');
- },
- setRosterId: function (res) {
- if (typeof res.rosters[0].id != "undefined") {
- localStorage.setItem('rosterId', res.rosters[0].id);
- localStorage.setItem('roster', res.rosters[0]);
- localStorage.setItem('rosterIndex', "0");
+ // errors
+ GlobalWidget.subscribe('io.ok.error', this, this.errorMsg);
+ GlobalWidget.subscribe('io.ok2.error', this, this.errorMsg);
+ GlobalWidget.subscribe('io.error.invalid_sms_code', this, this.errorMsg);
+ GlobalWidget.subscribe('io.error.session_not_found', this, this.errorMsg);
+ GlobalWidget.subscribe('io.error.not_authorized', this, this.errorMsg);
+ GlobalWidget.subscribe('io.error.roster_not_found', this, this.errorMsg);
+ },
+ subscribe(eventName, object, callback) {
+ this.events[eventName] = this.events[eventName] || [];
+ this.events[eventName].push({ object, callback });
+ },
+ unsubscribe(eventName, object, callback) {
+ if (this.events[eventName]) {
+ for (let i = 0; i < this.events[eventName].length; i++) {
+ if (this.events[eventName][i].object === object) {
+ this.events[eventName].splice(i, 1);
+ break;
+ }
+ }
+ }
+ },
+ publish(eventName, data) {
+ if (this.events[eventName]) {
+ // @TODO: add support a few eventName by commas
+ this.events[eventName].forEach((instance) => {
+ instance.callback(data);
+ });
+ }
+ },
+ getRosterId() {
+ return localStorage.getItem('rosterId');
+ },
+ setRosterId(res) {
+ if (typeof res.rosters[0].id !== 'undefined') {
+ localStorage.setItem('rosterId', res.rosters[0].id);
+ localStorage.setItem('roster', res.rosters[0]);
+ localStorage.setItem('rosterIndex', '0');
- if (location.pathname != '/web/dashboard.htm' && res.rosters[0].status == 'patch') {
- location.replace("/web/dashboard.htm");
- }
- }
- },
- getRosterIndex: function () {
- return localStorage.getItem('rosterIndex');
- },
- setRosterIndex: function (ind) {
- return localStorage.setItem('rosterIndex');
- },
- getPhoneNumber: function () {
- return t.getPhoneCode().replace("+", "") + t.getPhone();
- },
- getPhoneNumberId: function () {
- return t.getPhoneCode().replace("+", "") + t.getPhone() + '_' + t.getRosterId();
- },
- setPhoneCode: function (phoneCode) {
- return localStorage.setItem('phoneCode', phoneCode);
- },
- getPhoneCode: function () {
- return localStorage.getItem('phoneCode');
- },
- getPhone: function () {
- return localStorage.getItem('phone');
- },
- setPhone: function (phone) {
- return localStorage.setItem('phone', phone);
- },
- cleanPhone: function (phone) {
- return phone.substr(0, phone.indexOf('_'));
- },
- initNotify: function () {
- Notify.Settings = {};
- },
- errorMsg: function (res) {
- //@TODO: need to refactioring to msg
- var msg = (typeof res.code != "undefined" && (typeof res.code.code != "undefined")) ? res.code.code : res;
- Notify.Error(GlobalWidget.t(msg));
- },
- sucsessMsg: function (msg) {
- Notify.Success(GlobalWidget.t(msg));
- },
- warningMsg: function (msg) {
- Notify.Warning(GlobalWidget.t(msg));
- },
- convertUnixTime(unixtime) {
- var u = new Date(unixtime);
+ if (location.pathname != '/web/dashboard.htm' && res.rosters[0].status == 'patch') {
+ location.replace('/web/dashboard.htm');
+ }
+ }
+ },
+ getRosterIndex() {
+ return localStorage.getItem('rosterIndex');
+ },
+ setRosterIndex(ind) {
+ return localStorage.setItem('rosterIndex');
+ },
+ getPhoneNumber() {
+ return t.getPhoneCode().replace('+', '') + t.getPhone();
+ },
+ getPhoneNumberId() {
+ return `${t.getPhoneCode().replace('+', '') + t.getPhone()}_${t.getRosterId()}`;
+ },
+ setPhoneCode(phoneCode) {
+ return localStorage.setItem('phoneCode', phoneCode);
+ },
+ getPhoneCode() {
+ return localStorage.getItem('phoneCode');
+ },
+ getPhone() {
+ return localStorage.getItem('phone');
+ },
+ setPhone(phone) {
+ return localStorage.setItem('phone', phone);
+ },
+ cleanPhone(phone) {
+ return phone.substr(0, phone.indexOf('_'));
+ },
+ initNotify() {
+ Notify.Settings = {};
+ },
+ errorMsg(res) {
+ // @TODO: need to refactioring to msg
+ const msg = (typeof res.code !== 'undefined' && (typeof res.code.code !== 'undefined')) ? res.code.code : res;
+ Notify.Error(GlobalWidget.t(msg));
+ },
+ sucsessMsg(msg) {
+ Notify.Success(GlobalWidget.t(msg));
+ },
+ warningMsg(msg) {
+ Notify.Warning(GlobalWidget.t(msg));
+ },
+ convertUnixTime(unixtime) {
+ const u = new Date(unixtime);
- return u.getFullYear() +
- '-' + ('0' + u.getMonth()).slice(-2) +
- '-' + ('0' + u.getDate()).slice(-2) +
- ' ' + ('0' + u.getHours()).slice(-2) +
- ':' + ('0' + u.getMinutes()).slice(-2) +
- ':' + ('0' + u.getSeconds()).slice(-2);
- },
- t: function (msg, lang) {
- var lang = lang | "en";
- //@TODO: add translation logic
- return msg;
- },
- messages: function (code, placeholders) {
- var placeholders = placeholders || []; //@TODO: use in in the future
+ return `${u.getFullYear()
+ }-${(`0${u.getMonth()}`).slice(-2)
+ }-${(`0${u.getDate()}`).slice(-2)
+ } ${(`0${u.getHours()}`).slice(-2)
+ }:${(`0${u.getMinutes()}`).slice(-2)
+ }:${(`0${u.getSeconds()}`).slice(-2)}`;
+ },
+ t(msg, lang) {
+ var lang = lang | 'en';
+ // @TODO: add translation logic
+ return msg;
+ },
+ messages(code, placeholders) {
+ var placeholders = placeholders || []; // @TODO: use in in the future
- //@TODO: move to settings file e.g. JSON
- var codes = {
- 1100: "Profile was updated.",
- 1101: "First name is needed so other people know with whom they are talking.",
- 1102: "Sorry, this username is already taken.",
- 1103: "Username should contain at least 2 symbols.",
- 1104: "Sorry, this username is invalid."
- };
+ // @TODO: move to settings file e.g. JSON
+ const codes = {
+ 1100: 'Profile was updated.',
+ 1101: 'First name is needed so other people know with whom they are talking.',
+ 1102: 'Sorry, this username is already taken.',
+ 1103: 'Username should contain at least 2 symbols.',
+ 1104: 'Sorry, this username is invalid.'
+ };
- return (typeof codes[code] != "undefined") ? this.t(codes[code]) : this.t("Undefined error");
- },
- };
+ return (typeof codes[code] !== 'undefined') ? this.t(codes[code]) : this.t('Undefined error');
+ }
+ };
- GlobalWidget.init();
-}());
\ No newline at end of file
+ GlobalWidget.init();
+}());
diff --git a/src/assets/vendor/utils/handlers.js b/src/assets/vendor/utils/handlers.js
index 1b8d4b620a12ae2dfa8e68d42a794b0c0a017482..e82a11976d5c563f16478b2ffaded4966d66995d 100644
--- a/src/assets/vendor/utils/handlers.js
+++ b/src/assets/vendor/utils/handlers.js
@@ -6,59 +6,59 @@
* IO: Exceptions and Effects Protocol
* @see https://github.com/NYNJA-MC/protocol/blob/master/v1/IO.md
*/
-var $io = {}; $io.on = function onio(r, cb) {
- if (is(r, lenio(), 'io')) {
- try {
- var res = decio(r);
- var e = 'io.' + res.code.tup;
-
- if (typeof res.code.code != 'undefined') {
- e += '.' + res.code.code;
- } else if (typeof res.data.tup != "undefined") {
- //console.log(res.data);
- if (res.data.tup == "Roster" && typeof res.data.status != "undefined") {
- e += '.' + res.data.tup.toLowerCase() + '.' + res.data.status;
- }
- }
-
- console.log("Subscribe event: " + e);
- //console.log(r);
- //console.log(res);
-
- GlobalWidget.publish(e, res);
- return { status: "ok" };
- } catch (e) {
- console.log(e);
- return { status: '' };
+const $io = {}; $io.on = function onio(r, cb) {
+ if (is(r, lenio(), 'io')) {
+ try {
+ const res = decio(r);
+ let e = `io.${res.code.tup}`;
+
+ if (typeof res.code.code !== 'undefined') {
+ e += `.${res.code.code}`;
+ } else if (typeof res.data.tup !== 'undefined') {
+ // console.log(res.data);
+ if (res.data.tup == 'Roster' && typeof res.data.status !== 'undefined') {
+ e += `.${res.data.tup.toLowerCase()}.${res.data.status}`;
}
- } else return { status: '' };
+ }
+
+ console.log(`Subscribe event: ${e}`);
+ // console.log(r);
+ // console.log(res);
+
+ GlobalWidget.publish(e, res);
+ return { status: 'ok' };
+ } catch (e) {
+ console.log(e);
+ return { status: '' };
+ }
+ } else return { status: '' };
};
/**
* SERVER protocol for getting response from middleware
* @type {{}}
*/
-var $server = {}; $server.on = function onserver(r, cb) {
- if (is(r, 2, 'server')) {
- console.log(r['v'][1]);
- if (typeof cb == 'function') cb(r); return { status: "ok" };
- } else return { status: '' };
-}
+const $server = {}; $server.on = function onserver(r, cb) {
+ if (is(r, 2, 'server')) {
+ console.log(r.v[1]);
+ if (typeof cb === 'function') cb(r); return { status: 'ok' };
+ } return { status: '' };
+};
/**
* ROSTER: Managing Contact and Chat Lists
* @see https://github.com/NYNJA-MC/protocol/blob/master/v1/ROSTER.md
*/
-var $roster = {}; $roster.on = function onroster(r, cb) {
- if (is(r, lenRoster(), 'Roster')) {
- var res = decRoster(r),
- e = 'roster.' + res.status;
+const $roster = {}; $roster.on = function onroster(r, cb) {
+ if (is(r, lenRoster(), 'Roster')) {
+ let res = decRoster(r),
+ e = `roster.${res.status}`;
- console.log("Subscribe event: " + e);
- GlobalWidget.publish(e, res);
+ console.log(`Subscribe event: ${e}`);
+ GlobalWidget.publish(e, res);
- if (typeof cb == 'function') cb(r); return { status: "ok" };
- } else return { status: '' };
+ if (typeof cb === 'function') cb(r); return { status: 'ok' };
+ } return { status: '' };
};
/**
@@ -78,104 +78,103 @@ var $roster = {}; $roster.on = function onroster(r, cb) {
[],1507034024571,online,init}
*/
-var $profile = {}; $profile.on = function onprofile(r, cb) {
- if (is(r, lenProfile(), 'Profile')) {
- var res = decProfile(r),
- e = 'profile.' + res.status;
+const $profile = {}; $profile.on = function onprofile(r, cb) {
+ if (is(r, lenProfile(), 'Profile')) {
+ let res = decProfile(r),
+ e = `profile.${res.status}`;
- console.log("Subscribe event: " + e);
- //console.log(r);
- //console.log(res);
+ console.log(`Subscribe event: ${e}`);
+ // console.log(r);
+ // console.log(res);
- GlobalWidget.publish(e, res);
+ GlobalWidget.publish(e, res);
- if (typeof cb == 'function') cb(r); return { status: "ok" };
- } else return { status: '' };
+ if (typeof cb === 'function') cb(r); return { status: 'ok' };
+ } return { status: '' };
};
/**
* PERSON: External Settings
* @see https://github.com/NYNJA-MC/protocol/blob/master/v1/PERSON.md
*/
-var $person = {}; $person.on = function onperson(r, cb) {
- if (is(r, lenPerson(), 'Person')) {
-
- var res = decPerson(r),
- e = 'person.' + res.status;
+const $person = {}; $person.on = function onperson(r, cb) {
+ if (is(r, lenPerson(), 'Person')) {
+ let res = decPerson(r),
+ e = `person.${res.status}`;
- console.log("Subscribe event: " + e);
- //console.log(r);
- //console.log(res);
+ console.log(`Subscribe event: ${e}`);
+ // console.log(r);
+ // console.log(res);
- GlobalWidget.publish(e, res);
+ GlobalWidget.publish(e, res);
- if (typeof cb == 'function') cb(r); return { status: "ok" };
- } else return { status: '' };
+ if (typeof cb === 'function') cb(r); return { status: 'ok' };
+ } return { status: '' };
};
/**
* @see https://github.com/NYNJA-MC/protocol/blob/master/v1/ROSTER.md
*/
-var $contact = {}; $contact.on = function oncontact(r, cb) {
- if (is(r, lenContact(), 'Contact')) {
- var res = decContact(r),
- e = 'contact.' + res.status;
+const $contact = {}; $contact.on = function oncontact(r, cb) {
+ if (is(r, lenContact(), 'Contact')) {
+ let res = decContact(r),
+ e = `contact.${res.status}`;
- console.log("Subscribe event: " + e);
+ console.log(`Subscribe event: ${e}`);
- GlobalWidget.publish(e, res);
+ GlobalWidget.publish(e, res);
- if (typeof cb == 'function') cb(r); return { status: "ok" };
- } else return { status: '' };
+ if (typeof cb === 'function') cb(r); return { status: 'ok' };
+ } return { status: '' };
};
/**
* Friend
* @type {{}}
*/
-var $friend = {}; $friend.on = function onfriend(r, cb) {
- if (is(r, lenFriend(), 'Friend')) {
- var res = decFriend(r),
- e = 'friend.' + res.status;
+const $friend = {}; $friend.on = function onfriend(r, cb) {
+ if (is(r, lenFriend(), 'Friend')) {
+ let res = decFriend(r),
+ e = `friend.${res.status}`;
- console.log("Subscribe event: " + e);
+ console.log(`Subscribe event: ${e}`);
- GlobalWidget.publish(e, res);
+ GlobalWidget.publish(e, res);
- if (typeof cb == 'function') cb(r); return { status: "ok" };
- } else return { status: '' };
+ if (typeof cb === 'function') cb(r); return { status: 'ok' };
+ } return { status: '' };
};
/**
* MESSAGE: Retrieve History
* @see https://github.com/NYNJA-MC/protocol/blob/master/v1/MESSAGE.md
*/
-var $history = {}; $history.on = function onhistory(r, cb) {
- if (is(r, lenHistory(), 'History')) {
- var res = decHistory(r),
- e = 'history.' + res.status;
+const $history = {}; $history.on = function onhistory(r, cb) {
+ if (is(r, lenHistory(), 'History')) {
+ let res = decHistory(r),
+ e = `history.${res.status}`;
- console.log("Subscribe event: " + e);
+ console.log(`Subscribe event: ${e}`);
- GlobalWidget.publish(e, res);
+ GlobalWidget.publish(e, res);
- if (typeof cb == 'function') cb(r); return { status: "ok" };
- } else return { status: '' };
+ if (typeof cb === 'function') cb(r); return { status: 'ok' };
+ } return { status: '' };
};
/**
* MESSAGE: Sending and Receiving Messages
* @see https://github.com/NYNJA-MC/protocol/blob/master/v1/MESSAGE.md
*/
-var $message = {}; $message.on = function onmessage(r, cb) {
- if (is(r, lenMessage(), 'Message')) {
- var res = decMessage(r),
- e = 'message.' + res.status;
+const $message = {}; $message.on = function onmessage(r, cb) {
+ if (is(r, lenMessage(), 'Message')) {
+ let res = decMessage(r),
+ e = `message.${res.status}`;
- console.log("Subscribe event: " + e);
+ console.log(`Subscribe event: ${e}`);
- GlobalWidget.publish(e, res);
+ GlobalWidget.publish(e, res);
- if (typeof cb == 'function') cb(r); return { status: "ok" };
- } else return { status: '' };
-};
\ No newline at end of file
+ if (typeof cb === 'function') cb(r); return { status: 'ok' };
+ } return { status: '' };
+};
diff --git a/src/assets/vendor/utils/json-bert-old.js b/src/assets/vendor/utils/json-bert-old.js
index 2a63b44c1ea9885af7867b240a6a2b73c1e87f73..eb0f12569c22595ed345bd965a410f1d617f2451 100644
--- a/src/assets/vendor/utils/json-bert-old.js
+++ b/src/assets/vendor/utils/json-bert-old.js
@@ -1,1019 +1,1169 @@
-function clean(r) { for(var k in r) if(!r[k]) delete r[k]; return r; }
-function check_len(x) { try { return (eval('len'+utf8_dec(x.v[0].v))() == x.v.length) ? true : false }
-catch (e) { return false; } }
-
-function scalar(data) {
- var res = undefined;
- switch (typeof data) {
- case 'string': res = bin(data); break; case 'number': res = number(data); break;
- default: console.log('Strange data: ' + data); }
- return res; };
-function nil() { return {t: 106, v: undefined}; };
+function clean(r) { for (const k in r) if (!r[k]) delete r[k]; return r; }
+function check_len(x) {
+ try { return (eval(`len${utf8_dec(x.v[0].v)}`)() == x.v.length); } catch (e) { return false; }
+}
+
+function scalar(data) {
+ let res;
+ switch (typeof data) {
+ case 'string': res = bin(data); break; case 'number': res = number(data); break;
+ default: console.log(`Strange data: ${data}`);
+ }
+ return res;
+}
+function nil() { return { t: 106, v: undefined }; }
function decode(x) {
- if (typeof x == "undefined"){ //@TODO: need to add this condition to generator of models
- return x;
- } else if (x.t == 108) {
- var r = []; x.v.forEach(function(y) { r.push(decode(y)) }); return r;
- } else if (x.t == 109) {
- return utf8_dec(x.v);
- } else if (x.t == 104 && check_len(x)) {
- return eval('dec'+x.v[0].v)(x);
- } else if (x.t == 104) {
- var r=[]; x.v.forEach(function(a){r.push(decode(a))});
- return Object.assign({tup:'$'}, r);
- } else return x.v;
+ if (typeof x === 'undefined') { // @TODO: need to add this condition to generator of models
+ return x;
+ } else if (x.t == 108) {
+ var r = []; x.v.forEach((y) => { r.push(decode(y)); }); return r;
+ } else if (x.t == 109) {
+ return utf8_dec(x.v);
+ } else if (x.t == 104 && check_len(x)) {
+ return eval(`dec${x.v[0].v}`)(x);
+ } else if (x.t == 104) {
+ var r = []; x.v.forEach((a) => { r.push(decode(a)); });
+ return Object.assign({ tup: '$' }, r);
+ } return x.v;
}
function encode(x) {
- if (Array.isArray(x)) {
- var r = []; x.forEach(function(y) { r.push(encode(y)) }); return {t:108,v:r};
- } else if (typeof x == 'object') {
- switch (x.tup) {
- case '$': delete x['tup']; var r=[];
- Object.keys(x).map(function(p){return x[p];}).forEach(function(a){r.push(encode(a))});
- return {t:104, v:r};
- default: return eval('enc'+x.tup)(x); }
- } else return scalar(x);
+ if (Array.isArray(x)) {
+ var r = []; x.forEach((y) => { r.push(encode(y)); }); return { t: 108, v: r };
+ } else if (typeof x === 'object') {
+ switch (x.tup) {
+ case '$': delete x.tup; var r = [];
+ Object.keys(x).map(p => x[p]).forEach((a) => { r.push(encode(a)); });
+ return { t: 104, v: r };
+ default: return eval(`enc${x.tup}`)(x);
+ }
+ } else return scalar(x);
}
function encwriter(d) {
- var tup = atom('writer');
- var id = 'id' in d && d.id ? encode(d.id) : nil();
- var count = 'count' in d && d.count ? number(d.count) : nil();
- var cache = 'cache' in d && d.cache ? encode(d.cache) : nil();
- var args = 'args' in d && d.args ? encode(d.args) : nil();
- var first = 'first' in d && d.first ? encode(d.first) : nil();
- return tuple(tup,id,count,cache,args,first); }
+ const tup = atom('writer');
+ const id = 'id' in d && d.id ? encode(d.id) : nil();
+ const count = 'count' in d && d.count ? number(d.count) : nil();
+ const cache = 'cache' in d && d.cache ? encode(d.cache) : nil();
+ const args = 'args' in d && d.args ? encode(d.args) : nil();
+ const first = 'first' in d && d.first ? encode(d.first) : nil();
+ return tuple(tup, id, count, cache, args, first);
+}
function lenwriter() { return 6; }
function decwriter(d) {
- var r={}; r.tup = 'writer';
- r.id = d && d.v[1] ? decode(d.v[1].v) : undefined;
- r.count = d && d.v[2] ? d.v[2].v : undefined;
- r.cache = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.args = d && d.v[4] ? decode(d.v[4].v) : undefined;
- r.first = d && d.v[5] ? decode(d.v[5].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'writer';
+ r.id = d && d.v[1] ? decode(d.v[1].v) : undefined;
+ r.count = d && d.v[2] ? d.v[2].v : undefined;
+ r.cache = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.args = d && d.v[4] ? decode(d.v[4].v) : undefined;
+ r.first = d && d.v[5] ? decode(d.v[5].v) : undefined;
+ return clean(r);
+}
function encreader(d) {
- var tup = atom('reader');
- var id = 'id' in d && d.id ? encode(d.id) : nil();
- var pos = 'pos' in d && d.pos ? number(d.pos) : nil();
- var cache = 'cache' in d && d.cache ? number(d.cache) : nil();
- var args = 'args' in d && d.args ? encode(d.args) : nil();
- var feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
- var dir = 'dir' in d && d.dir ? encode(d.dir) : nil();
- return tuple(tup,id,pos,cache,args,feed,dir); }
+ const tup = atom('reader');
+ const id = 'id' in d && d.id ? encode(d.id) : nil();
+ const pos = 'pos' in d && d.pos ? number(d.pos) : nil();
+ const cache = 'cache' in d && d.cache ? number(d.cache) : nil();
+ const args = 'args' in d && d.args ? encode(d.args) : nil();
+ const feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
+ const dir = 'dir' in d && d.dir ? encode(d.dir) : nil();
+ return tuple(tup, id, pos, cache, args, feed, dir);
+}
function lenreader() { return 7; }
function decreader(d) {
- var r={}; r.tup = 'reader';
- r.id = d && d.v[1] ? decode(d.v[1].v) : undefined;
- r.pos = d && d.v[2] ? d.v[2].v : undefined;
- r.cache = d && d.v[3] ? d.v[3].v : undefined;
- r.args = d && d.v[4] ? decode(d.v[4].v) : undefined;
- r.feed = d && d.v[5] ? decode(d.v[5].v) : undefined;
- r.dir = d && d.v[6] ? decode(d.v[6]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'reader';
+ r.id = d && d.v[1] ? decode(d.v[1].v) : undefined;
+ r.pos = d && d.v[2] ? d.v[2].v : undefined;
+ r.cache = d && d.v[3] ? d.v[3].v : undefined;
+ r.args = d && d.v[4] ? decode(d.v[4].v) : undefined;
+ r.feed = d && d.v[5] ? decode(d.v[5].v) : undefined;
+ r.dir = d && d.v[6] ? decode(d.v[6]) : undefined;
+ return clean(r);
+}
function enccur(d) {
- var tup = atom('cur');
- var id = 'id' in d && d.id ? encode(d.id) : nil();
- var top = 'top' in d && d.top ? number(d.top) : nil();
- var bot = 'bot' in d && d.bot ? number(d.bot) : nil();
- var dir = 'dir' in d && d.dir ? encode(d.dir) : nil();
- var reader = 'reader' in d && d.reader ? encode(d.reader) : nil();
- var writer = 'writer' in d && d.writer ? encode(d.writer) : nil();
- var args = []; if ('args' in d && d.args)
- { d.args.forEach(function(x){
- args.push(encode(x))});
- args={t:108,v:args}; } else { args = nil() };
- return tuple(tup,id,top,bot,dir,reader,writer,args); }
+ const tup = atom('cur');
+ const id = 'id' in d && d.id ? encode(d.id) : nil();
+ const top = 'top' in d && d.top ? number(d.top) : nil();
+ const bot = 'bot' in d && d.bot ? number(d.bot) : nil();
+ const dir = 'dir' in d && d.dir ? encode(d.dir) : nil();
+ const reader = 'reader' in d && d.reader ? encode(d.reader) : nil();
+ const writer = 'writer' in d && d.writer ? encode(d.writer) : nil();
+ let args = []; if ('args' in d && d.args) {
+ d.args.forEach((x) => {
+ args.push(encode(x));
+ });
+ args = { t: 108, v: args };
+ } else { args = nil(); }
+ return tuple(tup, id, top, bot, dir, reader, writer, args);
+}
function lencur() { return 8; }
function deccur(d) {
- var r={}; r.tup = 'cur';
- r.id = d && d.v[1] ? decode(d.v[1].v) : undefined;
- r.top = d && d.v[2] ? d.v[2].v : undefined;
- r.bot = d && d.v[3] ? d.v[3].v : undefined;
- r.dir = d && d.v[4] ? decode(d.v[4]) : undefined;
- r.reader = d && d.v[5] ? decode(d.v[5].v) : undefined;
- r.writer = d && d.v[6] ? decode(d.v[6].v) : undefined;
- r.args = [];
- (d && d.v[7] && d.v[7].v) ?
- d.v[7].v.forEach(function(x){r.args.push(decode(x))}) :
- r.args = undefined;
- return clean(r); }
+ const r = {}; r.tup = 'cur';
+ r.id = d && d.v[1] ? decode(d.v[1].v) : undefined;
+ r.top = d && d.v[2] ? d.v[2].v : undefined;
+ r.bot = d && d.v[3] ? d.v[3].v : undefined;
+ r.dir = d && d.v[4] ? decode(d.v[4]) : undefined;
+ r.reader = d && d.v[5] ? decode(d.v[5].v) : undefined;
+ r.writer = d && d.v[6] ? decode(d.v[6].v) : undefined;
+ r.args = [];
+ (d && d.v[7] && d.v[7].v) ?
+ d.v[7].v.forEach((x) => { r.args.push(decode(x)); }) :
+ r.args = undefined;
+ return clean(r);
+}
function enciter(d) {
- var tup = atom('iter');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var container = 'container' in d && d.container ? atom(d.container) : nil();
- var feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- return tuple(tup,id,container,feed,next,prev); }
+ const tup = atom('iter');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const container = 'container' in d && d.container ? atom(d.container) : nil();
+ const feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ return tuple(tup, id, container, feed, next, prev);
+}
function leniter() { return 6; }
function deciter(d) {
- var r={}; r.tup = 'iter';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? d.v[2].v : undefined;
- r.feed = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.next = d && d.v[4] ? d.v[4].v : undefined;
- r.prev = d && d.v[5] ? d.v[5].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'iter';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? d.v[2].v : undefined;
+ r.feed = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.next = d && d.v[4] ? d.v[4].v : undefined;
+ r.prev = d && d.v[5] ? d.v[5].v : undefined;
+ return clean(r);
+}
function enccontainer(d) {
- var tup = atom('container');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var top = 'top' in d && d.top ? number(d.top) : nil();
- var rear = 'rear' in d && d.rear ? number(d.rear) : nil();
- var count = 'count' in d && d.count ? number(d.count) : nil();
- return tuple(tup,id,top,rear,count); }
+ const tup = atom('container');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const top = 'top' in d && d.top ? number(d.top) : nil();
+ const rear = 'rear' in d && d.rear ? number(d.rear) : nil();
+ const count = 'count' in d && d.count ? number(d.count) : nil();
+ return tuple(tup, id, top, rear, count);
+}
function lencontainer() { return 5; }
function deccontainer(d) {
- var r={}; r.tup = 'container';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.top = d && d.v[2] ? d.v[2].v : undefined;
- r.rear = d && d.v[3] ? d.v[3].v : undefined;
- r.count = d && d.v[4] ? d.v[4].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'container';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.top = d && d.v[2] ? d.v[2].v : undefined;
+ r.rear = d && d.v[3] ? d.v[3].v : undefined;
+ r.count = d && d.v[4] ? d.v[4].v : undefined;
+ return clean(r);
+}
function enciterator(d) {
- var tup = atom('iterator');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var container = 'container' in d && d.container ? atom(d.container) : nil();
- var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var feeds = []; if ('feeds' in d && d.feeds)
- { d.feeds.forEach(function(x){
- feeds.push(encode(x))});
- feeds={t:108,v:feeds}; } else { feeds = nil() };
- return tuple(tup,id,container,feed_id,prev,next,feeds); }
+ const tup = atom('iterator');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const container = 'container' in d && d.container ? atom(d.container) : nil();
+ const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ let feeds = []; if ('feeds' in d && d.feeds) {
+ d.feeds.forEach((x) => {
+ feeds.push(encode(x));
+ });
+ feeds = { t: 108, v: feeds };
+ } else { feeds = nil(); }
+ return tuple(tup, id, container, feed_id, prev, next, feeds);
+}
function leniterator() { return 7; }
function deciterator(d) {
- var r={}; r.tup = 'iterator';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? d.v[2].v : undefined;
- r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.prev = d && d.v[4] ? d.v[4].v : undefined;
- r.next = d && d.v[5] ? d.v[5].v : undefined;
- r.feeds = [];
- (d && d.v[6] && d.v[6].v) ?
- d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) :
- r.feeds = undefined;
- return clean(r); }
+ const r = {}; r.tup = 'iterator';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? d.v[2].v : undefined;
+ r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.prev = d && d.v[4] ? d.v[4].v : undefined;
+ r.next = d && d.v[5] ? d.v[5].v : undefined;
+ r.feeds = [];
+ (d && d.v[6] && d.v[6].v) ?
+ d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) :
+ r.feeds = undefined;
+ return clean(r);
+}
function enclog(d) {
- var tup = atom('log');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var top = 'top' in d && d.top ? number(d.top) : nil();
- var rear = 'rear' in d && d.rear ? number(d.rear) : nil();
- var count = 'count' in d && d.count ? number(d.count) : nil();
- return tuple(tup,id,top,rear,count); }
+ const tup = atom('log');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const top = 'top' in d && d.top ? number(d.top) : nil();
+ const rear = 'rear' in d && d.rear ? number(d.rear) : nil();
+ const count = 'count' in d && d.count ? number(d.count) : nil();
+ return tuple(tup, id, top, rear, count);
+}
function lenlog() { return 5; }
function declog(d) {
- var r={}; r.tup = 'log';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.top = d && d.v[2] ? d.v[2].v : undefined;
- r.rear = d && d.v[3] ? d.v[3].v : undefined;
- r.count = d && d.v[4] ? d.v[4].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'log';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.top = d && d.v[2] ? d.v[2].v : undefined;
+ r.rear = d && d.v[3] ? d.v[3].v : undefined;
+ r.count = d && d.v[4] ? d.v[4].v : undefined;
+ return clean(r);
+}
function encoperation(d) {
- var tup = atom('operation');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var container = 'container' in d && d.container ? atom(d.container) : nil();
- var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var feeds = []; if ('feeds' in d && d.feeds)
- { d.feeds.forEach(function(x){
- feeds.push(encode(x))});
- feeds={t:108,v:feeds}; } else { feeds = nil() };
- return tuple(tup,id,container,feed_id,prev,next,feeds); }
+ const tup = atom('operation');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const container = 'container' in d && d.container ? atom(d.container) : nil();
+ const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ let feeds = []; if ('feeds' in d && d.feeds) {
+ d.feeds.forEach((x) => {
+ feeds.push(encode(x));
+ });
+ feeds = { t: 108, v: feeds };
+ } else { feeds = nil(); }
+ return tuple(tup, id, container, feed_id, prev, next, feeds);
+}
function lenoperation() { return 7; }
function decoperation(d) {
- var r={}; r.tup = 'operation';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? d.v[2].v : undefined;
- r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.prev = d && d.v[4] ? d.v[4].v : undefined;
- r.next = d && d.v[5] ? d.v[5].v : undefined;
- r.feeds = [];
- (d && d.v[6] && d.v[6].v) ?
- d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) :
- r.feeds = undefined;
- return clean(r); }
+ const r = {}; r.tup = 'operation';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? d.v[2].v : undefined;
+ r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.prev = d && d.v[4] ? d.v[4].v : undefined;
+ r.next = d && d.v[5] ? d.v[5].v : undefined;
+ r.feeds = [];
+ (d && d.v[6] && d.v[6].v) ?
+ d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) :
+ r.feeds = undefined;
+ return clean(r);
+}
function encerror(d) {
- var tup = atom('error');
- var code = 'code' in d && d.code ? encode(d.code) : nil();
- return tuple(tup,code); }
+ const tup = atom('error');
+ const code = 'code' in d && d.code ? encode(d.code) : nil();
+ return tuple(tup, code);
+}
function lenerror() { return 2; }
function decerror(d) {
- var r={}; r.tup = 'error';
- r.code = d && d.v[1] ? decode(d.v[1]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'error';
+ r.code = d && d.v[1] ? decode(d.v[1]) : undefined;
+ return clean(r);
+}
function encok(d) {
- var tup = atom('ok');
- var code = 'code' in d && d.code ? encode(d.code) : nil();
- return tuple(tup,code); }
+ const tup = atom('ok');
+ const code = 'code' in d && d.code ? encode(d.code) : nil();
+ return tuple(tup, code);
+}
function lenok() { return 2; }
function decok(d) {
- var r={}; r.tup = 'ok';
- r.code = d && d.v[1] ? decode(d.v[1]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'ok';
+ r.code = d && d.v[1] ? decode(d.v[1]) : undefined;
+ return clean(r);
+}
function encerror2(d) {
- var tup = atom('error2');
- var code = 'code' in d && d.code ? atom(d.code) : nil();
- var src = 'src' in d && d.src ? encode(d.src) : nil();
- return tuple(tup,code,src); }
+ const tup = atom('error2');
+ const code = 'code' in d && d.code ? atom(d.code) : nil();
+ const src = 'src' in d && d.src ? encode(d.src) : nil();
+ return tuple(tup, code, src);
+}
function lenerror2() { return 3; }
function decerror2(d) {
- var r={}; r.tup = 'error2';
- r.code = d && d.v[1] ? d.v[1].v : undefined;
- r.src = d && d.v[2] ? decode(d.v[2]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'error2';
+ r.code = d && d.v[1] ? d.v[1].v : undefined;
+ r.src = d && d.v[2] ? decode(d.v[2]) : undefined;
+ return clean(r);
+}
function encok2(d) {
- var tup = atom('ok2');
- var code = 'code' in d && d.code ? atom(d.code) : nil();
- var src = 'src' in d && d.src ? encode(d.src) : nil();
- return tuple(tup,code,src); }
+ const tup = atom('ok2');
+ const code = 'code' in d && d.code ? atom(d.code) : nil();
+ const src = 'src' in d && d.src ? encode(d.src) : nil();
+ return tuple(tup, code, src);
+}
function lenok2() { return 3; }
function decok2(d) {
- var r={}; r.tup = 'ok2';
- r.code = d && d.v[1] ? d.v[1].v : undefined;
- r.src = d && d.v[2] ? decode(d.v[2]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'ok2';
+ r.code = d && d.v[1] ? d.v[1].v : undefined;
+ r.src = d && d.v[2] ? decode(d.v[2]) : undefined;
+ return clean(r);
+}
function encio(d) {
- var tup = atom('io');
- var code = 'code' in d && d.code ? encode(d.code) : nil();
- var data = 'data' in d && d.data ? encode(d.data) : nil();
- return tuple(tup,code,data); }
+ const tup = atom('io');
+ const code = 'code' in d && d.code ? encode(d.code) : nil();
+ const data = 'data' in d && d.data ? encode(d.data) : nil();
+ return tuple(tup, code, data);
+}
function lenio() { return 3; }
function decio(d) {
- var r={}; r.tup = 'io';
- r.code = d && d.v[1] ? decode(d.v[1]) : undefined;
- r.data = d && d.v[2] ? decode(d.v[2]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'io';
+ r.code = d && d.v[1] ? decode(d.v[1]) : undefined;
+ r.data = d && d.v[2] ? decode(d.v[2]) : undefined;
+ return clean(r);
+}
function encchain(d) {
- var tup = atom('chain');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var top = 'top' in d && d.top ? number(d.top) : nil();
- var rear = 'rear' in d && d.rear ? number(d.rear) : nil();
- var count = 'count' in d && d.count ? number(d.count) : nil();
- return tuple(tup,id,top,rear,count); }
+ const tup = atom('chain');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const top = 'top' in d && d.top ? number(d.top) : nil();
+ const rear = 'rear' in d && d.rear ? number(d.rear) : nil();
+ const count = 'count' in d && d.count ? number(d.count) : nil();
+ return tuple(tup, id, top, rear, count);
+}
function lenchain() { return 5; }
function decchain(d) {
- var r={}; r.tup = 'chain';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.top = d && d.v[2] ? d.v[2].v : undefined;
- r.rear = d && d.v[3] ? d.v[3].v : undefined;
- r.count = d && d.v[4] ? d.v[4].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'chain';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.top = d && d.v[2] ? d.v[2].v : undefined;
+ r.rear = d && d.v[3] ? d.v[3].v : undefined;
+ r.count = d && d.v[4] ? d.v[4].v : undefined;
+ return clean(r);
+}
function encpush(d) {
- var tup = atom('push');
- var model = 'model' in d && d.model ? bin(d.model) : nil();
- var type = 'type' in d && d.type ? bin(d.type) : nil();
- var title = 'title' in d && d.title ? bin(d.title) : nil();
- var alert = 'alert' in d && d.alert ? bin(d.alert) : nil();
- var badge = 'badge' in d && d.badge ? number(d.badge) : nil();
- var sound = 'sound' in d && d.sound ? bin(d.sound) : nil();
- return tuple(tup,model,type,title,alert,badge,sound); }
+ const tup = atom('push');
+ const model = 'model' in d && d.model ? bin(d.model) : nil();
+ const type = 'type' in d && d.type ? bin(d.type) : nil();
+ const title = 'title' in d && d.title ? bin(d.title) : nil();
+ const alert = 'alert' in d && d.alert ? bin(d.alert) : nil();
+ const badge = 'badge' in d && d.badge ? number(d.badge) : nil();
+ const sound = 'sound' in d && d.sound ? bin(d.sound) : nil();
+ return tuple(tup, model, type, title, alert, badge, sound);
+}
function lenpush() { return 7; }
function decpush(d) {
- var r={}; r.tup = 'push';
- r.model = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.type = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.title = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.alert = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
- r.badge = d && d.v[5] ? d.v[5].v : undefined;
- r.sound = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'push';
+ r.model = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.type = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.title = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.alert = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
+ r.badge = d && d.v[5] ? d.v[5].v : undefined;
+ r.sound = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
+ return clean(r);
+}
function encSearch(d) {
- var tup = atom('Search');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var ref = 'ref' in d && d.ref ? bin(d.ref) : nil();
- var field = 'field' in d && d.field ? bin(d.field) : nil();
- var type = 'type' in d && d.type ? atom(d.type) : nil();
- var value = 'value' in d && d.value ? encode(d.value) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,id,ref,field,type,value,status); }
+ const tup = atom('Search');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const ref = 'ref' in d && d.ref ? bin(d.ref) : nil();
+ const field = 'field' in d && d.field ? bin(d.field) : nil();
+ const type = 'type' in d && d.type ? atom(d.type) : nil();
+ const value = 'value' in d && d.value ? encode(d.value) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(tup, id, ref, field, type, value, status);
+}
function lenSearch() { return 7; }
function decSearch(d) {
- var r={}; r.tup = 'Search';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.ref = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.field = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.type = d && d.v[4] ? decode(d.v[4]) : undefined;
- r.value = d && d.v[5] ? decode(d.v[5].v) : undefined;
- r.status = d && d.v[6] ? decode(d.v[6]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Search';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.ref = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.field = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.type = d && d.v[4] ? decode(d.v[4]) : undefined;
+ r.value = d && d.v[5] ? decode(d.v[5].v) : undefined;
+ r.status = d && d.v[6] ? decode(d.v[6]) : undefined;
+ return clean(r);
+}
function encp2p(d) {
- var tup = atom('p2p');
- var from = 'from' in d && d.from ? bin(d.from) : nil();
- var to = 'to' in d && d.to ? bin(d.to) : nil();
- return tuple(tup,from,to); }
+ const tup = atom('p2p');
+ const from = 'from' in d && d.from ? bin(d.from) : nil();
+ const to = 'to' in d && d.to ? bin(d.to) : nil();
+ return tuple(tup, from, to);
+}
function lenp2p() { return 3; }
function decp2p(d) {
- var r={}; r.tup = 'p2p';
- r.from = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.to = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'p2p';
+ r.from = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.to = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ return clean(r);
+}
function encmuc(d) {
- var tup = atom('muc');
- var name = 'name' in d && d.name ? bin(d.name) : nil();
- return tuple(tup,name); }
+ const tup = atom('muc');
+ const name = 'name' in d && d.name ? bin(d.name) : nil();
+ return tuple(tup, name);
+}
function lenmuc() { return 2; }
function decmuc(d) {
- var r={}; r.tup = 'muc';
- r.name = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'muc';
+ r.name = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ return clean(r);
+}
function encCDR(d) {
- var tup = atom('CDR');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var container = 'container' in d && d.container ? atom(d.container) : nil();
- var feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- var from = 'from' in d && d.from ? bin(d.from) : nil();
- var to = 'to' in d && d.to ? bin(d.to) : nil();
- var start = 'start' in d && d.start ? number(d.start) : nil();
- var stop = 'stop' in d && d.stop ? number(d.stop) : nil();
- var type = 'type' in d && d.type ? encode(d.type) : nil();
- var desc = 'desc' in d && d.desc ? bin(d.desc) : nil();
- var bill = 'bill' in d && d.bill ? number(d.bill) : nil();
- var tariff = 'tariff' in d && d.tariff ? bin(d.tariff) : nil();
- return tuple(tup,id,container,feed,next,prev,from,to,start,stop,type,
- desc,bill,tariff); }
+ const tup = atom('CDR');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const container = 'container' in d && d.container ? atom(d.container) : nil();
+ const feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ const from = 'from' in d && d.from ? bin(d.from) : nil();
+ const to = 'to' in d && d.to ? bin(d.to) : nil();
+ const start = 'start' in d && d.start ? number(d.start) : nil();
+ const stop = 'stop' in d && d.stop ? number(d.stop) : nil();
+ const type = 'type' in d && d.type ? encode(d.type) : nil();
+ const desc = 'desc' in d && d.desc ? bin(d.desc) : nil();
+ const bill = 'bill' in d && d.bill ? number(d.bill) : nil();
+ const tariff = 'tariff' in d && d.tariff ? bin(d.tariff) : nil();
+ return tuple(
+ tup, id, container, feed, next, prev, from, to, start, stop, type,
+ desc, bill, tariff
+ );
+}
function lenCDR() { return 14; }
function decCDR(d) {
- var r={}; r.tup = 'CDR';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? d.v[2].v : undefined;
- r.feed = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.next = d && d.v[4] ? d.v[4].v : undefined;
- r.prev = d && d.v[5] ? d.v[5].v : undefined;
- r.from = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
- r.to = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
- r.start = d && d.v[8] ? d.v[8].v : undefined;
- r.stop = d && d.v[9] ? d.v[9].v : undefined;
- r.type = d && d.v[10] ? decode(d.v[10]) : undefined;
- r.desc = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined;
- r.bill = d && d.v[12] ? d.v[12].v : undefined;
- r.tariff = d && d.v[13] ? utf8_dec(d.v[13].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'CDR';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? d.v[2].v : undefined;
+ r.feed = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.next = d && d.v[4] ? d.v[4].v : undefined;
+ r.prev = d && d.v[5] ? d.v[5].v : undefined;
+ r.from = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
+ r.to = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
+ r.start = d && d.v[8] ? d.v[8].v : undefined;
+ r.stop = d && d.v[9] ? d.v[9].v : undefined;
+ r.type = d && d.v[10] ? decode(d.v[10]) : undefined;
+ r.desc = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined;
+ r.bill = d && d.v[12] ? d.v[12].v : undefined;
+ r.tariff = d && d.v[13] ? utf8_dec(d.v[13].v) : undefined;
+ return clean(r);
+}
function encMember(d) {
- var tup = atom('Member');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var container = 'container' in d && d.container ? encode(d.container) : nil();
- var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var feeds = []; if ('feeds' in d && d.feeds)
- { d.feeds.forEach(function(x){
- feeds.push(encode(x))});
- feeds={t:108,v:feeds}; } else { feeds = nil() };
- var phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil();
- var avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil();
- var names = 'names' in d && d.names ? bin(d.names) : nil();
- var surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil();
- var alias = 'alias' in d && d.alias ? bin(d.alias) : nil();
- var email = 'email' in d && d.email ? bin(d.email) : nil();
- var vox_id = 'vox_id' in d && d.vox_id ? bin(d.vox_id) : nil();
- var reader = 'reader' in d && d.reader ? number(d.reader) : nil();
- var update = 'update' in d && d.update ? number(d.update) : nil();
- var presence = 'presence' in d && d.presence ? atom(d.presence) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,id,container,feed_id,prev,next,feeds,phone_id,avatar,names,surnames,
- alias,email,vox_id,reader,update,presence,status); }
+ const tup = atom('Member');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const container = 'container' in d && d.container ? encode(d.container) : nil();
+ const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ let feeds = []; if ('feeds' in d && d.feeds) {
+ d.feeds.forEach((x) => {
+ feeds.push(encode(x));
+ });
+ feeds = { t: 108, v: feeds };
+ } else { feeds = nil(); }
+ const phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil();
+ const avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil();
+ const names = 'names' in d && d.names ? bin(d.names) : nil();
+ const surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil();
+ const alias = 'alias' in d && d.alias ? bin(d.alias) : nil();
+ const email = 'email' in d && d.email ? bin(d.email) : nil();
+ const vox_id = 'vox_id' in d && d.vox_id ? bin(d.vox_id) : nil();
+ const reader = 'reader' in d && d.reader ? number(d.reader) : nil();
+ const update = 'update' in d && d.update ? number(d.update) : nil();
+ const presence = 'presence' in d && d.presence ? atom(d.presence) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(
+ tup, id, container, feed_id, prev, next, feeds, phone_id, avatar, names, surnames,
+ alias, email, vox_id, reader, update, presence, status
+ );
+}
function lenMember() { return 18; }
function decMember(d) {
- var r={}; r.tup = 'Member';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? decode(d.v[2]) : undefined;
- r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined;
- r.prev = d && d.v[4] ? d.v[4].v : undefined;
- r.next = d && d.v[5] ? d.v[5].v : undefined;
- r.feeds = [];
- (d && d.v[6] && d.v[6].v) ?
- d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) :
- r.feeds = undefined;
- r.phone_id = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
- r.avatar = d && d.v[8] ? utf8_dec(d.v[8].v) : undefined;
- r.names = d && d.v[9] ? utf8_dec(d.v[9].v) : undefined;
- r.surnames = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined;
- r.alias = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined;
- r.email = d && d.v[12] ? utf8_dec(d.v[12].v) : undefined;
- r.vox_id = d && d.v[13] ? utf8_dec(d.v[13].v) : undefined;
- r.reader = d && d.v[14] ? d.v[14].v : undefined;
- r.update = d && d.v[15] ? d.v[15].v : undefined;
- r.presence = d && d.v[16] ? decode(d.v[16]) : undefined;
- r.status = d && d.v[17] ? decode(d.v[17]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Member';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? decode(d.v[2]) : undefined;
+ r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined;
+ r.prev = d && d.v[4] ? d.v[4].v : undefined;
+ r.next = d && d.v[5] ? d.v[5].v : undefined;
+ r.feeds = [];
+ (d && d.v[6] && d.v[6].v) ?
+ d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) :
+ r.feeds = undefined;
+ r.phone_id = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
+ r.avatar = d && d.v[8] ? utf8_dec(d.v[8].v) : undefined;
+ r.names = d && d.v[9] ? utf8_dec(d.v[9].v) : undefined;
+ r.surnames = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined;
+ r.alias = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined;
+ r.email = d && d.v[12] ? utf8_dec(d.v[12].v) : undefined;
+ r.vox_id = d && d.v[13] ? utf8_dec(d.v[13].v) : undefined;
+ r.reader = d && d.v[14] ? d.v[14].v : undefined;
+ r.update = d && d.v[15] ? d.v[15].v : undefined;
+ r.presence = d && d.v[16] ? decode(d.v[16]) : undefined;
+ r.status = d && d.v[17] ? decode(d.v[17]) : undefined;
+ return clean(r);
+}
function encCursor(d) {
- var tup = atom('Cursor');
- var feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
- var roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil();
- var position = 'position' in d && d.position ? number(d.position) : nil();
- return tuple(tup,feed,roster_id,position); }
+ const tup = atom('Cursor');
+ const feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
+ const roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil();
+ const position = 'position' in d && d.position ? number(d.position) : nil();
+ return tuple(tup, feed, roster_id, position);
+}
function lenCursor() { return 4; }
function decCursor(d) {
- var r={}; r.tup = 'Cursor';
- r.feed = d && d.v[1] ? decode(d.v[1]) : undefined;
- r.roster_id = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.position = d && d.v[3] ? d.v[3].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Cursor';
+ r.feed = d && d.v[1] ? decode(d.v[1]) : undefined;
+ r.roster_id = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.position = d && d.v[3] ? d.v[3].v : undefined;
+ return clean(r);
+}
function encPerson(d) {
- var tup = atom('Person');
- var id = 'id' in d && d.id ? bin(d.id) : nil();
- var phonelist = []; if ('phonelist' in d && d.phonelist)
- { d.phonelist.forEach(function(x){
- phonelist.push(encode(x))});
- phonelist={t:108,v:phonelist}; } else { phonelist = nil() };
- var alias = []; if ('alias' in d && d.alias)
- { d.alias.forEach(function(x){
- alias.push(encode(x))});
- alias={t:108,v:alias}; } else { alias = nil() };
- var localize = []; if ('localize' in d && d.localize)
- { d.localize.forEach(function(x){
- localize.push(encode(x))});
- localize={t:108,v:localize}; } else { localize = nil() };
- var NotificationSettings = []; if ('NotificationSettings' in d && d.NotificationSettings)
- { d.NotificationSettings.forEach(function(x){
- NotificationSettings.push(encode(x))});
- NotificationSettings={t:108,v:NotificationSettings}; } else { NotificationSettings = nil() };
- var SoundSettings = []; if ('SoundSettings' in d && d.SoundSettings)
- { d.SoundSettings.forEach(function(x){
- SoundSettings.push(encode(x))});
- SoundSettings={t:108,v:SoundSettings}; } else { SoundSettings = nil() };
- var ThemeID = 'ThemeID' in d && d.ThemeID ? bin(d.ThemeID) : nil();
- var BlockUsers = []; if ('BlockUsers' in d && d.BlockUsers)
- { d.BlockUsers.forEach(function(x){
- BlockUsers.push(encode(x))});
- BlockUsers={t:108,v:BlockUsers}; } else { BlockUsers = nil() };
- var balance = 'balance' in d && d.balance ? number(d.balance) : nil();
- var isParticipants = []; if ('isParticipants' in d && d.isParticipants)
- { d.isParticipants.forEach(function(x){
- isParticipants.push(encode(x))});
- isParticipants={t:108,v:isParticipants}; } else { isParticipants = nil() };
- var status = 'status' in d && d.status ? encode(d.status) : nil();
- return tuple(tup,id,phonelist,alias,localize,NotificationSettings,SoundSettings,ThemeID,BlockUsers,balance,isParticipants,status); }
+ const tup = atom('Person');
+ const id = 'id' in d && d.id ? bin(d.id) : nil();
+ let phonelist = []; if ('phonelist' in d && d.phonelist) {
+ d.phonelist.forEach((x) => {
+ phonelist.push(encode(x));
+ });
+ phonelist = { t: 108, v: phonelist };
+ } else { phonelist = nil(); }
+ let alias = []; if ('alias' in d && d.alias) {
+ d.alias.forEach((x) => {
+ alias.push(encode(x));
+ });
+ alias = { t: 108, v: alias };
+ } else { alias = nil(); }
+ let localize = []; if ('localize' in d && d.localize) {
+ d.localize.forEach((x) => {
+ localize.push(encode(x));
+ });
+ localize = { t: 108, v: localize };
+ } else { localize = nil(); }
+ let NotificationSettings = []; if ('NotificationSettings' in d && d.NotificationSettings) {
+ d.NotificationSettings.forEach((x) => {
+ NotificationSettings.push(encode(x));
+ });
+ NotificationSettings = { t: 108, v: NotificationSettings };
+ } else { NotificationSettings = nil(); }
+ let SoundSettings = []; if ('SoundSettings' in d && d.SoundSettings) {
+ d.SoundSettings.forEach((x) => {
+ SoundSettings.push(encode(x));
+ });
+ SoundSettings = { t: 108, v: SoundSettings };
+ } else { SoundSettings = nil(); }
+ const ThemeID = 'ThemeID' in d && d.ThemeID ? bin(d.ThemeID) : nil();
+ let BlockUsers = []; if ('BlockUsers' in d && d.BlockUsers) {
+ d.BlockUsers.forEach((x) => {
+ BlockUsers.push(encode(x));
+ });
+ BlockUsers = { t: 108, v: BlockUsers };
+ } else { BlockUsers = nil(); }
+ const balance = 'balance' in d && d.balance ? number(d.balance) : nil();
+ let isParticipants = []; if ('isParticipants' in d && d.isParticipants) {
+ d.isParticipants.forEach((x) => {
+ isParticipants.push(encode(x));
+ });
+ isParticipants = { t: 108, v: isParticipants };
+ } else { isParticipants = nil(); }
+ const status = 'status' in d && d.status ? encode(d.status) : nil();
+ return tuple(tup, id, phonelist, alias, localize, NotificationSettings, SoundSettings, ThemeID, BlockUsers, balance, isParticipants, status);
+}
function lenPerson() { return 12; }
function decPerson(d) {
- var r={}; r.tup = 'Person';
- r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.phonelist = [];
- (d && d.v[2] && d.v[2].v) ?
- d.v[2].v.forEach(function(x){r.phonelist.push(decode(x))}) :
- r.phonelist = undefined;
- r.alias = [];
- (d && d.v[3] && d.v[3].v) ?
- d.v[3].v.forEach(function(x){r.alias.push(decode(x))}) :
- r.alias = undefined;
- r.localize = [];
- (d && d.v[4] && d.v[4].v) ?
- d.v[4].v.forEach(function(x){r.localize.push(decode(x))}) :
- r.localize = undefined;
- r.NotificationSettings = [];
- (d && d.v[5] && d.v[5].v) ?
- d.v[5].v.forEach(function(x){r.NotificationSettings.push(decode(x))}) :
- r.NotificationSettings = undefined;
- r.SoundSettings = [];
- (d && d.v[6] && d.v[6].v) ?
- d.v[6].v.forEach(function(x){r.SoundSettings.push(decode(x))}) :
- r.SoundSettings = undefined;
- r.ThemeID = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
- r.BlockUsers = [];
- (d && d.v[8] && d.v[8].v) ?
- d.v[8].v.forEach(function(x){r.BlockUsers.push(decode(x))}) :
- r.BlockUsers = undefined;
- r.balance = d && d.v[9] ? d.v[9].v : undefined;
- r.isParticipants = [];
- (d && d.v[10] && d.v[10].v) ?
- d.v[10].v.forEach(function(x){r.isParticipants.push(decode(x))}) :
- r.isParticipants = undefined;
- r.status = d && d.v[11] ? decode(d.v[11]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Person';
+ r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.phonelist = [];
+ (d && d.v[2] && d.v[2].v) ?
+ d.v[2].v.forEach((x) => { r.phonelist.push(decode(x)); }) :
+ r.phonelist = undefined;
+ r.alias = [];
+ (d && d.v[3] && d.v[3].v) ?
+ d.v[3].v.forEach((x) => { r.alias.push(decode(x)); }) :
+ r.alias = undefined;
+ r.localize = [];
+ (d && d.v[4] && d.v[4].v) ?
+ d.v[4].v.forEach((x) => { r.localize.push(decode(x)); }) :
+ r.localize = undefined;
+ r.NotificationSettings = [];
+ (d && d.v[5] && d.v[5].v) ?
+ d.v[5].v.forEach((x) => { r.NotificationSettings.push(decode(x)); }) :
+ r.NotificationSettings = undefined;
+ r.SoundSettings = [];
+ (d && d.v[6] && d.v[6].v) ?
+ d.v[6].v.forEach((x) => { r.SoundSettings.push(decode(x)); }) :
+ r.SoundSettings = undefined;
+ r.ThemeID = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
+ r.BlockUsers = [];
+ (d && d.v[8] && d.v[8].v) ?
+ d.v[8].v.forEach((x) => { r.BlockUsers.push(decode(x)); }) :
+ r.BlockUsers = undefined;
+ r.balance = d && d.v[9] ? d.v[9].v : undefined;
+ r.isParticipants = [];
+ (d && d.v[10] && d.v[10].v) ?
+ d.v[10].v.forEach((x) => { r.isParticipants.push(decode(x)); }) :
+ r.isParticipants = undefined;
+ r.status = d && d.v[11] ? decode(d.v[11]) : undefined;
+ return clean(r);
+}
function encDesc(d) {
- var tup = atom('Desc');
- var mime = 'mime' in d && d.mime ? bin(d.mime) : nil();
- var payload = 'payload' in d && d.payload ? bin(d.payload) : nil();
- var size = 'size' in d && d.size ? number(d.size) : nil();
- var filename = 'filename' in d && d.filename ? bin(d.filename) : nil();
- var info = 'info' in d && d.info ? bin(d.info) : nil();
- return tuple(tup,mime,payload,size,filename,info); }
+ const tup = atom('Desc');
+ const mime = 'mime' in d && d.mime ? bin(d.mime) : nil();
+ const payload = 'payload' in d && d.payload ? bin(d.payload) : nil();
+ const size = 'size' in d && d.size ? number(d.size) : nil();
+ const filename = 'filename' in d && d.filename ? bin(d.filename) : nil();
+ const info = 'info' in d && d.info ? bin(d.info) : nil();
+ return tuple(tup, mime, payload, size, filename, info);
+}
function lenDesc() { return 6; }
function decDesc(d) {
- var r={}; r.tup = 'Desc';
- r.mime = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.size = d && d.v[3] ? d.v[3].v : undefined;
- r.filename = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
- r.info = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Desc';
+ r.mime = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.size = d && d.v[3] ? d.v[3].v : undefined;
+ r.filename = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
+ r.info = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
+ return clean(r);
+}
function encMessage(d) {
- var tup = atom('Message');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- //var container = 'container' in d && d.container ? encode(d.container) : nil();
- var container = 'container' in d && d.container ? atom(d.container) : nil();
- var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var msg_id = 'msg_id' in d && d.msg_id ? bin(d.msg_id) : nil();
- var from = 'from' in d && d.from ? bin(d.from) : nil();
- var to = 'to' in d && d.to ? bin(d.to) : nil();
- var created = 'created' in d && d.created ? encode(d.created) : nil();
- var files = []; if ('files' in d && d.files)
- { d.files.forEach(function(x){
- files.push(encode(x))});
- files={t:108,v:files}; } else { files = nil() };
- var type = 'type' in d && d.type ? encode(d.type) : nil();
- var edit_msg = 'edit_msg' in d && d.edit_msg ? number(d.edit_msg) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,id,container,feed_id,prev,next,msg_id,from,to,created,files,
- type,edit_msg,status); }
+ const tup = atom('Message');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ // var container = 'container' in d && d.container ? encode(d.container) : nil();
+ const container = 'container' in d && d.container ? atom(d.container) : nil();
+ const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ const msg_id = 'msg_id' in d && d.msg_id ? bin(d.msg_id) : nil();
+ const from = 'from' in d && d.from ? bin(d.from) : nil();
+ const to = 'to' in d && d.to ? bin(d.to) : nil();
+ const created = 'created' in d && d.created ? encode(d.created) : nil();
+ let files = []; if ('files' in d && d.files) {
+ d.files.forEach((x) => {
+ files.push(encode(x));
+ });
+ files = { t: 108, v: files };
+ } else { files = nil(); }
+ const type = 'type' in d && d.type ? encode(d.type) : nil();
+ const edit_msg = 'edit_msg' in d && d.edit_msg ? number(d.edit_msg) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(
+ tup, id, container, feed_id, prev, next, msg_id, from, to, created, files,
+ type, edit_msg, status
+ );
+}
function lenMessage() { return 14; }
function decMessage(d) {
- var r={}; r.tup = 'Message';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? decode(d.v[2]) : undefined;
- r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined;
- r.prev = d && d.v[4] ? d.v[4].v : undefined;
- r.next = d && d.v[5] ? d.v[5].v : undefined;
- r.msg_id = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
- r.from = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
- r.to = d && d.v[8] ? utf8_dec(d.v[8].v) : undefined;
- r.created = d && d.v[9] ? decode(d.v[9]) : undefined;
- r.files = [];
- (d && d.v[10] && d.v[10].v) ?
- d.v[10].v.forEach(function(x){r.files.push(decode(x))}) :
- r.files = undefined;
- r.type = d && d.v[11] ? decode(d.v[11]) : undefined;
- r.edit_msg = d && d.v[12] ? d.v[12].v : undefined;
- r.status = d && d.v[13] ? decode(d.v[13]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Message';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? decode(d.v[2]) : undefined;
+ r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined;
+ r.prev = d && d.v[4] ? d.v[4].v : undefined;
+ r.next = d && d.v[5] ? d.v[5].v : undefined;
+ r.msg_id = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
+ r.from = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
+ r.to = d && d.v[8] ? utf8_dec(d.v[8].v) : undefined;
+ r.created = d && d.v[9] ? decode(d.v[9]) : undefined;
+ r.files = [];
+ (d && d.v[10] && d.v[10].v) ?
+ d.v[10].v.forEach((x) => { r.files.push(decode(x)); }) :
+ r.files = undefined;
+ r.type = d && d.v[11] ? decode(d.v[11]) : undefined;
+ r.edit_msg = d && d.v[12] ? d.v[12].v : undefined;
+ r.status = d && d.v[13] ? decode(d.v[13]) : undefined;
+ return clean(r);
+}
function encRoom(d) {
- var tup = atom('Room');
- var id = 'id' in d && d.id ? bin(d.id) : nil();
- var name = 'name' in d && d.name ? bin(d.name) : nil();
- var description = 'description' in d && d.description ? bin(d.description) : nil();
- var settings = []; if ('settings' in d && d.settings)
- { d.settings.forEach(function(x){
- settings.push(encode(x))});
- settings={t:108,v:settings}; } else { settings = nil() };
- var members = []; if ('members' in d && d.members)
- { d.members.forEach(function(x){
- members.push(encode(x))});
- members={t:108,v:members}; } else { members = nil() };
- var admins = []; if ('admins' in d && d.admins)
- { d.admins.forEach(function(x){
- admins.push(encode(x))});
- admins={t:108,v:admins}; } else { admins = nil() };
- var data = []; if ('data' in d && d.data)
- { d.data.forEach(function(x){
- data.push(encode(x))});
- data={t:108,v:data}; } else { data = nil() };
- var type = 'type' in d && d.type ? encode(d.type) : nil();
- var tos = 'tos' in d && d.tos ? bin(d.tos) : nil();
- var unread = 'unread' in d && d.unread ? number(d.unread) : nil();
- var last_msg = 'last_msg' in d && d.last_msg ? encode(d.last_msg) : nil();
- var update = 'update' in d && d.update ? number(d.update) : nil();
- var created = 'created' in d && d.created ? number(d.created) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,id,name,description,settings,members,admins,data,type,tos,unread,
- last_msg,update,created,status); }
+ const tup = atom('Room');
+ const id = 'id' in d && d.id ? bin(d.id) : nil();
+ const name = 'name' in d && d.name ? bin(d.name) : nil();
+ const description = 'description' in d && d.description ? bin(d.description) : nil();
+ let settings = []; if ('settings' in d && d.settings) {
+ d.settings.forEach((x) => {
+ settings.push(encode(x));
+ });
+ settings = { t: 108, v: settings };
+ } else { settings = nil(); }
+ let members = []; if ('members' in d && d.members) {
+ d.members.forEach((x) => {
+ members.push(encode(x));
+ });
+ members = { t: 108, v: members };
+ } else { members = nil(); }
+ let admins = []; if ('admins' in d && d.admins) {
+ d.admins.forEach((x) => {
+ admins.push(encode(x));
+ });
+ admins = { t: 108, v: admins };
+ } else { admins = nil(); }
+ let data = []; if ('data' in d && d.data) {
+ d.data.forEach((x) => {
+ data.push(encode(x));
+ });
+ data = { t: 108, v: data };
+ } else { data = nil(); }
+ const type = 'type' in d && d.type ? encode(d.type) : nil();
+ const tos = 'tos' in d && d.tos ? bin(d.tos) : nil();
+ const unread = 'unread' in d && d.unread ? number(d.unread) : nil();
+ const last_msg = 'last_msg' in d && d.last_msg ? encode(d.last_msg) : nil();
+ const update = 'update' in d && d.update ? number(d.update) : nil();
+ const created = 'created' in d && d.created ? number(d.created) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(
+ tup, id, name, description, settings, members, admins, data, type, tos, unread,
+ last_msg, update, created, status
+ );
+}
function lenRoom() { return 15; }
function decRoom(d) {
- var r={}; r.tup = 'Room';
- r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.description = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.settings = [];
- (d && d.v[4] && d.v[4].v) ?
- d.v[4].v.forEach(function(x){r.settings.push(decode(x))}) :
- r.settings = undefined;
- r.members = [];
- (d && d.v[5] && d.v[5].v) ?
- d.v[5].v.forEach(function(x){r.members.push(decode(x))}) :
- r.members = undefined;
- r.admins = [];
- (d && d.v[6] && d.v[6].v) ?
- d.v[6].v.forEach(function(x){r.admins.push(decode(x))}) :
- r.admins = undefined;
- r.data = [];
- (d && d.v[7] && d.v[7].v) ?
- d.v[7].v.forEach(function(x){r.data.push(decode(x))}) :
- r.data = undefined;
- r.type = d && d.v[8] ? decode(d.v[8]) : undefined;
- r.tos = d && d.v[9] ? utf8_dec(d.v[9].v) : undefined;
- r.unread = d && d.v[10] ? d.v[10].v : undefined;
- r.last_msg = d && d.v[11] ? decode(d.v[11]) : undefined;
- r.update = d && d.v[12] ? d.v[12].v : undefined;
- r.created = d && d.v[13] ? d.v[13].v : undefined;
- r.status = d && d.v[14] ? decode(d.v[14]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Room';
+ r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.description = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.settings = [];
+ (d && d.v[4] && d.v[4].v) ?
+ d.v[4].v.forEach((x) => { r.settings.push(decode(x)); }) :
+ r.settings = undefined;
+ r.members = [];
+ (d && d.v[5] && d.v[5].v) ?
+ d.v[5].v.forEach((x) => { r.members.push(decode(x)); }) :
+ r.members = undefined;
+ r.admins = [];
+ (d && d.v[6] && d.v[6].v) ?
+ d.v[6].v.forEach((x) => { r.admins.push(decode(x)); }) :
+ r.admins = undefined;
+ r.data = [];
+ (d && d.v[7] && d.v[7].v) ?
+ d.v[7].v.forEach((x) => { r.data.push(decode(x)); }) :
+ r.data = undefined;
+ r.type = d && d.v[8] ? decode(d.v[8]) : undefined;
+ r.tos = d && d.v[9] ? utf8_dec(d.v[9].v) : undefined;
+ r.unread = d && d.v[10] ? d.v[10].v : undefined;
+ r.last_msg = d && d.v[11] ? decode(d.v[11]) : undefined;
+ r.update = d && d.v[12] ? d.v[12].v : undefined;
+ r.created = d && d.v[13] ? d.v[13].v : undefined;
+ r.status = d && d.v[14] ? decode(d.v[14]) : undefined;
+ return clean(r);
+}
function encTag(d) {
- var tup = atom('Tag');
- var roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil();
- var name = 'name' in d && d.name ? bin(d.name) : nil();
- var color = 'color' in d && d.color ? bin(d.color) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,roster_id,name,color,status); }
+ const tup = atom('Tag');
+ const roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil();
+ const name = 'name' in d && d.name ? bin(d.name) : nil();
+ const color = 'color' in d && d.color ? bin(d.color) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(tup, roster_id, name, color, status);
+}
function lenTag() { return 5; }
function decTag(d) {
- var r={}; r.tup = 'Tag';
- r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.color = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.status = d && d.v[4] ? decode(d.v[4]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Tag';
+ r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.color = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.status = d && d.v[4] ? decode(d.v[4]) : undefined;
+ return clean(r);
+}
function encStar(d) {
- var tup = atom('Star');
- var roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil();
- var message = 'message' in d && d.message ? encode(d.message) : nil();
- var tags = []; if ('tags' in d && d.tags)
- { d.tags.forEach(function(x){
- tags.push(encode(x))});
- tags={t:108,v:tags}; } else { tags = nil() };
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,roster_id,message,tags,status); }
+ const tup = atom('Star');
+ const roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil();
+ const message = 'message' in d && d.message ? encode(d.message) : nil();
+ let tags = []; if ('tags' in d && d.tags) {
+ d.tags.forEach((x) => {
+ tags.push(encode(x));
+ });
+ tags = { t: 108, v: tags };
+ } else { tags = nil(); }
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(tup, roster_id, message, tags, status);
+}
function lenStar() { return 5; }
function decStar(d) {
- var r={}; r.tup = 'Star';
- r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.message = d && d.v[2] ? decode(d.v[2]) : undefined;
- r.tags = [];
- (d && d.v[3] && d.v[3].v) ?
- d.v[3].v.forEach(function(x){r.tags.push(decode(x))}) :
- r.tags = undefined;
- r.status = d && d.v[4] ? decode(d.v[4]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Star';
+ r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.message = d && d.v[2] ? decode(d.v[2]) : undefined;
+ r.tags = [];
+ (d && d.v[3] && d.v[3].v) ?
+ d.v[3].v.forEach((x) => { r.tags.push(decode(x)); }) :
+ r.tags = undefined;
+ r.status = d && d.v[4] ? decode(d.v[4]) : undefined;
+ return clean(r);
+}
function encHistory(d) {
- var tup = atom('History');
- var roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil();
- var contact_id = 'contact_id' in d && d.contact_id ? bin(d.contact_id) : nil();
- var feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
- var size = 'size' in d && d.size ? number(d.size) : nil();
- var data = []; if ('data' in d && d.data)
- { d.data.forEach(function(x){
- data.push(encode(x))});
- data={t:108,v:data}; } else { data = nil() };
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,roster_id,contact_id,feed,size,data,status); }
+ const tup = atom('History');
+ const roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil();
+ const contact_id = 'contact_id' in d && d.contact_id ? bin(d.contact_id) : nil();
+ const feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
+ const size = 'size' in d && d.size ? number(d.size) : nil();
+ let data = []; if ('data' in d && d.data) {
+ d.data.forEach((x) => {
+ data.push(encode(x));
+ });
+ data = { t: 108, v: data };
+ } else { data = nil(); }
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(tup, roster_id, contact_id, feed, size, data, status);
+}
function lenHistory() { return 7; }
function decHistory(d) {
- var r={}; r.tup = 'History';
- r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.contact_id = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.feed = d && d.v[3] ? decode(d.v[3]) : undefined;
- r.size = d && d.v[4] ? d.v[4].v : undefined;
- r.data = [];
- (d && d.v[5] && d.v[5].v) ?
- d.v[5].v.forEach(function(x){r.data.push(decode(x))}) :
- r.data = undefined;
- r.status = d && d.v[6] ? decode(d.v[6]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'History';
+ r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.contact_id = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.feed = d && d.v[3] ? decode(d.v[3]) : undefined;
+ r.size = d && d.v[4] ? d.v[4].v : undefined;
+ r.data = [];
+ (d && d.v[5] && d.v[5].v) ?
+ d.v[5].v.forEach((x) => { r.data.push(decode(x)); }) :
+ r.data = undefined;
+ r.status = d && d.v[6] ? decode(d.v[6]) : undefined;
+ return clean(r);
+}
function encTyping(d) {
- var tup = atom('Typing');
- var phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil();
- var comments = 'comments' in d && d.comments ? encode(d.comments) : nil();
- return tuple(tup,phone_id,comments); }
+ const tup = atom('Typing');
+ const phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil();
+ const comments = 'comments' in d && d.comments ? encode(d.comments) : nil();
+ return tuple(tup, phone_id, comments);
+}
function lenTyping() { return 3; }
function decTyping(d) {
- var r={}; r.tup = 'Typing';
- r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.comments = d && d.v[2] ? decode(d.v[2].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Typing';
+ r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.comments = d && d.v[2] ? decode(d.v[2].v) : undefined;
+ return clean(r);
+}
function encContact(d) {
- var tup = atom('Contact');
- var phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil();
- var avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil();
- var names = 'names' in d && d.names ? bin(d.names) : nil();
- var surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil();
- var nick = 'nick' in d && d.nick ? bin(d.nick) : nil();
- var email = 'email' in d && d.email ? bin(d.email) : nil();
- var vox_id = 'vox_id' in d && d.vox_id ? bin(d.vox_id) : nil();
- var reader = 'reader' in d && d.reader ? number(d.reader) : nil();
- var unread = 'unread' in d && d.unread ? number(d.unread) : nil();
- var last_msg = 'last_msg' in d && d.last_msg ? encode(d.last_msg) : nil();
- var update = 'update' in d && d.update ? number(d.update) : nil();
- var presence = 'presence' in d && d.presence ? atom(d.presence) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,phone_id,avatar,names,surnames,nick,email,vox_id,reader,unread,last_msg,
- update,presence,status); }
+ const tup = atom('Contact');
+ const phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil();
+ const avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil();
+ const names = 'names' in d && d.names ? bin(d.names) : nil();
+ const surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil();
+ const nick = 'nick' in d && d.nick ? bin(d.nick) : nil();
+ const email = 'email' in d && d.email ? bin(d.email) : nil();
+ const vox_id = 'vox_id' in d && d.vox_id ? bin(d.vox_id) : nil();
+ const reader = 'reader' in d && d.reader ? number(d.reader) : nil();
+ const unread = 'unread' in d && d.unread ? number(d.unread) : nil();
+ const last_msg = 'last_msg' in d && d.last_msg ? encode(d.last_msg) : nil();
+ const update = 'update' in d && d.update ? number(d.update) : nil();
+ const presence = 'presence' in d && d.presence ? atom(d.presence) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(
+ tup, phone_id, avatar, names, surnames, nick, email, vox_id, reader, unread, last_msg,
+ update, presence, status
+ );
+}
function lenContact() { return 14; }
function decContact(d) {
- var r={}; r.tup = 'Contact';
- r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.avatar = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.names = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.surnames = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
- r.nick = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
- r.email = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
- r.vox_id = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
- r.reader = d && d.v[8] ? d.v[8].v : undefined;
- r.unread = d && d.v[9] ? d.v[9].v : undefined;
- r.last_msg = d && d.v[10] ? decode(d.v[10]) : undefined;
- r.update = d && d.v[11] ? d.v[11].v : undefined;
- r.presence = d && d.v[12] ? d.v[12].v : undefined;
- r.status = d && d.v[13] ? decode(d.v[13]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Contact';
+ r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.avatar = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.names = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.surnames = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
+ r.nick = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
+ r.email = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
+ r.vox_id = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
+ r.reader = d && d.v[8] ? d.v[8].v : undefined;
+ r.unread = d && d.v[9] ? d.v[9].v : undefined;
+ r.last_msg = d && d.v[10] ? decode(d.v[10]) : undefined;
+ r.update = d && d.v[11] ? d.v[11].v : undefined;
+ r.presence = d && d.v[12] ? d.v[12].v : undefined;
+ r.status = d && d.v[13] ? decode(d.v[13]) : undefined;
+ return clean(r);
+}
function encAuth(d) {
- var tup = atom('Auth');
- var client_id = 'client_id' in d && d.client_id ? bin(d.client_id) : nil();
- var dev_key = 'dev_key' in d && d.dev_key ? bin(d.dev_key) : nil();
- var user_id = 'user_id' in d && d.user_id ? bin(d.user_id) : nil();
- var phone = 'phone' in d && d.phone ? bin(d.phone) : nil();
- var token = 'token' in d && d.token ? bin(d.token) : nil();
- var type = 'type' in d && d.type ? atom(d.type) : nil();
- var sms_code = 'sms_code' in d && d.sms_code ? bin(d.sms_code) : nil();
- var attempts = 'attempts' in d && d.attempts ? number(d.attempts) : nil();
- var services = []; if ('services' in d && d.services)
- { d.services.forEach(function(x){
- services.push(encode(x))});
- services={t:108,v:services}; } else { services = nil() };
- var push = 'push' in d && d.push ? bin(d.push) : nil();
- var os = 'os' in d && d.os ? encode(d.os) : nil();
- var created = 'created' in d && d.created ? encode(d.created) : nil();
- var last_online = 'last_online' in d && d.last_online ? number(d.last_online) : nil();
- return tuple(tup,client_id,dev_key,user_id,phone,token,type,sms_code,attempts,services,push,
- os,created,last_online); }
+ const tup = atom('Auth');
+ const client_id = 'client_id' in d && d.client_id ? bin(d.client_id) : nil();
+ const dev_key = 'dev_key' in d && d.dev_key ? bin(d.dev_key) : nil();
+ const user_id = 'user_id' in d && d.user_id ? bin(d.user_id) : nil();
+ const phone = 'phone' in d && d.phone ? bin(d.phone) : nil();
+ const token = 'token' in d && d.token ? bin(d.token) : nil();
+ const type = 'type' in d && d.type ? atom(d.type) : nil();
+ const sms_code = 'sms_code' in d && d.sms_code ? bin(d.sms_code) : nil();
+ const attempts = 'attempts' in d && d.attempts ? number(d.attempts) : nil();
+ let services = []; if ('services' in d && d.services) {
+ d.services.forEach((x) => {
+ services.push(encode(x));
+ });
+ services = { t: 108, v: services };
+ } else { services = nil(); }
+ const push = 'push' in d && d.push ? bin(d.push) : nil();
+ const os = 'os' in d && d.os ? encode(d.os) : nil();
+ const created = 'created' in d && d.created ? encode(d.created) : nil();
+ const last_online = 'last_online' in d && d.last_online ? number(d.last_online) : nil();
+ return tuple(
+ tup, client_id, dev_key, user_id, phone, token, type, sms_code, attempts, services, push,
+ os, created, last_online
+ );
+}
function lenAuth() { return 14; }
function decAuth(d) {
- var r={}; r.tup = 'Auth';
- r.client_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.dev_key = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.user_id = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.phone = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
- r.token = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
- r.type = d && d.v[6] ? d.v[6].v : undefined;
- r.sms_code = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
- r.attempts = d && d.v[8] ? d.v[8].v : undefined;
- r.services = [];
- (d && d.v[9] && d.v[9].v) ?
- d.v[9].v.forEach(function(x){r.services.push(decode(x))}) :
- r.services = undefined;
- r.push = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined;
- r.os = d && d.v[11] ? decode(d.v[11]) : undefined;
- r.created = d && d.v[12] ? decode(d.v[12]) : undefined;
- r.last_online = d && d.v[13] ? d.v[13].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Auth';
+ r.client_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.dev_key = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.user_id = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.phone = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
+ r.token = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
+ r.type = d && d.v[6] ? d.v[6].v : undefined;
+ r.sms_code = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
+ r.attempts = d && d.v[8] ? d.v[8].v : undefined;
+ r.services = [];
+ (d && d.v[9] && d.v[9].v) ?
+ d.v[9].v.forEach((x) => { r.services.push(decode(x)); }) :
+ r.services = undefined;
+ r.push = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined;
+ r.os = d && d.v[11] ? decode(d.v[11]) : undefined;
+ r.created = d && d.v[12] ? decode(d.v[12]) : undefined;
+ r.last_online = d && d.v[13] ? d.v[13].v : undefined;
+ return clean(r);
+}
function encService(d) {
- var tup = atom('Service');
- var id = 'id' in d && d.id ? bin(d.id) : nil();
- var type = 'type' in d && d.type ? atom(d.type) : nil();
- var data = 'data' in d && d.data ? encode(d.data) : nil();
- var login = 'login' in d && d.login ? bin(d.login) : nil();
- var password = 'password' in d && d.password ? bin(d.password) : nil();
- var expiration = 'expiration' in d && d.expiration ? number(d.expiration) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,id,type,data,login,password,expiration,status); }
+ const tup = atom('Service');
+ const id = 'id' in d && d.id ? bin(d.id) : nil();
+ const type = 'type' in d && d.type ? atom(d.type) : nil();
+ const data = 'data' in d && d.data ? encode(d.data) : nil();
+ const login = 'login' in d && d.login ? bin(d.login) : nil();
+ const password = 'password' in d && d.password ? bin(d.password) : nil();
+ const expiration = 'expiration' in d && d.expiration ? number(d.expiration) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(tup, id, type, data, login, password, expiration, status);
+}
function lenService() { return 8; }
function decService(d) {
- var r={}; r.tup = 'Service';
- r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.type = d && d.v[2] ? decode(d.v[2]) : undefined;
- r.data = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.login = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
- r.password = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
- r.expiration = d && d.v[6] ? d.v[6].v : undefined;
- r.status = d && d.v[7] ? decode(d.v[7]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Service';
+ r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.type = d && d.v[2] ? decode(d.v[2]) : undefined;
+ r.data = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.login = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
+ r.password = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
+ r.expiration = d && d.v[6] ? d.v[6].v : undefined;
+ r.status = d && d.v[7] ? decode(d.v[7]) : undefined;
+ return clean(r);
+}
function encRoster(d) {
- var tup = atom('Roster');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var names = 'names' in d && d.names ? bin(d.names) : nil();
- var surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil();
- var email = 'email' in d && d.email ? bin(d.email) : nil();
- var nick = 'nick' in d && d.nick ? bin(d.nick) : nil();
- var userlist = []; if ('userlist' in d && d.userlist)
- { d.userlist.forEach(function(x){
- userlist.push(encode(x))});
- userlist={t:108,v:userlist}; } else { userlist = nil() };
- var roomlist = []; if ('roomlist' in d && d.roomlist)
- { d.roomlist.forEach(function(x){
- roomlist.push(encode(x))});
- roomlist={t:108,v:roomlist}; } else { roomlist = nil() };
- var favorite = []; if ('favorite' in d && d.favorite)
- { d.favorite.forEach(function(x){
- favorite.push(encode(x))});
- favorite={t:108,v:favorite}; } else { favorite = nil() };
- var tags = []; if ('tags' in d && d.tags)
- { d.tags.forEach(function(x){
- tags.push(encode(x))});
- tags={t:108,v:tags}; } else { tags = nil() };
- var phone = 'phone' in d && d.phone ? bin(d.phone) : nil();
- var avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil();
- var update = 'update' in d && d.update ? number(d.update) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,id,names,surnames,email,nick,userlist,roomlist,favorite,tags,phone,
- avatar,update,status); }
+ const tup = atom('Roster');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const names = 'names' in d && d.names ? bin(d.names) : nil();
+ const surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil();
+ const email = 'email' in d && d.email ? bin(d.email) : nil();
+ const nick = 'nick' in d && d.nick ? bin(d.nick) : nil();
+ let userlist = []; if ('userlist' in d && d.userlist) {
+ d.userlist.forEach((x) => {
+ userlist.push(encode(x));
+ });
+ userlist = { t: 108, v: userlist };
+ } else { userlist = nil(); }
+ let roomlist = []; if ('roomlist' in d && d.roomlist) {
+ d.roomlist.forEach((x) => {
+ roomlist.push(encode(x));
+ });
+ roomlist = { t: 108, v: roomlist };
+ } else { roomlist = nil(); }
+ let favorite = []; if ('favorite' in d && d.favorite) {
+ d.favorite.forEach((x) => {
+ favorite.push(encode(x));
+ });
+ favorite = { t: 108, v: favorite };
+ } else { favorite = nil(); }
+ let tags = []; if ('tags' in d && d.tags) {
+ d.tags.forEach((x) => {
+ tags.push(encode(x));
+ });
+ tags = { t: 108, v: tags };
+ } else { tags = nil(); }
+ const phone = 'phone' in d && d.phone ? bin(d.phone) : nil();
+ const avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil();
+ const update = 'update' in d && d.update ? number(d.update) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(
+ tup, id, names, surnames, email, nick, userlist, roomlist, favorite, tags, phone,
+ avatar, update, status
+ );
+}
function lenRoster() { return 14; }
function decRoster(d) {
- var r={}; r.tup = 'Roster';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.names = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.surnames = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.email = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
- r.nick = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
- r.userlist = [];
- (d && d.v[6] && d.v[6].v) ?
- d.v[6].v.forEach(function(x){r.userlist.push(decode(x))}) :
- r.userlist = undefined;
- r.roomlist = [];
- (d && d.v[7] && d.v[7].v) ?
- d.v[7].v.forEach(function(x){r.roomlist.push(decode(x))}) :
- r.roomlist = undefined;
- r.favorite = [];
- (d && d.v[8] && d.v[8].v) ?
- d.v[8].v.forEach(function(x){r.favorite.push(decode(x))}) :
- r.favorite = undefined;
- r.tags = [];
- (d && d.v[9] && d.v[9].v) ?
- d.v[9].v.forEach(function(x){r.tags.push(decode(x))}) :
- r.tags = undefined;
- r.phone = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined;
- r.avatar = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined;
- r.update = d && d.v[12] ? d.v[12].v : undefined;
- r.status = d && d.v[13] ? decode(d.v[13]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Roster';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.names = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.surnames = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.email = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
+ r.nick = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
+ r.userlist = [];
+ (d && d.v[6] && d.v[6].v) ?
+ d.v[6].v.forEach((x) => { r.userlist.push(decode(x)); }) :
+ r.userlist = undefined;
+ r.roomlist = [];
+ (d && d.v[7] && d.v[7].v) ?
+ d.v[7].v.forEach((x) => { r.roomlist.push(decode(x)); }) :
+ r.roomlist = undefined;
+ r.favorite = [];
+ (d && d.v[8] && d.v[8].v) ?
+ d.v[8].v.forEach((x) => { r.favorite.push(decode(x)); }) :
+ r.favorite = undefined;
+ r.tags = [];
+ (d && d.v[9] && d.v[9].v) ?
+ d.v[9].v.forEach((x) => { r.tags.push(decode(x)); }) :
+ r.tags = undefined;
+ r.phone = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined;
+ r.avatar = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined;
+ r.update = d && d.v[12] ? d.v[12].v : undefined;
+ r.status = d && d.v[13] ? decode(d.v[13]) : undefined;
+ return clean(r);
+}
function encFeature(d) {
- var tup = atom('Feature');
- var id = 'id' in d && d.id ? bin(d.id) : nil();
- var key = 'key' in d && d.key ? bin(d.key) : nil();
- var value = 'value' in d && d.value ? bin(d.value) : nil();
- var group = 'group' in d && d.group ? bin(d.group) : nil();
- return tuple(tup,id,key,value,group); }
+ const tup = atom('Feature');
+ const id = 'id' in d && d.id ? bin(d.id) : nil();
+ const key = 'key' in d && d.key ? bin(d.key) : nil();
+ const value = 'value' in d && d.value ? bin(d.value) : nil();
+ const group = 'group' in d && d.group ? bin(d.group) : nil();
+ return tuple(tup, id, key, value, group);
+}
function lenFeature() { return 5; }
function decFeature(d) {
- var r={}; r.tup = 'Feature';
- r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.key = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.value = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.group = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Feature';
+ r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.key = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.value = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.group = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
+ return clean(r);
+}
function encProfile(d) {
- var tup = atom('Profile');
- var phone = 'phone' in d && d.phone ? bin(d.phone) : nil();
- var services = []; if ('services' in d && d.services)
- { d.services.forEach(function(x){
- services.push(encode(x))});
- services={t:108,v:services}; } else { services = nil() };
- var rosters = []; if ('rosters' in d && d.rosters)
- { d.rosters.forEach(function(x){
- rosters.push(encode(x))});
- rosters={t:108,v:rosters}; } else { rosters = nil() };
- var settings = []; if ('settings' in d && d.settings)
- { d.settings.forEach(function(x){
- settings.push(encode(x))});
- settings={t:108,v:settings}; } else { settings = nil() };
- var update = 'update' in d && d.update ? number(d.update) : nil();
- var balance = 'balance' in d && d.balance ? number(d.balance) : nil();
- var presence = 'presence' in d && d.presence ? atom(d.presence) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,phone,services,rosters,settings,update,balance,presence,status); }
+ const tup = atom('Profile');
+ const phone = 'phone' in d && d.phone ? bin(d.phone) : nil();
+ let services = []; if ('services' in d && d.services) {
+ d.services.forEach((x) => {
+ services.push(encode(x));
+ });
+ services = { t: 108, v: services };
+ } else { services = nil(); }
+ let rosters = []; if ('rosters' in d && d.rosters) {
+ d.rosters.forEach((x) => {
+ rosters.push(encode(x));
+ });
+ rosters = { t: 108, v: rosters };
+ } else { rosters = nil(); }
+ let settings = []; if ('settings' in d && d.settings) {
+ d.settings.forEach((x) => {
+ settings.push(encode(x));
+ });
+ settings = { t: 108, v: settings };
+ } else { settings = nil(); }
+ const update = 'update' in d && d.update ? number(d.update) : nil();
+ const balance = 'balance' in d && d.balance ? number(d.balance) : nil();
+ const presence = 'presence' in d && d.presence ? atom(d.presence) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(tup, phone, services, rosters, settings, update, balance, presence, status);
+}
function lenProfile() { return 9; }
function decProfile(d) {
- var r={}; r.tup = 'Profile';
- r.phone = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.services = [];
- (d && d.v[2] && d.v[2].v) ?
- d.v[2].v.forEach(function(x){r.services.push(decode(x))}) :
- r.services = undefined;
- r.rosters = [];
- (d && d.v[3] && d.v[3].v) ?
- d.v[3].v.forEach(function(x){r.rosters.push(decode(x))}) :
- r.rosters = undefined;
- r.settings = [];
- (d && d.v[4] && d.v[4].v) ?
- d.v[4].v.forEach(function(x){r.settings.push(decode(x))}) :
- r.settings = undefined;
- r.update = d && d.v[5] ? d.v[5].v : undefined;
- r.balance = d && d.v[6] ? d.v[6].v : undefined;
- r.presence = d && d.v[7] ? d.v[7].v : undefined;
- r.status = d && d.v[8] ? d.v[8].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Profile';
+ r.phone = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.services = [];
+ (d && d.v[2] && d.v[2].v) ?
+ d.v[2].v.forEach((x) => { r.services.push(decode(x)); }) :
+ r.services = undefined;
+ r.rosters = [];
+ (d && d.v[3] && d.v[3].v) ?
+ d.v[3].v.forEach((x) => { r.rosters.push(decode(x)); }) :
+ r.rosters = undefined;
+ r.settings = [];
+ (d && d.v[4] && d.v[4].v) ?
+ d.v[4].v.forEach((x) => { r.settings.push(decode(x)); }) :
+ r.settings = undefined;
+ r.update = d && d.v[5] ? d.v[5].v : undefined;
+ r.balance = d && d.v[6] ? d.v[6].v : undefined;
+ r.presence = d && d.v[7] ? d.v[7].v : undefined;
+ r.status = d && d.v[8] ? d.v[8].v : undefined;
+ return clean(r);
+}
function encLoc(d) {
- var tup = atom('Loc');
- var x = 'x' in d && d.x ? bin(d.x) : nil();
- var y = 'y' in d && d.y ? bin(d.y) : nil();
- var z = 'z' in d && d.z ? bin(d.z) : nil();
- return tuple(tup,x,y,z); }
+ const tup = atom('Loc');
+ const x = 'x' in d && d.x ? bin(d.x) : nil();
+ const y = 'y' in d && d.y ? bin(d.y) : nil();
+ const z = 'z' in d && d.z ? bin(d.z) : nil();
+ return tuple(tup, x, y, z);
+}
function lenLoc() { return 4; }
function decLoc(d) {
- var r={}; r.tup = 'Loc';
- r.x = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.y = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.z = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Loc';
+ r.x = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.y = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.z = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ return clean(r);
+}
function encFriend(d) {
- var tup = atom('Friend');
- var phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil();
- var friend_id = 'friend_id' in d && d.friend_id ? bin(d.friend_id) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,phone_id,friend_id,status); }
+ const tup = atom('Friend');
+ const phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil();
+ const friend_id = 'friend_id' in d && d.friend_id ? bin(d.friend_id) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(tup, phone_id, friend_id, status);
+}
function lenFriend() { return 4; }
function decFriend(d) {
- var r={}; r.tup = 'Friend';
- r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.friend_id = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.status = d && d.v[3] ? decode(d.v[3]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Friend';
+ r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.friend_id = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.status = d && d.v[3] ? decode(d.v[3]) : undefined;
+ return clean(r);
+}
function encIndex(d) {
- var tup = atom('Index');
- var id = 'id' in d && d.id ? encode(d.id) : nil();
- var roster = []; if ('roster' in d && d.roster)
- { d.roster.forEach(function(x){
- roster.push(encode(x))});
- roster={t:108,v:roster}; } else { roster = nil() };
- return tuple(tup,id,roster); }
+ const tup = atom('Index');
+ const id = 'id' in d && d.id ? encode(d.id) : nil();
+ let roster = []; if ('roster' in d && d.roster) {
+ d.roster.forEach((x) => {
+ roster.push(encode(x));
+ });
+ roster = { t: 108, v: roster };
+ } else { roster = nil(); }
+ return tuple(tup, id, roster);
+}
function lenIndex() { return 3; }
function decIndex(d) {
- var r={}; r.tup = 'Index';
- r.id = d && d.v[1] ? decode(d.v[1].v) : undefined;
- r.roster = [];
- (d && d.v[2] && d.v[2].v) ?
- d.v[2].v.forEach(function(x){r.roster.push(decode(x))}) :
- r.roster = undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Index';
+ r.id = d && d.v[1] ? decode(d.v[1].v) : undefined;
+ r.roster = [];
+ (d && d.v[2] && d.v[2].v) ?
+ d.v[2].v.forEach((x) => { r.roster.push(decode(x)); }) :
+ r.roster = undefined;
+ return clean(r);
+}
function encTest(d) {
- var tup = atom('Test');
- var type = 'type' in d && d.type ? atom(d.type) : nil();
- var count = 'count' in d && d.count ? number(d.count) : nil();
- return tuple(tup,type,count); }
+ const tup = atom('Test');
+ const type = 'type' in d && d.type ? atom(d.type) : nil();
+ const count = 'count' in d && d.count ? number(d.count) : nil();
+ return tuple(tup, type, count);
+}
function lenTest() { return 3; }
function decTest(d) {
- var r={}; r.tup = 'Test';
- r.type = d && d.v[1] ? decode(d.v[1]) : undefined;
- r.count = d && d.v[2] ? d.v[2].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Test';
+ r.type = d && d.v[1] ? decode(d.v[1]) : undefined;
+ r.count = d && d.v[2] ? d.v[2].v : undefined;
+ return clean(r);
+}
diff --git a/src/assets/vendor/utils/json-bert-test.js b/src/assets/vendor/utils/json-bert-test.js
index cd30810dcbe0c648f5f0e8ec6e9aaf9ea93c5f26..64389f6e4ec77757acbe3b0cca017a47547d6597 100644
--- a/src/assets/vendor/utils/json-bert-test.js
+++ b/src/assets/vendor/utils/json-bert-test.js
@@ -1,28 +1,28 @@
function check() {
- var res = true;
- //@TODO: MORE TEST DATA
- testData = [
- 1,
- [1, 2, 3],
- "string",
- {tup: 'io', code: 'login', data: {tup: '$', 0: 'Auth', 1: 12}},
- {tup: 'io', code: 'login', data: {tup: 'Auth'}},
- {tup: 'io', code: 'login', data: {tup: '$', 0: 'пизда', 1: 12}},
- {tup: 'Roster', userlist: [{tup: 'Contact'}], status: 'get'},
- {tup: 'p2p', from: 'хуй', to: 'пизда'},
- {tup: 'Profile', accounts: [1], status: 'maxim'}
- ];
- testData.forEach(function (o) {
- var o = JSON.stringify(o);
- var d = JSON.stringify(decode(dec(enc(encode(o)).buffer))).replace(/\\/g, '');
+ let res = true;
+ // @TODO: MORE TEST DATA
+ testData = [
+ 1,
+ [1, 2, 3],
+ 'string',
+ { tup: 'io', code: 'login', data: { tup: '$', 0: 'Auth', 1: 12 } },
+ { tup: 'io', code: 'login', data: { tup: 'Auth' } },
+ { tup: 'io', code: 'login', data: { tup: '$', 0: 'пизда', 1: 12 } },
+ { tup: 'Roster', userlist: [{ tup: 'Contact' }], status: 'get' },
+ { tup: 'p2p', from: 'хуй', to: 'пизда' },
+ { tup: 'Profile', accounts: [1], status: 'maxim' }
+ ];
+ testData.forEach((o) => {
+ var o = JSON.stringify(o);
+ const d = JSON.stringify(decode(dec(enc(encode(o)).buffer))).replace(/\\/g, '');
- if (JSON.stringify(o) != JSON.stringify(decode(dec(enc(encode(o)).buffer)))) {
- console.log("Original: " + o + " <=> Decode: " + d + " %c [Error]", "color: red");
- res = false;
- } else {
- console.log("Data: " + o + " %c [OK]", "color: green");
- }
- });
+ if (JSON.stringify(o) != JSON.stringify(decode(dec(enc(encode(o)).buffer)))) {
+ console.log(`Original: ${o} <=> Decode: ${d} %c [Error]`, 'color: red');
+ res = false;
+ } else {
+ console.log(`Data: ${o} %c [OK]`, 'color: green');
+ }
+ });
- return res;
+ return res;
}
diff --git a/src/assets/vendor/utils/json-bert.js b/src/assets/vendor/utils/json-bert.js
index 14edf5e13f1b37438c1875362777a8cd1ac75163..158a1325fa141718c9609fc5bbfb09fc8a88f837 100644
--- a/src/assets/vendor/utils/json-bert.js
+++ b/src/assets/vendor/utils/json-bert.js
@@ -1,1521 +1,1749 @@
-function clean(r) { for(var k in r) if(!r[k]) delete r[k]; return r; }
-function check_len(x) { try { return (eval('len'+utf8_dec(x.v[0].v))() == x.v.length) ? true : false }
- catch (e) { return false; } }
-
-function scalar(data) {
- var res = undefined;
- switch (typeof data) {
- case 'string': res = bin(data); break; case 'number': res = number(data); break;
- default: console.log('Strange data: ' + data); }
- return res; };
-function nil() { return {t: 106, v: undefined}; };
+function clean(r) { for (const k in r) if (!r[k]) delete r[k]; return r; }
+function check_len(x) {
+ try { return (eval(`len${utf8_dec(x.v[0].v)}`)() == x.v.length); } catch (e) { return false; }
+}
+
+function scalar(data) {
+ let res;
+ switch (typeof data) {
+ case 'string': res = bin(data); break; case 'number': res = number(data); break;
+ default: console.log(`Strange data: ${data}`);
+ }
+ return res;
+}
+function nil() { return { t: 106, v: undefined }; }
function decode(x) {
- if (x == undefined) {
- return [];
- } else if (x.t == 108) {
- var r = []; x.v.forEach(function(y) { r.push(decode(y)) }); return r;
- } else if (x.t == 109) {
- return utf8_dec(x.v);
- } else if (x.t == 104 && check_len(x)) {
- return eval('dec'+x.v[0].v)(x);
- } else if (x.t == 104) {
- var r=[]; x.v.forEach(function(a){r.push(decode(a))});
- return Object.assign({tup:'$'}, r);
- } else return x.v;
+ if (x == undefined) {
+ return [];
+ } else if (x.t == 108) {
+ var r = []; x.v.forEach((y) => { r.push(decode(y)); }); return r;
+ } else if (x.t == 109) {
+ return utf8_dec(x.v);
+ } else if (x.t == 104 && check_len(x)) {
+ return eval(`dec${x.v[0].v}`)(x);
+ } else if (x.t == 104) {
+ var r = []; x.v.forEach((a) => { r.push(decode(a)); });
+ return Object.assign({ tup: '$' }, r);
+ } return x.v;
}
function encode(x) {
- if (Array.isArray(x)) {
- var r = []; x.forEach(function(y) { r.push(encode(y)) }); return {t:108,v:r};
- } else if (typeof x == 'object') {
- switch (x.tup) {
- case '$': delete x['tup']; var r=[];
- Object.keys(x).map(function(p){return x[p];}).forEach(function(a){r.push(encode(a))});
- return {t:104, v:r};
- default: return eval('enc'+x.tup)(x); }
- } else return scalar(x);
+ if (Array.isArray(x)) {
+ var r = []; x.forEach((y) => { r.push(encode(y)); }); return { t: 108, v: r };
+ } else if (typeof x === 'object') {
+ switch (x.tup) {
+ case '$': delete x.tup; var r = [];
+ Object.keys(x).map(p => x[p]).forEach((a) => { r.push(encode(a)); });
+ return { t: 104, v: r };
+ default: return eval(`enc${x.tup}`)(x);
+ }
+ } else return scalar(x);
}
function encwriter(d) {
- var tup = atom('writer');
- var id = 'id' in d && d.id ? encode(d.id) : nil();
- var count = 'count' in d && d.count ? number(d.count) : nil();
- var cache = 'cache' in d && d.cache ? encode(d.cache) : nil();
- var args = 'args' in d && d.args ? encode(d.args) : nil();
- var first = 'first' in d && d.first ? encode(d.first) : nil();
- return tuple(tup,id,count,cache,args,first); }
+ const tup = atom('writer');
+ const id = 'id' in d && d.id ? encode(d.id) : nil();
+ const count = 'count' in d && d.count ? number(d.count) : nil();
+ const cache = 'cache' in d && d.cache ? encode(d.cache) : nil();
+ const args = 'args' in d && d.args ? encode(d.args) : nil();
+ const first = 'first' in d && d.first ? encode(d.first) : nil();
+ return tuple(tup, id, count, cache, args, first);
+}
function lenwriter() { return 6; }
function decwriter(d) {
- var r={}; r.tup = 'writer';
- r.id = d && d.v[1] ? decode(d.v[1].v) : undefined;
- r.count = d && d.v[2] ? d.v[2].v : undefined;
- r.cache = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.args = d && d.v[4] ? decode(d.v[4].v) : undefined;
- r.first = d && d.v[5] ? decode(d.v[5].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'writer';
+ r.id = d && d.v[1] ? decode(d.v[1].v) : undefined;
+ r.count = d && d.v[2] ? d.v[2].v : undefined;
+ r.cache = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.args = d && d.v[4] ? decode(d.v[4].v) : undefined;
+ r.first = d && d.v[5] ? decode(d.v[5].v) : undefined;
+ return clean(r);
+}
function encreader(d) {
- var tup = atom('reader');
- var id = 'id' in d && d.id ? encode(d.id) : nil();
- var pos = 'pos' in d && d.pos ? number(d.pos) : nil();
- var cache = 'cache' in d && d.cache ? number(d.cache) : nil();
- var args = 'args' in d && d.args ? encode(d.args) : nil();
- var feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
- var dir = 'dir' in d && d.dir ? encode(d.dir) : nil();
- return tuple(tup,id,pos,cache,args,feed,dir); }
+ const tup = atom('reader');
+ const id = 'id' in d && d.id ? encode(d.id) : nil();
+ const pos = 'pos' in d && d.pos ? number(d.pos) : nil();
+ const cache = 'cache' in d && d.cache ? number(d.cache) : nil();
+ const args = 'args' in d && d.args ? encode(d.args) : nil();
+ const feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
+ const dir = 'dir' in d && d.dir ? encode(d.dir) : nil();
+ return tuple(tup, id, pos, cache, args, feed, dir);
+}
function lenreader() { return 7; }
function decreader(d) {
- var r={}; r.tup = 'reader';
- r.id = d && d.v[1] ? decode(d.v[1].v) : undefined;
- r.pos = d && d.v[2] ? d.v[2].v : undefined;
- r.cache = d && d.v[3] ? d.v[3].v : undefined;
- r.args = d && d.v[4] ? decode(d.v[4].v) : undefined;
- r.feed = d && d.v[5] ? decode(d.v[5].v) : undefined;
- r.dir = d && d.v[6] ? decode(d.v[6]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'reader';
+ r.id = d && d.v[1] ? decode(d.v[1].v) : undefined;
+ r.pos = d && d.v[2] ? d.v[2].v : undefined;
+ r.cache = d && d.v[3] ? d.v[3].v : undefined;
+ r.args = d && d.v[4] ? decode(d.v[4].v) : undefined;
+ r.feed = d && d.v[5] ? decode(d.v[5].v) : undefined;
+ r.dir = d && d.v[6] ? decode(d.v[6]) : undefined;
+ return clean(r);
+}
function enccur(d) {
- var tup = atom('cur');
- var id = 'id' in d && d.id ? encode(d.id) : nil();
- var top = 'top' in d && d.top ? number(d.top) : nil();
- var bot = 'bot' in d && d.bot ? number(d.bot) : nil();
- var dir = 'dir' in d && d.dir ? encode(d.dir) : nil();
- var reader = 'reader' in d && d.reader ? encode(d.reader) : nil();
- var writer = 'writer' in d && d.writer ? encode(d.writer) : nil();
- var args = []; if ('args' in d && d.args)
- { d.args.forEach(function(x){
- args.push(encode(x))});
- args={t:108,v:args}; } else { args = nil() };
- return tuple(tup,id,top,bot,dir,reader,writer,args); }
+ const tup = atom('cur');
+ const id = 'id' in d && d.id ? encode(d.id) : nil();
+ const top = 'top' in d && d.top ? number(d.top) : nil();
+ const bot = 'bot' in d && d.bot ? number(d.bot) : nil();
+ const dir = 'dir' in d && d.dir ? encode(d.dir) : nil();
+ const reader = 'reader' in d && d.reader ? encode(d.reader) : nil();
+ const writer = 'writer' in d && d.writer ? encode(d.writer) : nil();
+ let args = []; if ('args' in d && d.args) {
+ d.args.forEach((x) => {
+ args.push(encode(x));
+ });
+ args = { t: 108, v: args };
+ } else { args = nil(); }
+ return tuple(tup, id, top, bot, dir, reader, writer, args);
+}
function lencur() { return 8; }
function deccur(d) {
- var r={}; r.tup = 'cur';
- r.id = d && d.v[1] ? decode(d.v[1].v) : undefined;
- r.top = d && d.v[2] ? d.v[2].v : undefined;
- r.bot = d && d.v[3] ? d.v[3].v : undefined;
- r.dir = d && d.v[4] ? decode(d.v[4]) : undefined;
- r.reader = d && d.v[5] ? decode(d.v[5].v) : undefined;
- r.writer = d && d.v[6] ? decode(d.v[6].v) : undefined;
- r.args = [];
+ const r = {}; r.tup = 'cur';
+ r.id = d && d.v[1] ? decode(d.v[1].v) : undefined;
+ r.top = d && d.v[2] ? d.v[2].v : undefined;
+ r.bot = d && d.v[3] ? d.v[3].v : undefined;
+ r.dir = d && d.v[4] ? decode(d.v[4]) : undefined;
+ r.reader = d && d.v[5] ? decode(d.v[5].v) : undefined;
+ r.writer = d && d.v[6] ? decode(d.v[6].v) : undefined;
+ r.args = [];
(d && d.v[7] && d.v[7].v) ?
- d.v[7].v.forEach(function(x){r.args.push(decode(x))}) :
+ d.v[7].v.forEach((x) => { r.args.push(decode(x)); }) :
r.args = undefined;
- return clean(r); }
+ return clean(r);
+}
function enciter(d) {
- var tup = atom('iter');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var container = 'container' in d && d.container ? atom(d.container) : nil();
- var feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- return tuple(tup,id,container,feed,next,prev); }
+ const tup = atom('iter');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const container = 'container' in d && d.container ? atom(d.container) : nil();
+ const feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ return tuple(tup, id, container, feed, next, prev);
+}
function leniter() { return 6; }
function deciter(d) {
- var r={}; r.tup = 'iter';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? d.v[2].v : undefined;
- r.feed = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.next = d && d.v[4] ? d.v[4].v : undefined;
- r.prev = d && d.v[5] ? d.v[5].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'iter';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? d.v[2].v : undefined;
+ r.feed = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.next = d && d.v[4] ? d.v[4].v : undefined;
+ r.prev = d && d.v[5] ? d.v[5].v : undefined;
+ return clean(r);
+}
function enccontainer(d) {
- var tup = atom('container');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var top = 'top' in d && d.top ? number(d.top) : nil();
- var rear = 'rear' in d && d.rear ? number(d.rear) : nil();
- var count = 'count' in d && d.count ? number(d.count) : nil();
- return tuple(tup,id,top,rear,count); }
+ const tup = atom('container');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const top = 'top' in d && d.top ? number(d.top) : nil();
+ const rear = 'rear' in d && d.rear ? number(d.rear) : nil();
+ const count = 'count' in d && d.count ? number(d.count) : nil();
+ return tuple(tup, id, top, rear, count);
+}
function lencontainer() { return 5; }
function deccontainer(d) {
- var r={}; r.tup = 'container';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.top = d && d.v[2] ? d.v[2].v : undefined;
- r.rear = d && d.v[3] ? d.v[3].v : undefined;
- r.count = d && d.v[4] ? d.v[4].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'container';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.top = d && d.v[2] ? d.v[2].v : undefined;
+ r.rear = d && d.v[3] ? d.v[3].v : undefined;
+ r.count = d && d.v[4] ? d.v[4].v : undefined;
+ return clean(r);
+}
function enciterator(d) {
- var tup = atom('iterator');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var container = 'container' in d && d.container ? atom(d.container) : nil();
- var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var feeds = []; if ('feeds' in d && d.feeds)
- { d.feeds.forEach(function(x){
- feeds.push(encode(x))});
- feeds={t:108,v:feeds}; } else { feeds = nil() };
- return tuple(tup,id,container,feed_id,prev,next,feeds); }
+ const tup = atom('iterator');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const container = 'container' in d && d.container ? atom(d.container) : nil();
+ const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ let feeds = []; if ('feeds' in d && d.feeds) {
+ d.feeds.forEach((x) => {
+ feeds.push(encode(x));
+ });
+ feeds = { t: 108, v: feeds };
+ } else { feeds = nil(); }
+ return tuple(tup, id, container, feed_id, prev, next, feeds);
+}
function leniterator() { return 7; }
function deciterator(d) {
- var r={}; r.tup = 'iterator';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? d.v[2].v : undefined;
- r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.prev = d && d.v[4] ? d.v[4].v : undefined;
- r.next = d && d.v[5] ? d.v[5].v : undefined;
- r.feeds = [];
+ const r = {}; r.tup = 'iterator';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? d.v[2].v : undefined;
+ r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.prev = d && d.v[4] ? d.v[4].v : undefined;
+ r.next = d && d.v[5] ? d.v[5].v : undefined;
+ r.feeds = [];
(d && d.v[6] && d.v[6].v) ?
- d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) :
+ d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) :
r.feeds = undefined;
- return clean(r); }
+ return clean(r);
+}
function enclog(d) {
- var tup = atom('log');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var top = 'top' in d && d.top ? number(d.top) : nil();
- var rear = 'rear' in d && d.rear ? number(d.rear) : nil();
- var count = 'count' in d && d.count ? number(d.count) : nil();
- return tuple(tup,id,top,rear,count); }
+ const tup = atom('log');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const top = 'top' in d && d.top ? number(d.top) : nil();
+ const rear = 'rear' in d && d.rear ? number(d.rear) : nil();
+ const count = 'count' in d && d.count ? number(d.count) : nil();
+ return tuple(tup, id, top, rear, count);
+}
function lenlog() { return 5; }
function declog(d) {
- var r={}; r.tup = 'log';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.top = d && d.v[2] ? d.v[2].v : undefined;
- r.rear = d && d.v[3] ? d.v[3].v : undefined;
- r.count = d && d.v[4] ? d.v[4].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'log';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.top = d && d.v[2] ? d.v[2].v : undefined;
+ r.rear = d && d.v[3] ? d.v[3].v : undefined;
+ r.count = d && d.v[4] ? d.v[4].v : undefined;
+ return clean(r);
+}
function encoperation(d) {
- var tup = atom('operation');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var container = 'container' in d && d.container ? atom(d.container) : nil();
- var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var feeds = []; if ('feeds' in d && d.feeds)
- { d.feeds.forEach(function(x){
- feeds.push(encode(x))});
- feeds={t:108,v:feeds}; } else { feeds = nil() };
- return tuple(tup,id,container,feed_id,prev,next,feeds); }
+ const tup = atom('operation');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const container = 'container' in d && d.container ? atom(d.container) : nil();
+ const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ let feeds = []; if ('feeds' in d && d.feeds) {
+ d.feeds.forEach((x) => {
+ feeds.push(encode(x));
+ });
+ feeds = { t: 108, v: feeds };
+ } else { feeds = nil(); }
+ return tuple(tup, id, container, feed_id, prev, next, feeds);
+}
function lenoperation() { return 7; }
function decoperation(d) {
- var r={}; r.tup = 'operation';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? d.v[2].v : undefined;
- r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.prev = d && d.v[4] ? d.v[4].v : undefined;
- r.next = d && d.v[5] ? d.v[5].v : undefined;
- r.feeds = [];
+ const r = {}; r.tup = 'operation';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? d.v[2].v : undefined;
+ r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.prev = d && d.v[4] ? d.v[4].v : undefined;
+ r.next = d && d.v[5] ? d.v[5].v : undefined;
+ r.feeds = [];
(d && d.v[6] && d.v[6].v) ?
- d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) :
+ d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) :
r.feeds = undefined;
- return clean(r); }
+ return clean(r);
+}
function encchain(d) {
- var tup = atom('chain');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var top = 'top' in d && d.top ? number(d.top) : nil();
- var rear = 'rear' in d && d.rear ? number(d.rear) : nil();
- var count = 'count' in d && d.count ? number(d.count) : nil();
- return tuple(tup,id,top,rear,count); }
+ const tup = atom('chain');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const top = 'top' in d && d.top ? number(d.top) : nil();
+ const rear = 'rear' in d && d.rear ? number(d.rear) : nil();
+ const count = 'count' in d && d.count ? number(d.count) : nil();
+ return tuple(tup, id, top, rear, count);
+}
function lenchain() { return 5; }
function decchain(d) {
- var r={}; r.tup = 'chain';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.top = d && d.v[2] ? d.v[2].v : undefined;
- r.rear = d && d.v[3] ? d.v[3].v : undefined;
- r.count = d && d.v[4] ? d.v[4].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'chain';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.top = d && d.v[2] ? d.v[2].v : undefined;
+ r.rear = d && d.v[3] ? d.v[3].v : undefined;
+ r.count = d && d.v[4] ? d.v[4].v : undefined;
+ return clean(r);
+}
function encpush(d) {
- var tup = atom('push');
- var model = 'model' in d && d.model ? bin(d.model) : nil();
- var type = 'type' in d && d.type ? bin(d.type) : nil();
- var title = 'title' in d && d.title ? bin(d.title) : nil();
- var alert = 'alert' in d && d.alert ? bin(d.alert) : nil();
- var badge = 'badge' in d && d.badge ? number(d.badge) : nil();
- var sound = 'sound' in d && d.sound ? bin(d.sound) : nil();
- return tuple(tup,model,type,title,alert,badge,sound); }
+ const tup = atom('push');
+ const model = 'model' in d && d.model ? bin(d.model) : nil();
+ const type = 'type' in d && d.type ? bin(d.type) : nil();
+ const title = 'title' in d && d.title ? bin(d.title) : nil();
+ const alert = 'alert' in d && d.alert ? bin(d.alert) : nil();
+ const badge = 'badge' in d && d.badge ? number(d.badge) : nil();
+ const sound = 'sound' in d && d.sound ? bin(d.sound) : nil();
+ return tuple(tup, model, type, title, alert, badge, sound);
+}
function lenpush() { return 7; }
function decpush(d) {
- var r={}; r.tup = 'push';
- r.model = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.type = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.title = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.alert = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
- r.badge = d && d.v[5] ? d.v[5].v : undefined;
- r.sound = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'push';
+ r.model = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.type = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.title = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.alert = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
+ r.badge = d && d.v[5] ? d.v[5].v : undefined;
+ r.sound = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
+ return clean(r);
+}
function encSearch(d) {
- var tup = atom('Search');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var ref = 'ref' in d && d.ref ? bin(d.ref) : nil();
- var field = 'field' in d && d.field ? bin(d.field) : nil();
- var type = 'type' in d && d.type ? atom(d.type) : nil();
- var value = 'value' in d && d.value ? encode(d.value) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,id,ref,field,type,value,status); }
+ const tup = atom('Search');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const ref = 'ref' in d && d.ref ? bin(d.ref) : nil();
+ const field = 'field' in d && d.field ? bin(d.field) : nil();
+ const type = 'type' in d && d.type ? atom(d.type) : nil();
+ const value = 'value' in d && d.value ? encode(d.value) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(tup, id, ref, field, type, value, status);
+}
function lenSearch() { return 7; }
function decSearch(d) {
- var r={}; r.tup = 'Search';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.ref = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.field = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.type = d && d.v[4] ? decode(d.v[4]) : undefined;
- r.value = d && d.v[5] ? decode(d.v[5].v) : undefined;
- r.status = d && d.v[6] ? decode(d.v[6]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Search';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.ref = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.field = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.type = d && d.v[4] ? decode(d.v[4]) : undefined;
+ r.value = d && d.v[5] ? decode(d.v[5].v) : undefined;
+ r.status = d && d.v[6] ? decode(d.v[6]) : undefined;
+ return clean(r);
+}
function encp2p(d) {
- var tup = atom('p2p');
- var from = 'from' in d && d.from ? bin(d.from) : nil();
- var to = 'to' in d && d.to ? bin(d.to) : nil();
- return tuple(tup,from,to); }
+ const tup = atom('p2p');
+ const from = 'from' in d && d.from ? bin(d.from) : nil();
+ const to = 'to' in d && d.to ? bin(d.to) : nil();
+ return tuple(tup, from, to);
+}
function lenp2p() { return 3; }
function decp2p(d) {
- var r={}; r.tup = 'p2p';
- r.from = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.to = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'p2p';
+ r.from = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.to = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ return clean(r);
+}
function encmuc(d) {
- var tup = atom('muc');
- var name = 'name' in d && d.name ? bin(d.name) : nil();
- return tuple(tup,name); }
+ const tup = atom('muc');
+ const name = 'name' in d && d.name ? bin(d.name) : nil();
+ return tuple(tup, name);
+}
function lenmuc() { return 2; }
function decmuc(d) {
- var r={}; r.tup = 'muc';
- r.name = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'muc';
+ r.name = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ return clean(r);
+}
function encCDR(d) {
- var tup = atom('CDR');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var container = 'container' in d && d.container ? atom(d.container) : nil();
- var feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- var from = 'from' in d && d.from ? bin(d.from) : nil();
- var to = 'to' in d && d.to ? bin(d.to) : nil();
- var start = 'start' in d && d.start ? number(d.start) : nil();
- var stop = 'stop' in d && d.stop ? number(d.stop) : nil();
- var type = 'type' in d && d.type ? encode(d.type) : nil();
- var desc = 'desc' in d && d.desc ? bin(d.desc) : nil();
- var bill = 'bill' in d && d.bill ? number(d.bill) : nil();
- var tariff = 'tariff' in d && d.tariff ? bin(d.tariff) : nil();
- return tuple(tup,id,container,feed,next,prev,from,to,start,stop,type,
- desc,bill,tariff); }
+ const tup = atom('CDR');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const container = 'container' in d && d.container ? atom(d.container) : nil();
+ const feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ const from = 'from' in d && d.from ? bin(d.from) : nil();
+ const to = 'to' in d && d.to ? bin(d.to) : nil();
+ const start = 'start' in d && d.start ? number(d.start) : nil();
+ const stop = 'stop' in d && d.stop ? number(d.stop) : nil();
+ const type = 'type' in d && d.type ? encode(d.type) : nil();
+ const desc = 'desc' in d && d.desc ? bin(d.desc) : nil();
+ const bill = 'bill' in d && d.bill ? number(d.bill) : nil();
+ const tariff = 'tariff' in d && d.tariff ? bin(d.tariff) : nil();
+ return tuple(
+ tup, id, container, feed, next, prev, from, to, start, stop, type,
+ desc, bill, tariff
+ );
+}
function lenCDR() { return 14; }
function decCDR(d) {
- var r={}; r.tup = 'CDR';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? d.v[2].v : undefined;
- r.feed = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.next = d && d.v[4] ? d.v[4].v : undefined;
- r.prev = d && d.v[5] ? d.v[5].v : undefined;
- r.from = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
- r.to = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
- r.start = d && d.v[8] ? d.v[8].v : undefined;
- r.stop = d && d.v[9] ? d.v[9].v : undefined;
- r.type = d && d.v[10] ? decode(d.v[10]) : undefined;
- r.desc = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined;
- r.bill = d && d.v[12] ? d.v[12].v : undefined;
- r.tariff = d && d.v[13] ? utf8_dec(d.v[13].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'CDR';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? d.v[2].v : undefined;
+ r.feed = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.next = d && d.v[4] ? d.v[4].v : undefined;
+ r.prev = d && d.v[5] ? d.v[5].v : undefined;
+ r.from = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
+ r.to = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
+ r.start = d && d.v[8] ? d.v[8].v : undefined;
+ r.stop = d && d.v[9] ? d.v[9].v : undefined;
+ r.type = d && d.v[10] ? decode(d.v[10]) : undefined;
+ r.desc = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined;
+ r.bill = d && d.v[12] ? d.v[12].v : undefined;
+ r.tariff = d && d.v[13] ? utf8_dec(d.v[13].v) : undefined;
+ return clean(r);
+}
function encFeature(d) {
- var tup = atom('Feature');
- var id = 'id' in d && d.id ? bin(d.id) : nil();
- var key = 'key' in d && d.key ? bin(d.key) : nil();
- var value = 'value' in d && d.value ? bin(d.value) : nil();
- var group = 'group' in d && d.group ? bin(d.group) : nil();
- return tuple(tup,id,key,value,group); }
+ const tup = atom('Feature');
+ const id = 'id' in d && d.id ? bin(d.id) : nil();
+ const key = 'key' in d && d.key ? bin(d.key) : nil();
+ const value = 'value' in d && d.value ? bin(d.value) : nil();
+ const group = 'group' in d && d.group ? bin(d.group) : nil();
+ return tuple(tup, id, key, value, group);
+}
function lenFeature() { return 5; }
function decFeature(d) {
- var r={}; r.tup = 'Feature';
- r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.key = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.value = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.group = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Feature';
+ r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.key = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.value = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.group = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
+ return clean(r);
+}
function encMember(d) {
- var tup = atom('Member');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var container = 'container' in d && d.container ? encode(d.container) : nil();
- var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var feeds = []; if ('feeds' in d && d.feeds)
- { d.feeds.forEach(function(x){
- feeds.push(encode(x))});
- feeds={t:108,v:feeds}; } else { feeds = nil() };
- var phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil();
- var avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil();
- var names = 'names' in d && d.names ? bin(d.names) : nil();
- var surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil();
- var alias = 'alias' in d && d.alias ? bin(d.alias) : nil();
- var email = 'email' in d && d.email ? bin(d.email) : nil();
- var vox_id = 'vox_id' in d && d.vox_id ? bin(d.vox_id) : nil();
- var reader = 'reader' in d && d.reader ? number(d.reader) : nil();
- var update = 'update' in d && d.update ? number(d.update) : nil();
- var settings = []; if ('settings' in d && d.settings)
- { d.settings.forEach(function(x){
- settings.push(encode(x))});
- settings={t:108,v:settings}; } else { settings = nil() };
- var presence = 'presence' in d && d.presence ? atom(d.presence) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,id,container,feed_id,prev,next,feeds,phone_id,avatar,names,surnames,
- alias,email,vox_id,reader,update,settings,presence,status); }
+ const tup = atom('Member');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const container = 'container' in d && d.container ? encode(d.container) : nil();
+ const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ let feeds = []; if ('feeds' in d && d.feeds) {
+ d.feeds.forEach((x) => {
+ feeds.push(encode(x));
+ });
+ feeds = { t: 108, v: feeds };
+ } else { feeds = nil(); }
+ const phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil();
+ const avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil();
+ const names = 'names' in d && d.names ? bin(d.names) : nil();
+ const surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil();
+ const alias = 'alias' in d && d.alias ? bin(d.alias) : nil();
+ const email = 'email' in d && d.email ? bin(d.email) : nil();
+ const vox_id = 'vox_id' in d && d.vox_id ? bin(d.vox_id) : nil();
+ const reader = 'reader' in d && d.reader ? number(d.reader) : nil();
+ const update = 'update' in d && d.update ? number(d.update) : nil();
+ let settings = []; if ('settings' in d && d.settings) {
+ d.settings.forEach((x) => {
+ settings.push(encode(x));
+ });
+ settings = { t: 108, v: settings };
+ } else { settings = nil(); }
+ const presence = 'presence' in d && d.presence ? atom(d.presence) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(
+ tup, id, container, feed_id, prev, next, feeds, phone_id, avatar, names, surnames,
+ alias, email, vox_id, reader, update, settings, presence, status
+ );
+}
function lenMember() { return 19; }
function decMember(d) {
- var r={}; r.tup = 'Member';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? decode(d.v[2]) : undefined;
- r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined;
- r.prev = d && d.v[4] ? d.v[4].v : undefined;
- r.next = d && d.v[5] ? d.v[5].v : undefined;
- r.feeds = [];
+ const r = {}; r.tup = 'Member';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? decode(d.v[2]) : undefined;
+ r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined;
+ r.prev = d && d.v[4] ? d.v[4].v : undefined;
+ r.next = d && d.v[5] ? d.v[5].v : undefined;
+ r.feeds = [];
(d && d.v[6] && d.v[6].v) ?
- d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) :
+ d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) :
r.feeds = undefined;
- r.phone_id = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
- r.avatar = d && d.v[8] ? utf8_dec(d.v[8].v) : undefined;
- r.names = d && d.v[9] ? utf8_dec(d.v[9].v) : undefined;
- r.surnames = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined;
- r.alias = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined;
- r.email = d && d.v[12] ? utf8_dec(d.v[12].v) : undefined;
- r.vox_id = d && d.v[13] ? utf8_dec(d.v[13].v) : undefined;
- r.reader = d && d.v[14] ? d.v[14].v : undefined;
- r.update = d && d.v[15] ? d.v[15].v : undefined;
- r.settings = [];
+ r.phone_id = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
+ r.avatar = d && d.v[8] ? utf8_dec(d.v[8].v) : undefined;
+ r.names = d && d.v[9] ? utf8_dec(d.v[9].v) : undefined;
+ r.surnames = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined;
+ r.alias = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined;
+ r.email = d && d.v[12] ? utf8_dec(d.v[12].v) : undefined;
+ r.vox_id = d && d.v[13] ? utf8_dec(d.v[13].v) : undefined;
+ r.reader = d && d.v[14] ? d.v[14].v : undefined;
+ r.update = d && d.v[15] ? d.v[15].v : undefined;
+ r.settings = [];
(d && d.v[16] && d.v[16].v) ?
- d.v[16].v.forEach(function(x){r.settings.push(decode(x))}) :
+ d.v[16].v.forEach((x) => { r.settings.push(decode(x)); }) :
r.settings = undefined;
- r.presence = d && d.v[17] ? decode(d.v[17]) : undefined;
- r.status = d && d.v[18] ? decode(d.v[18]) : undefined;
- return clean(r); }
+ r.presence = d && d.v[17] ? decode(d.v[17]) : undefined;
+ r.status = d && d.v[18] ? decode(d.v[18]) : undefined;
+ return clean(r);
+}
function encPerson(d) {
- var tup = atom('Person');
- var id = 'id' in d && d.id ? bin(d.id) : nil();
- var phonelist = []; if ('phonelist' in d && d.phonelist)
- { d.phonelist.forEach(function(x){
- phonelist.push(encode(x))});
- phonelist={t:108,v:phonelist}; } else { phonelist = nil() };
- var alias = []; if ('alias' in d && d.alias)
- { d.alias.forEach(function(x){
- alias.push(encode(x))});
- alias={t:108,v:alias}; } else { alias = nil() };
- var localize = []; if ('localize' in d && d.localize)
- { d.localize.forEach(function(x){
- localize.push(encode(x))});
- localize={t:108,v:localize}; } else { localize = nil() };
- var NotificationSettings = []; if ('NotificationSettings' in d && d.NotificationSettings)
- { d.NotificationSettings.forEach(function(x){
- NotificationSettings.push(encode(x))});
- NotificationSettings={t:108,v:NotificationSettings}; } else { NotificationSettings = nil() };
- var SoundSettings = []; if ('SoundSettings' in d && d.SoundSettings)
- { d.SoundSettings.forEach(function(x){
- SoundSettings.push(encode(x))});
- SoundSettings={t:108,v:SoundSettings}; } else { SoundSettings = nil() };
- var ThemeID = 'ThemeID' in d && d.ThemeID ? bin(d.ThemeID) : nil();
- var BlockUsers = []; if ('BlockUsers' in d && d.BlockUsers)
- { d.BlockUsers.forEach(function(x){
- BlockUsers.push(encode(x))});
- BlockUsers={t:108,v:BlockUsers}; } else { BlockUsers = nil() };
- var balance = 'balance' in d && d.balance ? number(d.balance) : nil();
- var isParticipants = []; if ('isParticipants' in d && d.isParticipants)
- { d.isParticipants.forEach(function(x){
- isParticipants.push(encode(x))});
- isParticipants={t:108,v:isParticipants}; } else { isParticipants = nil() };
- var status = 'status' in d && d.status ? encode(d.status) : nil();
- return tuple(tup,id,phonelist,alias,localize,NotificationSettings,SoundSettings,ThemeID,BlockUsers,balance,isParticipants,status); }
+ const tup = atom('Person');
+ const id = 'id' in d && d.id ? bin(d.id) : nil();
+ let phonelist = []; if ('phonelist' in d && d.phonelist) {
+ d.phonelist.forEach((x) => {
+ phonelist.push(encode(x));
+ });
+ phonelist = { t: 108, v: phonelist };
+ } else { phonelist = nil(); }
+ let alias = []; if ('alias' in d && d.alias) {
+ d.alias.forEach((x) => {
+ alias.push(encode(x));
+ });
+ alias = { t: 108, v: alias };
+ } else { alias = nil(); }
+ let localize = []; if ('localize' in d && d.localize) {
+ d.localize.forEach((x) => {
+ localize.push(encode(x));
+ });
+ localize = { t: 108, v: localize };
+ } else { localize = nil(); }
+ let NotificationSettings = []; if ('NotificationSettings' in d && d.NotificationSettings) {
+ d.NotificationSettings.forEach((x) => {
+ NotificationSettings.push(encode(x));
+ });
+ NotificationSettings = { t: 108, v: NotificationSettings };
+ } else { NotificationSettings = nil(); }
+ let SoundSettings = []; if ('SoundSettings' in d && d.SoundSettings) {
+ d.SoundSettings.forEach((x) => {
+ SoundSettings.push(encode(x));
+ });
+ SoundSettings = { t: 108, v: SoundSettings };
+ } else { SoundSettings = nil(); }
+ const ThemeID = 'ThemeID' in d && d.ThemeID ? bin(d.ThemeID) : nil();
+ let BlockUsers = []; if ('BlockUsers' in d && d.BlockUsers) {
+ d.BlockUsers.forEach((x) => {
+ BlockUsers.push(encode(x));
+ });
+ BlockUsers = { t: 108, v: BlockUsers };
+ } else { BlockUsers = nil(); }
+ const balance = 'balance' in d && d.balance ? number(d.balance) : nil();
+ let isParticipants = []; if ('isParticipants' in d && d.isParticipants) {
+ d.isParticipants.forEach((x) => {
+ isParticipants.push(encode(x));
+ });
+ isParticipants = { t: 108, v: isParticipants };
+ } else { isParticipants = nil(); }
+ const status = 'status' in d && d.status ? encode(d.status) : nil();
+ return tuple(tup, id, phonelist, alias, localize, NotificationSettings, SoundSettings, ThemeID, BlockUsers, balance, isParticipants, status);
+}
function lenPerson() { return 12; }
function decPerson(d) {
- var r={}; r.tup = 'Person';
- r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.phonelist = [];
+ const r = {}; r.tup = 'Person';
+ r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.phonelist = [];
(d && d.v[2] && d.v[2].v) ?
- d.v[2].v.forEach(function(x){r.phonelist.push(decode(x))}) :
+ d.v[2].v.forEach((x) => { r.phonelist.push(decode(x)); }) :
r.phonelist = undefined;
- r.alias = [];
+ r.alias = [];
(d && d.v[3] && d.v[3].v) ?
- d.v[3].v.forEach(function(x){r.alias.push(decode(x))}) :
+ d.v[3].v.forEach((x) => { r.alias.push(decode(x)); }) :
r.alias = undefined;
- r.localize = [];
+ r.localize = [];
(d && d.v[4] && d.v[4].v) ?
- d.v[4].v.forEach(function(x){r.localize.push(decode(x))}) :
+ d.v[4].v.forEach((x) => { r.localize.push(decode(x)); }) :
r.localize = undefined;
- r.NotificationSettings = [];
+ r.NotificationSettings = [];
(d && d.v[5] && d.v[5].v) ?
- d.v[5].v.forEach(function(x){r.NotificationSettings.push(decode(x))}) :
+ d.v[5].v.forEach((x) => { r.NotificationSettings.push(decode(x)); }) :
r.NotificationSettings = undefined;
- r.SoundSettings = [];
+ r.SoundSettings = [];
(d && d.v[6] && d.v[6].v) ?
- d.v[6].v.forEach(function(x){r.SoundSettings.push(decode(x))}) :
+ d.v[6].v.forEach((x) => { r.SoundSettings.push(decode(x)); }) :
r.SoundSettings = undefined;
- r.ThemeID = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
- r.BlockUsers = [];
+ r.ThemeID = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
+ r.BlockUsers = [];
(d && d.v[8] && d.v[8].v) ?
- d.v[8].v.forEach(function(x){r.BlockUsers.push(decode(x))}) :
+ d.v[8].v.forEach((x) => { r.BlockUsers.push(decode(x)); }) :
r.BlockUsers = undefined;
- r.balance = d && d.v[9] ? d.v[9].v : undefined;
- r.isParticipants = [];
+ r.balance = d && d.v[9] ? d.v[9].v : undefined;
+ r.isParticipants = [];
(d && d.v[10] && d.v[10].v) ?
- d.v[10].v.forEach(function(x){r.isParticipants.push(decode(x))}) :
+ d.v[10].v.forEach((x) => { r.isParticipants.push(decode(x)); }) :
r.isParticipants = undefined;
- r.status = d && d.v[11] ? decode(d.v[11]) : undefined;
- return clean(r); }
+ r.status = d && d.v[11] ? decode(d.v[11]) : undefined;
+ return clean(r);
+}
function encDesc(d) {
- var tup = atom('Desc');
- var mime = 'mime' in d && d.mime ? bin(d.mime) : nil();
- var payload = 'payload' in d && d.payload ? bin(d.payload) : nil();
- var size = 'size' in d && d.size ? number(d.size) : nil();
- var filename = 'filename' in d && d.filename ? bin(d.filename) : nil();
- var info = 'info' in d && d.info ? bin(d.info) : nil();
- return tuple(tup,mime,payload,size,filename,info); }
+ const tup = atom('Desc');
+ const mime = 'mime' in d && d.mime ? bin(d.mime) : nil();
+ const payload = 'payload' in d && d.payload ? bin(d.payload) : nil();
+ const size = 'size' in d && d.size ? number(d.size) : nil();
+ const filename = 'filename' in d && d.filename ? bin(d.filename) : nil();
+ const info = 'info' in d && d.info ? bin(d.info) : nil();
+ return tuple(tup, mime, payload, size, filename, info);
+}
function lenDesc() { return 6; }
function decDesc(d) {
- var r={}; r.tup = 'Desc';
- r.mime = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.size = d && d.v[3] ? d.v[3].v : undefined;
- r.filename = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
- r.info = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Desc';
+ r.mime = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.size = d && d.v[3] ? d.v[3].v : undefined;
+ r.filename = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
+ r.info = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
+ return clean(r);
+}
function encMessage(d) {
- var tup = atom('Message');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var container = 'container' in d && d.container ? encode(d.container) : nil();
- var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var msg_id = 'msg_id' in d && d.msg_id ? bin(d.msg_id) : nil();
- var from = 'from' in d && d.from ? bin(d.from) : nil();
- var to = 'to' in d && d.to ? bin(d.to) : nil();
- var created = 'created' in d && d.created ? encode(d.created) : nil();
- var files = []; if ('files' in d && d.files)
- { d.files.forEach(function(x){
- files.push(encode(x))});
- files={t:108,v:files}; } else { files = nil() };
- var type = 'type' in d && d.type ? encode(d.type) : nil();
- var edit_msg = 'edit_msg' in d && d.edit_msg ? number(d.edit_msg) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,id,container,feed_id,prev,next,msg_id,from,to,created,files,
- type,edit_msg,status); }
+ const tup = atom('Message');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const container = 'container' in d && d.container ? encode(d.container) : nil();
+ const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ const msg_id = 'msg_id' in d && d.msg_id ? bin(d.msg_id) : nil();
+ const from = 'from' in d && d.from ? bin(d.from) : nil();
+ const to = 'to' in d && d.to ? bin(d.to) : nil();
+ const created = 'created' in d && d.created ? encode(d.created) : nil();
+ let files = []; if ('files' in d && d.files) {
+ d.files.forEach((x) => {
+ files.push(encode(x));
+ });
+ files = { t: 108, v: files };
+ } else { files = nil(); }
+ const type = 'type' in d && d.type ? encode(d.type) : nil();
+ const edit_msg = 'edit_msg' in d && d.edit_msg ? number(d.edit_msg) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(
+ tup, id, container, feed_id, prev, next, msg_id, from, to, created, files,
+ type, edit_msg, status
+ );
+}
function lenMessage() { return 14; }
function decMessage(d) {
- var r={}; r.tup = 'Message';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? decode(d.v[2]) : undefined;
- r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined;
- r.prev = d && d.v[4] ? d.v[4].v : undefined;
- r.next = d && d.v[5] ? d.v[5].v : undefined;
- r.msg_id = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
- r.from = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
- r.to = d && d.v[8] ? utf8_dec(d.v[8].v) : undefined;
- r.created = d && d.v[9] ? decode(d.v[9]) : undefined;
- r.files = [];
+ const r = {}; r.tup = 'Message';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? decode(d.v[2]) : undefined;
+ r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined;
+ r.prev = d && d.v[4] ? d.v[4].v : undefined;
+ r.next = d && d.v[5] ? d.v[5].v : undefined;
+ r.msg_id = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
+ r.from = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
+ r.to = d && d.v[8] ? utf8_dec(d.v[8].v) : undefined;
+ r.created = d && d.v[9] ? decode(d.v[9]) : undefined;
+ r.files = [];
(d && d.v[10] && d.v[10].v) ?
- d.v[10].v.forEach(function(x){r.files.push(decode(x))}) :
+ d.v[10].v.forEach((x) => { r.files.push(decode(x)); }) :
r.files = undefined;
- r.type = d && d.v[11] ? decode(d.v[11]) : undefined;
- r.edit_msg = d && d.v[12] ? d.v[12].v : undefined;
- r.status = d && d.v[13] ? decode(d.v[13]) : undefined;
- return clean(r); }
+ r.type = d && d.v[11] ? decode(d.v[11]) : undefined;
+ r.edit_msg = d && d.v[12] ? d.v[12].v : undefined;
+ r.status = d && d.v[13] ? decode(d.v[13]) : undefined;
+ return clean(r);
+}
function encRoom(d) {
- var tup = atom('Room');
- var id = 'id' in d && d.id ? bin(d.id) : nil();
- var name = 'name' in d && d.name ? bin(d.name) : nil();
- var description = 'description' in d && d.description ? bin(d.description) : nil();
- var settings = []; if ('settings' in d && d.settings)
- { d.settings.forEach(function(x){
- settings.push(encode(x))});
- settings={t:108,v:settings}; } else { settings = nil() };
- var members = []; if ('members' in d && d.members)
- { d.members.forEach(function(x){
- members.push(encode(x))});
- members={t:108,v:members}; } else { members = nil() };
- var admins = []; if ('admins' in d && d.admins)
- { d.admins.forEach(function(x){
- admins.push(encode(x))});
- admins={t:108,v:admins}; } else { admins = nil() };
- var data = []; if ('data' in d && d.data)
- { d.data.forEach(function(x){
- data.push(encode(x))});
- data={t:108,v:data}; } else { data = nil() };
- var type = 'type' in d && d.type ? encode(d.type) : nil();
- var tos = 'tos' in d && d.tos ? bin(d.tos) : nil();
- var tos_update = 'tos_update' in d && d.tos_update ? number(d.tos_update) : nil();
- var unread = 'unread' in d && d.unread ? number(d.unread) : nil();
- var last_msg = 'last_msg' in d && d.last_msg ? encode(d.last_msg) : nil();
- var update = 'update' in d && d.update ? number(d.update) : nil();
- var created = 'created' in d && d.created ? number(d.created) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,id,name,description,settings,members,admins,data,type,tos,tos_update,
- unread,last_msg,update,created,status); }
+ const tup = atom('Room');
+ const id = 'id' in d && d.id ? bin(d.id) : nil();
+ const name = 'name' in d && d.name ? bin(d.name) : nil();
+ const description = 'description' in d && d.description ? bin(d.description) : nil();
+ let settings = []; if ('settings' in d && d.settings) {
+ d.settings.forEach((x) => {
+ settings.push(encode(x));
+ });
+ settings = { t: 108, v: settings };
+ } else { settings = nil(); }
+ let members = []; if ('members' in d && d.members) {
+ d.members.forEach((x) => {
+ members.push(encode(x));
+ });
+ members = { t: 108, v: members };
+ } else { members = nil(); }
+ let admins = []; if ('admins' in d && d.admins) {
+ d.admins.forEach((x) => {
+ admins.push(encode(x));
+ });
+ admins = { t: 108, v: admins };
+ } else { admins = nil(); }
+ let data = []; if ('data' in d && d.data) {
+ d.data.forEach((x) => {
+ data.push(encode(x));
+ });
+ data = { t: 108, v: data };
+ } else { data = nil(); }
+ const type = 'type' in d && d.type ? encode(d.type) : nil();
+ const tos = 'tos' in d && d.tos ? bin(d.tos) : nil();
+ const tos_update = 'tos_update' in d && d.tos_update ? number(d.tos_update) : nil();
+ const unread = 'unread' in d && d.unread ? number(d.unread) : nil();
+ const last_msg = 'last_msg' in d && d.last_msg ? encode(d.last_msg) : nil();
+ const update = 'update' in d && d.update ? number(d.update) : nil();
+ const created = 'created' in d && d.created ? number(d.created) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(
+ tup, id, name, description, settings, members, admins, data, type, tos, tos_update,
+ unread, last_msg, update, created, status
+ );
+}
function lenRoom() { return 16; }
function decRoom(d) {
- var r={}; r.tup = 'Room';
- r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.description = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.settings = [];
+ const r = {}; r.tup = 'Room';
+ r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.description = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.settings = [];
(d && d.v[4] && d.v[4].v) ?
- d.v[4].v.forEach(function(x){r.settings.push(decode(x))}) :
+ d.v[4].v.forEach((x) => { r.settings.push(decode(x)); }) :
r.settings = undefined;
- r.members = [];
+ r.members = [];
(d && d.v[5] && d.v[5].v) ?
- d.v[5].v.forEach(function(x){r.members.push(decode(x))}) :
+ d.v[5].v.forEach((x) => { r.members.push(decode(x)); }) :
r.members = undefined;
- r.admins = [];
+ r.admins = [];
(d && d.v[6] && d.v[6].v) ?
- d.v[6].v.forEach(function(x){r.admins.push(decode(x))}) :
+ d.v[6].v.forEach((x) => { r.admins.push(decode(x)); }) :
r.admins = undefined;
- r.data = [];
+ r.data = [];
(d && d.v[7] && d.v[7].v) ?
- d.v[7].v.forEach(function(x){r.data.push(decode(x))}) :
+ d.v[7].v.forEach((x) => { r.data.push(decode(x)); }) :
r.data = undefined;
- r.type = d && d.v[8] ? decode(d.v[8]) : undefined;
- r.tos = d && d.v[9] ? utf8_dec(d.v[9].v) : undefined;
- r.tos_update = d && d.v[10] ? d.v[10].v : undefined;
- r.unread = d && d.v[11] ? d.v[11].v : undefined;
- r.last_msg = d && d.v[12] ? decode(d.v[12]) : undefined;
- r.update = d && d.v[13] ? d.v[13].v : undefined;
- r.created = d && d.v[14] ? d.v[14].v : undefined;
- r.status = d && d.v[15] ? decode(d.v[15]) : undefined;
- return clean(r); }
+ r.type = d && d.v[8] ? decode(d.v[8]) : undefined;
+ r.tos = d && d.v[9] ? utf8_dec(d.v[9].v) : undefined;
+ r.tos_update = d && d.v[10] ? d.v[10].v : undefined;
+ r.unread = d && d.v[11] ? d.v[11].v : undefined;
+ r.last_msg = d && d.v[12] ? decode(d.v[12]) : undefined;
+ r.update = d && d.v[13] ? d.v[13].v : undefined;
+ r.created = d && d.v[14] ? d.v[14].v : undefined;
+ r.status = d && d.v[15] ? decode(d.v[15]) : undefined;
+ return clean(r);
+}
function encTag(d) {
- var tup = atom('Tag');
- var roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil();
- var name = 'name' in d && d.name ? bin(d.name) : nil();
- var color = 'color' in d && d.color ? bin(d.color) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,roster_id,name,color,status); }
+ const tup = atom('Tag');
+ const roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil();
+ const name = 'name' in d && d.name ? bin(d.name) : nil();
+ const color = 'color' in d && d.color ? bin(d.color) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(tup, roster_id, name, color, status);
+}
function lenTag() { return 5; }
function decTag(d) {
- var r={}; r.tup = 'Tag';
- r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.color = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.status = d && d.v[4] ? decode(d.v[4]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Tag';
+ r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.color = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.status = d && d.v[4] ? decode(d.v[4]) : undefined;
+ return clean(r);
+}
function encStar(d) {
- var tup = atom('Star');
- var roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil();
- var message = 'message' in d && d.message ? encode(d.message) : nil();
- var tags = []; if ('tags' in d && d.tags)
- { d.tags.forEach(function(x){
- tags.push(encode(x))});
- tags={t:108,v:tags}; } else { tags = nil() };
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,roster_id,message,tags,status); }
+ const tup = atom('Star');
+ const roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil();
+ const message = 'message' in d && d.message ? encode(d.message) : nil();
+ let tags = []; if ('tags' in d && d.tags) {
+ d.tags.forEach((x) => {
+ tags.push(encode(x));
+ });
+ tags = { t: 108, v: tags };
+ } else { tags = nil(); }
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(tup, roster_id, message, tags, status);
+}
function lenStar() { return 5; }
function decStar(d) {
- var r={}; r.tup = 'Star';
- r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.message = d && d.v[2] ? decode(d.v[2]) : undefined;
- r.tags = [];
+ const r = {}; r.tup = 'Star';
+ r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.message = d && d.v[2] ? decode(d.v[2]) : undefined;
+ r.tags = [];
(d && d.v[3] && d.v[3].v) ?
- d.v[3].v.forEach(function(x){r.tags.push(decode(x))}) :
+ d.v[3].v.forEach((x) => { r.tags.push(decode(x)); }) :
r.tags = undefined;
- r.status = d && d.v[4] ? decode(d.v[4]) : undefined;
- return clean(r); }
+ r.status = d && d.v[4] ? decode(d.v[4]) : undefined;
+ return clean(r);
+}
function encHistory(d) {
- var tup = atom('History');
- var roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil();
- var feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
- var size = 'size' in d && d.size ? number(d.size) : nil();
- var entity_id = 'entity_id' in d && d.entity_id ? number(d.entity_id) : nil();
- var data = []; if ('data' in d && d.data)
- { d.data.forEach(function(x){
- data.push(encode(x))});
- data={t:108,v:data}; } else { data = nil() };
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,roster_id,feed,size,entity_id,data,status); }
+ const tup = atom('History');
+ const roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil();
+ const feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
+ const size = 'size' in d && d.size ? number(d.size) : nil();
+ const entity_id = 'entity_id' in d && d.entity_id ? number(d.entity_id) : nil();
+ let data = []; if ('data' in d && d.data) {
+ d.data.forEach((x) => {
+ data.push(encode(x));
+ });
+ data = { t: 108, v: data };
+ } else { data = nil(); }
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(tup, roster_id, feed, size, entity_id, data, status);
+}
function lenHistory() { return 7; }
function decHistory(d) {
- var r={}; r.tup = 'History';
- r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.feed = d && d.v[2] ? decode(d.v[2]) : undefined;
- r.size = d && d.v[3] ? d.v[3].v : undefined;
- r.entity_id = d && d.v[4] ? d.v[4].v : undefined;
- r.data = [];
+ const r = {}; r.tup = 'History';
+ r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.feed = d && d.v[2] ? decode(d.v[2]) : undefined;
+ r.size = d && d.v[3] ? d.v[3].v : undefined;
+ r.entity_id = d && d.v[4] ? d.v[4].v : undefined;
+ r.data = [];
(d && d.v[5] && d.v[5].v) ?
- d.v[5].v.forEach(function(x){r.data.push(decode(x))}) :
+ d.v[5].v.forEach((x) => { r.data.push(decode(x)); }) :
r.data = undefined;
- r.status = d && d.v[6] ? decode(d.v[6]) : undefined;
- return clean(r); }
+ r.status = d && d.v[6] ? decode(d.v[6]) : undefined;
+ return clean(r);
+}
function encTyping(d) {
- var tup = atom('Typing');
- var phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil();
- var comments = 'comments' in d && d.comments ? encode(d.comments) : nil();
- return tuple(tup,phone_id,comments); }
+ const tup = atom('Typing');
+ const phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil();
+ const comments = 'comments' in d && d.comments ? encode(d.comments) : nil();
+ return tuple(tup, phone_id, comments);
+}
function lenTyping() { return 3; }
function decTyping(d) {
- var r={}; r.tup = 'Typing';
- r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.comments = d && d.v[2] ? decode(d.v[2].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Typing';
+ r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.comments = d && d.v[2] ? decode(d.v[2].v) : undefined;
+ return clean(r);
+}
function encContact(d) {
- var tup = atom('Contact');
- var phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil();
- var avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil();
- var names = 'names' in d && d.names ? bin(d.names) : nil();
- var surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil();
- var nick = 'nick' in d && d.nick ? bin(d.nick) : nil();
- var email = 'email' in d && d.email ? bin(d.email) : nil();
- var vox_id = 'vox_id' in d && d.vox_id ? bin(d.vox_id) : nil();
- var reader = 'reader' in d && d.reader ? number(d.reader) : nil();
- var unread = 'unread' in d && d.unread ? number(d.unread) : nil();
- var last_msg = 'last_msg' in d && d.last_msg ? encode(d.last_msg) : nil();
- var update = 'update' in d && d.update ? number(d.update) : nil();
- var settings = []; if ('settings' in d && d.settings)
- { d.settings.forEach(function(x){
- settings.push(encode(x))});
- settings={t:108,v:settings}; } else { settings = nil() };
- var presence = 'presence' in d && d.presence ? atom(d.presence) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,phone_id,avatar,names,surnames,nick,email,vox_id,reader,unread,last_msg,
- update,settings,presence,status); }
+ const tup = atom('Contact');
+ const phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil();
+ const avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil();
+ const names = 'names' in d && d.names ? bin(d.names) : nil();
+ const surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil();
+ const nick = 'nick' in d && d.nick ? bin(d.nick) : nil();
+ const email = 'email' in d && d.email ? bin(d.email) : nil();
+ const vox_id = 'vox_id' in d && d.vox_id ? bin(d.vox_id) : nil();
+ const reader = 'reader' in d && d.reader ? number(d.reader) : nil();
+ const unread = 'unread' in d && d.unread ? number(d.unread) : nil();
+ const last_msg = 'last_msg' in d && d.last_msg ? encode(d.last_msg) : nil();
+ const update = 'update' in d && d.update ? number(d.update) : nil();
+ let settings = []; if ('settings' in d && d.settings) {
+ d.settings.forEach((x) => {
+ settings.push(encode(x));
+ });
+ settings = { t: 108, v: settings };
+ } else { settings = nil(); }
+ const presence = 'presence' in d && d.presence ? atom(d.presence) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(
+ tup, phone_id, avatar, names, surnames, nick, email, vox_id, reader, unread, last_msg,
+ update, settings, presence, status
+ );
+}
function lenContact() { return 15; }
function decContact(d) {
- var r={}; r.tup = 'Contact';
- r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.avatar = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.names = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.surnames = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
- r.nick = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
- r.email = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
- r.vox_id = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
- r.reader = d && d.v[8] ? d.v[8].v : undefined;
- r.unread = d && d.v[9] ? d.v[9].v : undefined;
- r.last_msg = d && d.v[10] ? decode(d.v[10]) : undefined;
- r.update = d && d.v[11] ? d.v[11].v : undefined;
- r.settings = [];
+ const r = {}; r.tup = 'Contact';
+ r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.avatar = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.names = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.surnames = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
+ r.nick = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
+ r.email = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
+ r.vox_id = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
+ r.reader = d && d.v[8] ? d.v[8].v : undefined;
+ r.unread = d && d.v[9] ? d.v[9].v : undefined;
+ r.last_msg = d && d.v[10] ? decode(d.v[10]) : undefined;
+ r.update = d && d.v[11] ? d.v[11].v : undefined;
+ r.settings = [];
(d && d.v[12] && d.v[12].v) ?
- d.v[12].v.forEach(function(x){r.settings.push(decode(x))}) :
+ d.v[12].v.forEach((x) => { r.settings.push(decode(x)); }) :
r.settings = undefined;
- r.presence = d && d.v[13] ? d.v[13].v : undefined;
- r.status = d && d.v[14] ? decode(d.v[14]) : undefined;
- return clean(r); }
+ r.presence = d && d.v[13] ? d.v[13].v : undefined;
+ r.status = d && d.v[14] ? decode(d.v[14]) : undefined;
+ return clean(r);
+}
function encAuth(d) {
- var tup = atom('Auth');
- var client_id = 'client_id' in d && d.client_id ? bin(d.client_id) : nil();
- var dev_key = 'dev_key' in d && d.dev_key ? bin(d.dev_key) : nil();
- var user_id = 'user_id' in d && d.user_id ? bin(d.user_id) : nil();
- var phone = 'phone' in d && d.phone ? bin(d.phone) : nil();
- var token = 'token' in d && d.token ? bin(d.token) : nil();
- var type = 'type' in d && d.type ? atom(d.type) : nil();
- var sms_code = 'sms_code' in d && d.sms_code ? bin(d.sms_code) : nil();
- var attempts = 'attempts' in d && d.attempts ? number(d.attempts) : nil();
- var services = []; if ('services' in d && d.services)
- { d.services.forEach(function(x){
- services.push(encode(x))});
- services={t:108,v:services}; } else { services = nil() };
- var push = 'push' in d && d.push ? bin(d.push) : nil();
- var os = 'os' in d && d.os ? encode(d.os) : nil();
- var created = 'created' in d && d.created ? encode(d.created) : nil();
- var last_online = 'last_online' in d && d.last_online ? number(d.last_online) : nil();
- return tuple(tup,client_id,dev_key,user_id,phone,token,type,sms_code,attempts,services,push,
- os,created,last_online); }
+ const tup = atom('Auth');
+ const client_id = 'client_id' in d && d.client_id ? bin(d.client_id) : nil();
+ const dev_key = 'dev_key' in d && d.dev_key ? bin(d.dev_key) : nil();
+ const user_id = 'user_id' in d && d.user_id ? bin(d.user_id) : nil();
+ const phone = 'phone' in d && d.phone ? bin(d.phone) : nil();
+ const token = 'token' in d && d.token ? bin(d.token) : nil();
+ const type = 'type' in d && d.type ? atom(d.type) : nil();
+ const sms_code = 'sms_code' in d && d.sms_code ? bin(d.sms_code) : nil();
+ const attempts = 'attempts' in d && d.attempts ? number(d.attempts) : nil();
+ let services = []; if ('services' in d && d.services) {
+ d.services.forEach((x) => {
+ services.push(encode(x));
+ });
+ services = { t: 108, v: services };
+ } else { services = nil(); }
+ const push = 'push' in d && d.push ? bin(d.push) : nil();
+ const os = 'os' in d && d.os ? encode(d.os) : nil();
+ const created = 'created' in d && d.created ? encode(d.created) : nil();
+ const last_online = 'last_online' in d && d.last_online ? number(d.last_online) : nil();
+ return tuple(
+ tup, client_id, dev_key, user_id, phone, token, type, sms_code, attempts, services, push,
+ os, created, last_online
+ );
+}
function lenAuth() { return 14; }
function decAuth(d) {
- var r={}; r.tup = 'Auth';
- r.client_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.dev_key = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.user_id = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.phone = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
- r.token = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
- r.type = d && d.v[6] ? d.v[6].v : undefined;
- r.sms_code = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
- r.attempts = d && d.v[8] ? d.v[8].v : undefined;
- r.services = [];
+ const r = {}; r.tup = 'Auth';
+ r.client_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.dev_key = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.user_id = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.phone = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
+ r.token = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
+ r.type = d && d.v[6] ? d.v[6].v : undefined;
+ r.sms_code = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
+ r.attempts = d && d.v[8] ? d.v[8].v : undefined;
+ r.services = [];
(d && d.v[9] && d.v[9].v) ?
- d.v[9].v.forEach(function(x){r.services.push(decode(x))}) :
+ d.v[9].v.forEach((x) => { r.services.push(decode(x)); }) :
r.services = undefined;
- r.push = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined;
- r.os = d && d.v[11] ? decode(d.v[11]) : undefined;
- r.created = d && d.v[12] ? decode(d.v[12]) : undefined;
- r.last_online = d && d.v[13] ? d.v[13].v : undefined;
- return clean(r); }
+ r.push = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined;
+ r.os = d && d.v[11] ? decode(d.v[11]) : undefined;
+ r.created = d && d.v[12] ? decode(d.v[12]) : undefined;
+ r.last_online = d && d.v[13] ? d.v[13].v : undefined;
+ return clean(r);
+}
function encService(d) {
- var tup = atom('Service');
- var id = 'id' in d && d.id ? bin(d.id) : nil();
- var type = 'type' in d && d.type ? atom(d.type) : nil();
- var data = 'data' in d && d.data ? encode(d.data) : nil();
- var login = 'login' in d && d.login ? bin(d.login) : nil();
- var password = 'password' in d && d.password ? bin(d.password) : nil();
- var expiration = 'expiration' in d && d.expiration ? number(d.expiration) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,id,type,data,login,password,expiration,status); }
+ const tup = atom('Service');
+ const id = 'id' in d && d.id ? bin(d.id) : nil();
+ const type = 'type' in d && d.type ? atom(d.type) : nil();
+ const data = 'data' in d && d.data ? encode(d.data) : nil();
+ const login = 'login' in d && d.login ? bin(d.login) : nil();
+ const password = 'password' in d && d.password ? bin(d.password) : nil();
+ const expiration = 'expiration' in d && d.expiration ? number(d.expiration) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(tup, id, type, data, login, password, expiration, status);
+}
function lenService() { return 8; }
function decService(d) {
- var r={}; r.tup = 'Service';
- r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.type = d && d.v[2] ? decode(d.v[2]) : undefined;
- r.data = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.login = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
- r.password = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
- r.expiration = d && d.v[6] ? d.v[6].v : undefined;
- r.status = d && d.v[7] ? decode(d.v[7]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Service';
+ r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.type = d && d.v[2] ? decode(d.v[2]) : undefined;
+ r.data = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.login = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
+ r.password = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
+ r.expiration = d && d.v[6] ? d.v[6].v : undefined;
+ r.status = d && d.v[7] ? decode(d.v[7]) : undefined;
+ return clean(r);
+}
function encRoster(d) {
- var tup = atom('Roster');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var names = 'names' in d && d.names ? bin(d.names) : nil();
- var surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil();
- var email = 'email' in d && d.email ? bin(d.email) : nil();
- var nick = 'nick' in d && d.nick ? bin(d.nick) : nil();
- var userlist = []; if ('userlist' in d && d.userlist)
- { d.userlist.forEach(function(x){
- userlist.push(encode(x))});
- userlist={t:108,v:userlist}; } else { userlist = nil() };
- var roomlist = []; if ('roomlist' in d && d.roomlist)
- { d.roomlist.forEach(function(x){
- roomlist.push(encode(x))});
- roomlist={t:108,v:roomlist}; } else { roomlist = nil() };
- var favorite = []; if ('favorite' in d && d.favorite)
- { d.favorite.forEach(function(x){
- favorite.push(encode(x))});
- favorite={t:108,v:favorite}; } else { favorite = nil() };
- var tags = []; if ('tags' in d && d.tags)
- { d.tags.forEach(function(x){
- tags.push(encode(x))});
- tags={t:108,v:tags}; } else { tags = nil() };
- var phone = 'phone' in d && d.phone ? bin(d.phone) : nil();
- var avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil();
- var update = 'update' in d && d.update ? number(d.update) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,id,names,surnames,email,nick,userlist,roomlist,favorite,tags,phone,
- avatar,update,status); }
+ const tup = atom('Roster');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const names = 'names' in d && d.names ? bin(d.names) : nil();
+ const surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil();
+ const email = 'email' in d && d.email ? bin(d.email) : nil();
+ const nick = 'nick' in d && d.nick ? bin(d.nick) : nil();
+ let userlist = []; if ('userlist' in d && d.userlist) {
+ d.userlist.forEach((x) => {
+ userlist.push(encode(x));
+ });
+ userlist = { t: 108, v: userlist };
+ } else { userlist = nil(); }
+ let roomlist = []; if ('roomlist' in d && d.roomlist) {
+ d.roomlist.forEach((x) => {
+ roomlist.push(encode(x));
+ });
+ roomlist = { t: 108, v: roomlist };
+ } else { roomlist = nil(); }
+ let favorite = []; if ('favorite' in d && d.favorite) {
+ d.favorite.forEach((x) => {
+ favorite.push(encode(x));
+ });
+ favorite = { t: 108, v: favorite };
+ } else { favorite = nil(); }
+ let tags = []; if ('tags' in d && d.tags) {
+ d.tags.forEach((x) => {
+ tags.push(encode(x));
+ });
+ tags = { t: 108, v: tags };
+ } else { tags = nil(); }
+ const phone = 'phone' in d && d.phone ? bin(d.phone) : nil();
+ const avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil();
+ const update = 'update' in d && d.update ? number(d.update) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(
+ tup, id, names, surnames, email, nick, userlist, roomlist, favorite, tags, phone,
+ avatar, update, status
+ );
+}
function lenRoster() { return 14; }
function decRoster(d) {
- var r={}; r.tup = 'Roster';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.names = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.surnames = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.email = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
- r.nick = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
- r.userlist = [];
+ const r = {}; r.tup = 'Roster';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.names = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.surnames = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.email = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
+ r.nick = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
+ r.userlist = [];
(d && d.v[6] && d.v[6].v) ?
- d.v[6].v.forEach(function(x){r.userlist.push(decode(x))}) :
+ d.v[6].v.forEach((x) => { r.userlist.push(decode(x)); }) :
r.userlist = undefined;
- r.roomlist = [];
+ r.roomlist = [];
(d && d.v[7] && d.v[7].v) ?
- d.v[7].v.forEach(function(x){r.roomlist.push(decode(x))}) :
+ d.v[7].v.forEach((x) => { r.roomlist.push(decode(x)); }) :
r.roomlist = undefined;
- r.favorite = [];
+ r.favorite = [];
(d && d.v[8] && d.v[8].v) ?
- d.v[8].v.forEach(function(x){r.favorite.push(decode(x))}) :
+ d.v[8].v.forEach((x) => { r.favorite.push(decode(x)); }) :
r.favorite = undefined;
- r.tags = [];
+ r.tags = [];
(d && d.v[9] && d.v[9].v) ?
- d.v[9].v.forEach(function(x){r.tags.push(decode(x))}) :
+ d.v[9].v.forEach((x) => { r.tags.push(decode(x)); }) :
r.tags = undefined;
- r.phone = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined;
- r.avatar = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined;
- r.update = d && d.v[12] ? d.v[12].v : undefined;
- r.status = d && d.v[13] ? decode(d.v[13]) : undefined;
- return clean(r); }
+ r.phone = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined;
+ r.avatar = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined;
+ r.update = d && d.v[12] ? d.v[12].v : undefined;
+ r.status = d && d.v[13] ? decode(d.v[13]) : undefined;
+ return clean(r);
+}
function encProfile(d) {
- var tup = atom('Profile');
- var phone = 'phone' in d && d.phone ? bin(d.phone) : nil();
- var services = []; if ('services' in d && d.services)
- { d.services.forEach(function(x){
- services.push(encode(x))});
- services={t:108,v:services}; } else { services = nil() };
- var rosters = []; if ('rosters' in d && d.rosters)
- { d.rosters.forEach(function(x){
- rosters.push(encode(x))});
- rosters={t:108,v:rosters}; } else { rosters = nil() };
- var settings = []; if ('settings' in d && d.settings)
- { d.settings.forEach(function(x){
- settings.push(encode(x))});
- settings={t:108,v:settings}; } else { settings = nil() };
- var update = 'update' in d && d.update ? number(d.update) : nil();
- var balance = 'balance' in d && d.balance ? number(d.balance) : nil();
- var presence = 'presence' in d && d.presence ? atom(d.presence) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,phone,services,rosters,settings,update,balance,presence,status); }
+ const tup = atom('Profile');
+ const phone = 'phone' in d && d.phone ? bin(d.phone) : nil();
+ let services = []; if ('services' in d && d.services) {
+ d.services.forEach((x) => {
+ services.push(encode(x));
+ });
+ services = { t: 108, v: services };
+ } else { services = nil(); }
+ let rosters = []; if ('rosters' in d && d.rosters) {
+ d.rosters.forEach((x) => {
+ rosters.push(encode(x));
+ });
+ rosters = { t: 108, v: rosters };
+ } else { rosters = nil(); }
+ let settings = []; if ('settings' in d && d.settings) {
+ d.settings.forEach((x) => {
+ settings.push(encode(x));
+ });
+ settings = { t: 108, v: settings };
+ } else { settings = nil(); }
+ const update = 'update' in d && d.update ? number(d.update) : nil();
+ const balance = 'balance' in d && d.balance ? number(d.balance) : nil();
+ const presence = 'presence' in d && d.presence ? atom(d.presence) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(tup, phone, services, rosters, settings, update, balance, presence, status);
+}
function lenProfile() { return 9; }
function decProfile(d) {
- var r={}; r.tup = 'Profile';
- r.phone = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.services = [];
+ const r = {}; r.tup = 'Profile';
+ r.phone = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.services = [];
(d && d.v[2] && d.v[2].v) ?
- d.v[2].v.forEach(function(x){r.services.push(decode(x))}) :
+ d.v[2].v.forEach((x) => { r.services.push(decode(x)); }) :
r.services = undefined;
- r.rosters = [];
+ r.rosters = [];
(d && d.v[3] && d.v[3].v) ?
- d.v[3].v.forEach(function(x){r.rosters.push(decode(x))}) :
+ d.v[3].v.forEach((x) => { r.rosters.push(decode(x)); }) :
r.rosters = undefined;
- r.settings = [];
+ r.settings = [];
(d && d.v[4] && d.v[4].v) ?
- d.v[4].v.forEach(function(x){r.settings.push(decode(x))}) :
+ d.v[4].v.forEach((x) => { r.settings.push(decode(x)); }) :
r.settings = undefined;
- r.update = d && d.v[5] ? d.v[5].v : undefined;
- r.balance = d && d.v[6] ? d.v[6].v : undefined;
- r.presence = d && d.v[7] ? d.v[7].v : undefined;
- r.status = d && d.v[8] ? d.v[8].v : undefined;
- return clean(r); }
+ r.update = d && d.v[5] ? d.v[5].v : undefined;
+ r.balance = d && d.v[6] ? d.v[6].v : undefined;
+ r.presence = d && d.v[7] ? d.v[7].v : undefined;
+ r.status = d && d.v[8] ? d.v[8].v : undefined;
+ return clean(r);
+}
function encLoc(d) {
- var tup = atom('Loc');
- var x = 'x' in d && d.x ? bin(d.x) : nil();
- var y = 'y' in d && d.y ? bin(d.y) : nil();
- var z = 'z' in d && d.z ? bin(d.z) : nil();
- return tuple(tup,x,y,z); }
+ const tup = atom('Loc');
+ const x = 'x' in d && d.x ? bin(d.x) : nil();
+ const y = 'y' in d && d.y ? bin(d.y) : nil();
+ const z = 'z' in d && d.z ? bin(d.z) : nil();
+ return tuple(tup, x, y, z);
+}
function lenLoc() { return 4; }
function decLoc(d) {
- var r={}; r.tup = 'Loc';
- r.x = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.y = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.z = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Loc';
+ r.x = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.y = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.z = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ return clean(r);
+}
function encFriend(d) {
- var tup = atom('Friend');
- var phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil();
- var friend_id = 'friend_id' in d && d.friend_id ? bin(d.friend_id) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,phone_id,friend_id,status); }
+ const tup = atom('Friend');
+ const phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil();
+ const friend_id = 'friend_id' in d && d.friend_id ? bin(d.friend_id) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(tup, phone_id, friend_id, status);
+}
function lenFriend() { return 4; }
function decFriend(d) {
- var r={}; r.tup = 'Friend';
- r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.friend_id = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.status = d && d.v[3] ? decode(d.v[3]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Friend';
+ r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.friend_id = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.status = d && d.v[3] ? decode(d.v[3]) : undefined;
+ return clean(r);
+}
function encCallMember(d) {
- var tup = atom('CallMember');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var container = 'container' in d && d.container ? encode(d.container) : nil();
- var feed_id = 'feed_id' in d && d.feed_id ? bin(d.feed_id) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var contact = 'contact' in d && d.contact ? encode(d.contact) : nil();
- var start = 'start' in d && d.start ? number(d.start) : nil();
- var stop = 'stop' in d && d.stop ? number(d.stop) : nil();
- var type = 'type' in d && d.type ? encode(d.type) : nil();
- var desc = 'desc' in d && d.desc ? bin(d.desc) : nil();
- var tariff = 'tariff' in d && d.tariff ? bin(d.tariff) : nil();
- var bill = 'bill' in d && d.bill ? number(d.bill) : nil();
- var duration = 'duration' in d && d.duration ? number(d.duration) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,id,container,feed_id,prev,next,contact,start,stop,type,desc,
- tariff,bill,duration,status); }
+ const tup = atom('CallMember');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const container = 'container' in d && d.container ? encode(d.container) : nil();
+ const feed_id = 'feed_id' in d && d.feed_id ? bin(d.feed_id) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ const contact = 'contact' in d && d.contact ? encode(d.contact) : nil();
+ const start = 'start' in d && d.start ? number(d.start) : nil();
+ const stop = 'stop' in d && d.stop ? number(d.stop) : nil();
+ const type = 'type' in d && d.type ? encode(d.type) : nil();
+ const desc = 'desc' in d && d.desc ? bin(d.desc) : nil();
+ const tariff = 'tariff' in d && d.tariff ? bin(d.tariff) : nil();
+ const bill = 'bill' in d && d.bill ? number(d.bill) : nil();
+ const duration = 'duration' in d && d.duration ? number(d.duration) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(
+ tup, id, container, feed_id, prev, next, contact, start, stop, type, desc,
+ tariff, bill, duration, status
+ );
+}
function lenCallMember() { return 15; }
function decCallMember(d) {
- var r={}; r.tup = 'CallMember';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? decode(d.v[2]) : undefined;
- r.feed_id = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.prev = d && d.v[4] ? d.v[4].v : undefined;
- r.next = d && d.v[5] ? d.v[5].v : undefined;
- r.contact = d && d.v[6] ? decode(d.v[6]) : undefined;
- r.start = d && d.v[7] ? d.v[7].v : undefined;
- r.stop = d && d.v[8] ? d.v[8].v : undefined;
- r.type = d && d.v[9] ? decode(d.v[9]) : undefined;
- r.desc = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined;
- r.tariff = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined;
- r.bill = d && d.v[12] ? d.v[12].v : undefined;
- r.duration = d && d.v[13] ? d.v[13].v : undefined;
- r.status = d && d.v[14] ? decode(d.v[14]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'CallMember';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? decode(d.v[2]) : undefined;
+ r.feed_id = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.prev = d && d.v[4] ? d.v[4].v : undefined;
+ r.next = d && d.v[5] ? d.v[5].v : undefined;
+ r.contact = d && d.v[6] ? decode(d.v[6]) : undefined;
+ r.start = d && d.v[7] ? d.v[7].v : undefined;
+ r.stop = d && d.v[8] ? d.v[8].v : undefined;
+ r.type = d && d.v[9] ? decode(d.v[9]) : undefined;
+ r.desc = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined;
+ r.tariff = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined;
+ r.bill = d && d.v[12] ? d.v[12].v : undefined;
+ r.duration = d && d.v[13] ? d.v[13].v : undefined;
+ r.status = d && d.v[14] ? decode(d.v[14]) : undefined;
+ return clean(r);
+}
function encCall(d) {
- var tup = atom('Call');
- var id = 'id' in d && d.id ? bin(d.id) : nil();
- var from = 'from' in d && d.from ? bin(d.from) : nil();
- var members = []; if ('members' in d && d.members)
- { d.members.forEach(function(x){
- members.push(encode(x))});
- members={t:108,v:members}; } else { members = nil() };
- var start = 'start' in d && d.start ? number(d.start) : nil();
- var stop = 'stop' in d && d.stop ? number(d.stop) : nil();
- var vox_url = 'vox_url' in d && d.vox_url ? bin(d.vox_url) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,id,from,members,start,stop,vox_url,status); }
+ const tup = atom('Call');
+ const id = 'id' in d && d.id ? bin(d.id) : nil();
+ const from = 'from' in d && d.from ? bin(d.from) : nil();
+ let members = []; if ('members' in d && d.members) {
+ d.members.forEach((x) => {
+ members.push(encode(x));
+ });
+ members = { t: 108, v: members };
+ } else { members = nil(); }
+ const start = 'start' in d && d.start ? number(d.start) : nil();
+ const stop = 'stop' in d && d.stop ? number(d.stop) : nil();
+ const vox_url = 'vox_url' in d && d.vox_url ? bin(d.vox_url) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(tup, id, from, members, start, stop, vox_url, status);
+}
function lenCall() { return 8; }
function decCall(d) {
- var r={}; r.tup = 'Call';
- r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.from = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.members = [];
+ const r = {}; r.tup = 'Call';
+ r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.from = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.members = [];
(d && d.v[3] && d.v[3].v) ?
- d.v[3].v.forEach(function(x){r.members.push(decode(x))}) :
+ d.v[3].v.forEach((x) => { r.members.push(decode(x)); }) :
r.members = undefined;
- r.start = d && d.v[4] ? d.v[4].v : undefined;
- r.stop = d && d.v[5] ? d.v[5].v : undefined;
- r.vox_url = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
- r.status = d && d.v[7] ? decode(d.v[7]) : undefined;
- return clean(r); }
+ r.start = d && d.v[4] ? d.v[4].v : undefined;
+ r.stop = d && d.v[5] ? d.v[5].v : undefined;
+ r.vox_url = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
+ r.status = d && d.v[7] ? decode(d.v[7]) : undefined;
+ return clean(r);
+}
function encIndex(d) {
- var tup = atom('Index');
- var id = 'id' in d && d.id ? encode(d.id) : nil();
- var roster = []; if ('roster' in d && d.roster)
- { d.roster.forEach(function(x){
- roster.push(encode(x))});
- roster={t:108,v:roster}; } else { roster = nil() };
- return tuple(tup,id,roster); }
+ const tup = atom('Index');
+ const id = 'id' in d && d.id ? encode(d.id) : nil();
+ let roster = []; if ('roster' in d && d.roster) {
+ d.roster.forEach((x) => {
+ roster.push(encode(x));
+ });
+ roster = { t: 108, v: roster };
+ } else { roster = nil(); }
+ return tuple(tup, id, roster);
+}
function lenIndex() { return 3; }
function decIndex(d) {
- var r={}; r.tup = 'Index';
- r.id = d && d.v[1] ? decode(d.v[1].v) : undefined;
- r.roster = [];
+ const r = {}; r.tup = 'Index';
+ r.id = d && d.v[1] ? decode(d.v[1].v) : undefined;
+ r.roster = [];
(d && d.v[2] && d.v[2].v) ?
- d.v[2].v.forEach(function(x){r.roster.push(decode(x))}) :
+ d.v[2].v.forEach((x) => { r.roster.push(decode(x)); }) :
r.roster = undefined;
- return clean(r); }
+ return clean(r);
+}
function encerror(d) {
- var tup = atom('error');
- var code = 'code' in d && d.code ? encode(d.code) : nil();
- return tuple(tup,code); }
+ const tup = atom('error');
+ const code = 'code' in d && d.code ? encode(d.code) : nil();
+ return tuple(tup, code);
+}
function lenerror() { return 2; }
function decerror(d) {
- var r={}; r.tup = 'error';
- r.code = d && d.v[1] ? decode(d.v[1]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'error';
+ r.code = d && d.v[1] ? decode(d.v[1]) : undefined;
+ return clean(r);
+}
function encok(d) {
- var tup = atom('ok');
- var code = 'code' in d && d.code ? encode(d.code) : nil();
- return tuple(tup,code); }
+ const tup = atom('ok');
+ const code = 'code' in d && d.code ? encode(d.code) : nil();
+ return tuple(tup, code);
+}
function lenok() { return 2; }
function decok(d) {
- var r={}; r.tup = 'ok';
- r.code = d && d.v[1] ? decode(d.v[1]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'ok';
+ r.code = d && d.v[1] ? decode(d.v[1]) : undefined;
+ return clean(r);
+}
function encerror2(d) {
- var tup = atom('error2');
- var code = 'code' in d && d.code ? atom(d.code) : nil();
- var src = 'src' in d && d.src ? encode(d.src) : nil();
- return tuple(tup,code,src); }
+ const tup = atom('error2');
+ const code = 'code' in d && d.code ? atom(d.code) : nil();
+ const src = 'src' in d && d.src ? encode(d.src) : nil();
+ return tuple(tup, code, src);
+}
function lenerror2() { return 3; }
function decerror2(d) {
- var r={}; r.tup = 'error2';
- r.code = d && d.v[1] ? d.v[1].v : undefined;
- r.src = d && d.v[2] ? decode(d.v[2]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'error2';
+ r.code = d && d.v[1] ? d.v[1].v : undefined;
+ r.src = d && d.v[2] ? decode(d.v[2]) : undefined;
+ return clean(r);
+}
function encok2(d) {
- var tup = atom('ok2');
- var code = 'code' in d && d.code ? atom(d.code) : nil();
- var src = 'src' in d && d.src ? encode(d.src) : nil();
- return tuple(tup,code,src); }
+ const tup = atom('ok2');
+ const code = 'code' in d && d.code ? atom(d.code) : nil();
+ const src = 'src' in d && d.src ? encode(d.src) : nil();
+ return tuple(tup, code, src);
+}
function lenok2() { return 3; }
function decok2(d) {
- var r={}; r.tup = 'ok2';
- r.code = d && d.v[1] ? d.v[1].v : undefined;
- r.src = d && d.v[2] ? decode(d.v[2]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'ok2';
+ r.code = d && d.v[1] ? d.v[1].v : undefined;
+ r.src = d && d.v[2] ? decode(d.v[2]) : undefined;
+ return clean(r);
+}
function encio(d) {
- var tup = atom('io');
- var code = 'code' in d && d.code ? encode(d.code) : nil();
- var data = 'data' in d && d.data ? encode(d.data) : nil();
- return tuple(tup,code,data); }
+ const tup = atom('io');
+ const code = 'code' in d && d.code ? encode(d.code) : nil();
+ const data = 'data' in d && d.data ? encode(d.data) : nil();
+ return tuple(tup, code, data);
+}
function lenio() { return 3; }
function decio(d) {
- var r={}; r.tup = 'io';
- r.code = d && d.v[1] ? decode(d.v[1]) : undefined;
- r.data = d && d.v[2] ? decode(d.v[2]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'io';
+ r.code = d && d.v[1] ? decode(d.v[1]) : undefined;
+ r.data = d && d.v[2] ? decode(d.v[2]) : undefined;
+ return clean(r);
+}
function encmax_tour(d) {
- var tup = atom('max_tour');
- var count = 'count' in d && d.count ? number(d.count) : nil();
- var joined = 'joined' in d && d.joined ? number(d.joined) : nil();
- return tuple(tup,count,joined); }
+ const tup = atom('max_tour');
+ const count = 'count' in d && d.count ? number(d.count) : nil();
+ const joined = 'joined' in d && d.joined ? number(d.joined) : nil();
+ return tuple(tup, count, joined);
+}
function lenmax_tour() { return 3; }
function decmax_tour(d) {
- var r={}; r.tup = 'max_tour';
- r.count = d && d.v[1] ? d.v[1].v : undefined;
- r.joined = d && d.v[2] ? d.v[2].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'max_tour';
+ r.count = d && d.v[1] ? d.v[1].v : undefined;
+ r.joined = d && d.v[2] ? d.v[2].v : undefined;
+ return clean(r);
+}
function encjoin_application(d) {
- var tup = atom('join_application');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var name = 'name' in d && d.name ? bin(d.name) : nil();
- var data = 'data' in d && d.data ? encode(d.data) : nil();
- return tuple(tup,id,name,data); }
+ const tup = atom('join_application');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const name = 'name' in d && d.name ? bin(d.name) : nil();
+ const data = 'data' in d && d.data ? encode(d.data) : nil();
+ return tuple(tup, id, name, data);
+}
function lenjoin_application() { return 4; }
function decjoin_application(d) {
- var r={}; r.tup = 'join_application';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.data = d && d.v[3] ? decode(d.v[3].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'join_application';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.data = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ return clean(r);
+}
function enctour_list(d) {
- var tup = atom('tour_list');
- var users = []; if ('users' in d && d.users)
- { d.users.forEach(function(x){
- users.push(encode(x))});
- users={t:108,v:users}; } else { users = nil() };
- return tuple(tup,users); }
+ const tup = atom('tour_list');
+ let users = []; if ('users' in d && d.users) {
+ d.users.forEach((x) => {
+ users.push(encode(x));
+ });
+ users = { t: 108, v: users };
+ } else { users = nil(); }
+ return tuple(tup, users);
+}
function lentour_list() { return 2; }
function dectour_list(d) {
- var r={}; r.tup = 'tour_list';
- r.users = [];
+ const r = {}; r.tup = 'tour_list';
+ r.users = [];
(d && d.v[1] && d.v[1].v) ?
- d.v[1].v.forEach(function(x){r.users.push(decode(x))}) :
+ d.v[1].v.forEach((x) => { r.users.push(decode(x)); }) :
r.users = undefined;
- return clean(r); }
+ return clean(r);
+}
function enctask(d) {
- var tup = atom('task');
- var name = 'name' in d && d.name ? atom(d.name) : nil();
- var roles = 'roles' in d && d.roles ? bin(d.roles) : nil();
- var module = 'module' in d && d.module ? atom(d.module) : nil();
- return tuple(tup,name,roles,module); }
+ const tup = atom('task');
+ const name = 'name' in d && d.name ? atom(d.name) : nil();
+ const roles = 'roles' in d && d.roles ? bin(d.roles) : nil();
+ const module = 'module' in d && d.module ? atom(d.module) : nil();
+ return tuple(tup, name, roles, module);
+}
function lentask() { return 4; }
function dectask(d) {
- var r={}; r.tup = 'task';
- r.name = d && d.v[1] ? d.v[1].v : undefined;
- r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.module = d && d.v[3] ? d.v[3].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'task';
+ r.name = d && d.v[1] ? d.v[1].v : undefined;
+ r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.module = d && d.v[3] ? d.v[3].v : undefined;
+ return clean(r);
+}
function encuserTask(d) {
- var tup = atom('userTask');
- var name = 'name' in d && d.name ? atom(d.name) : nil();
- var roles = 'roles' in d && d.roles ? bin(d.roles) : nil();
- var module = 'module' in d && d.module ? atom(d.module) : nil();
- return tuple(tup,name,roles,module); }
+ const tup = atom('userTask');
+ const name = 'name' in d && d.name ? atom(d.name) : nil();
+ const roles = 'roles' in d && d.roles ? bin(d.roles) : nil();
+ const module = 'module' in d && d.module ? atom(d.module) : nil();
+ return tuple(tup, name, roles, module);
+}
function lenuserTask() { return 4; }
function decuserTask(d) {
- var r={}; r.tup = 'userTask';
- r.name = d && d.v[1] ? d.v[1].v : undefined;
- r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.module = d && d.v[3] ? d.v[3].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'userTask';
+ r.name = d && d.v[1] ? d.v[1].v : undefined;
+ r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.module = d && d.v[3] ? d.v[3].v : undefined;
+ return clean(r);
+}
function encserviceTask(d) {
- var tup = atom('serviceTask');
- var name = 'name' in d && d.name ? atom(d.name) : nil();
- var roles = 'roles' in d && d.roles ? bin(d.roles) : nil();
- var module = 'module' in d && d.module ? atom(d.module) : nil();
- return tuple(tup,name,roles,module); }
+ const tup = atom('serviceTask');
+ const name = 'name' in d && d.name ? atom(d.name) : nil();
+ const roles = 'roles' in d && d.roles ? bin(d.roles) : nil();
+ const module = 'module' in d && d.module ? atom(d.module) : nil();
+ return tuple(tup, name, roles, module);
+}
function lenserviceTask() { return 4; }
function decserviceTask(d) {
- var r={}; r.tup = 'serviceTask';
- r.name = d && d.v[1] ? d.v[1].v : undefined;
- r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.module = d && d.v[3] ? d.v[3].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'serviceTask';
+ r.name = d && d.v[1] ? d.v[1].v : undefined;
+ r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.module = d && d.v[3] ? d.v[3].v : undefined;
+ return clean(r);
+}
function encreceiveTask(d) {
- var tup = atom('receiveTask');
- var name = 'name' in d && d.name ? atom(d.name) : nil();
- var roles = 'roles' in d && d.roles ? bin(d.roles) : nil();
- var module = 'module' in d && d.module ? atom(d.module) : nil();
- return tuple(tup,name,roles,module); }
+ const tup = atom('receiveTask');
+ const name = 'name' in d && d.name ? atom(d.name) : nil();
+ const roles = 'roles' in d && d.roles ? bin(d.roles) : nil();
+ const module = 'module' in d && d.module ? atom(d.module) : nil();
+ return tuple(tup, name, roles, module);
+}
function lenreceiveTask() { return 4; }
function decreceiveTask(d) {
- var r={}; r.tup = 'receiveTask';
- r.name = d && d.v[1] ? d.v[1].v : undefined;
- r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.module = d && d.v[3] ? d.v[3].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'receiveTask';
+ r.name = d && d.v[1] ? d.v[1].v : undefined;
+ r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.module = d && d.v[3] ? d.v[3].v : undefined;
+ return clean(r);
+}
function encmessageEvent(d) {
- var tup = atom('messageEvent');
- var name = 'name' in d && d.name ? atom(d.name) : nil();
- var payload = 'payload' in d && d.payload ? bin(d.payload) : nil();
- var timeout = 'timeout' in d && d.timeout ? encode(d.timeout) : nil();
- return tuple(tup,name,payload,timeout); }
+ const tup = atom('messageEvent');
+ const name = 'name' in d && d.name ? atom(d.name) : nil();
+ const payload = 'payload' in d && d.payload ? bin(d.payload) : nil();
+ const timeout = 'timeout' in d && d.timeout ? encode(d.timeout) : nil();
+ return tuple(tup, name, payload, timeout);
+}
function lenmessageEvent() { return 4; }
function decmessageEvent(d) {
- var r={}; r.tup = 'messageEvent';
- r.name = d && d.v[1] ? d.v[1].v : undefined;
- r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.timeout = d && d.v[3] ? decode(d.v[3].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'messageEvent';
+ r.name = d && d.v[1] ? d.v[1].v : undefined;
+ r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.timeout = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ return clean(r);
+}
function encboundaryEvent(d) {
- var tup = atom('boundaryEvent');
- var name = 'name' in d && d.name ? atom(d.name) : nil();
- var payload = 'payload' in d && d.payload ? bin(d.payload) : nil();
- var timeout = 'timeout' in d && d.timeout ? encode(d.timeout) : nil();
- var timeDate = 'timeDate' in d && d.timeDate ? bin(d.timeDate) : nil();
- var timeDuration = 'timeDuration' in d && d.timeDuration ? bin(d.timeDuration) : nil();
- var timeCycle = 'timeCycle' in d && d.timeCycle ? bin(d.timeCycle) : nil();
- var module = 'module' in d && d.module ? atom(d.module) : nil();
- return tuple(tup,name,payload,timeout,timeDate,timeDuration,timeCycle,module); }
+ const tup = atom('boundaryEvent');
+ const name = 'name' in d && d.name ? atom(d.name) : nil();
+ const payload = 'payload' in d && d.payload ? bin(d.payload) : nil();
+ const timeout = 'timeout' in d && d.timeout ? encode(d.timeout) : nil();
+ const timeDate = 'timeDate' in d && d.timeDate ? bin(d.timeDate) : nil();
+ const timeDuration = 'timeDuration' in d && d.timeDuration ? bin(d.timeDuration) : nil();
+ const timeCycle = 'timeCycle' in d && d.timeCycle ? bin(d.timeCycle) : nil();
+ const module = 'module' in d && d.module ? atom(d.module) : nil();
+ return tuple(tup, name, payload, timeout, timeDate, timeDuration, timeCycle, module);
+}
function lenboundaryEvent() { return 8; }
function decboundaryEvent(d) {
- var r={}; r.tup = 'boundaryEvent';
- r.name = d && d.v[1] ? d.v[1].v : undefined;
- r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.timeout = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.timeDate = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
- r.timeDuration = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
- r.timeCycle = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
- r.module = d && d.v[7] ? d.v[7].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'boundaryEvent';
+ r.name = d && d.v[1] ? d.v[1].v : undefined;
+ r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.timeout = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.timeDate = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
+ r.timeDuration = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
+ r.timeCycle = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
+ r.module = d && d.v[7] ? d.v[7].v : undefined;
+ return clean(r);
+}
function enctimeoutEvent(d) {
- var tup = atom('timeoutEvent');
- var name = 'name' in d && d.name ? atom(d.name) : nil();
- var payload = 'payload' in d && d.payload ? bin(d.payload) : nil();
- var timeout = 'timeout' in d && d.timeout ? encode(d.timeout) : nil();
- var timeDate = 'timeDate' in d && d.timeDate ? bin(d.timeDate) : nil();
- var timeDuration = 'timeDuration' in d && d.timeDuration ? bin(d.timeDuration) : nil();
- var timeCycle = 'timeCycle' in d && d.timeCycle ? bin(d.timeCycle) : nil();
- var module = 'module' in d && d.module ? atom(d.module) : nil();
- return tuple(tup,name,payload,timeout,timeDate,timeDuration,timeCycle,module); }
+ const tup = atom('timeoutEvent');
+ const name = 'name' in d && d.name ? atom(d.name) : nil();
+ const payload = 'payload' in d && d.payload ? bin(d.payload) : nil();
+ const timeout = 'timeout' in d && d.timeout ? encode(d.timeout) : nil();
+ const timeDate = 'timeDate' in d && d.timeDate ? bin(d.timeDate) : nil();
+ const timeDuration = 'timeDuration' in d && d.timeDuration ? bin(d.timeDuration) : nil();
+ const timeCycle = 'timeCycle' in d && d.timeCycle ? bin(d.timeCycle) : nil();
+ const module = 'module' in d && d.module ? atom(d.module) : nil();
+ return tuple(tup, name, payload, timeout, timeDate, timeDuration, timeCycle, module);
+}
function lentimeoutEvent() { return 8; }
function dectimeoutEvent(d) {
- var r={}; r.tup = 'timeoutEvent';
- r.name = d && d.v[1] ? d.v[1].v : undefined;
- r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.timeout = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.timeDate = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
- r.timeDuration = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
- r.timeCycle = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
- r.module = d && d.v[7] ? d.v[7].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'timeoutEvent';
+ r.name = d && d.v[1] ? d.v[1].v : undefined;
+ r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.timeout = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.timeDate = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
+ r.timeDuration = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
+ r.timeCycle = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
+ r.module = d && d.v[7] ? d.v[7].v : undefined;
+ return clean(r);
+}
function encbeginEvent(d) {
- var tup = atom('beginEvent');
- var name = 'name' in d && d.name ? atom(d.name) : nil();
- var module = 'module' in d && d.module ? atom(d.module) : nil();
- return tuple(tup,name,module); }
+ const tup = atom('beginEvent');
+ const name = 'name' in d && d.name ? atom(d.name) : nil();
+ const module = 'module' in d && d.module ? atom(d.module) : nil();
+ return tuple(tup, name, module);
+}
function lenbeginEvent() { return 3; }
function decbeginEvent(d) {
- var r={}; r.tup = 'beginEvent';
- r.name = d && d.v[1] ? d.v[1].v : undefined;
- r.module = d && d.v[2] ? d.v[2].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'beginEvent';
+ r.name = d && d.v[1] ? d.v[1].v : undefined;
+ r.module = d && d.v[2] ? d.v[2].v : undefined;
+ return clean(r);
+}
function encendEvent(d) {
- var tup = atom('endEvent');
- var name = 'name' in d && d.name ? atom(d.name) : nil();
- var module = 'module' in d && d.module ? atom(d.module) : nil();
- return tuple(tup,name,module); }
+ const tup = atom('endEvent');
+ const name = 'name' in d && d.name ? atom(d.name) : nil();
+ const module = 'module' in d && d.module ? atom(d.module) : nil();
+ return tuple(tup, name, module);
+}
function lenendEvent() { return 3; }
function decendEvent(d) {
- var r={}; r.tup = 'endEvent';
- r.name = d && d.v[1] ? d.v[1].v : undefined;
- r.module = d && d.v[2] ? d.v[2].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'endEvent';
+ r.name = d && d.v[1] ? d.v[1].v : undefined;
+ r.module = d && d.v[2] ? d.v[2].v : undefined;
+ return clean(r);
+}
function encsequenceFlow(d) {
- var tup = atom('sequenceFlow');
- var source = 'source' in d && d.source ? atom(d.source) : nil();
- var target = 'target' in d && d.target ? atom(d.target) : nil();
- return tuple(tup,source,target); }
+ const tup = atom('sequenceFlow');
+ const source = 'source' in d && d.source ? atom(d.source) : nil();
+ const target = 'target' in d && d.target ? atom(d.target) : nil();
+ return tuple(tup, source, target);
+}
function lensequenceFlow() { return 3; }
function decsequenceFlow(d) {
- var r={}; r.tup = 'sequenceFlow';
- r.source = d && d.v[1] ? d.v[1].v : undefined;
- r.target = d && d.v[2] ? d.v[2].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'sequenceFlow';
+ r.source = d && d.v[1] ? d.v[1].v : undefined;
+ r.target = d && d.v[2] ? d.v[2].v : undefined;
+ return clean(r);
+}
function enchist(d) {
- var tup = atom('hist');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var container = 'container' in d && d.container ? atom(d.container) : nil();
- var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var feeds = []; if ('feeds' in d && d.feeds)
- { d.feeds.forEach(function(x){
- feeds.push(encode(x))});
- feeds={t:108,v:feeds}; } else { feeds = nil() };
- var name = 'name' in d && d.name ? bin(d.name) : nil();
- var task = 'task' in d && d.task ? atom(d.task) : nil();
- var time = 'time' in d && d.time ? encode(d.time) : nil();
- return tuple(tup,id,container,feed_id,prev,next,feeds,name,task,time); }
+ const tup = atom('hist');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const container = 'container' in d && d.container ? atom(d.container) : nil();
+ const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ let feeds = []; if ('feeds' in d && d.feeds) {
+ d.feeds.forEach((x) => {
+ feeds.push(encode(x));
+ });
+ feeds = { t: 108, v: feeds };
+ } else { feeds = nil(); }
+ const name = 'name' in d && d.name ? bin(d.name) : nil();
+ const task = 'task' in d && d.task ? atom(d.task) : nil();
+ const time = 'time' in d && d.time ? encode(d.time) : nil();
+ return tuple(tup, id, container, feed_id, prev, next, feeds, name, task, time);
+}
function lenhist() { return 10; }
function dechist(d) {
- var r={}; r.tup = 'hist';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? d.v[2].v : undefined;
- r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.prev = d && d.v[4] ? d.v[4].v : undefined;
- r.next = d && d.v[5] ? d.v[5].v : undefined;
- r.feeds = [];
+ const r = {}; r.tup = 'hist';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? d.v[2].v : undefined;
+ r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.prev = d && d.v[4] ? d.v[4].v : undefined;
+ r.next = d && d.v[5] ? d.v[5].v : undefined;
+ r.feeds = [];
(d && d.v[6] && d.v[6].v) ?
- d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) :
+ d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) :
r.feeds = undefined;
- r.name = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
- r.task = d && d.v[8] ? d.v[8].v : undefined;
- r.time = d && d.v[9] ? decode(d.v[9].v) : undefined;
- return clean(r); }
+ r.name = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
+ r.task = d && d.v[8] ? d.v[8].v : undefined;
+ r.time = d && d.v[9] ? decode(d.v[9].v) : undefined;
+ return clean(r);
+}
function encprocess(d) {
- var tup = atom('process');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var container = 'container' in d && d.container ? atom(d.container) : nil();
- var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var feeds = []; if ('feeds' in d && d.feeds)
- { d.feeds.forEach(function(x){
- feeds.push(encode(x))});
- feeds={t:108,v:feeds}; } else { feeds = nil() };
- var name = 'name' in d && d.name ? bin(d.name) : nil();
- var roles = []; if ('roles' in d && d.roles)
- { d.roles.forEach(function(x){
- roles.push(encode(x))});
- roles={t:108,v:roles}; } else { roles = nil() };
- var tasks = []; if ('tasks' in d && d.tasks)
- { d.tasks.forEach(function(x){
- tasks.push(encode(x))});
- tasks={t:108,v:tasks}; } else { tasks = nil() };
- var events = []; if ('events' in d && d.events)
- { d.events.forEach(function(x){
- events.push(encode(x))});
- events={t:108,v:events}; } else { events = nil() };
- var hist = 'hist' in d && d.hist ? encode(d.hist) : nil();
- var flows = []; if ('flows' in d && d.flows)
- { d.flows.forEach(function(x){
- flows.push(encode(x))});
- flows={t:108,v:flows}; } else { flows = nil() };
- var rules = 'rules' in d && d.rules ? encode(d.rules) : nil();
- var docs = []; if ('docs' in d && d.docs)
- { d.docs.forEach(function(x){
- docs.push(encode(x))});
- docs={t:108,v:docs}; } else { docs = nil() };
- var options = 'options' in d && d.options ? encode(d.options) : nil();
- var task = 'task' in d && d.task ? atom(d.task) : nil();
- var timer = 'timer' in d && d.timer ? bin(d.timer) : nil();
- var notifications = 'notifications' in d && d.notifications ? encode(d.notifications) : nil();
- var result = 'result' in d && d.result ? bin(d.result) : nil();
- var started = 'started' in d && d.started ? bin(d.started) : nil();
- var beginEvent = 'beginEvent' in d && d.beginEvent ? atom(d.beginEvent) : nil();
- var endEvent = 'endEvent' in d && d.endEvent ? atom(d.endEvent) : nil();
- return tuple(tup,id,container,feed_id,prev,next,feeds,name,roles,tasks,events,
- hist,flows,rules,docs,options,task,timer,notifications,result,started,beginEvent,endEvent); }
+ const tup = atom('process');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const container = 'container' in d && d.container ? atom(d.container) : nil();
+ const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ let feeds = []; if ('feeds' in d && d.feeds) {
+ d.feeds.forEach((x) => {
+ feeds.push(encode(x));
+ });
+ feeds = { t: 108, v: feeds };
+ } else { feeds = nil(); }
+ const name = 'name' in d && d.name ? bin(d.name) : nil();
+ let roles = []; if ('roles' in d && d.roles) {
+ d.roles.forEach((x) => {
+ roles.push(encode(x));
+ });
+ roles = { t: 108, v: roles };
+ } else { roles = nil(); }
+ let tasks = []; if ('tasks' in d && d.tasks) {
+ d.tasks.forEach((x) => {
+ tasks.push(encode(x));
+ });
+ tasks = { t: 108, v: tasks };
+ } else { tasks = nil(); }
+ let events = []; if ('events' in d && d.events) {
+ d.events.forEach((x) => {
+ events.push(encode(x));
+ });
+ events = { t: 108, v: events };
+ } else { events = nil(); }
+ const hist = 'hist' in d && d.hist ? encode(d.hist) : nil();
+ let flows = []; if ('flows' in d && d.flows) {
+ d.flows.forEach((x) => {
+ flows.push(encode(x));
+ });
+ flows = { t: 108, v: flows };
+ } else { flows = nil(); }
+ const rules = 'rules' in d && d.rules ? encode(d.rules) : nil();
+ let docs = []; if ('docs' in d && d.docs) {
+ d.docs.forEach((x) => {
+ docs.push(encode(x));
+ });
+ docs = { t: 108, v: docs };
+ } else { docs = nil(); }
+ const options = 'options' in d && d.options ? encode(d.options) : nil();
+ const task = 'task' in d && d.task ? atom(d.task) : nil();
+ const timer = 'timer' in d && d.timer ? bin(d.timer) : nil();
+ const notifications = 'notifications' in d && d.notifications ? encode(d.notifications) : nil();
+ const result = 'result' in d && d.result ? bin(d.result) : nil();
+ const started = 'started' in d && d.started ? bin(d.started) : nil();
+ const beginEvent = 'beginEvent' in d && d.beginEvent ? atom(d.beginEvent) : nil();
+ const endEvent = 'endEvent' in d && d.endEvent ? atom(d.endEvent) : nil();
+ return tuple(
+ tup, id, container, feed_id, prev, next, feeds, name, roles, tasks, events,
+ hist, flows, rules, docs, options, task, timer, notifications, result, started, beginEvent, endEvent
+ );
+}
function lenprocess() { return 23; }
function decprocess(d) {
- var r={}; r.tup = 'process';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? d.v[2].v : undefined;
- r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.prev = d && d.v[4] ? d.v[4].v : undefined;
- r.next = d && d.v[5] ? d.v[5].v : undefined;
- r.feeds = [];
+ const r = {}; r.tup = 'process';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? d.v[2].v : undefined;
+ r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.prev = d && d.v[4] ? d.v[4].v : undefined;
+ r.next = d && d.v[5] ? d.v[5].v : undefined;
+ r.feeds = [];
(d && d.v[6] && d.v[6].v) ?
- d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) :
+ d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) :
r.feeds = undefined;
- r.name = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
- r.roles = [];
+ r.name = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
+ r.roles = [];
(d && d.v[8] && d.v[8].v) ?
- d.v[8].v.forEach(function(x){r.roles.push(decode(x))}) :
+ d.v[8].v.forEach((x) => { r.roles.push(decode(x)); }) :
r.roles = undefined;
- r.tasks = [];
+ r.tasks = [];
(d && d.v[9] && d.v[9].v) ?
- d.v[9].v.forEach(function(x){r.tasks.push(decode(x))}) :
+ d.v[9].v.forEach((x) => { r.tasks.push(decode(x)); }) :
r.tasks = undefined;
- r.events = [];
+ r.events = [];
(d && d.v[10] && d.v[10].v) ?
- d.v[10].v.forEach(function(x){r.events.push(decode(x))}) :
+ d.v[10].v.forEach((x) => { r.events.push(decode(x)); }) :
r.events = undefined;
- r.hist = d && d.v[11] ? decode(d.v[11]) : undefined;
- r.flows = [];
+ r.hist = d && d.v[11] ? decode(d.v[11]) : undefined;
+ r.flows = [];
(d && d.v[12] && d.v[12].v) ?
- d.v[12].v.forEach(function(x){r.flows.push(decode(x))}) :
+ d.v[12].v.forEach((x) => { r.flows.push(decode(x)); }) :
r.flows = undefined;
- r.rules = d && d.v[13] ? decode(d.v[13]) : undefined;
- r.docs = [];
+ r.rules = d && d.v[13] ? decode(d.v[13]) : undefined;
+ r.docs = [];
(d && d.v[14] && d.v[14].v) ?
- d.v[14].v.forEach(function(x){r.docs.push(decode(x))}) :
+ d.v[14].v.forEach((x) => { r.docs.push(decode(x)); }) :
r.docs = undefined;
- r.options = d && d.v[15] ? decode(d.v[15].v) : undefined;
- r.task = d && d.v[16] ? d.v[16].v : undefined;
- r.timer = d && d.v[17] ? utf8_dec(d.v[17].v) : undefined;
- r.notifications = d && d.v[18] ? decode(d.v[18].v) : undefined;
- r.result = d && d.v[19] ? utf8_dec(d.v[19].v) : undefined;
- r.started = d && d.v[20] ? utf8_dec(d.v[20].v) : undefined;
- r.beginEvent = d && d.v[21] ? d.v[21].v : undefined;
- r.endEvent = d && d.v[22] ? d.v[22].v : undefined;
- return clean(r); }
+ r.options = d && d.v[15] ? decode(d.v[15].v) : undefined;
+ r.task = d && d.v[16] ? d.v[16].v : undefined;
+ r.timer = d && d.v[17] ? utf8_dec(d.v[17].v) : undefined;
+ r.notifications = d && d.v[18] ? decode(d.v[18].v) : undefined;
+ r.result = d && d.v[19] ? utf8_dec(d.v[19].v) : undefined;
+ r.started = d && d.v[20] ? utf8_dec(d.v[20].v) : undefined;
+ r.beginEvent = d && d.v[21] ? d.v[21].v : undefined;
+ r.endEvent = d && d.v[22] ? d.v[22].v : undefined;
+ return clean(r);
+}
function enccomplete(d) {
- var tup = atom('complete');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- return tuple(tup,id); }
+ const tup = atom('complete');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ return tuple(tup, id);
+}
function lencomplete() { return 2; }
function deccomplete(d) {
- var r={}; r.tup = 'complete';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'complete';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ return clean(r);
+}
function encproc(d) {
- var tup = atom('proc');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- return tuple(tup,id); }
+ const tup = atom('proc');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ return tuple(tup, id);
+}
function lenproc() { return 2; }
function decproc(d) {
- var r={}; r.tup = 'proc';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'proc';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ return clean(r);
+}
function enchisto(d) {
- var tup = atom('histo');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- return tuple(tup,id); }
+ const tup = atom('histo');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ return tuple(tup, id);
+}
function lenhisto() { return 2; }
function dechisto(d) {
- var r={}; r.tup = 'histo';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'histo';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ return clean(r);
+}
function enccreate(d) {
- var tup = atom('create');
- var proc = 'proc' in d && d.proc ? encode(d.proc) : nil();
- var docs = []; if ('docs' in d && d.docs)
- { d.docs.forEach(function(x){
- docs.push(encode(x))});
- docs={t:108,v:docs}; } else { docs = nil() };
- return tuple(tup,proc,docs); }
+ const tup = atom('create');
+ const proc = 'proc' in d && d.proc ? encode(d.proc) : nil();
+ let docs = []; if ('docs' in d && d.docs) {
+ d.docs.forEach((x) => {
+ docs.push(encode(x));
+ });
+ docs = { t: 108, v: docs };
+ } else { docs = nil(); }
+ return tuple(tup, proc, docs);
+}
function lencreate() { return 3; }
function deccreate(d) {
- var r={}; r.tup = 'create';
- r.proc = d && d.v[1] ? decode(d.v[1]) : undefined;
- r.docs = [];
+ const r = {}; r.tup = 'create';
+ r.proc = d && d.v[1] ? decode(d.v[1]) : undefined;
+ r.docs = [];
(d && d.v[2] && d.v[2].v) ?
- d.v[2].v.forEach(function(x){r.docs.push(decode(x))}) :
+ d.v[2].v.forEach((x) => { r.docs.push(decode(x)); }) :
r.docs = undefined;
- return clean(r); }
+ return clean(r);
+}
function encamend(d) {
- var tup = atom('amend');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var docs = []; if ('docs' in d && d.docs)
- { d.docs.forEach(function(x){
- docs.push(encode(x))});
- docs={t:108,v:docs}; } else { docs = nil() };
- return tuple(tup,id,docs); }
+ const tup = atom('amend');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ let docs = []; if ('docs' in d && d.docs) {
+ d.docs.forEach((x) => {
+ docs.push(encode(x));
+ });
+ docs = { t: 108, v: docs };
+ } else { docs = nil(); }
+ return tuple(tup, id, docs);
+}
function lenamend() { return 3; }
function decamend(d) {
- var r={}; r.tup = 'amend';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.docs = [];
+ const r = {}; r.tup = 'amend';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.docs = [];
(d && d.v[2] && d.v[2].v) ?
- d.v[2].v.forEach(function(x){r.docs.push(decode(x))}) :
+ d.v[2].v.forEach((x) => { r.docs.push(decode(x)); }) :
r.docs = undefined;
- return clean(r); }
+ return clean(r);
+}
function encJob(d) {
- var tup = atom('Job');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var proc = 'proc' in d && d.proc ? encode(d.proc) : nil();
- var docs = []; if ('docs' in d && d.docs)
- { d.docs.forEach(function(x){
- docs.push(encode(x))});
- docs={t:108,v:docs}; } else { docs = nil() };
- var time = 'time' in d && d.time ? number(d.time) : nil();
- var events = []; if ('events' in d && d.events)
- { d.events.forEach(function(x){
- events.push(encode(x))});
- events={t:108,v:events}; } else { events = nil() };
- var status = 'status' in d && d.status ? encode(d.status) : nil();
- return tuple(tup,id,proc,docs,time,events,status); }
+ const tup = atom('Job');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const proc = 'proc' in d && d.proc ? encode(d.proc) : nil();
+ let docs = []; if ('docs' in d && d.docs) {
+ d.docs.forEach((x) => {
+ docs.push(encode(x));
+ });
+ docs = { t: 108, v: docs };
+ } else { docs = nil(); }
+ const time = 'time' in d && d.time ? number(d.time) : nil();
+ let events = []; if ('events' in d && d.events) {
+ d.events.forEach((x) => {
+ events.push(encode(x));
+ });
+ events = { t: 108, v: events };
+ } else { events = nil(); }
+ const status = 'status' in d && d.status ? encode(d.status) : nil();
+ return tuple(tup, id, proc, docs, time, events, status);
+}
function lenJob() { return 7; }
function decJob(d) {
- var r={}; r.tup = 'Job';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.proc = d && d.v[2] ? decode(d.v[2]) : undefined;
- r.docs = [];
+ const r = {}; r.tup = 'Job';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.proc = d && d.v[2] ? decode(d.v[2]) : undefined;
+ r.docs = [];
(d && d.v[3] && d.v[3].v) ?
- d.v[3].v.forEach(function(x){r.docs.push(decode(x))}) :
+ d.v[3].v.forEach((x) => { r.docs.push(decode(x)); }) :
r.docs = undefined;
- r.time = d && d.v[4] ? d.v[4].v : undefined;
- r.events = [];
+ r.time = d && d.v[4] ? d.v[4].v : undefined;
+ r.events = [];
(d && d.v[5] && d.v[5].v) ?
- d.v[5].v.forEach(function(x){r.events.push(decode(x))}) :
+ d.v[5].v.forEach((x) => { r.events.push(decode(x)); }) :
r.events = undefined;
- r.status = d && d.v[6] ? decode(d.v[6]) : undefined;
- return clean(r); }
+ r.status = d && d.v[6] ? decode(d.v[6]) : undefined;
+ return clean(r);
+}
function encTest(d) {
- var tup = atom('Test');
- var type = 'type' in d && d.type ? atom(d.type) : nil();
- var count = 'count' in d && d.count ? number(d.count) : nil();
- return tuple(tup,type,count); }
+ const tup = atom('Test');
+ const type = 'type' in d && d.type ? atom(d.type) : nil();
+ const count = 'count' in d && d.count ? number(d.count) : nil();
+ return tuple(tup, type, count);
+}
function lenTest() { return 3; }
function decTest(d) {
- var r={}; r.tup = 'Test';
- r.type = d && d.v[1] ? decode(d.v[1]) : undefined;
- r.count = d && d.v[2] ? d.v[2].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Test';
+ r.type = d && d.v[1] ? decode(d.v[1]) : undefined;
+ r.count = d && d.v[2] ? d.v[2].v : undefined;
+ return clean(r);
+}
diff --git a/src/assets/vendor/utils/recorder.js b/src/assets/vendor/utils/recorder.js
index 0fcb6b3cab6fec39a990eeab05a522bbb0bbd1eb..89caafa71bb2001dd37ceb81071e37ace2a169d1 100644
--- a/src/assets/vendor/utils/recorder.js
+++ b/src/assets/vendor/utils/recorder.js
@@ -1,273 +1,273 @@
-(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Recorder = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o
{
+ let define,
+ module,
+ exports; return (function e(t, n, r) { function s(o, u) { if (!n[o]) { if (!t[o]) { const a = typeof require === 'function' && require; if (!u && a) return a(o, !0); if (i) return i(o, !0); const f = new Error(`Cannot find module '${o}'`); throw f.code = 'MODULE_NOT_FOUND', f; } const l = n[o] = { exports: {} }; t[o][0].call(l.exports, (e) => { const n = t[o][1][e]; return s(n || e); }, l, l.exports, e, t, n, r); } return n[o].exports; } var i = typeof require === 'function' && require; for (let o = 0; o < r.length; o++)s(r[o]); return s; }({
+ 1: [function (require, module, exports) {
+ module.exports = require('./recorder').Recorder;
+ }, { './recorder': 2 }],
+ 2: [function (require, module, exports) {
+ const _createClass = (function () {
+ function defineProperties(target, props) {
+ for (let i = 0; i < props.length; i++) {
+ const descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor);
+ }
+ } return function (Constructor, protoProps, staticProps) {
+ if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor;
+ };
+ }());
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.Recorder = undefined;
+ Object.defineProperty(exports, '__esModule', {
+ value: true
+ });
+ exports.Recorder = undefined;
-var _inlineWorker = require('inline-worker');
+ const _inlineWorker = require('inline-worker');
-var _inlineWorker2 = _interopRequireDefault(_inlineWorker);
+ const _inlineWorker2 = _interopRequireDefault(_inlineWorker);
-function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
-}
+ function _interopRequireDefault(obj) {
+ return obj && obj.__esModule ? obj : { default: obj };
+ }
-function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
-}
+ function _classCallCheck(instance, Constructor) {
+ if (!(instance instanceof Constructor)) {
+ throw new TypeError('Cannot call a class as a function');
+ }
+ }
-var Recorder = exports.Recorder = (function () {
- function Recorder(source, cfg) {
- var _this = this;
+ const Recorder = exports.Recorder = (function () {
+ function Recorder(source, cfg) {
+ const _this = this;
- _classCallCheck(this, Recorder);
+ _classCallCheck(this, Recorder);
- this.config = {
+ this.config = {
bufferLen: 4096,
numChannels: 2,
mimeType: 'audio/wav'
- };
- this.recording = false;
- this.callbacks = {
+ };
+ this.recording = false;
+ this.callbacks = {
getBuffer: [],
exportWAV: []
- };
+ };
- Object.assign(this.config, cfg);
- this.context = source.context;
- this.node = (this.context.createScriptProcessor || this.context.createJavaScriptNode).call(this.context, this.config.bufferLen, this.config.numChannels, this.config.numChannels);
+ Object.assign(this.config, cfg);
+ this.context = source.context;
+ this.node = (this.context.createScriptProcessor || this.context.createJavaScriptNode).call(this.context, this.config.bufferLen, this.config.numChannels, this.config.numChannels);
- this.node.onaudioprocess = function (e) {
+ this.node.onaudioprocess = function (e) {
if (!_this.recording) return;
- var buffer = [];
- for (var channel = 0; channel < _this.config.numChannels; channel++) {
- buffer.push(e.inputBuffer.getChannelData(channel));
+ const buffer = [];
+ for (let channel = 0; channel < _this.config.numChannels; channel++) {
+ buffer.push(e.inputBuffer.getChannelData(channel));
}
_this.worker.postMessage({
- command: 'record',
- buffer: buffer
+ command: 'record',
+ buffer
});
- };
+ };
- source.connect(this.node);
- this.node.connect(this.context.destination); //this should not be necessary
+ source.connect(this.node);
+ this.node.connect(this.context.destination); // this should not be necessary
- var self = {};
- this.worker = new _inlineWorker2.default(function () {
- var recLength = 0,
- recBuffers = [],
- sampleRate = undefined,
- numChannels = undefined;
+ const self = {};
+ this.worker = new _inlineWorker2.default((() => {
+ let recLength = 0,
+ recBuffers = [],
+ sampleRate,
+ numChannels;
self.onmessage = function (e) {
- switch (e.data.command) {
- case 'init':
- init(e.data.config);
- break;
- case 'record':
- record(e.data.buffer);
- break;
- case 'exportWAV':
- exportWAV(e.data.type);
- break;
- case 'getBuffer':
- getBuffer();
- break;
- case 'clear':
- clear();
- break;
- }
+ switch (e.data.command) {
+ case 'init':
+ init(e.data.config);
+ break;
+ case 'record':
+ record(e.data.buffer);
+ break;
+ case 'exportWAV':
+ exportWAV(e.data.type);
+ break;
+ case 'getBuffer':
+ getBuffer();
+ break;
+ case 'clear':
+ clear();
+ break;
+ }
};
function init(config) {
- sampleRate = config.sampleRate;
- numChannels = config.numChannels;
- initBuffers();
+ sampleRate = config.sampleRate;
+ numChannels = config.numChannels;
+ initBuffers();
}
function record(inputBuffer) {
- for (var channel = 0; channel < numChannels; channel++) {
- recBuffers[channel].push(inputBuffer[channel]);
- }
- recLength += inputBuffer[0].length;
+ for (let channel = 0; channel < numChannels; channel++) {
+ recBuffers[channel].push(inputBuffer[channel]);
+ }
+ recLength += inputBuffer[0].length;
}
function exportWAV(type) {
- var buffers = [];
- for (var channel = 0; channel < numChannels; channel++) {
- buffers.push(mergeBuffers(recBuffers[channel], recLength));
- }
- var interleaved = undefined;
- if (numChannels === 2) {
- interleaved = interleave(buffers[0], buffers[1]);
- } else {
- interleaved = buffers[0];
- }
- var dataview = encodeWAV(interleaved);
- var audioBlob = new Blob([dataview], { type: type });
-
- self.postMessage({ command: 'exportWAV', data: audioBlob });
+ const buffers = [];
+ for (let channel = 0; channel < numChannels; channel++) {
+ buffers.push(mergeBuffers(recBuffers[channel], recLength));
+ }
+ let interleaved;
+ if (numChannels === 2) {
+ interleaved = interleave(buffers[0], buffers[1]);
+ } else {
+ interleaved = buffers[0];
+ }
+ const dataview = encodeWAV(interleaved);
+ const audioBlob = new Blob([dataview], { type });
+
+ self.postMessage({ command: 'exportWAV', data: audioBlob });
}
function getBuffer() {
- var buffers = [];
- for (var channel = 0; channel < numChannels; channel++) {
- buffers.push(mergeBuffers(recBuffers[channel], recLength));
- }
- self.postMessage({ command: 'getBuffer', data: buffers });
+ const buffers = [];
+ for (let channel = 0; channel < numChannels; channel++) {
+ buffers.push(mergeBuffers(recBuffers[channel], recLength));
+ }
+ self.postMessage({ command: 'getBuffer', data: buffers });
}
function clear() {
- recLength = 0;
- recBuffers = [];
- initBuffers();
+ recLength = 0;
+ recBuffers = [];
+ initBuffers();
}
function initBuffers() {
- for (var channel = 0; channel < numChannels; channel++) {
- recBuffers[channel] = [];
- }
+ for (let channel = 0; channel < numChannels; channel++) {
+ recBuffers[channel] = [];
+ }
}
function mergeBuffers(recBuffers, recLength) {
- var result = new Float32Array(recLength);
- var offset = 0;
- for (var i = 0; i < recBuffers.length; i++) {
- result.set(recBuffers[i], offset);
- offset += recBuffers[i].length;
- }
- return result;
+ const result = new Float32Array(recLength);
+ let offset = 0;
+ for (let i = 0; i < recBuffers.length; i++) {
+ result.set(recBuffers[i], offset);
+ offset += recBuffers[i].length;
+ }
+ return result;
}
function interleave(inputL, inputR) {
- var length = inputL.length + inputR.length;
- var result = new Float32Array(length);
-
- var index = 0,
- inputIndex = 0;
-
- while (index < length) {
- result[index++] = inputL[inputIndex];
- result[index++] = inputR[inputIndex];
- inputIndex++;
- }
- return result;
+ const length = inputL.length + inputR.length;
+ const result = new Float32Array(length);
+
+ let index = 0,
+ inputIndex = 0;
+
+ while (index < length) {
+ result[index++] = inputL[inputIndex];
+ result[index++] = inputR[inputIndex];
+ inputIndex++;
+ }
+ return result;
}
function floatTo16BitPCM(output, offset, input) {
- for (var i = 0; i < input.length; i++, offset += 2) {
- var s = Math.max(-1, Math.min(1, input[i]));
- output.setInt16(offset, s < 0 ? s * 0x8000 : s * 0x7FFF, true);
- }
+ for (let i = 0; i < input.length; i++, offset += 2) {
+ const s = Math.max(-1, Math.min(1, input[i]));
+ output.setInt16(offset, s < 0 ? s * 0x8000 : s * 0x7FFF, true);
+ }
}
function writeString(view, offset, string) {
- for (var i = 0; i < string.length; i++) {
- view.setUint8(offset + i, string.charCodeAt(i));
- }
+ for (let i = 0; i < string.length; i++) {
+ view.setUint8(offset + i, string.charCodeAt(i));
+ }
}
function encodeWAV(samples) {
- var buffer = new ArrayBuffer(44 + samples.length * 2);
- var view = new DataView(buffer);
-
- /* RIFF identifier */
- writeString(view, 0, 'RIFF');
- /* RIFF chunk length */
- view.setUint32(4, 36 + samples.length * 2, true);
- /* RIFF type */
- writeString(view, 8, 'WAVE');
- /* format chunk identifier */
- writeString(view, 12, 'fmt ');
- /* format chunk length */
- view.setUint32(16, 16, true);
- /* sample format (raw) */
- view.setUint16(20, 1, true);
- /* channel count */
- view.setUint16(22, numChannels, true);
- /* sample rate */
- view.setUint32(24, sampleRate, true);
- /* byte rate (sample rate * block align) */
- view.setUint32(28, sampleRate * 4, true);
- /* block align (channel count * bytes per sample) */
- view.setUint16(32, numChannels * 2, true);
- /* bits per sample */
- view.setUint16(34, 16, true);
- /* data chunk identifier */
- writeString(view, 36, 'data');
- /* data chunk length */
- view.setUint32(40, samples.length * 2, true);
-
- floatTo16BitPCM(view, 44, samples);
-
- return view;
+ const buffer = new ArrayBuffer(44 + samples.length * 2);
+ const view = new DataView(buffer);
+
+ /* RIFF identifier */
+ writeString(view, 0, 'RIFF');
+ /* RIFF chunk length */
+ view.setUint32(4, 36 + samples.length * 2, true);
+ /* RIFF type */
+ writeString(view, 8, 'WAVE');
+ /* format chunk identifier */
+ writeString(view, 12, 'fmt ');
+ /* format chunk length */
+ view.setUint32(16, 16, true);
+ /* sample format (raw) */
+ view.setUint16(20, 1, true);
+ /* channel count */
+ view.setUint16(22, numChannels, true);
+ /* sample rate */
+ view.setUint32(24, sampleRate, true);
+ /* byte rate (sample rate * block align) */
+ view.setUint32(28, sampleRate * 4, true);
+ /* block align (channel count * bytes per sample) */
+ view.setUint16(32, numChannels * 2, true);
+ /* bits per sample */
+ view.setUint16(34, 16, true);
+ /* data chunk identifier */
+ writeString(view, 36, 'data');
+ /* data chunk length */
+ view.setUint32(40, samples.length * 2, true);
+
+ floatTo16BitPCM(view, 44, samples);
+
+ return view;
}
- }, self);
+ }), self);
- this.worker.postMessage({
+ this.worker.postMessage({
command: 'init',
config: {
- sampleRate: this.context.sampleRate,
- numChannels: this.config.numChannels
+ sampleRate: this.context.sampleRate,
+ numChannels: this.config.numChannels
}
- });
+ });
- this.worker.onmessage = function (e) {
- var cb = _this.callbacks[e.data.command].pop();
- if (typeof cb == 'function') {
- cb(e.data.data);
+ this.worker.onmessage = function (e) {
+ const cb = _this.callbacks[e.data.command].pop();
+ if (typeof cb === 'function') {
+ cb(e.data.data);
}
- };
- }
+ };
+ }
- _createClass(Recorder, [{
- key: 'record',
- value: function record() {
+ _createClass(Recorder, [{
+ key: 'record',
+ value: function record() {
this.recording = true;
- }
- }, {
- key: 'stop',
- value: function stop() {
+ }
+ }, {
+ key: 'stop',
+ value: function stop() {
this.recording = false;
- }
- }, {
- key: 'clear',
- value: function clear() {
+ }
+ }, {
+ key: 'clear',
+ value: function clear() {
this.worker.postMessage({ command: 'clear' });
- }
- }, {
- key: 'getBuffer',
- value: function getBuffer(cb) {
+ }
+ }, {
+ key: 'getBuffer',
+ value: function getBuffer(cb) {
cb = cb || this.config.callback;
if (!cb) throw new Error('Callback not set');
this.callbacks.getBuffer.push(cb);
this.worker.postMessage({ command: 'getBuffer' });
- }
- }, {
- key: 'exportWAV',
- value: function exportWAV(cb, mimeType) {
+ }
+ }, {
+ key: 'exportWAV',
+ value: function exportWAV(cb, mimeType) {
mimeType = mimeType || this.config.mimeType;
cb = cb || this.config.callback;
if (!cb) throw new Error('Callback not set');
@@ -275,83 +275,81 @@ var Recorder = exports.Recorder = (function () {
this.callbacks.exportWAV.push(cb);
this.worker.postMessage({
- command: 'exportWAV',
- type: mimeType
+ command: 'exportWAV',
+ type: mimeType
});
- }
- }], [{
- key: 'forceDownload',
- value: function forceDownload(blob, filename) {
- var url = (window.URL || window.webkitURL).createObjectURL(blob);
- var link = window.document.createElement('a');
+ }
+ }], [{
+ key: 'forceDownload',
+ value: function forceDownload(blob, filename) {
+ const url = (window.URL || window.webkitURL).createObjectURL(blob);
+ const link = window.document.createElement('a');
link.href = url;
link.download = filename || 'output.wav';
- var click = document.createEvent("Event");
- click.initEvent("click", true, true);
+ const click = document.createEvent('Event');
+ click.initEvent('click', true, true);
link.dispatchEvent(click);
- }
- }]);
-
- return Recorder;
-})();
+ }
+ }]);
-exports.default = Recorder;
+ return Recorder;
+ }());
-},{"inline-worker":3}],3:[function(require,module,exports){
-"use strict";
+ exports.default = Recorder;
+ }, { 'inline-worker': 3 }],
+ 3: [function (require, module, exports) {
+ module.exports = require('./inline-worker');
+ }, { './inline-worker': 4 }],
+ 4: [function (require, module, exports) {
+ (function (global) {
+ const _createClass = (function () { function defineProperties(target, props) { for (const key in props) { const prop = props[key]; prop.configurable = true; if (prop.value) prop.writable = true; } Object.defineProperties(target, props); } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }());
-module.exports = require("./inline-worker");
-},{"./inline-worker":4}],4:[function(require,module,exports){
-(function (global){
-"use strict";
+ const _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };
-var _createClass = (function () { function defineProperties(target, props) { for (var key in props) { var prop = props[key]; prop.configurable = true; if (prop.value) prop.writable = true; } Object.defineProperties(target, props); } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
+ const WORKER_ENABLED = !!(global === global.window && global.URL && global.Blob && global.Worker);
-var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
+ const InlineWorker = (function () {
+ function InlineWorker(func, self) {
+ const _this = this;
-var WORKER_ENABLED = !!(global === global.window && global.URL && global.Blob && global.Worker);
+ _classCallCheck(this, InlineWorker);
-var InlineWorker = (function () {
- function InlineWorker(func, self) {
- var _this = this;
+ if (WORKER_ENABLED) {
+ const functionBody = func.toString().trim().match(/^function\s*\w*\s*\([\w\s,]*\)\s*{([\w\W]*?)}$/)[1];
+ const url = global.URL.createObjectURL(new global.Blob([functionBody], { type: 'text/javascript' }));
- _classCallCheck(this, InlineWorker);
-
- if (WORKER_ENABLED) {
- var functionBody = func.toString().trim().match(/^function\s*\w*\s*\([\w\s,]*\)\s*{([\w\W]*?)}$/)[1];
- var url = global.URL.createObjectURL(new global.Blob([functionBody], { type: "text/javascript" }));
-
- return new global.Worker(url);
- }
+ return new global.Worker(url);
+ }
- this.self = self;
- this.self.postMessage = function (data) {
- setTimeout(function () {
- _this.onmessage({ data: data });
- }, 0);
- };
+ this.self = self;
+ this.self.postMessage = function (data) {
+ setTimeout(() => {
+ _this.onmessage({ data });
+ }, 0);
+ };
- setTimeout(function () {
- func.call(self);
- }, 0);
- }
+ setTimeout(() => {
+ func.call(self);
+ }, 0);
+ }
- _createClass(InlineWorker, {
- postMessage: {
- value: function postMessage(data) {
- var _this = this;
+ _createClass(InlineWorker, {
+ postMessage: {
+ value: function postMessage(data) {
+ const _this = this;
- setTimeout(function () {
- _this.self.onmessage({ data: data });
- }, 0);
- }
- }
- });
+ setTimeout(() => {
+ _this.self.onmessage({ data });
+ }, 0);
+ }
+ }
+ });
- return InlineWorker;
-})();
+ return InlineWorker;
+ }());
-module.exports = InlineWorker;
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{}]},{},[1])(1)
-});
\ No newline at end of file
+ module.exports = InlineWorker;
+ }).call(this, typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : {});
+ }, {}]
+ }, {}, [1]))(1);
+}));
diff --git a/src/assets/vendor/utils/signin.js b/src/assets/vendor/utils/signin.js
index 44f6ad0df92c4023207e02c08bb408a6a15a22ec..64d65a17c33d7dad7a9c76b94b5c2324105f92af 100644
--- a/src/assets/vendor/utils/signin.js
+++ b/src/assets/vendor/utils/signin.js
@@ -1,216 +1,230 @@
-var SignInWidget;
+let SignInWidget;
(function () {
- var el, t, verifyAttempt = 0;
- SignInWidget = {
- settings: {
- geoIpService: "//freegeoip.net/json/",
- minNumberDigits: 10,
- minCodeDigits: 6,
- voiceLinkAfter: 3
+ let el,
+ t,
+ verifyAttempt = 0;
+ SignInWidget = {
+ settings: {
+ geoIpService: '//freegeoip.net/json/',
+ minNumberDigits: 10,
+ minCodeDigits: 6,
+ voiceLinkAfter: 3
+ },
+ elements: {
+ countryData: [],
+ addressDropdown: '#country',
+ codeInput: '#code',
+ codeInput2: '#code2',
+ telRealInput: '#number',
+ telRealInput2: '#number2',
+ telInput: '#full-number',
+ verify: '#verify',
+ timerBlock: '#timer',
+ resendSms: '#resendSms',
+ voiceCall: '#voiceCall',
+ sendCodeBtn: '#sendCode',
+ sendVerifyBtn: '#verifyCode',
+ step: '#step',
+ stepClass: '.step'
+ },
+ init() {
+ t = this;
+ el = this.elements;
+
+ this.subscribe();
+ this.initCountry();
+ this.initCodePhone();
+ this.bindUIActions();
+ this.initElementMasks();
+ },
+ subscribe() {
+ GlobalWidget.subscribe('io.ok.sms_sent', this, this.smsSent);
+ GlobalWidget.subscribe('profile.init', GlobalWidget, GlobalWidget.setRosterId);
+ GlobalWidget.subscribe('roster.patch', this, this.toDashboard);
+ GlobalWidget.subscribe('io.ok2.login', this, this.login);
+ },
+ initCodePhone() {
+ $(el.telInput).intlTelInput({
+ allowDropdown: false,
+ initialCountry: 'auto',
+ geoIpLookup() {
+ $.get(t.settings.geoIpService, () => {
+ }, 'jsonp').always((resp) => {
+ const countryCode = (resp && resp.country_code) ? resp.country_code : '';
+ $(el.telInput).intlTelInput('setCountry', countryCode.toLowerCase());
+ });
},
- elements: {
- countryData: [],
- addressDropdown: '#country',
- codeInput: '#code',
- codeInput2: '#code2',
- telRealInput: '#number',
- telRealInput2: '#number2',
- telInput: '#full-number',
- verify: '#verify',
- timerBlock: '#timer',
- resendSms: '#resendSms',
- voiceCall: '#voiceCall',
- sendCodeBtn: '#sendCode',
- sendVerifyBtn: '#verifyCode',
- step: '#step',
- stepClass: ".step"
- },
- init: function () {
- t = this;
- el = this.elements;
-
- this.subscribe();
- this.initCountry();
- this.initCodePhone();
- this.bindUIActions();
- this.initElementMasks();
- },
- subscribe: function () {
- GlobalWidget.subscribe('io.ok.sms_sent', this, this.smsSent);
- GlobalWidget.subscribe('profile.init', GlobalWidget, GlobalWidget.setRosterId);
- GlobalWidget.subscribe('roster.patch', this, this.toDashboard);
- GlobalWidget.subscribe('io.ok2.login', this, this.login);
- },
- initCodePhone: function () {
- $(el.telInput).intlTelInput({
- allowDropdown: false,
- initialCountry: "auto",
- geoIpLookup: function () {
- $.get(t.settings.geoIpService, function () {
- }, "jsonp").always(function (resp) {
- var countryCode = (resp && resp.country_code) ? resp.country_code : "";
- $(el.telInput).intlTelInput("setCountry", countryCode.toLowerCase());
- });
- },
- utilsScript: "../../build/js/utils.js"
- });
- },
- initCountry: function () {
- el.countryData = $.fn.intlTelInput.getCountryData();
- $.each(el.countryData, function (i, country) {
- $(el.addressDropdown).append($("").attr("value", country.iso2).text(country.name));
- });
-
- $(el.addressDropdown).val($(el.telInput).intlTelInput("getSelectedCountryData").iso2);
- },
- initElementMasks: function () {
- $(el.codeInput).mask('+0000', {placeholder: "+----"});
- $(el.telRealInput).mask('00 0000 0000', {placeholder: "-- ---- ----"});
- $(el.verify).mask('000 000', {placeholder: "--- ---"});
- },
- bindUIActions: function () {
- $(el.telInput).on("countrychange", function (e, countryData) {
- $(el.addressDropdown).val(countryData.iso2);
- $(el.codeInput).val('+' + countryData.dialCode);
- $(el.telRealInput).focus();
- });
- $(el.addressDropdown).on('change', function () {
- $(el.telInput).intlTelInput("setCountry", $(this).val());
- });
- $(el.telRealInput).on('keyup', function () {
- if ($(this).val().length > t.settings.minNumberDigits) {
- $(el.sendCodeBtn).removeClass('disabled').prop('disabled', false);
- } else {
- $(el.sendCodeBtn).addClass('disabled').prop('disabled', true);
- }
- }).on('keypress', function (e) {
- if (e.which == 13) {
- $(el.sendCodeBtn).click();
- }
- });
- $(el.verify).on('keyup', function () {
- if ($(this).val().length > t.settings.minCodeDigits) {
- $(el.sendVerifyBtn).removeClass('disabled').prop('disabled', false);
- } else {
- $(el.sendVerifyBtn).addClass('disabled').prop('disabled', true);
- }
- }).on('keypress', function (e) {
- if (e.which == 13) {
- $(el.sendVerifyBtn).click();
- }
- }).on('focus', function () {
- if (!$(el.timerBlock).hasClass('started')) {
- if (verifyAttempt <= t.settings.voiceLinkAfter) {
- $(el.timerBlock).addClass('started').timer([el.resendSms]);
- verifyAttempt++;
- } else {
- $(el.timerBlock).addClass('started').timer([el.voiceCall]);
- }
- }
- });
-
- $(el.sendCodeBtn).on('click', function () {
- var code = $(el.codeInput).val().replace("+", ""),
- phone = $(el.telRealInput).val().split(" ").join("");
-
- if (!$(this).hasClass('disabled') && code && phone) {
- GlobalWidget.setPhoneCode("+" + code);
- GlobalWidget.setPhone(phone);
- $(el.codeInput2).val(GlobalWidget.getPhoneCode());
- $(el.telRealInput2).val(GlobalWidget.getPhone());
-
- //1 - send sms
- var msg = enc(encAuth({
- "type": "reg", "token": token(), "phone": GlobalWidget.getPhoneNumber(),
- "client_id": client("reg_"), "dev_key": devKey()
- }));
- ws.send(msg);
- }
- });
- $(el.sendVerifyBtn).on('click', function () {
- //2a - verify
- var phone = GlobalWidget.getPhoneNumber(),
- verifyCode = $(el.verify).val().split(" ").join(""),
- msg = enc(encAuth({
- "type": "verify", "phone": phone, "token": token(),
- "dev_key": devKey(), "sms_code": verifyCode
- }));
- ws.send(msg);
- });
- $(el.resendSms).on('click', function (e) {
- e.preventDefault();
-
- $(el.timerMsg).removeClass('hidden');
- $(el.resendSms).addClass('hidden');
- $(el.timerBlock).removeClass('started');
- $(el.verify).val('').focus();
-
- //2b - resend code
- var msg = enc(encAuth({
- "type": "resend", "token": token(), "phone": GlobalWidget.getPhoneNumber(),
- "client_id": client("reg_"), "dev_key": devKey()
- }));
- ws.send(msg);
- });
- $(el.voiceCall).on('click', function (e) {
- e.preventDefault();
-
- $(el.timerMsg).removeClass('hidden');
- $(el.resendSms).addClass('hidden');
- $(el.timerBlock).removeClass('started');
- $(el.verify).val('').focus();
-
- //2c - get code via voice call
- var msg = enc(encAuth({
- "type": "voice", "token": token(), "phone": GlobalWidget.getPhoneNumber(),
- "client_id": client("reg_"), "dev_key": devKey(), "services": ["ua"]
- }));
- ws.send(msg);
- });
-
- },
- nextStep: function (nextStep) {
- var curStep = Number(nextStep) - 1;
- localStorage.setItem('currentStep', nextStep);
-
- $(el.step + curStep).addClass("disabled completed").removeClass("active");
- $(el.step + nextStep).addClass("active").removeClass("disabled");
-
- if (nextStep == 2) {
- $(el.verify).focus();
- }
- },
- smsSent: function () {
- $(el.codeInput2).val(GlobalWidget.getPhoneCode());
- $(el.telRealInput2).val(GlobalWidget.getPhone());
- t.nextStep(2);
- },
- login: function (res) {
- if (res.code.src) {
- console.log(res.code.src);
- localStorage.setItem("client", res.code.src[0]);
- localStorage.setItem("token", res.code.src[1]);
- localStorage.removeItem('currentStep');
-
- //3a. close "reg" connection
- mqtt_close();
-
- setTimeout(function () {
- //3b. connect with gotten token
- mqttOptions.password = token();
- mqttOptions.cleanSession = false;
- delete mqttOptions.mqttVersion;
- delete mqttOptions.mqttVersionExplicit;
-
- mqtt_open(mqttOptions);
- }, 200);
- }
- },
- toDashboard: function (res) {
- localStorage.removeItem('currentStep');
- location.replace("/web/dashboard.htm");
+ utilsScript: '../../build/js/utils.js'
+ });
+ },
+ initCountry() {
+ el.countryData = $.fn.intlTelInput.getCountryData();
+ $.each(el.countryData, (i, country) => {
+ $(el.addressDropdown).append($('').attr('value', country.iso2).text(country.name));
+ });
+
+ $(el.addressDropdown).val($(el.telInput).intlTelInput('getSelectedCountryData').iso2);
+ },
+ initElementMasks() {
+ $(el.codeInput).mask('+0000', { placeholder: '+----' });
+ $(el.telRealInput).mask('00 0000 0000', { placeholder: '-- ---- ----' });
+ $(el.verify).mask('000 000', { placeholder: '--- ---' });
+ },
+ bindUIActions() {
+ $(el.telInput).on('countrychange', (e, countryData) => {
+ $(el.addressDropdown).val(countryData.iso2);
+ $(el.codeInput).val(`+${countryData.dialCode}`);
+ $(el.telRealInput).focus();
+ });
+ $(el.addressDropdown).on('change', function () {
+ $(el.telInput).intlTelInput('setCountry', $(this).val());
+ });
+ $(el.telRealInput).on('keyup', function () {
+ if ($(this).val().length > t.settings.minNumberDigits) {
+ $(el.sendCodeBtn).removeClass('disabled').prop('disabled', false);
+ } else {
+ $(el.sendCodeBtn).addClass('disabled').prop('disabled', true);
+ }
+ }).on('keypress', (e) => {
+ if (e.which == 13) {
+ $(el.sendCodeBtn).click();
+ }
+ });
+ $(el.verify).on('keyup', function () {
+ if ($(this).val().length > t.settings.minCodeDigits) {
+ $(el.sendVerifyBtn).removeClass('disabled').prop('disabled', false);
+ } else {
+ $(el.sendVerifyBtn).addClass('disabled').prop('disabled', true);
+ }
+ }).on('keypress', (e) => {
+ if (e.which == 13) {
+ $(el.sendVerifyBtn).click();
+ }
+ }).on('focus', () => {
+ if (!$(el.timerBlock).hasClass('started')) {
+ if (verifyAttempt <= t.settings.voiceLinkAfter) {
+ $(el.timerBlock).addClass('started').timer([el.resendSms]);
+ verifyAttempt++;
+ } else {
+ $(el.timerBlock).addClass('started').timer([el.voiceCall]);
+ }
+ }
+ });
+
+ $(el.sendCodeBtn).on('click', function () {
+ let code = $(el.codeInput).val().replace('+', ''),
+ phone = $(el.telRealInput).val().split(' ').join('');
+
+ if (!$(this).hasClass('disabled') && code && phone) {
+ GlobalWidget.setPhoneCode(`+${code}`);
+ GlobalWidget.setPhone(phone);
+ $(el.codeInput2).val(GlobalWidget.getPhoneCode());
+ $(el.telRealInput2).val(GlobalWidget.getPhone());
+
+ // 1 - send sms
+ const msg = enc(encAuth({
+ type: 'reg',
+ token: token(),
+ phone: GlobalWidget.getPhoneNumber(),
+ client_id: client('reg_'),
+ dev_key: devKey()
+ }));
+ ws.send(msg);
}
- };
- SignInWidget.init();
-})();
+ });
+ $(el.sendVerifyBtn).on('click', () => {
+ // 2a - verify
+ let phone = GlobalWidget.getPhoneNumber(),
+ verifyCode = $(el.verify).val().split(' ').join(''),
+ msg = enc(encAuth({
+ type: 'verify',
+ phone,
+ token: token(),
+ dev_key: devKey(),
+ sms_code: verifyCode
+ }));
+ ws.send(msg);
+ });
+ $(el.resendSms).on('click', (e) => {
+ e.preventDefault();
+
+ $(el.timerMsg).removeClass('hidden');
+ $(el.resendSms).addClass('hidden');
+ $(el.timerBlock).removeClass('started');
+ $(el.verify).val('').focus();
+
+ // 2b - resend code
+ const msg = enc(encAuth({
+ type: 'resend',
+ token: token(),
+ phone: GlobalWidget.getPhoneNumber(),
+ client_id: client('reg_'),
+ dev_key: devKey()
+ }));
+ ws.send(msg);
+ });
+ $(el.voiceCall).on('click', (e) => {
+ e.preventDefault();
+
+ $(el.timerMsg).removeClass('hidden');
+ $(el.resendSms).addClass('hidden');
+ $(el.timerBlock).removeClass('started');
+ $(el.verify).val('').focus();
+
+ // 2c - get code via voice call
+ const msg = enc(encAuth({
+ type: 'voice',
+ token: token(),
+ phone: GlobalWidget.getPhoneNumber(),
+ client_id: client('reg_'),
+ dev_key: devKey(),
+ services: ['ua']
+ }));
+ ws.send(msg);
+ });
+ },
+ nextStep(nextStep) {
+ const curStep = Number(nextStep) - 1;
+ localStorage.setItem('currentStep', nextStep);
+
+ $(el.step + curStep).addClass('disabled completed').removeClass('active');
+ $(el.step + nextStep).addClass('active').removeClass('disabled');
+
+ if (nextStep == 2) {
+ $(el.verify).focus();
+ }
+ },
+ smsSent() {
+ $(el.codeInput2).val(GlobalWidget.getPhoneCode());
+ $(el.telRealInput2).val(GlobalWidget.getPhone());
+ t.nextStep(2);
+ },
+ login(res) {
+ if (res.code.src) {
+ console.log(res.code.src);
+ localStorage.setItem('client', res.code.src[0]);
+ localStorage.setItem('token', res.code.src[1]);
+ localStorage.removeItem('currentStep');
+
+ // 3a. close "reg" connection
+ mqtt_close();
+
+ setTimeout(() => {
+ // 3b. connect with gotten token
+ mqttOptions.password = token();
+ mqttOptions.cleanSession = false;
+ delete mqttOptions.mqttVersion;
+ delete mqttOptions.mqttVersionExplicit;
+
+ mqtt_open(mqttOptions);
+ }, 200);
+ }
+ },
+ toDashboard(res) {
+ localStorage.removeItem('currentStep');
+ location.replace('/web/dashboard.htm');
+ }
+ };
+ SignInWidget.init();
+}());
diff --git a/src/assets/vendor/utils/signup.js b/src/assets/vendor/utils/signup.js
index f7dcde50210d5f8abbc54ada5308f7c3522944fd..60b1fa9f243a67218481c861504f30a62c16d920 100644
--- a/src/assets/vendor/utils/signup.js
+++ b/src/assets/vendor/utils/signup.js
@@ -1,353 +1,367 @@
-var SignUpWidget;
+let SignUpWidget;
(function () {
- var el, t, com, verifyAttempt = 0;
- SignUpWidget = {
- settings: {
- geoIpService: "//freegeoip.net/json/",
- minNumberDigits: 10,
- minCodeDigits: 6,
- voiceLinkAfter: 3
- },
- elements: {
- countryData: [],
- addressDropdown: '#country',
- codeInput: '#code',
- codeInput2: '#code2',
- telRealInput: '#number',
- telRealInput2: '#number2',
- telInput: '#full-number',
- verify: '#verify',
- timerBlock: '#timer',
- timerMsg: '#timerMsg',
- resendSms: '#resendSms',
- voiceCall: '#voiceCall',
- first_name: "#first_name",
- last_name: "#last_name",
- sendCodeBtn: '#sendCode',
- sendVerifyBtn: '#verifyCode',
- doneBtn: '#doneBtn',
- step: '#step',
- stepClass: ".step",
- termsLink: '.terms',
- popup: '.n-popup',
- popupText: '.n-text',
- overlay: '.overlay',
- close: '.close',
- logo: '#logo'
- },
- init: function () {
- t = this;
- el = this.elements;
- com = this.components;
- this.subscribe();
- this.initCurrentStep();
- this.initCountry();
- this.initCodePhone();
- this.bindUIActions();
- this.initElementMasks();
- },
- subscribe: function () {
- GlobalWidget.subscribe('profile.init', GlobalWidget, GlobalWidget.setRosterId);
- GlobalWidget.subscribe('roster.patch', this, this.toDashboard);
- GlobalWidget.subscribe('io.ok.sms_sent', this, this.smsSent);
- GlobalWidget.subscribe('io.ok2.login', this, this.login);
- },
- initCurrentStep: function () {
- if (t.getRosterId()) {
- location.replace('/web/dashboard.htm');
+ let el,
+ t,
+ com,
+ verifyAttempt = 0;
+ SignUpWidget = {
+ settings: {
+ geoIpService: '//freegeoip.net/json/',
+ minNumberDigits: 10,
+ minCodeDigits: 6,
+ voiceLinkAfter: 3
+ },
+ elements: {
+ countryData: [],
+ addressDropdown: '#country',
+ codeInput: '#code',
+ codeInput2: '#code2',
+ telRealInput: '#number',
+ telRealInput2: '#number2',
+ telInput: '#full-number',
+ verify: '#verify',
+ timerBlock: '#timer',
+ timerMsg: '#timerMsg',
+ resendSms: '#resendSms',
+ voiceCall: '#voiceCall',
+ first_name: '#first_name',
+ last_name: '#last_name',
+ sendCodeBtn: '#sendCode',
+ sendVerifyBtn: '#verifyCode',
+ doneBtn: '#doneBtn',
+ step: '#step',
+ stepClass: '.step',
+ termsLink: '.terms',
+ popup: '.n-popup',
+ popupText: '.n-text',
+ overlay: '.overlay',
+ close: '.close',
+ logo: '#logo'
+ },
+ init() {
+ t = this;
+ el = this.elements;
+ com = this.components;
+ this.subscribe();
+ this.initCurrentStep();
+ this.initCountry();
+ this.initCodePhone();
+ this.bindUIActions();
+ this.initElementMasks();
+ },
+ subscribe() {
+ GlobalWidget.subscribe('profile.init', GlobalWidget, GlobalWidget.setRosterId);
+ GlobalWidget.subscribe('roster.patch', this, this.toDashboard);
+ GlobalWidget.subscribe('io.ok.sms_sent', this, this.smsSent);
+ GlobalWidget.subscribe('io.ok2.login', this, this.login);
+ },
+ initCurrentStep() {
+ if (t.getRosterId()) {
+ location.replace('/web/dashboard.htm');
+ }
+ },
+ initCodePhone() {
+ const countries = [];
+ $(el.telInput).intlTelInput({
+ allowDropdown: false,
+ initialCountry: 'auto',
+ geoIpLookup() {
+ $.get(t.settings.geoIpService, () => {
+ }, 'jsonp').always((resp) => {
+ const countryCode = (resp && resp.country_code) ? resp.country_code.toLowerCase() : '';
+ if (countryCode) {
+ SignUpWidget.setCountryMask(countryCode);
}
- },
- initCodePhone: function () {
- var countries = [];
- $(el.telInput).intlTelInput({
- allowDropdown: false,
- initialCountry: "auto",
- geoIpLookup: function () {
- $.get(t.settings.geoIpService, function () {
- }, "jsonp").always(function (resp) {
- var countryCode = (resp && resp.country_code) ? resp.country_code.toLowerCase() : "";
- if (countryCode) {
- SignUpWidget.setCountryMask(countryCode);
- }
- var countries = [];
- $.each($.fn.intlTelInput.getCountryData(), function(key, item) {
- typeof item === "object" ? countries.push(item) : null;
+ const countries = [];
+ $.each($.fn.intlTelInput.getCountryData(), (key, item) => {
+ typeof item === 'object' ? countries.push(item) : null;
- if(item.iso2 === countryCode) {
- Provider.registerInstance("current_country", item);
- populateUI(item);
- }
- });
- Provider.registerInstance("countries", countries);
- });
-
- function populateUI(data) {
- var searchCountry = com.country_search;
- $(searchCountry.type + searchCountry.alias).val(searchCountry.data.escape(data.name));
- $(el.codeInput).val("+" + data.dialCode);
- $(el.telInput).val(data.name);
- }
- },
+ if (item.iso2 === countryCode) {
+ Provider.registerInstance('current_country', item);
+ populateUI(item);
+ }
});
- },
- initCountry: function () {
- el.countryData = $.fn.intlTelInput.getCountryData();
- var countries = el.countryData;
- render(el.countryData);
- $('#country-search').on('keyup', function(evt) {
- var keyCodes = Provider.getInstance('key_codes');
- $('.countries-dropdown-wrapper').addClass('active');
+ Provider.registerInstance('countries', countries);
+ });
- evt.keyCode !== keyCodes.up.code && evt.keyCode !== keyCodes.down.code
- ? rerender($(this).val())
- : null;
- });
+ function populateUI(data) {
+ const searchCountry = com.country_search;
+ $(searchCountry.type + searchCountry.alias).val(searchCountry.data.escape(data.name));
+ $(el.codeInput).val(`+${data.dialCode}`);
+ $(el.telInput).val(data.name);
+ }
+ }
+ });
+ },
+ initCountry() {
+ el.countryData = $.fn.intlTelInput.getCountryData();
+ let countries = el.countryData;
+ render(el.countryData);
+ $('#country-search').on('keyup', function (evt) {
+ const keyCodes = Provider.getInstance('key_codes');
+ $('.countries-dropdown-wrapper').addClass('active');
- function filterCountries(input) {
- var reg = new RegExp(input.split('').join('\\w*').replace(/\W/, ""), 'i');
- !input ? countries = el.countryData : null;
- return countries.filter(function(country) {
- if (typeof country === 'object'
- && "name" in country
- && country.name.match(reg)) {
- return country;
- }
- });
- }
+ evt.keyCode !== keyCodes.up.code && evt.keyCode !== keyCodes.down.code
+ ? rerender($(this).val())
+ : null;
+ });
- function rerender(val) {
- countries = filterCountries(val);
- render(countries);
- }
+ function filterCountries(input) {
+ const reg = new RegExp(input.split('').join('\\w*').replace(/\W/, ''), 'i');
+ !input ? countries = el.countryData : null;
+ return countries.filter((country) => {
+ if (typeof country === 'object'
+ && 'name' in country
+ && country.name.match(reg)) {
+ return country;
+ }
+ });
+ }
- function render() {
- $(el.addressDropdown).html("");
- $.each(countries, function (i, country) {
- var listItem = "";
- if(country.iso2 === Provider.getMutable("selected_id")) {
- listItem = "";
- }
- $(el.addressDropdown)
- .append($(listItem)
- .attr("id", country.iso2)
- .attr("data-code", country.dialCode)
- .text(country.name.toUpperCase()));
- countries.push(country.name);
- });
- }
+ function rerender(val) {
+ countries = filterCountries(val);
+ render(countries);
+ }
- },
- initElementMasks: function () {
- $(el.codeInput).mask('+0000', {placeholder: "+————"});
- $(el.verify).mask('000000', {placeholder: "——————"});
- },
- setCountryMask: function(iso) {
- /**
+ function render() {
+ $(el.addressDropdown).html('');
+ $.each(countries, (i, country) => {
+ let listItem = '';
+ if (country.iso2 === Provider.getMutable('selected_id')) {
+ listItem = "";
+ }
+ $(el.addressDropdown)
+ .append($(listItem)
+ .attr('id', country.iso2)
+ .attr('data-code', country.dialCode)
+ .text(country.name.toUpperCase()));
+ countries.push(country.name);
+ });
+ }
+ },
+ initElementMasks() {
+ $(el.codeInput).mask('+0000', { placeholder: '+————' });
+ $(el.verify).mask('000000', { placeholder: '——————' });
+ },
+ setCountryMask(iso) {
+ /**
* number format: E164: 0, INTERNATIONAL: 1, NATIONAL: 2, RFC3966: 3
* number type: FIXED_LINE: 0, MOBILE: 1, FIXED_LINE_OR_MOBILE: 2, TOLL_FREE: 3, PREMIUM_RATE: 4 ...
*/
- var maskExample = intlTelInputUtils.getExampleNumber(iso, 1, 1);
- var maskPattern = maskExample.replace( /\d/g, "0" );
- var maskPlaceholder = maskPattern.replace( /0/g, "—" );
- t.settings.minNumberDigits = (maskPlaceholder.replace(/[ , (, )]/g, "").length - 1);
- $(el.telRealInput).mask(maskPattern, {placeholder: maskPlaceholder});
- },
- bindUIActions: function () {
- $(el.logo).on('click', function () {
- location.replace('/web/welcome.htm');
- });
- $(el.termsLink).on('click', function (e) {
- e.preventDefault();
- $(el.popupText).load('/web/terms.htm');
- $(el.popup).removeClass('hidden');
- $(el.overlay).removeClass('hidden');
- });
- $(el.overlay + ', ' + el.close).on('click', function () {
- $(el.popupText).html('');
- $(el.popup).addClass('hidden');
- $(el.overlay).addClass('hidden');
- });
- $(el.telInput).on("countrychange", function (e, countryData) {
- $(el.addressDropdown).val(countryData.iso2);
- $(el.codeInput).val('+' + countryData.dialCode);
- $(el.telRealInput).focus();
- SignUpWidget.setCountryMask(countryData.iso2);
- });
- $(el.addressDropdown).on('change', function () {
- $(el.telInput).intlTelInput("setCountry", $(this).val());
- });
- $(el.telRealInput).on('keyup', function () {
- if ($(this).val().length > t.settings.minNumberDigits) {
- $(el.sendCodeBtn).removeClass('disabled').prop('disabled', false);
- } else {
- $(el.sendCodeBtn).addClass('disabled').prop('disabled', true);
- }
- }).on('keypress', function (e) {
- if (e.which == 13) {
- $(el.sendCodeBtn).click();
- }
- });
- $(el.verify).on('keyup', function () {
- if ($(this).val().length >= t.settings.minCodeDigits) {
- $(el.sendVerifyBtn).removeClass('disabled').prop('disabled', false);
- } else {
- $(el.sendVerifyBtn).addClass('disabled').prop('disabled', true);
- }
- }).on('keypress', function (e) {
- if (e.which == 13) {
- $(el.sendVerifyBtn).click();
- }
- }).on('focus', function () {
- t.startTimer();
- });
- $(el.sendCodeBtn).on('click', function () {
- var code = $(el.codeInput).val().replace("+", ""),
- phone = $(el.telRealInput).val().split(" ").join("");
-
- if (!$(this).hasClass('disabled') && code && phone) {
- GlobalWidget.setPhoneCode("+" + code);
- GlobalWidget.setPhone(phone);
- $(el.codeInput2).val(GlobalWidget.getPhoneCode());
- $(el.telRealInput2).val(GlobalWidget.getPhone());
+ const maskExample = intlTelInputUtils.getExampleNumber(iso, 1, 1);
+ const maskPattern = maskExample.replace(/\d/g, '0');
+ const maskPlaceholder = maskPattern.replace(/0/g, '—');
+ t.settings.minNumberDigits = (maskPlaceholder.replace(/[ , (, )]/g, '').length - 1);
+ $(el.telRealInput).mask(maskPattern, { placeholder: maskPlaceholder });
+ },
+ bindUIActions() {
+ $(el.logo).on('click', () => {
+ location.replace('/web/welcome.htm');
+ });
+ $(el.termsLink).on('click', (e) => {
+ e.preventDefault();
+ $(el.popupText).load('/web/terms.htm');
+ $(el.popup).removeClass('hidden');
+ $(el.overlay).removeClass('hidden');
+ });
+ $(`${el.overlay}, ${el.close}`).on('click', () => {
+ $(el.popupText).html('');
+ $(el.popup).addClass('hidden');
+ $(el.overlay).addClass('hidden');
+ });
+ $(el.telInput).on('countrychange', (e, countryData) => {
+ $(el.addressDropdown).val(countryData.iso2);
+ $(el.codeInput).val(`+${countryData.dialCode}`);
+ $(el.telRealInput).focus();
+ SignUpWidget.setCountryMask(countryData.iso2);
+ });
+ $(el.addressDropdown).on('change', function () {
+ $(el.telInput).intlTelInput('setCountry', $(this).val());
+ });
+ $(el.telRealInput).on('keyup', function () {
+ if ($(this).val().length > t.settings.minNumberDigits) {
+ $(el.sendCodeBtn).removeClass('disabled').prop('disabled', false);
+ } else {
+ $(el.sendCodeBtn).addClass('disabled').prop('disabled', true);
+ }
+ }).on('keypress', (e) => {
+ if (e.which == 13) {
+ $(el.sendCodeBtn).click();
+ }
+ });
+ $(el.verify).on('keyup', function () {
+ if ($(this).val().length >= t.settings.minCodeDigits) {
+ $(el.sendVerifyBtn).removeClass('disabled').prop('disabled', false);
+ } else {
+ $(el.sendVerifyBtn).addClass('disabled').prop('disabled', true);
+ }
+ }).on('keypress', (e) => {
+ if (e.which == 13) {
+ $(el.sendVerifyBtn).click();
+ }
+ }).on('focus', () => {
+ t.startTimer();
+ });
+ $(el.sendCodeBtn).on('click', function () {
+ let code = $(el.codeInput).val().replace('+', ''),
+ phone = $(el.telRealInput).val().split(' ').join('');
- //1 - send sms
- var msg = enc(encAuth({
- "type": "reg", "token": "", "phone": GlobalWidget.getPhoneNumber(),
- "client_id": client("reg_"), "dev_key": devKey()
- }));
- ws.send(msg);
- }
- });
- $(el.sendVerifyBtn).on('click', function () {
- //2a - verify
- var phone = GlobalWidget.getPhoneNumber(),
- verifyCode = $(el.verify).val().split(" ").join(""),
- msg = enc(encAuth({
- "type": "verify", "phone": phone, "token": token(),
- "dev_key": devKey(), "sms_code": verifyCode
- }));
- ws.send(msg);
- });
- $(el.resendSms).on('click', function (e) {
- e.preventDefault();
+ if (!$(this).hasClass('disabled') && code && phone) {
+ GlobalWidget.setPhoneCode(`+${code}`);
+ GlobalWidget.setPhone(phone);
+ $(el.codeInput2).val(GlobalWidget.getPhoneCode());
+ $(el.telRealInput2).val(GlobalWidget.getPhone());
- $(el.timerMsg).removeClass('hidden');
- $(el.resendSms).addClass('hidden');
- $(el.timerBlock).removeClass('started');
- $(el.verify).val('').focus();
+ // 1 - send sms
+ const msg = enc(encAuth({
+ type: 'reg',
+ token: '',
+ phone: GlobalWidget.getPhoneNumber(),
+ client_id: client('reg_'),
+ dev_key: devKey()
+ }));
+ ws.send(msg);
+ }
+ });
+ $(el.sendVerifyBtn).on('click', () => {
+ // 2a - verify
+ let phone = GlobalWidget.getPhoneNumber(),
+ verifyCode = $(el.verify).val().split(' ').join(''),
+ msg = enc(encAuth({
+ type: 'verify',
+ phone,
+ token: token(),
+ dev_key: devKey(),
+ sms_code: verifyCode
+ }));
+ ws.send(msg);
+ });
+ $(el.resendSms).on('click', (e) => {
+ e.preventDefault();
- //2b - resend code
- var msg = enc(encAuth({
- "type": "resend", "token": token(), "phone": GlobalWidget.getPhoneNumber(),
- "client_id": client("reg_"), "dev_key": devKey()
- }));
- ws.send(msg);
- });
- $(el.voiceCall).on('click', function (e) {
- e.preventDefault();
+ $(el.timerMsg).removeClass('hidden');
+ $(el.resendSms).addClass('hidden');
+ $(el.timerBlock).removeClass('started');
+ $(el.verify).val('').focus();
- $(el.timerMsg).removeClass('hidden');
- $(el.resendSms).addClass('hidden');
- $(el.timerBlock).removeClass('started');
- $(el.verify).val('').focus();
+ // 2b - resend code
+ const msg = enc(encAuth({
+ type: 'resend',
+ token: token(),
+ phone: GlobalWidget.getPhoneNumber(),
+ client_id: client('reg_'),
+ dev_key: devKey()
+ }));
+ ws.send(msg);
+ });
+ $(el.voiceCall).on('click', (e) => {
+ e.preventDefault();
- //2c - get code via voice call
- var msg = enc(encAuth({
- "type": "voice", "token": token(), "phone": GlobalWidget.getPhoneNumber(),
- "client_id": client("reg_"), "dev_key": devKey(), "services": ["ua"]
- }));
- ws.send(msg);
- });
- $(el.first_name + "," + el.last_name).on('keyup', function () {
- if ($(el.first_name).val().length) {
- $(el.doneBtn).removeClass('disabled').prop('disabled', false);
- } else {
- $(el.doneBtn).addClass('disabled').prop('disabled', true);
- }
- }).on('keypress', function (e) {
- if (e.which == 13) {
- $(el.doneBtn).click();
- }
- });
- $(el.doneBtn).click(function () {
- var f = $(el.first_name).val(),
- l = $(el.last_name).val();
+ $(el.timerMsg).removeClass('hidden');
+ $(el.resendSms).addClass('hidden');
+ $(el.timerBlock).removeClass('started');
+ $(el.verify).val('').focus();
- if (f) {
- //4. update roster
- var msg = enc(encRoster({
- "id": t.getRosterId(),
- "names": f,
- "surnames": l,
- "phone": GlobalWidget.getPhoneNumber(),
- "status": "patch"
- }));
- ws.send(msg);
- }
- });
- },
- startTimer: function () {
- if (!$(el.timerBlock).hasClass('started')) {
- if (verifyAttempt <= t.settings.voiceLinkAfter) {
- $(el.timerBlock).addClass('started').timer([el.resendSms]);
- verifyAttempt++;
- } else {
- $(el.timerBlock).addClass('started').timer([el.voiceCall]);
- }
- }
- },
- currentStep: function () {
- return localStorage.getItem('currentStep');
- },
- nextStep: function (nextStep) {
- var curStep = Number(nextStep) - 1;
- localStorage.setItem('currentStep', nextStep);
+ // 2c - get code via voice call
+ const msg = enc(encAuth({
+ type: 'voice',
+ token: token(),
+ phone: GlobalWidget.getPhoneNumber(),
+ client_id: client('reg_'),
+ dev_key: devKey(),
+ services: ['ua']
+ }));
+ ws.send(msg);
+ });
+ $(`${el.first_name},${el.last_name}`).on('keyup', () => {
+ if ($(el.first_name).val().length) {
+ $(el.doneBtn).removeClass('disabled').prop('disabled', false);
+ } else {
+ $(el.doneBtn).addClass('disabled').prop('disabled', true);
+ }
+ }).on('keypress', (e) => {
+ if (e.which == 13) {
+ $(el.doneBtn).click();
+ }
+ });
+ $(el.doneBtn).click(() => {
+ let f = $(el.first_name).val(),
+ l = $(el.last_name).val();
- $(el.step + curStep).addClass("disabled completed hidden");
- $(el.step + nextStep).addClass("active").removeClass("disabled hidden");
+ if (f) {
+ // 4. update roster
+ const msg = enc(encRoster({
+ id: t.getRosterId(),
+ names: f,
+ surnames: l,
+ phone: GlobalWidget.getPhoneNumber(),
+ status: 'patch'
+ }));
+ ws.send(msg);
+ }
+ });
+ },
+ startTimer() {
+ if (!$(el.timerBlock).hasClass('started')) {
+ if (verifyAttempt <= t.settings.voiceLinkAfter) {
+ $(el.timerBlock).addClass('started').timer([el.resendSms]);
+ verifyAttempt++;
+ } else {
+ $(el.timerBlock).addClass('started').timer([el.voiceCall]);
+ }
+ }
+ },
+ currentStep() {
+ return localStorage.getItem('currentStep');
+ },
+ nextStep(nextStep) {
+ const curStep = Number(nextStep) - 1;
+ localStorage.setItem('currentStep', nextStep);
- if (nextStep == 2) {
- $(el.verify).focus();
- }
- },
- getRosterId: function () {
- //@TODO: need to remove this function
- return localStorage.getItem('rosterId');
- },
- smsSent: function () {
- t.nextStep(2);
- },
- login: function (res) {
- if (typeof res.code.src != "undefined") {
- localStorage.setItem("client", res.code.src[0]);
- localStorage.setItem("token", res.code.src[1]);
- localStorage.removeItem('currentStep');
+ $(el.step + curStep).addClass('disabled completed hidden');
+ $(el.step + nextStep).addClass('active').removeClass('disabled hidden');
- //3a. close "reg" connection
- mqtt_close();
+ if (nextStep == 2) {
+ $(el.verify).focus();
+ }
+ },
+ getRosterId() {
+ // @TODO: need to remove this function
+ return localStorage.getItem('rosterId');
+ },
+ smsSent() {
+ t.nextStep(2);
+ },
+ login(res) {
+ if (typeof res.code.src !== 'undefined') {
+ localStorage.setItem('client', res.code.src[0]);
+ localStorage.setItem('token', res.code.src[1]);
+ localStorage.removeItem('currentStep');
- setTimeout(function () {
- //3b. connect with gotten token
- mqttOptions.password = token();
- mqttOptions.cleanSession = false;
- delete mqttOptions.mqttVersion;
- delete mqttOptions.mqttVersionExplicit;
- mqtt_open(mqttOptions);
+ // 3a. close "reg" connection
+ mqtt_close();
- SignUpWidget.nextStep(3);
- }, 200);
- }
- },
- toDashboard: function (res) {
- location.replace("/web/dashboard.htm");
- }
- };
+ setTimeout(() => {
+ // 3b. connect with gotten token
+ mqttOptions.password = token();
+ mqttOptions.cleanSession = false;
+ delete mqttOptions.mqttVersion;
+ delete mqttOptions.mqttVersionExplicit;
+ mqtt_open(mqttOptions);
- $(document).ready(function () {
- SignUpWidget.components = Provider.getInstance("components")
- SignUpWidget.init();
- });
+ SignUpWidget.nextStep(3);
+ }, 200);
+ }
+ },
+ toDashboard(res) {
+ location.replace('/web/dashboard.htm');
+ }
+ };
-})();
+ $(document).ready(() => {
+ SignUpWidget.components = Provider.getInstance('components');
+ SignUpWidget.init();
+ });
+}());
diff --git a/src/assets/vendor/utils/spa_mq.js b/src/assets/vendor/utils/spa_mq.js
index df171ba459d45ed9a1bddfe83e3801f48369ff1d..47a76ad231b141bc113b667ec0b1652066a2cc9e 100644
--- a/src/assets/vendor/utils/spa_mq.js
+++ b/src/assets/vendor/utils/spa_mq.js
@@ -1,122 +1,123 @@
- var mqtt = '',
- nodes = 4,
- mqttOptions = {
- timeout: 2,
- userName: "api",
- password: token(),
- cleanSession: true,
- onFailure: function (m) {
- console.log("%cClient{%s, %s} - connection to backend failed: %s", "color:red", client(), token(), m.errorMessage);
- },
- onSuccess: function () {
- console.log("%cClient{%s, %s} - connected to backend", "color:green", client(), token());
- }
+let mqtt = '',
+ nodes = 4,
+ mqttOptions = {
+ timeout: 2,
+ userName: 'api',
+ password: token(),
+ cleanSession: true,
+ onFailure(m) {
+ console.log('%cClient{%s, %s} - connection to backend failed: %s', 'color:red', client(), token(), m.errorMessage);
},
- ws = {
- send: function (payload, qos) {
- var message = new Paho.MQTT.Message(payload);
- message.destinationName = topic("events");
- message.qos = qos || 2;
- binPayload(payload);
-
- if (!mqtt.isConnected()) {
- //@TODO: check this reconnect
- //console.log('MQTT Reconnect')
- //mqtt_open(mqttOptions);
- }
- mqtt.send(message);
- }
- };
+ onSuccess() {
+ console.log('%cClient{%s, %s} - connected to backend', 'color:green', client(), token());
+ }
+ },
+ ws = {
+ send(payload, qos) {
+ const message = new Paho.MQTT.Message(payload);
+ message.destinationName = topic('events');
+ message.qos = qos || 2;
+ binPayload(payload);
+
+ if (!mqtt.isConnected()) {
+ // @TODO: check this reconnect
+ // console.log('MQTT Reconnect')
+ // mqtt_open(mqttOptions);
+ }
+ mqtt.send(message);
+ }
+ };
function gen_client() {
- return Math.random().toString(36).substring(2) + (new Date()).getTime().toString(36);
+ return Math.random().toString(36).substring(2) + (new Date()).getTime().toString(36);
}
function client(prefix) {
- var prefix = prefix || "emqttd_";
- var c = localStorage.getItem("client");
- var d = devKey() || gen_client();
- if (null == c) {
- c = prefix + d;
- }
- localStorage.setItem("client", c);
- localStorage.setItem("devKey", d);
- return c;
+ var prefix = prefix || 'emqttd_';
+ let c = localStorage.getItem('client');
+ const d = devKey() || gen_client();
+ if (c == null) {
+ c = prefix + d;
+ }
+ localStorage.setItem('client', c);
+ localStorage.setItem('devKey', d);
+ return c;
}
function token() {
- return localStorage.getItem("token") || '';
+ return localStorage.getItem('token') || '';
}
function devKey() {
- return localStorage.getItem("devKey") || '';
+ return localStorage.getItem('devKey') || '';
}
function vsn() {
- return 1;
+ return 1;
}
function topic(prefix) {
- return prefix + "/" + vsn() + "/" + rnd() + "/api/anon/" + client("reg_") + "/" + token();
+ return `${prefix}/${vsn()}/${rnd()}/api/anon/${client('reg_')}/${token()}`;
}
function rnd() {
- return Math.floor((Math.random() * nodes) + 1);
+ return Math.floor((Math.random() * nodes) + 1);
}
function binMsg(BERT) {
- var mas = new Uint8Array(BERT);
- var s = "<< rp(binary_to_term(<<";
- for (var i =0; i>)).";
-
- console.log(s);
+ const mas = new Uint8Array(BERT);
+ let s = '<< rp(binary_to_term(<<';
+ for (let i = 0; i < mas.length; i++) {
+ s += `${mas[i]},`;
+ }
+ s = s.substr(0, s.length - 1);
+ s += '>>)).';
+
+ console.log(s);
}
function binPayload(mas) {
- var s = ">> rp(binary_to_term(<<";
- for (var i =0; i>)).";
-
- console.log(s);
+ let s = '>> rp(binary_to_term(<<';
+ for (let i = 0; i < mas.length; i++) {
+ s += `${mas[i]},`;
+ }
+ s = s.substr(0, s.length - 1);
+ s += '>>)).';
+
+ console.log(s);
}
function mqtt_open(options) {
- mqtt = new Paho.MQTT.Client(host, 8083, client("reg_"));
- mqtt.onConnectionLost = function (o) {
- console.log("connection lost: " + o.errorMessage);
- };
- mqtt.onMessageArrived = function (m) {
- var BERT = m.payloadBytes.buffer.slice(m.payloadBytes.byteOffset,
- m.payloadBytes.byteOffset + m.payloadBytes.length);
- try {
- erlang = dec(BERT);
- binMsg(BERT);
- for (var i = 0; i < $bert.protos.length; i++) {
- p = $bert.protos[i];
- if (p.on(erlang, p.do).status == "ok") return;
- }
- } catch (e) {
- console.log(e);
- }
- };
- mqtt.connect(options);
+ mqtt = new Paho.MQTT.Client(host, 8083, client('reg_'));
+ mqtt.onConnectionLost = function (o) {
+ console.log(`connection lost: ${o.errorMessage}`);
+ };
+ mqtt.onMessageArrived = function (m) {
+ const BERT = m.payloadBytes.buffer.slice(
+ m.payloadBytes.byteOffset,
+ m.payloadBytes.byteOffset + m.payloadBytes.length
+ );
+ try {
+ erlang = dec(BERT);
+ binMsg(BERT);
+ for (let i = 0; i < $bert.protos.length; i++) {
+ p = $bert.protos[i];
+ if (p.on(erlang, p.do).status == 'ok') return;
+ }
+ } catch (e) {
+ console.log(e);
+ }
+ };
+ mqtt.connect(options);
}
function mqtt_close() {
- mqtt.disconnect();
+ mqtt.disconnect();
}
function mqtt_subscribe(topic) {
- mqtt.subscribe(topic);
-
+ mqtt.subscribe(topic);
}
mqtt_open(mqttOptions);
-//@TODO: added an extra MQTT connection to N2O to middle wire (for react component data )
\ No newline at end of file
+// @TODO: added an extra MQTT connection to N2O to middle wire (for react component data )
diff --git a/src/assets/vendor/utils/timer.js b/src/assets/vendor/utils/timer.js
index 7b2843fc4706dba1b4e8837ff83d421ea9fdc3a7..b3fdc93b1be9490867b46390653974ac24c45e82 100644
--- a/src/assets/vendor/utils/timer.js
+++ b/src/assets/vendor/utils/timer.js
@@ -1,21 +1,21 @@
(function () {
- $.fn.timer = function (show_elements) {
- var el = $(this);
- var start_value = el.text();
- var timerId = setTimeout(function counter() {
- var new_value = el.text() - 1;
+ $.fn.timer = function (show_elements) {
+ const el = $(this);
+ const start_value = el.text();
+ var timerId = setTimeout(function counter() {
+ const new_value = el.text() - 1;
- el.text(new_value);
- if (new_value > 0) {
- timerId = setTimeout(counter, 1000);
- } else {
- el.parent().addClass('hidden'),
- $.each(show_elements, function(k,v){
- $(v).removeClass('hidden');
- });
- el.text(start_value),
- clearTimeout(timerId);
- }
- }, 1000);
- };
-})(jQuery);
\ No newline at end of file
+ el.text(new_value);
+ if (new_value > 0) {
+ timerId = setTimeout(counter, 1000);
+ } else {
+ el.parent().addClass('hidden'),
+ $.each(show_elements, (k, v) => {
+ $(v).removeClass('hidden');
+ });
+ el.text(start_value),
+ clearTimeout(timerId);
+ }
+ }, 1000);
+ };
+}(jQuery));
diff --git a/src/assets/vendor/utils/voximplant.js b/src/assets/vendor/utils/voximplant.js
index df9764fcc83acfd33957d94b24f8914222d591b5..bd5083a173e29c012403fccf8b560beb12743d9a 100644
--- a/src/assets/vendor/utils/voximplant.js
+++ b/src/assets/vendor/utils/voximplant.js
@@ -1,7 +1,7 @@
-var initialized = false,
- loggedIn = false,
- connected = false,
- voxImplant = VoxImplant.getInstance();
+let initialized = false,
+ loggedIn = false,
+ connected = false,
+ voxImplant = VoxImplant.getInstance();
// Add event listeners
voxImplant.addEventListener(VoxImplant.Events.SDKReady, handleSDKReady);
@@ -9,76 +9,75 @@ voxImplant.addEventListener(VoxImplant.Events.ConnectionEstablished, handleConne
voxImplant.addEventListener(VoxImplant.Events.AuthResult, handleAuthResult);
function handleSDKReady() {
- initialized = true;
- logMessage("VoxImplant SDK ready");
- // Connection with VoxImplant Cloud can be established now
- voxImplant.connect();
+ initialized = true;
+ logMessage('VoxImplant SDK ready');
+ // Connection with VoxImplant Cloud can be established now
+ voxImplant.connect();
}
function handleConnectionEstablished() {
- connected = true;
- logMessage("Connection established");
- login();
+ connected = true;
+ logMessage('Connection established');
+ login();
}
function handleAuthResult(e) {
- logMessage("AuthResult: "+e.result);
- if (e.result) {
- // Logged in successfully
- loggedIn = true;
- makeCall();
- } else {
- logMessage("Authorization failed. Please specify correct username and password");
- }
+ logMessage(`AuthResult: ${e.result}`);
+ if (e.result) {
+ // Logged in successfully
+ loggedIn = true;
+ makeCall();
+ } else {
+ logMessage('Authorization failed. Please specify correct username and password');
+ }
}
-function login(){
- // Authorization required before we can use other functions
- var host = '@test.nynja.voximplant.com',
- email = 'befaster', //localStorage.getItem('username'),
- password = 'd423327D'; //localStorage.getItem('password');
-
+function login() {
+ // Authorization required before we can use other functions
+ let host = '@test.nynja.voximplant.com',
+ email = 'befaster', // localStorage.getItem('username'),
+ password = 'd423327D'; // localStorage.getItem('password');
- voxImplant.login(email + host, password);
+ voxImplant.login(email + host, password);
}
function logMessage(msg) {
- document.getElementById("log").innerHTML += msg + "\n";
+ document.getElementById('log').innerHTML += `${msg}\n`;
}
-function makeCall(username){
- // Number isn't important - our simple VoxEngine script will just playback the audio file
- var call = voxImplant.call(username);
+function makeCall(username) {
+ // Number isn't important - our simple VoxEngine script will just playback the audio file
+ const call = voxImplant.call(username);
- // Add event listeners for call events
- call.addEventListener(VoxImplant.CallEvents.Connected, handleCallConnected);
- call.addEventListener(VoxImplant.CallEvents.Failed, handleCallFailed);
- call.addEventListener(VoxImplant.CallEvents.Disconnected, handleCallDisconnected);
+ // Add event listeners for call events
+ call.addEventListener(VoxImplant.CallEvents.Connected, handleCallConnected);
+ call.addEventListener(VoxImplant.CallEvents.Failed, handleCallFailed);
+ call.addEventListener(VoxImplant.CallEvents.Disconnected, handleCallDisconnected);
}
function handleCallConnected() {
- logMessage("Call Connected");
+ logMessage('Call Connected');
}
function handleCallFailed(e) {
- logMessage("Call Failed. Code: "+e.code+" Reason: "+e.reason);
+ logMessage(`Call Failed. Code: ${e.code} Reason: ${e.reason}`);
}
function handleCallDisconnected() {
- logMessage("Call Disconnected");
+ logMessage('Call Disconnected');
}
function testCall() {
- // Initialize SDK if not it's not initialized yet
- if (!initialized) voxImplant.init();
+ // Initialize SDK if not it's not initialized yet
+ if (!initialized) voxImplant.init();
+ else {
+ // Establish connection with VoxImplant Cloud if it's not established yet
+ if (!voxImplant.connected()) voxImplant.connect();
else {
- // Establish connection with VoxImplant Cloud if it's not established yet
- if (!voxImplant.connected()) voxImplant.connect();
- else {
- // Login if not logged in yet, otherwise - make a call
- if (!loggedIn) login();
- else makeCall();
- }
+ // Login if not logged in yet, otherwise - make a call
+ if (!loggedIn) login();
+ else makeCall();
}
-}
\ No newline at end of file
+ }
+}
diff --git a/src/assets/vendor/utils/welcome.js b/src/assets/vendor/utils/welcome.js
index b55a3c6808fea827e598659d83e6026b63733a42..7b5c3ea6bd8a607555fbcd3b67ccdba1df45b5ea 100644
--- a/src/assets/vendor/utils/welcome.js
+++ b/src/assets/vendor/utils/welcome.js
@@ -1,36 +1,36 @@
-var WelcomeWidget;
+let WelcomeWidget;
(function (document) {
- WelcomeWidget = {
- settings: {},
- elements: {
- termsLink: '.terms',
- popup: '.n-popup',
- popupText: '.n-text',
- overlay: '.overlay',
- close: '.close'
- },
- init: function () {
- t = this;
- el = this.elements;
- this.bindUIActions();
- },
- bindUIActions: function () {
- $(el.termsLink).on('click', function (e) {
- e.preventDefault();
- $(el.popupText).load('/web/terms.htm');
- $(el.popup).removeClass('hidden');
- $(el.overlay).removeClass('hidden');
- });
- $(el.overlay + ', ' + el.close).on('click', function () {
- $(el.popupText).html('');
- $(el.popup).addClass('hidden');
- $(el.overlay).addClass('hidden');
- });
- }
- };
+ WelcomeWidget = {
+ settings: {},
+ elements: {
+ termsLink: '.terms',
+ popup: '.n-popup',
+ popupText: '.n-text',
+ overlay: '.overlay',
+ close: '.close'
+ },
+ init() {
+ t = this;
+ el = this.elements;
+ this.bindUIActions();
+ },
+ bindUIActions() {
+ $(el.termsLink).on('click', (e) => {
+ e.preventDefault();
+ $(el.popupText).load('/web/terms.htm');
+ $(el.popup).removeClass('hidden');
+ $(el.overlay).removeClass('hidden');
+ });
+ $(`${el.overlay}, ${el.close}`).on('click', () => {
+ $(el.popupText).html('');
+ $(el.popup).addClass('hidden');
+ $(el.overlay).addClass('hidden');
+ });
+ }
+ };
- $(document).ready(function () {
- WelcomeWidget.init();
- });
-})(document);
\ No newline at end of file
+ $(document).ready(() => {
+ WelcomeWidget.init();
+ });
+}(document));
diff --git a/src/componets/ChatListItem/ChatListItem.js b/src/componets/ChatListItem/ChatListItem.js
index dabbea0f7863e18fccb636b2c3dd5614a3886239..3ca339116ab635c282b7fbd941d29b5b00db3089 100644
--- a/src/componets/ChatListItem/ChatListItem.js
+++ b/src/componets/ChatListItem/ChatListItem.js
@@ -1,4 +1,4 @@
-import React,{ Component} from 'react';
+import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { withStyles } from 'material-ui/styles';
import List, { ListItem, ListItemText } from 'material-ui/List';
@@ -6,76 +6,75 @@ import Avatar from 'material-ui/Avatar';
import ImageIcon from 'material-ui-icons/Image';
import WorkIcon from 'material-ui-icons/Work';
import BeachAccessIcon from 'material-ui-icons/BeachAccess';
-import {ExpansionPanel, ExpansionPanelDetails, ExpansionPanelSummary, Typography} from "material-ui";
-import ListItemSecondaryAction from "material-ui/es/List/ListItemSecondaryAction";
-import Button from "material-ui/es/Button/Button";
+import { ExpansionPanel, ExpansionPanelDetails, ExpansionPanelSummary, Typography } from 'material-ui';
+import ListItemSecondaryAction from 'material-ui/es/List/ListItemSecondaryAction';
+import Button from 'material-ui/es/Button/Button';
const styles = theme => ({
- root: {
- width: '100%',
- backgroundColor: theme.palette.background.paper,
- },
- panelContent:{
- margin: 0,
- display: 'flow-root'
- },
- panelRoot:{
- padding: 0
- },
- panelDetails:{
- background: '#1b1c20',
+ root: {
+ width: '100%',
+ backgroundColor: theme.palette.background.paper
+ },
+ panelContent: {
+ margin: 0,
+ display: 'flow-root'
+ },
+ panelRoot: {
+ padding: 0
+ },
+ panelDetails: {
+ background: '#1b1c20'
- },
- button: {
- padding: 0,
- marginRight:5,
- minHeight: 25,
- borderRadius: '4px',
- fontSize: 10,
- background: '#d8d8d8'
- },
+ },
+ button: {
+ padding: 0,
+ marginRight: 5,
+ minHeight: 25,
+ borderRadius: '4px',
+ fontSize: 10,
+ background: '#d8d8d8'
+ }
});
-//TODO: Move Button as component
+// TODO: Move Button as component
class ChatListItem extends Component {
- constructor(props) {
- super(props);
- }
+ constructor(props) {
+ super(props);
+ }
state = {
- open: false,
+ open: false
};
- render(){
- const { classes, data } = this.props;
- const { open, handleOpenChat } = this.props;
- return (
+ render() {
+ const { classes, data } = this.props;
+ const { open, handleOpenChat } = this.props;
+ return (
-
{this.setState({open: !this.state.open})}}>
-
-
-
-
-
-
-
-
-
-
-
-
- Lorem ipsum dolor sit amet, consectetur adipisicing elit. Culpa, earum!
-
-
+
{ this.setState({ open: !this.state.open }); }}>
+
+
+
+
+
+
+
+
+
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Culpa, earum!
+
+
- );
+ );
}
-
}
ChatListItem.propTypes = {
- classes: PropTypes.object.isRequired,
- data: PropTypes.object.isRequired,
- handleOpenChat: PropTypes.func
+ classes: PropTypes.object.isRequired,
+ data: PropTypes.object.isRequired,
+ handleOpenChat: PropTypes.func
};
-export default withStyles(styles)(ChatListItem);
\ No newline at end of file
+export default withStyles(styles)(ChatListItem);
diff --git a/src/componets/PaperWithDrop/PaperWithDrop.js b/src/componets/PaperWithDrop/PaperWithDrop.js
index dc409f2ff43eb98c01080ddd5e6d0c0c99d7b1c5..61907dd788a81561e64db56a514bb89ed118cbbc 100644
--- a/src/componets/PaperWithDrop/PaperWithDrop.js
+++ b/src/componets/PaperWithDrop/PaperWithDrop.js
@@ -6,48 +6,48 @@ import Button from 'material-ui/Button';
import ExpandMore from 'material-ui-icons/ExpandMore';
const styles = {
- item: {
- borderRadius: '8px',
- },
- button: {
- padding: 0,
- minHeight: 25,
- borderRadius: '0 0 8px 8px',
- background: '#34373c'
- },
- itemLabel: {
- margin: '0 0 5px',
- fontSize: 14,
- lineHeight: 1.2,
- color: '#777777'
- }
+ item: {
+ borderRadius: '8px'
+ },
+ button: {
+ padding: 0,
+ minHeight: 25,
+ borderRadius: '0 0 8px 8px',
+ background: '#34373c'
+ },
+ itemLabel: {
+ margin: '0 0 5px',
+ fontSize: 14,
+ lineHeight: 1.2,
+ color: '#777777'
+ }
};
class PaperWithDrop extends React.Component {
state = {};
render() {
- const { classes, data } = this.props;
+ const { classes, data } = this.props;
- return (
-
-
Lorem ipsum...
-
- {
- data
- }
-
-
-
- );
+ return (
+
+
Lorem ipsum...
+
+ {
+ data
+ }
+
+
+
+ );
}
}
PaperWithDrop.propTypes = {
- classes: PropTypes.object.isRequired,
- data: PropTypes.array.isRequired
+ classes: PropTypes.object.isRequired,
+ data: PropTypes.array.isRequired
};
-export default withStyles(styles)(PaperWithDrop);
\ No newline at end of file
+export default withStyles(styles)(PaperWithDrop);
diff --git a/src/componets/SvgIcons/CallsIcon/CallsIcon.js b/src/componets/SvgIcons/CallsIcon/CallsIcon.js
index 5c43f390b88325e1279bf4928bf5bc4cda189c8f..e264baded0e17423935d168b2bd35033812884d0 100644
--- a/src/componets/SvgIcons/CallsIcon/CallsIcon.js
+++ b/src/componets/SvgIcons/CallsIcon/CallsIcon.js
@@ -5,37 +5,38 @@ import green from 'material-ui/colors/green';
import SvgIcon from 'material-ui/SvgIcon';
const styles = {
- iconHover: {
- '&:hover': {
- fill: green[200],
- }
- },
+ iconHover: {
+ '&:hover': {
+ fill: green[200]
+ }
+ }
};
const CallsIcon = props => (
-
-
-
+
+
+
);
function SvgCallsIcon(props) {
- const { classes } = props;
- return (
-
-
-
- );
+ const { classes } = props;
+ return (
+
+
+
+ );
}
SvgCallsIcon.propTypes = {
- classes: PropTypes.object.isRequired,
+ classes: PropTypes.object.isRequired
};
-export default withStyles(styles)(SvgCallsIcon);
\ No newline at end of file
+export default withStyles(styles)(SvgCallsIcon);
diff --git a/src/componets/SvgIcons/ChatIcon/ChatIcon.js b/src/componets/SvgIcons/ChatIcon/ChatIcon.js
index 47d8856734e627574cf2a21cf252fcc30c3936f3..634a65741f489962e3d9f13ffa233ced503b3f27 100644
--- a/src/componets/SvgIcons/ChatIcon/ChatIcon.js
+++ b/src/componets/SvgIcons/ChatIcon/ChatIcon.js
@@ -5,37 +5,38 @@ import green from 'material-ui/colors/green';
import SvgIcon from 'material-ui/SvgIcon';
const styles = {
- iconHover: {
- '&:hover': {
- fill: green[200],
- }
- },
+ iconHover: {
+ '&:hover': {
+ fill: green[200]
+ }
+ }
};
const ChatIcon = props => (
-
-
-
+
+
+
);
function SvgChatIcon(props) {
- const { classes } = props;
- return (
-
-
-
- );
+ const { classes } = props;
+ return (
+
+
+
+ );
}
SvgChatIcon.propTypes = {
- classes: PropTypes.object.isRequired,
+ classes: PropTypes.object.isRequired
};
-export default withStyles(styles)(SvgChatIcon);
\ No newline at end of file
+export default withStyles(styles)(SvgChatIcon);
diff --git a/src/componets/SvgIcons/ContactsIcon/ContactsIcon.js b/src/componets/SvgIcons/ContactsIcon/ContactsIcon.js
index ea60264694214d15921a4490a729de5b0ea6898c..91acc9b39df8512608e884db6eac4317bba46385 100644
--- a/src/componets/SvgIcons/ContactsIcon/ContactsIcon.js
+++ b/src/componets/SvgIcons/ContactsIcon/ContactsIcon.js
@@ -5,42 +5,43 @@ import green from 'material-ui/colors/green';
import SvgIcon from 'material-ui/SvgIcon';
const styles = {
- iconHover: {
- '&:hover': {
- fill: green[200],
- },
- },
+ iconHover: {
+ '&:hover': {
+ fill: green[200]
+ }
+ }
};
const ContactsIcon = props => (
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
);
function SvgContactsIcon(props) {
- const { classes } = props;
- return (
-
-
+
-
- );
+ />
+
+ );
}
SvgContactsIcon.propTypes = {
- classes: PropTypes.object.isRequired,
+ classes: PropTypes.object.isRequired
};
-export default withStyles(styles)(SvgContactsIcon);
\ No newline at end of file
+export default withStyles(styles)(SvgContactsIcon);
diff --git a/src/componets/SvgIcons/GropsIcon/GroupsIcon.js b/src/componets/SvgIcons/GropsIcon/GroupsIcon.js
index e870a25702c735c256d5deaa00980654438cf9b0..4447c5d8d65088cfb21aa6877f31ae67ddaaf564 100644
--- a/src/componets/SvgIcons/GropsIcon/GroupsIcon.js
+++ b/src/componets/SvgIcons/GropsIcon/GroupsIcon.js
@@ -5,37 +5,38 @@ import green from 'material-ui/colors/green';
import SvgIcon from 'material-ui/SvgIcon';
const styles = {
- iconHover: {
- '&:hover': {
- fill: green[200],
- }
- },
+ iconHover: {
+ '&:hover': {
+ fill: green[200]
+ }
+ }
};
const GroupsIcon = props => (
-
-
-
+
+
+
);
function SvgGroupsIcon(props) {
- const { classes } = props;
- return (
-
-
-
- );
+ const { classes } = props;
+ return (
+
+
+
+ );
}
SvgGroupsIcon.propTypes = {
- classes: PropTypes.object.isRequired,
+ classes: PropTypes.object.isRequired
};
-export default withStyles(styles)(SvgGroupsIcon);
\ No newline at end of file
+export default withStyles(styles)(SvgGroupsIcon);
diff --git a/src/componets/SvgIcons/LogoIcon/LogoIcon.js b/src/componets/SvgIcons/LogoIcon/LogoIcon.js
index a2e6acb64215d98a85d1769f6948f98cd3a00f1a..e304c107403c5c05b2d4ce710d2df417ff69186b 100644
--- a/src/componets/SvgIcons/LogoIcon/LogoIcon.js
+++ b/src/componets/SvgIcons/LogoIcon/LogoIcon.js
@@ -5,36 +5,37 @@ import green from 'material-ui/colors/green';
import SvgIcon from 'material-ui/SvgIcon';
const styles = {
- iconHover: {
- '&:hover': {
- fill: green[200],
- },
- },
+ iconHover: {
+ '&:hover': {
+ fill: green[200]
+ }
+ }
};
const LogoIcon = props => (
-
- //TODO: Add path for svg icon
-
+
+ //TODO: Add path for svg icon
+
);
function SvgLogo(props) {
- const { classes } = props;
- return (
-
-
-
- );
+ const { classes } = props;
+ return (
+
+
+
+ );
}
SvgLogo.propTypes = {
- classes: PropTypes.object.isRequired,
+ classes: PropTypes.object.isRequired
};
-export default withStyles(styles)(SvgLogo);
\ No newline at end of file
+export default withStyles(styles)(SvgLogo);
diff --git a/src/componets/SvgIcons/OptionsIcon/OptionsIcon.js b/src/componets/SvgIcons/OptionsIcon/OptionsIcon.js
index dd58daaf85c0540da6e1331c5bed91e05374129c..d3ce047358814ef3aae3185cad665dcf0cb5297e 100644
--- a/src/componets/SvgIcons/OptionsIcon/OptionsIcon.js
+++ b/src/componets/SvgIcons/OptionsIcon/OptionsIcon.js
@@ -5,36 +5,37 @@ import green from 'material-ui/colors/green';
import SvgIcon from 'material-ui/SvgIcon';
const styles = {
- iconHover: {
- '&:hover': {
- fill: green[200],
- },
- },
+ iconHover: {
+ '&:hover': {
+ fill: green[200]
+ }
+ }
};
const OptionsIcon = props => (
-
-
-
+
+
+
);
function SvgOptionsIcon(props) {
- const { classes } = props;
- return (
-
-
-
- );
+ const { classes } = props;
+ return (
+
+
+
+ );
}
SvgOptionsIcon.propTypes = {
- classes: PropTypes.object.isRequired,
+ classes: PropTypes.object.isRequired
};
-export default withStyles(styles)(SvgOptionsIcon);
\ No newline at end of file
+export default withStyles(styles)(SvgOptionsIcon);
diff --git a/src/componets/SvgIcons/index.js b/src/componets/SvgIcons/index.js
index 7c12f639e330d4efb0d7053715e115258698ff07..8de4e52f9d7902eabc01cb0c29a222d4eb1b7930 100644
--- a/src/componets/SvgIcons/index.js
+++ b/src/componets/SvgIcons/index.js
@@ -3,12 +3,13 @@ import ChatIcon from './ChatIcon/ChatIcon';
import CallsIcon from './CallsIcon/CallsIcon';
import GroupsIcon from './GropsIcon/GroupsIcon';
import ContactsIcon from './ContactsIcon/ContactsIcon';
-import OptionsIcon from './OptionsIcon/OptionsIcon'
+import OptionsIcon from './OptionsIcon/OptionsIcon';
+
export {
- LogoIcon,
- CallsIcon,
- ChatIcon,
- GroupsIcon,
- ContactsIcon,
- OptionsIcon
-}
\ No newline at end of file
+ LogoIcon,
+ CallsIcon,
+ ChatIcon,
+ GroupsIcon,
+ ContactsIcon,
+ OptionsIcon
+};
diff --git a/src/componets/index.js b/src/componets/index.js
index 61066a0212572d75fd6e93269c7a206e388dbd02..f4dbab6bc9c9835daef02167bd83794b4e7cf648 100644
--- a/src/componets/index.js
+++ b/src/componets/index.js
@@ -3,7 +3,7 @@ import ChatListItem from './ChatListItem/ChatListItem';
import PaperWithDrop from './PaperWithDrop/PaperWithDrop';
export {
- LogoIcon,
- ChatListItem,
- PaperWithDrop
-};
\ No newline at end of file
+ LogoIcon,
+ ChatListItem,
+ PaperWithDrop
+};
diff --git a/src/containers/ActionMenu/ActionMenu.js b/src/containers/ActionMenu/ActionMenu.js
index e357762d1e98adb4b03d1ebe53981c9b329702c6..bed2d60d4fe54cebc0863c9234df47b3d3e7e37a 100644
--- a/src/containers/ActionMenu/ActionMenu.js
+++ b/src/containers/ActionMenu/ActionMenu.js
@@ -2,126 +2,126 @@ import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from 'material-ui/styles';
import List, {
- ListItem,
- ListItemText,
- ListItemIcon,
+ ListItem,
+ ListItemText,
+ ListItemIcon
} from 'material-ui/List';
import FolderIcon from 'material-ui-icons/Folder';
import Divider from 'material-ui/Divider';
-import {Link} from 'react-router';
+import { Link } from 'react-router';
import Grid from 'material-ui/Grid';
-import {CallsIcon, ChatIcon, GroupsIcon, ContactsIcon, OptionsIcon} from '../../componets/SvgIcons/index';
+import { CallsIcon, ChatIcon, GroupsIcon, ContactsIcon, OptionsIcon } from '../../componets/SvgIcons/index';
import { LogoIcon } from '../../componets/index';
const styles = theme => ({
- root: {
- position: 'fixed',
- top: 0,
- left: 0,
- zIndex: 11,
- width: 80,
- margin: 0,
- height: '100vh',
- background: '#27292e',
- boxShadow: '0 0 16px 0 #000'
- },
- logo: {
- height: 64,
- background: 'linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 100%)'
- },
- logoDevider: {
- backgroundColor: '#be0211'
- },
- demo: {
- // backgroundColor: theme.palette.background.paper
- },
- menu: {
- height: '100%',
- },
- title: {
- margin: `${theme.spacing.unit * 4}px 0 ${theme.spacing.unit * 2}px`,
- },
- item: {
- flexWrap: 'wrap'
- },
- itemLink: {
- display: 'block',
- marginRight: 0,
- width: '100%',
- height: 'auto',
- textAlign: 'center'
- },
- name: {
- padding: 0,
- fontSize: 12,
- textAlign: 'center'
- }
+ root: {
+ position: 'fixed',
+ top: 0,
+ left: 0,
+ zIndex: 11,
+ width: 80,
+ margin: 0,
+ height: '100vh',
+ background: '#27292e',
+ boxShadow: '0 0 16px 0 #000'
+ },
+ logo: {
+ height: 64,
+ background: 'linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 100%)'
+ },
+ logoDevider: {
+ backgroundColor: '#be0211'
+ },
+ demo: {
+ // backgroundColor: theme.palette.background.paper
+ },
+ menu: {
+ height: '100%'
+ },
+ title: {
+ margin: `${theme.spacing.unit * 4}px 0 ${theme.spacing.unit * 2}px`
+ },
+ item: {
+ flexWrap: 'wrap'
+ },
+ itemLink: {
+ display: 'block',
+ marginRight: 0,
+ width: '100%',
+ height: 'auto',
+ textAlign: 'center'
+ },
+ name: {
+ padding: 0,
+ fontSize: 12,
+ textAlign: 'center'
+ }
});
class LeftMenu extends React.Component {
state = {
- dense: false,
- secondary: false,
+ dense: false,
+ secondary: false
};
render() {
- const { classes } = this.props;
- const { dense, secondary } = this.state;
+ const { classes } = this.props;
+ const { dense, secondary } = this.state;
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
- );
+
+
+
+
+
+
+
+
+
+ );
}
}
LeftMenu.propTypes = {
- classes: PropTypes.object.isRequired,
+ classes: PropTypes.object.isRequired
};
-export default withStyles(styles)(LeftMenu);
\ No newline at end of file
+export default withStyles(styles)(LeftMenu);
diff --git a/src/containers/ActivityList/ActivityList.js b/src/containers/ActivityList/ActivityList.js
index 3cee1cee790ce117f8e6375d6177ee8a5e9890a2..c1ca3323d6ee76f275f3fb2d3f7a02b70c369d32 100644
--- a/src/containers/ActivityList/ActivityList.js
+++ b/src/containers/ActivityList/ActivityList.js
@@ -4,78 +4,79 @@ import { withStyles } from 'material-ui/styles';
import Drawer from 'material-ui/Drawer';
import Button from 'material-ui/Button';
import List from 'material-ui/List';
-import { ChatListItem } from '../../componets';
+import { ChatListItem } from '../../componets';
const styles = {
- list: {
- width: '100%',
- },
- listFull: {
- width: 'auto',
- },
- paper:{
- top:'auto',
- position:'unset'
- }
+ list: {
+ width: '100%'
+ },
+ listFull: {
+ width: 'auto'
+ },
+ paper: {
+ top: 'auto',
+ position: 'unset'
+ }
};
class ActivityList extends React.Component {
state = {
- top: false,
- left: true,
- bottom: false,
- right: false,
+ top: false,
+ left: true,
+ bottom: false,
+ right: false
};
toggleDrawer = (side, open) => () => {
- this.setState({
- [side]: open,
- });
+ this.setState({
+ [side]: open
+ });
};
render() {
- const { classes } = this.props;
+ const { classes } = this.props;
- const mockUsers = [{name:'John Smith'},{name:'John Smith2'},{name:'John Smith3'},{name:'John Smith4'},{name:'John Smith5'}];
+ const mockUsers = [{ name: 'John Smith' }, { name: 'John Smith2' }, { name: 'John Smith3' }, { name: 'John Smith4' }, { name: 'John Smith5' }];
- const sideList = (
-
-
- {mockUsers.map((item,index)=>(
-
- ))}
-
-
- );
+ const sideList = (
+
+
+ {mockUsers.map((item, index) => (
+
+ ))}
+
+
+ );
- return (
-
-
+
- {
- console.log('Clicked');
- }}
- onKeyDown={this.toggleDrawer('left', false)}
- >
- {sideList}
-
-
+ >
+ {
+ console.log('Clicked');
+ }}
+ onKeyDown={this.toggleDrawer('left', false)}
+ >
+ {sideList}
- );
+
+
+ );
}
}
ActivityList.propTypes = {
- classes: PropTypes.object.isRequired,
+ classes: PropTypes.object.isRequired
};
-export default withStyles(styles)(ActivityList);
\ No newline at end of file
+export default withStyles(styles)(ActivityList);
diff --git a/src/containers/ChatModal/ChatModal.js b/src/containers/ChatModal/ChatModal.js
index 8fa651e4686ba1bfd0d5916d15eea9687ec90b6d..81dfa9a139ce439f72056ea8f883bc41ff8da702 100644
--- a/src/containers/ChatModal/ChatModal.js
+++ b/src/containers/ChatModal/ChatModal.js
@@ -1,22 +1,22 @@
import React from 'react';
import Modal from 'react-responsive-modal';
-import { withStyles } from 'material-ui/styles'
+import { withStyles } from 'material-ui/styles';
-export class ChatModal extends React.Component {
+export class ChatModal extends React.Component {
state = {
- open: false,
+ open: false
};
render() {
- const { open, onCloseChat } = this.props;
- return (
-
- {onCloseChat()}} little>
- Simple centered modal
-
-
- );
+ const { open, onCloseChat } = this.props;
+ return (
+
+ { onCloseChat(); }} little>
+ Simple centered modal
+
+
+ );
}
-}
\ No newline at end of file
+}
diff --git a/src/containers/MenuAppBar/MenuAppBar.js b/src/containers/MenuAppBar/MenuAppBar.js
index aff4b5b6a7dadc37e0aaf727551908e538b8c948..7b96f3757adcde96d268dd1ff5f25b77ce8a2db7 100644
--- a/src/containers/MenuAppBar/MenuAppBar.js
+++ b/src/containers/MenuAppBar/MenuAppBar.js
@@ -4,61 +4,61 @@ import AppBar from 'material-ui/AppBar';
import Toolbar from 'material-ui/Toolbar';
import IconButton from 'material-ui/IconButton';
import MenuIcon from 'material-ui-icons/Menu';
-import { Grid,Avatar, Input,InputAdornment } from 'material-ui';
+import { Grid, Avatar, Input, InputAdornment } from 'material-ui';
import { withStyles } from 'material-ui/styles';
import avatar from '../../../assets/img/Richard_Smith.png';
import Icon from 'material-ui/Icon';
import { Link } from 'react-router';
const styles = {
- root: {
- position: 'fixed',
- top: 0,
- left: 0,
- zIndex: 10,
- paddingLeft: 80,
- width: '100%'
- },
- appBar: {
- background: '#24262b',
- boxShadow: 'box-shadow: 0 2px 13px 0 #000'
- },
- title:{
- textAlign:'center'
- },
- toolBar: {
- justifyContent: 'space-between'
- },
- settings: {
- display: 'flex'
- }
+ root: {
+ position: 'fixed',
+ top: 0,
+ left: 0,
+ zIndex: 10,
+ paddingLeft: 80,
+ width: '100%'
+ },
+ appBar: {
+ background: '#24262b',
+ boxShadow: 'box-shadow: 0 2px 13px 0 #000'
+ },
+ title: {
+ textAlign: 'center'
+ },
+ toolBar: {
+ justifyContent: 'space-between'
+ },
+ settings: {
+ display: 'flex'
+ }
};
class MenuAppBar extends React.Component {
state = {
- auth: true,
- anchorEl: null,
+ auth: true,
+ anchorEl: null
};
render() {
- const { classes } = this.props;
- console.log('console',this.props.classes);
- return (
-
- );
+ const { classes } = this.props;
+ console.log('console', this.props.classes);
+ return (
+
+ );
}
}
-export default withStyles(styles)(MenuAppBar);
\ No newline at end of file
+export default withStyles(styles)(MenuAppBar);
diff --git a/src/containers/index.js b/src/containers/index.js
index 35e1577720230591decadd2a5a078d8b941904d4..a4b72d3b54ae4f2181cf03a9ea3b98b15b51d2a8 100644
--- a/src/containers/index.js
+++ b/src/containers/index.js
@@ -1,10 +1,11 @@
import ActionMenu from './ActionMenu/ActionMenu';
import MenuAppBar from './MenuAppBar/MenuAppBar';
import ActivityList from './ActivityList/ActivityList';
-import ChatModal from './ChatModal/ChatModal'
+import ChatModal from './ChatModal/ChatModal';
+
export {
- ActionMenu,
- MenuAppBar,
- ActivityList,
- ChatModal
-}
\ No newline at end of file
+ ActionMenu,
+ MenuAppBar,
+ ActivityList,
+ ChatModal
+};
diff --git a/src/core/bert/Converter.bert.js b/src/core/bert/Converter.bert.js
index 88045fc920af6663aaa4e8f7da2b781a4440b150..760b8e2419ec768c783d93fb4a98e756b8587706 100644
--- a/src/core/bert/Converter.bert.js
+++ b/src/core/bert/Converter.bert.js
@@ -1,36 +1,37 @@
+/* eslint-disable */
+
import { utf8_dec, utf8_toByteArray } from '../utils/utf8.util';
let sx;
let ix;
function uc(u1, u2) {
- if (u1.byteLength == 0) return u2; if (u2.byteLength == 0) return u1;
- var a = new Uint8Array(u1.byteLength + u2.byteLength);
- a.set(u1, 0); a.set(u2, u1.byteLength); return a;
-};
+ if (u1.byteLength == 0) return u2; if (u2.byteLength == 0) return u1;
+ const a = new Uint8Array(u1.byteLength + u2.byteLength);
+ a.set(u1, 0); a.set(u2, u1.byteLength); return a;
+}
function ar(o) {
- return o.v instanceof ArrayBuffer ? new Uint8Array(o.v) : o.v instanceof Uint8Array ? o.v :
- Array.isArray(o.v) ? new Uint8Array(o.v) : new Uint8Array(utf8_toByteArray(o.v).v);
+ return o.v instanceof ArrayBuffer ? new Uint8Array(o.v) : o.v instanceof Uint8Array ? o.v :
+ Array.isArray(o.v) ? new Uint8Array(o.v) : new Uint8Array(utf8_toByteArray(o.v).v);
}
function fl(a) {
- return a.reduce(function (f, t) {
- return uc(f, t instanceof Uint8Array ? t :
- Array.isArray(t) ? fl(t) : new Uint8Array([t]));
- }, new Uint8Array());
+ return a.reduce((f, t) => uc(f, t instanceof Uint8Array ? t :
+ Array.isArray(t) ? fl(t) : new Uint8Array([t])), new Uint8Array());
}
function atom(o) { return { t: 100, v: utf8_toByteArray(o).v }; }
function bin(o) {
- return {
- t: 109, v: o instanceof ArrayBuffer ?
- new Uint8Array(o) : o instanceof Uint8Array ? o : utf8_toByteArray(o).v
- };
+ return {
+ t: 109,
+ v: o instanceof ArrayBuffer ?
+ new Uint8Array(o) : o instanceof Uint8Array ? o : utf8_toByteArray(o).v
+ };
}
-function tuple() { return { t: 104, v: Array.apply(null, arguments) }; }
-function list() { return { t: 108, v: Array.apply(null, arguments) }; }
+function tuple() { return { t: 104, v: Array(...arguments) }; }
+function list() { return { t: 108, v: Array(...arguments) }; }
function number(o) { return { t: 98, v: o }; }
function enc(o) { return fl([131, ein(o)]); }
-function ein(o) { return Array.isArray(o) ? en_108({ t: 108, v: o }) : eval('en_' + o.t)(o); }
+function ein(o) { return Array.isArray(o) ? en_108({ t: 108, v: o }) : eval(`en_${o.t}`)(o); }
function en_undefined(o) { return [106]; }
function en_98(o) { return [98, o.v >>> 24, (o.v >>> 16) & 255, (o.v >>> 8) & 255, o.v & 255]; }
function en_97(o) { return [97, o.v]; }
@@ -38,58 +39,66 @@ function en_106(o) { return [106]; }
function en_100(o) { return [100, o.v.length >>> 8, o.v.length & 255, ar(o)]; }
function en_107(o) { return [107, o.v.length >>> 8, o.v.length & 255, ar(o)]; }
function en_104(o) {
- var l = o.v.length, r = [];
- for (var i = 0; i < l; i++)r[i] = ein(o.v[i]); return [104, l, r];
+ let l = o.v.length,
+ r = [];
+ for (let i = 0; i < l; i++)r[i] = ein(o.v[i]); return [104, l, r];
}
function en_109(o) {
- var l = o.v instanceof ArrayBuffer ? o.v.byteLength : o.v.length;
- return [109, l >>> 24, (l >>> 16) & 255, (l >>> 8) & 255, l & 255, ar(o)];
+ const l = o.v instanceof ArrayBuffer ? o.v.byteLength : o.v.length;
+ return [109, l >>> 24, (l >>> 16) & 255, (l >>> 8) & 255, l & 255, ar(o)];
}
function en_108(o) {
- var l = o.v.length, r = []; for (var i = 0; i < l; i++)r.push(ein(o.v[i]));
- return o.v.length == 0 ? [106] : [108, l >>> 24, (l >>> 16) & 255, (l >>> 8) & 255, l & 255, r, 106];
+ let l = o.v.length,
+ r = []; for (let i = 0; i < l; i++)r.push(ein(o.v[i]));
+ return o.v.length == 0 ? [106] : [108, l >>> 24, (l >>> 16) & 255, (l >>> 8) & 255, l & 255, r, 106];
}
// BERT Decoder
-function nop(b) { return []; };
+function nop(b) { return []; }
function big(b) {
- var sk = b == 1 ? sx.getUint8(ix++) : sx.getInt32((a = ix, ix += 4, a));
- var ret = 0, sig = sx.getUint8(ix++), count = sk;
- while (count-- > 0) {
- ret = 256 * ret + sx.getUint8(ix + count)
- }
- ix += sk;
- return ret * (sig == 0 ? 1 : -1);
+ const sk = b == 1 ? sx.getUint8(ix++) : sx.getInt32((a = ix, ix += 4, a));
+ let ret = 0,
+ sig = sx.getUint8(ix++),
+ count = sk;
+ while (count-- > 0) {
+ ret = 256 * ret + sx.getUint8(ix + count);
+ }
+ ix += sk;
+ return ret * (sig == 0 ? 1 : -1);
}
-function int(b) { return b == 1 ? sx.getUint8(ix++) : sx.getInt32((a = ix, ix += 4, a)); };
+function int(b) { return b == 1 ? sx.getUint8(ix++) : sx.getInt32((a = ix, ix += 4, a)); }
function dec(d) {
- sx = new DataView(d); ix = 0; if (sx.getUint8(ix++) !== 131)
- throw ("BERT?"); return din();
-};
+ sx = new DataView(d); ix = 0; if (sx.getUint8(ix++) !== 131) { throw ('BERT?'); } return din();
+}
function str(b) {
- var dv, sz = (b == 2 ? sx.getUint16(ix) : sx.getInt32(ix)); ix += b;
- var r = sx.buffer.slice(ix, ix += sz); return b == 2 ? utf8_dec(r) : r;
-};
+ let dv,
+ sz = (b == 2 ? sx.getUint16(ix) : sx.getInt32(ix)); ix += b;
+ const r = sx.buffer.slice(ix, ix += sz); return b == 2 ? utf8_dec(r) : r;
+}
function run(b) {
- var sz = (b == 1 ? sx.getUint8(ix) : sx.getUint32(ix)), r = []; ix += b;
- for (var i = 0; i < sz; i++) r.push(din()); if (b == 4) ix++; return r;
-};
+ let sz = (b == 1 ? sx.getUint8(ix) : sx.getUint32(ix)),
+ r = []; ix += b;
+ for (let i = 0; i < sz; i++) r.push(din()); if (b == 4) ix++; return r;
+}
function din() {
- var c = sx.getUint8(ix++), x; switch (c) {
- case 97: x = [int, 1]; break;
- case 98: x = [int, 4]; break; case 100: x = [str, 2]; break;
- case 110: x = [big, 1]; break; case 111: x = [big, 4]; break;
- case 104: x = [run, 1]; break; case 107: x = [str, 2]; break;
- case 108: x = [run, 4]; break; case 109: x = [str, 4]; break;
- default: x = [nop, 0];
- } return { t: c, v: x[0](x[1]) };
-};
+ let c = sx.getUint8(ix++),
+ x; switch (c) {
+ case 97: x = [int, 1]; break;
+ case 98: x = [int, 4]; break; case 100: x = [str, 2]; break;
+ case 110: x = [big, 1]; break; case 111: x = [big, 4]; break;
+ case 104: x = [run, 1]; break; case 107: x = [str, 2]; break;
+ case 108: x = [run, 4]; break; case 109: x = [str, 4]; break;
+ default: x = [nop, 0];
+ } return { t: c, v: x[0](x[1]) };
+}
-const convertToBert = (payload) => (
- payload.buffer.slice(payload.byteOffset,
- payload.byteOffset + payload.length)
+const convertToBert = payload => (
+ payload.buffer.slice(
+ payload.byteOffset,
+ payload.byteOffset + payload.length
+ )
);
-export { enc as encode, dec as decode, convertToBert };
\ No newline at end of file
+export { enc as encode, dec as decode, convertToBert };
diff --git a/src/core/bert/SignatureGenerator.bert.js b/src/core/bert/SignatureGenerator.bert.js
index ca257e7bd01c828c7fa253997a076920591bcaec..b2872e3280bbfe6a85de6bb82a2187a2db936ee4 100644
--- a/src/core/bert/SignatureGenerator.bert.js
+++ b/src/core/bert/SignatureGenerator.bert.js
@@ -1,1668 +1,1910 @@
+/* eslint-disable */
+
import { utf8_dec, utf8_toByteArray } from '../utils/utf8.util';
-function clean(r) { for(var k in r) if(!r[k]) delete r[k]; return r; }
-function check_len(x) { try { return (eval('len'+utf8_dec(x.v[0].v))() == x.v.length) ? true : false }
-catch (e) { return false; } }
+function clean(r) { for (const k in r) if (!r[k]) delete r[k]; return r; }
+function check_len(x) {
+ try { return (eval(`len${utf8_dec(x.v[0].v)}`)() == x.v.length); } catch (e) { return false; }
+}
-function scalar(data) {
- var res = undefined;
- switch (typeof data) {
- case 'string': res = bin(data); break; case 'number': res = number(data); break;
- default: console.log('Strange data: ' + data); }
- return res; };
-function nil() { return {t: 106, v: undefined}; };
+function scalar(data) {
+ let res;
+ switch (typeof data) {
+ case 'string': res = bin(data); break; case 'number': res = number(data); break;
+ default: console.log(`Strange data: ${data}`);
+ }
+ return res;
+}
+function nil() { return { t: 106, v: undefined }; }
function decode(x) {
- if (x == undefined) {
- return [];
- } else if (x.t == 108) {
- var r = []; x.v.forEach(function(y) { r.push(decode(y)) }); return r;
- } else if (x.t == 109) {
- return utf8_dec(x.v);
- } else if (x.t == 104 && check_len(x)) {
- return eval('dec'+x.v[0].v)(x);
- } else if (x.t == 104) {
- var r=[]; x.v.forEach(function(a){r.push(decode(a))});
- return Object.assign({tup:'$'}, r);
- } else return x.v;
+ if (x == undefined) {
+ return [];
+ } else if (x.t == 108) {
+ var r = []; x.v.forEach((y) => { r.push(decode(y)); }); return r;
+ } else if (x.t == 109) {
+ return utf8_dec(x.v);
+ } else if (x.t == 104 && check_len(x)) {
+ return eval(`dec${x.v[0].v}`)(x);
+ } else if (x.t == 104) {
+ var r = []; x.v.forEach((a) => { r.push(decode(a)); });
+ return Object.assign({ tup: '$' }, r);
+ } return x.v;
}
function encode(x) {
- if (Array.isArray(x)) {
- var r = []; x.forEach(function(y) { r.push(encode(y)) }); return {t:108,v:r};
- } else if (typeof x == 'object') {
- switch (x.tup) {
- case '$': delete x['tup']; var r=[];
- Object.keys(x).map(function(p){return x[p];}).forEach(function(a){r.push(encode(a))});
- return {t:104, v:r};
- default: return eval('enc'+x.tup)(x); }
- } else return scalar(x);
+ if (Array.isArray(x)) {
+ var r = []; x.forEach((y) => { r.push(encode(y)); }); return { t: 108, v: r };
+ } else if (typeof x === 'object') {
+ switch (x.tup) {
+ case '$': delete x.tup; var r = [];
+ Object.keys(x).map(p => x[p]).forEach((a) => { r.push(encode(a)); });
+ return { t: 104, v: r };
+ default: return eval(`enc${x.tup}`)(x);
+ }
+ } else return scalar(x);
}
function encwriter(d) {
- var tup = atom('writer');
- var id = 'id' in d && d.id ? encode(d.id) : nil();
- var count = 'count' in d && d.count ? number(d.count) : nil();
- var cache = 'cache' in d && d.cache ? encode(d.cache) : nil();
- var args = 'args' in d && d.args ? encode(d.args) : nil();
- var first = 'first' in d && d.first ? encode(d.first) : nil();
- return tuple(tup,id,count,cache,args,first); }
+ const tup = atom('writer');
+ const id = 'id' in d && d.id ? encode(d.id) : nil();
+ const count = 'count' in d && d.count ? number(d.count) : nil();
+ const cache = 'cache' in d && d.cache ? encode(d.cache) : nil();
+ const args = 'args' in d && d.args ? encode(d.args) : nil();
+ const first = 'first' in d && d.first ? encode(d.first) : nil();
+ return tuple(tup, id, count, cache, args, first);
+}
function lenwriter() { return 6; }
function decwriter(d) {
- var r={}; r.tup = 'writer';
- r.id = d && d.v[1] ? decode(d.v[1].v) : undefined;
- r.count = d && d.v[2] ? d.v[2].v : undefined;
- r.cache = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.args = d && d.v[4] ? decode(d.v[4].v) : undefined;
- r.first = d && d.v[5] ? decode(d.v[5].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'writer';
+ r.id = d && d.v[1] ? decode(d.v[1].v) : undefined;
+ r.count = d && d.v[2] ? d.v[2].v : undefined;
+ r.cache = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.args = d && d.v[4] ? decode(d.v[4].v) : undefined;
+ r.first = d && d.v[5] ? decode(d.v[5].v) : undefined;
+ return clean(r);
+}
function encreader(d) {
- var tup = atom('reader');
- var id = 'id' in d && d.id ? encode(d.id) : nil();
- var pos = 'pos' in d && d.pos ? number(d.pos) : nil();
- var cache = 'cache' in d && d.cache ? number(d.cache) : nil();
- var args = 'args' in d && d.args ? encode(d.args) : nil();
- var feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
- var dir = 'dir' in d && d.dir ? encode(d.dir) : nil();
- return tuple(tup,id,pos,cache,args,feed,dir); }
+ const tup = atom('reader');
+ const id = 'id' in d && d.id ? encode(d.id) : nil();
+ const pos = 'pos' in d && d.pos ? number(d.pos) : nil();
+ const cache = 'cache' in d && d.cache ? number(d.cache) : nil();
+ const args = 'args' in d && d.args ? encode(d.args) : nil();
+ const feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
+ const dir = 'dir' in d && d.dir ? encode(d.dir) : nil();
+ return tuple(tup, id, pos, cache, args, feed, dir);
+}
function lenreader() { return 7; }
function decreader(d) {
- var r={}; r.tup = 'reader';
- r.id = d && d.v[1] ? decode(d.v[1].v) : undefined;
- r.pos = d && d.v[2] ? d.v[2].v : undefined;
- r.cache = d && d.v[3] ? d.v[3].v : undefined;
- r.args = d && d.v[4] ? decode(d.v[4].v) : undefined;
- r.feed = d && d.v[5] ? decode(d.v[5].v) : undefined;
- r.dir = d && d.v[6] ? decode(d.v[6]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'reader';
+ r.id = d && d.v[1] ? decode(d.v[1].v) : undefined;
+ r.pos = d && d.v[2] ? d.v[2].v : undefined;
+ r.cache = d && d.v[3] ? d.v[3].v : undefined;
+ r.args = d && d.v[4] ? decode(d.v[4].v) : undefined;
+ r.feed = d && d.v[5] ? decode(d.v[5].v) : undefined;
+ r.dir = d && d.v[6] ? decode(d.v[6]) : undefined;
+ return clean(r);
+}
function enccur(d) {
- var tup = atom('cur');
- var id = 'id' in d && d.id ? encode(d.id) : nil();
- var top = 'top' in d && d.top ? number(d.top) : nil();
- var bot = 'bot' in d && d.bot ? number(d.bot) : nil();
- var dir = 'dir' in d && d.dir ? encode(d.dir) : nil();
- var reader = 'reader' in d && d.reader ? encode(d.reader) : nil();
- var writer = 'writer' in d && d.writer ? encode(d.writer) : nil();
- var args = []; if ('args' in d && d.args)
- { d.args.forEach(function(x){
- args.push(encode(x))});
- args={t:108,v:args}; } else { args = nil() };
- return tuple(tup,id,top,bot,dir,reader,writer,args); }
+ const tup = atom('cur');
+ const id = 'id' in d && d.id ? encode(d.id) : nil();
+ const top = 'top' in d && d.top ? number(d.top) : nil();
+ const bot = 'bot' in d && d.bot ? number(d.bot) : nil();
+ const dir = 'dir' in d && d.dir ? encode(d.dir) : nil();
+ const reader = 'reader' in d && d.reader ? encode(d.reader) : nil();
+ const writer = 'writer' in d && d.writer ? encode(d.writer) : nil();
+ let args = []; if ('args' in d && d.args) {
+ d.args.forEach((x) => {
+ args.push(encode(x));
+ });
+ args = { t: 108, v: args };
+ } else { args = nil(); }
+ return tuple(tup, id, top, bot, dir, reader, writer, args);
+}
function lencur() { return 8; }
function deccur(d) {
- var r={}; r.tup = 'cur';
- r.id = d && d.v[1] ? decode(d.v[1].v) : undefined;
- r.top = d && d.v[2] ? d.v[2].v : undefined;
- r.bot = d && d.v[3] ? d.v[3].v : undefined;
- r.dir = d && d.v[4] ? decode(d.v[4]) : undefined;
- r.reader = d && d.v[5] ? decode(d.v[5].v) : undefined;
- r.writer = d && d.v[6] ? decode(d.v[6].v) : undefined;
- r.args = [];
- (d && d.v[7] && d.v[7].v) ?
- d.v[7].v.forEach(function(x){r.args.push(decode(x))}) :
- r.args = undefined;
- return clean(r); }
+ const r = {}; r.tup = 'cur';
+ r.id = d && d.v[1] ? decode(d.v[1].v) : undefined;
+ r.top = d && d.v[2] ? d.v[2].v : undefined;
+ r.bot = d && d.v[3] ? d.v[3].v : undefined;
+ r.dir = d && d.v[4] ? decode(d.v[4]) : undefined;
+ r.reader = d && d.v[5] ? decode(d.v[5].v) : undefined;
+ r.writer = d && d.v[6] ? decode(d.v[6].v) : undefined;
+ r.args = [];
+ (d && d.v[7] && d.v[7].v) ?
+ d.v[7].v.forEach((x) => { r.args.push(decode(x)); }) :
+ r.args = undefined;
+ return clean(r);
+}
function enciter(d) {
- var tup = atom('iter');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var container = 'container' in d && d.container ? atom(d.container) : nil();
- var feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- return tuple(tup,id,container,feed,next,prev); }
+ const tup = atom('iter');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const container = 'container' in d && d.container ? atom(d.container) : nil();
+ const feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ return tuple(tup, id, container, feed, next, prev);
+}
function leniter() { return 6; }
function deciter(d) {
- var r={}; r.tup = 'iter';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? d.v[2].v : undefined;
- r.feed = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.next = d && d.v[4] ? d.v[4].v : undefined;
- r.prev = d && d.v[5] ? d.v[5].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'iter';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? d.v[2].v : undefined;
+ r.feed = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.next = d && d.v[4] ? d.v[4].v : undefined;
+ r.prev = d && d.v[5] ? d.v[5].v : undefined;
+ return clean(r);
+}
function enccontainer(d) {
- var tup = atom('container');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var top = 'top' in d && d.top ? number(d.top) : nil();
- var rear = 'rear' in d && d.rear ? number(d.rear) : nil();
- var count = 'count' in d && d.count ? number(d.count) : nil();
- return tuple(tup,id,top,rear,count); }
+ const tup = atom('container');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const top = 'top' in d && d.top ? number(d.top) : nil();
+ const rear = 'rear' in d && d.rear ? number(d.rear) : nil();
+ const count = 'count' in d && d.count ? number(d.count) : nil();
+ return tuple(tup, id, top, rear, count);
+}
function lencontainer() { return 5; }
function deccontainer(d) {
- var r={}; r.tup = 'container';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.top = d && d.v[2] ? d.v[2].v : undefined;
- r.rear = d && d.v[3] ? d.v[3].v : undefined;
- r.count = d && d.v[4] ? d.v[4].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'container';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.top = d && d.v[2] ? d.v[2].v : undefined;
+ r.rear = d && d.v[3] ? d.v[3].v : undefined;
+ r.count = d && d.v[4] ? d.v[4].v : undefined;
+ return clean(r);
+}
function enciterator(d) {
- var tup = atom('iterator');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var container = 'container' in d && d.container ? atom(d.container) : nil();
- var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var feeds = []; if ('feeds' in d && d.feeds)
- { d.feeds.forEach(function(x){
- feeds.push(encode(x))});
- feeds={t:108,v:feeds}; } else { feeds = nil() };
- return tuple(tup,id,container,feed_id,prev,next,feeds); }
+ const tup = atom('iterator');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const container = 'container' in d && d.container ? atom(d.container) : nil();
+ const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ let feeds = []; if ('feeds' in d && d.feeds) {
+ d.feeds.forEach((x) => {
+ feeds.push(encode(x));
+ });
+ feeds = { t: 108, v: feeds };
+ } else { feeds = nil(); }
+ return tuple(tup, id, container, feed_id, prev, next, feeds);
+}
function leniterator() { return 7; }
function deciterator(d) {
- var r={}; r.tup = 'iterator';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? d.v[2].v : undefined;
- r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.prev = d && d.v[4] ? d.v[4].v : undefined;
- r.next = d && d.v[5] ? d.v[5].v : undefined;
- r.feeds = [];
- (d && d.v[6] && d.v[6].v) ?
- d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) :
- r.feeds = undefined;
- return clean(r); }
+ const r = {}; r.tup = 'iterator';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? d.v[2].v : undefined;
+ r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.prev = d && d.v[4] ? d.v[4].v : undefined;
+ r.next = d && d.v[5] ? d.v[5].v : undefined;
+ r.feeds = [];
+ (d && d.v[6] && d.v[6].v) ?
+ d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) :
+ r.feeds = undefined;
+ return clean(r);
+}
function enclog(d) {
- var tup = atom('log');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var top = 'top' in d && d.top ? number(d.top) : nil();
- var rear = 'rear' in d && d.rear ? number(d.rear) : nil();
- var count = 'count' in d && d.count ? number(d.count) : nil();
- return tuple(tup,id,top,rear,count); }
+ const tup = atom('log');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const top = 'top' in d && d.top ? number(d.top) : nil();
+ const rear = 'rear' in d && d.rear ? number(d.rear) : nil();
+ const count = 'count' in d && d.count ? number(d.count) : nil();
+ return tuple(tup, id, top, rear, count);
+}
function lenlog() { return 5; }
function declog(d) {
- var r={}; r.tup = 'log';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.top = d && d.v[2] ? d.v[2].v : undefined;
- r.rear = d && d.v[3] ? d.v[3].v : undefined;
- r.count = d && d.v[4] ? d.v[4].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'log';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.top = d && d.v[2] ? d.v[2].v : undefined;
+ r.rear = d && d.v[3] ? d.v[3].v : undefined;
+ r.count = d && d.v[4] ? d.v[4].v : undefined;
+ return clean(r);
+}
function encoperation(d) {
- var tup = atom('operation');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var container = 'container' in d && d.container ? atom(d.container) : nil();
- var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var feeds = []; if ('feeds' in d && d.feeds)
- { d.feeds.forEach(function(x){
- feeds.push(encode(x))});
- feeds={t:108,v:feeds}; } else { feeds = nil() };
- return tuple(tup,id,container,feed_id,prev,next,feeds); }
+ const tup = atom('operation');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const container = 'container' in d && d.container ? atom(d.container) : nil();
+ const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ let feeds = []; if ('feeds' in d && d.feeds) {
+ d.feeds.forEach((x) => {
+ feeds.push(encode(x));
+ });
+ feeds = { t: 108, v: feeds };
+ } else { feeds = nil(); }
+ return tuple(tup, id, container, feed_id, prev, next, feeds);
+}
function lenoperation() { return 7; }
function decoperation(d) {
- var r={}; r.tup = 'operation';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? d.v[2].v : undefined;
- r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.prev = d && d.v[4] ? d.v[4].v : undefined;
- r.next = d && d.v[5] ? d.v[5].v : undefined;
- r.feeds = [];
- (d && d.v[6] && d.v[6].v) ?
- d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) :
- r.feeds = undefined;
- return clean(r); }
+ const r = {}; r.tup = 'operation';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? d.v[2].v : undefined;
+ r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.prev = d && d.v[4] ? d.v[4].v : undefined;
+ r.next = d && d.v[5] ? d.v[5].v : undefined;
+ r.feeds = [];
+ (d && d.v[6] && d.v[6].v) ?
+ d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) :
+ r.feeds = undefined;
+ return clean(r);
+}
function encchain(d) {
- var tup = atom('chain');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var top = 'top' in d && d.top ? number(d.top) : nil();
- var rear = 'rear' in d && d.rear ? number(d.rear) : nil();
- var count = 'count' in d && d.count ? number(d.count) : nil();
- return tuple(tup,id,top,rear,count); }
+ const tup = atom('chain');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const top = 'top' in d && d.top ? number(d.top) : nil();
+ const rear = 'rear' in d && d.rear ? number(d.rear) : nil();
+ const count = 'count' in d && d.count ? number(d.count) : nil();
+ return tuple(tup, id, top, rear, count);
+}
function lenchain() { return 5; }
function decchain(d) {
- var r={}; r.tup = 'chain';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.top = d && d.v[2] ? d.v[2].v : undefined;
- r.rear = d && d.v[3] ? d.v[3].v : undefined;
- r.count = d && d.v[4] ? d.v[4].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'chain';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.top = d && d.v[2] ? d.v[2].v : undefined;
+ r.rear = d && d.v[3] ? d.v[3].v : undefined;
+ r.count = d && d.v[4] ? d.v[4].v : undefined;
+ return clean(r);
+}
function encpush(d) {
- var tup = atom('push');
- var model = 'model' in d && d.model ? bin(d.model) : nil();
- var type = 'type' in d && d.type ? bin(d.type) : nil();
- var title = 'title' in d && d.title ? bin(d.title) : nil();
- var alert = 'alert' in d && d.alert ? bin(d.alert) : nil();
- var badge = 'badge' in d && d.badge ? number(d.badge) : nil();
- var sound = 'sound' in d && d.sound ? bin(d.sound) : nil();
- return tuple(tup,model,type,title,alert,badge,sound); }
+ const tup = atom('push');
+ const model = 'model' in d && d.model ? bin(d.model) : nil();
+ const type = 'type' in d && d.type ? bin(d.type) : nil();
+ const title = 'title' in d && d.title ? bin(d.title) : nil();
+ const alert = 'alert' in d && d.alert ? bin(d.alert) : nil();
+ const badge = 'badge' in d && d.badge ? number(d.badge) : nil();
+ const sound = 'sound' in d && d.sound ? bin(d.sound) : nil();
+ return tuple(tup, model, type, title, alert, badge, sound);
+}
function lenpush() { return 7; }
function decpush(d) {
- var r={}; r.tup = 'push';
- r.model = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.type = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.title = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.alert = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
- r.badge = d && d.v[5] ? d.v[5].v : undefined;
- r.sound = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'push';
+ r.model = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.type = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.title = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.alert = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
+ r.badge = d && d.v[5] ? d.v[5].v : undefined;
+ r.sound = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
+ return clean(r);
+}
function encSearch(d) {
- var tup = atom('Search');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var ref = 'ref' in d && d.ref ? bin(d.ref) : nil();
- var field = 'field' in d && d.field ? bin(d.field) : nil();
- var type = 'type' in d && d.type ? atom(d.type) : nil();
- var value = 'value' in d && d.value ? encode(d.value) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,id,ref,field,type,value,status); }
+ const tup = atom('Search');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const ref = 'ref' in d && d.ref ? bin(d.ref) : nil();
+ const field = 'field' in d && d.field ? bin(d.field) : nil();
+ const type = 'type' in d && d.type ? atom(d.type) : nil();
+ const value = 'value' in d && d.value ? encode(d.value) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(tup, id, ref, field, type, value, status);
+}
function lenSearch() { return 7; }
function decSearch(d) {
- var r={}; r.tup = 'Search';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.ref = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.field = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.type = d && d.v[4] ? decode(d.v[4]) : undefined;
- r.value = d && d.v[5] ? decode(d.v[5].v) : undefined;
- r.status = d && d.v[6] ? decode(d.v[6]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Search';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.ref = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.field = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.type = d && d.v[4] ? decode(d.v[4]) : undefined;
+ r.value = d && d.v[5] ? decode(d.v[5].v) : undefined;
+ r.status = d && d.v[6] ? decode(d.v[6]) : undefined;
+ return clean(r);
+}
function encp2p(d) {
- var tup = atom('p2p');
- var from = 'from' in d && d.from ? bin(d.from) : nil();
- var to = 'to' in d && d.to ? bin(d.to) : nil();
- return tuple(tup,from,to); }
+ const tup = atom('p2p');
+ const from = 'from' in d && d.from ? bin(d.from) : nil();
+ const to = 'to' in d && d.to ? bin(d.to) : nil();
+ return tuple(tup, from, to);
+}
function lenp2p() { return 3; }
function decp2p(d) {
- var r={}; r.tup = 'p2p';
- r.from = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.to = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'p2p';
+ r.from = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.to = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ return clean(r);
+}
function encmuc(d) {
- var tup = atom('muc');
- var name = 'name' in d && d.name ? bin(d.name) : nil();
- return tuple(tup,name); }
+ const tup = atom('muc');
+ const name = 'name' in d && d.name ? bin(d.name) : nil();
+ return tuple(tup, name);
+}
function lenmuc() { return 2; }
function decmuc(d) {
- var r={}; r.tup = 'muc';
- r.name = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'muc';
+ r.name = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ return clean(r);
+}
function encCDR(d) {
- var tup = atom('CDR');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var container = 'container' in d && d.container ? atom(d.container) : nil();
- var feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- var from = 'from' in d && d.from ? bin(d.from) : nil();
- var to = 'to' in d && d.to ? bin(d.to) : nil();
- var start = 'start' in d && d.start ? number(d.start) : nil();
- var stop = 'stop' in d && d.stop ? number(d.stop) : nil();
- var type = 'type' in d && d.type ? encode(d.type) : nil();
- var desc = 'desc' in d && d.desc ? bin(d.desc) : nil();
- var bill = 'bill' in d && d.bill ? number(d.bill) : nil();
- var tariff = 'tariff' in d && d.tariff ? bin(d.tariff) : nil();
- return tuple(tup,id,container,feed,next,prev,from,to,start,stop,type,
- desc,bill,tariff); }
+ const tup = atom('CDR');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const container = 'container' in d && d.container ? atom(d.container) : nil();
+ const feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ const from = 'from' in d && d.from ? bin(d.from) : nil();
+ const to = 'to' in d && d.to ? bin(d.to) : nil();
+ const start = 'start' in d && d.start ? number(d.start) : nil();
+ const stop = 'stop' in d && d.stop ? number(d.stop) : nil();
+ const type = 'type' in d && d.type ? encode(d.type) : nil();
+ const desc = 'desc' in d && d.desc ? bin(d.desc) : nil();
+ const bill = 'bill' in d && d.bill ? number(d.bill) : nil();
+ const tariff = 'tariff' in d && d.tariff ? bin(d.tariff) : nil();
+ return tuple(
+ tup, id, container, feed, next, prev, from, to, start, stop, type,
+ desc, bill, tariff
+ );
+}
function lenCDR() { return 14; }
function decCDR(d) {
- var r={}; r.tup = 'CDR';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? d.v[2].v : undefined;
- r.feed = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.next = d && d.v[4] ? d.v[4].v : undefined;
- r.prev = d && d.v[5] ? d.v[5].v : undefined;
- r.from = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
- r.to = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
- r.start = d && d.v[8] ? d.v[8].v : undefined;
- r.stop = d && d.v[9] ? d.v[9].v : undefined;
- r.type = d && d.v[10] ? decode(d.v[10]) : undefined;
- r.desc = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined;
- r.bill = d && d.v[12] ? d.v[12].v : undefined;
- r.tariff = d && d.v[13] ? utf8_dec(d.v[13].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'CDR';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? d.v[2].v : undefined;
+ r.feed = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.next = d && d.v[4] ? d.v[4].v : undefined;
+ r.prev = d && d.v[5] ? d.v[5].v : undefined;
+ r.from = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
+ r.to = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
+ r.start = d && d.v[8] ? d.v[8].v : undefined;
+ r.stop = d && d.v[9] ? d.v[9].v : undefined;
+ r.type = d && d.v[10] ? decode(d.v[10]) : undefined;
+ r.desc = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined;
+ r.bill = d && d.v[12] ? d.v[12].v : undefined;
+ r.tariff = d && d.v[13] ? utf8_dec(d.v[13].v) : undefined;
+ return clean(r);
+}
function encFeature(d) {
- var tup = atom('Feature');
- var id = 'id' in d && d.id ? bin(d.id) : nil();
- var key = 'key' in d && d.key ? bin(d.key) : nil();
- var value = 'value' in d && d.value ? bin(d.value) : nil();
- var group = 'group' in d && d.group ? bin(d.group) : nil();
- return tuple(tup,id,key,value,group); }
+ const tup = atom('Feature');
+ const id = 'id' in d && d.id ? bin(d.id) : nil();
+ const key = 'key' in d && d.key ? bin(d.key) : nil();
+ const value = 'value' in d && d.value ? bin(d.value) : nil();
+ const group = 'group' in d && d.group ? bin(d.group) : nil();
+ return tuple(tup, id, key, value, group);
+}
function lenFeature() { return 5; }
function decFeature(d) {
- var r={}; r.tup = 'Feature';
- r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.key = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.value = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.group = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Feature';
+ r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.key = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.value = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.group = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
+ return clean(r);
+}
function encMember(d) {
- var tup = atom('Member');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var container = 'container' in d && d.container ? encode(d.container) : nil();
- var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var feeds = []; if ('feeds' in d && d.feeds)
- { d.feeds.forEach(function(x){
- feeds.push(encode(x))});
- feeds={t:108,v:feeds}; } else { feeds = nil() };
- var phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil();
- var avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil();
- var names = 'names' in d && d.names ? bin(d.names) : nil();
- var surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil();
- var alias = 'alias' in d && d.alias ? bin(d.alias) : nil();
- var email = 'email' in d && d.email ? bin(d.email) : nil();
- var vox_id = 'vox_id' in d && d.vox_id ? bin(d.vox_id) : nil();
- var reader = 'reader' in d && d.reader ? number(d.reader) : nil();
- var update = 'update' in d && d.update ? number(d.update) : nil();
- var settings = []; if ('settings' in d && d.settings)
- { d.settings.forEach(function(x){
- settings.push(encode(x))});
- settings={t:108,v:settings}; } else { settings = nil() };
- var presence = 'presence' in d && d.presence ? atom(d.presence) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,id,container,feed_id,prev,next,feeds,phone_id,avatar,names,surnames,
- alias,email,vox_id,reader,update,settings,presence,status); }
+ const tup = atom('Member');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const container = 'container' in d && d.container ? encode(d.container) : nil();
+ const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ let feeds = []; if ('feeds' in d && d.feeds) {
+ d.feeds.forEach((x) => {
+ feeds.push(encode(x));
+ });
+ feeds = { t: 108, v: feeds };
+ } else { feeds = nil(); }
+ const phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil();
+ const avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil();
+ const names = 'names' in d && d.names ? bin(d.names) : nil();
+ const surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil();
+ const alias = 'alias' in d && d.alias ? bin(d.alias) : nil();
+ const email = 'email' in d && d.email ? bin(d.email) : nil();
+ const vox_id = 'vox_id' in d && d.vox_id ? bin(d.vox_id) : nil();
+ const reader = 'reader' in d && d.reader ? number(d.reader) : nil();
+ const update = 'update' in d && d.update ? number(d.update) : nil();
+ let settings = []; if ('settings' in d && d.settings) {
+ d.settings.forEach((x) => {
+ settings.push(encode(x));
+ });
+ settings = { t: 108, v: settings };
+ } else { settings = nil(); }
+ const presence = 'presence' in d && d.presence ? atom(d.presence) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(
+ tup, id, container, feed_id, prev, next, feeds, phone_id, avatar, names, surnames,
+ alias, email, vox_id, reader, update, settings, presence, status
+ );
+}
function lenMember() { return 19; }
function decMember(d) {
- var r={}; r.tup = 'Member';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? decode(d.v[2]) : undefined;
- r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined;
- r.prev = d && d.v[4] ? d.v[4].v : undefined;
- r.next = d && d.v[5] ? d.v[5].v : undefined;
- r.feeds = [];
- (d && d.v[6] && d.v[6].v) ?
- d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) :
- r.feeds = undefined;
- r.phone_id = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
- r.avatar = d && d.v[8] ? utf8_dec(d.v[8].v) : undefined;
- r.names = d && d.v[9] ? utf8_dec(d.v[9].v) : undefined;
- r.surnames = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined;
- r.alias = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined;
- r.email = d && d.v[12] ? utf8_dec(d.v[12].v) : undefined;
- r.vox_id = d && d.v[13] ? utf8_dec(d.v[13].v) : undefined;
- r.reader = d && d.v[14] ? d.v[14].v : undefined;
- r.update = d && d.v[15] ? d.v[15].v : undefined;
- r.settings = [];
- (d && d.v[16] && d.v[16].v) ?
- d.v[16].v.forEach(function(x){r.settings.push(decode(x))}) :
- r.settings = undefined;
- r.presence = d && d.v[17] ? decode(d.v[17]) : undefined;
- r.status = d && d.v[18] ? decode(d.v[18]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Member';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? decode(d.v[2]) : undefined;
+ r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined;
+ r.prev = d && d.v[4] ? d.v[4].v : undefined;
+ r.next = d && d.v[5] ? d.v[5].v : undefined;
+ r.feeds = [];
+ (d && d.v[6] && d.v[6].v) ?
+ d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) :
+ r.feeds = undefined;
+ r.phone_id = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
+ r.avatar = d && d.v[8] ? utf8_dec(d.v[8].v) : undefined;
+ r.names = d && d.v[9] ? utf8_dec(d.v[9].v) : undefined;
+ r.surnames = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined;
+ r.alias = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined;
+ r.email = d && d.v[12] ? utf8_dec(d.v[12].v) : undefined;
+ r.vox_id = d && d.v[13] ? utf8_dec(d.v[13].v) : undefined;
+ r.reader = d && d.v[14] ? d.v[14].v : undefined;
+ r.update = d && d.v[15] ? d.v[15].v : undefined;
+ r.settings = [];
+ (d && d.v[16] && d.v[16].v) ?
+ d.v[16].v.forEach((x) => { r.settings.push(decode(x)); }) :
+ r.settings = undefined;
+ r.presence = d && d.v[17] ? decode(d.v[17]) : undefined;
+ r.status = d && d.v[18] ? decode(d.v[18]) : undefined;
+ return clean(r);
+}
function encPerson(d) {
- var tup = atom('Person');
- var id = 'id' in d && d.id ? bin(d.id) : nil();
- var phonelist = []; if ('phonelist' in d && d.phonelist)
- { d.phonelist.forEach(function(x){
- phonelist.push(encode(x))});
- phonelist={t:108,v:phonelist}; } else { phonelist = nil() };
- var alias = []; if ('alias' in d && d.alias)
- { d.alias.forEach(function(x){
- alias.push(encode(x))});
- alias={t:108,v:alias}; } else { alias = nil() };
- var localize = []; if ('localize' in d && d.localize)
- { d.localize.forEach(function(x){
- localize.push(encode(x))});
- localize={t:108,v:localize}; } else { localize = nil() };
- var NotificationSettings = []; if ('NotificationSettings' in d && d.NotificationSettings)
- { d.NotificationSettings.forEach(function(x){
- NotificationSettings.push(encode(x))});
- NotificationSettings={t:108,v:NotificationSettings}; } else { NotificationSettings = nil() };
- var SoundSettings = []; if ('SoundSettings' in d && d.SoundSettings)
- { d.SoundSettings.forEach(function(x){
- SoundSettings.push(encode(x))});
- SoundSettings={t:108,v:SoundSettings}; } else { SoundSettings = nil() };
- var ThemeID = 'ThemeID' in d && d.ThemeID ? bin(d.ThemeID) : nil();
- var BlockUsers = []; if ('BlockUsers' in d && d.BlockUsers)
- { d.BlockUsers.forEach(function(x){
- BlockUsers.push(encode(x))});
- BlockUsers={t:108,v:BlockUsers}; } else { BlockUsers = nil() };
- var balance = 'balance' in d && d.balance ? number(d.balance) : nil();
- var isParticipants = []; if ('isParticipants' in d && d.isParticipants)
- { d.isParticipants.forEach(function(x){
- isParticipants.push(encode(x))});
- isParticipants={t:108,v:isParticipants}; } else { isParticipants = nil() };
- var status = 'status' in d && d.status ? encode(d.status) : nil();
- return tuple(tup,id,phonelist,alias,localize,NotificationSettings,SoundSettings,ThemeID,BlockUsers,balance,isParticipants,status); }
+ const tup = atom('Person');
+ const id = 'id' in d && d.id ? bin(d.id) : nil();
+ let phonelist = []; if ('phonelist' in d && d.phonelist) {
+ d.phonelist.forEach((x) => {
+ phonelist.push(encode(x));
+ });
+ phonelist = { t: 108, v: phonelist };
+ } else { phonelist = nil(); }
+ let alias = []; if ('alias' in d && d.alias) {
+ d.alias.forEach((x) => {
+ alias.push(encode(x));
+ });
+ alias = { t: 108, v: alias };
+ } else { alias = nil(); }
+ let localize = []; if ('localize' in d && d.localize) {
+ d.localize.forEach((x) => {
+ localize.push(encode(x));
+ });
+ localize = { t: 108, v: localize };
+ } else { localize = nil(); }
+ let NotificationSettings = []; if ('NotificationSettings' in d && d.NotificationSettings) {
+ d.NotificationSettings.forEach((x) => {
+ NotificationSettings.push(encode(x));
+ });
+ NotificationSettings = { t: 108, v: NotificationSettings };
+ } else { NotificationSettings = nil(); }
+ let SoundSettings = []; if ('SoundSettings' in d && d.SoundSettings) {
+ d.SoundSettings.forEach((x) => {
+ SoundSettings.push(encode(x));
+ });
+ SoundSettings = { t: 108, v: SoundSettings };
+ } else { SoundSettings = nil(); }
+ const ThemeID = 'ThemeID' in d && d.ThemeID ? bin(d.ThemeID) : nil();
+ let BlockUsers = []; if ('BlockUsers' in d && d.BlockUsers) {
+ d.BlockUsers.forEach((x) => {
+ BlockUsers.push(encode(x));
+ });
+ BlockUsers = { t: 108, v: BlockUsers };
+ } else { BlockUsers = nil(); }
+ const balance = 'balance' in d && d.balance ? number(d.balance) : nil();
+ let isParticipants = []; if ('isParticipants' in d && d.isParticipants) {
+ d.isParticipants.forEach((x) => {
+ isParticipants.push(encode(x));
+ });
+ isParticipants = { t: 108, v: isParticipants };
+ } else { isParticipants = nil(); }
+ const status = 'status' in d && d.status ? encode(d.status) : nil();
+ return tuple(tup, id, phonelist, alias, localize, NotificationSettings, SoundSettings, ThemeID, BlockUsers, balance, isParticipants, status);
+}
function lenPerson() { return 12; }
function decPerson(d) {
- var r={}; r.tup = 'Person';
- r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.phonelist = [];
- (d && d.v[2] && d.v[2].v) ?
- d.v[2].v.forEach(function(x){r.phonelist.push(decode(x))}) :
- r.phonelist = undefined;
- r.alias = [];
- (d && d.v[3] && d.v[3].v) ?
- d.v[3].v.forEach(function(x){r.alias.push(decode(x))}) :
- r.alias = undefined;
- r.localize = [];
- (d && d.v[4] && d.v[4].v) ?
- d.v[4].v.forEach(function(x){r.localize.push(decode(x))}) :
- r.localize = undefined;
- r.NotificationSettings = [];
- (d && d.v[5] && d.v[5].v) ?
- d.v[5].v.forEach(function(x){r.NotificationSettings.push(decode(x))}) :
- r.NotificationSettings = undefined;
- r.SoundSettings = [];
- (d && d.v[6] && d.v[6].v) ?
- d.v[6].v.forEach(function(x){r.SoundSettings.push(decode(x))}) :
- r.SoundSettings = undefined;
- r.ThemeID = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
- r.BlockUsers = [];
- (d && d.v[8] && d.v[8].v) ?
- d.v[8].v.forEach(function(x){r.BlockUsers.push(decode(x))}) :
- r.BlockUsers = undefined;
- r.balance = d && d.v[9] ? d.v[9].v : undefined;
- r.isParticipants = [];
- (d && d.v[10] && d.v[10].v) ?
- d.v[10].v.forEach(function(x){r.isParticipants.push(decode(x))}) :
- r.isParticipants = undefined;
- r.status = d && d.v[11] ? decode(d.v[11]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Person';
+ r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.phonelist = [];
+ (d && d.v[2] && d.v[2].v) ?
+ d.v[2].v.forEach((x) => { r.phonelist.push(decode(x)); }) :
+ r.phonelist = undefined;
+ r.alias = [];
+ (d && d.v[3] && d.v[3].v) ?
+ d.v[3].v.forEach((x) => { r.alias.push(decode(x)); }) :
+ r.alias = undefined;
+ r.localize = [];
+ (d && d.v[4] && d.v[4].v) ?
+ d.v[4].v.forEach((x) => { r.localize.push(decode(x)); }) :
+ r.localize = undefined;
+ r.NotificationSettings = [];
+ (d && d.v[5] && d.v[5].v) ?
+ d.v[5].v.forEach((x) => { r.NotificationSettings.push(decode(x)); }) :
+ r.NotificationSettings = undefined;
+ r.SoundSettings = [];
+ (d && d.v[6] && d.v[6].v) ?
+ d.v[6].v.forEach((x) => { r.SoundSettings.push(decode(x)); }) :
+ r.SoundSettings = undefined;
+ r.ThemeID = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
+ r.BlockUsers = [];
+ (d && d.v[8] && d.v[8].v) ?
+ d.v[8].v.forEach((x) => { r.BlockUsers.push(decode(x)); }) :
+ r.BlockUsers = undefined;
+ r.balance = d && d.v[9] ? d.v[9].v : undefined;
+ r.isParticipants = [];
+ (d && d.v[10] && d.v[10].v) ?
+ d.v[10].v.forEach((x) => { r.isParticipants.push(decode(x)); }) :
+ r.isParticipants = undefined;
+ r.status = d && d.v[11] ? decode(d.v[11]) : undefined;
+ return clean(r);
+}
function encDesc(d) {
- var tup = atom('Desc');
- var id = 'id' in d && d.id ? bin(d.id) : nil();
- var mime = 'mime' in d && d.mime ? bin(d.mime) : nil();
- var payload = 'payload' in d && d.payload ? bin(d.payload) : nil();
- var size = 'size' in d && d.size ? number(d.size) : nil();
- var filename = 'filename' in d && d.filename ? bin(d.filename) : nil();
- var info = 'info' in d && d.info ? bin(d.info) : nil();
- return tuple(tup,id,mime,payload,size,filename,info); }
+ const tup = atom('Desc');
+ const id = 'id' in d && d.id ? bin(d.id) : nil();
+ const mime = 'mime' in d && d.mime ? bin(d.mime) : nil();
+ const payload = 'payload' in d && d.payload ? bin(d.payload) : nil();
+ const size = 'size' in d && d.size ? number(d.size) : nil();
+ const filename = 'filename' in d && d.filename ? bin(d.filename) : nil();
+ const info = 'info' in d && d.info ? bin(d.info) : nil();
+ return tuple(tup, id, mime, payload, size, filename, info);
+}
function lenDesc() { return 7; }
function decDesc(d) {
- var r={}; r.tup = 'Desc';
- r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.mime = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.payload = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.size = d && d.v[4] ? d.v[4].v : undefined;
- r.filename = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
- r.info = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Desc';
+ r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.mime = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.payload = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.size = d && d.v[4] ? d.v[4].v : undefined;
+ r.filename = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
+ r.info = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
+ return clean(r);
+}
function encMessage(d) {
- var tup = atom('Message');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- //@TODO: CRASHED ANDROID VERSION
- //var container = 'container' in d && d.container ? encode(d.container) : nil();
- var container = 'container' in d && d.container ? atom(d.container) : nil();
- var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var msg_id = 'msg_id' in d && d.msg_id ? bin(d.msg_id) : nil();
- var from = 'from' in d && d.from ? bin(d.from) : nil();
- var to = 'to' in d && d.to ? bin(d.to) : nil();
- var created = 'created' in d && d.created ? encode(d.created) : nil();
- var files = []; if ('files' in d && d.files)
- { d.files.forEach(function(x){
- files.push(encode(x))});
- files={t:108,v:files}; } else { files = nil() };
- var type = 'type' in d && d.type ? encode(d.type) : nil();
- var link = 'link' in d && d.link ? number(d.link) : nil();
- var seenby = []; if ('seenby' in d && d.seenby)
- { d.seenby.forEach(function(x){
- seenby.push(encode(x))});
- seenby={t:108,v:seenby}; } else { seenby = nil() };
- var repliedby = []; if ('repliedby' in d && d.repliedby)
- { d.repliedby.forEach(function(x){
- repliedby.push(encode(x))});
- repliedby={t:108,v:repliedby}; } else { repliedby = nil() };
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,id,container,feed_id,prev,next,msg_id,from,to,created,files,
- type,link,seenby,repliedby,status); }
+ const tup = atom('Message');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ // @TODO: CRASHED ANDROID VERSION
+ // var container = 'container' in d && d.container ? encode(d.container) : nil();
+ const container = 'container' in d && d.container ? atom(d.container) : nil();
+ const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ const msg_id = 'msg_id' in d && d.msg_id ? bin(d.msg_id) : nil();
+ const from = 'from' in d && d.from ? bin(d.from) : nil();
+ const to = 'to' in d && d.to ? bin(d.to) : nil();
+ const created = 'created' in d && d.created ? encode(d.created) : nil();
+ let files = []; if ('files' in d && d.files) {
+ d.files.forEach((x) => {
+ files.push(encode(x));
+ });
+ files = { t: 108, v: files };
+ } else { files = nil(); }
+ const type = 'type' in d && d.type ? encode(d.type) : nil();
+ const link = 'link' in d && d.link ? number(d.link) : nil();
+ let seenby = []; if ('seenby' in d && d.seenby) {
+ d.seenby.forEach((x) => {
+ seenby.push(encode(x));
+ });
+ seenby = { t: 108, v: seenby };
+ } else { seenby = nil(); }
+ let repliedby = []; if ('repliedby' in d && d.repliedby) {
+ d.repliedby.forEach((x) => {
+ repliedby.push(encode(x));
+ });
+ repliedby = { t: 108, v: repliedby };
+ } else { repliedby = nil(); }
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(
+ tup, id, container, feed_id, prev, next, msg_id, from, to, created, files,
+ type, link, seenby, repliedby, status
+ );
+}
function lenMessage() { return 16; }
function decMessage(d) {
- var r={}; r.tup = 'Message';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? decode(d.v[2]) : undefined;
- r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined;
- r.prev = d && d.v[4] ? d.v[4].v : undefined;
- r.next = d && d.v[5] ? d.v[5].v : undefined;
- r.msg_id = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
- r.from = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
- r.to = d && d.v[8] ? utf8_dec(d.v[8].v) : undefined;
- r.created = d && d.v[9] ? decode(d.v[9]) : undefined;
- r.files = [];
- (d && d.v[10] && d.v[10].v) ?
- d.v[10].v.forEach(function(x){r.files.push(decode(x))}) :
- r.files = undefined;
- r.type = d && d.v[11] ? decode(d.v[11]) : undefined;
- r.link = d && d.v[12] ? d.v[12].v : undefined;
- r.seenby = [];
- (d && d.v[13] && d.v[13].v) ?
- d.v[13].v.forEach(function(x){r.seenby.push(decode(x))}) :
- r.seenby = undefined;
- r.repliedby = [];
- (d && d.v[14] && d.v[14].v) ?
- d.v[14].v.forEach(function(x){r.repliedby.push(decode(x))}) :
- r.repliedby = undefined;
- r.status = d && d.v[15] ? decode(d.v[15]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Message';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? decode(d.v[2]) : undefined;
+ r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined;
+ r.prev = d && d.v[4] ? d.v[4].v : undefined;
+ r.next = d && d.v[5] ? d.v[5].v : undefined;
+ r.msg_id = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
+ r.from = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
+ r.to = d && d.v[8] ? utf8_dec(d.v[8].v) : undefined;
+ r.created = d && d.v[9] ? decode(d.v[9]) : undefined;
+ r.files = [];
+ (d && d.v[10] && d.v[10].v) ?
+ d.v[10].v.forEach((x) => { r.files.push(decode(x)); }) :
+ r.files = undefined;
+ r.type = d && d.v[11] ? decode(d.v[11]) : undefined;
+ r.link = d && d.v[12] ? d.v[12].v : undefined;
+ r.seenby = [];
+ (d && d.v[13] && d.v[13].v) ?
+ d.v[13].v.forEach((x) => { r.seenby.push(decode(x)); }) :
+ r.seenby = undefined;
+ r.repliedby = [];
+ (d && d.v[14] && d.v[14].v) ?
+ d.v[14].v.forEach((x) => { r.repliedby.push(decode(x)); }) :
+ r.repliedby = undefined;
+ r.status = d && d.v[15] ? decode(d.v[15]) : undefined;
+ return clean(r);
+}
function encRoom(d) {
- var tup = atom('Room');
- var id = 'id' in d && d.id ? bin(d.id) : nil();
- var name = 'name' in d && d.name ? bin(d.name) : nil();
- var description = 'description' in d && d.description ? bin(d.description) : nil();
- var settings = []; if ('settings' in d && d.settings)
- { d.settings.forEach(function(x){
- settings.push(encode(x))});
- settings={t:108,v:settings}; } else { settings = nil() };
- var members = []; if ('members' in d && d.members)
- { d.members.forEach(function(x){
- members.push(encode(x))});
- members={t:108,v:members}; } else { members = nil() };
- var admins = []; if ('admins' in d && d.admins)
- { d.admins.forEach(function(x){
- admins.push(encode(x))});
- admins={t:108,v:admins}; } else { admins = nil() };
- var data = []; if ('data' in d && d.data)
- { d.data.forEach(function(x){
- data.push(encode(x))});
- data={t:108,v:data}; } else { data = nil() };
- var type = 'type' in d && d.type ? encode(d.type) : nil();
- var tos = 'tos' in d && d.tos ? bin(d.tos) : nil();
- var tos_update = 'tos_update' in d && d.tos_update ? number(d.tos_update) : nil();
- var unread = 'unread' in d && d.unread ? number(d.unread) : nil();
- var readers = []; if ('readers' in d && d.readers)
- { d.readers.forEach(function(x){
- readers.push(encode(x))});
- readers={t:108,v:readers}; } else { readers = nil() };
- var last_msg = 'last_msg' in d && d.last_msg ? encode(d.last_msg) : nil();
- var update = 'update' in d && d.update ? number(d.update) : nil();
- var created = 'created' in d && d.created ? number(d.created) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,id,name,description,settings,members,admins,data,type,tos,tos_update,
- unread,readers,last_msg,update,created,status); }
+ const tup = atom('Room');
+ const id = 'id' in d && d.id ? bin(d.id) : nil();
+ const name = 'name' in d && d.name ? bin(d.name) : nil();
+ const description = 'description' in d && d.description ? bin(d.description) : nil();
+ let settings = []; if ('settings' in d && d.settings) {
+ d.settings.forEach((x) => {
+ settings.push(encode(x));
+ });
+ settings = { t: 108, v: settings };
+ } else { settings = nil(); }
+ let members = []; if ('members' in d && d.members) {
+ d.members.forEach((x) => {
+ members.push(encode(x));
+ });
+ members = { t: 108, v: members };
+ } else { members = nil(); }
+ let admins = []; if ('admins' in d && d.admins) {
+ d.admins.forEach((x) => {
+ admins.push(encode(x));
+ });
+ admins = { t: 108, v: admins };
+ } else { admins = nil(); }
+ let data = []; if ('data' in d && d.data) {
+ d.data.forEach((x) => {
+ data.push(encode(x));
+ });
+ data = { t: 108, v: data };
+ } else { data = nil(); }
+ const type = 'type' in d && d.type ? encode(d.type) : nil();
+ const tos = 'tos' in d && d.tos ? bin(d.tos) : nil();
+ const tos_update = 'tos_update' in d && d.tos_update ? number(d.tos_update) : nil();
+ const unread = 'unread' in d && d.unread ? number(d.unread) : nil();
+ let readers = []; if ('readers' in d && d.readers) {
+ d.readers.forEach((x) => {
+ readers.push(encode(x));
+ });
+ readers = { t: 108, v: readers };
+ } else { readers = nil(); }
+ const last_msg = 'last_msg' in d && d.last_msg ? encode(d.last_msg) : nil();
+ const update = 'update' in d && d.update ? number(d.update) : nil();
+ const created = 'created' in d && d.created ? number(d.created) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(
+ tup, id, name, description, settings, members, admins, data, type, tos, tos_update,
+ unread, readers, last_msg, update, created, status
+ );
+}
function lenRoom() { return 17; }
function decRoom(d) {
- var r={}; r.tup = 'Room';
- r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.description = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.settings = [];
- (d && d.v[4] && d.v[4].v) ?
- d.v[4].v.forEach(function(x){r.settings.push(decode(x))}) :
- r.settings = undefined;
- r.members = [];
- (d && d.v[5] && d.v[5].v) ?
- d.v[5].v.forEach(function(x){r.members.push(decode(x))}) :
- r.members = undefined;
- r.admins = [];
- (d && d.v[6] && d.v[6].v) ?
- d.v[6].v.forEach(function(x){r.admins.push(decode(x))}) :
- r.admins = undefined;
- r.data = [];
- (d && d.v[7] && d.v[7].v) ?
- d.v[7].v.forEach(function(x){r.data.push(decode(x))}) :
- r.data = undefined;
- r.type = d && d.v[8] ? decode(d.v[8]) : undefined;
- r.tos = d && d.v[9] ? utf8_dec(d.v[9].v) : undefined;
- r.tos_update = d && d.v[10] ? d.v[10].v : undefined;
- r.unread = d && d.v[11] ? d.v[11].v : undefined;
- r.readers = [];
- (d && d.v[12] && d.v[12].v) ?
- d.v[12].v.forEach(function(x){r.readers.push(decode(x))}) :
- r.readers = undefined;
- r.last_msg = d && d.v[13] ? decode(d.v[13]) : undefined;
- r.update = d && d.v[14] ? d.v[14].v : undefined;
- r.created = d && d.v[15] ? d.v[15].v : undefined;
- r.status = d && d.v[16] ? decode(d.v[16]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Room';
+ r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.description = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.settings = [];
+ (d && d.v[4] && d.v[4].v) ?
+ d.v[4].v.forEach((x) => { r.settings.push(decode(x)); }) :
+ r.settings = undefined;
+ r.members = [];
+ (d && d.v[5] && d.v[5].v) ?
+ d.v[5].v.forEach((x) => { r.members.push(decode(x)); }) :
+ r.members = undefined;
+ r.admins = [];
+ (d && d.v[6] && d.v[6].v) ?
+ d.v[6].v.forEach((x) => { r.admins.push(decode(x)); }) :
+ r.admins = undefined;
+ r.data = [];
+ (d && d.v[7] && d.v[7].v) ?
+ d.v[7].v.forEach((x) => { r.data.push(decode(x)); }) :
+ r.data = undefined;
+ r.type = d && d.v[8] ? decode(d.v[8]) : undefined;
+ r.tos = d && d.v[9] ? utf8_dec(d.v[9].v) : undefined;
+ r.tos_update = d && d.v[10] ? d.v[10].v : undefined;
+ r.unread = d && d.v[11] ? d.v[11].v : undefined;
+ r.readers = [];
+ (d && d.v[12] && d.v[12].v) ?
+ d.v[12].v.forEach((x) => { r.readers.push(decode(x)); }) :
+ r.readers = undefined;
+ r.last_msg = d && d.v[13] ? decode(d.v[13]) : undefined;
+ r.update = d && d.v[14] ? d.v[14].v : undefined;
+ r.created = d && d.v[15] ? d.v[15].v : undefined;
+ r.status = d && d.v[16] ? decode(d.v[16]) : undefined;
+ return clean(r);
+}
function encTag(d) {
- var tup = atom('Tag');
- var roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil();
- var name = 'name' in d && d.name ? bin(d.name) : nil();
- var color = 'color' in d && d.color ? bin(d.color) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,roster_id,name,color,status); }
+ const tup = atom('Tag');
+ const roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil();
+ const name = 'name' in d && d.name ? bin(d.name) : nil();
+ const color = 'color' in d && d.color ? bin(d.color) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(tup, roster_id, name, color, status);
+}
function lenTag() { return 5; }
function decTag(d) {
- var r={}; r.tup = 'Tag';
- r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.color = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.status = d && d.v[4] ? decode(d.v[4]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Tag';
+ r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.color = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.status = d && d.v[4] ? decode(d.v[4]) : undefined;
+ return clean(r);
+}
function encStar(d) {
- var tup = atom('Star');
- var roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil();
- var message = 'message' in d && d.message ? encode(d.message) : nil();
- var tags = []; if ('tags' in d && d.tags)
- { d.tags.forEach(function(x){
- tags.push(encode(x))});
- tags={t:108,v:tags}; } else { tags = nil() };
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,roster_id,message,tags,status); }
+ const tup = atom('Star');
+ const roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil();
+ const message = 'message' in d && d.message ? encode(d.message) : nil();
+ let tags = []; if ('tags' in d && d.tags) {
+ d.tags.forEach((x) => {
+ tags.push(encode(x));
+ });
+ tags = { t: 108, v: tags };
+ } else { tags = nil(); }
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(tup, roster_id, message, tags, status);
+}
function lenStar() { return 5; }
function decStar(d) {
- var r={}; r.tup = 'Star';
- r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.message = d && d.v[2] ? decode(d.v[2]) : undefined;
- r.tags = [];
- (d && d.v[3] && d.v[3].v) ?
- d.v[3].v.forEach(function(x){r.tags.push(decode(x))}) :
- r.tags = undefined;
- r.status = d && d.v[4] ? decode(d.v[4]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Star';
+ r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.message = d && d.v[2] ? decode(d.v[2]) : undefined;
+ r.tags = [];
+ (d && d.v[3] && d.v[3].v) ?
+ d.v[3].v.forEach((x) => { r.tags.push(decode(x)); }) :
+ r.tags = undefined;
+ r.status = d && d.v[4] ? decode(d.v[4]) : undefined;
+ return clean(r);
+}
function encHistory(d) {
- var tup = atom('History');
- var roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil();
- var feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
- var size = 'size' in d && d.size ? number(d.size) : nil();
- var entity_id = 'entity_id' in d && d.entity_id ? number(d.entity_id) : nil();
- var data = []; if ('data' in d && d.data)
- { d.data.forEach(function(x){
- data.push(encode(x))});
- data={t:108,v:data}; } else { data = nil() };
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,roster_id,feed,size,entity_id,data,status); }
+ const tup = atom('History');
+ const roster_id = 'roster_id' in d && d.roster_id ? bin(d.roster_id) : nil();
+ const feed = 'feed' in d && d.feed ? encode(d.feed) : nil();
+ const size = 'size' in d && d.size ? number(d.size) : nil();
+ const entity_id = 'entity_id' in d && d.entity_id ? number(d.entity_id) : nil();
+ let data = []; if ('data' in d && d.data) {
+ d.data.forEach((x) => {
+ data.push(encode(x));
+ });
+ data = { t: 108, v: data };
+ } else { data = nil(); }
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(tup, roster_id, feed, size, entity_id, data, status);
+}
function lenHistory() { return 7; }
function decHistory(d) {
- var r={}; r.tup = 'History';
- r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.feed = d && d.v[2] ? decode(d.v[2]) : undefined;
- r.size = d && d.v[3] ? d.v[3].v : undefined;
- r.entity_id = d && d.v[4] ? d.v[4].v : undefined;
- r.data = [];
- (d && d.v[5] && d.v[5].v) ?
- d.v[5].v.forEach(function(x){r.data.push(decode(x))}) :
- r.data = undefined;
- r.status = d && d.v[6] ? decode(d.v[6]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'History';
+ r.roster_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.feed = d && d.v[2] ? decode(d.v[2]) : undefined;
+ r.size = d && d.v[3] ? d.v[3].v : undefined;
+ r.entity_id = d && d.v[4] ? d.v[4].v : undefined;
+ r.data = [];
+ (d && d.v[5] && d.v[5].v) ?
+ d.v[5].v.forEach((x) => { r.data.push(decode(x)); }) :
+ r.data = undefined;
+ r.status = d && d.v[6] ? decode(d.v[6]) : undefined;
+ return clean(r);
+}
function encTyping(d) {
- var tup = atom('Typing');
- var phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil();
- var comments = 'comments' in d && d.comments ? encode(d.comments) : nil();
- return tuple(tup,phone_id,comments); }
+ const tup = atom('Typing');
+ const phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil();
+ const comments = 'comments' in d && d.comments ? encode(d.comments) : nil();
+ return tuple(tup, phone_id, comments);
+}
function lenTyping() { return 3; }
function decTyping(d) {
- var r={}; r.tup = 'Typing';
- r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.comments = d && d.v[2] ? decode(d.v[2].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Typing';
+ r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.comments = d && d.v[2] ? decode(d.v[2].v) : undefined;
+ return clean(r);
+}
function encContact(d) {
- var tup = atom('Contact');
- var phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil();
- var avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil();
- var names = 'names' in d && d.names ? bin(d.names) : nil();
- var surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil();
- var nick = 'nick' in d && d.nick ? bin(d.nick) : nil();
- var email = 'email' in d && d.email ? bin(d.email) : nil();
- var vox_id = 'vox_id' in d && d.vox_id ? bin(d.vox_id) : nil();
- var reader = 'reader' in d && d.reader ? number(d.reader) : nil();
- var unread = 'unread' in d && d.unread ? number(d.unread) : nil();
- var last_msg = 'last_msg' in d && d.last_msg ? encode(d.last_msg) : nil();
- var update = 'update' in d && d.update ? number(d.update) : nil();
- var settings = []; if ('settings' in d && d.settings)
- { d.settings.forEach(function(x){
- settings.push(encode(x))});
- settings={t:108,v:settings}; } else { settings = nil() };
- var presence = 'presence' in d && d.presence ? atom(d.presence) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,phone_id,avatar,names,surnames,nick,email,vox_id,reader,unread,last_msg,
- update,settings,presence,status); }
+ const tup = atom('Contact');
+ const phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil();
+ const avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil();
+ const names = 'names' in d && d.names ? bin(d.names) : nil();
+ const surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil();
+ const nick = 'nick' in d && d.nick ? bin(d.nick) : nil();
+ const email = 'email' in d && d.email ? bin(d.email) : nil();
+ const vox_id = 'vox_id' in d && d.vox_id ? bin(d.vox_id) : nil();
+ const reader = 'reader' in d && d.reader ? number(d.reader) : nil();
+ const unread = 'unread' in d && d.unread ? number(d.unread) : nil();
+ const last_msg = 'last_msg' in d && d.last_msg ? encode(d.last_msg) : nil();
+ const update = 'update' in d && d.update ? number(d.update) : nil();
+ let settings = []; if ('settings' in d && d.settings) {
+ d.settings.forEach((x) => {
+ settings.push(encode(x));
+ });
+ settings = { t: 108, v: settings };
+ } else { settings = nil(); }
+ const presence = 'presence' in d && d.presence ? atom(d.presence) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(
+ tup, phone_id, avatar, names, surnames, nick, email, vox_id, reader, unread, last_msg,
+ update, settings, presence, status
+ );
+}
function lenContact() { return 15; }
function decContact(d) {
- var r={}; r.tup = 'Contact';
- r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.avatar = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.names = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.surnames = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
- r.nick = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
- r.email = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
- r.vox_id = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
- r.reader = d && d.v[8] ? d.v[8].v : undefined;
- r.unread = d && d.v[9] ? d.v[9].v : undefined;
- r.last_msg = d && d.v[10] ? decode(d.v[10]) : undefined;
- r.update = d && d.v[11] ? d.v[11].v : undefined;
- r.settings = [];
- (d && d.v[12] && d.v[12].v) ?
- d.v[12].v.forEach(function(x){r.settings.push(decode(x))}) :
- r.settings = undefined;
- r.presence = d && d.v[13] ? d.v[13].v : undefined;
- r.status = d && d.v[14] ? decode(d.v[14]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Contact';
+ r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.avatar = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.names = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.surnames = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
+ r.nick = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
+ r.email = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
+ r.vox_id = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
+ r.reader = d && d.v[8] ? d.v[8].v : undefined;
+ r.unread = d && d.v[9] ? d.v[9].v : undefined;
+ r.last_msg = d && d.v[10] ? decode(d.v[10]) : undefined;
+ r.update = d && d.v[11] ? d.v[11].v : undefined;
+ r.settings = [];
+ (d && d.v[12] && d.v[12].v) ?
+ d.v[12].v.forEach((x) => { r.settings.push(decode(x)); }) :
+ r.settings = undefined;
+ r.presence = d && d.v[13] ? d.v[13].v : undefined;
+ r.status = d && d.v[14] ? decode(d.v[14]) : undefined;
+ return clean(r);
+}
function encAuth(d) {
- var tup = atom('Auth');
- var client_id = 'client_id' in d && d.client_id ? bin(d.client_id) : nil();
- var dev_key = 'dev_key' in d && d.dev_key ? bin(d.dev_key) : nil();
- var user_id = 'user_id' in d && d.user_id ? bin(d.user_id) : nil();
- var phone = 'phone' in d && d.phone ? bin(d.phone) : nil();
- var token = 'token' in d && d.token ? bin(d.token) : nil();
- var type = 'type' in d && d.type ? atom(d.type) : nil();
- var sms_code = 'sms_code' in d && d.sms_code ? bin(d.sms_code) : nil();
- var attempts = 'attempts' in d && d.attempts ? number(d.attempts) : nil();
- var services = []; if ('services' in d && d.services)
- { d.services.forEach(function(x){
- services.push(encode(x))});
- services={t:108,v:services}; } else { services = nil() };
- var push = 'push' in d && d.push ? bin(d.push) : nil();
- var os = 'os' in d && d.os ? encode(d.os) : nil();
- var created = 'created' in d && d.created ? encode(d.created) : nil();
- var last_online = 'last_online' in d && d.last_online ? number(d.last_online) : nil();
- return tuple(tup,client_id,dev_key,user_id,phone,token,type,sms_code,attempts,services,push,
- os,created,last_online); }
+ const tup = atom('Auth');
+ const client_id = 'client_id' in d && d.client_id ? bin(d.client_id) : nil();
+ const dev_key = 'dev_key' in d && d.dev_key ? bin(d.dev_key) : nil();
+ const user_id = 'user_id' in d && d.user_id ? bin(d.user_id) : nil();
+ const phone = 'phone' in d && d.phone ? bin(d.phone) : nil();
+ const token = 'token' in d && d.token ? bin(d.token) : nil();
+ const type = 'type' in d && d.type ? atom(d.type) : nil();
+ const sms_code = 'sms_code' in d && d.sms_code ? bin(d.sms_code) : nil();
+ const attempts = 'attempts' in d && d.attempts ? number(d.attempts) : nil();
+ let services = []; if ('services' in d && d.services) {
+ d.services.forEach((x) => {
+ services.push(encode(x));
+ });
+ services = { t: 108, v: services };
+ } else { services = nil(); }
+ const push = 'push' in d && d.push ? bin(d.push) : nil();
+ const os = 'os' in d && d.os ? encode(d.os) : nil();
+ const created = 'created' in d && d.created ? encode(d.created) : nil();
+ const last_online = 'last_online' in d && d.last_online ? number(d.last_online) : nil();
+ return tuple(
+ tup, client_id, dev_key, user_id, phone, token, type, sms_code, attempts, services, push,
+ os, created, last_online
+ );
+}
function lenAuth() { return 14; }
function decAuth(d) {
- var r={}; r.tup = 'Auth';
- r.client_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.dev_key = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.user_id = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.phone = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
- r.token = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
- r.type = d && d.v[6] ? d.v[6].v : undefined;
- r.sms_code = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
- r.attempts = d && d.v[8] ? d.v[8].v : undefined;
- r.services = [];
- (d && d.v[9] && d.v[9].v) ?
- d.v[9].v.forEach(function(x){r.services.push(decode(x))}) :
- r.services = undefined;
- r.push = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined;
- r.os = d && d.v[11] ? decode(d.v[11]) : undefined;
- r.created = d && d.v[12] ? decode(d.v[12]) : undefined;
- r.last_online = d && d.v[13] ? d.v[13].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Auth';
+ r.client_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.dev_key = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.user_id = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.phone = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
+ r.token = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
+ r.type = d && d.v[6] ? d.v[6].v : undefined;
+ r.sms_code = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
+ r.attempts = d && d.v[8] ? d.v[8].v : undefined;
+ r.services = [];
+ (d && d.v[9] && d.v[9].v) ?
+ d.v[9].v.forEach((x) => { r.services.push(decode(x)); }) :
+ r.services = undefined;
+ r.push = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined;
+ r.os = d && d.v[11] ? decode(d.v[11]) : undefined;
+ r.created = d && d.v[12] ? decode(d.v[12]) : undefined;
+ r.last_online = d && d.v[13] ? d.v[13].v : undefined;
+ return clean(r);
+}
function encService(d) {
- var tup = atom('Service');
- var id = 'id' in d && d.id ? bin(d.id) : nil();
- var type = 'type' in d && d.type ? atom(d.type) : nil();
- var data = 'data' in d && d.data ? encode(d.data) : nil();
- var login = 'login' in d && d.login ? bin(d.login) : nil();
- var password = 'password' in d && d.password ? bin(d.password) : nil();
- var expiration = 'expiration' in d && d.expiration ? number(d.expiration) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,id,type,data,login,password,expiration,status); }
+ const tup = atom('Service');
+ const id = 'id' in d && d.id ? bin(d.id) : nil();
+ const type = 'type' in d && d.type ? atom(d.type) : nil();
+ const data = 'data' in d && d.data ? encode(d.data) : nil();
+ const login = 'login' in d && d.login ? bin(d.login) : nil();
+ const password = 'password' in d && d.password ? bin(d.password) : nil();
+ const expiration = 'expiration' in d && d.expiration ? number(d.expiration) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(tup, id, type, data, login, password, expiration, status);
+}
function lenService() { return 8; }
function decService(d) {
- var r={}; r.tup = 'Service';
- r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.type = d && d.v[2] ? decode(d.v[2]) : undefined;
- r.data = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.login = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
- r.password = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
- r.expiration = d && d.v[6] ? d.v[6].v : undefined;
- r.status = d && d.v[7] ? decode(d.v[7]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Service';
+ r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.type = d && d.v[2] ? decode(d.v[2]) : undefined;
+ r.data = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.login = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
+ r.password = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
+ r.expiration = d && d.v[6] ? d.v[6].v : undefined;
+ r.status = d && d.v[7] ? decode(d.v[7]) : undefined;
+ return clean(r);
+}
function encRoster(d) {
- var tup = atom('Roster');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var names = 'names' in d && d.names ? bin(d.names) : nil();
- var surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil();
- var email = 'email' in d && d.email ? bin(d.email) : nil();
- var nick = 'nick' in d && d.nick ? bin(d.nick) : nil();
- var userlist = []; if ('userlist' in d && d.userlist)
- { d.userlist.forEach(function(x){
- userlist.push(encode(x))});
- userlist={t:108,v:userlist}; } else { userlist = nil() };
- var roomlist = []; if ('roomlist' in d && d.roomlist)
- { d.roomlist.forEach(function(x){
- roomlist.push(encode(x))});
- roomlist={t:108,v:roomlist}; } else { roomlist = nil() };
- var favorite = []; if ('favorite' in d && d.favorite)
- { d.favorite.forEach(function(x){
- favorite.push(encode(x))});
- favorite={t:108,v:favorite}; } else { favorite = nil() };
- var tags = []; if ('tags' in d && d.tags)
- { d.tags.forEach(function(x){
- tags.push(encode(x))});
- tags={t:108,v:tags}; } else { tags = nil() };
- var phone = 'phone' in d && d.phone ? bin(d.phone) : nil();
- var avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil();
- var update = 'update' in d && d.update ? number(d.update) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,id,names,surnames,email,nick,userlist,roomlist,favorite,tags,phone,
- avatar,update,status); }
+ const tup = atom('Roster');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const names = 'names' in d && d.names ? bin(d.names) : nil();
+ const surnames = 'surnames' in d && d.surnames ? bin(d.surnames) : nil();
+ const email = 'email' in d && d.email ? bin(d.email) : nil();
+ const nick = 'nick' in d && d.nick ? bin(d.nick) : nil();
+ let userlist = []; if ('userlist' in d && d.userlist) {
+ d.userlist.forEach((x) => {
+ userlist.push(encode(x));
+ });
+ userlist = { t: 108, v: userlist };
+ } else { userlist = nil(); }
+ let roomlist = []; if ('roomlist' in d && d.roomlist) {
+ d.roomlist.forEach((x) => {
+ roomlist.push(encode(x));
+ });
+ roomlist = { t: 108, v: roomlist };
+ } else { roomlist = nil(); }
+ let favorite = []; if ('favorite' in d && d.favorite) {
+ d.favorite.forEach((x) => {
+ favorite.push(encode(x));
+ });
+ favorite = { t: 108, v: favorite };
+ } else { favorite = nil(); }
+ let tags = []; if ('tags' in d && d.tags) {
+ d.tags.forEach((x) => {
+ tags.push(encode(x));
+ });
+ tags = { t: 108, v: tags };
+ } else { tags = nil(); }
+ const phone = 'phone' in d && d.phone ? bin(d.phone) : nil();
+ const avatar = 'avatar' in d && d.avatar ? bin(d.avatar) : nil();
+ const update = 'update' in d && d.update ? number(d.update) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(
+ tup, id, names, surnames, email, nick, userlist, roomlist, favorite, tags, phone,
+ avatar, update, status
+ );
+}
function lenRoster() { return 14; }
function decRoster(d) {
- var r={}; r.tup = 'Roster';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.names = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.surnames = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.email = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
- r.nick = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
- r.userlist = [];
- (d && d.v[6] && d.v[6].v) ?
- d.v[6].v.forEach(function(x){r.userlist.push(decode(x))}) :
- r.userlist = undefined;
- r.roomlist = [];
- (d && d.v[7] && d.v[7].v) ?
- d.v[7].v.forEach(function(x){r.roomlist.push(decode(x))}) :
- r.roomlist = undefined;
- r.favorite = [];
- (d && d.v[8] && d.v[8].v) ?
- d.v[8].v.forEach(function(x){r.favorite.push(decode(x))}) :
- r.favorite = undefined;
- r.tags = [];
- (d && d.v[9] && d.v[9].v) ?
- d.v[9].v.forEach(function(x){r.tags.push(decode(x))}) :
- r.tags = undefined;
- r.phone = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined;
- r.avatar = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined;
- r.update = d && d.v[12] ? d.v[12].v : undefined;
- r.status = d && d.v[13] ? decode(d.v[13]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Roster';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.names = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.surnames = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.email = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
+ r.nick = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
+ r.userlist = [];
+ (d && d.v[6] && d.v[6].v) ?
+ d.v[6].v.forEach((x) => { r.userlist.push(decode(x)); }) :
+ r.userlist = undefined;
+ r.roomlist = [];
+ (d && d.v[7] && d.v[7].v) ?
+ d.v[7].v.forEach((x) => { r.roomlist.push(decode(x)); }) :
+ r.roomlist = undefined;
+ r.favorite = [];
+ (d && d.v[8] && d.v[8].v) ?
+ d.v[8].v.forEach((x) => { r.favorite.push(decode(x)); }) :
+ r.favorite = undefined;
+ r.tags = [];
+ (d && d.v[9] && d.v[9].v) ?
+ d.v[9].v.forEach((x) => { r.tags.push(decode(x)); }) :
+ r.tags = undefined;
+ r.phone = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined;
+ r.avatar = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined;
+ r.update = d && d.v[12] ? d.v[12].v : undefined;
+ r.status = d && d.v[13] ? decode(d.v[13]) : undefined;
+ return clean(r);
+}
function encProfile(d) {
- var tup = atom('Profile');
- var phone = 'phone' in d && d.phone ? bin(d.phone) : nil();
- var services = []; if ('services' in d && d.services)
- { d.services.forEach(function(x){
- services.push(encode(x))});
- services={t:108,v:services}; } else { services = nil() };
- var rosters = []; if ('rosters' in d && d.rosters)
- { d.rosters.forEach(function(x){
- rosters.push(encode(x))});
- rosters={t:108,v:rosters}; } else { rosters = nil() };
- var settings = []; if ('settings' in d && d.settings)
- { d.settings.forEach(function(x){
- settings.push(encode(x))});
- settings={t:108,v:settings}; } else { settings = nil() };
- var update = 'update' in d && d.update ? number(d.update) : nil();
- var balance = 'balance' in d && d.balance ? number(d.balance) : nil();
- var presence = 'presence' in d && d.presence ? atom(d.presence) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,phone,services,rosters,settings,update,balance,presence,status); }
+ const tup = atom('Profile');
+ const phone = 'phone' in d && d.phone ? bin(d.phone) : nil();
+ let services = []; if ('services' in d && d.services) {
+ d.services.forEach((x) => {
+ services.push(encode(x));
+ });
+ services = { t: 108, v: services };
+ } else { services = nil(); }
+ let rosters = []; if ('rosters' in d && d.rosters) {
+ d.rosters.forEach((x) => {
+ rosters.push(encode(x));
+ });
+ rosters = { t: 108, v: rosters };
+ } else { rosters = nil(); }
+ let settings = []; if ('settings' in d && d.settings) {
+ d.settings.forEach((x) => {
+ settings.push(encode(x));
+ });
+ settings = { t: 108, v: settings };
+ } else { settings = nil(); }
+ const update = 'update' in d && d.update ? number(d.update) : nil();
+ const balance = 'balance' in d && d.balance ? number(d.balance) : nil();
+ const presence = 'presence' in d && d.presence ? atom(d.presence) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(tup, phone, services, rosters, settings, update, balance, presence, status);
+}
function lenProfile() { return 9; }
function decProfile(d) {
- var r={}; r.tup = 'Profile';
- r.phone = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.services = [];
- (d && d.v[2] && d.v[2].v) ?
- d.v[2].v.forEach(function(x){r.services.push(decode(x))}) :
- r.services = undefined;
- r.rosters = [];
- (d && d.v[3] && d.v[3].v) ?
- d.v[3].v.forEach(function(x){r.rosters.push(decode(x))}) :
- r.rosters = undefined;
- r.settings = [];
- (d && d.v[4] && d.v[4].v) ?
- d.v[4].v.forEach(function(x){r.settings.push(decode(x))}) :
- r.settings = undefined;
- r.update = d && d.v[5] ? d.v[5].v : undefined;
- r.balance = d && d.v[6] ? d.v[6].v : undefined;
- r.presence = d && d.v[7] ? d.v[7].v : undefined;
- r.status = d && d.v[8] ? d.v[8].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Profile';
+ r.phone = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.services = [];
+ (d && d.v[2] && d.v[2].v) ?
+ d.v[2].v.forEach((x) => { r.services.push(decode(x)); }) :
+ r.services = undefined;
+ r.rosters = [];
+ (d && d.v[3] && d.v[3].v) ?
+ d.v[3].v.forEach((x) => { r.rosters.push(decode(x)); }) :
+ r.rosters = undefined;
+ r.settings = [];
+ (d && d.v[4] && d.v[4].v) ?
+ d.v[4].v.forEach((x) => { r.settings.push(decode(x)); }) :
+ r.settings = undefined;
+ r.update = d && d.v[5] ? d.v[5].v : undefined;
+ r.balance = d && d.v[6] ? d.v[6].v : undefined;
+ r.presence = d && d.v[7] ? d.v[7].v : undefined;
+ r.status = d && d.v[8] ? d.v[8].v : undefined;
+ return clean(r);
+}
function encLoc(d) {
- var tup = atom('Loc');
- var x = 'x' in d && d.x ? bin(d.x) : nil();
- var y = 'y' in d && d.y ? bin(d.y) : nil();
- var z = 'z' in d && d.z ? bin(d.z) : nil();
- return tuple(tup,x,y,z); }
+ const tup = atom('Loc');
+ const x = 'x' in d && d.x ? bin(d.x) : nil();
+ const y = 'y' in d && d.y ? bin(d.y) : nil();
+ const z = 'z' in d && d.z ? bin(d.z) : nil();
+ return tuple(tup, x, y, z);
+}
function lenLoc() { return 4; }
function decLoc(d) {
- var r={}; r.tup = 'Loc';
- r.x = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.y = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.z = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Loc';
+ r.x = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.y = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.z = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ return clean(r);
+}
function encFriend(d) {
- var tup = atom('Friend');
- var phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil();
- var friend_id = 'friend_id' in d && d.friend_id ? bin(d.friend_id) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,phone_id,friend_id,status); }
+ const tup = atom('Friend');
+ const phone_id = 'phone_id' in d && d.phone_id ? bin(d.phone_id) : nil();
+ const friend_id = 'friend_id' in d && d.friend_id ? bin(d.friend_id) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(tup, phone_id, friend_id, status);
+}
function lenFriend() { return 4; }
function decFriend(d) {
- var r={}; r.tup = 'Friend';
- r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.friend_id = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.status = d && d.v[3] ? decode(d.v[3]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Friend';
+ r.phone_id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.friend_id = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.status = d && d.v[3] ? decode(d.v[3]) : undefined;
+ return clean(r);
+}
function encCallMember(d) {
- var tup = atom('CallMember');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var container = 'container' in d && d.container ? encode(d.container) : nil();
- var feed_id = 'feed_id' in d && d.feed_id ? bin(d.feed_id) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var contact = 'contact' in d && d.contact ? encode(d.contact) : nil();
- var start = 'start' in d && d.start ? number(d.start) : nil();
- var stop = 'stop' in d && d.stop ? number(d.stop) : nil();
- var type = 'type' in d && d.type ? encode(d.type) : nil();
- var desc = 'desc' in d && d.desc ? bin(d.desc) : nil();
- var tariff = 'tariff' in d && d.tariff ? bin(d.tariff) : nil();
- var bill = 'bill' in d && d.bill ? number(d.bill) : nil();
- var duration = 'duration' in d && d.duration ? number(d.duration) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,id,container,feed_id,prev,next,contact,start,stop,type,desc,
- tariff,bill,duration,status); }
+ const tup = atom('CallMember');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const container = 'container' in d && d.container ? encode(d.container) : nil();
+ const feed_id = 'feed_id' in d && d.feed_id ? bin(d.feed_id) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ const contact = 'contact' in d && d.contact ? encode(d.contact) : nil();
+ const start = 'start' in d && d.start ? number(d.start) : nil();
+ const stop = 'stop' in d && d.stop ? number(d.stop) : nil();
+ const type = 'type' in d && d.type ? encode(d.type) : nil();
+ const desc = 'desc' in d && d.desc ? bin(d.desc) : nil();
+ const tariff = 'tariff' in d && d.tariff ? bin(d.tariff) : nil();
+ const bill = 'bill' in d && d.bill ? number(d.bill) : nil();
+ const duration = 'duration' in d && d.duration ? number(d.duration) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(
+ tup, id, container, feed_id, prev, next, contact, start, stop, type, desc,
+ tariff, bill, duration, status
+ );
+}
function lenCallMember() { return 15; }
function decCallMember(d) {
- var r={}; r.tup = 'CallMember';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? decode(d.v[2]) : undefined;
- r.feed_id = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
- r.prev = d && d.v[4] ? d.v[4].v : undefined;
- r.next = d && d.v[5] ? d.v[5].v : undefined;
- r.contact = d && d.v[6] ? decode(d.v[6]) : undefined;
- r.start = d && d.v[7] ? d.v[7].v : undefined;
- r.stop = d && d.v[8] ? d.v[8].v : undefined;
- r.type = d && d.v[9] ? decode(d.v[9]) : undefined;
- r.desc = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined;
- r.tariff = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined;
- r.bill = d && d.v[12] ? d.v[12].v : undefined;
- r.duration = d && d.v[13] ? d.v[13].v : undefined;
- r.status = d && d.v[14] ? decode(d.v[14]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'CallMember';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? decode(d.v[2]) : undefined;
+ r.feed_id = d && d.v[3] ? utf8_dec(d.v[3].v) : undefined;
+ r.prev = d && d.v[4] ? d.v[4].v : undefined;
+ r.next = d && d.v[5] ? d.v[5].v : undefined;
+ r.contact = d && d.v[6] ? decode(d.v[6]) : undefined;
+ r.start = d && d.v[7] ? d.v[7].v : undefined;
+ r.stop = d && d.v[8] ? d.v[8].v : undefined;
+ r.type = d && d.v[9] ? decode(d.v[9]) : undefined;
+ r.desc = d && d.v[10] ? utf8_dec(d.v[10].v) : undefined;
+ r.tariff = d && d.v[11] ? utf8_dec(d.v[11].v) : undefined;
+ r.bill = d && d.v[12] ? d.v[12].v : undefined;
+ r.duration = d && d.v[13] ? d.v[13].v : undefined;
+ r.status = d && d.v[14] ? decode(d.v[14]) : undefined;
+ return clean(r);
+}
function encCall(d) {
- var tup = atom('Call');
- var id = 'id' in d && d.id ? bin(d.id) : nil();
- var from = 'from' in d && d.from ? bin(d.from) : nil();
- var members = []; if ('members' in d && d.members)
- { d.members.forEach(function(x){
- members.push(encode(x))});
- members={t:108,v:members}; } else { members = nil() };
- var start = 'start' in d && d.start ? number(d.start) : nil();
- var stop = 'stop' in d && d.stop ? number(d.stop) : nil();
- var vox_url = 'vox_url' in d && d.vox_url ? bin(d.vox_url) : nil();
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,id,from,members,start,stop,vox_url,status); }
+ const tup = atom('Call');
+ const id = 'id' in d && d.id ? bin(d.id) : nil();
+ const from = 'from' in d && d.from ? bin(d.from) : nil();
+ let members = []; if ('members' in d && d.members) {
+ d.members.forEach((x) => {
+ members.push(encode(x));
+ });
+ members = { t: 108, v: members };
+ } else { members = nil(); }
+ const start = 'start' in d && d.start ? number(d.start) : nil();
+ const stop = 'stop' in d && d.stop ? number(d.stop) : nil();
+ const vox_url = 'vox_url' in d && d.vox_url ? bin(d.vox_url) : nil();
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(tup, id, from, members, start, stop, vox_url, status);
+}
function lenCall() { return 8; }
function decCall(d) {
- var r={}; r.tup = 'Call';
- r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.from = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.members = [];
- (d && d.v[3] && d.v[3].v) ?
- d.v[3].v.forEach(function(x){r.members.push(decode(x))}) :
- r.members = undefined;
- r.start = d && d.v[4] ? d.v[4].v : undefined;
- r.stop = d && d.v[5] ? d.v[5].v : undefined;
- r.vox_url = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
- r.status = d && d.v[7] ? decode(d.v[7]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Call';
+ r.id = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.from = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.members = [];
+ (d && d.v[3] && d.v[3].v) ?
+ d.v[3].v.forEach((x) => { r.members.push(decode(x)); }) :
+ r.members = undefined;
+ r.start = d && d.v[4] ? d.v[4].v : undefined;
+ r.stop = d && d.v[5] ? d.v[5].v : undefined;
+ r.vox_url = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
+ r.status = d && d.v[7] ? decode(d.v[7]) : undefined;
+ return clean(r);
+}
function encIndex(d) {
- var tup = atom('Index');
- var id = 'id' in d && d.id ? encode(d.id) : nil();
- var roster = []; if ('roster' in d && d.roster)
- { d.roster.forEach(function(x){
- roster.push(encode(x))});
- roster={t:108,v:roster}; } else { roster = nil() };
- return tuple(tup,id,roster); }
+ const tup = atom('Index');
+ const id = 'id' in d && d.id ? encode(d.id) : nil();
+ let roster = []; if ('roster' in d && d.roster) {
+ d.roster.forEach((x) => {
+ roster.push(encode(x));
+ });
+ roster = { t: 108, v: roster };
+ } else { roster = nil(); }
+ return tuple(tup, id, roster);
+}
function lenIndex() { return 3; }
function decIndex(d) {
- var r={}; r.tup = 'Index';
- r.id = d && d.v[1] ? decode(d.v[1].v) : undefined;
- r.roster = [];
- (d && d.v[2] && d.v[2].v) ?
- d.v[2].v.forEach(function(x){r.roster.push(decode(x))}) :
- r.roster = undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Index';
+ r.id = d && d.v[1] ? decode(d.v[1].v) : undefined;
+ r.roster = [];
+ (d && d.v[2] && d.v[2].v) ?
+ d.v[2].v.forEach((x) => { r.roster.push(decode(x)); }) :
+ r.roster = undefined;
+ return clean(r);
+}
function encerror(d) {
- var tup = atom('error');
- var code = 'code' in d && d.code ? encode(d.code) : nil();
- return tuple(tup,code); }
+ const tup = atom('error');
+ const code = 'code' in d && d.code ? encode(d.code) : nil();
+ return tuple(tup, code);
+}
function lenerror() { return 2; }
function decerror(d) {
- var r={}; r.tup = 'error';
- r.code = d && d.v[1] ? decode(d.v[1]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'error';
+ r.code = d && d.v[1] ? decode(d.v[1]) : undefined;
+ return clean(r);
+}
function encok(d) {
- var tup = atom('ok');
- var code = 'code' in d && d.code ? encode(d.code) : nil();
- return tuple(tup,code); }
+ const tup = atom('ok');
+ const code = 'code' in d && d.code ? encode(d.code) : nil();
+ return tuple(tup, code);
+}
function lenok() { return 2; }
function decok(d) {
- var r={}; r.tup = 'ok';
- r.code = d && d.v[1] ? decode(d.v[1]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'ok';
+ r.code = d && d.v[1] ? decode(d.v[1]) : undefined;
+ return clean(r);
+}
function encerror2(d) {
- var tup = atom('error2');
- var code = 'code' in d && d.code ? atom(d.code) : nil();
- var src = 'src' in d && d.src ? encode(d.src) : nil();
- return tuple(tup,code,src); }
+ const tup = atom('error2');
+ const code = 'code' in d && d.code ? atom(d.code) : nil();
+ const src = 'src' in d && d.src ? encode(d.src) : nil();
+ return tuple(tup, code, src);
+}
function lenerror2() { return 3; }
function decerror2(d) {
- var r={}; r.tup = 'error2';
- r.code = d && d.v[1] ? d.v[1].v : undefined;
- r.src = d && d.v[2] ? decode(d.v[2]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'error2';
+ r.code = d && d.v[1] ? d.v[1].v : undefined;
+ r.src = d && d.v[2] ? decode(d.v[2]) : undefined;
+ return clean(r);
+}
function encok2(d) {
- var tup = atom('ok2');
- var code = 'code' in d && d.code ? atom(d.code) : nil();
- var src = 'src' in d && d.src ? encode(d.src) : nil();
- return tuple(tup,code,src); }
+ const tup = atom('ok2');
+ const code = 'code' in d && d.code ? atom(d.code) : nil();
+ const src = 'src' in d && d.src ? encode(d.src) : nil();
+ return tuple(tup, code, src);
+}
function lenok2() { return 3; }
function decok2(d) {
- var r={}; r.tup = 'ok2';
- r.code = d && d.v[1] ? d.v[1].v : undefined;
- r.src = d && d.v[2] ? decode(d.v[2]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'ok2';
+ r.code = d && d.v[1] ? d.v[1].v : undefined;
+ r.src = d && d.v[2] ? decode(d.v[2]) : undefined;
+ return clean(r);
+}
function encio(d) {
- var tup = atom('io');
- var code = 'code' in d && d.code ? encode(d.code) : nil();
- var data = 'data' in d && d.data ? encode(d.data) : nil();
- return tuple(tup,code,data); }
+ const tup = atom('io');
+ const code = 'code' in d && d.code ? encode(d.code) : nil();
+ const data = 'data' in d && d.data ? encode(d.data) : nil();
+ return tuple(tup, code, data);
+}
function lenio() { return 3; }
function decio(d) {
- var r={}; r.tup = 'io';
- r.code = d && d.v[1] ? decode(d.v[1]) : undefined;
- r.data = d && d.v[2] ? decode(d.v[2]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'io';
+ r.code = d && d.v[1] ? decode(d.v[1]) : undefined;
+ r.data = d && d.v[2] ? decode(d.v[2]) : undefined;
+ return clean(r);
+}
function encmax_tour(d) {
- var tup = atom('max_tour');
- var count = 'count' in d && d.count ? number(d.count) : nil();
- var joined = 'joined' in d && d.joined ? number(d.joined) : nil();
- return tuple(tup,count,joined); }
+ const tup = atom('max_tour');
+ const count = 'count' in d && d.count ? number(d.count) : nil();
+ const joined = 'joined' in d && d.joined ? number(d.joined) : nil();
+ return tuple(tup, count, joined);
+}
function lenmax_tour() { return 3; }
function decmax_tour(d) {
- var r={}; r.tup = 'max_tour';
- r.count = d && d.v[1] ? d.v[1].v : undefined;
- r.joined = d && d.v[2] ? d.v[2].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'max_tour';
+ r.count = d && d.v[1] ? d.v[1].v : undefined;
+ r.joined = d && d.v[2] ? d.v[2].v : undefined;
+ return clean(r);
+}
function encjoin_application(d) {
- var tup = atom('join_application');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var name = 'name' in d && d.name ? bin(d.name) : nil();
- var data = 'data' in d && d.data ? encode(d.data) : nil();
- return tuple(tup,id,name,data); }
+ const tup = atom('join_application');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const name = 'name' in d && d.name ? bin(d.name) : nil();
+ const data = 'data' in d && d.data ? encode(d.data) : nil();
+ return tuple(tup, id, name, data);
+}
function lenjoin_application() { return 4; }
function decjoin_application(d) {
- var r={}; r.tup = 'join_application';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.data = d && d.v[3] ? decode(d.v[3].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'join_application';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.name = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.data = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ return clean(r);
+}
function enctour_list(d) {
- var tup = atom('tour_list');
- var users = []; if ('users' in d && d.users)
- { d.users.forEach(function(x){
- users.push(encode(x))});
- users={t:108,v:users}; } else { users = nil() };
- return tuple(tup,users); }
+ const tup = atom('tour_list');
+ let users = []; if ('users' in d && d.users) {
+ d.users.forEach((x) => {
+ users.push(encode(x));
+ });
+ users = { t: 108, v: users };
+ } else { users = nil(); }
+ return tuple(tup, users);
+}
function lentour_list() { return 2; }
function dectour_list(d) {
- var r={}; r.tup = 'tour_list';
- r.users = [];
- (d && d.v[1] && d.v[1].v) ?
- d.v[1].v.forEach(function(x){r.users.push(decode(x))}) :
- r.users = undefined;
- return clean(r); }
+ const r = {}; r.tup = 'tour_list';
+ r.users = [];
+ (d && d.v[1] && d.v[1].v) ?
+ d.v[1].v.forEach((x) => { r.users.push(decode(x)); }) :
+ r.users = undefined;
+ return clean(r);
+}
function enctask(d) {
- var tup = atom('task');
- var name = 'name' in d && d.name ? atom(d.name) : nil();
- var roles = 'roles' in d && d.roles ? bin(d.roles) : nil();
- var module = 'module' in d && d.module ? atom(d.module) : nil();
- return tuple(tup,name,roles,module); }
+ const tup = atom('task');
+ const name = 'name' in d && d.name ? atom(d.name) : nil();
+ const roles = 'roles' in d && d.roles ? bin(d.roles) : nil();
+ const module = 'module' in d && d.module ? atom(d.module) : nil();
+ return tuple(tup, name, roles, module);
+}
function lentask() { return 4; }
function dectask(d) {
- var r={}; r.tup = 'task';
- r.name = d && d.v[1] ? d.v[1].v : undefined;
- r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.module = d && d.v[3] ? d.v[3].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'task';
+ r.name = d && d.v[1] ? d.v[1].v : undefined;
+ r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.module = d && d.v[3] ? d.v[3].v : undefined;
+ return clean(r);
+}
function encuserTask(d) {
- var tup = atom('userTask');
- var name = 'name' in d && d.name ? atom(d.name) : nil();
- var roles = 'roles' in d && d.roles ? bin(d.roles) : nil();
- var module = 'module' in d && d.module ? atom(d.module) : nil();
- return tuple(tup,name,roles,module); }
+ const tup = atom('userTask');
+ const name = 'name' in d && d.name ? atom(d.name) : nil();
+ const roles = 'roles' in d && d.roles ? bin(d.roles) : nil();
+ const module = 'module' in d && d.module ? atom(d.module) : nil();
+ return tuple(tup, name, roles, module);
+}
function lenuserTask() { return 4; }
function decuserTask(d) {
- var r={}; r.tup = 'userTask';
- r.name = d && d.v[1] ? d.v[1].v : undefined;
- r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.module = d && d.v[3] ? d.v[3].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'userTask';
+ r.name = d && d.v[1] ? d.v[1].v : undefined;
+ r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.module = d && d.v[3] ? d.v[3].v : undefined;
+ return clean(r);
+}
function encserviceTask(d) {
- var tup = atom('serviceTask');
- var name = 'name' in d && d.name ? atom(d.name) : nil();
- var roles = 'roles' in d && d.roles ? bin(d.roles) : nil();
- var module = 'module' in d && d.module ? atom(d.module) : nil();
- return tuple(tup,name,roles,module); }
+ const tup = atom('serviceTask');
+ const name = 'name' in d && d.name ? atom(d.name) : nil();
+ const roles = 'roles' in d && d.roles ? bin(d.roles) : nil();
+ const module = 'module' in d && d.module ? atom(d.module) : nil();
+ return tuple(tup, name, roles, module);
+}
function lenserviceTask() { return 4; }
function decserviceTask(d) {
- var r={}; r.tup = 'serviceTask';
- r.name = d && d.v[1] ? d.v[1].v : undefined;
- r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.module = d && d.v[3] ? d.v[3].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'serviceTask';
+ r.name = d && d.v[1] ? d.v[1].v : undefined;
+ r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.module = d && d.v[3] ? d.v[3].v : undefined;
+ return clean(r);
+}
function encreceiveTask(d) {
- var tup = atom('receiveTask');
- var name = 'name' in d && d.name ? atom(d.name) : nil();
- var roles = 'roles' in d && d.roles ? bin(d.roles) : nil();
- var module = 'module' in d && d.module ? atom(d.module) : nil();
- return tuple(tup,name,roles,module); }
+ const tup = atom('receiveTask');
+ const name = 'name' in d && d.name ? atom(d.name) : nil();
+ const roles = 'roles' in d && d.roles ? bin(d.roles) : nil();
+ const module = 'module' in d && d.module ? atom(d.module) : nil();
+ return tuple(tup, name, roles, module);
+}
function lenreceiveTask() { return 4; }
function decreceiveTask(d) {
- var r={}; r.tup = 'receiveTask';
- r.name = d && d.v[1] ? d.v[1].v : undefined;
- r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.module = d && d.v[3] ? d.v[3].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'receiveTask';
+ r.name = d && d.v[1] ? d.v[1].v : undefined;
+ r.roles = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.module = d && d.v[3] ? d.v[3].v : undefined;
+ return clean(r);
+}
function encmessageEvent(d) {
- var tup = atom('messageEvent');
- var name = 'name' in d && d.name ? atom(d.name) : nil();
- var payload = 'payload' in d && d.payload ? bin(d.payload) : nil();
- var timeout = 'timeout' in d && d.timeout ? encode(d.timeout) : nil();
- return tuple(tup,name,payload,timeout); }
+ const tup = atom('messageEvent');
+ const name = 'name' in d && d.name ? atom(d.name) : nil();
+ const payload = 'payload' in d && d.payload ? bin(d.payload) : nil();
+ const timeout = 'timeout' in d && d.timeout ? encode(d.timeout) : nil();
+ return tuple(tup, name, payload, timeout);
+}
function lenmessageEvent() { return 4; }
function decmessageEvent(d) {
- var r={}; r.tup = 'messageEvent';
- r.name = d && d.v[1] ? d.v[1].v : undefined;
- r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.timeout = d && d.v[3] ? decode(d.v[3].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'messageEvent';
+ r.name = d && d.v[1] ? d.v[1].v : undefined;
+ r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.timeout = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ return clean(r);
+}
function encboundaryEvent(d) {
- var tup = atom('boundaryEvent');
- var name = 'name' in d && d.name ? atom(d.name) : nil();
- var payload = 'payload' in d && d.payload ? bin(d.payload) : nil();
- var timeout = 'timeout' in d && d.timeout ? encode(d.timeout) : nil();
- var timeDate = 'timeDate' in d && d.timeDate ? bin(d.timeDate) : nil();
- var timeDuration = 'timeDuration' in d && d.timeDuration ? bin(d.timeDuration) : nil();
- var timeCycle = 'timeCycle' in d && d.timeCycle ? bin(d.timeCycle) : nil();
- var module = 'module' in d && d.module ? atom(d.module) : nil();
- return tuple(tup,name,payload,timeout,timeDate,timeDuration,timeCycle,module); }
+ const tup = atom('boundaryEvent');
+ const name = 'name' in d && d.name ? atom(d.name) : nil();
+ const payload = 'payload' in d && d.payload ? bin(d.payload) : nil();
+ const timeout = 'timeout' in d && d.timeout ? encode(d.timeout) : nil();
+ const timeDate = 'timeDate' in d && d.timeDate ? bin(d.timeDate) : nil();
+ const timeDuration = 'timeDuration' in d && d.timeDuration ? bin(d.timeDuration) : nil();
+ const timeCycle = 'timeCycle' in d && d.timeCycle ? bin(d.timeCycle) : nil();
+ const module = 'module' in d && d.module ? atom(d.module) : nil();
+ return tuple(tup, name, payload, timeout, timeDate, timeDuration, timeCycle, module);
+}
function lenboundaryEvent() { return 8; }
function decboundaryEvent(d) {
- var r={}; r.tup = 'boundaryEvent';
- r.name = d && d.v[1] ? d.v[1].v : undefined;
- r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.timeout = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.timeDate = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
- r.timeDuration = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
- r.timeCycle = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
- r.module = d && d.v[7] ? d.v[7].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'boundaryEvent';
+ r.name = d && d.v[1] ? d.v[1].v : undefined;
+ r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.timeout = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.timeDate = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
+ r.timeDuration = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
+ r.timeCycle = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
+ r.module = d && d.v[7] ? d.v[7].v : undefined;
+ return clean(r);
+}
function enctimeoutEvent(d) {
- var tup = atom('timeoutEvent');
- var name = 'name' in d && d.name ? atom(d.name) : nil();
- var payload = 'payload' in d && d.payload ? bin(d.payload) : nil();
- var timeout = 'timeout' in d && d.timeout ? encode(d.timeout) : nil();
- var timeDate = 'timeDate' in d && d.timeDate ? bin(d.timeDate) : nil();
- var timeDuration = 'timeDuration' in d && d.timeDuration ? bin(d.timeDuration) : nil();
- var timeCycle = 'timeCycle' in d && d.timeCycle ? bin(d.timeCycle) : nil();
- var module = 'module' in d && d.module ? atom(d.module) : nil();
- return tuple(tup,name,payload,timeout,timeDate,timeDuration,timeCycle,module); }
+ const tup = atom('timeoutEvent');
+ const name = 'name' in d && d.name ? atom(d.name) : nil();
+ const payload = 'payload' in d && d.payload ? bin(d.payload) : nil();
+ const timeout = 'timeout' in d && d.timeout ? encode(d.timeout) : nil();
+ const timeDate = 'timeDate' in d && d.timeDate ? bin(d.timeDate) : nil();
+ const timeDuration = 'timeDuration' in d && d.timeDuration ? bin(d.timeDuration) : nil();
+ const timeCycle = 'timeCycle' in d && d.timeCycle ? bin(d.timeCycle) : nil();
+ const module = 'module' in d && d.module ? atom(d.module) : nil();
+ return tuple(tup, name, payload, timeout, timeDate, timeDuration, timeCycle, module);
+}
function lentimeoutEvent() { return 8; }
function dectimeoutEvent(d) {
- var r={}; r.tup = 'timeoutEvent';
- r.name = d && d.v[1] ? d.v[1].v : undefined;
- r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
- r.timeout = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.timeDate = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
- r.timeDuration = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
- r.timeCycle = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
- r.module = d && d.v[7] ? d.v[7].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'timeoutEvent';
+ r.name = d && d.v[1] ? d.v[1].v : undefined;
+ r.payload = d && d.v[2] ? utf8_dec(d.v[2].v) : undefined;
+ r.timeout = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.timeDate = d && d.v[4] ? utf8_dec(d.v[4].v) : undefined;
+ r.timeDuration = d && d.v[5] ? utf8_dec(d.v[5].v) : undefined;
+ r.timeCycle = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
+ r.module = d && d.v[7] ? d.v[7].v : undefined;
+ return clean(r);
+}
function encbeginEvent(d) {
- var tup = atom('beginEvent');
- var name = 'name' in d && d.name ? atom(d.name) : nil();
- var module = 'module' in d && d.module ? atom(d.module) : nil();
- return tuple(tup,name,module); }
+ const tup = atom('beginEvent');
+ const name = 'name' in d && d.name ? atom(d.name) : nil();
+ const module = 'module' in d && d.module ? atom(d.module) : nil();
+ return tuple(tup, name, module);
+}
function lenbeginEvent() { return 3; }
function decbeginEvent(d) {
- var r={}; r.tup = 'beginEvent';
- r.name = d && d.v[1] ? d.v[1].v : undefined;
- r.module = d && d.v[2] ? d.v[2].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'beginEvent';
+ r.name = d && d.v[1] ? d.v[1].v : undefined;
+ r.module = d && d.v[2] ? d.v[2].v : undefined;
+ return clean(r);
+}
function encendEvent(d) {
- var tup = atom('endEvent');
- var name = 'name' in d && d.name ? atom(d.name) : nil();
- var module = 'module' in d && d.module ? atom(d.module) : nil();
- return tuple(tup,name,module); }
+ const tup = atom('endEvent');
+ const name = 'name' in d && d.name ? atom(d.name) : nil();
+ const module = 'module' in d && d.module ? atom(d.module) : nil();
+ return tuple(tup, name, module);
+}
function lenendEvent() { return 3; }
function decendEvent(d) {
- var r={}; r.tup = 'endEvent';
- r.name = d && d.v[1] ? d.v[1].v : undefined;
- r.module = d && d.v[2] ? d.v[2].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'endEvent';
+ r.name = d && d.v[1] ? d.v[1].v : undefined;
+ r.module = d && d.v[2] ? d.v[2].v : undefined;
+ return clean(r);
+}
function encsequenceFlow(d) {
- var tup = atom('sequenceFlow');
- var source = 'source' in d && d.source ? atom(d.source) : nil();
- var target = 'target' in d && d.target ? atom(d.target) : nil();
- return tuple(tup,source,target); }
+ const tup = atom('sequenceFlow');
+ const source = 'source' in d && d.source ? atom(d.source) : nil();
+ const target = 'target' in d && d.target ? atom(d.target) : nil();
+ return tuple(tup, source, target);
+}
function lensequenceFlow() { return 3; }
function decsequenceFlow(d) {
- var r={}; r.tup = 'sequenceFlow';
- r.source = d && d.v[1] ? d.v[1].v : undefined;
- r.target = d && d.v[2] ? d.v[2].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'sequenceFlow';
+ r.source = d && d.v[1] ? d.v[1].v : undefined;
+ r.target = d && d.v[2] ? d.v[2].v : undefined;
+ return clean(r);
+}
function enchist(d) {
- var tup = atom('hist');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var container = 'container' in d && d.container ? atom(d.container) : nil();
- var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var feeds = []; if ('feeds' in d && d.feeds)
- { d.feeds.forEach(function(x){
- feeds.push(encode(x))});
- feeds={t:108,v:feeds}; } else { feeds = nil() };
- var name = 'name' in d && d.name ? bin(d.name) : nil();
- var task = 'task' in d && d.task ? atom(d.task) : nil();
- var time = 'time' in d && d.time ? encode(d.time) : nil();
- return tuple(tup,id,container,feed_id,prev,next,feeds,name,task,time); }
+ const tup = atom('hist');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const container = 'container' in d && d.container ? atom(d.container) : nil();
+ const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ let feeds = []; if ('feeds' in d && d.feeds) {
+ d.feeds.forEach((x) => {
+ feeds.push(encode(x));
+ });
+ feeds = { t: 108, v: feeds };
+ } else { feeds = nil(); }
+ const name = 'name' in d && d.name ? bin(d.name) : nil();
+ const task = 'task' in d && d.task ? atom(d.task) : nil();
+ const time = 'time' in d && d.time ? encode(d.time) : nil();
+ return tuple(tup, id, container, feed_id, prev, next, feeds, name, task, time);
+}
function lenhist() { return 10; }
function dechist(d) {
- var r={}; r.tup = 'hist';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? d.v[2].v : undefined;
- r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.prev = d && d.v[4] ? d.v[4].v : undefined;
- r.next = d && d.v[5] ? d.v[5].v : undefined;
- r.feeds = [];
- (d && d.v[6] && d.v[6].v) ?
- d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) :
- r.feeds = undefined;
- r.name = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
- r.task = d && d.v[8] ? d.v[8].v : undefined;
- r.time = d && d.v[9] ? decode(d.v[9].v) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'hist';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? d.v[2].v : undefined;
+ r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.prev = d && d.v[4] ? d.v[4].v : undefined;
+ r.next = d && d.v[5] ? d.v[5].v : undefined;
+ r.feeds = [];
+ (d && d.v[6] && d.v[6].v) ?
+ d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) :
+ r.feeds = undefined;
+ r.name = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
+ r.task = d && d.v[8] ? d.v[8].v : undefined;
+ r.time = d && d.v[9] ? decode(d.v[9].v) : undefined;
+ return clean(r);
+}
function encprocess(d) {
- var tup = atom('process');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var container = 'container' in d && d.container ? atom(d.container) : nil();
- var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var feeds = []; if ('feeds' in d && d.feeds)
- { d.feeds.forEach(function(x){
- feeds.push(encode(x))});
- feeds={t:108,v:feeds}; } else { feeds = nil() };
- var name = 'name' in d && d.name ? bin(d.name) : nil();
- var roles = []; if ('roles' in d && d.roles)
- { d.roles.forEach(function(x){
- roles.push(encode(x))});
- roles={t:108,v:roles}; } else { roles = nil() };
- var tasks = []; if ('tasks' in d && d.tasks)
- { d.tasks.forEach(function(x){
- tasks.push(encode(x))});
- tasks={t:108,v:tasks}; } else { tasks = nil() };
- var events = []; if ('events' in d && d.events)
- { d.events.forEach(function(x){
- events.push(encode(x))});
- events={t:108,v:events}; } else { events = nil() };
- var hist = 'hist' in d && d.hist ? encode(d.hist) : nil();
- var flows = []; if ('flows' in d && d.flows)
- { d.flows.forEach(function(x){
- flows.push(encode(x))});
- flows={t:108,v:flows}; } else { flows = nil() };
- var rules = 'rules' in d && d.rules ? encode(d.rules) : nil();
- var docs = []; if ('docs' in d && d.docs)
- { d.docs.forEach(function(x){
- docs.push(encode(x))});
- docs={t:108,v:docs}; } else { docs = nil() };
- var options = 'options' in d && d.options ? encode(d.options) : nil();
- var task = 'task' in d && d.task ? atom(d.task) : nil();
- var timer = 'timer' in d && d.timer ? bin(d.timer) : nil();
- var notifications = 'notifications' in d && d.notifications ? encode(d.notifications) : nil();
- var result = 'result' in d && d.result ? bin(d.result) : nil();
- var started = 'started' in d && d.started ? bin(d.started) : nil();
- var beginEvent = 'beginEvent' in d && d.beginEvent ? atom(d.beginEvent) : nil();
- var endEvent = 'endEvent' in d && d.endEvent ? atom(d.endEvent) : nil();
- return tuple(tup,id,container,feed_id,prev,next,feeds,name,roles,tasks,events,
- hist,flows,rules,docs,options,task,timer,notifications,result,started,beginEvent,endEvent); }
+ const tup = atom('process');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const container = 'container' in d && d.container ? atom(d.container) : nil();
+ const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ let feeds = []; if ('feeds' in d && d.feeds) {
+ d.feeds.forEach((x) => {
+ feeds.push(encode(x));
+ });
+ feeds = { t: 108, v: feeds };
+ } else { feeds = nil(); }
+ const name = 'name' in d && d.name ? bin(d.name) : nil();
+ let roles = []; if ('roles' in d && d.roles) {
+ d.roles.forEach((x) => {
+ roles.push(encode(x));
+ });
+ roles = { t: 108, v: roles };
+ } else { roles = nil(); }
+ let tasks = []; if ('tasks' in d && d.tasks) {
+ d.tasks.forEach((x) => {
+ tasks.push(encode(x));
+ });
+ tasks = { t: 108, v: tasks };
+ } else { tasks = nil(); }
+ let events = []; if ('events' in d && d.events) {
+ d.events.forEach((x) => {
+ events.push(encode(x));
+ });
+ events = { t: 108, v: events };
+ } else { events = nil(); }
+ const hist = 'hist' in d && d.hist ? encode(d.hist) : nil();
+ let flows = []; if ('flows' in d && d.flows) {
+ d.flows.forEach((x) => {
+ flows.push(encode(x));
+ });
+ flows = { t: 108, v: flows };
+ } else { flows = nil(); }
+ const rules = 'rules' in d && d.rules ? encode(d.rules) : nil();
+ let docs = []; if ('docs' in d && d.docs) {
+ d.docs.forEach((x) => {
+ docs.push(encode(x));
+ });
+ docs = { t: 108, v: docs };
+ } else { docs = nil(); }
+ const options = 'options' in d && d.options ? encode(d.options) : nil();
+ const task = 'task' in d && d.task ? atom(d.task) : nil();
+ const timer = 'timer' in d && d.timer ? bin(d.timer) : nil();
+ const notifications = 'notifications' in d && d.notifications ? encode(d.notifications) : nil();
+ const result = 'result' in d && d.result ? bin(d.result) : nil();
+ const started = 'started' in d && d.started ? bin(d.started) : nil();
+ const beginEvent = 'beginEvent' in d && d.beginEvent ? atom(d.beginEvent) : nil();
+ const endEvent = 'endEvent' in d && d.endEvent ? atom(d.endEvent) : nil();
+ return tuple(
+ tup, id, container, feed_id, prev, next, feeds, name, roles, tasks, events,
+ hist, flows, rules, docs, options, task, timer, notifications, result, started, beginEvent, endEvent
+ );
+}
function lenprocess() { return 23; }
function decprocess(d) {
- var r={}; r.tup = 'process';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? d.v[2].v : undefined;
- r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined;
- r.prev = d && d.v[4] ? d.v[4].v : undefined;
- r.next = d && d.v[5] ? d.v[5].v : undefined;
- r.feeds = [];
- (d && d.v[6] && d.v[6].v) ?
- d.v[6].v.forEach(function(x){r.feeds.push(decode(x))}) :
- r.feeds = undefined;
- r.name = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
- r.roles = [];
- (d && d.v[8] && d.v[8].v) ?
- d.v[8].v.forEach(function(x){r.roles.push(decode(x))}) :
- r.roles = undefined;
- r.tasks = [];
- (d && d.v[9] && d.v[9].v) ?
- d.v[9].v.forEach(function(x){r.tasks.push(decode(x))}) :
- r.tasks = undefined;
- r.events = [];
- (d && d.v[10] && d.v[10].v) ?
- d.v[10].v.forEach(function(x){r.events.push(decode(x))}) :
- r.events = undefined;
- r.hist = d && d.v[11] ? decode(d.v[11]) : undefined;
- r.flows = [];
- (d && d.v[12] && d.v[12].v) ?
- d.v[12].v.forEach(function(x){r.flows.push(decode(x))}) :
- r.flows = undefined;
- r.rules = d && d.v[13] ? decode(d.v[13]) : undefined;
- r.docs = [];
- (d && d.v[14] && d.v[14].v) ?
- d.v[14].v.forEach(function(x){r.docs.push(decode(x))}) :
- r.docs = undefined;
- r.options = d && d.v[15] ? decode(d.v[15].v) : undefined;
- r.task = d && d.v[16] ? d.v[16].v : undefined;
- r.timer = d && d.v[17] ? utf8_dec(d.v[17].v) : undefined;
- r.notifications = d && d.v[18] ? decode(d.v[18].v) : undefined;
- r.result = d && d.v[19] ? utf8_dec(d.v[19].v) : undefined;
- r.started = d && d.v[20] ? utf8_dec(d.v[20].v) : undefined;
- r.beginEvent = d && d.v[21] ? d.v[21].v : undefined;
- r.endEvent = d && d.v[22] ? d.v[22].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'process';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? d.v[2].v : undefined;
+ r.feed_id = d && d.v[3] ? decode(d.v[3].v) : undefined;
+ r.prev = d && d.v[4] ? d.v[4].v : undefined;
+ r.next = d && d.v[5] ? d.v[5].v : undefined;
+ r.feeds = [];
+ (d && d.v[6] && d.v[6].v) ?
+ d.v[6].v.forEach((x) => { r.feeds.push(decode(x)); }) :
+ r.feeds = undefined;
+ r.name = d && d.v[7] ? utf8_dec(d.v[7].v) : undefined;
+ r.roles = [];
+ (d && d.v[8] && d.v[8].v) ?
+ d.v[8].v.forEach((x) => { r.roles.push(decode(x)); }) :
+ r.roles = undefined;
+ r.tasks = [];
+ (d && d.v[9] && d.v[9].v) ?
+ d.v[9].v.forEach((x) => { r.tasks.push(decode(x)); }) :
+ r.tasks = undefined;
+ r.events = [];
+ (d && d.v[10] && d.v[10].v) ?
+ d.v[10].v.forEach((x) => { r.events.push(decode(x)); }) :
+ r.events = undefined;
+ r.hist = d && d.v[11] ? decode(d.v[11]) : undefined;
+ r.flows = [];
+ (d && d.v[12] && d.v[12].v) ?
+ d.v[12].v.forEach((x) => { r.flows.push(decode(x)); }) :
+ r.flows = undefined;
+ r.rules = d && d.v[13] ? decode(d.v[13]) : undefined;
+ r.docs = [];
+ (d && d.v[14] && d.v[14].v) ?
+ d.v[14].v.forEach((x) => { r.docs.push(decode(x)); }) :
+ r.docs = undefined;
+ r.options = d && d.v[15] ? decode(d.v[15].v) : undefined;
+ r.task = d && d.v[16] ? d.v[16].v : undefined;
+ r.timer = d && d.v[17] ? utf8_dec(d.v[17].v) : undefined;
+ r.notifications = d && d.v[18] ? decode(d.v[18].v) : undefined;
+ r.result = d && d.v[19] ? utf8_dec(d.v[19].v) : undefined;
+ r.started = d && d.v[20] ? utf8_dec(d.v[20].v) : undefined;
+ r.beginEvent = d && d.v[21] ? d.v[21].v : undefined;
+ r.endEvent = d && d.v[22] ? d.v[22].v : undefined;
+ return clean(r);
+}
function enccomplete(d) {
- var tup = atom('complete');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- return tuple(tup,id); }
+ const tup = atom('complete');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ return tuple(tup, id);
+}
function lencomplete() { return 2; }
function deccomplete(d) {
- var r={}; r.tup = 'complete';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'complete';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ return clean(r);
+}
function encproc(d) {
- var tup = atom('proc');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- return tuple(tup,id); }
+ const tup = atom('proc');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ return tuple(tup, id);
+}
function lenproc() { return 2; }
function decproc(d) {
- var r={}; r.tup = 'proc';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'proc';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ return clean(r);
+}
function enchisto(d) {
- var tup = atom('histo');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- return tuple(tup,id); }
+ const tup = atom('histo');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ return tuple(tup, id);
+}
function lenhisto() { return 2; }
function dechisto(d) {
- var r={}; r.tup = 'histo';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'histo';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ return clean(r);
+}
function enccreate(d) {
- var tup = atom('create');
- var proc = 'proc' in d && d.proc ? encode(d.proc) : nil();
- var docs = []; if ('docs' in d && d.docs)
- { d.docs.forEach(function(x){
- docs.push(encode(x))});
- docs={t:108,v:docs}; } else { docs = nil() };
- return tuple(tup,proc,docs); }
+ const tup = atom('create');
+ const proc = 'proc' in d && d.proc ? encode(d.proc) : nil();
+ let docs = []; if ('docs' in d && d.docs) {
+ d.docs.forEach((x) => {
+ docs.push(encode(x));
+ });
+ docs = { t: 108, v: docs };
+ } else { docs = nil(); }
+ return tuple(tup, proc, docs);
+}
function lencreate() { return 3; }
function deccreate(d) {
- var r={}; r.tup = 'create';
- r.proc = d && d.v[1] ? decode(d.v[1]) : undefined;
- r.docs = [];
- (d && d.v[2] && d.v[2].v) ?
- d.v[2].v.forEach(function(x){r.docs.push(decode(x))}) :
- r.docs = undefined;
- return clean(r); }
+ const r = {}; r.tup = 'create';
+ r.proc = d && d.v[1] ? decode(d.v[1]) : undefined;
+ r.docs = [];
+ (d && d.v[2] && d.v[2].v) ?
+ d.v[2].v.forEach((x) => { r.docs.push(decode(x)); }) :
+ r.docs = undefined;
+ return clean(r);
+}
function encamend(d) {
- var tup = atom('amend');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var docs = []; if ('docs' in d && d.docs)
- { d.docs.forEach(function(x){
- docs.push(encode(x))});
- docs={t:108,v:docs}; } else { docs = nil() };
- return tuple(tup,id,docs); }
+ const tup = atom('amend');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ let docs = []; if ('docs' in d && d.docs) {
+ d.docs.forEach((x) => {
+ docs.push(encode(x));
+ });
+ docs = { t: 108, v: docs };
+ } else { docs = nil(); }
+ return tuple(tup, id, docs);
+}
function lenamend() { return 3; }
function decamend(d) {
- var r={}; r.tup = 'amend';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.docs = [];
- (d && d.v[2] && d.v[2].v) ?
- d.v[2].v.forEach(function(x){r.docs.push(decode(x))}) :
- r.docs = undefined;
- return clean(r); }
+ const r = {}; r.tup = 'amend';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.docs = [];
+ (d && d.v[2] && d.v[2].v) ?
+ d.v[2].v.forEach((x) => { r.docs.push(decode(x)); }) :
+ r.docs = undefined;
+ return clean(r);
+}
function encaction(d) {
- var tup = atom('action');
- var name = 'name' in d && d.name ? bin(d.name) : nil();
- var data = 'data' in d && d.data ? encode(d.data) : nil();
- return tuple(tup,name,data); }
+ const tup = atom('action');
+ const name = 'name' in d && d.name ? bin(d.name) : nil();
+ const data = 'data' in d && d.data ? encode(d.data) : nil();
+ return tuple(tup, name, data);
+}
function lenaction() { return 3; }
function decaction(d) {
- var r={}; r.tup = 'action';
- r.name = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
- r.data = d && d.v[2] ? decode(d.v[2]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'action';
+ r.name = d && d.v[1] ? utf8_dec(d.v[1].v) : undefined;
+ r.data = d && d.v[2] ? decode(d.v[2]) : undefined;
+ return clean(r);
+}
function encShedule(d) {
- var tup = atom('Shedule');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var proc = 'proc' in d && d.proc ? encode(d.proc) : nil();
- var data = []; if ('data' in d && d.data)
- { d.data.forEach(function(x){
- data.push(encode(x))});
- data={t:108,v:data}; } else { data = nil() };
- return tuple(tup,id,proc,data); }
+ const tup = atom('Shedule');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const proc = 'proc' in d && d.proc ? encode(d.proc) : nil();
+ let data = []; if ('data' in d && d.data) {
+ d.data.forEach((x) => {
+ data.push(encode(x));
+ });
+ data = { t: 108, v: data };
+ } else { data = nil(); }
+ return tuple(tup, id, proc, data);
+}
function lenShedule() { return 4; }
function decShedule(d) {
- var r={}; r.tup = 'Shedule';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.proc = d && d.v[2] ? decode(d.v[2]) : undefined;
- r.data = [];
- (d && d.v[3] && d.v[3].v) ?
- d.v[3].v.forEach(function(x){r.data.push(decode(x))}) :
- r.data = undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Shedule';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.proc = d && d.v[2] ? decode(d.v[2]) : undefined;
+ r.data = [];
+ (d && d.v[3] && d.v[3].v) ?
+ d.v[3].v.forEach((x) => { r.data.push(decode(x)); }) :
+ r.data = undefined;
+ return clean(r);
+}
function encJob(d) {
- var tup = atom('Job');
- var id = 'id' in d && d.id ? number(d.id) : nil();
- var container = 'container' in d && d.container ? encode(d.container) : nil();
- var feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
- var next = 'next' in d && d.next ? number(d.next) : nil();
- var prev = 'prev' in d && d.prev ? number(d.prev) : nil();
- var context = 'context' in d && d.context ? bin(d.context) : nil();
- var proc = 'proc' in d && d.proc ? encode(d.proc) : nil();
- var time = 'time' in d && d.time ? number(d.time) : nil();
- var data = []; if ('data' in d && d.data)
- { d.data.forEach(function(x){
- data.push(encode(x))});
- data={t:108,v:data}; } else { data = nil() };
- var events = []; if ('events' in d && d.events)
- { d.events.forEach(function(x){
- events.push(encode(x))});
- events={t:108,v:events}; } else { events = nil() };
- var status = 'status' in d && d.status ? atom(d.status) : nil();
- return tuple(tup,id,container,feed_id,next,prev,context,proc,time,data,events,status); }
+ const tup = atom('Job');
+ const id = 'id' in d && d.id ? number(d.id) : nil();
+ const container = 'container' in d && d.container ? encode(d.container) : nil();
+ const feed_id = 'feed_id' in d && d.feed_id ? encode(d.feed_id) : nil();
+ const next = 'next' in d && d.next ? number(d.next) : nil();
+ const prev = 'prev' in d && d.prev ? number(d.prev) : nil();
+ const context = 'context' in d && d.context ? bin(d.context) : nil();
+ const proc = 'proc' in d && d.proc ? encode(d.proc) : nil();
+ const time = 'time' in d && d.time ? number(d.time) : nil();
+ let data = []; if ('data' in d && d.data) {
+ d.data.forEach((x) => {
+ data.push(encode(x));
+ });
+ data = { t: 108, v: data };
+ } else { data = nil(); }
+ let events = []; if ('events' in d && d.events) {
+ d.events.forEach((x) => {
+ events.push(encode(x));
+ });
+ events = { t: 108, v: events };
+ } else { events = nil(); }
+ const status = 'status' in d && d.status ? atom(d.status) : nil();
+ return tuple(tup, id, container, feed_id, next, prev, context, proc, time, data, events, status);
+}
function lenJob() { return 12; }
function decJob(d) {
- var r={}; r.tup = 'Job';
- r.id = d && d.v[1] ? d.v[1].v : undefined;
- r.container = d && d.v[2] ? decode(d.v[2]) : undefined;
- r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined;
- r.next = d && d.v[4] ? d.v[4].v : undefined;
- r.prev = d && d.v[5] ? d.v[5].v : undefined;
- r.context = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
- r.proc = d && d.v[7] ? decode(d.v[7]) : undefined;
- r.time = d && d.v[8] ? d.v[8].v : undefined;
- r.data = [];
- (d && d.v[9] && d.v[9].v) ?
- d.v[9].v.forEach(function(x){r.data.push(decode(x))}) :
- r.data = undefined;
- r.events = [];
- (d && d.v[10] && d.v[10].v) ?
- d.v[10].v.forEach(function(x){r.events.push(decode(x))}) :
- r.events = undefined;
- r.status = d && d.v[11] ? decode(d.v[11]) : undefined;
- return clean(r); }
+ const r = {}; r.tup = 'Job';
+ r.id = d && d.v[1] ? d.v[1].v : undefined;
+ r.container = d && d.v[2] ? decode(d.v[2]) : undefined;
+ r.feed_id = d && d.v[3] ? decode(d.v[3]) : undefined;
+ r.next = d && d.v[4] ? d.v[4].v : undefined;
+ r.prev = d && d.v[5] ? d.v[5].v : undefined;
+ r.context = d && d.v[6] ? utf8_dec(d.v[6].v) : undefined;
+ r.proc = d && d.v[7] ? decode(d.v[7]) : undefined;
+ r.time = d && d.v[8] ? d.v[8].v : undefined;
+ r.data = [];
+ (d && d.v[9] && d.v[9].v) ?
+ d.v[9].v.forEach((x) => { r.data.push(decode(x)); }) :
+ r.data = undefined;
+ r.events = [];
+ (d && d.v[10] && d.v[10].v) ?
+ d.v[10].v.forEach((x) => { r.events.push(decode(x)); }) :
+ r.events = undefined;
+ r.status = d && d.v[11] ? decode(d.v[11]) : undefined;
+ return clean(r);
+}
function encTest(d) {
- var tup = atom('Test');
- var type = 'type' in d && d.type ? atom(d.type) : nil();
- var count = 'count' in d && d.count ? number(d.count) : nil();
- return tuple(tup,type,count); }
+ const tup = atom('Test');
+ const type = 'type' in d && d.type ? atom(d.type) : nil();
+ const count = 'count' in d && d.count ? number(d.count) : nil();
+ return tuple(tup, type, count);
+}
function lenTest() { return 3; }
function decTest(d) {
- var r={}; r.tup = 'Test';
- r.type = d && d.v[1] ? decode(d.v[1]) : undefined;
- r.count = d && d.v[2] ? d.v[2].v : undefined;
- return clean(r); }
-
-const mapper = (len, decode, encode ) => ({
- len: len,
- decode: decode,
- encode: encode
+ const r = {}; r.tup = 'Test';
+ r.type = d && d.v[1] ? decode(d.v[1]) : undefined;
+ r.count = d && d.v[2] ? d.v[2].v : undefined;
+ return clean(r);
+}
+
+const mapper = (len, decode, encode) => ({
+ len,
+ decode,
+ encode
});
const personUtils = mapper(
- lenPerson,
- decPerson,
- encPerson
+ lenPerson,
+ decPerson,
+ encPerson
);
const profileUtils = mapper(
- lenProfile,
- decProfile,
- encProfile
+ lenProfile,
+ decProfile,
+ encProfile
);
const rosterUtils = mapper(
- lenRoster,
- decRoster,
- encRoster
+ lenRoster,
+ decRoster,
+ encRoster
);
const contactUtils = mapper(
- lenContact,
- decContact,
- encContact
+ lenContact,
+ decContact,
+ encContact
);
const friendUtils = mapper(
- lenFriend,
- decFriend,
- encFriend
+ lenFriend,
+ decFriend,
+ encFriend
);
const historyUtils = mapper(
- lenHistory,
- decHistory,
- encHistory
+ lenHistory,
+ decHistory,
+ encHistory
);
const ioUtils = mapper(
- lenio,
- decio,
- encio
+ lenio,
+ decio,
+ encio
);
const messageUtils = mapper(
- lenMessage,
- decMessage,
- encMessage
+ lenMessage,
+ decMessage,
+ encMessage
);
const authUtils = mapper(
- lenAuth,
- decAuth,
- encAuth
+ lenAuth,
+ decAuth,
+ encAuth
);
export {
- decode,
- encode,
-
- authUtils,
- personUtils,
- profileUtils,
- rosterUtils,
- ioUtils,
- contactUtils,
- historyUtils,
- friendUtils,
- messageUtils
-}
\ No newline at end of file
+ decode,
+ encode,
+
+ authUtils,
+ personUtils,
+ profileUtils,
+ rosterUtils,
+ ioUtils,
+ contactUtils,
+ historyUtils,
+ friendUtils,
+ messageUtils
+};
diff --git a/src/core/configs/BrowserStorage.config.js b/src/core/configs/BrowserStorage.config.js
index 80fc8fe45f3ed2782f0a76f064dd4d3e20bb5636..724f0376fe56a73768acff86756534f7228e582f 100644
--- a/src/core/configs/BrowserStorage.config.js
+++ b/src/core/configs/BrowserStorage.config.js
@@ -1,4 +1,4 @@
-export const STORAGE_NAME = "store";
+export const STORAGE_NAME = 'store';
export const SAVE_TIME_DELAY = 1000;
export const CLIENT = 'client';
export const DEV_KEY = 'devKey';
diff --git a/src/core/configs/MqttEvents.config.js b/src/core/configs/MqttEvents.config.js
index 9567f76fa90e01d7aa5937896eea1fd1a5cce008..38c6d4e121766fd38b0f59aa9cab1fd833b02424 100644
--- a/src/core/configs/MqttEvents.config.js
+++ b/src/core/configs/MqttEvents.config.js
@@ -3,4 +3,4 @@ export const CLOSE = 'close';
export const MESSAGE = 'message';
export const ERROR = 'error';
export const PACKETSEND = 'packetsend';
-export const PACKETRECEIVE = 'packetreceive';
\ No newline at end of file
+export const PACKETRECEIVE = 'packetreceive';
diff --git a/src/core/configs/MqttInit.config.js b/src/core/configs/MqttInit.config.js
index 9c8421eea5791041914ac41e67ff7dc9efa2c1d3..46d76178756aff03de2a22fb72d8119ab4ba4702 100644
--- a/src/core/configs/MqttInit.config.js
+++ b/src/core/configs/MqttInit.config.js
@@ -1,19 +1,19 @@
export default ({
- username: 'api',
- loggedPrefix: 'emqttd_',
- authPrefix: 'reg_',
- host: location.hostname,
- port: 8083,
- queueQoSZero: true,
- resubscribe: true,
- cleanSession: true,
- provider: 'mqtt',
- protocol: 'ws',
- timeout: 2,
- reconnectPeriod: 3000,
- will : {
- topic: 'version/1',
- payload:'version/1',
- qos: '2'
- }
+ username: 'api',
+ loggedPrefix: 'emqttd_',
+ authPrefix: 'reg_',
+ host: location.hostname,
+ port: 8083,
+ queueQoSZero: true,
+ resubscribe: true,
+ cleanSession: true,
+ provider: 'mqtt',
+ protocol: 'ws',
+ timeout: 2,
+ reconnectPeriod: 3000,
+ will: {
+ topic: 'version/1',
+ payload: 'version/1',
+ qos: '2'
+ }
});
diff --git a/src/core/configs/ProtocolHandlers.config.js b/src/core/configs/ProtocolHandlers.config.js
index 609e02112f45b742af5e4fc1ef5eb94500a971d6..bd5007ed0b002634c829de21cec36da9bd6e4745 100644
--- a/src/core/configs/ProtocolHandlers.config.js
+++ b/src/core/configs/ProtocolHandlers.config.js
@@ -6,4 +6,4 @@ export const MESSAGE = 'message';
export const PERSON = 'person';
export const PROFILE = 'profile';
export const ROSTER = 'roster';
-export const SERVER = 'server';
\ No newline at end of file
+export const SERVER = 'server';
diff --git a/src/core/loggers/SentryError.logger b/src/core/loggers/SentryError.logger
index 6e39bd9dec48afaaab6f154f21218524e76103b1..0ff0a065712edd17626a7170d1b7339f2cee50fd 100644
--- a/src/core/loggers/SentryError.logger
+++ b/src/core/loggers/SentryError.logger
@@ -1,3 +1,5 @@
+/* eslint-disable */
+
import Raven from 'raven-js';
export default (
diff --git a/src/core/messages/Converter.message.js b/src/core/messages/Converter.message.js
index 25bbee3149c62747843312017077e73e4f0ccdfc..1082f43e4df602761be0f45b0b558f5f8906ddd4 100644
--- a/src/core/messages/Converter.message.js
+++ b/src/core/messages/Converter.message.js
@@ -1,12 +1,12 @@
import { decode, convertToBert } from '../bert/Converter.bert';
const formatter = (packet = {}) => {
- const bert = convertToBert(packet.payload);
- try {
- return decode(bert);
- } catch(e) {
- //notify store, user, server
- }
+ const bert = convertToBert(packet.payload);
+ try {
+ return decode(bert);
+ } catch (e) {
+ // notify store, user, server
+ }
};
-export { formatter };
\ No newline at end of file
+export { formatter };
diff --git a/src/core/middlewares/ErrorHandler.middleware.js b/src/core/middlewares/ErrorHandler.middleware.js
index 6afbff2494160ac9511ad6602b6497087d31a1ae..de5d28d026c1c6e5c3f2206ddb54b9bbfe16f702 100644
--- a/src/core/middlewares/ErrorHandler.middleware.js
+++ b/src/core/middlewares/ErrorHandler.middleware.js
@@ -1,20 +1,20 @@
import Raven from 'raven-js';
-const crashReporter = store => next => action => {
- try {
- return next(action)
- } catch (err) {
- console.error('Caught an exception!', err);
- Raven.captureException(err, {
- extra: {
- action,
- state: store.getState()
- }
- });
- throw err
- }
+const crashReporter = store => next => (action) => {
+ try {
+ return next(action);
+ } catch (err) {
+ console.error('Caught an exception!', err);
+ Raven.captureException(err, {
+ extra: {
+ action,
+ state: store.getState()
+ }
+ });
+ throw err;
+ }
};
/*
then call func(Raven);
- */
\ No newline at end of file
+ */
diff --git a/src/core/offline/service-worker/register.service-worker.js b/src/core/offline/service-worker/register.service-worker.js
index 84f5e39bc8c48260eecdbbe87ed6abd7399cece6..87781e4b4a64ec91679c25f90357700c102e0abc 100644
--- a/src/core/offline/service-worker/register.service-worker.js
+++ b/src/core/offline/service-worker/register.service-worker.js
@@ -1,35 +1,34 @@
+/* eslint-disable */
import * as validator from './validator.service-worker';
export default function register() {
- if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
- // The URL constructor is available in all browsers that support SW.
- const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
- if (publicUrl.origin !== window.location.origin) {
- // Our service worker won't work if PUBLIC_URL is on a different origin
- // from what our page is served on. This might happen if a CDN is used to
- // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
- return;
- }
+ if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
+ // The URL constructor is available in all browsers that support SW.
+ const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
+ if (publicUrl.origin !== window.location.origin) {
+ // Our service worker won't work if PUBLIC_URL is on a different origin
+ // from what our page is served on. This might happen if a CDN is used to
+ // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
+ return;
+ }
- window.addEventListener('load', () => {
- const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
+ window.addEventListener('load', () => {
+ const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
- if (isLocalhost) {
- // This is running on localhost. Lets check if a service worker still exists or not.
- checkValidServiceWorker(swUrl);
+ if (isLocalhost) {
+ // This is running on localhost. Lets check if a service worker still exists or not.
+ checkValidServiceWorker(swUrl);
- // Add some additional logging to localhost, pointing developers to the
- // service worker/PWA documentation.
- navigator.serviceWorker.ready.then(() => {
- console.log(
- 'This web app is being served cache-first by a service ' +
- 'worker. To learn more, visit https://goo.gl/SC7cgQ'
- );
- });
- } else {
- // Is not local host. Just register service worker
- registerValidSW(swUrl);
- }
+ // Add some additional logging to localhost, pointing developers to the
+ // service worker/PWA documentation.
+ navigator.serviceWorker.ready.then(() => {
+ console.log('This web app is being served cache-first by a service ' +
+ 'worker. To learn more, visit https://goo.gl/SC7cgQ');
});
- }
+ } else {
+ // Is not local host. Just register service worker
+ registerValidSW(swUrl);
+ }
+ });
+ }
}
diff --git a/src/core/offline/service-worker/unregister.service-worker.js b/src/core/offline/service-worker/unregister.service-worker.js
index 43d0970a1f9452763ea061c4a1fd9a89df606692..bf53e82fc08797bfa68d301c59a9f6104a9c0659 100644
--- a/src/core/offline/service-worker/unregister.service-worker.js
+++ b/src/core/offline/service-worker/unregister.service-worker.js
@@ -1,7 +1,9 @@
+/* eslint-disable */
+
export function unregister() {
- if ('serviceWorker' in navigator) {
- navigator.serviceWorker.ready.then(registration => {
- registration.unregister();
- });
- }
-}
\ No newline at end of file
+ if ('serviceWorker' in navigator) {
+ navigator.serviceWorker.ready.then((registration) => {
+ registration.unregister();
+ });
+ }
+}
diff --git a/src/core/offline/service-worker/validator.service-worker.js b/src/core/offline/service-worker/validator.service-worker.js
index 904f2dc2ed1192b1080366e11c52a62ae541386f..9c56d4bafd13bea561f0c99422aba63576685b32 100644
--- a/src/core/offline/service-worker/validator.service-worker.js
+++ b/src/core/offline/service-worker/validator.service-worker.js
@@ -1,61 +1,57 @@
+/* eslint-disable */
+
export const isLocalhost = () => (
- Boolean(
- window.location.hostname === 'localhost' ||
- // [::1] is the IPv6 localhost address.
+ Boolean(window.location.hostname === 'localhost' ||
+ // [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
- // 127.0.0.1/8 is considered localhost for IPv4.
- window.location.hostname.match(
- /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
- )
- )
+ // 127.0.0.1/8 is considered localhost for IPv4.
+ window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/))
);
export function registerValidSW(swUrl) {
- navigator.serviceWorker
- .register(swUrl)
- .then(registration => {
- registration.onupdatefound = () => {
- const installingWorker = registration.installing;
- installingWorker.onstatechange = () => {
- if (installingWorker.state === 'installed') {
- if (navigator.serviceWorker.controller) {
- console.log('New content is available; please refresh.');
- } else {
- console.log('Content is cached for offline use.');
- }
- }
- };
- };
- })
- .catch(error => {
- console.error('Error during service worker registration:', error);
- });
+ navigator.serviceWorker
+ .register(swUrl)
+ .then((registration) => {
+ registration.onupdatefound = () => {
+ const installingWorker = registration.installing;
+ installingWorker.onstatechange = () => {
+ if (installingWorker.state === 'installed') {
+ if (navigator.serviceWorker.controller) {
+ console.log('New content is available; please refresh.');
+ } else {
+ console.log('Content is cached for offline use.');
+ }
+ }
+ };
+ };
+ })
+ .catch((error) => {
+ console.error('Error during service worker registration:', error);
+ });
}
export function checkValidServiceWorker(swUrl) {
- // Check if the service worker can be found. If it can't reload the page.
- fetch(swUrl)
- .then(response => {
- // Ensure service worker exists, and that we really are getting a JS file.
- if (
- response.status === 404 ||
+ // Check if the service worker can be found. If it can't reload the page.
+ fetch(swUrl)
+ .then((response) => {
+ // Ensure service worker exists, and that we really are getting a JS file.
+ if (
+ response.status === 404 ||
response.headers.get('content-type').indexOf('javascript') === -1
- ) {
- // No service worker found. Probably a different app. Reload the page.
- navigator.serviceWorker.ready.then(registration => {
- registration.unregister().then(() => {
- window.location.reload();
- });
- });
- } else {
- // Service worker found. Proceed as normal.
- registerValidSW(swUrl);
- }
- })
- .catch(() => {
- console.log(
- 'No internet connection found. App is running in offline mode.'
- );
+ ) {
+ // No service worker found. Probably a different app. Reload the page.
+ navigator.serviceWorker.ready.then((registration) => {
+ registration.unregister().then(() => {
+ window.location.reload();
+ });
});
-}
\ No newline at end of file
+ } else {
+ // Service worker found. Proceed as normal.
+ registerValidSW(swUrl);
+ }
+ })
+ .catch(() => {
+ console.log('No internet connection found. App is running in offline mode.');
+ });
+}
diff --git a/src/core/protocols/Index.protocol.js b/src/core/protocols/Index.protocol.js
index 75334d45babdf9c7e1fe6db9fbbfca4d922a96f2..7dd309aef0ea844726d133fbd718a6fb5625b173 100644
--- a/src/core/protocols/Index.protocol.js
+++ b/src/core/protocols/Index.protocol.js
@@ -1,149 +1,135 @@
import * as protocolsName from '../configs/ProtocolHandlers.config';
import {
- profileUtils,
- personUtils,
- rosterUtils,
- contactUtils,
- messageUtils,
- historyUtils,
- ioUtils,
- friendUtils,
+ profileUtils,
+ personUtils,
+ rosterUtils,
+ contactUtils,
+ messageUtils,
+ historyUtils,
+ ioUtils,
+ friendUtils
} from '../bert/SignatureGenerator.bert';
const lenServer = () => (2);
-const check = node => {
- if(typeof node == 'undefined') {
- return;
- }
- return node;
+const check = (node) => {
+ if (typeof node === 'undefined') {
+ return;
+ }
+ return node;
};
const factory = (name = '', utils = {}, eventFormer = null, ...args) => {
- let response;
- const delimiter = '/';
- const eventFormerCopy = eventFormer;
- const prepareEvent = (pipe = []) => {
- if(!Array.isArray(pipe)) {
- return;
- }
- return pipe.join(delimiter)
- };
-
- if(!eventFormer) {
- eventFormer = (res = []) => {
- response = utils.decode(res);
- return prepareEvent([
- name,
- response.status
- ]);
- }
- } else {
- eventFormer = (res = []) => {
- response = utils.decode(res);
- prepareEvent(eventFormerCopy(response));
- }
+ let response;
+ const delimiter = '/';
+ const eventFormerCopy = eventFormer;
+ const prepareEvent = (pipe = []) => {
+ if (!Array.isArray(pipe)) {
+ return;
}
- return {
+ return pipe.join(delimiter);
+ };
+
+ if (!eventFormer) {
+ eventFormer = (res = []) => {
+ response = utils.decode(res);
+ return prepareEvent([
name,
- ...utils,
- eventFormer,
- response,
- ...args
- }
+ response.status
+ ]);
+ };
+ } else {
+ eventFormer = (res = []) => {
+ response = utils.decode(res);
+ prepareEvent(eventFormerCopy(response));
+ };
+ }
+ return {
+ name,
+ ...utils,
+ eventFormer,
+ response,
+ ...args
+ };
};
-const io = () => {
- return factory(
- protocolsName.IO,
- ioUtils,
- (res) => {
- let pipe = [
- protocolsName.IO,
- res.code.tup,
- check(res.code.code)
- ];
- res.data
+const io = () => factory(
+ protocolsName.IO,
+ ioUtils,
+ (res) => {
+ const pipe = [
+ protocolsName.IO,
+ res.code.tup,
+ check(res.code.code)
+ ];
+ res.data
&& res.data.tup == 'Roster'
&& check(res.data.status)
&& pipe.push(res.data.tup.toLowerCase())
&& pipe.push(res.data.status);
- return pipe;
- }
- );
-};
+ return pipe;
+ }
+);
const server = () => {
- const util = {
- length: lenServer,
- decode: v => v,
- encode: v => v
- };
- return factory(
- protocolsName.SERVER,
- util,
- v => v
- )
+ const util = {
+ length: lenServer,
+ decode: v => v,
+ encode: v => v
+ };
+ return factory(
+ protocolsName.SERVER,
+ util,
+ v => v
+ );
};
-const contact = () => {
- return factory(
- protocolsName.CONTACT,
- contactUtils
- );
-};
+const contact = () => factory(
+ protocolsName.CONTACT,
+ contactUtils
+);
-const friend = () => {
- return factory(
- protocolsName.FRIEND,
- friendUtils
- );
-};
+const friend = () => factory(
+ protocolsName.FRIEND,
+ friendUtils
+);
-const profile = () => {
- return factory(
- protocolsName.PROFILE,
- profileUtils
- )
-};
+const profile = () => factory(
+ protocolsName.PROFILE,
+ profileUtils
+);
const person = () => {
- const name = 'person';
- return factory(
- protocolsName.PERSON,
- personUtils
- )
+ const name = 'person';
+ return factory(
+ protocolsName.PERSON,
+ personUtils
+ );
};
-const history = () => {
- return factory(
- protocolsName.HISTORY,
- historyUtils
- )
-};
+const history = () => factory(
+ protocolsName.HISTORY,
+ historyUtils
+);
-const message = () => {
- return factory(
- protocolsName.MESSAGE,
- messageUtils
- )
-};
+const message = () => factory(
+ protocolsName.MESSAGE,
+ messageUtils
+);
-const roster = () => {
- return factory(
- protocolsName.ROSTER,
- rosterUtils
- );
-};
+const roster = () => factory(
+ protocolsName.ROSTER,
+ rosterUtils
+);
export {
- profile,
- person,
- roster,
- contact,
- message,
- history,
- io,
- friend,
-};
\ No newline at end of file
+ profile,
+ person,
+ roster,
+ contact,
+ message,
+ history,
+ io,
+ friend
+};
diff --git a/src/core/protocols/Topic.protocol.js b/src/core/protocols/Topic.protocol.js
index 3d70b2f1a86037f4cefbef34f6990dff05a58ff6..f50bf3e53307525e1f284248856fde0950702b5a 100644
--- a/src/core/protocols/Topic.protocol.js
+++ b/src/core/protocols/Topic.protocol.js
@@ -1,21 +1,21 @@
import { setupClientEntry } from '../store';
import * as config from '../configs/ProtocolTopic.config';
-import { browserStorage } from '../store'
+import { browserStorage } from '../store';
const generateNumber = () => (
- Math.floor((Math.random() * config.NODES) + 1)
+ Math.floor((Math.random() * config.NODES) + 1)
);
const topic = (prefix, ...args) => {
- let pipe = [
- prefix,
- ...args,
- config.VERSION,
- generateNumber(),
- config.DIRECTION,
- setupClientEntry()
- ];
- return pipe.join('/') + '/';
+ const pipe = [
+ prefix,
+ ...args,
+ config.VERSION,
+ generateNumber(),
+ config.DIRECTION,
+ setupClientEntry()
+ ];
+ return `${pipe.join('/')}/`;
};
-export { topic };
\ No newline at end of file
+export { topic };
diff --git a/src/core/protocols/Validator.protocol.js b/src/core/protocols/Validator.protocol.js
index b5a56e5834acb7f95e84057a3ee1dff2413a8711..5df9fa99fbcad79e32232a32adc71d2dcac027f0 100644
--- a/src/core/protocols/Validator.protocol.js
+++ b/src/core/protocols/Validator.protocol.js
@@ -1,27 +1,26 @@
import * as protocols from './Index.protocol';
const isCorrespond = (x, num, name) => (
- x == undefined
+ x == undefined
? false
: (x.t == 106 ? false : (x.v.length === num && x.v[0].v === name))
);
const validate = (res) => {
- for(let protocol in protocols) {
- let node = protocols[protocol]();
- if(isCorrespond(res, node.len(), node.name)) {
- return {
- event: node.eventFormer(res),
- response: node.response
- };
- }
+ for (const protocol in protocols) {
+ const node = protocols[protocol]();
+ if (isCorrespond(res, node.len(), node.name)) {
+ return {
+ event: node.eventFormer(res),
+ response: node.response
+ };
}
- return;
+ }
};
export {
- isCorrespond,
- validate
-};
\ No newline at end of file
+ isCorrespond,
+ validate
+};
diff --git a/src/core/protocols/index.js b/src/core/protocols/index.js
index e168f8dda37b6affe8cb1dcbcdb13d09b14f7551..57e1d80c323301284b8d0a7b3b88b87ecd647d30 100644
--- a/src/core/protocols/index.js
+++ b/src/core/protocols/index.js
@@ -1,3 +1,3 @@
import { topic } from './Topic.protocol';
-export { topic };
\ No newline at end of file
+export { topic };
diff --git a/src/core/resource/Auth.resource.js b/src/core/resource/Auth.resource.js
index 2192b2c46195c0e08375972b28a5cded131bc2b8..73a7c0e6a7715ceab5fceb1db4897156f65c652b 100644
--- a/src/core/resource/Auth.resource.js
+++ b/src/core/resource/Auth.resource.js
@@ -4,7 +4,7 @@ const REGISTER = 'REGISTER';
const REGISTERED = 'REGISTER';
const login = (time, token) => ({
- type: LOGIN,
- token
+ type: LOGIN,
+ token
});
diff --git a/src/core/resource/Init.resource.js b/src/core/resource/Init.resource.js
index 4176d3b49cf4b85ef92d7c09a91c5aee7c902de1..84c551041bef3950e4990f8d3f40f2eb5b591dbb 100644
--- a/src/core/resource/Init.resource.js
+++ b/src/core/resource/Init.resource.js
@@ -3,28 +3,28 @@ export const CONNECTED = 'CONNECTED';
export const CLOSE = 'CLOSE';
export const ERROR = 'ERROR';
-export const connecting = (time) =>({
- type: CONNECTING,
- time
+export const connecting = time => ({
+ type: CONNECTING,
+ time
});
export const connected = () => ({
- type: CONNECTED
+ type: CONNECTED
});
-export const close = (time) =>({
- type: CLOSE
+export const close = time => ({
+ type: CLOSE
});
export const provider = (state = {}, action) => {
- switch (action.type) {
- case CONNECTING:
- return {
- updated: action.time,
- ...state
- };
- break;
- default:
- return state;
- }
-};
\ No newline at end of file
+ switch (action.type) {
+ case CONNECTING:
+ return {
+ updated: action.time,
+ ...state
+ };
+ break;
+ default:
+ return state;
+ }
+};
diff --git a/src/core/resource/Messages.resource.js b/src/core/resource/Messages.resource.js
index 6d0ed23656bee9c454ee2c52242bfa4097f02326..0eaa1b782ebaa1dff83de997cc916fd7cae6c8f8 100644
--- a/src/core/resource/Messages.resource.js
+++ b/src/core/resource/Messages.resource.js
@@ -1,64 +1,66 @@
export const MESSAGE_SEND = 'MESSAGE_SEND';
export const MESSAGE_DELIVERED = 'MESSAGE_DELIVERED';
export const MESSAGE_RECEIVE = 'MESSAGE_RECEIVE';
-export const ERROR = "ERROR";
+export const ERROR = 'ERROR';
-const send = (topic, message, status, packet) =>({
- type: MESSAGE_SEND,
- topic,
- message,
- status
+const send = (topic, message, status, packet) => ({
+ type: MESSAGE_SEND,
+ topic,
+ message,
+ status
});
const dilivered = (topic, message, time) => ({
- type: MESSAGE_DELIVERED,
- topic,
- message,
- time
+ type: MESSAGE_DELIVERED,
+ topic,
+ message,
+ time
});
const receive = (topic, message, status, time) => ({
- type: MESSAGE_RECEIVE,
- topic,
- message
+ type: MESSAGE_RECEIVE,
+ topic,
+ message
});
-const messageSendSelector = ({message, status, sentTime, id}) => ({
- [id]: {
- content,
- status,
- sentTime
- }
+const messageSendSelector = ({
+ message, status, sentTime, id
+}) => ({
+ [id]: {
+ content,
+ status,
+ sentTime
+ }
});
const messageDelivered = ({ id, status }) => ({
- [id]: {
- status
- }
+ [id]: {
+ status
+ }
});
const messages = (state = {}, action) => {
- switch(action.type) {
- case MESSAGE_SEND:
- return [
- ...state,
- ...messageSendSelector(action.payload)
- ];
- break;
- case MESSAGE_DELIVERED:
- return [
- ...state,
- ...messageDelivered(action.payload)
- ];
- default:
- return state;
- }
+ switch (action.type) {
+ case MESSAGE_SEND:
+ return [
+ ...state,
+ ...messageSendSelector(action.payload)
+ ];
+ break;
+ case MESSAGE_DELIVERED:
+ return [
+ ...state,
+ ...messageDelivered(action.payload)
+ ];
+ default:
+ return state;
+ }
};
export {
- send,
- receive,
- dilivered,
- messages
-}
\ No newline at end of file
+ send,
+ receive,
+ dilivered,
+ messages
+};
diff --git a/src/core/resource/Registry.resource.js b/src/core/resource/Registry.resource.js
index fabfa3c804073978a9ff26bcab5de0f012e6baa5..46d7fbe19c9d0eb233c6fcc4f656c169c79dbeab 100644
--- a/src/core/resource/Registry.resource.js
+++ b/src/core/resource/Registry.resource.js
@@ -1,27 +1,27 @@
import { createAction, createReducer } from 'redux-act';
class ReducerRegistry {
- constructor() {
- this._emitChange = null;
- this._reducers = {};
- }
+ constructor() {
+ this._emitChange = null;
+ this._reducers = {};
+ }
- getReducers() {
- return { ...this._reducers };
- }
+ getReducers() {
+ return { ...this._reducers };
+ }
- register(name, reducer) {
- this._reducers = { ...this._reducers, [name]: reducer };
- if (this._emitChange) {
- this._emitChange(this.getReducers());
- }
+ register(name, reducer) {
+ this._reducers = { ...this._reducers, [name]: reducer };
+ if (this._emitChange) {
+ this._emitChange(this.getReducers());
}
+ }
- setChangeListener(listener) {
- this._emitChange = listener;
- }
+ setChangeListener(listener) {
+ this._emitChange = listener;
+ }
}
const reducerRegistry = new ReducerRegistry();
-export { reducerRegistry };
\ No newline at end of file
+export { reducerRegistry };
diff --git a/src/core/resource/Users.resource.js b/src/core/resource/Users.resource.js
index 7f85f659cc31df393d6a07f8368c4a2c46842ba3..99c33392d5a307dfb982ae5016c37289089f5009 100644
--- a/src/core/resource/Users.resource.js
+++ b/src/core/resource/Users.resource.js
@@ -2,43 +2,38 @@ const SMS_SENT = 'io/ok/sms_sent';
const LOGIN = 'io/ok2/login';
const LOGOUT = 'io/ok/logout';
-const sentSMS = (data) => {
- return {
- type: SMS_SENT,
- ...data
- }
-};
+const sentSMS = data => ({
+ type: SMS_SENT,
+ ...data
+});
-const login = (data) => {
- return {
- type: LOGIN,
- ...data
- }
-};
+const login = data => ({
+ type: LOGIN,
+ ...data
+});
const initialState = {
- auth: {
- token: '',
- readyState: false,
- status: 'uncomplete'
- },
+ auth: {
+ token: '',
+ readyState: false,
+ status: 'uncomplete'
+ }
};
const user = (state = initialState, action) => {
- switch(action.type) {
- case SMS_SENT:
- return {
- ...state,
- status: action.status,
- ...action.payload
- };
- case LOGIN:
- return {
- ...state,
- readyState: !action.readyState
- };
- default:
- return state;
- }
+ switch (action.type) {
+ case SMS_SENT:
+ return {
+ ...state,
+ status: action.status,
+ ...action.payload
+ };
+ case LOGIN:
+ return {
+ ...state,
+ readyState: !action.readyState
+ };
+ default:
+ return state;
+ }
};
-
diff --git a/src/core/resource/index.js b/src/core/resource/index.js
index 494f08b5abf6ff5cbe54ba86a665316c8d18a462..3c7e61f07c6d82559a9bb3f21aba229cda8567c4 100644
--- a/src/core/resource/index.js
+++ b/src/core/resource/index.js
@@ -4,8 +4,8 @@ import { messages } from './Messages.resource';
const rootReducer = combineReducers({
- provider,
- messages
+ provider,
+ messages
});
export { rootReducer };
diff --git a/src/core/sagas/Connector.saga.js b/src/core/sagas/Connector.saga.js
index f6ed40402538f0e472de1e6ec55d04fc9fd98c02..0e9ea703767ca18d05672c689ecd2157d19d0380 100644
--- a/src/core/sagas/Connector.saga.js
+++ b/src/core/sagas/Connector.saga.js
@@ -1,21 +1,22 @@
import { takeEvery, takeLatest, fork } from 'redux-saga/effects';
-import { effects } from 'redux-saga'
+import { effects } from 'redux-saga';
import { providerEventChannel } from '../services';
import { CONNECTING } from '../resource/Init.resource';
+
const { call, put, take } = effects;
const mqttSaga = function* (action) {
- const socketChannel = yield call(providerEventChannel, action);
- while (true) {
- const eventAction = yield take(socketChannel);
- yield put(eventAction);
- }
+ const socketChannel = yield call(providerEventChannel, action);
+ while (true) {
+ const eventAction = yield take(socketChannel);
+ yield put(eventAction);
+ }
};
const connector = function* (params) {
- yield take(CONNECTING, mqttSaga);
- yield fork(mqttSaga);
+ yield take(CONNECTING, mqttSaga);
+ yield fork(mqttSaga);
};
-export { connector };
\ No newline at end of file
+export { connector };
diff --git a/src/core/sagas/Messages.saga.js b/src/core/sagas/Messages.saga.js
index 3310dc3b78ddb1db9d0b28a9bbf45744ba9251f0..7a0caed8564f45c83f9a505e9b4f06b05ec2fa1c 100644
--- a/src/core/sagas/Messages.saga.js
+++ b/src/core/sagas/Messages.saga.js
@@ -2,11 +2,11 @@ import { takeEvery, take } from 'redux-saga/effects';
import { MESSAGE_SEND } from '../resource/Messages.resource';
function* handleSend(action) {
- console.log()
+ console.log();
}
function* watchSendRequest(params) {
- const { request } = yield take("*");
+ const { request } = yield take('*');
}
-export { watchSendRequest };
\ No newline at end of file
+export { watchSendRequest };
diff --git a/src/core/sagas/Root.saga.js b/src/core/sagas/Root.saga.js
index b56d60bed15703990aa5c09c9d41e8e73e8cf1d0..914b3232a4d0e8e795dd928126571489fad9eef5 100644
--- a/src/core/sagas/Root.saga.js
+++ b/src/core/sagas/Root.saga.js
@@ -3,10 +3,10 @@ import { connector } from './Connector.saga';
import { watchSendRequest } from './Messages.saga';
function* rootSaga() {
- yield all([
- connector,
- watchSendRequest
- ])
+ yield all([
+ connector,
+ watchSendRequest
+ ]);
}
-export { rootSaga };
\ No newline at end of file
+export { rootSaga };
diff --git a/src/core/sagas/index.js b/src/core/sagas/index.js
index bce69eba26a43608132f69d6caff7022d739c0e7..76e99fcc10e79bba5c08bc97fb24fcd72e303b32 100644
--- a/src/core/sagas/index.js
+++ b/src/core/sagas/index.js
@@ -1,3 +1,3 @@
import { rootSaga } from './Root.saga';
-export { rootSaga };
\ No newline at end of file
+export { rootSaga };
diff --git a/src/core/services/MqttClient.service.js b/src/core/services/MqttClient.service.js
index 15c6aba07352246ad1d28d5064cf3d8a329f4d68..3d4b6bceaec1e492b4add99c7ca5c51f56465216 100644
--- a/src/core/services/MqttClient.service.js
+++ b/src/core/services/MqttClient.service.js
@@ -6,40 +6,39 @@ import { MqttLocaforageStore } from '../store';
import { incomeDB, browserStorage } from '../store';
import mqttConfig from '../configs/MqttInit.config';
-let client;
-const setPrefix = (id) => (mqttConfig.authPrefix + id);
+const setPrefix = id => (mqttConfig.authPrefix + id);
export const genClientId = () => (
- Math.random().toString(36).substring(2)
+ Math.random().toString(36).substring(2)
+ (new Date()).getTime().toString(36)
);
const initProvider = () => {
- let connectPath = `${ mqttConfig.protocol }://${ mqttConfig.host }:${ mqttConfig.port }/${ mqttConfig.provider }`;
- let config = {
- clientId: setPrefix(genClientId()),
- password: browserStorage.getItem('token'),
- ...mqttConfig
- };
- let client = mqtt.connect(connectPath, config);
-
- const xtendedClient = Object.assign(client, {
- onClose: () => {
-
- },
-
- send: (...args) => {
- args[0] = topic(args[0]);
- const message = args[1];
- if(message) {
- args[1] = encode(message)
- }
- return client.publish(...args);
- }
- });
-
- return xtendedClient;
+ const connectPath = `${mqttConfig.protocol}://${mqttConfig.host}:${mqttConfig.port}/${mqttConfig.provider}`;
+ const config = {
+ clientId: setPrefix(genClientId()),
+ password: browserStorage.getItem('token'),
+ ...mqttConfig
+ };
+ const client = mqtt.connect(connectPath, config);
+
+ const xtendedClient = Object.assign(client, {
+ onClose: () => {
+
+ },
+
+ send: (...args) => {
+ args[0] = topic(args[0]);
+ const message = args[1];
+ if (message) {
+ args[1] = encode(message);
+ }
+ return client.publish(...args);
+ }
+ });
+
+ return xtendedClient;
};
-export default initProvider;
\ No newline at end of file
+export default initProvider;
diff --git a/src/core/services/MqttEventChannel.service.js b/src/core/services/MqttEventChannel.service.js
index 720d69236df50a6ce7b8ed0132d9bc9415b0ada3..1ed8db855a92874ea1346243a2e0e5662641cf94 100644
--- a/src/core/services/MqttEventChannel.service.js
+++ b/src/core/services/MqttEventChannel.service.js
@@ -1,9 +1,9 @@
import mqtt from 'mqtt';
-import { buffers, eventChannel } from 'redux-saga'
+import { buffers, eventChannel } from 'redux-saga';
import { put } from 'redux-saga/effects';
-import { bindActionCreators } from 'redux'
+import { bindActionCreators } from 'redux';
import { topic } from '../protocols';
-//import { Store as MQTTLocalForageStore } from 'mqtt-localforage-store';
+// import { Store as MQTTLocalForageStore } from 'mqtt-localforage-store';
import { formatter } from '../messages/Converter.message';
import { validate } from '../protocols/Validator.protocol';
import initProvider from './MqttClient.service';
@@ -14,43 +14,41 @@ import { mockReceivePacket } from '../../../tools/ErlangDebugger.tools';
const bufferSize = 100;
-const providerEventChannel = () => eventChannel(
- emitter => {
- const client = initProvider();
- const boundEventHandlers = bindActionCreators(eventHandlers, emitter);
- client.on(eventTypes.CONNECT, function() {
- boundEventHandlers.connected();
- //redux log
- });
- client.on(eventTypes.CLOSE, function() {
- //redux log
- boundEventHandlers.close();
- });
- client.on(eventTypes.ERROR, function(e) {
- console.log('Error', e);
- boundEventHandlers.error(e)
- });
- client.on(eventTypes.MESSAGE, function(topic, message, packet) {
- boundEventHandlers.publish(topic, message, packet)
- });
- client.on(eventTypes.PACKETRECEIVE, function (packet = {}) {
- if(!packet.payload) {
- return;
- }
- const processedResponse = formatter(mockReceivePacket);
- let { event, response } = validate(processedResponse);
+const providerEventChannel = () => eventChannel((emitter) => {
+ const client = initProvider();
+ const boundEventHandlers = bindActionCreators(eventHandlers, emitter);
+ client.on(eventTypes.CONNECT, () => {
+ boundEventHandlers.connected();
+ // redux log
+ });
+ client.on(eventTypes.CLOSE, () => {
+ // redux log
+ boundEventHandlers.close();
+ });
+ client.on(eventTypes.ERROR, (e) => {
+ console.log('Error', e);
+ boundEventHandlers.error(e);
+ });
+ client.on(eventTypes.MESSAGE, (topic, message, packet) => {
+ boundEventHandlers.publish(topic, message, packet);
+ });
+ client.on(eventTypes.PACKETRECEIVE, (packet = {}) => {
+ if (!packet.payload) {
+ return;
+ }
+ const processedResponse = formatter(mockReceivePacket);
+ const { event, response } = validate(processedResponse);
- console.log('PACKETRECEIVE', packet);
- });
- client.on(eventTypes.PACKETSEND, function(packet) {
- console.log('PACKETSEND', packet);
- });
+ console.log('PACKETRECEIVE', packet);
+ });
+ client.on(eventTypes.PACKETSEND, (packet) => {
+ console.log('PACKETSEND', packet);
+ });
- //buffers.expanding(bufferSize);
- return client.end
- }
-);
+ // buffers.expanding(bufferSize);
+ return client.end;
+});
-export default providerEventChannel;
\ No newline at end of file
+export default providerEventChannel;
diff --git a/src/core/services/index.js b/src/core/services/index.js
index 4c6198970ab85380bb19c843725af465eb8ccc3a..d370b0f44bfeee6be1649565e317a27710720d24 100644
--- a/src/core/services/index.js
+++ b/src/core/services/index.js
@@ -1,4 +1,4 @@
import initProvider, { genClientId } from './MqttClient.service';
import providerEventChannel from './MqttEventChannel.service';
-export { initProvider, providerEventChannel, genClientId };
\ No newline at end of file
+export { initProvider, providerEventChannel, genClientId };
diff --git a/src/core/store/Browser.store.js b/src/core/store/Browser.store.js
index 4132cc1d6535d8e89c52c41f1cdb1e936e7df12e..54013bf8d484b0e61fe21eb86745de371e4f1330 100644
--- a/src/core/store/Browser.store.js
+++ b/src/core/store/Browser.store.js
@@ -1,24 +1,24 @@
import { browserStorage } from './index';
import { genClientId } from '../services';
-import { DEV_KEY, CLIENT} from '../configs/BrowserStorage.config';
+import { DEV_KEY, CLIENT } from '../configs/BrowserStorage.config';
const setupDevEntry = () => {
- let devKey = browserStorage.getItem(DEV_KEY) || genClientId();
+ const devKey = browserStorage.getItem(DEV_KEY) || genClientId();
- browserStorage.setItem(DEV_KEY, devKey);
+ browserStorage.setItem(DEV_KEY, devKey);
- return devKey;
+ return devKey;
};
-//emqttd_
-const setupClientEntry = (prefix = "reg_") => {
- let devKey = setupDevEntry();
+// emqttd_
+const setupClientEntry = (prefix = 'reg_') => {
+ const devKey = setupDevEntry();
- let clientKey = browserStorage.getItem(CLIENT) || prefix + devKey;
- browserStorage.setItem(CLIENT, clientKey);
+ const clientKey = browserStorage.getItem(CLIENT) || prefix + devKey;
+ browserStorage.setItem(CLIENT, clientKey);
- return clientKey;
+ return clientKey;
};
-export { setupClientEntry, setupDevEntry };
\ No newline at end of file
+export { setupClientEntry, setupDevEntry };
diff --git a/src/core/store/Configure.dev.store.js b/src/core/store/Configure.dev.store.js
index 8336f6704a1b675210d5a0edd75f5d855e354b40..8c17a2f973598173a4e8e7ff28452711bf7c7573 100644
--- a/src/core/store/Configure.dev.store.js
+++ b/src/core/store/Configure.dev.store.js
@@ -1,6 +1,6 @@
import { applyMiddleware, createStore, compose } from 'redux';
import createSagaMiddleware from 'redux-saga';
-import { loadingBarMiddleware } from 'react-redux-loading-bar'
+import { loadingBarMiddleware } from 'react-redux-loading-bar';
import reduxImmutableStateInvariant from 'redux-immutable-state-invariant';
import logger from 'redux-logger';
import trottle from 'lodash/throttle';
@@ -15,15 +15,12 @@ const configureStore = () => {
const middlewares = [
reduxImmutableStateInvariant(),
sagaMiddleware,
- //loadingBarMiddleware({ scope: 'page' }),
+ // loadingBarMiddleware({ scope: 'page' }),
logger
];
const composeExtenders = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
- const store = createStore(rootReducer, {}, composeExtenders(
- applyMiddleware(...middlewares)
- )
- );
+ const store = createStore(rootReducer, {}, composeExtenders(applyMiddleware(...middlewares)));
sagaMiddleware.run(rootSaga);
diff --git a/src/core/store/ConfigureBrowser.store.js b/src/core/store/ConfigureBrowser.store.js
index ce78caa203f8acd5d9af46a995b10052d9e4c3c1..cefb38c9bcdb63e6a1855116c1ec3830b968af08 100644
--- a/src/core/store/ConfigureBrowser.store.js
+++ b/src/core/store/ConfigureBrowser.store.js
@@ -1,11 +1,11 @@
import localforage from 'localforage';
const config = {
- driver: localforage.INDEXEDDB,
- version: 1
+ driver: localforage.INDEXEDDB,
+ version: 1
};
-const incomeDB = localforage.createInstance({name: 'incomeDB',...config});
-const outcomeDB = localforage.createInstance({name: 'outcomeDB',...config});
+const incomeDB = localforage.createInstance({ name: 'incomeDB', ...config });
+const outcomeDB = localforage.createInstance({ name: 'outcomeDB', ...config });
-export { incomeDB, outcomeDB };
\ No newline at end of file
+export { incomeDB, outcomeDB };
diff --git a/src/core/store/MqttLocaforage.store.js b/src/core/store/MqttLocaforage.store.js
index 80474ee042b9070bf382d4a90338a9d8b9b9887f..ea1dff9d0dabffca448cad664f6f33e79a5fceaa 100644
--- a/src/core/store/MqttLocaforage.store.js
+++ b/src/core/store/MqttLocaforage.store.js
@@ -1,77 +1,76 @@
import { Readable } from 'readable-stream';
class MqttLocaforageStore {
- constructor(localForageDb, options) {
- this.inflights = localForageDb;
- this.options = options || {};
- this.options.clean = this.options.clean || true;
- }
-
- put(packet, cb) {
- this.inflights.setItem(`msgid_${packet.messageId}`, packet, cb);
- return this;
- }
-
- createStream() {
- const stream = new Readable({ objectMode: true });
- const inflights = this.inflights;
- let destroyed = false;
-
- stream._read = function() {
- if (destroyed === true) {
- this.push(null);
- return;
- }
-
- inflights.iterate((value, key) => {
- this.push(value);
- return;
- });
- };
-
- stream._destroy = function(err, cb) {
- if (destroyed) return;
-
- destroyed = true;
-
- this.emit('close');
- cb();
+ constructor(localForageDb, options) {
+ this.inflights = localForageDb;
+ this.options = options || {};
+ this.options.clean = this.options.clean || true;
+ }
+
+ put(packet, cb) {
+ this.inflights.setItem(`msgid_${packet.messageId}`, packet, cb);
+ return this;
+ }
+
+ createStream() {
+ const stream = new Readable({ objectMode: true });
+ const inflights = this.inflights;
+ let destroyed = false;
+
+ stream._read = function () {
+ if (destroyed === true) {
+ this.push(null);
+ return;
+ }
+
+ inflights.iterate((value, key) => {
+ this.push(value);
+ });
+ };
+
+ stream._destroy = function (err, cb) {
+ if (destroyed) return;
+
+ destroyed = true;
+
+ this.emit('close');
+ cb();
+ };
+
+ return stream;
+ }
+
+ get(packet, cb) {
+ this.inflights.getItem(`msgid_${packet.messageId}`, cb);
+ return this;
+ }
+
+ del(packet, cb) {
+ this.inflights.getItem(`msgid_${packet.messageId}`, (err, result) => {
+ this.inflights.removeItem(`msgid_${packet.messageId}`, (err) => {
+ if (err) {
+ cb(err);
+ return;
}
- return stream;
- }
-
- get(packet, cb) {
- this.inflights.getItem(`msgid_${packet.messageId}`, cb);
- return this;
- }
+ cb(null, result);
+ });
+ });
- del(packet, cb) {
- this.inflights.getItem(`msgid_${packet.messageId}`, (err, result) => {
- this.inflights.removeItem(`msgid_${packet.messageId}`, (err) => {
- if (err) {
- cb(err);
- return;
- }
+ return this;
+ }
- cb(null, result);
- });
- });
+ close(cb) {
+ const callback = cb || (() => {});
- return this;
+ if (this.options.clean === false) {
+ callback(null);
+ return this;
}
- close(cb) {
- const callback = cb || (() => {});
-
- if (this.options.clean === false) {
- callback(null);
- return this;
- }
-
- this.inflights.clear(callback);
- return this;
- }
+ this.inflights.clear(callback);
+ return this;
+ }
}
export default MqttLocaforageStore;
diff --git a/src/core/store/index.js b/src/core/store/index.js
index 99700df55dda5ecb388dc1fc790ab0f2b9f07386..1ba3ec14f4594ec7b8eaef6519d9701fed9a3e1a 100644
--- a/src/core/store/index.js
+++ b/src/core/store/index.js
@@ -4,15 +4,15 @@ import MqttLocaforageStore from './MqttLocaforage.store';
console.log(process.env.NODE_ENV);
-const configureStore = process.env.NODE_ENV === "development"
- ? require('./Configure.dev.store')
- : '';
+const configureStore = process.env.NODE_ENV === 'development'
+ ? require('./Configure.dev.store')
+ : '';
const browserStorage = localStorage !== 'undefined' ? localStorage : outcomeDB;
- export {
- setupClientEntry,
- browserStorage,
- configureStore,
- MqttLocaforageStore
+export {
+ setupClientEntry,
+ browserStorage,
+ configureStore,
+ MqttLocaforageStore
};
diff --git a/src/core/utils/utf8.util.js b/src/core/utils/utf8.util.js
index a9f83a6bc8b356206ca143f07384b11835d059fc..9633ae64c0139642bd78fb8b88d2a76beea8ba1b 100644
--- a/src/core/utils/utf8.util.js
+++ b/src/core/utils/utf8.util.js
@@ -1,5 +1,9 @@
-function utf8_toByteArray(str) { return { t: 107, v: (new TextEncoder("utf-8")).encode(str) }; };
-function utf8_dec(ab) { if (!(ab instanceof ArrayBuffer)) ab = new Uint8Array(utf8_toByteArray(ab).v).buffer;
- return (new TextDecoder()).decode(ab); }
+/* eslint-disable */
-export { utf8_dec, utf8_toByteArray }
+function utf8_toByteArray(str) { return { t: 107, v: (new TextEncoder('utf-8')).encode(str) }; }
+function utf8_dec(ab) {
+ if (!(ab instanceof ArrayBuffer)) ab = new Uint8Array(utf8_toByteArray(ab).v).buffer;
+ return (new TextDecoder()).decode(ab);
+}
+
+export { utf8_dec, utf8_toByteArray };
diff --git a/src/index.js b/src/index.js
index 0c537a1c023874c424bcaf82aefda4ad4ec0f7d4..42a08b20086e293387f95aee96c3897afa4838df 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,20 +1,21 @@
-import "regenerator-runtime/runtime";
-import Raven from './core/loggers/SentryError.logger';
-import React from 'react';
-import { render } from 'react-dom';
-import Root from './root';
+import 'regenerator-runtime/runtime';
+
-import { configureStore } from './core/store'
+import React from 'react';
+import Root from './root';
import Reboot from 'material-ui/Reboot';
+import { configureStore } from './core/store';
+import { render } from 'react-dom';
+
require('./favicon.ico');
render(
-
-
-
-
,
+
+
+
+
,
- document.getElementById('app')
+ document.getElementById('app')
);
diff --git a/src/modules/Chats/Chats.js b/src/modules/Chats/Chats.js
index 7c0176e910ab2c0777485c8fa78de27cb17c87f2..b505f0f262a57dba7e359e1559e0ae1618dc4bbc 100644
--- a/src/modules/Chats/Chats.js
+++ b/src/modules/Chats/Chats.js
@@ -1,13 +1,14 @@
import React, { PureComponent } from 'react';
import { ActivityList } from './../../containers';
-export default class Chats extends PureComponent {
- render() {
- return (
-
-
+
+export default class Chats extends PureComponent {
+ render() {
+ return (
+
- );
- }
+
+ );
+ }
}
diff --git a/src/modules/Dashboard/Dashboard.js b/src/modules/Dashboard/Dashboard.js
index d1222062883da029c655154607962807823b15b7..4e6748782e5db34ab5c8cdc8fa4d15a0b7eefa65 100644
--- a/src/modules/Dashboard/Dashboard.js
+++ b/src/modules/Dashboard/Dashboard.js
@@ -1,55 +1,51 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { PaperWithDrop } from '../../componets';
-import {ChatListItem} from '../../componets';
-import { withStyles } from 'material-ui/styles'
-import { List, Grid } from 'material-ui' ;
-import {ChatModal} from "../../containers/ChatModal/ChatModal";
+import { ChatListItem } from '../../componets';
+import { withStyles } from 'material-ui/styles';
+import { List, Grid } from 'material-ui';
+import { ChatModal } from '../../containers/ChatModal/ChatModal';
const styles = {
- item: {
- marginRight: 8,
- width: 'calc(33.33% - 16px)'
- }
-}
+ item: {
+ marginRight: 8,
+ width: 'calc(33.33% - 16px)'
+ }
+};
export class Dashboard extends Component {
- constructor(props) {
- super(props);
+ constructor(props) {
+ super(props);
- this.state ={
- openChat: false
- }
- }
+ this.state = {
+ openChat: false
+ };
+ }
static propTypes = {
- classes: PropTypes.object.isRequired
+ classes: PropTypes.object.isRequired
};
render() {
- const mockUsers = [{name:'John Smith'},{name:'John Smith2'},{name:'John Smith3'},{name:'John Smith4'},{name:'John Smith5'}]
- let sideList = [];
-
- mockUsers.map((item,index)=>(
- sideList.push(
-
- {this.setState({openChat: !this.state.openChat})}}/>
-
-
- ))
- );
-
- const { classes } = this.props;
- const { openChat } = this.state;
- return (
-
-
-
-
- this.setState({openChat: false})} />
-
-
- );
+ const mockUsers = [{ name: 'John Smith' }, { name: 'John Smith2' }, { name: 'John Smith3' }, { name: 'John Smith4' }, { name: 'John Smith5' }];
+ const sideList = [];
+
+ mockUsers.map((item, index) => (
+ sideList.push(
+ { this.setState({ openChat: !this.state.openChat }); }} />
+
)));
+
+ const { classes } = this.props;
+ const { openChat } = this.state;
+ return (
+
+
+
+
+ this.setState({ openChat: false })} />
+
+
+ );
}
}
-export default withStyles(styles)(Dashboard);
\ No newline at end of file
+export default withStyles(styles)(Dashboard);
diff --git a/src/modules/Home/Home.js b/src/modules/Home/Home.js
index 5b5c98d1037a7eaafe558124f8aec5ea8b212927..3f35b5357c0264eab792628deba81baf7cfdf11d 100644
--- a/src/modules/Home/Home.js
+++ b/src/modules/Home/Home.js
@@ -1,10 +1,10 @@
import React, { PureComponent } from 'react';
-export default class Home extends PureComponent {
- render() {
- return (
-
HomePage
- );
- }
+export default class Home extends PureComponent {
+ render() {
+ return (
+
HomePage
+ );
+ }
}
diff --git a/src/modules/Login/Login.js b/src/modules/Login/Login.js
index 526e5482e7f816ac89f9cb4dbbbeed7e512426a8..47f414b2f0cbdf0da148da4c2462cc1512019db0 100644
--- a/src/modules/Login/Login.js
+++ b/src/modules/Login/Login.js
@@ -7,72 +7,71 @@ import TextField from 'material-ui/TextField';
import Button from 'material-ui/Button';
const styles = theme => ({
- root: {
- flexGrow: 1,
- marginTop: 30,
- },
- paper: {
- padding: 16,
- textAlign: 'center',
- color: blue[500]
- // color: theme.palette.text.secondary,
- },
- textField: {
- marginLeft: theme.spacing.unit,
- marginRight: theme.spacing.unit,
- width: 200,
- },
- button: {
- margin: theme.spacing.unit,
- },
+ root: {
+ flexGrow: 1,
+ marginTop: 30
+ },
+ paper: {
+ padding: 16,
+ textAlign: 'center',
+ color: blue[500]
+ // color: theme.palette.text.secondary,
+ },
+ textField: {
+ marginLeft: theme.spacing.unit,
+ marginRight: theme.spacing.unit,
+ width: 200
+ },
+ button: {
+ margin: theme.spacing.unit
+ }
});
-export class Login extends PureComponent {
+export class Login extends PureComponent {
+ constructor(props) {
+ super(props);
+ }
- constructor(props) {
- super(props);
- }
+ render() {
+ const { classes } = this.props;
- render() {
- const { classes } = this.props;
-
- return (
-
-
-
-
+ return (
+
+
+
+
Login Test Container
-
-
-
-
-
-
-
-
-
-
-
- );
- }
+
+
+
+
+
+
+ );
+ }
}
-export default withStyles(styles)(Login);
\ No newline at end of file
+export default withStyles(styles)(Login);
diff --git a/src/modules/SignUp/SignUp.js b/src/modules/SignUp/SignUp.js
index 7a3e1e8d379895fe89db4d44499019ac105e9f66..04a0e2c7852e20169946f1ffe3e3140d9be6eafd 100644
--- a/src/modules/SignUp/SignUp.js
+++ b/src/modules/SignUp/SignUp.js
@@ -5,123 +5,124 @@ export default class SignUp extends Component {
};
constructor(props) {
- super(props);
- this.state = {
+ super(props);
+ this.state = {
- };
+ };
}
render() {
- return (
-
-
-
-
-
-
-
-
-
Phone Number
-
-
Please choose your country and enter your phone number.
-
-
-
-
-
-
-
-
-
-
-
-
Your Name
-
-
How would you like to be called?
-
-
-
-
-
-
-
-
-
-
-
- Done
-
-
-
-
-
-
-
-
-
-
+ return (
+
+
+
+
+
+
+
+
+
Phone Number
+
+
Please choose your country and enter your phone number.
+
+
+
+
+
+
+
+
+
+
+
+
Your Name
+
+
How would you like to be called?
+
+
+
+
+
+
+
+
+
+
+
+ Done
+
+
+
+
+
+
+
-
-
-
-
)
+ Service.
+
+
+
+
+
+
+
+
+
);
}
-}
\ No newline at end of file
+}
diff --git a/src/modules/index.js b/src/modules/index.js
index 8411bd6a52cbb1304c55c0e30e8f0efd9b0379fd..71c5755c0a2646b10e32f6e3e9bfe824501ba3a9 100644
--- a/src/modules/index.js
+++ b/src/modules/index.js
@@ -5,9 +5,9 @@ import Dashboard from './Dashboard/Dashboard';
import Chats from './Chats/Chats';
export {
- Home,
- Login,
- SignUp,
- Dashboard,
- Chats
-};
\ No newline at end of file
+ Home,
+ Login,
+ SignUp,
+ Dashboard,
+ Chats
+};
diff --git a/src/pages/App/App.js b/src/pages/App/App.js
index 7bd594e7c20dd9fae6b0144a534133f572fe6aae..15ab462a342a0079cf599b27a21a374dbfed1b82 100644
--- a/src/pages/App/App.js
+++ b/src/pages/App/App.js
@@ -1,43 +1,41 @@
import React, { Component, PropTypes } from 'react';
import { MuiThemeProvider } from 'material-ui';
-import {createMuiTheme} from "material-ui/styles/index";
+import { createMuiTheme } from 'material-ui/styles/index';
export default class App extends Component {
-
constructor(props) {
super(props);
}
static propTypes = {
};
- componentWillMount(){
+ componentWillMount() {
}
renderChildren(globalProps, childProps) {
- return React.cloneElement(globalProps, childProps);
+ return React.cloneElement(globalProps, childProps);
}
render() {
- const theme = createMuiTheme({
- palette: {
- type:'dark',
- primary: {
- main: '#1b1c20'
- },
- background:{
- paper: '#24262b'
- }
- },
- });
- console.log(theme);
+ const theme = createMuiTheme({
+ palette: {
+ type: 'dark',
+ primary: {
+ main: '#1b1c20'
+ },
+ background: {
+ paper: '#24262b'
+ }
+ }
+ });
+ console.log(theme);
return (
-
-
- { this.renderChildren(this.props.children, {}) }
-
-
+
+
+ { this.renderChildren(this.props.children, {}) }
+
+
- )
+ );
}
}
-
diff --git a/src/pages/NinjaApp/NinjaApp.js b/src/pages/NinjaApp/NinjaApp.js
index 7a3fafa259fca50896929936a51f1307ed2690ed..1aee7c89324029e74283de399b5090bc8d05585e 100644
--- a/src/pages/NinjaApp/NinjaApp.js
+++ b/src/pages/NinjaApp/NinjaApp.js
@@ -1,53 +1,52 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect, dispatch } from 'react-redux';
-import { MenuAppBar,ActionMenu } from '../../containers';
-import {Grid} from 'material-ui';
-import {withStyles} from 'material-ui/styles';
+import { MenuAppBar, ActionMenu } from '../../containers';
+import { Grid } from 'material-ui';
+import { withStyles } from 'material-ui/styles';
const styles = theme => ({
- wrapper: {
- padding: '73px 0 0 107px',
- minHeight: '100vh',
- background: theme.palette.primary.main
- },
+ wrapper: {
+ padding: '73px 0 0 107px',
+ minHeight: '100vh',
+ background: theme.palette.primary.main
+ }
-})
+});
export class Dashboard extends Component {
-
- constructor(props) {
- super(props);
- }
+ constructor(props) {
+ super(props);
+ }
static propTypes = {
- classes: PropTypes.object.isRequired
+ classes: PropTypes.object.isRequired
};
- componentWillMount(){
+ componentWillMount() {
}
renderChildren(globalProps, childProps) {
- return React.cloneElement(globalProps, childProps);
+ return React.cloneElement(globalProps, childProps);
}
render() {
- console.log(this.props)
- const { classes } = this.props;
+ console.log(this.props);
+ const { classes } = this.props;
- return (
-
-
-
+ return (
+
+
+
- { this.renderChildren(this.props.children, {}) }
+ { this.renderChildren(this.props.children, {}) }
-
+
- )
+ );
}
}
-export default withStyles(styles)(Dashboard)
+export default withStyles(styles)(Dashboard);
diff --git a/src/pages/NotFound/NotFoundPage.js b/src/pages/NotFound/NotFoundPage.js
index a805b3c8ff533242c5e06748c08896d4285e5257..5ba368f02f350741c2e1592292ba6ee6021ccf68 100644
--- a/src/pages/NotFound/NotFoundPage.js
+++ b/src/pages/NotFound/NotFoundPage.js
@@ -3,7 +3,7 @@ import React, { PureComponent } from 'react';
export default class NotFoundPage extends PureComponent {
render() {
return (
-
404
+
404
);
}
}
diff --git a/src/pages/Unauthorized/UnauthorizedPage.js b/src/pages/Unauthorized/UnauthorizedPage.js
index 99feeb7ce961a82b1882ef93422d9964e4f17660..4daf6f912ab4f35032534866523164dd232ae327 100644
--- a/src/pages/Unauthorized/UnauthorizedPage.js
+++ b/src/pages/Unauthorized/UnauthorizedPage.js
@@ -11,15 +11,15 @@ export default class UnauthorizedPage extends Component {
}
renderChildren(globalProps, childProps) {
- return React.cloneElement(globalProps, childProps);
+ return React.cloneElement(globalProps, childProps);
}
render() {
console.log(this.props.children);
return (
-
- { this.renderChildren(this.props.children, {}) }
-
- )
+
+ { this.renderChildren(this.props.children, {}) }
+
+ );
}
}
diff --git a/src/pages/index.js b/src/pages/index.js
index f624d2e2cabe6009ea28521fc45c8da5c46a47e1..621042484a198566a9ec35fe513cb09dad611be9 100644
--- a/src/pages/index.js
+++ b/src/pages/index.js
@@ -4,8 +4,8 @@ import UnauthorizedPage from './Unauthorized/UnauthorizedPage';
import NinjaApp from './NinjaApp/NinjaApp';
export {
- App,
- NotFoundPage,
- UnauthorizedPage,
- NinjaApp
-};
\ No newline at end of file
+ App,
+ NotFoundPage,
+ UnauthorizedPage,
+ NinjaApp
+};
diff --git a/src/root.js b/src/root.js
index 85662069442e5dc710d5762f3546cd2219366545..cacdb418b64a31eb8d16ef0d539248ba53b8aefb 100644
--- a/src/root.js
+++ b/src/root.js
@@ -1,26 +1,26 @@
import React, { Component } from 'react';
import Reboot from 'material-ui/Reboot';
import { Provider } from 'react-redux';
-//import LoadingBar from 'react-redux-loading-bar'
+// import LoadingBar from 'react-redux-loading-bar'
import { Router, browserHistory } from 'react-router';
import routes from './routes';
-import { connecting } from './core/resource/Init.resource'
+import { connecting } from './core/resource/Init.resource';
class Root extends Component {
- componentDidMount() {
- let t = new Date();
- // this.props.store.dispatch(connecting(t))
- }
- render() {
- const { store } = this.props;
- return (
-
-
- { routes(store) }
-
-
- )
- }
+ componentDidMount() {
+ const t = new Date();
+ // this.props.store.dispatch(connecting(t))
+ }
+ render() {
+ const { store } = this.props;
+ return (
+
+
+ { routes(store) }
+
+
+ );
+ }
}
-export default Root;
\ No newline at end of file
+export default Root;
diff --git a/src/routes.js b/src/routes.js
index ed61dfc91dd515a7c94da9f1e0304868cda464bc..0c9a3b0d398f7841e5481aa32545d20ad13bd18a 100644
--- a/src/routes.js
+++ b/src/routes.js
@@ -1,26 +1,27 @@
import React from 'react';
import { IndexRoute, Route } from 'react-router';
import { App, NotFoundPage, UnauthorizedPage, NinjaApp } from './pages';
-import { Home, Login, SignUp,Dashboard, Chats } from './modules';
-export default () => {
- /**
+import { Home, Login, SignUp, Dashboard, Chats } from './modules';
+
+export default () =>
+/**
* Please keep routes in alphabetical order
*/
- return (
-
-
-
-
-
-
+ (
+
+
+
+
+
+
+
+
+
+
-
-
-
+
-
+
+
+ );
-
-
- );
-};
\ No newline at end of file
diff --git a/src/vendors.js b/src/vendors.js
index 938e7f84a597231f2dfb15c4ae278250466a5553..5b12117b8f1a749cdff73affadd4d2f9977a5224 100644
--- a/src/vendors.js
+++ b/src/vendors.js
@@ -5,5 +5,5 @@ module.exports = [
'react-redux',
'react-router',
'react-select',
- 'redux',
-];
\ No newline at end of file
+ 'redux'
+];
diff --git a/tools/ErlangDebugger.tools.js b/tools/ErlangDebugger.tools.js
index b83aa6b295450061630ebaeae8bad95a79b65e25..963918e8b751024c6b742aad7f65ecfd3e086e90 100644
--- a/tools/ErlangDebugger.tools.js
+++ b/tools/ErlangDebugger.tools.js
@@ -1,3 +1,5 @@
+/* eslint-disable */
+
function binPayload(mas) {
var s = ">> rp(binary_to_term(<<";
for (var i =0; i