@oneblink/sdk
Advanced tools
Comparing version 0.3.2-beta.1 to 0.3.2-beta.2
@@ -8,3 +8,3 @@ # Changelog | ||
- `isDraft` property to form submission events | ||
- [`Forms.getDraftData()`](./docs/forms.md#getdraftdata) | ||
- `isDraft` parameter to [`Forms.getSubmissionData()`](./docs/forms.md#getsubmissiondata) | ||
@@ -11,0 +11,0 @@ # 0.3.1 (2019-06-18) |
@@ -127,24 +127,6 @@ // @flow | ||
async getDraftData( | ||
formId /* : ?mixed */, | ||
draftDataId /* : ?mixed */ | ||
) /* : Promise<S3SubmissionData> */ { | ||
if (typeof formId !== 'number') { | ||
return Promise.reject(new TypeError('Must supply "formId" as a number')) | ||
} | ||
if (typeof draftDataId !== 'string') { | ||
return Promise.reject( | ||
new TypeError('Must supply "draftDataId" as a string') | ||
) | ||
} | ||
const credentials = await super.postRequest( | ||
`/forms/${formId}/download-draft-data-credentials/${draftDataId}` | ||
) | ||
return submissionData.getSubmissionData(credentials) | ||
} | ||
getSubmissionData( | ||
formId /* : ?mixed */, | ||
submissionId /* : ?mixed */ | ||
submissionId /* : ?mixed */, | ||
isDraft /* : ?boolean */ | ||
) /* : Promise<S3SubmissionData> */ { | ||
@@ -160,4 +142,9 @@ if (typeof formId !== 'number') { | ||
let url = `/forms/${formId}/retrieval-credentials/${submissionId}` | ||
if (isDraft) { | ||
url = `/forms/${formId}/download-draft-data-credentials/${submissionId}` | ||
} | ||
return super | ||
.postRequest(`/forms/${formId}/retrieval-credentials/${submissionId}`) | ||
.postRequest(url) | ||
.then(credentials => submissionData.getSubmissionData(credentials)) | ||
@@ -164,0 +151,0 @@ } |
{ | ||
"name": "@oneblink/sdk", | ||
"description": "OneBlink SDK to serve as an entry point for all OneBlink Services in NodeJS", | ||
"version": "0.3.2-beta.1", | ||
"version": "0.3.2-beta.2", | ||
"bugs": { | ||
@@ -6,0 +6,0 @@ "url": "https://github.com/blinkmobile/oneblink-sdk-js/issues" |
91125
2670