e_plat 1.2.0 → 1.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/README.md +8 -8
- data/lib/e_plat/mapping/shopify/v_2026_04/metafield.rb +26 -0
- data/lib/e_plat/mapping/shopify/v_2026_04/order/billing_address.rb +14 -0
- data/lib/e_plat/mapping/shopify/v_2026_04/order/shipping_address.rb +30 -0
- data/lib/e_plat/mapping/shopify/v_2026_04/order.rb +26 -0
- data/lib/e_plat/mapping/shopify/v_2026_04/product/image.rb +52 -0
- data/lib/e_plat/mapping/shopify/v_2026_04/product/option.rb +45 -0
- data/lib/e_plat/mapping/shopify/v_2026_04/product/variant/option_value.rb +58 -0
- data/lib/e_plat/mapping/shopify/v_2026_04/product/variant.rb +182 -0
- data/lib/e_plat/mapping/shopify/v_2026_04/product.rb +100 -0
- data/lib/e_plat/mapping/shopify/v_2026_04/script_tag.rb +26 -0
- data/lib/e_plat/mapping/shopify/v_2026_04/shop.rb +26 -0
- data/lib/e_plat/mapping/shopify/v_2026_04/webhook.rb +29 -0
- data/lib/e_plat/resource/concerns/graph_q_lable.rb +15 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2026_04/input/product/variant.rb +87 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2026_04/input/product/variants_bulk.rb +58 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2026_04/input/product.rb +36 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2026_04/input.rb +133 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2026_04/mutation/product/variant.rb +86 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2026_04/mutation/product.rb +55 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2026_04/mutation.rb +5 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2026_04/query/product/variant.rb +44 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2026_04/query/product.rb +58 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2026_04/query.rb +5 -0
- data/lib/e_plat/version.rb +1 -1
- data/lib/e_plat.rb +58 -58
- metadata +25 -7
data/lib/e_plat.rb
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
require "e_plat/engine"
|
|
3
|
-
require "zeitwerk"
|
|
1
|
+
# frozen_string_literal: true
|
|
4
2
|
|
|
5
|
-
require
|
|
6
|
-
require
|
|
7
|
-
require
|
|
3
|
+
require 'e_plat/version'
|
|
4
|
+
require 'e_plat/engine'
|
|
5
|
+
require 'zeitwerk'
|
|
6
|
+
|
|
7
|
+
require 'active_support'
|
|
8
|
+
require 'activeresource'
|
|
9
|
+
require 'activeresource-response'
|
|
8
10
|
require 'dry-types'
|
|
9
11
|
require 'active_resource/connection_error'
|
|
10
|
-
require_relative
|
|
12
|
+
require_relative 'hash'
|
|
11
13
|
# require "e_plat/railtie" if defined?(Rails::Railtie)
|
|
12
14
|
|
|
13
15
|
Zeitwerk::Loader.for_gem(warn_on_extra_files: false)
|
|
@@ -16,66 +18,64 @@ loader.collapse("#{__dir__}/e_plat/resource") # So can call EPlat::Product
|
|
|
16
18
|
loader.collapse("#{__dir__}/e_plat/resource/shopify_only")
|
|
17
19
|
loader.collapse("#{__dir__}/e_plat/resource/platform_specific")
|
|
18
20
|
loader.collapse("#{__dir__}/e_plat/errors")
|
|
19
|
-
loader.setup
|
|
21
|
+
loader.setup
|
|
20
22
|
|
|
23
|
+
module EPlat
|
|
24
|
+
extend Dry::Configurable
|
|
25
|
+
SUPPORTED_SHOPIFY_API_VERSIONS = %w[2024_01 2024_07 2025_01 2025_10 2026_04].freeze
|
|
26
|
+
SUPPORTED_BIGCOMMERCE_API_VERSIONS = ['3'].freeze
|
|
27
|
+
SUPPORTED_WOOCOMMERCE_API_VERSIONS = ['3'].freeze
|
|
28
|
+
SUPPORTED_PLATFORMS = %w[shopify bigcommerce woocommerce].freeze
|
|
29
|
+
SUPPORTED_RESOURCES = [
|
|
30
|
+
'shop',
|
|
31
|
+
'product',
|
|
32
|
+
'product/variant',
|
|
33
|
+
'product/image',
|
|
34
|
+
'product/option',
|
|
35
|
+
'product/image',
|
|
36
|
+
'order',
|
|
37
|
+
'order/line_item',
|
|
38
|
+
'order/shipping_address',
|
|
39
|
+
'order/billing_address',
|
|
40
|
+
'script_tag',
|
|
41
|
+
'webhook',
|
|
42
|
+
'metafield'
|
|
43
|
+
].freeze
|
|
44
|
+
PROTECTED_PREFIX = '_protected_'
|
|
21
45
|
|
|
46
|
+
setting(:shopify_api_version, default: ENV['EPLAT_SHOPIFY_API_VERSION'] || '2026_04', constructor: lambda do |value|
|
|
47
|
+
SUPPORTED_SHOPIFY_API_VERSIONS.include?(value.underscore) ? value.underscore : raise(ArgumentError, "Shopify API version #{value} is not supported")
|
|
48
|
+
end)
|
|
22
49
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
SUPPORTED_WOOCOMMERCE_API_VERSIONS = ['3']
|
|
28
|
-
SUPPORTED_PLATFORMS = ["shopify", "bigcommerce", "woocommerce"]
|
|
29
|
-
SUPPORTED_RESOURCES = [
|
|
30
|
-
"shop",
|
|
31
|
-
"product",
|
|
32
|
-
"product/variant",
|
|
33
|
-
"product/image",
|
|
34
|
-
"product/option",
|
|
35
|
-
"product/image",
|
|
36
|
-
"order",
|
|
37
|
-
"order/line_item",
|
|
38
|
-
"order/shipping_address",
|
|
39
|
-
"order/billing_address",
|
|
40
|
-
"script_tag",
|
|
41
|
-
"webhook",
|
|
42
|
-
"metafield"
|
|
43
|
-
]
|
|
44
|
-
PROTECTED_PREFIX = "_protected_"
|
|
45
|
-
|
|
46
|
-
setting(:shopify_api_version, default: ENV['EPLAT_SHOPIFY_API_VERSION'] || "2025_10", constructor: ->(value) do
|
|
47
|
-
SUPPORTED_SHOPIFY_API_VERSIONS.include?(value.underscore) ? value.underscore : raise(ArgumentError, "Shopify API version #{value} is not supported")
|
|
48
|
-
end)
|
|
50
|
+
setting(:bigcommerce_api_version, default: ENV['EPLAT_BIGCOMMERCE_API_VERSION'] || 'v3', constructor: lambda do |value|
|
|
51
|
+
v = value.downcase.gsub('v', '')
|
|
52
|
+
SUPPORTED_BIGCOMMERCE_API_VERSIONS.include?(v) ? v : raise(ArgumentError, "Bigcommerce API version #{value} is not supported")
|
|
53
|
+
end)
|
|
49
54
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
setting(:woocommerce_api_version, default: ENV['EPLAT_WOOCOMMERCE_API_VERSION'] || "v3", constructor: ->(value) do
|
|
56
|
-
v = value.downcase.gsub("v", "")
|
|
57
|
-
SUPPORTED_WOOCOMMERCE_API_VERSIONS.include?(v) ? v : raise(ArgumentError, "WooCommerce API version #{value} is not supported")
|
|
58
|
-
end)
|
|
55
|
+
setting(:woocommerce_api_version, default: ENV['EPLAT_WOOCOMMERCE_API_VERSION'] || 'v3', constructor: lambda do |value|
|
|
56
|
+
v = value.downcase.gsub('v', '')
|
|
57
|
+
SUPPORTED_WOOCOMMERCE_API_VERSIONS.include?(v) ? v : raise(ArgumentError, "WooCommerce API version #{value} is not supported")
|
|
58
|
+
end)
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
setting(:print_graphql_requests, default: ENV['EPLAT_PRINT_GRAPHQL_REQUESTS'] || false)
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
setting(:mute_woocommerce_variant_warnings, default: ENV['EPLAT_MUTE_WOOCOMMERCE_VARIANT_WARNINGS'] || false)
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
64
|
+
def self.api_display_name
|
|
65
|
+
apis = Struct.new(:shopify, :bigcommerce, :woocommerce)
|
|
66
|
+
apis.new(
|
|
67
|
+
shopify: config.shopify_api_version&.dasherize, # "2024-01"
|
|
68
|
+
bigcommerce: "v#{config.bigcommerce_api_version}", # "v3"
|
|
69
|
+
woocommerce: "v#{config.woocommerce_api_version}" # "v3"
|
|
70
|
+
)
|
|
71
|
+
end
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
def self.shopify_graphql_version
|
|
74
|
+
"V#{EPlat.config.shopify_api_version.gsub('_', '')}"
|
|
75
|
+
end
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
class Error < StandardError; end
|
|
78
|
+
class GraphqlError < Error; end
|
|
79
79
|
end
|
|
80
80
|
|
|
81
81
|
EPlat::Initializer.check_required_classes!
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: e_plat
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- oliwoodsuk
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: bundler
|
|
@@ -224,7 +223,6 @@ dependencies:
|
|
|
224
223
|
- - ">="
|
|
225
224
|
- !ruby/object:Gem::Version
|
|
226
225
|
version: '2'
|
|
227
|
-
description:
|
|
228
226
|
email:
|
|
229
227
|
- 55204545+oliwoodsuk@users.noreply.github.com
|
|
230
228
|
executables: []
|
|
@@ -312,6 +310,18 @@ files:
|
|
|
312
310
|
- lib/e_plat/mapping/shopify/v_2025_10/script_tag.rb
|
|
313
311
|
- lib/e_plat/mapping/shopify/v_2025_10/shop.rb
|
|
314
312
|
- lib/e_plat/mapping/shopify/v_2025_10/webhook.rb
|
|
313
|
+
- lib/e_plat/mapping/shopify/v_2026_04/metafield.rb
|
|
314
|
+
- lib/e_plat/mapping/shopify/v_2026_04/order.rb
|
|
315
|
+
- lib/e_plat/mapping/shopify/v_2026_04/order/billing_address.rb
|
|
316
|
+
- lib/e_plat/mapping/shopify/v_2026_04/order/shipping_address.rb
|
|
317
|
+
- lib/e_plat/mapping/shopify/v_2026_04/product.rb
|
|
318
|
+
- lib/e_plat/mapping/shopify/v_2026_04/product/image.rb
|
|
319
|
+
- lib/e_plat/mapping/shopify/v_2026_04/product/option.rb
|
|
320
|
+
- lib/e_plat/mapping/shopify/v_2026_04/product/variant.rb
|
|
321
|
+
- lib/e_plat/mapping/shopify/v_2026_04/product/variant/option_value.rb
|
|
322
|
+
- lib/e_plat/mapping/shopify/v_2026_04/script_tag.rb
|
|
323
|
+
- lib/e_plat/mapping/shopify/v_2026_04/shop.rb
|
|
324
|
+
- lib/e_plat/mapping/shopify/v_2026_04/webhook.rb
|
|
315
325
|
- lib/e_plat/mapping/virtual_collection/base.rb
|
|
316
326
|
- lib/e_plat/mapping/virtual_collection/bigcommerce/order_line_items.rb
|
|
317
327
|
- lib/e_plat/mapping/virtual_collection/shopify/product/variant/option_value.rb
|
|
@@ -397,6 +407,16 @@ files:
|
|
|
397
407
|
- lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_10/query.rb
|
|
398
408
|
- lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_10/query/product.rb
|
|
399
409
|
- lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_10/query/product/variant.rb
|
|
410
|
+
- lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2026_04/input.rb
|
|
411
|
+
- lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2026_04/input/product.rb
|
|
412
|
+
- lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2026_04/input/product/variant.rb
|
|
413
|
+
- lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2026_04/input/product/variants_bulk.rb
|
|
414
|
+
- lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2026_04/mutation.rb
|
|
415
|
+
- lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2026_04/mutation/product.rb
|
|
416
|
+
- lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2026_04/mutation/product/variant.rb
|
|
417
|
+
- lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2026_04/query.rb
|
|
418
|
+
- lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2026_04/query/product.rb
|
|
419
|
+
- lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2026_04/query/product/variant.rb
|
|
400
420
|
- lib/e_plat/resource/platform_specific/shopify/metafield.rb
|
|
401
421
|
- lib/e_plat/resource/platform_specific/shopify/order.rb
|
|
402
422
|
- lib/e_plat/resource/platform_specific/shopify/order/Consignment.rb
|
|
@@ -469,7 +489,6 @@ licenses:
|
|
|
469
489
|
- MIT
|
|
470
490
|
metadata:
|
|
471
491
|
homepage_uri: https://rubygems.org/gems/e_plat
|
|
472
|
-
post_install_message:
|
|
473
492
|
rdoc_options: []
|
|
474
493
|
require_paths:
|
|
475
494
|
- lib
|
|
@@ -484,8 +503,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
484
503
|
- !ruby/object:Gem::Version
|
|
485
504
|
version: '0'
|
|
486
505
|
requirements: []
|
|
487
|
-
rubygems_version:
|
|
488
|
-
signing_key:
|
|
506
|
+
rubygems_version: 4.0.10
|
|
489
507
|
specification_version: 4
|
|
490
508
|
summary: Creates a single interface for integrating with ecommerce platform APIs.
|
|
491
509
|
test_files: []
|