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.
- package/LICENSE +21 -21
- package/README.md +404 -365
- package/package.json +47 -46
- package/src/api/CompaniesApi.js +67 -60
- package/src/api/CompanyCatalogApi.js +129 -108
- package/src/api/FileAreasApi.js +57 -37
- package/src/api/FileRevisionsApi.js +31 -31
- package/src/api/FileUploadApi.js +64 -64
- package/src/api/FilesApi.js +701 -297
- package/src/api/FoldersApi.js +283 -58
- package/src/api/FormsApi.js +53 -48
- package/src/api/InspectionPlansApi.js +66 -62
- package/src/api/ProjectTemplatesApi.js +25 -25
- package/src/api/ProjectsApi.js +127 -106
- package/src/api/TasksApi.js +193 -161
- package/src/api/TestPlansApi.js +63 -59
- package/src/api/UsersApi.js +52 -47
- package/src/api/VersionSetsApi.js +75 -67
- package/src/api/WorkPackagesApi.js +30 -26
- package/src/apiClient.js +139 -75
- package/src/configuration.js +39 -24
- package/src/index.js +133 -92
- package/src/models/common.js +22 -0
- package/src/models/companies/index.js +14 -0
- package/src/models/companyCatalog/index.js +19 -0
- package/src/models/convert.js +44 -0
- package/src/models/fileAreas/index.js +20 -0
- package/src/models/fileRevisions/index.js +12 -0
- package/src/models/fileUpload/index.js +12 -0
- package/src/models/files/index.js +97 -0
- package/src/models/folders/index.js +20 -0
- package/src/models/forms/index.js +19 -0
- package/src/models/helpers.js +62 -0
- package/src/models/index.js +148 -0
- package/src/models/inspectionPlans/index.js +18 -0
- package/src/models/projectTemplates/index.js +11 -0
- package/src/models/projects/index.js +57 -0
- package/src/models/tasks/index.js +105 -0
- package/src/models/testPlans/index.js +17 -0
- package/src/models/users/index.js +29 -0
- package/src/models/versionSets/index.js +22 -0
- package/src/models/workPackages/index.js +19 -0
- package/src/utils/errors.js +45 -0
- package/src/utils/index.js +26 -0
- package/src/utils/pagination.js +82 -0
- package/src/utils/pathResolver.js +124 -0
- package/src/utils/search.js +61 -0
- package/src/utils/validation.js +36 -0
package/src/api/FileUploadApi.js
CHANGED
|
@@ -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;
|