update
This commit is contained in:
@@ -1,16 +1,12 @@
|
||||
import { CNBCore, CNBCoreOptions, RequestOptions, Result } from "../cnb-core.ts";
|
||||
type AiOptions = CNBCoreOptions<{
|
||||
group?: string;
|
||||
}>
|
||||
|
||||
class AiBase extends CNBCore {
|
||||
group: string;
|
||||
constructor(options: AiOptions) {
|
||||
constructor(options: CNBCoreOptions) {
|
||||
super({ token: options.token, cookie: options.cookie });
|
||||
this.group = options.group || '';
|
||||
}
|
||||
autoPr(repo: string, data: { body: string, branch?: string, title: string }): Promise<Result<any>> {
|
||||
const group = this.group || '';
|
||||
const url = `/${group}/${repo}/-/build/ai/auto-pr`;
|
||||
const url = `/${repo}/-/build/ai/auto-pr`;
|
||||
const postData = {
|
||||
...data,
|
||||
branch: data.branch || 'refs/heads/main',
|
||||
|
||||
Reference in New Issue
Block a user