showroom 0.3.1 → 0.3.3
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/CHANGELOG.md +14 -0
- data/README.md +3 -0
- data/lib/showroom/client.rb +1 -1
- data/lib/showroom/core/version.rb +1 -1
- data/lib/showroom/models/search/collection_suggestion.rb +8 -0
- data/lib/showroom/models/search/product_suggestion.rb +8 -0
- data/lib/showroom/models/search/result.rb +12 -6
- metadata +9 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fb9b3d557d2d6eff7a04f917fdd3712fae253809de079349ea73c7b67d5ba4bd
|
|
4
|
+
data.tar.gz: 90569fd64dcaf712e5633f6029ab8be328eb7cafd80d5043518d221752833dc7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 90514f57c37117c324ddc3e16873842a685af54976a4daef3b6fd62fa49421a8852b720d012c3589d3d6e02f1aba3e12babe10aef4ce52093af87f7c1751bf35
|
|
7
|
+
data.tar.gz: 250bbf1733cd6139972c856d4c68d44e92850f9eb7f91e3bf3043f4eb842e9ac8165e8aac3cb3d483faa15f047e56dcfa18b40f9df0df7dc41bfced28e9c282e
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.3.3] - 2026-12-03
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Final notice-only release: Showroom is no longer maintained. Added notices to the README, gem description, and install output. No functionality or dependencies changed.
|
|
15
|
+
|
|
16
|
+
## [0.3.2] - 2026-04-25
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- `Search::ProductSuggestion#url` — returns the canonical storefront URL (`/products/:handle`), matching the existing `Product#url` API
|
|
21
|
+
- `Search::CollectionSuggestion#url` — returns the canonical storefront URL (`/collections/:handle`), matching the existing `Collection#url` API
|
|
22
|
+
- `Search::Result.new` now accepts a `client:` keyword and propagates it onto every suggestion it builds, so suggestions can resolve their store-specific URL without falling back to the global client
|
|
23
|
+
|
|
10
24
|
## [0.3.1] - 2026-04-25
|
|
11
25
|
|
|
12
26
|
### Changed
|
data/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Showroom
|
|
2
2
|
|
|
3
|
+
> [!IMPORTANT]
|
|
4
|
+
> **Showroom is no longer maintained.** It relies on Shopify's public storefront product listing (`/products.json`), which [Shopify has said it plans to deprecate](https://community.shopify.dev/t/about-rest-to-graphql-migration-roadmap/5832). Version 0.3.3 is a final notice-only release; existing versions remain installable, but no fixes or updates are planned.
|
|
5
|
+
|
|
3
6
|
A Ruby gem wrapping Shopify's public, unauthenticated JSON endpoints — no app, no token, no session required.
|
|
4
7
|
|
|
5
8
|
```ruby
|
data/lib/showroom/client.rb
CHANGED
|
@@ -93,7 +93,7 @@ module Showroom
|
|
|
93
93
|
query['resources[type]'] = types.join(',') unless types.empty?
|
|
94
94
|
query.merge!(params)
|
|
95
95
|
raw = get('/search/suggest.json', query)
|
|
96
|
-
Search::Result.new(raw.dig('resources', 'results') || {})
|
|
96
|
+
Search::Result.new(raw.dig('resources', 'results') || {}, client: self)
|
|
97
97
|
end
|
|
98
98
|
end
|
|
99
99
|
end
|
|
@@ -14,6 +14,14 @@ module Showroom
|
|
|
14
14
|
def self.complete_model_class
|
|
15
15
|
Collection
|
|
16
16
|
end
|
|
17
|
+
|
|
18
|
+
# Returns the canonical storefront URL for this collection suggestion.
|
|
19
|
+
#
|
|
20
|
+
# @return [String]
|
|
21
|
+
def url
|
|
22
|
+
conn = client || Showroom.client
|
|
23
|
+
"#{conn.base_url}/collections/#{handle}"
|
|
24
|
+
end
|
|
17
25
|
end
|
|
18
26
|
end
|
|
19
27
|
end
|
|
@@ -15,6 +15,14 @@ module Showroom
|
|
|
15
15
|
def self.complete_model_class
|
|
16
16
|
Product
|
|
17
17
|
end
|
|
18
|
+
|
|
19
|
+
# Returns the canonical storefront URL for this product suggestion.
|
|
20
|
+
#
|
|
21
|
+
# @return [String]
|
|
22
|
+
def url
|
|
23
|
+
conn = client || Showroom.client
|
|
24
|
+
"#{conn.base_url}/products/#{handle}"
|
|
25
|
+
end
|
|
18
26
|
end
|
|
19
27
|
end
|
|
20
28
|
end
|
|
@@ -12,8 +12,10 @@ module Showroom
|
|
|
12
12
|
# result.queries # => [Array<QuerySuggestion>]
|
|
13
13
|
class Result
|
|
14
14
|
# @param results_hash [Hash] the +resources.results+ hash from the API response
|
|
15
|
-
|
|
15
|
+
# @param client [Showroom::Client, nil] the client to propagate onto suggestions
|
|
16
|
+
def initialize(results_hash, client: nil)
|
|
16
17
|
@data = results_hash
|
|
18
|
+
@client = client
|
|
17
19
|
end
|
|
18
20
|
|
|
19
21
|
PRODUCT_ORDER_ATTRS = %w[id title handle price].freeze
|
|
@@ -28,7 +30,7 @@ module Showroom
|
|
|
28
30
|
# @raise [ArgumentError] when an unsupported order attribute is given
|
|
29
31
|
def products(order: nil)
|
|
30
32
|
validate_order!(order)
|
|
31
|
-
suggestions =
|
|
33
|
+
suggestions = build_suggestions('products', ProductSuggestion)
|
|
32
34
|
return suggestions unless order
|
|
33
35
|
|
|
34
36
|
sort_product_suggestions(suggestions, order)
|
|
@@ -38,32 +40,36 @@ module Showroom
|
|
|
38
40
|
#
|
|
39
41
|
# @return [Array<CollectionSuggestion>]
|
|
40
42
|
def collections
|
|
41
|
-
|
|
43
|
+
build_suggestions('collections', CollectionSuggestion)
|
|
42
44
|
end
|
|
43
45
|
|
|
44
46
|
# Returns page suggestions from the search result.
|
|
45
47
|
#
|
|
46
48
|
# @return [Array<PageSuggestion>]
|
|
47
49
|
def pages
|
|
48
|
-
|
|
50
|
+
build_suggestions('pages', PageSuggestion)
|
|
49
51
|
end
|
|
50
52
|
|
|
51
53
|
# Returns article suggestions from the search result.
|
|
52
54
|
#
|
|
53
55
|
# @return [Array<ArticleSuggestion>]
|
|
54
56
|
def articles
|
|
55
|
-
|
|
57
|
+
build_suggestions('articles', ArticleSuggestion)
|
|
56
58
|
end
|
|
57
59
|
|
|
58
60
|
# Returns query suggestions from the search result.
|
|
59
61
|
#
|
|
60
62
|
# @return [Array<QuerySuggestion>]
|
|
61
63
|
def queries
|
|
62
|
-
|
|
64
|
+
build_suggestions('queries', QuerySuggestion)
|
|
63
65
|
end
|
|
64
66
|
|
|
65
67
|
private
|
|
66
68
|
|
|
69
|
+
def build_suggestions(key, klass)
|
|
70
|
+
@data.fetch(key, []).map { |h| klass.new(h).tap { |s| s.client = @client } }
|
|
71
|
+
end
|
|
72
|
+
|
|
67
73
|
def validate_order!(order)
|
|
68
74
|
return unless order
|
|
69
75
|
return if PRODUCT_ORDER_ATTRS.include?(order.to_s)
|
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: showroom
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- 01max
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: bin
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-12-03 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: faraday
|
|
@@ -29,9 +30,8 @@ dependencies:
|
|
|
29
30
|
- - "<"
|
|
30
31
|
- !ruby/object:Gem::Version
|
|
31
32
|
version: '3'
|
|
32
|
-
description:
|
|
33
|
-
|
|
34
|
-
to interact with the Shopify public API.
|
|
33
|
+
description: 'Unmaintained: a Faraday-based Ruby client for Shopify''s public storefront
|
|
34
|
+
endpoints.'
|
|
35
35
|
email: []
|
|
36
36
|
executables: []
|
|
37
37
|
extensions: []
|
|
@@ -73,6 +73,8 @@ metadata:
|
|
|
73
73
|
homepage_uri: https://github.com/01max/showroom
|
|
74
74
|
source_code_uri: https://github.com/01max/showroom
|
|
75
75
|
changelog_uri: https://github.com/01max/showroom/blob/main/CHANGELOG.md
|
|
76
|
+
post_install_message: Showroom is no longer maintained. Shopify storefront behavior
|
|
77
|
+
may change without notice.
|
|
76
78
|
rdoc_options: []
|
|
77
79
|
require_paths:
|
|
78
80
|
- lib
|
|
@@ -87,7 +89,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
87
89
|
- !ruby/object:Gem::Version
|
|
88
90
|
version: '0'
|
|
89
91
|
requirements: []
|
|
90
|
-
rubygems_version: 3.
|
|
92
|
+
rubygems_version: 3.5.22
|
|
93
|
+
signing_key:
|
|
91
94
|
specification_version: 4
|
|
92
95
|
summary: An unauthenticated Ruby client for Shopify's public API.
|
|
93
96
|
test_files: []
|