New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@oneblink/sdk

Package Overview
Dependencies
Maintainers
4
Versions
511
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oneblink/sdk - npm Package Compare versions

Comparing version 0.2.4 to 0.2.5

6

changelog.md

@@ -5,2 +5,8 @@ # Changelog

## 0.2.5 (2018-01-14)
### Changed
- Changed `generateFormUrl()` function to get hostname via `appId`
## 0.2.4 (2018-10-24)

@@ -7,0 +13,0 @@

35

classes/Forms.js

@@ -37,13 +37,12 @@ // @flow

) /* : Promise<{ expiry: string, formUrl: string }> */ {
const organisationsResults = await super.searchRequest(`/organisations`)
if (typeof formId !== 'number') {
throw new TypeError('Must supply "formId" as a number')
}
if (externalId && typeof externalId !== 'string') {
throw new TypeError('Must supply "externalId" as a string or not at all')
}
if (!organisationsResults.organisations || !organisationsResults.organisations.length) {
throw new Error('Access Denied. The "accessKey" and "secretKey" provided may have been revoked.')
}
const hostname = await this.getHostname(formId)
let preFillFormDataId

@@ -60,3 +59,3 @@ if (preFillData) {

const formUrl = generateFormUrl(`https://${organisationsResults.organisations[0].formsHostname}/forms`, formId, token, externalId, preFillFormDataId)
const formUrl = generateFormUrl(`https://${hostname}/forms`, formId, token, externalId, preFillFormDataId)

@@ -71,2 +70,28 @@ const expiry = new Date(Date.now() + (jwtExpiry * 1000)).toISOString()

async getHostname (
formId /* : number */
) {
try {
const formResults = await super.getRequest(`/forms/${formId}`)
if (!formResults || !formResults.formsAppIds.length) {
throw new Error('Access Denied. The "accessKey" and "secretKey" provided may have been revoked.')
}
const appResults = await super.getRequest(`/forms-apps/${formResults.formsAppIds[0]}`)
if (!appResults || !appResults.hostname) {
throw new Error('Access Denied. The "accessKey" and "secretKey" provided may have been revoked.')
}
return appResults.hostname
} catch (e) {
const organisationsResults = await super.searchRequest(`/organisations`)
if (!organisationsResults.organisations || !organisationsResults.organisations.length) {
throw new Error('Access Denied. The "accessKey" and "secretKey" provided may have been revoked.')
}
return organisationsResults.organisations[0].formsHostname
}
}
async generateSubmissionDataUrl (

@@ -73,0 +98,0 @@ formId /* : ?mixed */,

2

package.json
{
"name": "@oneblink/sdk",
"description": "OneBlink SDK to serve as an entry point for all OneBlink Services in NodeJS",
"version": "0.2.4",
"version": "0.2.5",
"bugs": {

@@ -6,0 +6,0 @@ "url": "https://github.com/blinkmobile/oneblink-sdk-js/issues"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc