mirror of
https://github.com/Skylar-Tech/node-red-contrib-matrix-chat.git
synced 2025-04-20 13:03:12 -06:00
- can now specify message in node's configuration for matrix-send-message - can now specify reaction in node's configuration for matrix-react - reason can now be configured on both matrix-room-kick and matrix-room-ban - icons updated for various nodes - fix tag for name configuration field for various nodes - roomId input is now validated to ensure it starts with ! and if not shows an error
132 lines
7.0 KiB
HTML
132 lines
7.0 KiB
HTML
<script type="text/javascript">
|
|
RED.nodes.registerType('matrix-synapse-users',{
|
|
category: 'matrix',
|
|
color: '#00b7ca',
|
|
icon: "matrix.png",
|
|
outputLabels: ["success", "error"],
|
|
inputs:1,
|
|
outputs:2,
|
|
defaults: {
|
|
name: { value: null },
|
|
server: { value: "", type: "matrix-server-config" }
|
|
},
|
|
label: function() {
|
|
return this.name || "Synapse User List";
|
|
},
|
|
paletteLabel: 'Synapse User List'
|
|
});
|
|
</script>
|
|
|
|
<script type="text/html" data-template-name="matrix-synapse-users">
|
|
<div class="form-row">
|
|
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
<input type="text" id="node-input-name" placeholder="Name">
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="node-input-server"><i class="fa fa-user"></i> Matrix Server Config</label>
|
|
<input type="text" id="node-input-server">
|
|
</div>
|
|
<div class="form-tips">
|
|
This only works on Synapse servers. The user also must be an administrator.
|
|
</div>
|
|
</script>
|
|
|
|
<script type="text/html" data-help-name="matrix-synapse-users">
|
|
<h3>Details</h3>
|
|
<p>This node lists out users from a Synapse server. Only works on Synapse Matrix servers. User must be an admin to call this API.</p>
|
|
<a href="https://matrix-org.github.io/synapse/develop/admin_api/user_admin_api.html#list-accounts" target="_blank">Synapse API Endpoint Information</a>
|
|
|
|
<h3>Inputs</h3>
|
|
<dl class="message-properties">
|
|
<dt class="optional">msg.from
|
|
<span class="property-type">integer</span>
|
|
</dt>
|
|
<dd> Is optional but used for pagination, denoting the offset in the returned results. This should be treated as an opaque value and not explicitly set to anything other than the return value of <code>msg.next_token</code> from a previous call. Defaults to 0.</dd>
|
|
|
|
<dt class="optional">msg.limit
|
|
<span class="property-type">integer</span>
|
|
</dt>
|
|
<dd> limit - representing a positive integer - Is optional but is used for pagination, denoting the maximum number of items to return in this call. Defaults to 100.</dd>
|
|
|
|
<dt class="optional">msg.guests
|
|
<span class="property-type">bool</span>
|
|
</dt>
|
|
<dd> Is optional and if false will exclude guest users. Defaults to true to include guest users.</dd>
|
|
|
|
<dt class="optional">msg.order_by
|
|
<span class="property-type">string</span>
|
|
</dt>
|
|
<dd>
|
|
The method by which to sort the returned list of users.
|
|
If the ordered field has duplicates, the second order is always by ascending name, which guarantees a stable ordering.
|
|
Valid values are:
|
|
<ul>
|
|
<li><code>name</code> - Users are ordered alphabetically by <code>name</code>. This is the default.</li>
|
|
<li><code>is_guest</code> - Users are ordered by <code>is_guest</code> status.</li>
|
|
<li><code>admin</code> - Users are ordered by <code>admin</code> status.</li>
|
|
<li><code>user_type</code> - Users are ordered alphabetically by <code>user_type</code>.</li>
|
|
<li><code>deactivated</code> - Users are ordered by <code>deactivated</code> status.</li>
|
|
<li><code>shadow_banned</code> - Users are ordered by <code>shadow_banned</code> status.</li>
|
|
<li><code>displayname</code> - Users are ordered alphabetically by <code>displayname</code>.</li>
|
|
<li><code>avatar_url</code> - Users are ordered alphabetically by avatar URL.</li>
|
|
<li><code>creation_ts</code> - Users are ordered by when the users was created in ms.</li>
|
|
</ul>
|
|
<p>Caution. The database only has indexes on the columns <code>name</code> and <code>creation_ts</code>.
|
|
This means that if a different sort order is used (<code>is_guest</code>, <code>admin</code>,
|
|
<code>user_type</code>, <code>deactivated</code>, <code>shadow_banned</code>, <code>avatar_url</code> or <code>displayname</code>),
|
|
this can cause a large load on the database, especially for large environments.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h3>Outputs</h3>
|
|
<ol class="node-ports">
|
|
<li>Success
|
|
<dl class="message-properties">
|
|
<dt>msg.payload <span class="property-type">object</span></dt>
|
|
<dd>the response object from the server.</dd>
|
|
|
|
<dt>msg.payload.next_token <span class="property-type">string</span></dt>
|
|
<dd>string representing a positive integer - Indication for pagination. If this is unset then there are no more users to paginate through.</dd>
|
|
|
|
<dt>msg.payload.total <span class="property-type">integer</span></dt>
|
|
<dd>Total number of users.</dd>
|
|
|
|
<dt>msg.payload.users <span class="property-type">array</span></dt>
|
|
<dd>list of users from the Matrix server. <a href="https://matrix-org.github.io/synapse/develop/admin_api/user_admin_api.html#list-accounts" target="_blank">Click here</a> for details on what this contains (or do a debug on the output).</dd>
|
|
|
|
<dt>msg.payload.users[].name <span class="property-type">string</span></dt>
|
|
<dd>Fully-qualified user ID (ex. <code>@user:server.com</code>).</dd>
|
|
|
|
<dt>msg.payload.users[].is_guest <span class="property-type">bool</span></dt>
|
|
<dd>Status if that user is a guest account.</dd>
|
|
|
|
<dt>msg.payload.users[].admin <span class="property-type">string</span></dt>
|
|
<dd>Status if that user is a server administrator.</dd>
|
|
|
|
<dt>msg.payload.users[].user_type <span class="property-type">string</span></dt>
|
|
<dd>Type of the user. Normal users are type <code>None</code>. This allows user type specific behaviour. There are also types <code>support</code> and <code>bot</code>.</dd>
|
|
|
|
<dt>msg.payload.users[].deactivated <span class="property-type">bool</span></dt>
|
|
<dd>Status if that user has been marked as deactivated.</dd>
|
|
|
|
<dt>msg.payload.users[].shadow_banned <span class="property-type">bool</span></dt>
|
|
<dd>Status if that user has been marked as shadow banned.</dd>
|
|
|
|
<dt>msg.payload.users[].displayname <span class="property-type">string</span></dt>
|
|
<dd>The user's display name if they have set one.</dd>
|
|
|
|
<dt>msg.payload.users[].avatar_url <span class="property-type">string</span></dt>
|
|
<dd>The user's avatar URL if they have set one.</dd>
|
|
|
|
<dt>msg.payload.users[].creation_ts <span class="property-type">integer</span></dt>
|
|
<dd>The user's creation timestamp in ms.</dd>
|
|
</dl>
|
|
</li>
|
|
<li>Error
|
|
<dl class="message-properties">
|
|
<dt>msg.error <span class="property-type">string</span></dt>
|
|
<dd>the error that occurred.</dd>
|
|
</dl>
|
|
</li>
|
|
</ol>
|
|
</script> |