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 +4 -4
- data/README.md +1 -0
- data/lib/typesense/api_call.rb +8 -4
- data/lib/typesense/documents.rb +5 -2
- data/lib/typesense/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4170ba5a72493eb15ae0659ded317a9d0b97ee402b0a21f12544f441e269c2df
|
4
|
+
data.tar.gz: a711dbf8e069670ff4d31a339f10bec22051c8dcaa355bbf8bee8853330eee08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 |
|
data/lib/typesense/api_call.rb
CHANGED
@@ -25,20 +25,22 @@ module Typesense
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def post(endpoint, parameters = {})
|
28
|
-
headers, body =
|
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 =
|
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
|
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)
|
data/lib/typesense/documents.rb
CHANGED
@@ -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'),
|
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
|
data/lib/typesense/version.rb
CHANGED
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.
|
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-
|
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:
|
314
|
+
version: 1.3.1
|
315
315
|
requirements: []
|
316
316
|
rubygems_version: 3.0.6
|
317
317
|
signing_key:
|