cookie 0.1.0 → 0.2.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 +5 -0
- data/Rakefile +7 -1
- data/Steepfile +10 -0
- data/lib/cookie/client.rb +79 -0
- data/lib/cookie/models/base_response.rb +40 -0
- data/lib/cookie/models/login_response.rb +26 -0
- data/lib/cookie/models/order_response.rb +64 -0
- data/lib/cookie/resources/login.rb +71 -0
- data/lib/cookie/resources/orders.rb +34 -0
- data/lib/cookie/version.rb +1 -1
- data/lib/cookie.rb +12 -1
- data/sig/cookie/client.rbs +32 -0
- data/sig/cookie/models/base_response.rbs +14 -0
- data/sig/cookie/models/login_response.rbs +10 -0
- data/sig/cookie/models/order_response.rbs +36 -0
- data/sig/cookie/resources/login.rbs +15 -0
- data/sig/cookie/resources/orders.rbs +10 -0
- data/sig/gems.rbs +22 -0
- metadata +129 -9
- data/.idea/.gitignore +0 -8
- data/.idea/cookie.iml +0 -81
- data/.idea/git_toolbox_blame.xml +0 -6
- data/.idea/misc.xml +0 -4
- data/.idea/modules.xml +0 -8
- data/.idea/vcs.xml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe7d568d91c50070c8a024724af3820d180005809b7ed2d6882df6077cab23be
|
4
|
+
data.tar.gz: c6c3871e384141147dd00effd66eb5ed3f713b37d1fbfcfaf63d49e27949cfb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5edb7bd4b49d679d0716499964653d11272d46109e03c649e6340cd60800cf0b8606ce8d1ae2154ecc349c43180c36dfc27848f47afec47e9a73f2dc720a94de
|
7
|
+
data.tar.gz: 864c8df0448b00ebd51392594abb89d424d1846eea35048e286c84ae22375be6a125050f135b9a430aee57fe8b6929798efb2a6f0b8948185bbfca2e79715114
|
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
@@ -6,5 +6,11 @@ require "rspec/core/rake_task"
|
|
6
6
|
RSpec::Core::RakeTask.new(:spec)
|
7
7
|
|
8
8
|
require "standard/rake"
|
9
|
+
require "steep/cli"
|
9
10
|
|
10
|
-
|
11
|
+
desc "Run type checks"
|
12
|
+
task :steep do
|
13
|
+
sh "steep check"
|
14
|
+
end
|
15
|
+
|
16
|
+
task default: %i[standard steep spec]
|
data/Steepfile
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
require "faraday"
|
5
|
+
|
6
|
+
module Cookie
|
7
|
+
# Client for interacting with the Digital Cookie API
|
8
|
+
#
|
9
|
+
# @example Authenticate and create a new client
|
10
|
+
# client = Cookie::Client.authenticate(
|
11
|
+
# username: "user@example.com",
|
12
|
+
# credential: "password123"
|
13
|
+
# )
|
14
|
+
#
|
15
|
+
# @example Create a client with an existing token
|
16
|
+
# client = Cookie::Client.new(api_key: "existing_token")
|
17
|
+
class Client
|
18
|
+
BASE_URL = "https://apimobile.digitalcookie.girlscouts.org/mobileapp/api"
|
19
|
+
|
20
|
+
# @return [Symbol] The Faraday adapter being used
|
21
|
+
attr_reader :adapter
|
22
|
+
|
23
|
+
# Authenticate with username and password to create a new client
|
24
|
+
#
|
25
|
+
# @param username [String] Email address for authentication
|
26
|
+
# @param credential [String] Password for authentication
|
27
|
+
# @return [Client] Authenticated client instance
|
28
|
+
# @raise [UnauthorizedError] When credentials are invalid
|
29
|
+
# @raise [ApiError] When the API request fails
|
30
|
+
def self.authenticate(username:, credential:)
|
31
|
+
client = new
|
32
|
+
response = client.login.authenticate(username: username, credential: credential)
|
33
|
+
client.setup_authorization(response.token)
|
34
|
+
client
|
35
|
+
end
|
36
|
+
|
37
|
+
# Initialize a new API client
|
38
|
+
#
|
39
|
+
# @param api_key [String, nil] Bearer token for authentication
|
40
|
+
# @param adapter [Symbol] The Faraday adapter to use
|
41
|
+
# @return [Client] A new client instance
|
42
|
+
def initialize(api_key: nil, adapter: Faraday.default_adapter)
|
43
|
+
@api_key = api_key
|
44
|
+
@adapter = adapter
|
45
|
+
end
|
46
|
+
|
47
|
+
# Set up authorization with a bearer token
|
48
|
+
#
|
49
|
+
# @param token [String] Bearer token for authentication
|
50
|
+
# @return [void]
|
51
|
+
def setup_authorization(token)
|
52
|
+
@api_key = token
|
53
|
+
|
54
|
+
# Reset the connection so it's rebuilt with the new token
|
55
|
+
@connection = nil
|
56
|
+
end
|
57
|
+
|
58
|
+
# @return [Faraday::Connection] The configured HTTP client
|
59
|
+
def connection
|
60
|
+
@connection ||= Faraday.new(url: BASE_URL) do |faraday|
|
61
|
+
faraday.request :json
|
62
|
+
faraday.response :json
|
63
|
+
faraday.adapter adapter
|
64
|
+
faraday.headers["Authorization"] = "Bearer #{@api_key}" if @api_key
|
65
|
+
faraday.headers["Content-Type"] = "application/json"
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# @return [Resources::Login] The login resource
|
70
|
+
def login
|
71
|
+
@login ||= Resources::Login.new(self)
|
72
|
+
end
|
73
|
+
|
74
|
+
# @return [Resources::Orders] The orders resource
|
75
|
+
def orders
|
76
|
+
@orders ||= Resources::Orders.new(self)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cookie
|
4
|
+
module Models
|
5
|
+
# Base class for API responses that provides error checking capabilities
|
6
|
+
#
|
7
|
+
# @abstract Subclass and add attributes specific to the endpoint
|
8
|
+
class BaseResponse
|
9
|
+
# @return [String] The type of response from the API
|
10
|
+
attr_reader :type
|
11
|
+
|
12
|
+
# @return [String, nil] Error code if present
|
13
|
+
attr_reader :error_code
|
14
|
+
|
15
|
+
# @return [String, nil] Error message if present
|
16
|
+
attr_reader :error_message
|
17
|
+
|
18
|
+
# @return [Boolean] Whether the session is expired
|
19
|
+
attr_reader :expired
|
20
|
+
|
21
|
+
# @param attributes [Hash] Raw response attributes from the API
|
22
|
+
def initialize(attributes)
|
23
|
+
@type = attributes["type"]
|
24
|
+
@error_code = attributes["errorCode"]
|
25
|
+
@error_message = attributes["errorMessage"]
|
26
|
+
@expired = attributes["expired"] || false
|
27
|
+
end
|
28
|
+
|
29
|
+
# @return [Boolean] Whether the response contains an error
|
30
|
+
def error?
|
31
|
+
!!(error_code && !error_code.empty?)
|
32
|
+
end
|
33
|
+
|
34
|
+
# @return [Boolean] Whether the error is an authentication error
|
35
|
+
def authentication_error?
|
36
|
+
error? && error_code == "500"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cookie
|
4
|
+
module Models
|
5
|
+
# Response from the login endpoint containing authentication details
|
6
|
+
#
|
7
|
+
# @example
|
8
|
+
# response = login.authenticate(username: "user@example.com", credential: "password")
|
9
|
+
# puts response.token # => "abc123"
|
10
|
+
# puts response.expired_in # => 43050
|
11
|
+
class LoginResponse < BaseResponse
|
12
|
+
# @return [String] The authentication token for API requests
|
13
|
+
attr_reader :token
|
14
|
+
|
15
|
+
# @return [Integer] Time in seconds until the token expires
|
16
|
+
attr_reader :expired_in
|
17
|
+
|
18
|
+
# @param attributes [Hash] Raw response attributes from the API
|
19
|
+
def initialize(attributes)
|
20
|
+
super
|
21
|
+
@token = attributes["token"]
|
22
|
+
@expired_in = attributes["expiredIn"]
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cookie
|
4
|
+
module Models
|
5
|
+
# Response containing order information and details
|
6
|
+
#
|
7
|
+
# @example
|
8
|
+
# orders = client.orders.get_hand_delivery("12345")
|
9
|
+
# puts orders.total_order_count # => 119
|
10
|
+
# puts orders.orders.first.order_number # => "132747574"
|
11
|
+
class OrderResponse < BaseResponse
|
12
|
+
attr_reader :can_view_details, :total_order_count, :orders
|
13
|
+
|
14
|
+
def initialize(attributes)
|
15
|
+
super
|
16
|
+
@can_view_details = attributes["canViewDetails"]
|
17
|
+
@total_order_count = attributes["totalOrderCount"]
|
18
|
+
@orders = (attributes["orders"] || []).map { |order| Order.new(order) }
|
19
|
+
end
|
20
|
+
|
21
|
+
# Individual order details including purchase and payment information
|
22
|
+
#
|
23
|
+
# @example
|
24
|
+
# order = orders.orders.first
|
25
|
+
# puts order.order_number # => "132747574"
|
26
|
+
# puts order.number_purchased # => 2
|
27
|
+
class Order
|
28
|
+
attr_reader :date_actioned, :number_purchased, :order_number,
|
29
|
+
:order_time_display, :payment_address, :sales_application
|
30
|
+
|
31
|
+
def initialize(attributes)
|
32
|
+
@date_actioned = attributes["dateActioned"]
|
33
|
+
@number_purchased = attributes["numberPurchased"]
|
34
|
+
@order_number = attributes["orderNumber"]
|
35
|
+
@order_time_display = attributes["orderTimeDisplay"]
|
36
|
+
@payment_address = PaymentAddress.new(attributes["paymentAddress"])
|
37
|
+
@sales_application = attributes["salesApplication"]
|
38
|
+
end
|
39
|
+
|
40
|
+
# Payment and shipping address details for an order
|
41
|
+
#
|
42
|
+
# @example
|
43
|
+
# address = order.payment_address
|
44
|
+
# puts address.email # => "user@example.com"
|
45
|
+
class PaymentAddress
|
46
|
+
attr_reader :address_line1, :address_line2, :address_line3, :email,
|
47
|
+
:first_name, :last_name, :phone_number, :town, :zip_code
|
48
|
+
|
49
|
+
def initialize(attributes)
|
50
|
+
@address_line1 = attributes["addressLine1"]
|
51
|
+
@address_line2 = attributes["addressLine2"]
|
52
|
+
@address_line3 = attributes["addressLine3"]
|
53
|
+
@email = attributes["email"]
|
54
|
+
@first_name = attributes["firstName"]
|
55
|
+
@last_name = attributes["lastName"]
|
56
|
+
@phone_number = attributes["phoneNumber"]
|
57
|
+
@town = attributes["town"]
|
58
|
+
@zip_code = attributes["zipCode"]
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
|
5
|
+
module Cookie
|
6
|
+
module Resources
|
7
|
+
# Handles authentication with the Digital Cookie API
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# client = Cookie::Client.new(api_key: "your_key")
|
11
|
+
# response = client.login.authenticate(
|
12
|
+
# username: "user@example.com",
|
13
|
+
# credential: "password123"
|
14
|
+
# )
|
15
|
+
# puts response.token
|
16
|
+
#
|
17
|
+
# @api public
|
18
|
+
class Login
|
19
|
+
# @return [Cookie::Client] The configured API client
|
20
|
+
attr_reader :client
|
21
|
+
|
22
|
+
# Initialize a new login resource
|
23
|
+
#
|
24
|
+
# @param client [Cookie::Client] The configured API client
|
25
|
+
# @return [Login] A new instance of Login
|
26
|
+
def initialize(client)
|
27
|
+
@client = client
|
28
|
+
end
|
29
|
+
|
30
|
+
# Authenticate with the Digital Cookie API
|
31
|
+
#
|
32
|
+
# @param username [String] The user's email address
|
33
|
+
# @param credential [String] The user's password
|
34
|
+
# @return [Models::LoginResponse] The response containing authentication tokens
|
35
|
+
#
|
36
|
+
# @example
|
37
|
+
# login.authenticate(
|
38
|
+
# username: "user@example.com",
|
39
|
+
# credential: "password123"
|
40
|
+
# )
|
41
|
+
def authenticate(username:, credential:)
|
42
|
+
response = @client.connection.post(
|
43
|
+
"login",
|
44
|
+
build_request_body(username, credential)
|
45
|
+
)
|
46
|
+
|
47
|
+
login_response = Models::LoginResponse.new(response.body)
|
48
|
+
|
49
|
+
if login_response.authentication_error?
|
50
|
+
raise UnauthorizedError, login_response.error_message
|
51
|
+
elsif login_response.error?
|
52
|
+
raise ApiError, login_response.error_message
|
53
|
+
end
|
54
|
+
|
55
|
+
login_response
|
56
|
+
rescue Faraday::Error => e
|
57
|
+
raise ApiError, "Request failed: #{e.message}"
|
58
|
+
end
|
59
|
+
|
60
|
+
private
|
61
|
+
|
62
|
+
def build_request_body(username, credential)
|
63
|
+
JSON.generate({
|
64
|
+
uid: username,
|
65
|
+
credential: credential,
|
66
|
+
client: "gsa_mobile_iOS"
|
67
|
+
})
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cookie
|
4
|
+
module Resources
|
5
|
+
# Handles order-related operations with the Digital Cookie API
|
6
|
+
#
|
7
|
+
# @example
|
8
|
+
# client = Cookie::Client.new(api_key: "your_key")
|
9
|
+
# orders = client.orders.get_hand_delivery("12345")
|
10
|
+
# puts orders.total_order_count
|
11
|
+
#
|
12
|
+
# @api public
|
13
|
+
class Orders
|
14
|
+
attr_reader :client
|
15
|
+
|
16
|
+
def initialize(client)
|
17
|
+
@client = client
|
18
|
+
end
|
19
|
+
|
20
|
+
def get_hand_delivery(troop_id)
|
21
|
+
response = @client.connection.get("getAllOrders/hand-delivery/#{troop_id}")
|
22
|
+
order_response = Models::OrderResponse.new(response.body)
|
23
|
+
|
24
|
+
if order_response.error?
|
25
|
+
raise ApiError, order_response.error_message
|
26
|
+
end
|
27
|
+
|
28
|
+
order_response
|
29
|
+
rescue Faraday::Error => e
|
30
|
+
raise ApiError, "Request failed: #{e.message}"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/lib/cookie/version.rb
CHANGED
data/lib/cookie.rb
CHANGED
@@ -1,8 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative "cookie/client"
|
4
|
+
require_relative "cookie/models/base_response"
|
5
|
+
require_relative "cookie/models/login_response"
|
6
|
+
require_relative "cookie/models/order_response"
|
7
|
+
require_relative "cookie/resources/login"
|
8
|
+
require_relative "cookie/resources/orders"
|
3
9
|
require_relative "cookie/version"
|
4
10
|
|
5
11
|
module Cookie
|
6
12
|
class Error < StandardError; end
|
7
|
-
|
13
|
+
|
14
|
+
class UnauthorizedError < Error; end
|
15
|
+
|
16
|
+
class AuthenticationError < Error; end
|
17
|
+
|
18
|
+
class ApiError < Error; end
|
8
19
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Cookie
|
2
|
+
class Error < StandardError
|
3
|
+
end
|
4
|
+
|
5
|
+
class UnauthorizedError < Error
|
6
|
+
end
|
7
|
+
|
8
|
+
class AuthenticationError < Error
|
9
|
+
end
|
10
|
+
|
11
|
+
class ApiError < Error
|
12
|
+
end
|
13
|
+
|
14
|
+
class Client
|
15
|
+
BASE_URL: String
|
16
|
+
|
17
|
+
@api_key: String?
|
18
|
+
@connection: Faraday::Connection?
|
19
|
+
@login: Resources::Login?
|
20
|
+
@orders: Resources::Orders?
|
21
|
+
|
22
|
+
attr_reader adapter: Symbol
|
23
|
+
|
24
|
+
def self.authenticate: (username: String, credential: String) -> Client
|
25
|
+
def initialize: (?api_key: String?, ?adapter: Symbol) -> void
|
26
|
+
def setup_authorization: (String) -> void
|
27
|
+
def connection: () -> Faraday::Connection
|
28
|
+
|
29
|
+
def login: () -> Resources::Login
|
30
|
+
def orders: () -> Resources::Orders
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Cookie
|
2
|
+
module Models
|
3
|
+
class BaseResponse
|
4
|
+
attr_reader type: String
|
5
|
+
attr_reader error_code: String?
|
6
|
+
attr_reader error_message: String?
|
7
|
+
attr_reader expired: bool
|
8
|
+
|
9
|
+
def initialize: (Hash[String, untyped] attributes) -> void
|
10
|
+
def error?: -> bool
|
11
|
+
def authentication_error?: -> bool
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Cookie
|
2
|
+
module Models
|
3
|
+
class OrderResponse < BaseResponse
|
4
|
+
attr_reader can_view_details: bool
|
5
|
+
attr_reader total_order_count: Integer
|
6
|
+
attr_reader orders: Array[Order]
|
7
|
+
|
8
|
+
def initialize: (Hash[String, untyped]) -> void
|
9
|
+
|
10
|
+
class Order
|
11
|
+
attr_reader date_actioned: String
|
12
|
+
attr_reader number_purchased: Integer
|
13
|
+
attr_reader order_number: String
|
14
|
+
attr_reader order_time_display: String
|
15
|
+
attr_reader payment_address: PaymentAddress
|
16
|
+
attr_reader sales_application: String
|
17
|
+
|
18
|
+
def initialize: (Hash[String, untyped]) -> void
|
19
|
+
|
20
|
+
class PaymentAddress
|
21
|
+
attr_reader address_line1: String
|
22
|
+
attr_reader address_line2: String
|
23
|
+
attr_reader address_line3: String
|
24
|
+
attr_reader email: String
|
25
|
+
attr_reader first_name: String
|
26
|
+
attr_reader last_name: String
|
27
|
+
attr_reader phone_number: String
|
28
|
+
attr_reader town: String
|
29
|
+
attr_reader zip_code: String
|
30
|
+
|
31
|
+
def initialize: (Hash[String, untyped]) -> void
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Cookie
|
2
|
+
module Resources
|
3
|
+
class Login
|
4
|
+
attr_reader client: Cookie::Client
|
5
|
+
|
6
|
+
def initialize: (Cookie::Client client) -> void
|
7
|
+
|
8
|
+
def authenticate: (username: String, credential: String) -> Models::LoginResponse
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def build_request_body: (String username, String credential) -> String
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/sig/gems.rbs
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
class Faraday
|
2
|
+
class Connection
|
3
|
+
def initialize: (?url: String?) ?{ (Connection) -> void } -> void
|
4
|
+
def get: (String) -> Response
|
5
|
+
def post: (String, String) -> Response
|
6
|
+
def headers: () -> Hash[String, String]
|
7
|
+
def request: (Symbol name) -> void
|
8
|
+
def response: (Symbol name) -> void
|
9
|
+
def adapter: (Symbol adapter) -> void
|
10
|
+
end
|
11
|
+
|
12
|
+
class Response
|
13
|
+
attr_reader body: Hash[String, String]
|
14
|
+
attr_reader status: Integer
|
15
|
+
end
|
16
|
+
|
17
|
+
class Error < StandardError
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.new: (?url: String?) ?{ (Connection) -> void } -> Connection
|
21
|
+
def self.default_adapter: () -> Symbol
|
22
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cookie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Morton
|
@@ -9,8 +9,120 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2025-02-
|
13
|
-
dependencies:
|
12
|
+
date: 2025-02-12 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: faraday
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '2.12'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '2.12'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: json
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '2.9'
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '2.9'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: rake
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - "~>"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '13.0'
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - "~>"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '13.0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: rbs
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '3.4'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '3.4'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rspec
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - "~>"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '3.12'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - "~>"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '3.12'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: standard
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - "~>"
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '1.3'
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - "~>"
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '1.3'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: steep
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - "~>"
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '1.9'
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - "~>"
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '1.9'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: webmock
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - "~>"
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '3.25'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - "~>"
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '3.25'
|
14
126
|
description: Digital Cookie is the official platform for managing sales of Girl Scout
|
15
127
|
cookies. This client provides an excellent way to teach Girl Scouts about programming
|
16
128
|
in a domain they are familiar with.
|
@@ -20,12 +132,6 @@ executables: []
|
|
20
132
|
extensions: []
|
21
133
|
extra_rdoc_files: []
|
22
134
|
files:
|
23
|
-
- ".idea/.gitignore"
|
24
|
-
- ".idea/cookie.iml"
|
25
|
-
- ".idea/git_toolbox_blame.xml"
|
26
|
-
- ".idea/misc.xml"
|
27
|
-
- ".idea/modules.xml"
|
28
|
-
- ".idea/vcs.xml"
|
29
135
|
- ".rspec"
|
30
136
|
- ".standard.yml"
|
31
137
|
- CHANGELOG.md
|
@@ -33,9 +139,23 @@ files:
|
|
33
139
|
- LICENSE.txt
|
34
140
|
- README.md
|
35
141
|
- Rakefile
|
142
|
+
- Steepfile
|
36
143
|
- lib/cookie.rb
|
144
|
+
- lib/cookie/client.rb
|
145
|
+
- lib/cookie/models/base_response.rb
|
146
|
+
- lib/cookie/models/login_response.rb
|
147
|
+
- lib/cookie/models/order_response.rb
|
148
|
+
- lib/cookie/resources/login.rb
|
149
|
+
- lib/cookie/resources/orders.rb
|
37
150
|
- lib/cookie/version.rb
|
38
151
|
- sig/cookie.rbs
|
152
|
+
- sig/cookie/client.rbs
|
153
|
+
- sig/cookie/models/base_response.rbs
|
154
|
+
- sig/cookie/models/login_response.rbs
|
155
|
+
- sig/cookie/models/order_response.rbs
|
156
|
+
- sig/cookie/resources/login.rbs
|
157
|
+
- sig/cookie/resources/orders.rbs
|
158
|
+
- sig/gems.rbs
|
39
159
|
homepage: https://github.com/bmorton/cookie
|
40
160
|
licenses:
|
41
161
|
- MIT
|
data/.idea/.gitignore
DELETED
data/.idea/cookie.iml
DELETED
@@ -1,81 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<module type="RUBY_MODULE" version="4">
|
3
|
-
<component name="ModuleRunConfigurationManager">
|
4
|
-
<shared />
|
5
|
-
</component>
|
6
|
-
<component name="NewModuleRootManager">
|
7
|
-
<content url="file://$MODULE_DIR$">
|
8
|
-
<sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
|
9
|
-
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
10
|
-
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
11
|
-
</content>
|
12
|
-
<orderEntry type="inheritedJdk" />
|
13
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
14
|
-
<orderEntry type="library" scope="PROVIDED" name="ast (v2.4.2, asdf: 3.3.6) [gem]" level="application" />
|
15
|
-
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.5.22, asdf: 3.3.6) [gem]" level="application" />
|
16
|
-
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.5.1, asdf: 3.3.6) [gem]" level="application" />
|
17
|
-
<orderEntry type="library" scope="PROVIDED" name="json (v2.9.1, asdf: 3.3.6) [gem]" level="application" />
|
18
|
-
<orderEntry type="library" scope="PROVIDED" name="language_server-protocol (v3.17.0.4, asdf: 3.3.6) [gem]" level="application" />
|
19
|
-
<orderEntry type="library" scope="PROVIDED" name="lint_roller (v1.1.0, asdf: 3.3.6) [gem]" level="application" />
|
20
|
-
<orderEntry type="library" scope="PROVIDED" name="parallel (v1.26.3, asdf: 3.3.6) [gem]" level="application" />
|
21
|
-
<orderEntry type="library" scope="PROVIDED" name="parser (v3.3.7.1, asdf: 3.3.6) [gem]" level="application" />
|
22
|
-
<orderEntry type="library" scope="PROVIDED" name="racc (v1.8.1, asdf: 3.3.6) [gem]" level="application" />
|
23
|
-
<orderEntry type="library" scope="PROVIDED" name="rainbow (v3.1.1, asdf: 3.3.6) [gem]" level="application" />
|
24
|
-
<orderEntry type="library" scope="PROVIDED" name="rake (v13.2.1, asdf: 3.3.6) [gem]" level="application" />
|
25
|
-
<orderEntry type="library" scope="PROVIDED" name="regexp_parser (v2.10.0, asdf: 3.3.6) [gem]" level="application" />
|
26
|
-
<orderEntry type="library" scope="PROVIDED" name="rspec (v3.13.0, asdf: 3.3.6) [gem]" level="application" />
|
27
|
-
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.13.3, asdf: 3.3.6) [gem]" level="application" />
|
28
|
-
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.13.3, asdf: 3.3.6) [gem]" level="application" />
|
29
|
-
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.13.2, asdf: 3.3.6) [gem]" level="application" />
|
30
|
-
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.13.2, asdf: 3.3.6) [gem]" level="application" />
|
31
|
-
<orderEntry type="library" scope="PROVIDED" name="rubocop (v1.70.0, asdf: 3.3.6) [gem]" level="application" />
|
32
|
-
<orderEntry type="library" scope="PROVIDED" name="rubocop-ast (v1.38.0, asdf: 3.3.6) [gem]" level="application" />
|
33
|
-
<orderEntry type="library" scope="PROVIDED" name="rubocop-performance (v1.23.1, asdf: 3.3.6) [gem]" level="application" />
|
34
|
-
<orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.13.0, asdf: 3.3.6) [gem]" level="application" />
|
35
|
-
<orderEntry type="library" scope="PROVIDED" name="standard (v1.44.0, asdf: 3.3.6) [gem]" level="application" />
|
36
|
-
<orderEntry type="library" scope="PROVIDED" name="standard-custom (v1.0.2, asdf: 3.3.6) [gem]" level="application" />
|
37
|
-
<orderEntry type="library" scope="PROVIDED" name="standard-performance (v1.6.0, asdf: 3.3.6) [gem]" level="application" />
|
38
|
-
<orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v3.1.4, asdf: 3.3.6) [gem]" level="application" />
|
39
|
-
<orderEntry type="library" scope="PROVIDED" name="unicode-emoji (v4.0.4, asdf: 3.3.6) [gem]" level="application" />
|
40
|
-
</component>
|
41
|
-
<component name="RakeTasksCache-v2">
|
42
|
-
<option name="myRootTask">
|
43
|
-
<RakeTaskImpl id="rake">
|
44
|
-
<subtasks>
|
45
|
-
<RakeTaskImpl description="Build cookie-0.1.0.gem into the pkg directory" fullCommand="build" id="build" />
|
46
|
-
<RakeTaskImpl id="build">
|
47
|
-
<subtasks>
|
48
|
-
<RakeTaskImpl description="Generate SHA512 checksum of cookie-0.1.0.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
|
49
|
-
</subtasks>
|
50
|
-
</RakeTaskImpl>
|
51
|
-
<RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
|
52
|
-
<RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
|
53
|
-
<RakeTaskImpl description="Build and install cookie-0.1.0.gem into system gems" fullCommand="install" id="install" />
|
54
|
-
<RakeTaskImpl id="install">
|
55
|
-
<subtasks>
|
56
|
-
<RakeTaskImpl description="Build and install cookie-0.1.0.gem into system gems without network access" fullCommand="install:local" id="local" />
|
57
|
-
</subtasks>
|
58
|
-
</RakeTaskImpl>
|
59
|
-
<RakeTaskImpl description="Create tag v0.1.0 and build and push cookie-0.1.0.gem to TODO: Set to your gem server 'https://example.com'" fullCommand="release[remote]" id="release[remote]" />
|
60
|
-
<RakeTaskImpl description="Run RSpec code examples" fullCommand="spec" id="spec" />
|
61
|
-
<RakeTaskImpl description="Lint with the Standard Ruby style guide" fullCommand="standard" id="standard" />
|
62
|
-
<RakeTaskImpl id="standard">
|
63
|
-
<subtasks>
|
64
|
-
<RakeTaskImpl description="Lint and automatically make safe fixes with the Standard Ruby style guide" fullCommand="standard:fix" id="fix" />
|
65
|
-
<RakeTaskImpl description="Lint and automatically make fixes (even unsafe ones" fullCommand="standard:fix_unsafely" id="fix_unsafely" />
|
66
|
-
</subtasks>
|
67
|
-
</RakeTaskImpl>
|
68
|
-
<RakeTaskImpl description="" fullCommand="default" id="default" />
|
69
|
-
<RakeTaskImpl description="" fullCommand="release" id="release" />
|
70
|
-
<RakeTaskImpl id="release">
|
71
|
-
<subtasks>
|
72
|
-
<RakeTaskImpl description="" fullCommand="release:guard_clean" id="guard_clean" />
|
73
|
-
<RakeTaskImpl description="" fullCommand="release:rubygem_push" id="rubygem_push" />
|
74
|
-
<RakeTaskImpl description="" fullCommand="release:source_control_push" id="source_control_push" />
|
75
|
-
</subtasks>
|
76
|
-
</RakeTaskImpl>
|
77
|
-
</subtasks>
|
78
|
-
</RakeTaskImpl>
|
79
|
-
</option>
|
80
|
-
</component>
|
81
|
-
</module>
|
data/.idea/git_toolbox_blame.xml
DELETED
data/.idea/misc.xml
DELETED
data/.idea/modules.xml
DELETED