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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a361942c6f469a3bd03cb666b2740717d4f163ae5668536d292e4c72670b2a3
4
- data.tar.gz: 865893e5e873829cee7fc43cb9aa9a006fa87487ccf04cc2c41009e657f407e0
3
+ metadata.gz: 2534e355696eda17e5f4b8dac2b21335fdd54183c29c9ac694ac8886caceccbd
4
+ data.tar.gz: fcf8fea062ec5e2964fb3a32a2154a869b2e8256f6b7331e7aa29f7e52b2d0a8
5
5
  SHA512:
6
- metadata.gz: 7ab5a3c953f0c7eea8297685e97e408271f00389b563de2ac8583fec5b5c2a95971b00920a42c87232f584afad6fcfdfab6ef09b541a5d35d5df809771d9e925
7
- data.tar.gz: 274ee8bf41f5cdc48d5d35c5f97e368d4766cb5670c3294afc8f8f5364e9835540d07eb7f02d804414602f8cbca777c6dae42110a4db657fd655289bb649a766
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stytch
4
- VERSION = '3.0.0'
4
+ VERSION = '3.1.0'
5
5
  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: 3.0.0
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-22 00:00:00.000000000 Z
11
+ date: 2022-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday