dalux-build-api 1.1.3 → 2.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.
Files changed (48) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +404 -365
  3. package/package.json +47 -46
  4. package/src/api/CompaniesApi.js +67 -60
  5. package/src/api/CompanyCatalogApi.js +129 -108
  6. package/src/api/FileAreasApi.js +57 -37
  7. package/src/api/FileRevisionsApi.js +31 -31
  8. package/src/api/FileUploadApi.js +64 -64
  9. package/src/api/FilesApi.js +701 -297
  10. package/src/api/FoldersApi.js +283 -58
  11. package/src/api/FormsApi.js +53 -48
  12. package/src/api/InspectionPlansApi.js +66 -62
  13. package/src/api/ProjectTemplatesApi.js +25 -25
  14. package/src/api/ProjectsApi.js +127 -106
  15. package/src/api/TasksApi.js +193 -161
  16. package/src/api/TestPlansApi.js +63 -59
  17. package/src/api/UsersApi.js +52 -47
  18. package/src/api/VersionSetsApi.js +75 -67
  19. package/src/api/WorkPackagesApi.js +30 -26
  20. package/src/apiClient.js +139 -75
  21. package/src/configuration.js +39 -24
  22. package/src/index.js +133 -92
  23. package/src/models/common.js +22 -0
  24. package/src/models/companies/index.js +14 -0
  25. package/src/models/companyCatalog/index.js +19 -0
  26. package/src/models/convert.js +44 -0
  27. package/src/models/fileAreas/index.js +20 -0
  28. package/src/models/fileRevisions/index.js +12 -0
  29. package/src/models/fileUpload/index.js +12 -0
  30. package/src/models/files/index.js +97 -0
  31. package/src/models/folders/index.js +20 -0
  32. package/src/models/forms/index.js +19 -0
  33. package/src/models/helpers.js +62 -0
  34. package/src/models/index.js +148 -0
  35. package/src/models/inspectionPlans/index.js +18 -0
  36. package/src/models/projectTemplates/index.js +11 -0
  37. package/src/models/projects/index.js +57 -0
  38. package/src/models/tasks/index.js +105 -0
  39. package/src/models/testPlans/index.js +17 -0
  40. package/src/models/users/index.js +29 -0
  41. package/src/models/versionSets/index.js +22 -0
  42. package/src/models/workPackages/index.js +19 -0
  43. package/src/utils/errors.js +45 -0
  44. package/src/utils/index.js +26 -0
  45. package/src/utils/pagination.js +82 -0
  46. package/src/utils/pathResolver.js +124 -0
  47. package/src/utils/search.js +61 -0
  48. package/src/utils/validation.js +36 -0
package/package.json CHANGED
@@ -1,46 +1,47 @@
1
- {
2
- "name": "dalux-build-api",
3
- "version": "1.1.3",
4
- "description": "Node.js client for the Dalux Build API",
5
- "main": "src/index.js",
6
- "files": [
7
- "src",
8
- "README.md"
9
- ],
10
- "scripts": {
11
- "test": "jest --coverage",
12
- "build": "npm pack",
13
- "pack:check": "npm pack --dry-run",
14
- "release:check": "npm test && npm run pack:check"
15
- },
16
- "keywords": [
17
- "dalux",
18
- "build",
19
- "api",
20
- "client",
21
- "construction"
22
- ],
23
- "author": "Bruno Adam",
24
- "license": "MIT",
25
- "repository": {
26
- "type": "git",
27
- "url": "git+https://github.com/bruadam/Dalux-Build-API.git"
28
- },
29
- "bugs": {
30
- "url": "https://github.com/bruadam/Dalux-Build-API/issues"
31
- },
32
- "homepage": "https://github.com/bruadam/Dalux-Build-API#readme",
33
- "publishConfig": {
34
- "access": "public"
35
- },
36
- "dependencies": {
37
- "axios": "^1.7.7"
38
- },
39
- "devDependencies": {
40
- "axios-mock-adapter": "^2.1.0",
41
- "jest": "^29.7.0"
42
- },
43
- "jest": {
44
- "testEnvironment": "node"
45
- }
46
- }
1
+ {
2
+ "name": "dalux-build-api",
3
+ "version": "2.0.0",
4
+ "description": "Node.js client for the Dalux Build API",
5
+ "main": "src/index.js",
6
+ "files": [
7
+ "src",
8
+ "README.md"
9
+ ],
10
+ "scripts": {
11
+ "test": "jest --coverage",
12
+ "build": "npm pack",
13
+ "pack:check": "npm pack --dry-run",
14
+ "release:check": "npm test && npm run pack:check"
15
+ },
16
+ "keywords": [
17
+ "dalux",
18
+ "build",
19
+ "api",
20
+ "client",
21
+ "construction"
22
+ ],
23
+ "author": "Bruno Adam",
24
+ "license": "MIT",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/bruadam/dalux-build.git"
28
+ },
29
+ "bugs": {
30
+ "url": "https://github.com/bruadam/dalux-build/issues"
31
+ },
32
+ "homepage": "https://github.com/bruadam/dalux-build#readme",
33
+ "publishConfig": {
34
+ "access": "public"
35
+ },
36
+ "dependencies": {
37
+ "axios": "^1.7.7",
38
+ "zod": "^3.23.8"
39
+ },
40
+ "devDependencies": {
41
+ "axios-mock-adapter": "^2.1.0",
42
+ "jest": "^29.7.0"
43
+ },
44
+ "jest": {
45
+ "testEnvironment": "node"
46
+ }
47
+ }
@@ -1,60 +1,67 @@
1
- 'use strict';
2
-
3
- /**
4
- * API methods for managing companies on a project.
5
- */
6
- class CompaniesApi {
7
- /**
8
- * @param {import('../apiClient')} apiClient
9
- */
10
- constructor(apiClient) {
11
- this._client = apiClient;
12
- }
13
-
14
- /**
15
- * Get companies on a project.
16
- * GET /3.1/projects/{projectId}/companies
17
- * @param {string} projectId
18
- * @param {object} [params]
19
- * @returns {Promise<object>}
20
- */
21
- listProjectCompanies(projectId, params = {}) {
22
- return this._client.get(`/3.1/projects/${projectId}/companies`, params);
23
- }
24
-
25
- /**
26
- * Get a specific company on a project.
27
- * GET /3.0/projects/{projectId}/companies/{companyId}
28
- * @param {string} projectId
29
- * @param {string} companyId
30
- * @returns {Promise<object>}
31
- */
32
- getProjectCompany(projectId, companyId) {
33
- return this._client.get(`/3.0/projects/${projectId}/companies/${companyId}`);
34
- }
35
-
36
- /**
37
- * Add a company to a project.
38
- * POST /3.1/projects/{projectId}/companies
39
- * @param {string} projectId
40
- * @param {object} body
41
- * @returns {Promise<object>}
42
- */
43
- createProjectCompany(projectId, body) {
44
- return this._client.post(`/3.1/projects/${projectId}/companies`, body);
45
- }
46
-
47
- /**
48
- * Update a company on a project.
49
- * PATCH /3.0/projects/{projectId}/companies/{companyId}
50
- * @param {string} projectId
51
- * @param {string} companyId
52
- * @param {object} body
53
- * @returns {Promise<object>}
54
- */
55
- updateProjectCompany(projectId, companyId, body) {
56
- return this._client.patch(`/3.0/projects/${projectId}/companies/${companyId}`, body);
57
- }
58
- }
59
-
60
- module.exports = CompaniesApi;
1
+ 'use strict';
2
+
3
+ const { convertToModel } = require('../models/convert');
4
+ const { CompaniesListResponseSchema, CompanyResponseSchema } = require('../models/companies');
5
+
6
+ /**
7
+ * API methods for managing companies on a project.
8
+ */
9
+ class CompaniesApi {
10
+ /**
11
+ * @param {import('../apiClient')} apiClient
12
+ */
13
+ constructor(apiClient) {
14
+ this._client = apiClient;
15
+ }
16
+
17
+ /**
18
+ * Get companies on a project.
19
+ * GET /3.1/projects/{projectId}/companies
20
+ * @param {string} projectId
21
+ * @param {object} [params]
22
+ * @returns {Promise<object>} CompaniesListResponse ({ items: ProjectCompany[], metadata?, links? })
23
+ */
24
+ async listProjectCompanies(projectId, params = {}) {
25
+ const response = await this._client.get(`/3.1/projects/${projectId}/companies`, params);
26
+ return convertToModel(response, CompaniesListResponseSchema, 'CompaniesListResponse');
27
+ }
28
+
29
+ /**
30
+ * Get a specific company on a project.
31
+ * GET /3.0/projects/{projectId}/companies/{companyId}
32
+ * @param {string} projectId
33
+ * @param {string} companyId
34
+ * @returns {Promise<object>} CompanyResponse ({ data: ProjectCompany, links? })
35
+ */
36
+ async getProjectCompany(projectId, companyId) {
37
+ const response = await this._client.get(`/3.0/projects/${projectId}/companies/${companyId}`);
38
+ return convertToModel(response, CompanyResponseSchema, 'CompanyResponse');
39
+ }
40
+
41
+ /**
42
+ * Add a company to a project.
43
+ * POST /3.1/projects/{projectId}/companies
44
+ * @param {string} projectId
45
+ * @param {object} body
46
+ * @returns {Promise<object>} CompanyResponse
47
+ */
48
+ async createProjectCompany(projectId, body) {
49
+ const response = await this._client.post(`/3.1/projects/${projectId}/companies`, body);
50
+ return convertToModel(response, CompanyResponseSchema, 'CompanyResponse');
51
+ }
52
+
53
+ /**
54
+ * Update a company on a project.
55
+ * PATCH /3.0/projects/{projectId}/companies/{companyId}
56
+ * @param {string} projectId
57
+ * @param {string} companyId
58
+ * @param {object} body
59
+ * @returns {Promise<object>} CompanyResponse
60
+ */
61
+ async updateProjectCompany(projectId, companyId, body) {
62
+ const response = await this._client.patch(`/3.0/projects/${projectId}/companies/${companyId}`, body);
63
+ return convertToModel(response, CompanyResponseSchema, 'CompanyResponse');
64
+ }
65
+ }
66
+
67
+ module.exports = CompaniesApi;
@@ -1,108 +1,129 @@
1
- 'use strict';
2
-
3
- /**
4
- * API methods for the company catalog.
5
- */
6
- class CompanyCatalogApi {
7
- /**
8
- * @param {import('../apiClient')} apiClient
9
- */
10
- constructor(apiClient) {
11
- this._client = apiClient;
12
- }
13
-
14
- /**
15
- * Get companies registered in the company catalog.
16
- * GET /2.2/companyCatalog
17
- * @param {object} [params]
18
- * @returns {Promise<object>}
19
- */
20
- getCompanies(params = {}) {
21
- return this._client.get('/2.2/companyCatalog', params);
22
- }
23
-
24
- /**
25
- * Get a specific company from the catalog.
26
- * GET /1.2/companyCatalog/{catalogCompanyId}
27
- * @param {string} catalogCompanyId
28
- * @returns {Promise<object>}
29
- */
30
- getCompany(catalogCompanyId) {
31
- return this._client.get(`/1.2/companyCatalog/${catalogCompanyId}`);
32
- }
33
-
34
- /**
35
- * Add a company to the catalog.
36
- * POST /2.2/companyCatalog
37
- * @param {object} body
38
- * @returns {Promise<object>}
39
- */
40
- createCompany(body) {
41
- return this._client.post('/2.2/companyCatalog', body);
42
- }
43
-
44
- /**
45
- * Update a company in the catalog.
46
- * PATCH /2.1/companyCatalog/{catalogCompanyId}
47
- * @param {string} catalogCompanyId
48
- * @param {object} body
49
- * @returns {Promise<object>}
50
- */
51
- updateCompany(catalogCompanyId, body) {
52
- return this._client.patch(`/2.1/companyCatalog/${catalogCompanyId}`, body);
53
- }
54
-
55
- /**
56
- * Get metadata of a specific company from the catalog.
57
- * GET /1.0/companyCatalog/{catalogCompanyId}/metadata
58
- * @param {string} catalogCompanyId
59
- * @returns {Promise<object>}
60
- */
61
- listCompanyMetadata(catalogCompanyId) {
62
- return this._client.get(`/1.0/companyCatalog/${catalogCompanyId}/metadata`);
63
- }
64
-
65
- /**
66
- * Get all metadata available for a PATCH company-catalog operation.
67
- * GET /1.0/companyCatalog/{catalogCompanyId}/metadata/1.0/mappings
68
- * @param {string} catalogCompanyId
69
- * @returns {Promise<object>}
70
- */
71
- listCompanyMetadataMappings(catalogCompanyId) {
72
- return this._client.get(`/1.0/companyCatalog/${catalogCompanyId}/metadata/1.0/mappings`);
73
- }
74
-
75
- /**
76
- * Get available values for metadata in a PATCH company-catalog operation.
77
- * GET /1.0/companyCatalog/{catalogCompanyId}/metadata/1.0/mappings/{key}/values
78
- * @param {string} catalogCompanyId
79
- * @param {string} key
80
- * @returns {Promise<object>}
81
- */
82
- listCompanyMetadataValues(catalogCompanyId, key) {
83
- return this._client.get(
84
- `/1.0/companyCatalog/${catalogCompanyId}/metadata/1.0/mappings/${key}/values`,
85
- );
86
- }
87
-
88
- /**
89
- * Get all metadata available for a POST company-catalog operation.
90
- * GET /1.0/companyCatalog/metadata/1.0/mappings
91
- * @returns {Promise<object>}
92
- */
93
- listMetadataMappingsForCompanies() {
94
- return this._client.get('/1.0/companyCatalog/metadata/1.0/mappings');
95
- }
96
-
97
- /**
98
- * Get available values for metadata in a POST company-catalog operation.
99
- * GET /1.0/companyCatalog/metadata/1.0/mappings/{key}/values
100
- * @param {string} key
101
- * @returns {Promise<object>}
102
- */
103
- listMetadataValuesForCompanies(key) {
104
- return this._client.get(`/1.0/companyCatalog/metadata/1.0/mappings/${key}/values`);
105
- }
106
- }
107
-
108
- module.exports = CompanyCatalogApi;
1
+ 'use strict';
2
+
3
+ const { findByField } = require('../utils/search');
4
+ const { convertToModel } = require('../models/convert');
5
+ const { CompaniesListResponseSchema, CompanyResponseSchema } = require('../models/companies');
6
+
7
+ /**
8
+ * API methods for the company catalog.
9
+ */
10
+ class CompanyCatalogApi {
11
+ /**
12
+ * @param {import('../apiClient')} apiClient
13
+ */
14
+ constructor(apiClient) {
15
+ this._client = apiClient;
16
+ }
17
+
18
+ /**
19
+ * Get companies registered in the company catalog.
20
+ * GET /2.2/companyCatalog
21
+ * @param {object} [params]
22
+ * @returns {Promise<object>} CompaniesListResponse ({ items: ProjectCompany[], metadata?, links? })
23
+ */
24
+ async getCompanies(params = {}) {
25
+ const response = await this._client.get('/2.2/companyCatalog', params);
26
+ return convertToModel(response, CompaniesListResponseSchema, 'CompaniesListResponse');
27
+ }
28
+
29
+ /**
30
+ * Get a specific company from the catalog.
31
+ * GET /1.2/companyCatalog/{catalogCompanyId}
32
+ * @param {string} catalogCompanyId
33
+ * @returns {Promise<object>} CompanyResponse ({ data: ProjectCompany, links? })
34
+ */
35
+ async getCompany(catalogCompanyId) {
36
+ const response = await this._client.get(`/1.2/companyCatalog/${catalogCompanyId}`);
37
+ return convertToModel(response, CompanyResponseSchema, 'CompanyResponse');
38
+ }
39
+
40
+ /**
41
+ * Add a company to the catalog.
42
+ * POST /2.2/companyCatalog
43
+ * @param {object} body
44
+ * @returns {Promise<object>} CompanyResponse
45
+ */
46
+ async createCompany(body) {
47
+ const response = await this._client.post('/2.2/companyCatalog', body);
48
+ return convertToModel(response, CompanyResponseSchema, 'CompanyResponse');
49
+ }
50
+
51
+ /**
52
+ * Update a company in the catalog.
53
+ * PATCH /2.1/companyCatalog/{catalogCompanyId}
54
+ * @param {string} catalogCompanyId
55
+ * @param {object} body
56
+ * @returns {Promise<object>} CompanyResponse
57
+ */
58
+ async updateCompany(catalogCompanyId, body) {
59
+ const response = await this._client.patch(`/2.1/companyCatalog/${catalogCompanyId}`, body);
60
+ return convertToModel(response, CompanyResponseSchema, 'CompanyResponse');
61
+ }
62
+
63
+ /**
64
+ * Get metadata of a specific company from the catalog.
65
+ * GET /1.0/companyCatalog/{catalogCompanyId}/metadata
66
+ * @param {string} catalogCompanyId
67
+ * @returns {Promise<object>}
68
+ */
69
+ listCompanyMetadata(catalogCompanyId) {
70
+ return this._client.get(`/1.0/companyCatalog/${catalogCompanyId}/metadata`);
71
+ }
72
+
73
+ /**
74
+ * Get all metadata available for a PATCH company-catalog operation.
75
+ * GET /1.0/companyCatalog/{catalogCompanyId}/metadata/1.0/mappings
76
+ * @param {string} catalogCompanyId
77
+ * @returns {Promise<object>}
78
+ */
79
+ listCompanyMetadataMappings(catalogCompanyId) {
80
+ return this._client.get(`/1.0/companyCatalog/${catalogCompanyId}/metadata/1.0/mappings`);
81
+ }
82
+
83
+ /**
84
+ * Get available values for metadata in a PATCH company-catalog operation.
85
+ * GET /1.0/companyCatalog/{catalogCompanyId}/metadata/1.0/mappings/{key}/values
86
+ * @param {string} catalogCompanyId
87
+ * @param {string} key
88
+ * @returns {Promise<object>}
89
+ */
90
+ listCompanyMetadataValues(catalogCompanyId, key) {
91
+ return this._client.get(
92
+ `/1.0/companyCatalog/${catalogCompanyId}/metadata/1.0/mappings/${key}/values`,
93
+ );
94
+ }
95
+
96
+ /**
97
+ * Get all metadata available for a POST company-catalog operation.
98
+ * GET /1.0/companyCatalog/metadata/1.0/mappings
99
+ * @returns {Promise<object>}
100
+ */
101
+ listMetadataMappingsForCompanies() {
102
+ return this._client.get('/1.0/companyCatalog/metadata/1.0/mappings');
103
+ }
104
+
105
+ /**
106
+ * Get available values for metadata in a POST company-catalog operation.
107
+ * GET /1.0/companyCatalog/metadata/1.0/mappings/{key}/values
108
+ * @param {string} key
109
+ * @returns {Promise<object>}
110
+ */
111
+ listMetadataValuesForCompanies(key) {
112
+ return this._client.get(`/1.0/companyCatalog/metadata/1.0/mappings/${key}/values`);
113
+ }
114
+
115
+ /**
116
+ * Get a company ID by its name from the catalog.
117
+ * @param {string} companyName
118
+ * @returns {Promise<string|null>} The catalogCompanyId, or null if not found.
119
+ */
120
+ async getCompanyByName(companyName) {
121
+ const response = await this.getCompanies();
122
+ const items = (response && response.items) || [];
123
+ const company = findByField(items, 'name', companyName);
124
+ if (!company) return null;
125
+ return company.catalogCompanyId || null;
126
+ }
127
+ }
128
+
129
+ module.exports = CompanyCatalogApi;
@@ -1,37 +1,57 @@
1
- 'use strict';
2
-
3
- /**
4
- * API methods for file areas on a project.
5
- */
6
- class FileAreasApi {
7
- /**
8
- * @param {import('../apiClient')} apiClient
9
- */
10
- constructor(apiClient) {
11
- this._client = apiClient;
12
- }
13
-
14
- /**
15
- * Retrieve the file areas on the given project.
16
- * GET /5.1/projects/{projectId}/file_areas
17
- * @param {string} projectId
18
- * @param {object} [params]
19
- * @returns {Promise<object>}
20
- */
21
- getFileAreas(projectId, params = {}) {
22
- return this._client.get(`/5.1/projects/${projectId}/file_areas`, params);
23
- }
24
-
25
- /**
26
- * Retrieve a specific file area.
27
- * GET /1.0/projects/{projectId}/file_areas/{fileAreaId}
28
- * @param {string} projectId
29
- * @param {string} fileAreaId
30
- * @returns {Promise<object>}
31
- */
32
- getFileArea(projectId, fileAreaId) {
33
- return this._client.get(`/1.0/projects/${projectId}/file_areas/${fileAreaId}`);
34
- }
35
- }
36
-
37
- module.exports = FileAreasApi;
1
+ 'use strict';
2
+
3
+ const { findByField } = require('../utils/search');
4
+ const { convertToModel } = require('../models/convert');
5
+ const { FileAreaSchema, FileAreasListResponseSchema } = require('../models/fileAreas');
6
+
7
+ /**
8
+ * API methods for file areas on a project.
9
+ */
10
+ class FileAreasApi {
11
+ /**
12
+ * @param {import('../apiClient')} apiClient
13
+ */
14
+ constructor(apiClient) {
15
+ this._client = apiClient;
16
+ }
17
+
18
+ /**
19
+ * Retrieve the file areas on the given project.
20
+ * GET /5.1/projects/{projectId}/file_areas
21
+ * @param {string} projectId
22
+ * @param {object} [params]
23
+ * @returns {Promise<object>} FileAreasListResponse ({ items: FileArea[], metadata?, links? })
24
+ */
25
+ async getFileAreas(projectId, params = {}) {
26
+ const response = await this._client.get(`/5.1/projects/${projectId}/file_areas`, params);
27
+ return convertToModel(response, FileAreasListResponseSchema, 'FileAreasListResponse');
28
+ }
29
+
30
+ /**
31
+ * Retrieve a specific file area.
32
+ * GET /1.0/projects/{projectId}/file_areas/{fileAreaId}
33
+ * @param {string} projectId
34
+ * @param {string} fileAreaId
35
+ * @returns {Promise<object>} FileArea (not wrapped in a data envelope, matches Python)
36
+ */
37
+ async getFileArea(projectId, fileAreaId) {
38
+ const response = await this._client.get(`/1.0/projects/${projectId}/file_areas/${fileAreaId}`);
39
+ return convertToModel(response, FileAreaSchema, 'FileArea');
40
+ }
41
+
42
+ /**
43
+ * Get a file area ID by its name for a project.
44
+ * @param {string} projectId
45
+ * @param {string} fileAreaName
46
+ * @returns {Promise<string|null>} The fileAreaId, or null if not found.
47
+ */
48
+ async getFileAreaByName(projectId, fileAreaName) {
49
+ const response = await this.getFileAreas(projectId);
50
+ const items = (response && response.items) || [];
51
+ const area = findByField(items, 'fileAreaName', fileAreaName);
52
+ if (!area) return null;
53
+ return area.fileAreaId || null;
54
+ }
55
+ }
56
+
57
+ module.exports = FileAreasApi;
@@ -1,31 +1,31 @@
1
- 'use strict';
2
-
3
- /**
4
- * API methods for file revision content.
5
- */
6
- class FileRevisionsApi {
7
- /**
8
- * @param {import('../apiClient')} apiClient
9
- */
10
- constructor(apiClient) {
11
- this._client = apiClient;
12
- }
13
-
14
- /**
15
- * Retrieve content of a specific file revision.
16
- * GET /2.0/projects/{projectId}/file_areas/{fileAreaId}/files/{fileId}/revisions/{fileRevisionId}/content
17
- * @param {string} projectId
18
- * @param {string} fileAreaId
19
- * @param {string} fileId
20
- * @param {string} fileRevisionId
21
- * @returns {Promise<Buffer>} Raw binary content
22
- */
23
- getFileRevisionContent(projectId, fileAreaId, fileId, fileRevisionId) {
24
- return this._client.get(
25
- `/2.0/projects/${projectId}/file_areas/${fileAreaId}/files/${fileId}/revisions/${fileRevisionId}/content`,
26
- {},
27
- );
28
- }
29
- }
30
-
31
- module.exports = FileRevisionsApi;
1
+ 'use strict';
2
+
3
+ /**
4
+ * API methods for file revision content.
5
+ */
6
+ class FileRevisionsApi {
7
+ /**
8
+ * @param {import('../apiClient')} apiClient
9
+ */
10
+ constructor(apiClient) {
11
+ this._client = apiClient;
12
+ }
13
+
14
+ /**
15
+ * Retrieve content of a specific file revision.
16
+ * GET /2.0/projects/{projectId}/file_areas/{fileAreaId}/files/{fileId}/revisions/{fileRevisionId}/content
17
+ * @param {string} projectId
18
+ * @param {string} fileAreaId
19
+ * @param {string} fileId
20
+ * @param {string} fileRevisionId
21
+ * @returns {Promise<Buffer>} Raw binary content
22
+ */
23
+ getFileRevisionContent(projectId, fileAreaId, fileId, fileRevisionId) {
24
+ return this._client.get(
25
+ `/2.0/projects/${projectId}/file_areas/${fileAreaId}/files/${fileId}/revisions/${fileRevisionId}/content`,
26
+ {},
27
+ );
28
+ }
29
+ }
30
+
31
+ module.exports = FileRevisionsApi;