e_plat 1.0.0.pre.rc.3 → 1.0.0.pre.rc.5
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 +23 -1
- data/lib/e_plat/mapping/shopify/v_2025_01/metafield.rb +26 -0
- data/lib/e_plat/mapping/shopify/v_2025_01/order/billing_address.rb +14 -0
- data/lib/e_plat/mapping/shopify/v_2025_01/order/shipping_address.rb +30 -0
- data/lib/e_plat/mapping/shopify/v_2025_01/order.rb +26 -0
- data/lib/e_plat/mapping/shopify/v_2025_01/product/image.rb +52 -0
- data/lib/e_plat/mapping/shopify/v_2025_01/product/option.rb +45 -0
- data/lib/e_plat/mapping/shopify/v_2025_01/product/variant/option_value.rb +58 -0
- data/lib/e_plat/mapping/shopify/v_2025_01/product/variant.rb +186 -0
- data/lib/e_plat/mapping/shopify/v_2025_01/product.rb +100 -0
- data/lib/e_plat/mapping/shopify/v_2025_01/script_tag.rb +26 -0
- data/lib/e_plat/mapping/shopify/v_2025_01/shop.rb +26 -0
- data/lib/e_plat/mapping/shopify/v_2025_01/webhook.rb +29 -0
- data/lib/e_plat/resource/base.rb +8 -3
- data/lib/e_plat/resource/concerns/graph_q_lable.rb +17 -11
- data/lib/e_plat/resource/concerns/overwrite_request_methods.rb +7 -1
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_01/input/product/variant.rb +90 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_01/input/product/variants_bulk.rb +60 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_01/input/product.rb +36 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_01/input.rb +133 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_01/mutation/product/variant.rb +86 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_01/mutation/product.rb +55 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_01/mutation.rb +5 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_01/query/product/variant.rb +44 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_01/query/product.rb +58 -0
- data/lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_01/query.rb +5 -0
- data/lib/e_plat/resource/platform_specific/shopify/product/variant.rb +3 -3
- data/lib/e_plat/resource/platform_specific/shopify/product.rb +1 -5
- data/lib/e_plat/resource/product/variant.rb +1 -1
- data/lib/e_plat/version.rb +1 -1
- data/lib/e_plat.rb +3 -4
- 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: 953c86fe923b6191dfe8d01e89d316601c31d5b55d50e356bb7b898bd0238a8f
|
4
|
+
data.tar.gz: f59b674ab4e8efad4e945d1fd2309b388c441f61202e07405afe26960cba05a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0965ed485b7a393c6a06981eaf1b943be3847721c0491678435db5aa859d97ef96f736d4d6424104c8b5dd1261acb37aa4815ec87a6c9a5f3b77170423913a8
|
7
|
+
data.tar.gz: 17094ac85530115a4a32ecee582d2a89fca6cb5ce65cae0ad94bb3bbbedab77a41defe45ede364d319f4b68890c78d3bbe5279058989c4481136f926a8d98445
|
data/README.md
CHANGED
@@ -50,7 +50,7 @@ EPlat.config.bigcommerce_api_version = "v3"
|
|
50
50
|
```
|
51
51
|
<br>
|
52
52
|
|
53
|
-
## Testing
|
53
|
+
## Testing and development
|
54
54
|
|
55
55
|
To run the test for the default versions of all supported platforms:
|
56
56
|
```
|
@@ -67,6 +67,28 @@ To print out Shopify GraphQL queries/mutations
|
|
67
67
|
EPLAT_PRINT_GRAPHQL_REQUESTS=true rails test
|
68
68
|
```
|
69
69
|
|
70
|
+
We have a guide on upgrading the gem to a new Shopify API version here: [UPGRADE_GUIDE.md](UPGRADE_GUIDE.md)
|
71
|
+
|
72
|
+
### In the console ###
|
73
|
+
You can run `rails c` then `Dotenv.load` to load the environment variables.
|
74
|
+
You can then add to your .env file and run the following to setup your session:
|
75
|
+
```
|
76
|
+
EPlat::Session.new(
|
77
|
+
platform: :shopify,
|
78
|
+
store_url: ENV["SHOPIFY_TEST_STORE_URL"],
|
79
|
+
api_token: ENV["SHOPIFY_TEST_API_KEY"]
|
80
|
+
)
|
81
|
+
|
82
|
+
# or...
|
83
|
+
|
84
|
+
EPlat::Session.new(
|
85
|
+
platform: :bigcommerce,
|
86
|
+
store_url: ENV["BIGCOMMERCE_TEST_STORE_URL"],
|
87
|
+
api_token: ENV["BIGCOMMERCE_TEST_API_KEY"],
|
88
|
+
store_hash: ENV["BIGCOMMERCE_TEST_STORE_HASH"]
|
89
|
+
)
|
90
|
+
```
|
91
|
+
|
70
92
|
<br>
|
71
93
|
|
72
94
|
## Releasing a new version
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module EPlat
|
2
|
+
class Mapping
|
3
|
+
module Shopify
|
4
|
+
module V202501 #< :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 V202501
|
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 V202501 #< :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 V202501
|
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 V202501
|
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 V202501
|
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,186 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
module EPlat
|
4
|
+
class Mapping
|
5
|
+
module Shopify
|
6
|
+
module V202501
|
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
|
+
existing_entry: {native_key: "tax_code", e_plat_key: "tax_code"}
|
101
|
+
},
|
102
|
+
{
|
103
|
+
alias_attribute: {native_key: "inventory_item[requires_shipping]", e_plat_key: "requires_shipping",
|
104
|
+
custom_native_setter: '-> { warn("Setting requires_shipping directly is not supported on ProductVariant via GraphQL."); _1 }'
|
105
|
+
}
|
106
|
+
},
|
107
|
+
{
|
108
|
+
existing_entry: {native_key: "fulfillment_service", e_plat_key: "fulfillment_service"}
|
109
|
+
},
|
110
|
+
{
|
111
|
+
existing_entry: {native_key: "grams", e_plat_key: "grams", # doesnt exist on any current API but we create it
|
112
|
+
custom_e_plat_getter: '-> {
|
113
|
+
_1
|
114
|
+
case weight_unit
|
115
|
+
when "GRAMS", "grams", "g"
|
116
|
+
weight
|
117
|
+
when "KILOGRAMS", "kilograms", "kg"
|
118
|
+
weight * 1000
|
119
|
+
when "OUNCES", "ounces", "oz"
|
120
|
+
weight * 28.3495
|
121
|
+
when "POUNDS", "pounds", "lb"
|
122
|
+
weight * 453.592
|
123
|
+
else
|
124
|
+
weight
|
125
|
+
end
|
126
|
+
}',
|
127
|
+
custom_native_setter: '-> {
|
128
|
+
warn("Setting grams directly is not supported on ProductVariant via GraphQL. Mutate the inventoryItem.measurement.weight object `value` field instead")
|
129
|
+
case weight_unit
|
130
|
+
when "GRAMS", "grams", "g"
|
131
|
+
_1
|
132
|
+
when "KILOGRAMS", "kilograms", "kg"
|
133
|
+
_1 / 1000
|
134
|
+
when "OUNCES", "ounces", "oz"
|
135
|
+
_1 / 28.3495
|
136
|
+
when "POUNDS", "pounds", "lb"
|
137
|
+
_1 / 453.592
|
138
|
+
else
|
139
|
+
_1
|
140
|
+
end
|
141
|
+
}'
|
142
|
+
}
|
143
|
+
}
|
144
|
+
|
145
|
+
])
|
146
|
+
end
|
147
|
+
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
# RESOURCE
|
156
|
+
# integer :id
|
157
|
+
# integer :product_id
|
158
|
+
# string :title
|
159
|
+
# string :price
|
160
|
+
# string :sku
|
161
|
+
# integer :position
|
162
|
+
# string :inventory_policy
|
163
|
+
# string :compare_at_price
|
164
|
+
# string :fulfillment_service
|
165
|
+
# string :inventory_management
|
166
|
+
# datetime :created_at
|
167
|
+
# datetime :updated_at
|
168
|
+
# boolean :taxable
|
169
|
+
# string :barcode
|
170
|
+
# integer :grams
|
171
|
+
# integer :image_id
|
172
|
+
# float :weight
|
173
|
+
# string :weight_unit
|
174
|
+
# integer :inventory_item_id
|
175
|
+
# integer :inventory_quantity
|
176
|
+
# string :tax_code
|
177
|
+
# boolean :requires_shipping
|
178
|
+
# string :admin_graphql_api_id
|
179
|
+
|
180
|
+
|
181
|
+
# fields without setter support
|
182
|
+
# | grams | integer | getter only: converted node.inventoryItem[measurement][weight][value] | nil | nil |
|
183
|
+
# | weight | float | getter only: node.inventoryItem[measurement][weight][value] | weight |
|
184
|
+
# | weight_unit | string | getter only: node.inventoryItem[measurement][weight][unit] | nil |
|
185
|
+
# | inventory_item_id | integer | getter only: node.inventoryItem[id]| nil | nil |
|
186
|
+
# | inventory_quantity | integer | getter only: node.inventoryQuantity | inventory_level
|
@@ -0,0 +1,100 @@
|
|
1
|
+
module EPlat
|
2
|
+
class Mapping
|
3
|
+
module Shopify
|
4
|
+
module V202501 #< :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 V202501 #< :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 V202501 #< :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 V202501 #< :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
|
+
|