🔀 Merge branch 'RicardoE105-fix/rocketchat-node'

This commit is contained in:
Jan Oberhauser 2019-12-01 20:51:53 +01:00
commit 3d005c5b38
4 changed files with 22 additions and 7 deletions

View file

@ -2,6 +2,23 @@
This list shows all the versions which include breaking changes and how to upgrade
## 0.37.0
### What changed?
To make it possible to support also Rocketchat on-premise the credentials had to be changed.
The `subdomain` parameter had to get renamed to `domain`.
### When is action necessary?
When you currently use the Rocketchat-Node.
### How to upgrade:
Open the Rocketchat credentials and fill the parameter `domain`. If you had previously the
subdomain "example" set you have to set now "https://example.rocket.chat".
## 0.19.0
### What changed?

View file

@ -21,11 +21,11 @@ export class RocketchatApi implements ICredentialType {
default: '',
},
{
displayName: 'Sub Domain',
name: 'subdomain',
displayName: 'Domain',
name: 'domain',
type: 'string' as NodePropertyTypes,
default: '',
placeholder: 'n8n'
placeholder: 'https://n8n.rocket.chat',
},
];
}

View file

@ -16,13 +16,11 @@ export async function rocketchatApiRequest(this: IHookFunctions | IExecuteFuncti
const headerWithAuthentication = Object.assign({}, headers,
{ 'X-Auth-Token': credentials.authKey, 'X-User-Id': credentials.userId });
const endpoint = 'rocket.chat/api/v1';
const options: OptionsWithUri = {
headers: headerWithAuthentication,
method,
body,
uri: `https://${credentials.subdomain}.${endpoint}${resource}.${operation}`,
uri: `${credentials.domain}${resource}.${operation}`,
json: true
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB