update
This commit is contained in:
14
src/index.ts
14
src/index.ts
@@ -3,23 +3,29 @@ 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<{}>;
|
||||
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);
|
||||
this.knowledgeBase = new KnowledgeBase({ token: options.token, cookie: options.cookie });
|
||||
this.repo = new Repo({ token: options.token, cookie: options.cookie });
|
||||
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 });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,3 +33,5 @@ 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'
|
||||
Reference in New Issue
Block a user