typesense 0.7.0 → 0.8.0pre

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: f663250e6124fb4e46d1cba2ff8b33747b3b34ca5f643e4746193a495a9ec3ef
4
- data.tar.gz: 74a083d9ba5302be52473bff5cfb5588456d8744c886647050abfd84c7451997
3
+ metadata.gz: 4170ba5a72493eb15ae0659ded317a9d0b97ee402b0a21f12544f441e269c2df
4
+ data.tar.gz: a711dbf8e069670ff4d31a339f10bec22051c8dcaa355bbf8bee8853330eee08
5
5
  SHA512:
6
- metadata.gz: 229c87aab72ca56db2e4e4c1677a6e606f007617f7d967584e75c7c5a4e48c63d65f198b9d7659a0570708b7babb1eb480bce41673f736aad6ec3fc3674fe752
7
- data.tar.gz: 61aaf27f9a5f8fdbc7eb35ac2d50e8c29025297c56a6ed8421cb45f02e9eab6566ee3d1bd61caa47f7bda59543677d2c8bcf36b63eb2733c5fe477fdad9b043e
6
+ metadata.gz: 2fed977aae1688b4f1ffa46e86d3007c39dd5dec0d4c485b0887c4076c440d6b35e00c03acc099fca057665372c501a3ecdf686aab93321779ca5bc650f49e12
7
+ data.tar.gz: '03198e7930adfcbd8f5e049cd0b7cf5edbf9aa8567d8b3f6d978af66cb74de02bec0dd32715266d712f6571f631e68756cf84f7838a97b6ec17907b3515b191a'
data/README.md CHANGED
@@ -33,6 +33,7 @@ Tests are also a good place to know how the the library works internally: [spec]
33
33
 
34
34
  | Typesense Server | typesense-ruby |
35
35
  |------------------|----------------|
36
+ | \>= v0.15.1 | \>= v0.8.0 |
36
37
  | \>= v0.15.0 | \>= v0.7.0 |
37
38
  | \>= v0.12.1 | \>= v0.5.0 |
38
39
  | \>= v0.12.0 | \>= v0.4.0 |
@@ -25,20 +25,22 @@ module Typesense
25
25
  end
26
26
 
27
27
  def post(endpoint, parameters = {})
28
- headers, body = extract_headers_and_body_from(parameters)
28
+ headers, query, body = split_post_put_parameters(parameters)
29
29
 
30
30
  perform_request :post,
31
31
  endpoint,
32
32
  headers,
33
+ params: query,
33
34
  body: body
34
35
  end
35
36
 
36
37
  def put(endpoint, parameters = {})
37
- headers, body = extract_headers_and_body_from(parameters)
38
+ headers, query, body = split_post_put_parameters(parameters)
38
39
 
39
40
  perform_request :put,
40
41
  endpoint,
41
42
  headers,
43
+ params: query,
42
44
  body: body
43
45
  end
44
46
 
@@ -110,15 +112,17 @@ module Typesense
110
112
 
111
113
  private
112
114
 
113
- def extract_headers_and_body_from(parameters)
115
+ def split_post_put_parameters(parameters)
114
116
  if json_request?(parameters)
115
117
  headers = { 'Content-Type' => 'application/json' }
118
+ query = parameters[:query]
116
119
  body = Oj.dump(sanitize_parameters(parameters))
117
120
  else
118
121
  headers = {}
122
+ query = parameters[:query]
119
123
  body = parameters[:body]
120
124
  end
121
- [headers, body]
125
+ [headers, query, body]
122
126
  end
123
127
 
124
128
  def extract_headers_and_query_from(parameters)
@@ -22,8 +22,11 @@ module Typesense
22
22
  results_in_jsonl_format.split("\n").map { |r| Oj.load(r) }
23
23
  end
24
24
 
25
- def import(documents_in_jsonl_format)
26
- @api_call.post(endpoint_path('import'), as_json: false, body: documents_in_jsonl_format)
25
+ def import(documents_in_jsonl_format, query_parameters = {})
26
+ @api_call.post(endpoint_path('import'),
27
+ as_json: false,
28
+ query: query_parameters,
29
+ body: documents_in_jsonl_format)
27
30
  end
28
31
 
29
32
  def export
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Typesense
4
- VERSION = '0.7.0'
4
+ VERSION = '0.8.0pre'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: typesense
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Typesense, Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-19 00:00:00.000000000 Z
11
+ date: 2020-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print
@@ -309,9 +309,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
309
309
  version: '2.4'
310
310
  required_rubygems_version: !ruby/object:Gem::Requirement
311
311
  requirements:
312
- - - ">="
312
+ - - ">"
313
313
  - !ruby/object:Gem::Version
314
- version: '0'
314
+ version: 1.3.1
315
315
  requirements: []
316
316
  rubygems_version: 3.0.6
317
317
  signing_key: