Various pre-release fixes #5

Merged
raucao merged 5 commits from dev/prerelease_fixes into master 2021-09-13 11:43:27 +00:00
3 changed files with 13 additions and 10 deletions

View File

@ -12,9 +12,10 @@
},
"author": "Kosmos Contributors <mail@kosmos.org> (https://kosmos.org)",
"license": "MIT",
"homepage": "https://gitea.kosmos.org/kosmos/rs-module-chat-messages",
"repository": {
"type": "git",
"url": "https://github.com/67P/remotestorage-module-chat-messages.git"
"url": "https://gitea.kosmos.org/kosmos/rs-module-chat-messages.git"
},
"devDependencies": {
"@babel/core": "^7.14.8",

View File

@ -20,7 +20,7 @@ const ChatMessages = function (privateClient, publicClient) {
*
* @example
* {
* "@context": "https://kosmos.org/ns/v1",
* "@context": "https://kosmos.org/ns/v2",
* "@id": "chat-messages/irc.libera.chat/channels/kosmos/",
* "@type": "ChatChannel",
* "service": {
@ -48,8 +48,8 @@ const ChatMessages = function (privateClient, publicClient) {
"properties": {
"@context": {
"type": "string",
"default": "https://kosmos.org/ns/v1",
"enum": ["https://kosmos.org/ns/v1"]
"default": "https://kosmos.org/ns/v2",
"enum": ["https://kosmos.org/ns/v2"]
},
"@id": {
"type": "string",
@ -141,8 +141,8 @@ const ChatMessages = function (privateClient, publicClient) {
"required": []
};
privateClient.declareType("daily-archive", "https://kosmos.org/ns/v1", archiveSchema);
publicClient.declareType("daily-archive", "https://kosmos.org/ns/v1", archiveSchema);
privateClient.declareType("daily-archive", "https://kosmos.org/ns/v2", archiveSchema);
publicClient.declareType("daily-archive", "https://kosmos.org/ns/v2", archiveSchema);
/**
* A daily archive stores chat messages by calendar day.
@ -158,7 +158,7 @@ const ChatMessages = function (privateClient, publicClient) {
* @param {string} options.channelName - Name of room/channel (e.g. "#kosmos")
* @param {string} [options.channelType] - Type of channel ("room" or "person")
* @param {date} options.date - Date of archive day
* @param {boolean} options.isPublic - Store logs in public folder (defaults to false)
* @param {boolean} [options.isPublic] - Store logs in public folder (defaults to false)
* @param {string} [options.previous] - Date of previous log file as `YYYY/MM/DD`. Looked up automatically when not given
* @param {string} [options.next] - Date of next log file as `YYYY/MM/DD`. looked up automatically when not given
*
@ -360,7 +360,7 @@ const ChatMessages = function (privateClient, publicClient) {
* @private
*/
_updateDocument (archive, messages) {
console.debug('[chat-messages] Updating archive document', archive);
console.debug('[chat-messages] Updating archive document');
if (Array.isArray(messages)) {
messages.forEach(function(message) {
@ -545,7 +545,7 @@ const ChatMessages = function (privateClient, publicClient) {
* @private
*/
_sync (obj) {
console.debug('[chat-messages] Writing archive object', obj);
console.debug(`[chat-messages] Writing archive object with ${obj.today.messages.length} messages`);
return this.client.storeObject('daily-archive', this.path, obj).then(function(){
console.debug('[chat-messages] Archive written to remote storage');

View File

@ -9,7 +9,9 @@ module.exports = {
filename: 'build.js',
library: 'ChatMessages',
libraryTarget: 'umd',
libraryExport: 'default'
libraryExport: 'default',
umdNamedDefine: true,
globalObject: 'this'
},
mode: isProd ? 'production' : 'development',
devtool: isProd ? 'source-map' : 'eval-source-map',