feat: 添加知识库和用户模块,更新核心功能并修复导入路径
This commit is contained in:
31
src/index.ts
31
src/index.ts
@@ -1,10 +1,29 @@
|
||||
import { CNBCore, CNBCoreOptions } from "./cnb-core";
|
||||
import { Workspace } from "./workspace";
|
||||
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";
|
||||
|
||||
type CNBOptions = CNBCoreOptions<{}>;
|
||||
|
||||
export class CNB extends CNBCore {
|
||||
workspace: Workspace;
|
||||
workspace!: Workspace;
|
||||
knowledgeBase!: KnowledgeBase;
|
||||
repo!: Repo;
|
||||
user!: User;
|
||||
constructor(options: CNBOptions) {
|
||||
super({ token: options.token });
|
||||
this.workspace = new Workspace(options.token);
|
||||
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 });
|
||||
this.user = new User({ 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'
|
||||
|
||||
Reference in New Issue
Block a user