update
This commit is contained in:
47
src/index.ts
47
src/index.ts
@@ -15,17 +15,54 @@ export class CNB extends CNBCore {
|
||||
repo!: Repo;
|
||||
user!: User;
|
||||
build!: Build;
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
issue!: Issue;
|
||||
mission!: Mission;
|
||||
group!: string;
|
||||
>>>>>>> 84efdce (update)
|
||||
constructor(options: CNBOptions) {
|
||||
super({ token: options.token, cookie: options.cookie });
|
||||
super({ token: options.token, cookie: options.cookie, cnb: options.cnb });
|
||||
this.init(options);
|
||||
}
|
||||
init(options: CNBOptions) {
|
||||
init(cnbOptions?: CNBOptions) {
|
||||
const token = this.token;
|
||||
const cookie = this.cookie;
|
||||
const options = { token, cookie };
|
||||
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 });
|
||||
const group = cnbOptions?.group || '';
|
||||
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 });
|
||||
<<<<<<< HEAD
|
||||
this.build = new Build({ group: group, token: options.token, cookie: options.cookie });
|
||||
=======
|
||||
this.build = new Build({ token: options.token, cookie: options.cookie });
|
||||
this.issue = new Issue({ token: options.token, cookie: options.cookie });
|
||||
this.mission = new Mission({ token: options.token, cookie: options.cookie });
|
||||
this.group = group;
|
||||
}
|
||||
setGroup(group: string) {
|
||||
this.group = group;
|
||||
}
|
||||
setToken(token: string) {
|
||||
this.token = token;
|
||||
this.knowledgeBase.token = token;
|
||||
this.repo.token = token;
|
||||
this.user.token = token;
|
||||
this.build.token = token;
|
||||
this.issue.token = token;
|
||||
this.mission.token = token;
|
||||
}
|
||||
setCookie(cookie: string) {
|
||||
this.cookie = cookie;
|
||||
this.knowledgeBase.cookie = cookie;
|
||||
this.repo.cookie = cookie;
|
||||
this.user.cookie = cookie;
|
||||
this.build.cookie = cookie;
|
||||
this.issue.cookie = cookie;
|
||||
this.mission.cookie = cookie;
|
||||
>>>>>>> 84efdce (update)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user