monta_api 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/.rubocop.yml +19 -0
- data/.standard.yml +3 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/LICENSE.txt +21 -0
- data/README.md +71 -0
- data/Rakefile +8 -0
- data/lib/monta_api/client.rb +35 -0
- data/lib/monta_api/errors.rb +21 -0
- data/lib/monta_api/object.rb +22 -0
- data/lib/monta_api/objects/return.rb +6 -0
- data/lib/monta_api/objects/return_forecast.rb +6 -0
- data/lib/monta_api/resource.rb +44 -0
- data/lib/monta_api/resources/return_forecast_resource.rb +68 -0
- data/lib/monta_api/resources/return_resource.rb +47 -0
- data/lib/monta_api/version.rb +5 -0
- data/lib/monta_api.rb +18 -0
- data/monta_api.gemspec +44 -0
- data/sig/monta_api.rbs +4 -0
- metadata +166 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5f29ddd2ccb0ab6e30c08d7926b5636906538221e8e4a5e9d8b1960090ac503b
|
4
|
+
data.tar.gz: 2e387dd4fd3e80167ae40097673e4d1e0d25884b726780720cc79300396c084b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a3c4fca085ecea45bd2075c31cf2bc5c302af579af5db3d8aa8cdd98f3176b2c98a50ec538fb403535f0e52e21b6b0f136776c3988161e47b5d2f989bec7a5ed
|
7
|
+
data.tar.gz: 7f8c7c8e94bb1f960faed34154e773c6fe413c4ed8ee4f5e2e8475104af7c018c86af36c95f762e3c4b56f5535026144b5c7243e3ffd5605eb8b2a1e99ef1610
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.6
|
3
|
+
|
4
|
+
Style/StringLiterals:
|
5
|
+
Enabled: true
|
6
|
+
EnforcedStyle: double_quotes
|
7
|
+
|
8
|
+
Style/StringLiteralsInInterpolation:
|
9
|
+
Enabled: true
|
10
|
+
EnforcedStyle: double_quotes
|
11
|
+
|
12
|
+
Layout/LineLength:
|
13
|
+
Max: 120
|
14
|
+
|
15
|
+
Metrics/MethodLength:
|
16
|
+
Enabled: false
|
17
|
+
|
18
|
+
Metrics/BlockLength:
|
19
|
+
Enabled: false
|
data/.standard.yml
ADDED
data/CHANGELOG.md
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
6
|
+
|
7
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
8
|
+
|
9
|
+
## Our Standards
|
10
|
+
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
12
|
+
|
13
|
+
* Demonstrating empathy and kindness toward other people
|
14
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
15
|
+
* Giving and gracefully accepting constructive feedback
|
16
|
+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
17
|
+
* Focusing on what is best not just for us as individuals, but for the overall community
|
18
|
+
|
19
|
+
Examples of unacceptable behavior include:
|
20
|
+
|
21
|
+
* The use of sexualized language or imagery, and sexual attention or
|
22
|
+
advances of any kind
|
23
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
24
|
+
* Public or private harassment
|
25
|
+
* Publishing others' private information, such as a physical or email
|
26
|
+
address, without their explicit permission
|
27
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
28
|
+
professional setting
|
29
|
+
|
30
|
+
## Enforcement Responsibilities
|
31
|
+
|
32
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
33
|
+
|
34
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
35
|
+
|
36
|
+
## Scope
|
37
|
+
|
38
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
39
|
+
|
40
|
+
## Enforcement
|
41
|
+
|
42
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at marcushwz@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
|
43
|
+
|
44
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
45
|
+
|
46
|
+
## Enforcement Guidelines
|
47
|
+
|
48
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
49
|
+
|
50
|
+
### 1. Correction
|
51
|
+
|
52
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
53
|
+
|
54
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
55
|
+
|
56
|
+
### 2. Warning
|
57
|
+
|
58
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
59
|
+
|
60
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
61
|
+
|
62
|
+
### 3. Temporary Ban
|
63
|
+
|
64
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
65
|
+
|
66
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
67
|
+
|
68
|
+
### 4. Permanent Ban
|
69
|
+
|
70
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
71
|
+
|
72
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
73
|
+
|
74
|
+
## Attribution
|
75
|
+
|
76
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
|
77
|
+
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
78
|
+
|
79
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
80
|
+
|
81
|
+
[homepage]: https://www.contributor-covenant.org
|
82
|
+
|
83
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
84
|
+
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2024 Wei Zhe Heng
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
# MontaAPI
|
2
|
+
|
3
|
+
This is a Monta API wrapper gem to perform CRUD actions to the following resources:
|
4
|
+
- ReturnForecast
|
5
|
+
- ReturnLabel
|
6
|
+
- Return
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Add this line to your application's Gemfile:
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
gem 'monta_api'
|
14
|
+
```
|
15
|
+
|
16
|
+
And then execute:
|
17
|
+
|
18
|
+
$ bundle install
|
19
|
+
|
20
|
+
Or install it yourself as:
|
21
|
+
|
22
|
+
$ gem install monta_api
|
23
|
+
|
24
|
+
## Usage
|
25
|
+
|
26
|
+
### Client
|
27
|
+
|
28
|
+
On Monta dashboard, first connect to Monta's REST API and then add a new connection to get your
|
29
|
+
username and password
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
client = MontaAPI::Client.new(username: monta_username, password: monta_password)
|
33
|
+
```
|
34
|
+
|
35
|
+
### Return
|
36
|
+
|
37
|
+
#### 1. Retrieve returns that were updated since a date
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
client.return.where(since: "2024-04-05")
|
41
|
+
|
42
|
+
# => returns an array of MontaAPI::Return objects
|
43
|
+
```
|
44
|
+
|
45
|
+
### Return Forecast
|
46
|
+
|
47
|
+
#### 1. Retrieve a ReturnForecast by code
|
48
|
+
|
49
|
+
```ruby
|
50
|
+
client.return_forecast.find_by(code: "2")
|
51
|
+
|
52
|
+
# => returns a MontaAPI::ReturnForecast object
|
53
|
+
```
|
54
|
+
|
55
|
+
## Development
|
56
|
+
|
57
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
58
|
+
|
59
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
60
|
+
|
61
|
+
## Contributing
|
62
|
+
|
63
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/monta_api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/monta_api/blob/main/CODE_OF_CONDUCT.md).
|
64
|
+
|
65
|
+
## License
|
66
|
+
|
67
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
68
|
+
|
69
|
+
## Code of Conduct
|
70
|
+
|
71
|
+
Everyone interacting in the MontaApi project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/monta_api/blob/main/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "faraday"
|
4
|
+
|
5
|
+
module MontaAPI
|
6
|
+
class Client
|
7
|
+
BASE_URL = "https://api-v6.monta.nl/"
|
8
|
+
|
9
|
+
attr_reader :username, :password, :adapter
|
10
|
+
|
11
|
+
def initialize(username:, password:, adapter: Faraday.default_adapter)
|
12
|
+
@username = username
|
13
|
+
@password = password
|
14
|
+
@adapter = adapter
|
15
|
+
end
|
16
|
+
|
17
|
+
def return
|
18
|
+
ReturnResource.new(self)
|
19
|
+
end
|
20
|
+
|
21
|
+
def return_forecast
|
22
|
+
ReturnForecastResource.new(self)
|
23
|
+
end
|
24
|
+
|
25
|
+
def connection
|
26
|
+
@connection ||= Faraday.new do |conn|
|
27
|
+
conn.url_prefix = BASE_URL
|
28
|
+
conn.request :json
|
29
|
+
conn.response :json, content_type: "application/json"
|
30
|
+
conn.adapter adapter
|
31
|
+
conn.request :authorization, :basic, username, password
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module MontaAPI
|
4
|
+
class Error < StandardError
|
5
|
+
end
|
6
|
+
|
7
|
+
class NotFoundError < Error
|
8
|
+
end
|
9
|
+
|
10
|
+
class WhiteListError < Error
|
11
|
+
end
|
12
|
+
|
13
|
+
class AuthenticationError < Error
|
14
|
+
end
|
15
|
+
|
16
|
+
class ServerError < Error
|
17
|
+
end
|
18
|
+
|
19
|
+
class RateLimitError < Error
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "active_support/core_ext/string"
|
4
|
+
require "ostruct"
|
5
|
+
|
6
|
+
module MontaAPI
|
7
|
+
class Object < OpenStruct
|
8
|
+
def initialize(attributes)
|
9
|
+
super to_ostruct(attributes)
|
10
|
+
end
|
11
|
+
|
12
|
+
def to_ostruct(obj)
|
13
|
+
if obj.is_a?(Hash)
|
14
|
+
OpenStruct.new(obj.map { |key, val| [key.underscore, to_ostruct(val)] }.to_h)
|
15
|
+
elsif obj.is_a?(Array)
|
16
|
+
obj.map { |o| to_ostruct(o) }
|
17
|
+
else # Assumed to be a primitive value
|
18
|
+
obj
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module MontaAPI
|
4
|
+
class Resource
|
5
|
+
attr_reader :client
|
6
|
+
|
7
|
+
def initialize(client)
|
8
|
+
@client = client
|
9
|
+
end
|
10
|
+
|
11
|
+
def get_request(url, params: {}, headers: {})
|
12
|
+
handle_response client.connection.get(url, params, headers)
|
13
|
+
end
|
14
|
+
|
15
|
+
def post_request(url, body:, headers: {})
|
16
|
+
handle_response client.connection.post(url, body, headers)
|
17
|
+
end
|
18
|
+
|
19
|
+
def put_request(url, body:, headers: {})
|
20
|
+
handle_response client.connection.put(url, body, headers)
|
21
|
+
end
|
22
|
+
|
23
|
+
def handle_response(response)
|
24
|
+
error_message = response.body
|
25
|
+
|
26
|
+
case response.status
|
27
|
+
when 400
|
28
|
+
raise Error, "A bad request or a validation exception has occurred. #{error_message}"
|
29
|
+
when 401
|
30
|
+
raise AuthenticationError, "Invalid authorization credentials. #{error_message}"
|
31
|
+
when 403
|
32
|
+
raise WhiteListError, "IP address is not white listed. #{error_message}"
|
33
|
+
when 404
|
34
|
+
raise NotFoundError, "The resource you have specified cannot be found. #{error_message}"
|
35
|
+
when 429
|
36
|
+
raise RateLimitError, "The API rate limit for your application has been exceeded. #{error_message}"
|
37
|
+
when 500
|
38
|
+
raise ServerError, "An unhandled error with the Monta API. #{error_message}"
|
39
|
+
end
|
40
|
+
|
41
|
+
response
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module MontaAPI
|
4
|
+
class ReturnForecastResource < Resource
|
5
|
+
# @client.return_forecast.find_by(code: "2")
|
6
|
+
# Response
|
7
|
+
# {
|
8
|
+
# "Code": "2",
|
9
|
+
# "WebshopOrderId": "1173",
|
10
|
+
# "Lines": [
|
11
|
+
# {
|
12
|
+
# "WebshopOrderLineId": "14638817116463",
|
13
|
+
# "ReturnQuantity": 1,
|
14
|
+
# "ReturnReason": "Incorrect item received",
|
15
|
+
# "RelatieRetourOorzaakId": null,
|
16
|
+
# "RelatieRetourOorzaakParentId": null,
|
17
|
+
# "CustomerComment": ""
|
18
|
+
# }
|
19
|
+
# ],
|
20
|
+
# "CauseDescription": "",
|
21
|
+
# "Comment": "",
|
22
|
+
# "TrackAndTraceCode": null,
|
23
|
+
# "TrackAndTraceLink": null,
|
24
|
+
# "GeneralComment": ""
|
25
|
+
# }
|
26
|
+
def find_by(code:)
|
27
|
+
response_body = get_request("returnforecast/#{code}").body
|
28
|
+
|
29
|
+
ReturnForecast.new(response_body)
|
30
|
+
end
|
31
|
+
|
32
|
+
# @client.return_forecast.create(...)
|
33
|
+
# Response:
|
34
|
+
# {
|
35
|
+
# "Code": "2",
|
36
|
+
# "WebshopOrderId": "1173",
|
37
|
+
# "Lines": [
|
38
|
+
# {
|
39
|
+
# "WebshopOrderLineId": "14638817116463",
|
40
|
+
# "ReturnQuantity": 1,
|
41
|
+
# "ReturnReason": "Incorrect item received",
|
42
|
+
# "RelatieRetourOorzaakId": null,
|
43
|
+
# "RelatieRetourOorzaakParentId": null,
|
44
|
+
# "CustomerComment": null
|
45
|
+
# }
|
46
|
+
# ],
|
47
|
+
# "CauseDescription": null,
|
48
|
+
# "Comment": null,
|
49
|
+
# "TrackAndTraceCode": null,
|
50
|
+
# "TrackAndTraceLink": null,
|
51
|
+
# "GeneralComment": null
|
52
|
+
# }
|
53
|
+
def create
|
54
|
+
# Pending
|
55
|
+
end
|
56
|
+
|
57
|
+
# @client.return_forecast.generate_label(code:)
|
58
|
+
# Response:
|
59
|
+
# {
|
60
|
+
# "EncodedData": "base64 string",
|
61
|
+
# "FileExtension": "pdf",
|
62
|
+
# "TrackAndTraceLink": "https://tracking.dpd.de/parcelstatus?query=05212012021346&locale=nl_NL"
|
63
|
+
# }
|
64
|
+
def generate_label
|
65
|
+
# Pending
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module MontaAPI
|
4
|
+
class ReturnResource < Resource
|
5
|
+
# @client.return.where(since: "2024-04-05", status: "any")
|
6
|
+
# Response:
|
7
|
+
# {
|
8
|
+
# "Returns": [
|
9
|
+
# {
|
10
|
+
# "Id": 3873210,
|
11
|
+
# "CreatedAt": "2024-04-05T08:40:40.327",
|
12
|
+
# "Comment": null,
|
13
|
+
# "Cause": "Ik ben van gedachten veranderd",
|
14
|
+
# "WebshopCause": null,
|
15
|
+
# "WebshopOrderId": "1173",
|
16
|
+
# "Lines": [
|
17
|
+
# {
|
18
|
+
# "WebshopOrderLineId": "14638817116463",
|
19
|
+
# "Sku": "ABC",
|
20
|
+
# "ReturnedQuantity": 1,
|
21
|
+
# "Sellable": true,
|
22
|
+
# "FollowedUpMontapacking": false,
|
23
|
+
# "FollowedUpCustomer": false,
|
24
|
+
# "FollowedUpAction": null,
|
25
|
+
# "Cause": "Ik ben van gedachten veranderd",
|
26
|
+
# "Comment": null,
|
27
|
+
# "BatchCode": null
|
28
|
+
# }
|
29
|
+
# ],
|
30
|
+
# "UpdatedAt": "2024-04-05T08:41:33.81",
|
31
|
+
# "SerialNumbers": [],
|
32
|
+
# "ReturnForecastId": 2361500,
|
33
|
+
# "ForecastCode": "2"
|
34
|
+
# }
|
35
|
+
# ]
|
36
|
+
# }
|
37
|
+
def where(since:, status: "any")
|
38
|
+
response_body = get_request("return/updated_since/#{since}", params: { status: status }).body
|
39
|
+
|
40
|
+
response_body["Returns"].map { |attributes| Return.new(attributes) }
|
41
|
+
end
|
42
|
+
|
43
|
+
def update
|
44
|
+
# Update the follow up actions per Return Line
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/lib/monta_api.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "monta_api/version"
|
4
|
+
require "zeitwerk"
|
5
|
+
|
6
|
+
loader = Zeitwerk::Loader.for_gem
|
7
|
+
loader.inflector.inflect("monta_api" => "MontaAPI")
|
8
|
+
loader.collapse("#{__dir__}/monta_api/objects")
|
9
|
+
loader.collapse("#{__dir__}/monta_api/resources")
|
10
|
+
# Zeitwerk doesn't support multiple classes in a single file
|
11
|
+
# https://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#one-file-one-constant-at-the-same-top-level
|
12
|
+
loader.ignore("#{__dir__}/monta_api/errors.rb")
|
13
|
+
loader.setup
|
14
|
+
|
15
|
+
require "monta_api/errors"
|
16
|
+
|
17
|
+
module MontaAPI
|
18
|
+
end
|
data/monta_api.gemspec
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/monta_api/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "monta_api"
|
7
|
+
spec.version = MontaAPI::VERSION
|
8
|
+
spec.authors = ["Wei Zhe Heng"]
|
9
|
+
spec.email = ["marcus@postco.io"]
|
10
|
+
|
11
|
+
spec.summary = "Monta API Wrapper"
|
12
|
+
spec.homepage = "https://github.com/PostCo/monta_api"
|
13
|
+
spec.license = "MIT"
|
14
|
+
spec.required_ruby_version = ">= 2.6.0"
|
15
|
+
|
16
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org/"
|
17
|
+
|
18
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
19
|
+
spec.metadata["source_code_uri"] = "https://github.com/PostCo/monta_api"
|
20
|
+
spec.metadata["changelog_uri"] = "https://github.com/PostCo/monta_api/releases"
|
21
|
+
|
22
|
+
# Specify which files should be added to the gem when it is released.
|
23
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
24
|
+
spec.files = Dir.chdir(__dir__) do
|
25
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
26
|
+
(File.expand_path(f) == __FILE__) ||
|
27
|
+
f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor Gemfile])
|
28
|
+
end
|
29
|
+
end
|
30
|
+
spec.bindir = "exe"
|
31
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
32
|
+
spec.require_paths = ["lib"]
|
33
|
+
|
34
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
35
|
+
|
36
|
+
spec.add_development_dependency("dotenv", "~> 2.1")
|
37
|
+
spec.add_development_dependency("pry", "~> 0.14.2")
|
38
|
+
spec.add_development_dependency("rubocop", "~> 1.62")
|
39
|
+
spec.add_development_dependency("webmock", "~> 3.23.0")
|
40
|
+
|
41
|
+
spec.add_dependency "activesupport", "~> 7.0"
|
42
|
+
spec.add_dependency "faraday", "~> 2.5"
|
43
|
+
spec.add_dependency "zeitwerk", "~> 2.6"
|
44
|
+
end
|
data/sig/monta_api.rbs
ADDED
metadata
ADDED
@@ -0,0 +1,166 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: monta_api
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.3
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Wei Zhe Heng
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-04-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: dotenv
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.1'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pry
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.14.2
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.14.2
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rubocop
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.62'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.62'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: webmock
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 3.23.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 3.23.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: activesupport
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '7.0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '7.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: faraday
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '2.5'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '2.5'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: zeitwerk
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '2.6'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '2.6'
|
111
|
+
description:
|
112
|
+
email:
|
113
|
+
- marcus@postco.io
|
114
|
+
executables: []
|
115
|
+
extensions: []
|
116
|
+
extra_rdoc_files: []
|
117
|
+
files:
|
118
|
+
- ".rspec"
|
119
|
+
- ".rubocop.yml"
|
120
|
+
- ".standard.yml"
|
121
|
+
- CHANGELOG.md
|
122
|
+
- CODE_OF_CONDUCT.md
|
123
|
+
- LICENSE.txt
|
124
|
+
- README.md
|
125
|
+
- Rakefile
|
126
|
+
- lib/monta_api.rb
|
127
|
+
- lib/monta_api/client.rb
|
128
|
+
- lib/monta_api/errors.rb
|
129
|
+
- lib/monta_api/object.rb
|
130
|
+
- lib/monta_api/objects/return.rb
|
131
|
+
- lib/monta_api/objects/return_forecast.rb
|
132
|
+
- lib/monta_api/resource.rb
|
133
|
+
- lib/monta_api/resources/return_forecast_resource.rb
|
134
|
+
- lib/monta_api/resources/return_resource.rb
|
135
|
+
- lib/monta_api/version.rb
|
136
|
+
- monta_api.gemspec
|
137
|
+
- sig/monta_api.rbs
|
138
|
+
homepage: https://github.com/PostCo/monta_api
|
139
|
+
licenses:
|
140
|
+
- MIT
|
141
|
+
metadata:
|
142
|
+
allowed_push_host: https://rubygems.org/
|
143
|
+
homepage_uri: https://github.com/PostCo/monta_api
|
144
|
+
source_code_uri: https://github.com/PostCo/monta_api
|
145
|
+
changelog_uri: https://github.com/PostCo/monta_api/releases
|
146
|
+
rubygems_mfa_required: 'true'
|
147
|
+
post_install_message:
|
148
|
+
rdoc_options: []
|
149
|
+
require_paths:
|
150
|
+
- lib
|
151
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
152
|
+
requirements:
|
153
|
+
- - ">="
|
154
|
+
- !ruby/object:Gem::Version
|
155
|
+
version: 2.6.0
|
156
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
157
|
+
requirements:
|
158
|
+
- - ">="
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: '0'
|
161
|
+
requirements: []
|
162
|
+
rubygems_version: 3.4.19
|
163
|
+
signing_key:
|
164
|
+
specification_version: 4
|
165
|
+
summary: Monta API Wrapper
|
166
|
+
test_files: []
|