dalux-build-api 1.0.0 → 1.0.1

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.
@@ -1,64 +1,64 @@
1
- 'use strict';
2
-
3
- /**
4
- * API methods for chunked file uploads.
5
- */
6
- class FileUploadApi {
7
- /**
8
- * @param {import('../apiClient')} apiClient
9
- */
10
- constructor(apiClient) {
11
- this._client = apiClient;
12
- }
13
-
14
- /**
15
- * Create a new upload slot and return a GUID pointing to that slot.
16
- * POST /1.0/projects/{projectId}/file_areas/{fileAreaId}/upload
17
- * @param {string} projectId
18
- * @param {string} fileAreaId
19
- * @param {object} body
20
- * @returns {Promise<object>}
21
- */
22
- createUpload(projectId, fileAreaId, body) {
23
- return this._client.post(
24
- `/1.0/projects/${projectId}/file_areas/${fileAreaId}/upload`,
25
- body,
26
- );
27
- }
28
-
29
- /**
30
- * Upload a part of a file.
31
- * POST /1.0/projects/{projectId}/file_areas/{fileAreaId}/upload/{uploadGuid}
32
- * @param {string} projectId
33
- * @param {string} fileAreaId
34
- * @param {string} uploadGuid
35
- * @param {Buffer|Uint8Array} chunk - Binary file chunk
36
- * @returns {Promise<object>}
37
- */
38
- uploadFilePart(projectId, fileAreaId, uploadGuid, chunk) {
39
- return this._client.post(
40
- `/1.0/projects/${projectId}/file_areas/${fileAreaId}/upload/${uploadGuid}`,
41
- chunk,
42
- {},
43
- { headers: { 'Content-Type': 'application/octet-stream' } },
44
- );
45
- }
46
-
47
- /**
48
- * Finish uploading a file (finalize the upload).
49
- * POST /2.0/projects/{projectId}/file_areas/{fileAreaId}/upload/{uploadGuid}/finalize
50
- * @param {string} projectId
51
- * @param {string} fileAreaId
52
- * @param {string} uploadGuid
53
- * @param {object} body
54
- * @returns {Promise<object>}
55
- */
56
- finishUpload(projectId, fileAreaId, uploadGuid, body) {
57
- return this._client.post(
58
- `/2.0/projects/${projectId}/file_areas/${fileAreaId}/upload/${uploadGuid}/finalize`,
59
- body,
60
- );
61
- }
62
- }
63
-
64
- module.exports = FileUploadApi;
1
+ 'use strict';
2
+
3
+ /**
4
+ * API methods for chunked file uploads.
5
+ */
6
+ class FileUploadApi {
7
+ /**
8
+ * @param {import('../apiClient')} apiClient
9
+ */
10
+ constructor(apiClient) {
11
+ this._client = apiClient;
12
+ }
13
+
14
+ /**
15
+ * Create a new upload slot and return a GUID pointing to that slot.
16
+ * POST /1.0/projects/{projectId}/file_areas/{fileAreaId}/upload
17
+ * @param {string} projectId
18
+ * @param {string} fileAreaId
19
+ * @param {object} body
20
+ * @returns {Promise<object>}
21
+ */
22
+ createUpload(projectId, fileAreaId, body) {
23
+ return this._client.post(
24
+ `/1.0/projects/${projectId}/file_areas/${fileAreaId}/upload`,
25
+ body,
26
+ );
27
+ }
28
+
29
+ /**
30
+ * Upload a part of a file.
31
+ * POST /1.0/projects/{projectId}/file_areas/{fileAreaId}/upload/{uploadGuid}
32
+ * @param {string} projectId
33
+ * @param {string} fileAreaId
34
+ * @param {string} uploadGuid
35
+ * @param {Buffer|Uint8Array} chunk - Binary file chunk
36
+ * @returns {Promise<object>}
37
+ */
38
+ uploadFilePart(projectId, fileAreaId, uploadGuid, chunk) {
39
+ return this._client.post(
40
+ `/1.0/projects/${projectId}/file_areas/${fileAreaId}/upload/${uploadGuid}`,
41
+ chunk,
42
+ {},
43
+ { headers: { 'Content-Type': 'application/octet-stream' } },
44
+ );
45
+ }
46
+
47
+ /**
48
+ * Finish uploading a file (finalize the upload).
49
+ * POST /2.0/projects/{projectId}/file_areas/{fileAreaId}/upload/{uploadGuid}/finalize
50
+ * @param {string} projectId
51
+ * @param {string} fileAreaId
52
+ * @param {string} uploadGuid
53
+ * @param {object} body
54
+ * @returns {Promise<object>}
55
+ */
56
+ finishUpload(projectId, fileAreaId, uploadGuid, body) {
57
+ return this._client.post(
58
+ `/2.0/projects/${projectId}/file_areas/${fileAreaId}/upload/${uploadGuid}/finalize`,
59
+ body,
60
+ );
61
+ }
62
+ }
63
+
64
+ module.exports = FileUploadApi;
@@ -1,72 +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;
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;
@@ -1,58 +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;
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;
@@ -1,48 +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;
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;
@@ -1,62 +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;
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;
@@ -1,25 +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;
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;