datawow 1.3.2 → 1.4.2
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/.gitignore +1 -0
- data/README.md +55 -69
- data/README/image_docs.md +39 -0
- data/datawow.gemspec +1 -1
- data/lib/datawow.rb +5 -0
- data/lib/datawow/connector.rb +1 -1
- data/lib/datawow/models/images/document_verification.rb +18 -0
- data/lib/datawow/version.rb +1 -1
- data/test/datawow/image_document_verification_test.rb +48 -0
- data/test/fixtures/image_document_verification/all.json +143 -0
- data/test/fixtures/image_document_verification/create.json +27 -0
- data/test/test_helper.rb +40 -37
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b374a165eb0735d634ea3cdffa68790023419fa02736cb6fa5d632d2a7ec18c
|
4
|
+
data.tar.gz: 11deb66ba61a1ba30701935f56bbabf5643aa5d5b3d4bcfc4c97b8820d0a48c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13cd5d468aabddacd7fc149c14627297c8edcca925156b70042bc65e5296e4c501e314eeed5bcd4532559296970b38c311f4fc4134d4648476b856fac4e30d6b
|
7
|
+
data.tar.gz: 3c30f6acb2780ce4e8db3883538b12fb829a99e8c3d3e786390a1180bfe773338b4df87fdaee5ab2822c7801c1aa159730fc37da923a52175b190cc454cc5213
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -6,31 +6,34 @@ HTTP RESTFul for calling DataWow APIs
|
|
6
6
|
|
7
7
|
# Installation
|
8
8
|
```ruby
|
9
|
-
gem 'datawow', '~> 1.
|
9
|
+
gem 'datawow', '~> 1.4.2'
|
10
10
|
```
|
11
11
|
|
12
|
-
|
12
|
+
### Rails
|
13
13
|
|
14
14
|
```console
|
15
15
|
$ rails generate datawow:install
|
16
16
|
```
|
17
|
-
|
18
|
-
|
19
|
-
**Note**: Our library work with Rails 4.1 or above
|
17
|
+
**Note**: Rails 4.1 or above
|
20
18
|
|
21
19
|
# Usage
|
22
20
|
|
23
|
-
To call our module use `Datawow`
|
21
|
+
To call our module, use `Datawow` followed by any of the classes provided in our APIs
|
22
|
+
|
23
|
+
## Classes explanation
|
24
|
+
These classes are instance methods we have created for you. You can use our provider or the recommended methods, [here](#dynamically_token_setting), when using our APIs
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
There are 4 APIs for image class
|
26
|
+
#### Image classes `Datawow.image_*`
|
27
|
+
There are 6 APIs for image class
|
28
28
|
|
29
|
+
## instance method
|
29
30
|
```ruby
|
30
31
|
Datawow.image_closed_question
|
31
32
|
Datawow.image_photo_tag
|
32
33
|
Datawow.image_choice
|
33
34
|
Datawow.image_message
|
35
|
+
Datawow.nanameue_human
|
36
|
+
Datawow.document_verification
|
34
37
|
```
|
35
38
|
---
|
36
39
|
|
@@ -42,7 +45,7 @@ Datawow.video_classification
|
|
42
45
|
```
|
43
46
|
---
|
44
47
|
#### Text classe `Datawow.text_*`
|
45
|
-
There are
|
48
|
+
There are 4 APIs for text class
|
46
49
|
|
47
50
|
```ruby
|
48
51
|
Datawow.text_closed_question
|
@@ -50,105 +53,94 @@ Datawow.text_category
|
|
50
53
|
Datawow.text_conversation
|
51
54
|
Datawow.text_ja
|
52
55
|
```
|
56
|
+
|
53
57
|
---
|
54
58
|
|
55
|
-
#### Prediction
|
59
|
+
#### Prediction classes `Datawow.prediction`
|
56
60
|
There are 1 API for prediction class
|
57
61
|
|
58
62
|
```ruby
|
59
63
|
Datawow.prediction
|
60
64
|
```
|
61
|
-
---
|
62
|
-
## Calling APIs
|
63
|
-
Every classes there are 3 function that is `create`, `find_by` and `all`
|
64
|
-
#### `create`
|
65
|
-
```ruby
|
66
|
-
Datawow.[class].create({data: "image URL", token: '_token'})
|
67
|
-
```
|
68
|
-
|
69
|
-
#### `find_by`
|
70
|
-
```ruby
|
71
|
-
Datawow.[class].find_by({id: "_image_id", token: '_token'})
|
72
|
-
```
|
73
65
|
|
74
|
-
|
66
|
+
Above methods are shortcuts for calling the following classes
|
75
67
|
```ruby
|
76
|
-
Datawow
|
68
|
+
Datawow::ImageClosedQuestion
|
69
|
+
Datawow::PhotoTag
|
70
|
+
Datawow::ImageChoice
|
71
|
+
Datawow::ImageMessage
|
72
|
+
Datawow::NanameueHuman
|
73
|
+
Datawow::VideoClassification
|
74
|
+
Datawow::TextClosedQuestion
|
75
|
+
Datawow::TextCategory
|
76
|
+
Datawow::TextConversation
|
77
|
+
Datawow::TextJa
|
78
|
+
Datawow::Prediction
|
79
|
+
Datawow::DocumentVerification
|
77
80
|
```
|
78
81
|
---
|
79
|
-
##
|
80
|
-
|
81
|
-
|
82
|
-
Firstly, __dynamic token__. if you have multiple project to work with, You could call library by using module name
|
82
|
+
## Available methods in our APIs
|
83
|
+
There are 3 main functions for each class: `create`, `find_by` and `all`
|
83
84
|
#### `create`
|
84
85
|
```ruby
|
85
|
-
Datawow
|
86
|
+
Datawow.[class].create(data: {})
|
86
87
|
```
|
87
88
|
|
88
89
|
#### `find_by`
|
89
90
|
```ruby
|
90
|
-
Datawow
|
91
|
+
Datawow.[class].find_by({id: "_image_id"})
|
91
92
|
```
|
92
93
|
|
93
94
|
#### `all`
|
94
95
|
```ruby
|
95
|
-
Datawow
|
96
|
+
Datawow.[class].all()
|
96
97
|
```
|
97
98
|
|
98
|
-
or another way
|
99
99
|
|
100
|
-
|
101
|
-
|
102
|
-
model.project_key = '_token'
|
103
|
-
model.create()
|
104
|
-
```
|
100
|
+
---
|
101
|
+
## Example
|
105
102
|
|
106
|
-
|
107
|
-
##### Setting project key
|
103
|
+
After the library has been called for the first time, the associated modules will be initialized and you could then call using the package name instead. [here](#class_explanation)
|
104
|
+
##### Setting the project key
|
108
105
|
```ruby
|
109
106
|
Datawow.project_key = '_token'
|
110
107
|
```
|
111
|
-
#####
|
108
|
+
##### Working with the methods
|
112
109
|
#### `create`
|
113
110
|
```ruby
|
114
|
-
Datawow.
|
111
|
+
Datawow.[class].create({data: "image URL"})
|
115
112
|
```
|
116
113
|
|
117
114
|
#### `find_by`
|
118
115
|
```ruby
|
119
|
-
Datawow.
|
116
|
+
Datawow.[class].find_by({id: "_image_id"})
|
120
117
|
```
|
121
118
|
|
122
119
|
#### `all`
|
123
120
|
```ruby
|
124
|
-
Datawow.
|
121
|
+
Datawow.[class].all({page: '_page', per_page: '_per_page'})
|
125
122
|
```
|
126
123
|
---
|
127
124
|
|
128
|
-
## Text AI Japanese
|
129
|
-
##### Set your project key
|
130
|
-
```ruby
|
131
|
-
Datawow.project_key = '_token'
|
132
|
-
```
|
133
125
|
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
```
|
126
|
+
## Dynamically setting the token
|
127
|
+
|
128
|
+
If you have many projects, we recommend using the following example instead of the one shown above if you would like to create an object and change its token dynamically
|
138
129
|
|
139
|
-
#### `find_by`
|
140
130
|
```ruby
|
141
|
-
Datawow.
|
131
|
+
Datawow::[class].new('_token').create({data: "image URL"})
|
142
132
|
```
|
143
|
-
|
144
|
-
#### `all`
|
133
|
+
or
|
145
134
|
```ruby
|
146
|
-
Datawow.
|
135
|
+
model = Datawow::[class].new
|
136
|
+
model.project_key = '_token'
|
137
|
+
model.create()
|
147
138
|
```
|
148
139
|
|
149
|
-
|
140
|
+
For available method, see [calling APIs](#avalabile_method_for_apis) section
|
141
|
+
|
150
142
|
|
151
|
-
|
143
|
+
# Setting default token for rails project
|
152
144
|
|
153
145
|
`config/initializers/datawow.rb`
|
154
146
|
|
@@ -160,20 +152,14 @@ Datawow.setup do |config|
|
|
160
152
|
end
|
161
153
|
```
|
162
154
|
|
163
|
-
After configuration has been set. You can calling APIs by not insert token like this
|
164
|
-
```ruby
|
165
|
-
Datawow.[class].create({data: "image URL"})
|
166
|
-
```
|
167
|
-
The system will be looking for your token by automatically
|
168
|
-
|
169
155
|
# Response
|
170
156
|
|
171
|
-
Response is a module and it
|
172
|
-
#### Example of response module
|
157
|
+
Response is a module and it contains data including: data, meta-data, message, and status
|
158
|
+
#### Example of a response module
|
173
159
|
```ruby
|
174
160
|
<Datawow::Response @status=200, @message="success" @meta={"code"=>200, "message"=>"success"}, @data={...}, />
|
175
161
|
```
|
176
|
-
|
162
|
+
You can call the `data` property to get the data, which would return in the format as shown below
|
177
163
|
|
178
164
|
```json
|
179
165
|
{
|
data/README/image_docs.md
CHANGED
@@ -92,6 +92,45 @@ Description: Identifying an object in the image (60 mins response time) - This m
|
|
92
92
|
|custom_id|string|No|Custom ID that used for search|
|
93
93
|
|
94
94
|
---
|
95
|
+
|
96
|
+
## Document Verification
|
97
|
+
|
98
|
+
### Create
|
99
|
+
```ruby
|
100
|
+
payload = {
|
101
|
+
data: <document-image-url>,
|
102
|
+
infos: {
|
103
|
+
type: {
|
104
|
+
value: <document-type> # - The document's type. e.g. "student card", "ID card", "Passport"
|
105
|
+
},
|
106
|
+
dob: {
|
107
|
+
value: <customer-date-of-birth> # - The customer's date of birth. Should be in format like `YYYY-MM-DD`.
|
108
|
+
}
|
109
|
+
},
|
110
|
+
postback_method: "GET", # - The HTTP method for posting result back to customer.
|
111
|
+
postback_url: <customer-postback-url> # - The customer's endpoint url receives result after verified success.
|
112
|
+
}
|
113
|
+
|
114
|
+
Datawow.project_key = <project-token>
|
115
|
+
Datawow.document_verification.create(payload)
|
116
|
+
```
|
117
|
+
|
118
|
+
#### params
|
119
|
+
| Field | Type| Required | Description |
|
120
|
+
| ------------- |:-------------:| :-----:| :-----|
|
121
|
+
|data| string|**Yes** |URL of image|
|
122
|
+
|infos| Hash| **Yes** |Hash of document's informations|
|
123
|
+
|postback_url|string| No |URL to receive result once document has been verified|
|
124
|
+
|postback_method|string | No |Configuration HTTP method GET POST PUT PATCH|
|
125
|
+
|custom_id|string|No|Custom ID that used for search|
|
126
|
+
|
127
|
+
### Search
|
128
|
+
```ruby
|
129
|
+
Datawow.project_key = <project-token>
|
130
|
+
Datawow.document_verification.find_by(id: <either-id-or-custom_id>) # - To find task by specific ID.
|
131
|
+
# - To either retrieve task as a list or find by specific ID.
|
132
|
+
Datawow.document_verification.all(id: <either-id-or-custom_id>, page: <number-of-result-page>, per_page: <number-of-result-per-page>)
|
133
|
+
```
|
95
134
|
# Common function
|
96
135
|
For every classes there are common functions to get list of data and find by ID. We're going to show you how to use it.
|
97
136
|
|
data/datawow.gemspec
CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = 'datawow'
|
8
|
-
s.version = '1.
|
8
|
+
s.version = '1.4.2'
|
9
9
|
s.date = '2019-01-04'
|
10
10
|
s.summary = 'HTTP RESTFul for calling DataWow APIs'
|
11
11
|
s.description = 'Moderation suite'
|
data/lib/datawow.rb
CHANGED
@@ -10,6 +10,7 @@ require_relative 'datawow/models/images/image_photo_tags'
|
|
10
10
|
require_relative 'datawow/models/images/image_choices'
|
11
11
|
require_relative 'datawow/models/images/image_messages'
|
12
12
|
require_relative 'datawow/models/images/nanameue_human'
|
13
|
+
require_relative 'datawow/models/images/document_verification'
|
13
14
|
require_relative 'datawow/models/predictions/predictors'
|
14
15
|
|
15
16
|
require_relative 'datawow/models/texts/text_categories'
|
@@ -73,5 +74,9 @@ module Datawow
|
|
73
74
|
def nanameue_human
|
74
75
|
NanameueHuman.new
|
75
76
|
end
|
77
|
+
|
78
|
+
def document_verification
|
79
|
+
DocumentVerification.new
|
80
|
+
end
|
76
81
|
end
|
77
82
|
end
|
data/lib/datawow/connector.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Datawow
|
4
|
+
# :nodoc:
|
5
|
+
class DocumentVerification
|
6
|
+
include Datawow::Models::Interface
|
7
|
+
|
8
|
+
attr_writer :project_key
|
9
|
+
|
10
|
+
def initialize(token = nil)
|
11
|
+
@project_key = token
|
12
|
+
@type = :image
|
13
|
+
@query_str = false
|
14
|
+
|
15
|
+
@path = 'images/document_verifications'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/datawow/version.rb
CHANGED
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'test_helper'
|
4
|
+
|
5
|
+
module Datawow
|
6
|
+
class DocumentVerificationTest < TestBase
|
7
|
+
def test_all
|
8
|
+
stub_request(:get, IMAGE_DOCUMENT_VERIFICATION_URL)
|
9
|
+
.to_return(body: JSON.generate(image_document_verifications), status: 200)
|
10
|
+
response = model.all
|
11
|
+
|
12
|
+
assert_instance_of(Response, response)
|
13
|
+
assert_equal(200, response.status)
|
14
|
+
refute_nil(response.data)
|
15
|
+
refute_nil(response.meta)
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_create
|
19
|
+
stub_request(:post, IMAGE_DOCUMENT_VERIFICATION_URL)
|
20
|
+
.to_return(body: JSON.generate(image_document_verification), status: 201)
|
21
|
+
response = model.create(options)
|
22
|
+
|
23
|
+
assert_instance_of(Response, response)
|
24
|
+
assert_equal(201, response.status)
|
25
|
+
refute_nil(response.data)
|
26
|
+
refute_nil(response.meta)
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_find
|
30
|
+
stub_request(:get, "#{IMAGE_DOCUMENT_VERIFICATION_URL}/test")
|
31
|
+
.to_return(body: JSON.generate(image_document_verification), status: 200)
|
32
|
+
response = model.find_by(id: 'test')
|
33
|
+
|
34
|
+
assert_instance_of(Response, response)
|
35
|
+
assert_equal(200, response.status)
|
36
|
+
refute_nil(response.data)
|
37
|
+
refute_nil(response.meta)
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def model
|
43
|
+
@model ||= DocumentVerification.new
|
44
|
+
@model.project_key = 'test'
|
45
|
+
@model
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,143 @@
|
|
1
|
+
{
|
2
|
+
"data": [
|
3
|
+
{
|
4
|
+
"id": "5c5cfb176e1157d3a56622fa",
|
5
|
+
"custom_id": null,
|
6
|
+
"status": "processed",
|
7
|
+
"postback_url": "https://9a9fe5c0.ap.ngrok.io/api/v1/moderate/images/closed_questions",
|
8
|
+
"postback": false,
|
9
|
+
"postback_method": "GET",
|
10
|
+
"project_id": 192,
|
11
|
+
"created_at": "2019-02-08T10:44:23.981+07:00",
|
12
|
+
"processed_at": "2019-02-08T10:44:36.350+07:00",
|
13
|
+
"data": "https://assets-cdn.github.com/images/modules/open_graph/github-mark.png",
|
14
|
+
"infos": {
|
15
|
+
"type": {
|
16
|
+
"value": "student_card",
|
17
|
+
"valid": true
|
18
|
+
},
|
19
|
+
"dob": {
|
20
|
+
"value": "91/11/28",
|
21
|
+
"valid": true
|
22
|
+
}
|
23
|
+
},
|
24
|
+
"contributors": [
|
25
|
+
999999,
|
26
|
+
49
|
27
|
+
]
|
28
|
+
},
|
29
|
+
{
|
30
|
+
"id": "5c5ce5bc6e1157b669f2ae5d",
|
31
|
+
"custom_id": null,
|
32
|
+
"status": "processed",
|
33
|
+
"postback_url": "https://9a9fe5c0.ap.ngrok.io/api/v1/moderate/images/closed_questions",
|
34
|
+
"postback": false,
|
35
|
+
"postback_method": "GET",
|
36
|
+
"project_id": 192,
|
37
|
+
"created_at": "2019-02-08T09:13:16.410+07:00",
|
38
|
+
"processed_at": "2019-02-08T10:34:26.088+07:00",
|
39
|
+
"data": "https://assets-cdn.github.com/images/modules/open_graph/github-mark.png",
|
40
|
+
"infos": {
|
41
|
+
"type": {
|
42
|
+
"value": "student_card",
|
43
|
+
"valid": false
|
44
|
+
},
|
45
|
+
"dob": {
|
46
|
+
"value": "91/11/28",
|
47
|
+
"valid": true
|
48
|
+
}
|
49
|
+
},
|
50
|
+
"contributors": [
|
51
|
+
49,
|
52
|
+
999999
|
53
|
+
]
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"id": "5c5cdac56e1157a373e24da6",
|
57
|
+
"custom_id": null,
|
58
|
+
"status": "processed",
|
59
|
+
"postback_url": "https://9a9fe5c0.ap.ngrok.io/api/v1/moderate/images/closed_questions",
|
60
|
+
"postback": false,
|
61
|
+
"postback_method": "GET",
|
62
|
+
"project_id": 192,
|
63
|
+
"created_at": "2019-02-08T08:26:29.070+07:00",
|
64
|
+
"processed_at": "2019-02-08T08:29:18.893+07:00",
|
65
|
+
"data": "https://assets-cdn.github.com/images/modules/open_graph/github-mark.png",
|
66
|
+
"infos": {
|
67
|
+
"type": {
|
68
|
+
"value": "student_card",
|
69
|
+
"valid": false
|
70
|
+
},
|
71
|
+
"dob": {
|
72
|
+
"value": "91/11/28",
|
73
|
+
"valid": false
|
74
|
+
}
|
75
|
+
},
|
76
|
+
"contributors": [
|
77
|
+
49,
|
78
|
+
999999
|
79
|
+
]
|
80
|
+
},
|
81
|
+
{
|
82
|
+
"id": "5c5c02df6e1157989273f33e",
|
83
|
+
"custom_id": null,
|
84
|
+
"status": "processed",
|
85
|
+
"postback_url": "https://9a9fe5c0.ap.ngrok.io/api/v1/moderate/images/closed_questions",
|
86
|
+
"postback": false,
|
87
|
+
"postback_method": "GET",
|
88
|
+
"project_id": 192,
|
89
|
+
"created_at": "2019-02-07T17:05:19.586+07:00",
|
90
|
+
"processed_at": "2019-02-07T17:05:34.045+07:00",
|
91
|
+
"data": "https://assets-cdn.github.com/images/modules/open_graph/github-mark.png",
|
92
|
+
"infos": {
|
93
|
+
"type": {
|
94
|
+
"value": "student_card",
|
95
|
+
"valid": false
|
96
|
+
},
|
97
|
+
"dob": {
|
98
|
+
"value": "91/11/28",
|
99
|
+
"valid": false
|
100
|
+
}
|
101
|
+
},
|
102
|
+
"contributors": [
|
103
|
+
999999,
|
104
|
+
49
|
105
|
+
]
|
106
|
+
},
|
107
|
+
{
|
108
|
+
"id": "5c5c02796e1157989273f33b",
|
109
|
+
"custom_id": null,
|
110
|
+
"status": "processed",
|
111
|
+
"postback_url": "https://9a9fe5c0.ap.ngrok.io/api/v1/moderate/images/closed_questions",
|
112
|
+
"postback": false,
|
113
|
+
"postback_method": "GET",
|
114
|
+
"project_id": 192,
|
115
|
+
"created_at": "2019-02-07T17:03:37.214+07:00",
|
116
|
+
"processed_at": "2019-02-07T17:05:02.430+07:00",
|
117
|
+
"data": "https://assets-cdn.github.com/images/modules/open_graph/github-mark.png",
|
118
|
+
"infos": {
|
119
|
+
"type": {
|
120
|
+
"value": "student_card",
|
121
|
+
"valid": true
|
122
|
+
},
|
123
|
+
"dob": {
|
124
|
+
"value": "91/11/28",
|
125
|
+
"valid": true
|
126
|
+
}
|
127
|
+
},
|
128
|
+
"contributors": [
|
129
|
+
999999,
|
130
|
+
49
|
131
|
+
]
|
132
|
+
}
|
133
|
+
],
|
134
|
+
"meta": {
|
135
|
+
"code": 200,
|
136
|
+
"message": "success",
|
137
|
+
"current_page": 1,
|
138
|
+
"next_page": -1,
|
139
|
+
"prev_page": -1,
|
140
|
+
"total_pages": 1,
|
141
|
+
"total_count": 5
|
142
|
+
}
|
143
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"id": "5c5d399b6e11571af0b87911",
|
4
|
+
"custom_id": null,
|
5
|
+
"status": "unprocess",
|
6
|
+
"postback_url": "https://9a9fe5c0.ap.ngrok.io/api/v1/moderate/images/closed_questions",
|
7
|
+
"postback": false,
|
8
|
+
"postback_method": "GET",
|
9
|
+
"project_id": 192,
|
10
|
+
"created_at": "2019-02-08T15:11:07.116+07:00",
|
11
|
+
"processed_at": null,
|
12
|
+
"data": "https://assets-cdn.github.com/images/modules/open_graph/github-mark.png",
|
13
|
+
"infos": {
|
14
|
+
"type": {
|
15
|
+
"value": "student_card"
|
16
|
+
},
|
17
|
+
"dob": {
|
18
|
+
"value": "91/11/28"
|
19
|
+
}
|
20
|
+
},
|
21
|
+
"contributors": []
|
22
|
+
},
|
23
|
+
"meta": {
|
24
|
+
"code": 201,
|
25
|
+
"message": "created success"
|
26
|
+
}
|
27
|
+
}
|
data/test/test_helper.rb
CHANGED
@@ -14,48 +14,51 @@ class TestBase < Minitest::Test
|
|
14
14
|
:image_photo_tags, :prediction, :predictions, :videos, :video,
|
15
15
|
:text_categories, :text_category, :text_conversations, :text_conversation,
|
16
16
|
:text_closed_questions, :text_closed_question, :nanameue_human, :nanameue_humans,
|
17
|
-
:text_ja, :text_jas
|
17
|
+
:text_ja, :text_jas, :image_document_verifications, :image_document_verification
|
18
18
|
|
19
|
-
IMAGE_CHOICES_URL
|
20
|
-
IMAGE_CHOICE_URL
|
19
|
+
IMAGE_CHOICES_URL = 'https://kiyo-image.datawow.io/api/v1/images/choices'.freeze
|
20
|
+
IMAGE_CHOICE_URL = 'https://kiyo-image.datawow.io/api/v1/images/choice'.freeze
|
21
21
|
IMAGE_CLOSED_QUESTIONS_URL = 'https://kiyo-image.datawow.io/api/v1/images/closed_questions'.freeze
|
22
|
-
IMAGE_CLOSED_QUESTION_URL
|
23
|
-
IMAGE_MESSAGES_URL
|
24
|
-
IMAGE_MESSAGE_URL
|
25
|
-
IMAGE_PHOTO_TAGS
|
26
|
-
IMAGE_PHOTO_TAG
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
22
|
+
IMAGE_CLOSED_QUESTION_URL = 'https://kiyo-image.datawow.io/api/v1/images/closed_question'.freeze
|
23
|
+
IMAGE_MESSAGES_URL = 'https://kiyo-image.datawow.io/api/v1/images/messages'.freeze
|
24
|
+
IMAGE_MESSAGE_URL = 'https://kiyo-image.datawow.io/api/v1/images/message'.freeze
|
25
|
+
IMAGE_PHOTO_TAGS = 'https://kiyo-image.datawow.io/api/v1/images/photo_tags'.freeze
|
26
|
+
IMAGE_PHOTO_TAG = 'https://kiyo-image.datawow.io/api/v1/images/photo_tag'.freeze
|
27
|
+
IMAGE_DOCUMENT_VERIFICATION_URL = 'https://kiyo-image.datawow.io/api/v1/images/document_verifications'.freeze
|
28
|
+
PREDICTIONS_URL = 'https://kiyo-image.datawow.io/api/v1/prime/predictions'.freeze
|
29
|
+
IMAGE_URL = 'https://kiyo-image.datawow.io/api/v1/projects/images'.freeze
|
30
|
+
VIDEO_URL = 'https://kiyo-image.datawow.io/api/v1/videos/closed_questions'.freeze
|
31
|
+
NANAMEUE_HUMAN_URL = 'https://kiyo-image.datawow.io/api/v1/jobs/nanameue/consensuses'.freeze
|
32
|
+
TEXT_CATEGORY_URL = 'https://kiyo-text.datawow.io/api/v1/text/text_categories'.freeze
|
33
|
+
TEXT_CONVERSATION_URL = 'https://kiyo-text.datawow.io/api/v1/text/text_conversations'.freeze
|
34
|
+
TEXT_CLOSED_QUESTION_URL = 'https://kiyo-text.datawow.io/api/v1/text/text_closed_questions'.freeze
|
35
|
+
TEXT_JA_URL = 'https://kiyo-text.datawow.io/api/v1/text_ai/text_ja'.freeze
|
35
36
|
|
36
37
|
def setup
|
37
|
-
@image_choices
|
38
|
-
@image_choice
|
38
|
+
@image_choices = FileReader.new('test/fixtures/image_choice/all.json').read_json
|
39
|
+
@image_choice = FileReader.new('test/fixtures/image_choice/create.json').read_json
|
39
40
|
@image_closed_questions = FileReader.new('test/fixtures/image_closed_question/all.json').read_json
|
40
|
-
@image_closed_question
|
41
|
-
@image_messages
|
42
|
-
@image_message
|
43
|
-
@image_photo_tags
|
44
|
-
@image_photo_tag
|
45
|
-
@
|
46
|
-
@
|
47
|
-
@
|
48
|
-
@
|
49
|
-
@
|
50
|
-
@
|
51
|
-
@
|
52
|
-
@
|
53
|
-
@
|
54
|
-
@
|
55
|
-
@
|
56
|
-
@
|
57
|
-
@
|
58
|
-
@
|
41
|
+
@image_closed_question = FileReader.new('test/fixtures/image_closed_question/create.json').read_json
|
42
|
+
@image_messages = FileReader.new('test/fixtures/image_message/all.json').read_json
|
43
|
+
@image_message = FileReader.new('test/fixtures/image_message/create.json').read_json
|
44
|
+
@image_photo_tags = FileReader.new('test/fixtures/image_photo_tag/all.json').read_json
|
45
|
+
@image_photo_tag = FileReader.new('test/fixtures/image_photo_tag/create.json').read_json
|
46
|
+
@image_document_verifications = FileReader.new('test/fixtures/image_document_verification/all.json').read_json
|
47
|
+
@image_document_verification = FileReader.new('test/fixtures/image_document_verification/create.json').read_json
|
48
|
+
@predictions = FileReader.new('test/fixtures/prediction/all.json').read_json
|
49
|
+
@prediction = FileReader.new('test/fixtures/prediction/create.json').read_json
|
50
|
+
@videos = FileReader.new('test/fixtures/video_classification/all.json').read_json
|
51
|
+
@video = FileReader.new('test/fixtures/video_classification/create.json').read_json
|
52
|
+
@nanameue_human = FileReader.new('test/fixtures/nanameue_human/create.json').read_json
|
53
|
+
@nanameue_humans = FileReader.new('test/fixtures/nanameue_human/all.json').read_json
|
54
|
+
@text_category = FileReader.new('test/fixtures/text_category/create.json').read_json
|
55
|
+
@text_categories = FileReader.new('test/fixtures/text_category/all.json').read_json
|
56
|
+
@text_conversation = FileReader.new('test/fixtures/text_conversation/create.json').read_json
|
57
|
+
@text_conversations = FileReader.new('test/fixtures/text_conversation/all.json').read_json
|
58
|
+
@text_closed_question = FileReader.new('test/fixtures/text_closed_question/create.json').read_json
|
59
|
+
@text_closed_questions = FileReader.new('test/fixtures/text_closed_question/all.json').read_json
|
60
|
+
@text_ja = FileReader.new('test/fixtures/text_ja/create.json').read_json
|
61
|
+
@text_jas = FileReader.new('test/fixtures/text_ja/all.json').read_json
|
59
62
|
@options = {
|
60
63
|
token: 'project token'
|
61
64
|
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datawow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jesdakorn Samittiauttakorn
|
@@ -114,6 +114,7 @@ files:
|
|
114
114
|
- lib/datawow/client_response.rb
|
115
115
|
- lib/datawow/connector.rb
|
116
116
|
- lib/datawow/error.rb
|
117
|
+
- lib/datawow/models/images/document_verification.rb
|
117
118
|
- lib/datawow/models/images/image_choices.rb
|
118
119
|
- lib/datawow/models/images/image_closed_questions.rb
|
119
120
|
- lib/datawow/models/images/image_messages.rb
|
@@ -133,6 +134,7 @@ files:
|
|
133
134
|
- test/datawow/connector_test.rb
|
134
135
|
- test/datawow/image_choices_test.rb
|
135
136
|
- test/datawow/image_closed_questions_test.rb
|
137
|
+
- test/datawow/image_document_verification_test.rb
|
136
138
|
- test/datawow/image_messages_test.rb
|
137
139
|
- test/datawow/image_photo_tags_test.rb
|
138
140
|
- test/datawow/nanameue_human_test.rb
|
@@ -147,6 +149,8 @@ files:
|
|
147
149
|
- test/fixtures/image_choice/create.json
|
148
150
|
- test/fixtures/image_closed_question/all.json
|
149
151
|
- test/fixtures/image_closed_question/create.json
|
152
|
+
- test/fixtures/image_document_verification/all.json
|
153
|
+
- test/fixtures/image_document_verification/create.json
|
150
154
|
- test/fixtures/image_message/all.json
|
151
155
|
- test/fixtures/image_message/create.json
|
152
156
|
- test/fixtures/image_photo_tag/all.json
|