diff --git a/dist/build.js b/dist/build.js index b99f9a1..22e3664 100644 --- a/dist/build.js +++ b/dist/build.js @@ -1 +1 @@ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e){"use strict";function n(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e0){var h=a(Math.max.apply(Math,n(o)).toString());return t.client.getObject(e+h)}return t.client.getListing(r).then(function(e){var s=Object.keys(e).map(function(t){return parseInt(t.substr(0,2))}).map(function(e){return e0){var o=a(Math.max.apply(Math,n(s)).toString());return t.client.getListing(r+o+"/").then(function(e){var i=Object.keys(e).map(function(t){return parseInt(t)}),s=a(Math.max.apply(Math,n(i)).toString());return t.client.getObject(r+o+"/"+s)})}return t.client.getListing(i).then(function(e){var r=Object.keys(e).map(function(t){return parseInt(t.substr(0,4))}).map(function(e){return e0){var s=Math.max.apply(Math,n(r)).toString();return t.client.getListing(i+s+"/").then(function(e){var r=Object.keys(e).map(function(t){return parseInt(t.substr(0,2))}),o=a(Math.max.apply(Math,n(r)).toString());return t.client.getListing(i+s+"/"+o+"/").then(function(e){var r=Object.keys(e).map(function(t){return parseInt(t)}),h=a(Math.max.apply(Math,n(r)).toString());return t.client.getObject(i+s+"/"+o+"/"+h)})})}return!1})})})},_sync:function(t){return RemoteStorage.log("[chat-messages] Writing archive object",t),this.client.storeObject("daily-archive",this.path,t).then(function(){return RemoteStorage.log("[chat-messages] Archive written to remote storage"),!0},function(t){return console.log("[chat-messages] Error trying to store object",t),t})}};var a=function(t){return t=String(t),1===t.length&&(t="0"+t),t},o=function(t){return{year:t.getUTCFullYear(),month:a(t.getUTCMonth()+1),day:a(t.getUTCDate())}},h={DailyArchive:s,privateClient:t,publicClient:e};return{exports:h}};e.default={name:"chat-messages",builder:i}}])}); \ No newline at end of file +!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var s=n[r]={exports:{},id:r,loaded:!1};return t[r].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e){"use strict";function n(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e0){var u=a(Math.max.apply(Math,n(o)).toString());return t.client.getObject(e+u)}return t.client.getListing(r).then(function(e){var i=Object.keys(e).map(function(t){return parseInt(t.substr(0,2))}).map(function(e){return e0){var o=a(Math.max.apply(Math,n(i)).toString());return t.client.getListing(r+o+"/").then(function(e){var s=Object.keys(e).map(function(t){return parseInt(t)}),i=a(Math.max.apply(Math,n(s)).toString());return t.client.getObject(r+o+"/"+i)})}return t.client.getListing(s).then(function(e){var r=Object.keys(e).map(function(t){return parseInt(t.substr(0,4))}).map(function(e){return e0){var i=Math.max.apply(Math,n(r)).toString();return t.client.getListing(s+i+"/").then(function(e){var r=Object.keys(e).map(function(t){return parseInt(t.substr(0,2))}),o=a(Math.max.apply(Math,n(r)).toString());return t.client.getListing(s+i+"/"+o+"/").then(function(e){var r=Object.keys(e).map(function(t){return parseInt(t)}),u=a(Math.max.apply(Math,n(r)).toString());return t.client.getObject(s+i+"/"+o+"/"+u)})})}return!1})})})},_sync:function(t){return console.debug("[chat-messages] Writing archive object",t),this.client.storeObject("daily-archive",this.path,t).then(function(){return console.debug("[chat-messages] Archive written to remote storage"),!0},function(t){return console.warn("[chat-messages] Error trying to store object",t),t})}};var a=function(t){return t=String(t),1===t.length&&(t="0"+t),t},o=function(t){return{year:t.getUTCFullYear(),month:a(t.getUTCMonth()+1),day:a(t.getUTCDate())}},u={DailyArchive:i,privateClient:t,publicClient:e};return{exports:u}};e.default={name:"chat-messages",builder:s}}])}); \ No newline at end of file diff --git a/package.json b/package.json index cc9404b..37fd0b7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "remotestorage-module-chat-messages", - "version": "1.0.0", + "version": "1.0.1", "description": "Stores chat messages in daily archive files", "main": "./dist/build.js", "scripts": {