mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
@@ -12,6 +12,9 @@ const userScopes = [
|
|||||||
'stars:write',
|
'stars:write',
|
||||||
'users.profile:read',
|
'users.profile:read',
|
||||||
'users.profile:write',
|
'users.profile:write',
|
||||||
|
'groups:read',
|
||||||
|
'im:read',
|
||||||
|
'mpim:read',
|
||||||
];
|
];
|
||||||
|
|
||||||
export class SlackOAuth2Api implements ICredentialType {
|
export class SlackOAuth2Api implements ICredentialType {
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ export async function slackApiRequest(this: IExecuteFunctions | IExecuteSingleFu
|
|||||||
delete options.qs;
|
delete options.qs;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
||||||
let response: any; // tslint:disable-line:no-any
|
let response: any; // tslint:disable-line:no-any
|
||||||
|
|
||||||
if (authenticationMethod === 'accessToken') {
|
if (authenticationMethod === 'accessToken') {
|
||||||
|
|||||||
@@ -217,7 +217,8 @@ export class Slack implements INodeType {
|
|||||||
// select them easily
|
// select them easily
|
||||||
async getChannels(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
async getChannels(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||||
const returnData: INodePropertyOptions[] = [];
|
const returnData: INodePropertyOptions[] = [];
|
||||||
const channels = await slackApiRequestAllItems.call(this, 'channels', 'GET', '/conversations.list');
|
const qs = { types: 'public_channel,private_channel' };
|
||||||
|
const channels = await slackApiRequestAllItems.call(this, 'channels', 'GET', '/conversations.list', {}, qs);
|
||||||
for (const channel of channels) {
|
for (const channel of channels) {
|
||||||
const channelName = channel.name;
|
const channelName = channel.name;
|
||||||
const channelId = channel.id;
|
const channelId = channel.id;
|
||||||
@@ -240,7 +241,6 @@ export class Slack implements INodeType {
|
|||||||
async getTeamFields(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
async getTeamFields(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||||
const returnData: INodePropertyOptions[] = [];
|
const returnData: INodePropertyOptions[] = [];
|
||||||
const { profile: { fields } } = await slackApiRequest.call(this, 'GET', '/team.profile.get');
|
const { profile: { fields } } = await slackApiRequest.call(this, 'GET', '/team.profile.get');
|
||||||
console.log(fields);
|
|
||||||
for (const field of fields) {
|
for (const field of fields) {
|
||||||
const fieldName = field.label;
|
const fieldName = field.label;
|
||||||
const fieldId = field.id;
|
const fieldId = field.id;
|
||||||
|
|||||||
Reference in New Issue
Block a user