1
1
import type { IDataObject , ILoadOptionsFunctions , INodePropertyOptions } from 'n8n-workflow' ;
2
2
import { NodeOperationError } from 'n8n-workflow' ;
3
3
4
- import { apiRequest } from '../transport' ;
4
+ import { apiRequestAllItems } from '../transport' ;
5
5
6
6
// Get all the available channels
7
7
export async function getChannels ( this : ILoadOptionsFunctions ) : Promise < INodePropertyOptions [ ] > {
8
8
const endpoint = 'channels' ;
9
- const responseData = await apiRequest . call ( this , 'GET' , endpoint , { } ) ;
9
+ const responseData = await apiRequestAllItems . call ( this , 'GET' , endpoint , { } ) ;
10
10
11
11
if ( responseData === undefined ) {
12
12
throw new NodeOperationError ( this . getNode ( ) , 'No data got returned' ) ;
@@ -25,7 +25,7 @@ export async function getChannels(this: ILoadOptionsFunctions): Promise<INodePro
25
25
26
26
returnData . push ( {
27
27
name,
28
- value : data . id ,
28
+ value : data . id as string ,
29
29
} ) ;
30
30
}
31
31
@@ -48,7 +48,7 @@ export async function getChannelsInTeam(
48
48
) : Promise < INodePropertyOptions [ ] > {
49
49
const teamId = this . getCurrentNodeParameter ( 'teamId' ) ;
50
50
const endpoint = `users/me/teams/${ teamId } /channels` ;
51
- const responseData = await apiRequest . call ( this , 'GET' , endpoint , { } ) ;
51
+ const responseData = await apiRequestAllItems . call ( this , 'GET' , endpoint , { } ) ;
52
52
53
53
if ( responseData === undefined ) {
54
54
throw new NodeOperationError ( this . getNode ( ) , 'No data got returned' ) ;
@@ -72,7 +72,7 @@ export async function getChannelsInTeam(
72
72
73
73
returnData . push ( {
74
74
name,
75
- value : data . id ,
75
+ value : data . id as string ,
76
76
} ) ;
77
77
}
78
78
@@ -91,7 +91,7 @@ export async function getChannelsInTeam(
91
91
92
92
export async function getTeams ( this : ILoadOptionsFunctions ) : Promise < INodePropertyOptions [ ] > {
93
93
const endpoint = 'users/me/teams' ;
94
- const responseData = await apiRequest . call ( this , 'GET' , endpoint , { } ) ;
94
+ const responseData = await apiRequestAllItems . call ( this , 'GET' , endpoint , { } ) ;
95
95
96
96
if ( responseData === undefined ) {
97
97
throw new NodeOperationError ( this . getNode ( ) , 'No data got returned' ) ;
@@ -108,7 +108,7 @@ export async function getTeams(this: ILoadOptionsFunctions): Promise<INodeProper
108
108
109
109
returnData . push ( {
110
110
name,
111
- value : data . id ,
111
+ value : data . id as string ,
112
112
} ) ;
113
113
}
114
114
@@ -127,7 +127,7 @@ export async function getTeams(this: ILoadOptionsFunctions): Promise<INodeProper
127
127
128
128
export async function getUsers ( this : ILoadOptionsFunctions ) : Promise < INodePropertyOptions [ ] > {
129
129
const endpoint = 'users' ;
130
- const responseData = await apiRequest . call ( this , 'GET' , endpoint , { } ) ;
130
+ const responseData = await apiRequestAllItems . call ( this , 'GET' , endpoint , { } ) ;
131
131
132
132
if ( responseData === undefined ) {
133
133
throw new NodeOperationError ( this . getNode ( ) , 'No data got returned' ) ;
@@ -140,8 +140,8 @@ export async function getUsers(this: ILoadOptionsFunctions): Promise<INodeProper
140
140
}
141
141
142
142
returnData . push ( {
143
- name : data . username ,
144
- value : data . id ,
143
+ name : data . username as string ,
144
+ value : data . id as string ,
145
145
} ) ;
146
146
}
147
147
0 commit comments