stytch 0.1.14 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8b8368ac805dc6fab37019952fb4212d253f02c178fd1252d2495acc9bef967
4
- data.tar.gz: 51eb55471aca49aff3f30415fecda9911f79f3c390ccc9e9f8129a82084ae94d
3
+ metadata.gz: 3c8b898c1c7e673cc54ef1ee97fdaeb3d436c24f26b251254656b1122687ff6e
4
+ data.tar.gz: 7dc74b9fd3d9de595f6d30b51c800ec0942ab048b3ce7696268335140d8c5b56
5
5
  SHA512:
6
- metadata.gz: d7b3b92df95967d07997421b29f2dd53cff3be399c1daa5db4f1207cfcd99ae59394b2b4b436baea556fa6e6e5545b32abd86399d0a46d65ee7ca50bcb7006f2
7
- data.tar.gz: 53bc8fc1a34c9afeec90296935e48ab79438761b2f09e34e75c6bd06dc9c46c92665988f123bd91bc1cba896a0f81c835b18c078ef44e2426416c10585f1fa6a
6
+ metadata.gz: ce3b4b0172588906bec95a68cc479e74ec77dafcc070e7d3019d1b262a23ff504505c62189ef0b10351b5156bee7ce72e7c6a638e6a4b5dffa96b2d44e61d022
7
+ data.tar.gz: db7fb71f2cdba11ab2eac8acbf6f41ecb7f5e50f5bae31d76a9a5305b41529070e5e008c3275b47f4765f065309c6a6a3e21e3a5092b584dd92c45ed8337da1b
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Stytch
2
2
 
3
- Welcome to the offical Stytch ruby gem! This gem provides easy access to Stytch's API.
3
+ Welcome to the official Stytch ruby gem! This gem provides easy access to Stytch's API.
4
4
 
5
5
  ## Installation
6
6
 
data/lib/stytch/client.rb CHANGED
@@ -69,5 +69,17 @@ module Stytch
69
69
  path
70
70
  ).body
71
71
  end
72
+
73
+ def request_with_query_params(path, params)
74
+ request = path
75
+ params.compact.each_with_index do |p, i|
76
+ if i == 0
77
+ request += "?#{p[0].to_s}=#{p[1]}"
78
+ else
79
+ request += "&#{p[0].to_s}=#{p[1]}"
80
+ end
81
+ end
82
+ request
83
+ end
72
84
  end
73
85
  end
@@ -45,13 +45,15 @@ module Stytch
45
45
  signup_magic_link_url:,
46
46
  login_expiration_minutes: nil,
47
47
  signup_expiration_minutes: nil,
48
- attributes: {}
48
+ attributes: {},
49
+ create_user_as_pending: false
49
50
  )
50
51
 
51
52
  request = {
52
53
  email: email,
53
54
  login_magic_link_url: login_magic_link_url,
54
55
  signup_magic_link_url: signup_magic_link_url,
56
+ create_user_as_pending: create_user_as_pending,
55
57
  }
56
58
 
57
59
  request[:login_expiration_minutes] = login_expiration_minutes if login_expiration_minutes != nil
@@ -61,33 +63,12 @@ module Stytch
61
63
  post("#{PATH}/login_or_create", request)
62
64
  end
63
65
 
64
- def login_or_invite_by_email(
65
- email:,
66
- login_magic_link_url:,
67
- invite_magic_link_url:,
68
- login_expiration_minutes: nil,
69
- invite_expiration_minutes: nil,
70
- attributes: {}
71
- )
72
-
73
- request = {
74
- email: email,
75
- login_magic_link_url: login_magic_link_url,
76
- invite_magic_link_url: invite_magic_link_url,
77
- }
78
-
79
- request[:login_expiration_minutes] = login_expiration_minutes if login_expiration_minutes != nil
80
- request[:invite_expiration_minutes] = invite_expiration_minutes if invite_expiration_minutes != nil
81
- request[:attributes] = attributes if attributes != {}
82
-
83
- post("#{PATH}/login_or_invite", request)
84
- end
85
-
86
66
  def invite_by_email(
87
67
  email:,
88
68
  magic_link_url:,
89
69
  expiration_minutes: nil,
90
- attributes: {}
70
+ attributes: {},
71
+ name: {}
91
72
  )
92
73
 
93
74
  request = {
@@ -97,6 +78,7 @@ module Stytch
97
78
 
98
79
  request[:expiration_minutes] = expiration_minutes if expiration_minutes != nil
99
80
  request[:attributes] = attributes if attributes != {}
81
+ request[:name] = name if name != {}
100
82
 
101
83
  post("#{PATH}/invite_by_email", request)
102
84
  end
@@ -7,8 +7,18 @@ module Stytch
7
7
  get("#{PATH}/#{user_id}")
8
8
  end
9
9
 
10
- def get_invited_users()
11
- get("#{PATH}/invites")
10
+ def get_pending_users(
11
+ limit: nil,
12
+ starting_after_id: nil
13
+ )
14
+ query_params = {
15
+ limit: limit,
16
+ starting_after_id: starting_after_id,
17
+ }
18
+
19
+ request = request_with_query_params("#{PATH}/pending", query_params)
20
+
21
+ get(request)
12
22
  end
13
23
 
14
24
  def create_user(
@@ -1,3 +1,3 @@
1
1
  module Stytch
2
- VERSION = "0.1.14"
2
+ VERSION = "0.1.19"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stytch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.14
4
+ version: 0.1.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - alex-stytch
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-20 00:00:00.000000000 Z
11
+ date: 2021-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -50,7 +50,7 @@ dependencies:
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
52
  version: '2.0'
53
- description:
53
+ description:
54
54
  email:
55
55
  - alex@stytch.com
56
56
  executables: []
@@ -80,7 +80,7 @@ licenses:
80
80
  metadata:
81
81
  homepage_uri: https://stytch.com
82
82
  source_code_uri: https://github.com/stytchauth/stytch-ruby
83
- post_install_message:
83
+ post_install_message:
84
84
  rdoc_options: []
85
85
  require_paths:
86
86
  - lib
@@ -95,8 +95,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  requirements: []
98
- rubygems_version: 3.1.4
99
- signing_key:
98
+ rubygems_version: 3.0.3
99
+ signing_key:
100
100
  specification_version: 4
101
101
  summary: Stytch Ruby Gem
102
102
  test_files: []