From 500aac44d3199edf0cf91950095684f064b29c89 Mon Sep 17 00:00:00 2001 From: sgruse Date: Thu, 2 May 2019 11:11:30 -0700 Subject: [PATCH] Updating emails to use new image model --- dist/transform/transform.js | 6 +++--- package-lock.json | 35 ++++++++++++++++++++++++++++------- package.json | 2 +- src/transform/transform.ts | 6 +++--- 4 files changed, 35 insertions(+), 14 deletions(-) diff --git a/dist/transform/transform.js b/dist/transform/transform.js index 9a67527..666befa 100644 --- a/dist/transform/transform.js +++ b/dist/transform/transform.js @@ -17,7 +17,7 @@ exports.BuildEventContent = (event, club, link) => { const richContent = { name: event.name, subtitle: "New Club Event!", - photoURL: event.photoURL, + photoURL: event.image.md, content: event.richContent.html, url: link, cta: 'View Event', @@ -33,7 +33,7 @@ exports.BuildEventContent = (event, club, link) => { exports.BuildPostContent = (post, club, link) => { const postInfo = { name: post.title, - photoURL: post.imageURL, + photoURL: post.image.md, content: post.richContent.html, url: link, cta: 'View Post', @@ -95,7 +95,7 @@ exports.BuildClubInfo = (club) => { const clubInfo = { name: club.name, domain: club.domain, - logoURL: club.photoURL, + logoURL: club.image.md, street: club.locations[0].address1, city: club.locations[0].city, state: club.locations[0].state, diff --git a/package-lock.json b/package-lock.json index a794a31..a297cfe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2091,10 +2091,11 @@ } }, "club-hub-core": { - "version": "git+https://git@github.com/meshhq/club-hub-core.git#1a40993087b9982558657141cc32613b5464b614", - "from": "git+https://git@github.com/meshhq/club-hub-core.git#0.0.54", + "version": "git+https://git@github.com/meshhq/club-hub-core.git#a555f8b8c04221842dda9b6ba65612482356244d", + "from": "git+https://git@github.com/meshhq/club-hub-core.git#0.0.77", "requires": { - "axios": "^0.18.0" + "axios": "^0.18.0", + "isomorphic-fetch": "^2.2.1" }, "dependencies": { "axios": { @@ -3677,7 +3678,6 @@ "version": "0.1.12", "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", - "dev": true, "requires": { "iconv-lite": "~0.4.13" } @@ -7314,7 +7314,6 @@ "version": "0.4.23", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", - "dev": true, "requires": { "safer-buffer": ">= 2.1.2 < 3" } @@ -8743,8 +8742,7 @@ "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" }, "is-svg": { "version": "1.1.1", @@ -8836,6 +8834,15 @@ "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true }, + "isomorphic-fetch": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", + "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", + "requires": { + "node-fetch": "^1.0.1", + "whatwg-fetch": ">=0.10.0" + } + }, "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", @@ -10338,6 +10345,15 @@ "lower-case": "^1.1.1" } }, + "node-fetch": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", + "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", + "requires": { + "encoding": "^0.1.11", + "is-stream": "^1.0.1" + } + }, "node-gyp": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz", @@ -14989,6 +15005,11 @@ } } }, + "whatwg-fetch": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz", + "integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==" + }, "whatwg-mimetype": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", diff --git a/package.json b/package.json index 8f01d44..b40d041 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "index.js" ], "dependencies": { - "club-hub-core": "https://git@github.com/meshhq/club-hub-core.git#0.0.54", + "club-hub-core": "https://git@github.com/meshhq/club-hub-core.git#0.0.77", "feather-icons": "^4.17.0", "handlebars": "^4.1.0", "jsdom": "^14.0.0", diff --git a/src/transform/transform.ts b/src/transform/transform.ts index 1002d4b..ff89408 100644 --- a/src/transform/transform.ts +++ b/src/transform/transform.ts @@ -32,7 +32,7 @@ export const BuildEventContent = (event: core.Event.Model, club: core.Club.Model const richContent: EventInfo = { name: event.name, subtitle: "New Club Event!", - photoURL: event.photoURL, + photoURL: event.image.md, content: event.richContent.html, url: link, cta: 'View Event', @@ -54,7 +54,7 @@ export const BuildEventContent = (event: core.Event.Model, club: core.Club.Model export const BuildPostContent = (post: core.Post.Model, club: core.Club.Model, link: string): RichContent => { const postInfo: RichContent = { name: post.title, - photoURL: post.imageURL, + photoURL: post.image.md, content: post.richContent.html, url: link, cta: 'View Post', @@ -133,7 +133,7 @@ export const BuildClubInfo = (club: core.Club.Model): ClubInfo => { const clubInfo: ClubInfo = { name: club.name, domain: club.domain, - logoURL: club.photoURL, + logoURL: club.image.md, street: club.locations[0].address1, city: club.locations[0].city, state: club.locations[0].state,