diff --git a/package.json b/package.json index 5215090..533bee6 100644 --- a/package.json +++ b/package.json @@ -12,9 +12,10 @@ }, "author": "Kosmos Contributors (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", diff --git a/src/chat-messages.js b/src/chat-messages.js index 573966f..76a4eec 100644 --- a/src/chat-messages.js +++ b/src/chat-messages.js @@ -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'); diff --git a/webpack.config.js b/webpack.config.js index fc0e132..9107eb7 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -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',