portage-ucp-shopify 0.3.0 → 0.4.0
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 +20 -0
- data/lib/portage/ucp/shopify/adapter.rb +6 -0
- data/lib/portage/ucp/shopify/queries.rb +11 -0
- data/lib/portage/ucp/shopify/version.rb +1 -1
- metadata +9 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7a765da54993cf41e31bf88ed87b7b77980c699d9870cc8669ed3129bd215322
|
|
4
|
+
data.tar.gz: f6ed02a45de96177706fd90283972623164b1cc48dc1d2e2b985bd2f34e3d002
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2c56b50e718ffffc7fffe8298d94b2b1ae716ea1664e85d3b7ba6ad4cb2e066906b8c0b6dc2b0bae67b2fce6060769707c4c104f9fcba04e53a55400b1984df1
|
|
7
|
+
data.tar.gz: 2b36bc54e055429bddf8b0ea01ca17f3abfe7f152576c6007775f3b5b31db2684348044dd2f54ee9be81d4f5b908ceef7e32a47ec404e057a3db4214c9881659
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,26 @@ All notable changes to this project are documented here. Format loosely follows
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.0.0/); this project is
|
|
5
5
|
pre-1.0, so APIs may still shift between minor versions.
|
|
6
6
|
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.4.0] - 2026-09-14
|
|
10
|
+
|
|
11
|
+
- Added `Adapter#lookup_catalog(ids:)` — fetches several known product ids in
|
|
12
|
+
one round trip via the Admin API's `nodes(ids:)` field, instead of one
|
|
13
|
+
`get_product` call per id. Mirrors Shopify's real `search_catalog`/
|
|
14
|
+
`lookup_catalog` split, and reuses `Mapper.product` against the same node
|
|
15
|
+
shape `get_product`/`search_catalog` already use.
|
|
16
|
+
- Widened the `portage-ucp` dependency pin from `~> 0.4` to `~> 0.5` —
|
|
17
|
+
`lookup_catalog` is only advertised by the base `Adapter` from
|
|
18
|
+
`portage-ucp` 0.5.0 on.
|
|
19
|
+
|
|
20
|
+
## [0.3.1] - 2026-08-28
|
|
21
|
+
|
|
22
|
+
- Widened the `portage-ucp` dependency pin from `~> 0.3` to `~> 0.4` —
|
|
23
|
+
`portage-ucp` bumped to 0.4.0 (reorder capability, correlation ids,
|
|
24
|
+
PII redaction), and this gem is published, so its old pin would refuse
|
|
25
|
+
the new core version on install. No code change in this gem itself.
|
|
26
|
+
|
|
7
27
|
## [0.3.0] - 2026-08-27
|
|
8
28
|
|
|
9
29
|
- `metadata_field` config DSL (`Configuration`) — lets a merchant map their
|
|
@@ -66,6 +66,12 @@ module Portage
|
|
|
66
66
|
node && Portage::Ucp::ProductDetail.new(product: Mapper.product(node))
|
|
67
67
|
end
|
|
68
68
|
|
|
69
|
+
def lookup_catalog(product_ids:)
|
|
70
|
+
data = @client.admin_query(Queries.products_by_ids_query, variables: { ids: product_ids })
|
|
71
|
+
products = data["nodes"].compact.map { |node| Mapper.product(node) }
|
|
72
|
+
Portage::Ucp::CatalogSearchResult.new(products: products)
|
|
73
|
+
end
|
|
74
|
+
|
|
69
75
|
def get_cart(cart_id:)
|
|
70
76
|
cart_node = fetch_cart_node(cart_id)
|
|
71
77
|
cart_node && Mapper.cart(cart_node)
|
|
@@ -83,6 +83,17 @@ module Portage
|
|
|
83
83
|
GRAPHQL
|
|
84
84
|
end
|
|
85
85
|
|
|
86
|
+
# Admin API batch-by-GID fetch — `nodes` returns one entry per
|
|
87
|
+
# requested id, in order, `null` for any id that doesn't resolve to a
|
|
88
|
+
# Product (see Adapter#lookup_catalog's `.compact`).
|
|
89
|
+
def self.products_by_ids_query
|
|
90
|
+
<<~GRAPHQL
|
|
91
|
+
query ProductsByIds($ids: [ID!]!) {
|
|
92
|
+
nodes(ids: $ids) { ... on Product { #{product_fields} } }
|
|
93
|
+
}
|
|
94
|
+
GRAPHQL
|
|
95
|
+
end
|
|
96
|
+
|
|
86
97
|
CART_FIELDS = <<~GRAPHQL.freeze
|
|
87
98
|
id
|
|
88
99
|
checkoutUrl
|
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: portage-ucp-shopify
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tom Whitbread
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: exe
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-09-14 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: portage-ucp
|
|
@@ -15,14 +16,14 @@ dependencies:
|
|
|
15
16
|
requirements:
|
|
16
17
|
- - "~>"
|
|
17
18
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: '0.
|
|
19
|
+
version: '0.5'
|
|
19
20
|
type: :runtime
|
|
20
21
|
prerelease: false
|
|
21
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
23
|
requirements:
|
|
23
24
|
- - "~>"
|
|
24
25
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: '0.
|
|
26
|
+
version: '0.5'
|
|
26
27
|
- !ruby/object:Gem::Dependency
|
|
27
28
|
name: rake
|
|
28
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -96,6 +97,7 @@ dependencies:
|
|
|
96
97
|
description: Implements Portage::Ucp::Adapter against Shopify's Admin (catalog, order)
|
|
97
98
|
and Storefront (cart, checkout) GraphQL APIs. Generic only — no merchant-specific
|
|
98
99
|
business logic. Plain Net::HTTP, no shopify_api runtime dependency.
|
|
100
|
+
email:
|
|
99
101
|
executables:
|
|
100
102
|
- portage-ucp-shopify
|
|
101
103
|
extensions: []
|
|
@@ -121,6 +123,7 @@ metadata:
|
|
|
121
123
|
source_code_uri: https://github.com/tomtom87/Portage/tree/main/portage-ucp-shopify
|
|
122
124
|
changelog_uri: https://github.com/tomtom87/Portage/blob/main/portage-ucp-shopify/CHANGELOG.md
|
|
123
125
|
rubygems_mfa_required: 'true'
|
|
126
|
+
post_install_message:
|
|
124
127
|
rdoc_options: []
|
|
125
128
|
require_paths:
|
|
126
129
|
- lib
|
|
@@ -135,7 +138,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
135
138
|
- !ruby/object:Gem::Version
|
|
136
139
|
version: '0'
|
|
137
140
|
requirements: []
|
|
138
|
-
rubygems_version: 3.
|
|
141
|
+
rubygems_version: 3.5.22
|
|
142
|
+
signing_key:
|
|
139
143
|
specification_version: 4
|
|
140
144
|
summary: Shopify adapter for portage-ucp — standard catalog/cart/checkout/order over
|
|
141
145
|
MCP and UCP
|