dooca_commerce 1.0.2 → 1.0.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/lib/dooca_commerce.rb +109 -1
- data/lib/response_handler.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf1c826816b46f397e0b43fb5022589c99a321375c281d8bde9242404a12e108
|
4
|
+
data.tar.gz: 45f33a1578c46546b90d60b633ea0eade64419fb475e50a7b1c09109b71c57b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 702025e5c85b16a57c56a7daaaf72e3d377cbd982807170f51e92419408b2c2a173e589a40a1aef2052e06d634e7b8fd6494eb6956774b14466ddf71a6ce49d5
|
7
|
+
data.tar.gz: e1931a6d934435f63a7d0abb684a6dff6bab53c7b1b0dc19570e3fdbf6ff8848be7630544d1e6278089f52582def00188433bae8f6cbf701fc1777901b5dc0de
|
data/lib/dooca_commerce.rb
CHANGED
@@ -34,12 +34,120 @@ class DoocaCommerce
|
|
34
34
|
handler.new(response, single_from_list: true).parse!
|
35
35
|
end
|
36
36
|
|
37
|
-
def
|
37
|
+
def fetch_categories(query = {})
|
38
|
+
response = connection.get("/categories", query)
|
39
|
+
|
40
|
+
handler.new(response).parse!
|
41
|
+
end
|
42
|
+
|
43
|
+
def fetch_category(category_id:)
|
44
|
+
response = connection.get("/categories/#{category_id}")
|
45
|
+
|
46
|
+
handler.new(response).parse!
|
47
|
+
end
|
48
|
+
|
49
|
+
def fetch_colors(query = {})
|
50
|
+
response = connection.get("/colors", query)
|
51
|
+
|
52
|
+
handler.new(response).parse!
|
53
|
+
end
|
54
|
+
|
55
|
+
def fetch_brands(query = {})
|
56
|
+
response = connection.get("/brands", query)
|
57
|
+
|
58
|
+
handler.new(response).parse!
|
59
|
+
end
|
60
|
+
|
61
|
+
def fetch_attributes(query = {})
|
62
|
+
response = connection.get("/attributes", query)
|
63
|
+
|
64
|
+
handler.new(response).parse!
|
65
|
+
end
|
66
|
+
|
67
|
+
def create_product(body)
|
68
|
+
response = connection.post("/products", body.to_json)
|
69
|
+
|
70
|
+
handler.new(response).parse!
|
71
|
+
end
|
72
|
+
|
73
|
+
def update_product(product_id:, body:)
|
38
74
|
response = connection.put("/products/#{product_id}", body.to_json)
|
39
75
|
|
40
76
|
handler.new(response).parse!
|
41
77
|
end
|
42
78
|
|
79
|
+
def create_variation(body)
|
80
|
+
response = connection.post("/variations", body.to_json)
|
81
|
+
|
82
|
+
handler.new(response).parse!
|
83
|
+
end
|
84
|
+
|
85
|
+
def update_variation(variation_id:, body:)
|
86
|
+
response = connection.put("/variations/#{variation_id}", body.to_json)
|
87
|
+
|
88
|
+
handler.new(response).parse!
|
89
|
+
end
|
90
|
+
|
91
|
+
def create_category(body)
|
92
|
+
response = connection.post("/categories", body.to_json)
|
93
|
+
|
94
|
+
handler.new(response).parse!
|
95
|
+
end
|
96
|
+
|
97
|
+
def update_category(category_id:, body:)
|
98
|
+
response = connection.put("/categories/#{category_id}", body.to_json)
|
99
|
+
|
100
|
+
handler.new(response).parse!
|
101
|
+
end
|
102
|
+
|
103
|
+
def create_brand(body)
|
104
|
+
response = connection.post("/brands", body.to_json)
|
105
|
+
|
106
|
+
handler.new(response).parse!
|
107
|
+
end
|
108
|
+
|
109
|
+
def update_brand(brand_id:, body:)
|
110
|
+
response = connection.put("/brands/#{brand_id}", body.to_json)
|
111
|
+
|
112
|
+
handler.new(response).parse!
|
113
|
+
end
|
114
|
+
|
115
|
+
def create_color(body)
|
116
|
+
response = connection.post("/colors", body.to_json)
|
117
|
+
|
118
|
+
handler.new(response).parse!
|
119
|
+
end
|
120
|
+
|
121
|
+
def update_color(color_id:, body:)
|
122
|
+
response = connection.put("/colors/#{color_id}", body.to_json)
|
123
|
+
|
124
|
+
handler.new(response).parse!
|
125
|
+
end
|
126
|
+
|
127
|
+
def create_attribute(body)
|
128
|
+
response = connection.post("/attributes", body.to_json)
|
129
|
+
|
130
|
+
handler.new(response).parse!
|
131
|
+
end
|
132
|
+
|
133
|
+
def update_attribute(attribute_id:, body:)
|
134
|
+
response = connection.put("/attributes/#{attribute_id}", body.to_json)
|
135
|
+
|
136
|
+
handler.new(response).parse!
|
137
|
+
end
|
138
|
+
|
139
|
+
def create_attribute_value(body)
|
140
|
+
response = connection.post("/attributes/values", body.to_json)
|
141
|
+
|
142
|
+
handler.new(response).parse!
|
143
|
+
end
|
144
|
+
|
145
|
+
def update_attribute_value(attribute_value_id:, body:)
|
146
|
+
response = connection.put("/attributes/values/#{attribute_value_id}", body.to_json)
|
147
|
+
|
148
|
+
handler.new(response).parse!
|
149
|
+
end
|
150
|
+
|
43
151
|
private
|
44
152
|
|
45
153
|
URL = "https://api.dooca.store"
|
data/lib/response_handler.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dooca_commerce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luciano Cesar Cordeiro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|