Files
cnb/src/index.ts
2026-01-05 10:50:37 +08:00

37 lines
1.3 KiB
TypeScript

import { CNBCore, CNBCoreOptions } from "./cnb-core.ts";
import { Workspace } from "./workspace.ts";
import { KnowledgeBase } from "./knowledge/index.ts";
import { Repo } from "./repo/index.ts";
import { User } from "./user/index.ts";
import { Build } from "./build/index.ts";
type CNBOptions = CNBCoreOptions<{
group?: string;
}>;
export class CNB extends CNBCore {
workspace!: Workspace;
knowledgeBase!: KnowledgeBase;
repo!: Repo;
user!: User;
build!: Build;
constructor(options: CNBOptions) {
super({ token: options.token, cookie: options.cookie });
this.init(options);
}
init(options: CNBOptions) {
this.workspace = new Workspace(options.token);
const group = options.group || '';
this.knowledgeBase = new KnowledgeBase({ group: group, token: options.token, cookie: options.cookie });
this.repo = new Repo({ group: group, token: options.token, cookie: options.cookie });
this.user = new User({ token: options.token, cookie: options.cookie });
this.build = new Build({ group: group, token: options.token, cookie: options.cookie });
}
}
export * from './workspace.ts'
export * from './cnb-core.ts'
export * from './knowledge/index.ts'
export * from './repo/index.ts'
export * from './user/index.ts'
export * from './build/index.ts'