@jdr-web-infra/xingyun-open-api-user 0.0.1 → 0.0.3
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/index.d.mts +84 -44
- package/dist/index.mjs +12 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,76 @@
|
|
|
1
|
+
export declare const BASE_URL = "http://api-gateway.jd.com/jacp";
|
|
2
|
+
export declare const APP_ID = "joyclaw";
|
|
3
|
+
export declare const CONTENT_TYPE = "application/json";
|
|
4
|
+
export declare const API_SUCCESS_CODE = 200;
|
|
5
|
+
interface Card {
|
|
6
|
+
id: number;
|
|
7
|
+
code: string;
|
|
8
|
+
name: string;
|
|
9
|
+
space: {
|
|
10
|
+
id: number;
|
|
11
|
+
name: string;
|
|
12
|
+
};
|
|
13
|
+
workitemTypeCode: string;
|
|
14
|
+
workitemTypeName: string;
|
|
15
|
+
stageId: number;
|
|
16
|
+
stageName: string;
|
|
17
|
+
statusId: number;
|
|
18
|
+
statusName: string;
|
|
19
|
+
startDate: number;
|
|
20
|
+
deadline: number;
|
|
21
|
+
priority: number;
|
|
22
|
+
story: number;
|
|
23
|
+
sprint: {
|
|
24
|
+
id: number;
|
|
25
|
+
name: string;
|
|
26
|
+
};
|
|
27
|
+
desc: string;
|
|
28
|
+
demandId: number;
|
|
29
|
+
createTime: number;
|
|
30
|
+
updateTime: number;
|
|
31
|
+
}
|
|
32
|
+
interface Space {
|
|
33
|
+
id: number;
|
|
34
|
+
key: string;
|
|
35
|
+
name: string;
|
|
36
|
+
desc: string;
|
|
37
|
+
creator: UserVO;
|
|
38
|
+
operator: UserVO;
|
|
39
|
+
visibility: number;
|
|
40
|
+
createTime: number;
|
|
41
|
+
updateTime: number;
|
|
42
|
+
}
|
|
43
|
+
interface SprintInfo {
|
|
44
|
+
id: number;
|
|
45
|
+
spaceId: number;
|
|
46
|
+
name: string;
|
|
47
|
+
startDate: number;
|
|
48
|
+
endDate: number;
|
|
49
|
+
status: number;
|
|
50
|
+
desc: string;
|
|
51
|
+
creator: UserVO;
|
|
52
|
+
locked: number;
|
|
53
|
+
archived: number;
|
|
54
|
+
kickoffTime: number;
|
|
55
|
+
archivedTime: number;
|
|
56
|
+
createTime: number;
|
|
57
|
+
updateTime: number;
|
|
58
|
+
}
|
|
59
|
+
interface Sprint {
|
|
60
|
+
id: number;
|
|
61
|
+
spaceId: number;
|
|
62
|
+
name: string;
|
|
63
|
+
startDate: number;
|
|
64
|
+
endDate: number;
|
|
65
|
+
status: number;
|
|
66
|
+
statusName: string;
|
|
67
|
+
desc: string;
|
|
68
|
+
creator: UserVO;
|
|
69
|
+
locked: number;
|
|
70
|
+
archived: number;
|
|
71
|
+
createTime: number;
|
|
72
|
+
updateTime: number;
|
|
73
|
+
}
|
|
1
74
|
interface UserVO {
|
|
2
75
|
erp: string;
|
|
3
76
|
headImage: string;
|
|
@@ -17,66 +90,33 @@ interface UserVO {
|
|
|
17
90
|
declare class Application {
|
|
18
91
|
private axiosInstance;
|
|
19
92
|
constructor(userToken?: string);
|
|
93
|
+
/**
|
|
94
|
+
* 按卡片ID查询卡片详情(含所属空间、迭代、阶段、扩展字段及关联附件)
|
|
95
|
+
*
|
|
96
|
+
* @param cardId
|
|
97
|
+
* @returns
|
|
98
|
+
*/
|
|
99
|
+
getCardById(cardId: number): Promise<Card>;
|
|
20
100
|
/**
|
|
21
101
|
* 按空间ID查询空间信息
|
|
22
102
|
*
|
|
23
103
|
* @param spaceId 空间ID
|
|
24
104
|
* @returns
|
|
25
105
|
*/
|
|
26
|
-
getSpaceById(spaceId: string): Promise<
|
|
27
|
-
id: number;
|
|
28
|
-
key: string;
|
|
29
|
-
name: string;
|
|
30
|
-
desc: string;
|
|
31
|
-
creator: UserVO;
|
|
32
|
-
operator: UserVO;
|
|
33
|
-
visibility: number;
|
|
34
|
-
createTime: number;
|
|
35
|
-
updateTime: number;
|
|
36
|
-
}>;
|
|
106
|
+
getSpaceById(spaceId: string): Promise<Space>;
|
|
37
107
|
/**
|
|
38
108
|
* 按迭代ID查询迭代信息
|
|
39
109
|
*
|
|
40
110
|
* @param sprintId 迭代ID
|
|
41
111
|
* @returns
|
|
42
112
|
*/
|
|
43
|
-
getSprintById(sprintId: string): Promise<
|
|
44
|
-
id: number;
|
|
45
|
-
spaceId: number;
|
|
46
|
-
name: string;
|
|
47
|
-
startDate: number;
|
|
48
|
-
endDate: number;
|
|
49
|
-
status: number;
|
|
50
|
-
desc: string;
|
|
51
|
-
creator: UserVO;
|
|
52
|
-
locked: number;
|
|
53
|
-
archived: number;
|
|
54
|
-
kickoffTime: number;
|
|
55
|
-
archivedTime: number;
|
|
56
|
-
createTime: number;
|
|
57
|
-
updateTime: number;
|
|
58
|
-
}>;
|
|
113
|
+
getSprintById(sprintId: string): Promise<SprintInfo>;
|
|
59
114
|
/**
|
|
60
115
|
* 查询指定空间下的迭代列表
|
|
61
116
|
*
|
|
62
117
|
* @param spaceId 空间 ID
|
|
63
118
|
* @returns
|
|
64
119
|
*/
|
|
65
|
-
querySprintsBySpaceId(spaceId: string): Promise<
|
|
66
|
-
id: number;
|
|
67
|
-
spaceId: number;
|
|
68
|
-
name: string;
|
|
69
|
-
owner: UserVO;
|
|
70
|
-
startDate: number;
|
|
71
|
-
endDate: number;
|
|
72
|
-
status: number;
|
|
73
|
-
desc: string;
|
|
74
|
-
locked: number;
|
|
75
|
-
archived: number;
|
|
76
|
-
kickoffTime: number;
|
|
77
|
-
archivedTime: number;
|
|
78
|
-
cTime: number;
|
|
79
|
-
uTime: number;
|
|
80
|
-
}[]>;
|
|
120
|
+
querySprintsBySpaceId(spaceId: string): Promise<Sprint[]>;
|
|
81
121
|
}
|
|
82
|
-
export { Application as default };
|
|
122
|
+
export { type Card, type Space, type Sprint, type SprintInfo, type UserVO, Application as default };
|
package/dist/index.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import { create, isAxiosError } from "axios";
|
|
|
3
3
|
const BASE_URL = "http://api-gateway.jd.com/jacp";
|
|
4
4
|
const APP_ID = "joyclaw";
|
|
5
5
|
const CONTENT_TYPE = "application/json";
|
|
6
|
+
const API_SUCCESS_CODE = 200;
|
|
6
7
|
// src/index.ts
|
|
7
8
|
var Application = class {
|
|
8
9
|
axiosInstance;
|
|
@@ -34,6 +35,15 @@ var Application = class {
|
|
|
34
35
|
this.axiosInstance = axiosInstance;
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
38
|
+
* 按卡片ID查询卡片详情(含所属空间、迭代、阶段、扩展字段及关联附件)
|
|
39
|
+
*
|
|
40
|
+
* @param cardId
|
|
41
|
+
* @returns
|
|
42
|
+
*/
|
|
43
|
+
async getCardById(cardId) {
|
|
44
|
+
return (await this.axiosInstance.get(`/openapi/v3/cards/${cardId}`)).data;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
37
47
|
* 按空间ID查询空间信息
|
|
38
48
|
*
|
|
39
49
|
* @param spaceId 空间ID
|
|
@@ -58,7 +68,7 @@ var Application = class {
|
|
|
58
68
|
* @returns
|
|
59
69
|
*/
|
|
60
70
|
async querySprintsBySpaceId(spaceId) {
|
|
61
|
-
return (await this.axiosInstance.get(
|
|
71
|
+
return (await this.axiosInstance.get(`/openapi/v3/spaces/${spaceId}/sprints`)).data;
|
|
62
72
|
}
|
|
63
73
|
};
|
|
64
|
-
export { Application as default };
|
|
74
|
+
export { API_SUCCESS_CODE, APP_ID, BASE_URL, CONTENT_TYPE, Application as default };
|