mirror of
https://github.com/ToolJet/ToolJet
synced 2026-04-21 13:37:28 +00:00
* lint fixes: frontend * lint fixes: marketplace * lint fixes: plugins-client js files * typo fix * eslint updates/fixes for marketplace * eslint updates/fixes for plugins * removing "@typescript-eslint/no-floating-promises for plugins" * ignore client.js and server.js * ignore client.js and server.js * ignore client.js and server.tss * Delete client.js * ignore cypress-test/**
35 lines
1.1 KiB
TypeScript
35 lines
1.1 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;
|
|
}
|