@oneblink/sdk
Advanced tools
Comparing version 0.2.8-beta.5 to 0.2.8-beta.6
@@ -9,2 +9,3 @@ # Changelog | ||
- ON-4098 # Strip out unwanted properties from form elements | ||
- [`FormsApps`](./docs/forms-apps.md) class | ||
@@ -11,0 +12,0 @@ ## 0.2.7 (2019-05-06) |
@@ -190,2 +190,38 @@ // @flow | ||
} | ||
declare type FormsAppStyles = { | ||
foregroundColour?: string, | ||
highlightColour?: string, | ||
contrastColour?: string, | ||
logoUrl?: string, | ||
customCss?: string | ||
} | ||
declare type FormsApp = { | ||
id: number, | ||
name: string, | ||
hostname: string, | ||
oAuthClientId: ?string, | ||
createdAt: string, | ||
updatedAt: string, | ||
organisationId: string, | ||
formIds: number[], | ||
styles: FormsAppStyles, | ||
pwaSettings: { | ||
homeScreenIconUrl?: string, | ||
homeScreenName?: string, | ||
splashScreenName?: string | ||
}, | ||
welcomeEmail?: { | ||
body?: string, | ||
subject?: string | ||
} | ||
} | ||
declare type FormsAppUser = { | ||
id: number, | ||
email: string, | ||
formsAppId: number, | ||
createdAt: string | ||
} | ||
*/ |
@@ -5,2 +5,3 @@ // @flow | ||
const Forms = require('./classes/Forms.js') | ||
const FormsApps = require('./classes/FormsApps.js') | ||
const Jobs = require('./classes/Jobs.js') | ||
@@ -12,2 +13,3 @@ const Keys = require('./classes/Keys.js') | ||
Forms, | ||
FormsApps, | ||
Jobs, | ||
@@ -14,0 +16,0 @@ Keys, |
@@ -68,2 +68,10 @@ // @flow | ||
get defaultRequestConfig () { | ||
return { | ||
headers: { | ||
'Authorization': `Bearer ${generateJWT(this.accessKey, this.secretKey, this.jwtExpiry)}` | ||
} | ||
} | ||
} | ||
getRequest ( | ||
@@ -73,7 +81,3 @@ path /* : string */ | ||
// 5 minute expiry | ||
return this.oneBlinkAPI.get(path, { | ||
headers: { | ||
'Authorization': `Bearer ${generateJWT(this.accessKey, this.secretKey, this.jwtExpiry)}` | ||
} | ||
}) | ||
return this.oneBlinkAPI.get(path, this.defaultRequestConfig) | ||
.then((response) => response.data) | ||
@@ -91,2 +95,12 @@ .catch(errorHandler) | ||
putRequest ( | ||
path /* : string */, | ||
body /* : ?mixed */ | ||
) /* Promise<Object> */ { | ||
// 5 minute expiry | ||
return this.oneBlinkAPI.put(path, body, this.defaultRequestConfig) | ||
.then((response) => response.data) | ||
.catch(errorHandler) | ||
} | ||
postRequest ( | ||
@@ -97,7 +111,3 @@ path /* : string */, | ||
// 5 minute expiry | ||
return this.oneBlinkAPI.post(path, body, { | ||
headers: { | ||
'Authorization': `Bearer ${generateJWT(this.accessKey, this.secretKey, this.jwtExpiry)}` | ||
} | ||
}) | ||
return this.oneBlinkAPI.post(path, body, this.defaultRequestConfig) | ||
.then((response) => response.data) | ||
@@ -112,7 +122,3 @@ .catch(errorHandler) | ||
try { | ||
await this.oneBlinkAPI.delete(path, { | ||
headers: { | ||
'Authorization': `Bearer ${generateJWT(this.accessKey, this.secretKey, this.jwtExpiry)}` | ||
} | ||
}) | ||
await this.oneBlinkAPI.delete(path, this.defaultRequestConfig) | ||
} catch (error) { | ||
@@ -119,0 +125,0 @@ errorHandler(error) |
{ | ||
"name": "@oneblink/sdk", | ||
"description": "OneBlink SDK to serve as an entry point for all OneBlink Services in NodeJS", | ||
"version": "0.2.8-beta.5", | ||
"version": "0.2.8-beta.6", | ||
"bugs": { | ||
@@ -6,0 +6,0 @@ "url": "https://github.com/blinkmobile/oneblink-sdk-js/issues" |
88592
21
2614