k_sequencing 0.0.5 → 0.1
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 +4 -4
- data/README.md +14 -1
- data/docs/documentation.md +59 -7
- data/k_sequencing.gemspec +1 -1
- data/lib/k_sequencing/client.rb +19 -3
- data/lib/k_sequencing/connection.rb +12 -0
- data/lib/k_sequencing/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac8d1a9191c7b01681bd8321fecbd7a0e47b7e29
|
4
|
+
data.tar.gz: b8a434c282ed4b1b988f25c126b0fbed3e781712
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb745ec30b822eb9964fc59338de20f256a83d5ebc9f7769a6457975c790e637bb328ec16fe4b1ed9222daec34c37aef05a42f2ae70bc9dd394fa11d82b568ac
|
7
|
+
data.tar.gz: 2aa1a039ba1f82efebb629e5e154076c495a082cdd91b36f3da2da06aad9a9795f995f54487ccd4e45dace122fe5d1c6d83dcf985610b10c359406ad44fce35d
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@ Image and content moderation services.
|
|
4
4
|
|
5
5
|
## Getting Started
|
6
6
|
|
7
|
-
KSequencing 0.
|
7
|
+
KSequencing 0.1 works with Rails 4.1 onwards. You can add it to your Gemfile with:
|
8
8
|
```ruby
|
9
9
|
gem 'k_sequencing'
|
10
10
|
```
|
@@ -14,6 +14,19 @@ You have to contact us [Datawow](https://datawow.io/pages/contact) to get your t
|
|
14
14
|
|
15
15
|
## Usage
|
16
16
|
### Operations about Images
|
17
|
+
Get image
|
18
|
+
```ruby
|
19
|
+
KSequencing.client.get_image_closed_questions()
|
20
|
+
```
|
21
|
+
|
22
|
+
| Field | Type | Required | Description |
|
23
|
+
| ------------- |:-------------:| :----:| :-----|
|
24
|
+
| token | string | Yes |Project Authorization Token|
|
25
|
+
| id | integer | No | Image id|
|
26
|
+
|custom_id | integer | No | Client's image id |
|
27
|
+
|
28
|
+
Note: You must choose id or custom_id for search. Not both.
|
29
|
+
|
17
30
|
Create images
|
18
31
|
```ruby
|
19
32
|
KSequencing.client.create_image_closed_questions()
|
data/docs/documentation.md
CHANGED
@@ -7,6 +7,19 @@
|
|
7
7
|
* [Messages](#messages) - User can set messages for answer.
|
8
8
|
---
|
9
9
|
#### Closed questions
|
10
|
+
Get image
|
11
|
+
```ruby
|
12
|
+
KSequencing.client.get_image_closed_questions()
|
13
|
+
```
|
14
|
+
|
15
|
+
| Field | Type | Required | Description |
|
16
|
+
| ------------- |:-------------:| :----:| :-----|
|
17
|
+
| token | string | Yes |Project Authorization Token|
|
18
|
+
| id | integer | No | Image id|
|
19
|
+
|custom_id | integer | No | Client's image id |
|
20
|
+
|
21
|
+
Note: You must choose id or custom_id for search. Not both.
|
22
|
+
|
10
23
|
Create images
|
11
24
|
```ruby
|
12
25
|
KSequencing.client.create_image_closed_questions()
|
@@ -57,9 +70,22 @@ Sample results
|
|
57
70
|
```
|
58
71
|
---
|
59
72
|
#### Choices
|
73
|
+
Get image
|
74
|
+
```ruby
|
75
|
+
KSequencing.client.get_image_choices()
|
76
|
+
```
|
77
|
+
|
78
|
+
| Field | Type | Required | Description |
|
79
|
+
| ------------- |:-------------:| :----:| :-----|
|
80
|
+
| token | string | Yes |Project Authorization Token|
|
81
|
+
| id | integer | No | Image id|
|
82
|
+
|custom_id | integer | No | Client's image id |
|
83
|
+
|
84
|
+
Note: You must choose id or custom_id for search. Not both.
|
85
|
+
|
60
86
|
Create new choices
|
61
87
|
```ruby
|
62
|
-
KSequencing.client.
|
88
|
+
KSequencing.client.create_image_choices()
|
63
89
|
```
|
64
90
|
| Field | Type | Required | Description |
|
65
91
|
| ------------- |:-------------:| :-----:| :-----|
|
@@ -78,7 +104,7 @@ Sample request
|
|
78
104
|
|
79
105
|
For one answer
|
80
106
|
```ruby
|
81
|
-
KSequencing.client.
|
107
|
+
KSequencing.client.create_image_choices(
|
82
108
|
token: "9UPmGGWEwBsJrVnw6844tfpd",
|
83
109
|
instruction: "question",
|
84
110
|
categories: ["options1", "options2", "options3"],
|
@@ -87,7 +113,7 @@ KSequencing.client.create_choices(
|
|
87
113
|
```
|
88
114
|
For multiple answer
|
89
115
|
```ruby
|
90
|
-
KSequencing.client.
|
116
|
+
KSequencing.client.create_image_choices(
|
91
117
|
token: "9UPmGGWEwBsJrVnw6844tfpd",
|
92
118
|
instruction: "question",
|
93
119
|
categories: ["options1", "options2", "options3"],
|
@@ -134,9 +160,22 @@ Sample results
|
|
134
160
|
```
|
135
161
|
---
|
136
162
|
#### Messages
|
163
|
+
Get image
|
164
|
+
```ruby
|
165
|
+
KSequencing.client.get_image_messages()
|
166
|
+
```
|
167
|
+
|
168
|
+
| Field | Type | Required | Description |
|
169
|
+
| ------------- |:-------------:| :----:| :-----|
|
170
|
+
| token | string | Yes |Project Authorization Token|
|
171
|
+
| id | integer | No | Image id|
|
172
|
+
|custom_id | integer | No | Client's image id |
|
173
|
+
|
174
|
+
Note: You must choose id or custom_id for search. Not both.
|
175
|
+
|
137
176
|
Create new message
|
138
177
|
```ruby
|
139
|
-
KSequencing.client.
|
178
|
+
KSequencing.client.create_image_messages()
|
140
179
|
```
|
141
180
|
| Field | Type | Required | Description |
|
142
181
|
| ------------- |:-------------:| :-----:| :-----|
|
@@ -149,7 +188,7 @@ KSequencing.client.create_messages()
|
|
149
188
|
|
150
189
|
Sample request
|
151
190
|
```ruby
|
152
|
-
KSequencing.client.
|
191
|
+
KSequencing.client.create_image_messages(
|
153
192
|
token: "9UPmGGWEwBsJrVnw6844tfpd",
|
154
193
|
instruction: "question",
|
155
194
|
data: "image_url"
|
@@ -187,9 +226,22 @@ Sample results
|
|
187
226
|
```
|
188
227
|
---
|
189
228
|
#### Photo tags
|
229
|
+
Get image
|
230
|
+
```ruby
|
231
|
+
KSequencing.client.get_image_photo_tags()
|
232
|
+
```
|
233
|
+
|
234
|
+
| Field | Type | Required | Description |
|
235
|
+
| ------------- |:-------------:| :----:| :-----|
|
236
|
+
| token | string | Yes |Project Authorization Token|
|
237
|
+
| id | integer | No | Image id|
|
238
|
+
|custom_id | integer | No | Client's image id |
|
239
|
+
|
240
|
+
Note: You must choose id or custom_id for search. Not both.
|
241
|
+
|
190
242
|
Create new photo tag
|
191
243
|
```ruby
|
192
|
-
KSequencing.client.
|
244
|
+
KSequencing.client.create_image_photo_tags()
|
193
245
|
```
|
194
246
|
| Field | Type | Required | Description |
|
195
247
|
| ------------- |:-------------:| :-----:| :-----|
|
@@ -202,7 +254,7 @@ KSequencing.client.create_photo_tags()
|
|
202
254
|
|
203
255
|
Sample request
|
204
256
|
```ruby
|
205
|
-
KSequencing.client.
|
257
|
+
KSequencing.client.create_image_photo_tags(
|
206
258
|
token: "9UPmGGWEwBsJrVnw6844tfpd",
|
207
259
|
instruction: "question",
|
208
260
|
data: "image_url"
|
data/k_sequencing.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = 'k_sequencing'
|
7
|
-
s.version = '0.
|
7
|
+
s.version = '0.1'
|
8
8
|
s.date = '2017-05-24'
|
9
9
|
s.summary = 'KSequencing is a moderator service for your online content'
|
10
10
|
s.description = 'Moderation suite'
|
data/lib/k_sequencing/client.rb
CHANGED
@@ -2,7 +2,7 @@ module KSequencing
|
|
2
2
|
|
3
3
|
class Client
|
4
4
|
|
5
|
-
def
|
5
|
+
def create_image_choices(options = {})
|
6
6
|
connection.post("/api/images/choices", options)
|
7
7
|
end
|
8
8
|
|
@@ -10,14 +10,30 @@ module KSequencing
|
|
10
10
|
connection.post("/api/images/closed_questions", options)
|
11
11
|
end
|
12
12
|
|
13
|
-
def
|
13
|
+
def create_image_messages(options = {})
|
14
14
|
connection.post("/api/images/messages", options)
|
15
15
|
end
|
16
16
|
|
17
|
-
def
|
17
|
+
def create_image_photo_tags(options = {})
|
18
18
|
connection.post("/api/images/photo_tags", options)
|
19
19
|
end
|
20
20
|
|
21
|
+
def get_image_choices(options = {})
|
22
|
+
connection.get("/api/images/choice", options)
|
23
|
+
end
|
24
|
+
|
25
|
+
def get_image_closed_questions(options = {})
|
26
|
+
connection.get("/api/images/closed_question", options)
|
27
|
+
end
|
28
|
+
|
29
|
+
def get_image_messages(options = {})
|
30
|
+
connection.get("/api/images/message", options)
|
31
|
+
end
|
32
|
+
|
33
|
+
def get_image_photo_tags(options = {})
|
34
|
+
connection.get("/api/images/photo_tag", options)
|
35
|
+
end
|
36
|
+
|
21
37
|
private
|
22
38
|
|
23
39
|
def connection
|
@@ -6,6 +6,18 @@ module KSequencing
|
|
6
6
|
|
7
7
|
class Connection
|
8
8
|
|
9
|
+
def get(path, options = {})
|
10
|
+
response = connection.get do |request|
|
11
|
+
request.url(path)
|
12
|
+
request.headers["Content-Type"] = "application/json"
|
13
|
+
request.headers["Authorization"] = options[:token] unless options[:token].nil?
|
14
|
+
request.params = options
|
15
|
+
end
|
16
|
+
Response.new(data(response), true, response.status, "success", meta(response), total(response))
|
17
|
+
rescue Error, Faraday::Error => e
|
18
|
+
handle_error(e)
|
19
|
+
end
|
20
|
+
|
9
21
|
def post(path, options = {}, query_params = {})
|
10
22
|
response = connection.post do |request|
|
11
23
|
request.path = path
|
data/lib/k_sequencing/version.rb
CHANGED