spree-api-client 0.0.1 → 0.2.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 +7 -0
- data/CHANGELOG.md +9 -0
- data/LICENSE.txt +674 -0
- data/README.md +31 -38
- data/lib/spree_client.rb +3 -0
- data/lib/spree_client.rb~ +71 -0
- data/lib/spree_client/api.rb +1 -0
- data/lib/spree_client/api/v1.rb +53 -0
- data/lib/spree_client/api/v1/products.rb +23 -0
- data/lib/spree_client/api/v1/properties.rb +12 -0
- data/lib/spree_client/api/v1/resources.rb +142 -0
- data/lib/spree_client/api/v1/stock_items.rb +27 -0
- data/lib/spree_client/api/v1/stock_locations.rb +33 -0
- data/lib/spree_client/api/v1/stock_movements.rb +16 -0
- data/lib/spree_client/api/v1/taxonomies.rb +12 -0
- data/lib/spree_client/api/v1/variants.rb +13 -0
- data/lib/spree_client/attributes.rb +27 -0
- data/lib/spree_client/models.rb +5 -0
- data/lib/spree_client/models/product.rb +7 -0
- data/lib/spree_client/models/property.rb +6 -0
- data/lib/spree_client/models/stock_item.rb +7 -0
- data/lib/spree_client/models/stock_location.rb +7 -0
- data/lib/spree_client/models/stock_movement.rb +7 -0
- data/lib/spree_client/models/store.rb +7 -0
- data/lib/spree_client/models/taxonomy.rb +5 -0
- data/lib/spree_client/models/variant.rb +7 -0
- metadata +79 -118
- data/.gitignore +0 -17
- data/.travis.yml +0 -9
- data/CONTRIBUTING.md +0 -8
- data/Gemfile +0 -3
- data/LICENSE +0 -22
- data/Rakefile +0 -7
- data/lib/spree-api-client.rb +0 -49
- data/lib/spree-api-client/addresses.rb +0 -15
- data/lib/spree-api-client/connection.rb +0 -30
- data/lib/spree-api-client/countries.rb +0 -15
- data/lib/spree-api-client/line_items.rb +0 -19
- data/lib/spree-api-client/orders.rb +0 -31
- data/lib/spree-api-client/payments.rb +0 -43
- data/lib/spree-api-client/products.rb +0 -31
- data/lib/spree-api-client/properties.rb +0 -31
- data/lib/spree-api-client/request.rb +0 -49
- data/lib/spree-api-client/return_authorizations.rb +0 -31
- data/lib/spree-api-client/shipments.rb +0 -15
- data/lib/spree-api-client/taxonomies.rb +0 -31
- data/lib/spree-api-client/taxons.rb +0 -27
- data/lib/spree-api-client/variants.rb +0 -31
- data/lib/spree-api-client/version.rb +0 -7
- data/lib/spree-api-client/zones.rb +0 -31
- data/spec/addresses_spec.rb +0 -11
- data/spec/client_spec.rb +0 -31
- data/spec/countries_spec.rb +0 -11
- data/spec/orders_spec.rb +0 -11
- data/spec/payments_spec.rb +0 -11
- data/spec/products_spec.rb +0 -11
- data/spec/properties_spec.rb +0 -11
- data/spec/return_authorizations_spec.rb +0 -11
- data/spec/shipments_spec.rb +0 -11
- data/spec/spec_helper.rb +0 -5
- data/spec/taxonomies_spec.rb +0 -11
- data/spec/taxons_spec.rb +0 -11
- data/spec/variants_spec.rb +0 -11
- data/spec/zones_spec.rb +0 -11
- data/spree-api-client.gemspec +0 -27
@@ -0,0 +1,16 @@
|
|
1
|
+
module SpreeClient
|
2
|
+
module API
|
3
|
+
class V1
|
4
|
+
# Stock Movements
|
5
|
+
# @see SpreeClient::API:V1::Resources
|
6
|
+
class StockMovements < Resources
|
7
|
+
ENDPOINT = '/api/v1/stock_locations/:stock_location_id/stock_movements'
|
8
|
+
RESOURCE = SpreeClient::Models::StockMovement
|
9
|
+
NAME = 'stock_movement'
|
10
|
+
|
11
|
+
def update(_); end
|
12
|
+
def destroy(_); end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module SpreeClient
|
2
|
+
# @see Spree::PermittedAttributes
|
3
|
+
class Attributes
|
4
|
+
PRODUCT = %i[id name description available_on discontinue_on
|
5
|
+
permalink meta_description meta_keywords meta_title
|
6
|
+
price sku deleted_at prototype_id option_values_hash
|
7
|
+
weight height width depth shipping_category_id
|
8
|
+
tax_category_id cost_currency cost_price
|
9
|
+
option_type_ids taxon_ids pay_what_you_can].freeze
|
10
|
+
|
11
|
+
VARIANT = %i[id name presentation cost_price discontinue_on
|
12
|
+
lock_version position track_inventory product_id
|
13
|
+
product option_values_attributes price weight height
|
14
|
+
width depth sku cost_currency options
|
15
|
+
option_value_ids].freeze
|
16
|
+
|
17
|
+
STOCK_LOCATION = %i[name active address1 address2 city zipcode
|
18
|
+
backorderable_default state_name state_id
|
19
|
+
country_id phone propagate_all_variants].freeze
|
20
|
+
|
21
|
+
STOCK_ITEM = %i[stock_location_id variant stock_location backorderable variant_id].freeze
|
22
|
+
|
23
|
+
STOCK_MOVEMENT = %i[id stock_location_id quantity stock_item
|
24
|
+
stock_item_id originator action].freeze
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Stores are different frontends for the same backend.
|
2
|
+
#
|
3
|
+
# @see {https://guides.spreecommerce.org/user/configuration/configuring_multi_stores.html}
|
4
|
+
Store = Struct.new :id, :name, :url,
|
5
|
+
:seo_title, :meta_description, :meta_keywords,
|
6
|
+
:mail_from_address, :default_currency,
|
7
|
+
:facebook, :twitter, :instagram, keyword_init: true
|
metadata
CHANGED
@@ -1,164 +1,125 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree-api-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
|
-
-
|
9
|
-
autorequire:
|
7
|
+
- f
|
8
|
+
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2021-07-29 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
16
|
-
requirement:
|
17
|
-
none: false
|
14
|
+
name: httparty
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
19
|
+
version: 0.18.0
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
|
-
version_requirements:
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: faraday_middleware
|
27
|
-
requirement: &70322126263240 !ruby/object:Gem::Requirement
|
28
|
-
none: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
29
23
|
requirements:
|
30
|
-
- - ~>
|
24
|
+
- - "~>"
|
31
25
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
33
|
-
type: :runtime
|
34
|
-
prerelease: false
|
35
|
-
version_requirements: *70322126263240
|
26
|
+
version: 0.18.0
|
36
27
|
- !ruby/object:Gem::Dependency
|
37
|
-
name:
|
38
|
-
requirement:
|
39
|
-
none: false
|
28
|
+
name: fast_blank
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
40
30
|
requirements:
|
41
|
-
- - ~>
|
31
|
+
- - "~>"
|
42
32
|
- !ruby/object:Gem::Version
|
43
|
-
version: '1
|
33
|
+
version: '1'
|
44
34
|
type: :runtime
|
45
35
|
prerelease: false
|
46
|
-
version_requirements:
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: multi_json
|
49
|
-
requirement: &70322126261720 !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
37
|
requirements:
|
52
|
-
- - ~>
|
38
|
+
- - "~>"
|
53
39
|
- !ruby/object:Gem::Version
|
54
|
-
version: '1
|
55
|
-
type: :runtime
|
56
|
-
prerelease: false
|
57
|
-
version_requirements: *70322126261720
|
40
|
+
version: '1'
|
58
41
|
- !ruby/object:Gem::Dependency
|
59
|
-
name:
|
60
|
-
requirement:
|
61
|
-
none: false
|
42
|
+
name: pry
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
62
44
|
requirements:
|
63
|
-
- -
|
45
|
+
- - ">="
|
64
46
|
- !ruby/object:Gem::Version
|
65
47
|
version: '0'
|
66
48
|
type: :development
|
67
49
|
prerelease: false
|
68
|
-
version_requirements:
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rspec
|
71
|
-
requirement: &70322126257560 !ruby/object:Gem::Requirement
|
72
|
-
none: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
51
|
requirements:
|
74
|
-
- -
|
52
|
+
- - ">="
|
75
53
|
- !ruby/object:Gem::Version
|
76
54
|
version: '0'
|
77
|
-
|
78
|
-
prerelease: false
|
79
|
-
version_requirements: *70322126257560
|
80
|
-
description: A rubygem for interacting with the Spree API
|
55
|
+
description: This is a work in progress!
|
81
56
|
email:
|
82
|
-
-
|
57
|
+
- f@sutty.nl
|
83
58
|
executables: []
|
84
59
|
extensions: []
|
85
|
-
extra_rdoc_files:
|
60
|
+
extra_rdoc_files:
|
61
|
+
- README.md
|
62
|
+
- CHANGELOG.md
|
63
|
+
- LICENSE.txt
|
86
64
|
files:
|
87
|
-
- .
|
88
|
-
- .
|
89
|
-
-
|
90
|
-
-
|
91
|
-
-
|
65
|
+
- CHANGELOG.md
|
66
|
+
- LICENSE.txt
|
67
|
+
- README.md
|
68
|
+
- lib/spree_client.rb
|
69
|
+
- lib/spree_client.rb~
|
70
|
+
- lib/spree_client/api.rb
|
71
|
+
- lib/spree_client/api/v1.rb
|
72
|
+
- lib/spree_client/api/v1/products.rb
|
73
|
+
- lib/spree_client/api/v1/properties.rb
|
74
|
+
- lib/spree_client/api/v1/resources.rb
|
75
|
+
- lib/spree_client/api/v1/stock_items.rb
|
76
|
+
- lib/spree_client/api/v1/stock_locations.rb
|
77
|
+
- lib/spree_client/api/v1/stock_movements.rb
|
78
|
+
- lib/spree_client/api/v1/taxonomies.rb
|
79
|
+
- lib/spree_client/api/v1/variants.rb
|
80
|
+
- lib/spree_client/attributes.rb
|
81
|
+
- lib/spree_client/models.rb
|
82
|
+
- lib/spree_client/models/product.rb
|
83
|
+
- lib/spree_client/models/property.rb
|
84
|
+
- lib/spree_client/models/stock_item.rb
|
85
|
+
- lib/spree_client/models/stock_location.rb
|
86
|
+
- lib/spree_client/models/stock_movement.rb
|
87
|
+
- lib/spree_client/models/store.rb
|
88
|
+
- lib/spree_client/models/taxonomy.rb
|
89
|
+
- lib/spree_client/models/variant.rb
|
90
|
+
homepage: https://0xacab.org/sutty/spree-api-client
|
91
|
+
licenses:
|
92
|
+
- GPL-3.0
|
93
|
+
metadata:
|
94
|
+
bug_tracker_uri: https://0xacab.org/sutty/spree-api-client/issues
|
95
|
+
homepage_uri: https://0xacab.org/sutty/spree-api-client
|
96
|
+
source_code_uri: https://0xacab.org/sutty/spree-api-client
|
97
|
+
changelog_uri: https://0xacab.org/sutty/spree-api-client/-/blob/master/CHANGELOG.md
|
98
|
+
documentation_uri: https://rubydoc.info/gems/spree-api-client
|
99
|
+
post_install_message:
|
100
|
+
rdoc_options:
|
101
|
+
- "--title"
|
102
|
+
- spree-api-client - Spree Ecommerce API client
|
103
|
+
- "--main"
|
92
104
|
- README.md
|
93
|
-
-
|
94
|
-
-
|
95
|
-
-
|
96
|
-
- lib/spree-api-client/connection.rb
|
97
|
-
- lib/spree-api-client/countries.rb
|
98
|
-
- lib/spree-api-client/line_items.rb
|
99
|
-
- lib/spree-api-client/orders.rb
|
100
|
-
- lib/spree-api-client/payments.rb
|
101
|
-
- lib/spree-api-client/products.rb
|
102
|
-
- lib/spree-api-client/properties.rb
|
103
|
-
- lib/spree-api-client/request.rb
|
104
|
-
- lib/spree-api-client/return_authorizations.rb
|
105
|
-
- lib/spree-api-client/shipments.rb
|
106
|
-
- lib/spree-api-client/taxonomies.rb
|
107
|
-
- lib/spree-api-client/taxons.rb
|
108
|
-
- lib/spree-api-client/variants.rb
|
109
|
-
- lib/spree-api-client/version.rb
|
110
|
-
- lib/spree-api-client/zones.rb
|
111
|
-
- spec/addresses_spec.rb
|
112
|
-
- spec/client_spec.rb
|
113
|
-
- spec/countries_spec.rb
|
114
|
-
- spec/orders_spec.rb
|
115
|
-
- spec/payments_spec.rb
|
116
|
-
- spec/products_spec.rb
|
117
|
-
- spec/properties_spec.rb
|
118
|
-
- spec/return_authorizations_spec.rb
|
119
|
-
- spec/shipments_spec.rb
|
120
|
-
- spec/spec_helper.rb
|
121
|
-
- spec/taxonomies_spec.rb
|
122
|
-
- spec/taxons_spec.rb
|
123
|
-
- spec/variants_spec.rb
|
124
|
-
- spec/zones_spec.rb
|
125
|
-
- spree-api-client.gemspec
|
126
|
-
homepage: https://github.com/andrew/spree-api-client
|
127
|
-
licenses: []
|
128
|
-
post_install_message:
|
129
|
-
rdoc_options: []
|
105
|
+
- "--line-numbers"
|
106
|
+
- "--inline-source"
|
107
|
+
- "--quiet"
|
130
108
|
require_paths:
|
131
109
|
- lib
|
132
110
|
required_ruby_version: !ruby/object:Gem::Requirement
|
133
|
-
none: false
|
134
111
|
requirements:
|
135
|
-
- -
|
112
|
+
- - ">="
|
136
113
|
- !ruby/object:Gem::Version
|
137
|
-
version:
|
114
|
+
version: 2.6.0
|
138
115
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
139
|
-
none: false
|
140
116
|
requirements:
|
141
|
-
- -
|
117
|
+
- - ">="
|
142
118
|
- !ruby/object:Gem::Version
|
143
119
|
version: '0'
|
144
120
|
requirements: []
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
test_files:
|
151
|
-
- spec/addresses_spec.rb
|
152
|
-
- spec/client_spec.rb
|
153
|
-
- spec/countries_spec.rb
|
154
|
-
- spec/orders_spec.rb
|
155
|
-
- spec/payments_spec.rb
|
156
|
-
- spec/products_spec.rb
|
157
|
-
- spec/properties_spec.rb
|
158
|
-
- spec/return_authorizations_spec.rb
|
159
|
-
- spec/shipments_spec.rb
|
160
|
-
- spec/spec_helper.rb
|
161
|
-
- spec/taxonomies_spec.rb
|
162
|
-
- spec/taxons_spec.rb
|
163
|
-
- spec/variants_spec.rb
|
164
|
-
- spec/zones_spec.rb
|
121
|
+
rubygems_version: 3.1.2
|
122
|
+
signing_key:
|
123
|
+
specification_version: 4
|
124
|
+
summary: Spree Ecommerce API client
|
125
|
+
test_files: []
|
data/.gitignore
DELETED
data/.travis.yml
DELETED
data/CONTRIBUTING.md
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
## Contributing
|
2
|
-
* Fork the project.
|
3
|
-
* Make your feature addition or bug fix.
|
4
|
-
* Add tests for it. This is important so I don't break it in a
|
5
|
-
future version unintentionally.
|
6
|
-
* Commit, do not mess with rakefile, version, or history.
|
7
|
-
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
8
|
-
* Send a pull request. Bonus points for topic branches.
|
data/Gemfile
DELETED
data/LICENSE
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2012 Andrew Nesbitt
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|