stytch 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stytch/users.rb +24 -0
- data/lib/stytch/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2534e355696eda17e5f4b8dac2b21335fdd54183c29c9ac694ac8886caceccbd
|
4
|
+
data.tar.gz: fcf8fea062ec5e2964fb3a32a2154a869b2e8256f6b7331e7aa29f7e52b2d0a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: deb23398868a541f5a0cf46d2314c27e9d50675948d190edc4696457e7dfd79f412a60bcd36140d2cbd2f17267919b1cd46ff60c648abb8a58c12021f27027b4
|
7
|
+
data.tar.gz: 5f763a8e124baf69867d99b8f80e76cbbe78bfb6d27199be31a097680187d90e24cb69bf66b97580e523b7287f3d41f97a007f5007d729d28d146721c66e314b
|
data/lib/stytch/users.rb
CHANGED
@@ -12,6 +12,30 @@ module Stytch
|
|
12
12
|
@connection = connection
|
13
13
|
end
|
14
14
|
|
15
|
+
def search(query, limit: 100, cursor: nil)
|
16
|
+
request = {
|
17
|
+
query: query,
|
18
|
+
limit: limit
|
19
|
+
}
|
20
|
+
request[:cursor] = cursor if cursor
|
21
|
+
post_request("#{PATH}/search", request)
|
22
|
+
end
|
23
|
+
|
24
|
+
def search_all(query, limit: 100)
|
25
|
+
Enumerator.new do |enum|
|
26
|
+
cursor = nil
|
27
|
+
loop do
|
28
|
+
resp = search(query, limit: limit, cursor: cursor)
|
29
|
+
resp['results'].each do |user|
|
30
|
+
enum << user
|
31
|
+
end
|
32
|
+
|
33
|
+
cursor = resp['results_metadata']['next_cursor']
|
34
|
+
break if cursor.nil?
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
15
39
|
def get(user_id:)
|
16
40
|
get_request("#{PATH}/#{user_id}")
|
17
41
|
end
|
data/lib/stytch/version.rb
CHANGED
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: 3.
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- stytch
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|