dalux-build-api 1.0.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 -0
- package/README.md +300 -0
- package/package.json +46 -0
- package/src/api/CompaniesApi.js +60 -0
- package/src/api/CompanyCatalogApi.js +108 -0
- package/src/api/FileAreasApi.js +37 -0
- package/src/api/FileRevisionsApi.js +31 -0
- package/src/api/FileUploadApi.js +64 -0
- package/src/api/FilesApi.js +72 -0
- package/src/api/FoldersApi.js +58 -0
- package/src/api/FormsApi.js +48 -0
- package/src/api/InspectionPlansApi.js +62 -0
- package/src/api/ProjectTemplatesApi.js +25 -0
- package/src/api/ProjectsApi.js +106 -0
- package/src/api/TasksApi.js +59 -0
- package/src/api/TestPlansApi.js +59 -0
- package/src/api/UsersApi.js +47 -0
- package/src/api/VersionSetsApi.js +67 -0
- package/src/api/WorkPackagesApi.js +26 -0
- package/src/apiClient.js +75 -0
- package/src/configuration.js +24 -0
- package/src/index.js +92 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* API methods for files within a file area.
|
|
5
|
+
*/
|
|
6
|
+
class FilesApi {
|
|
7
|
+
/**
|
|
8
|
+
* @param {import('../apiClient')} apiClient
|
|
9
|
+
*/
|
|
10
|
+
constructor(apiClient) {
|
|
11
|
+
this._client = apiClient;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Browse all files on the given project and file area.
|
|
16
|
+
* GET /6.0/projects/{projectId}/file_areas/{fileAreaId}/files
|
|
17
|
+
* @param {string} projectId
|
|
18
|
+
* @param {string} fileAreaId
|
|
19
|
+
* @param {object} [params] - Optional filters (e.g. folderId, updatedAfter)
|
|
20
|
+
* @returns {Promise<object>}
|
|
21
|
+
*/
|
|
22
|
+
listFiles(projectId, fileAreaId, params = {}) {
|
|
23
|
+
return this._client.get(
|
|
24
|
+
`/6.0/projects/${projectId}/file_areas/${fileAreaId}/files`,
|
|
25
|
+
params,
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Retrieve a specific file.
|
|
31
|
+
* GET /5.0/projects/{projectId}/file_areas/{fileAreaId}/files/{fileId}
|
|
32
|
+
* @param {string} projectId
|
|
33
|
+
* @param {string} fileAreaId
|
|
34
|
+
* @param {string} fileId
|
|
35
|
+
* @returns {Promise<object>}
|
|
36
|
+
*/
|
|
37
|
+
getFile(projectId, fileAreaId, fileId) {
|
|
38
|
+
return this._client.get(
|
|
39
|
+
`/5.0/projects/${projectId}/file_areas/${fileAreaId}/files/${fileId}`,
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Retrieve properties mapping for a specific file.
|
|
45
|
+
* GET /1.0/projects/{projectId}/file_areas/{fileAreaId}/files/{fileId}/properties/1.0/mappings
|
|
46
|
+
* @param {string} projectId
|
|
47
|
+
* @param {string} fileAreaId
|
|
48
|
+
* @param {string} fileId
|
|
49
|
+
* @returns {Promise<object>}
|
|
50
|
+
*/
|
|
51
|
+
getFilePropertiesMapping(projectId, fileAreaId, fileId) {
|
|
52
|
+
return this._client.get(
|
|
53
|
+
`/1.0/projects/${projectId}/file_areas/${fileAreaId}/files/${fileId}/properties/1.0/mappings`,
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Retrieve valid property values for a specific file property mapping.
|
|
59
|
+
* GET /1.0/projects/{projectId}/file_areas/{fileAreaId}/files/properties/1.0/mappings/{filePropertyId}/values
|
|
60
|
+
* @param {string} projectId
|
|
61
|
+
* @param {string} fileAreaId
|
|
62
|
+
* @param {string} filePropertyId
|
|
63
|
+
* @returns {Promise<object>}
|
|
64
|
+
*/
|
|
65
|
+
getFilePropertyMappingValues(projectId, fileAreaId, filePropertyId) {
|
|
66
|
+
return this._client.get(
|
|
67
|
+
`/1.0/projects/${projectId}/file_areas/${fileAreaId}/files/properties/1.0/mappings/${filePropertyId}/values`,
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
module.exports = FilesApi;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* API methods for folders within a file area.
|
|
5
|
+
*/
|
|
6
|
+
class FoldersApi {
|
|
7
|
+
/**
|
|
8
|
+
* @param {import('../apiClient')} apiClient
|
|
9
|
+
*/
|
|
10
|
+
constructor(apiClient) {
|
|
11
|
+
this._client = apiClient;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Browse all folders on the given project and file area.
|
|
16
|
+
* GET /5.1/projects/{projectId}/file_areas/{fileAreaId}/folders
|
|
17
|
+
* @param {string} projectId
|
|
18
|
+
* @param {string} fileAreaId
|
|
19
|
+
* @param {object} [params]
|
|
20
|
+
* @returns {Promise<object>}
|
|
21
|
+
*/
|
|
22
|
+
listFolders(projectId, fileAreaId, params = {}) {
|
|
23
|
+
return this._client.get(
|
|
24
|
+
`/5.1/projects/${projectId}/file_areas/${fileAreaId}/folders`,
|
|
25
|
+
params,
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Retrieve a specific folder.
|
|
31
|
+
* GET /5.0/projects/{projectId}/file_areas/{fileAreaId}/folders/{folderId}
|
|
32
|
+
* @param {string} projectId
|
|
33
|
+
* @param {string} fileAreaId
|
|
34
|
+
* @param {string} folderId
|
|
35
|
+
* @returns {Promise<object>}
|
|
36
|
+
*/
|
|
37
|
+
getFolder(projectId, fileAreaId, folderId) {
|
|
38
|
+
return this._client.get(
|
|
39
|
+
`/5.0/projects/${projectId}/file_areas/${fileAreaId}/folders/${folderId}`,
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Retrieve all properties for each file type in a specific folder.
|
|
45
|
+
* GET /1.0/projects/{projectId}/file_areas/{fileAreaId}/folders/{folderId}/files/properties/1.0/mappings
|
|
46
|
+
* @param {string} projectId
|
|
47
|
+
* @param {string} fileAreaId
|
|
48
|
+
* @param {string} folderId
|
|
49
|
+
* @returns {Promise<object>}
|
|
50
|
+
*/
|
|
51
|
+
getFolderFilesProperties(projectId, fileAreaId, folderId) {
|
|
52
|
+
return this._client.get(
|
|
53
|
+
`/1.0/projects/${projectId}/file_areas/${fileAreaId}/folders/${folderId}/files/properties/1.0/mappings`,
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
module.exports = FoldersApi;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* API methods for forms on a project.
|
|
5
|
+
*/
|
|
6
|
+
class FormsApi {
|
|
7
|
+
/**
|
|
8
|
+
* @param {import('../apiClient')} apiClient
|
|
9
|
+
*/
|
|
10
|
+
constructor(apiClient) {
|
|
11
|
+
this._client = apiClient;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Retrieve forms on a project.
|
|
16
|
+
* GET /2.1/projects/{projectId}/forms
|
|
17
|
+
* @param {string} projectId
|
|
18
|
+
* @param {object} [params] - Optional filters (e.g. updatedAfter)
|
|
19
|
+
* @returns {Promise<object>}
|
|
20
|
+
*/
|
|
21
|
+
getProjectForms(projectId, params = {}) {
|
|
22
|
+
return this._client.get(`/2.1/projects/${projectId}/forms`, params);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Retrieve a specific form.
|
|
27
|
+
* GET /1.2/projects/{projectId}/forms/{formId}
|
|
28
|
+
* @param {string} projectId
|
|
29
|
+
* @param {string} formId
|
|
30
|
+
* @returns {Promise<object>}
|
|
31
|
+
*/
|
|
32
|
+
getForm(projectId, formId) {
|
|
33
|
+
return this._client.get(`/1.2/projects/${projectId}/forms/${formId}`);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Retrieve attachments on forms on a project in incremental updates.
|
|
38
|
+
* GET /2.1/projects/{projectId}/forms/attachments
|
|
39
|
+
* @param {string} projectId
|
|
40
|
+
* @param {object} [params] - Optional filters (e.g. updatedAfter)
|
|
41
|
+
* @returns {Promise<object>}
|
|
42
|
+
*/
|
|
43
|
+
getProjectFormAttachments(projectId, params = {}) {
|
|
44
|
+
return this._client.get(`/2.1/projects/${projectId}/forms/attachments`, params);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
module.exports = FormsApi;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* API methods for inspection plans.
|
|
5
|
+
*/
|
|
6
|
+
class InspectionPlansApi {
|
|
7
|
+
/**
|
|
8
|
+
* @param {import('../apiClient')} apiClient
|
|
9
|
+
*/
|
|
10
|
+
constructor(apiClient) {
|
|
11
|
+
this._client = apiClient;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Browse all inspection plans on the given project.
|
|
16
|
+
* GET /1.2/projects/{projectId}/inspectionPlans
|
|
17
|
+
* @param {string} projectId
|
|
18
|
+
* @param {object} [params]
|
|
19
|
+
* @returns {Promise<object>}
|
|
20
|
+
*/
|
|
21
|
+
listInspectionPlans(projectId, params = {}) {
|
|
22
|
+
return this._client.get(`/1.2/projects/${projectId}/inspectionPlans`, params);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Browse all inspection plan items on the given project.
|
|
27
|
+
* GET /1.1/projects/{projectId}/inspectionPlanItems
|
|
28
|
+
* @param {string} projectId
|
|
29
|
+
* @param {object} [params]
|
|
30
|
+
* @returns {Promise<object>}
|
|
31
|
+
*/
|
|
32
|
+
listInspectionPlanItems(projectId, params = {}) {
|
|
33
|
+
return this._client.get(`/1.1/projects/${projectId}/inspectionPlanItems`, params);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Browse all inspection plan item zones on the given project.
|
|
38
|
+
* GET /1.1/projects/{projectId}/inspectionPlanItemZones
|
|
39
|
+
* @param {string} projectId
|
|
40
|
+
* @param {object} [params]
|
|
41
|
+
* @returns {Promise<object>}
|
|
42
|
+
*/
|
|
43
|
+
listInspectionPlanItemZones(projectId, params = {}) {
|
|
44
|
+
return this._client.get(`/1.1/projects/${projectId}/inspectionPlanItemZones`, params);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Browse all inspection plan registrations on the given project.
|
|
49
|
+
* GET /2.1/projects/{projectId}/inspectionPlanRegistrations
|
|
50
|
+
* @param {string} projectId
|
|
51
|
+
* @param {object} [params]
|
|
52
|
+
* @returns {Promise<object>}
|
|
53
|
+
*/
|
|
54
|
+
listInspectionPlanRegistrations(projectId, params = {}) {
|
|
55
|
+
return this._client.get(
|
|
56
|
+
`/2.1/projects/${projectId}/inspectionPlanRegistrations`,
|
|
57
|
+
params,
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
module.exports = InspectionPlansApi;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* API methods for project templates.
|
|
5
|
+
*/
|
|
6
|
+
class ProjectTemplatesApi {
|
|
7
|
+
/**
|
|
8
|
+
* @param {import('../apiClient')} apiClient
|
|
9
|
+
*/
|
|
10
|
+
constructor(apiClient) {
|
|
11
|
+
this._client = apiClient;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Get all available project templates on the company profile.
|
|
16
|
+
* GET /1.1/projectTemplates
|
|
17
|
+
* @param {object} [params]
|
|
18
|
+
* @returns {Promise<object>}
|
|
19
|
+
*/
|
|
20
|
+
listProjectTemplates(params = {}) {
|
|
21
|
+
return this._client.get('/1.1/projectTemplates', params);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
module.exports = ProjectTemplatesApi;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* API methods for project management.
|
|
5
|
+
*/
|
|
6
|
+
class ProjectsApi {
|
|
7
|
+
/**
|
|
8
|
+
* @param {import('../apiClient')} apiClient
|
|
9
|
+
*/
|
|
10
|
+
constructor(apiClient) {
|
|
11
|
+
this._client = apiClient;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Get all available projects.
|
|
16
|
+
* GET /5.1/projects
|
|
17
|
+
* @param {object} [params] - Optional query parameters (e.g. updatedAfter)
|
|
18
|
+
* @returns {Promise<object>}
|
|
19
|
+
*/
|
|
20
|
+
listProjects(params = {}) {
|
|
21
|
+
return this._client.get('/5.1/projects', params);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Get a specific project.
|
|
26
|
+
* GET /5.0/projects/{projectId}
|
|
27
|
+
* @param {string} projectId
|
|
28
|
+
* @returns {Promise<object>}
|
|
29
|
+
*/
|
|
30
|
+
getProject(projectId) {
|
|
31
|
+
return this._client.get(`/5.0/projects/${projectId}`);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Create a new project.
|
|
36
|
+
* POST /5.0/projects
|
|
37
|
+
* @param {object} body
|
|
38
|
+
* @returns {Promise<object>}
|
|
39
|
+
*/
|
|
40
|
+
createProject(body) {
|
|
41
|
+
return this._client.post('/5.0/projects', body);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Update a project.
|
|
46
|
+
* PATCH /5.0/projects/{projectId}
|
|
47
|
+
* @param {string} projectId
|
|
48
|
+
* @param {object} body
|
|
49
|
+
* @returns {Promise<object>}
|
|
50
|
+
*/
|
|
51
|
+
updateProject(projectId, body) {
|
|
52
|
+
return this._client.patch(`/5.0/projects/${projectId}`, body);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Get all metadata available for POST project operations.
|
|
57
|
+
* GET /1.0/projects/metadata/1.0/mappings
|
|
58
|
+
* @returns {Promise<object>}
|
|
59
|
+
*/
|
|
60
|
+
listMetadataMappingsForProjects() {
|
|
61
|
+
return this._client.get('/1.0/projects/metadata/1.0/mappings');
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Get available values for a metadata key in POST project operations.
|
|
66
|
+
* GET /1.0/projects/metadata/1.0/mappings/{key}/values
|
|
67
|
+
* @param {string} key
|
|
68
|
+
* @returns {Promise<object>}
|
|
69
|
+
*/
|
|
70
|
+
listMetadataValuesForProjects(key) {
|
|
71
|
+
return this._client.get(`/1.0/projects/metadata/1.0/mappings/${key}/values`);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Get metadata of a specific project.
|
|
76
|
+
* GET /1.0/projects/{projectId}/metadata
|
|
77
|
+
* @param {string} projectId
|
|
78
|
+
* @returns {Promise<object>}
|
|
79
|
+
*/
|
|
80
|
+
listProjectMetadata(projectId) {
|
|
81
|
+
return this._client.get(`/1.0/projects/${projectId}/metadata`);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Get all metadata available for PATCH project operations.
|
|
86
|
+
* GET /1.0/projects/{projectId}/metadata/1.0/mappings
|
|
87
|
+
* @param {string} projectId
|
|
88
|
+
* @returns {Promise<object>}
|
|
89
|
+
*/
|
|
90
|
+
listProjectMetadataMappings(projectId) {
|
|
91
|
+
return this._client.get(`/1.0/projects/${projectId}/metadata/1.0/mappings`);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Get available values for metadata in a PATCH project operation.
|
|
96
|
+
* GET /1.0/projects/{projectId}/metadata/1.0/mappings/{key}/values
|
|
97
|
+
* @param {string} projectId
|
|
98
|
+
* @param {string} key
|
|
99
|
+
* @returns {Promise<object>}
|
|
100
|
+
*/
|
|
101
|
+
listProjectMetadataValues(projectId, key) {
|
|
102
|
+
return this._client.get(`/1.0/projects/${projectId}/metadata/1.0/mappings/${key}/values`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
module.exports = ProjectsApi;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* API methods for tasks, approvals, safety issues, observations and good practices.
|
|
5
|
+
*/
|
|
6
|
+
class TasksApi {
|
|
7
|
+
/**
|
|
8
|
+
* @param {import('../apiClient')} apiClient
|
|
9
|
+
*/
|
|
10
|
+
constructor(apiClient) {
|
|
11
|
+
this._client = apiClient;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Retrieve tasks, approvals, safety issues, safety observations and good practices on a project.
|
|
16
|
+
* GET /5.1/projects/{projectId}/tasks
|
|
17
|
+
* @param {string} projectId
|
|
18
|
+
* @param {object} [params] - Optional filters (e.g. updatedAfter, status, typeFilter)
|
|
19
|
+
* @returns {Promise<object>}
|
|
20
|
+
*/
|
|
21
|
+
getProjectTasks(projectId, params = {}) {
|
|
22
|
+
return this._client.get(`/5.1/projects/${projectId}/tasks`, params);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Retrieve a specific task/approval/safety issue/safety observation/good practice.
|
|
27
|
+
* GET /3.3/projects/{projectId}/tasks/{taskId}
|
|
28
|
+
* @param {string} projectId
|
|
29
|
+
* @param {string} taskId
|
|
30
|
+
* @returns {Promise<object>}
|
|
31
|
+
*/
|
|
32
|
+
getTask(projectId, taskId) {
|
|
33
|
+
return this._client.get(`/3.3/projects/${projectId}/tasks/${taskId}`);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Retrieve task changes on a project in incremental updates.
|
|
38
|
+
* GET /2.2/projects/{projectId}/tasks/changes
|
|
39
|
+
* @param {string} projectId
|
|
40
|
+
* @param {object} [params] - Optional filters (e.g. updatedAfter)
|
|
41
|
+
* @returns {Promise<object>}
|
|
42
|
+
*/
|
|
43
|
+
getProjectTaskChanges(projectId, params = {}) {
|
|
44
|
+
return this._client.get(`/2.2/projects/${projectId}/tasks/changes`, params);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Retrieve attachments on tasks on a project.
|
|
49
|
+
* GET /1.1/projects/{projectId}/tasks/attachments
|
|
50
|
+
* @param {string} projectId
|
|
51
|
+
* @param {object} [params] - Optional filters (e.g. updatedAfter)
|
|
52
|
+
* @returns {Promise<object>}
|
|
53
|
+
*/
|
|
54
|
+
getProjectTaskAttachments(projectId, params = {}) {
|
|
55
|
+
return this._client.get(`/1.1/projects/${projectId}/tasks/attachments`, params);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
module.exports = TasksApi;
|
|
@@ -0,0 +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;
|
|
@@ -0,0 +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;
|
|
@@ -0,0 +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;
|
|
@@ -0,0 +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;
|