ruby-brightpearl 0.10.0 → 0.12.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/CHANGELOG.md +16 -0
- data/Gemfile.lock +3 -3
- data/lib/brightpearl/resources/brand.rb +21 -0
- data/lib/brightpearl/resources/channel.rb +21 -0
- data/lib/brightpearl/resources/contact_custom_field_metadata.rb +26 -0
- data/lib/brightpearl/resources/order_custom_field_metadata.rb +26 -0
- data/lib/brightpearl/resources/product_category.rb +21 -0
- data/lib/brightpearl/resources/product_custom_field_metadata.rb +13 -0
- data/lib/brightpearl/resources/product_type.rb +21 -0
- data/lib/brightpearl/resources/warehouse.rb +21 -0
- data/lib/brightpearl/resources.rb +13 -0
- data/lib/brightpearl/version.rb +1 -1
- metadata +9 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4e872e28d8c8ed42ed2e30a141e6b37b709e857e11e506feefcd9ffba901398f
|
|
4
|
+
data.tar.gz: e73b1a317a93421b24fe84959d816edd0b5940243cd87a1f0e6fb56da9856c25
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b9e8a6fca6d64b1d641b24dbcdef1ef942ea4ddb6c8aae150800a2db1dd945712540d4159615ce4eb97a69d47d5b20f3062fe785369886dea0064d0fca27be9c
|
|
7
|
+
data.tar.gz: 2bee8f31a03585425df7c4527a78f8a7e29850534c6437ec1da87a95e72bcd78fa216052e6249be45d3c06b70e30ac308559090820f063d72c05a1c8a8d6217f
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.12.0] - 2026-06-02
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- New catalog resources `Brand`, `Channel`, `ProductCategory`, `ProductType`, and `Warehouse`
|
|
8
|
+
- Available operations: `GET`
|
|
9
|
+
- Supports fetching the full list (no argument) or a specific record by id-set
|
|
10
|
+
|
|
11
|
+
## [0.11.0] - 2026-05-08
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- New resources `ContactCustomFieldMetadata`, `OrderCustomFieldMetadata`, and `ProductCustomFieldMetadata`
|
|
16
|
+
- Available operations: `GET`
|
|
17
|
+
- Useful to get the available custom fields for a contact, order, or product and their metadata (name, type, list of values, etc.)
|
|
18
|
+
|
|
3
19
|
## [0.10.0] - 2026-04-17
|
|
4
20
|
|
|
5
21
|
### Added
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
ruby-brightpearl (0.
|
|
4
|
+
ruby-brightpearl (0.12.0)
|
|
5
5
|
httparty (~> 0.20)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -10,7 +10,7 @@ GEM
|
|
|
10
10
|
addressable (2.8.0)
|
|
11
11
|
public_suffix (>= 2.0.2, < 5.0)
|
|
12
12
|
base64 (0.3.0)
|
|
13
|
-
bigdecimal (4.1.
|
|
13
|
+
bigdecimal (4.1.2)
|
|
14
14
|
byebug (11.1.3)
|
|
15
15
|
coderay (1.1.3)
|
|
16
16
|
crack (0.4.5)
|
|
@@ -25,7 +25,7 @@ GEM
|
|
|
25
25
|
multi_xml (>= 0.5.2)
|
|
26
26
|
method_source (1.1.0)
|
|
27
27
|
mini_mime (1.1.5)
|
|
28
|
-
multi_xml (0.
|
|
28
|
+
multi_xml (0.9.1)
|
|
29
29
|
bigdecimal (>= 3.1, < 5)
|
|
30
30
|
pry (0.15.2)
|
|
31
31
|
coderay (~> 1.1)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Brightpearl
|
|
2
|
+
class Brand < Resource
|
|
3
|
+
extend Brightpearl::APIOperations::Get
|
|
4
|
+
class << self
|
|
5
|
+
def resource_path
|
|
6
|
+
"product-service/brand"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def get(id_set = nil)
|
|
10
|
+
if id_set
|
|
11
|
+
super
|
|
12
|
+
else
|
|
13
|
+
super(nil)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# https://api-docs.brightpearl.com/product/brand/get.html
|
|
18
|
+
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Brightpearl
|
|
2
|
+
class Channel < Resource
|
|
3
|
+
extend Brightpearl::APIOperations::Get
|
|
4
|
+
class << self
|
|
5
|
+
def resource_path
|
|
6
|
+
"product-service/channel"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def get(id_set = nil)
|
|
10
|
+
if id_set
|
|
11
|
+
super
|
|
12
|
+
else
|
|
13
|
+
super(nil)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# https://api-docs.brightpearl.com/product/sales-channel/get.html
|
|
18
|
+
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module Brightpearl
|
|
2
|
+
# https://api-docs.brightpearl.com/contact/custom-field-meta-data/get.html
|
|
3
|
+
class ContactCustomFieldMetadata < Resource
|
|
4
|
+
VALID_CONTACT_TYPES = ["customer", "supplier"].freeze
|
|
5
|
+
|
|
6
|
+
class << self
|
|
7
|
+
def get(contact_type, id_set = nil)
|
|
8
|
+
contact_type = contact_type.to_s
|
|
9
|
+
validate_contact_type!(contact_type)
|
|
10
|
+
|
|
11
|
+
path = "contact-service/#{contact_type}/custom-field-meta-data"
|
|
12
|
+
path = "#{path}/#{id_set}" if id_set
|
|
13
|
+
|
|
14
|
+
send_request(path: path, method: :get)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
private
|
|
18
|
+
|
|
19
|
+
def validate_contact_type!(contact_type)
|
|
20
|
+
return if VALID_CONTACT_TYPES.include?(contact_type)
|
|
21
|
+
|
|
22
|
+
raise ArgumentError, "Invalid contact custom field metadata type: #{contact_type.inspect}. Valid types: #{VALID_CONTACT_TYPES.join(', ')}"
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module Brightpearl
|
|
2
|
+
# https://api-docs.brightpearl.com/order/customfield-metadata/get.html
|
|
3
|
+
class OrderCustomFieldMetadata < Resource
|
|
4
|
+
VALID_ORDER_TYPES = ["sale", "purchase"].freeze
|
|
5
|
+
|
|
6
|
+
class << self
|
|
7
|
+
def get(order_type, id_set = nil)
|
|
8
|
+
order_type = order_type.to_s
|
|
9
|
+
validate_order_type!(order_type)
|
|
10
|
+
|
|
11
|
+
path = "order-service/#{order_type}/custom-field-meta-data"
|
|
12
|
+
path = "#{path}/#{id_set}" if id_set
|
|
13
|
+
|
|
14
|
+
send_request(path: path, method: :get)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
private
|
|
18
|
+
|
|
19
|
+
def validate_order_type!(order_type)
|
|
20
|
+
return if VALID_ORDER_TYPES.include?(order_type)
|
|
21
|
+
|
|
22
|
+
raise ArgumentError, "Invalid order custom field metadata type: #{order_type.inspect}. Valid types: #{VALID_ORDER_TYPES.join(', ')}"
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Brightpearl
|
|
2
|
+
class ProductCategory < Resource
|
|
3
|
+
extend Brightpearl::APIOperations::Get
|
|
4
|
+
class << self
|
|
5
|
+
def resource_path
|
|
6
|
+
"product-service/brightpearl-category"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def get(id_set = nil)
|
|
10
|
+
if id_set
|
|
11
|
+
super
|
|
12
|
+
else
|
|
13
|
+
super(nil)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# https://api-docs.brightpearl.com/product/category/get.html
|
|
18
|
+
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module Brightpearl
|
|
2
|
+
# https://api-docs.brightpearl.com/product/product-custom-field-metadata/get.html
|
|
3
|
+
class ProductCustomFieldMetadata < Resource
|
|
4
|
+
class << self
|
|
5
|
+
def get(id_set = nil)
|
|
6
|
+
path = "product-service/product/custom-field-meta-data"
|
|
7
|
+
path = "#{path}/#{id_set}" if id_set
|
|
8
|
+
|
|
9
|
+
send_request(path: path, method: :get)
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Brightpearl
|
|
2
|
+
class ProductType < Resource
|
|
3
|
+
extend Brightpearl::APIOperations::Get
|
|
4
|
+
class << self
|
|
5
|
+
def resource_path
|
|
6
|
+
"product-service/product-type"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def get(id_set = nil)
|
|
10
|
+
if id_set
|
|
11
|
+
super
|
|
12
|
+
else
|
|
13
|
+
super(nil)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# https://api-docs.brightpearl.com/product/product-type/get.html
|
|
18
|
+
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Brightpearl
|
|
2
|
+
class Warehouse < Resource
|
|
3
|
+
extend Brightpearl::APIOperations::Get
|
|
4
|
+
class << self
|
|
5
|
+
def resource_path
|
|
6
|
+
"warehouse-service/warehouse"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def get(id_set = nil)
|
|
10
|
+
if id_set
|
|
11
|
+
super
|
|
12
|
+
else
|
|
13
|
+
super(nil)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# https://api-docs.brightpearl.com/warehouse/warehouse/get.html
|
|
18
|
+
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -1,21 +1,34 @@
|
|
|
1
1
|
require 'brightpearl/resource'
|
|
2
2
|
|
|
3
|
+
# Contacts
|
|
3
4
|
require 'brightpearl/resources/contact'
|
|
4
5
|
require 'brightpearl/resources/contact_custom_field'
|
|
6
|
+
require 'brightpearl/resources/contact_custom_field_metadata'
|
|
5
7
|
|
|
8
|
+
# Orders
|
|
6
9
|
require 'brightpearl/resources/order'
|
|
7
10
|
require 'brightpearl/resources/order_row'
|
|
8
11
|
require 'brightpearl/resources/order_shipping_status'
|
|
9
12
|
require 'brightpearl/resources/order_status'
|
|
10
13
|
require 'brightpearl/resources/order_status_update'
|
|
11
14
|
require 'brightpearl/resources/order_custom_field'
|
|
15
|
+
require 'brightpearl/resources/order_custom_field_metadata'
|
|
12
16
|
|
|
13
17
|
require 'brightpearl/resources/goods_out_note'
|
|
14
18
|
|
|
19
|
+
# Products
|
|
15
20
|
require 'brightpearl/resources/product'
|
|
16
21
|
require 'brightpearl/resources/product_price'
|
|
17
22
|
require 'brightpearl/resources/price_list'
|
|
18
23
|
require 'brightpearl/resources/product_availability'
|
|
24
|
+
require 'brightpearl/resources/product_custom_field_metadata'
|
|
25
|
+
|
|
26
|
+
# Catalogs
|
|
27
|
+
require 'brightpearl/resources/brand'
|
|
28
|
+
require 'brightpearl/resources/channel'
|
|
29
|
+
require 'brightpearl/resources/product_category'
|
|
30
|
+
require 'brightpearl/resources/product_type'
|
|
31
|
+
require 'brightpearl/resources/warehouse'
|
|
19
32
|
|
|
20
33
|
# Integration
|
|
21
34
|
require 'brightpearl/resources/webhook'
|
data/lib/brightpearl/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby-brightpearl
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.12.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- vicvans20
|
|
@@ -152,12 +152,16 @@ files:
|
|
|
152
152
|
- lib/brightpearl/errors.rb
|
|
153
153
|
- lib/brightpearl/resource.rb
|
|
154
154
|
- lib/brightpearl/resources.rb
|
|
155
|
+
- lib/brightpearl/resources/brand.rb
|
|
156
|
+
- lib/brightpearl/resources/channel.rb
|
|
155
157
|
- lib/brightpearl/resources/contact.rb
|
|
156
158
|
- lib/brightpearl/resources/contact_custom_field.rb
|
|
159
|
+
- lib/brightpearl/resources/contact_custom_field_metadata.rb
|
|
157
160
|
- lib/brightpearl/resources/customer_payment.rb
|
|
158
161
|
- lib/brightpearl/resources/goods_out_note.rb
|
|
159
162
|
- lib/brightpearl/resources/order.rb
|
|
160
163
|
- lib/brightpearl/resources/order_custom_field.rb
|
|
164
|
+
- lib/brightpearl/resources/order_custom_field_metadata.rb
|
|
161
165
|
- lib/brightpearl/resources/order_row.rb
|
|
162
166
|
- lib/brightpearl/resources/order_shipping_status.rb
|
|
163
167
|
- lib/brightpearl/resources/order_status.rb
|
|
@@ -165,8 +169,12 @@ files:
|
|
|
165
169
|
- lib/brightpearl/resources/price_list.rb
|
|
166
170
|
- lib/brightpearl/resources/product.rb
|
|
167
171
|
- lib/brightpearl/resources/product_availability.rb
|
|
172
|
+
- lib/brightpearl/resources/product_category.rb
|
|
173
|
+
- lib/brightpearl/resources/product_custom_field_metadata.rb
|
|
168
174
|
- lib/brightpearl/resources/product_price.rb
|
|
175
|
+
- lib/brightpearl/resources/product_type.rb
|
|
169
176
|
- lib/brightpearl/resources/tax_code.rb
|
|
177
|
+
- lib/brightpearl/resources/warehouse.rb
|
|
170
178
|
- lib/brightpearl/resources/webhook.rb
|
|
171
179
|
- lib/brightpearl/version.rb
|
|
172
180
|
- playground.rb
|