From 74a31f3301df7789edc2675f02ede1ec3e570dc1 Mon Sep 17 00:00:00 2001 From: wescoeur Date: Fri, 27 Nov 2015 16:47:16 +0100 Subject: [PATCH] Add schema --- .../xo-server-transport-xmpp/src/index.js | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/packages/xo-server-transport-xmpp/src/index.js b/packages/xo-server-transport-xmpp/src/index.js index 602b1ee6a..114cc8280 100644 --- a/packages/xo-server-transport-xmpp/src/index.js +++ b/packages/xo-server-transport-xmpp/src/index.js @@ -1,3 +1,55 @@ +export const configurationSchema = { + type: 'object', + + properties: { + transport: { + type: 'object', + + properties: { + host: { + type: 'string', + description: 'host where the XMPP server is located' + }, + port: { + type: 'number', + description: 'port of the XMPP server (default to 5222)' + }, + user: { + type: 'string', + description: 'name to use to authenticate' + }, + pass: { + type: 'string', + description: 'password to use to authenticate' + } + }, + + additionalProperties: false, + required: ['user', 'pass'] + }, + + accountOptions: { + type: 'object', + + properties: { + register: { + type: 'boolean', + description: 'create a new account if necessary', + default: true + } + }, + + additionalProperties: false, + required: ['register'] + } + }, + + additionalProperties: false, + required: ['transport', 'accountOptions'] +} + +// =================================================================== + class TransportXmppPlugin { constructor (xo) {