yotpo 1.0.1 → 1.0.3

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
- SHA1:
3
- metadata.gz: fb53b7fdd20dfaafab8a3e4829cefe24a314f606
4
- data.tar.gz: 4493eda469919fe3ec415d7aa7cc9ae49725e1d0
2
+ SHA256:
3
+ metadata.gz: 0b83e3f2fc016a5ee39f8dfd8f6600978bc51779653f708523789bf47c143577
4
+ data.tar.gz: ad7d8cb447ccdddcae389f2b8d46cd70bb823b9c5bc070311320a15731bcb173
5
5
  SHA512:
6
- metadata.gz: 3f6b71eabccef39287b304503bc552a3e474de9d47c6b29e9e924364ad9c34a912c2f4bec29a96b63edc5ad6e910fa9cb5ca3aef344744aa7655f801ce053a8a
7
- data.tar.gz: a73b871e0ef8f4a1ee474aa15fbdb3c5f54f268fdd317f9eb008e720443b2003959052631c1717e4779b10b7b3e9bd7bd17561295de580aed8d8950ca5791001
6
+ metadata.gz: 8b2399df877a4c3b3a6bc00ded492ce2da59ad6fdb48cb416aa9ef05b957dcc4adfc2632ec800d1ce886e9da314939df881fdbf75146b893e3e87455133bc9bb
7
+ data.tar.gz: 23d109586179d07909d4c0f36102b65bc3f060137f91ea0ba57510489c839d6759219d272d124456b5edf8e2e67b65091eb5983e0c0326630933542f7f85074d
@@ -40,6 +40,16 @@ module Yotpo
40
40
  utoken = params[:utoken]
41
41
  get("/apps/#{app_key}/subomain_check/#{subdomain}?utoken=#{utoken}")
42
42
  end
43
+
44
+ #
45
+ # Check if the account is locked
46
+ #
47
+ # @param params [Hash]
48
+ # @option params [String] :app_key the account app key that was created at registration
49
+ def check_lock_state(params)
50
+ app_key = params[:app_key]
51
+ get("/apps/#{app_key}/lock_state")
52
+ end
43
53
  end
44
54
  end
45
55
 
@@ -0,0 +1,27 @@
1
+ module Yotpo
2
+ module Image
3
+
4
+ # Gets a specific image in Yotpo
5
+ #
6
+ # @param [Hash] params
7
+ # @option params [String] :app_key the account app key that was created at registration
8
+ # @option params [String] :id the id of the image
9
+ # @return [::Hashie::Mash] The image with all of it's data
10
+ def get_image(params)
11
+ image_id = params[:id]
12
+ app_key = params[:app_key]
13
+ get("v1/widget/#{app_key}/images/show/#{image_id}")
14
+ end
15
+
16
+ # Gets a list of images in Yotpo
17
+ #
18
+ # @param [Hash] params
19
+ # @option params [Array] :ids the ids of the images
20
+ # @return [::Hashie::Mash] The images with all of their data
21
+ def list_images(params)
22
+ app_key = params[:app_key]
23
+ ids = params[:ids]
24
+ post("v1/widget/#{app_key}/images/list", ids: ids)
25
+ end
26
+ end
27
+ end
@@ -11,6 +11,11 @@ module Yotpo
11
11
  get("/apps/#{app_key}/bottom_lines", request)
12
12
  end
13
13
 
14
+ def get_products_information(params)
15
+ app_key = params[:app_key]
16
+ get("/v1/widget/#{app_key}/products/products_information", { domain_keys: params[:domain_keys] })
17
+ end
18
+
14
19
  #
15
20
  # Retrieves the bottom line of a product
16
21
  # @param params [Hash]
@@ -17,7 +17,7 @@ module Yotpo
17
17
  # @option params [String] :review_title the review title
18
18
  # @option params [String Integer] :review_score the rating of the review
19
19
  # @option params [String] :utoken the token of the user who wrote the review (if one exists)
20
- # @return [::Hashie::Mash] The new review with all of it's date
20
+ # @return [::Hashie::Mash] The new review with all of it's data
21
21
  def create_review(params)
22
22
  request = {
23
23
  appkey: params[:app_key],
@@ -34,10 +34,54 @@ module Yotpo
34
34
  review_score: params[:review_score],
35
35
  utoken: params[:utoken]
36
36
  }
37
- request.delete_if {|element, value| value.nil? }
37
+ request.delete_if { |element, value| value.nil? }
38
38
  get('/reviews/dynamic_create', request)
39
39
  end
40
40
 
41
+ # Gets a specific review in Yotpo
42
+ #
43
+ # @param [Hash] params
44
+ # @option params [String] :id the id of the review
45
+ # @return [::Hashie::Mash] The review with all of it's data
46
+ def get_review(params)
47
+ review_id = params[:id]
48
+ get("/reviews/#{review_id}")
49
+ end
50
+
51
+ #
52
+ # Gets reviews of all products
53
+ #
54
+ # @param [Hash] params
55
+ # @option params [String] :app_key the app key of the account for which the review is created
56
+ # @option params [String] :product_id the id of the product
57
+ # @option params [Integer] :count the amount of reviews per page
58
+ # @option params [Integer] :page the page number
59
+ # @option params [String] :since_id the id from which to start retrieving reviews
60
+ # @option params [String] :since_date the date from which to start retrieving reviews
61
+ # @option params [String] :since_updated_at Earliest update date of returned reviews
62
+ # @option params [String] :utoken the users utoken to get the reviews that are most relevant to that user
63
+ # @option params [String] :user_reference Filter by user reference
64
+ # @option params [Boolean] :include_site_reviews Include site reviews
65
+ # @option params [Boolean] :deleted Include deleted reviews
66
+
67
+ def get_all_reviews(params)
68
+ app_key = params[:app_key]
69
+ sku = params[:product_id]
70
+ request = {
71
+ utoken: params[:utoken],
72
+ since_id: params[:since_id],
73
+ since_date: params[:since_date],
74
+ since_updated_at: params[:since_updated_at],
75
+ count: params[:per_page] || 20,
76
+ page: params[:page] || 1,
77
+ include_site_reviews: params[:include_site_reviews],
78
+ deleted: params[:deleted],
79
+ user_reference: params[:user_reference]
80
+ }
81
+ request.delete_if{|key,val| val.nil? }
82
+ get("/v1/apps/#{app_key}/#{sku}/reviews", request)
83
+ end
84
+
41
85
  #
42
86
  # Gets reviews of a specific product
43
87
  #
@@ -13,6 +13,7 @@ require 'yotpo/api/question'
13
13
  require 'yotpo/api/answer'
14
14
  require 'yotpo/api/feature'
15
15
  require 'yotpo/api/oauth'
16
+ require 'yotpo/api/image'
16
17
  require 'yotpo/api/owner_feature'
17
18
  require 'yotpo/api/owner_feature_setting'
18
19
  require 'yotpo/api/product'
@@ -28,6 +29,7 @@ module Yotpo
28
29
  include Yotpo::AccountSocial
29
30
  include Yotpo::Comment
30
31
  include Yotpo::Feature
32
+ include Yotpo::Image
31
33
  include Yotpo::Oauth
32
34
  include Yotpo::OwnerFeature
33
35
  include Yotpo::OwnerFeatureSetting
@@ -1,3 +1,3 @@
1
1
  module Yotpo
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.3'
3
3
  end
@@ -36,7 +36,19 @@ describe Yotpo::Account do
36
36
  it { should be_a ::Hashie::Mash }
37
37
  it { should respond_to :available }
38
38
  it { should respond_to :subdomain }
39
+ end
39
40
 
40
-
41
+ describe '#check_lock_state' do
42
+ before(:all) do
43
+ data = {
44
+ app_key: @app_key
45
+ }
46
+ VCR.use_cassette('check_lock_state') do
47
+ @response = Yotpo.check_lock_state(data)
48
+ end
49
+ end
50
+ subject { @response.body }
51
+ it { should be_a ::Hashie::Mash }
52
+ it { should respond_to :active }
41
53
  end
42
54
  end
@@ -0,0 +1,38 @@
1
+ require 'helper'
2
+
3
+ describe Yotpo::Image do
4
+ describe '#get_image' do
5
+ before(:all) do
6
+ VCR.use_cassette('get_image') do
7
+ @response = Yotpo.get_image(id: 5, app_key: @app_key)
8
+ end
9
+ end
10
+
11
+ subject { @response.body.image }
12
+ it { should respond_to :id }
13
+ it { should respond_to :image_url }
14
+ it { should respond_to :big_image_url }
15
+ it { should respond_to :image_content_type }
16
+ it { should respond_to :image_width }
17
+ it { should respond_to :image_height }
18
+ end
19
+
20
+ describe '#list_images' do
21
+ before(:all) do
22
+ VCR.use_cassette('list_images') do
23
+ @response = Yotpo.list_images(ids: [23,24], app_key: @app_key)
24
+ end
25
+ end
26
+
27
+ subject { @response.body.images }
28
+ it { should respond_to :count }
29
+
30
+ subject { @response.body.images.first }
31
+ it { should respond_to :id }
32
+ it { should respond_to :image_url }
33
+ it { should respond_to :big_image_url }
34
+ it { should respond_to :image_content_type }
35
+ it { should respond_to :image_width }
36
+ it { should respond_to :image_height }
37
+ end
38
+ end
@@ -1,6 +1,24 @@
1
1
  require 'helper'
2
2
 
3
3
  describe Yotpo::Product do
4
+ describe '#get_product_information' do
5
+ before(:all) do
6
+ products_params = {
7
+ app_key: 'vzStmYud6bHLto5ksn5DoGoA7ghM0kzjMdH2DS5T',
8
+ domain_keys: ['1', '2']
9
+ }
10
+ VCR.use_cassette('check_products_information') do
11
+ @response = Yotpo.get_products_information(products_params)
12
+ end
13
+ end
14
+
15
+ subject { @response.body.products['1'] }
16
+ it { should be_a ::Hashie::Mash }
17
+ it { should respond_to :domain_key }
18
+ it { should respond_to :product_link }
19
+ it { should respond_to :name }
20
+ end
21
+
4
22
  describe '#get_all_bottom_lines' do
5
23
  before(:all) do
6
24
  get_app_bottom_lines_params = {
@@ -31,6 +31,20 @@ describe Yotpo::Review do
31
31
  it { should respond_to :title }
32
32
  end
33
33
 
34
+ describe '#get_review' do
35
+ before(:all) do
36
+ VCR.use_cassette('get_review') do
37
+ @response = Yotpo.get_review(id: 22)
38
+ end
39
+ end
40
+
41
+ subject { @response.body.review }
42
+ it { should respond_to :id }
43
+ it { should respond_to :user }
44
+ it { should respond_to :content }
45
+ it { should respond_to :title }
46
+ end
47
+
34
48
  describe '#get_product_reviews' do
35
49
  before(:all) do
36
50
  get_reviews_params = {
@@ -68,4 +82,4 @@ describe Yotpo::Review do
68
82
  it { should respond_to :id }
69
83
 
70
84
  end
71
- end
85
+ end
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.yotpo.com/apps/3ovRYNIb6OIAI0ddS7EfpYkHpi0oTKl6bj82Vjiy/lock_state
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.2
12
+ Yotpo-Api-Connector:
13
+ - Ruby1.0.1
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: 'OK '
18
+ headers:
19
+ Server:
20
+ - nginx/1.8.1
21
+ Date:
22
+ - Tue, 16 May 2017 13:55:49 GMT
23
+ Content-Type:
24
+ - application/json; charset=utf-8
25
+ Content-Length:
26
+ - '65'
27
+ Connection:
28
+ - keep-alive
29
+ Yotpo-Parsed-Request:
30
+ - '{"action":"lock_state","controller":"apps","id":"3ovRYNIb6OIAI0ddS7EfpYkHpi0oTKl6bj82Vjiy"}'
31
+ X-Ua-Compatible:
32
+ - IE=Edge,chrome=1
33
+ Etag:
34
+ - '"c3733c6fbd8c6c10a81437240c49c7f9"'
35
+ Cache-Control:
36
+ - max-age=0, private, must-revalidate
37
+ X-Request-Id:
38
+ - 700119c9b20f1006b5007ff80c96bc8a
39
+ X-Runtime:
40
+ - '11.192951'
41
+ Access-Control-Allow-Credentials:
42
+ - 'true'
43
+ Strict-Transport-Security:
44
+ - max-age=31536000; includeSubDomains
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"status":{"code":200,"message":"OK"},"response":{"active":true}}'
48
+ http_version:
49
+ recorded_at: Tue, 16 May 2017 13:55:49 GMT
50
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,55 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.yotpo.com/v1/widget/vzStmYud6bHLto5ksn5DoGoA7ghM0kzjMdH2DS5T/products/products_information?domain_keys%5B%5D=1&domain_keys%5B%5D=2
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.2
12
+ Yotpo-Api-Connector:
13
+ - Ruby1.0.1
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: 'OK '
18
+ headers:
19
+ Server:
20
+ - nginx/1.8.1
21
+ Date:
22
+ - Tue, 05 Dec 2017 15:45:28 GMT
23
+ Content-Type:
24
+ - application/json; charset=utf-8
25
+ Content-Length:
26
+ - '357'
27
+ Connection:
28
+ - keep-alive
29
+ X-Frame-Options:
30
+ - SAMEORIGIN
31
+ X-Xss-Protection:
32
+ - 1; mode=block
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ Yotpo-Parsed-Request:
36
+ - '{"format":"json","controller":"widget/products","action":"products_information","app_key":"vzStmYud6bHLto5ksn5DoGoA7ghM0kzjMdH2DS5T"}'
37
+ Etag:
38
+ - W/"b8bb74f4e812cc9bb09d713b88bc2b0c"
39
+ Cache-Control:
40
+ - max-age=0, private, must-revalidate
41
+ X-Request-Id:
42
+ - 699b3444-eb7b-4c01-9b78-9216a2840821
43
+ X-Runtime:
44
+ - '2.754755'
45
+ Access-Control-Allow-Credentials:
46
+ - 'true'
47
+ Strict-Transport-Security:
48
+ - max-age=31536000; includeSubDomains
49
+ body:
50
+ encoding: UTF-8
51
+ string: '{"status":{"code":200,"message":"OK"},"response":{"products":{"1":{"id":88,"name":"Angry
52
+ Bird","domain_key":"1","product_link":"https://yotpo.com/go/mEiK6Ji5","product_url":"http://yotpo.mysimplestore.com/products/angry-bird","image_url":"https://s3.amazonaws.com/yotpo-images-test/Product/88/123/square.png?1503838853","score":null,"reviews_count":null}}}}'
53
+ http_version:
54
+ recorded_at: Tue, 05 Dec 2017 15:45:28 GMT
55
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,162 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.yotpo.com/images/5
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.2
12
+ Yotpo-Api-Connector:
13
+ - Ruby1.0.1
14
+ Expect:
15
+ - ''
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: 'OK '
20
+ headers:
21
+ Server:
22
+ - nginx/1.10.3
23
+ Date:
24
+ - Thu, 16 Nov 2017 15:13:55 GMT
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ Content-Length:
28
+ - '365'
29
+ Connection:
30
+ - keep-alive
31
+ X-Frame-Options:
32
+ - SAMEORIGIN
33
+ X-Xss-Protection:
34
+ - 1; mode=block
35
+ X-Content-Type-Options:
36
+ - nosniff
37
+ Yotpo-Parsed-Request:
38
+ - '{"format":"json","controller":"images","action":"show","id":"5"}'
39
+ Etag:
40
+ - W/"8d7961068fa8091bac9925ccf6939fac"
41
+ Cache-Control:
42
+ - max-age=0, private, must-revalidate
43
+ X-Request-Id:
44
+ - 9c9ceb89-73dc-4c29-8a5a-1b907e74de0d
45
+ X-Runtime:
46
+ - '0.137265'
47
+ Access-Control-Allow-Credentials:
48
+ - 'true'
49
+ Strict-Transport-Security:
50
+ - max-age=31536000; includeSubDomains
51
+ body:
52
+ encoding: UTF-8
53
+ string: '{"status":{"code":200,"message":"OK"},"response":{"image":{"id":5,"image_url":"https://s3.amazonaws.com/yotpo-images-test/Review/22/5/thumb.jpg?1487686542","big_image_url":"https://s3.amazonaws.com/yotpo-images-test/Review/22/5/big.jpg?1487686542","image_content_type":"image/jpeg","image_width":200,"image_height":200,"imageable_type":"Review","imageable_id":22}}}'
54
+ http_version:
55
+ recorded_at: Thu, 16 Nov 2017 15:13:55 GMT
56
+ - request:
57
+ method: get
58
+ uri: https://api.yotpo.com/v1/widget/3ovRYNIb6OIAI0ddS7EfpYkHpi0oTKl6bj82Vjiy/images/5
59
+ body:
60
+ encoding: US-ASCII
61
+ string: ''
62
+ headers:
63
+ User-Agent:
64
+ - Faraday v0.9.2
65
+ Yotpo-Api-Connector:
66
+ - Ruby1.0.1
67
+ Expect:
68
+ - ''
69
+ response:
70
+ status:
71
+ code: 200
72
+ message: 'OK '
73
+ headers:
74
+ Server:
75
+ - nginx/1.10.3
76
+ Date:
77
+ - Mon, 04 Dec 2017 08:05:10 GMT
78
+ Content-Type:
79
+ - application/json; charset=utf-8
80
+ Content-Length:
81
+ - '365'
82
+ Connection:
83
+ - keep-alive
84
+ X-Frame-Options:
85
+ - SAMEORIGIN
86
+ X-Xss-Protection:
87
+ - 1; mode=block
88
+ X-Content-Type-Options:
89
+ - nosniff
90
+ Yotpo-Parsed-Request:
91
+ - '{"format":"json","controller":"widget/images","action":"show","app_key":"3ovRYNIb6OIAI0ddS7EfpYkHpi0oTKl6bj82Vjiy","id":"5"}'
92
+ Etag:
93
+ - W/"8d7961068fa8091bac9925ccf6939fac"
94
+ Cache-Control:
95
+ - max-age=0, private, must-revalidate
96
+ X-Request-Id:
97
+ - 2783e562-476d-4913-97bb-58e70d1a2643
98
+ X-Runtime:
99
+ - '0.143147'
100
+ Access-Control-Allow-Credentials:
101
+ - 'true'
102
+ Strict-Transport-Security:
103
+ - max-age=31536000; includeSubDomains
104
+ body:
105
+ encoding: UTF-8
106
+ string: '{"status":{"code":200,"message":"OK"},"response":{"image":{"id":5,"image_url":"https://s3.amazonaws.com/yotpo-images-test/Review/22/5/thumb.jpg?1487686542","big_image_url":"https://s3.amazonaws.com/yotpo-images-test/Review/22/5/big.jpg?1487686542","image_content_type":"image/jpeg","image_width":200,"image_height":200,"imageable_type":"Review","imageable_id":22}}}'
107
+ http_version:
108
+ recorded_at: Mon, 04 Dec 2017 08:05:10 GMT
109
+ - request:
110
+ method: get
111
+ uri: https://api.yotpo.com/v1/widget/3ovRYNIb6OIAI0ddS7EfpYkHpi0oTKl6bj82Vjiy/images/show/5
112
+ body:
113
+ encoding: US-ASCII
114
+ string: ''
115
+ headers:
116
+ User-Agent:
117
+ - Faraday v0.9.2
118
+ Yotpo-Api-Connector:
119
+ - Ruby1.0.1
120
+ Expect:
121
+ - ''
122
+ response:
123
+ status:
124
+ code: 200
125
+ message: 'OK '
126
+ headers:
127
+ Server:
128
+ - nginx/1.10.3
129
+ Date:
130
+ - Mon, 04 Dec 2017 09:36:19 GMT
131
+ Content-Type:
132
+ - application/json; charset=utf-8
133
+ Content-Length:
134
+ - '365'
135
+ Connection:
136
+ - keep-alive
137
+ X-Frame-Options:
138
+ - SAMEORIGIN
139
+ X-Xss-Protection:
140
+ - 1; mode=block
141
+ X-Content-Type-Options:
142
+ - nosniff
143
+ Yotpo-Parsed-Request:
144
+ - '{"format":"json","controller":"widget/images","action":"show","app_key":"3ovRYNIb6OIAI0ddS7EfpYkHpi0oTKl6bj82Vjiy","id":"5"}'
145
+ Etag:
146
+ - W/"8d7961068fa8091bac9925ccf6939fac"
147
+ Cache-Control:
148
+ - max-age=0, private, must-revalidate
149
+ X-Request-Id:
150
+ - e9728daf-160c-4bbc-90e5-f65c21f8f678
151
+ X-Runtime:
152
+ - '7.839896'
153
+ Access-Control-Allow-Credentials:
154
+ - 'true'
155
+ Strict-Transport-Security:
156
+ - max-age=31536000; includeSubDomains
157
+ body:
158
+ encoding: UTF-8
159
+ string: '{"status":{"code":200,"message":"OK"},"response":{"image":{"id":5,"image_url":"https://s3.amazonaws.com/yotpo-images-test/Review/22/5/thumb.jpg?1487686542","big_image_url":"https://s3.amazonaws.com/yotpo-images-test/Review/22/5/big.jpg?1487686542","image_content_type":"image/jpeg","image_width":200,"image_height":200,"imageable_type":"Review","imageable_id":22}}}'
160
+ http_version:
161
+ recorded_at: Mon, 04 Dec 2017 09:36:19 GMT
162
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,61 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.yotpo.com/reviews/22
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.2
12
+ Yotpo-Api-Connector:
13
+ - Ruby1.0.1
14
+ Expect:
15
+ - ''
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: 'OK '
20
+ headers:
21
+ Server:
22
+ - nginx/1.10.3
23
+ Date:
24
+ - Thu, 16 Nov 2017 15:13:55 GMT
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ Content-Length:
28
+ - '1515'
29
+ Connection:
30
+ - keep-alive
31
+ X-Frame-Options:
32
+ - SAMEORIGIN
33
+ X-Xss-Protection:
34
+ - 1; mode=block
35
+ X-Content-Type-Options:
36
+ - nosniff
37
+ Yotpo-Parsed-Request:
38
+ - '{"format":"json","controller":"reviews","action":"show","id":"22"}'
39
+ Etag:
40
+ - W/"f8255f25de01e79b2568f439aa9305e4"
41
+ Cache-Control:
42
+ - max-age=0, private, must-revalidate
43
+ X-Request-Id:
44
+ - b90ae4f6-2014-4701-a226-9ad3339b6592
45
+ X-Runtime:
46
+ - '0.150779'
47
+ Access-Control-Allow-Credentials:
48
+ - 'true'
49
+ Strict-Transport-Security:
50
+ - max-age=31536000; includeSubDomains
51
+ body:
52
+ encoding: UTF-8
53
+ string: '{"status":{"code":200,"message":"OK"},"response":{"review":{"id":22,"content":"Wow,
54
+ what a camera! This is absolutely perfect for anyone who wants to use it for
55
+ personal use.","title":"Works Great","score":5,"user":{"id":7,"display_name":"Henry
56
+ K.","slug":"henry-k","social_image":"https://ddcfq0gxiontw.cloudfront.net/images/anonymous_user.png","is_social_connected":false,"bio":null,"score":0,"badges":[]},"user_type":"User","users":[],"products":[{"Location_idx":[0,0],"Product":{"id":8,"name":"Camera
57
+ GX4","slug":"camera-gx4--4","product_url":"http://www.yotpo.com","shorten_url":"https://yotpo.com/go/v5n0HW0r","images":[{"id":16,"image_url":"https://s3.amazonaws.com/yotpo-images-test/Product/8/16/square.jpg?1487692044","big_image_url":"https://s3.amazonaws.com/yotpo-images-test/Product/8/16/big.jpg?1487692044"}],"social_network_links":{"facebook":"https://yotpo.com/go/kjcEQbGK","twitter":"https://yotpo.com/go/fx5SeycZ","linkedin":"https://yotpo.com/go/vUOZEgEi","google_oauth2":"https://yotpo.com/go/evOxBJDA"},"facebook_testemonials_page_product_url":"https://yotpo.com/go/cFIcQ0lI"}}],"votes_up":0,"votes_down":0,"user_vote":0,"created_at":"2015-03-05T22:00:00.000Z","deleted":false,"new":false,"verified_buyer":false,"archived":false,"social_pushed":false,"facebook_pushed":0,"twitter_pushed":0,"account":{"id":1,"domain":"w2.yotpo.com"},"products_apps":[{"id":8,"product_url":"http://www.yotpo.com","domain_key":"nb2b_pictures_in_reviews","product":{"id":8,"name":"Camera
58
+ GX4"}}],"sentiment":null}}}'
59
+ http_version:
60
+ recorded_at: Thu, 16 Nov 2017 15:13:55 GMT
61
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,58 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.yotpo.com/v1/widget/3ovRYNIb6OIAI0ddS7EfpYkHpi0oTKl6bj82Vjiy/images/list
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"ids":[23,24]}'
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.2
12
+ Yotpo-Api-Connector:
13
+ - Ruby1.0.1
14
+ Content-Type:
15
+ - application/json
16
+ Expect:
17
+ - ''
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: 'OK '
22
+ headers:
23
+ Server:
24
+ - nginx/1.10.3
25
+ Date:
26
+ - Mon, 04 Dec 2017 08:05:10 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Content-Length:
30
+ - '681'
31
+ Connection:
32
+ - keep-alive
33
+ X-Frame-Options:
34
+ - SAMEORIGIN
35
+ X-Xss-Protection:
36
+ - 1; mode=block
37
+ X-Content-Type-Options:
38
+ - nosniff
39
+ Yotpo-Parsed-Request:
40
+ - '{"format":"json","controller":"widget/images","action":"list","app_key":"3ovRYNIb6OIAI0ddS7EfpYkHpi0oTKl6bj82Vjiy"}'
41
+ Etag:
42
+ - W/"5fb271f67fa767bd3316eabc14503793"
43
+ Cache-Control:
44
+ - max-age=0, private, must-revalidate
45
+ X-Request-Id:
46
+ - 8c735063-66c7-41a4-bdf3-10552aea65e1
47
+ X-Runtime:
48
+ - '0.212524'
49
+ Access-Control-Allow-Credentials:
50
+ - 'true'
51
+ Strict-Transport-Security:
52
+ - max-age=31536000; includeSubDomains
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"status":{"code":200,"message":"OK"},"response":{"images":[{"id":23,"image_url":"https://s3.amazonaws.com/yotpo-images-test/Review/46/23/thumb.jpg?1488294060","big_image_url":"https://s3.amazonaws.com/yotpo-images-test/Review/46/23/big.jpg?1488294060","image_content_type":"image/jpeg","image_width":640,"image_height":426,"imageable_type":"Review","imageable_id":46},{"id":24,"image_url":"https://s3.amazonaws.com/yotpo-images-test/Review/46/24/thumb.jpg?1488294066","big_image_url":"https://s3.amazonaws.com/yotpo-images-test/Review/46/24/big.jpg?1488294066","image_content_type":"image/jpeg","image_width":1024,"image_height":589,"imageable_type":"Review","imageable_id":46}]}}'
56
+ http_version:
57
+ recorded_at: Mon, 04 Dec 2017 08:05:10 GMT
58
+ recorded_with: VCR 3.0.3
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yotpo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladislav Shub
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-21 00:00:00.000000000 Z
11
+ date: 2017-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -124,6 +124,7 @@ files:
124
124
  - lib/yotpo/api/answer.rb
125
125
  - lib/yotpo/api/comment.rb
126
126
  - lib/yotpo/api/feature.rb
127
+ - lib/yotpo/api/image.rb
127
128
  - lib/yotpo/api/oauth.rb
128
129
  - lib/yotpo/api/owner_feature.rb
129
130
  - lib/yotpo/api/owner_feature_setting.rb
@@ -142,6 +143,7 @@ files:
142
143
  - spec/api/answer_spec.rb
143
144
  - spec/api/comment_spec.rb
144
145
  - spec/api/feature_spec.rb
146
+ - spec/api/image_spec.rb
145
147
  - spec/api/oauth_spec.rb
146
148
  - spec/api/owner_feature_setting_spec.rb
147
149
  - spec/api/owner_feature_spec.rb
@@ -155,7 +157,9 @@ files:
155
157
  - spec/cassettes/add_shop_owner_answer.yml
156
158
  - spec/cassettes/add_vote_to_review.yml
157
159
  - spec/cassettes/anonymous_user_confirmation.yml
160
+ - spec/cassettes/check_lock_state.yml
158
161
  - spec/cassettes/check_minisite_subdomain.yml
162
+ - spec/cassettes/check_products_information.yml
159
163
  - spec/cassettes/create_account_platform.yml
160
164
  - spec/cassettes/create_account_social.yml
161
165
  - spec/cassettes/create_comment.yml
@@ -166,6 +170,7 @@ files:
166
170
  - spec/cassettes/get_account_social.yml
167
171
  - spec/cassettes/get_feature_settings.yml
168
172
  - spec/cassettes/get_features.yml
173
+ - spec/cassettes/get_image.yml
169
174
  - spec/cassettes/get_login_url.yml
170
175
  - spec/cassettes/get_oauth_token.yml
171
176
  - spec/cassettes/get_owner_features.yml
@@ -173,6 +178,8 @@ files:
173
178
  - spec/cassettes/get_product_reviews.yml
174
179
  - spec/cassettes/get_product_url.yml
175
180
  - spec/cassettes/get_purchases.yml
181
+ - spec/cassettes/get_review.yml
182
+ - spec/cassettes/list_images.yml
176
183
  - spec/cassettes/mass_update_feature_settings.yml
177
184
  - spec/cassettes/owner_feature_settings.yml
178
185
  - spec/cassettes/question_create_by_token.yml
@@ -222,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
222
229
  version: '0'
223
230
  requirements: []
224
231
  rubyforge_project:
225
- rubygems_version: 2.6.6
232
+ rubygems_version: 2.7.3
226
233
  signing_key:
227
234
  specification_version: 4
228
235
  summary: A Ruby interface to the YOTPO API
@@ -233,6 +240,7 @@ test_files:
233
240
  - spec/api/answer_spec.rb
234
241
  - spec/api/comment_spec.rb
235
242
  - spec/api/feature_spec.rb
243
+ - spec/api/image_spec.rb
236
244
  - spec/api/oauth_spec.rb
237
245
  - spec/api/owner_feature_setting_spec.rb
238
246
  - spec/api/owner_feature_spec.rb
@@ -246,7 +254,9 @@ test_files:
246
254
  - spec/cassettes/add_shop_owner_answer.yml
247
255
  - spec/cassettes/add_vote_to_review.yml
248
256
  - spec/cassettes/anonymous_user_confirmation.yml
257
+ - spec/cassettes/check_lock_state.yml
249
258
  - spec/cassettes/check_minisite_subdomain.yml
259
+ - spec/cassettes/check_products_information.yml
250
260
  - spec/cassettes/create_account_platform.yml
251
261
  - spec/cassettes/create_account_social.yml
252
262
  - spec/cassettes/create_comment.yml
@@ -257,6 +267,7 @@ test_files:
257
267
  - spec/cassettes/get_account_social.yml
258
268
  - spec/cassettes/get_feature_settings.yml
259
269
  - spec/cassettes/get_features.yml
270
+ - spec/cassettes/get_image.yml
260
271
  - spec/cassettes/get_login_url.yml
261
272
  - spec/cassettes/get_oauth_token.yml
262
273
  - spec/cassettes/get_owner_features.yml
@@ -264,6 +275,8 @@ test_files:
264
275
  - spec/cassettes/get_product_reviews.yml
265
276
  - spec/cassettes/get_product_url.yml
266
277
  - spec/cassettes/get_purchases.yml
278
+ - spec/cassettes/get_review.yml
279
+ - spec/cassettes/list_images.yml
267
280
  - spec/cassettes/mass_update_feature_settings.yml
268
281
  - spec/cassettes/owner_feature_settings.yml
269
282
  - spec/cassettes/question_create_by_token.yml