Skip to content

Commit 2283174

Browse files
authoredFeb 26, 2025··
Merge pull request #375 from topcoder-platform/pm-810
feat(PM-810): added get/download submission artifacts api
2 parents 02635ff + d4fe1aa commit 2283174

File tree

3 files changed

+26470
-37
lines changed

3 files changed

+26470
-37
lines changed
 

‎package-lock.json

Lines changed: 26446 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"lint:js": "./node_modules/.bin/eslint --ext .js,.jsx .",
3232
"test": "npm run lint && npm run jest"
3333
},
34-
"version": "1.2.16",
34+
"version": "1.2.17",
3535
"dependencies": {
3636
"auth0-js": "^6.8.4",
3737
"config": "^3.2.0",

‎src/services/submissions.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,29 @@ class SubmissionsService {
6464
.then(res => res.result);
6565
}
6666

67+
/**
68+
* Get submission artifacts of challenge
69+
* @param {String} submissionId
70+
* @return {Promise} Resolves to the api response.
71+
*/
72+
async getSubmissionArtifacts(submissionId) {
73+
const url = `/submissions/${submissionId}/artifacts`;
74+
return this.private.apiV5.get(url)
75+
.then(checkErrorV5)
76+
.then(res => res.result);
77+
}
78+
79+
/**
80+
* Download submission artifact.
81+
* @param {Number|String} submissionId Submission ID.
82+
* * @param {String} fileName Artifact file name.
83+
* @return {Promise} Resolves to the list of submission object.
84+
*/
85+
async downloadSubmissionArtifact(submissionId, fileName) {
86+
return this.private.apiV5.get(`/submissions/${submissionId}/artifacts/${fileName}/download`)
87+
.then(response => response.blob());
88+
}
89+
6790
/**
6891
* Get scan reviews types
6992
* @returns {Promise} Resolves to the api response.

0 commit comments

Comments
 (0)
Please sign in to comment.