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
@@ -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;