1
0
mirror of https://github.com/oceanprotocol/webtasks synced 2025-01-08 21:04:03 +01:00

package updates

* closes #29
This commit is contained in:
Matthias Kretschmann 2019-08-19 13:03:48 +02:00
parent 4a9355bed3
commit 2c5bd901a8
Signed by: m
GPG Key ID: 606EEEF3C479A91F
4 changed files with 18 additions and 18 deletions

View File

@ -15,7 +15,7 @@
"webtask-tools": "^3.4.0" "webtask-tools": "^3.4.0"
}, },
"devDependencies": { "devDependencies": {
"eslint": "^6.0.0", "eslint": "^6.2.0",
"eslint-config-oceanprotocol": "^1.3.0" "eslint-config-oceanprotocol": "^1.4.0"
} }
} }

View File

@ -33,20 +33,20 @@ server.post('/newsletter/:email', (req, res) => {
const baseOptions = { const baseOptions = {
url: `${baseUrl}/lists/${listId}/members/${subscriberHash}`, url: `${baseUrl}/lists/${listId}/members/${subscriberHash}`,
'auth': { auth: {
'user': 'oceanprotocol', user: 'oceanprotocol',
'pass': MAILCHIMP_API_KEY pass: MAILCHIMP_API_KEY
} }
} }
const optionsCreate = { const optionsCreate = {
...baseOptions, ...baseOptions,
json: { json: {
'email_address': emailDecoded, email_address: emailDecoded,
'status': 'pending', // double opt-in status: 'pending', // double opt-in
'merge_fields': { merge_fields: {
// our GDPR fallback // our GDPR fallback
'GDPR': 'yes' GDPR: 'yes'
} }
} }
} }
@ -55,10 +55,10 @@ server.post('/newsletter/:email', (req, res) => {
{ {
...baseOptions, ...baseOptions,
json: { json: {
'marketing_permissions': [{ marketing_permissions: [{
'marketing_permission_id': marketingPermissionId, marketing_permission_id: marketingPermissionId,
'text': 'Email', text: 'Email',
'enabled': true enabled: true
}] }]
} }
} }

View File

@ -30,7 +30,7 @@ app.get('/', (req, res) => {
app.get('/channel/:channelId', (req, res) => { app.get('/channel/:channelId', (req, res) => {
const options = { const options = {
url: `https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=${req.params.channelId}&maxResults=10&order=date&type=video&key=${req.webtaskContext.secrets.YOUTUBE_API_KEY}`, url: `https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=${req.params.channelId}&maxResults=10&order=date&type=video&key=${req.webtaskContext.secrets.YOUTUBE_API_KEY}`,
headers: { 'referer': req.headers.host } headers: { referer: req.headers.host }
} }
const parsedPosts = [] const parsedPosts = []
@ -54,7 +54,7 @@ app.get('/channel/:channelId', (req, res) => {
app.get('/channel/:channelId/raw', (req, res) => { app.get('/channel/:channelId/raw', (req, res) => {
const options = { const options = {
url: `https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=${req.params.channelId}&maxResults=10&order=date&type=video&key=${req.webtaskContext.secrets.YOUTUBE_API_KEY}`, url: `https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=${req.params.channelId}&maxResults=10&order=date&type=video&key=${req.webtaskContext.secrets.YOUTUBE_API_KEY}`,
headers: { 'referer': req.headers.host } headers: { referer: req.headers.host }
} }
makeRequest(options, (videos) => { makeRequest(options, (videos) => {
@ -65,7 +65,7 @@ app.get('/channel/:channelId/raw', (req, res) => {
app.get('/playlist/:playlistId', (req, res) => { app.get('/playlist/:playlistId', (req, res) => {
const options = { const options = {
url: `https://www.googleapis.com/youtube/v3/playlistItems?part=snippet%2CcontentDetails&maxResults=10&playlistId=${req.params.playlistId}&key=${req.webtaskContext.secrets.YOUTUBE_API_KEY}`, url: `https://www.googleapis.com/youtube/v3/playlistItems?part=snippet%2CcontentDetails&maxResults=10&playlistId=${req.params.playlistId}&key=${req.webtaskContext.secrets.YOUTUBE_API_KEY}`,
headers: { 'referer': req.headers.host } headers: { referer: req.headers.host }
} }
const parsedPosts = [] const parsedPosts = []
@ -89,7 +89,7 @@ app.get('/playlist/:playlistId', (req, res) => {
app.get('/playlist/:playlistId/raw', (req, res) => { app.get('/playlist/:playlistId/raw', (req, res) => {
const options = { const options = {
url: `https://www.googleapis.com/youtube/v3/playlistItems?part=snippet%2CcontentDetails&maxResults=10&playlistId=${req.params.playlistId}&key=${req.webtaskContext.secrets.YOUTUBE_API_KEY}`, url: `https://www.googleapis.com/youtube/v3/playlistItems?part=snippet%2CcontentDetails&maxResults=10&playlistId=${req.params.playlistId}&key=${req.webtaskContext.secrets.YOUTUBE_API_KEY}`,
headers: { 'referer': req.headers.host } headers: { referer: req.headers.host }
} }
makeRequest(options, (videos) => { makeRequest(options, (videos) => {

View File

@ -78,7 +78,7 @@ server.get('/crm/:data', (req, res) => {
const options = { const options = {
url: `${apiUrlZohoCRM}Leads`, url: `${apiUrlZohoCRM}Leads`,
headers: { 'Authorization': `Zoho-oauthtoken ${ZOHO_CRM_TOKEN}` }, headers: { Authorization: `Zoho-oauthtoken ${ZOHO_CRM_TOKEN}` },
method: 'POST', method: 'POST',
formData: data formData: data
} }