pwinty 3.0.6 → 4.0.1
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/.devcontainer/Dockerfile +17 -0
- data/.devcontainer/base.Dockerfile +43 -0
- data/.devcontainer/devcontainer.json +37 -0
- data/.travis.yml +1 -1
- data/Gemfile.lock +82 -63
- data/README.md +50 -99
- data/lib/pwinty/api_models/order.rb +114 -0
- data/lib/pwinty/api_models/order_asset.rb +7 -0
- data/lib/pwinty/api_models/order_charge.rb +5 -0
- data/lib/pwinty/api_models/order_cost.rb +7 -0
- data/lib/pwinty/api_models/order_item.rb +24 -0
- data/lib/pwinty/api_models/order_packing_slip.rb +7 -0
- data/lib/pwinty/api_models/order_recipient.rb +17 -0
- data/lib/pwinty/api_models/order_recipient_address.rb +11 -0
- data/lib/pwinty/api_models/order_shipment.rb +16 -0
- data/lib/pwinty/api_models/order_shipment_carrier.rb +6 -0
- data/lib/pwinty/api_models/order_shipment_fulfillment_location.rb +7 -0
- data/lib/pwinty/api_models/order_shipment_item.rb +6 -0
- data/lib/pwinty/api_models/order_status.rb +11 -0
- data/lib/pwinty/api_models/order_status_auth_details.rb +7 -0
- data/lib/pwinty/api_models/order_status_details.rb +10 -0
- data/lib/pwinty/api_models/order_status_issue.rb +11 -0
- data/lib/pwinty/api_models/order_tracking.rb +6 -0
- data/lib/pwinty/api_models/product.rb +19 -0
- data/lib/pwinty/api_models/product_dimensions.rb +8 -0
- data/lib/pwinty/api_models/product_variant.rb +8 -0
- data/lib/pwinty/http_errors.rb +6 -4
- data/lib/pwinty/version.rb +1 -1
- data/lib/pwinty.rb +11 -12
- data/pwinty.gemspec +13 -13
- metadata +55 -40
- data/lib/pwinty/country.rb +0 -12
- data/lib/pwinty/image.rb +0 -24
- data/lib/pwinty/order.rb +0 -134
- data/lib/pwinty/order_status.rb +0 -17
- data/lib/pwinty/photo_status.rb +0 -8
- data/lib/pwinty/shipment.rb +0 -14
- data/lib/pwinty/shipping_info.rb +0 -9
@@ -0,0 +1,24 @@
|
|
1
|
+
module Pwinty
|
2
|
+
class OrderItem < Pwinty::Base
|
3
|
+
"""https://www.prodigi.com/print-api/docs/reference/#order-object-item"""
|
4
|
+
attribute? :id, Types::String.optional
|
5
|
+
attribute? :merchantReference, Types::String.optional
|
6
|
+
attribute? :sku, Types::String
|
7
|
+
attribute? :copies, Types::Integer
|
8
|
+
attribute? :sizing, Types::String.default('fillPrintArea')
|
9
|
+
attribute? :assets, Types::Array.of(Pwinty::OrderAsset)
|
10
|
+
attribute? :attributes, Types::Hash
|
11
|
+
|
12
|
+
def serializable
|
13
|
+
item_attrs = Hash.new
|
14
|
+
item_attrs.update(self.attributes)
|
15
|
+
item_attrs[:assets] = []
|
16
|
+
for asset in self.assets
|
17
|
+
item_attrs[:assets] << asset.attributes
|
18
|
+
end
|
19
|
+
item_attrs
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require "pwinty/api_models/order_recipient_address"
|
2
|
+
|
3
|
+
module Pwinty
|
4
|
+
class OrderRecipient < Pwinty::Base
|
5
|
+
"""https://www.prodigi.com/print-api/docs/reference/#order-object-recipient"""
|
6
|
+
attribute? :name, Types::String.optional
|
7
|
+
attribute? :email, Types::String.optional
|
8
|
+
attribute? :phoneNumber, Types::String.optional
|
9
|
+
attribute? :address, Pwinty::OrderRecipientAddress
|
10
|
+
|
11
|
+
def serializable
|
12
|
+
recp_attrs = self.attributes
|
13
|
+
recp_attrs[:address] = self.address.attributes
|
14
|
+
recp_attrs
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Pwinty
|
2
|
+
class OrderRecipientAddress < Pwinty::Base
|
3
|
+
"""https://www.prodigi.com/print-api/docs/reference/#order-object-address"""
|
4
|
+
attribute? :line1, Types::String.optional
|
5
|
+
attribute? :line2, Types::String.optional
|
6
|
+
attribute? :postalOrZipCode, Types::String.optional
|
7
|
+
attribute? :countryCode, Types::String.optional
|
8
|
+
attribute? :townOrCity, Types::String.optional
|
9
|
+
attribute? :stateOrCounty, Types::String.optional
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require "pwinty/api_models/order_shipment_carrier"
|
2
|
+
require "pwinty/api_models/order_shipment_item"
|
3
|
+
require "pwinty/api_models/order_shipment_fulfillment_location"
|
4
|
+
require "pwinty/api_models/order_tracking"
|
5
|
+
|
6
|
+
module Pwinty
|
7
|
+
class OrderShipment < Pwinty::Base
|
8
|
+
"""https://www.prodigi.com/print-api/docs/reference/#order-object-shipment"""
|
9
|
+
attribute? :id, Types::String.optional
|
10
|
+
attribute? :carrier, Pwinty::OrderShipmentCarrier.optional
|
11
|
+
attribute? :tracking, Pwinty::OrderTracking.optional
|
12
|
+
attribute? :dispatchDate, Types::String.optional
|
13
|
+
attribute? :items, Types::Array.of(Pwinty::OrderShipmentItem).optional
|
14
|
+
attribute? :fulfillmentLocation, Pwinty::OrderShipmentFulfillmentLocation
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
module Pwinty
|
2
|
+
class OrderShipmentFulfillmentLocation < Pwinty::Base
|
3
|
+
"""https://www.prodigi.com/print-api/docs/reference/#order-object-fulfillment-location"""
|
4
|
+
attribute? :countryCode, Types::String.optional
|
5
|
+
attribute? :labCode, Types::String.optional
|
6
|
+
end
|
7
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require "pwinty/api_models/order_status_details"
|
2
|
+
require "pwinty/api_models/order_status_issue"
|
3
|
+
|
4
|
+
module Pwinty
|
5
|
+
class OrderStatus < Pwinty::Base
|
6
|
+
"""https://www.prodigi.com/print-api/docs/reference/#status-status-object"""
|
7
|
+
attribute? :stage, Types::String.default('NotYetSubmitted')
|
8
|
+
attribute? :details, Pwinty::OrderStatusDetails
|
9
|
+
attribute? :issues, Types::Array.of(Pwinty::OrderStatusIssue)
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
module Pwinty
|
2
|
+
class OrderStatusAuthDetails < Pwinty::Base
|
3
|
+
"""https://www.prodigi.com/print-api/docs/reference/#status-status-authorisation-details"""
|
4
|
+
attribute? :authorisationUrl, Types::String.optional
|
5
|
+
attribute? :paymentDetails, Pwinty::OrderCost
|
6
|
+
end
|
7
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module Pwinty
|
2
|
+
class OrderStatusDetails < Pwinty::Base
|
3
|
+
"""https://www.prodigi.com/print-api/docs/reference/#status-status-object-details"""
|
4
|
+
attribute? :downloadAssets, Types::String.optional
|
5
|
+
attribute? :allocateProductionLocation, Types::String.optional
|
6
|
+
attribute? :printReadyAssetsPrepared, Types::String.optional
|
7
|
+
attribute? :inProduction, Types::String.optional
|
8
|
+
attribute? :shipping, Types::String.optional
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require "pwinty/api_models/order_status_auth_details"
|
2
|
+
|
3
|
+
module Pwinty
|
4
|
+
class OrderStatusIssue < Pwinty::Base
|
5
|
+
"""https://www.prodigi.com/print-api/docs/reference/#status-status-object-issues"""
|
6
|
+
attribute? :objectId, Types::String.optional
|
7
|
+
attribute? :errorCode, Types::String.optional
|
8
|
+
attribute? :description, Types::String.optional
|
9
|
+
attribute? :authorisationDetails, Pwinty::OrderStatusAuthDetails.optional
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require "pwinty/api_models/product_dimensions"
|
2
|
+
require "pwinty/api_models/product_variant"
|
3
|
+
|
4
|
+
module Pwinty
|
5
|
+
class Product < Pwinty::Base
|
6
|
+
"""https://www.prodigi.com/print-api/docs/reference/#product-details"""
|
7
|
+
attribute :sku, Types::String
|
8
|
+
attribute :description, Types::String
|
9
|
+
attribute :productDimensions, Pwinty::ProductDimensions
|
10
|
+
attribute :attributes, Types::Hash
|
11
|
+
attribute :printAreas, Types::Hash
|
12
|
+
attribute :variants, Types::Array.of(Pwinty::ProductVariant)
|
13
|
+
|
14
|
+
def self.find(sku)
|
15
|
+
response = Pwinty.conn.get("products/#{sku}")
|
16
|
+
new(response.body['product'])
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
module Pwinty
|
2
|
+
class ProductVariant < Pwinty::Base
|
3
|
+
"""https://www.prodigi.com/print-api/docs/reference/#product-details-object-variant"""
|
4
|
+
attribute :attributes, Types::Hash
|
5
|
+
attribute :shipsTo, Types::Array.of(Types::String)
|
6
|
+
attribute :printAreaSizes, Types::Hash
|
7
|
+
end
|
8
|
+
end
|
data/lib/pwinty/http_errors.rb
CHANGED
@@ -3,10 +3,12 @@ module Pwinty
|
|
3
3
|
def on_complete(env)
|
4
4
|
msg = env[:body]
|
5
5
|
case env[:status]
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
when 400; raise Pwinty::ValidationError, msg
|
7
|
+
when 401; raise Pwinty::AuthenticationError, msg
|
8
|
+
when 404; raise Pwinty::NotFound, msg
|
9
|
+
when 405; raise Pwinty::MethodNotAllowed, msg
|
10
|
+
when 415; raise Pwinty::InvalidContentTypeHeader, msg
|
11
|
+
when 500; raise Pwinty::Error, msg
|
10
12
|
end
|
11
13
|
end
|
12
14
|
end
|
data/lib/pwinty/version.rb
CHANGED
data/lib/pwinty.rb
CHANGED
@@ -2,26 +2,26 @@ require 'faraday'
|
|
2
2
|
require 'faraday_middleware'
|
3
3
|
|
4
4
|
require "pwinty/base"
|
5
|
-
require "pwinty/country"
|
6
5
|
require "pwinty/http_errors"
|
7
|
-
require "pwinty/image"
|
8
|
-
require "pwinty/order"
|
9
|
-
require "pwinty/order_status"
|
10
|
-
require 'pwinty/photo_status'
|
11
|
-
require "pwinty/shipment"
|
12
|
-
require "pwinty/shipping_info"
|
13
6
|
require "pwinty/version"
|
14
7
|
|
8
|
+
require "pwinty/api_models/order"
|
9
|
+
require 'pwinty/api_models/product'
|
10
|
+
|
15
11
|
module Pwinty
|
16
12
|
class Error < StandardError; end
|
13
|
+
class OrderActionUnavailable < Pwinty::Error; end
|
17
14
|
class AuthenticationError < Pwinty::Error; end
|
18
|
-
class
|
15
|
+
class InvalidContentTypeHeader < Pwinty::Error; end
|
16
|
+
class MethodNotAllowed < Pwinty::Error; end
|
17
|
+
class NotFound < Pwinty::Error; end
|
19
18
|
class StateIsInvalid < Pwinty::Error; end
|
19
|
+
class ValidationError < Pwinty::Error; end
|
20
20
|
|
21
21
|
MERCHANT_ID = ENV['PWINTY_MERCHANT_ID']
|
22
22
|
API_KEY = ENV['PWINTY_API_KEY']
|
23
|
-
BASE_URL = ENV['PWINTY_BASE_URL'] || 'https://sandbox.
|
24
|
-
API_VERSION = '
|
23
|
+
BASE_URL = ENV['PWINTY_BASE_URL'] || 'https://api.sandbox.prodigi.com'
|
24
|
+
API_VERSION = 'v4.0'
|
25
25
|
|
26
26
|
class << self
|
27
27
|
attr_accessor :logger
|
@@ -38,8 +38,7 @@ module Pwinty
|
|
38
38
|
|
39
39
|
def self.headers
|
40
40
|
{
|
41
|
-
'X-
|
42
|
-
'X-Pwinty-REST-API-Key' => Pwinty::API_KEY,
|
41
|
+
'X-API-Key' => Pwinty::API_KEY,
|
43
42
|
}
|
44
43
|
end
|
45
44
|
|
data/pwinty.gemspec
CHANGED
@@ -9,14 +9,14 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Thomas Harvey"]
|
10
10
|
spec.email = ["tom@alush.co.uk"]
|
11
11
|
|
12
|
-
spec.summary = %q{Order photo prints through Pwinty}
|
13
|
-
spec.description = "This wraps the Pwinty API at version
|
12
|
+
spec.summary = %q{Order photo prints through the Prodigi Pwinty API}
|
13
|
+
spec.description = "This wraps the Pwinty API at version 4 and aims to make your ruby life easier when interacting with the API."
|
14
14
|
spec.homepage = "https://github.com/tomharvey/pwinty3-rb"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
17
|
spec.metadata["homepage_uri"] = spec.homepage
|
18
18
|
spec.metadata["source_code_uri"] = spec.homepage
|
19
|
-
spec.metadata["documentation_uri"] = "https://
|
19
|
+
spec.metadata["documentation_uri"] = "https://www.prodigi.com/print-api/docs/"
|
20
20
|
|
21
21
|
# Specify which files should be added to the gem when it is released.
|
22
22
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -27,18 +27,18 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
28
|
spec.require_paths = ["lib"]
|
29
29
|
|
30
|
-
spec.add_development_dependency "bundler"
|
31
|
-
spec.add_development_dependency "rake"
|
32
|
-
spec.add_development_dependency "rspec"
|
30
|
+
spec.add_development_dependency "bundler"
|
31
|
+
spec.add_development_dependency "rake"
|
32
|
+
spec.add_development_dependency "rspec"
|
33
33
|
|
34
|
-
spec.add_development_dependency "vcr", "~>
|
35
|
-
spec.add_development_dependency "webmock", "~> 3.
|
36
|
-
spec.add_development_dependency "simplecov", "~> 0.
|
34
|
+
spec.add_development_dependency "vcr", "~> 6.0"
|
35
|
+
spec.add_development_dependency "webmock", "~> 3.14"
|
36
|
+
spec.add_development_dependency "simplecov", "~> 0.21"
|
37
37
|
spec.add_development_dependency "dotenv", "~> 2.7.5"
|
38
38
|
|
39
39
|
spec.add_dependency "dry-struct", "~> 1.0"
|
40
|
-
spec.add_dependency "dry-struct-setters", "~> 0.
|
41
|
-
spec.add_dependency "faraday", "~> 0
|
42
|
-
spec.add_dependency "faraday_middleware", "~>
|
43
|
-
spec.add_dependency "json", "~> 2.
|
40
|
+
spec.add_dependency "dry-struct-setters", "~> 0.4"
|
41
|
+
spec.add_dependency "faraday", "~> 1.0"
|
42
|
+
spec.add_dependency "faraday_middleware", "~> 1.2"
|
43
|
+
spec.add_dependency "json", "~> 2.6"
|
44
44
|
end
|
metadata
CHANGED
@@ -1,99 +1,99 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pwinty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Harvey
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: vcr
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '6.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '6.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: webmock
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '3.
|
75
|
+
version: '3.14'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '3.
|
82
|
+
version: '3.14'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: simplecov
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0.
|
89
|
+
version: '0.21'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0.
|
96
|
+
version: '0.21'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: dotenv
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,57 +128,57 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '0.
|
131
|
+
version: '0.4'
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '0.
|
138
|
+
version: '0.4'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: faraday
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: '0
|
145
|
+
version: '1.0'
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: '0
|
152
|
+
version: '1.0'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: faraday_middleware
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: '
|
159
|
+
version: '1.2'
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: '
|
166
|
+
version: '1.2'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: json
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: '2.
|
173
|
+
version: '2.6'
|
174
174
|
type: :runtime
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: '2.
|
181
|
-
description: This wraps the Pwinty API at version
|
180
|
+
version: '2.6'
|
181
|
+
description: This wraps the Pwinty API at version 4 and aims to make your ruby life
|
182
182
|
easier when interacting with the API.
|
183
183
|
email:
|
184
184
|
- tom@alush.co.uk
|
@@ -186,6 +186,9 @@ executables: []
|
|
186
186
|
extensions: []
|
187
187
|
extra_rdoc_files: []
|
188
188
|
files:
|
189
|
+
- ".devcontainer/Dockerfile"
|
190
|
+
- ".devcontainer/base.Dockerfile"
|
191
|
+
- ".devcontainer/devcontainer.json"
|
189
192
|
- ".env.sample"
|
190
193
|
- ".gitignore"
|
191
194
|
- ".rspec"
|
@@ -200,15 +203,28 @@ files:
|
|
200
203
|
- bin/console
|
201
204
|
- bin/setup
|
202
205
|
- lib/pwinty.rb
|
206
|
+
- lib/pwinty/api_models/order.rb
|
207
|
+
- lib/pwinty/api_models/order_asset.rb
|
208
|
+
- lib/pwinty/api_models/order_charge.rb
|
209
|
+
- lib/pwinty/api_models/order_cost.rb
|
210
|
+
- lib/pwinty/api_models/order_item.rb
|
211
|
+
- lib/pwinty/api_models/order_packing_slip.rb
|
212
|
+
- lib/pwinty/api_models/order_recipient.rb
|
213
|
+
- lib/pwinty/api_models/order_recipient_address.rb
|
214
|
+
- lib/pwinty/api_models/order_shipment.rb
|
215
|
+
- lib/pwinty/api_models/order_shipment_carrier.rb
|
216
|
+
- lib/pwinty/api_models/order_shipment_fulfillment_location.rb
|
217
|
+
- lib/pwinty/api_models/order_shipment_item.rb
|
218
|
+
- lib/pwinty/api_models/order_status.rb
|
219
|
+
- lib/pwinty/api_models/order_status_auth_details.rb
|
220
|
+
- lib/pwinty/api_models/order_status_details.rb
|
221
|
+
- lib/pwinty/api_models/order_status_issue.rb
|
222
|
+
- lib/pwinty/api_models/order_tracking.rb
|
223
|
+
- lib/pwinty/api_models/product.rb
|
224
|
+
- lib/pwinty/api_models/product_dimensions.rb
|
225
|
+
- lib/pwinty/api_models/product_variant.rb
|
203
226
|
- lib/pwinty/base.rb
|
204
|
-
- lib/pwinty/country.rb
|
205
227
|
- lib/pwinty/http_errors.rb
|
206
|
-
- lib/pwinty/image.rb
|
207
|
-
- lib/pwinty/order.rb
|
208
|
-
- lib/pwinty/order_status.rb
|
209
|
-
- lib/pwinty/photo_status.rb
|
210
|
-
- lib/pwinty/shipment.rb
|
211
|
-
- lib/pwinty/shipping_info.rb
|
212
228
|
- lib/pwinty/version.rb
|
213
229
|
- pwinty.gemspec
|
214
230
|
homepage: https://github.com/tomharvey/pwinty3-rb
|
@@ -217,7 +233,7 @@ licenses:
|
|
217
233
|
metadata:
|
218
234
|
homepage_uri: https://github.com/tomharvey/pwinty3-rb
|
219
235
|
source_code_uri: https://github.com/tomharvey/pwinty3-rb
|
220
|
-
documentation_uri: https://
|
236
|
+
documentation_uri: https://www.prodigi.com/print-api/docs/
|
221
237
|
post_install_message:
|
222
238
|
rdoc_options: []
|
223
239
|
require_paths:
|
@@ -233,9 +249,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
233
249
|
- !ruby/object:Gem::Version
|
234
250
|
version: '0'
|
235
251
|
requirements: []
|
236
|
-
|
237
|
-
rubygems_version: 2.7.7
|
252
|
+
rubygems_version: 3.3.7
|
238
253
|
signing_key:
|
239
254
|
specification_version: 4
|
240
|
-
summary: Order photo prints through Pwinty
|
255
|
+
summary: Order photo prints through the Prodigi Pwinty API
|
241
256
|
test_files: []
|
data/lib/pwinty/country.rb
DELETED
data/lib/pwinty/image.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
module Pwinty
|
2
|
-
|
3
|
-
class Image < Pwinty::Base
|
4
|
-
attribute :id, Types::Integer
|
5
|
-
attribute :url, Types::String
|
6
|
-
attribute :status, Types::String
|
7
|
-
attribute :copies, Types::Integer
|
8
|
-
attribute :sizing, Types::String
|
9
|
-
attribute :price, Types::Integer
|
10
|
-
attribute :priceToUser, Types::Integer.optional
|
11
|
-
attribute :md5Hash, Types::String.optional
|
12
|
-
attribute :previewUrl, Types::String.optional
|
13
|
-
attribute :thumbnailUrl, Types::String.optional
|
14
|
-
attribute :sku, Types::String
|
15
|
-
attribute :attributes, Types::Hash.schema(
|
16
|
-
substrateWeight?: Types::String.optional,
|
17
|
-
frame?: Types::String.optional,
|
18
|
-
edge?: Types::String.optional,
|
19
|
-
paperType?: Types::String.optional,
|
20
|
-
frameColour?: Types::String.optional,
|
21
|
-
).optional
|
22
|
-
attribute :errorMessage, Types::String.optional
|
23
|
-
end
|
24
|
-
end
|