@kevisual/cnb 0.0.58 → 0.0.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -24946,6 +24946,24 @@ function useCommentEnv() {
24946
24946
  };
24947
24947
  }
24948
24948
 
24949
+ // src/issue/dashboard.ts
24950
+ class Dashboard extends CNBCore {
24951
+ constructor(options) {
24952
+ super(options);
24953
+ }
24954
+ getMineCreateIssue(params) {
24955
+ const url3 = `${this.hackURL}/user/dashboard/mine_create/issue`;
24956
+ return this.get({
24957
+ url: url3,
24958
+ params,
24959
+ useCookie: true,
24960
+ headers: {
24961
+ Accept: "application/vnd.cnb.web+json"
24962
+ }
24963
+ });
24964
+ }
24965
+ }
24966
+
24949
24967
  // src/issue/index.ts
24950
24968
  class Issue extends CNBCore {
24951
24969
  constructor(options) {
@@ -25415,6 +25433,7 @@ class CNB extends CNBCore {
25415
25433
  labels;
25416
25434
  packages;
25417
25435
  org;
25436
+ dashboard;
25418
25437
  constructor(options) {
25419
25438
  super({ ...options, token: options.token, cookie: options.cookie, cnb: options.cnb });
25420
25439
  this.init(options);
@@ -25442,6 +25461,7 @@ class CNB extends CNBCore {
25442
25461
  package: new PackageManagement(options)
25443
25462
  };
25444
25463
  this.org = new Organization(options);
25464
+ this.dashboard = new Dashboard(options);
25445
25465
  }
25446
25466
  setToken(token) {
25447
25467
  this.token = token;
@@ -25456,6 +25476,7 @@ class CNB extends CNBCore {
25456
25476
  this.packages.registry.token = token;
25457
25477
  this.packages.package.token = token;
25458
25478
  this.org.token = token;
25479
+ this.dashboard.token = token;
25459
25480
  }
25460
25481
  setCookie(cookie) {
25461
25482
  this.cookie = cookie;
@@ -25470,6 +25491,7 @@ class CNB extends CNBCore {
25470
25491
  this.packages.registry.cookie = cookie;
25471
25492
  this.packages.package.cookie = cookie;
25472
25493
  this.org.cookie = cookie;
25494
+ this.dashboard.cookie = cookie;
25473
25495
  }
25474
25496
  getCNBVersion = getCNBVersion;
25475
25497
  }
package/dist/npc.js CHANGED
@@ -24980,6 +24980,24 @@ var useIssueEnv = () => {
24980
24980
  };
24981
24981
  };
24982
24982
 
24983
+ // src/issue/dashboard.ts
24984
+ class Dashboard extends CNBCore {
24985
+ constructor(options) {
24986
+ super(options);
24987
+ }
24988
+ getMineCreateIssue(params) {
24989
+ const url3 = `${this.hackURL}/user/dashboard/mine_create/issue`;
24990
+ return this.get({
24991
+ url: url3,
24992
+ params,
24993
+ useCookie: true,
24994
+ headers: {
24995
+ Accept: "application/vnd.cnb.web+json"
24996
+ }
24997
+ });
24998
+ }
24999
+ }
25000
+
24983
25001
  // src/issue/index.ts
24984
25002
  class Issue extends CNBCore {
24985
25003
  constructor(options) {
@@ -25449,6 +25467,7 @@ class CNB extends CNBCore {
25449
25467
  labels;
25450
25468
  packages;
25451
25469
  org;
25470
+ dashboard;
25452
25471
  constructor(options) {
25453
25472
  super({ ...options, token: options.token, cookie: options.cookie, cnb: options.cnb });
25454
25473
  this.init(options);
@@ -25476,6 +25495,7 @@ class CNB extends CNBCore {
25476
25495
  package: new PackageManagement(options)
25477
25496
  };
25478
25497
  this.org = new Organization(options);
25498
+ this.dashboard = new Dashboard(options);
25479
25499
  }
25480
25500
  setToken(token) {
25481
25501
  this.token = token;
@@ -25490,6 +25510,7 @@ class CNB extends CNBCore {
25490
25510
  this.packages.registry.token = token;
25491
25511
  this.packages.package.token = token;
25492
25512
  this.org.token = token;
25513
+ this.dashboard.token = token;
25493
25514
  }
25494
25515
  setCookie(cookie) {
25495
25516
  this.cookie = cookie;
@@ -25504,6 +25525,7 @@ class CNB extends CNBCore {
25504
25525
  this.packages.registry.cookie = cookie;
25505
25526
  this.packages.package.cookie = cookie;
25506
25527
  this.org.cookie = cookie;
25528
+ this.dashboard.cookie = cookie;
25507
25529
  }
25508
25530
  getCNBVersion = getCNBVersion;
25509
25531
  }
package/dist/opencode.js CHANGED
@@ -22853,6 +22853,24 @@ function useCommentEnv() {
22853
22853
  };
22854
22854
  }
22855
22855
 
22856
+ // src/issue/dashboard.ts
22857
+ class Dashboard extends CNBCore {
22858
+ constructor(options) {
22859
+ super(options);
22860
+ }
22861
+ getMineCreateIssue(params) {
22862
+ const url3 = `${this.hackURL}/user/dashboard/mine_create/issue`;
22863
+ return this.get({
22864
+ url: url3,
22865
+ params,
22866
+ useCookie: true,
22867
+ headers: {
22868
+ Accept: "application/vnd.cnb.web+json"
22869
+ }
22870
+ });
22871
+ }
22872
+ }
22873
+
22856
22874
  // src/issue/index.ts
22857
22875
  class Issue extends CNBCore {
22858
22876
  constructor(options) {
@@ -23322,6 +23340,7 @@ class CNB extends CNBCore {
23322
23340
  labels;
23323
23341
  packages;
23324
23342
  org;
23343
+ dashboard;
23325
23344
  constructor(options) {
23326
23345
  super({ ...options, token: options.token, cookie: options.cookie, cnb: options.cnb });
23327
23346
  this.init(options);
@@ -23349,6 +23368,7 @@ class CNB extends CNBCore {
23349
23368
  package: new PackageManagement(options)
23350
23369
  };
23351
23370
  this.org = new Organization(options);
23371
+ this.dashboard = new Dashboard(options);
23352
23372
  }
23353
23373
  setToken(token) {
23354
23374
  this.token = token;
@@ -23363,6 +23383,7 @@ class CNB extends CNBCore {
23363
23383
  this.packages.registry.token = token;
23364
23384
  this.packages.package.token = token;
23365
23385
  this.org.token = token;
23386
+ this.dashboard.token = token;
23366
23387
  }
23367
23388
  setCookie(cookie) {
23368
23389
  this.cookie = cookie;
@@ -23377,6 +23398,7 @@ class CNB extends CNBCore {
23377
23398
  this.packages.registry.cookie = cookie;
23378
23399
  this.packages.package.cookie = cookie;
23379
23400
  this.org.cookie = cookie;
23401
+ this.dashboard.cookie = cookie;
23380
23402
  }
23381
23403
  getCNBVersion = getCNBVersion;
23382
23404
  }
package/dist/routes.d.ts CHANGED
@@ -580,6 +580,52 @@ type StartBuildData = {
580
580
  tag?: string;
581
581
  };
582
582
 
583
+ type DashboardTodoStatus = 'pending' | 'processing' | 'completed';
584
+ type DashboardIssueItem = {
585
+ todo_id: string;
586
+ pinned: boolean;
587
+ number: number;
588
+ slug: string;
589
+ slug_freeze: boolean;
590
+ title: string;
591
+ state: string;
592
+ priority: string;
593
+ labels: {
594
+ name: string;
595
+ description: string;
596
+ color: string;
597
+ }[];
598
+ associated_pull_request_counts: number;
599
+ comment_count: number;
600
+ creator: {
601
+ username: string;
602
+ nickname: string;
603
+ freeze: boolean;
604
+ };
605
+ author_context: Record<string, any>;
606
+ created_time: string;
607
+ updated_time: string;
608
+ };
609
+ type DashboardMineCreateIssue = {
610
+ todo_type: string;
611
+ issue_datas: DashboardIssueItem[];
612
+ };
613
+ declare class Dashboard extends CNBCore {
614
+ constructor(options: CNBCoreOptions);
615
+ /**
616
+ * 获取我创建的 Issue 仪表盘
617
+ * @param params
618
+ * @param params.todoStatus - 待办状态: pending | processing | completed
619
+ * @param params.page - 页码,默认 1
620
+ * @param params.page_size - 每页数量,默认 20
621
+ */
622
+ getMineCreateIssue(params?: {
623
+ todoStatus?: DashboardTodoStatus;
624
+ page?: number;
625
+ page_size?: number;
626
+ }): Promise<Result<DashboardMineCreateIssue>>;
627
+ }
628
+
583
629
  type IssueAssignee = {
584
630
  nickname: string;
585
631
  username: string;
@@ -1714,6 +1760,7 @@ declare class CNB extends CNBCore {
1714
1760
  package: PackageManagement;
1715
1761
  };
1716
1762
  org: Organization;
1763
+ dashboard: Dashboard;
1717
1764
  constructor(options: CNBOptions);
1718
1765
  init(cnbOptions?: CNBOptions): void;
1719
1766
  setToken(token: string): void;
package/dist/routes.js CHANGED
@@ -22853,6 +22853,24 @@ function useCommentEnv() {
22853
22853
  };
22854
22854
  }
22855
22855
 
22856
+ // src/issue/dashboard.ts
22857
+ class Dashboard extends CNBCore {
22858
+ constructor(options) {
22859
+ super(options);
22860
+ }
22861
+ getMineCreateIssue(params) {
22862
+ const url3 = `${this.hackURL}/user/dashboard/mine_create/issue`;
22863
+ return this.get({
22864
+ url: url3,
22865
+ params,
22866
+ useCookie: true,
22867
+ headers: {
22868
+ Accept: "application/vnd.cnb.web+json"
22869
+ }
22870
+ });
22871
+ }
22872
+ }
22873
+
22856
22874
  // src/issue/index.ts
22857
22875
  class Issue extends CNBCore {
22858
22876
  constructor(options) {
@@ -23322,6 +23340,7 @@ class CNB extends CNBCore {
23322
23340
  labels;
23323
23341
  packages;
23324
23342
  org;
23343
+ dashboard;
23325
23344
  constructor(options) {
23326
23345
  super({ ...options, token: options.token, cookie: options.cookie, cnb: options.cnb });
23327
23346
  this.init(options);
@@ -23349,6 +23368,7 @@ class CNB extends CNBCore {
23349
23368
  package: new PackageManagement(options)
23350
23369
  };
23351
23370
  this.org = new Organization(options);
23371
+ this.dashboard = new Dashboard(options);
23352
23372
  }
23353
23373
  setToken(token) {
23354
23374
  this.token = token;
@@ -23363,6 +23383,7 @@ class CNB extends CNBCore {
23363
23383
  this.packages.registry.token = token;
23364
23384
  this.packages.package.token = token;
23365
23385
  this.org.token = token;
23386
+ this.dashboard.token = token;
23366
23387
  }
23367
23388
  setCookie(cookie) {
23368
23389
  this.cookie = cookie;
@@ -23377,6 +23398,7 @@ class CNB extends CNBCore {
23377
23398
  this.packages.registry.cookie = cookie;
23378
23399
  this.packages.package.cookie = cookie;
23379
23400
  this.org.cookie = cookie;
23401
+ this.dashboard.cookie = cookie;
23380
23402
  }
23381
23403
  getCNBVersion = getCNBVersion;
23382
23404
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevisual/cnb",
3
- "version": "0.0.58",
3
+ "version": "0.0.59",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "basename": "/root/cnb",
package/src/index.ts CHANGED
@@ -4,7 +4,7 @@ import { KnowledgeBase } from "./knowledge/index.ts";
4
4
  import { Repo } from "./repo/index.ts";
5
5
  import { User } from "./user/index.ts";
6
6
  import { Build } from "./build/index.ts";
7
- import { Issue } from "./issue/index.ts";
7
+ import { Issue, Dashboard } from "./issue/index.ts";
8
8
  import { Mission } from "./mission/index.ts";
9
9
  import { AiBase } from "./ai/index.ts";
10
10
  import { RepoLabel, IssueLabel } from "./labels/index.ts";
@@ -32,6 +32,7 @@ export class CNB extends CNBCore {
32
32
  package: PackageManagement;
33
33
  };
34
34
  org!: Organization;
35
+ dashboard!: Dashboard;
35
36
  constructor(options: CNBOptions) {
36
37
  super({ ...options, token: options.token, cookie: options.cookie, cnb: options.cnb });
37
38
  this.init(options);
@@ -59,6 +60,7 @@ export class CNB extends CNBCore {
59
60
  package: new PackageManagement(options),
60
61
  };
61
62
  this.org = new Organization(options);
63
+ this.dashboard = new Dashboard(options);
62
64
  }
63
65
  setToken(token: string) {
64
66
  this.token = token;
@@ -73,6 +75,7 @@ export class CNB extends CNBCore {
73
75
  this.packages.registry.token = token;
74
76
  this.packages.package.token = token;
75
77
  this.org.token = token;
78
+ this.dashboard.token = token;
76
79
  }
77
80
  setCookie(cookie: string) {
78
81
  this.cookie = cookie;
@@ -87,6 +90,7 @@ export class CNB extends CNBCore {
87
90
  this.packages.registry.cookie = cookie;
88
91
  this.packages.package.cookie = cookie;
89
92
  this.org.cookie = cookie;
93
+ this.dashboard.cookie = cookie;
90
94
  }
91
95
  getCNBVersion = getCNBVersion
92
96
  }
@@ -0,0 +1,64 @@
1
+ import { CNBCore, CNBCoreOptions, Result } from "../cnb-core.ts";
2
+
3
+ export type DashboardTodoStatus = 'pending' | 'processing' | 'completed';
4
+
5
+ export type DashboardIssueItem = {
6
+ todo_id: string;
7
+ pinned: boolean;
8
+ number: number;
9
+ slug: string;
10
+ slug_freeze: boolean;
11
+ title: string;
12
+ state: string;
13
+ priority: string;
14
+ labels: {
15
+ name: string;
16
+ description: string;
17
+ color: string;
18
+ }[];
19
+ associated_pull_request_counts: number;
20
+ comment_count: number;
21
+ creator: {
22
+ username: string;
23
+ nickname: string;
24
+ freeze: boolean;
25
+ };
26
+ author_context: Record<string, any>;
27
+ created_time: string;
28
+ updated_time: string;
29
+ };
30
+
31
+ export type DashboardMineCreateIssue = {
32
+ // 'issue'
33
+ todo_type: string;
34
+ issue_datas: DashboardIssueItem[];
35
+ };
36
+
37
+ export class Dashboard extends CNBCore {
38
+ constructor(options: CNBCoreOptions) {
39
+ super(options);
40
+ }
41
+
42
+ /**
43
+ * 获取我创建的 Issue 仪表盘
44
+ * @param params
45
+ * @param params.todoStatus - 待办状态: pending | processing | completed
46
+ * @param params.page - 页码,默认 1
47
+ * @param params.page_size - 每页数量,默认 20
48
+ */
49
+ getMineCreateIssue(params?: {
50
+ todoStatus?: DashboardTodoStatus;
51
+ page?: number;
52
+ page_size?: number;
53
+ }): Promise<Result<DashboardMineCreateIssue>> {
54
+ const url = `${this.hackURL}/user/dashboard/mine_create/issue`;
55
+ return this.get({
56
+ url,
57
+ params,
58
+ useCookie: true,
59
+ headers: {
60
+ 'Accept': 'application/vnd.cnb.web+json',
61
+ },
62
+ });
63
+ }
64
+ }
@@ -1,6 +1,7 @@
1
1
  import { CNBCore, CNBCoreOptions, RequestOptions, Result } from "../cnb-core.ts";
2
2
  import { extractAliveInfo } from "./issue-alive.ts";
3
3
  import { useNPCEnv, useCommentEnv, usePullRequestEnv, useRepoInfoEnv } from "./npc/env.ts";
4
+ export { Dashboard, type DashboardIssueItem, type DashboardMineCreateIssue, type DashboardTodoStatus } from "./dashboard.ts";
4
5
  export type IssueAssignee = {
5
6
  nickname: string;
6
7
  username: string;