mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
* fixes: integrating plugins from marketplace to apps * clean up * update deps: markeplace to node 18 * adds plivo * updates plivo icon * fixes app crash on clicking sidebae datasources popup * fixes app crash for rendering selected ds form from leftsidebar * fixes app crash for loading installed plugins * fixes: updated correct plugin id to testconection * init * updates s3 plugin name * checking if marketplace flag is "true" * updates github svg * plugin icon fix * fixes:components werent rendering if marketplace plugin queries were used * github plugin: error message for invalid creds * fixes: typos * fixes multiple installation of the same plugin
49 lines
No EOL
1.2 KiB
TypeScript
49 lines
No EOL
1.2 KiB
TypeScript
import { Octokit } from 'octokit'
|
|
import { QueryOptions } from './types'
|
|
|
|
|
|
export async function getUserInfo(octokit: Octokit, options: QueryOptions): Promise<object> {
|
|
const { data } = await octokit.request(
|
|
'GET /users/{username}',
|
|
{
|
|
username: options.username
|
|
}
|
|
);
|
|
return data;
|
|
}
|
|
|
|
export async function getRepo(octokit: Octokit, options: QueryOptions): Promise<object> {
|
|
const { data } = await octokit.request(
|
|
'GET /repos/{owner}/{repo}',
|
|
{
|
|
owner: options.owner,
|
|
repo: options.repo
|
|
}
|
|
);
|
|
return data;
|
|
}
|
|
|
|
export async function getRepoIssues(octokit: Octokit, options: QueryOptions): Promise<object> {
|
|
const { data } = await octokit.request(
|
|
'GET /repos/{owner}/{repo}/issues',
|
|
{
|
|
owner: options.owner,
|
|
repo: options.repo,
|
|
state: options.state || 'all'
|
|
|
|
}
|
|
);
|
|
return data;
|
|
}
|
|
|
|
export async function getRepoPullRequests(octokit: Octokit, options: QueryOptions): Promise<object> {
|
|
const { data } = await octokit.request(
|
|
'GET /repos/{owner}/{repo}/pulls',
|
|
{
|
|
owner: options.owner,
|
|
repo: options.repo,
|
|
state: options.state || 'all'
|
|
}
|
|
);
|
|
return data;
|
|
} |