lemonsqueezy 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/lib/lemon_squeezy/client.rb +28 -0
- data/lib/lemon_squeezy/objects/discount.rb +12 -0
- data/lib/lemon_squeezy/objects/file.rb +12 -0
- data/lib/lemon_squeezy/objects/license_key.rb +12 -0
- data/lib/lemon_squeezy/objects/order.rb +12 -0
- data/lib/lemon_squeezy/objects/order_item.rb +12 -0
- data/lib/lemon_squeezy/objects/product.rb +12 -0
- data/lib/lemon_squeezy/objects/subscription.rb +12 -0
- data/lib/lemon_squeezy/resources/discounts.rb +15 -0
- data/lib/lemon_squeezy/resources/files.rb +15 -0
- data/lib/lemon_squeezy/resources/license_keys.rb +15 -0
- data/lib/lemon_squeezy/resources/orders.rb +20 -0
- data/lib/lemon_squeezy/resources/products.rb +15 -0
- data/lib/lemon_squeezy/resources/stores.rb +0 -1
- data/lib/lemon_squeezy/resources/subscriptions.rb +15 -0
- data/lib/lemon_squeezy/resources/variants.rb +15 -0
- data/lib/lemon_squeezy/version.rb +1 -1
- data/lib/lemon_squeezy.rb +15 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6caa3dd3252a4d5e97ccffa65a6cbdc82afb275d58591904ed4ca575e5254cf7
|
4
|
+
data.tar.gz: 2e3881b8b63e63525dda7839b714740c70565282a3552e955b2e7c0295a74a17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6e61129aa111dea54a26a2ac0915fce6ea1217d3bfaed1afbd0e432297496081f1d046a4fef554515d1cb9e81a35571c792cf4d674ef97bc7aa44960275ab56
|
7
|
+
data.tar.gz: b86eaa0cb92691704d289ac7785003937e77b3dec5679a5c986f9fc889f94a267633924bcbbb2406f5fe0b94ea537ec80c1c3fb863ff950a9c654644922aae4a
|
data/Gemfile.lock
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
lemonsqueezy (0.1.
|
4
|
+
lemonsqueezy (0.1.1)
|
5
5
|
faraday (~> 2.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
10
|
dotenv (2.7.6)
|
11
|
-
faraday (2.
|
11
|
+
faraday (2.6.0)
|
12
12
|
faraday-net_http (>= 2.0, < 3.1)
|
13
13
|
ruby2_keywords (>= 0.0.4)
|
14
|
-
faraday-net_http (3.0.
|
14
|
+
faraday-net_http (3.0.1)
|
15
15
|
minitest (5.15.0)
|
16
16
|
rake (13.0.6)
|
17
17
|
ruby2_keywords (0.0.5)
|
data/lib/lemon_squeezy/client.rb
CHANGED
@@ -16,6 +16,34 @@ module LemonSqueezy
|
|
16
16
|
StoresResource.new(self)
|
17
17
|
end
|
18
18
|
|
19
|
+
def products
|
20
|
+
ProductsResource.new(self)
|
21
|
+
end
|
22
|
+
|
23
|
+
def variants
|
24
|
+
VariantsResource.new(self)
|
25
|
+
end
|
26
|
+
|
27
|
+
def orders
|
28
|
+
OrdersResource.new(self)
|
29
|
+
end
|
30
|
+
|
31
|
+
def subscriptions
|
32
|
+
SubscriptionsResource.new(self)
|
33
|
+
end
|
34
|
+
|
35
|
+
def discounts
|
36
|
+
DiscountsResource.new(self)
|
37
|
+
end
|
38
|
+
|
39
|
+
def license_keys
|
40
|
+
LicenseKeysResource.new(self)
|
41
|
+
end
|
42
|
+
|
43
|
+
def files
|
44
|
+
FilesResource.new(self)
|
45
|
+
end
|
46
|
+
|
19
47
|
def connection
|
20
48
|
@connection ||= Faraday.new(BASE_URL) do |conn|
|
21
49
|
conn.request :authorization, :Bearer, access_token
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module LemonSqueezy
|
2
|
+
class DiscountsResource < Resource
|
3
|
+
|
4
|
+
def list(**params)
|
5
|
+
response = get_request("discounts", params: params)
|
6
|
+
Collection.from_response(response, type: Discount)
|
7
|
+
end
|
8
|
+
|
9
|
+
def get(id:)
|
10
|
+
response = get_request("discounts/#{id}")
|
11
|
+
Discount.new(response.body["data"]) if response.success?
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module LemonSqueezy
|
2
|
+
class FilesResource < Resource
|
3
|
+
|
4
|
+
def list(**params)
|
5
|
+
response = get_request("files", params: params)
|
6
|
+
Collection.from_response(response, type: File)
|
7
|
+
end
|
8
|
+
|
9
|
+
def get(id:)
|
10
|
+
response = get_request("files/#{id}")
|
11
|
+
File.new(response.body["data"]) if response.success?
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module LemonSqueezy
|
2
|
+
class LicenseKeysResource < Resource
|
3
|
+
|
4
|
+
def list(**params)
|
5
|
+
response = get_request("license-keys", params: params)
|
6
|
+
Collection.from_response(response, type: LicenseKey)
|
7
|
+
end
|
8
|
+
|
9
|
+
def get(id:)
|
10
|
+
response = get_request("license-keys/#{id}")
|
11
|
+
LicenseKey.new(response.body["data"]) if response.success?
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module LemonSqueezy
|
2
|
+
class OrdersResource < Resource
|
3
|
+
|
4
|
+
def list(**params)
|
5
|
+
response = get_request("orders", params: params)
|
6
|
+
Collection.from_response(response, type: Order)
|
7
|
+
end
|
8
|
+
|
9
|
+
def get(id:)
|
10
|
+
response = get_request("orders/#{id}")
|
11
|
+
Order.new(response.body["data"]) if response.success?
|
12
|
+
end
|
13
|
+
|
14
|
+
def order_items(id:)
|
15
|
+
response = get_request("order-items", params: {order_id: id})
|
16
|
+
Collection.from_response(response, type: OrderItem)
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module LemonSqueezy
|
2
|
+
class ProductsResource < Resource
|
3
|
+
|
4
|
+
def list(**params)
|
5
|
+
response = get_request("products", params: params)
|
6
|
+
Collection.from_response(response, type: Product)
|
7
|
+
end
|
8
|
+
|
9
|
+
def get(id:)
|
10
|
+
response = get_request("products/#{id}")
|
11
|
+
Product.new(response.body["data"]) if response.success?
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module LemonSqueezy
|
2
|
+
class SubscriptionsResource < Resource
|
3
|
+
|
4
|
+
def list(**params)
|
5
|
+
response = get_request("subscriptions", params: params)
|
6
|
+
Collection.from_response(response, type: Subscription)
|
7
|
+
end
|
8
|
+
|
9
|
+
def get(id:)
|
10
|
+
response = get_request("subscriptions/#{id}")
|
11
|
+
Subscription.new(response.body["data"]) if response.success?
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module LemonSqueezy
|
2
|
+
class VariantsResource < Resource
|
3
|
+
|
4
|
+
def list(**params)
|
5
|
+
response = get_request("variants", params: params)
|
6
|
+
Collection.from_response(response, type: Variant)
|
7
|
+
end
|
8
|
+
|
9
|
+
def get(id:)
|
10
|
+
response = get_request("variants/#{id}")
|
11
|
+
Variant.new(response.body["data"]) if response.success?
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
data/lib/lemon_squeezy.rb
CHANGED
@@ -13,7 +13,22 @@ module LemonSqueezy
|
|
13
13
|
autoload :Object, "lemon_squeezy/object"
|
14
14
|
|
15
15
|
autoload :StoresResource, "lemon_squeezy/resources/stores"
|
16
|
+
autoload :ProductsResource, "lemon_squeezy/resources/products"
|
17
|
+
autoload :VariantsResource, "lemon_squeezy/resources/variants"
|
18
|
+
autoload :OrdersResource, "lemon_squeezy/resources/orders"
|
19
|
+
autoload :SubscriptionsResource, "lemon_squeezy/resources/subscriptions"
|
20
|
+
autoload :DiscountsResource, "lemon_squeezy/resources/discounts"
|
21
|
+
autoload :LicenseKeysResource, "lemon_squeezy/resources/license_keys"
|
22
|
+
autoload :FilesResource, "lemon_squeezy/resources/files"
|
16
23
|
|
17
24
|
autoload :Store, "lemon_squeezy/objects/store"
|
25
|
+
autoload :Product, "lemon_squeezy/objects/product"
|
26
|
+
autoload :Variant, "lemon_squeezy/objects/variant"
|
27
|
+
autoload :Order, "lemon_squeezy/objects/order"
|
28
|
+
autoload :OrderItem, "lemon_squeezy/objects/order_item"
|
29
|
+
autoload :Subscription, "lemon_squeezy/objects/subscription"
|
30
|
+
autoload :Discount, "lemon_squeezy/objects/discount"
|
31
|
+
autoload :LicenseKey, "lemon_squeezy/objects/license_key"
|
32
|
+
autoload :File, "lemon_squeezy/objects/file"
|
18
33
|
|
19
34
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lemonsqueezy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dean Perry
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -44,9 +44,23 @@ files:
|
|
44
44
|
- lib/lemon_squeezy/collection.rb
|
45
45
|
- lib/lemon_squeezy/error.rb
|
46
46
|
- lib/lemon_squeezy/object.rb
|
47
|
+
- lib/lemon_squeezy/objects/discount.rb
|
48
|
+
- lib/lemon_squeezy/objects/file.rb
|
49
|
+
- lib/lemon_squeezy/objects/license_key.rb
|
50
|
+
- lib/lemon_squeezy/objects/order.rb
|
51
|
+
- lib/lemon_squeezy/objects/order_item.rb
|
52
|
+
- lib/lemon_squeezy/objects/product.rb
|
47
53
|
- lib/lemon_squeezy/objects/store.rb
|
54
|
+
- lib/lemon_squeezy/objects/subscription.rb
|
48
55
|
- lib/lemon_squeezy/resource.rb
|
56
|
+
- lib/lemon_squeezy/resources/discounts.rb
|
57
|
+
- lib/lemon_squeezy/resources/files.rb
|
58
|
+
- lib/lemon_squeezy/resources/license_keys.rb
|
59
|
+
- lib/lemon_squeezy/resources/orders.rb
|
60
|
+
- lib/lemon_squeezy/resources/products.rb
|
49
61
|
- lib/lemon_squeezy/resources/stores.rb
|
62
|
+
- lib/lemon_squeezy/resources/subscriptions.rb
|
63
|
+
- lib/lemon_squeezy/resources/variants.rb
|
50
64
|
- lib/lemon_squeezy/version.rb
|
51
65
|
- lib/lemonsqueezy.rb
|
52
66
|
homepage: https://github.com/deanpcmad/lemonsqueezy
|