e_plat 1.1.2 → 1.2.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 +3 -3
- data/lib/e_plat/mapping/shopify/v_2025_10/metafield.rb +26 -0
- data/lib/e_plat/mapping/shopify/v_2025_10/order/billing_address.rb +14 -0
- data/lib/e_plat/mapping/shopify/v_2025_10/order/shipping_address.rb +30 -0
- data/lib/e_plat/mapping/shopify/v_2025_10/order.rb +26 -0
- data/lib/e_plat/mapping/shopify/v_2025_10/product/image.rb +52 -0
- data/lib/e_plat/mapping/shopify/v_2025_10/product/option.rb +45 -0
- data/lib/e_plat/mapping/shopify/v_2025_10/product/variant/option_value.rb +58 -0
- data/lib/e_plat/mapping/shopify/v_2025_10/product/variant.rb +182 -0
- data/lib/e_plat/mapping/shopify/v_2025_10/product.rb +100 -0
- data/lib/e_plat/mapping/shopify/v_2025_10/script_tag.rb +26 -0
- data/lib/e_plat/mapping/shopify/v_2025_10/shop.rb +26 -0
- data/lib/e_plat/mapping/shopify/v_2025_10/webhook.rb +29 -0
- data/lib/e_plat/mapping/woocommerce/v_3/product/variant.rb +0 -7
- data/lib/e_plat/resource/countable.rb +1 -1
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_10/input/product/variant.rb +87 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_10/input/product/variants_bulk.rb +58 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_10/input/product.rb +36 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_10/input.rb +133 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_10/mutation/product/variant.rb +86 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_10/mutation/product.rb +55 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_10/mutation.rb +5 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_10/query/product/variant.rb +44 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_10/query/product.rb +58 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_10/query.rb +5 -0
- data/lib/e_plat/resource/platform_specific/shopify/metafield.rb +3 -1
- data/lib/e_plat/resource/platform_specific/shopify/product/variant.rb +0 -1
- data/lib/e_plat/resource/product/variant.rb +0 -1
- data/lib/e_plat/version.rb +1 -1
- data/lib/e_plat.rb +2 -2
- metadata +24 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '00444097bf58036794578e3a6764eb36c94e3a67e8bad39518ffa0730b9785cd'
|
|
4
|
+
data.tar.gz: 31c18e7ac398c4467fa628fca7d2f804f818ebdb459bf6a4be26b5f75ab553aa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6558b4247f422366911903821e350a2e9c7b1612358f61a34e39603e60a6343bbfae5d97d65fcb2212c561a2c665fbf64f8764bcc55c88650c10fd19f6ab76fb
|
|
7
|
+
data.tar.gz: 1a81d8e69249c0d2fcf2edbad8bff4b1b0c49236ae11b114f9c5e14632a4b26757f9f8174bcb016ba4ebe46be4fafd254680a1977100b0cf0386fa43dee86211
|
data/README.md
CHANGED
|
@@ -48,7 +48,7 @@ To your gemfile and then run
|
|
|
48
48
|
You can configure which platform APIs are used by updating the EPlat config: <br/>
|
|
49
49
|
```ruby
|
|
50
50
|
#initializers/e_plat.rb
|
|
51
|
-
EPlat.config.shopify_api_version = "
|
|
51
|
+
EPlat.config.shopify_api_version = "2025-10"
|
|
52
52
|
EPlat.config.bigcommerce_api_version = "v3"
|
|
53
53
|
EPlat.config.woocommerce_api_version = "v3"
|
|
54
54
|
|
|
@@ -313,7 +313,6 @@ EPlat is designed to let you mostly use it's universal interface, but then easil
|
|
|
313
313
|
| weight_unit | string | node.inventoryItem[measurement][weight][unit] | nil | nil |
|
|
314
314
|
| inventory_item_id | integer | node.inventoryItem[id] | nil | nil |
|
|
315
315
|
| inventory_quantity | integer | node.inventoryQuantity | inventory_level | stock_quantity |
|
|
316
|
-
| tax_code | string | * | nil | tax_class |
|
|
317
316
|
| requires_shipping | boolean | InventoryItem[requiresShipping] | nil | !virtual |
|
|
318
317
|
| option_values | array | * | * | *generated |
|
|
319
318
|
|
|
@@ -573,7 +572,8 @@ helper methods: <br>
|
|
|
573
572
|
| value | string | * | value | value |
|
|
574
573
|
| type | string | * | nil | nil |
|
|
575
574
|
|
|
576
|
-
*
|
|
575
|
+
* Bigcommerce always assumes a type of String and a native attribute permission_set of "read_and_sf_access"
|
|
576
|
+
** Shopify metafield.description is read only.
|
|
577
577
|
|
|
578
578
|
</details>
|
|
579
579
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module EPlat
|
|
2
|
+
class Mapping
|
|
3
|
+
module Shopify
|
|
4
|
+
module V202510 #< :module
|
|
5
|
+
class Metafield < EPlat::Mapping::Base
|
|
6
|
+
|
|
7
|
+
def native_top_key
|
|
8
|
+
"metafield"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def native_attributes
|
|
12
|
+
super.concat([
|
|
13
|
+
])
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def native_attribute_aliases
|
|
17
|
+
super.concat([
|
|
18
|
+
])
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
module EPlat
|
|
4
|
+
class Mapping
|
|
5
|
+
module Shopify
|
|
6
|
+
module V202510
|
|
7
|
+
class Order
|
|
8
|
+
class ShippingAddress < EPlat::Mapping::Base
|
|
9
|
+
|
|
10
|
+
def native_top_key
|
|
11
|
+
:itself
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def native_attributes
|
|
15
|
+
super.concat([
|
|
16
|
+
])
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def native_attribute_aliases
|
|
20
|
+
super.concat([
|
|
21
|
+
])
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module EPlat
|
|
2
|
+
class Mapping
|
|
3
|
+
module Shopify
|
|
4
|
+
module V202510 #< :module
|
|
5
|
+
class Order < EPlat::Mapping::Base
|
|
6
|
+
|
|
7
|
+
def native_top_key
|
|
8
|
+
"order"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def native_attributes
|
|
12
|
+
super.concat([
|
|
13
|
+
])
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def native_attribute_aliases
|
|
17
|
+
super.concat([
|
|
18
|
+
])
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
module EPlat
|
|
4
|
+
class Mapping
|
|
5
|
+
module Shopify
|
|
6
|
+
module V202510
|
|
7
|
+
class Product
|
|
8
|
+
class Image < EPlat::Mapping::Base
|
|
9
|
+
|
|
10
|
+
def native_top_key
|
|
11
|
+
:itself
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def native_attributes
|
|
15
|
+
super.concat([
|
|
16
|
+
"id",
|
|
17
|
+
"alt_text", #would be altText before and after EPlat processes it
|
|
18
|
+
"width",
|
|
19
|
+
"height",
|
|
20
|
+
"url"
|
|
21
|
+
])
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def native_attribute_aliases
|
|
25
|
+
super.concat([
|
|
26
|
+
{
|
|
27
|
+
existing_entry: {native_key: "id", e_plat_key: "id",
|
|
28
|
+
custom_e_plat_getter: '-> { _1.try(:split, "/")&.last || _1 }',
|
|
29
|
+
custom_native_setter: '-> { "gid://shopify/ProductImage/#{_1}" }'
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
alias_attribute: {native_key: "alt_text", e_plat_key: "alt"}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
existing_entry: {native_key: "width", e_plat_key: "width"}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
existing_entry: {native_key: "height", e_plat_key: "height"}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
alias_attribute: {native_key: "url", e_plat_key: "src"}
|
|
43
|
+
}
|
|
44
|
+
])
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
module EPlat
|
|
4
|
+
class Mapping
|
|
5
|
+
module Shopify
|
|
6
|
+
module V202510
|
|
7
|
+
class Product
|
|
8
|
+
class Option < EPlat::Mapping::Base
|
|
9
|
+
include_root_in_request_body true
|
|
10
|
+
|
|
11
|
+
def native_top_key
|
|
12
|
+
:itself
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def native_attributes
|
|
16
|
+
super
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def native_attribute_aliases
|
|
20
|
+
super.concat([
|
|
21
|
+
|
|
22
|
+
{
|
|
23
|
+
existing_entry: {native_key: "id", e_plat_key: "id",
|
|
24
|
+
custom_e_plat_getter: '-> { _1&.split("/")&.last }',
|
|
25
|
+
custom_native_setter: '-> { "gid://shopify/ProductOption/#{_1}" }'
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
existing_entry: {native_key: "name", e_plat_key: "name"}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
existing_entry: {native_key: "position", e_plat_key: "position"}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
existing_entry: {native_key: "values", e_plat_key: "values"}
|
|
36
|
+
}
|
|
37
|
+
])
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
module EPlat
|
|
4
|
+
class Mapping
|
|
5
|
+
module Shopify
|
|
6
|
+
module V202510
|
|
7
|
+
class Product::Variant
|
|
8
|
+
class OptionValue < EPlat::Mapping::Base
|
|
9
|
+
include_root_in_request_body true
|
|
10
|
+
|
|
11
|
+
def native_top_key
|
|
12
|
+
:itself
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def native_attributes
|
|
16
|
+
super.concat([
|
|
17
|
+
])
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def native_attribute_aliases
|
|
22
|
+
super.concat([
|
|
23
|
+
# see virtual_collection @ EPlat::Mapping::VirtualCollection::Shopify::Product::Variant::OptionValue
|
|
24
|
+
])
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
# bigcommerce
|
|
36
|
+
# option_values => [{
|
|
37
|
+
# "id": 174,
|
|
38
|
+
# "label": "Beige",
|
|
39
|
+
# "option_id": 220,
|
|
40
|
+
# "option_display_name": "Color"
|
|
41
|
+
# }]
|
|
42
|
+
|
|
43
|
+
# shopify
|
|
44
|
+
# selected_options => [{
|
|
45
|
+
# "name"=>"Size",
|
|
46
|
+
# "value"=>"green",
|
|
47
|
+
# "option_value" => {
|
|
48
|
+
# "id"=>"gid://shopify/ProductOptionValue/657155129475",
|
|
49
|
+
# "name"=>"green"
|
|
50
|
+
# }
|
|
51
|
+
# }]
|
|
52
|
+
|
|
53
|
+
# target e_plat schema
|
|
54
|
+
# option_values => [{
|
|
55
|
+
# "id": 174,
|
|
56
|
+
# "name": "Color",
|
|
57
|
+
# "value": "Beige",
|
|
58
|
+
# }]
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
module EPlat
|
|
4
|
+
class Mapping
|
|
5
|
+
module Shopify
|
|
6
|
+
module V202510
|
|
7
|
+
class Product
|
|
8
|
+
class Variant < EPlat::Mapping::Base
|
|
9
|
+
include_root_in_request_body true
|
|
10
|
+
virtual_collection :option_values, class: EPlat::Mapping::VirtualCollection::Shopify::Product::Variant::OptionValue, map_from: "selected_options"
|
|
11
|
+
|
|
12
|
+
def native_top_key
|
|
13
|
+
:itself
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def native_attributes
|
|
17
|
+
super
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def native_attribute_aliases
|
|
21
|
+
super.concat([
|
|
22
|
+
{
|
|
23
|
+
existing_entry: {native_key: "id", e_plat_key: "id",
|
|
24
|
+
custom_e_plat_getter: '-> { (_1.is_a? Integer) ? _1 : _1&.split("/")&.last }',
|
|
25
|
+
custom_native_setter: '-> { (_1.is_a? String) ? _1 : "gid://shopify/ProductVariant/#{_1}" }'
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
existing_entry: {native_key: "product_id", e_plat_key: "product_id",
|
|
30
|
+
custom_e_plat_getter: '-> { (_1.is_a? Integer) ? _1 : _1&.split("/")&.last }',
|
|
31
|
+
custom_native_setter: '-> { (_1.is_a? String) ? _1 : "gid://shopify/Product/#{_1}" }'
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
existing_entry: {native_key: "title", e_plat_key: "title"}
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
existing_entry: {native_key: "price", e_plat_key: "price"}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
existing_entry: {native_key: "sku", e_plat_key: "sku",
|
|
42
|
+
custom_e_plat_getter: '-> { _1 }',
|
|
43
|
+
custom_native_setter: '-> do
|
|
44
|
+
inventory_item.sku = _1;
|
|
45
|
+
inventory_item.attribute_will_change!("sku");
|
|
46
|
+
_1
|
|
47
|
+
end'
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
existing_entry: {native_key: "position", e_plat_key: "position"}
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
existing_entry: {native_key: "inventory_policy", e_plat_key: "inventory_policy",
|
|
55
|
+
custom_e_plat_getter: '-> { _1&.downcase }',
|
|
56
|
+
custom_native_setter: '-> { _1&.upcase }'
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
existing_entry: {native_key: "compare_at_price", e_plat_key: "compare_at_price"}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
alias_attribute: {native_key: "inventory_item[tracked]", e_plat_key: "inventory_management"}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
|
|
67
|
+
existing_entry: {native_key: "created_at", e_plat_key: "created_at"}
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
existing_entry: {native_key: "updated_at", e_plat_key: "updated_at"}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
existing_entry: {native_key: "taxable", e_plat_key: "taxable"}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
existing_entry: {native_key: "barcode", e_plat_key: "barcode"}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
alias_attribute: {native_key: "inventory_item[measurement][weight][unit]", e_plat_key: "weight_unit",
|
|
80
|
+
custom_native_setter: '-> { warn("Setting weight_unit directly is not supported on ProductVariant via GraphQL."); _1 }'
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
alias_attribute: {native_key: "inventory_item[measurement][weight][value]", e_plat_key: "weight",
|
|
85
|
+
custom_native_setter: '-> { warn("Setting weight directly is not supported on ProductVariant via GraphQL."); _1 }'
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
alias_attribute: {native_key: "inventory_item[id]", e_plat_key: "inventory_item_id",
|
|
90
|
+
custom_e_plat_getter: '-> { _1&.split("/")&.last }',
|
|
91
|
+
custom_native_setter: '-> { "gid://shopify/InventoryItem/#{_1}" }'
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
existing_entry: {native_key: "inventory_quantity", e_plat_key: "inventory_quantity",
|
|
96
|
+
custom_native_setter: '-> { warn("Setting inventory_quantity directly is not supported on ProductVariant via GraphQL."); _1 }'
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
alias_attribute: {native_key: "inventory_item[requires_shipping]", e_plat_key: "requires_shipping",
|
|
101
|
+
custom_native_setter: '-> { warn("Setting requires_shipping directly is not supported on ProductVariant via GraphQL."); _1 }'
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
existing_entry: {native_key: "fulfillment_service", e_plat_key: "fulfillment_service"}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
existing_entry: {native_key: "grams", e_plat_key: "grams", # doesnt exist on any current API but we create it
|
|
109
|
+
custom_e_plat_getter: '-> {
|
|
110
|
+
_1
|
|
111
|
+
case weight_unit
|
|
112
|
+
when "GRAMS", "grams", "g"
|
|
113
|
+
weight
|
|
114
|
+
when "KILOGRAMS", "kilograms", "kg"
|
|
115
|
+
weight * 1000
|
|
116
|
+
when "OUNCES", "ounces", "oz"
|
|
117
|
+
weight * 28.3495
|
|
118
|
+
when "POUNDS", "pounds", "lb"
|
|
119
|
+
weight * 453.592
|
|
120
|
+
else
|
|
121
|
+
weight
|
|
122
|
+
end
|
|
123
|
+
}',
|
|
124
|
+
custom_native_setter: '-> {
|
|
125
|
+
warn("Setting grams directly is not supported on ProductVariant via GraphQL. Mutate the inventoryItem.measurement.weight object `value` field instead")
|
|
126
|
+
case weight_unit
|
|
127
|
+
when "GRAMS", "grams", "g"
|
|
128
|
+
_1
|
|
129
|
+
when "KILOGRAMS", "kilograms", "kg"
|
|
130
|
+
_1 / 1000
|
|
131
|
+
when "OUNCES", "ounces", "oz"
|
|
132
|
+
_1 / 28.3495
|
|
133
|
+
when "POUNDS", "pounds", "lb"
|
|
134
|
+
_1 / 453.592
|
|
135
|
+
else
|
|
136
|
+
_1
|
|
137
|
+
end
|
|
138
|
+
}'
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
])
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# RESOURCE
|
|
153
|
+
# integer :id
|
|
154
|
+
# integer :product_id
|
|
155
|
+
# string :title
|
|
156
|
+
# string :price
|
|
157
|
+
# string :sku
|
|
158
|
+
# integer :position
|
|
159
|
+
# string :inventory_policy
|
|
160
|
+
# string :compare_at_price
|
|
161
|
+
# string :fulfillment_service
|
|
162
|
+
# string :inventory_management
|
|
163
|
+
# datetime :created_at
|
|
164
|
+
# datetime :updated_at
|
|
165
|
+
# boolean :taxable
|
|
166
|
+
# string :barcode
|
|
167
|
+
# integer :grams
|
|
168
|
+
# integer :image_id
|
|
169
|
+
# float :weight
|
|
170
|
+
# string :weight_unit
|
|
171
|
+
# integer :inventory_item_id
|
|
172
|
+
# integer :inventory_quantity
|
|
173
|
+
# boolean :requires_shipping
|
|
174
|
+
# string :admin_graphql_api_id
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
# fields without setter support
|
|
178
|
+
# | grams | integer | getter only: converted node.inventoryItem[measurement][weight][value] | nil | nil |
|
|
179
|
+
# | weight | float | getter only: node.inventoryItem[measurement][weight][value] | weight |
|
|
180
|
+
# | weight_unit | string | getter only: node.inventoryItem[measurement][weight][unit] | nil |
|
|
181
|
+
# | inventory_item_id | integer | getter only: node.inventoryItem[id]| nil | nil |
|
|
182
|
+
# | inventory_quantity | integer | getter only: node.inventoryQuantity | inventory_level
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
module EPlat
|
|
2
|
+
class Mapping
|
|
3
|
+
module Shopify
|
|
4
|
+
module V202510 #< :module
|
|
5
|
+
class Product < EPlat::Mapping::Base
|
|
6
|
+
|
|
7
|
+
def native_top_key
|
|
8
|
+
"product"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def native_attributes
|
|
12
|
+
super.concat([
|
|
13
|
+
"id",
|
|
14
|
+
"descriptionHtml",
|
|
15
|
+
"createdAt",
|
|
16
|
+
"updatedAt",
|
|
17
|
+
"handle",
|
|
18
|
+
"productType",
|
|
19
|
+
"publishedAt",
|
|
20
|
+
"publishedScope",
|
|
21
|
+
"status",
|
|
22
|
+
"tags",
|
|
23
|
+
"templateSuffix",
|
|
24
|
+
"title",
|
|
25
|
+
"vendor"
|
|
26
|
+
])
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def native_attribute_aliases
|
|
30
|
+
super.concat([
|
|
31
|
+
{
|
|
32
|
+
alias_attribute: {native_key: "description_html", e_plat_key: "body_html"}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
existing_entry: {native_key: "created_at", e_plat_key: "created_at"}
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
existing_entry: {native_key: "updated_at", e_plat_key: "updated_at"}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
existing_entry: {native_key: "handle", e_plat_key: "handle"}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
existing_entry: {native_key: "product_type", e_plat_key: "product_type"}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
existing_entry: {native_key: "published_at", e_plat_key: "published_at"}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
existing_entry: {native_key: "status", e_plat_key: "status",
|
|
51
|
+
custom_e_plat_getter: '-> { _1&.downcase }',
|
|
52
|
+
custom_native_setter: '-> { _1&.upcase }'
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
existing_entry: {native_key: "tags", e_plat_key: "tags",
|
|
57
|
+
custom_e_plat_getter: "-> { _1&.join(',') }",
|
|
58
|
+
custom_native_setter: "-> { _1&.split(',') }"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
existing_entry: {native_key: "id", e_plat_key: "id",
|
|
63
|
+
custom_e_plat_getter: '-> { (_1.is_a? Integer) ? _1 : _1&.split("/")&.last }',
|
|
64
|
+
custom_native_setter: '-> { (_1.is_a? String) ? _1 : "gid://shopify/Product/#{_1}" }'
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
existing_entry: {native_key: "template_suffix", e_plat_key: "template_suffix"}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
existing_entry: {native_key: "title", e_plat_key: "title"}
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
existing_entry: {native_key: "vendor", e_plat_key: "vendor"}
|
|
75
|
+
}
|
|
76
|
+
])
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
# string :body_html
|
|
86
|
+
# datetime :created_at
|
|
87
|
+
# string :handle
|
|
88
|
+
# integer :id
|
|
89
|
+
# array :images
|
|
90
|
+
# array :options
|
|
91
|
+
# string :product_type
|
|
92
|
+
# datetime :published_at
|
|
93
|
+
# string :status
|
|
94
|
+
# string :tags
|
|
95
|
+
# string :admin_graphql_api_id
|
|
96
|
+
# string :template_suffix
|
|
97
|
+
# string :title
|
|
98
|
+
# datetime :updated_at
|
|
99
|
+
# array :variants
|
|
100
|
+
# string :vendor
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module EPlat
|
|
2
|
+
class Mapping
|
|
3
|
+
module Shopify
|
|
4
|
+
module V202510 #< :module
|
|
5
|
+
class ScriptTag < EPlat::Mapping::Base
|
|
6
|
+
|
|
7
|
+
def native_top_key
|
|
8
|
+
"script_tag"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def native_attributes
|
|
12
|
+
super.concat([
|
|
13
|
+
])
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def native_attribute_aliases
|
|
17
|
+
super.concat([
|
|
18
|
+
])
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module EPlat
|
|
2
|
+
class Mapping
|
|
3
|
+
module Shopify
|
|
4
|
+
module V202510 #< :module
|
|
5
|
+
class Shop < EPlat::Mapping::Base
|
|
6
|
+
|
|
7
|
+
def native_top_key
|
|
8
|
+
"shop"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def native_attributes
|
|
12
|
+
super.concat([
|
|
13
|
+
])
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def native_attribute_aliases
|
|
17
|
+
super.concat([
|
|
18
|
+
])
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
module EPlat
|
|
2
|
+
class Mapping
|
|
3
|
+
module Shopify
|
|
4
|
+
module V202510 #< :module
|
|
5
|
+
class Webhook < EPlat::Mapping::Base
|
|
6
|
+
DEFAULT_VALUES = {
|
|
7
|
+
format: "json"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
def native_top_key
|
|
11
|
+
"webhook"
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def native_attributes
|
|
15
|
+
super.concat([
|
|
16
|
+
])
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def native_attribute_aliases
|
|
20
|
+
super.concat([
|
|
21
|
+
])
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
@@ -35,7 +35,6 @@ module EPlat
|
|
|
35
35
|
"download_limit",
|
|
36
36
|
"download_expiry",
|
|
37
37
|
"tax_status",
|
|
38
|
-
"tax_class",
|
|
39
38
|
"manage_stock",
|
|
40
39
|
"stock_quantity",
|
|
41
40
|
"stock_status",
|
|
@@ -152,12 +151,6 @@ module EPlat
|
|
|
152
151
|
}"
|
|
153
152
|
}
|
|
154
153
|
},
|
|
155
|
-
{
|
|
156
|
-
alias_attribute: {
|
|
157
|
-
native_key: "tax_class",
|
|
158
|
-
e_plat_key: "tax_code"
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
154
|
{
|
|
162
155
|
alias_attribute: {
|
|
163
156
|
native_key: "virtual",
|
|
@@ -62,7 +62,7 @@ module EPlat
|
|
|
62
62
|
|
|
63
63
|
def graphql_count
|
|
64
64
|
graphql_query = eval graphql_count_query
|
|
65
|
-
response = execute_graphql_request(graphql_query.call("limit: null"))
|
|
65
|
+
response = execute_graphql_request(graphql_query.call("limit: null")) #limit has to be null or present
|
|
66
66
|
|
|
67
67
|
if !response.is_a?(Hash)
|
|
68
68
|
raise EPlat::GraphqlError.new(response.first["message"])
|