- 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
69 lines
2.7 KiB
HTML
69 lines
2.7 KiB
HTML
<script type="text/javascript">
|
|
RED.nodes.registerType('matrix-synapse-create-edit-user', {
|
|
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 Add/Edit User";
|
|
},
|
|
paletteLabel: 'Synapse Add/Edit User'
|
|
});
|
|
</script>
|
|
|
|
<script type="text/html" data-template-name="matrix-synapse-create-edit-user">
|
|
<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" style="margin-bottom: 12px;">
|
|
User must be an admin to use this endpoint. Only works with Synapse servers. It is recommended to check if the user exists before creating otherwise it will edit an existing user.
|
|
</div>
|
|
</script>
|
|
|
|
<script type="text/html" data-help-name="matrix-synapse-create-edit-user">
|
|
<h3>Details</h3>
|
|
<p>Allows an administrator to create or modify a user account with a specific <code>msg.userId</code>.</p>
|
|
<a href="https://matrix-org.github.io/synapse/develop/admin_api/user_admin_api.html#create-or-modify-account" target="_blank">Synapse API Endpoint Information</a>
|
|
|
|
<h3>Inputs</h3>
|
|
<dl class="message-properties">
|
|
<dt>msg.userId
|
|
<span class="property-type">string</span>
|
|
</dt>
|
|
<dd> ID of user to create/edit (ex: @bob:example.com)</dd>
|
|
|
|
<dt>msg.payload
|
|
<span class="property-type">object</span>
|
|
</dt>
|
|
<dd> Details of the new user to create. <a href="https://matrix-org.github.io/synapse/develop/admin_api/user_admin_api.html#create-or-modify-account" target="_blank">Click here</a> to see what valid data you can pass via this input. If the user already exists then optional parameters default to the current value.</dd>
|
|
</dl>
|
|
|
|
<h3>Outputs</h3>
|
|
<ol class="node-ports">
|
|
<li>Success
|
|
<dl class="message-properties">
|
|
<dt>msg.payload <span class="property-type">string</span></dt>
|
|
<dd>the eventId from the posted message.</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> |