Commit Graph

477 Commits

Author SHA1 Message Date
Rish
1acf7d40be 🐛 Fixed incorrect payload creation for magic link token
no issue

- The extra payload added to magic link token included `name`, `labels` and `oldEmail`
- Refactor in commit [here](bf63ffe424 (diff-9f9ef757543bb9a90baba0d3bea76a83L157-R169)) changed the `body` variable assignment causing the payload objection creation to not include the extra data from request body
- Updates `body` to `req.body` to use correct data from request
2020-07-08 21:48:12 +05:30
Nazar Gargol
5b909735fd Published new versions
- @tryghost/magic-link@0.4.10
 - @tryghost/members-api@0.23.1
 - @tryghost/members-csv@0.2.1
 - @tryghost/members-ssr@0.8.2
2020-07-08 20:23:05 +12:00
Nazar Gargol
d28d336660 Added package usage examples to README 2020-07-08 20:09:44 +12:00
Nazar Gargol
86ff376c99 Reworked unparse test to use less dependencies 2020-07-08 20:09:21 +12:00
Nazar Gargol
4c21bb9d65 Added basic test coverage for JSON to CSV serialization
no issue
2020-07-08 19:40:48 +12:00
Nazar Gargol
7f25548be5 Removed unneeded test suite
no issue

- This is a leftover from initial project scaffolding
2020-07-08 19:40:10 +12:00
Nazar Gargol
3a97d39d72 Substituted csv-parser with papaparse as CSV parsing package
refs 5c46786ebc

- This is continuation of work removing csv-parser as main CSV handling library with more suitable papaparse library
- Referenced commit introduced papaparse as a library to serialize JSON to CSV, this changeset takes it a step further and replaces CSV to JSON seriazliation logic
2020-07-08 19:39:37 +12:00
Renovate Bot
587c95b0d0 Update dependency @types/node to v12.12.48 2020-07-06 22:13:49 +00:00
Nazar Gargol
6b24cb8a9d Published new versions
- @tryghost/members-csv@0.2.0
2020-07-02 14:58:12 +12:00
Nazar Gargol
fd982fef73 Added mapping support to CSV parser
no issue

- When processing CSV files `parse` function now allows for the client to specify "mapping" parameter in format of a hash as follows:
{ destination_property_name: 'source_column_name'}
e.g.:
{
  name: 'weird_name_column',
  email: 'email_column'
}
- It is done so to allow for the end user to provide exact mapping of the fields to be transformed into JSON.
2020-07-02 14:53:56 +12:00
Nazar Gargol
bf0e890751 Published new versions
- @tryghost/members-csv@0.1.2
2020-06-19 19:52:52 +12:00
Nazar Gargol
afa20f7472 Fixed module paths
refs 6d3b080b30
2020-06-19 19:52:21 +12:00
Nazar Gargol
6d3b080b30 Published new versions
- @tryghost/members-csv@0.1.1
2020-06-19 19:50:39 +12:00
Nazar Gargol
93ab8ae946 Moved modules into lib folder
no issue

- This fixes a problem where files are skiped form the @tryghost/members-csv package
- Also this follows the file structure convention with other packages
2020-06-19 19:49:39 +12:00
Nazar Gargol
53993358ae Published new versions
- @tryghost/members-csv@0.1.0
2020-06-19 19:35:55 +12:00
Nazar Gargol
5c47d725cb Fixed tests and added fixtures from Ghost repo 2020-06-19 19:33:43 +12:00
Nazar Gargol
320d1f7653 Exposed parsed/unparsed methods through package API 2020-06-19 19:33:43 +12:00
Nazar Gargol
0b54b187bd Added dependent CSV parsing packages 2020-06-19 19:33:43 +12:00
Nazar Gargol
5c46786ebc Colocated readCSV util with members input serializer
refs 8185b42d9e5fd9e9051f08ce3395a648ec02f3a4

- Allows to move files and keep the history in one go.
- 'csv-parser' will be upgraded to 'papaparse' lib in a new package
2020-06-19 19:33:43 +12:00
Nazar Gargol
08600f05c7 Extracted members csv input serialization logic into separate module
refs 772ec13ac49a1d80877bb7b0f90ad57899f868dd

- This is prep work for extraction into members repository.
2020-06-19 19:33:43 +12:00
Nazar Gargol
c5c20d5efb Extracted members csv serialization logic into separate module
no issue

- This is prep work for extraction into members repository.
2020-06-19 19:33:43 +12:00
Nazar Gargol
ca2ab5bbce Initialized members-csv package 2020-06-19 18:54:48 +12:00
Fabien O'Carroll
1b51ed7a5d Published new versions
- @tryghost/members-api@0.23.0
2020-06-18 18:03:46 +02:00
Fabien 'egg' O'Carroll
ae9870993a Added hasActiveStripeSubscriptions method (#169)
no-issue

This can be used by Ghost to determine if the Stripe keys can be deleted
2020-06-18 18:01:04 +02:00
Hannah Wolfe
aa0b02b75e Published new versions
- @tryghost/members-api@0.22.0
2020-06-12 17:11:14 +01:00
Hannah Wolfe
ebaf9538b6 Adding INR currency support
- We have many customers asking for INR as there are special rules in Stripe for this currency
- As well as a desire for local-selling
- Meaning it's not valid to use e.g. USD instead
2020-06-12 08:58:49 +01:00
Nazar Gargol
7872355962 Published new versions
- @tryghost/members-api@0.21.0
2020-06-12 15:36:07 +12:00
Nazar Gargol
d83525b54b Added stripe customer fetching method to member's API
no issue

- This method is needed to be able to validate if customer exist in configured Stripe account before attempting to link one with local member.
2020-06-12 15:35:16 +12:00
Rish
a136e5f839 Published new versions
- @tryghost/magic-link@0.4.9
 - @tryghost/members-api@0.20.1
 - @tryghost/members-ssr@0.8.1
2020-06-10 16:32:14 +05:30
Rish
11e2732d50 Handled error for stripe checkout rejection
refs https://github.com/TryGhost/members.js/issues/38

- In case of incomplete Stripe setup like Account name, checkout session creation fails and throws error, which was not being handled and 200 returned after long timeout
- This change catches the error and returns correct status along with message for clients to handle it downstream
2020-06-10 16:29:48 +05:30
Renovate Bot
ec81ccfbeb Update dependency @types/node to v12.12.47 2020-06-09 22:59:06 +00:00
Renovate Bot
7fbe60c104 Update dependency @types/node to v12.12.46 2020-06-09 18:18:20 +00:00
Renovate Bot
4761601219 Update dependency @types/node to v12.12.45 2020-06-08 20:22:23 +00:00
Renovate Bot
937584f290 Update dependency @types/node to v12.12.44 2020-06-04 23:18:43 +00:00
Kevin Ansfield
88146dc3a3 Published new versions
- @tryghost/magic-link@0.4.8
 - @tryghost/members-api@0.20.0
 - @tryghost/members-ssr@0.8.0
2020-06-04 13:27:14 +01:00
Kevin Ansfield
bf63ffe424 Moved members geolocation fetch/update into members-ssr (#151)
closes https://github.com/TryGhost/Members/issues/148

- geolocation was not being fetched/stored for paid member signup
  - magic link was being sent after Stripe webhook but we don't have an IP at that stage
  - it only worked when a magic link was requested by the browser
- moved the geolocation fetch/update to `members-ssr`
  - kept the ip geolookup and storage inside `members-api` but exposed it as a method so consumers are able to choose when it's performed
  - used the new api method in `members-ssr` when exchanging a token from the session as that is always driven by browser requests so we know we have an IP and it's likely the correct one (reliant on consumers having "trust proxy" config correct)
  - stopped storing IP addresses in the token payload (keeps links shorter)
2020-06-04 13:20:19 +01:00
Renovate Bot
141be65d5e Update dependency @types/node to v12.12.43 2020-06-02 00:38:29 +00:00
Rish
8891777681 Published new versions
- @tryghost/members-api@0.19.0
2020-05-28 20:37:29 +05:30
Rishabh Garg
e9b7dacb2e Updated magic link flow to allow changing member's email (#161)
refs https://github.com/TryGhost/members.js/issues/30

- Updates `sendMagicLink` middleware to allow adding old email address to payload. Checks for if new email address already exists in db before creating magic link, throws error in case of duplicate email.
- Updates magic link parsing for data to check if the intention is to update email address and update member's email to new email address in case its allowed.
- Return session data from magic link using the new email address
2020-05-28 19:37:03 +05:30
Daniel Lockyer
730ddc2ae6 Published new versions
- @tryghost/magic-link@0.4.7
 - @tryghost/members-api@0.18.7
 - @tryghost/members-ssr@0.7.10
2020-05-25 13:11:54 +01:00
Fabien O'Carroll
24e13651a8 Published new versions
- @tryghost/members-api@0.18.6
2020-05-25 13:38:11 +02:00
Renovate Bot
be5568682a Update dependency @types/node to v12.12.42 2020-05-21 22:17:43 +00:00
Fabien 'egg' O'Carroll
48260dedba Used plans trial by default for checkout sessions (#158)
no-issue

Without this flag the checkout session will ignore any default trial periods
attached to the plan. Now we are able to give basic support for trials, by
attaching a trial period in Stripe Dashboard
2020-05-21 10:14:36 +02:00
Rish
ce72aa40a0 Published new versions
- @tryghost/magic-link@0.4.6
 - @tryghost/members-api@0.18.5
 - @tryghost/members-ssr@0.7.9
2020-05-20 14:34:40 +05:30
Rish
d5d2cc5137 Added name from magic link token to member creation
refs https://github.com/TryGhost/members.js/issues/26

- Allows magic link tokens to pass member name on signup
- Uses member name from magic link token to assign member name during creation
2020-05-20 14:33:15 +05:30
Renovate Bot
01de256cc4 Update dependency @types/node to v12.12.41 2020-05-20 01:15:38 +00:00
Renovate Bot
92fd95c08a Update dependency @types/node to v12.12.40 2020-05-19 20:15:56 +00:00
Rish
23e343d3b4 Published new versions
- @tryghost/magic-link@0.4.5
 - @tryghost/members-api@0.18.4
 - @tryghost/members-ssr@0.7.8
2020-05-19 22:03:56 +05:30
Rish
a1f29d8ede Updated member update method
no issue

- Makes passing `name` and `note` field in member update data as optional instead of making them undefined
- Allows email to be updated
- Adds stripe subscriptions list to updated member's response data to make update consistent with get method
2020-05-19 20:35:36 +05:30
Rish
167811c5fd Updated stripe checkout to store member name from metadata
refs TryGhost/members.js#29

- Uses the metadata option in stripe checkout flow to add member's name on creation via anonymous checkout flow
- Allows clients like memebrs.js to pass member's info like name from checkout signup flow
2020-05-19 13:54:25 +05:30