mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-28 14:09:43 -08:00
14 lines
472 B
TypeScript
14 lines
472 B
TypeScript
import type { ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow';
|
|
|
|
import { splunkApiJsonRequest } from '../transport';
|
|
|
|
export async function getRoles(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
|
const endpoint = '/services/authorization/roles';
|
|
const responseData = await splunkApiJsonRequest.call(this, 'GET', endpoint);
|
|
|
|
return (responseData as Array<{ id: string }>).map((entry) => ({
|
|
name: entry.id,
|
|
value: entry.id,
|
|
}));
|
|
}
|