dalux-build-api 1.0.4 → 1.1.0
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/LICENSE +21 -21
- package/README.md +365 -300
- package/package.json +46 -46
- package/src/api/CompaniesApi.js +60 -60
- package/src/api/CompanyCatalogApi.js +108 -108
- package/src/api/FileAreasApi.js +37 -37
- package/src/api/FileRevisionsApi.js +31 -31
- package/src/api/FileUploadApi.js +64 -64
- package/src/api/FilesApi.js +297 -72
- package/src/api/FoldersApi.js +58 -58
- package/src/api/FormsApi.js +48 -48
- package/src/api/InspectionPlansApi.js +62 -62
- package/src/api/ProjectTemplatesApi.js +25 -25
- package/src/api/ProjectsApi.js +106 -106
- package/src/api/TasksApi.js +161 -87
- package/src/api/TestPlansApi.js +59 -59
- package/src/api/UsersApi.js +47 -47
- package/src/api/VersionSetsApi.js +67 -67
- package/src/api/WorkPackagesApi.js +26 -26
- package/src/apiClient.js +75 -75
- package/src/configuration.js +24 -24
- package/src/index.js +92 -92
package/src/api/TasksApi.js
CHANGED
|
@@ -1,87 +1,161 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
* @param {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Build query params for GET /5.2/projects/.../tasks (OData).
|
|
5
|
+
* If params contains typeId and no $filter, expands to
|
|
6
|
+
* $filter=data/type/typeId eq '<typeId>'
|
|
7
|
+
* Single quotes in typeId are escaped as '' per OData. If $filter is set,
|
|
8
|
+
* typeId is still omitted from the outgoing query (not merged).
|
|
9
|
+
* @param {object} [params]
|
|
10
|
+
* @returns {object}
|
|
11
|
+
*/
|
|
12
|
+
function normalizeTaskParams(params = {}) {
|
|
13
|
+
const normalized = { ...params };
|
|
14
|
+
const typeId = normalized.typeId;
|
|
15
|
+
delete normalized.typeId;
|
|
16
|
+
if (typeId != null && normalized.$filter === undefined) {
|
|
17
|
+
const escaped = String(typeId).replace(/'/g, "''");
|
|
18
|
+
normalized.$filter = `data/type/typeId eq '${escaped}'`;
|
|
19
|
+
}
|
|
20
|
+
return normalized;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* API methods for tasks, approvals, safety issues, observations and good practices.
|
|
25
|
+
*/
|
|
26
|
+
class TasksApi {
|
|
27
|
+
/**
|
|
28
|
+
* @param {import('../apiClient')} apiClient
|
|
29
|
+
*/
|
|
30
|
+
constructor(apiClient) {
|
|
31
|
+
this._client = apiClient;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Retrieve tasks, approvals, safety issues, safety observations and good practices on a project.
|
|
36
|
+
* GET /5.2/projects/{projectId}/tasks
|
|
37
|
+
* @param {string} projectId
|
|
38
|
+
* @param {object} [params] - Optional filters (e.g. updatedAfter). Pass typeId as shorthand for
|
|
39
|
+
* OData $filter on task type, or pass $filter (and other OData options) directly.
|
|
40
|
+
* @returns {Promise<object>}
|
|
41
|
+
*/
|
|
42
|
+
getProjectTasks(projectId, params = {}) {
|
|
43
|
+
return this._client.get(`/5.2/projects/${projectId}/tasks`, normalizeTaskParams(params));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Retrieve all tasks on a project by following bookmark pagination automatically.
|
|
48
|
+
* Matches Python client behaviour: uses metadata.totalRemainingItems when present;
|
|
49
|
+
* otherwise uses metadata.totalItems across pages as a ceiling so pagination cannot run forever.
|
|
50
|
+
* @param {string} projectId
|
|
51
|
+
* @param {object} [params] - Optional filters / OData (typeId shorthand supported).
|
|
52
|
+
* @param {boolean} [verbose=false] - Log progress to console.
|
|
53
|
+
* @returns {Promise<object[]>} All task items across all pages
|
|
54
|
+
*/
|
|
55
|
+
async getAllProjectTasks(projectId, params = {}, verbose = false) {
|
|
56
|
+
const allItems = [];
|
|
57
|
+
const baseParams = normalizeTaskParams(params);
|
|
58
|
+
let currentParams = { ...baseParams };
|
|
59
|
+
let hasNextPage = true;
|
|
60
|
+
/** @type {number|null} */
|
|
61
|
+
let tasksItemsCeiling = null;
|
|
62
|
+
|
|
63
|
+
while (hasNextPage) {
|
|
64
|
+
const response = await this._client.get(`/5.2/projects/${projectId}/tasks`, currentParams);
|
|
65
|
+
const items = Array.isArray(response.items) ? response.items : [];
|
|
66
|
+
if (items.length) {
|
|
67
|
+
allItems.push(...items);
|
|
68
|
+
}
|
|
69
|
+
const meta = (response && response.metadata) || {};
|
|
70
|
+
let remaining;
|
|
71
|
+
let useFilesRemainingStop;
|
|
72
|
+
|
|
73
|
+
if (Object.prototype.hasOwnProperty.call(meta, 'totalRemainingItems')) {
|
|
74
|
+
remaining = Number(meta.totalRemainingItems);
|
|
75
|
+
useFilesRemainingStop = true;
|
|
76
|
+
} else if (Object.prototype.hasOwnProperty.call(meta, 'totalItems')) {
|
|
77
|
+
const ti = Number(meta.totalItems);
|
|
78
|
+
tasksItemsCeiling = Math.max(tasksItemsCeiling || 0, ti);
|
|
79
|
+
remaining = ti;
|
|
80
|
+
useFilesRemainingStop = false;
|
|
81
|
+
} else {
|
|
82
|
+
remaining = 0;
|
|
83
|
+
useFilesRemainingStop = true;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const nextLink = (response.links || []).find((l) => l.rel === 'nextPage');
|
|
87
|
+
const nextHref = nextLink ? nextLink.href : null;
|
|
88
|
+
|
|
89
|
+
if (verbose) {
|
|
90
|
+
const nextPart = nextHref ? ` next: ${nextHref}` : ' next: (none)';
|
|
91
|
+
if (useFilesRemainingStop) {
|
|
92
|
+
console.log(`Retrieved ${allItems.length} tasks so far, ${remaining} remaining...${nextPart}`);
|
|
93
|
+
} else if (tasksItemsCeiling != null) {
|
|
94
|
+
const remV = Math.max(0, tasksItemsCeiling - allItems.length);
|
|
95
|
+
console.log(`Retrieved ${allItems.length} tasks so far, ${remV} remaining...${nextPart}`);
|
|
96
|
+
} else {
|
|
97
|
+
console.log(`Retrieved ${allItems.length} tasks so far, ${remaining} remaining...${nextPart}`);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (!items.length) {
|
|
102
|
+
hasNextPage = false;
|
|
103
|
+
} else if (useFilesRemainingStop && remaining === 0) {
|
|
104
|
+
hasNextPage = false;
|
|
105
|
+
} else if (
|
|
106
|
+
!useFilesRemainingStop &&
|
|
107
|
+
tasksItemsCeiling != null &&
|
|
108
|
+
allItems.length >= tasksItemsCeiling
|
|
109
|
+
) {
|
|
110
|
+
hasNextPage = false;
|
|
111
|
+
} else if (nextLink) {
|
|
112
|
+
const bookmark = new URL(nextLink.href).searchParams.get('bookmark');
|
|
113
|
+
currentParams = { ...baseParams, bookmark };
|
|
114
|
+
} else {
|
|
115
|
+
hasNextPage = false;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (verbose) {
|
|
120
|
+
console.log(`Done. Total tasks retrieved: ${allItems.length}`);
|
|
121
|
+
}
|
|
122
|
+
return allItems;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Retrieve a specific task/approval/safety issue/safety observation/good practice.
|
|
127
|
+
* GET /3.3/projects/{projectId}/tasks/{taskId}
|
|
128
|
+
* @param {string} projectId
|
|
129
|
+
* @param {string} taskId
|
|
130
|
+
* @returns {Promise<object>}
|
|
131
|
+
*/
|
|
132
|
+
getTask(projectId, taskId) {
|
|
133
|
+
return this._client.get(`/3.3/projects/${projectId}/tasks/${taskId}`);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Retrieve task changes on a project in incremental updates.
|
|
138
|
+
* GET /2.2/projects/{projectId}/tasks/changes
|
|
139
|
+
* @param {string} projectId
|
|
140
|
+
* @param {object} [params] - Optional filters (e.g. updatedAfter)
|
|
141
|
+
* @returns {Promise<object>}
|
|
142
|
+
*/
|
|
143
|
+
getProjectTaskChanges(projectId, params = {}) {
|
|
144
|
+
return this._client.get(`/2.2/projects/${projectId}/tasks/changes`, params);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Retrieve attachments on tasks on a project.
|
|
149
|
+
* GET /1.1/projects/{projectId}/tasks/attachments
|
|
150
|
+
* @param {string} projectId
|
|
151
|
+
* @param {object} [params] - Optional filters (e.g. updatedAfter)
|
|
152
|
+
* @returns {Promise<object>}
|
|
153
|
+
*/
|
|
154
|
+
getProjectTaskAttachments(projectId, params = {}) {
|
|
155
|
+
return this._client.get(`/1.1/projects/${projectId}/tasks/attachments`, params);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
TasksApi.normalizeTaskParams = normalizeTaskParams;
|
|
160
|
+
|
|
161
|
+
module.exports = TasksApi;
|
package/src/api/TestPlansApi.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* API methods for test plans.
|
|
5
|
-
*/
|
|
6
|
-
class TestPlansApi {
|
|
7
|
-
/**
|
|
8
|
-
* @param {import('../apiClient')} apiClient
|
|
9
|
-
*/
|
|
10
|
-
constructor(apiClient) {
|
|
11
|
-
this._client = apiClient;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Browse all test plans on the given project.
|
|
16
|
-
* GET /1.2/projects/{projectId}/testPlans
|
|
17
|
-
* @param {string} projectId
|
|
18
|
-
* @param {object} [params]
|
|
19
|
-
* @returns {Promise<object>}
|
|
20
|
-
*/
|
|
21
|
-
listTestPlans(projectId, params = {}) {
|
|
22
|
-
return this._client.get(`/1.2/projects/${projectId}/testPlans`, params);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Browse all test plan items on the given project.
|
|
27
|
-
* GET /1.1/projects/{projectId}/testPlanItems
|
|
28
|
-
* @param {string} projectId
|
|
29
|
-
* @param {object} [params]
|
|
30
|
-
* @returns {Promise<object>}
|
|
31
|
-
*/
|
|
32
|
-
listTestPlanItems(projectId, params = {}) {
|
|
33
|
-
return this._client.get(`/1.1/projects/${projectId}/testPlanItems`, params);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Browse all test plan item zones on the given project.
|
|
38
|
-
* GET /1.1/projects/{projectId}/testPlanItemZones
|
|
39
|
-
* @param {string} projectId
|
|
40
|
-
* @param {object} [params]
|
|
41
|
-
* @returns {Promise<object>}
|
|
42
|
-
*/
|
|
43
|
-
listTestPlanItemZones(projectId, params = {}) {
|
|
44
|
-
return this._client.get(`/1.1/projects/${projectId}/testPlanItemZones`, params);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Browse all test plan registrations on the given project.
|
|
49
|
-
* GET /1.1/projects/{projectId}/testPlanRegistrations
|
|
50
|
-
* @param {string} projectId
|
|
51
|
-
* @param {object} [params]
|
|
52
|
-
* @returns {Promise<object>}
|
|
53
|
-
*/
|
|
54
|
-
listTestPlanRegistrations(projectId, params = {}) {
|
|
55
|
-
return this._client.get(`/1.1/projects/${projectId}/testPlanRegistrations`, params);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
module.exports = TestPlansApi;
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* API methods for test plans.
|
|
5
|
+
*/
|
|
6
|
+
class TestPlansApi {
|
|
7
|
+
/**
|
|
8
|
+
* @param {import('../apiClient')} apiClient
|
|
9
|
+
*/
|
|
10
|
+
constructor(apiClient) {
|
|
11
|
+
this._client = apiClient;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Browse all test plans on the given project.
|
|
16
|
+
* GET /1.2/projects/{projectId}/testPlans
|
|
17
|
+
* @param {string} projectId
|
|
18
|
+
* @param {object} [params]
|
|
19
|
+
* @returns {Promise<object>}
|
|
20
|
+
*/
|
|
21
|
+
listTestPlans(projectId, params = {}) {
|
|
22
|
+
return this._client.get(`/1.2/projects/${projectId}/testPlans`, params);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Browse all test plan items on the given project.
|
|
27
|
+
* GET /1.1/projects/{projectId}/testPlanItems
|
|
28
|
+
* @param {string} projectId
|
|
29
|
+
* @param {object} [params]
|
|
30
|
+
* @returns {Promise<object>}
|
|
31
|
+
*/
|
|
32
|
+
listTestPlanItems(projectId, params = {}) {
|
|
33
|
+
return this._client.get(`/1.1/projects/${projectId}/testPlanItems`, params);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Browse all test plan item zones on the given project.
|
|
38
|
+
* GET /1.1/projects/{projectId}/testPlanItemZones
|
|
39
|
+
* @param {string} projectId
|
|
40
|
+
* @param {object} [params]
|
|
41
|
+
* @returns {Promise<object>}
|
|
42
|
+
*/
|
|
43
|
+
listTestPlanItemZones(projectId, params = {}) {
|
|
44
|
+
return this._client.get(`/1.1/projects/${projectId}/testPlanItemZones`, params);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Browse all test plan registrations on the given project.
|
|
49
|
+
* GET /1.1/projects/{projectId}/testPlanRegistrations
|
|
50
|
+
* @param {string} projectId
|
|
51
|
+
* @param {object} [params]
|
|
52
|
+
* @returns {Promise<object>}
|
|
53
|
+
*/
|
|
54
|
+
listTestPlanRegistrations(projectId, params = {}) {
|
|
55
|
+
return this._client.get(`/1.1/projects/${projectId}/testPlanRegistrations`, params);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
module.exports = TestPlansApi;
|
package/src/api/UsersApi.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* API methods for users.
|
|
5
|
-
*/
|
|
6
|
-
class UsersApi {
|
|
7
|
-
/**
|
|
8
|
-
* @param {import('../apiClient')} apiClient
|
|
9
|
-
*/
|
|
10
|
-
constructor(apiClient) {
|
|
11
|
-
this._client = apiClient;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Get a specific user.
|
|
16
|
-
* GET /1.1/users/{userId}
|
|
17
|
-
* @param {string} userId
|
|
18
|
-
* @returns {Promise<object>}
|
|
19
|
-
*/
|
|
20
|
-
getUser(userId) {
|
|
21
|
-
return this._client.get(`/1.1/users/${userId}`);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Get users on a project.
|
|
26
|
-
* GET /1.2/projects/{projectId}/users
|
|
27
|
-
* @param {string} projectId
|
|
28
|
-
* @param {object} [params]
|
|
29
|
-
* @returns {Promise<object>}
|
|
30
|
-
*/
|
|
31
|
-
listProjectUsers(projectId, params = {}) {
|
|
32
|
-
return this._client.get(`/1.2/projects/${projectId}/users`, params);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Get a specific user on a project.
|
|
37
|
-
* GET /1.1/projects/{projectId}/users/{userId}
|
|
38
|
-
* @param {string} projectId
|
|
39
|
-
* @param {string} userId
|
|
40
|
-
* @returns {Promise<object>}
|
|
41
|
-
*/
|
|
42
|
-
getProjectUser(projectId, userId) {
|
|
43
|
-
return this._client.get(`/1.1/projects/${projectId}/users/${userId}`);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
module.exports = UsersApi;
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* API methods for users.
|
|
5
|
+
*/
|
|
6
|
+
class UsersApi {
|
|
7
|
+
/**
|
|
8
|
+
* @param {import('../apiClient')} apiClient
|
|
9
|
+
*/
|
|
10
|
+
constructor(apiClient) {
|
|
11
|
+
this._client = apiClient;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Get a specific user.
|
|
16
|
+
* GET /1.1/users/{userId}
|
|
17
|
+
* @param {string} userId
|
|
18
|
+
* @returns {Promise<object>}
|
|
19
|
+
*/
|
|
20
|
+
getUser(userId) {
|
|
21
|
+
return this._client.get(`/1.1/users/${userId}`);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Get users on a project.
|
|
26
|
+
* GET /1.2/projects/{projectId}/users
|
|
27
|
+
* @param {string} projectId
|
|
28
|
+
* @param {object} [params]
|
|
29
|
+
* @returns {Promise<object>}
|
|
30
|
+
*/
|
|
31
|
+
listProjectUsers(projectId, params = {}) {
|
|
32
|
+
return this._client.get(`/1.2/projects/${projectId}/users`, params);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Get a specific user on a project.
|
|
37
|
+
* GET /1.1/projects/{projectId}/users/{userId}
|
|
38
|
+
* @param {string} projectId
|
|
39
|
+
* @param {string} userId
|
|
40
|
+
* @returns {Promise<object>}
|
|
41
|
+
*/
|
|
42
|
+
getProjectUser(projectId, userId) {
|
|
43
|
+
return this._client.get(`/1.1/projects/${projectId}/users/${userId}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
module.exports = UsersApi;
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* API methods for version sets.
|
|
5
|
-
*/
|
|
6
|
-
class VersionSetsApi {
|
|
7
|
-
/**
|
|
8
|
-
* @param {import('../apiClient')} apiClient
|
|
9
|
-
*/
|
|
10
|
-
constructor(apiClient) {
|
|
11
|
-
this._client = apiClient;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Retrieve the version sets on the given project.
|
|
16
|
-
* GET /2.1/projects/{projectId}/version_sets
|
|
17
|
-
* @param {string} projectId
|
|
18
|
-
* @param {object} [params]
|
|
19
|
-
* @returns {Promise<object>}
|
|
20
|
-
*/
|
|
21
|
-
getVersionSets(projectId, params = {}) {
|
|
22
|
-
return this._client.get(`/2.1/projects/${projectId}/version_sets`, params);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Retrieve a specific version set.
|
|
27
|
-
* GET /2.0/projects/{projectId}/version_sets/{versionSetId}
|
|
28
|
-
* @param {string} projectId
|
|
29
|
-
* @param {string} versionSetId
|
|
30
|
-
* @returns {Promise<object>}
|
|
31
|
-
*/
|
|
32
|
-
getVersionSet(projectId, versionSetId) {
|
|
33
|
-
return this._client.get(`/2.0/projects/${projectId}/version_sets/${versionSetId}`);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Browse all version sets on the given file area and project.
|
|
38
|
-
* GET /2.1/projects/{projectId}/file_areas/{fileAreaId}/version_sets
|
|
39
|
-
* @param {string} projectId
|
|
40
|
-
* @param {string} fileAreaId
|
|
41
|
-
* @param {object} [params]
|
|
42
|
-
* @returns {Promise<object>}
|
|
43
|
-
*/
|
|
44
|
-
listFileAreaVersionSets(projectId, fileAreaId, params = {}) {
|
|
45
|
-
return this._client.get(
|
|
46
|
-
`/2.1/projects/${projectId}/file_areas/${fileAreaId}/version_sets`,
|
|
47
|
-
params,
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Browse all files on the given project and given version set.
|
|
53
|
-
* GET /3.0/projects/{projectId}/version_sets/{versionSetId}/files
|
|
54
|
-
* @param {string} projectId
|
|
55
|
-
* @param {string} versionSetId
|
|
56
|
-
* @param {object} [params]
|
|
57
|
-
* @returns {Promise<object>}
|
|
58
|
-
*/
|
|
59
|
-
listVersionSetFiles(projectId, versionSetId, params = {}) {
|
|
60
|
-
return this._client.get(
|
|
61
|
-
`/3.0/projects/${projectId}/version_sets/${versionSetId}/files`,
|
|
62
|
-
params,
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
module.exports = VersionSetsApi;
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* API methods for version sets.
|
|
5
|
+
*/
|
|
6
|
+
class VersionSetsApi {
|
|
7
|
+
/**
|
|
8
|
+
* @param {import('../apiClient')} apiClient
|
|
9
|
+
*/
|
|
10
|
+
constructor(apiClient) {
|
|
11
|
+
this._client = apiClient;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Retrieve the version sets on the given project.
|
|
16
|
+
* GET /2.1/projects/{projectId}/version_sets
|
|
17
|
+
* @param {string} projectId
|
|
18
|
+
* @param {object} [params]
|
|
19
|
+
* @returns {Promise<object>}
|
|
20
|
+
*/
|
|
21
|
+
getVersionSets(projectId, params = {}) {
|
|
22
|
+
return this._client.get(`/2.1/projects/${projectId}/version_sets`, params);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Retrieve a specific version set.
|
|
27
|
+
* GET /2.0/projects/{projectId}/version_sets/{versionSetId}
|
|
28
|
+
* @param {string} projectId
|
|
29
|
+
* @param {string} versionSetId
|
|
30
|
+
* @returns {Promise<object>}
|
|
31
|
+
*/
|
|
32
|
+
getVersionSet(projectId, versionSetId) {
|
|
33
|
+
return this._client.get(`/2.0/projects/${projectId}/version_sets/${versionSetId}`);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Browse all version sets on the given file area and project.
|
|
38
|
+
* GET /2.1/projects/{projectId}/file_areas/{fileAreaId}/version_sets
|
|
39
|
+
* @param {string} projectId
|
|
40
|
+
* @param {string} fileAreaId
|
|
41
|
+
* @param {object} [params]
|
|
42
|
+
* @returns {Promise<object>}
|
|
43
|
+
*/
|
|
44
|
+
listFileAreaVersionSets(projectId, fileAreaId, params = {}) {
|
|
45
|
+
return this._client.get(
|
|
46
|
+
`/2.1/projects/${projectId}/file_areas/${fileAreaId}/version_sets`,
|
|
47
|
+
params,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Browse all files on the given project and given version set.
|
|
53
|
+
* GET /3.0/projects/{projectId}/version_sets/{versionSetId}/files
|
|
54
|
+
* @param {string} projectId
|
|
55
|
+
* @param {string} versionSetId
|
|
56
|
+
* @param {object} [params]
|
|
57
|
+
* @returns {Promise<object>}
|
|
58
|
+
*/
|
|
59
|
+
listVersionSetFiles(projectId, versionSetId, params = {}) {
|
|
60
|
+
return this._client.get(
|
|
61
|
+
`/3.0/projects/${projectId}/version_sets/${versionSetId}/files`,
|
|
62
|
+
params,
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
module.exports = VersionSetsApi;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* API methods for work packages on a project.
|
|
5
|
-
*/
|
|
6
|
-
class WorkPackagesApi {
|
|
7
|
-
/**
|
|
8
|
-
* @param {import('../apiClient')} apiClient
|
|
9
|
-
*/
|
|
10
|
-
constructor(apiClient) {
|
|
11
|
-
this._client = apiClient;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Browse all work packages on the given project.
|
|
16
|
-
* GET /1.0/projects/{projectId}/workpackages
|
|
17
|
-
* @param {string} projectId
|
|
18
|
-
* @param {object} [params]
|
|
19
|
-
* @returns {Promise<object>}
|
|
20
|
-
*/
|
|
21
|
-
listWorkPackages(projectId, params = {}) {
|
|
22
|
-
return this._client.get(`/1.0/projects/${projectId}/workpackages`, params);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
module.exports = WorkPackagesApi;
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* API methods for work packages on a project.
|
|
5
|
+
*/
|
|
6
|
+
class WorkPackagesApi {
|
|
7
|
+
/**
|
|
8
|
+
* @param {import('../apiClient')} apiClient
|
|
9
|
+
*/
|
|
10
|
+
constructor(apiClient) {
|
|
11
|
+
this._client = apiClient;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Browse all work packages on the given project.
|
|
16
|
+
* GET /1.0/projects/{projectId}/workpackages
|
|
17
|
+
* @param {string} projectId
|
|
18
|
+
* @param {object} [params]
|
|
19
|
+
* @returns {Promise<object>}
|
|
20
|
+
*/
|
|
21
|
+
listWorkPackages(projectId, params = {}) {
|
|
22
|
+
return this._client.get(`/1.0/projects/${projectId}/workpackages`, params);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
module.exports = WorkPackagesApi;
|