workarea-api-storefront 4.4.6 → 4.5.4

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.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +52 -0
  3. data/README.md +4 -7
  4. data/app/controllers/workarea/api/storefront/analytics_controller.rb +31 -19
  5. data/app/controllers/workarea/api/storefront/application_controller.rb +15 -2
  6. data/app/controllers/workarea/api/storefront/authentication.rb +6 -9
  7. data/app/controllers/workarea/api/storefront/categories_controller.rb +3 -1
  8. data/app/controllers/workarea/api/storefront/checkouts_controller.rb +0 -1
  9. data/app/controllers/workarea/api/storefront/menus_controller.rb +3 -1
  10. data/app/controllers/workarea/api/storefront/pages_controller.rb +3 -1
  11. data/app/controllers/workarea/api/storefront/products_controller.rb +3 -1
  12. data/app/controllers/workarea/api/storefront/recent_views_controller.rb +13 -26
  13. data/app/controllers/workarea/api/storefront/recommendations_controller.rb +2 -8
  14. data/app/controllers/workarea/api/storefront/searches_controller.rb +0 -12
  15. data/app/views/workarea/api/storefront/categories/show.json.jbuilder +1 -1
  16. data/app/views/workarea/api/storefront/email_signups/show.json.jbuilder +1 -1
  17. data/app/views/workarea/api/storefront/menus/_menu.json.jbuilder +1 -1
  18. data/app/views/workarea/api/storefront/pages/show.json.jbuilder +1 -1
  19. data/app/views/workarea/api/storefront/recent_views/show.json.jbuilder +0 -1
  20. data/app/views/workarea/api/storefront/searches/show.json.jbuilder +1 -1
  21. data/app/views/workarea/api/storefront/system_content/show.json.jbuilder +1 -1
  22. data/config/initializers/config.rb +19 -0
  23. data/lib/workarea/api/storefront.rb +1 -0
  24. data/lib/workarea/api/storefront/visit.decorator +52 -0
  25. data/test/documentation/workarea/api/storefront/checkouts_documentation_test.rb +21 -0
  26. data/test/documentation/workarea/api/storefront/segmentation_documentation_test.rb +104 -0
  27. data/test/documentation/workarea/api/storefront/validation_documentation_test.rb +1 -1
  28. data/test/dummy/config/initializers/session_store.rb +3 -1
  29. data/test/integration/workarea/api/storefront/analytics_integration_test.rb +12 -7
  30. data/test/integration/workarea/api/storefront/recent_views_integration_test.rb +38 -33
  31. data/test/integration/workarea/api/storefront/recommendations_integration_test.rb +1 -1
  32. data/test/integration/workarea/api/storefront/searches_integration_test.rb +0 -36
  33. data/test/integration/workarea/api/storefront/segments_integration_test.rb +218 -0
  34. data/workarea-api-storefront.gemspec +8 -7
  35. metadata +19 -15
  36. data/app/controllers/workarea/api/storefront/user_activity.rb +0 -36
  37. data/app/view_models/workarea/api/storefront/search_suggestion_view_model.rb +0 -21
@@ -3,16 +3,17 @@ require File.expand_path('../../lib/workarea/api/version', __FILE__)
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'workarea-api-storefront'
5
5
  s.version = Workarea::Api::VERSION
6
- s.authors = ['Curt Howard']
7
- s.email = ['choward@weblinc.com']
8
- s.homepage = 'http://www.workarea.com'
9
- s.summary = 'Storefront API for the Workarea commerce platform'
10
- s.description = 'Storefront HTTP API Rails Engine of the Workarea ecommerce platform'
6
+ s.authors = ['Ben Crouse']
7
+ s.email = ['bcrouse@workarea.com']
8
+ s.homepage = 'https://www.workarea.com'
9
+ s.license = 'Business Software License'
10
+ s.summary = 'Storefront JSON REST API for the Workarea Commerce Platform'
11
+ s.description = 'This provides a storefront JSON REST API for the Workarea Commerce Platform. Useful for building apps, kiosks, etc.'
11
12
 
12
13
  s.files = `git ls-files`.split("\n")
13
14
 
14
15
  s.required_ruby_version = '>= 2.3.0'
15
16
 
16
- s.add_dependency 'workarea', '~> 3.x', '>= 3.2.x'
17
- s.add_dependency 'responders', '~> 2.4.0'
17
+ s.add_dependency 'workarea', '~> 3.x', '>= 3.5.x'
18
+ s.add_dependency 'responders', '~> 3.0.0'
18
19
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workarea-api-storefront
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.6
4
+ version: 4.5.4
5
5
  platform: ruby
6
6
  authors:
7
- - Curt Howard
7
+ - Ben Crouse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-21 00:00:00.000000000 Z
11
+ date: 2020-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: workarea
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 3.x
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 3.2.x
22
+ version: 3.5.x
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,29 +29,31 @@ dependencies:
29
29
  version: 3.x
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 3.2.x
32
+ version: 3.5.x
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: responders
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: 2.4.0
39
+ version: 3.0.0
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: 2.4.0
47
- description: Storefront HTTP API Rails Engine of the Workarea ecommerce platform
46
+ version: 3.0.0
47
+ description: This provides a storefront JSON REST API for the Workarea Commerce Platform.
48
+ Useful for building apps, kiosks, etc.
48
49
  email:
49
- - choward@weblinc.com
50
+ - bcrouse@workarea.com
50
51
  executables: []
51
52
  extensions: []
52
53
  extra_rdoc_files: []
53
54
  files:
54
55
  - ".gitignore"
56
+ - LICENSE
55
57
  - README.md
56
58
  - Rakefile
57
59
  - app/controllers/workarea/api/storefront/accounts_controller.rb
@@ -79,7 +81,6 @@ files:
79
81
  - app/controllers/workarea/api/storefront/searches_controller.rb
80
82
  - app/controllers/workarea/api/storefront/system_content_controller.rb
81
83
  - app/controllers/workarea/api/storefront/taxons_controller.rb
82
- - app/controllers/workarea/api/storefront/user_activity.rb
83
84
  - app/controllers/workarea/storefront/application_controller.decorator
84
85
  - app/helpers/workarea/api/storefront/application_helper.rb
85
86
  - app/helpers/workarea/api/storefront/checkouts_helper.rb
@@ -87,7 +88,6 @@ files:
87
88
  - app/models/workarea/catalog/category.decorator
88
89
  - app/models/workarea/user.decorator
89
90
  - app/models/workarea/user/authentication_token.rb
90
- - app/view_models/workarea/api/storefront/search_suggestion_view_model.rb
91
91
  - app/views/workarea/api/storefront/accounts/_account.json.jbuilder
92
92
  - app/views/workarea/api/storefront/accounts/create.json.jbuilder
93
93
  - app/views/workarea/api/storefront/accounts/show.json.jbuilder
@@ -147,6 +147,7 @@ files:
147
147
  - config/routes.rb
148
148
  - lib/workarea/api/storefront.rb
149
149
  - lib/workarea/api/storefront/engine.rb
150
+ - lib/workarea/api/storefront/visit.decorator
150
151
  - test/documentation/workarea/api/storefront/accounts_documentation_test.rb
151
152
  - test/documentation/workarea/api/storefront/analytics_documentation_test.rb
152
153
  - test/documentation/workarea/api/storefront/assets_documentation_test.rb
@@ -167,6 +168,7 @@ files:
167
168
  - test/documentation/workarea/api/storefront/saved_addresses_documentation_test.rb
168
169
  - test/documentation/workarea/api/storefront/saved_credit_cards_documentation_test.rb
169
170
  - test/documentation/workarea/api/storefront/searches_documentation_test.rb
171
+ - test/documentation/workarea/api/storefront/segmentation_documentation_test.rb
170
172
  - test/documentation/workarea/api/storefront/system_content_documentation_test.rb
171
173
  - test/documentation/workarea/api/storefront/taxons_documentation_test.rb
172
174
  - test/documentation/workarea/api/storefront/validation_documentation_test.rb
@@ -244,6 +246,7 @@ files:
244
246
  - test/integration/workarea/api/storefront/saved_addresses_integration_test.rb
245
247
  - test/integration/workarea/api/storefront/saved_credit_cards_integration_test.rb
246
248
  - test/integration/workarea/api/storefront/searches_integration_test.rb
249
+ - test/integration/workarea/api/storefront/segments_integration_test.rb
247
250
  - test/integration/workarea/api/storefront/system_content_integration_test.rb
248
251
  - test/integration/workarea/api/storefront/taxons_integration_test.rb
249
252
  - test/integration/workarea/api/storefront/user_carts_integration_test.rb
@@ -252,8 +255,9 @@ files:
252
255
  - test/support/orders_test.rb
253
256
  - test/test_helper.rb
254
257
  - workarea-api-storefront.gemspec
255
- homepage: http://www.workarea.com
256
- licenses: []
258
+ homepage: https://www.workarea.com
259
+ licenses:
260
+ - Business Software License
257
261
  metadata: {}
258
262
  post_install_message:
259
263
  rdoc_options: []
@@ -270,8 +274,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
270
274
  - !ruby/object:Gem::Version
271
275
  version: '0'
272
276
  requirements: []
273
- rubygems_version: 3.0.4
277
+ rubygems_version: 3.0.3
274
278
  signing_key:
275
279
  specification_version: 4
276
- summary: Storefront API for the Workarea commerce platform
280
+ summary: Storefront JSON REST API for the Workarea Commerce Platform
277
281
  test_files: []
@@ -1,36 +0,0 @@
1
- module Workarea
2
- module Api
3
- module Storefront
4
- module UserActivity
5
- extend ActiveSupport::Concern
6
-
7
- def user_activity
8
- @user_activity ||= Recommendation::UserActivity.find_or_initialize_by(
9
- id: current_user_activity_id
10
- )
11
- end
12
-
13
- def current_user_activity_id
14
- if authentication?
15
- current_user.id
16
- else
17
- params[:session_id]
18
- end
19
- end
20
-
21
- def assert_current_user_activity_id
22
- if current_user_activity_id.blank?
23
- render(
24
- json: {
25
- problem: t('workarea.api.storefront.recent_views.missing_id')
26
- },
27
- status: :unprocessable_entity
28
- )
29
-
30
- return false
31
- end
32
- end
33
- end
34
- end
35
- end
36
- end
@@ -1,21 +0,0 @@
1
- module Workarea
2
- module Api
3
- module Storefront
4
- class SearchSuggestionViewModel < Workarea::Storefront::SearchSuggestionViewModel
5
- def url
6
- helpers = Api::Storefront::Engine.routes.url_helpers
7
-
8
- if suggestion_type == 'product'
9
- helpers.product_path(product)
10
- elsif suggestion_type == 'search'
11
- helpers.search_path(q: name)
12
- elsif suggestion_type == 'category'
13
- helpers.category_path(source['slug'])
14
- elsif suggestion_type == 'page'
15
- helpers.page_path(source['slug'])
16
- end
17
- end
18
- end
19
- end
20
- end
21
- end